@skastr0/prism-linux-arm64 0.1.2 → 0.2.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.
@@ -1,8 +1,14 @@
1
1
  import { Effect, Schema } from "effect";
2
+ import type { Either } from "effect/Either";
3
+ import type { ParseError } from "effect/ParseResult";
4
+ import type { WorkflowRuntimeError } from "./workflow-errors.js";
5
+ export type { WorkflowRuntimeError } from "./workflow-errors.js";
2
6
  export interface WorkflowModelRef {
3
7
  readonly modelspace?: string;
4
8
  readonly profile?: string;
9
+ readonly targets?: Readonly<Record<string, WorkflowModelTarget>>;
5
10
  }
11
+ export type WorkflowModelTarget = Readonly<Record<string, unknown>>;
6
12
  export interface WorkflowModelspaceRef {
7
13
  readonly kind: "modelspace-ref";
8
14
  readonly plugin: string;
@@ -13,6 +19,7 @@ export interface WorkflowModelProfileRef {
13
19
  readonly plugin: string;
14
20
  readonly modelspace: string;
15
21
  readonly profile: string;
22
+ readonly targets?: Readonly<Record<string, WorkflowModelTarget>>;
16
23
  }
17
24
  export interface WorkflowManagedSkillRef {
18
25
  readonly kind: "managed-skill-ref";
@@ -36,12 +43,35 @@ export interface WorkflowAgentRef {
36
43
  readonly installs: ReadonlyArray<string>;
37
44
  }
38
45
  export type WorkflowOutputSchema = Schema.Schema.AnyNoContext;
46
+ export type WorkflowFinishCriterionError = Error;
39
47
  export type WorkflowWorkerId = "amp-code" | "antigravity-cli" | "claude-code" | "codex-cli" | "grok" | "hermes" | "kimi-code" | "opencode";
40
- export interface WorkflowTaskWorkerOptions {
41
- readonly worker?: WorkflowWorkerId;
42
- readonly model?: string;
48
+ export type WorkflowPermissionMode = "legacy" | "permissive" | "restricted" | "interactive" | "sandbox-read-only" | "sandbox-workspace-write" | "full-access";
49
+ export type AntigravityWorkflowPermissionMode = Extract<WorkflowPermissionMode, "legacy" | "permissive" | "full-access">;
50
+ type WorkflowTaskWorkerOptionsBase = {
51
+ readonly model?: string | WorkflowModelProfileRef;
52
+ readonly modelResolver?: (models: WorkflowResolvedModelTarget) => string;
43
53
  readonly profile?: string;
44
- }
54
+ readonly restrictedTools?: ReadonlyArray<string>;
55
+ readonly processTimeoutMs?: number;
56
+ };
57
+ export type WorkflowTaskWorkerOptions = (WorkflowTaskWorkerOptionsBase & {
58
+ readonly worker?: Exclude<WorkflowWorkerId, "antigravity-cli">;
59
+ readonly permission?: WorkflowPermissionMode;
60
+ }) | (WorkflowTaskWorkerOptionsBase & {
61
+ readonly worker: "antigravity-cli";
62
+ readonly permission?: AntigravityWorkflowPermissionMode;
63
+ });
64
+ export type WorkflowResolvedModelEntry = Readonly<{
65
+ readonly model: string;
66
+ }>;
67
+ export type WorkflowResolvedModelTarget = Readonly<Record<string, WorkflowResolvedModelEntry | WorkflowResolvedModelEntry[]>>;
68
+ export declare class WorkflowModelResolutionError extends Error {
69
+ readonly name = "WorkflowModelResolutionError";
70
+ }
71
+ export declare const resolveWorkflowTaskModel: (task: AnyWorkflowTask, options?: {
72
+ readonly worker?: string;
73
+ readonly fallbackModel?: string;
74
+ }) => string | undefined;
45
75
  export interface WorkflowFinishCriterionContext<Output> {
46
76
  readonly output: Output;
47
77
  readonly rawOutput: unknown;
@@ -50,7 +80,7 @@ export interface WorkflowFinishCriterionContext<Output> {
50
80
  export interface WorkflowDeterministicFinishCriterion<Output> {
51
81
  readonly kind?: "deterministic";
52
82
  readonly name: string;
53
- readonly check: (context: WorkflowFinishCriterionContext<Output>) => Effect.Effect<void, unknown>;
83
+ readonly check: (context: WorkflowFinishCriterionContext<Output>) => Effect.Effect<void, WorkflowFinishCriterionError>;
54
84
  readonly repairPrompt?: (error: unknown, context: WorkflowFinishCriterionContext<Output>) => string;
55
85
  }
56
86
  export type WorkflowJudgeVerdict = {
@@ -93,7 +123,7 @@ export interface WorkflowJudgeFinishCriterion<Output, Evidence = unknown> {
93
123
  readonly name: string;
94
124
  readonly goal?: string | ((context: Omit<WorkflowJudgeEvidenceSelectionContext<Output>, "goal">) => string);
95
125
  readonly selectEvidence?: (context: WorkflowJudgeEvidenceSelectionContext<Output>) => Evidence;
96
- readonly evaluate: (context: WorkflowJudgeCriterionContext<Output, Evidence>) => Effect.Effect<WorkflowJudgeVerdict, unknown>;
126
+ readonly evaluate: (context: WorkflowJudgeCriterionContext<Output, Evidence>) => Effect.Effect<WorkflowJudgeVerdict, WorkflowFinishCriterionError>;
97
127
  }
98
128
  export type WorkflowFinishCriterion<Output> = WorkflowDeterministicFinishCriterion<Output> | WorkflowJudgeFinishCriterion<Output>;
99
129
  export interface WorkflowFinishOptions<Output> {
@@ -105,6 +135,7 @@ export interface WorkflowTaskDefinition<Id extends string, Agent extends Workflo
105
135
  readonly agent: Agent;
106
136
  readonly prompt: string;
107
137
  readonly output: Output;
138
+ readonly phase?: string;
108
139
  readonly cacheKey?: string;
109
140
  readonly worker?: WorkflowTaskWorkerOptions;
110
141
  readonly finish?: WorkflowFinishOptions<Schema.Schema.Type<Output>>;
@@ -120,17 +151,18 @@ export interface WorkflowDefinition<Name extends string, Tasks extends ReadonlyA
120
151
  readonly tasks: Tasks;
121
152
  }
122
153
  export interface WorkflowRuntime {
123
- runTask: <Task extends AnyWorkflowTask>(task: Task) => Effect.Effect<WorkflowTaskOutput<Task>, unknown>;
154
+ runTask: <Task extends AnyWorkflowTask>(task: Task) => Effect.Effect<WorkflowTaskOutput<Task>, WorkflowRuntimeError>;
124
155
  }
125
156
  export interface WorkflowRuntimeOptions {
126
157
  readonly fallbackWorker?: string;
127
158
  readonly fallbackModel?: string;
159
+ readonly fallbackPermission?: WorkflowPermissionMode;
128
160
  }
129
- export interface DynamicWorkflowDefinition<Name extends string> {
161
+ export interface DynamicWorkflowDefinition<Name extends string, Result = unknown, Err = WorkflowRuntimeError> {
130
162
  readonly kind: "workflow";
131
163
  readonly name: Name;
132
164
  readonly tasks: readonly [];
133
- readonly run: (runtime: WorkflowRuntime) => Effect.Effect<unknown, unknown>;
165
+ readonly run: (runtime: WorkflowRuntime) => Effect.Effect<Result, Err, never>;
134
166
  }
135
167
  export type AnyWorkflowDefinition = WorkflowDefinition<string, ReadonlyArray<AnyWorkflowTask>> | DynamicWorkflowDefinition<string>;
136
168
  export declare const defineTask: <const Id extends string, const Agent extends WorkflowAgentRef, const Output extends WorkflowOutputSchema>(definition: WorkflowTaskDefinition<Id, Agent, Output>) => WorkflowTask<Id, Agent, Output>;
@@ -138,8 +170,8 @@ export declare function defineWorkflow<const Name extends string, const Tasks ex
138
170
  readonly name: Name;
139
171
  readonly tasks: Tasks;
140
172
  }): WorkflowDefinition<Name, Tasks>;
141
- export declare function defineWorkflow<const Name extends string>(definition: {
173
+ export declare function defineWorkflow<const Name extends string, Result, Err = WorkflowRuntimeError>(definition: {
142
174
  readonly name: Name;
143
- readonly run: (runtime: WorkflowRuntime) => Effect.Effect<unknown, unknown>;
144
- }): DynamicWorkflowDefinition<Name>;
145
- export declare const decodeTaskOutput: <Task extends AnyWorkflowTask>(task: Task, value: unknown) => import("effect/Either").Either<any, import("effect/ParseResult").ParseError>;
175
+ readonly run: (runtime: WorkflowRuntime) => Effect.Effect<Result, Err, never>;
176
+ }): DynamicWorkflowDefinition<Name, Result, Err>;
177
+ export declare const decodeTaskOutput: <Task extends AnyWorkflowTask>(task: Task, value: unknown) => Either<Schema.Schema.Type<Task["output"]>, ParseError>;