@integrity-labs/agt-cli 0.28.810 → 0.28.812
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 +3 -3
- package/dist/{chunk-2D242AQK.js → chunk-NKFM5VY3.js} +2 -2
- package/dist/lib/manager-worker.js +2 -2
- package/dist/mcp/index.js +10 -4
- package/dist/mcp/slack-channel.js +44 -28
- package/dist/mcp/telegram-channel.js +7 -4
- package/package.json +1 -1
- /package/dist/{chunk-2D242AQK.js.map → chunk-NKFM5VY3.js.map} +0 -0
package/dist/bin/agt.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
success,
|
|
41
41
|
table,
|
|
42
42
|
warn
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-NKFM5VY3.js";
|
|
44
44
|
import {
|
|
45
45
|
getProjectDir,
|
|
46
46
|
isSessionResumeDisabled,
|
|
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
5467
5467
|
import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
|
|
5468
5468
|
import chalk18 from "chalk";
|
|
5469
5469
|
import ora16 from "ora";
|
|
5470
|
-
var cliVersion = true ? "0.28.
|
|
5470
|
+
var cliVersion = true ? "0.28.812" : "dev";
|
|
5471
5471
|
async function fetchLatestVersion() {
|
|
5472
5472
|
const host2 = getHost();
|
|
5473
5473
|
if (!host2) return null;
|
|
@@ -6658,7 +6658,7 @@ function handleError(err) {
|
|
|
6658
6658
|
}
|
|
6659
6659
|
|
|
6660
6660
|
// src/bin/agt.ts
|
|
6661
|
-
var cliVersion2 = true ? "0.28.
|
|
6661
|
+
var cliVersion2 = true ? "0.28.812" : "dev";
|
|
6662
6662
|
var program = new Command();
|
|
6663
6663
|
program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
|
|
6664
6664
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -6523,7 +6523,7 @@ function exchangeFailureKind(err) {
|
|
|
6523
6523
|
}
|
|
6524
6524
|
|
|
6525
6525
|
// src/lib/api-client.ts
|
|
6526
|
-
var agtCliVersion = true ? "0.28.
|
|
6526
|
+
var agtCliVersion = true ? "0.28.812" : "dev";
|
|
6527
6527
|
var lastConfigHash = null;
|
|
6528
6528
|
function setConfigHash(hash) {
|
|
6529
6529
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -10818,4 +10818,4 @@ export {
|
|
|
10818
10818
|
managerInstallSystemUnitCommand,
|
|
10819
10819
|
managerUninstallSystemUnitCommand
|
|
10820
10820
|
};
|
|
10821
|
-
//# sourceMappingURL=chunk-
|
|
10821
|
+
//# sourceMappingURL=chunk-NKFM5VY3.js.map
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
safeWriteJsonAtomic,
|
|
59
59
|
setConfigHash,
|
|
60
60
|
tripClass
|
|
61
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-NKFM5VY3.js";
|
|
62
62
|
import {
|
|
63
63
|
getProjectDir as getProjectDir2,
|
|
64
64
|
getReadyTasks,
|
|
@@ -13578,7 +13578,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
13578
13578
|
var lastVersionCheckAt = 0;
|
|
13579
13579
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
13580
13580
|
var lastResponsivenessProbeAt = 0;
|
|
13581
|
-
var agtCliVersion = true ? "0.28.
|
|
13581
|
+
var agtCliVersion = true ? "0.28.812" : "dev";
|
|
13582
13582
|
function resolveBrewPath(execFileSync2) {
|
|
13583
13583
|
try {
|
|
13584
13584
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
package/dist/mcp/index.js
CHANGED
|
@@ -47520,10 +47520,16 @@ server.tool(
|
|
|
47520
47520
|
)
|
|
47521
47521
|
},
|
|
47522
47522
|
async (params) => {
|
|
47523
|
-
const data = await apiPost(
|
|
47524
|
-
|
|
47525
|
-
|
|
47526
|
-
|
|
47523
|
+
const data = await apiPost(
|
|
47524
|
+
"/host/schedules/update",
|
|
47525
|
+
{
|
|
47526
|
+
agent_id: AGT_AGENT_ID,
|
|
47527
|
+
...params
|
|
47528
|
+
},
|
|
47529
|
+
false,
|
|
47530
|
+
FORWARD_TOOL_CALL_TIMEOUT_MS,
|
|
47531
|
+
"schedule_update"
|
|
47532
|
+
);
|
|
47527
47533
|
if (params.description_feedback) {
|
|
47528
47534
|
const lines = [];
|
|
47529
47535
|
lines.push(data.applied ? "\u2705 Applied schedule prompt rewrite" : "\u{1F4CB} Proposed schedule prompt rewrite (preview)");
|
|
@@ -23330,6 +23330,38 @@ ${forwarded.text}` : forwarded.text;
|
|
|
23330
23330
|
};
|
|
23331
23331
|
}
|
|
23332
23332
|
|
|
23333
|
+
// src/help-command-syntax.ts
|
|
23334
|
+
var SLACK_COMMAND_MAX_LENGTH = 32;
|
|
23335
|
+
function agentSlashCommand(base, rawCodeName) {
|
|
23336
|
+
const codeName = rawCodeName?.trim().toLowerCase();
|
|
23337
|
+
if (!codeName || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(codeName)) return base;
|
|
23338
|
+
const suffixed = `${base}-${codeName}`;
|
|
23339
|
+
return suffixed.length > SLACK_COMMAND_MAX_LENGTH ? base : suffixed;
|
|
23340
|
+
}
|
|
23341
|
+
function stripLeadingSlackMention(text) {
|
|
23342
|
+
return text.replace(/^\s*<@[^>]+>\s*/, "").trim();
|
|
23343
|
+
}
|
|
23344
|
+
function isSlackHelpCommand(text, helpSuffixed) {
|
|
23345
|
+
const stripped = stripLeadingSlackMention(text);
|
|
23346
|
+
return stripped === "/help" || stripped.startsWith("/help ") || stripped === helpSuffixed || stripped.startsWith(`${helpSuffixed} `);
|
|
23347
|
+
}
|
|
23348
|
+
function buildSlackHelpMessage(codeName, rawCodeName) {
|
|
23349
|
+
const cmd = (base) => agentSlashCommand(base, rawCodeName);
|
|
23350
|
+
return [
|
|
23351
|
+
`\u{1F916} *Available commands for \`${codeName}\`*`,
|
|
23352
|
+
"",
|
|
23353
|
+
"All commands are real Slack slash commands (autocomplete via `/`). For backward compatibility, `/help` and the restart command can also be typed as plain messages in any channel where the bot is present:",
|
|
23354
|
+
`\u2022 \`${cmd("/help")}\` (or type \`/help\`) \u2014 show this help`,
|
|
23355
|
+
`\u2022 \`${cmd("/restart")}\` \u2014 restart this agent`,
|
|
23356
|
+
`\u2022 \`${cmd("/onboard")}\` \u2014 re-run this agent's onboarding: re-interview, existing config kept (allowlisted users)`,
|
|
23357
|
+
`\u2022 \`${cmd("/resume-onboarding")}\` \u2014 resume this agent's onboarding where it left off (allowlisted users)`,
|
|
23358
|
+
`\u2022 \`${cmd("/status")}\` - full health report: model, session, uptime + per-channel and per-integration status (cached snapshot, then this channel's own live check)`,
|
|
23359
|
+
`\u2022 \`${cmd("/ping")}\` - confirm this agent's channel is connected: posts a visible pong (team + manager only)`,
|
|
23360
|
+
"\u2022 `/watch <google-doc-url> [duration]` (type it in chat) \u2014 watch a Google Doc for comments that mention me (default 2h, max 7d; auto-pauses when the window ends). In a shared channel, address me as `/watch-<my-name>`.",
|
|
23361
|
+
`\u2022 \`${cmd("/investigate")}\` \u2014 live tail of this agent's terminal pane (DM only, allowlisted users; works while the channel process is alive \u2014 a wedged host still needs SSM diagnostics)`
|
|
23362
|
+
].join("\n");
|
|
23363
|
+
}
|
|
23364
|
+
|
|
23333
23365
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js
|
|
23334
23366
|
var NEVER = Object.freeze({
|
|
23335
23367
|
status: "aborted"
|
|
@@ -43052,15 +43084,11 @@ var BOT_TOKEN = process.env.SLACK_BOT_TOKEN;
|
|
|
43052
43084
|
var APP_TOKEN = process.env.SLACK_APP_TOKEN;
|
|
43053
43085
|
var AGENT_CODE_NAME = process.env.AGT_AGENT_CODE_NAME ?? null;
|
|
43054
43086
|
var AGENT_AVATAR_URL = process.env.SLACK_AGENT_AVATAR_URL?.trim() || null;
|
|
43055
|
-
|
|
43056
|
-
|
|
43057
|
-
const codeName = AGENT_CODE_NAME?.trim().toLowerCase();
|
|
43058
|
-
if (!codeName || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(codeName)) return base;
|
|
43059
|
-
const suffixed = `${base}-${codeName}`;
|
|
43060
|
-
return suffixed.length > SLACK_COMMAND_MAX_LENGTH ? base : suffixed;
|
|
43087
|
+
function agentSlashCommand3(base) {
|
|
43088
|
+
return agentSlashCommand(base, AGENT_CODE_NAME);
|
|
43061
43089
|
}
|
|
43062
43090
|
function matchesAgentCommand(command, base) {
|
|
43063
|
-
return command === base || command ===
|
|
43091
|
+
return command === base || command === agentSlashCommand3(base);
|
|
43064
43092
|
}
|
|
43065
43093
|
var AGT_HOST = process.env.AGT_HOST ?? null;
|
|
43066
43094
|
var AGT_API_KEY = process.env.AGT_API_KEY ?? null;
|
|
@@ -45019,20 +45047,8 @@ async function postSlackMessage(body) {
|
|
|
45019
45047
|
return { ok: false, error: isTimeout ? "timeout" : err.message };
|
|
45020
45048
|
}
|
|
45021
45049
|
}
|
|
45022
|
-
function
|
|
45023
|
-
return
|
|
45024
|
-
`\u{1F916} *Available commands for \`${codeName}\`*`,
|
|
45025
|
-
"",
|
|
45026
|
-
"All commands are real Slack slash commands (autocomplete via `/`). For backward compatibility, `/help` and the restart command can also be typed as plain messages in any channel where the bot is present:",
|
|
45027
|
-
`\u2022 \`${agentSlashCommand2("/help")}\` (or type \`/help\`) \u2014 show this help`,
|
|
45028
|
-
`\u2022 \`${agentSlashCommand2("/restart")}\` \u2014 restart this agent`,
|
|
45029
|
-
`\u2022 \`${agentSlashCommand2("/onboard")}\` \u2014 re-run this agent's onboarding: re-interview, existing config kept (allowlisted users)`,
|
|
45030
|
-
`\u2022 \`${agentSlashCommand2("/resume-onboarding")}\` \u2014 resume this agent's onboarding where it left off (allowlisted users)`,
|
|
45031
|
-
`\u2022 \`${agentSlashCommand2("/status")}\` - full health report: model, session, uptime + per-channel and per-integration status (cached snapshot, then this channel's own live check)`,
|
|
45032
|
-
`\u2022 \`${agentSlashCommand2("/ping")}\` - confirm this agent's channel is connected: posts a visible pong (team + manager only)`,
|
|
45033
|
-
"\u2022 `/watch <google-doc-url> [duration]` (type it in chat) \u2014 watch a Google Doc for comments that mention me (default 2h, max 7d; auto-pauses when the window ends). In a shared channel, address me as `/watch-<my-name>`.",
|
|
45034
|
-
`\u2022 \`${agentSlashCommand2("/investigate")}\` \u2014 live tail of this agent's terminal pane (DM only, allowlisted users; works while the channel process is alive \u2014 a wedged host still needs SSM diagnostics)`
|
|
45035
|
-
].join("\n");
|
|
45050
|
+
function buildSlackHelpMessage2(codeName) {
|
|
45051
|
+
return buildSlackHelpMessage(codeName, AGENT_CODE_NAME);
|
|
45036
45052
|
}
|
|
45037
45053
|
var lastActivityAt = null;
|
|
45038
45054
|
var lastActivityKind = null;
|
|
@@ -45422,7 +45438,7 @@ async function runDebugTailLoop(opts) {
|
|
|
45422
45438
|
capturedAtLabel: last.capturedAtLabel,
|
|
45423
45439
|
status: { kind: "expired" },
|
|
45424
45440
|
// ENG-6044: advertise the renamed command in the expired header.
|
|
45425
|
-
commandName:
|
|
45441
|
+
commandName: agentSlashCommand3("/investigate")
|
|
45426
45442
|
})
|
|
45427
45443
|
);
|
|
45428
45444
|
}
|
|
@@ -45434,7 +45450,7 @@ async function handleDebugSlashCommand(payload, responseUrl) {
|
|
|
45434
45450
|
userId: payload.user_id,
|
|
45435
45451
|
allowedUsers: getEffectiveAllowedUsers()
|
|
45436
45452
|
});
|
|
45437
|
-
const investigateCmd =
|
|
45453
|
+
const investigateCmd = agentSlashCommand3("/investigate");
|
|
45438
45454
|
if (!verdict.ok) {
|
|
45439
45455
|
debugAuditLog(`denied reason=${verdict.reason} user=${payload.user_id ?? "unknown"}`);
|
|
45440
45456
|
const denialText = verdict.reason === "not-dm" ? `:warning: \`${investigateCmd}\` only works in a direct message with \`${codeName}\` \u2014 it shows the agent's raw terminal, so it stays 1:1. Open a DM with the bot and run \`${investigateCmd}\` there.` : verdict.reason === "allowlist-empty" ? `\u{1F6AB} \`${investigateCmd}\` is disabled for \`${codeName}\` \u2014 no diagnostic allowlist is configured. Because it exposes the agent's raw terminal, \`${investigateCmd}\` requires a non-empty \`SLACK_ALLOWED_USERS\` on the host (unlike the restart command, it does not open up when the allowlist is unset).` : `\u{1F6AB} \`${investigateCmd}\` denied \u2014 your Slack user isn't on the diagnostic allowlist for \`${codeName}\`. Ask whoever operates this host to add you to \`SLACK_ALLOWED_USERS\`.`;
|
|
@@ -45534,7 +45550,7 @@ async function handleSlashCommandEnvelope(payload) {
|
|
|
45534
45550
|
return;
|
|
45535
45551
|
}
|
|
45536
45552
|
if (matchesAgentCommand(command, "/help")) {
|
|
45537
|
-
await postEphemeralViaResponseUrl(responseUrl,
|
|
45553
|
+
await postEphemeralViaResponseUrl(responseUrl, buildSlackHelpMessage2(codeName), codeName);
|
|
45538
45554
|
return;
|
|
45539
45555
|
}
|
|
45540
45556
|
if (matchesAgentCommand(command, "/restart")) {
|
|
@@ -45686,7 +45702,7 @@ async function handleHelpCommand(opts) {
|
|
|
45686
45702
|
const replyThread = opts.threadTs ?? opts.ts;
|
|
45687
45703
|
const ack = await postSlackMessage({
|
|
45688
45704
|
channel: opts.channel,
|
|
45689
|
-
text:
|
|
45705
|
+
text: buildSlackHelpMessage2(codeName),
|
|
45690
45706
|
...replyThread ? { thread_ts: replyThread } : {}
|
|
45691
45707
|
});
|
|
45692
45708
|
if (!ack.ok) {
|
|
@@ -48106,10 +48122,10 @@ async function connectSocketMode() {
|
|
|
48106
48122
|
) : void 0;
|
|
48107
48123
|
const rawText = evt.text ?? "";
|
|
48108
48124
|
const strippedText = rawText.replace(/^\s*<@[^>]+>\s*/, "").trim();
|
|
48109
|
-
const restartSuffixed =
|
|
48110
|
-
const helpSuffixed =
|
|
48125
|
+
const restartSuffixed = agentSlashCommand3("/restart");
|
|
48126
|
+
const helpSuffixed = agentSlashCommand3("/help");
|
|
48111
48127
|
const isRestartCommand = strippedText === "/restart" || strippedText.startsWith("/restart ") || strippedText === restartSuffixed || strippedText.startsWith(`${restartSuffixed} `);
|
|
48112
|
-
const isHelpCommand =
|
|
48128
|
+
const isHelpCommand = isSlackHelpCommand(rawText, helpSuffixed);
|
|
48113
48129
|
const isWatchDm = evt.channel?.startsWith("D") ?? false;
|
|
48114
48130
|
const isWatchCommand = !isBot && watchArgsFromText(strippedText, AGENT_CODE_NAME, { allowBare: isWatchDm }) !== null;
|
|
48115
48131
|
const command = isBot ? void 0 : isHelpCommand ? { command: "help", authorized: true } : isWatchCommand ? { command: "watch", authorized: isRestartSenderAllowed(getEffectiveAllowedUsers(), evt.user) } : isRestartCommand ? { command: "restart", authorized: isRestartSenderAllowed(getEffectiveAllowedUsers(), evt.user) } : void 0;
|
|
@@ -30740,6 +30740,12 @@ function decideInboundAccess(input) {
|
|
|
30740
30740
|
return { kind: "admit" };
|
|
30741
30741
|
}
|
|
30742
30742
|
|
|
30743
|
+
// src/help-command-syntax.ts
|
|
30744
|
+
var TELEGRAM_HELP_SYNTAX_RE = /^\/help(?:@([A-Za-z0-9_]{1,64}))?(?:\s|$)/;
|
|
30745
|
+
function isTelegramHelpSyntax(text) {
|
|
30746
|
+
return TELEGRAM_HELP_SYNTAX_RE.test(text);
|
|
30747
|
+
}
|
|
30748
|
+
|
|
30743
30749
|
// ../core/dist/channels/governance/telegram-chat-type.js
|
|
30744
30750
|
function isTelegramPrivateChat(chatType) {
|
|
30745
30751
|
return chatType === "private";
|
|
@@ -42855,10 +42861,7 @@ async function resolveBotIdentity() {
|
|
|
42855
42861
|
return { bot_id: cachedBotId, bot_username: cachedBotUsername };
|
|
42856
42862
|
}
|
|
42857
42863
|
var RESTART_SYNTAX_RE = /^\/restart(?:@([A-Za-z0-9_]{1,64}))?(?:\s|$)/;
|
|
42858
|
-
var
|
|
42859
|
-
function isHelpSyntax(text) {
|
|
42860
|
-
return HELP_SYNTAX_RE.test(text);
|
|
42861
|
-
}
|
|
42864
|
+
var isHelpSyntax = isTelegramHelpSyntax;
|
|
42862
42865
|
var STATUS_SYNTAX_RE = /^\/status(?:@([A-Za-z0-9_]{1,64}))?(?:\s|$)/;
|
|
42863
42866
|
function isStatusSyntax(text) {
|
|
42864
42867
|
return STATUS_SYNTAX_RE.test(text);
|
package/package.json
CHANGED
|
File without changes
|