@agimon-ai/doompi-workflow 0.0.1-alpha.11 → 0.0.1-alpha.111

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.
Files changed (142) hide show
  1. package/LICENSE +8 -0
  2. package/LICENSE.web +29 -0
  3. package/README.md +156 -26
  4. package/dist/apiContracts.cjs +335 -0
  5. package/dist/apiContracts.cjs.map +1 -0
  6. package/dist/apiContracts.d.mts +53 -0
  7. package/dist/apiContracts.d.mts.map +1 -0
  8. package/dist/apiContracts.mjs +330 -0
  9. package/dist/apiContracts.mjs.map +1 -0
  10. package/dist/extensions/pi.cjs +4775 -1
  11. package/dist/extensions/pi.cjs.map +1 -1
  12. package/dist/extensions/pi.d.mts +39 -2
  13. package/dist/extensions/pi.d.mts.map +1 -0
  14. package/dist/extensions/pi.mjs +4770 -1
  15. package/dist/extensions/pi.mjs.map +1 -1
  16. package/dist/extensions/server.cjs +3271 -0
  17. package/dist/extensions/server.cjs.map +1 -0
  18. package/dist/extensions/server.d.mts +5 -0
  19. package/dist/extensions/server.d.mts.map +1 -0
  20. package/dist/extensions/server.mjs +3263 -0
  21. package/dist/extensions/server.mjs.map +1 -0
  22. package/dist/extensions/web.mjs +3659 -0
  23. package/dist/extensions/web.mjs.map +1 -0
  24. package/dist/index.cjs +4 -1
  25. package/dist/index.d.mts +59 -3
  26. package/dist/index.d.mts.map +1 -0
  27. package/dist/index.mjs +2 -1
  28. package/dist/workflowLaunchCommand-BLrxmzdd.mjs +125 -0
  29. package/dist/workflowLaunchCommand-BLrxmzdd.mjs.map +1 -0
  30. package/dist/workflowLaunchCommand-DJyDB96d.cjs +148 -0
  31. package/dist/workflowLaunchCommand-DJyDB96d.cjs.map +1 -0
  32. package/dist/workflowTerminal-Cuc79Gog.mjs +842 -0
  33. package/dist/workflowTerminal-Cuc79Gog.mjs.map +1 -0
  34. package/dist/workflowTerminal-DeJ9BBta.cjs +1158 -0
  35. package/dist/workflowTerminal-DeJ9BBta.cjs.map +1 -0
  36. package/llms.txt +16 -0
  37. package/package.json +92 -26
  38. package/skills/workflow-recovery/SKILL.md +17 -15
  39. package/src/prompts/doompi-author-workflow/SKILL.md +56 -0
  40. package/src/prompts/doompi-use-workflow/SKILL.md +21 -0
  41. package/src/types/webWorkflowTerminal.ts +109 -0
  42. package/src/types/webWorkflows.ts +174 -0
  43. package/dist/adapters/pi/dispatcher.cjs +0 -2
  44. package/dist/adapters/pi/dispatcher.cjs.map +0 -1
  45. package/dist/adapters/pi/dispatcher.d.cts +0 -6
  46. package/dist/adapters/pi/dispatcher.d.cts.map +0 -1
  47. package/dist/adapters/pi/dispatcher.d.mts +0 -6
  48. package/dist/adapters/pi/dispatcher.d.mts.map +0 -1
  49. package/dist/adapters/pi/dispatcher.mjs +0 -2
  50. package/dist/adapters/pi/dispatcher.mjs.map +0 -1
  51. package/dist/adapters/pi/extension.cjs +0 -2
  52. package/dist/adapters/pi/extension.cjs.map +0 -1
  53. package/dist/adapters/pi/extension.d.cts +0 -6
  54. package/dist/adapters/pi/extension.d.cts.map +0 -1
  55. package/dist/adapters/pi/extension.d.mts +0 -6
  56. package/dist/adapters/pi/extension.d.mts.map +0 -1
  57. package/dist/adapters/pi/extension.mjs +0 -2
  58. package/dist/adapters/pi/extension.mjs.map +0 -1
  59. package/dist/adapters/pi/leader.cjs +0 -2
  60. package/dist/adapters/pi/leader.cjs.map +0 -1
  61. package/dist/adapters/pi/leader.mjs +0 -2
  62. package/dist/adapters/pi/leader.mjs.map +0 -1
  63. package/dist/adapters/pi/workflow/piExtension.cjs +0 -11
  64. package/dist/adapters/pi/workflow/piExtension.cjs.map +0 -1
  65. package/dist/adapters/pi/workflow/piExtension.mjs +0 -11
  66. package/dist/adapters/pi/workflow/piExtension.mjs.map +0 -1
  67. package/dist/adapters/pi/workflow/piToolBridge.cjs +0 -11
  68. package/dist/adapters/pi/workflow/piToolBridge.cjs.map +0 -1
  69. package/dist/adapters/pi/workflow/piToolBridge.mjs +0 -11
  70. package/dist/adapters/pi/workflow/piToolBridge.mjs.map +0 -1
  71. package/dist/adapters/pi/workflow/piTools.cjs +0 -4
  72. package/dist/adapters/pi/workflow/piTools.cjs.map +0 -1
  73. package/dist/adapters/pi/workflow/piTools.mjs +0 -4
  74. package/dist/adapters/pi/workflow/piTools.mjs.map +0 -1
  75. package/dist/adapters/pi/workflow/workflowLauncher.cjs +0 -2
  76. package/dist/adapters/pi/workflow/workflowLauncher.cjs.map +0 -1
  77. package/dist/adapters/pi/workflow/workflowLauncher.mjs +0 -2
  78. package/dist/adapters/pi/workflow/workflowLauncher.mjs.map +0 -1
  79. package/dist/extensions/dispatcher.cjs +0 -2
  80. package/dist/extensions/dispatcher.cjs.map +0 -1
  81. package/dist/extensions/dispatcher.d.cts +0 -2
  82. package/dist/extensions/dispatcher.d.mts +0 -2
  83. package/dist/extensions/dispatcher.mjs +0 -2
  84. package/dist/extensions/dispatcher.mjs.map +0 -1
  85. package/dist/extensions/pi.d.cts +0 -2
  86. package/dist/index.d.cts +0 -3
  87. package/dist/schemas/workflowPi.cjs +0 -2
  88. package/dist/schemas/workflowPi.cjs.map +0 -1
  89. package/dist/schemas/workflowPi.mjs +0 -2
  90. package/dist/schemas/workflowPi.mjs.map +0 -1
  91. package/dist/services/workflow/backgroundWork.cjs +0 -2
  92. package/dist/services/workflow/backgroundWork.cjs.map +0 -1
  93. package/dist/services/workflow/backgroundWork.mjs +0 -2
  94. package/dist/services/workflow/backgroundWork.mjs.map +0 -1
  95. package/dist/tui/workflow/doomOverlay.cjs +0 -2
  96. package/dist/tui/workflow/doomOverlay.cjs.map +0 -1
  97. package/dist/tui/workflow/doomOverlay.mjs +0 -2
  98. package/dist/tui/workflow/doomOverlay.mjs.map +0 -1
  99. package/dist/tui/workflow/overlayText.cjs +0 -2
  100. package/dist/tui/workflow/overlayText.cjs.map +0 -1
  101. package/dist/tui/workflow/overlayText.mjs +0 -2
  102. package/dist/tui/workflow/overlayText.mjs.map +0 -1
  103. package/dist/tui/workflow/rendering.cjs +0 -2
  104. package/dist/tui/workflow/rendering.cjs.map +0 -1
  105. package/dist/tui/workflow/rendering.mjs +0 -2
  106. package/dist/tui/workflow/rendering.mjs.map +0 -1
  107. package/dist/tui/workflow/workflowFooterStatus.cjs +0 -2
  108. package/dist/tui/workflow/workflowFooterStatus.cjs.map +0 -1
  109. package/dist/tui/workflow/workflowFooterStatus.mjs +0 -2
  110. package/dist/tui/workflow/workflowFooterStatus.mjs.map +0 -1
  111. package/dist/tui/workflow/workflowInspector.cjs +0 -2
  112. package/dist/tui/workflow/workflowInspector.cjs.map +0 -1
  113. package/dist/tui/workflow/workflowInspector.mjs +0 -2
  114. package/dist/tui/workflow/workflowInspector.mjs.map +0 -1
  115. package/dist/tui/workflow/workflowOverlay.cjs +0 -2
  116. package/dist/tui/workflow/workflowOverlay.cjs.map +0 -1
  117. package/dist/tui/workflow/workflowOverlay.mjs +0 -2
  118. package/dist/tui/workflow/workflowOverlay.mjs.map +0 -1
  119. package/dist/tui/workflow/workflowPicker.cjs +0 -2
  120. package/dist/tui/workflow/workflowPicker.cjs.map +0 -1
  121. package/dist/tui/workflow/workflowPicker.mjs +0 -2
  122. package/dist/tui/workflow/workflowPicker.mjs.map +0 -1
  123. package/dist/tui/workflow/workflowPrompt.cjs +0 -2
  124. package/dist/tui/workflow/workflowPrompt.cjs.map +0 -1
  125. package/dist/tui/workflow/workflowPrompt.mjs +0 -2
  126. package/dist/tui/workflow/workflowPrompt.mjs.map +0 -1
  127. package/dist/tui/workflow/workflowRunPanel.cjs +0 -2
  128. package/dist/tui/workflow/workflowRunPanel.cjs.map +0 -1
  129. package/dist/tui/workflow/workflowRunPanel.mjs +0 -2
  130. package/dist/tui/workflow/workflowRunPanel.mjs.map +0 -1
  131. package/dist/tui/workflow/workflowStatusRow.cjs +0 -2
  132. package/dist/tui/workflow/workflowStatusRow.cjs.map +0 -1
  133. package/dist/tui/workflow/workflowStatusRow.mjs +0 -2
  134. package/dist/tui/workflow/workflowStatusRow.mjs.map +0 -1
  135. package/dist/tui/workflow/workflowStepMessage.cjs +0 -2
  136. package/dist/tui/workflow/workflowStepMessage.cjs.map +0 -1
  137. package/dist/tui/workflow/workflowStepMessage.mjs +0 -2
  138. package/dist/tui/workflow/workflowStepMessage.mjs.map +0 -1
  139. package/dist/types/index.cjs +0 -2
  140. package/dist/types/index.cjs.map +0 -1
  141. package/dist/types/index.mjs +0 -2
  142. package/dist/types/index.mjs.map +0 -1
