@guyghost/swarm-dao-graph 0.2.1 → 0.3.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.
- package/dist/ai-channel.d.ts +22 -0
- package/dist/ai-channel.d.ts.map +1 -0
- package/dist/ai-channel.js +28 -0
- package/dist/ai-channel.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type GraphSubmissionResult } from "./runner.js";
|
|
2
|
+
/** The AI-artifact event types (the only ones the AI channel may emit). */
|
|
3
|
+
export declare const GRAPH_AI_EVENT_TYPES: readonly ["MODEL_DRAFTED", "IMPLEMENTATION_READY", "IMPLEMENTATION_FAILED"];
|
|
4
|
+
export type GraphAiEventType = (typeof GRAPH_AI_EVENT_TYPES)[number];
|
|
5
|
+
export interface AiGraphSignalInput {
|
|
6
|
+
runId: string;
|
|
7
|
+
type: GraphAiEventType;
|
|
8
|
+
producer: string;
|
|
9
|
+
payload: Readonly<Record<string, unknown>>;
|
|
10
|
+
evidence: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Submit an AI-source signal to a graph run. The caller supplies only the
|
|
14
|
+
* artifact fields; this helper stamps `source: "ai"` and `occurredAt`, then
|
|
15
|
+
* routes through the same validation and frozen machine as every other
|
|
16
|
+
* submission.
|
|
17
|
+
*/
|
|
18
|
+
export declare function submitAiGraphSignal(options: {
|
|
19
|
+
evidenceRoot: string;
|
|
20
|
+
now?: () => string;
|
|
21
|
+
}, signal: AiGraphSignalInput): Promise<GraphSubmissionResult>;
|
|
22
|
+
//# sourceMappingURL=ai-channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-channel.d.ts","sourceRoot":"","sources":["../src/ai-channel.ts"],"names":[],"mappings":"AAWA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,6EAA8E,CAAC;AAEhH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,qBAAqB,CAAC,CAOhC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Swarm DAO Graph Engineering — AI-channel signal submission
|
|
3
|
+
// ============================================================
|
|
4
|
+
// The single entry host adapters (MCP server, Pi adapter, …) should use to
|
|
5
|
+
// submit an AI worker's artifact to a graph run. The source is forced to
|
|
6
|
+
// "ai" HERE, inside the package — an AI-facing host can never claim the
|
|
7
|
+
// tool/system/human channel, and the event types are restricted to the
|
|
8
|
+
// AI-artifact set at the type level. Human events (MODEL_APPROVED,
|
|
9
|
+
// MODEL_REJECTED, RETRY_AUTHORIZED, CANCEL) belong to the CLI human channel;
|
|
10
|
+
// tool/system events belong to the deterministic tools.
|
|
11
|
+
import { createGraphRunner } from "./runner.js";
|
|
12
|
+
/** The AI-artifact event types (the only ones the AI channel may emit). */
|
|
13
|
+
export const GRAPH_AI_EVENT_TYPES = ["MODEL_DRAFTED", "IMPLEMENTATION_READY", "IMPLEMENTATION_FAILED"];
|
|
14
|
+
/**
|
|
15
|
+
* Submit an AI-source signal to a graph run. The caller supplies only the
|
|
16
|
+
* artifact fields; this helper stamps `source: "ai"` and `occurredAt`, then
|
|
17
|
+
* routes through the same validation and frozen machine as every other
|
|
18
|
+
* submission.
|
|
19
|
+
*/
|
|
20
|
+
export async function submitAiGraphSignal(options, signal) {
|
|
21
|
+
const runner = await createGraphRunner({ evidenceRoot: options.evidenceRoot, runId: signal.runId });
|
|
22
|
+
return runner.submit({
|
|
23
|
+
...signal,
|
|
24
|
+
source: "ai",
|
|
25
|
+
occurredAt: (options.now ?? (() => new Date().toISOString()))(),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ai-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-channel.js","sourceRoot":"","sources":["../src/ai-channel.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,+DAA+D;AAC/D,2EAA2E;AAC3E,yEAAyE;AACzE,wEAAwE;AACxE,uEAAuE;AACvE,mEAAmE;AACnE,6EAA6E;AAC7E,wDAAwD;AAExD,OAAO,EAAE,iBAAiB,EAA8B,MAAM,aAAa,CAAC;AAE5E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,CAAU,CAAC;AAYhH;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAqD,EACrD,MAA0B;IAE1B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACpG,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,MAAM;QACT,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE;KAChE,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// journal-replayed change-control runs over the frozen machine in
|
|
3
3
|
// @guyghost/swarm-dao-core, with strict signal validation (AI signals never
|
|
4
4
|
// carry authority keys; human-source events cannot be forged by tools).
|
|
5
|
+
export * from "./ai-channel.js";
|
|
5
6
|
export * from "./cli.js";
|
|
6
7
|
export * from "./runner.js";
|
|
7
8
|
export * from "./signal.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,kEAAkE;AAClE,4EAA4E;AAC5E,wEAAwE;AAExE,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,kEAAkE;AAClE,4EAA4E;AAC5E,wEAAwE;AAExE,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guyghost/swarm-dao-graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Swarm DAO Graph Engineering run executor — journal-replayed change-control runs with strict signal validation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepublishOnly": "bun run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@guyghost/swarm-dao-core": "^0.11.
|
|
27
|
+
"@guyghost/swarm-dao-core": "^0.11.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/bun": "1.3.14",
|