@skastr0/prism-darwin-x64 0.3.5 → 0.4.2
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/bin/prism +0 -0
- package/package.json +2 -3
- package/types/content-hash.d.ts +0 -14
- package/types/index.d.ts +0 -16
- package/types/lowerer-capabilities.d.ts +76 -72
- package/types/types.d.ts +4 -11
- package/types/workflow-bun-runtime.d.ts +21 -3
- package/types/workflow-data-governance.d.ts +43 -0
- package/types/workflow-data-policy.d.ts +39 -0
- package/types/workflow-errors.d.ts +36 -1
- package/types/workflow-harness-detection.d.ts +2 -0
- package/types/workflow-identity.d.ts +12 -0
- package/types/workflow-runner-log.d.ts +34 -0
- package/types/workflow-runner.d.ts +11 -2
- package/types/workflow-runtime.d.ts +11 -2
- package/types/workflow-session.d.ts +15 -5
- package/types/workflow-store.d.ts +191 -7
- package/types/workflow-usage.d.ts +21 -0
- package/types/workflow-worker-metadata.d.ts +16 -0
- package/types/workflows.d.ts +22 -1
package/bin/prism
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skastr0/prism-darwin-x64",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Prism standalone CLI binary for macOS x64.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@modelcontextprotocol/sdk": "1.29.0",
|
|
21
20
|
"@opencode-ai/plugin": "^1.15.13",
|
|
22
21
|
"@opentui/core-darwin-x64": "0.4.1",
|
|
23
|
-
"@skastr0/prism-sdk": "0.
|
|
22
|
+
"@skastr0/prism-sdk": "0.4.2",
|
|
24
23
|
"effect": "^3.21.1",
|
|
25
24
|
"typescript": "^5.8.3",
|
|
26
25
|
"zod": "4.4.3"
|
package/types/content-hash.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
1
|
export declare const computeContentHash: (content: string | Uint8Array) => string;
|
|
2
|
-
/**
|
|
3
|
-
* Normalizes the dynamic `mcpServers[*].url` authority (host:port) out of a
|
|
4
|
-
* generated MCP HTTP config before hashing, so an owner daemon rebinding to a
|
|
5
|
-
* different ephemeral port is never mistaken for content drift. Detection is
|
|
6
|
-
* purely structural (`{ mcpServers: { url: "http(s)://..." } }`); content that
|
|
7
|
-
* does not match this shape is returned unchanged.
|
|
8
|
-
*/
|
|
9
|
-
export declare const normalizeMcpHttpConfigForHash: (content: string) => string;
|
|
10
|
-
/**
|
|
11
|
-
* Content hash for a generated MCP HTTP config owned file. Equal for two
|
|
12
|
-
* renders that differ only in the dynamic port/url authority; still differs
|
|
13
|
-
* for a genuine content change (e.g. an added/removed server entry).
|
|
14
|
-
*/
|
|
15
|
-
export declare const computeMcpHttpConfigContentHash: (content: string) => string;
|
package/types/index.d.ts
CHANGED
|
@@ -562,20 +562,4 @@ export declare const hookMatcher: {
|
|
|
562
562
|
readonly canonical: (ref: string) => HookCanonicalToolMatcherDefinition;
|
|
563
563
|
};
|
|
564
564
|
};
|
|
565
|
-
/** Transitional identity wrapper. The canonical public source type is `AgentSource`. */
|
|
566
|
-
export declare const defineAgent: <T extends AgentSource>(agent: T) => T;
|
|
567
|
-
/** Transitional identity wrapper. The canonical public source type is `TraitSource`. */
|
|
568
|
-
export declare const defineTrait: <T extends TraitSource>(trait: T) => T;
|
|
569
|
-
/** Transitional identity wrapper. The canonical public source type is `OrbitSource`. */
|
|
570
|
-
export declare const defineOrbit: <T extends OrbitSource>(orbit: T) => T;
|
|
571
|
-
/** Transitional identity wrapper. The canonical public source type is `ToolSource`. */
|
|
572
|
-
export declare const defineTool: <T extends ToolSource>(tool: T) => T;
|
|
573
|
-
/** Transitional identity wrapper. The canonical public source type is `ToolspaceSource`. */
|
|
574
|
-
export declare const defineToolspace: <T extends ToolspaceSource>(toolspace: T) => T;
|
|
575
|
-
/** Transitional identity wrapper. The canonical public source type is `ModelspaceSource`. */
|
|
576
|
-
export declare const defineModelspace: <T extends ModelspaceSource>(modelspace: T) => T;
|
|
577
|
-
/** Transitional identity wrapper. The canonical public source type is `SkillspaceSource`. */
|
|
578
|
-
export declare const defineSkillspace: <T extends SkillspaceSource>(skillspace: T) => T;
|
|
579
|
-
/** Transitional identity wrapper. The canonical public source type is `HookSource`. */
|
|
580
|
-
export declare const defineHook: <E extends HookEvent, T extends HookSource<E>>(hook: T) => T;
|
|
581
565
|
export type { ToolRuntimeContext, ToolRuntimeCost } from "./compile/runtime/schema-bridge";
|
|
@@ -10,9 +10,9 @@ export interface CompileTargetCapabilities {
|
|
|
10
10
|
readonly hooks: CompileSurfaceSupport;
|
|
11
11
|
readonly skillPermissions: SkillPermissionSupport;
|
|
12
12
|
}
|
|
13
|
-
export declare const LOWERER_SURFACE_IDS: readonly ["pluginBundle", "rules", "commands", "agents", "skills", "generatedTools", "hooks", "
|
|
13
|
+
export declare const LOWERER_SURFACE_IDS: readonly ["pluginBundle", "rules", "commands", "agents", "skills", "generatedTools", "hooks", "agentConfig"];
|
|
14
14
|
export type LowererSurfaceId = (typeof LOWERER_SURFACE_IDS)[number];
|
|
15
|
-
export declare const LOWERER_SURFACE_KINDS: readonly ["native-plugin-api", "native-plugin-bundle", "
|
|
15
|
+
export declare const LOWERER_SURFACE_KINDS: readonly ["native-plugin-api", "native-plugin-bundle", "markdown-file", "direct-file", "config-patch", "unsupported"];
|
|
16
16
|
export type LowererSurfaceKind = (typeof LOWERER_SURFACE_KINDS)[number];
|
|
17
17
|
export type HarnessFamily = "coding-harness" | "claw-harness";
|
|
18
18
|
export interface LowererSurfaceCapability {
|
|
@@ -68,20 +68,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
68
68
|
readonly summary: "Compile bundles targeted skills and orbit skills as Agent Skills.";
|
|
69
69
|
};
|
|
70
70
|
readonly generatedTools: {
|
|
71
|
-
readonly kind: "
|
|
72
|
-
readonly path: "<prism-home>/runtime/
|
|
73
|
-
readonly summary: "Canonical tools lower to the
|
|
71
|
+
readonly kind: "direct-file";
|
|
72
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
73
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
74
74
|
};
|
|
75
75
|
readonly hooks: {
|
|
76
76
|
readonly kind: "native-plugin-bundle";
|
|
77
77
|
readonly path: "<generated-plugin>/hooks/hooks.json";
|
|
78
78
|
readonly summary: "Hooks are bundled in Claude Code's plugin hook layout.";
|
|
79
79
|
};
|
|
80
|
-
readonly mcpConfig: {
|
|
81
|
-
readonly kind: "native-plugin-bundle";
|
|
82
|
-
readonly path: "<generated-plugin>/.mcp.json";
|
|
83
|
-
readonly summary: "MCP config is plugin-local, not a global settings patch.";
|
|
84
|
-
};
|
|
85
80
|
readonly agentConfig: LowererSurfaceCapability;
|
|
86
81
|
};
|
|
87
82
|
};
|
|
@@ -126,7 +121,6 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
126
121
|
readonly path: "<generated-plugin>/dist/server.mjs";
|
|
127
122
|
readonly summary: "Hooks lower through the OpenCode plugin API.";
|
|
128
123
|
};
|
|
129
|
-
readonly mcpConfig: LowererSurfaceCapability;
|
|
130
124
|
readonly agentConfig: {
|
|
131
125
|
readonly kind: "config-patch";
|
|
132
126
|
readonly path: "<opencode-root>/opencode.json#agent.<name>";
|
|
@@ -151,7 +145,6 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
151
145
|
};
|
|
152
146
|
readonly generatedTools: LowererSurfaceCapability;
|
|
153
147
|
readonly hooks: LowererSurfaceCapability;
|
|
154
|
-
readonly mcpConfig: LowererSurfaceCapability;
|
|
155
148
|
readonly agentConfig: LowererSurfaceCapability;
|
|
156
149
|
};
|
|
157
150
|
readonly notes: readonly ["OpenClaw remains Prism skills-only for now."];
|
|
@@ -172,20 +165,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
172
165
|
readonly summary: "Install and compile write Hermes skill folders.";
|
|
173
166
|
};
|
|
174
167
|
readonly generatedTools: {
|
|
175
|
-
readonly kind: "
|
|
176
|
-
readonly path: "<prism-home>/runtime/
|
|
177
|
-
readonly summary: "Canonical tools lower to the
|
|
168
|
+
readonly kind: "direct-file";
|
|
169
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
170
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
178
171
|
};
|
|
179
172
|
readonly hooks: {
|
|
180
173
|
readonly kind: "config-patch";
|
|
181
174
|
readonly path: "<hermes-root>/config.yaml#hooks";
|
|
182
175
|
readonly summary: "Compile patches managed Hermes hook entries and wrapper files.";
|
|
183
176
|
};
|
|
184
|
-
readonly mcpConfig: {
|
|
185
|
-
readonly kind: "config-patch";
|
|
186
|
-
readonly path: "<hermes-root>/config.yaml#mcp_servers";
|
|
187
|
-
readonly summary: "Compile patches the Hermes MCP server map.";
|
|
188
|
-
};
|
|
189
177
|
readonly agentConfig: LowererSurfaceCapability;
|
|
190
178
|
};
|
|
191
179
|
};
|
|
@@ -217,20 +205,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
217
205
|
readonly summary: "Install and compile write Agent Skill folders.";
|
|
218
206
|
};
|
|
219
207
|
readonly generatedTools: {
|
|
220
|
-
readonly kind: "
|
|
221
|
-
readonly path: "<prism-home>/runtime/
|
|
222
|
-
readonly summary: "Canonical tools lower to the
|
|
208
|
+
readonly kind: "direct-file";
|
|
209
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
210
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
223
211
|
};
|
|
224
212
|
readonly hooks: {
|
|
225
213
|
readonly kind: "config-patch";
|
|
226
214
|
readonly path: "<codex-root>/config.toml#hooks";
|
|
227
215
|
readonly summary: "Compile patches managed Codex hook entries and wrapper files.";
|
|
228
216
|
};
|
|
229
|
-
readonly mcpConfig: {
|
|
230
|
-
readonly kind: "config-patch";
|
|
231
|
-
readonly path: "<codex-root>/config.toml#mcp_servers";
|
|
232
|
-
readonly summary: "Compile patches generated MCP server tables.";
|
|
233
|
-
};
|
|
234
217
|
readonly agentConfig: {
|
|
235
218
|
readonly kind: "direct-file";
|
|
236
219
|
readonly path: "<codex-root>/agents/<name>.toml";
|
|
@@ -266,20 +249,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
266
249
|
readonly summary: "Compile bundles targeted skills and orbit skills.";
|
|
267
250
|
};
|
|
268
251
|
readonly generatedTools: {
|
|
269
|
-
readonly kind: "
|
|
270
|
-
readonly path: "<prism-home>/runtime/
|
|
271
|
-
readonly summary: "Canonical tools lower to the
|
|
252
|
+
readonly kind: "direct-file";
|
|
253
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
254
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
272
255
|
};
|
|
273
256
|
readonly hooks: {
|
|
274
257
|
readonly kind: "native-plugin-bundle";
|
|
275
258
|
readonly path: "<generated-plugin>/hooks.json";
|
|
276
259
|
readonly summary: "Hooks are bundled in Antigravity plugin format.";
|
|
277
260
|
};
|
|
278
|
-
readonly mcpConfig: {
|
|
279
|
-
readonly kind: "native-plugin-bundle";
|
|
280
|
-
readonly path: "<generated-plugin>/mcp_config.json";
|
|
281
|
-
readonly summary: "MCP config is plugin-local for generated plugin bundles.";
|
|
282
|
-
};
|
|
283
261
|
readonly agentConfig: {
|
|
284
262
|
readonly kind: "native-plugin-bundle";
|
|
285
263
|
readonly path: "<generated-plugin>/agents/";
|
|
@@ -319,20 +297,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
319
297
|
readonly summary: "Compile bundles targeted plugin skills and orbit skills into the generated Kimi plugin.";
|
|
320
298
|
};
|
|
321
299
|
readonly generatedTools: {
|
|
322
|
-
readonly kind: "
|
|
323
|
-
readonly path: "<prism-home>/runtime/
|
|
324
|
-
readonly summary: "Canonical tools lower to the
|
|
300
|
+
readonly kind: "direct-file";
|
|
301
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
302
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
325
303
|
};
|
|
326
304
|
readonly hooks: {
|
|
327
305
|
readonly kind: "config-patch";
|
|
328
306
|
readonly path: "<kimi-root>/config.toml#hooks";
|
|
329
307
|
readonly summary: "Hooks lower to managed [[hooks]] config entries plus generated wrapper scripts.";
|
|
330
308
|
};
|
|
331
|
-
readonly mcpConfig: {
|
|
332
|
-
readonly kind: "native-plugin-bundle";
|
|
333
|
-
readonly path: "<generated-plugin>/kimi.plugin.json#mcpServers + <kimi-root>/plugins/installed.json";
|
|
334
|
-
readonly summary: "MCP config is plugin-local and enabled through Kimi's installed plugin record; Prism patches config.toml only for hooks.";
|
|
335
|
-
};
|
|
336
309
|
readonly agentConfig: {
|
|
337
310
|
readonly kind: "native-plugin-bundle";
|
|
338
311
|
readonly path: "<generated-plugin>/skills/prism-agent-<name>/SKILL.md";
|
|
@@ -382,7 +355,6 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
382
355
|
readonly path: "<generated-plugin>.ts";
|
|
383
356
|
readonly summary: "Supported Prism hooks lower to Amp amp.on(...) plugin event handlers; session.end fails closed because Amp has no native session-end event.";
|
|
384
357
|
};
|
|
385
|
-
readonly mcpConfig: LowererSurfaceCapability;
|
|
386
358
|
readonly agentConfig: LowererSurfaceCapability;
|
|
387
359
|
};
|
|
388
360
|
readonly notes: readonly ["Amp generated commands, tools, and supported hooks use the native plugin API; compiled agents currently lower as role-skill guidance.", "Amp exposes session.start, tool.call, tool.result, agent.start, and agent.end plugin events; Prism does not map portable session.end to agent.end."];
|
|
@@ -415,19 +387,14 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
415
387
|
readonly summary: "Install writes Agent Skill folders.";
|
|
416
388
|
};
|
|
417
389
|
readonly generatedTools: {
|
|
418
|
-
readonly kind: "
|
|
419
|
-
readonly path: "<prism-home>/runtime/
|
|
420
|
-
readonly summary: "Canonical tools lower to the
|
|
390
|
+
readonly kind: "direct-file";
|
|
391
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
392
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
421
393
|
};
|
|
422
394
|
readonly hooks: LowererSurfaceCapability;
|
|
423
|
-
readonly mcpConfig: {
|
|
424
|
-
readonly kind: "config-patch";
|
|
425
|
-
readonly path: "<cursor-root>/mcp.json#mcpServers";
|
|
426
|
-
readonly summary: "Compile patches a compiler-owned Cursor MCP server entry.";
|
|
427
|
-
};
|
|
428
395
|
readonly agentConfig: LowererSurfaceCapability;
|
|
429
396
|
};
|
|
430
|
-
readonly notes: readonly ["Cursor compile support is tools-only for now; compiled agents, orbits, hooks, and skill permission visibility remain unsupported.", "Cursor command artifacts install through a local plugin bundle under ~/.cursor/plugins/local so Prism uses Cursor's native command discovery instead of direct command files.", "Cursor Agent Skills are docs-backed under .cursor/skills and ~/.cursor/skills, so Prism keeps install-phase skills direct.", "Cursor
|
|
397
|
+
readonly notes: readonly ["Cursor compile support is tools-only for now; compiled agents, orbits, hooks, and skill permission visibility remain unsupported.", "Cursor command artifacts install through a local plugin bundle under ~/.cursor/plugins/local so Prism uses Cursor's native command discovery instead of direct command files.", "Cursor Agent Skills are docs-backed under .cursor/skills and ~/.cursor/skills, so Prism keeps install-phase skills direct.", "Cursor canonical tools are CLI-only (`prism tools invoke`); no mcp.json patch is emitted."];
|
|
431
398
|
};
|
|
432
399
|
readonly "factory-droid": {
|
|
433
400
|
readonly harness: "factory-droid";
|
|
@@ -461,20 +428,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
461
428
|
readonly summary: "Compiled bundles own targeted skills; skills-only plugins still install direct skills.";
|
|
462
429
|
};
|
|
463
430
|
readonly generatedTools: {
|
|
464
|
-
readonly kind: "
|
|
465
|
-
readonly path: "<prism-home>/runtime/
|
|
466
|
-
readonly summary: "Canonical tools lower to the
|
|
431
|
+
readonly kind: "direct-file";
|
|
432
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
433
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
467
434
|
};
|
|
468
435
|
readonly hooks: {
|
|
469
436
|
readonly kind: "native-plugin-bundle";
|
|
470
437
|
readonly path: "<generated-plugin>/hooks/hooks.json";
|
|
471
438
|
readonly summary: "Hooks are bundled in Factory plugin format.";
|
|
472
439
|
};
|
|
473
|
-
readonly mcpConfig: {
|
|
474
|
-
readonly kind: "native-plugin-bundle";
|
|
475
|
-
readonly path: "<generated-plugin>/mcp.json";
|
|
476
|
-
readonly summary: "MCP config is plugin-local; Prism does not patch settings.json.";
|
|
477
|
-
};
|
|
478
440
|
readonly agentConfig: {
|
|
479
441
|
readonly kind: "native-plugin-bundle";
|
|
480
442
|
readonly path: "<generated-plugin>/droids/";
|
|
@@ -523,7 +485,6 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
523
485
|
readonly path: "<generated-package>/extensions/prism-extension.js and <generated-package>/hooks/";
|
|
524
486
|
readonly summary: "Hooks lower through Pi extension events and generated wrapper files.";
|
|
525
487
|
};
|
|
526
|
-
readonly mcpConfig: LowererSurfaceCapability;
|
|
527
488
|
readonly agentConfig: {
|
|
528
489
|
readonly kind: "markdown-file";
|
|
529
490
|
readonly path: "~/.pi/agents/<name>.md or .pi/agents/<name>.md";
|
|
@@ -532,6 +493,55 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
532
493
|
};
|
|
533
494
|
readonly notes: readonly ["Pi packages are referenced from settings.json#packages; project scope uses .pi/settings.json.", "Compiled Pi agents use pi-agents markdown discovery: ~/.pi/agents globally and nearest .pi/agents in project scope."];
|
|
534
495
|
};
|
|
496
|
+
readonly omp: {
|
|
497
|
+
readonly harness: "omp";
|
|
498
|
+
readonly family: "coding-harness";
|
|
499
|
+
readonly workflowWorker: true;
|
|
500
|
+
readonly compile: CompileTargetCapabilities;
|
|
501
|
+
readonly surfaces: {
|
|
502
|
+
readonly pluginBundle: {
|
|
503
|
+
readonly kind: "native-plugin-bundle";
|
|
504
|
+
readonly path: "<omp-root>/extensions/prism-generated-<plugin>/";
|
|
505
|
+
readonly summary: "Compile emits OMP native extensions under the extensions surface.";
|
|
506
|
+
};
|
|
507
|
+
readonly rules: {
|
|
508
|
+
readonly kind: "direct-file";
|
|
509
|
+
readonly path: "<omp-root>/rules/";
|
|
510
|
+
readonly summary: "Compile writes OMP native rule files.";
|
|
511
|
+
};
|
|
512
|
+
readonly commands: {
|
|
513
|
+
readonly kind: "direct-file";
|
|
514
|
+
readonly path: "<omp-root>/commands/";
|
|
515
|
+
readonly summary: "Compile writes OMP native command files.";
|
|
516
|
+
};
|
|
517
|
+
readonly agents: {
|
|
518
|
+
readonly kind: "direct-file";
|
|
519
|
+
readonly path: "<omp-root>/agents/";
|
|
520
|
+
readonly summary: "Compile writes OMP native agent files.";
|
|
521
|
+
};
|
|
522
|
+
readonly skills: {
|
|
523
|
+
readonly kind: "direct-file";
|
|
524
|
+
readonly path: "<omp-root>/skills/";
|
|
525
|
+
readonly summary: "Compile writes OMP native skill folders.";
|
|
526
|
+
};
|
|
527
|
+
readonly generatedTools: {
|
|
528
|
+
readonly kind: "native-plugin-api";
|
|
529
|
+
readonly path: "<omp-root>/extensions/prism-generated-<plugin>/";
|
|
530
|
+
readonly summary: "Canonical tools lower through OMP's native extension API.";
|
|
531
|
+
};
|
|
532
|
+
readonly hooks: {
|
|
533
|
+
readonly kind: "native-plugin-api";
|
|
534
|
+
readonly path: "<omp-root>/extensions/prism-generated-<plugin>/";
|
|
535
|
+
readonly summary: "Hooks lower through OMP's native extension API.";
|
|
536
|
+
};
|
|
537
|
+
readonly agentConfig: {
|
|
538
|
+
readonly kind: "direct-file";
|
|
539
|
+
readonly path: "<omp-root>/agents/";
|
|
540
|
+
readonly summary: "OMP agent model bindings and settings live in generated agent files.";
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
readonly notes: readonly ["OMP is a distinct harness from Pi and uses ~/.omp/agent globally or .omp project-local.", "OMP does not expose a verified per-agent skill permission surface; permission-only skill access fails closed."];
|
|
544
|
+
};
|
|
535
545
|
readonly grok: {
|
|
536
546
|
readonly harness: "grok";
|
|
537
547
|
readonly family: "coding-harness";
|
|
@@ -560,20 +570,15 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
560
570
|
readonly summary: "Compile bundles targeted skills and orbit skills.";
|
|
561
571
|
};
|
|
562
572
|
readonly generatedTools: {
|
|
563
|
-
readonly kind: "
|
|
564
|
-
readonly path: "<prism-home>/runtime/
|
|
565
|
-
readonly summary: "Canonical tools lower to the
|
|
573
|
+
readonly kind: "direct-file";
|
|
574
|
+
readonly path: "<prism-home>/runtime/tools/<plugin>/runtime.mjs";
|
|
575
|
+
readonly summary: "Canonical tools lower to the CLI runtime; agents invoke via `prism tools invoke`.";
|
|
566
576
|
};
|
|
567
577
|
readonly hooks: {
|
|
568
578
|
readonly kind: "native-plugin-bundle";
|
|
569
579
|
readonly path: "<generated-plugin>/hooks/hooks.json";
|
|
570
580
|
readonly summary: "Hooks are bundled in Grok plugin format.";
|
|
571
581
|
};
|
|
572
|
-
readonly mcpConfig: {
|
|
573
|
-
readonly kind: "config-patch";
|
|
574
|
-
readonly path: "<grok-root>/config.toml#mcp_servers";
|
|
575
|
-
readonly summary: "Compile patches a managed [mcp_servers] stdio-shim region; grok does not resolve plugin-bundle .mcp.json files.";
|
|
576
|
-
};
|
|
577
582
|
readonly agentConfig: {
|
|
578
583
|
readonly kind: "native-plugin-bundle";
|
|
579
584
|
readonly path: "<generated-plugin>/agents/";
|
|
@@ -612,7 +617,6 @@ export declare const LOWERER_CAPABILITIES: {
|
|
|
612
617
|
readonly path: "project: hooks.v1.json; global: config.json#hooks json-array-member + hooks/*.mjs";
|
|
613
618
|
readonly summary: "Project scope writes hooks.v1.json; global scope upserts Prism entries into config.json hooks without whole-file adopt. Wrappers under hooks/.";
|
|
614
619
|
};
|
|
615
|
-
readonly mcpConfig: LowererSurfaceCapability;
|
|
616
620
|
readonly agentConfig: {
|
|
617
621
|
readonly kind: "direct-file";
|
|
618
622
|
readonly path: "ephemeral --agent-config for workflow runs";
|
package/types/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core types for prism - the unified plugin distribution system
|
|
3
3
|
*/
|
|
4
|
-
export type HarnessId = "claude-code" | "opencode" | "openclaw" | "hermes" | "codex-cli" | "antigravity-cli" | "kimi-code" | "amp-code" | "cursor" | "factory-droid" | "pi" | "grok" | "devin";
|
|
4
|
+
export type HarnessId = "claude-code" | "opencode" | "openclaw" | "hermes" | "codex-cli" | "antigravity-cli" | "kimi-code" | "amp-code" | "cursor" | "factory-droid" | "pi" | "omp" | "grok" | "devin";
|
|
5
5
|
export declare const HARNESS_SCOPES: readonly ["global", "project"];
|
|
6
6
|
export type HarnessScope = (typeof HARNESS_SCOPES)[number];
|
|
7
7
|
export interface HarnessConfig {
|
|
@@ -15,13 +15,13 @@ export interface HarnessConfig {
|
|
|
15
15
|
agentsDir: string | null;
|
|
16
16
|
toolsDir: string | null;
|
|
17
17
|
skillsDir: string | null;
|
|
18
|
+
extensionsDir?: string | null;
|
|
18
19
|
configFile: string | null;
|
|
19
20
|
configFormat: "json" | "yaml" | "toml" | "markdown" | "mdc";
|
|
20
21
|
supportsTools: boolean;
|
|
21
22
|
supportsCommands: boolean;
|
|
22
23
|
supportsAgents: boolean;
|
|
23
24
|
supportsSkills: boolean;
|
|
24
|
-
supportsMCP: boolean;
|
|
25
25
|
alternativeRulesFiles?: string[];
|
|
26
26
|
}
|
|
27
27
|
export declare const PLUGIN_ARTIFACT_TYPES: readonly ["rules", "commands", "agents", "skills"];
|
|
@@ -33,16 +33,8 @@ export type TargetPresetId = (typeof TARGET_PRESET_IDS)[number];
|
|
|
33
33
|
export type PluginTargetId = HarnessId | TargetPresetId;
|
|
34
34
|
export type AnyArtifactType = PluginArtifactType | CompileArtifactType;
|
|
35
35
|
export type PluginManifestTargets = Partial<Record<AnyArtifactType, PluginTargetId[]>>;
|
|
36
|
-
|
|
37
|
-
export interface PluginRuntimeMcpHarnessConfig {
|
|
38
|
-
transport?: PrismMcpTransport;
|
|
39
|
-
host?: string;
|
|
40
|
-
port?: number;
|
|
41
|
-
connectTimeoutMs?: number;
|
|
42
|
-
toolTimeoutMs?: number;
|
|
43
|
-
}
|
|
36
|
+
/** Reserved plugin runtime knobs. MCP harness config is retired. */
|
|
44
37
|
export interface PluginRuntimeConfig {
|
|
45
|
-
mcp?: Partial<Record<HarnessId, PluginRuntimeMcpHarnessConfig>>;
|
|
46
38
|
}
|
|
47
39
|
export interface PluginManifest {
|
|
48
40
|
name: string;
|
|
@@ -157,6 +149,7 @@ export interface UnifiedFrontmatter {
|
|
|
157
149
|
cursor?: CursorFrontmatter;
|
|
158
150
|
"factory-droid"?: FactoryDroidFrontmatter;
|
|
159
151
|
pi?: Record<string, unknown>;
|
|
152
|
+
omp?: Record<string, unknown>;
|
|
160
153
|
grok?: Record<string, unknown>;
|
|
161
154
|
devin?: Record<string, unknown>;
|
|
162
155
|
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
interface WorkflowBunSpawnBaseOptions {
|
|
2
2
|
readonly cmd: ReadonlyArray<string>;
|
|
3
3
|
readonly cwd?: string;
|
|
4
4
|
readonly env?: Record<string, string | undefined>;
|
|
5
|
+
readonly detached?: boolean;
|
|
6
|
+
/** A `number` redirects to that open file descriptor (e.g. a log file opened before spawn). */
|
|
7
|
+
readonly stdout: "ignore" | "pipe" | number;
|
|
8
|
+
readonly stderr: "ignore" | "pipe" | number;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkflowBunSpawnOptions extends WorkflowBunSpawnBaseOptions {
|
|
5
11
|
readonly stdin: "ignore";
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowBunPipedSpawnOptions extends WorkflowBunSpawnBaseOptions {
|
|
14
|
+
readonly stdin: "pipe";
|
|
15
|
+
readonly stdout: "pipe";
|
|
16
|
+
readonly stderr: "pipe";
|
|
17
|
+
}
|
|
18
|
+
export interface WorkflowBunWritableStdin {
|
|
19
|
+
end(error?: Error): number | Promise<number>;
|
|
8
20
|
}
|
|
9
21
|
export interface WorkflowBunSpawnedProcess {
|
|
10
22
|
readonly pid?: number;
|
|
@@ -14,8 +26,14 @@ export interface WorkflowBunSpawnedProcess {
|
|
|
14
26
|
kill(signal?: NodeJS.Signals | number): void;
|
|
15
27
|
unref?(): void;
|
|
16
28
|
}
|
|
29
|
+
export interface WorkflowBunPipedSpawnedProcess extends WorkflowBunSpawnedProcess {
|
|
30
|
+
readonly stdin: WorkflowBunWritableStdin;
|
|
31
|
+
readonly stdout: ReadableStream<Uint8Array>;
|
|
32
|
+
}
|
|
17
33
|
export interface WorkflowBunRuntime {
|
|
18
34
|
which(name: string): string | null;
|
|
19
35
|
spawn(options: WorkflowBunSpawnOptions): WorkflowBunSpawnedProcess;
|
|
36
|
+
spawn(options: WorkflowBunPipedSpawnOptions): WorkflowBunPipedSpawnedProcess;
|
|
20
37
|
}
|
|
21
38
|
export declare const workflowBunRuntime: (capability: string) => WorkflowBunRuntime;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { WorkflowRunnerLogRemoval } from "./workflow-runner-log.js";
|
|
2
|
+
export declare const DEFAULT_WORKFLOW_RETENTION_DAYS = 30;
|
|
3
|
+
export declare const DEFAULT_WORKFLOW_RETENTION_MS: number;
|
|
4
|
+
export declare const DEFAULT_WORKFLOW_RETENTION_AGE = "30d";
|
|
5
|
+
export declare const parseWorkflowRetentionAge: (input: string) => number;
|
|
6
|
+
export interface WorkflowRunArtifactCounts {
|
|
7
|
+
readonly runs: number;
|
|
8
|
+
readonly tasks: number;
|
|
9
|
+
readonly attempts: number;
|
|
10
|
+
readonly events: number;
|
|
11
|
+
readonly spans: number;
|
|
12
|
+
readonly runSnapshots: number;
|
|
13
|
+
readonly taskSnapshots: number;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkflowCacheArtifactCounts {
|
|
16
|
+
readonly taskCache: number;
|
|
17
|
+
readonly judgeCache: number;
|
|
18
|
+
}
|
|
19
|
+
export interface WorkflowRunDeletionReport {
|
|
20
|
+
readonly runId: string;
|
|
21
|
+
readonly status: "deleted" | "missing";
|
|
22
|
+
readonly rows: WorkflowRunArtifactCounts;
|
|
23
|
+
readonly runnerLog: WorkflowRunnerLogRemoval;
|
|
24
|
+
}
|
|
25
|
+
export interface WorkflowRetentionCleanupReport {
|
|
26
|
+
readonly policy: "workflow-ledger-retention-v1";
|
|
27
|
+
readonly olderThanMs: number;
|
|
28
|
+
readonly cutoff: string;
|
|
29
|
+
readonly runs: {
|
|
30
|
+
readonly matched: number;
|
|
31
|
+
readonly deleted: number;
|
|
32
|
+
readonly rows: WorkflowRunArtifactCounts;
|
|
33
|
+
};
|
|
34
|
+
readonly caches: WorkflowCacheArtifactCounts;
|
|
35
|
+
readonly runnerLogs: {
|
|
36
|
+
readonly deleted: number;
|
|
37
|
+
readonly missing: number;
|
|
38
|
+
readonly skippedUnsafeRunId: number;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare const emptyWorkflowRunArtifactCounts: () => WorkflowRunArtifactCounts;
|
|
42
|
+
export declare const addWorkflowRunArtifactCounts: (left: WorkflowRunArtifactCounts, right: WorkflowRunArtifactCounts) => WorkflowRunArtifactCounts;
|
|
43
|
+
export declare const workflowRetentionCutoff: (olderThanMs: number, now?: Date) => Date;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central workflow-ledger data policy.
|
|
3
|
+
*
|
|
4
|
+
* All durable workflow evidence and telemetry exports pass through this module.
|
|
5
|
+
* Exact-continuation identifiers and execution provenance are deliberately
|
|
6
|
+
* preserved: they are operational routing data, not authentication secrets.
|
|
7
|
+
* Cache payloads are never mutated. Callers must skip a cache write when
|
|
8
|
+
* `workflowCachePersistenceDecision` rejects it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const WORKFLOW_DATA_POLICY_VERSION = 1;
|
|
11
|
+
export declare const WORKFLOW_REDACTION_MARKER = "[REDACTED]";
|
|
12
|
+
export declare const WORKFLOW_SECRET_DIGEST_PREFIX = "sha256:";
|
|
13
|
+
export type WorkflowSensitiveDataReason = "sensitive-key" | "bearer-credential" | "provider-token" | "credential-assignment" | "private-key" | "url-password";
|
|
14
|
+
export interface WorkflowSensitiveDataFinding {
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly reason: WorkflowSensitiveDataReason;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkflowDataPolicyResult<Value> {
|
|
19
|
+
readonly value: Value;
|
|
20
|
+
readonly findings: ReadonlyArray<WorkflowSensitiveDataFinding>;
|
|
21
|
+
}
|
|
22
|
+
export type WorkflowCachePersistenceDecision = {
|
|
23
|
+
readonly safe: true;
|
|
24
|
+
} | {
|
|
25
|
+
readonly safe: false;
|
|
26
|
+
readonly reason: "sensitive-data";
|
|
27
|
+
readonly findings: ReadonlyArray<WorkflowSensitiveDataFinding>;
|
|
28
|
+
};
|
|
29
|
+
export declare const applyWorkflowDataPolicy: <Value>(input: Value) => WorkflowDataPolicyResult<Value>;
|
|
30
|
+
export declare const inspectWorkflowSensitiveData: (input: unknown) => ReadonlyArray<WorkflowSensitiveDataFinding>;
|
|
31
|
+
export declare const redactWorkflowData: <Value>(input: Value) => Value;
|
|
32
|
+
export declare const redactWorkflowText: (input: string) => string;
|
|
33
|
+
export declare const digestWorkflowSecret: (input: string) => string;
|
|
34
|
+
export declare const workflowCachePersistenceDecision: (input: {
|
|
35
|
+
readonly output: unknown;
|
|
36
|
+
readonly metadata?: Record<string, unknown>;
|
|
37
|
+
readonly identity?: unknown;
|
|
38
|
+
readonly agent?: unknown;
|
|
39
|
+
}) => WorkflowCachePersistenceDecision;
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
export declare class WorkflowRunTimeoutError extends Error {
|
|
2
|
+
readonly limitMs: number;
|
|
3
|
+
readonly name = "WorkflowRunTimeoutError";
|
|
4
|
+
constructor(limitMs: number);
|
|
5
|
+
}
|
|
6
|
+
export declare class WorkflowTaskNoProgressError extends Error {
|
|
7
|
+
readonly taskId: string;
|
|
8
|
+
readonly limitMs: number;
|
|
9
|
+
readonly name = "WorkflowTaskNoProgressError";
|
|
10
|
+
constructor(taskId: string, limitMs: number);
|
|
11
|
+
}
|
|
12
|
+
export declare class WorkflowFanoutExceededError extends Error {
|
|
13
|
+
readonly limit: number;
|
|
14
|
+
readonly observed: number;
|
|
15
|
+
readonly name = "WorkflowFanoutExceededError";
|
|
16
|
+
constructor(limit: number, observed: number);
|
|
17
|
+
}
|
|
18
|
+
export declare class WorkflowCostExceededError extends Error {
|
|
19
|
+
readonly limitUsd: number;
|
|
20
|
+
readonly observedUsd: number;
|
|
21
|
+
readonly name = "WorkflowCostExceededError";
|
|
22
|
+
constructor(limitUsd: number, observedUsd: number);
|
|
23
|
+
}
|
|
24
|
+
export declare class WorkflowCostUnavailableError extends Error {
|
|
25
|
+
readonly limitUsd: number;
|
|
26
|
+
readonly name = "WorkflowCostUnavailableError";
|
|
27
|
+
constructor(limitUsd: number);
|
|
28
|
+
}
|
|
29
|
+
export declare class WorkflowPromptLimitError extends Error {
|
|
30
|
+
readonly taskId: string;
|
|
31
|
+
readonly limitBytes: number;
|
|
32
|
+
readonly observedBytes: number;
|
|
33
|
+
readonly name = "WorkflowPromptLimitError";
|
|
34
|
+
constructor(taskId: string, limitBytes: number, observedBytes: number);
|
|
35
|
+
}
|
|
1
36
|
/** Errors surfaced by {@link WorkflowRuntime.runTask} and dynamic workflow runs. */
|
|
2
37
|
export declare class WorkflowTaskDecodeError extends Error {
|
|
3
38
|
readonly taskId: string;
|
|
@@ -25,4 +60,4 @@ export declare class WorkflowUnsupportedHarnessError extends Error {
|
|
|
25
60
|
readonly name = "WorkflowUnsupportedHarnessError";
|
|
26
61
|
constructor(harness: string, validHarnesses: ReadonlyArray<string>);
|
|
27
62
|
}
|
|
28
|
-
export type WorkflowRuntimeError = WorkflowBunRuntimeUnavailableError | WorkflowUnsupportedHarnessError | WorkflowTaskDecodeError | WorkflowTaskEscalatedError | WorkflowRunStoppedError | Error;
|
|
63
|
+
export type WorkflowRuntimeError = WorkflowBunRuntimeUnavailableError | WorkflowUnsupportedHarnessError | WorkflowTaskDecodeError | WorkflowTaskEscalatedError | WorkflowRunStoppedError | WorkflowRunTimeoutError | WorkflowTaskNoProgressError | WorkflowFanoutExceededError | WorkflowCostExceededError | WorkflowCostUnavailableError | WorkflowPromptLimitError | Error;
|
|
@@ -10,6 +10,8 @@ import type { HarnessId } from "./types.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const WORKFLOW_HARNESS_IDS: ReadonlyArray<WorkflowWorkerHarnessId>;
|
|
12
12
|
export type WorkflowHarnessId = WorkflowWorkerHarnessId;
|
|
13
|
+
/** Shared env/CLI integer parser kept off the worker-process module so the public SDK graph stays free of spawn runtime. */
|
|
14
|
+
export declare const parsePositiveInteger: (value: string | undefined) => number | undefined;
|
|
13
15
|
export type WorkflowHarnessDetectionStatus = "available" | "missing" | "broken";
|
|
14
16
|
export type WorkflowHarnessDetectionReasonCode = "executable-found" | "executable-missing" | "probe-succeeded" | "probe-exited-nonzero" | "probe-timed-out" | "probe-failed";
|
|
15
17
|
export interface WorkflowHarnessDetectionReason {
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { type AnyWorkflowTask, type WorkflowRuntimeOptions } from "./workflows.js";
|
|
2
|
+
/**
|
|
3
|
+
* `cacheKey` and `promptHash` AND together in the cache primary key
|
|
4
|
+
* (workflow-store.ts) — `cacheKey` never substitutes for `promptHash`, and
|
|
5
|
+
* there is no override/terminal-marker mechanism to make a stale prompt hash
|
|
6
|
+
* replay anyway. `promptHash` hashes the literal rendered `task.prompt`
|
|
7
|
+
* string, so interpolating volatile upstream text (judge prose, logs, whole
|
|
8
|
+
* objects) into a downstream prompt guarantees resume misses by construction.
|
|
9
|
+
* Authoring discipline: interpolate only narrow, stable upstream fields —
|
|
10
|
+
* ids, hashes, short enums (e.g. `build.commitSha`) — never freeform upstream
|
|
11
|
+
* text. There is no `--no-cache` bypass (removed; cache is mandatory) — the
|
|
12
|
+
* sanctioned no-reuse path is a fresh `--store`.
|
|
13
|
+
*/
|
|
2
14
|
export interface WorkflowTaskIdentity {
|
|
3
15
|
readonly workflow: string;
|
|
4
16
|
readonly taskId: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const WORKFLOW_RUNNER_LOG_FILE_MODE = 384;
|
|
2
|
+
export declare const WORKFLOW_RUNNER_LOG_DIRECTORY_MODE = 448;
|
|
3
|
+
export type WorkflowRunnerLogRemoval = {
|
|
4
|
+
readonly status: "deleted";
|
|
5
|
+
readonly path: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly status: "missing";
|
|
8
|
+
readonly path: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly status: "skipped-unsafe-run-id";
|
|
11
|
+
};
|
|
12
|
+
export type WorkflowRunnerLogRedaction = {
|
|
13
|
+
readonly status: "redacted" | "unchanged";
|
|
14
|
+
readonly path: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly status: "missing";
|
|
17
|
+
readonly path: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly status: "skipped-unsafe-run-id" | "skipped-non-file";
|
|
20
|
+
};
|
|
21
|
+
export declare const workflowRunnerLogDir: (storePath: string) => string;
|
|
22
|
+
export declare const workflowRunnerLogPath: (storePath: string, runId: string) => string;
|
|
23
|
+
export declare const workflowRunnerLogPathIfPresent: (storePath: string, run: {
|
|
24
|
+
readonly runId: string;
|
|
25
|
+
readonly runnerPid?: number;
|
|
26
|
+
}) => string | undefined;
|
|
27
|
+
export declare const secureWorkflowRunnerLog: (path: string) => Promise<void>;
|
|
28
|
+
export declare const readRedactedWorkflowRunnerLog: (storePath: string, runId: string) => Promise<{
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly bytes: number;
|
|
31
|
+
readonly content: string;
|
|
32
|
+
} | null>;
|
|
33
|
+
export declare const redactWorkflowRunnerLogInPlace: (storePath: string, runId: string) => Promise<WorkflowRunnerLogRedaction>;
|
|
34
|
+
export declare const removeWorkflowRunnerLog: (storePath: string, runId: string) => Promise<WorkflowRunnerLogRemoval>;
|
|
@@ -24,8 +24,10 @@ export interface WorkflowRunResult {
|
|
|
24
24
|
readonly tasks: ReadonlyArray<WorkflowRunTaskResult>;
|
|
25
25
|
readonly output?: unknown;
|
|
26
26
|
}
|
|
27
|
-
export { WorkflowRunStoppedError, WorkflowTaskDecodeError, WorkflowTaskEscalatedError, type WorkflowRuntimeError, } from "./workflow-errors.js";
|
|
27
|
+
export { WorkflowRunStoppedError, WorkflowTaskDecodeError, WorkflowTaskEscalatedError, WorkflowRunTimeoutError, WorkflowTaskNoProgressError, WorkflowFanoutExceededError, WorkflowCostExceededError, WorkflowCostUnavailableError, WorkflowPromptLimitError, type WorkflowRuntimeError, } from "./workflow-errors.js";
|
|
28
28
|
export type WorkflowTaskRepairMode = "native-continuation" | "fresh-executor-invocation" | "none";
|
|
29
|
+
export type WorkflowTaskProgressSource = "executor" | "worker-stdout" | "worker-stderr";
|
|
30
|
+
export type WorkflowTaskProgressReporter = (source?: WorkflowTaskProgressSource) => void;
|
|
29
31
|
export type WorkflowTaskRepairFallbackReason = "adapter-does-not-support-continuation" | "executor-does-not-advertise-continuation" | "missing-session-id";
|
|
30
32
|
interface WorkflowTaskRepairContextBase {
|
|
31
33
|
readonly attempt: number;
|
|
@@ -44,10 +46,12 @@ export type WorkflowTaskRepairContext = WorkflowTaskRepairContextBase & ({
|
|
|
44
46
|
});
|
|
45
47
|
export interface WorkflowTaskExecutionContext {
|
|
46
48
|
readonly abortSignal?: AbortSignal;
|
|
49
|
+
readonly reportProgress?: WorkflowTaskProgressReporter;
|
|
47
50
|
readonly repair?: WorkflowTaskRepairContext;
|
|
48
51
|
}
|
|
49
52
|
export interface WorkflowTaskExecutionContextWithoutRepair {
|
|
50
53
|
readonly abortSignal?: AbortSignal;
|
|
54
|
+
readonly reportProgress?: WorkflowTaskProgressReporter;
|
|
51
55
|
}
|
|
52
56
|
export type WorkflowTaskRepairLoopOption<Worker extends string> = Worker extends WorkflowRepairLoopContinuationWorkerId ? {
|
|
53
57
|
readonly repair?: WorkflowTaskRepairContext;
|
|
@@ -56,12 +60,17 @@ export type WorkflowTaskRepairLoopOption<Worker extends string> = Worker extends
|
|
|
56
60
|
};
|
|
57
61
|
export type WorkflowTaskExecutor = (task: AnyWorkflowTask, context?: WorkflowTaskExecutionContext) => Promise<unknown | WorkflowTaskExecution>;
|
|
58
62
|
export declare const DEFAULT_WORKFLOW_TASK_CONCURRENCY = 8;
|
|
63
|
+
export declare const DEFAULT_WORKFLOW_MAX_PROMPT_BYTES: number;
|
|
59
64
|
export declare const runWorkflow: (workflow: AnyWorkflowDefinition, options: {
|
|
60
65
|
readonly executeTask: WorkflowTaskExecutor;
|
|
61
66
|
readonly store?: WorkflowStore;
|
|
62
|
-
readonly cache?: boolean;
|
|
63
67
|
readonly mockOutput?: boolean;
|
|
64
68
|
readonly maxConcurrentTasks?: number;
|
|
69
|
+
readonly maxWallMs?: number;
|
|
70
|
+
readonly taskNoProgressMs?: number;
|
|
71
|
+
readonly maxTasks?: number;
|
|
72
|
+
readonly maxCostUsd?: number;
|
|
73
|
+
readonly maxPromptBytes?: number;
|
|
65
74
|
readonly runId?: string;
|
|
66
75
|
readonly runtimeOptions?: WorkflowRuntimeOptions;
|
|
67
76
|
readonly abortSignal?: AbortSignal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WorkflowBunSpawnedProcess, type WorkflowBunSpawnOptions } from "./workflow-bun-runtime.js";
|
|
1
|
+
import { type WorkflowBunPipedSpawnOptions, type WorkflowBunPipedSpawnedProcess, type WorkflowBunSpawnedProcess, type WorkflowBunSpawnOptions } from "./workflow-bun-runtime.js";
|
|
2
2
|
export interface WorkflowDatabaseQuery<Row, Params extends ReadonlyArray<unknown>> {
|
|
3
3
|
get(...params: Params): Row | null;
|
|
4
4
|
all(...params: Params): Row[];
|
|
@@ -13,12 +13,21 @@ export interface WorkflowDatabase {
|
|
|
13
13
|
export interface WorkflowSpawnOptions extends WorkflowBunSpawnOptions {
|
|
14
14
|
readonly cwd: string;
|
|
15
15
|
}
|
|
16
|
+
export interface WorkflowPipedSpawnOptions extends WorkflowBunPipedSpawnOptions {
|
|
17
|
+
readonly cwd: string;
|
|
18
|
+
}
|
|
16
19
|
export interface WorkflowSpawnedProcess extends WorkflowBunSpawnedProcess {
|
|
17
20
|
readonly pid: number;
|
|
18
21
|
readonly stdout: ReadableStream<Uint8Array>;
|
|
19
22
|
readonly stderr: ReadableStream<Uint8Array>;
|
|
20
23
|
unref(): void;
|
|
21
24
|
}
|
|
25
|
+
export interface WorkflowPipedSpawnedProcess extends WorkflowBunPipedSpawnedProcess {
|
|
26
|
+
readonly pid: number;
|
|
27
|
+
readonly stderr: ReadableStream<Uint8Array>;
|
|
28
|
+
unref(): void;
|
|
29
|
+
}
|
|
22
30
|
export declare const openWorkflowDatabase: (path: string) => WorkflowDatabase;
|
|
23
|
-
export declare
|
|
31
|
+
export declare function spawnWorkflowProcess(options: WorkflowPipedSpawnOptions): WorkflowPipedSpawnedProcess;
|
|
32
|
+
export declare function spawnWorkflowProcess(options: WorkflowSpawnOptions): WorkflowSpawnedProcess;
|
|
24
33
|
export declare const findWorkflowExecutable: (name: string) => string | undefined;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const WorkflowContinuationAdapterIdSchema: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli"]>;
|
|
2
|
+
export declare const WorkflowContinuationAdapterIdSchema: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
3
3
|
export type WorkflowContinuationAdapterId = typeof WorkflowContinuationAdapterIdSchema.Type;
|
|
4
|
-
export declare const WorkflowContinuationWorkerIdSchema: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok", "hermes", "kimi-code", "opencode"]>;
|
|
4
|
+
export declare const WorkflowContinuationWorkerIdSchema: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok", "hermes", "kimi-code", "opencode", "omp"]>;
|
|
5
5
|
export type WorkflowContinuationWorkerId = typeof WorkflowContinuationWorkerIdSchema.Type;
|
|
6
6
|
export declare const StableSessionIdSchema: Schema.brand<typeof Schema.NonEmptyTrimmedString, "StableSessionId">;
|
|
7
7
|
export type StableSessionId = typeof StableSessionIdSchema.Type;
|
|
8
8
|
export declare const WorkflowStableSessionSchema: Schema.Struct<{
|
|
9
|
-
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli"]>;
|
|
9
|
+
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
10
10
|
sessionId: Schema.brand<typeof Schema.NonEmptyTrimmedString, "StableSessionId">;
|
|
11
11
|
}>;
|
|
12
12
|
export type WorkflowStableSession = typeof WorkflowStableSessionSchema.Type;
|
|
13
13
|
export declare const WorkflowHarnessContinuationSupportSchema: Schema.Union<[Schema.Struct<{
|
|
14
|
-
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli"]>;
|
|
14
|
+
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
15
15
|
workflowWorker: typeof Schema.Boolean;
|
|
16
16
|
stableSessionIds: Schema.Literal<[true]>;
|
|
17
17
|
exactSameSessionContinuation: Schema.Literal<[true]>;
|
|
@@ -19,7 +19,7 @@ export declare const WorkflowHarnessContinuationSupportSchema: Schema.Union<[Sch
|
|
|
19
19
|
continueCommand: typeof Schema.NonEmptyTrimmedString;
|
|
20
20
|
capture: typeof Schema.NonEmptyTrimmedString;
|
|
21
21
|
}>, Schema.Struct<{
|
|
22
|
-
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli"]>;
|
|
22
|
+
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
23
23
|
workflowWorker: typeof Schema.Boolean;
|
|
24
24
|
stableSessionIds: Schema.Literal<[false]>;
|
|
25
25
|
exactSameSessionContinuation: Schema.Literal<[false]>;
|
|
@@ -37,6 +37,7 @@ export declare const workflowContinuationAdapterByWorker: {
|
|
|
37
37
|
readonly hermes: "hermes";
|
|
38
38
|
readonly "kimi-code": "kimi-code";
|
|
39
39
|
readonly opencode: "opencode-cli";
|
|
40
|
+
readonly omp: "omp-cli";
|
|
40
41
|
};
|
|
41
42
|
export type WorkflowRepairLoopContinuationWorkerId = keyof typeof workflowContinuationAdapterByWorker;
|
|
42
43
|
export type WorkflowRepairLoopContinuationCapability = "stable-session-repair-loop" | "no-repair-loop-continuation";
|
|
@@ -123,6 +124,15 @@ export declare const workflowHarnessContinuationSupport: {
|
|
|
123
124
|
readonly continueCommand: "opencode run -s <sessionId> <prompt>";
|
|
124
125
|
readonly capture: "json step_start sessionID, session list, export, database, or log recovery";
|
|
125
126
|
};
|
|
127
|
+
readonly "omp-cli": {
|
|
128
|
+
readonly adapter: "omp-cli";
|
|
129
|
+
readonly workflowWorker: true;
|
|
130
|
+
readonly stableSessionIds: true;
|
|
131
|
+
readonly exactSameSessionContinuation: true;
|
|
132
|
+
readonly sessionIdField: "sessionId";
|
|
133
|
+
readonly continueCommand: "omp --mode json --resume <sessionId> -- <prompt>";
|
|
134
|
+
readonly capture: "json session event id";
|
|
135
|
+
};
|
|
126
136
|
};
|
|
127
137
|
export declare const stableSessionIdFromUnknown: (value: unknown) => StableSessionId | undefined;
|
|
128
138
|
export declare const workflowContinuationAdapterForWorker: (worker: string) => WorkflowContinuationAdapterId | undefined;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type WorkflowRetentionCleanupReport, type WorkflowRunArtifactCounts, type WorkflowRunDeletionReport } from "./workflow-data-governance.js";
|
|
1
2
|
import type { WorkflowJudgeVerdict } from "./workflows.js";
|
|
2
3
|
import type { WorkflowJudgeIdentity, WorkflowRunTaskSnapshot, WorkflowTaskIdentity } from "./workflow-identity.js";
|
|
3
4
|
export { workflowRunTaskSnapshotForTask, workflowTaskIdentity, type WorkflowJudgeIdentity, type WorkflowRunTaskSnapshot, type WorkflowTaskIdentity } from "./workflow-identity.js";
|
|
4
5
|
import { type WorkflowDatabase } from "./workflow-runtime.js";
|
|
5
6
|
import type { WorkflowSpanRecord } from "./workflow-tracing.js";
|
|
7
|
+
import { type WorkflowUsage, type WorkflowUsageTotals } from "./workflow-usage.js";
|
|
6
8
|
export type WorkflowTaskOutputSource = "mock-output";
|
|
7
9
|
export interface CompletedWorkflowTaskRecord {
|
|
8
10
|
readonly identity: WorkflowTaskIdentity;
|
|
@@ -31,6 +33,14 @@ export interface WorkflowJudgeRecord {
|
|
|
31
33
|
readonly createdAt: string;
|
|
32
34
|
readonly updatedAt: string;
|
|
33
35
|
}
|
|
36
|
+
export type WorkflowCacheWriteResult = {
|
|
37
|
+
readonly stored: true;
|
|
38
|
+
} | {
|
|
39
|
+
readonly stored: false;
|
|
40
|
+
readonly reason: "sensitive-data";
|
|
41
|
+
readonly findingCount: number;
|
|
42
|
+
readonly findingPaths: ReadonlyArray<string>;
|
|
43
|
+
};
|
|
34
44
|
export type WorkflowRunTaskStatus = "completed" | "failed" | "escalated";
|
|
35
45
|
export interface WorkflowRunTaskRecord {
|
|
36
46
|
readonly runId: string;
|
|
@@ -46,7 +56,7 @@ export interface WorkflowRunTaskRecord {
|
|
|
46
56
|
readonly output: unknown;
|
|
47
57
|
readonly metadata?: Record<string, unknown>;
|
|
48
58
|
}
|
|
49
|
-
export type WorkflowRunTaskProgressStatus = "running" | "completed" | "failed" | "escalated";
|
|
59
|
+
export type WorkflowRunTaskProgressStatus = "running" | "completed" | "failed" | "escalated" | "stopped" | "crashed";
|
|
50
60
|
export type WorkflowRunTaskCacheLookup = "hit" | "miss" | "skipped";
|
|
51
61
|
export interface WorkflowRunTaskProgress {
|
|
52
62
|
readonly ordinal?: number;
|
|
@@ -86,6 +96,7 @@ export interface WorkflowRunTaskCompactSummary {
|
|
|
86
96
|
readonly externalSessionPointer: string | null;
|
|
87
97
|
readonly lastEventType?: string;
|
|
88
98
|
readonly lastEventAt?: string;
|
|
99
|
+
readonly attempts: ReadonlyArray<WorkflowTaskAttemptRecord>;
|
|
89
100
|
}
|
|
90
101
|
export interface WorkflowRunSnapshot {
|
|
91
102
|
readonly runId: string;
|
|
@@ -131,19 +142,77 @@ export interface WorkflowRunCompactSummary {
|
|
|
131
142
|
readonly repairs: number;
|
|
132
143
|
readonly status: WorkflowRunStatus;
|
|
133
144
|
readonly durationMs: number | null;
|
|
145
|
+
readonly usage: WorkflowUsageTotals;
|
|
134
146
|
};
|
|
135
147
|
readonly tasks: WorkflowRunTaskCompactSummary[];
|
|
136
148
|
}
|
|
149
|
+
export type WorkflowRunCompletedCause = {
|
|
150
|
+
readonly kind: "completed";
|
|
151
|
+
};
|
|
152
|
+
export type WorkflowRunTaskFailureCause = {
|
|
153
|
+
readonly kind: "task-failed" | "task-escalated";
|
|
154
|
+
readonly taskId: string;
|
|
155
|
+
readonly ordinal: number;
|
|
156
|
+
readonly attempt: number;
|
|
157
|
+
readonly errorName: string;
|
|
158
|
+
readonly message: string;
|
|
159
|
+
};
|
|
160
|
+
export type WorkflowRunFailureCause = {
|
|
161
|
+
readonly kind: "workflow-failed";
|
|
162
|
+
readonly errorName: string;
|
|
163
|
+
readonly message: string;
|
|
164
|
+
};
|
|
165
|
+
export type WorkflowRunStoppedCause = {
|
|
166
|
+
readonly kind: "stopped";
|
|
167
|
+
readonly reason: string;
|
|
168
|
+
readonly signal?: string;
|
|
169
|
+
};
|
|
170
|
+
export type WorkflowRunCrashedCause = {
|
|
171
|
+
readonly kind: "crashed";
|
|
172
|
+
readonly reason: string;
|
|
173
|
+
readonly runnerPid?: number;
|
|
174
|
+
readonly heartbeatAt?: string;
|
|
175
|
+
};
|
|
176
|
+
export type WorkflowRunTimeoutCause = {
|
|
177
|
+
readonly kind: "workflow-timeout";
|
|
178
|
+
readonly limitMs: number;
|
|
179
|
+
};
|
|
180
|
+
export type WorkflowRunFanoutExceededCause = {
|
|
181
|
+
readonly kind: "workflow-fanout-exceeded";
|
|
182
|
+
readonly limit: number;
|
|
183
|
+
readonly observed: number;
|
|
184
|
+
};
|
|
185
|
+
export type WorkflowRunCostExceededCause = {
|
|
186
|
+
readonly kind: "workflow-cost-exceeded";
|
|
187
|
+
readonly limitUsd: number;
|
|
188
|
+
readonly observedUsd: number;
|
|
189
|
+
};
|
|
190
|
+
export type WorkflowRunCostUnavailableCause = {
|
|
191
|
+
readonly kind: "workflow-cost-unavailable";
|
|
192
|
+
readonly limitUsd: number;
|
|
193
|
+
};
|
|
194
|
+
export type WorkflowRunPromptLimitCause = {
|
|
195
|
+
readonly kind: "workflow-prompt-limit-exceeded";
|
|
196
|
+
readonly taskId: string;
|
|
197
|
+
readonly limitBytes: number;
|
|
198
|
+
readonly observedBytes: number;
|
|
199
|
+
};
|
|
200
|
+
export type WorkflowRunTerminalCause = WorkflowRunCompletedCause | WorkflowRunTaskFailureCause | WorkflowRunFailureCause | WorkflowRunStoppedCause | WorkflowRunCrashedCause | WorkflowRunTimeoutCause | WorkflowRunFanoutExceededCause | WorkflowRunCostExceededCause | WorkflowRunCostUnavailableCause | WorkflowRunPromptLimitCause;
|
|
137
201
|
export interface WorkflowRunRecord {
|
|
138
202
|
readonly runId: string;
|
|
139
203
|
readonly workflow: string;
|
|
140
204
|
readonly status: WorkflowRunStatus;
|
|
205
|
+
readonly terminalCause: WorkflowRunTerminalCause | null;
|
|
141
206
|
readonly finishedAt: string | null;
|
|
142
207
|
readonly runnerPid?: number;
|
|
143
208
|
readonly heartbeatAt?: string;
|
|
209
|
+
readonly liveness: WorkflowRunLiveness;
|
|
144
210
|
readonly createdAt?: string;
|
|
211
|
+
readonly usage: WorkflowUsageTotals;
|
|
145
212
|
}
|
|
146
|
-
export type
|
|
213
|
+
export type WorkflowRunLiveness = "alive" | "stale" | "unknown";
|
|
214
|
+
export declare const WORKFLOW_RUN_LIVENESS_STALE_AFTER_MS = 10000;
|
|
215
|
+
export type WorkflowRunStatus = "running" | "completed" | "failed" | "escalated" | "stopped" | "crashed" | "unknown";
|
|
147
216
|
/**
|
|
148
217
|
* A run's persisted status can read "completed" while carrying isolated task failures: the
|
|
149
218
|
* dynamic runtime's fault-isolation contract (PQ-166) lets an author's `run` program finish
|
|
@@ -161,13 +230,124 @@ export interface WorkflowEventRecord {
|
|
|
161
230
|
readonly payload: unknown;
|
|
162
231
|
readonly createdAt: string;
|
|
163
232
|
}
|
|
233
|
+
export interface WorkflowRunInspection {
|
|
234
|
+
readonly schema: "prism.workflow-run-inspection.v1";
|
|
235
|
+
readonly dataPolicyVersion: number;
|
|
236
|
+
readonly store: {
|
|
237
|
+
readonly path: string;
|
|
238
|
+
readonly schemaVersion: number;
|
|
239
|
+
readonly files: ReadonlyArray<{
|
|
240
|
+
readonly path: string;
|
|
241
|
+
readonly present: boolean;
|
|
242
|
+
readonly mode: number | null;
|
|
243
|
+
readonly bytes: number | null;
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
246
|
+
readonly run: WorkflowRunRecord;
|
|
247
|
+
readonly rows: WorkflowRunArtifactCounts;
|
|
248
|
+
readonly runnerLog: {
|
|
249
|
+
readonly path: string | null;
|
|
250
|
+
readonly present: boolean;
|
|
251
|
+
readonly bytes: number | null;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
export interface WorkflowRunExport {
|
|
255
|
+
readonly schema: "prism.workflow-run-export.v1";
|
|
256
|
+
readonly dataPolicyVersion: number;
|
|
257
|
+
readonly exportedAt: string;
|
|
258
|
+
readonly run: WorkflowRunRecord;
|
|
259
|
+
readonly snapshot: WorkflowRunSnapshot | null;
|
|
260
|
+
readonly tasks: ReadonlyArray<WorkflowRunTaskRecord>;
|
|
261
|
+
readonly taskSnapshots: ReadonlyArray<WorkflowRunTaskSnapshot>;
|
|
262
|
+
readonly attempts: ReadonlyArray<WorkflowTaskAttemptRecord>;
|
|
263
|
+
readonly events: ReadonlyArray<WorkflowEventRecord>;
|
|
264
|
+
readonly spans: ReadonlyArray<Omit<WorkflowSpanRecord, "startNs" | "endNs"> & {
|
|
265
|
+
readonly startNs: string;
|
|
266
|
+
readonly endNs: string | null;
|
|
267
|
+
}>;
|
|
268
|
+
readonly runnerLog: {
|
|
269
|
+
readonly path: string;
|
|
270
|
+
readonly bytes: number;
|
|
271
|
+
readonly content: string;
|
|
272
|
+
} | null;
|
|
273
|
+
}
|
|
274
|
+
export type WorkflowTaskAttemptStatus = "running" | "completed" | "failed" | "stopped" | "crashed";
|
|
275
|
+
export type WorkflowTaskAttemptFailureKind = "executor" | "decode" | "finish" | "stopped" | "crashed";
|
|
276
|
+
export interface WorkflowTaskAttemptFailure {
|
|
277
|
+
readonly kind: WorkflowTaskAttemptFailureKind;
|
|
278
|
+
readonly message: string;
|
|
279
|
+
}
|
|
280
|
+
export interface WorkflowTaskAttemptStartedInput {
|
|
281
|
+
readonly runId: string;
|
|
282
|
+
readonly ordinal: number;
|
|
283
|
+
readonly attempt: number;
|
|
284
|
+
readonly taskId: string;
|
|
285
|
+
readonly metadata?: Record<string, unknown>;
|
|
286
|
+
}
|
|
287
|
+
export interface WorkflowTaskAttemptFinishedInput {
|
|
288
|
+
readonly runId: string;
|
|
289
|
+
readonly ordinal: number;
|
|
290
|
+
readonly attempt: number;
|
|
291
|
+
readonly status: Exclude<WorkflowTaskAttemptStatus, "running">;
|
|
292
|
+
readonly metadata?: Record<string, unknown>;
|
|
293
|
+
readonly failure?: WorkflowTaskAttemptFailure;
|
|
294
|
+
}
|
|
295
|
+
export interface WorkflowTaskAttemptRecord {
|
|
296
|
+
readonly runId: string;
|
|
297
|
+
readonly ordinal: number;
|
|
298
|
+
readonly attempt: number;
|
|
299
|
+
readonly taskId: string;
|
|
300
|
+
readonly status: WorkflowTaskAttemptStatus;
|
|
301
|
+
readonly startedAt: string;
|
|
302
|
+
readonly finishedAt: string | null;
|
|
303
|
+
readonly adapter?: string;
|
|
304
|
+
readonly model?: string;
|
|
305
|
+
readonly nativeAgent?: string;
|
|
306
|
+
readonly sessionId?: string;
|
|
307
|
+
readonly failure?: WorkflowTaskAttemptFailure;
|
|
308
|
+
readonly usage?: WorkflowUsage;
|
|
309
|
+
readonly metadata?: Record<string, unknown>;
|
|
310
|
+
}
|
|
164
311
|
export declare const projectWorkflowStoreDir: (prismHome: string, cwd?: string) => string;
|
|
165
312
|
export declare const defaultWorkflowStorePath: (prismHome: string, cwd?: string) => string;
|
|
313
|
+
export declare const WORKFLOW_STORE_SCHEMA_VERSION = 5;
|
|
314
|
+
/**
|
|
315
|
+
* Surfaces the one-time soft-divergence direction (WFE-007): a pre-existing store opened at a
|
|
316
|
+
* schema version older than the binary's `WORKFLOW_STORE_SCHEMA_VERSION` migrates in place inside
|
|
317
|
+
* `WorkflowStore.open`, silently by design, but callers reporting on the store (`runs list`,
|
|
318
|
+
* `runs show`) surface that a migration just ran. The other direction — a store newer than this
|
|
319
|
+
* binary supports — is not migratable and is already a hard error in `open`. Never populated for
|
|
320
|
+
* a brand-new store (nothing to diverge from).
|
|
321
|
+
*/
|
|
322
|
+
export interface WorkflowStoreSchemaNotice {
|
|
323
|
+
readonly severity: "info";
|
|
324
|
+
readonly openedVersion: number;
|
|
325
|
+
readonly currentVersion: number;
|
|
326
|
+
readonly message: string;
|
|
327
|
+
}
|
|
328
|
+
export declare const workflowRunLiveness: (run: Pick<WorkflowRunRecord, "status" | "runnerPid" | "heartbeatAt">, nowMs?: number) => WorkflowRunLiveness;
|
|
166
329
|
export declare class WorkflowStore {
|
|
167
330
|
private readonly db;
|
|
168
|
-
|
|
169
|
-
|
|
331
|
+
readonly path: string;
|
|
332
|
+
readonly schemaNotice: WorkflowStoreSchemaNotice | null;
|
|
333
|
+
initialRetentionCleanup: WorkflowRetentionCleanupReport | null;
|
|
334
|
+
constructor(db: WorkflowDatabase, path: string, schemaNotice?: WorkflowStoreSchemaNotice | null);
|
|
335
|
+
private updateRunUsageInCurrentTransaction;
|
|
336
|
+
static open(path: string, options?: {
|
|
337
|
+
readonly applyDefaultRetention?: boolean;
|
|
338
|
+
}): Promise<WorkflowStore>;
|
|
170
339
|
close(): void;
|
|
340
|
+
private countRunArtifacts;
|
|
341
|
+
private deleteRunRowsInCurrentTransaction;
|
|
342
|
+
private removeQueuedRunnerLog;
|
|
343
|
+
private flushQueuedRunnerLogCleanup;
|
|
344
|
+
inspectRun(runId: string): Promise<WorkflowRunInspection>;
|
|
345
|
+
exportRun(runId: string): Promise<WorkflowRunExport>;
|
|
346
|
+
deleteRun(runId: string): Promise<WorkflowRunDeletionReport>;
|
|
347
|
+
pruneByAge(options?: {
|
|
348
|
+
readonly olderThanMs?: number;
|
|
349
|
+
readonly now?: Date;
|
|
350
|
+
}): Promise<WorkflowRetentionCleanupReport>;
|
|
171
351
|
getCompleted(identity: WorkflowTaskIdentity, options?: {
|
|
172
352
|
readonly allowMockSourced?: boolean;
|
|
173
353
|
}): CompletedWorkflowTaskRecord | null;
|
|
@@ -178,7 +358,7 @@ export declare class WorkflowStore {
|
|
|
178
358
|
readonly evidence: unknown;
|
|
179
359
|
readonly output: unknown;
|
|
180
360
|
readonly taskMetadata: unknown;
|
|
181
|
-
}):
|
|
361
|
+
}): WorkflowCacheWriteResult;
|
|
182
362
|
listJudgeRecords(options?: {
|
|
183
363
|
readonly workflow?: string;
|
|
184
364
|
readonly taskId?: string;
|
|
@@ -204,7 +384,11 @@ export declare class WorkflowStore {
|
|
|
204
384
|
consumeRunHandoffToken(runId: string, token: string): boolean;
|
|
205
385
|
markRunRunnerStarted(runId: string, runnerPid: number): void;
|
|
206
386
|
heartbeatRun(runId: string): void;
|
|
207
|
-
|
|
387
|
+
recordTaskAttemptStarted(input: WorkflowTaskAttemptStartedInput): void;
|
|
388
|
+
recordTaskAttemptFinished(input: WorkflowTaskAttemptFinishedInput): void;
|
|
389
|
+
listRunTaskAttempts(runId: string): WorkflowTaskAttemptRecord[];
|
|
390
|
+
private finishRunInCurrentTransaction;
|
|
391
|
+
finishRun(runId: string, status: Exclude<WorkflowRunStatus, "running" | "unknown">, terminalCause?: WorkflowRunTerminalCause): void;
|
|
208
392
|
stopRun(runId: string, reason?: string): WorkflowRunRecord | null;
|
|
209
393
|
stopRunningRun(runId: string, reason?: string): WorkflowRunRecord | null;
|
|
210
394
|
restartRunningRun(input: {
|
|
@@ -263,5 +447,5 @@ export declare class WorkflowStore {
|
|
|
263
447
|
readonly output: unknown;
|
|
264
448
|
readonly metadata?: Record<string, unknown>;
|
|
265
449
|
readonly outputSource?: WorkflowTaskOutputSource;
|
|
266
|
-
}):
|
|
450
|
+
}): WorkflowCacheWriteResult;
|
|
267
451
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type WorkflowCostReporting = "full" | "tokens" | "none";
|
|
2
|
+
export interface WorkflowUsage {
|
|
3
|
+
readonly tokensIn?: number;
|
|
4
|
+
readonly tokensOut?: number;
|
|
5
|
+
readonly costUsd?: number;
|
|
6
|
+
readonly durationMs?: number;
|
|
7
|
+
readonly costReporting: WorkflowCostReporting;
|
|
8
|
+
}
|
|
9
|
+
export interface WorkflowUsageTotals {
|
|
10
|
+
readonly agentRuns: number;
|
|
11
|
+
readonly reused: number;
|
|
12
|
+
readonly tokensIn: number;
|
|
13
|
+
readonly tokensOut: number;
|
|
14
|
+
readonly costUsd: number;
|
|
15
|
+
readonly durationMs: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const emptyWorkflowUsageTotals: () => WorkflowUsageTotals;
|
|
18
|
+
/** Normalize provider-specific task metadata into Prism's durable usage contract. */
|
|
19
|
+
export declare const workflowUsageFromMetadata: (metadata: Record<string, unknown> | undefined) => WorkflowUsage;
|
|
20
|
+
export declare const addWorkflowUsage: (totals: WorkflowUsageTotals, usage: WorkflowUsage) => WorkflowUsageTotals;
|
|
21
|
+
export declare const addWorkflowReuse: (totals: WorkflowUsageTotals) => WorkflowUsageTotals;
|
|
@@ -6,3 +6,19 @@ export interface WorkflowWorkerStderrMetadata {
|
|
|
6
6
|
readonly stderrTruncated?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const summarizeWorkflowWorkerStderr: (stderr: string, maxExcerptBytes?: number) => WorkflowWorkerStderrMetadata;
|
|
9
|
+
/**
|
|
10
|
+
* Forensics attached to a worker adapter's thrown error on the failure path (OBS-006).
|
|
11
|
+
* On success, every adapter already returns `{ adapter, ..., sessionId, ...stderr summary }`
|
|
12
|
+
* as its `WorkflowTaskExecution.metadata`. On failure, that same shape was previously
|
|
13
|
+
* discarded entirely — the runner persisted only `{contractVersion, instructionSource}` —
|
|
14
|
+
* so a failed task could not be joined to its harness session or its stderr tail. Adapters
|
|
15
|
+
* attach this to their custom Error's `metadata` property at each failure throw site; the
|
|
16
|
+
* runner merges `error.metadata` into both the `task.executor.failed` event and the
|
|
17
|
+
* persisted task record.
|
|
18
|
+
*/
|
|
19
|
+
export declare const workflowWorkerFailureMetadata: (input: {
|
|
20
|
+
readonly adapter: string;
|
|
21
|
+
readonly stderr: string;
|
|
22
|
+
readonly sessionId?: string;
|
|
23
|
+
readonly maxExcerptBytes?: number;
|
|
24
|
+
}) => Record<string, unknown>;
|
package/types/workflows.d.ts
CHANGED
|
@@ -58,15 +58,27 @@ export interface WorkflowValidationSummary {
|
|
|
58
58
|
}
|
|
59
59
|
export type WorkflowOutputSchema = Schema.Schema.AnyNoContext;
|
|
60
60
|
export type WorkflowFinishCriterionError = Error;
|
|
61
|
-
export type WorkflowWorkerId = "amp-code" | "antigravity-cli" | "claude-code" | "codex-cli" | "devin" | "grok" | "hermes" | "kimi-code" | "opencode";
|
|
61
|
+
export type WorkflowWorkerId = "amp-code" | "antigravity-cli" | "claude-code" | "codex-cli" | "devin" | "grok" | "hermes" | "kimi-code" | "opencode" | "omp";
|
|
62
62
|
export type WorkflowPermissionMode = "legacy" | "permissive" | "restricted" | "interactive" | "sandbox-read-only" | "sandbox-workspace-write" | "full-access";
|
|
63
63
|
export type AntigravityWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access">;
|
|
64
|
+
/**
|
|
65
|
+
* Per-task override for the executor-level transient-failure retry (WFE-009). Only
|
|
66
|
+
* classified-transient executor failures (process/idle timeout, unclassified non-zero
|
|
67
|
+
* exit) are retried; config/load errors and cancellation-barrier outcomes never are.
|
|
68
|
+
* `maxAttempts` counts total attempts (default 2, i.e. one retry) — the same convention
|
|
69
|
+
* as the shipped `agy` adapter's own `maxAttempts` option.
|
|
70
|
+
*/
|
|
71
|
+
export interface WorkflowTaskWorkerRetryOptions {
|
|
72
|
+
readonly maxAttempts?: number;
|
|
73
|
+
readonly backoffMs?: number;
|
|
74
|
+
}
|
|
64
75
|
type WorkflowTaskWorkerOptionsBase = {
|
|
65
76
|
readonly model?: string | WorkflowModelProfileRef;
|
|
66
77
|
readonly modelResolver?: (models: WorkflowResolvedModelTarget) => string;
|
|
67
78
|
readonly profile?: string;
|
|
68
79
|
readonly restrictedTools?: ReadonlyArray<string>;
|
|
69
80
|
readonly processTimeoutMs?: number;
|
|
81
|
+
readonly retry?: WorkflowTaskWorkerRetryOptions;
|
|
70
82
|
};
|
|
71
83
|
export type WorkflowTaskWorkerOptions = (WorkflowTaskWorkerOptionsBase & {
|
|
72
84
|
readonly worker?: Exclude<WorkflowWorkerId, "antigravity-cli">;
|
|
@@ -87,6 +99,8 @@ export interface WorkflowTaskModelResolution {
|
|
|
87
99
|
readonly model: string;
|
|
88
100
|
/** Harness-side inference provider (e.g. hermes `--provider xai-oauth`), from the modelspace target or harness default. */
|
|
89
101
|
readonly provider?: string;
|
|
102
|
+
/** Harness-bound model variant, such as Codex reasoning effort. */
|
|
103
|
+
readonly variant?: string;
|
|
90
104
|
readonly source: WorkflowTaskModelResolutionSource;
|
|
91
105
|
}
|
|
92
106
|
export declare const resolveWorkflowTaskModelResolution: (task: AnyWorkflowTask, options?: {
|
|
@@ -151,8 +165,15 @@ export interface WorkflowJudgeFinishCriterion<Output, Evidence = unknown> {
|
|
|
151
165
|
readonly evaluate: (context: WorkflowJudgeCriterionContext<Output, Evidence>) => Effect.Effect<WorkflowJudgeVerdict, WorkflowFinishCriterionError>;
|
|
152
166
|
}
|
|
153
167
|
export type WorkflowFinishCriterion<Output> = WorkflowDeterministicFinishCriterion<Output> | WorkflowJudgeFinishCriterion<Output>;
|
|
168
|
+
export declare const DEFAULT_WORKFLOW_DECODE_REPAIRS = 2;
|
|
154
169
|
export interface WorkflowFinishOptions<Output> {
|
|
170
|
+
/** Maximum repairs requested by deterministic or judge finish criteria. Defaults to zero. */
|
|
155
171
|
readonly maxRepairs?: number;
|
|
172
|
+
/**
|
|
173
|
+
* Maximum repairs after JSON parse or output schema decode failures.
|
|
174
|
+
* Defaults to DEFAULT_WORKFLOW_DECODE_REPAIRS.
|
|
175
|
+
*/
|
|
176
|
+
readonly maxDecodeRepairs?: number;
|
|
156
177
|
readonly criteria?: ReadonlyArray<WorkflowFinishCriterion<Output>>;
|
|
157
178
|
}
|
|
158
179
|
export interface WorkflowTaskDefinition<Id extends string, Agent extends WorkflowAgentRef, Output extends WorkflowOutputSchema> {
|