@agimon-ai/doompi-workflow 0.0.1-alpha.100 → 0.0.1-alpha.103

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/README.md CHANGED
@@ -64,9 +64,10 @@ Core tools are:
64
64
  - `list_workflows`: discover workflows.
65
65
  - `launch_workflow`: register and start an asynchronous run.
66
66
  - `workflow_run`: inspect or control a run through supported actions.
67
+ - `workflow_tools` (server/web sessions): read failed-run recovery evidence or resume the existing run.
67
68
 
68
- Launch returns after the run is registered, not after all jobs complete. Use status and follow
69
- controls for progress, and wait for a terminal notification.
69
+ Launch returns after the run is registered, not after all jobs complete. Use status for progress
70
+ and wait for a terminal notification. The TUI also supports follow controls.
70
71
 
71
72
  In the TUI, `SPC w l` lists the repository's workflows and launches the one under the cursor with
72
73
  `r`, `SPC w r` inspects this session's runs, `SPC w c` opens recovery, and `SPC w e`
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_workflowTerminal = require("../workflowTerminal-Bb4bLtLu.cjs");
5
+ const require_workflowTerminal = require("../workflowTerminal-Dse-ahCB.cjs");
6
6
  const require_workflowLaunchCommand = require("../workflowLaunchCommand-DJyDB96d.cjs");
7
7
  let _agimon_ai_doompi_core_piExtension = require("@agimon-ai/doompi-core/piExtension");
8
8
  let _agimon_ai_doompi_core_extensionFile = require("@agimon-ai/doompi-core/extensionFile");
