@polpo-ai/core 0.1.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.
Files changed (122) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapter.d.ts +61 -0
  3. package/dist/adapter.d.ts.map +1 -0
  4. package/dist/adapter.js +9 -0
  5. package/dist/adapter.js.map +1 -0
  6. package/dist/agent-manager.d.ts +36 -0
  7. package/dist/agent-manager.d.ts.map +1 -0
  8. package/dist/agent-manager.js +176 -0
  9. package/dist/agent-manager.js.map +1 -0
  10. package/dist/approval-manager.d.ts +49 -0
  11. package/dist/approval-manager.d.ts.map +1 -0
  12. package/dist/approval-manager.js +325 -0
  13. package/dist/approval-manager.js.map +1 -0
  14. package/dist/approval-store.d.ts +19 -0
  15. package/dist/approval-store.d.ts.map +1 -0
  16. package/dist/approval-store.js +2 -0
  17. package/dist/approval-store.js.map +1 -0
  18. package/dist/checkpoint-store.d.ts +20 -0
  19. package/dist/checkpoint-store.d.ts.map +1 -0
  20. package/dist/checkpoint-store.js +2 -0
  21. package/dist/checkpoint-store.js.map +1 -0
  22. package/dist/config-store.d.ts +13 -0
  23. package/dist/config-store.d.ts.map +1 -0
  24. package/dist/config-store.js +2 -0
  25. package/dist/config-store.js.map +1 -0
  26. package/dist/cron.d.ts +29 -0
  27. package/dist/cron.d.ts.map +1 -0
  28. package/dist/cron.js +105 -0
  29. package/dist/cron.js.map +1 -0
  30. package/dist/delay-store.d.ts +21 -0
  31. package/dist/delay-store.d.ts.map +1 -0
  32. package/dist/delay-store.js +2 -0
  33. package/dist/delay-store.js.map +1 -0
  34. package/dist/escalation-manager.d.ts +31 -0
  35. package/dist/escalation-manager.d.ts.map +1 -0
  36. package/dist/escalation-manager.js +281 -0
  37. package/dist/escalation-manager.js.map +1 -0
  38. package/dist/event-bus.d.ts +18 -0
  39. package/dist/event-bus.d.ts.map +1 -0
  40. package/dist/event-bus.js +2 -0
  41. package/dist/event-bus.js.map +1 -0
  42. package/dist/events.d.ts +377 -0
  43. package/dist/events.d.ts.map +1 -0
  44. package/dist/events.js +9 -0
  45. package/dist/events.js.map +1 -0
  46. package/dist/hooks.d.ts +185 -0
  47. package/dist/hooks.d.ts.map +1 -0
  48. package/dist/hooks.js +152 -0
  49. package/dist/hooks.js.map +1 -0
  50. package/dist/index.d.ts +31 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +22 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/log-store.d.ts +31 -0
  55. package/dist/log-store.d.ts.map +1 -0
  56. package/dist/log-store.js +6 -0
  57. package/dist/log-store.js.map +1 -0
  58. package/dist/memory-store.d.ts +17 -0
  59. package/dist/memory-store.d.ts.map +1 -0
  60. package/dist/memory-store.js +2 -0
  61. package/dist/memory-store.js.map +1 -0
  62. package/dist/notification-router-port.d.ts +11 -0
  63. package/dist/notification-router-port.d.ts.map +1 -0
  64. package/dist/notification-router-port.js +2 -0
  65. package/dist/notification-router-port.js.map +1 -0
  66. package/dist/notification-store.d.ts +58 -0
  67. package/dist/notification-store.d.ts.map +1 -0
  68. package/dist/notification-store.js +9 -0
  69. package/dist/notification-store.js.map +1 -0
  70. package/dist/orchestrator-context.d.ts +87 -0
  71. package/dist/orchestrator-context.d.ts.map +1 -0
  72. package/dist/orchestrator-context.js +2 -0
  73. package/dist/orchestrator-context.js.map +1 -0
  74. package/dist/peer-store.d.ts +29 -0
  75. package/dist/peer-store.d.ts.map +1 -0
  76. package/dist/peer-store.js +6 -0
  77. package/dist/peer-store.js.map +1 -0
  78. package/dist/quality-controller.d.ts +46 -0
  79. package/dist/quality-controller.d.ts.map +1 -0
  80. package/dist/quality-controller.js +373 -0
  81. package/dist/quality-controller.js.map +1 -0
  82. package/dist/run-store.d.ts +31 -0
  83. package/dist/run-store.d.ts.map +1 -0
  84. package/dist/run-store.js +2 -0
  85. package/dist/run-store.js.map +1 -0
  86. package/dist/scheduler.d.ts +35 -0
  87. package/dist/scheduler.d.ts.map +1 -0
  88. package/dist/scheduler.js +195 -0
  89. package/dist/scheduler.js.map +1 -0
  90. package/dist/schemas.d.ts +104 -0
  91. package/dist/schemas.d.ts.map +1 -0
  92. package/dist/schemas.js +200 -0
  93. package/dist/schemas.js.map +1 -0
  94. package/dist/session-store.d.ts +50 -0
  95. package/dist/session-store.d.ts.map +1 -0
  96. package/dist/session-store.js +6 -0
  97. package/dist/session-store.js.map +1 -0
  98. package/dist/sla-monitor.d.ts +30 -0
  99. package/dist/sla-monitor.d.ts.map +1 -0
  100. package/dist/sla-monitor.js +156 -0
  101. package/dist/sla-monitor.js.map +1 -0
  102. package/dist/state-machine.d.ts +8 -0
  103. package/dist/state-machine.d.ts.map +1 -0
  104. package/dist/state-machine.js +23 -0
  105. package/dist/state-machine.js.map +1 -0
  106. package/dist/task-manager.d.ts +38 -0
  107. package/dist/task-manager.d.ts.map +1 -0
  108. package/dist/task-manager.js +308 -0
  109. package/dist/task-manager.js.map +1 -0
  110. package/dist/task-store.d.ts +33 -0
  111. package/dist/task-store.d.ts.map +1 -0
  112. package/dist/task-store.js +2 -0
  113. package/dist/task-store.js.map +1 -0
  114. package/dist/task-watcher.d.ts +38 -0
  115. package/dist/task-watcher.d.ts.map +1 -0
  116. package/dist/task-watcher.js +103 -0
  117. package/dist/task-watcher.js.map +1 -0
  118. package/dist/types.d.ts +1073 -0
  119. package/dist/types.d.ts.map +1 -0
  120. package/dist/types.js +35 -0
  121. package/dist/types.js.map +1 -0
  122. package/package.json +170 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenPolpo Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Agent adapter type definitions.
