@skastr0/prism-linux-x64 0.7.1 → 0.8.0
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 +2 -2
- package/package.json +2 -2
- package/types/amp-projects.d.ts +39 -0
- package/types/amp-runners.d.ts +71 -0
- package/types/ast-to-json-schema.d.ts +46 -0
- package/types/fs.d.ts +2 -2
- package/types/harness-types-discover.d.ts +34 -0
- package/types/harness-types.d.ts +12 -0
- package/types/index.d.ts +19 -1
- package/types/lowerer-capabilities.d.ts +85 -120
- package/types/types.d.ts +2 -13
- package/types/workflow-amp-remote-worker.d.ts +69 -0
- package/types/workflow-amp-worker.d.ts +89 -0
- package/types/workflow-antigravity-pty.d.ts +22 -0
- package/types/workflow-antigravity-worker.d.ts +84 -0
- package/types/workflow-bun-runtime.d.ts +2 -0
- package/types/workflow-claude-worker.d.ts +36 -0
- package/types/workflow-cli-command.d.ts +1 -0
- package/types/workflow-codex-worker.d.ts +36 -0
- package/types/workflow-cursor-worker.d.ts +24 -0
- package/types/workflow-devin-worker.d.ts +25 -0
- package/types/workflow-effort.d.ts +18 -0
- package/types/workflow-grok-worker.d.ts +32 -0
- package/types/workflow-hermes-worker.d.ts +28 -0
- package/types/workflow-identity.d.ts +1 -0
- package/types/workflow-kimi-effort.d.ts +17 -0
- package/types/workflow-kimi-worker.d.ts +27 -0
- package/types/workflow-omp-worker.d.ts +49 -0
- package/types/workflow-opencode-worker.d.ts +26 -0
- package/types/workflow-output-schema.d.ts +6 -0
- package/types/workflow-permissions.d.ts +10 -0
- package/types/workflow-process-guard.d.ts +28 -0
- package/types/workflow-session.d.ts +24 -14
- package/types/workflow-worker-process.d.ts +40 -0
- package/types/workflow-workers.d.ts +50 -0
- package/types/workflows.d.ts +111 -9
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AnyWorkflowWorkerTask, WorkflowPermissionMode } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution, WorkflowTaskProgressReporter, WorkflowTaskRepairLoopOption } from "./workflow-runner.js";
|
|
3
|
+
export type OpenCodeWorkflowWorkerOptions = {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly resolvedPermission: WorkflowPermissionMode;
|
|
8
|
+
readonly abortSignal?: AbortSignal;
|
|
9
|
+
readonly reportProgress?: WorkflowTaskProgressReporter;
|
|
10
|
+
} & WorkflowTaskRepairLoopOption<"opencode">;
|
|
11
|
+
export declare class OpenCodeWorkflowWorkerError extends Error {
|
|
12
|
+
readonly name = "OpenCodeWorkflowWorkerError";
|
|
13
|
+
readonly metadata?: Record<string, unknown>;
|
|
14
|
+
constructor(message: string, metadata?: Record<string, unknown>);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* OpenCode v2 `run` has no `--dir` (the process cwd is the project) and uses
|
|
18
|
+
* `--auto` instead of `--dangerously-skip-permissions`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const buildOpenCodeArgs: (input: {
|
|
21
|
+
readonly model?: string;
|
|
22
|
+
readonly prompt: string;
|
|
23
|
+
readonly sessionId?: string;
|
|
24
|
+
readonly permission?: WorkflowPermissionMode;
|
|
25
|
+
}) => ReadonlyArray<string>;
|
|
26
|
+
export declare const runOpenCodeWorkflowTask: (task: AnyWorkflowWorkerTask, options: OpenCodeWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Schema } from "effect";
|
|
2
|
+
import { WorkflowOutputSchemaError, type JsonSchema as WorkflowJsonSchema } from "./ast-to-json-schema.js";
|
|
3
|
+
export { WorkflowOutputSchemaError };
|
|
4
|
+
export type { WorkflowJsonSchema };
|
|
5
|
+
export declare const workflowJsonSchemaFromEffectSchema: (schema: Schema.Top) => WorkflowJsonSchema;
|
|
6
|
+
export declare const tryWorkflowJsonSchemaFromEffectSchema: (schema: Schema.Top) => WorkflowJsonSchema | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkflowPermissionMode } from "./workflows.js";
|
|
2
|
+
export declare const WORKFLOW_PERMISSION_MODES: readonly ["legacy", "permissive", "restricted", "interactive", "sandbox-read-only", "sandbox-workspace-write", "full-access"];
|
|
3
|
+
export declare const isWorkflowPermissionMode: (value: string) => value is WorkflowPermissionMode;
|
|
4
|
+
export declare const assertNeverWorkflowPermissionMode: (worker: string, mode: never) => never;
|
|
5
|
+
export declare class WorkflowPermissionError extends Error {
|
|
6
|
+
readonly worker: string;
|
|
7
|
+
readonly mode: string;
|
|
8
|
+
readonly name = "WorkflowPermissionError";
|
|
9
|
+
constructor(worker: string, mode: string, message: string);
|
|
10
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface WorkflowProcessGuardRequest {
|
|
2
|
+
readonly cwd: string;
|
|
3
|
+
readonly command: string;
|
|
4
|
+
readonly args: ReadonlyArray<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class WorkflowProcessGuardError extends Error {
|
|
7
|
+
readonly name = "WorkflowProcessGuardError";
|
|
8
|
+
}
|
|
9
|
+
export declare const encodeWorkflowProcessGuardRequest: (request: WorkflowProcessGuardRequest) => ReadonlyArray<string>;
|
|
10
|
+
export declare const decodeWorkflowProcessGuardRequest: (encodedCwd: string, encodedCommand: string, encodedArgs: ReadonlyArray<string>) => WorkflowProcessGuardRequest;
|
|
11
|
+
export declare const workflowProcessGroupExists: (pid: number) => boolean;
|
|
12
|
+
export declare const waitForWorkflowProcessGroupAbsence: (pid: number, timeoutMs: number) => Promise<boolean>;
|
|
13
|
+
export interface WorkflowProcessGroupTerminationResult {
|
|
14
|
+
readonly escalated: boolean;
|
|
15
|
+
readonly alreadyAbsent: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface WorkflowProcessGroupTerminationOptions {
|
|
18
|
+
readonly termGraceMs?: number;
|
|
19
|
+
readonly killConfirmationMs?: number;
|
|
20
|
+
readonly onEscalated?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const terminateWorkflowProcessGroup: (pid: number, options?: WorkflowProcessGroupTerminationOptions) => Promise<WorkflowProcessGroupTerminationResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Own a detached workload process group for exactly as long as the caller keeps
|
|
25
|
+
* this guard's stdin open. Every shutdown cause shares the same bounded group
|
|
26
|
+
* termination and direct-child reap operation.
|
|
27
|
+
*/
|
|
28
|
+
export declare const runWorkflowProcessGuard: (request: WorkflowProcessGuardRequest) => Promise<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const WorkflowContinuationAdapterIdSchema: Schema.Literals<readonly ["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "
|
|
2
|
+
export declare const WorkflowContinuationAdapterIdSchema: Schema.Literals<readonly ["amp-code", "amp-orb", "amp-runner", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
3
3
|
export type WorkflowContinuationAdapterId = typeof WorkflowContinuationAdapterIdSchema.Type;
|
|
4
4
|
/**
|
|
5
5
|
* Workflow workers that can continue a session.
|
|
@@ -13,12 +13,12 @@ export type WorkflowContinuationWorkerId = typeof WorkflowContinuationWorkerIdSc
|
|
|
13
13
|
export declare const StableSessionIdSchema: Schema.brand<Schema.NonEmptyString, "StableSessionId">;
|
|
14
14
|
export type StableSessionId = typeof StableSessionIdSchema.Type;
|
|
15
15
|
export declare const WorkflowStableSessionSchema: Schema.Struct<{
|
|
16
|
-
readonly adapter: Schema.Literals<readonly ["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "
|
|
16
|
+
readonly adapter: Schema.Literals<readonly ["amp-code", "amp-orb", "amp-runner", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
17
17
|
readonly sessionId: Schema.brand<Schema.NonEmptyString, "StableSessionId">;
|
|
18
18
|
}>;
|
|
19
19
|
export type WorkflowStableSession = typeof WorkflowStableSessionSchema.Type;
|
|
20
20
|
export declare const WorkflowHarnessContinuationSupportSchema: Schema.Union<readonly [Schema.Struct<{
|
|
21
|
-
readonly adapter: Schema.Literals<readonly ["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "
|
|
21
|
+
readonly adapter: Schema.Literals<readonly ["amp-code", "amp-orb", "amp-runner", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
22
22
|
readonly workflowWorker: Schema.Boolean;
|
|
23
23
|
readonly stableSessionIds: Schema.Literal<true>;
|
|
24
24
|
readonly exactSameSessionContinuation: Schema.Literal<true>;
|
|
@@ -26,7 +26,7 @@ export declare const WorkflowHarnessContinuationSupportSchema: Schema.Union<read
|
|
|
26
26
|
readonly continueCommand: Schema.NonEmptyString;
|
|
27
27
|
readonly capture: Schema.NonEmptyString;
|
|
28
28
|
}>, Schema.Struct<{
|
|
29
|
-
readonly adapter: Schema.Literals<readonly ["amp-code", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "
|
|
29
|
+
readonly adapter: Schema.Literals<readonly ["amp-code", "amp-orb", "amp-runner", "antigravity-cli", "claude-code", "codex-cli", "cursor", "devin", "grok-cli", "hermes", "kimi-code", "opencode-cli", "omp-cli"]>;
|
|
30
30
|
readonly workflowWorker: Schema.Boolean;
|
|
31
31
|
readonly stableSessionIds: Schema.Literal<false>;
|
|
32
32
|
readonly exactSameSessionContinuation: Schema.Literal<false>;
|
|
@@ -36,6 +36,8 @@ export declare const WorkflowHarnessContinuationSupportSchema: Schema.Union<read
|
|
|
36
36
|
export type WorkflowHarnessContinuationSupport = typeof WorkflowHarnessContinuationSupportSchema.Type;
|
|
37
37
|
export declare const workflowContinuationAdapterByWorker: {
|
|
38
38
|
readonly "amp-code": "amp-code";
|
|
39
|
+
readonly "amp-orb": "amp-orb";
|
|
40
|
+
readonly "amp-runner": "amp-runner";
|
|
39
41
|
readonly "antigravity-cli": "antigravity-cli";
|
|
40
42
|
readonly "claude-code": "claude-code";
|
|
41
43
|
readonly "codex-cli": "codex-cli";
|
|
@@ -45,7 +47,6 @@ export declare const workflowContinuationAdapterByWorker: {
|
|
|
45
47
|
readonly hermes: "hermes";
|
|
46
48
|
readonly "kimi-code": "kimi-code";
|
|
47
49
|
readonly opencode: "opencode-cli";
|
|
48
|
-
readonly opencode2: "opencode2-cli";
|
|
49
50
|
readonly omp: "omp-cli";
|
|
50
51
|
};
|
|
51
52
|
export type WorkflowRepairLoopContinuationWorkerId = keyof typeof workflowContinuationAdapterByWorker;
|
|
@@ -61,6 +62,24 @@ export declare const workflowHarnessContinuationSupport: {
|
|
|
61
62
|
readonly continueCommand: "amp threads continue <sessionId> --execute <prompt>";
|
|
62
63
|
readonly capture: "stream-json session_id, local thread metadata, or threads list/search recovery";
|
|
63
64
|
};
|
|
65
|
+
readonly "amp-orb": {
|
|
66
|
+
readonly adapter: "amp-orb";
|
|
67
|
+
readonly workflowWorker: true;
|
|
68
|
+
readonly stableSessionIds: true;
|
|
69
|
+
readonly exactSameSessionContinuation: true;
|
|
70
|
+
readonly sessionIdField: "sessionId";
|
|
71
|
+
readonly continueCommand: "amp threads continue <sessionId> --orb-execute --execute <prompt> --stream-json";
|
|
72
|
+
readonly capture: "stream-json session_id (the orb thread id); never list readback";
|
|
73
|
+
};
|
|
74
|
+
readonly "amp-runner": {
|
|
75
|
+
readonly adapter: "amp-runner";
|
|
76
|
+
readonly workflowWorker: true;
|
|
77
|
+
readonly stableSessionIds: true;
|
|
78
|
+
readonly exactSameSessionContinuation: true;
|
|
79
|
+
readonly sessionIdField: "sessionId";
|
|
80
|
+
readonly continueCommand: "amp threads continue <sessionId> --orb-execute --execute <prompt> --stream-json";
|
|
81
|
+
readonly capture: "stream-json session_id (the runner thread id); never list readback";
|
|
82
|
+
};
|
|
64
83
|
readonly "antigravity-cli": {
|
|
65
84
|
readonly adapter: "antigravity-cli";
|
|
66
85
|
readonly workflowWorker: true;
|
|
@@ -142,15 +161,6 @@ export declare const workflowHarnessContinuationSupport: {
|
|
|
142
161
|
readonly continueCommand: "opencode run -s <sessionId> <prompt>";
|
|
143
162
|
readonly capture: "json step_start sessionID, session list, export, database, or log recovery";
|
|
144
163
|
};
|
|
145
|
-
readonly "opencode2-cli": {
|
|
146
|
-
readonly adapter: "opencode2-cli";
|
|
147
|
-
readonly workflowWorker: true;
|
|
148
|
-
readonly stableSessionIds: true;
|
|
149
|
-
readonly exactSameSessionContinuation: true;
|
|
150
|
-
readonly sessionIdField: "sessionId";
|
|
151
|
-
readonly continueCommand: "opencode2 run -s <sessionId> <prompt>";
|
|
152
|
-
readonly capture: "json step_start sessionID, session list, export, database, or log recovery";
|
|
153
|
-
};
|
|
154
164
|
readonly "omp-cli": {
|
|
155
165
|
readonly adapter: "omp-cli";
|
|
156
166
|
readonly workflowWorker: true;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { parsePositiveInteger } from "./workflow-harness-detection.js";
|
|
2
|
+
export { parsePositiveInteger };
|
|
3
|
+
export interface WorkflowWorkerProcessOptions {
|
|
4
|
+
readonly command: string;
|
|
5
|
+
readonly args: ReadonlyArray<string>;
|
|
6
|
+
readonly cwd: string;
|
|
7
|
+
readonly abortSignal?: AbortSignal;
|
|
8
|
+
readonly env?: Record<string, string>;
|
|
9
|
+
readonly onOutputActivity?: (stream: WorkflowWorkerOutputStream) => void;
|
|
10
|
+
readonly earlyExitPatterns?: ReadonlyArray<{
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly pattern: RegExp;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export type WorkflowWorkerOutputStream = "stdout" | "stderr";
|
|
16
|
+
export interface WorkflowWorkerProcessResult {
|
|
17
|
+
readonly exitCode: number | null;
|
|
18
|
+
readonly stdout: string;
|
|
19
|
+
readonly stderr: string;
|
|
20
|
+
readonly durationMs: number;
|
|
21
|
+
readonly aborted: boolean;
|
|
22
|
+
readonly earlyExit?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Worker output is captured in full, without a byte ceiling. Harness workers are
|
|
26
|
+
* long-running agents whose event streams routinely reach tens or hundreds of
|
|
27
|
+
* megabytes; a size cap turned normal agent verbosity into a task failure and
|
|
28
|
+
* forced callers to guess a number they cannot know in advance. Runaway workers
|
|
29
|
+
* are bounded by run control (`workflow runs stop`), the opt-in inactivity
|
|
30
|
+
* watchdog, and cost budgets \u2014 not by truncating their output.
|
|
31
|
+
*/
|
|
32
|
+
export declare class WorkflowWorkerOutputCapture {
|
|
33
|
+
private readonly streams;
|
|
34
|
+
private totalBytes;
|
|
35
|
+
append(source: WorkflowWorkerOutputStream, text: string, byteLength?: number): void;
|
|
36
|
+
output(source: WorkflowWorkerOutputStream): string;
|
|
37
|
+
bytes(): number;
|
|
38
|
+
}
|
|
39
|
+
export declare const workflowWorkerProcessExcerpt: (stdout: string, stderr: string) => string;
|
|
40
|
+
export declare const runWorkflowWorkerProcess: (options: WorkflowWorkerProcessOptions) => Promise<WorkflowWorkerProcessResult>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type AnyWorkflowWorkerTask, type WorkflowPermissionMode, type WorkflowWorkerId } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution, WorkflowTaskExecutionContext, WorkflowTaskExecutionContextWithoutRepair, WorkflowWorkerTaskExecutor } from "./workflow-runner.js";
|
|
3
|
+
import { type WorkflowRepairLoopContinuationCapability, type WorkflowRepairLoopContinuationCapabilityForWorker } from "./workflow-session.js";
|
|
4
|
+
export { WorkflowPermissionError } from "./workflow-permissions.js";
|
|
5
|
+
export interface WorkflowWorkerAdapterOptionsBase {
|
|
6
|
+
readonly cwd: string;
|
|
7
|
+
readonly model?: string;
|
|
8
|
+
readonly profile?: string;
|
|
9
|
+
readonly resolvedPermission: WorkflowPermissionMode;
|
|
10
|
+
readonly restrictedTools?: readonly string[];
|
|
11
|
+
readonly abortSignal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
export type WorkflowWorkerAdapterOptionsForCapability<Capability extends WorkflowRepairLoopContinuationCapability> = WorkflowWorkerAdapterOptionsBase & (Capability extends "stable-session-repair-loop" ? {
|
|
14
|
+
readonly context?: WorkflowTaskExecutionContext;
|
|
15
|
+
} : {
|
|
16
|
+
readonly context?: WorkflowTaskExecutionContextWithoutRepair;
|
|
17
|
+
});
|
|
18
|
+
export type WorkflowWorkerAdapterOptions<Worker extends WorkflowWorkerId = WorkflowWorkerId> = WorkflowWorkerAdapterOptionsForCapability<WorkflowRepairLoopContinuationCapabilityForWorker<Worker>>;
|
|
19
|
+
export interface WorkflowWorkerAdapter<Worker extends WorkflowWorkerId = WorkflowWorkerId> {
|
|
20
|
+
readonly id: Worker;
|
|
21
|
+
readonly runTask: (task: AnyWorkflowWorkerTask, options: WorkflowWorkerAdapterOptions<Worker>) => Promise<WorkflowTaskExecution>;
|
|
22
|
+
}
|
|
23
|
+
export declare class UnsupportedWorkflowWorkerError extends Error {
|
|
24
|
+
readonly worker: string;
|
|
25
|
+
readonly supportedWorkers: ReadonlyArray<string>;
|
|
26
|
+
readonly name = "UnsupportedWorkflowWorkerError";
|
|
27
|
+
constructor(worker: string, supportedWorkers: ReadonlyArray<string>);
|
|
28
|
+
}
|
|
29
|
+
export declare class WorkflowWorkerContinuationError extends Error {
|
|
30
|
+
readonly name = "WorkflowWorkerContinuationError";
|
|
31
|
+
}
|
|
32
|
+
export declare const supportedWorkflowWorkers: () => ReadonlyArray<string>;
|
|
33
|
+
export declare function getWorkflowWorkerAdapter<Worker extends WorkflowWorkerId>(worker: Worker): WorkflowWorkerAdapter<Worker>;
|
|
34
|
+
export declare function getWorkflowWorkerAdapter(worker: string): WorkflowWorkerAdapter;
|
|
35
|
+
/**
|
|
36
|
+
* Per-worker default permission. Remote Amp executors (orb, runner) accept only
|
|
37
|
+
* `legacy` — no per-invocation override reaches the remote amp process — so an
|
|
38
|
+
* unconfigured remote task must default to `legacy`, not the local `permissive`
|
|
39
|
+
* default that dispatch would then reject.
|
|
40
|
+
*/
|
|
41
|
+
export declare const defaultWorkflowWorkerPermission: (worker?: string) => WorkflowPermissionMode;
|
|
42
|
+
export declare const resolveWorkflowTaskPermission: (task: AnyWorkflowWorkerTask, fallbackPermission?: WorkflowPermissionMode) => WorkflowPermissionMode;
|
|
43
|
+
/** Same argv interpreters run uses. Validate calls this so illegal pins fail before spend. */
|
|
44
|
+
export declare const assertWorkflowWorkerPermission: (worker: string, mode: WorkflowPermissionMode, restrictedTools?: readonly string[]) => void;
|
|
45
|
+
export declare const createWorkflowWorkerExecutor: (input: {
|
|
46
|
+
readonly worker?: string;
|
|
47
|
+
readonly cwd: string;
|
|
48
|
+
readonly model?: string;
|
|
49
|
+
readonly fallbackPermission?: WorkflowPermissionMode;
|
|
50
|
+
}) => WorkflowWorkerTaskExecutor;
|
package/types/workflows.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Effect, Result, Schema, type SchemaAST } from "effect";
|
|
2
|
+
import { type WorkflowEffortCapabilityFor, type WorkflowEffortWorkerHarnessId, type WorkflowWorkerHarnessId } from "./lowerer-capabilities.js";
|
|
2
3
|
import { type WorkflowRuntimeError } from "./workflow-errors.js";
|
|
3
4
|
import { type WorkflowSchedule } from "./workflow-scheduler/schedule.js";
|
|
4
5
|
import { type JevEntry, type JevQuestions, type JevRequest, type JevResult, type JevResultCodec } from "./jev.js";
|
|
@@ -57,7 +58,7 @@ export interface WorkflowValidationSummary {
|
|
|
57
58
|
*/
|
|
58
59
|
export type WorkflowOutputSchema = Schema.Codec<unknown, unknown, never, never>;
|
|
59
60
|
export type WorkflowFinishCriterionError = Error;
|
|
60
|
-
export type WorkflowWorkerId =
|
|
61
|
+
export type WorkflowWorkerId = WorkflowWorkerHarnessId;
|
|
61
62
|
/**
|
|
62
63
|
* Per-harness model identifier map. Empty in core so `worker.model` stays
|
|
63
64
|
* `string` until `prism workflow refresh-harness-types` augments keys with
|
|
@@ -73,14 +74,56 @@ export interface WorkflowHarnessModelMap {
|
|
|
73
74
|
export interface WorkflowHarnessCatalogModelMap {
|
|
74
75
|
}
|
|
75
76
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
77
|
+
* Model-specific reasoning-effort ladders from installed CLI catalogs.
|
|
78
|
+
* Fixed CLI values come from `LOWERER_CAPABILITIES` and are not discovered.
|
|
79
|
+
* Refresh augments only catalog-backed workers.
|
|
78
80
|
*/
|
|
79
81
|
export interface WorkflowHarnessEffortMap {
|
|
80
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Discovered Amp orb projects (`amp projects list --json`). Empty in core;
|
|
85
|
+
* refresh augments `"amp-orb"` so `worker.project` narrows to known projects.
|
|
86
|
+
*/
|
|
87
|
+
export interface WorkflowHarnessProjectMap {
|
|
88
|
+
}
|
|
89
|
+
export type WorkflowHarnessProject<W extends WorkflowWorkerId> = W extends keyof WorkflowHarnessProjectMap ? WorkflowHarnessProjectMap[W] : string;
|
|
90
|
+
/**
|
|
91
|
+
* Discovered Amp runners (`list_runners`, captured by
|
|
92
|
+
* `refresh-harness-types --discover-amp-runners`). Empty in core; refresh
|
|
93
|
+
* augments one key per runner whose value is the union of the directories
|
|
94
|
+
* that runner serves.
|
|
95
|
+
*/
|
|
96
|
+
export interface WorkflowHarnessRunnerDirMap {
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The `amp-runner` target: with a runner snapshot, a discriminated union over
|
|
100
|
+
* the live runner ids so `runnerDir` follows the chosen id (a directory
|
|
101
|
+
* another runner serves is a type error); without one, both stay plain
|
|
102
|
+
* strings. `validate` enforces the pair again at load time.
|
|
103
|
+
*/
|
|
104
|
+
export type AmpRunnerTargetOptions = keyof WorkflowHarnessRunnerDirMap extends never ? {
|
|
105
|
+
/** Runner id from `amp --no-tui --runner-id <id>` (`--executor runner:<id>`). */
|
|
106
|
+
readonly runnerId: string;
|
|
107
|
+
/** Absolute directory the runner serves (`--runner-dir`); defaults to the runner's start directory. */
|
|
108
|
+
readonly runnerDir?: string;
|
|
109
|
+
} : {
|
|
110
|
+
[R in keyof WorkflowHarnessRunnerDirMap]: {
|
|
111
|
+
readonly runnerId: R;
|
|
112
|
+
readonly runnerDir?: WorkflowHarnessRunnerDirMap[R];
|
|
113
|
+
};
|
|
114
|
+
}[keyof WorkflowHarnessRunnerDirMap];
|
|
81
115
|
export type WorkflowHarnessModel<W extends WorkflowWorkerId> = (W extends keyof WorkflowHarnessModelMap ? WorkflowHarnessModelMap[W] : string) | WorkflowModelProfileRef;
|
|
82
116
|
export type WorkflowHarnessCatalogModel<W extends WorkflowWorkerId> = W extends keyof WorkflowHarnessCatalogModelMap ? WorkflowHarnessCatalogModelMap[W] : string;
|
|
83
|
-
|
|
117
|
+
type WorkflowHarnessEffortForCapability<W extends WorkflowWorkerId, Capability> = Capability extends {
|
|
118
|
+
readonly kind: "fixed";
|
|
119
|
+
readonly values: readonly (infer Value extends string)[];
|
|
120
|
+
} ? Value : Capability extends {
|
|
121
|
+
readonly kind: "catalog";
|
|
122
|
+
} ? W extends keyof WorkflowHarnessEffortMap ? WorkflowHarnessEffortMap[W] : never : never;
|
|
123
|
+
type WorkflowHarnessEffortForOne<W extends WorkflowWorkerId> = WorkflowHarnessEffortForCapability<W, NonNullable<WorkflowEffortCapabilityFor<W>>>;
|
|
124
|
+
/** Harness-bound effort values; catalog-backed values require a refreshed type map. */
|
|
125
|
+
export type WorkflowHarnessEffort<W extends WorkflowWorkerId> = W extends WorkflowWorkerId ? WorkflowHarnessEffortForOne<W> : never;
|
|
126
|
+
export declare const workflowWorkerSupportsEffort: (worker: unknown) => worker is WorkflowEffortWorkerHarnessId;
|
|
84
127
|
export type WorkflowPermissionMode = "legacy" | "permissive" | "restricted" | "interactive" | "sandbox-read-only" | "sandbox-workspace-write" | "full-access";
|
|
85
128
|
/** Workers with no sandbox flag and no per-invocation allowlist. */
|
|
86
129
|
export type WorkflowDialPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access">;
|
|
@@ -90,8 +133,31 @@ export type CodexWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legac
|
|
|
90
133
|
export type CursorWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access" | "sandbox-workspace-write">;
|
|
91
134
|
export type DevinWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "restricted" | "full-access">;
|
|
92
135
|
export type OmpWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "restricted" | "full-access">;
|
|
93
|
-
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;
|
|
94
136
|
export declare const WORKFLOW_SESSION_PERSISTENCE_WORKERS: readonly ["claude-code", "codex-cli", "omp"];
|
|
137
|
+
/** Remote Amp executors: hosted orbs and operator-declared runners. */
|
|
138
|
+
export type AmpRemoteWorkflowWorkerId = Extract<WorkflowWorkerId, "amp-orb" | "amp-runner">;
|
|
139
|
+
/**
|
|
140
|
+
* Workers whose full options can be built from `{ worker, model, ... }` alone.
|
|
141
|
+
* TypeScript's smarter union checking (TS 3.5+) decomposes a wide `worker`
|
|
142
|
+
* discriminant across the options union, so a helper typed against the full
|
|
143
|
+
* {@link WorkflowWorkerId} that cannot supply remote workers' required fields
|
|
144
|
+
* (`project`, `runnerId`) would silently accept remote ids as invalid tasks.
|
|
145
|
+
* Loose helpers must narrow to this.
|
|
146
|
+
*/
|
|
147
|
+
export type WorkflowWorkerIdWithoutRequiredOptions = Exclude<WorkflowWorkerId, AmpRemoteWorkflowWorkerId>;
|
|
148
|
+
/**
|
|
149
|
+
* Remote Amp executors (orb, runner) read tool permissions from the remote
|
|
150
|
+
* machine's Amp settings or the ampcode.com project; Prism has no
|
|
151
|
+
* per-invocation override that reaches them.
|
|
152
|
+
*/
|
|
153
|
+
export type AmpRemoteWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy">;
|
|
154
|
+
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 : W extends AmpRemoteWorkflowWorkerId ? AmpRemoteWorkflowPermissionMode : WorkflowDialPermissionMode;
|
|
155
|
+
/** Documented orb sizes (https://ampcode.com/docs/orbs/sizes-and-costs); `a1.3xlarge` needs Gigawatt/Enterprise. */
|
|
156
|
+
export declare const AMP_ORB_SIZES: readonly ["a1.tiny", "a1.small", "a1.medium", "a1.large", "a1.xxlarge", "a1.3xlarge"];
|
|
157
|
+
export type AmpOrbSize = (typeof AMP_ORB_SIZES)[number];
|
|
158
|
+
/** Amp thread visibility values (`--visibility`). */
|
|
159
|
+
export declare const AMP_THREAD_VISIBILITIES: readonly ["private", "unlisted", "workspace", "group"];
|
|
160
|
+
export type AmpThreadVisibility = (typeof AMP_THREAD_VISIBILITIES)[number];
|
|
95
161
|
export type WorkflowSessionPersistenceWorkerId = typeof WORKFLOW_SESSION_PERSISTENCE_WORKERS[number];
|
|
96
162
|
export type WorkflowSessionPersistence = "persistent" | "ephemeral";
|
|
97
163
|
/** @deprecated Use WorkflowSessionPersistence. */
|
|
@@ -118,17 +184,46 @@ type WorkflowTaskWorkerOptionsFor<W extends WorkflowWorkerId> = WorkflowTaskWork
|
|
|
118
184
|
readonly worker: W;
|
|
119
185
|
readonly permission?: WorkflowWorkerPermissionMode<W>;
|
|
120
186
|
} & (W extends "amp-code" ? {
|
|
121
|
-
readonly sessionPersistence?: never;
|
|
122
187
|
readonly catalogModel?: WorkflowHarnessCatalogModel<"amp-code">;
|
|
123
|
-
|
|
124
|
-
|
|
188
|
+
} : W extends "amp-runner" ? {
|
|
189
|
+
readonly catalogModel?: WorkflowHarnessCatalogModel<"amp-code">;
|
|
190
|
+
} : {
|
|
191
|
+
readonly catalogModel?: never;
|
|
192
|
+
}) & (W extends WorkflowEffortWorkerHarnessId ? {
|
|
193
|
+
readonly effort?: WorkflowHarnessEffort<W>;
|
|
194
|
+
} : {
|
|
195
|
+
readonly effort?: never;
|
|
196
|
+
}) & (W extends WorkflowSessionPersistenceWorkerId ? {
|
|
125
197
|
readonly sessionPersistence?: WorkflowSessionPersistence;
|
|
126
198
|
} : {
|
|
127
199
|
readonly sessionPersistence?: never;
|
|
200
|
+
}) & (W extends AmpRemoteWorkflowWorkerId ? {
|
|
201
|
+
readonly labels?: ReadonlyArray<string>;
|
|
202
|
+
} : {
|
|
203
|
+
readonly labels?: never;
|
|
204
|
+
}) & (W extends "amp-orb" ? {
|
|
205
|
+
/**
|
|
206
|
+
* Amp project for the orb (`--project`): namespace/name, owner/repo, or repository URL.
|
|
207
|
+
* Narrows to discovered projects after `prism workflow refresh-harness-types`.
|
|
208
|
+
*/
|
|
209
|
+
readonly project: WorkflowHarnessProject<"amp-orb">;
|
|
210
|
+
/** `--orb-size`; defaults to the project's size. */
|
|
211
|
+
readonly size?: AmpOrbSize;
|
|
212
|
+
/** Thread visibility; defaults to Amp's own default. Cosmetic: not part of cache identity. */
|
|
213
|
+
readonly visibility?: AmpThreadVisibility;
|
|
214
|
+
} : {
|
|
215
|
+
readonly project?: never;
|
|
216
|
+
readonly size?: never;
|
|
217
|
+
readonly visibility?: never;
|
|
218
|
+
}) & (W extends "amp-runner" ? AmpRunnerTargetOptions : {
|
|
219
|
+
readonly runnerId?: never;
|
|
220
|
+
readonly runnerDir?: never;
|
|
128
221
|
});
|
|
129
222
|
export type WorkflowTaskWorkerOptions = (WorkflowTaskWorkerOptionsCommon & {
|
|
130
223
|
readonly worker?: undefined;
|
|
131
224
|
readonly permission?: WorkflowPermissionMode;
|
|
225
|
+
readonly catalogModel?: never;
|
|
226
|
+
readonly effort?: never;
|
|
132
227
|
readonly sessionPersistence?: never;
|
|
133
228
|
}) | {
|
|
134
229
|
[W in WorkflowWorkerId]: WorkflowTaskWorkerOptionsFor<W>;
|
|
@@ -141,8 +236,10 @@ export interface WorkflowTaskModelResolution {
|
|
|
141
236
|
readonly model: string;
|
|
142
237
|
/** Harness-side inference provider (e.g. hermes `--provider xai-oauth`), from the modelspace target or harness default. */
|
|
143
238
|
readonly provider?: string;
|
|
144
|
-
/**
|
|
239
|
+
/** Model-selection variant, such as OpenCode's `provider/model#variant`. */
|
|
145
240
|
readonly variant?: string;
|
|
241
|
+
/** Harness-bound reasoning effort from a modelspace target. */
|
|
242
|
+
readonly effort?: string;
|
|
146
243
|
readonly source: WorkflowTaskModelResolutionSource;
|
|
147
244
|
}
|
|
148
245
|
/**
|
|
@@ -160,6 +257,11 @@ export declare const resolveWorkflowTaskModel: (task: AnyWorkflowWorkerTask, opt
|
|
|
160
257
|
readonly worker?: string;
|
|
161
258
|
readonly fallbackModel?: string;
|
|
162
259
|
}) => string | undefined;
|
|
260
|
+
/** Task-level effort is the explicit override; modelspace effort is the fallback. */
|
|
261
|
+
export declare const resolveWorkflowTaskEffort: (task: AnyWorkflowWorkerTask, options?: {
|
|
262
|
+
readonly worker?: string;
|
|
263
|
+
readonly fallbackModel?: string;
|
|
264
|
+
}) => string | undefined;
|
|
163
265
|
export interface WorkflowFinishCriterionContext<Output> {
|
|
164
266
|
readonly output: Output;
|
|
165
267
|
readonly rawOutput: unknown;
|