@skastr0/prism-darwin-x64 0.1.1 → 0.1.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 -1
- package/types/compile/bundle-utils.d.ts +16 -0
- package/types/compile/cache.d.ts +49 -0
- package/types/compile/compile-manifest.d.ts +48 -0
- package/types/compile/compose.d.ts +35 -0
- package/types/compile/errors.d.ts +124 -0
- package/types/compile/generated-plugin.d.ts +8 -0
- package/types/compile/load.d.ts +23 -0
- package/types/compile/paths.d.ts +2 -0
- package/types/compile/protocol-tools.d.ts +47 -0
- package/types/compile/refs.d.ts +7 -0
- package/types/compile/registry.d.ts +32 -0
- package/types/compile/resolve.d.ts +63 -0
- package/types/compile/runtime/schema-bridge.d.ts +61 -0
- package/types/compile/runtime-deps.d.ts +6 -0
- package/types/compile/sources.d.ts +2782 -0
- package/types/content-hash.d.ts +1 -0
- package/types/errors.d.ts +107 -0
- package/types/fs.d.ts +60 -0
- package/types/harnesses.d.ts +10 -0
- package/types/index.d.ts +493 -0
- package/types/lowerer-capabilities.d.ts +559 -0
- package/types/manifest.d.ts +106 -0
- package/types/prism-home.d.ts +26 -0
- package/types/project-key.d.ts +48 -0
- package/types/source-selection.d.ts +38 -0
- package/types/state/lock.d.ts +14 -0
- package/types/types.d.ts +193 -0
- package/types/workflow-amp-worker.d.ts +12 -0
- package/types/workflow-antigravity-worker.d.ts +14 -0
- package/types/workflow-claude-worker.d.ts +13 -0
- package/types/workflow-codex-worker.d.ts +12 -0
- package/types/workflow-grok-worker.d.ts +14 -0
- package/types/workflow-hermes-worker.d.ts +14 -0
- package/types/workflow-kimi-worker.d.ts +13 -0
- package/types/workflow-loader.d.ts +64 -0
- package/types/workflow-opencode-worker.d.ts +12 -0
- package/types/workflow-runner.d.ts +69 -0
- package/types/workflow-store.d.ts +214 -0
- package/types/workflow-tsconfig.d.ts +90 -0
- package/types/workflow-worker-contract.d.ts +10 -0
- package/types/workflow-worker-metadata.d.ts +8 -0
- package/types/workflow-worker-process.d.ts +18 -0
- package/types/workflow-workers.d.ts +27 -0
- package/types/workflows.d.ts +145 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const PRISM_CONFIG_SCHEMA_VERSION = 1;
|
|
3
|
+
export declare const DEFAULT_BACKUP_RETENTION_PER_TARGET = 3;
|
|
4
|
+
export declare const BackupModeSchema: Schema.Literal<["always", "never"]>;
|
|
5
|
+
export type BackupMode = typeof BackupModeSchema.Type;
|
|
6
|
+
export interface PrismBackupConfig {
|
|
7
|
+
readonly mode: BackupMode;
|
|
8
|
+
readonly retentionPerTarget: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PrismConfig {
|
|
11
|
+
readonly version: typeof PRISM_CONFIG_SCHEMA_VERSION;
|
|
12
|
+
readonly backup: PrismBackupConfig;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the Prism home directory from an override or the environment.
|
|
16
|
+
*
|
|
17
|
+
* WS2+: new code must NOT call this from library modules — consume the
|
|
18
|
+
* `PrismHome` Context.Tag from src/services/prism-env.ts instead; the env
|
|
19
|
+
* read happens exactly once at the CLI edge layer.
|
|
20
|
+
*/
|
|
21
|
+
export declare const resolvePrismHome: (override?: string) => string;
|
|
22
|
+
export declare const prismConfigPath: (prismHome?: string) => string;
|
|
23
|
+
export declare const prismStateDir: (prismHome?: string) => string;
|
|
24
|
+
export declare const prismBackupDir: (prismHome?: string) => string;
|
|
25
|
+
export declare const defaultPrismConfig: () => PrismConfig;
|
|
26
|
+
export declare const readPrismConfig: (prismHome?: string) => Promise<PrismConfig>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project identity (toolchain & distribution §4).
|
|
3
|
+
*
|
|
4
|
+
* A project key is derived at the CLI edge:
|
|
5
|
+
* - the git repository root (worktree/origin root) when cwd is inside a git
|
|
6
|
+
* repo,
|
|
7
|
+
* - else realpath(cwd).
|
|
8
|
+
*
|
|
9
|
+
* The human-readable path is hashed (sha256) only to produce a filesystem-safe
|
|
10
|
+
* directory name; the original path is recorded alongside for inspection.
|
|
11
|
+
*
|
|
12
|
+
* Prism-owned generated types live machine-global, project-keyed, never in the
|
|
13
|
+
* project tree:
|
|
14
|
+
* ~/.prism/state/projects/<key>/compile-manifest.json
|
|
15
|
+
* ~/.prism/state/projects/<key>/generated/...
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The resolved project path (git root or realpath(cwd)) plus its
|
|
19
|
+
* filesystem-safe hash. Carry both: the hash names the directory, the path is
|
|
20
|
+
* for human inspection.
|
|
21
|
+
*/
|
|
22
|
+
export interface ProjectKey {
|
|
23
|
+
/** The resolved project root path (git toplevel, else realpath(cwd)). */
|
|
24
|
+
readonly path: string;
|
|
25
|
+
/** sha256(path) hex — the filesystem-safe directory name. */
|
|
26
|
+
readonly key: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the git repository root (worktree root) for a directory, or
|
|
30
|
+
* undefined when the directory is not inside a git repo (or git is missing).
|
|
31
|
+
* Synchronous: the workflow loader's `prism/refs` resolver and tsconfig path
|
|
32
|
+
* derivation run on a sync path.
|
|
33
|
+
*/
|
|
34
|
+
export declare const gitRepositoryRoot: (cwd: string) => string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Derive the project key for a directory: git root if inside a git repo, else
|
|
37
|
+
* realpath(cwd). The path is realpath-normalized either way so that distinct
|
|
38
|
+
* spellings of the same location collapse to one key.
|
|
39
|
+
*/
|
|
40
|
+
export declare const deriveProjectKey: (cwd?: string) => ProjectKey;
|
|
41
|
+
/** ~/.prism/state/projects/<key> for a project key. */
|
|
42
|
+
export declare const projectStateDir: (prismHome: string, key: string) => string;
|
|
43
|
+
/** ~/.prism/state/projects/<key>/compile-manifest.json — per-project manifest. */
|
|
44
|
+
export declare const projectCompileManifestPath: (prismHome: string, key: string) => string;
|
|
45
|
+
/** ~/.prism/state/projects/<key>/generated — Prism-owned generated refs dir. */
|
|
46
|
+
export declare const projectGeneratedRefsDir: (prismHome: string, key: string) => string;
|
|
47
|
+
/** ~/.prism/state/projects/<key>/generated/agents.ts — the agents refs file. */
|
|
48
|
+
export declare const projectGeneratedAgentsPath: (prismHome: string, key: string) => string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type HarnessId, type HarnessScope, type PluginArtifactType, type PluginManifestTargets, type PluginRuntimeConfig, type PluginTargetId, type TargetPresetId } from "./types.js";
|
|
2
|
+
export declare const SOURCE_NOUNS: readonly ["rules", "commands", "agents", "skills", "orbits", "tools", "toolspaces", "modelspaces", "skillspaces", "hooks"];
|
|
3
|
+
export type SourceNoun = (typeof SOURCE_NOUNS)[number];
|
|
4
|
+
export interface SourceRuntimeRequirements {
|
|
5
|
+
readonly mcpConfigured: boolean;
|
|
6
|
+
readonly streamableHttpMcp: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SourceSelectionEntry {
|
|
9
|
+
readonly noun: SourceNoun;
|
|
10
|
+
readonly declaredTargets: readonly PluginTargetId[];
|
|
11
|
+
readonly harnesses: readonly HarnessId[];
|
|
12
|
+
}
|
|
13
|
+
export interface SourceSelection {
|
|
14
|
+
readonly entries: readonly SourceSelectionEntry[];
|
|
15
|
+
readonly runtime: PluginRuntimeConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface TargetSourceSelection {
|
|
18
|
+
readonly target: HarnessId;
|
|
19
|
+
readonly scope?: HarnessScope;
|
|
20
|
+
readonly nouns: Readonly<Record<SourceNoun, boolean>>;
|
|
21
|
+
readonly runtime: SourceRuntimeRequirements;
|
|
22
|
+
readonly hasLowerableSources: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const getCompileManagedPluginArtifactTargets: (artifact: PluginArtifactType) => readonly HarnessId[];
|
|
25
|
+
export declare function isTargetPresetId(value: string): value is TargetPresetId;
|
|
26
|
+
export declare function isPluginTargetId(value: unknown): value is PluginTargetId;
|
|
27
|
+
export declare const targetSupportsSourceNoun: (harnessId: HarnessId, noun: SourceNoun) => boolean;
|
|
28
|
+
export declare function resolveManifestTargets(targets: readonly PluginTargetId[]): HarnessId[];
|
|
29
|
+
export declare function resolveManifestTargetsForSourceNoun(targets: readonly PluginTargetId[], noun: SourceNoun): HarnessId[];
|
|
30
|
+
export declare function unsupportedDirectTargetsForSourceNoun(targets: readonly PluginTargetId[], noun: SourceNoun): HarnessId[];
|
|
31
|
+
export declare function presetsWithNoSupportedTargetsForSourceNoun(targets: readonly PluginTargetId[], noun: SourceNoun): TargetPresetId[];
|
|
32
|
+
export declare function validateSourceTargetSupport(noun: SourceNoun, declaredTargets: readonly unknown[]): string[];
|
|
33
|
+
export declare const sourceSelectionFromManifestTargets: (targets: PluginManifestTargets, options?: {
|
|
34
|
+
readonly runtime?: PluginRuntimeConfig;
|
|
35
|
+
}) => SourceSelection;
|
|
36
|
+
export declare const selectSourcesForTarget: (selection: SourceSelection, target: HarnessId, options?: {
|
|
37
|
+
readonly scope?: HarnessScope;
|
|
38
|
+
}) => TargetSourceSelection;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advisory run lock — one concurrent plan→apply→commit per PRISM_HOME.
|
|
3
|
+
*
|
|
4
|
+
* O_EXCL create of `<PRISM_HOME>/state/lock` holding {pid}; a lock whose pid
|
|
5
|
+
* is dead is stale and taken over. Ledger files were bare read-modify-write
|
|
6
|
+
* JSON with no concurrency story; the snapshot store inherits a real one.
|
|
7
|
+
*/
|
|
8
|
+
export declare const lockPath: (prismHome: string) => string;
|
|
9
|
+
export declare class SnapshotLockHeldError extends Error {
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly pid: number | undefined;
|
|
12
|
+
constructor(path: string, pid: number | undefined);
|
|
13
|
+
}
|
|
14
|
+
export declare const withSnapshotLock: <T>(prismHome: string, run: () => Promise<T>) => Promise<T>;
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for prism - the unified plugin distribution system
|
|
3
|
+
*/
|
|
4
|
+
export type HarnessId = "claude-code" | "opencode" | "openclaw" | "hermes" | "codex-cli" | "antigravity-cli" | "kimi-code" | "amp-code" | "cursor" | "factory-droid" | "pi" | "grok";
|
|
5
|
+
export declare const HARNESS_SCOPES: readonly ["global", "project"];
|
|
6
|
+
export type HarnessScope = (typeof HARNESS_SCOPES)[number];
|
|
7
|
+
export interface HarnessConfig {
|
|
8
|
+
id: HarnessId;
|
|
9
|
+
name: string;
|
|
10
|
+
globalConfigPath: string;
|
|
11
|
+
projectConfigPath: string | null;
|
|
12
|
+
rulesFile: string | null;
|
|
13
|
+
rulesDir: string | null;
|
|
14
|
+
commandsDir: string | null;
|
|
15
|
+
agentsDir: string | null;
|
|
16
|
+
toolsDir: string | null;
|
|
17
|
+
skillsDir: string | null;
|
|
18
|
+
configFile: string | null;
|
|
19
|
+
configFormat: "json" | "yaml" | "toml" | "markdown" | "mdc";
|
|
20
|
+
supportsTools: boolean;
|
|
21
|
+
supportsCommands: boolean;
|
|
22
|
+
supportsAgents: boolean;
|
|
23
|
+
supportsSkills: boolean;
|
|
24
|
+
supportsMCP: boolean;
|
|
25
|
+
alternativeRulesFiles?: string[];
|
|
26
|
+
}
|
|
27
|
+
export declare const PLUGIN_ARTIFACT_TYPES: readonly ["rules", "commands", "agents", "skills"];
|
|
28
|
+
export type PluginArtifactType = (typeof PLUGIN_ARTIFACT_TYPES)[number];
|
|
29
|
+
export declare const COMPILE_ARTIFACT_TYPES: readonly ["orbits", "tools", "toolspaces", "modelspaces", "skillspaces", "hooks"];
|
|
30
|
+
export type CompileArtifactType = (typeof COMPILE_ARTIFACT_TYPES)[number];
|
|
31
|
+
export declare const TARGET_PRESET_IDS: readonly ["coding-harness", "claw-harness"];
|
|
32
|
+
export type TargetPresetId = (typeof TARGET_PRESET_IDS)[number];
|
|
33
|
+
export type PluginTargetId = HarnessId | TargetPresetId;
|
|
34
|
+
export type AnyArtifactType = PluginArtifactType | CompileArtifactType;
|
|
35
|
+
export type PluginManifestTargets = Partial<Record<AnyArtifactType, PluginTargetId[]>>;
|
|
36
|
+
export type PrismMcpTransport = "streamable-http";
|
|
37
|
+
export interface PluginRuntimeMcpHarnessConfig {
|
|
38
|
+
transport?: PrismMcpTransport;
|
|
39
|
+
host?: string;
|
|
40
|
+
port?: number;
|
|
41
|
+
tokenEnv?: string;
|
|
42
|
+
connectTimeoutMs?: number;
|
|
43
|
+
toolTimeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface PluginRuntimeConfig {
|
|
46
|
+
mcp?: Partial<Record<HarnessId, PluginRuntimeMcpHarnessConfig>>;
|
|
47
|
+
}
|
|
48
|
+
export interface PluginManifest {
|
|
49
|
+
name: string;
|
|
50
|
+
version: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
targets: PluginManifestTargets;
|
|
53
|
+
deps?: Record<string, string>;
|
|
54
|
+
runtime?: PluginRuntimeConfig;
|
|
55
|
+
projects?: Record<string, ProjectConfig>;
|
|
56
|
+
}
|
|
57
|
+
export interface ProjectConfig {
|
|
58
|
+
pattern?: string;
|
|
59
|
+
rulesDir?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface InstallOptions {
|
|
62
|
+
pluginPath: string;
|
|
63
|
+
harnesses: HarnessId[];
|
|
64
|
+
projectPath?: string;
|
|
65
|
+
overwrite: boolean;
|
|
66
|
+
dryRun: boolean;
|
|
67
|
+
}
|
|
68
|
+
export type FileOperationType = "copy" | "append" | "merge" | "prune" | "drift" | "skip";
|
|
69
|
+
export interface ManagedFileOperationMetadata {
|
|
70
|
+
entryId: string;
|
|
71
|
+
pluginName: string;
|
|
72
|
+
pluginVersion?: string;
|
|
73
|
+
pluginPath: string;
|
|
74
|
+
scope: HarnessScope;
|
|
75
|
+
root: string;
|
|
76
|
+
kind: "file" | "directory" | "section" | "config";
|
|
77
|
+
sourcePath?: string;
|
|
78
|
+
contentHash: string;
|
|
79
|
+
}
|
|
80
|
+
export interface FileOperation {
|
|
81
|
+
type: FileOperationType;
|
|
82
|
+
source: string;
|
|
83
|
+
target: string;
|
|
84
|
+
harness: HarnessId;
|
|
85
|
+
artifact: "rules" | "command" | "agent" | "tool" | "skill" | "config" | "compile";
|
|
86
|
+
content?: string;
|
|
87
|
+
reason?: string;
|
|
88
|
+
managed?: ManagedFileOperationMetadata;
|
|
89
|
+
}
|
|
90
|
+
export interface InstallResult {
|
|
91
|
+
success: boolean;
|
|
92
|
+
operations: FileOperation[];
|
|
93
|
+
errors: InstallError[];
|
|
94
|
+
backups: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface InstallError {
|
|
97
|
+
operation: FileOperation;
|
|
98
|
+
message: string;
|
|
99
|
+
}
|
|
100
|
+
export type OpenCodePermission = "allow" | "ask" | "deny";
|
|
101
|
+
export interface OpenCodeAgentFrontmatter {
|
|
102
|
+
description?: string;
|
|
103
|
+
mode?: "subagent" | "primary" | "all";
|
|
104
|
+
model?: string;
|
|
105
|
+
temperature?: number;
|
|
106
|
+
top_p?: number;
|
|
107
|
+
tools?: Record<string, boolean>;
|
|
108
|
+
color?: string;
|
|
109
|
+
maxSteps?: number;
|
|
110
|
+
disable?: boolean;
|
|
111
|
+
permission?: {
|
|
112
|
+
edit?: OpenCodePermission;
|
|
113
|
+
bash?: OpenCodePermission | Record<string, OpenCodePermission>;
|
|
114
|
+
webfetch?: OpenCodePermission;
|
|
115
|
+
doom_loop?: OpenCodePermission;
|
|
116
|
+
external_directory?: OpenCodePermission;
|
|
117
|
+
skill?: OpenCodePermission | Record<string, OpenCodePermission>;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export interface ClaudeCodeFrontmatter {
|
|
121
|
+
description?: string;
|
|
122
|
+
"allowed-tools"?: string[];
|
|
123
|
+
model?: "sonnet" | "opus" | "haiku" | string;
|
|
124
|
+
temperature?: number;
|
|
125
|
+
top_p?: number;
|
|
126
|
+
}
|
|
127
|
+
export interface CursorFrontmatter {
|
|
128
|
+
description?: string;
|
|
129
|
+
globs?: string[];
|
|
130
|
+
alwaysApply?: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface FactoryDroidFrontmatter {
|
|
133
|
+
description?: string;
|
|
134
|
+
model?: string | "inherit";
|
|
135
|
+
reasoningEffort?: "low" | "medium" | "high";
|
|
136
|
+
tools?: string | string[];
|
|
137
|
+
"user-invocable"?: boolean;
|
|
138
|
+
"disable-model-invocation"?: boolean;
|
|
139
|
+
"argument-hint"?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface CodexCliFrontmatter {
|
|
142
|
+
description?: string;
|
|
143
|
+
model?: string;
|
|
144
|
+
model_reasoning_effort?: "low" | "medium" | "high" | "xhigh";
|
|
145
|
+
sandbox_mode?: "read-only" | "full" | "danger-full-access";
|
|
146
|
+
}
|
|
147
|
+
export interface UnifiedFrontmatter {
|
|
148
|
+
description?: string;
|
|
149
|
+
"claude-code"?: ClaudeCodeFrontmatter;
|
|
150
|
+
opencode?: OpenCodeAgentFrontmatter;
|
|
151
|
+
openclaw?: Record<string, unknown>;
|
|
152
|
+
hermes?: Record<string, unknown>;
|
|
153
|
+
"codex-cli"?: CodexCliFrontmatter;
|
|
154
|
+
"antigravity-cli"?: Record<string, unknown>;
|
|
155
|
+
"kimi-code"?: Record<string, unknown>;
|
|
156
|
+
"amp-code"?: Record<string, unknown>;
|
|
157
|
+
cursor?: CursorFrontmatter;
|
|
158
|
+
"factory-droid"?: FactoryDroidFrontmatter;
|
|
159
|
+
pi?: Record<string, unknown>;
|
|
160
|
+
grok?: Record<string, unknown>;
|
|
161
|
+
}
|
|
162
|
+
export interface SkillFrontmatter {
|
|
163
|
+
name: string;
|
|
164
|
+
description: string;
|
|
165
|
+
compatibility?: string;
|
|
166
|
+
license?: string;
|
|
167
|
+
"allowed-tools"?: string[];
|
|
168
|
+
metadata?: Record<string, string>;
|
|
169
|
+
}
|
|
170
|
+
export declare const SKILL_VALIDATION: {
|
|
171
|
+
readonly NAME_MAX_LENGTH: 64;
|
|
172
|
+
readonly NAME_PATTERN: RegExp;
|
|
173
|
+
readonly DESCRIPTION_MAX_LENGTH: 1024;
|
|
174
|
+
readonly COMPATIBILITY_MAX_LENGTH: 500;
|
|
175
|
+
readonly RECOMMENDED_BODY_MAX_LINES: 500;
|
|
176
|
+
readonly ALLOWED_FRONTMATTER_KEYS: Set<string>;
|
|
177
|
+
};
|
|
178
|
+
export interface ValidationResult {
|
|
179
|
+
valid: boolean;
|
|
180
|
+
errors: string[];
|
|
181
|
+
warnings: string[];
|
|
182
|
+
}
|
|
183
|
+
export interface SkillValidationResult extends ValidationResult {
|
|
184
|
+
skillName?: string;
|
|
185
|
+
skillPath: string;
|
|
186
|
+
}
|
|
187
|
+
export interface AgentValidationResult extends ValidationResult {
|
|
188
|
+
agentName?: string;
|
|
189
|
+
agentPath: string;
|
|
190
|
+
}
|
|
191
|
+
export declare const AGENT_VALIDATION: {
|
|
192
|
+
readonly DESCRIPTION_MAX_LENGTH: 1024;
|
|
193
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface AmpWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export declare class AmpWorkflowWorkerError extends Error {
|
|
10
|
+
readonly name = "AmpWorkflowWorkerError";
|
|
11
|
+
}
|
|
12
|
+
export declare const runAmpWorkflowTask: (task: AnyWorkflowTask, options: AmpWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface AntigravityWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly printTimeout?: string;
|
|
8
|
+
readonly processTimeoutMs?: number;
|
|
9
|
+
readonly abortSignal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
export declare class AntigravityWorkflowWorkerError extends Error {
|
|
12
|
+
readonly name = "AntigravityWorkflowWorkerError";
|
|
13
|
+
}
|
|
14
|
+
export declare const runAntigravityWorkflowTask: (task: AnyWorkflowTask, options: AntigravityWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution, WorkflowTaskRepairContext } from "./workflow-runner.js";
|
|
3
|
+
export interface ClaudeWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly abortSignal?: AbortSignal;
|
|
8
|
+
readonly repair?: WorkflowTaskRepairContext;
|
|
9
|
+
}
|
|
10
|
+
export declare class ClaudeWorkflowWorkerError extends Error {
|
|
11
|
+
readonly name = "ClaudeWorkflowWorkerError";
|
|
12
|
+
}
|
|
13
|
+
export declare const runClaudeWorkflowTask: (task: AnyWorkflowTask, options: ClaudeWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface CodexWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export declare class CodexWorkflowWorkerError extends Error {
|
|
10
|
+
readonly name = "CodexWorkflowWorkerError";
|
|
11
|
+
}
|
|
12
|
+
export declare const runCodexWorkflowTask: (task: AnyWorkflowTask, options: CodexWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface GrokWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly effort?: string;
|
|
8
|
+
readonly abortSignal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export declare class WorkflowWorkerError extends Error {
|
|
11
|
+
readonly name = "WorkflowWorkerError";
|
|
12
|
+
}
|
|
13
|
+
export declare const runGrokWorkflowTask: (task: AnyWorkflowTask, options: GrokWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
14
|
+
export { parseWorkflowWorkerJsonOutput, WorkflowOutputParseError } from "./workflow-worker-contract.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface HermesWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly profile?: string;
|
|
8
|
+
readonly processTimeoutMs?: number;
|
|
9
|
+
readonly abortSignal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
export declare class HermesWorkflowWorkerError extends Error {
|
|
12
|
+
readonly name = "HermesWorkflowWorkerError";
|
|
13
|
+
}
|
|
14
|
+
export declare const runHermesWorkflowTask: (task: AnyWorkflowTask, options: HermesWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface KimiWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly processTimeoutMs?: number;
|
|
8
|
+
readonly abortSignal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export declare class KimiWorkflowWorkerError extends Error {
|
|
11
|
+
readonly name = "KimiWorkflowWorkerError";
|
|
12
|
+
}
|
|
13
|
+
export declare const runKimiWorkflowTask: (task: AnyWorkflowTask, options: KimiWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { AnyWorkflowDefinition } from "./workflows.js";
|
|
2
|
+
export interface WorkflowTaskSummary {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly agent: {
|
|
5
|
+
readonly plugin: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
};
|
|
8
|
+
readonly cacheKey?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkflowValidationSummary {
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly tasks: ReadonlyArray<WorkflowTaskSummary>;
|
|
14
|
+
readonly dynamic: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkflowTypecheckDiagnostic {
|
|
17
|
+
readonly file: string;
|
|
18
|
+
readonly line: number | null;
|
|
19
|
+
readonly character: number | null;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class WorkflowLoadError extends Error {
|
|
23
|
+
readonly name = "WorkflowLoadError";
|
|
24
|
+
}
|
|
25
|
+
export declare class WorkflowTypecheckError extends Error {
|
|
26
|
+
readonly filePath: string;
|
|
27
|
+
readonly diagnostics: ReadonlyArray<WorkflowTypecheckDiagnostic>;
|
|
28
|
+
readonly name = "WorkflowTypecheckError";
|
|
29
|
+
constructor(filePath: string, diagnostics: ReadonlyArray<WorkflowTypecheckDiagnostic>);
|
|
30
|
+
}
|
|
31
|
+
export declare const isWorkflowDefinition: (value: unknown) => value is AnyWorkflowDefinition;
|
|
32
|
+
export declare const workflowSummary: (path: string, workflow: AnyWorkflowDefinition) => WorkflowValidationSummary;
|
|
33
|
+
/**
|
|
34
|
+
* Check whether the generated refs are fresh relative to the current compile
|
|
35
|
+
* manifest. Emits a warning to stderr when drift is detected. The check is
|
|
36
|
+
* best-effort: missing refs or missing manifest produce no warning (the refs
|
|
37
|
+
* file may simply not exist yet).
|
|
38
|
+
*/
|
|
39
|
+
export declare const checkWorkflowRefsFreshness: (options: {
|
|
40
|
+
readonly prismHome?: string;
|
|
41
|
+
}) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Run an in-process TypeScript typecheck on a workflow file using the
|
|
44
|
+
* binary-embedded TypeScript and the resolved type environment.
|
|
45
|
+
*
|
|
46
|
+
* Behaviour:
|
|
47
|
+
* - No resolvable type environment at all (never compiled, no shipped types):
|
|
48
|
+
* warn to stderr and proceed — the runtime loader works regardless.
|
|
49
|
+
* - Module-not-found / no-types-configured diagnostics: warn and proceed.
|
|
50
|
+
* - A genuine type error inside the workflow (e.g. an unknown agent ref like
|
|
51
|
+
* `agents.forge.doesNotExist`): throw WorkflowTypecheckError. This is the
|
|
52
|
+
* moat.
|
|
53
|
+
*/
|
|
54
|
+
export declare const typecheckWorkflowFile: (filePath: string, options?: {
|
|
55
|
+
readonly prismHome?: string;
|
|
56
|
+
}) => void;
|
|
57
|
+
export declare const loadWorkflowFile: (filePath: string, options?: {
|
|
58
|
+
readonly prismHome?: string;
|
|
59
|
+
readonly skipTypecheck?: boolean;
|
|
60
|
+
}) => Promise<AnyWorkflowDefinition>;
|
|
61
|
+
export declare const validateWorkflowFile: (filePath: string, options?: {
|
|
62
|
+
readonly prismHome?: string;
|
|
63
|
+
readonly skipTypecheck?: boolean;
|
|
64
|
+
}) => Promise<WorkflowValidationSummary>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnyWorkflowTask } from "./workflows.js";
|
|
2
|
+
import type { WorkflowTaskExecution } from "./workflow-runner.js";
|
|
3
|
+
export interface OpenCodeWorkflowWorkerOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly bin?: string;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
readonly abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export declare class OpenCodeWorkflowWorkerError extends Error {
|
|
10
|
+
readonly name = "OpenCodeWorkflowWorkerError";
|
|
11
|
+
}
|
|
12
|
+
export declare const runOpenCodeWorkflowTask: (task: AnyWorkflowTask, options: OpenCodeWorkflowWorkerOptions) => Promise<WorkflowTaskExecution>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type AnyWorkflowDefinition, type AnyWorkflowTask, type WorkflowRuntimeOptions } from "./workflows.js";
|
|
2
|
+
import { type WorkflowStore } from "./workflow-store.js";
|
|
3
|
+
export interface WorkflowTaskExecution {
|
|
4
|
+
readonly output: unknown;
|
|
5
|
+
readonly metadata?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface WorkflowRunTaskResult {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly agent: {
|
|
10
|
+
readonly plugin: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
};
|
|
13
|
+
readonly output: unknown;
|
|
14
|
+
readonly cached: boolean;
|
|
15
|
+
readonly metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface WorkflowRunResult {
|
|
18
|
+
readonly runId: string | null;
|
|
19
|
+
readonly workflow: string;
|
|
20
|
+
readonly tasks: ReadonlyArray<WorkflowRunTaskResult>;
|
|
21
|
+
readonly output?: unknown;
|
|
22
|
+
}
|
|
23
|
+
export declare class WorkflowTaskDecodeError extends Error {
|
|
24
|
+
readonly taskId: string;
|
|
25
|
+
readonly cause: unknown;
|
|
26
|
+
readonly name = "WorkflowTaskDecodeError";
|
|
27
|
+
constructor(taskId: string, cause: unknown);
|
|
28
|
+
}
|
|
29
|
+
export declare class WorkflowRunStoppedError extends Error {
|
|
30
|
+
readonly runId: string;
|
|
31
|
+
readonly name = "WorkflowRunStoppedError";
|
|
32
|
+
constructor(runId: string);
|
|
33
|
+
}
|
|
34
|
+
export declare class WorkflowTaskEscalatedError extends Error {
|
|
35
|
+
readonly taskId: string;
|
|
36
|
+
readonly criterion: string;
|
|
37
|
+
readonly feedback?: string | undefined;
|
|
38
|
+
readonly name = "WorkflowTaskEscalatedError";
|
|
39
|
+
constructor(taskId: string, criterion: string, feedback?: string | undefined);
|
|
40
|
+
}
|
|
41
|
+
export type WorkflowTaskRepairMode = "native-continuation" | "fresh-executor-invocation" | "none";
|
|
42
|
+
export interface WorkflowTaskRepairContext {
|
|
43
|
+
readonly attempt: number;
|
|
44
|
+
readonly criterion: string;
|
|
45
|
+
readonly repairPrompt: string;
|
|
46
|
+
readonly mode: Exclude<WorkflowTaskRepairMode, "none">;
|
|
47
|
+
readonly previousMetadata?: Record<string, unknown>;
|
|
48
|
+
readonly fallbackReason?: "adapter-does-not-support-continuation" | "executor-does-not-advertise-continuation" | "missing-session-id";
|
|
49
|
+
readonly continuation?: {
|
|
50
|
+
readonly adapter: string;
|
|
51
|
+
readonly sessionId: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface WorkflowTaskExecutionContext {
|
|
55
|
+
readonly abortSignal?: AbortSignal;
|
|
56
|
+
readonly repair?: WorkflowTaskRepairContext;
|
|
57
|
+
}
|
|
58
|
+
export type WorkflowTaskExecutor = (task: AnyWorkflowTask, context?: WorkflowTaskExecutionContext) => Promise<unknown | WorkflowTaskExecution>;
|
|
59
|
+
export declare const DEFAULT_WORKFLOW_TASK_CONCURRENCY = 8;
|
|
60
|
+
export declare const runWorkflow: (workflow: AnyWorkflowDefinition, options: {
|
|
61
|
+
readonly executeTask: WorkflowTaskExecutor;
|
|
62
|
+
readonly store?: WorkflowStore;
|
|
63
|
+
readonly cache?: boolean;
|
|
64
|
+
readonly mockOutput?: boolean;
|
|
65
|
+
readonly maxConcurrentTasks?: number;
|
|
66
|
+
readonly runId?: string;
|
|
67
|
+
readonly runtimeOptions?: WorkflowRuntimeOptions;
|
|
68
|
+
readonly abortSignal?: AbortSignal;
|
|
69
|
+
}) => Promise<WorkflowRunResult>;
|