3
+ * Pure interfaces — no runtime dependencies.
4
+ *
5
+ * SpawnContext uses generic types for vault/whatsapp to avoid
6
+ * coupling @polpo-ai/core to specific runtime implementations.
7
+ */
8
+ import type { AgentActivity, TaskResult, TaskOutcome, ReasoningLevel } from "./types.js";
9
+ /**
10
+ * Handle returned by the engine after spawning an agent.
11
+ * The orchestrator uses this to monitor and control the agent.
12
+ */
13
+ export interface AgentHandle {
14
+ /** Agent name from config */
15
+ agentName: string;
16
+ /** Task ID this handle is working on */
17
+ taskId: string;
18
+ /** When the agent was started */
19
+ startedAt: string;
20
+ /** Process ID (0 when running in-process) */
21
+ pid: number;
22
+ /** Session ID — for reading conversation transcripts */
23
+ sessionId?: string;
24
+ /** Live activity data — updated in place by the engine */
25
+ activity: AgentActivity;
26
+ /** Resolves when the agent finishes (success or failure) */
27
+ done: Promise<TaskResult>;
28
+ /** Check if the agent is still running */
29
+ isAlive(): boolean;
30
+ /** Kill the agent process */
31
+ kill(): void;
32
+ /**
33
+ * Transcript callback — set by the runner to persist every agent message.
34
+ * The engine calls this for each message/event (assistant text, tool use, tool result, etc.)
35
+ */
36
+ onTranscript?: (entry: Record<string, unknown>) => void;
37
+ /**
38
+ * Auto-collected outcomes from tool executions.
39
+ * Populated by the engine when tools produce files, media, or other artifacts.
40
+ * The runner reads this after completion and stores them on the run record.
41
+ */
42
+ outcomes?: TaskOutcome[];
43
+ }
44
+ /** Extra context passed to the engine at spawn time. */
45
+ export interface SpawnContext {
46
+ /** Absolute path to the .polpo directory. Used for skill loading, logs, etc. */
47
+ polpoDir: string;
48
+ /** Per-task output directory (.polpo/output/<taskId>/). Agents write deliverables here. */
49
+ outputDir?: string;
50
+ /** Email domain allowlist — restricts email_send tool to these domains. */
51
+ emailAllowedDomains?: string[];
52
+ /** Global reasoning level from settings — used as fallback when agent doesn't specify one. */
53
+ reasoning?: ReasoningLevel;
54
+ /** Encrypted vault store — runtime-specific, provided by the shell layer. */
55
+ vaultStore?: unknown;
56
+ /** WhatsApp message store — runtime-specific, provided by the shell layer. */
57
+ whatsappStore?: unknown;
58
+ /** WhatsApp send function — runtime-specific, provided by the shell layer. */
59
+ whatsappSendMessage?: (jid: string, text: string) => Promise<string | undefined>;
60
+ }
61
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,EAAE,aAAa,CAAC;IACxB,4DAA4D;IAC5D,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1B,0CAA0C;IAC1C,OAAO,IAAI,OAAO,CAAC;IACnB,6BAA6B;IAC7B,IAAI,IAAI,IAAI,CAAC;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACxD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAC3B,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,8FAA8F;IAC9F,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAClF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Agent adapter type definitions.
3
+ * Pure interfaces — no runtime dependencies.
4
+ *
5
+ * SpawnContext uses generic types for vault/whatsapp to avoid
6
+ * coupling @polpo-ai/core to specific runtime implementations.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,36 @@
1
+ import type { OrchestratorContext } from "./orchestrator-context.js";
2
+ import type { AgentConfig, Team } from "./types.js";
3
+ /**
4
+ * Manages multi-team agent topology: CRUD operations on teams and agents,
5
+ * volatile (mission-tied) agents, and config persistence.
6
+ */
7
+ export declare class AgentManager {
8
+ private ctx;
9
+ constructor(ctx: OrchestratorContext);
10
+ /**
11
+ * Persist the current teams to polpo.json, excluding volatile agents.
12
+ * Merges into the existing file config to preserve providers/settings
13
+ * that may have been edited outside the runtime.
14
+ */
15
+ private persistConfig;
16
+ /** Returns true if a team had ONLY volatile agents (should not be persisted). */
17
+ private isVolatileOnlyTeam;
18
+ getTeams(): Team[];
19
+ getTeam(name?: string): Team | undefined;
20
+ /** Get the default (first) team, creating one if none exist. */
21
+ getDefaultTeam(): Team;
22
+ addTeam(team: Team): Promise<void>;
23
+ removeTeam(name: string): Promise<boolean>;
24
+ renameTeam(oldName: string, newName: string): Promise<void>;
25
+ /** Get ALL agents across all teams (flattened). */
26
+ getAgents(): AgentConfig[];
27
+ /** Find an agent by name across all teams. */
28
+ findAgent(name: string): AgentConfig | undefined;
29
+ /** Find which team an agent belongs to. */
30
+ findAgentTeam(name: string): Team | undefined;
31
+ addAgent(agent: AgentConfig, teamName?: string): Promise<void>;
32
+ removeAgent(name: string): Promise<boolean>;
33
+ addVolatileAgent(agent: AgentConfig, group: string): Promise<void>;
34
+ cleanupVolatileAgents(group: string): Promise<number>;
35
+ }
36
+ //# sourceMappingURL=agent-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-manager.d.ts","sourceRoot":"","sources":["../src/agent-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGpD;;;GAGG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,mBAAmB;IAE5C;;;;OAIG;YACW,aAAa;IAc3B,iFAAiF;IACjF,OAAO,CAAC,kBAAkB;IAQ1B,QAAQ,IAAI,IAAI,EAAE;IAIlB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAMxC,gEAAgE;IAChE,cAAc,IAAI,IAAI;IAShB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAc1C,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAejE,mDAAmD;IACnD,SAAS,IAAI,WAAW,EAAE;IAI1B,8CAA8C;IAC9C,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIhD,2CAA2C;IAC3C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIvC,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB9D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB3C,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAclE,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAc5D"}
@@ -0,0 +1,176 @@
1
+ import { getAllAgents, findAgent, findAgentTeam } from "./types.js";
2
+ /**
3
+ * Manages multi-team agent topology: CRUD operations on teams and agents,
4
+ * volatile (mission-tied) agents, and config persistence.
5
+ */
6
+ export class AgentManager {
7
+ ctx;
8
+ constructor(ctx) {
9
+ this.ctx = ctx;
10
+ }
11
+ /**
12
+ * Persist the current teams to polpo.json, excluding volatile agents.
13
+ * Merges into the existing file config to preserve providers/settings
14
+ * that may have been edited outside the runtime.
15
+ */
16
+ async persistConfig() {
17
+ if (!this.ctx.loadConfig || !this.ctx.saveConfig)
18
+ return;
19
+ const existing = this.ctx.loadConfig();
20
+ if (!existing)
21
+ return; // no polpo.json to update (e.g. headless / test mode)
22
+ // Strip volatile agents from each team; drop empty teams that only had volatile agents
23
+ existing.teams = this.ctx.config.teams.map(t => ({
24
+ ...t,
25
+ agents: t.agents.filter(a => !a.volatile),
26
+ })).filter(t => t.agents.length > 0 || !this.isVolatileOnlyTeam(t.name));
27
+ this.ctx.saveConfig(existing);
28
+ }
29
+ /** Returns true if a team had ONLY volatile agents (should not be persisted). */
30
+ isVolatileOnlyTeam(teamName) {
31
+ const team = this.ctx.config.teams.find(t => t.name === teamName);
32
+ if (!team)
33
+ return false;
34
+ return team.agents.length > 0 && team.agents.every(a => a.volatile);
35
+ }
36
+ // ── Team-level operations ──
37
+ getTeams() {
38
+ return this.ctx.config?.teams ?? [];
39
+ }
40
+ getTeam(name) {
41
+ if (!this.ctx.config)
42
+ return undefined;
43
+ if (!name)
44
+ return this.ctx.config.teams[0];
45
+ return this.ctx.config.teams.find(t => t.name === name);
46
+ }
47
+ /** Get the default (first) team, creating one if none exist. */
48
+ getDefaultTeam() {
49
+ if (!this.ctx.config)
50
+ return { name: "default", agents: [] };
51
+ if (this.ctx.config.teams.length === 0) {
52
+ const team = { name: "default", agents: [] };
53
+ this.ctx.config.teams.push(team);
54
+ }
55
+ return this.ctx.config.teams[0];
56
+ }
57
+ async addTeam(team) {
58
+ if (!this.ctx.config)
59
+ throw new Error("Orchestrator not initialized");
60
+ const existing = this.ctx.config.teams.find(t => t.name === team.name);
61
+ if (existing)
62
+ throw new Error(`Team "${team.name}" already exists`);
63
+ this.ctx.config.teams.push(team);
64
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
65
+ await this.persistConfig();
66
+ this.ctx.emitter.emit("log", { level: "info", message: `Team added: ${team.name}` });
67
+ }
68
+ async removeTeam(name) {
69
+ if (!this.ctx.config)
70
+ throw new Error("Orchestrator not initialized");
71
+ const idx = this.ctx.config.teams.findIndex(t => t.name === name);
72
+ if (idx < 0)
73
+ return false;
74
+ if (this.ctx.config.teams.length === 1) {
75
+ throw new Error("Cannot remove the last team");
76
+ }
77
+ this.ctx.config.teams.splice(idx, 1);
78
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
79
+ await this.persistConfig();
80
+ this.ctx.emitter.emit("log", { level: "info", message: `Team removed: ${name}` });
81
+ return true;
82
+ }
83
+ async renameTeam(oldName, newName) {
84
+ if (!this.ctx.config)
85
+ throw new Error("Orchestrator not initialized");
86
+ const team = this.ctx.config.teams.find(t => t.name === oldName);
87
+ if (!team)
88
+ throw new Error(`Team "${oldName}" not found`);
89
+ if (this.ctx.config.teams.some(t => t.name === newName)) {
90
+ throw new Error(`Team "${newName}" already exists`);
91
+ }
92
+ team.name = newName;
93
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
94
+ await this.persistConfig();
95
+ this.ctx.emitter.emit("log", { level: "info", message: `Team renamed: "${oldName}" → "${newName}"` });
96
+ }
97
+ // ── Agent-level operations ──
98
+ /** Get ALL agents across all teams (flattened). */
99
+ getAgents() {
100
+ return getAllAgents(this.ctx.config?.teams ?? []);
101
+ }
102
+ /** Find an agent by name across all teams. */
103
+ findAgent(name) {
104
+ return findAgent(this.ctx.config?.teams ?? [], name);
105
+ }
106
+ /** Find which team an agent belongs to. */
107
+ findAgentTeam(name) {
108
+ return findAgentTeam(this.ctx.config?.teams ?? [], name);
109
+ }
110
+ async addAgent(agent, teamName) {
111
+ if (!this.ctx.config)
112
+ throw new Error("Orchestrator not initialized");
113
+ // Globally unique names across all teams
114
+ const existing = this.findAgent(agent.name);
115
+ if (existing)
116
+ throw new Error(`Agent "${agent.name}" already exists`);
117
+ const team = teamName
118
+ ? this.ctx.config.teams.find(t => t.name === teamName)
119
+ : this.getDefaultTeam();
120
+ if (!team)
121
+ throw new Error(`Team "${teamName}" not found`);
122
+ if (!agent.createdAt)
123
+ agent.createdAt = new Date().toISOString();
124
+ team.agents.push(agent);
125
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
126
+ if (!agent.volatile)
127
+ await this.persistConfig();
128
+ this.ctx.emitter.emit("log", { level: "info", message: `Agent added: ${agent.name} (team: ${team.name})` });
129
+ }
130
+ async removeAgent(name) {
131
+ if (!this.ctx.config)
132
+ throw new Error("Orchestrator not initialized");
133
+ for (const team of this.ctx.config.teams) {
134
+ const idx = team.agents.findIndex(a => a.name === name);
135
+ if (idx >= 0) {
136
+ const wasVolatile = team.agents[idx].volatile;
137
+ team.agents.splice(idx, 1);
138
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
139
+ if (!wasVolatile)
140
+ await this.persistConfig();
141
+ this.ctx.emitter.emit("log", { level: "info", message: `Agent removed: ${name} (team: ${team.name})` });
142
+ return true;
143
+ }
144
+ }
145
+ return false;
146
+ }
147
+ async addVolatileAgent(agent, group) {
148
+ if (!this.ctx.config)
149
+ throw new Error("Orchestrator not initialized");
150
+ const existing = this.findAgent(agent.name);
151
+ if (existing)
152
+ return;
153
+ // Volatile agents go to the default (first) team
154
+ const team = this.getDefaultTeam();
155
+ const volatileAgent = { ...agent, volatile: true, missionGroup: group, createdAt: agent.createdAt ?? new Date().toISOString() };
156
+ team.agents.push(volatileAgent);
157
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
158
+ this.ctx.emitter.emit("log", { level: "info", message: `Volatile agent added: ${agent.name} for ${group}` });
159
+ }
160
+ async cleanupVolatileAgents(group) {
161
+ if (!this.ctx.config)
162
+ return 0;
163
+ let removed = 0;
164
+ for (const team of this.ctx.config.teams) {
165
+ const before = team.agents.length;
166
+ team.agents = team.agents.filter(a => !(a.volatile && a.missionGroup === group));
167
+ removed += before - team.agents.length;
168
+ }
169
+ if (removed > 0) {
170
+ await this.ctx.registry.setState({ teams: this.ctx.config.teams });
171
+ this.ctx.emitter.emit("log", { level: "debug", message: `Cleaned up ${removed} volatile agent(s) from ${group}` });
172
+ }
173
+ return removed;
174
+ }
175
+ }
176
+ //# sourceMappingURL=agent-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-manager.js","sourceRoot":"","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AAK,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,KAAK,CAAC,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/G,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,KAAa;QACvC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM;YAAE,OAAO,CAAC,CAAC;QAC/B,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC;YACjF,OAAO,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACnE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,OAAO,2BAA2B,KAAK,EAAE,EAAE,CAAC,CAAC;QACrH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,49 @@
1
+ import type { OrchestratorContext } from "./orchestrator-context.js";
2
+ import type { ApprovalStore } from "./approval-store.js";
3
+ import type { ApprovalRequest, ApprovalStatus } from "./types.js";
4
+ import type { NotificationRouterPort } from "./notification-router-port.js";
5
+ /**
6
+ * Manages approval gates — both automatic (condition-based) and human (blocking).
7
+ *
8
+ * Automatic gates evaluate a condition against the hook payload and either
9
+ * allow or block the operation immediately.
10
+ *
11
+ * Human gates pause the operation (task enters "awaiting_approval"),
12
+ * emit a notification event, and wait for external resolution (API call,
13
+ * TUI action, or timeout).
14
+ */
15
+ export declare class ApprovalManager {
16
+ private ctx;
17
+ private store;
18
+ private timers;
19
+ private notificationRouter?;
20
+ private registeredGateRules;
21
+ constructor(ctx: OrchestratorContext, store: ApprovalStore);
22
+ /** Wire the notification router so per-gate notifyChannels work. */
23
+ setNotificationRouter(router: NotificationRouterPort): void;
24
+ /** Initialize: register hooks for all configured approval gates. */
25
+ init(): Promise<void>;
26
+ private ensureGateNotificationRules;
27
+ private registerGate;
28
+ private createRequest;
29
+ approve(requestId: string, resolvedBy?: string, note?: string): Promise<ApprovalRequest | null>;
30
+ reject(requestId: string, feedback: string, resolvedBy?: string): Promise<ApprovalRequest | null>;
31
+ canReject(requestId: string): Promise<{
32
+ allowed: boolean;
33
+ rejectionCount: number;
34
+ maxRejections: number;
35
+ }>;
36
+ private resolve;
37
+ private resolveTimeout;
38
+ getPending(): Promise<ApprovalRequest[]>;
39
+ getAll(status?: ApprovalStatus): Promise<ApprovalRequest[]>;
40
+ getRequest(id: string): Promise<ApprovalRequest | undefined>;
41
+ private startTimer;
42
+ private clearTimer;
43
+ private evaluateCondition;
44
+ private isRecord;
45
+ private extractTaskId;
46
+ private extractMissionId;
47
+ dispose(): void;
48
+ }
49
+ //# sourceMappingURL=approval-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-manager.d.ts","sourceRoot":"","sources":["../src/approval-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAgB,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE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