@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.
@@ -0,0 +1,24 @@
1
+ circuitry: "0.4"
2
+ title: Agent with prompt input
3
+ inputs:
4
+ user_turn:
5
+ type: text
6
+ required: true
7
+ entry: assistant
8
+ resources:
9
+ user_turn:
10
+ type: input
11
+ from: user_turn
12
+ guide:
13
+ type: text
14
+ value: Be direct, accurate, and natural.
15
+ assistant:
16
+ type: agent
17
+ inputs: [guide, user_turn]
18
+ tools: [read, write, bash, run_graph]
19
+ instructions: Use the guide and answer the user.
20
+ expect:
21
+ response: str
22
+ outputs:
23
+ response:
24
+ from: assistant.response
@@ -0,0 +1,13 @@
1
+ circuitry: "0.4"
2
+ title: Imports and entries
3
+ imports:
4
+ - path: ./agent.circuitry.yaml
5
+ resources: "*"
6
+ prefix: imported_
7
+ entry: imported_assistant
8
+ entries:
9
+ default: imported_assistant
10
+ resources:
11
+ local_note:
12
+ type: text
13
+ value: Local resource.
@@ -0,0 +1,20 @@
1
+ circuitry: "0.4"
2
+ title: Minimal
3
+ inputs:
4
+ user_turn:
5
+ type: text
6
+ required: true
7
+ entry: assistant
8
+ resources:
9
+ user_turn:
10
+ type: input
11
+ from: user_turn
12
+ assistant:
13
+ type: agent
14
+ inputs: [user_turn]
15
+ instructions: Answer the user.
16
+ expect:
17
+ response: str
18
+ outputs:
19
+ response:
20
+ from: assistant.response
@@ -0,0 +1,24 @@
1
+ circuitry: "0.4"
2
+ title: Run resource
3
+ inputs:
4
+ user_turn:
5
+ type: text
6
+ required: true
7
+ entry: assistant
8
+ resources:
9
+ user_turn:
10
+ type: input
11
+ from: user_turn
12
+ recovered_context:
13
+ type: run
14
+ graph: ./context-recovery.circuitry.yaml
15
+ entry: recovery
16
+ inputs:
17
+ user_turn: user_turn
18
+ assistant:
19
+ type: agent
20
+ inputs: [user_turn, recovered_context]
21
+ instructions: Answer with recovered context when useful.
22
+ outputs:
23
+ response:
24
+ from: assistant
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkhorseprojects/circuitry",
3
- "version": "0.3.10",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -9,9 +9,9 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "import": "./dist/index.js"
11
11
  },
12
- "./node": {
13
- "types": "./dist/node.d.ts",
14
- "import": "./dist/node.js"
12
+ "./resolve": {
13
+ "types": "./dist/resolve.d.ts",
14
+ "import": "./dist/resolve.js"
15
15
  }
16
16
  },
