@piewf/cli 4.0.2 → 5.0.0
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/src/cli.js
CHANGED
|
@@ -467,7 +467,7 @@ async function invokeWorkflow(fn, args, runtime, options, context) {
|
|
|
467
467
|
return; announcedRunId = runId; options.stderr(`Run ID: ${runId}\n`); };
|
|
468
468
|
const progress = new CliProgress(options.stderr, options.isTTY ?? process.stderr.isTTY, announceRunId);
|
|
469
469
|
try {
|
|
470
|
-
const result = await runtime.workflowTool.execute(randomUUID(), {
|
|
470
|
+
const result = await runtime.workflowTool.execute(randomUUID(), { name: fn.name, script: `return await ${fn.name}(args);`, args, foreground: true }, options.signal, (update) => { if (object(update) && object(update.details) && object(update.details.run))
|
|
471
471
|
progress.update(update.details.run); }, context);
|
|
472
472
|
const details = object(result.details) ? result.details : {};
|
|
473
473
|
const runId = typeof details.runId === "string" ? details.runId : undefined;
|
|
@@ -212,11 +212,6 @@ function validateSnapshot(snapshot) {
|
|
|
212
212
|
throw new Error("Persisted launch snapshot is invalid");
|
|
213
213
|
if (snapshot.identityVersion !== undefined)
|
|
214
214
|
positiveInteger(snapshot.identityVersion, "Persisted snapshot identity version");
|
|
215
|
-
if (snapshot.launchKind !== undefined && !["inline", "function"].includes(snapshot.launchKind))
|
|
216
|
-
throw new Error("Persisted snapshot launch kind is invalid");
|
|
217
|
-
if (snapshot.launchKind === "function" && (typeof snapshot.functionName !== "string" || !snapshot.functionName))
|
|
218
|
-
throw new Error("Persisted snapshot function name is invalid");
|
|
219
|
-
optionalString(snapshot.functionName, "Persisted snapshot function name");
|
|
220
215
|
optionalString(snapshot.settingsPath, "Persisted snapshot settings path");
|
|
221
216
|
if (snapshot.settingsSources !== undefined) {
|
|
222
217
|
if (!object(snapshot.settingsSources) || typeof snapshot.settingsSources.concurrency !== "string" || typeof snapshot.settingsSources.modelAliases !== "string" || typeof snapshot.settingsSources.disabledAgentResources !== "string")
|
|
@@ -46,6 +46,8 @@ export function transcriptLines(entries) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
export function transcriptFileLines(path) {
|
|
49
|
+
if (!existsSync(path))
|
|
50
|
+
throw new Error(`Transcript file not found: ${path}`);
|
|
49
51
|
return transcriptLines(SessionManager.open(path).buildContextEntries());
|
|
50
52
|
}
|
|
51
53
|
function mergedModels(groups) {
|
|
@@ -215,7 +217,7 @@ export async function loadSessionReport(path, home = homedir()) {
|
|
|
215
217
|
const args = call.arguments;
|
|
216
218
|
const agents = loaded ? await Promise.all(loaded.run.agents.map(agentReport)) : [];
|
|
217
219
|
const models = mergedModels(agents.flatMap(({ attempts }) => attempts.map(({ models: attemptModels }) => attemptModels)));
|
|
218
|
-
const name = loaded?.run.workflowName ?? (typeof args.
|
|
220
|
+
const name = loaded?.run.workflowName ?? (typeof args.name === "string" ? args.name : "workflow");
|
|
219
221
|
const description = typeof args.description === "string" ? args.description : loaded?.snapshot.metadata.description;
|
|
220
222
|
const script = typeof args.script === "string" && args.script.trim() ? args.script : loaded?.snapshot.script;
|
|
221
223
|
let staticCalls = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piewf/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "CLI for pi-extensible-workflows",
|
|
5
5
|
"homepage": "https://vekexasia.github.io/pi-extensible-workflows/",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"typebox": "*"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@earendil-works/pi-ai": "0.
|
|
36
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
35
|
+
"@earendil-works/pi-ai": "0.82.1",
|
|
36
|
+
"@earendil-works/pi-coding-agent": "0.82.1",
|
|
37
37
|
"@eslint/js": "10.0.1",
|
|
38
38
|
"@types/node": "24.12.4",
|
|
39
39
|
"eslint": "10.0.3",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"pi-extensible-workflows": "
|
|
48
|
+
"pi-extensible-workflows": "5.0.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|