@skastr0/prism-linux-x64 0.4.6 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/prism +0 -0
- package/package.json +2 -2
- package/types/compile/errors.d.ts +114 -0
- package/types/errors.d.ts +107 -0
- package/types/harness-types-discover.d.ts +65 -0
- package/types/harness-types.d.ts +45 -0
- package/types/index.d.ts +26 -229
- package/types/lowerer-capabilities.d.ts +68 -15
- package/types/prism-home.d.ts +35 -0
- package/types/project-key.d.ts +2 -2
- package/types/types.d.ts +3 -3
- package/types/workflow-errors.d.ts +8 -1
- package/types/workflow-identity.d.ts +0 -9
- package/types/workflow-runner.d.ts +0 -4
- package/types/workflow-session.d.ts +25 -5
- package/types/workflow-store.d.ts +1 -28
- package/types/workflows.d.ts +85 -59
|
@@ -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", "omp-cli"]>;
|
|
2
|
+
export declare const WorkflowContinuationAdapterIdSchema: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "opencode2-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", "omp"]>;
|
|
4
|
+
export declare const WorkflowContinuationWorkerIdSchema: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok", "hermes", "kimi-code", "opencode", "opencode2", "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", "omp-cli"]>;
|
|
9
|
+
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "opencode2-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", "omp-cli"]>;
|
|
14
|
+
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "opencode2-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", "omp-cli"]>;
|
|
22
|
+
adapter: Schema.Literal<["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "opencode2-cli", "omp-cli"]>;
|
|
23
23
|
workflowWorker: typeof Schema.Boolean;
|
|
24
24
|
stableSessionIds: Schema.Literal<[false]>;
|
|
25
25
|
exactSameSessionContinuation: Schema.Literal<[false]>;
|
|
@@ -32,11 +32,13 @@ export declare const workflowContinuationAdapterByWorker: {
|
|
|
32
32
|
readonly "antigravity-cli": "antigravity-cli";
|
|
33
33
|
readonly "claude-code": "claude-code";
|
|
34
34
|
readonly "codex-cli": "codex-cli";
|
|
35
|
+
readonly cursor: "cursor";
|
|
35
36
|
readonly devin: "devin";
|
|
36
37
|
readonly grok: "grok-cli";
|
|
37
38
|
readonly hermes: "hermes";
|
|
38
39
|
readonly "kimi-code": "kimi-code";
|
|
39
40
|
readonly opencode: "opencode-cli";
|
|
41
|
+
readonly opencode2: "opencode2-cli";
|
|
40
42
|
readonly omp: "omp-cli";
|
|
41
43
|
};
|
|
42
44
|
export type WorkflowRepairLoopContinuationWorkerId = keyof typeof workflowContinuationAdapterByWorker;
|
|
@@ -79,6 +81,15 @@ export declare const workflowHarnessContinuationSupport: {
|
|
|
79
81
|
readonly continueCommand: "codex exec resume <sessionId> <prompt>";
|
|
80
82
|
readonly capture: "session_meta payload id, rollout JSONL, app-server metadata, or session index recovery";
|
|
81
83
|
};
|
|
84
|
+
readonly cursor: {
|
|
85
|
+
readonly adapter: "cursor";
|
|
86
|
+
readonly workflowWorker: true;
|
|
87
|
+
readonly stableSessionIds: true;
|
|
88
|
+
readonly exactSameSessionContinuation: true;
|
|
89
|
+
readonly sessionIdField: "sessionId";
|
|
90
|
+
readonly continueCommand: "agent --resume <sessionId> --print <prompt>";
|
|
91
|
+
readonly capture: "stream-json session_id";
|
|
92
|
+
};
|
|
82
93
|
readonly "grok-cli": {
|
|
83
94
|
readonly adapter: "grok-cli";
|
|
84
95
|
readonly workflowWorker: true;
|
|
@@ -124,6 +135,15 @@ export declare const workflowHarnessContinuationSupport: {
|
|
|
124
135
|
readonly continueCommand: "opencode run -s <sessionId> <prompt>";
|
|
125
136
|
readonly capture: "json step_start sessionID, session list, export, database, or log recovery";
|
|
126
137
|
};
|
|
138
|
+
readonly "opencode2-cli": {
|
|
139
|
+
readonly adapter: "opencode2-cli";
|
|
140
|
+
readonly workflowWorker: true;
|
|
141
|
+
readonly stableSessionIds: true;
|
|
142
|
+
readonly exactSameSessionContinuation: true;
|
|
143
|
+
readonly sessionIdField: "sessionId";
|
|
144
|
+
readonly continueCommand: "opencode2 run -s <sessionId> <prompt>";
|
|
145
|
+
readonly capture: "json step_start sessionID, session list, export, database, or log recovery";
|
|
146
|
+
};
|
|
127
147
|
readonly "omp-cli": {
|
|
128
148
|
readonly adapter: "omp-cli";
|
|
129
149
|
readonly workflowWorker: true;
|
|
@@ -8,10 +8,6 @@ import { type WorkflowUsage, type WorkflowUsageTotals } from "./workflow-usage.j
|
|
|
8
8
|
export type WorkflowTaskOutputSource = "mock-output";
|
|
9
9
|
export interface CompletedWorkflowTaskRecord {
|
|
10
10
|
readonly identity: WorkflowTaskIdentity;
|
|
11
|
-
readonly agent: {
|
|
12
|
-
readonly plugin: string;
|
|
13
|
-
readonly name: string;
|
|
14
|
-
};
|
|
15
11
|
readonly output: unknown;
|
|
16
12
|
readonly metadata?: Record<string, unknown>;
|
|
17
13
|
readonly outputSource?: WorkflowTaskOutputSource;
|
|
@@ -49,10 +45,6 @@ export interface WorkflowRunTaskRecord {
|
|
|
49
45
|
readonly cacheKey: string;
|
|
50
46
|
readonly status: WorkflowRunTaskStatus;
|
|
51
47
|
readonly cached: boolean;
|
|
52
|
-
readonly agent: {
|
|
53
|
-
readonly plugin: string;
|
|
54
|
-
readonly name: string;
|
|
55
|
-
};
|
|
56
48
|
readonly output: unknown;
|
|
57
49
|
readonly metadata?: Record<string, unknown>;
|
|
58
50
|
}
|
|
@@ -66,10 +58,6 @@ export interface WorkflowRunTaskProgress {
|
|
|
66
58
|
readonly cached?: boolean;
|
|
67
59
|
readonly cacheLookup?: WorkflowRunTaskCacheLookup;
|
|
68
60
|
readonly repairs: number;
|
|
69
|
-
readonly agent?: {
|
|
70
|
-
readonly plugin: string;
|
|
71
|
-
readonly name: string;
|
|
72
|
-
};
|
|
73
61
|
readonly lastEventType?: string;
|
|
74
62
|
readonly lastEventAt?: string;
|
|
75
63
|
}
|
|
@@ -83,13 +71,8 @@ export interface WorkflowRunTaskCompactSummary {
|
|
|
83
71
|
readonly evidenceSource: WorkflowRunTaskEvidenceSource;
|
|
84
72
|
readonly cached: boolean | null;
|
|
85
73
|
readonly cacheLookup?: WorkflowRunTaskCacheLookup;
|
|
86
|
-
readonly agent?: {
|
|
87
|
-
readonly plugin: string;
|
|
88
|
-
readonly name: string;
|
|
89
|
-
};
|
|
90
74
|
readonly workerAdapter: string | null;
|
|
91
75
|
readonly model: string | null;
|
|
92
|
-
readonly nativeAgent: string | null;
|
|
93
76
|
readonly repairCount: number;
|
|
94
77
|
readonly repairMode: string | null;
|
|
95
78
|
readonly durationMs: number | null;
|
|
@@ -302,7 +285,6 @@ export interface WorkflowTaskAttemptRecord {
|
|
|
302
285
|
readonly finishedAt: string | null;
|
|
303
286
|
readonly adapter?: string;
|
|
304
287
|
readonly model?: string;
|
|
305
|
-
readonly nativeAgent?: string;
|
|
306
288
|
readonly sessionId?: string;
|
|
307
289
|
readonly failure?: WorkflowTaskAttemptFailure;
|
|
308
290
|
readonly usage?: WorkflowUsage;
|
|
@@ -310,7 +292,7 @@ export interface WorkflowTaskAttemptRecord {
|
|
|
310
292
|
}
|
|
311
293
|
export declare const projectWorkflowStoreDir: (prismHome: string, cwd?: string) => string;
|
|
312
294
|
export declare const defaultWorkflowStorePath: (prismHome: string, cwd?: string) => string;
|
|
313
|
-
export declare const WORKFLOW_STORE_SCHEMA_VERSION =
|
|
295
|
+
export declare const WORKFLOW_STORE_SCHEMA_VERSION = 6;
|
|
314
296
|
/**
|
|
315
297
|
* Surfaces the one-time soft-divergence direction (WFE-007): a pre-existing store opened at a
|
|
316
298
|
* schema version older than the binary's `WORKFLOW_STORE_SCHEMA_VERSION` migrates in place inside
|
|
@@ -369,7 +351,6 @@ export declare class WorkflowStore {
|
|
|
369
351
|
readonly taskId?: string;
|
|
370
352
|
readonly cacheKey?: string;
|
|
371
353
|
readonly promptHash?: string;
|
|
372
|
-
readonly agentManifestHash?: string;
|
|
373
354
|
}): WorkflowCacheRecord[];
|
|
374
355
|
createRun(workflow: string, runId?: string): string;
|
|
375
356
|
recordRunSnapshot(input: {
|
|
@@ -423,10 +404,6 @@ export declare class WorkflowStore {
|
|
|
423
404
|
readonly runId: string;
|
|
424
405
|
readonly ordinal: number;
|
|
425
406
|
readonly identity: WorkflowTaskIdentity;
|
|
426
|
-
readonly agent: {
|
|
427
|
-
readonly plugin: string;
|
|
428
|
-
readonly name: string;
|
|
429
|
-
};
|
|
430
407
|
readonly status: WorkflowRunTaskStatus;
|
|
431
408
|
readonly cached: boolean;
|
|
432
409
|
readonly output: unknown;
|
|
@@ -440,10 +417,6 @@ export declare class WorkflowStore {
|
|
|
440
417
|
workflowMonitorRunDetail(runId: string): WorkflowMonitorRunDetail | null;
|
|
441
418
|
recordCompleted(input: {
|
|
442
419
|
readonly identity: WorkflowTaskIdentity;
|
|
443
|
-
readonly agent: {
|
|
444
|
-
readonly plugin: string;
|
|
445
|
-
readonly name: string;
|
|
446
|
-
};
|
|
447
420
|
readonly output: unknown;
|
|
448
421
|
readonly metadata?: Record<string, unknown>;
|
|
449
422
|
readonly outputSource?: WorkflowTaskOutputSource;
|
package/types/workflows.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import type { Either } from "effect/Either";
|
|
3
3
|
import type { ParseError } from "effect/ParseResult";
|
|
4
|
-
import type
|
|
4
|
+
import { type WorkflowRuntimeError } from "./workflow-errors.js";
|
|
5
5
|
export type { WorkflowRuntimeError } from "./workflow-errors.js";
|
|
6
6
|
export interface WorkflowModelRef {
|
|
7
7
|
readonly modelspace?: string;
|
|
@@ -32,22 +32,8 @@ export interface WorkflowSkillspaceRef {
|
|
|
32
32
|
readonly skillspace: string;
|
|
33
33
|
readonly skills: ReadonlyArray<string>;
|
|
34
34
|
}
|
|
35
|
-
export interface WorkflowAgentRef {
|
|
36
|
-
readonly kind: "agent-ref";
|
|
37
|
-
readonly plugin: string;
|
|
38
|
-
readonly name: string;
|
|
39
|
-
readonly description: string;
|
|
40
|
-
readonly sourceHash: string;
|
|
41
|
-
readonly manifestHash: string;
|
|
42
|
-
readonly model?: WorkflowModelRef;
|
|
43
|
-
readonly installs: ReadonlyArray<string>;
|
|
44
|
-
}
|
|
45
35
|
export interface WorkflowTaskSummary {
|
|
46
36
|
readonly id: string;
|
|
47
|
-
readonly agent: {
|
|
48
|
-
readonly plugin: string;
|
|
49
|
-
readonly name: string;
|
|
50
|
-
};
|
|
51
37
|
readonly cacheKey?: string;
|
|
52
38
|
}
|
|
53
39
|
export interface WorkflowValidationSummary {
|
|
@@ -58,9 +44,40 @@ export interface WorkflowValidationSummary {
|
|
|
58
44
|
}
|
|
59
45
|
export type WorkflowOutputSchema = Schema.Schema.AnyNoContext;
|
|
60
46
|
export type WorkflowFinishCriterionError = Error;
|
|
61
|
-
export type WorkflowWorkerId = "amp-code" | "antigravity-cli" | "claude-code" | "codex-cli" | "devin" | "grok" | "hermes" | "kimi-code" | "opencode" | "omp";
|
|
47
|
+
export type WorkflowWorkerId = "amp-code" | "antigravity-cli" | "claude-code" | "codex-cli" | "cursor" | "devin" | "grok" | "hermes" | "kimi-code" | "opencode" | "opencode2" | "omp";
|
|
48
|
+
/**
|
|
49
|
+
* Per-harness model identifier map. Empty in core so `worker.model` stays
|
|
50
|
+
* `string` until `prism workflow refresh-harness-types` augments keys with
|
|
51
|
+
* live unions. Do not pre-declare `string` properties here — interface
|
|
52
|
+
* merging cannot narrow `string` to a slug union.
|
|
53
|
+
*/
|
|
54
|
+
export interface WorkflowHarnessModelMap {
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Amp catalog `provider/model` ids from `show-agent-options`. Empty in core;
|
|
58
|
+
* refresh augments `"amp-code"` for `worker.catalogModel`.
|
|
59
|
+
*/
|
|
60
|
+
export interface WorkflowHarnessCatalogModelMap {
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Amp reasoning-effort ladders from the catalog. Empty in core; refresh
|
|
64
|
+
* augments `"amp-code"` for `worker.effort`.
|
|
65
|
+
*/
|
|
66
|
+
export interface WorkflowHarnessEffortMap {
|
|
67
|
+
}
|
|
68
|
+
export type WorkflowHarnessModel<W extends WorkflowWorkerId> = (W extends keyof WorkflowHarnessModelMap ? WorkflowHarnessModelMap[W] : string) | WorkflowModelProfileRef;
|
|
69
|
+
export type WorkflowHarnessCatalogModel<W extends WorkflowWorkerId> = W extends keyof WorkflowHarnessCatalogModelMap ? WorkflowHarnessCatalogModelMap[W] : string;
|
|
70
|
+
export type WorkflowHarnessEffort<W extends WorkflowWorkerId> = W extends keyof WorkflowHarnessEffortMap ? WorkflowHarnessEffortMap[W] : string;
|
|
62
71
|
export type WorkflowPermissionMode = "legacy" | "permissive" | "restricted" | "interactive" | "sandbox-read-only" | "sandbox-workspace-write" | "full-access";
|
|
63
|
-
|
|
72
|
+
/** Workers with no sandbox flag and no per-invocation allowlist. */
|
|
73
|
+
export type WorkflowDialPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access">;
|
|
74
|
+
export type AntigravityWorkflowPermissionMode = WorkflowDialPermissionMode;
|
|
75
|
+
export type ClaudeWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "restricted" | "full-access">;
|
|
76
|
+
export type CodexWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access" | "sandbox-read-only" | "sandbox-workspace-write">;
|
|
77
|
+
export type CursorWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access" | "sandbox-workspace-write">;
|
|
78
|
+
export type DevinWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "restricted" | "full-access">;
|
|
79
|
+
export type OmpWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "restricted" | "full-access">;
|
|
80
|
+
export type WorkflowWorkerPermissionMode<W extends WorkflowWorkerId> = W extends "claude-code" ? ClaudeWorkflowPermissionMode : W extends "codex-cli" ? CodexWorkflowPermissionMode : W extends "cursor" ? CursorWorkflowPermissionMode : W extends "devin" ? DevinWorkflowPermissionMode : W extends "omp" ? OmpWorkflowPermissionMode : WorkflowDialPermissionMode;
|
|
64
81
|
export declare const WORKFLOW_SESSION_PERSISTENCE_WORKERS: readonly ["claude-code", "codex-cli", "omp"];
|
|
65
82
|
export type WorkflowSessionPersistenceWorkerId = typeof WORKFLOW_SESSION_PERSISTENCE_WORKERS[number];
|
|
66
83
|
export type WorkflowSessionPersistence = "persistent" | "ephemeral";
|
|
@@ -78,34 +95,35 @@ export interface WorkflowTaskWorkerRetryOptions {
|
|
|
78
95
|
readonly maxAttempts?: number;
|
|
79
96
|
readonly backoffMs?: number;
|
|
80
97
|
}
|
|
81
|
-
type
|
|
82
|
-
readonly model?:
|
|
83
|
-
readonly modelResolver?: (models: WorkflowResolvedModelTarget) => string;
|
|
98
|
+
type WorkflowTaskWorkerOptionsCommon<W extends WorkflowWorkerId = WorkflowWorkerId> = {
|
|
99
|
+
readonly model?: WorkflowHarnessModel<W>;
|
|
84
100
|
readonly profile?: string;
|
|
85
101
|
readonly restrictedTools?: ReadonlyArray<string>;
|
|
86
102
|
readonly retry?: WorkflowTaskWorkerRetryOptions;
|
|
87
103
|
};
|
|
88
|
-
|
|
89
|
-
readonly worker
|
|
90
|
-
readonly permission?:
|
|
104
|
+
type WorkflowTaskWorkerOptionsFor<W extends WorkflowWorkerId> = WorkflowTaskWorkerOptionsCommon<W> & {
|
|
105
|
+
readonly worker: W;
|
|
106
|
+
readonly permission?: WorkflowWorkerPermissionMode<W>;
|
|
107
|
+
} & (W extends "amp-code" ? {
|
|
91
108
|
readonly sessionPersistence?: never;
|
|
92
|
-
|
|
93
|
-
readonly
|
|
94
|
-
|
|
109
|
+
readonly catalogModel?: WorkflowHarnessCatalogModel<"amp-code">;
|
|
110
|
+
readonly effort?: WorkflowHarnessEffort<"amp-code">;
|
|
111
|
+
} : W extends WorkflowSessionPersistenceWorkerId ? {
|
|
95
112
|
readonly sessionPersistence?: WorkflowSessionPersistence;
|
|
96
|
-
}
|
|
97
|
-
readonly worker: "antigravity-cli";
|
|
98
|
-
readonly permission?: AntigravityWorkflowPermissionMode;
|
|
113
|
+
} : {
|
|
99
114
|
readonly sessionPersistence?: never;
|
|
100
115
|
});
|
|
101
|
-
export type
|
|
102
|
-
readonly
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
export type WorkflowTaskWorkerOptions = (WorkflowTaskWorkerOptionsCommon & {
|
|
117
|
+
readonly worker?: undefined;
|
|
118
|
+
readonly permission?: WorkflowPermissionMode;
|
|
119
|
+
readonly sessionPersistence?: never;
|
|
120
|
+
}) | {
|
|
121
|
+
[W in WorkflowWorkerId]: WorkflowTaskWorkerOptionsFor<W>;
|
|
122
|
+
}[WorkflowWorkerId];
|
|
105
123
|
export declare class WorkflowModelResolutionError extends Error {
|
|
106
124
|
readonly name = "WorkflowModelResolutionError";
|
|
107
125
|
}
|
|
108
|
-
export type WorkflowTaskModelResolutionSource = "task" | "
|
|
126
|
+
export type WorkflowTaskModelResolutionSource = "task" | "default" | "cli-fallback";
|
|
109
127
|
export interface WorkflowTaskModelResolution {
|
|
110
128
|
readonly model: string;
|
|
111
129
|
/** Harness-side inference provider (e.g. hermes `--provider xai-oauth`), from the modelspace target or harness default. */
|
|
@@ -114,6 +132,13 @@ export interface WorkflowTaskModelResolution {
|
|
|
114
132
|
readonly variant?: string;
|
|
115
133
|
readonly source: WorkflowTaskModelResolutionSource;
|
|
116
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Resolves a task's model to a concrete string: `worker.model` (or the
|
|
137
|
+
* modelspace profile it points at) wins; otherwise only the CLI `--model`
|
|
138
|
+
* fallback is consulted. A task with no model info at all resolves to
|
|
139
|
+
* `undefined` so per-worker CLIs that tolerate an omitted --model flag
|
|
140
|
+
* (e.g. opencode) keep doing so.
|
|
141
|
+
*/
|
|
117
142
|
export declare const resolveWorkflowTaskModelResolution: (task: AnyWorkflowTask, options?: {
|
|
118
143
|
readonly worker?: string;
|
|
119
144
|
readonly fallbackModel?: string;
|
|
@@ -152,10 +177,6 @@ export type WorkflowJudgeVerdict = {
|
|
|
152
177
|
};
|
|
153
178
|
export interface WorkflowJudgeTaskMetadata {
|
|
154
179
|
readonly id: string;
|
|
155
|
-
readonly agent: {
|
|
156
|
-
readonly plugin: string;
|
|
157
|
-
readonly name: string;
|
|
158
|
-
};
|
|
159
180
|
readonly cacheKey?: string;
|
|
160
181
|
readonly worker?: WorkflowTaskWorkerOptions;
|
|
161
182
|
}
|
|
@@ -187,9 +208,8 @@ export interface WorkflowFinishOptions<Output> {
|
|
|
187
208
|
readonly maxDecodeRepairs?: number;
|
|
188
209
|
readonly criteria?: ReadonlyArray<WorkflowFinishCriterion<Output>>;
|
|
189
210
|
}
|
|
190
|
-
export interface WorkflowTaskDefinition<Id extends string,
|
|
211
|
+
export interface WorkflowTaskDefinition<Id extends string, Output extends WorkflowOutputSchema> {
|
|
191
212
|
readonly id: Id;
|
|
192
|
-
readonly agent: Agent;
|
|
193
213
|
readonly prompt: string;
|
|
194
214
|
readonly output: Output;
|
|
195
215
|
readonly phase?: string;
|
|
@@ -197,14 +217,13 @@ export interface WorkflowTaskDefinition<Id extends string, Agent extends Workflo
|
|
|
197
217
|
readonly worker?: WorkflowTaskWorkerOptions;
|
|
198
218
|
readonly finish?: WorkflowFinishOptions<Schema.Schema.Type<Output>>;
|
|
199
219
|
}
|
|
200
|
-
export
|
|
220
|
+
export type WorkflowTask<Id extends string = string, Output extends WorkflowOutputSchema = WorkflowOutputSchema> = WorkflowTaskDefinition<Id, Output> & {
|
|
201
221
|
readonly kind: "workflow-task";
|
|
202
|
-
}
|
|
203
|
-
export type AnyWorkflowTask = WorkflowTask<string,
|
|
222
|
+
};
|
|
223
|
+
export type AnyWorkflowTask = WorkflowTask<string, WorkflowOutputSchema>;
|
|
204
224
|
export type WorkflowTaskOutput<Task extends AnyWorkflowTask> = Schema.Schema.Type<Task["output"]>;
|
|
205
225
|
export declare const resolveWorkflowTaskSessionPersistence: (task: Pick<AnyWorkflowTask, "worker">, effectiveWorker?: string | undefined) => WorkflowSessionPersistence | undefined;
|
|
206
226
|
export declare const assertWorkflowTaskSessionPersistence: (task: AnyWorkflowTask) => void;
|
|
207
|
-
export declare const isWorkflowAgentRef: (value: unknown) => value is WorkflowAgentRef;
|
|
208
227
|
export declare const isWorkflowTask: (value: unknown) => value is AnyWorkflowTask;
|
|
209
228
|
export interface WorkflowDefinition<Name extends string, Tasks extends ReadonlyArray<AnyWorkflowTask>> {
|
|
210
229
|
readonly kind: "workflow";
|
|
@@ -212,42 +231,49 @@ export interface WorkflowDefinition<Name extends string, Tasks extends ReadonlyA
|
|
|
212
231
|
readonly tasks: Tasks;
|
|
213
232
|
}
|
|
214
233
|
export interface PhaseFraming {
|
|
215
|
-
readonly
|
|
234
|
+
readonly purpose?: string;
|
|
216
235
|
readonly when?: string;
|
|
217
|
-
readonly coordination?: string;
|
|
218
236
|
readonly escalation?: string;
|
|
219
237
|
}
|
|
220
|
-
|
|
238
|
+
/**
|
|
239
|
+
* A SOP phase contract. The generated `sops.<plugin>.<sop>.phases.<phase>`
|
|
240
|
+
* value from `prism/refs/sops` satisfies this shape directly: `name`, `sop`,
|
|
241
|
+
* `plugin`, optional `input`/`output` schemas, optional `criteria`, and
|
|
242
|
+
* optional `framing`.
|
|
243
|
+
*/
|
|
244
|
+
export interface PhaseContract<Name extends string, Input extends WorkflowOutputSchema | undefined, Output extends WorkflowOutputSchema | undefined> {
|
|
221
245
|
readonly name: Name;
|
|
222
|
-
readonly
|
|
246
|
+
readonly sop: string;
|
|
223
247
|
readonly plugin: string;
|
|
224
|
-
readonly
|
|
225
|
-
readonly output
|
|
248
|
+
readonly input?: Input;
|
|
249
|
+
readonly output?: Output;
|
|
226
250
|
readonly criteria?: readonly string[];
|
|
227
251
|
readonly framing?: PhaseFraming;
|
|
228
252
|
}
|
|
229
253
|
export type PhaseTaskFinishOptions<Output> = WorkflowFinishOptions<Output> & {
|
|
230
254
|
readonly inherit?: boolean;
|
|
231
255
|
};
|
|
232
|
-
|
|
256
|
+
/** Decoded TypeScript value of a phase input contract (unknown when no contract). */
|
|
257
|
+
export type PhaseTaskInputValue<Input extends WorkflowOutputSchema | undefined> = Input extends WorkflowOutputSchema ? Schema.Schema.Type<Input> : unknown;
|
|
258
|
+
export type PhaseTaskDefinition<Id extends string, Input extends WorkflowOutputSchema | undefined = undefined, Output extends WorkflowOutputSchema = WorkflowOutputSchema> = Omit<WorkflowTaskDefinition<Id, Output>, "output" | "phase" | "finish"> & {
|
|
259
|
+
readonly input?: PhaseTaskInputValue<Input>;
|
|
233
260
|
readonly output?: Output;
|
|
234
261
|
readonly phase?: string;
|
|
235
262
|
readonly finish?: PhaseTaskFinishOptions<Schema.Schema.Type<Output>>;
|
|
236
263
|
readonly brief?: boolean;
|
|
237
264
|
};
|
|
238
|
-
export type PhaseCtxTask<
|
|
239
|
-
export interface PhaseCtx<Name extends string,
|
|
265
|
+
export type PhaseCtxTask<Input extends WorkflowOutputSchema | undefined, DefaultOutput extends WorkflowOutputSchema | undefined> = <const Id extends string, const TaskOutput extends WorkflowOutputSchema = Extract<DefaultOutput, WorkflowOutputSchema>>(def: PhaseTaskDefinition<Id, Input, TaskOutput>) => Effect.Effect<WorkflowTaskOutput<WorkflowTask<Id, TaskOutput>>, WorkflowRuntimeError>;
|
|
266
|
+
export interface PhaseCtx<Name extends string, Input extends WorkflowOutputSchema | undefined, DefaultOutput extends WorkflowOutputSchema | undefined> {
|
|
240
267
|
readonly name: Name;
|
|
241
|
-
readonly
|
|
268
|
+
readonly sop: string;
|
|
242
269
|
readonly plugin: string;
|
|
243
|
-
readonly agents: Agents;
|
|
244
270
|
readonly phase: string;
|
|
245
|
-
readonly task: PhaseCtxTask<
|
|
271
|
+
readonly task: PhaseCtxTask<Input, DefaultOutput>;
|
|
246
272
|
}
|
|
247
|
-
export declare const phase: <const Name extends string, const
|
|
273
|
+
export declare const phase: <const Name extends string, const Input extends WorkflowOutputSchema | undefined, const Output extends WorkflowOutputSchema | undefined, Result, Err = WorkflowRuntimeError>(runtime: Pick<WorkflowRuntime, "runTask">, contract: PhaseContract<Name, Input, Output>, fn: (ctx: PhaseCtx<Name, Input, Output>) => Effect.Effect<Result, Err, never>) => Effect.Effect<Result, Err | WorkflowRuntimeError, never>;
|
|
248
274
|
export interface WorkflowRuntime {
|
|
249
275
|
runTask: <Task extends AnyWorkflowTask>(task: Task) => Effect.Effect<WorkflowTaskOutput<Task>, WorkflowRuntimeError>;
|
|
250
|
-
phase: <const Name extends string, const
|
|
276
|
+
phase: <const Name extends string, const Input extends WorkflowOutputSchema | undefined, const Output extends WorkflowOutputSchema | undefined, Result, Err = WorkflowRuntimeError>(contract: PhaseContract<Name, Input, Output>, fn: (ctx: PhaseCtx<Name, Input, Output>) => Effect.Effect<Result, Err, never>) => Effect.Effect<Result, Err | WorkflowRuntimeError, never>;
|
|
251
277
|
}
|
|
252
278
|
export interface WorkflowRuntimeOptions {
|
|
253
279
|
readonly fallbackWorker?: string;
|
|
@@ -263,7 +289,7 @@ export interface DynamicWorkflowDefinition<Name extends string, Result = unknown
|
|
|
263
289
|
export type AnyWorkflowDefinition = WorkflowDefinition<string, ReadonlyArray<AnyWorkflowTask>> | DynamicWorkflowDefinition<string>;
|
|
264
290
|
export declare const isWorkflowDefinition: (value: unknown) => value is AnyWorkflowDefinition;
|
|
265
291
|
export declare const workflowSummary: (path: string, workflow: AnyWorkflowDefinition) => WorkflowValidationSummary;
|
|
266
|
-
export declare const defineTask: <const Id extends string, const
|
|
292
|
+
export declare const defineTask: <const Id extends string, const Output extends WorkflowOutputSchema>(definition: WorkflowTaskDefinition<Id, Output>) => WorkflowTask<Id, Output>;
|
|
267
293
|
export declare function defineWorkflow<const Name extends string, const Tasks extends ReadonlyArray<AnyWorkflowTask>>(definition: {
|
|
268
294
|
readonly name: Name;
|
|
269
295
|
readonly tasks: Tasks;
|