@integrity-labs/agt-cli 0.28.671 → 0.28.672
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/bin/agt.js +6 -6
- package/dist/bin/agt.js.map +1 -1
- package/dist/{chunk-ZU2BHLUS.js → chunk-EX6INJDG.js} +20 -76
- package/dist/chunk-EX6INJDG.js.map +1 -0
- package/dist/{chunk-57XP5OG6.js → chunk-YAVWYI5S.js} +104 -5
- package/dist/chunk-YAVWYI5S.js.map +1 -0
- package/dist/{chunk-DWFN5PMF.js → chunk-YOID6KOQ.js} +22 -1
- package/dist/chunk-YOID6KOQ.js.map +1 -0
- package/dist/{claude-pair-runtime-ANNQRKO4.js → claude-pair-runtime-UZ2JB2KY.js} +2 -2
- package/dist/lib/manager-worker.js +52 -20
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +21 -0
- package/dist/mcp/index.js +21 -0
- package/dist/mcp/origami.js +21 -0
- package/dist/mcp/slack-channel.js +21 -0
- package/dist/mcp/telegram-channel.js +21 -0
- package/dist/{persistent-session-LTFB4M53.js → persistent-session-PYAJ4VJW.js} +3 -3
- package/dist/{responsiveness-probe-P2S3UMRE.js → responsiveness-probe-5I2LIVCA.js} +3 -3
- package/dist/{session-auth-dead-YHSQBOB4.js → session-auth-dead-NUX643UJ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-57XP5OG6.js.map +0 -1
- package/dist/chunk-DWFN5PMF.js.map +0 -1
- package/dist/chunk-ZU2BHLUS.js.map +0 -1
- /package/dist/{claude-pair-runtime-ANNQRKO4.js.map → claude-pair-runtime-UZ2JB2KY.js.map} +0 -0
- /package/dist/{persistent-session-LTFB4M53.js.map → persistent-session-PYAJ4VJW.js.map} +0 -0
- /package/dist/{responsiveness-probe-P2S3UMRE.js.map → responsiveness-probe-5I2LIVCA.js.map} +0 -0
- /package/dist/{session-auth-dead-YHSQBOB4.js.map → session-auth-dead-NUX643UJ.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
rotateDailySession,
|
|
17
17
|
sessionFileExists,
|
|
18
18
|
todayLocalIso
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YOID6KOQ.js";
|
|
20
20
|
import {
|
|
21
21
|
reapOrphanChannelMcps
|
|
22
22
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -200,6 +200,70 @@ import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync3, wr
|
|
|
200
200
|
import { homedir as homedir2 } from "os";
|
|
201
201
|
import { join as join2 } from "path";
|
|
202
202
|
|
|
203
|
+
// ../../packages/core/dist/provisioning/env-integrations-file.js
|
|
204
|
+
function shellQuote(value) {
|
|
205
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
206
|
+
}
|
|
207
|
+
var CHANNEL_SECRET_ENV_KEYS = [
|
|
208
|
+
"SLACK_BOT_TOKEN",
|
|
209
|
+
"SLACK_APP_TOKEN",
|
|
210
|
+
"TELEGRAM_BOT_TOKEN",
|
|
211
|
+
"MSTEAMS_CLIENT_SECRET"
|
|
212
|
+
];
|
|
213
|
+
var MCP_SERVER_SECRET_ENV_KEYS = [
|
|
214
|
+
"COMPOSIO_API_KEY",
|
|
215
|
+
"PIPEDREAM_CLIENT_SECRET"
|
|
216
|
+
];
|
|
217
|
+
var PRESERVED_ENV_KEYS = [
|
|
218
|
+
...CHANNEL_SECRET_ENV_KEYS,
|
|
219
|
+
...MCP_SERVER_SECRET_ENV_KEYS
|
|
220
|
+
];
|
|
221
|
+
var HEADER = "# Augmented integrations \u2014 auto-generated, do not edit";
|
|
222
|
+
function parseEnvFileEntries(content) {
|
|
223
|
+
const out = /* @__PURE__ */ new Map();
|
|
224
|
+
for (const line2 of content.split("\n")) {
|
|
225
|
+
if (!line2 || line2.startsWith("#") || !line2.includes("="))
|
|
226
|
+
continue;
|
|
227
|
+
const eqIdx = line2.indexOf("=");
|
|
228
|
+
out.set(line2.slice(0, eqIdx), line2.slice(eqIdx + 1));
|
|
229
|
+
}
|
|
230
|
+
return out;
|
|
231
|
+
}
|
|
232
|
+
function renderEnvIntegrations(entries) {
|
|
233
|
+
const lines = [HEADER];
|
|
234
|
+
for (const [key, rendered] of entries)
|
|
235
|
+
lines.push(`${key}=${rendered}`);
|
|
236
|
+
return lines.join("\n") + "\n";
|
|
237
|
+
}
|
|
238
|
+
function mergeEnvIntegrationsContent(existing, args) {
|
|
239
|
+
const current = existing === null ? /* @__PURE__ */ new Map() : parseEnvFileEntries(existing);
|
|
240
|
+
let next;
|
|
241
|
+
if (args.mode === "upsert") {
|
|
242
|
+
next = new Map(current);
|
|
243
|
+
for (const [key, raw] of Object.entries(args.updates)) {
|
|
244
|
+
if (raw === null)
|
|
245
|
+
next.delete(key);
|
|
246
|
+
else
|
|
247
|
+
next.set(key, shellQuote(raw));
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
next = /* @__PURE__ */ new Map();
|
|
251
|
+
for (const [key, raw] of Object.entries(args.updates)) {
|
|
252
|
+
if (raw !== null)
|
|
253
|
+
next.set(key, shellQuote(raw));
|
|
254
|
+
}
|
|
255
|
+
const preserve = args.preserveKeys ?? PRESERVED_ENV_KEYS;
|
|
256
|
+
for (const key of preserve) {
|
|
257
|
+
if (key in args.updates)
|
|
258
|
+
continue;
|
|
259
|
+
if (!next.has(key) && current.has(key)) {
|
|
260
|
+
next.set(key, current.get(key));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return renderEnvIntegrations(next);
|
|
265
|
+
}
|
|
266
|
+
|
|
203
267
|
// ../../packages/core/dist/provisioning/channel-env.js
|
|
204
268
|
function buildChannelCredentialEnv(channelId, config) {
|
|
205
269
|
const env = {};
|
|
@@ -242,6 +306,21 @@ function buildChannelCredentialEnv(channelId, config) {
|
|
|
242
306
|
}
|
|
243
307
|
return { env, secrets };
|
|
244
308
|
}
|
|
309
|
+
function collectChannelSpawnSecrets(channelConfigs) {
|
|
310
|
+
const allowed = new Set(CHANNEL_SECRET_ENV_KEYS);
|
|
311
|
+
const out = {};
|
|
312
|
+
for (const [channelId, entry] of Object.entries(channelConfigs ?? {})) {
|
|
313
|
+
if (!entry || !(entry.status === "active" || entry.status === "pending") || !entry.config)
|
|
314
|
+
continue;
|
|
315
|
+
const config = entry.config;
|
|
316
|
+
const { secrets } = buildChannelCredentialEnv(channelId, config);
|
|
317
|
+
for (const [key, value] of Object.entries(secrets)) {
|
|
318
|
+
if (allowed.has(key))
|
|
319
|
+
out[key] = value;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return out;
|
|
323
|
+
}
|
|
245
324
|
function peerModeEnv(prefix, config) {
|
|
246
325
|
const env = {};
|
|
247
326
|
const mode = config["peer_agent_mode"];
|
|
@@ -3018,7 +3097,7 @@ function restartEgressSidecar(codeName) {
|
|
|
3018
3097
|
}
|
|
3019
3098
|
}
|
|
3020
3099
|
function buildDockerRunCommand(args) {
|
|
3021
|
-
const { codeName, agentId, wrapperPath, projectDir, homeDir, runId, passApiKey, passOpenRouter, egress, forwardSlackReplyBinding, forwardBlockTurnEndAllMarkers, forwardKanbanWaiting, forwardNotifyDispatch, forwardTurnFailureNotice } = args;
|
|
3100
|
+
const { codeName, agentId, wrapperPath, projectDir, homeDir, runId, passApiKey, passOpenRouter, egress, forwardSlackReplyBinding, forwardBlockTurnEndAllMarkers, forwardKanbanWaiting, forwardNotifyDispatch, forwardTurnFailureNotice, forwardChannelSecrets } = args;
|
|
3022
3101
|
const q = (s) => `'${s.replace(/'/g, `'\\''`)}'`;
|
|
3023
3102
|
const agentDir2 = join6(homeDir, ".augmented", codeName);
|
|
3024
3103
|
const agentIdDir = join6(homeDir, ".augmented", agentId);
|
|
@@ -3057,6 +3136,9 @@ function buildDockerRunCommand(args) {
|
|
|
3057
3136
|
if (forwardKanbanWaiting) envArgs.push("-e AGT_KANBAN_WAITING_ENABLED");
|
|
3058
3137
|
if (forwardNotifyDispatch) envArgs.push("-e AGT_NOTIFY_DISPATCH");
|
|
3059
3138
|
if (forwardTurnFailureNotice) envArgs.push("-e AGT_WEDGE_TRANSIENT_NOTICE_ENABLED");
|
|
3139
|
+
for (const name of forwardChannelSecrets ?? []) {
|
|
3140
|
+
envArgs.push(`-e ${name}`);
|
|
3141
|
+
}
|
|
3060
3142
|
const egressImage = process.env.AGT_EGRESS_IMAGE || "agt-squid:latest";
|
|
3061
3143
|
const internalNet = `agt-net-${codeName}`;
|
|
3062
3144
|
const squidName = `agt-squid-${codeName}`;
|
|
@@ -3517,6 +3599,9 @@ function spawnSession(config, session) {
|
|
|
3517
3599
|
if (config.turnFailureNoticeEnabled && !process.env["AGT_WEDGE_TRANSIENT_NOTICE_ENABLED"]) {
|
|
3518
3600
|
tmuxSessionEnvArgs.push("-e", "AGT_WEDGE_TRANSIENT_NOTICE_ENABLED=true");
|
|
3519
3601
|
}
|
|
3602
|
+
for (const [key, value] of Object.entries(config.channelSpawnSecrets ?? {})) {
|
|
3603
|
+
tmuxSessionEnvArgs.push("-e", `${key}=${value}`);
|
|
3604
|
+
}
|
|
3520
3605
|
const sessionHomeDir = process.env.HOME?.trim() || homedir5();
|
|
3521
3606
|
let egress;
|
|
3522
3607
|
if (egressMode(codeName) === "allowlist") {
|
|
@@ -3556,7 +3641,14 @@ function spawnSession(config, session) {
|
|
|
3556
3641
|
// container boundary and the notice stays dark for exactly the isolated
|
|
3557
3642
|
// agents it was added for (CodeRabbit, PR #3907).
|
|
3558
3643
|
forwardTurnFailureNotice: !!process.env["AGT_WEDGE_TRANSIENT_NOTICE_ENABLED"] || // feature-gate-allow: registry-flag envVar operator-override precedence, not a new gate
|
|
3559
|
-
!!config.turnFailureNoticeEnabled
|
|
3644
|
+
!!config.turnFailureNoticeEnabled,
|
|
3645
|
+
// ENG-9350: name-forward this agent's channel bot-token vars into the
|
|
3646
|
+
// container (value from the session-shell env, same ps-hiding posture
|
|
3647
|
+
// as AGT_API_KEY). REQUIRED under isolation in spawn-env mode: the file
|
|
3648
|
+
// no longer carries them for the in-container wrapper to source, so
|
|
3649
|
+
// without the forward `${SLACK_BOT_TOKEN}` resolves empty and the
|
|
3650
|
+
// channel MCP dies. Empty/undef ⇒ no forwards (file-sourced as before).
|
|
3651
|
+
forwardChannelSecrets: config.channelSpawnSecrets ? Object.keys(config.channelSpawnSecrets) : void 0
|
|
3560
3652
|
}) : JSON.stringify(wrapperPath);
|
|
3561
3653
|
const tmuxEnv = buildSpawnEnv({
|
|
3562
3654
|
base: process.env,
|
|
@@ -3570,15 +3662,17 @@ function spawnSession(config, session) {
|
|
|
3570
3662
|
ANTHROPIC_MODEL: config.openRouter.model,
|
|
3571
3663
|
...config.openRouter.smallFastModel ? { ANTHROPIC_SMALL_FAST_MODEL: config.openRouter.smallFastModel } : {}
|
|
3572
3664
|
} : {};
|
|
3665
|
+
const channelSecretEnv = config.channelSpawnSecrets ?? {};
|
|
3573
3666
|
const probeBaseEnv = isolationMode(codeName) === "docker" ? {
|
|
3574
3667
|
HOME: tmuxEnv["HOME"],
|
|
3575
3668
|
...apiKeyEnv,
|
|
3576
3669
|
...openRouterEnv,
|
|
3670
|
+
...channelSecretEnv,
|
|
3577
3671
|
...config.runId ? { AGT_RUN_ID: config.runId } : {},
|
|
3578
3672
|
AGT_API_KEY: tmuxEnv["AGT_API_KEY"],
|
|
3579
3673
|
AGT_HOST: tmuxEnv["AGT_HOST"],
|
|
3580
3674
|
AGT_AGENT_ID: config.agentId
|
|
3581
|
-
} : { ...tmuxEnv, ...apiKeyEnv, ...openRouterEnv };
|
|
3675
|
+
} : { ...tmuxEnv, ...apiKeyEnv, ...openRouterEnv, ...channelSecretEnv };
|
|
3582
3676
|
for (const f of probeMcpEnvSubstitution({
|
|
3583
3677
|
mcpConfigPath,
|
|
3584
3678
|
envIntegrationsPath: join6(projectDir, ".env.integrations"),
|
|
@@ -4277,6 +4371,11 @@ export {
|
|
|
4277
4371
|
buildLiveHeaderRemoteMcpProxyEntry,
|
|
4278
4372
|
buildOAuthRemoteMcpProxyEntry,
|
|
4279
4373
|
buildNativeMcpEntry,
|
|
4374
|
+
shellQuote,
|
|
4375
|
+
CHANNEL_SECRET_ENV_KEYS,
|
|
4376
|
+
parseEnvFileEntries,
|
|
4377
|
+
mergeEnvIntegrationsContent,
|
|
4378
|
+
collectChannelSpawnSecrets,
|
|
4280
4379
|
toOpencodeModel,
|
|
4281
4380
|
mergeOpencodeConfigArtifact,
|
|
4282
4381
|
readChannelServerEnv,
|
|
@@ -4347,4 +4446,4 @@ export {
|
|
|
4347
4446
|
stopAllSessionsAndWait,
|
|
4348
4447
|
getProjectDir
|
|
4349
4448
|
};
|
|
4350
|
-
//# sourceMappingURL=chunk-
|
|
4449
|
+
//# sourceMappingURL=chunk-YAVWYI5S.js.map
|