@agimon-ai/doompi-workflow 0.0.1-alpha.9 → 0.0.1-alpha.90
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/LICENSE +8 -0
- package/LICENSE.web +29 -0
- package/README.md +125 -26
- package/dist/apiContracts.cjs +332 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +327 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/extensions/pi.cjs +5353 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.mts +39 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +5348 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/extensions/server.cjs +1620 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +1612 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +3219 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.d.mts +52 -3
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/workflowLaunchCommand-7y8xg5YF.cjs +141 -0
- package/dist/workflowLaunchCommand-7y8xg5YF.cjs.map +1 -0
- package/dist/workflowLaunchCommand-Bhr-PvdD.mjs +118 -0
- package/dist/workflowLaunchCommand-Bhr-PvdD.mjs.map +1 -0
- package/dist/workflowTerminal-Bj4KKpoA.mjs +148 -0
- package/dist/workflowTerminal-Bj4KKpoA.mjs.map +1 -0
- package/dist/workflowTerminal-WM_cpxIO.cjs +200 -0
- package/dist/workflowTerminal-WM_cpxIO.cjs.map +1 -0
- package/llms.txt +16 -0
- package/package.json +92 -26
- package/src/prompts/doompi-author-workflow/SKILL.md +30 -0
- package/src/prompts/doompi-use-workflow/SKILL.md +21 -0
- package/src/types/webWorkflowTerminal.ts +93 -0
- package/src/types/webWorkflows.ts +150 -0
- package/dist/dispatcher.cjs +0 -2
- package/dist/dispatcher.cjs.map +0 -1
- package/dist/dispatcher.d.cts +0 -6
- package/dist/dispatcher.d.cts.map +0 -1
- package/dist/dispatcher.d.mts +0 -6
- package/dist/dispatcher.d.mts.map +0 -1
- package/dist/dispatcher.mjs +0 -2
- package/dist/dispatcher.mjs.map +0 -1
- package/dist/extension.cjs +0 -2
- package/dist/extension.cjs.map +0 -1
- package/dist/extension.d.cts +0 -6
- package/dist/extension.d.cts.map +0 -1
- package/dist/extension.d.mts +0 -6
- package/dist/extension.d.mts.map +0 -1
- package/dist/extension.mjs +0 -2
- package/dist/extension.mjs.map +0 -1
- package/dist/extensions/dispatcher.cjs +0 -2
- package/dist/extensions/dispatcher.cjs.map +0 -1
- package/dist/extensions/dispatcher.d.cts +0 -2
- package/dist/extensions/dispatcher.d.mts +0 -2
- package/dist/extensions/dispatcher.mjs +0 -2
- package/dist/extensions/dispatcher.mjs.map +0 -1
- package/dist/extensions/pi.d.cts +0 -2
- package/dist/index.d.cts +0 -3
- package/dist/leader.cjs +0 -2
- package/dist/leader.cjs.map +0 -1
- package/dist/leader.mjs +0 -2
- package/dist/leader.mjs.map +0 -1
- package/dist/types.cjs +0 -2
- package/dist/types.cjs.map +0 -1
- package/dist/types.mjs +0 -2
- package/dist/types.mjs.map +0 -1
- package/dist/workflow/backgroundWork.cjs +0 -2
- package/dist/workflow/backgroundWork.cjs.map +0 -1
- package/dist/workflow/backgroundWork.mjs +0 -2
- package/dist/workflow/backgroundWork.mjs.map +0 -1
- package/dist/workflow/doomOverlay.cjs +0 -2
- package/dist/workflow/doomOverlay.cjs.map +0 -1
- package/dist/workflow/doomOverlay.mjs +0 -2
- package/dist/workflow/doomOverlay.mjs.map +0 -1
- package/dist/workflow/overlayText.cjs +0 -2
- package/dist/workflow/overlayText.cjs.map +0 -1
- package/dist/workflow/overlayText.mjs +0 -2
- package/dist/workflow/overlayText.mjs.map +0 -1
- package/dist/workflow/piExtension.cjs +0 -11
- package/dist/workflow/piExtension.cjs.map +0 -1
- package/dist/workflow/piExtension.mjs +0 -11
- package/dist/workflow/piExtension.mjs.map +0 -1
- package/dist/workflow/piToolBridge.cjs +0 -11
- package/dist/workflow/piToolBridge.cjs.map +0 -1
- package/dist/workflow/piToolBridge.mjs +0 -11
- package/dist/workflow/piToolBridge.mjs.map +0 -1
- package/dist/workflow/piTools.cjs +0 -4
- package/dist/workflow/piTools.cjs.map +0 -1
- package/dist/workflow/piTools.mjs +0 -4
- package/dist/workflow/piTools.mjs.map +0 -1
- package/dist/workflow/rendering.cjs +0 -2
- package/dist/workflow/rendering.cjs.map +0 -1
- package/dist/workflow/rendering.mjs +0 -2
- package/dist/workflow/rendering.mjs.map +0 -1
- package/dist/workflow/workflowFooterStatus.cjs +0 -2
- package/dist/workflow/workflowFooterStatus.cjs.map +0 -1
- package/dist/workflow/workflowFooterStatus.mjs +0 -2
- package/dist/workflow/workflowFooterStatus.mjs.map +0 -1
- package/dist/workflow/workflowInspector.cjs +0 -2
- package/dist/workflow/workflowInspector.cjs.map +0 -1
- package/dist/workflow/workflowInspector.mjs +0 -2
- package/dist/workflow/workflowInspector.mjs.map +0 -1
- package/dist/workflow/workflowLauncher.cjs +0 -2
- package/dist/workflow/workflowLauncher.cjs.map +0 -1
- package/dist/workflow/workflowLauncher.mjs +0 -2
- package/dist/workflow/workflowLauncher.mjs.map +0 -1
- package/dist/workflow/workflowOverlay.cjs +0 -2
- package/dist/workflow/workflowOverlay.cjs.map +0 -1
- package/dist/workflow/workflowOverlay.mjs +0 -2
- package/dist/workflow/workflowOverlay.mjs.map +0 -1
- package/dist/workflow/workflowPicker.cjs +0 -2
- package/dist/workflow/workflowPicker.cjs.map +0 -1
- package/dist/workflow/workflowPicker.mjs +0 -2
- package/dist/workflow/workflowPicker.mjs.map +0 -1
- package/dist/workflow/workflowPrompt.cjs +0 -2
- package/dist/workflow/workflowPrompt.cjs.map +0 -1
- package/dist/workflow/workflowPrompt.mjs +0 -2
- package/dist/workflow/workflowPrompt.mjs.map +0 -1
- package/dist/workflow/workflowRunPanel.cjs +0 -2
- package/dist/workflow/workflowRunPanel.cjs.map +0 -1
- package/dist/workflow/workflowRunPanel.mjs +0 -2
- package/dist/workflow/workflowRunPanel.mjs.map +0 -1
- package/dist/workflow/workflowStatusRow.cjs +0 -2
- package/dist/workflow/workflowStatusRow.cjs.map +0 -1
- package/dist/workflow/workflowStatusRow.mjs +0 -2
- package/dist/workflow/workflowStatusRow.mjs.map +0 -1
- package/dist/workflow/workflowStepMessage.cjs +0 -2
- package/dist/workflow/workflowStepMessage.cjs.map +0 -1
- package/dist/workflow/workflowStepMessage.mjs +0 -2
- package/dist/workflow/workflowStepMessage.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,146 @@
|
|
|
1
1
|
# @agimon-ai/doompi-workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Discover, launch, monitor, control, and recover asynchronous DoomPi workflows.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 0.85.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
|
-
|
|
23
|
+
pi install npm:@agimon-ai/doompi-workflow
|
|
17
24
|
```
|
|
18
25
|
|
|
19
|
-
|
|
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
|
+
## Launch and monitor
|
|
54
|
+
|
|
55
|
+
Core tools are:
|
|
20
56
|
|
|
21
|
-
|
|
22
|
-
|
|
57
|
+
- `list_workflows`: discover workflows.
|
|
58
|
+
- `launch_workflow`: register and start an asynchronous run.
|
|
59
|
+
- `workflow_run`: inspect or control a run through supported actions.
|
|
23
60
|
|
|
24
|
-
|
|
61
|
+
Launch returns after the run is registered, not after all jobs complete. Use status and follow
|
|
62
|
+
controls for progress, and wait for a terminal notification.
|
|
25
63
|
|
|
26
|
-
|
|
64
|
+
In the TUI, `SPC w l` lists the repository's workflows and launches the one under the cursor with
|
|
65
|
+
`r`, `SPC w r` inspects this session's runs, `SPC w c` opens recovery, and `SPC w e`
|
|
66
|
+
toggles model-visible tools. The root session can launch; child sessions can inspect the catalog but
|
|
67
|
+
do not receive an unrestricted workflow factory.
|
|
27
68
|
|
|
28
|
-
|
|
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.
|
|
69
|
+
## Storage, concurrency, and lifecycle
|
|
30
70
|
|
|
31
|
-
|
|
71
|
+
Registry data defaults to `$HOME/.workflow-mcp`; set `WORKFLOW_MCP_HOME` to relocate it. Persisted
|
|
72
|
+
records contain workflow and run identity, job and step state, ownership, output locations, and
|
|
73
|
+
recovery evidence. The default concurrency ceiling is five runs.
|
|
74
|
+
|
|
75
|
+
Runs embedded directly in the Pi process end with that process. Runs launched through a terminal
|
|
76
|
+
host such as tmux or cmux can have a different lifetime and remain manageable from the CLI. When
|
|
77
|
+
Team is loaded, Workflow contributes active session runs through Team's `doom/background-work`
|
|
78
|
+
service. That contribution reconnects after Team is replaced and is removed when Workflow unloads.
|
|
79
|
+
Reconciliation distinguishes stale registry records from live processes; do not assume every run
|
|
80
|
+
outlives its parent session.
|
|
81
|
+
|
|
82
|
+
Each workflow or repair step can launch commands and model-backed agents, consuming provider quota
|
|
83
|
+
and repeating external side effects.
|
|
84
|
+
|
|
85
|
+
## Recovery
|
|
86
|
+
|
|
87
|
+
Recovery is available only for records in a terminal failure state. A recovery claim atomically
|
|
88
|
+
adopts the eligible failure, validates the evidence, and transfers ownership to the replay session.
|
|
89
|
+
Live controls remain scoped to the owning session. Recovery does not launch a second copy beside a
|
|
90
|
+
still-running job and does not guarantee that parent-session work survives shutdown.
|
|
91
|
+
|
|
92
|
+
The package publishes `workflow-recovery` for active Workflow mode. While parent Help mode is
|
|
93
|
+
active, it also contributes `doompi-author-workflow` for writing workflow definitions and
|
|
94
|
+
`doompi-use-workflow` for launching, monitoring, and recovering runs. Deactivating Help hides both
|
|
95
|
+
descriptors; cached files may remain.
|
|
96
|
+
|
|
97
|
+
Each Pi extension instance uses the runner's shared Doom lifecycle. Reload or shutdown stops retained
|
|
98
|
+
callbacks, interrupts bounded inline work, removes UI and service registrations, and releases
|
|
99
|
+
package resources. Detached children load the same extension entry in their own process.
|
|
100
|
+
|
|
101
|
+
## Pi extension
|
|
102
|
+
|
|
103
|
+
The Pi extension is published at `@agimon-ai/doompi-workflow/extensions/pi` and declared in
|
|
104
|
+
`package.json.pi.extensions`. Installing the package loads it automatically; there is no secondary
|
|
105
|
+
registration or dispatcher export.
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pnpm build
|
|
111
|
+
pnpm typecheck
|
|
112
|
+
pnpm test
|
|
113
|
+
pnpm lint
|
|
114
|
+
```
|
|
32
115
|
|
|
33
|
-
|
|
34
|
-
root session, so a subagent can look but not spawn.
|
|
116
|
+
Maintained by [Agimon](https://agimon.ai/about).
|
|
35
117
|
|
|
36
|
-
##
|
|
118
|
+
## Web cockpit plugin
|
|
37
119
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
120
|
+
The `.web` routed files under `src/extensions/workspaces/sessions/(frontend)` are this package's
|
|
121
|
+
DoomPi web cockpit plugin: the workflows panel the dock's workflows group opens in a temporary tab,
|
|
122
|
+
its store, and its `workflow_runs` session channel, compiled into the cockpit bundle by
|
|
123
|
+
`doompi-web`'s build. Each surface keeps its components in a colocated `_components` folder and its
|
|
124
|
+
stores and helpers in `_lib`.
|
|
125
|
+
The hub-side data source ships behind the `./web-hub` subpath and reads the workflow registry
|
|
126
|
+
(run.json plus progress.ndjson) exactly as the engine writes it. Both halves are declared by the
|
|
127
|
+
`doompiWeb` block in package.json.
|
|
44
128
|
|
|
45
129
|
## License
|
|
46
130
|
|
|
47
|
-
MIT
|
|
131
|
+
MIT, except this package's browser half (the `.web` routed files under `src/extensions` and the
|
|
132
|
+
`_components` and `_lib` modules colocated with one), which is source available under the DoomPi
|
|
133
|
+
Web License (see `LICENSE.web`): free to use, including commercially, but not to redistribute.
|
|
134
|
+
|
|
135
|
+
Workflow's host entries live in `src/extensions/pi.ts`, `server.ts`, and `web.ts`.
|
|
136
|
+
`src/exports` exposes reusable package APIs. Controllers declare server APIs and
|
|
137
|
+
contributions, tools declare native tools, and each service has its own folder.
|
|
138
|
+
Terminal presentation and its session coordinator live in `src/tui`.
|
|
139
|
+
|
|
140
|
+
The Pi helper owns registrations and service fibers. The Workflow runtime returns
|
|
141
|
+
commands, events, mode ownership, and tool dependencies. Session startup begins
|
|
142
|
+
readiness discovery; dependent calls await that session's readiness. On shutdown,
|
|
143
|
+
`onStop` interrupts inline runs and clears session resources, while `onDispose`
|
|
144
|
+
also handles startup failure. Both use the same idempotent cleanup. A generation
|
|
145
|
+
fence prevents retired callbacks from sending messages or updating the UI; only
|
|
146
|
+
explicit resource teardown may use a retired UI context.
|
|
@@ -0,0 +1,332 @@
|
|
|
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
|
+
startedAt: O(S),
|
|
26
|
+
endedAt: O(S)
|
|
27
|
+
};
|
|
28
|
+
const Run = typebox.Type.Object({
|
|
29
|
+
runKey: S,
|
|
30
|
+
workspace: S,
|
|
31
|
+
displayName: S,
|
|
32
|
+
workflowName: O(S),
|
|
33
|
+
workflowPath: S,
|
|
34
|
+
stage: values([
|
|
35
|
+
"running",
|
|
36
|
+
"completed",
|
|
37
|
+
"error"
|
|
38
|
+
]),
|
|
39
|
+
outcome: O(values([
|
|
40
|
+
"success",
|
|
41
|
+
"skipped",
|
|
42
|
+
"failed",
|
|
43
|
+
"interrupted"
|
|
44
|
+
])),
|
|
45
|
+
executionState: O(values([
|
|
46
|
+
"running",
|
|
47
|
+
"pause_requested",
|
|
48
|
+
"paused",
|
|
49
|
+
"resume_requested"
|
|
50
|
+
])),
|
|
51
|
+
prompt: O(S),
|
|
52
|
+
startedAt: S,
|
|
53
|
+
finishedAt: O(S),
|
|
54
|
+
errorMessage: O(S),
|
|
55
|
+
failedJob: O(S),
|
|
56
|
+
stale: O(B),
|
|
57
|
+
staleReason: O(S),
|
|
58
|
+
worktreeBranch: O(S),
|
|
59
|
+
position: O(typebox.Type.Object({
|
|
60
|
+
job: S,
|
|
61
|
+
step: O(S),
|
|
62
|
+
index: O(N),
|
|
63
|
+
total: O(N)
|
|
64
|
+
})),
|
|
65
|
+
jobs: typebox.Type.Array(typebox.Type.Object({
|
|
66
|
+
...Step,
|
|
67
|
+
phase: values([
|
|
68
|
+
"pre",
|
|
69
|
+
"job",
|
|
70
|
+
"post"
|
|
71
|
+
]),
|
|
72
|
+
index: O(N),
|
|
73
|
+
total: O(N),
|
|
74
|
+
steps: typebox.Type.Array(typebox.Type.Object(Step))
|
|
75
|
+
}))
|
|
76
|
+
});
|
|
77
|
+
const WorkflowRunsSchema = typebox.Type.Object({ runs: typebox.Type.Array(Run) });
|
|
78
|
+
const Artifact = {
|
|
79
|
+
path: S,
|
|
80
|
+
kind: values(["file", "directory"]),
|
|
81
|
+
description: S,
|
|
82
|
+
producedBy: typebox.Type.Array(S)
|
|
83
|
+
};
|
|
84
|
+
const WorkflowCatalogSchema = typebox.Type.Object({
|
|
85
|
+
cwd: S,
|
|
86
|
+
warning: O(S),
|
|
87
|
+
workflows: typebox.Type.Array(typebox.Type.Object({
|
|
88
|
+
path: S,
|
|
89
|
+
relativePath: S,
|
|
90
|
+
name: S,
|
|
91
|
+
description: S,
|
|
92
|
+
tags: typebox.Type.Array(S),
|
|
93
|
+
triggers: typebox.Type.Array(S),
|
|
94
|
+
inputs: typebox.Type.Array(typebox.Type.Object({
|
|
95
|
+
name: S,
|
|
96
|
+
description: O(S),
|
|
97
|
+
required: O(B),
|
|
98
|
+
default: O(S),
|
|
99
|
+
type: O(S),
|
|
100
|
+
options: O(typebox.Type.Array(S))
|
|
101
|
+
})),
|
|
102
|
+
jobs: typebox.Type.Array(typebox.Type.Object({
|
|
103
|
+
name: S,
|
|
104
|
+
steps: typebox.Type.Array(S)
|
|
105
|
+
})),
|
|
106
|
+
artifacts: typebox.Type.Array(typebox.Type.Object(Artifact)),
|
|
107
|
+
runners: O(typebox.Type.Array(S)),
|
|
108
|
+
error: O(S)
|
|
109
|
+
}))
|
|
110
|
+
});
|
|
111
|
+
const Screen = typebox.Type.Object({
|
|
112
|
+
lines: typebox.Type.Array(S),
|
|
113
|
+
capabilities: typebox.Type.Object({
|
|
114
|
+
readable: B,
|
|
115
|
+
writable: B,
|
|
116
|
+
resizable: B,
|
|
117
|
+
reason: O(S)
|
|
118
|
+
}),
|
|
119
|
+
ended: O(B)
|
|
120
|
+
});
|
|
121
|
+
const Control = typebox.Type.Object({
|
|
122
|
+
held: B,
|
|
123
|
+
token: O(S),
|
|
124
|
+
reason: O(S)
|
|
125
|
+
});
|
|
126
|
+
const root = "/runs/{workspace}/{runKey}";
|
|
127
|
+
const apiContracts = (0, _agimon_ai_doompi_core_apiContracts.defineApiContract)({
|
|
128
|
+
version: 1,
|
|
129
|
+
dynamic: [],
|
|
130
|
+
http: [
|
|
131
|
+
"global",
|
|
132
|
+
"workspace",
|
|
133
|
+
"session"
|
|
134
|
+
].flatMap((scope) => [
|
|
135
|
+
{
|
|
136
|
+
id: "workflow.screen",
|
|
137
|
+
scope,
|
|
138
|
+
basePath: "workflow",
|
|
139
|
+
path: `${root}/screen/stream`,
|
|
140
|
+
method: "GET",
|
|
141
|
+
authentication: "owner",
|
|
142
|
+
description: "Follow the workflow terminal.",
|
|
143
|
+
responses: {
|
|
144
|
+
"200": {
|
|
145
|
+
description: "SSE stream with JSON screen events.",
|
|
146
|
+
contentType: "text/event-stream",
|
|
147
|
+
schema: S,
|
|
148
|
+
events: { screen: Screen }
|
|
149
|
+
},
|
|
150
|
+
"404": {
|
|
151
|
+
description: "Run unavailable.",
|
|
152
|
+
schema: typebox.Type.Object({ error: S })
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "workflow.control",
|
|
158
|
+
scope,
|
|
159
|
+
basePath: "workflow",
|
|
160
|
+
path: `${root}/control`,
|
|
161
|
+
method: "POST",
|
|
162
|
+
authentication: "owner",
|
|
163
|
+
description: "Take or release the keyboard.",
|
|
164
|
+
body: {
|
|
165
|
+
required: true,
|
|
166
|
+
contentType: "application/json",
|
|
167
|
+
schema: typebox.Type.Object({
|
|
168
|
+
release: O(B),
|
|
169
|
+
token: O(S)
|
|
170
|
+
})
|
|
171
|
+
},
|
|
172
|
+
responses: {
|
|
173
|
+
...(0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(Control),
|
|
174
|
+
"409": {
|
|
175
|
+
description: "Keyboard unavailable.",
|
|
176
|
+
schema: Control
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "workflow.keys",
|
|
182
|
+
scope,
|
|
183
|
+
basePath: "workflow",
|
|
184
|
+
path: `${root}/keys`,
|
|
185
|
+
method: "POST",
|
|
186
|
+
authentication: "owner",
|
|
187
|
+
description: "Write terminal data with the control token.",
|
|
188
|
+
body: {
|
|
189
|
+
required: true,
|
|
190
|
+
contentType: "application/json",
|
|
191
|
+
schema: typebox.Type.Object({
|
|
192
|
+
token: S,
|
|
193
|
+
data: S
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
responses: {
|
|
197
|
+
"204": { description: "Data written." },
|
|
198
|
+
"400": {
|
|
199
|
+
description: "Invalid request.",
|
|
200
|
+
schema: typebox.Type.Object({ error: S })
|
|
201
|
+
},
|
|
202
|
+
"409": {
|
|
203
|
+
description: "Write refused.",
|
|
204
|
+
schema: typebox.Type.Object({ error: S })
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: "workflow.resize",
|
|
210
|
+
scope,
|
|
211
|
+
basePath: "workflow",
|
|
212
|
+
path: `${root}/resize`,
|
|
213
|
+
method: "POST",
|
|
214
|
+
authentication: "owner",
|
|
215
|
+
description: "Resize the terminal.",
|
|
216
|
+
body: {
|
|
217
|
+
required: true,
|
|
218
|
+
contentType: "application/json",
|
|
219
|
+
schema: typebox.Type.Object({
|
|
220
|
+
token: S,
|
|
221
|
+
columns: N,
|
|
222
|
+
rows: N
|
|
223
|
+
})
|
|
224
|
+
},
|
|
225
|
+
responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ resized: B }))
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: "workflow.delete",
|
|
229
|
+
scope,
|
|
230
|
+
basePath: "workflow",
|
|
231
|
+
path: root,
|
|
232
|
+
method: "DELETE",
|
|
233
|
+
authentication: "owner",
|
|
234
|
+
description: "Delete a settled run and its directory.",
|
|
235
|
+
responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ deleted: typebox.Type.Literal(true) }))
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: "workflow.artifacts",
|
|
239
|
+
scope,
|
|
240
|
+
basePath: "workflow",
|
|
241
|
+
path: `${root}/artifacts`,
|
|
242
|
+
method: "GET",
|
|
243
|
+
authentication: "owner",
|
|
244
|
+
description: "List declared and discovered artifacts.",
|
|
245
|
+
responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
|
|
246
|
+
runDir: S,
|
|
247
|
+
description: S,
|
|
248
|
+
artifacts: typebox.Type.Array(typebox.Type.Object({
|
|
249
|
+
...Artifact,
|
|
250
|
+
declared: B,
|
|
251
|
+
state: values([
|
|
252
|
+
"written",
|
|
253
|
+
"empty",
|
|
254
|
+
"pending",
|
|
255
|
+
"unreadable"
|
|
256
|
+
]),
|
|
257
|
+
size: O(N),
|
|
258
|
+
modifiedAt: O(S)
|
|
259
|
+
}))
|
|
260
|
+
}))
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: "workflow.artifact",
|
|
264
|
+
scope,
|
|
265
|
+
basePath: "workflow",
|
|
266
|
+
path: `${root}/artifacts/{name}`,
|
|
267
|
+
method: "GET",
|
|
268
|
+
authentication: "owner",
|
|
269
|
+
description: "Read artifact metadata and text. name may contain nested path segments. raw=1 streams binary with its media type and supports byte ranges.",
|
|
270
|
+
parameters: [
|
|
271
|
+
{
|
|
272
|
+
name: "raw",
|
|
273
|
+
in: "query",
|
|
274
|
+
required: false,
|
|
275
|
+
schema: values(["0", "1"])
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "download",
|
|
279
|
+
in: "query",
|
|
280
|
+
required: false,
|
|
281
|
+
schema: values(["0", "1"])
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "range",
|
|
285
|
+
in: "header",
|
|
286
|
+
required: false,
|
|
287
|
+
schema: S
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
responses: {
|
|
291
|
+
...(0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Union([typebox.Type.Object({
|
|
292
|
+
path: S,
|
|
293
|
+
size: N,
|
|
294
|
+
modifiedAt: S,
|
|
295
|
+
mimeType: O(S),
|
|
296
|
+
text: O(S),
|
|
297
|
+
truncated: B
|
|
298
|
+
}), S])),
|
|
299
|
+
"206": {
|
|
300
|
+
description: "Partial raw bytes.",
|
|
301
|
+
contentType: "application/octet-stream",
|
|
302
|
+
schema: S
|
|
303
|
+
},
|
|
304
|
+
"416": { description: "Unsatisfiable byte range." }
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
]),
|
|
308
|
+
sockets: ["global", "workspace"].flatMap((scope) => [{
|
|
309
|
+
id: "workflow.runs",
|
|
310
|
+
scope,
|
|
311
|
+
service: "doompi.hub.v1",
|
|
312
|
+
member: "workflow_runs",
|
|
313
|
+
kind: "channel",
|
|
314
|
+
direction: "server-to-client",
|
|
315
|
+
description: "Workflow runs channel payload.",
|
|
316
|
+
input: WorkflowRunsSchema
|
|
317
|
+
}, {
|
|
318
|
+
id: "workflow.catalog",
|
|
319
|
+
scope,
|
|
320
|
+
service: "doompi.hub.v1",
|
|
321
|
+
member: "workflow_catalog",
|
|
322
|
+
kind: "channel",
|
|
323
|
+
direction: "server-to-client",
|
|
324
|
+
description: "Workflow catalog channel payload.",
|
|
325
|
+
input: WorkflowCatalogSchema
|
|
326
|
+
}])
|
|
327
|
+
});
|
|
328
|
+
//#endregion
|
|
329
|
+
exports.apiContracts = apiContracts;
|
|
330
|
+
exports.default = apiContracts;
|
|
331
|
+
|
|
332
|
+
//# 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), 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 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,WAAW,EAAE,CAAC;CAAG,SAAS,EAAE,CAAC;AAAE;AACvF,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,QAAAA,KAAK,MACTA,QAAAA,KAAK,OAAO;EACV,GAAG;EACH,OAAO,OAAO;GAAC;GA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ACE;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":";;qBA2Ea"}
|