Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/plugins/.setup/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"packageName": "@magmacomputing/tempo-plugin-batch",
"plan": "community",
"status": "active",
"version": "1.0.2"
"version": "1.1.0"
},
{
"id": "finance",
Expand Down Expand Up @@ -60,7 +60,7 @@
"packageName": "@magmacomputing/tempo-plugin-ai",
"plan": "community",
"status": "active",
"version": "1.2.1"
"version": "2.0.0"
},
{
"id": "ticker",
Expand All @@ -78,7 +78,7 @@
"packageName": "@magmacomputing/tempo-plugin-geo",
"plan": "community",
"status": "active",
"version": "0.1.0"
"version": "1.0.0"
},
{
"id": "_std",
Expand Down
12 changes: 7 additions & 5 deletions packages/plugins/ai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ All notable changes to the `@magmacomputing/tempo-plugin-ai` project will be doc
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.1] - 2026-09-07
## [2.0.0] - 2026-09-08

### Security & Reliability
### Breaking Changes & Major Release
- **Standardized on Tempo v4.1.0+ Community Core**:
- Requires `@magmacomputing/tempo` `^4.1.0`.
- Migrated configuration discovery to the dedicated `pluginOptions.ai` configuration slot introduced in Tempo v4.1.0, deprecating legacy `plugins.ai` dictionary passing.
- **Self-Contained Network Transport (`fetch.ts`)**:
- Decoupled network request utilities from `@magmacomputing/tempo/library` into a self-contained local transport helper.
- Added chunk-by-chunk stream consumption via `res.body.getReader()` with proactive byte accounting and immediate reader cancellation (`await reader.cancel()`).
- Enforced upfront `Content-Length` checks against `maxBytes` and strictly bounded stream reads to prevent unbounded memory allocation and OS thread starvation.
- Decoupled network transport entirely from `@magmacomputing/tempo/library` (removing reliance on core internal `HttpError` and `fetchRequest`).
- Implemented proactive stream consumption via `res.body.getReader()` with strict byte accounting and upfront `Content-Length` enforcement against `maxBytes` to prevent memory exhaustion.

## [1.2.0] - 2026-09-06

Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/tempo-plugin-ai",
"version": "1.2.1",
"version": "2.0.0",
"description": "Tempo community plugin for LLM-powered natural language parsing.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions packages/plugins/batch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to the `@magmacomputing/tempo-plugin-batch` project will be documented in this file.

## [1.1.0] - 2026-09-08

### Added & Enhanced
- **Worker Thread Runtime Flag Inheritance (`execArgv`)**:
- Configured `BatchOrchestrator` to forward `process.execArgv` to spawned worker threads.
- Workers automatically inherit native runtime flags (such as `--harmony-temporal`) or custom loader configurations (`--import`) without bundling or depending on a polyfill, strictly preserving Tempo's zero-dependency, native-first Temporal philosophy.
- **Shorthand Mutation Parsing**:
- Added support for relative duration shorthand strings (e.g. `+1d`, `+1w`, `+1h`, `+1m`) alongside `{ Term: Value }` mutation objects.

