@simulacra-ai/orchestration 0.0.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.
Files changed (50) hide show
  1. package/README.md +123 -0
  2. package/dist/background-agent-pool.d.ts +56 -0
  3. package/dist/background-agent-pool.d.ts.map +1 -0
  4. package/dist/background-agent-pool.js +102 -0
  5. package/dist/background-agent-pool.js.map +1 -0
  6. package/dist/background-agent.d.ts +59 -0
  7. package/dist/background-agent.d.ts.map +1 -0
  8. package/dist/background-agent.js +135 -0
  9. package/dist/background-agent.js.map +1 -0
  10. package/dist/index.d.ts +8 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +8 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/orchestrator.d.ts +43 -0
  15. package/dist/orchestrator.d.ts.map +1 -0
  16. package/dist/orchestrator.js +124 -0
  17. package/dist/orchestrator.js.map +1 -0
  18. package/dist/parallel-agent.d.ts +17 -0
  19. package/dist/parallel-agent.d.ts.map +1 -0
  20. package/dist/parallel-agent.js +33 -0
  21. package/dist/parallel-agent.js.map +1 -0
  22. package/dist/subagent.d.ts +18 -0
  23. package/dist/subagent.d.ts.map +1 -0
  24. package/dist/subagent.js +19 -0
  25. package/dist/subagent.js.map +1 -0
  26. package/dist/tools/background-worker-pool.d.ts +16 -0
  27. package/dist/tools/background-worker-pool.d.ts.map +1 -0
  28. package/dist/tools/background-worker-pool.js +126 -0
  29. package/dist/tools/background-worker-pool.js.map +1 -0
  30. package/dist/tools/index.d.ts +9 -0
  31. package/dist/tools/index.d.ts.map +1 -0
  32. package/dist/tools/index.js +15 -0
  33. package/dist/tools/index.js.map +1 -0
  34. package/dist/tools/parallel-agent-task.d.ts +16 -0
  35. package/dist/tools/parallel-agent-task.d.ts.map +1 -0
  36. package/dist/tools/parallel-agent-task.js +68 -0
  37. package/dist/tools/parallel-agent-task.js.map +1 -0
  38. package/dist/tools/subagent-task.d.ts +14 -0
  39. package/dist/tools/subagent-task.d.ts.map +1 -0
  40. package/dist/tools/subagent-task.js +58 -0
  41. package/dist/tools/subagent-task.js.map +1 -0
  42. package/dist/tools/utils.d.ts +8 -0
  43. package/dist/tools/utils.d.ts.map +1 -0
  44. package/dist/tools/utils.js +25 -0
  45. package/dist/tools/utils.js.map +1 -0
  46. package/dist/types.d.ts +90 -0
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/types.js +2 -0
  49. package/dist/types.js.map +1 -0
  50. package/package.json +23 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACrD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YACjC,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,SAAS;QACX,CAAC;QACD,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;gBACxC,OAAO,KAAK,CAAC,IAAI,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,90 @@
1
+ import type { Message, ToolClass, Workflow } from "@simulacra-ai/core";
2
+ /**
3
+ * Configuration options for spawning a subagent.
4
+ */
5
+ export interface SubagentOptions {
6
+ /**
7
+ * The system prompt for the subagent's conversation.
8
+ */
9
+ system?: string;
10
+ /**
11
+ * The tools available to the subagent.
12
+ */
13
+ toolkit?: ToolClass[];
14
+ /**
15
+ * Whether the subagent starts with a copy of the parent's conversation history.
16
+ */
17
+ fork_session?: boolean;
18
+ /**
19
+ * A custom identifier for the subagent.
20
+ */
21
+ id?: string;
22
+ }
23
+ /**
24
+ * The result of a completed subagent execution.
25
+ */
26
+ export interface SubagentResult {
27
+ /**
28
+ * The unique identifier of the subagent.
29
+ */
30
+ id: string;
31
+ /**
32
+ * The complete message history from the subagent's conversation.
33
+ */
34
+ messages: readonly Readonly<Message>[];
35
+ /**
36
+ * The reason the subagent's execution ended.
37
+ */
38
+ end_reason: "complete" | "cancel" | "error";
39
+ }
40
+ /**
41
+ * A handle for managing a background subagent task.
42
+ */
43
+ export interface BackgroundHandle {
44
+ /**
45
+ * The unique identifier of the background task.
46
+ */
47
+ readonly id: string;
48
+ /**
49
+ * The workflow instance running the background task.
50
+ */
51
+ readonly workflow: Workflow;
52
+ /**
53
+ * A promise that resolves when the background task completes.
54
+ */
55
+ readonly promise: Promise<SubagentResult>;
56
+ /**
57
+ * Whether the background task has finished execution.
58
+ */
59
+ readonly done: boolean;
60
+ /**
61
+ * Cancels the background task.
62
+ */
63
+ cancel(): void;
64
+ }
65
+ /**
66
+ * Status snapshot of a background worker.
67
+ */
68
+ export interface WorkerState {
69
+ /**
70
+ * The unique identifier of the worker.
71
+ */
72
+ id: string;
73
+ /**
74
+ * The worker's current execution state.
75
+ */
76
+ status: "running" | "completed" | "cancelled";
77
+ /**
78
+ * Number of agentic turns (assistant messages) completed.
79
+ */
80
+ rounds: number;
81
+ /**
82
+ * Total number of tool calls made across all rounds.
83
+ */
84
+ tool_call_count: number;
85
+ /**
86
+ * The text content of the most recent assistant message, if any.
87
+ */
88
+ latest_message?: string;
89
+ }
90
+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,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@simulacra-ai/orchestration",
3
+ "version": "0.0.1",
4
+ "description": "Subagent, background, and parallel workflow orchestration for the Simulacra conversation engine",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "default": "./dist/index.js"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc -p tsconfig.json",
17
+ "clean": "rm -rf dist *.tsbuildinfo"
18
+ },
19
+ "peerDependencies": {
20
+ "@simulacra-ai/core": "0.0.1"
21
+ },
22
+ "license": "MIT"
23
+ }