@darkhorseprojects/circuitry 0.3.10 → 0.4.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/SPEC.md +96 -0
- package/dist/cli.js +7481 -154
- package/dist/graph.d.ts +155 -156
- package/dist/index.d.ts +1 -8
- package/dist/index.js +7549 -963
- package/dist/resolve.d.ts +9 -0
- package/dist/resolve.js +7548 -0
- package/examples/agent.circuitry.yaml +24 -0
- package/examples/imports.circuitry.yaml +13 -0
- package/examples/minimal.circuitry.yaml +20 -0
- package/examples/run-resource.circuitry.yaml +24 -0
- package/package.json +11 -6
- package/schema.json +65 -0
- package/dist/bundle.d.ts +0 -32
- package/dist/host.d.ts +0 -41
- package/dist/node.d.ts +0 -58
- package/dist/node.js +0 -838
- package/dist/presets.d.ts +0 -4
- package/dist/runtime.d.ts +0 -16
- package/dist/scheduler.d.ts +0 -30
- package/dist/simulation.d.ts +0 -89
- package/dist/tools.d.ts +0 -553
- package/dist/types.d.ts +0 -41
package/dist/graph.d.ts
CHANGED
|
@@ -1,187 +1,90 @@
|
|
|
1
|
-
export declare const CIRCUITRY_SPEC_VERSION: "0.
|
|
1
|
+
export declare const CIRCUITRY_SPEC_VERSION: "0.4";
|
|
2
2
|
export type CircuitrySpecVersion = typeof CIRCUITRY_SPEC_VERSION;
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
tools?: string[];
|
|
10
|
-
identity?: string;
|
|
11
|
-
personality?: string;
|
|
12
|
-
instructions?: string;
|
|
13
|
-
context?: string;
|
|
14
|
-
};
|
|
15
|
-
export type CircuitryInput = {
|
|
16
|
-
id: string;
|
|
17
|
-
type: CircuitryInputKind;
|
|
3
|
+
export type CircuitrySchema = "str" | "int" | "float" | "bool" | "list" | "dict" | Record<string, unknown>;
|
|
4
|
+
export type CircuitryInputKind = "text" | "file" | "url" | "image" | "uri" | "data" | string;
|
|
5
|
+
export type CircuitryInputSpec = {
|
|
6
|
+
type?: CircuitryInputKind;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
default?: unknown;
|
|
18
9
|
label?: string;
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
description?: string;
|
|
11
|
+
mime?: string;
|
|
21
12
|
mimeType?: string;
|
|
22
|
-
data?: Record<string, unknown>;
|
|
23
13
|
};
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
skills?: string[];
|
|
31
|
-
expect?: CircuitryExpectSchema;
|
|
32
|
-
data?: Record<string, unknown>;
|
|
33
|
-
view?: {
|
|
34
|
-
adapter?: "excalidraw" | string;
|
|
35
|
-
x?: number;
|
|
36
|
-
y?: number;
|
|
37
|
-
width?: number;
|
|
38
|
-
height?: number;
|
|
39
|
-
color?: string;
|
|
40
|
-
};
|
|
14
|
+
export type CircuitryGraphArg = CircuitryInputSpec;
|
|
15
|
+
export type CircuitryRuntimeInputs = Record<string, unknown>;
|
|
16
|
+
export type CircuitryImport = {
|
|
17
|
+
path: string;
|
|
18
|
+
resources?: "*" | string[] | Record<string, string>;
|
|
19
|
+
prefix?: string;
|
|
41
20
|
};
|
|
42
|
-
export type
|
|
43
|
-
|
|
44
|
-
from: string;
|
|
45
|
-
to: string;
|
|
46
|
-
kind?: CircuitryEdgeKind;
|
|
21
|
+
export type CircuitryResource = {
|
|
22
|
+
type: string;
|
|
47
23
|
label?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
inputs?: string[] | Record<string, string>;
|
|
26
|
+
from?: string;
|
|
27
|
+
value?: unknown;
|
|
28
|
+
path?: string;
|
|
29
|
+
uri?: string;
|
|
30
|
+
mime?: string;
|
|
31
|
+
mimeType?: string;
|
|
48
32
|
data?: Record<string, unknown>;
|
|
49
|
-
};
|
|
50
|
-
export type CircuitryExpectFieldType = "str" | "int" | "float" | "bool" | "list" | "dict" | (string & {});
|
|
51
|
-
export type CircuitryExpectField = {
|
|
52
|
-
type: CircuitryExpectFieldType;
|
|
53
|
-
contains?: string;
|
|
54
|
-
items?: CircuitryExpectSchema | CircuitryExpectFieldType;
|
|
55
|
-
optional?: boolean;
|
|
56
|
-
};
|
|
57
|
-
export interface CircuitryExpectSchema {
|
|
58
|
-
[key: string]: CircuitryExpectField | CircuitryExpectFieldType | CircuitryExpectSchema;
|
|
59
|
-
}
|
|
60
|
-
export type CircuitryResourceText = {
|
|
61
|
-
type: "text";
|
|
62
|
-
value: string;
|
|
63
|
-
label?: string;
|
|
64
|
-
};
|
|
65
|
-
export type CircuitryResourceAgent = {
|
|
66
|
-
type: "agent";
|
|
67
33
|
identity?: string;
|
|
68
|
-
label?: string;
|
|
69
34
|
model?: string;
|
|
70
|
-
inputs?: string[];
|
|
71
|
-
tools?: string[];
|
|
72
|
-
skills?: string[];
|
|
73
|
-
expect?: CircuitryExpectSchema;
|
|
74
35
|
instructions?: string;
|
|
75
36
|
personality?: string;
|
|
76
37
|
context?: string;
|
|
38
|
+
tools?: string[];
|
|
39
|
+
skills?: string[];
|
|
40
|
+
graph?: string;
|
|
41
|
+
entry?: string;
|
|
42
|
+
expect?: CircuitrySchema;
|
|
43
|
+
[key: `x-${string}`]: unknown;
|
|
77
44
|
};
|
|
78
|
-
export type
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
inputs?: string[];
|
|
82
|
-
instructions?: string;
|
|
83
|
-
};
|
|
84
|
-
export type CircuitryResourceData = {
|
|
85
|
-
type: CircuitryInputKind;
|
|
86
|
-
value?: string;
|
|
87
|
-
uri?: string;
|
|
88
|
-
path?: string;
|
|
89
|
-
mimeType?: string;
|
|
90
|
-
label?: string;
|
|
91
|
-
data?: Record<string, unknown>;
|
|
92
|
-
};
|
|
93
|
-
export type CircuitryResourceEntry = CircuitryResourceText | CircuitryResourceAgent | CircuitryResourceTool | CircuitryResourceData;
|
|
94
|
-
export type CircuitrySandboxProvider = "local" | "docker" | "e2b" | "daytona" | "cloudflare" | "modal" | "openai" | (string & {});
|
|
95
|
-
export type CircuitrySandboxClient = {
|
|
96
|
-
provider: CircuitrySandboxProvider;
|
|
97
|
-
image?: string;
|
|
98
|
-
cwd?: string;
|
|
99
|
-
command?: string[];
|
|
100
|
-
env?: Record<string, string>;
|
|
101
|
-
secrets?: Record<string, string>;
|
|
102
|
-
timeoutMs?: number;
|
|
103
|
-
resources?: {
|
|
104
|
-
cpu?: number;
|
|
105
|
-
memoryMb?: number;
|
|
106
|
-
diskMb?: number;
|
|
107
|
-
gpu?: boolean | string;
|
|
108
|
-
};
|
|
109
|
-
providerOptions?: Record<string, unknown>;
|
|
110
|
-
};
|
|
111
|
-
export type CircuitryRuntimeProvider = "pi" | "claude-code" | "codex" | "opencode" | (string & {});
|
|
112
|
-
export type CircuitryRuntimeClient = {
|
|
113
|
-
type?: "sdk" | "cli" | "mcp" | "http" | (string & {});
|
|
114
|
-
command?: string;
|
|
115
|
-
args?: string[];
|
|
116
|
-
cwd?: string;
|
|
117
|
-
env?: Record<string, string>;
|
|
118
|
-
config?: string;
|
|
119
|
-
agent?: string;
|
|
120
|
-
providerOptions?: Record<string, unknown>;
|
|
121
|
-
};
|
|
122
|
-
export type CircuitryRuntime = {
|
|
123
|
-
provider?: CircuitryRuntimeProvider;
|
|
124
|
-
model?: string;
|
|
125
|
-
client?: CircuitryRuntimeClient;
|
|
126
|
-
sandbox?: CircuitrySandboxClient;
|
|
127
|
-
permissions?: Record<string, unknown>;
|
|
128
|
-
};
|
|
129
|
-
export type CircuitryBuiltInValidationRule = "no-self-loops" | "no-unknown-edge-endpoints" | "require-executable-inputs" | "no-cycles";
|
|
130
|
-
export type CircuitryValidationRuleEntry = CircuitryBuiltInValidationRule | {
|
|
131
|
-
rule: "require-executable-inputs";
|
|
132
|
-
executableKinds?: string[];
|
|
45
|
+
export type CircuitryResourceEntry = CircuitryResource;
|
|
46
|
+
export type CircuitryResourceText = CircuitryResource & {
|
|
47
|
+
type: "text";
|
|
133
48
|
};
|
|
134
|
-
export type
|
|
135
|
-
|
|
49
|
+
export type CircuitryResourceAgent = CircuitryResource & {
|
|
50
|
+
type: "agent";
|
|
136
51
|
};
|
|
137
|
-
export type
|
|
138
|
-
type:
|
|
139
|
-
required?: boolean;
|
|
140
|
-
label?: string;
|
|
141
|
-
description?: string;
|
|
142
|
-
default?: unknown;
|
|
143
|
-
mimeType?: string;
|
|
52
|
+
export type CircuitryResourceTool = CircuitryResource & {
|
|
53
|
+
type: "tool";
|
|
144
54
|
};
|
|
145
|
-
export type
|
|
146
|
-
export type
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
55
|
+
export type CircuitryResourceData = CircuitryResource;
|
|
56
|
+
export type CircuitryOutput = {
|
|
57
|
+
from: string;
|
|
58
|
+
type?: string;
|
|
59
|
+
mime?: string;
|
|
60
|
+
schema?: CircuitrySchema;
|
|
150
61
|
};
|
|
62
|
+
export type CircuitryRuntime = Record<string, unknown>;
|
|
63
|
+
export type CircuitryGraphValidation = Record<string, unknown>;
|
|
151
64
|
export type CircuitryGraph = {
|
|
152
65
|
circuitry: CircuitrySpecVersion | string;
|
|
153
66
|
id?: string;
|
|
154
67
|
title?: string;
|
|
155
68
|
description?: string;
|
|
156
69
|
imports?: CircuitryImport[];
|
|
157
|
-
|
|
70
|
+
inputs?: Record<string, CircuitryInputSpec>;
|
|
71
|
+
args?: Record<string, CircuitryInputSpec>;
|
|
72
|
+
entry?: string;
|
|
73
|
+
entries?: Record<string, string>;
|
|
158
74
|
resources?: Record<string, CircuitryResourceEntry>;
|
|
75
|
+
outputs?: Record<string, CircuitryOutput>;
|
|
159
76
|
nodes?: CircuitryNode[];
|
|
160
77
|
edges?: CircuitryEdge[];
|
|
161
|
-
agents?: never;
|
|
162
78
|
runtime?: CircuitryRuntime;
|
|
163
79
|
validation?: CircuitryGraphValidation;
|
|
164
80
|
metadata?: Record<string, unknown>;
|
|
81
|
+
[key: `x-${string}`]: unknown;
|
|
165
82
|
};
|
|
166
83
|
export type LoadedCircuitryBundle = {
|
|
167
84
|
circuitryBundle: CircuitrySpecVersion;
|
|
168
85
|
graph: CircuitryGraph;
|
|
169
86
|
origins: Record<string, string>;
|
|
170
87
|
};
|
|
171
|
-
export type CircuitryAgentPreset = {
|
|
172
|
-
name: string;
|
|
173
|
-
description?: string;
|
|
174
|
-
model?: string;
|
|
175
|
-
personality?: string;
|
|
176
|
-
instructions: string;
|
|
177
|
-
metadata?: Record<string, unknown>;
|
|
178
|
-
};
|
|
179
|
-
export type CircuitryValidationStandard = {
|
|
180
|
-
version?: CircuitrySpecVersion | string;
|
|
181
|
-
requireSpecVersion?: boolean;
|
|
182
|
-
rules?: CircuitryValidationRuleEntry[];
|
|
183
|
-
executableKinds?: string[];
|
|
184
|
-
};
|
|
185
88
|
export type CircuitryValidationIssue = {
|
|
186
89
|
code: string;
|
|
187
90
|
message: string;
|
|
@@ -192,17 +95,113 @@ export type CircuitryValidationResult = {
|
|
|
192
95
|
errors: CircuitryValidationIssue[];
|
|
193
96
|
standard: Required<CircuitryValidationStandard>;
|
|
194
97
|
};
|
|
195
|
-
export
|
|
98
|
+
export type CircuitryValidationStandard = {
|
|
99
|
+
version?: CircuitrySpecVersion | string;
|
|
100
|
+
requireSpecVersion?: boolean;
|
|
101
|
+
};
|
|
196
102
|
export declare const DEFAULT_CIRCUITRY_VALIDATION_STANDARD: {
|
|
197
|
-
readonly version: "0.
|
|
103
|
+
readonly version: "0.4";
|
|
198
104
|
readonly requireSpecVersion: true;
|
|
199
|
-
readonly rules: CircuitryValidationRuleEntry[];
|
|
200
|
-
readonly executableKinds: ["agent", "tool", "output"];
|
|
201
105
|
};
|
|
106
|
+
export type CircuitryDependency = {
|
|
107
|
+
from: string;
|
|
108
|
+
to: string;
|
|
109
|
+
name?: string;
|
|
110
|
+
};
|
|
111
|
+
export type CircuitryInspection = {
|
|
112
|
+
version: string;
|
|
113
|
+
title?: string;
|
|
114
|
+
entry?: string;
|
|
115
|
+
entries: Record<string, string>;
|
|
116
|
+
inputs: string[];
|
|
117
|
+
resources: string[];
|
|
118
|
+
outputs: string[];
|
|
119
|
+
dependencies: CircuitryDependency[];
|
|
120
|
+
};
|
|
121
|
+
export declare const createCircuitryValidationStandard: (standard?: CircuitryValidationStandard) => Required<CircuitryValidationStandard>;
|
|
122
|
+
export declare const getResourceInputs: (resource: CircuitryResourceEntry) => CircuitryDependency[];
|
|
123
|
+
export declare const getCircuitryDependencies: (graph: CircuitryGraph) => CircuitryDependency[];
|
|
124
|
+
export declare const getCircuitryDependents: (graph: CircuitryGraph, resourceId: string) => string[];
|
|
125
|
+
export declare const getCircuitryRunSet: (graph: CircuitryGraph, entry?: string | undefined) => string[];
|
|
126
|
+
export declare const toposortCircuitryResources: (graph: CircuitryGraph, entry?: string) => string[];
|
|
127
|
+
export declare const resolveCircuitrySource: (graph: CircuitryGraph) => CircuitryGraph;
|
|
202
128
|
export declare const applyCircuitryRuntimeInputs: (graph: CircuitryGraph, inputs?: CircuitryRuntimeInputs) => CircuitryGraph;
|
|
203
|
-
export declare const
|
|
204
|
-
export declare const normalizeCircuitryGraph: (graph: CircuitryGraph) => CircuitryGraph;
|
|
129
|
+
export declare const validateCircuitrySource: (graph: unknown, standard?: CircuitryValidationStandard) => CircuitryValidationResult;
|
|
205
130
|
export declare const validateCircuitryGraphWithStandard: (graph: unknown, standard?: CircuitryValidationStandard) => CircuitryValidationResult;
|
|
206
131
|
export declare const validateCircuitryExecutionGraphWithStandard: (graph: unknown, standard?: CircuitryValidationStandard) => CircuitryValidationResult;
|
|
207
132
|
export declare const validateCircuitryGraph: (graph: unknown, standard?: CircuitryValidationStandard) => string[];
|
|
208
|
-
export declare const
|
|
133
|
+
export declare const inspectCircuitrySource: (graph: CircuitryGraph) => CircuitryInspection;
|
|
134
|
+
export declare const parseCircuitrySource: (value: unknown) => CircuitryGraph;
|
|
135
|
+
export declare const isUriInput: (input: {
|
|
136
|
+
type?: string;
|
|
137
|
+
uri?: string;
|
|
138
|
+
path?: string;
|
|
139
|
+
}) => boolean;
|
|
140
|
+
export type CircuitryNodeKind = "agent" | "input" | "tool" | "output" | string;
|
|
141
|
+
export type CircuitryEdgeKind = "dependency" | "context" | "message" | "control" | string;
|
|
142
|
+
export type CircuitryExpectFieldType = "str" | "int" | "float" | "bool" | "list" | "dict" | (string & {});
|
|
143
|
+
export type CircuitryExpectField = {
|
|
144
|
+
type: CircuitryExpectFieldType;
|
|
145
|
+
contains?: string;
|
|
146
|
+
items?: CircuitrySchema | CircuitryExpectFieldType;
|
|
147
|
+
optional?: boolean;
|
|
148
|
+
};
|
|
149
|
+
export interface CircuitryExpectSchema {
|
|
150
|
+
[key: string]: CircuitryExpectField | CircuitryExpectFieldType | CircuitryExpectSchema;
|
|
151
|
+
}
|
|
152
|
+
export type CircuitryAgent = {
|
|
153
|
+
uses?: string;
|
|
154
|
+
model?: string;
|
|
155
|
+
tools?: string[];
|
|
156
|
+
identity?: string;
|
|
157
|
+
personality?: string;
|
|
158
|
+
instructions?: string;
|
|
159
|
+
context?: string;
|
|
160
|
+
};
|
|
161
|
+
export type CircuitryInput = {
|
|
162
|
+
id: string;
|
|
163
|
+
type: CircuitryInputKind;
|
|
164
|
+
label?: string;
|
|
165
|
+
value?: string;
|
|
166
|
+
uri?: string;
|
|
167
|
+
mimeType?: string;
|
|
168
|
+
data?: Record<string, unknown>;
|
|
169
|
+
};
|
|
170
|
+
export type CircuitryNode = {
|
|
171
|
+
id: string;
|
|
172
|
+
kind: CircuitryNodeKind;
|
|
173
|
+
label: string;
|
|
174
|
+
agent?: CircuitryAgent;
|
|
175
|
+
input?: Omit<CircuitryInput, "id">;
|
|
176
|
+
skills?: string[];
|
|
177
|
+
expect?: CircuitryExpectSchema;
|
|
178
|
+
data?: Record<string, unknown>;
|
|
179
|
+
view?: Record<string, unknown>;
|
|
180
|
+
};
|
|
181
|
+
export type CircuitryEdge = {
|
|
182
|
+
id?: string;
|
|
183
|
+
from: string;
|
|
184
|
+
to: string;
|
|
185
|
+
kind?: CircuitryEdgeKind;
|
|
186
|
+
label?: string;
|
|
187
|
+
data?: Record<string, unknown>;
|
|
188
|
+
};
|
|
189
|
+
export type CircuitrySandboxProvider = string;
|
|
190
|
+
export type CircuitryRuntimeProvider = string;
|
|
191
|
+
export type CircuitryBuiltInValidationRule = string;
|
|
192
|
+
export type CircuitryValidationRuleEntry = string | {
|
|
193
|
+
rule: string;
|
|
194
|
+
executableKinds?: string[];
|
|
195
|
+
};
|
|
196
|
+
export type CircuitryAgentPreset = {
|
|
197
|
+
name: string;
|
|
198
|
+
description?: string;
|
|
199
|
+
model?: string;
|
|
200
|
+
personality?: string;
|
|
201
|
+
instructions: string;
|
|
202
|
+
metadata?: Record<string, unknown>;
|
|
203
|
+
};
|
|
204
|
+
export declare const normalizeCircuitryGraph: (graph: CircuitryGraph) => CircuitryGraph & {
|
|
205
|
+
nodes?: CircuitryNode[];
|
|
206
|
+
edges?: CircuitryEdge[];
|
|
207
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
1
|
export * from "./graph";
|
|
3
2
|
export * from "./yaml";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./scheduler";
|
|
6
|
-
export * from "./simulation";
|
|
7
|
-
export * from "./bundle";
|
|
8
|
-
export * from "./runtime";
|
|
9
|
-
export * from "./host";
|
|
10
|
-
export * from "./tools";
|
|
3
|
+
export * from "./resolve";
|