@wichayutdew/pi-workflows 2.4.1 → 2.5.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/index.js +18 -1
- package/package.json +1 -1
- package/src/commands.ts +9 -0
- package/src/harness.ts +11 -0
- package/src/prompt/main-workflow-notice.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1374,6 +1374,13 @@ function createHarnessCommands(controller) {
|
|
|
1374
1374
|
handler: async (reason, context) => controller.abort(reason.trim(), context)
|
|
1375
1375
|
}
|
|
1376
1376
|
},
|
|
1377
|
+
{
|
|
1378
|
+
name: "workflow-status",
|
|
1379
|
+
options: {
|
|
1380
|
+
description: "Toggle workflow status",
|
|
1381
|
+
handler: async (_args, context) => controller.status(context)
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1377
1384
|
{
|
|
1378
1385
|
name: "workflow-reload",
|
|
1379
1386
|
options: {
|
|
@@ -6884,7 +6891,7 @@ function buildMainWorkflowNotice(workflow, run, statusShortcutLabel = "Ctrl+Alt+
|
|
|
6884
6891
|
"",
|
|
6885
6892
|
`Workflow "${workflow.definition.id}" is running step "${run.currentStepId}" (${step.title}) in a separate pi-subagents child process.`,
|
|
6886
6893
|
"Do not perform the workflow step in this main session.",
|
|
6887
|
-
`Use \`${statusShortcutLabel}\`
|
|
6894
|
+
`Use \`${statusShortcutLabel}\` or \`/workflow-status\` to open the workflow status overlay, or \`/workflow-pause\` to cancel the child and repair the workflow before resuming.`
|
|
6888
6895
|
].join(`
|
|
6889
6896
|
`);
|
|
6890
6897
|
}
|
|
@@ -8575,6 +8582,16 @@ class WorkflowHarness {
|
|
|
8575
8582
|
abort(reason, context) {
|
|
8576
8583
|
return this.enqueueMutation(context, () => this.abortNow(reason, context));
|
|
8577
8584
|
}
|
|
8585
|
+
async status(context) {
|
|
8586
|
+
this.latestContext = context;
|
|
8587
|
+
if (this.isStatusOverlayOpen)
|
|
8588
|
+
return;
|
|
8589
|
+
if (!this.run) {
|
|
8590
|
+
context.ui.notify("No workflow checkpoint in this session", "info");
|
|
8591
|
+
return;
|
|
8592
|
+
}
|
|
8593
|
+
await this.showWorkflowStatus(context);
|
|
8594
|
+
}
|
|
8578
8595
|
reload(context) {
|
|
8579
8596
|
return this.enqueueMutation(context, () => this.reloadNow(context));
|
|
8580
8597
|
}
|
package/package.json
CHANGED
package/src/commands.ts
CHANGED
|
@@ -43,6 +43,8 @@ export type WorkflowCommandController = {
|
|
|
43
43
|
reason: string,
|
|
44
44
|
context: ExtensionCommandContext,
|
|
45
45
|
) => Promise<void>;
|
|
46
|
+
/** Opens the active workflow status overlay. */
|
|
47
|
+
readonly status: (context: ExtensionCommandContext) => Promise<void>;
|
|
46
48
|
/** Reloads workflow configuration. */
|
|
47
49
|
readonly reload: (context: ExtensionCommandContext) => Promise<void>;
|
|
48
50
|
};
|
|
@@ -165,6 +167,13 @@ export function createHarnessCommands(
|
|
|
165
167
|
controller.abort(reason.trim(), context),
|
|
166
168
|
},
|
|
167
169
|
},
|
|
170
|
+
{
|
|
171
|
+
name: 'workflow-status',
|
|
172
|
+
options: {
|
|
173
|
+
description: 'Toggle workflow status',
|
|
174
|
+
handler: async (_args, context) => controller.status(context),
|
|
175
|
+
},
|
|
176
|
+
},
|
|
168
177
|
{
|
|
169
178
|
name: 'workflow-reload',
|
|
170
179
|
options: {
|
package/src/harness.ts
CHANGED
|
@@ -380,6 +380,17 @@ export class WorkflowHarness implements WorkflowCommandController {
|
|
|
380
380
|
return this.enqueueMutation(context, () => this.abortNow(reason, context));
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
+
/** Opens the workflow status overlay, matching the configured shortcut. */
|
|
384
|
+
async status(context: ExtensionCommandContext): Promise<void> {
|
|
385
|
+
this.latestContext = context;
|
|
386
|
+
if (this.isStatusOverlayOpen) return;
|
|
387
|
+
if (!this.run) {
|
|
388
|
+
context.ui.notify('No workflow checkpoint in this session', 'info');
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
await this.showWorkflowStatus(context);
|
|
392
|
+
}
|
|
393
|
+
|
|
383
394
|
/** Reloads workflow configuration while no workflow is executing. */
|
|
384
395
|
reload(context: ExtensionCommandContext): Promise<void> {
|
|
385
396
|
return this.enqueueMutation(context, () => this.reloadNow(context));
|
|
@@ -36,6 +36,6 @@ export function buildMainWorkflowNotice(
|
|
|
36
36
|
'',
|
|
37
37
|
`Workflow "${workflow.definition.id}" is running step "${run.currentStepId}" (${step.title}) in a separate pi-subagents child process.`,
|
|
38
38
|
'Do not perform the workflow step in this main session.',
|
|
39
|
-
`Use \`${statusShortcutLabel}\`
|
|
39
|
+
`Use \`${statusShortcutLabel}\` or \`/workflow-status\` to open the workflow status overlay, or \`/workflow-pause\` to cancel the child and repair the workflow before resuming.`,
|
|
40
40
|
].join('\n');
|
|
41
41
|
}
|