@cnwenf/occ 2.1.266 → 2.1.267
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.267","BUILD_TIME":"2026-07-10T11:27:59.433Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -583530,13 +583530,13 @@ You MUST call the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool exactly once at the end of
|
|
|
583530
583530
|
};
|
|
583531
583531
|
const parallel = async (items) => {
|
|
583532
583532
|
if (!Array.isArray(items)) {
|
|
583533
|
-
throw new Error("parallel() requires an array of thunks");
|
|
583533
|
+
throw new Error("parallel() requires an array of thunks or promises");
|
|
583534
583534
|
}
|
|
583535
583535
|
if (items.length > WORKFLOW_PARALLEL_MAX_ITEMS) {
|
|
583536
583536
|
throw new Error(`parallel() accepts at most ${WORKFLOW_PARALLEL_MAX_ITEMS} items; ` + `got ${items.length}`);
|
|
583537
583537
|
}
|
|
583538
583538
|
const sem = createSemaphore(concurrency);
|
|
583539
|
-
const settled = await Promise.allSettled(items.map((
|
|
583539
|
+
const settled = await Promise.allSettled(items.map((item) => sem(() => typeof item === "function" ? item() : item)));
|
|
583540
583540
|
const results = [];
|
|
583541
583541
|
let budgetHits = 0;
|
|
583542
583542
|
for (const s4 of settled) {
|
|
@@ -583604,7 +583604,7 @@ You MUST call the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool exactly once at the end of
|
|
|
583604
583604
|
}
|
|
583605
583605
|
return results;
|
|
583606
583606
|
};
|
|
583607
|
-
const phase = (title) => {
|
|
583607
|
+
const phase = (title, fn) => {
|
|
583608
583608
|
if (typeof title !== "string") {
|
|
583609
583609
|
throw new Error("phase() requires a string title");
|
|
583610
583610
|
}
|
|
@@ -583625,6 +583625,9 @@ You MUST call the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool exactly once at the end of
|
|
|
583625
583625
|
phase: title,
|
|
583626
583626
|
agentCount: ctx.counters.agentCount
|
|
583627
583627
|
});
|
|
583628
|
+
if (typeof fn === "function") {
|
|
583629
|
+
return Promise.resolve(fn());
|
|
583630
|
+
}
|
|
583628
583631
|
};
|
|
583629
583632
|
const log3 = (...args) => {
|
|
583630
583633
|
const msg = args.map((a6) => typeof a6 === "string" ? a6 : JSON.stringify(a6)).join(" ");
|
|
@@ -584376,7 +584379,7 @@ function buildWorkflowProgressHandler(runId, seedPhases, emit2, onAgentEvent) {
|
|
|
584376
584379
|
});
|
|
584377
584380
|
};
|
|
584378
584381
|
}
|
|
584379
|
-
var import_react83, inputSchema41, outputSchema37, DESCRIPTION22 = `Run a multi-step workflow from a self-contained JavaScript script. The script runs in a sandboxed vm with access to primitives: agent(prompt, opts?) to spawn a subagent, parallel(items) for concurrent execution (max 4096 items, ~10 concurrent), pipeline(items, ...stages) for streaming, phase(title) to group agents, log(...args) for workflow-scoped logging, budget {total, remaining(), spent()} for token caps, and workflow(nameOrRef) / resolveWorkflow(name) for sub-workflows. Scripts are deterministic for resume (no Date/Math.random/import). Use the Workflow tool on substantive multi-agent tasks.
|
|
584382
|
+
var import_react83, inputSchema41, outputSchema37, DESCRIPTION22 = `Run a multi-step workflow from a self-contained JavaScript script. The script runs in a sandboxed vm with access to primitives: agent(prompt, opts?) to spawn a subagent, parallel(items) for concurrent execution (max 4096 items, ~10 concurrent), pipeline(items, ...stages) for streaming, phase(title, fn?) to group agents (optional callback form: phase('title', async () => { ...parallel/agent... }) runs fn within the phase and returns its result), log(...args) for workflow-scoped logging, budget {total, remaining(), spent()} for token caps, and workflow(nameOrRef) / resolveWorkflow(name) for sub-workflows. Scripts are deterministic for resume (no Date/Math.random/import). Use the Workflow tool on substantive multi-agent tasks.
|
|
584380
584383
|
|
|
584381
584384
|
- Ultracode is on for the session (a system-reminder confirms it) \u2014 see **Ultracode** below.
|
|
584382
584385
|
|