@wichayutdew/pi-workflows 2.4.1 → 2.5.1

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 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: {
@@ -1558,7 +1565,7 @@ var parseFailureTranscript = (transcript) => {
1558
1565
  tool: item.name,
1559
1566
  argumentsValue: item.arguments
1560
1567
  });
1561
- const isExclusiveCompletion = toolCalls.length === 1 && message.content.every((contentItem) => isDiagnosticRecord(contentItem) && (contentItem.type === "thinking" || contentItem.type === "toolCall"));
1568
+ const isExclusiveCompletion = toolCalls.length === 1 && message.content.every((contentItem) => isDiagnosticRecord(contentItem) && (contentItem.type === "thinking" || contentItem.type === "text" || contentItem.type === "toolCall"));
1562
1569
  const completionValue = item.name === "structured_output" && isExclusiveCompletion ? structuredCompletionValue(item.arguments) : undefined;
1563
1570
  const recordedCall = {
1564
1571
  id: item.id,
@@ -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}\` to show or hide the workflow status overlay, or \`/workflow-pause\` to cancel the child and repair the workflow before resuming.`
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wichayutdew/pi-workflows",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "A declarative, pauseable workflow harness for Pi",
5
5
  "license": "MIT",
6
6
  "repository": {
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));
@@ -155,6 +155,7 @@ export const parseFailureTranscript = (
155
155
  (contentItem) =>
156
156
  isDiagnosticRecord(contentItem) &&
157
157
  (contentItem.type === 'thinking' ||
158
+ contentItem.type === 'text' ||
158
159
  contentItem.type === 'toolCall'),
159
160
  );
160
161
  const completionValue =
@@ -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}\` to show or hide the workflow status overlay, or \`/workflow-pause\` to cancel the child and repair the workflow before resuming.`,
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
  }