package/LICENSE CHANGED
@@ -1,3 +1,11 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ * The browser half of this package, meaning every ".web" routed file under
4
+ "src/extensions" and the "_components" and "_lib" modules colocated with
5
+ one, is licensed under the DoomPi Web License defined in "LICENSE.web":
6
+ free to use, not to redistribute.
7
+ * All other content is licensed under the MIT license below.
8
+
1
9
  MIT License
2
10
 
3
11
  Copyright (c) 2026 Vuong Ngo
package/LICENSE.web ADDED
@@ -0,0 +1,29 @@
1
+ The DoomPi Web License
2
+
3
+ Copyright (c) 2026 Agimon Pty Ltd
4
+
5
+ With regard to the DoomPi Web Software:
6
+
7
+ This software and associated documentation files (the "Software") may be
8
+ used, free of charge, by any person or entity, for any purpose, including
9
+ production and commercial use. You may copy the Software as reasonably
10
+ necessary to install, run, develop against, test, and back it up. You are
11
+ free to modify the Software for your own use and to publish patches to the
12
+ Software. You agree that the licensor retains all right, title, and interest
13
+ in and to the Software, and that your modifications and patches may only be
14
+ used, copied, modified, displayed, distributed, or otherwise exploited
15
+ together with the Software. You are not granted any other rights beyond what
16
+ is expressly stated herein. Subject to the foregoing, it is forbidden to
17
+ publish, distribute, sublicense, and/or sell the Software or any copy of it,
18
+ or to offer the Software to third parties as a hosted or managed service.
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29
+ IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,47 +1,177 @@
1
1
  # @agimon-ai/doompi-workflow