## [1.0.2] - 2026-08-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/batch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/tempo-plugin-batch",
"version": "1.0.2",
"version": "1.1.0",
"description": "Tempo community plugin bringing C-level parallelization to massive date arrays via SharedArrayBuffer and Worker Threads.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
20 changes: 14 additions & 6 deletions packages/plugins/batch/src/BatchOrchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ export class BatchOrchestrator {
if (epochs.length === 0) return [];

if (options.threads !== undefined) {
if (!Number.isInteger(options.threads) || options.threads <= 0) {
if (!Number.isInteger(options.threads) || options.threads <= 0)
throw new Error("options.threads must be a positive integer");
}
}

const threadCount = options.threads ?? os.cpus().length;
Expand Down Expand Up @@ -82,6 +81,10 @@ export class BatchOrchestrator {
const workers: Promise<void>[] = [];
const actualThreads = Math.min(threadCount, Math.ceil(epochs.length / chunkSize));

const execArgv = (process.execArgv || []).filter(
arg => !arg.startsWith('--input-type') && !arg.startsWith('--eval') && !arg.startsWith('-e') && !arg.startsWith('--print') && !arg.startsWith('-p')
);
Comment thread
magmacomputing marked this conversation as resolved.
Outdated

for (let i = 0; i < actualThreads; i++) {
const startIdx = i * chunkSize;
const endIdx = Math.min((i + 1) * chunkSize, epochs.length);
Expand All @@ -94,8 +97,9 @@ export class BatchOrchestrator {
outputBuffer,
startIdx,
endIdx,
operation
}
operation,
},
execArgv,
});
worker.on('message', (msg: any) => {
if (msg.status === 'done') resolve();
Expand Down Expand Up @@ -135,6 +139,9 @@ export class BatchOrchestrator {
private static async _transformWithPostMessage(epochs: number[], operation: string, threadCount: number, chunkSize: number, options: BatchOptions): Promise<any[]> {
const workers: Promise<any[]>[] = [];
const actualThreads = Math.min(threadCount, Math.ceil(epochs.length / chunkSize));
const execArgv = (process.execArgv || []).filter(
arg => !arg.startsWith('--input-type') && !arg.startsWith('--eval') && !arg.startsWith('-e') && !arg.startsWith('--print') && !arg.startsWith('-p')
);

for (let i = 0; i < actualThreads; i++) {
const startIdx = i * chunkSize;
Expand All @@ -146,8 +153,9 @@ export class BatchOrchestrator {
workerData: {
mode: 'postMessage',
chunk,
operation
}
operation,
},
execArgv,
});
worker.on('message', (msg: any) => {
if (msg.status === 'done') resolve(msg.result);
Expand Down
31 changes: 26 additions & 5 deletions packages/plugins/batch/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
import { workerData, parentPort } from 'node:worker_threads';
import { Tempo } from '@magmacomputing/tempo';

function applyMutation(t: any, op: any) {
if (typeof op === 'string') {
const match = op.trim().match(/^([+-]?\d+)\s*([a-zA-Z]+)$/);
if (match) {
const count = parseInt(match[1], 10);
const unit = match[2].toLowerCase();
const unitMap: Record<string, string> = {
d: 'days', day: 'days', days: 'days',
w: 'weeks', week: 'weeks', weeks: 'weeks',
m: 'minutes', min: 'minutes', mins: 'minutes', minute: 'minutes', minutes: 'minutes',
h: 'hours', hr: 'hours', hrs: 'hours', hour: 'hours', hours: 'hours',
s: 'seconds', sec: 'seconds', secs: 'seconds', second: 'seconds', seconds: 'seconds',
mo: 'months', month: 'months', months: 'months',
y: 'years', yr: 'years', yrs: 'years', year: 'years', years: 'years'
};
const mappedUnit = unitMap[unit];
if (mappedUnit) {
return t.add({ [mappedUnit]: count });
}
}
}
return t.add(op);
}

async function run() {
if (!parentPort) return;

Expand All @@ -14,11 +38,8 @@ async function run() {

for (let i = startIdx; i < endIdx; i++) {
const epoch = inputView[i];
// Using Tempo to mutate. In a full implementation, we'd have robust parsing of the 'operation' string.
// For this prototype, we assume the operation is an add operation (e.g. "+1w").
// We get the mutated epoch number and put it back into the buffer.
const t = new Tempo(epoch);
const resultT = t.add(operation);
const resultT = applyMutation(t, operation);
outputView[i] = resultT.epoch.ms;
}
parentPort.postMessage({ status: 'done' });
Expand All @@ -30,7 +51,7 @@ async function run() {
for (let i = 0; i < chunk.length; i++) {
const epoch = chunk[i];
const t = new Tempo(epoch);
const resultT = t.add(operation);
const resultT = applyMutation(t, operation);
result[i] = resultT.epoch.ms;
}

Expand Down
7 changes: 7 additions & 0 deletions packages/plugins/geo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to the `@magmacomputing/tempo-plugin-geo` project will be do
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2026-09-07

### Added
- **Stable Community Release**:
- Official 1.0.0 release of `@magmacomputing/tempo-plugin-geo`.
- Configured npm Trusted Publisher automation for CI/CD publishing.

## [0.1.0] - 2026-09-07

### Added
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/geo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/tempo-plugin-geo",
"version": "0.1.0",
"version": "1.0.0",
"description": "Tempo community plugin for IP geolocation lookup, browser hardware location services, and coordinate resolution.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -53,4 +53,4 @@
"default": "./dist/index.js"
}
}
}
}
2 changes: 1 addition & 1 deletion packages/tempo/.vitepress/theme/data/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"packageName": "@magmacomputing/tempo-plugin-geo",
"plan": "community",
"status": "active",
"version": "0.1.0"
"version": "1.0.0"
},
{
"id": "_std",
Expand Down
Loading