@@ -23,76 +23,6 @@ let _agimon_ai_doompi_core_readiness = require("@agimon-ai/doompi-core/readiness
23
23
  let _agimon_ai_doompi_minor_mode = require("@agimon-ai/doompi-minor-mode");
24
24
  let _agimon_ai_doompi_telemetry = require("@agimon-ai/doompi-telemetry");
25
25
  let _earendil_works_pi_tui = require("@earendil-works/pi-tui");
26
- //#region src/schemas/workflowPi.ts
27
- const RUN_SELECTOR_FIELDS = {
28
- runKey: zod.z.string().min(1).describe("Run key of the workflow run."),
29
- workspace: zod.z.string().optional().describe("Workspace the run belongs to.")
30
- };
31
- const workflowRunInputSchema = zod.z.discriminatedUnion("action", [
32
- zod.z.object({
33
- action: zod.z.literal("status"),
34
- ...RUN_SELECTOR_FIELDS
35
- }).strict(),
36
- zod.z.object({
37
- action: zod.z.literal("tail"),
38
- ...RUN_SELECTOR_FIELDS
39
- }).strict(),
40
- zod.z.object({
41
- action: zod.z.literal("recovery-evidence"),
42
- ...RUN_SELECTOR_FIELDS
43
- }).strict(),
44
- zod.z.object({
45
- action: zod.z.literal("follow"),
46
- ...RUN_SELECTOR_FIELDS
47
- }).strict(),
48
- zod.z.object({
49
- action: zod.z.literal("open"),
50
- ...RUN_SELECTOR_FIELDS
51
- }).strict(),
52
- zod.z.object({
53
- action: zod.z.literal("pause"),
54
- ...RUN_SELECTOR_FIELDS,
55
- reason: zod.z.string().optional()
56
- }).strict(),
57
- zod.z.object({
58
- action: zod.z.literal("resume"),
59
- ...RUN_SELECTOR_FIELDS,
60
- reason: zod.z.string().optional()
61
- }).strict(),
62
- zod.z.object({
63
- action: zod.z.literal("stop"),
64
- ...RUN_SELECTOR_FIELDS,
65
- reason: zod.z.string().optional()
66
- }).strict(),
67
- zod.z.object({
68
- action: zod.z.literal("recover"),
69
- ...RUN_SELECTOR_FIELDS,
70
- dryRun: zod.z.boolean().optional(),
71
- job: zod.z.string().optional(),
72
- runner: zod.z.string().optional()
73
- }).strict()
74
- ]);
75
- const dispatchInputSchema = zod.z.object({
76
- description: zod.z.string().optional().describe("Description shown for the workflow input."),
77
- required: zod.z.boolean().optional().describe("Whether the workflow input must be provided."),
78
- default: zod.z.string().optional().describe("Default value for the workflow input."),
79
- type: zod.z.string().optional().describe("Declared workflow input type."),
80
- options: zod.z.array(zod.z.string()).optional().describe("Allowed values for the workflow input.")
81
- }).passthrough();
82
- const workflowDispatchInputsSchema = zod.z.object({ inputs: zod.z.record(zod.z.string(), dispatchInputSchema).optional().describe("Workflow dispatch input definitions.") }).passthrough();
83
- const workflowCatalogPageSchema = zod.z.object({
84
- directory: zod.z.string().min(1).describe("Directory searched for workflow definitions."),
85
- hasNextPage: zod.z.boolean().describe("Whether another catalog page exists."),
86
- page: zod.z.number().int().positive().describe("One-based catalog page number."),
87
- pageSize: zod.z.number().int().positive().describe("Catalog page size."),
88
- workflows: zod.z.array(zod.z.object({
89
- path: zod.z.string().min(1).describe("Workflow path relative to the catalog directory."),
90
- name: zod.z.string().describe("Workflow display name."),
91
- description: zod.z.string().describe("Workflow description."),
92
- tags: zod.z.array(zod.z.string()).describe("Workflow tags.")
93
- }).passthrough()).describe("Workflow definitions on this page.")
94
- }).passthrough();
95
- //#endregion
96
26
  //#region src/services/workflowTools/index.ts
97
27
  const PI_LAUNCH_FIELDS = {
98
28
  workflowPath: true,
@@ -175,11 +105,11 @@ function createWorkflowTools(dependencies, renderers = () => ({})) {
175
105
  "Use action recover only after loading the `workflow-recovery` skill and gathering its required evidence. Recovery may adopt a terminal failed run from an earlier Pi session; it never grants cross-session control of running work. Never edit issue.md or repair.json, and verify real process and registry progress before recovery.",
176
106
  "Never unlock or force-release an Agiflow claim from this tool."
177
107
  ],
178
- parameters: zod.z.toJSONSchema(workflowRunInputSchema),
108
+ parameters: zod.z.toJSONSchema(require_workflowTerminal.workflowRunInputSchema),
179
109
  renderShell: "self",
180
110
  ...renderers(require_workflowTerminal.WORKFLOW_RUN_TOOL_NAME),
181
111
  async execute(_toolCallId, rawParams, _signal, onUpdate, ctx) {
182
- const input = workflowRunInputSchema.parse(rawParams);
112
+ const input = require_workflowTerminal.workflowRunInputSchema.parse(rawParams);
183
113
  const sessionId = (0, _agimon_ai_doompi_core_childProcess.resolveRootSessionId)(ctx.sessionManager.getSessionId(), dependencies.environment);
184
114
  dependencies.observeSession?.(sessionId);
185
115
  const selector = {
@@ -887,7 +817,7 @@ function workflowTriggerBlock(workflow) {
887
817
  function dispatchInputs(workflow) {
888
818
  const dispatch = workflowTriggerBlock(workflow)[WORKFLOW_DISPATCH_TRIGGER];
889
819
  if (dispatch === null || dispatch === void 0) return {};
890
- const parsed = workflowDispatchInputsSchema.safeParse(dispatch);
820
+ const parsed = require_workflowTerminal.workflowDispatchInputsSchema.safeParse(dispatch);
891
821
  if (!parsed.success) throw new Error(`Invalid workflow_dispatch input definitions: ${parsed.error.message}`);
892
822
  return parsed.data.inputs ?? {};
893
823
  }
@@ -902,7 +832,7 @@ function parseWorkflowCatalogPage(result) {
902
832
  } catch (cause) {
903
833
  throw new Error("Workflow catalog returned invalid JSON.", { cause });
904
834
  }
905
- const parsed = workflowCatalogPageSchema.safeParse(value);
835
+ const parsed = require_workflowTerminal.workflowCatalogPageSchema.safeParse(value);
906
836
  if (!parsed.success) throw new Error(`Workflow catalog response was invalid: ${parsed.error.message}`);
907
837
  return {
908
838
  directory: parsed.data.directory,