2
2
 
3
- Doompi workflow execution and monitoring integration.
3
+ Discover, launch, monitor, control, and recover asynchronous DoomPi workflows.
4
4
 
5
- Long autonomous work in the shape a GitHub Actions user already knows: `on:`, `jobs:`,
6
- `needs:`, `steps:`, timeouts, and declared artifacts. Every step names the session it wants,
7
- so one run can hand each job exactly the context that job needs.
5
+ Part of the [DoomPi distribution](https://www.npmjs.com/package/@agimon-ai/doompi).
8
6
 
9
- Part of [Doompi](https://www.npmjs.com/package/@agimon-ai/doompi), a coding agent that loads
10
- only the skills and tools you name. This package is composed by Doompi and is not usually
11
- installed on its own.
7
+ The integration embeds `@agimon-ai/workflow-mcp`. Workflow files describe job dependencies and
8
+ host-executed steps, while DoomPi provides session-scoped tools and TUI surfaces.
9
+
10
+ > **Alpha:** workflow and recovery contracts may change between releases.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 22.19.0 or newer
15
+ - Pi 1.0.0 and Pi TUI 0.85.0
12
16
 
13
17
  ## Install
14
18
 
19
+ The seeded `modes.yaml` selects Workflow in `default.packages`. Keep it there or select it through
20
+ a layer; its tools remain inactive until Workflow mode is enabled. For standalone Pi:
21
+
15
22
  ```bash
16
- npm install @agimon-ai/doompi-workflow
23
+ pi install npm:@agimon-ai/doompi-workflow
17
24
  ```
18
25
 
19
- ## How it loads
26
+ Enable tools with `SPC w e`, or set `WORKFLOW_MCP_MODE=on` for a non-interactive harness that cannot
27
+ toggle the minor mode.
28
+
29
+ ## Define a workflow
30
+
31
+ Create a `*.workflow.yml` file:
32
+
33
+ ```yaml
34
+ name: verify
35
+
36
+ jobs:
37
+ test:
38
+ steps:
39
+ - name: Run tests
40
+ run: pnpm test
41
+
42
+ summarize:
43
+ needs: test
44
+ steps:
45
+ - name: Record result
46
+ run: node scripts/write-verification-summary.mjs
47
+ ```
48
+
49
+ `run` commands execute on the host with the workflow process's environment and privileges. There is
50
+ no VM, container, or sandbox. Review workflow files as executable code. Runner-specific
51
+ `interactiveRun` mappings are available for commands that require a TTY.
52
+
53
+ A step can also declare `runConfig` (major mode, minor modes, profile, domains, model, thinking)
54
+ and `customRun` (a prompt). Launched from the DoomPi server, a `customRun` step runs as a child
55
+ session of the launching session with those settings, until the agent has recorded what the step
56
+ needs, and `run` and `interactiveRun` steps each get their own RMUX pane. Each run keeps its engine
57
+ log in `engine.log` in its run directory. See `docs/automation.md` for the full contract and the
58
+ CLI fallback.
59
+
60
+ ## Launch and monitor
61
+
62
+ Core tools are:
63
+
64
+ - `list_workflows`: discover workflows.
65
+ - `launch_workflow`: register and start an asynchronous run.
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.
20
68
 
21
- Doompi loads this unconditionally. It is core, not a layer, so it does not appear in
22
- `.doom/modes.yaml`: making it optional would only create broken configurations.
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.
23
71
 
24
- Extension entry: `@agimon-ai/doompi-workflow/extensions/pi`
72
+ In the TUI, `SPC w l` lists the repository's workflows and launches the one under the cursor with
73
+ `r`, `SPC w r` inspects this session's runs, `SPC w c` opens recovery, and `SPC w e`
74
+ toggles model-visible tools. The root session can launch; child sessions can inspect the catalog but
75
+ do not receive an unrestricted workflow factory.
25
76
 
26
- ## Leader
77
+ ## Storage, concurrency, and lifecycle
27
78
 
28
- `SPC w w` launches, `SPC w l` manages, `SPC w r` recovers, once the extension is loaded.
29
- The recovery picker includes terminal failed runs from earlier Pi sessions. `workflow_run` action `recovery-evidence` reads only terminal registry evidence; generic status/tail and all live controls remain session-scoped. Replay claims the failed record atomically, transfers only `PI_SESSION_ID`, and binds controls to the exact run generation the session authorized.
79
+ Registry data defaults to `$HOME/.workflow-mcp`; set `WORKFLOW_MCP_HOME` to relocate it. Persisted
80
+ records contain workflow and run identity, job and step state, ownership, output locations, and
81
+ recovery evidence. The default concurrency ceiling is five runs.
30
82
 
31
- ## Notes
83
+ Runs embedded directly in the Pi process end with that process. Runs launched through a terminal
84
+ host such as tmux or cmux can have a different lifetime and remain manageable from the CLI. When
85
+ Team is loaded, Workflow contributes active session runs through Team's `doom/background-work`
86
+ service. That contribution reconnects after Team is replaced and is removed when Workflow unloads.
87
+ Reconciliation distinguishes stale registry records from live processes; do not assume every run
88
+ outlives its parent session.
89
+
90
+ Each workflow or repair step can launch commands and model-backed agents, consuming provider quota
91
+ and repeating external side effects.
92
+
93
+ ## Recovery
94
+
95
+ Recovery is available only for records in a terminal failure state. A recovery claim atomically
96
+ adopts the eligible failure, validates the evidence, and transfers ownership to the replay session.
97
+ Live controls remain scoped to the owning session. Recovery does not launch a second copy beside a
98
+ still-running job and does not guarantee that parent-session work survives shutdown.
99
+
100
+ The package publishes `workflow-recovery`, `doompi-author-workflow` for writing workflow
101
+ definitions, and `doompi-use-workflow` for launching, monitoring, and recovering runs while Workflow
102
+ mode is active. Deactivating Workflow mode hides them; cached files may remain.
103
+
104
+ ## Workflow sessions
105
+
106
+ In a server (web cockpit) session, a launch does not run in the session that asked for it. The
107
+ session creates a child **workflow session** (provenance `workflow-session`), nested under it in the
108
+ rail, and hands it the launch. The workflow session owns the run (`PI_SESSION_ID`), runs its step
109
+ sessions, and has Workflow mode on, so its agent can troubleshoot and recover the run. The run's
110
+ environment also carries `DOOMPI_WORKFLOW_LAUNCHER_SESSION_ID`, naming the launching session, which
111
+ lists the run in its Activity group, is told when it ends, and may read its status.
112
+
113
+ - The workflow session's rail row shows the run (`workflow · build › test · 4m`, or a failure or
114
+ pause marked like a pending question) through the host's per-session activity line.
115
+ - A failure or finish is posted into the workflow session's conversation as a notice, without
116
+ starting an agent turn. The owner agent also gets a live brief of its runs on every turn.
117
+ - After a success, a workflow session nobody interacted with asks its launcher to release it, and it
118
+ becomes `stopped · open to wake`. A session whose run failed or paused, or whose agent you
119
+ prompted, stays live until you remove it. Removing or restarting a live workflow session stops its
120
+ run.
121
+ - Recovery is refused from any session other than the owner while the owner is live.
122
+
123
+ Launches from inside a workflow session, and launches in hosts without a session service (the TUI
124
+ and CLI), run in place as before.
125
+
126
+ Each Pi extension instance uses the runner's shared Doom lifecycle. Reload or shutdown stops retained
127
+ callbacks, interrupts bounded inline work, removes UI and service registrations, and releases
128
+ package resources. Detached children load the same extension entry in their own process.
129
+
130
+ ## Pi extension
131
+
132
+ The Pi extension is published at `@agimon-ai/doompi-workflow/extensions/pi` and declared in
133
+ `package.json.pi.extensions`. Installing the package loads it automatically; there is no secondary
134
+ registration or dispatcher export.
135
+
136
+ ## Development
137
+
138
+ ```bash
139
+ pnpm build
140
+ pnpm typecheck
141
+ pnpm test
142
+ pnpm lint
143
+ ```
32
144
 
33
- The dispatcher exposes `list_workflows` to any session but scopes `launch_workflow` to the
34
- root session, so a subagent can look but not spawn.
145
+ Maintained by [Agimon](https://agimon.ai/about).
35
146
 
36
- ## Entry points
147
+ ## Web cockpit plugin
37
148
 
38
- | Import |
39
- | -------------------------------------------------------------- |
40
- | `@agimon-ai/doompi-workflow` |
41
- | `@agimon-ai/doompi-workflow/extensions/dispatcher` |
42
- | `@agimon-ai/doompi-workflow/extensions/pi` |
43
- | `@agimon-ai/doompi-workflow/skills/workflow-recovery/SKILL.md` |
149
+ The `.web` routed files under `src/extensions/workspaces/sessions/(frontend)` are this package's
150
+ DoomPi web cockpit plugin: the `workflow` dock face beside Activity and Context (the owned run's
151
+ jobs, active steps and artifacts, each opening its own tab), the workflow catalog and launch
152
+ dialog in the overlay slot, the Activity group's run rows (a handed-off run opens its workflow
153
+ session), their stores, and the `workflow_runs` session channel, compiled into the cockpit bundle
154
+ by `doompi-web`'s build. Each surface keeps its components in a colocated `_components` folder and
155
+ its stores and helpers in `_lib`.
156
+ The hub-side data source ships behind the `./web-hub` subpath and reads the workflow registry
157
+ (run.json plus progress.ndjson) exactly as the engine writes it. Both halves are declared by the
158
+ `doompiWeb` block in package.json.
44
159
 
45
160
  ## License
46
161
 
47
- MIT
162
+ MIT, except this package's browser half (the `.web` routed files under `src/extensions` and the
163
+ `_components` and `_lib` modules colocated with one), which is source available under the DoomPi
164
+ Web License (see `LICENSE.web`): free to use, including commercially, but not to redistribute.
165
+
166
+ Workflow's host entries live in `src/extensions/pi.ts`, `server.ts`, and `web.ts`.
167
+ `src/exports` exposes reusable package APIs. Controllers declare server APIs and
168
+ contributions, tools declare native tools, and each service has its own folder.
169
+ Terminal presentation and its session coordinator live in `src/tui`.
170
+
171
+ The Pi helper owns registrations and service fibers. The Workflow runtime returns
172
+ commands, events, mode ownership, and tool dependencies. Session startup begins
173
+ readiness discovery; dependent calls await that session's readiness. On shutdown,
174
+ `onStop` interrupts inline runs and clears session resources, while `onDispose`
175
+ also handles startup failure. Both use the same idempotent cleanup. A generation
176
+ fence prevents retired callbacks from sending messages or updating the UI; only
177
+ explicit resource teardown may use a retired UI context.
@@ -0,0 +1,335 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let _agimon_ai_doompi_core_apiContracts = require("@agimon-ai/doompi-core/apiContracts");
6
+ let typebox = require("typebox");
7
+ //#region src/schemas/apiContracts.ts
8
+ const S = typebox.Type.String();
9
+ const N = typebox.Type.Number();
10
+ const B = typebox.Type.Boolean();
11
+ const O = typebox.Type.Optional;
12
+ const values = (items) => typebox.Type.Union(items.map((item) => typebox.Type.Literal(item)));
13
+ const Step = {
14
+ name: S,
15
+ status: values([
16
+ "running",
17
+ "completed",
18
+ "skipped",
19
+ "failed",
20
+ "pause_requested",
21
+ "paused",
22
+ "resumed"
23
+ ]),
24
+ reason: O(S),
25
+ group: O(S),
26
+ startedAt: O(S),
27
+ endedAt: O(S)
28
+ };
29
+ const Run = typebox.Type.Object({
30
+ runKey: S,
31
+ workspace: S,
32
+ displayName: S,
33
+ workflowName: O(S),
34
+ workflowPath: S,
35
+ stage: values([
36
+ "running",
37
+ "completed",
38
+ "error"
39
+ ]),
40
+ outcome: O(values([
41
+ "success",
42
+ "skipped",
43
+ "failed",
44
+ "interrupted"
45
+ ])),
46
+ executionState: O(values([
47
+ "running",
48
+ "pause_requested",
49
+ "paused",
50
+ "resume_requested"
51
+ ])),
52
+ prompt: O(S),
53
+ startedAt: S,
54
+ finishedAt: O(S),
55
+ errorMessage: O(S),
56
+ failedJob: O(S),
57
+ stale: O(B),
58
+ staleReason: O(S),
59
+ worktreeBranch: O(S),
60
+ position: O(typebox.Type.Object({
61
+ job: S,
62
+ step: O(S),
63
+ index: O(N),
64
+ total: O(N)
65
+ })),
66
+ jobs: typebox.Type.Array(typebox.Type.Object({
67
+ ...Step,
68
+ phase: values([
69
+ "pre",
70
+ "job",
71
+ "post"
72
+ ]),
73
+ index: O(N),
74
+ total: O(N),
75
+ steps: typebox.Type.Array(typebox.Type.Object(Step))
76
+ }))
77
+ });
78
+ const WorkflowRunsSchema = typebox.Type.Object({ runs: typebox.Type.Array(Run) });
79
+ const Artifact = {
80
+ path: S,
81
+ kind: values(["file", "directory"]),
82
+ description: S,
83
+ producedBy: typebox.Type.Array(S)
84
+ };
85
+ const WorkflowCatalogSchema = typebox.Type.Object({
86
+ cwd: S,
87
+ warning: O(S),
88
+ workflows: typebox.Type.Array(typebox.Type.Object({
89
+ path: S,
90
+ relativePath: S,
91
+ name: S,
92
+ description: S,
93
+ tags: typebox.Type.Array(S),
94
+ triggers: typebox.Type.Array(S),
95
+ inputs: typebox.Type.Array(typebox.Type.Object({
96
+ name: S,
97
+ description: O(S),
98
+ required: O(B),
99
+ default: O(S),
100
+ type: O(S),
101
+ options: O(typebox.Type.Array(S))
102
+ })),
103
+ jobs: typebox.Type.Array(typebox.Type.Object({
104
+ name: S,
105
+ steps: typebox.Type.Array(S)
106
+ })),
107
+ artifacts: typebox.Type.Array(typebox.Type.Object(Artifact)),
108
+ runners: O(typebox.Type.Array(S)),
109
+ commands: O(typebox.Type.Array(S)),
110
+ choices: O(typebox.Type.Array(S)),
111
+ error: O(S)
112
+ }))
113
+ });
114
+ const Screen = typebox.Type.Object({
115
+ lines: typebox.Type.Array(S),
116
+ capabilities: typebox.Type.Object({
117
+ readable: B,
118
+ writable: B,
119
+ resizable: B,
120
+ reason: O(S)
121
+ }),
122
+ ended: O(B)
123
+ });
124
+ const Control = typebox.Type.Object({
125
+ held: B,
126
+ token: O(S),
127
+ reason: O(S)
128
+ });
129
+ const root = "/runs/{workspace}/{runKey}";
130
+ const apiContracts = (0, _agimon_ai_doompi_core_apiContracts.defineApiContract)({
131
+ version: 1,
132
+ dynamic: [],
133
+ http: [
134
+ "global",
135
+ "workspace",
136
+ "session"
137
+ ].flatMap((scope) => [
138
+ {
139
+ id: "workflow.screen",
140
+ scope,
141
+ basePath: "workflow",
142
+ path: `${root}/screen/stream`,
143
+ method: "GET",
144
+ authentication: "owner",
145
+ description: "Follow the workflow terminal.",
146
+ responses: {
147
+ "200": {
148
+ description: "SSE stream with JSON screen events.",
149
+ contentType: "text/event-stream",
150
+ schema: S,
151
+ events: { screen: Screen }
152
+ },
153
+ "404": {
154
+ description: "Run unavailable.",
155
+ schema: typebox.Type.Object({ error: S })
156
+ }
157
+ }
158
+ },
159
+ {
160
+ id: "workflow.control",
161
+ scope,
162
+ basePath: "workflow",
163
+ path: `${root}/control`,
164
+ method: "POST",
165
+ authentication: "owner",
166
+ description: "Take or release the keyboard.",
167
+ body: {
168
+ required: true,
169
+ contentType: "application/json",
170
+ schema: typebox.Type.Object({
171
+ release: O(B),
172
+ token: O(S)
173
+ })
174
+ },
175
+ responses: {
176
+ ...(0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(Control),
177
+ "409": {
178
+ description: "Keyboard unavailable.",
179
+ schema: Control
180
+ }
181
+ }
182
+ },
183
+ {
184
+ id: "workflow.keys",
185
+ scope,
186
+ basePath: "workflow",
187
+ path: `${root}/keys`,
188
+ method: "POST",
189
+ authentication: "owner",
190
+ description: "Write terminal data with the control token.",
191
+ body: {
192
+ required: true,
193
+ contentType: "application/json",
194
+ schema: typebox.Type.Object({
195
+ token: S,
196
+ data: S
197
+ })
198
+ },
199
+ responses: {
200
+ "204": { description: "Data written." },
201
+ "400": {
202
+ description: "Invalid request.",
203
+ schema: typebox.Type.Object({ error: S })
204
+ },
205
+ "409": {
206
+ description: "Write refused.",
207
+ schema: typebox.Type.Object({ error: S })
208
+ }
209
+ }
210
+ },
211
+ {
212
+ id: "workflow.resize",
213
+ scope,
214
+ basePath: "workflow",
215
+ path: `${root}/resize`,
216
+ method: "POST",
217
+ authentication: "owner",
218
+ description: "Resize the terminal.",
219
+ body: {
220
+ required: true,
221
+ contentType: "application/json",
222
+ schema: typebox.Type.Object({
223
+ token: S,
224
+ columns: N,
225
+ rows: N
226
+ })
227
+ },
228
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ resized: B }))
229
+ },
230
+ {
231
+ id: "workflow.delete",
232
+ scope,
233
+ basePath: "workflow",
234
+ path: root,
235
+ method: "DELETE",
236
+ authentication: "owner",
237
+ description: "Delete a settled run and its directory.",
238
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ deleted: typebox.Type.Literal(true) }))
239
+ },
240
+ {
241
+ id: "workflow.artifacts",
242
+ scope,
243
+ basePath: "workflow",
244
+ path: `${root}/artifacts`,
245
+ method: "GET",
246
+ authentication: "owner",
247
+ description: "List declared and discovered artifacts.",
248
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
249
+ runDir: S,
250
+ description: S,
251
+ artifacts: typebox.Type.Array(typebox.Type.Object({
252
+ ...Artifact,
253
+ declared: B,
254
+ state: values([
255
+ "written",
256
+ "empty",
257
+ "pending",
258
+ "unreadable"
259
+ ]),
260
+ size: O(N),
261
+ modifiedAt: O(S)
262
+ }))
263
+ }))
264
+ },
265
+ {
266
+ id: "workflow.artifact",
267
+ scope,
268
+ basePath: "workflow",
269
+ path: `${root}/artifacts/{name}`,
270
+ method: "GET",
271
+ authentication: "owner",
272
+ description: "Read artifact metadata and text. name may contain nested path segments. raw=1 streams binary with its media type and supports byte ranges.",
273
+ parameters: [
274
+ {
275
+ name: "raw",
276
+ in: "query",
277
+ required: false,
278
+ schema: values(["0", "1"])
279
+ },
280
+ {
281
+ name: "download",
282
+ in: "query",
283
+ required: false,
284
+ schema: values(["0", "1"])
285
+ },
286
+ {
287
+ name: "range",
288
+ in: "header",
289
+ required: false,
290
+ schema: S
291
+ }
292
+ ],
293
+ responses: {
294
+ ...(0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Union([typebox.Type.Object({
295
+ path: S,
296
+ size: N,
297
+ modifiedAt: S,
298
+ mimeType: O(S),
299
+ text: O(S),
300
+ truncated: B
301
+ }), S])),
302
+ "206": {
303
+ description: "Partial raw bytes.",
304
+ contentType: "application/octet-stream",
305
+ schema: S
306
+ },
307
+ "416": { description: "Unsatisfiable byte range." }
308
+ }
309
+ }
310
+ ]),
311
+ sockets: ["global", "workspace"].flatMap((scope) => [{
312
+ id: "workflow.runs",
313
+ scope,
314
+ service: "doompi.hub.v1",
315
+ member: "workflow_runs",
316
+ kind: "channel",
317
+ direction: "server-to-client",
318
+ description: "Workflow runs channel payload.",
319
+ input: WorkflowRunsSchema
320
+ }, {
321
+ id: "workflow.catalog",
322
+ scope,
323
+ service: "doompi.hub.v1",
324
+ member: "workflow_catalog",
325
+ kind: "channel",
326
+ direction: "server-to-client",
327
+ description: "Workflow catalog channel payload.",
328
+ input: WorkflowCatalogSchema
329
+ }])
330
+ });
331
+ //#endregion
332
+ exports.apiContracts = apiContracts;
333
+ exports.default = apiContracts;
334
+
335
+ //# sourceMappingURL=apiContracts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses, type DoomHttpContract } from '@agimon-ai/doompi-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst B = Type.Boolean();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Progress = values(['running', 'completed', 'skipped', 'failed', 'pause_requested', 'paused', 'resumed']);\nconst Step = { name: S, status: Progress, reason: O(S), group: O(S), startedAt: O(S), endedAt: O(S) };\nconst Run = Type.Object({\n runKey: S,\n workspace: S,\n displayName: S,\n workflowName: O(S),\n workflowPath: S,\n stage: values(['running', 'completed', 'error']),\n outcome: O(values(['success', 'skipped', 'failed', 'interrupted'])),\n executionState: O(values(['running', 'pause_requested', 'paused', 'resume_requested'])),\n prompt: O(S),\n startedAt: S,\n finishedAt: O(S),\n errorMessage: O(S),\n failedJob: O(S),\n stale: O(B),\n staleReason: O(S),\n worktreeBranch: O(S),\n position: O(Type.Object({ job: S, step: O(S), index: O(N), total: O(N) })),\n jobs: Type.Array(\n Type.Object({\n ...Step,\n phase: values(['pre', 'job', 'post']),\n index: O(N),\n total: O(N),\n steps: Type.Array(Type.Object(Step)),\n }),\n ),\n});\nexport const WorkflowRunsSchema = Type.Object({ runs: Type.Array(Run) });\nconst Artifact = { path: S, kind: values(['file', 'directory']), description: S, producedBy: Type.Array(S) };\nexport const WorkflowCatalogSchema = Type.Object({\n cwd: S,\n warning: O(S),\n workflows: Type.Array(\n Type.Object({\n path: S,\n relativePath: S,\n name: S,\n description: S,\n tags: Type.Array(S),\n triggers: Type.Array(S),\n inputs: Type.Array(\n Type.Object({\n name: S,\n description: O(S),\n required: O(B),\n default: O(S),\n type: O(S),\n options: O(Type.Array(S)),\n }),\n ),\n jobs: Type.Array(Type.Object({ name: S, steps: Type.Array(S) })),\n artifacts: Type.Array(Type.Object(Artifact)),\n runners: O(Type.Array(S)),\n commands: O(Type.Array(S)),\n choices: O(Type.Array(S)),\n error: O(S),\n }),\n ),\n});\nconst Screen = Type.Object({\n lines: Type.Array(S),\n capabilities: Type.Object({ readable: B, writable: B, resizable: B, reason: O(S) }),\n ended: O(B),\n});\nconst Control = Type.Object({ held: B, token: O(S), reason: O(S) });\nconst root = '/runs/{workspace}/{runKey}';\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: [],\n http: (['global', 'workspace', 'session'] as const).flatMap((scope): DoomHttpContract[] => [\n {\n id: 'workflow.screen',\n scope,\n basePath: 'workflow',\n path: `${root}/screen/stream`,\n method: 'GET',\n authentication: 'owner',\n description: 'Follow the workflow terminal.',\n responses: {\n '200': {\n description: 'SSE stream with JSON screen events.',\n contentType: 'text/event-stream',\n schema: S,\n events: { screen: Screen },\n },\n '404': { description: 'Run unavailable.', schema: Type.Object({ error: S }) },\n },\n },\n {\n id: 'workflow.control',\n scope,\n basePath: 'workflow',\n path: `${root}/control`,\n method: 'POST',\n authentication: 'owner',\n description: 'Take or release the keyboard.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ release: O(B), token: O(S) }) },\n responses: { ...jsonApiResponses(Control), '409': { description: 'Keyboard unavailable.', schema: Control } },\n },\n {\n id: 'workflow.keys',\n scope,\n basePath: 'workflow',\n path: `${root}/keys`,\n method: 'POST',\n authentication: 'owner',\n description: 'Write terminal data with the control token.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ token: S, data: S }) },\n responses: {\n '204': { description: 'Data written.' },\n '400': { description: 'Invalid request.', schema: Type.Object({ error: S }) },\n '409': { description: 'Write refused.', schema: Type.Object({ error: S }) },\n },\n },\n {\n id: 'workflow.resize',\n scope,\n basePath: 'workflow',\n path: `${root}/resize`,\n method: 'POST',\n authentication: 'owner',\n description: 'Resize the terminal.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ token: S, columns: N, rows: N }) },\n responses: jsonApiResponses(Type.Object({ resized: B })),\n },\n {\n id: 'workflow.delete',\n scope,\n basePath: 'workflow',\n path: root,\n method: 'DELETE',\n authentication: 'owner',\n description: 'Delete a settled run and its directory.',\n responses: jsonApiResponses(Type.Object({ deleted: Type.Literal(true) })),\n },\n {\n id: 'workflow.artifacts',\n scope,\n basePath: 'workflow',\n path: `${root}/artifacts`,\n method: 'GET',\n authentication: 'owner',\n description: 'List declared and discovered artifacts.',\n responses: jsonApiResponses(\n Type.Object({\n runDir: S,\n description: S,\n artifacts: Type.Array(\n Type.Object({\n ...Artifact,\n declared: B,\n state: values(['written', 'empty', 'pending', 'unreadable']),\n size: O(N),\n modifiedAt: O(S),\n }),\n ),\n }),\n ),\n },\n {\n id: 'workflow.artifact',\n scope,\n basePath: 'workflow',\n path: `${root}/artifacts/{name}`,\n method: 'GET',\n authentication: 'owner',\n description:\n 'Read artifact metadata and text. name may contain nested path segments. raw=1 streams binary with its media type and supports byte ranges.',\n parameters: [\n { name: 'raw', in: 'query', required: false, schema: values(['0', '1']) },\n { name: 'download', in: 'query', required: false, schema: values(['0', '1']) },\n { name: 'range', in: 'header', required: false, schema: S },\n ],\n responses: {\n ...jsonApiResponses(\n Type.Union([Type.Object({ path: S, size: N, modifiedAt: S, mimeType: O(S), text: O(S), truncated: B }), S]),\n ),\n '206': { description: 'Partial raw bytes.', contentType: 'application/octet-stream', schema: S },\n '416': { description: 'Unsatisfiable byte range.' },\n },\n },\n ]),\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'workflow.runs',\n scope,\n service: 'doompi.hub.v1',\n member: 'workflow_runs',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Workflow runs channel payload.',\n input: WorkflowRunsSchema,\n },\n {\n id: 'workflow.catalog',\n scope,\n service: 'doompi.hub.v1',\n member: 'workflow_catalog',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Workflow catalog channel payload.',\n input: WorkflowCatalogSchema,\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAM,IAAIA,QAAAA,KAAK,OAAO;AACtB,MAAM,IAAIA,QAAAA,KAAK,OAAO;AACtB,MAAM,IAAIA,QAAAA,KAAK,QAAQ;AACvB,MAAM,IAAIA,QAAAA,KAAK;AACf,MAAM,UAA4B,UAAeA,QAAAA,KAAK,MAAM,MAAM,KAAK,SAASA,QAAAA,KAAK,QAAQ,IAAI,CAAC,CAAC;AAEnG,MAAM,OAAO;CAAE,MAAM;CAAG,QADP,OAAO;EAAC;EAAW;EAAa;EAAW;EAAU;EAAmB;EAAU;CAAS,CACrE;CAAG,QAAQ,EAAE,CAAC;CAAG,OAAO,EAAE,CAAC;CAAG,WAAW,EAAE,CAAC;CAAG,SAAS,EAAE,CAAC;AAAE;AACpG,MAAM,MAAMA,QAAAA,KAAK,OAAO;CACtB,QAAQ;CACR,WAAW;CACX,aAAa;CACb,cAAc,EAAE,CAAC;CACjB,cAAc;CACd,OAAO,OAAO;EAAC;EAAW;EAAa;CAAO,CAAC;CAC/C,SAAS,EAAE,OAAO;EAAC;EAAW;EAAW;EAAU;CAAa,CAAC,CAAC;CAClE,gBAAgB,EAAE,OAAO;EAAC;EAAW;EAAmB;EAAU;CAAkB,CAAC,CAAC;CACtF,QAAQ,EAAE,CAAC;CACX,WAAW;CACX,YAAY,EAAE,CAAC;CACf,cAAc,EAAE,CAAC;CACjB,WAAW,EAAE,CAAC;CACd,OAAO,EAAE,CAAC;CACV,aAAa,EAAE,CAAC;CAChB,gBAAgB,EAAE,CAAC;CACnB,UAAU,EAAEA,QAAAA,KAAK,OAAO;EAAE,KAAK;EAAG,MAAM,EAAE,CAAC;EAAG,OAAO,EAAE,CAAC;EAAG,OAAO,EAAE,CAAC;CAAE,CAAC,CAAC;CACzE,MAAMA,QAAA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C3D,MAAM,EAAE,CAAC;KACT,YAAY,EAAE,CAAC;IACjB,CAAC,CACH;GACF,CAAC,CACH;EACF;EACA;GACE,IAAI;GACJ;GACA,UAAU;GACV,MAAM,GAAG,KAAK;GACd,QAAQ;GACR,gBAAgB;GAChB,aACE;GACF,YAAY;IACV;KAAE,MAAM;KAAO,IAAI;KAAS,UAAU;KAAO,QAAQ,OAAO,CAAC,KAAK,GAAG,CAAC;IAAE;IACxE;KAAE,MAAM;KAAY,IAAI;KAAS,UAAU;KAAO,QAAQ,OAAO,CAAC,KAAK,GAAG,CAAC;IAAE;IAC7E;KAAE,MAAM;KAAS,IAAI;KAAU,UAAU;KAAO,QAAQ;IAAE;GAC5D;GACA,WAAW;IACT,IAAA,GAAGE,oCAAAA,iBAAAA,CACDF,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,OAAO;KAAE,MAAM;KAAG,MAAM;KAAG,YAAY;KAAG,UAAU,EAAE,CAAC;KAAG,MAAM,EAAE,CAAC;KAAG,WAAW;IAAE,CAAC,GAAG,CAAC,CAAC,CAC5G;IACA,OAAO;KAAE,aAAa;KAAsB,aAAa;KAA4B,QAAQ;IAAE;IAC/F,OAAO,EAAE,aAAa,4BAA4B;GACpD;EACF;CACF,CAAC;CACD,SAAU,CAAC,UAAU,WAAW,CAAC,CAAW,SAAS,UAAU,CAC7D;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO;CACT,GACA;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO;CACT,CACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Type } from "typebox";
2
+ //#region src/schemas/apiContracts.d.ts
3
+ export declare const apiContracts: {
4
+ version: 1;
5
+ protocols?: Record<string, string> | undefined;
6
+ schemas?: Record<string, boolean | object> | undefined;
7
+ http: {
8
+ id: string;
9
+ scope: "global" | "session" | "workspace";
10
+ basePath?: string | undefined;
11
+ path: string;
12
+ method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
13
+ description: string;
14
+ availability?: string | undefined;
15
+ authentication: "device" | "none" | "owner";
16
+ parameters?: {
17
+ name: string;
18
+ in: "header" | "path" | "query";
19
+ required: boolean;
20
+ schema: boolean | object;
21
+ }[] | undefined;
22
+ body?: {
23
+ contentType: string;
24
+ contentTypes?: string[] | undefined;
25
+ required: boolean;
26
+ schema: boolean | object;
27
+ } | undefined;
28
+ responses: Record<string, {
29
+ description: string;
30
+ contentType?: string | undefined;
31
+ schema?: boolean | object | undefined;
32
+ events?: Record<string, boolean | object> | undefined;
33
+ }>;
34
+ }[];
35
+ sockets: {
36
+ id: string;
37
+ scope: "global" | "session" | "workspace";
38
+ description: string;
39
+ availability?: string | undefined;
40
+ service: string;
41
+ member: string;
42
+ direction: "client-to-server" | "server-to-client";
43
+ kind: "channel" | "method" | "state";
44
+ input: boolean | object;
45
+ output?: boolean | object | undefined;
46
+ errors?: boolean | object | undefined;
47
+ }[];
48
+ dynamic: string[];
49
+ gaps?: string[] | undefined;
50
+ };
51
+ //#endregion
52
+ export { apiContracts as default };
53
+ //# sourceMappingURL=apiContracts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBA6Ea"}