@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 CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skastr0/prism-linux-x64",
3
- "version": "0.4.6",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "Prism standalone CLI binary for Linux x64.",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@opencode-ai/plugin": "^1.15.13",
21
- "@skastr0/prism-sdk": "0.4.6",
21
+ "@skastr0/prism-sdk": "0.5.1",
22
22
  "effect": "^3.21.1",
23
23
  "typescript": "^5.8.3",
24
24
  "zod": "4.4.3"
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Typed compile errors for the structured compile-language pipeline.
3
+ *
4
+ * These tags are members of the `PrismError` union in src/errors.ts; the CLI
5
+ * edge renders them via `renderPrismError`/`renderPrismCause`. The canonical
6
+ * `PluginManifestError` lives in src/errors.ts (type-only import here keeps
7
+ * the modules cycle-free at runtime).
8
+ */
9
+ import { Schema } from "effect";
10
+ import type { PluginManifestError } from "../errors.js";
11
+ declare const SourceParseError_base: Schema.TaggedErrorClass<SourceParseError, "SourceParseError", {
12
+ readonly _tag: Schema.tag<"SourceParseError">;
13
+ } & {
14
+ sourcePath: typeof Schema.String;
15
+ kind: Schema.Literal<["identity", "personality", "agent", "modelspace", "skillspace", "sop", "tool", "hook"]>;
16
+ message: typeof Schema.String;
17
+ }>;
18
+ export declare class SourceParseError extends SourceParseError_base {
19
+ }
20
+ declare const UnknownReferenceError_base: Schema.TaggedErrorClass<UnknownReferenceError, "UnknownReferenceError", {
21
+ readonly _tag: Schema.tag<"UnknownReferenceError">;
22
+ } & {
23
+ agentName: typeof Schema.String;
24
+ sourcePath: typeof Schema.String;
25
+ field: Schema.Literal<["identity", "personality", "model", "skill", "phase.agent"]>;
26
+ referenceName: typeof Schema.String;
27
+ }>;
28
+ export declare class UnknownReferenceError extends UnknownReferenceError_base {
29
+ }
30
+ declare const UnknownDependencyError_base: Schema.TaggedErrorClass<UnknownDependencyError, "UnknownDependencyError", {
31
+ readonly _tag: Schema.tag<"UnknownDependencyError">;
32
+ } & {
33
+ sourcePath: typeof Schema.String;
34
+ referenceName: typeof Schema.String;
35
+ depPrefix: typeof Schema.String;
36
+ declaredDeps: Schema.Array$<typeof Schema.String>;
37
+ }>;
38
+ export declare class UnknownDependencyError extends UnknownDependencyError_base {
39
+ }
40
+ declare const DependencyCycleError_base: Schema.TaggedErrorClass<DependencyCycleError, "DependencyCycleError", {
41
+ readonly _tag: Schema.tag<"DependencyCycleError">;
42
+ } & {
43
+ cycle: Schema.Array$<typeof Schema.String>;
44
+ }>;
45
+ export declare class DependencyCycleError extends DependencyCycleError_base {
46
+ }
47
+ declare const UnknownTargetError_base: Schema.TaggedErrorClass<UnknownTargetError, "UnknownTargetError", {
48
+ readonly _tag: Schema.tag<"UnknownTargetError">;
49
+ } & {
50
+ target: typeof Schema.String;
51
+ supportedTargets: Schema.Array$<typeof Schema.String>;
52
+ }>;
53
+ export declare class UnknownTargetError extends UnknownTargetError_base {
54
+ }
55
+ declare const InvalidTargetScopeError_base: Schema.TaggedErrorClass<InvalidTargetScopeError, "InvalidTargetScopeError", {
56
+ readonly _tag: Schema.tag<"InvalidTargetScopeError">;
57
+ } & {
58
+ target: typeof Schema.String;
59
+ scope: typeof Schema.String;
60
+ message: typeof Schema.String;
61
+ }>;
62
+ export declare class InvalidTargetScopeError extends InvalidTargetScopeError_base {
63
+ }
64
+ declare const UnsupportedTargetCapabilityError_base: Schema.TaggedErrorClass<UnsupportedTargetCapabilityError, "UnsupportedTargetCapabilityError", {
65
+ readonly _tag: Schema.tag<"UnsupportedTargetCapabilityError">;
66
+ } & {
67
+ target: typeof Schema.String;
68
+ capability: Schema.Literal<["compiled-agents", "hooks"]>;
69
+ message: typeof Schema.String;
70
+ }>;
71
+ export declare class UnsupportedTargetCapabilityError extends UnsupportedTargetCapabilityError_base {
72
+ }
73
+ declare const AgentValidationError_base: Schema.TaggedErrorClass<AgentValidationError, "AgentValidationError", {
74
+ readonly _tag: Schema.tag<"AgentValidationError">;
75
+ } & {
76
+ sourcePath: typeof Schema.String;
77
+ agentName: typeof Schema.String;
78
+ field: typeof Schema.String;
79
+ message: typeof Schema.String;
80
+ }>;
81
+ export declare class AgentValidationError extends AgentValidationError_base {
82
+ }
83
+ declare const DuplicateNameError_base: Schema.TaggedErrorClass<DuplicateNameError, "DuplicateNameError", {
84
+ readonly _tag: Schema.tag<"DuplicateNameError">;
85
+ } & {
86
+ kind: Schema.Literal<["identity", "personality", "agent", "modelspace", "skillspace", "sop", "tool", "hook"]>;
87
+ name: typeof Schema.String;
88
+ firstPath: typeof Schema.String;
89
+ secondPath: typeof Schema.String;
90
+ }>;
91
+ export declare class DuplicateNameError extends DuplicateNameError_base {
92
+ }
93
+ declare const AgentNameMismatchError_base: Schema.TaggedErrorClass<AgentNameMismatchError, "AgentNameMismatchError", {
94
+ readonly _tag: Schema.tag<"AgentNameMismatchError">;
95
+ } & {
96
+ sourcePath: typeof Schema.String;
97
+ fileStem: typeof Schema.String;
98
+ agentName: typeof Schema.String;
99
+ }>;
100
+ export declare class AgentNameMismatchError extends AgentNameMismatchError_base {
101
+ }
102
+ declare const MissingTargetResolutionError_base: Schema.TaggedErrorClass<MissingTargetResolutionError, "MissingTargetResolutionError", {
103
+ readonly _tag: Schema.tag<"MissingTargetResolutionError">;
104
+ } & {
105
+ agentName: typeof Schema.String;
106
+ referenceKind: Schema.Literal<["model-profile", "skill"]>;
107
+ referenceName: typeof Schema.String;
108
+ target: typeof Schema.String;
109
+ }>;
110
+ export declare class MissingTargetResolutionError extends MissingTargetResolutionError_base {
111
+ }
112
+ export type CompileError = SourceParseError | UnknownReferenceError | AgentValidationError | UnknownTargetError | InvalidTargetScopeError | UnsupportedTargetCapabilityError | DuplicateNameError | AgentNameMismatchError | MissingTargetResolutionError | UnknownDependencyError | DependencyCycleError | PluginManifestError;
113
+ export declare const formatCompileError: (error: CompileError) => string;
114
+ export {};
@@ -0,0 +1,107 @@
1
+ /**
2
+ * PrismError — the single tagged-error vocabulary that survives the
3
+ * one-writer overhaul (docs/overhaul-one-writer-plan.md, WS2).
4
+ *
5
+ * Every failure Prism shows a human goes through this module:
6
+ * - one `PrismError` union the CLI edge can exhaustively match,
7
+ * - `renderPrismError` / `renderPrismCause` as the only renderers
8
+ * (one-line headline, optional indented detail, a `hint:` line),
9
+ * - never a stack trace.
10
+ *
11
+ * Compile-language errors keep living in `src/compile/errors.ts` (they are
12
+ * constructed throughout the compile pipeline); this module absorbs them into
13
+ * the union instead of duplicating them. New error families added by later
14
+ * workstreams (SnapshotDecodeError, RegionPatchError, BlockedTargetError,
15
+ * TokenStoreError, …) join the union here.
16
+ */
17
+ import { Schema } from "effect";
18
+ import { type CompileError } from "./compile/errors.js";
19
+ declare const PluginManifestError_base: Schema.TaggedErrorClass<PluginManifestError, "PluginManifestError", {
20
+ readonly _tag: Schema.tag<"PluginManifestError">;
21
+ } & {
22
+ pluginPath: typeof Schema.String;
23
+ manifestPath: typeof Schema.String;
24
+ pluginLabel: typeof Schema.String;
25
+ summary: typeof Schema.String;
26
+ details: Schema.Array$<typeof Schema.String>;
27
+ }>;
28
+ export declare class PluginManifestError extends PluginManifestError_base {
29
+ /**
30
+ * Build a manifest error from just a plugin path + summary, deriving the
31
+ * manifest path and plugin label.
32
+ */
33
+ static forPlugin(pluginPath: string, summary: string, details?: ReadonlyArray<string>, options?: {
34
+ readonly pluginName?: string;
35
+ }): PluginManifestError;
36
+ get message(): string;
37
+ }
38
+ declare const PrismConfigError_base: Schema.TaggedErrorClass<PrismConfigError, "PrismConfigError", {
39
+ readonly _tag: Schema.tag<"PrismConfigError">;
40
+ } & {
41
+ message: typeof Schema.String;
42
+ }>;
43
+ export declare class PrismConfigError extends PrismConfigError_base {
44
+ }
45
+ declare const BundleBuildError_base: Schema.TaggedErrorClass<BundleBuildError, "BundleBuildError", {
46
+ readonly _tag: Schema.tag<"BundleBuildError">;
47
+ } & {
48
+ bundleKind: typeof Schema.String;
49
+ diagnostics: typeof Schema.String;
50
+ }>;
51
+ export declare class BundleBuildError extends BundleBuildError_base {
52
+ get message(): string;
53
+ }
54
+ declare const BlockedTargetError_base: Schema.TaggedErrorClass<BlockedTargetError, "BlockedTargetError", {
55
+ readonly _tag: Schema.tag<"BlockedTargetError">;
56
+ } & {
57
+ targetPath: typeof Schema.String;
58
+ plugin: typeof Schema.String;
59
+ hint: typeof Schema.String;
60
+ }>;
61
+ export declare class BlockedTargetError extends BlockedTargetError_base {
62
+ get message(): string;
63
+ }
64
+ declare const PathConflictError_base: Schema.TaggedErrorClass<PathConflictError, "PathConflictError", {
65
+ readonly _tag: Schema.tag<"PathConflictError">;
66
+ } & {
67
+ targetPath: typeof Schema.String;
68
+ firstPlugin: typeof Schema.String;
69
+ secondPlugin: typeof Schema.String;
70
+ }>;
71
+ export declare class PathConflictError extends PathConflictError_base {
72
+ get message(): string;
73
+ }
74
+ /**
75
+ * Every typed error Prism may surface to a human. `CompileError` (which
76
+ * includes `PluginManifestError`) is defined in src/compile/errors.ts.
77
+ */
78
+ export type PrismError = CompileError | PrismConfigError | BundleBuildError | BlockedTargetError | PathConflictError;
79
+ export declare const PRISM_ERROR_TAGS: ReadonlySet<string>;
80
+ export declare const isPrismError: (value: unknown) => value is PrismError;
81
+ export interface PrismErrorRender {
82
+ /** One line; never multi-line, never a stack frame. */
83
+ readonly headline: string;
84
+ /** Optional extra lines, rendered indented under the headline. */
85
+ readonly detail?: ReadonlyArray<string>;
86
+ /** Remediation; rendered as a trailing `hint: …` line. */
87
+ readonly hint: string;
88
+ /** Filesystem path the error is about, when it has one. */
89
+ readonly path?: string;
90
+ }
91
+ export declare const describePrismError: (error: PrismError) => PrismErrorRender;
92
+ /** Render a PrismError for humans: headline, indented detail, hint line. */
93
+ export declare const renderPrismError: (error: PrismError) => string;
94
+ export interface PrismCauseDescription {
95
+ readonly headline: string;
96
+ readonly detail?: ReadonlyArray<string>;
97
+ readonly hint?: string;
98
+ readonly path?: string;
99
+ }
100
+ /**
101
+ * Walk an Effect Cause (or any thrown value) and describe the first Prism
102
+ * error found. Unknown defects render name + message only — never `.stack`.
103
+ */
104
+ export declare const describePrismCause: (cause: unknown) => PrismCauseDescription;
105
+ /** Render a whole Cause for humans. The single edge renderer. */
106
+ export declare const renderPrismCause: (cause: unknown) => string;
107
+ export {};
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Fail-soft discovery of installed workflow-harness models.
3
+ * Cache reads and CLI lists never throw; empty means "leave this worker as string".
4
+ */
5
+ import { type DiscoveredHarnessModels, type HarnessModelOption, type RefreshHarnessTypesResult } from "./harness-types.js";
6
+ export type HarnessTypesReadText = (path: string) => string | undefined;
7
+ export type HarnessTypesCommandRunner = (command: string, args: readonly string[]) => Promise<string>;
8
+ export interface DiscoverHarnessTypesOptions {
9
+ readonly home?: string;
10
+ readonly env?: Readonly<Record<string, string | undefined>>;
11
+ readonly readText?: HarnessTypesReadText;
12
+ readonly runCommand?: HarnessTypesCommandRunner;
13
+ }
14
+ export declare const parseClaudeModelCache: (raw: string) => {
15
+ readonly models: HarnessModelOption[];
16
+ readonly error?: string;
17
+ };
18
+ export declare const readClaudeModels: (home: string, readText: HarnessTypesReadText) => DiscoveredHarnessModels;
19
+ export declare const parseCodexDebugModels: (stdout: string) => {
20
+ readonly models: HarnessModelOption[];
21
+ readonly error?: string;
22
+ };
23
+ export declare const parseGrokModelsCache: (raw: string) => {
24
+ readonly models: HarnessModelOption[];
25
+ readonly error?: string;
26
+ };
27
+ export declare const parseGrokModelsCli: (stdout: string) => HarnessModelOption[];
28
+ export declare const parseHermesProviderModelsCache: (raw: string) => {
29
+ readonly models: HarnessModelOption[];
30
+ readonly error?: string;
31
+ };
32
+ export declare const parseOpenCodeModels: (stdout: string) => HarnessModelOption[];
33
+ export declare const parseCursorModelsList: (stdout: string) => {
34
+ readonly models: HarnessModelOption[];
35
+ readonly error?: string;
36
+ };
37
+ export declare const parseAgyModelsList: (stdout: string) => {
38
+ readonly models: HarnessModelOption[];
39
+ readonly error?: string;
40
+ };
41
+ export declare const parseDevinModelsList: (stdout: string) => {
42
+ readonly models: HarnessModelOption[];
43
+ readonly error?: string;
44
+ };
45
+ /** Canonical OMP `--model` pin is `selector` (`provider/id`). */
46
+ export declare const parseOmpModelsJson: (raw: string) => {
47
+ readonly models: HarnessModelOption[];
48
+ readonly error?: string;
49
+ };
50
+ /** `modelRoles.default` from ~/.omp/agent/config.yml, without a trailing :thinking suffix. */
51
+ export declare const parseOmpConfigDefaultModel: (raw: string) => string | undefined;
52
+ export declare const readOmpConfigDefaultModel: (home: string, readText?: HarnessTypesReadText) => string | undefined;
53
+ export declare const parseKimiProviderList: (stdout: string) => HarnessModelOption[];
54
+ /** Built-in `--mode` dial from `amp --help` (`low, medium, high, ultra, or a plugin mode…`). */
55
+ export declare const parseAmpModeHelp: (stdout: string) => HarnessModelOption[];
56
+ /** Plugin-registered `--mode` keys from `amp plugins list` (`agent mode: grok45`). */
57
+ export declare const parseAmpPluginListModes: (stdout: string) => HarnessModelOption[];
58
+ /** Curated `provider/model` catalog from `amp plugins show-agent-options --json`. */
59
+ export declare const parseAmpAgentOptions: (raw: string) => {
60
+ readonly models: HarnessModelOption[];
61
+ readonly error?: string;
62
+ };
63
+ export declare const discoverWorkflowHarnessModels: (options?: DiscoverHarnessTypesOptions) => Promise<readonly DiscoveredHarnessModels[]>;
64
+ export declare const refreshHarnessTypes: (prismHome: string, options?: DiscoverHarnessTypesOptions) => Promise<RefreshHarnessTypesResult>;
65
+ export declare const renderHarnessTypesRefreshHuman: (result: RefreshHarnessTypesResult) => string;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Global (machine-wide) harness model types for plugin-free workflow authoring.
3
+ *
4
+ * Written by `prism workflow refresh-harness-types` to
5
+ * `<PRISM_HOME>/state/harness-types/`. Not project-keyed — harnesses are
6
+ * installed on the machine, not per repo.
7
+ */
8
+ import type { WorkflowWorkerId } from "./workflows.js";
9
+ export declare const HARNESS_TYPES_DIRNAME = "harness-types";
10
+ export declare const HARNESS_MODELS_FILENAME = "harness-models.ts";
11
+ export declare const HARNESS_DISCOVERED_FILENAME = "discovered.json";
12
+ export declare const harnessTypesDir: (prismHome: string) => string;
13
+ export declare const harnessModelsModulePath: (prismHome: string) => string;
14
+ export declare const harnessDiscoveredPath: (prismHome: string) => string;
15
+ export declare const harnessTypesExist: (prismHome: string) => boolean;
16
+ export type HarnessModelSource = "cache" | "aliases" | "command" | "static" | "empty";
17
+ export interface HarnessModelOption {
18
+ readonly id: string;
19
+ readonly label?: string;
20
+ readonly efforts?: readonly string[];
21
+ readonly provider?: string;
22
+ /** Amp: dial / plugin-mode / curated model. Other harnesses omit this. */
23
+ readonly kind?: "dial" | "plugin-mode" | "model";
24
+ }
25
+ export interface DiscoveredHarnessModels {
26
+ readonly harness: WorkflowWorkerId;
27
+ readonly models: readonly HarnessModelOption[];
28
+ readonly source: HarnessModelSource;
29
+ readonly error?: string;
30
+ }
31
+ export interface HarnessTypesSnapshot {
32
+ readonly generatedAt: string;
33
+ readonly harnesses: readonly DiscoveredHarnessModels[];
34
+ }
35
+ export interface RefreshHarnessTypesResult {
36
+ readonly modelsPath: string;
37
+ readonly discoveredPath: string;
38
+ readonly snapshot: HarnessTypesSnapshot;
39
+ }
40
+ /**
41
+ * Render the generated `prism/harnesses` module. A worker appears only
42
+ * when discovery returned at least one model id.
43
+ */
44
+ export declare const renderHarnessModelsModule: (snapshot: HarnessTypesSnapshot) => string;
45
+ export declare const writeHarnessTypesSnapshot: (prismHome: string, snapshot: HarnessTypesSnapshot) => RefreshHarnessTypesResult;