17
17
  "bin": {
@@ -20,6 +20,9 @@
20
20
  "license": "MPL-2.0",
21
21
  "files": [
22
22
  "dist",
23
+ "SPEC.md",
24
+ "schema.json",
25
+ "examples",
23
26
  "LICENSE"
24
27
  ],
25
28
  "scripts": {
@@ -33,8 +36,10 @@
33
36
  "type": "git",
34
37
  "url": "git+https://github.com/darkhorseprojects/circuitry.git"
35
38
  },
36
- "dependencies": {
37
- "@earendil-works/pi-coding-agent": "latest",
39
+ "dependencies": {},
40
+ "devDependencies": {
41
+ "@types/node": "^20.11.0",
42
+ "typescript": "^5.3.3",
38
43
  "yaml": "^2.8.4",
39
44
  "zod": "^3.25.76"
40
45
  }
package/schema.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://darkhorseprojects.github.io/circuitry/schema/0.4/schema.json",
4
+ "title": "Circuitry 0.4",
5
+ "type": "object",
6
+ "required": ["circuitry", "resources"],
7
+ "properties": {
8
+ "circuitry": { "const": "0.4" },
9
+ "title": { "type": "string" },
10
+ "description": { "type": "string" },
11
+ "imports": { "type": "array" },
12
+ "inputs": { "type": "object" },
13
+ "entry": { "type": "string" },
14
+ "entries": { "type": "object", "additionalProperties": { "type": "string" } },
15
+ "resources": {
16
+ "type": "object",
17
+ "additionalProperties": { "$ref": "#/$defs/resource" }
18
+ },
19
+ "outputs": {
20
+ "type": "object",
21
+ "additionalProperties": { "$ref": "#/$defs/output" }
22
+ }
23
+ },
24
+ "additionalProperties": true,
25
+ "$defs": {
26
+ "resource": {
27
+ "type": "object",
28
+ "required": ["type"],
29
+ "properties": {
30
+ "type": { "type": "string" },
31
+ "label": { "type": "string" },
32
+ "description": { "type": "string" },
33
+ "inputs": {
34
+ "oneOf": [
35
+ { "type": "array", "items": { "type": "string" } },
36
+ { "type": "object", "additionalProperties": { "type": "string" } }
37
+ ]
38
+ },
39
+ "from": { "type": "string" },
40
+ "value": true,
41
+ "path": { "type": "string" },
42
+ "uri": { "type": "string" },
43
+ "mime": { "type": "string" },
44
+ "identity": { "type": "string" },
45
+ "instructions": { "type": "string" },
46
+ "tools": { "type": "array", "items": { "type": "string" } },
47
+ "graph": { "type": "string" },
48
+ "entry": { "type": "string" },
49
+ "expect": true
50
+ },
51
+ "additionalProperties": true
52
+ },
53
+ "output": {
54
+ "type": "object",
55
+ "required": ["from"],
56
+ "properties": {
57
+ "from": { "type": "string" },
58
+ "type": { "type": "string" },
59
+ "mime": { "type": "string" },
60
+ "schema": true
61
+ },
62
+ "additionalProperties": true
63
+ }
64
+ }
65
+ }
package/dist/bundle.d.ts DELETED
@@ -1,32 +0,0 @@
1
- type SceneElement = {
2
- id: string;
3
- type: string;
4
- x?: number;
5
- y?: number;
6
- frameId?: string | null;
7
- containerId?: string | null;
8
- boundElements?: readonly {
9
- id: string;
10
- type: string;
11
- }[] | null;
12
- startBinding?: {
13
- elementId?: string;
14
- } | null;
15
- endBinding?: {
16
- elementId?: string;
17
- } | null;
18
- };
19
- export declare const BUNDLE_MIME = "application/vnd.circuitry.bundle+yaml";
20
- export type CircuitryBundle = {
21
- version: 1;
22
- createdAt: string;
23
- elements: SceneElement[];
24
- };
25
- export declare const createBundleFromSelection: (elements: readonly SceneElement[], selectedIds: Readonly<Record<string, true>>) => CircuitryBundle | null;
26
- export declare const stringifyBundle: (bundle: CircuitryBundle) => string;
27
- export declare const parseBundleText: (text: string) => CircuitryBundle;
28
- export declare const importBundleElements: (bundle: CircuitryBundle, opts?: {
29
- offsetX?: number;
30
- offsetY?: number;
31
- }) => SceneElement[];
32
- export {};
package/dist/host.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import type { CircuitryGraph, CircuitryRuntimeInputs, CircuitryValidationResult, CircuitryValidationStandard } from "./graph";
2
- import type { SimulationRunItem } from "./simulation";
3
- export interface CircuitryHost {
4
- readGraph(input: {
5
- filename?: string;
6
- }): Promise<{
7
- filename: string;
8
- graph: CircuitryGraph;
9
- text: string;
10
- lastRun?: any;
11
- }>;
12
- validateGraph(input: {
13
- text?: string;
14
- filename?: string;
15
- graph?: CircuitryGraph;
16
- standard?: CircuitryValidationStandard;
17
- }): Promise<CircuitryValidationResult>;
18
- writeGraph(input: {
19
- text?: string;
20
- filename?: string;
21
- graph?: CircuitryGraph;
22
- mode?: "replace";
23
- standard?: CircuitryValidationStandard;
24
- }): Promise<{
25
- filename: string;
26
- graph: CircuitryGraph;
27
- mode: "replace";
28
- }>;
29
- runGraph(input: {
30
- source?: "current" | "text";
31
- text?: string;
32
- filename?: string;
33
- selectedNodeId?: string;
34
- inputs?: CircuitryRuntimeInputs;
35
- standard?: CircuitryValidationStandard;
36
- hostModel?: string;
37
- }): Promise<{
38
- completedAt: string;
39
- runItems: SimulationRunItem[];
40
- }>;
41
- }
package/dist/node.d.ts DELETED
@@ -1,58 +0,0 @@
1
- import type { CircuitryHost } from "./host";
2
- import type { CircuitryGraph, CircuitryRuntimeInputs, CircuitryValidationStandard } from "./graph";
3
- import type { NodeExecutionRequest, NodeExecutionResult, SimulationRunItem } from "./simulation";
4
- export declare const runNodeWithPiSDK: ({ model, prompt, images, tools, }: NodeExecutionRequest) => Promise<NodeExecutionResult>;
5
- export type CircuitryResourceOrigins = Record<string, string>;
6
- export type LoadedCircuitryGraph = {
7
- filename: string;
8
- text: string;
9
- graph: CircuitryGraph;
10
- origins: CircuitryResourceOrigins;
11
- };
12
- export declare const loadCircuitryGraphFile: (filename?: string, standard?: CircuitryValidationStandard, stack?: string[]) => Promise<LoadedCircuitryGraph>;
13
- export declare class NodeCircuitryHost implements CircuitryHost {
14
- private resolveGraphFile;
15
- private runFileFor;
16
- private exists;
17
- private parseIssue;
18
- private parseSourceGraph;
19
- private parseAndResolveGraph;
20
- private readGraphFile;
21
- readGraph(input?: {
22
- filename?: string;
23
- }): Promise<{
24
- filename: string;
25
- graph: CircuitryGraph;
26
- text: string;
27
- lastRun: unknown;
28
- }>;
29
- validateGraph(input: {
30
- text?: string;
31
- filename?: string;
32
- graph?: CircuitryGraph;
33
- standard?: CircuitryValidationStandard;
34
- }): Promise<import("./graph").CircuitryValidationResult>;
35
- writeGraph(input: {
36
- text?: string;
37
- filename?: string;
38
- graph?: CircuitryGraph;
39
- mode?: "replace";
40
- standard?: CircuitryValidationStandard;
41
- }): Promise<{
42
- filename: string;
43
- graph: CircuitryGraph;
44
- mode: "replace";
45
- }>;
46
- runGraph(input?: {
47
- source?: "current" | "text";
48
- text?: string;
49
- filename?: string;
50
- selectedNodeId?: string;
51
- inputs?: CircuitryRuntimeInputs;
52
- standard?: CircuitryValidationStandard;
53
- hostModel?: string;
54
- }): Promise<{
55
- completedAt: string;
56
- runItems: SimulationRunItem[];
57
- }>;
58
- }