@guyghost/swarm-dao-product 0.2.0 → 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.
@@ -0,0 +1,22 @@
1
+ import { type ProductSubmissionResult } from "./runner.js";
2
+ /** The AI-artifact event types (the only ones the AI channel may emit). */
3
+ export declare const PRODUCT_AI_EVENT_TYPES: readonly ["AGENT_SIGNAL", "FEEDBACK_AGGREGATED", "PROPOSAL_DRAFTED"];
4
+ export type ProductAiEventType = (typeof PRODUCT_AI_EVENT_TYPES)[number];
5
+ export interface AiProductSignalInput {
6
+ runId: string;
7
+ type: ProductAiEventType;
8
+ producer: string;
9
+ payload: Readonly<Record<string, unknown>>;
10
+ evidence: readonly string[];
11
+ }
12
+ /**
13
+ * Submit an AI-source signal to a product 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 submitAiProductSignal(options: {
19
+ evidenceRoot: string;
20
+ now?: () => string;
21
+ }, signal: AiProductSignalInput): Promise<ProductSubmissionResult>;
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":"AAYA,OAAO,EAAuB,KAAK,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEhF,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,sEAAuE,CAAC;AAE3G,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,kBAAkB,CAAC;IACzB,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,qBAAqB,CACzC,OAAO,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,uBAAuB,CAAC,CAOlC"}
@@ -0,0 +1,29 @@
1
+ // ============================================================
2
+ // Swarm DAO Product Loop — 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 product 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 (producer binding is still enforced by
9
+ // validateProductSignal). Human events (REVIEW_RESOLVED,
10
+ // RETRY_VERIFICATION_AUTHORIZED, CONTACT_RELAY_AUTHORIZED, CANCEL) belong to
11
+ // the CLI human channel.
12
+ import { createProductRunner } from "./runner.js";
13
+ /** The AI-artifact event types (the only ones the AI channel may emit). */
14
+ export const PRODUCT_AI_EVENT_TYPES = ["AGENT_SIGNAL", "FEEDBACK_AGGREGATED", "PROPOSAL_DRAFTED"];
15
+ /**
16
+ * Submit an AI-source signal to a product run. The caller supplies only the
17
+ * artifact fields; this helper stamps `source: "ai"` and `occurredAt`, then
18
+ * routes through the same validation and frozen machine as every other
19
+ * submission.
20
+ */
21
+ export async function submitAiProductSignal(options, signal) {
22
+ const runner = await createProductRunner({ evidenceRoot: options.evidenceRoot, runId: signal.runId });
23
+ return runner.submit({
24
+ ...signal,
25
+ source: "ai",
26
+ occurredAt: (options.now ?? (() => new Date().toISOString()))(),
27
+ });
28
+ }
29
+ //# 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,wDAAwD;AACxD,+DAA+D;AAC/D,2EAA2E;AAC3E,2EAA2E;AAC3E,wEAAwE;AACxE,uEAAuE;AACvE,2EAA2E;AAC3E,yDAAyD;AACzD,6EAA6E;AAC7E,yBAAyB;AAEzB,OAAO,EAAE,mBAAmB,EAAgC,MAAM,aAAa,CAAC;AAEhF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,cAAc,EAAE,qBAAqB,EAAE,kBAAkB,CAAU,CAAC;AAY3G;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAqD,EACrD,MAA4B;IAE5B,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACtG,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
@@ -1,3 +1,4 @@
1
+ export * from "./ai-channel.js";
1
2
  export * from "./cli.js";
2
3
  export * from "./runner.js";
3
4
  export * from "./signal.js";
@@ -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 runs over the frozen machine in @guyghost/swarm-dao-core,
3
3
  // with strict signal validation (producer-bound authority; AI signals never
4
4
  // carry votes, approvals, retries, or cancellations).
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,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,sDAAsD;AAEtD,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,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,sDAAsD;AAEtD,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-product",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Swarm DAO product-loop executor — journal-replayed product runs (proposition, qualification, vote, execution, verification, observation) with producer-bound 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.10.2"
27
+ "@guyghost/swarm-dao-core": "^0.11.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/bun": "1.3.14",