abtars 0.2.1 → 0.2.2
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/bundle/{_registry.generated-FNJOX7VV.js → _registry.generated-KYX63MGY.js} +3 -3
- package/bundle/abtars-cli.js +66 -14
- package/bundle/abtars-cli.js.map +3 -3
- package/bundle/abtars.js +109 -53
- package/bundle/abtars.js.map +3 -3
- package/bundle/{agent-registry-S2MNHQYQ.js → agent-registry-5VL5KI6U.js} +3 -3
- package/bundle/agent-registry-PIS5XJHX.js +19 -0
- package/bundle/{chunk-HCYENZAB.js → chunk-3IPMKYYH.js} +5 -5
- package/bundle/{chunk-WLAVZSVZ.js → chunk-4WKWPU6U.js} +70 -2
- package/bundle/chunk-4WKWPU6U.js.map +7 -0
- package/bundle/chunk-5WFIAUQC.js +672 -0
- package/bundle/chunk-5WFIAUQC.js.map +7 -0
- package/bundle/{chunk-2SWKJX64.js → chunk-7WFE2JI5.js} +3 -3
- package/bundle/{chunk-3X6VGRL6.js → chunk-B52YRWR6.js} +2 -1
- package/bundle/chunk-B52YRWR6.js.map +7 -0
- package/bundle/chunk-BBTQKKDO.js +258 -0
- package/bundle/chunk-BBTQKKDO.js.map +7 -0
- package/bundle/chunk-GXKJKYU4.js +1089 -0
- package/bundle/chunk-GXKJKYU4.js.map +7 -0
- package/bundle/chunk-HAS5NEK7.js +189 -0
- package/bundle/chunk-HAS5NEK7.js.map +7 -0
- package/bundle/chunk-HB54S5OY.js +4036 -0
- package/bundle/chunk-HB54S5OY.js.map +7 -0
- package/bundle/{chunk-Z4SWEFIY.js → chunk-N24ROESF.js} +4 -4
- package/bundle/chunk-N7UG4FID.js +4036 -0
- package/bundle/chunk-N7UG4FID.js.map +7 -0
- package/bundle/{chunk-MHK4UPM6.js → chunk-PKHYCNTT.js} +1 -1
- package/bundle/{chunk-QIAFGDRL.js → chunk-PUDGA4RR.js} +4 -4
- package/bundle/chunk-QSC6QZ44.js +183 -0
- package/bundle/chunk-QSC6QZ44.js.map +7 -0
- package/bundle/{chunk-KL5QRHHK.js → chunk-SMZQDMSZ.js} +1 -1
- package/bundle/{chunk-OGZXYN6E.js → chunk-VY2BUO6L.js} +64 -13
- package/bundle/chunk-VY2BUO6L.js.map +7 -0
- package/bundle/chunk-W6ELWLAR.js +143 -0
- package/bundle/chunk-W6ELWLAR.js.map +7 -0
- package/bundle/chunk-Y2XBDQP3.js +4055 -0
- package/bundle/chunk-Y2XBDQP3.js.map +7 -0
- package/bundle/chunk-YMGX6HNP.js +131 -0
- package/bundle/chunk-YMGX6HNP.js.map +7 -0
- package/bundle/{commands-AXW7L2MZ.js → commands-IGRSOSK6.js} +5 -5
- package/bundle/commands-LAWVNQTO.js +34 -0
- package/bundle/commands-RBWY7YXB.js +34 -0
- package/bundle/commands-XFZNMZN6.js +34 -0
- package/bundle/{direct-api-transport-LSAUIP5S.js → direct-api-transport-OZICXTWQ.js} +18 -2
- package/bundle/direct-api-transport-OZICXTWQ.js.map +7 -0
- package/bundle/direct-api-transport-QIWA5ES2.js +889 -0
- package/bundle/direct-api-transport-QIWA5ES2.js.map +7 -0
- package/bundle/{discord-adapter-LNWTIOUK.js → discord-adapter-JFIIVG34.js} +6 -6
- package/bundle/discord-adapter-U3FA5OTY.js +589 -0
- package/bundle/discord-adapter-U3FA5OTY.js.map +7 -0
- package/bundle/discord-adapter-W6L5KJ6T.js +589 -0
- package/bundle/discord-adapter-W6L5KJ6T.js.map +7 -0
- package/bundle/discord-adapter-WWM6ROTW.js +589 -0
- package/bundle/discord-adapter-WWM6ROTW.js.map +7 -0
- package/bundle/{install-FZT43PTH.js → install-I3CXVW52.js} +2 -2
- package/bundle/kanban-board-6Q5E5GEB.js +31 -0
- package/bundle/kanban-board-I52RHNHQ.js +31 -0
- package/bundle/kanban-board-I52RHNHQ.js.map +7 -0
- package/bundle/{message-pipeline-QX272U5X.js → message-pipeline-4CTBJ6K2.js} +5 -5
- package/bundle/message-pipeline-4CTBJ6K2.js.map +7 -0
- package/bundle/message-pipeline-4KL7OWUH.js +38 -0
- package/bundle/message-pipeline-4KL7OWUH.js.map +7 -0
- package/bundle/message-pipeline-GFKSHRFU.js +38 -0
- package/bundle/message-pipeline-GFKSHRFU.js.map +7 -0
- package/bundle/message-pipeline-TGI2WJJM.js +38 -0
- package/bundle/message-pipeline-TGI2WJJM.js.map +7 -0
- package/bundle/meta.json +784 -600
- package/bundle/{phase-transport-BSGROTHY.js → phase-transport-INFD6ELA.js} +4 -4
- package/bundle/phase-transport-INFD6ELA.js.map +7 -0
- package/bundle/phase-transport-KXFZ5BVF.js +23 -0
- package/bundle/phase-transport-KXFZ5BVF.js.map +7 -0
- package/bundle/{sleep-K7EXAFGW.js → sleep-ENFZFUJJ.js} +3 -3
- package/bundle/sleep-ENFZFUJJ.js.map +7 -0
- package/bundle/{subagent-runtime-FQAT3564.js → subagent-runtime-5AYOXOU2.js} +2 -2
- package/bundle/subagent-runtime-5AYOXOU2.js.map +7 -0
- package/bundle/subagent-runtime-VKTX6Q2M.js +13 -0
- package/bundle/subagent-runtime-VKTX6Q2M.js.map +7 -0
- package/bundle/{telegram-adapter-LXLSG4SK.js → telegram-adapter-4KI4CJPG.js} +7 -7
- package/bundle/telegram-adapter-76B4JRJJ.js +1080 -0
- package/bundle/telegram-adapter-76B4JRJJ.js.map +7 -0
- package/bundle/telegram-adapter-VZA74EMT.js +1080 -0
- package/bundle/telegram-adapter-VZA74EMT.js.map +7 -0
- package/bundle/telegram-adapter-ZO2CLU22.js +1080 -0
- package/bundle/telegram-adapter-ZO2CLU22.js.map +7 -0
- package/bundle/{tool-registry-5PXNSYOI.js → tool-registry-CG7GIS64.js} +3 -2
- package/bundle/tool-registry-CG7GIS64.js.map +7 -0
- package/bundle/tool-registry-TGNU5AMG.js +43 -0
- package/bundle/tool-registry-TGNU5AMG.js.map +7 -0
- package/install-manifest.json +4 -0
- package/package.json +2 -1
- package/scripts/abtars-daemon.service +3 -0
- package/scripts/abtars@.service +3 -0
- package/scripts/build-and-deploy.sh +40 -0
- package/bundle/chunk-3X6VGRL6.js.map +0 -7
- package/bundle/chunk-OGZXYN6E.js.map +0 -7
- package/bundle/chunk-WLAVZSVZ.js.map +0 -7
- package/bundle/direct-api-transport-LSAUIP5S.js.map +0 -7
- /package/bundle/{_registry.generated-FNJOX7VV.js.map → _registry.generated-KYX63MGY.js.map} +0 -0
- /package/bundle/{agent-registry-S2MNHQYQ.js.map → agent-registry-5VL5KI6U.js.map} +0 -0
- /package/bundle/{commands-AXW7L2MZ.js.map → agent-registry-PIS5XJHX.js.map} +0 -0
- /package/bundle/{chunk-HCYENZAB.js.map → chunk-3IPMKYYH.js.map} +0 -0
- /package/bundle/{chunk-2SWKJX64.js.map → chunk-7WFE2JI5.js.map} +0 -0
- /package/bundle/{chunk-Z4SWEFIY.js.map → chunk-N24ROESF.js.map} +0 -0
- /package/bundle/{chunk-MHK4UPM6.js.map → chunk-PKHYCNTT.js.map} +0 -0
- /package/bundle/{chunk-QIAFGDRL.js.map → chunk-PUDGA4RR.js.map} +0 -0
- /package/bundle/{chunk-KL5QRHHK.js.map → chunk-SMZQDMSZ.js.map} +0 -0
- /package/bundle/{install-FZT43PTH.js.map → commands-IGRSOSK6.js.map} +0 -0
- /package/bundle/{message-pipeline-QX272U5X.js.map → commands-LAWVNQTO.js.map} +0 -0
- /package/bundle/{phase-transport-BSGROTHY.js.map → commands-RBWY7YXB.js.map} +0 -0
- /package/bundle/{sleep-K7EXAFGW.js.map → commands-XFZNMZN6.js.map} +0 -0
- /package/bundle/{discord-adapter-LNWTIOUK.js.map → discord-adapter-JFIIVG34.js.map} +0 -0
- /package/bundle/{subagent-runtime-FQAT3564.js.map → install-I3CXVW52.js.map} +0 -0
- /package/bundle/{tool-registry-5PXNSYOI.js.map → kanban-board-6Q5E5GEB.js.map} +0 -0
- /package/bundle/{telegram-adapter-LXLSG4SK.js.map → telegram-adapter-4KI4CJPG.js.map} +0 -0
|
@@ -15901,4 +15901,4 @@ export {
|
|
|
15901
15901
|
ModelNotFoundError,
|
|
15902
15902
|
AcpTransport
|
|
15903
15903
|
};
|
|
15904
|
-
//# sourceMappingURL=chunk-
|
|
15904
|
+
//# sourceMappingURL=chunk-PKHYCNTT.js.map
|
|
@@ -48,7 +48,7 @@ var SubagentRuntime = class {
|
|
|
48
48
|
const cached = this.cache.get(agent);
|
|
49
49
|
if (cached && sessionStrategy === "fresh") {
|
|
50
50
|
await cached.transport.resetSession?.(cached.sessionKey);
|
|
51
|
-
(await import("./tool-registry-
|
|
51
|
+
(await import("./tool-registry-TGNU5AMG.js")).resetStoreCounter();
|
|
52
52
|
}
|
|
53
53
|
const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);
|
|
54
54
|
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
@@ -151,7 +151,7 @@ var SubagentRuntime = class {
|
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
153
153
|
async createAgent(agent, sessionType) {
|
|
154
|
-
const { createSubagentTransport } = await import("./agent-registry-
|
|
154
|
+
const { createSubagentTransport } = await import("./agent-registry-5VL5KI6U.js");
|
|
155
155
|
const role = AGENT_TO_ROLE[agent];
|
|
156
156
|
const mainModel = this._mainTransport && "currentModel" in this._mainTransport ? this._mainTransport.currentModel : void 0;
|
|
157
157
|
const { transport, model } = await createSubagentTransport(role, this._registry ?? void 0, mainModel);
|
|
@@ -165,7 +165,7 @@ var SubagentRuntime = class {
|
|
|
165
165
|
const sessionKey = `system:${agent}`;
|
|
166
166
|
const entry = { transport, model, sessionKey };
|
|
167
167
|
this.cache.set(agent, entry);
|
|
168
|
-
(await import("./tool-registry-
|
|
168
|
+
(await import("./tool-registry-TGNU5AMG.js")).resetStoreCounter();
|
|
169
169
|
return entry;
|
|
170
170
|
}
|
|
171
171
|
};
|
|
@@ -180,4 +180,4 @@ var AGENT_TO_ROLE = {
|
|
|
180
180
|
export {
|
|
181
181
|
SubagentRuntime
|
|
182
182
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-PUDGA4RR.js.map
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
3
|
+
import {
|
|
4
|
+
init_log_and_swallow,
|
|
5
|
+
logAndSwallow
|
|
6
|
+
} from "./chunk-CYSGXNBY.js";
|
|
7
|
+
import {
|
|
8
|
+
init_logger,
|
|
9
|
+
logInfo,
|
|
10
|
+
logWarn
|
|
11
|
+
} from "./chunk-GUTRAMK3.js";
|
|
12
|
+
|
|
13
|
+
// src/components/subagent-runtime.ts
|
|
14
|
+
init_log_and_swallow();
|
|
15
|
+
init_logger();
|
|
16
|
+
import { randomBytes } from "node:crypto";
|
|
17
|
+
var TAG = "runtime";
|
|
18
|
+
var DEFAULT_SESSION = {
|
|
19
|
+
professor: "reuse",
|
|
20
|
+
dreamy: "fresh",
|
|
21
|
+
browsie: "fresh",
|
|
22
|
+
coding: "reuse",
|
|
23
|
+
task: "fresh"
|
|
24
|
+
};
|
|
25
|
+
var DEFAULT_SPAWN_TIMEOUT_MS = 6e5;
|
|
26
|
+
var SubagentRuntime = class {
|
|
27
|
+
cache = /* @__PURE__ */ new Map();
|
|
28
|
+
activeSpawns = /* @__PURE__ */ new Map();
|
|
29
|
+
_registry = null;
|
|
30
|
+
_mainTransport = null;
|
|
31
|
+
_sessionManager = null;
|
|
32
|
+
/** Set shared model health registry (from boot ctx). */
|
|
33
|
+
setRegistry(registry) {
|
|
34
|
+
this._registry = registry;
|
|
35
|
+
}
|
|
36
|
+
/** Set main transport reference for currentModel reads. */
|
|
37
|
+
setMainTransport(transport) {
|
|
38
|
+
this._mainTransport = transport;
|
|
39
|
+
}
|
|
40
|
+
/** Set session manager for auto-spawn sub-session creation (#510). */
|
|
41
|
+
setSessionManager(mgr) {
|
|
42
|
+
this._sessionManager = mgr;
|
|
43
|
+
}
|
|
44
|
+
/** Send a prompt to a named agent and get the response. */
|
|
45
|
+
async complete(agent, prompt, opts) {
|
|
46
|
+
const sessionStrategy = opts?.session ?? DEFAULT_SESSION[agent] ?? "fresh";
|
|
47
|
+
const start = Date.now();
|
|
48
|
+
const cached = this.cache.get(agent);
|
|
49
|
+
if (cached && sessionStrategy === "fresh") {
|
|
50
|
+
await cached.transport.resetSession?.(cached.sessionKey);
|
|
51
|
+
(await import("./tool-registry-CG7GIS64.js")).resetStoreCounter();
|
|
52
|
+
}
|
|
53
|
+
const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);
|
|
54
|
+
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
55
|
+
transport.setTimeoutOverride(opts.timeoutMs);
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
const response = await transport.sendPrompt(sessionKey, prompt);
|
|
59
|
+
const elapsed = Date.now() - start;
|
|
60
|
+
logInfo(TAG, `${agent} complete: ${prompt.length}ch \u2192 ${response?.length ?? 0}ch (${elapsed}ms, ${model})`);
|
|
61
|
+
return response ?? "";
|
|
62
|
+
} catch (err) {
|
|
63
|
+
logWarn(TAG, `${agent} complete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
64
|
+
this.cache.delete(agent);
|
|
65
|
+
throw err;
|
|
66
|
+
} finally {
|
|
67
|
+
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
68
|
+
transport.setTimeoutOverride(null);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Get a persistent session handle for multi-turn callers. */
|
|
73
|
+
async session(agent) {
|
|
74
|
+
const cached = this.cache.get(agent) ?? await this.createAgent(agent);
|
|
75
|
+
return {
|
|
76
|
+
sendPrompt: (sessionKey, prompt) => cached.transport.sendPrompt(sessionKey, prompt),
|
|
77
|
+
destroy: async () => {
|
|
78
|
+
try {
|
|
79
|
+
cached.transport.destroy();
|
|
80
|
+
} catch (err) {
|
|
81
|
+
logAndSwallow("subagent_runtime", "op", err);
|
|
82
|
+
}
|
|
83
|
+
this.cache.delete(agent);
|
|
84
|
+
logInfo(TAG, `${agent} session destroyed`);
|
|
85
|
+
},
|
|
86
|
+
get isReady() {
|
|
87
|
+
return cached.transport.isReady;
|
|
88
|
+
},
|
|
89
|
+
get transport() {
|
|
90
|
+
return cached.transport;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Fire-and-forget: run complete() in background, deliver result via callback. */
|
|
95
|
+
async spawn(agent, prompt, opts) {
|
|
96
|
+
const taskId = randomBytes(4).toString("hex");
|
|
97
|
+
const abort = new AbortController();
|
|
98
|
+
this.activeSpawns.set(taskId, { abort, startedAt: Date.now() });
|
|
99
|
+
if (this._sessionManager) {
|
|
100
|
+
const typeMap = { browsie: "B", coding: "C", task: "T" };
|
|
101
|
+
const sessionType = typeMap[agent];
|
|
102
|
+
if (sessionType) this._sessionManager.createSubSession("master", "telegram", sessionType);
|
|
103
|
+
}
|
|
104
|
+
const timeoutMs = opts?.timeoutMs ?? DEFAULT_SPAWN_TIMEOUT_MS;
|
|
105
|
+
const timer = setTimeout(() => abort.abort(), timeoutMs);
|
|
106
|
+
void (async () => {
|
|
107
|
+
try {
|
|
108
|
+
const result = await this.complete(agent, prompt);
|
|
109
|
+
if (!abort.signal.aborted) opts?.onComplete?.(taskId, result);
|
|
110
|
+
} catch (err) {
|
|
111
|
+
if (!abort.signal.aborted) opts?.onError?.(taskId, err instanceof Error ? err : new Error(String(err)));
|
|
112
|
+
} finally {
|
|
113
|
+
clearTimeout(timer);
|
|
114
|
+
this.activeSpawns.delete(taskId);
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
logInfo(TAG, `${agent} spawned: taskId=${taskId}, timeout=${timeoutMs}ms`);
|
|
118
|
+
return { taskId };
|
|
119
|
+
}
|
|
120
|
+
/** Shut down all cached transports and abort active spawns. */
|
|
121
|
+
async shutdown() {
|
|
122
|
+
for (const [id, { abort }] of this.activeSpawns) {
|
|
123
|
+
abort.abort();
|
|
124
|
+
logInfo(TAG, `spawn ${id} aborted`);
|
|
125
|
+
}
|
|
126
|
+
this.activeSpawns.clear();
|
|
127
|
+
for (const [name, cached] of this.cache) {
|
|
128
|
+
try {
|
|
129
|
+
cached.transport.destroy();
|
|
130
|
+
} catch (err) {
|
|
131
|
+
logAndSwallow("subagent_runtime", "op", err);
|
|
132
|
+
}
|
|
133
|
+
logInfo(TAG, `${name} transport closed`);
|
|
134
|
+
}
|
|
135
|
+
this.cache.clear();
|
|
136
|
+
}
|
|
137
|
+
/** Active registry: list running background spawns. */
|
|
138
|
+
listActive() {
|
|
139
|
+
return [...this.activeSpawns.entries()].map(([taskId, entry]) => ({
|
|
140
|
+
taskId,
|
|
141
|
+
startedAt: entry.startedAt ?? 0
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
/** Interrupt a specific spawn by taskId. Returns true if found. */
|
|
145
|
+
interruptSpawn(taskId) {
|
|
146
|
+
const entry = this.activeSpawns.get(taskId);
|
|
147
|
+
if (!entry) return false;
|
|
148
|
+
entry.abort.abort();
|
|
149
|
+
this.activeSpawns.delete(taskId);
|
|
150
|
+
logInfo(TAG, `spawn ${taskId} interrupted`);
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
async createAgent(agent, sessionType) {
|
|
154
|
+
const { createSubagentTransport } = await import("./agent-registry-PIS5XJHX.js");
|
|
155
|
+
const role = AGENT_TO_ROLE[agent];
|
|
156
|
+
const mainModel = this._mainTransport && "currentModel" in this._mainTransport ? this._mainTransport.currentModel : void 0;
|
|
157
|
+
const { transport, model } = await createSubagentTransport(role, this._registry ?? void 0, mainModel);
|
|
158
|
+
const typeMap = { browsie: "B", coding: "C", task: "T" };
|
|
159
|
+
const resolvedType = sessionType || typeMap[agent];
|
|
160
|
+
if (resolvedType && "setSystemPrompt" in transport && typeof transport.setSystemPrompt === "function") {
|
|
161
|
+
const { buildSoulBundle } = await import("./soul-bundle-QTPWDJB2.js");
|
|
162
|
+
const bundle = buildSoulBundle(resolvedType);
|
|
163
|
+
if (bundle) transport.setSystemPrompt(bundle);
|
|
164
|
+
}
|
|
165
|
+
const sessionKey = `system:${agent}`;
|
|
166
|
+
const entry = { transport, model, sessionKey };
|
|
167
|
+
this.cache.set(agent, entry);
|
|
168
|
+
(await import("./tool-registry-CG7GIS64.js")).resetStoreCounter();
|
|
169
|
+
return entry;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var AGENT_TO_ROLE = {
|
|
173
|
+
professor: "task",
|
|
174
|
+
dreamy: "sleep",
|
|
175
|
+
browsie: "browse",
|
|
176
|
+
coding: "coding",
|
|
177
|
+
task: "task"
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export {
|
|
181
|
+
SubagentRuntime
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=chunk-QSC6QZ44.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/subagent-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * SubagentRuntime \u2014 unified LLM access for all subagents.\n * Replaces manual createSubagentTransport() calls.\n * Caches transports per agent, handles session lifecycle + fallback.\n */\n\nimport { logAndSwallow } from \"./log-and-swallow.js\";\nimport type { IKiroTransport } from \"./transport/kiro-transport.js\";\nimport { logInfo, logWarn } from \"./logger.js\";\nimport { randomBytes } from \"node:crypto\";\n\nimport type { ModelHealthRegistry } from \"./transport/model-health-registry.js\";\n\nconst TAG = \"runtime\";\n\nexport type AgentName = \"professor\" | \"dreamy\" | \"browsie\" | \"coding\" | \"task\";\n\nexport interface AgentOpts {\n /** Override default session strategy for this call. */\n session?: \"fresh\" | \"reuse\";\n /** Context passed to tool executor (userId, metadata). */\n context?: Record<string, unknown>;\n /** Override model API timeout for this call (ms). */\n timeoutMs?: number;\n /** Override session type (default: derived from agent name). */\n sessionType?: import(\"./session-manager.js\").SessionType;\n}\n\n/** Persistent transport handle for multi-turn callers. */\nexport interface AgentSession {\n sendPrompt(sessionKey: string, prompt: string, image?: { mime: string; base64: string }): Promise<string>;\n destroy(): Promise<void>;\n readonly isReady: boolean;\n /** Underlying transport \u2014 used to set sandboxPolicy for peer sessions (#678). */\n readonly transport?: IKiroTransport;\n}\n\nexport interface SpawnResult {\n taskId: string;\n}\n\nexport interface SpawnOpts {\n onComplete?: (taskId: string, result: string) => void;\n onError?: (taskId: string, error: Error) => void;\n timeoutMs?: number;\n}\n\ninterface CachedAgent {\n transport: IKiroTransport;\n model: string;\n sessionKey: string;\n}\n\nconst DEFAULT_SESSION: Record<AgentName, \"fresh\" | \"reuse\"> = {\n professor: \"reuse\",\n dreamy: \"fresh\",\n browsie: \"fresh\",\n coding: \"reuse\",\n task: \"fresh\",\n};\n\nconst DEFAULT_SPAWN_TIMEOUT_MS = 600_000; // 10 min\n\nexport class SubagentRuntime {\n private readonly cache = new Map<AgentName, CachedAgent>();\n private readonly activeSpawns = new Map<string, { abort: AbortController; startedAt: number }>();\n private _registry: ModelHealthRegistry | null = null;\n private _mainTransport: IKiroTransport | null = null;\n private _sessionManager: import(\"./session-manager.js\").SessionManager | null = null;\n\n /** Set shared model health registry (from boot ctx). */\n setRegistry(registry: ModelHealthRegistry): void { this._registry = registry; }\n\n /** Set main transport reference for currentModel reads. */\n setMainTransport(transport: IKiroTransport): void { this._mainTransport = transport; }\n\n /** Set session manager for auto-spawn sub-session creation (#510). */\n setSessionManager(mgr: import(\"./session-manager.js\").SessionManager): void { this._sessionManager = mgr; }\n\n /** Send a prompt to a named agent and get the response. */\n async complete(agent: AgentName, prompt: string, opts?: AgentOpts): Promise<string> {\n const sessionStrategy = opts?.session ?? DEFAULT_SESSION[agent] ?? \"fresh\";\n const start = Date.now();\n\n const cached = this.cache.get(agent);\n if (cached && sessionStrategy === \"fresh\") {\n await cached.transport.resetSession?.(cached.sessionKey);\n (await import(\"./transport/tool-registry.js\")).resetStoreCounter();\n }\n\n const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);\n\n // Per-call timeout override (e.g. dreamy sleep steps need longer than default)\n if (opts?.timeoutMs && transport.setTimeoutOverride) {\n transport.setTimeoutOverride(opts.timeoutMs);\n }\n\n try {\n const response = await transport.sendPrompt(sessionKey, prompt);\n const elapsed = Date.now() - start;\n logInfo(TAG, `${agent} complete: ${prompt.length}ch \u2192 ${response?.length ?? 0}ch (${elapsed}ms, ${model})`);\n return response ?? \"\";\n } catch (err) {\n logWarn(TAG, `${agent} complete failed: ${err instanceof Error ? err.message : String(err)}`);\n this.cache.delete(agent);\n throw err;\n } finally {\n if (opts?.timeoutMs && transport.setTimeoutOverride) {\n transport.setTimeoutOverride(null);\n }\n }\n }\n\n /** Get a persistent session handle for multi-turn callers. */\n async session(agent: AgentName): Promise<AgentSession> {\n const cached = this.cache.get(agent) ?? await this.createAgent(agent);\n return {\n sendPrompt: (sessionKey: string, prompt: string) => cached.transport.sendPrompt(sessionKey, prompt),\n destroy: async () => {\n try { cached.transport.destroy(); } catch (err) { logAndSwallow(\"subagent_runtime\", \"op\", err); }\n this.cache.delete(agent);\n logInfo(TAG, `${agent} session destroyed`);\n },\n get isReady() { return cached.transport.isReady; },\n get transport() { return cached.transport; },\n };\n }\n\n /** Fire-and-forget: run complete() in background, deliver result via callback. */\n async spawn(agent: AgentName, prompt: string, opts?: SpawnOpts): Promise<SpawnResult> {\n const taskId = randomBytes(4).toString(\"hex\");\n const abort = new AbortController();\n this.activeSpawns.set(taskId, { abort, startedAt: Date.now() });\n\n // Create sub-session for visibility in /session list (#510)\n if (this._sessionManager) {\n const typeMap: Partial<Record<AgentName, import(\"./session-manager.js\").SessionType>> = { browsie: \"B\", coding: \"C\", task: \"T\" };\n const sessionType = typeMap[agent];\n if (sessionType) this._sessionManager.createSubSession(\"master\", \"telegram\", sessionType);\n }\n\n const timeoutMs = opts?.timeoutMs ?? DEFAULT_SPAWN_TIMEOUT_MS;\n const timer = setTimeout(() => abort.abort(), timeoutMs);\n\n // Fire and forget \u2014 don't await\n void (async () => {\n try {\n const result = await this.complete(agent, prompt);\n if (!abort.signal.aborted) opts?.onComplete?.(taskId, result);\n } catch (err) {\n if (!abort.signal.aborted) opts?.onError?.(taskId, err instanceof Error ? err : new Error(String(err)));\n } finally {\n clearTimeout(timer);\n this.activeSpawns.delete(taskId);\n }\n })();\n\n logInfo(TAG, `${agent} spawned: taskId=${taskId}, timeout=${timeoutMs}ms`);\n return { taskId };\n }\n\n /** Shut down all cached transports and abort active spawns. */\n async shutdown(): Promise<void> {\n for (const [id, { abort }] of this.activeSpawns) {\n abort.abort();\n logInfo(TAG, `spawn ${id} aborted`);\n }\n this.activeSpawns.clear();\n\n for (const [name, cached] of this.cache) {\n try { cached.transport.destroy(); } catch (err) { logAndSwallow(\"subagent_runtime\", \"op\", err); }\n logInfo(TAG, `${name} transport closed`);\n }\n this.cache.clear();\n }\n\n /** Active registry: list running background spawns. */\n listActive(): Array<{ taskId: string; startedAt: number }> {\n return [...this.activeSpawns.entries()].map(([taskId, entry]) => ({\n taskId,\n startedAt: (entry as any).startedAt ?? 0,\n }));\n }\n\n /** Interrupt a specific spawn by taskId. Returns true if found. */\n interruptSpawn(taskId: string): boolean {\n const entry = this.activeSpawns.get(taskId);\n if (!entry) return false;\n entry.abort.abort();\n this.activeSpawns.delete(taskId);\n logInfo(TAG, `spawn ${taskId} interrupted`);\n return true;\n }\n\n private async createAgent(agent: AgentName, sessionType?: import(\"./session-manager.js\").SessionType): Promise<CachedAgent> {\n const { createSubagentTransport } = await import(\"./agent-registry.js\");\n const role = AGENT_TO_ROLE[agent];\n const mainModel = this._mainTransport && \"currentModel\" in this._mainTransport\n ? (this._mainTransport as unknown as { currentModel: string }).currentModel\n : undefined;\n const { transport, model } = await createSubagentTransport(role, this._registry ?? undefined, mainModel);\n\n // Inject session-type-appropriate SOUL bundle (#744)\n const typeMap: Partial<Record<AgentName, import(\"./session-manager.js\").SessionType>> = { browsie: \"B\", coding: \"C\", task: \"T\" };\n const resolvedType = sessionType || typeMap[agent];\n if (resolvedType && \"setSystemPrompt\" in transport && typeof (transport as any).setSystemPrompt === \"function\") {\n const { buildSoulBundle } = await import(\"./soul-bundle.js\");\n const bundle = buildSoulBundle(resolvedType);\n if (bundle) (transport as any).setSystemPrompt(bundle);\n }\n\n const sessionKey = `system:${agent}`;\n const entry: CachedAgent = { transport, model, sessionKey };\n this.cache.set(agent, entry);\n (await import(\"./transport/tool-registry.js\")).resetStoreCounter();\n return entry;\n }\n}\n\nconst AGENT_TO_ROLE: Record<AgentName, import(\"./agent-registry.js\").SubagentRole> = {\n professor: \"task\",\n dreamy: \"sleep\",\n browsie: \"browse\",\n coding: \"coding\",\n task: \"task\",\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAMA;AAEA;AACA,SAAS,mBAAmB;AAI5B,IAAM,MAAM;AAwCZ,IAAM,kBAAwD;AAAA,EAC5D,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,IAAM,2BAA2B;AAE1B,IAAM,kBAAN,MAAsB;AAAA,EACV,QAAQ,oBAAI,IAA4B;AAAA,EACxC,eAAe,oBAAI,IAA2D;AAAA,EACvF,YAAwC;AAAA,EACxC,iBAAwC;AAAA,EACxC,kBAAwE;AAAA;AAAA,EAGhF,YAAY,UAAqC;AAAE,SAAK,YAAY;AAAA,EAAU;AAAA;AAAA,EAG9E,iBAAiB,WAAiC;AAAE,SAAK,iBAAiB;AAAA,EAAW;AAAA;AAAA,EAGrF,kBAAkB,KAA0D;AAAE,SAAK,kBAAkB;AAAA,EAAK;AAAA;AAAA,EAG1G,MAAM,SAAS,OAAkB,QAAgB,MAAmC;AAClF,UAAM,kBAAk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9G,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,2BAAkB;AAC3D,YAAM,SAAS,gBAAgB,YAAY;AAC3C,UAAI,OAAQ,CAAC,UAAkB,gBAAgB,MAAM;AAAA,IACvD;AAEA,UAAM,aAAa,UAAU,KAAK;AAClC,UAAM,QAAqB,EAAE,WAAW,OAAO,WAAW;AAC1D,SAAK,MAAM,IAAI,OAAO,KAAK;AAC3B,KAAC,MAAM,OAAO,6BAA8B,GAAG,kBAAkB;AACjE,WAAO;AAAA,EACT;AACF;AAEA,IAAM,gBAA+E;AAAA,EACnF,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
import {
|
|
4
4
|
require_ws
|
|
5
5
|
} from "./chunk-NIRYBWUW.js";
|
|
6
|
+
import {
|
|
7
|
+
loadMinimalSoul,
|
|
8
|
+
loadSoulBundle
|
|
9
|
+
} from "./chunk-L33WNMCP.js";
|
|
6
10
|
import {
|
|
7
11
|
transcribeAudio
|
|
8
12
|
} from "./chunk-SA6YEFNG.js";
|
|
9
13
|
import {
|
|
10
14
|
ModelNotFoundError
|
|
11
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PKHYCNTT.js";
|
|
12
16
|
import {
|
|
13
17
|
sanitizeOutbound
|
|
14
18
|
} from "./chunk-YWZPKBO6.js";
|
|
15
|
-
import {
|
|
16
|
-
loadMinimalSoul,
|
|
17
|
-
loadSoulBundle
|
|
18
|
-
} from "./chunk-L33WNMCP.js";
|
|
19
19
|
import {
|
|
20
20
|
abmind
|
|
21
21
|
} from "./chunk-JAJ3DUQ2.js";
|
|
@@ -1750,6 +1750,10 @@ ${prompt}`;
|
|
|
1750
1750
|
const rawResponse = sessions.get(activeSessionId)?.fullMode ? response : cleanAnswer || response;
|
|
1751
1751
|
const { text: cleanedText, reactionEmoji, noReply, topics } = cleanResponse(rawResponse);
|
|
1752
1752
|
let userResponse = cleanedText;
|
|
1753
|
+
const reasoningSession = transport.getActiveSession?.();
|
|
1754
|
+
if (!reasoningSession?.showReasoning) {
|
|
1755
|
+
userResponse = userResponse.replace(/<thinking>[\s\S]*?<\/thinking>\s*/g, "");
|
|
1756
|
+
}
|
|
1753
1757
|
for (const [key, val] of Object.entries(process.env)) {
|
|
1754
1758
|
if (key.startsWith("SECRET_") && val && userResponse.includes(val)) {
|
|
1755
1759
|
userResponse = userResponse.replaceAll(val, `[REDACTED:$${key}]`);
|
|
@@ -2364,6 +2368,27 @@ Use /model quick <name> to switch.`);
|
|
|
2364
2368
|
await ctx.reply(lines.join("\n"));
|
|
2365
2369
|
return true;
|
|
2366
2370
|
}
|
|
2371
|
+
async function handleReasoning(text, ctx) {
|
|
2372
|
+
const arg = text.replace(/^\/(reasoning)\s*/i, "").trim().toLowerCase();
|
|
2373
|
+
const session = ctx.transport.getActiveSession?.();
|
|
2374
|
+
if (!session) {
|
|
2375
|
+
await ctx.reply("No active session.");
|
|
2376
|
+
return true;
|
|
2377
|
+
}
|
|
2378
|
+
if (arg === "show" || arg === "on") {
|
|
2379
|
+
session.showReasoning = true;
|
|
2380
|
+
await ctx.reply("Reasoning display: on");
|
|
2381
|
+
} else if (arg === "hide" || arg === "off") {
|
|
2382
|
+
session.showReasoning = false;
|
|
2383
|
+
await ctx.reply("Reasoning display: off");
|
|
2384
|
+
} else if (["none", "low", "medium", "high"].includes(arg)) {
|
|
2385
|
+
session.reasoningEffort = arg === "none" ? null : arg;
|
|
2386
|
+
await ctx.reply(`Reasoning effort: ${arg}`);
|
|
2387
|
+
} else {
|
|
2388
|
+
await ctx.reply(`Reasoning: effort=${session.reasoningEffort ?? "default"}, display=${session.showReasoning ? "show" : "hide"}`);
|
|
2389
|
+
}
|
|
2390
|
+
return true;
|
|
2391
|
+
}
|
|
2367
2392
|
|
|
2368
2393
|
// src/components/commands/exec-async.ts
|
|
2369
2394
|
import { execFile } from "node:child_process";
|
|
@@ -2699,9 +2724,12 @@ async function handleWhoami(_text, ctx) {
|
|
|
2699
2724
|
const user = ctx.userId ? reg.byUserId.get(ctx.userId) : void 0;
|
|
2700
2725
|
if (user) {
|
|
2701
2726
|
const clearance = CLASS_NAMES[user.maxClass] ?? `class ${user.maxClass}`;
|
|
2702
|
-
await ctx.reply(`${user.displayName ?? user.userId} (${user.role}
|
|
2727
|
+
await ctx.reply(`${user.displayName ?? user.userId} (${user.role})
|
|
2728
|
+
Clearance: ${clearance}
|
|
2729
|
+
chatId: ${ctx.chatId}`);
|
|
2703
2730
|
} else {
|
|
2704
|
-
await ctx.reply(`${ctx.userId ?? "unknown"} (unregistered)
|
|
2731
|
+
await ctx.reply(`${ctx.userId ?? "unknown"} (unregistered)
|
|
2732
|
+
chatId: ${ctx.chatId}`);
|
|
2705
2733
|
}
|
|
2706
2734
|
return true;
|
|
2707
2735
|
}
|
|
@@ -2831,7 +2859,7 @@ Ready to deploy: /update deploy`);
|
|
|
2831
2859
|
await ctx.reply(`Deploy failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2832
2860
|
}
|
|
2833
2861
|
return true;
|
|
2834
|
-
} else if (arg === "update") {
|
|
2862
|
+
} else if (arg === "update" || arg === "npm" || arg === "update npm") {
|
|
2835
2863
|
if (!isMaster) {
|
|
2836
2864
|
await ctx.reply("Requires master role.");
|
|
2837
2865
|
return true;
|
|
@@ -2896,7 +2924,7 @@ Ready to deploy: /update deploy`);
|
|
|
2896
2924
|
const { execFileSync } = await import("node:child_process");
|
|
2897
2925
|
const raw = execFileSync("npm", ["view", "abmind", "dist-tags", "--json"], { encoding: "utf-8", timeout: 5e3 });
|
|
2898
2926
|
const latest = JSON.parse(raw).alpha ?? JSON.parse(raw).latest;
|
|
2899
|
-
if (latest) lines.push(` npm latest: abmind@${latest} ${latest === pkg.version ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2927
|
+
if (latest) lines.push(` npm latest: abmind@${latest} ${latest === pkg.version || pkg.version.startsWith(latest) ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2900
2928
|
} catch {
|
|
2901
2929
|
}
|
|
2902
2930
|
} catch {
|
|
@@ -2912,7 +2940,7 @@ Ready to deploy: /update deploy`);
|
|
|
2912
2940
|
const { execFileSync } = await import("node:child_process");
|
|
2913
2941
|
const raw = execFileSync("npm", ["view", "abmind", "dist-tags", "--json"], { encoding: "utf-8", timeout: 5e3 });
|
|
2914
2942
|
const latest = JSON.parse(raw).alpha ?? JSON.parse(raw).latest;
|
|
2915
|
-
if (latest) lines.push(` npm latest: abmind@${latest} ${latest === m.version ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2943
|
+
if (latest) lines.push(` npm latest: abmind@${latest} ${latest === m.version || m.version.startsWith(latest) ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2916
2944
|
} catch {
|
|
2917
2945
|
}
|
|
2918
2946
|
} catch {
|
|
@@ -2933,7 +2961,7 @@ Ready to deploy: /update deploy`);
|
|
|
2933
2961
|
}
|
|
2934
2962
|
}
|
|
2935
2963
|
lines.push("");
|
|
2936
|
-
lines.push(" /
|
|
2964
|
+
lines.push(" /update [pull|deploy|npm] | /software rollback <version>");
|
|
2937
2965
|
await ctx.reply(lines.join("\n"));
|
|
2938
2966
|
return true;
|
|
2939
2967
|
}
|
|
@@ -3365,6 +3393,26 @@ async function handleTaskPause(text, ctx) {
|
|
|
3365
3393
|
}
|
|
3366
3394
|
return true;
|
|
3367
3395
|
}
|
|
3396
|
+
async function handleKanban(_text, ctx) {
|
|
3397
|
+
try {
|
|
3398
|
+
const { kanbanList } = await import("./kanban-board-6Q5E5GEB.js");
|
|
3399
|
+
const cards = kanbanList();
|
|
3400
|
+
if (cards.length === 0) {
|
|
3401
|
+
await ctx.reply("\u{1F4CB} Kanban board is empty.");
|
|
3402
|
+
return true;
|
|
3403
|
+
}
|
|
3404
|
+
const lines = cards.map((c) => {
|
|
3405
|
+
const icon = c.status === "delivered" ? "\u2705" : c.status === "done" ? "\u{1F4EC}" : c.status === "running" ? "\u23F3" : c.status === "failed" ? "\u274C" : "\u{1F4E5}";
|
|
3406
|
+
const due = c.due_at ? ` due:${c.due_at.slice(0, 10)}` : "";
|
|
3407
|
+
return `${icon} #${c.id} ${c.title} (${c.source}/${c.priority})${due}`;
|
|
3408
|
+
});
|
|
3409
|
+
await ctx.reply(`\u{1F4CB} Kanban Board:
|
|
3410
|
+
${lines.join("\n")}`);
|
|
3411
|
+
} catch (err) {
|
|
3412
|
+
await ctx.reply(`\u274C Failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
3413
|
+
}
|
|
3414
|
+
return true;
|
|
3415
|
+
}
|
|
3368
3416
|
|
|
3369
3417
|
// src/components/commands/handlers-admin.ts
|
|
3370
3418
|
init_log_and_swallow();
|
|
@@ -3557,7 +3605,8 @@ async function handleHelp(_text, ctx) {
|
|
|
3557
3605
|
"/restart \u2014 Restart bridge",
|
|
3558
3606
|
"/wakeup \u2014 Wake Mac from sleep",
|
|
3559
3607
|
"/sleep \u2014 Sleep status / /sleep resume / /sleep now",
|
|
3560
|
-
"/whoami \u2014 Your user info & clearance"
|
|
3608
|
+
"/whoami \u2014 Your user info & clearance",
|
|
3609
|
+
"/reasoning \u2014 Reasoning effort (low/medium/high/none) + show/hide thinking"
|
|
3561
3610
|
];
|
|
3562
3611
|
if (ctx.platform === "telegram") {
|
|
3563
3612
|
cmds.push("/full \u2014 Raw output, TTS disabled", "/short \u2014 Clean responses (default)", "/healing \u2014 Toggle self-healer on/off");
|
|
@@ -3929,11 +3978,13 @@ registerExact("/facts", handleFacts);
|
|
|
3929
3978
|
registerExact("/tasks", handleTasksList);
|
|
3930
3979
|
registerExact("/task", handleTasksList);
|
|
3931
3980
|
registerExact("/cron", handleTasksList);
|
|
3981
|
+
registerExact("/kanban", handleKanban);
|
|
3932
3982
|
registerExact("/memory", handleMemory);
|
|
3933
3983
|
registerExact("/heartbeat", handleHeartbeat);
|
|
3934
3984
|
registerExact("/models", handleModels);
|
|
3935
3985
|
registerExact("/model", handleModels);
|
|
3936
3986
|
registerExact("/change", (_, ctx) => handleModels("/model change", ctx));
|
|
3987
|
+
registerExact("/reasoning", handleReasoning);
|
|
3937
3988
|
registerExact("/emergency", handleEmergencyAlias);
|
|
3938
3989
|
registerExact("/help", handleHelp);
|
|
3939
3990
|
registerExact("/users", handleUsers);
|
|
@@ -3981,4 +4032,4 @@ export {
|
|
|
3981
4032
|
handleInboundMessage,
|
|
3982
4033
|
startSession
|
|
3983
4034
|
};
|
|
3984
|
-
//# sourceMappingURL=chunk-
|
|
4035
|
+
//# sourceMappingURL=chunk-VY2BUO6L.js.map
|