@integrity-labs/agt-cli 0.28.347 → 0.28.348
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-CD3HY46A.js → chunk-3ME4JXUG.js} +2 -2
- package/dist/lib/manager-worker.js +2 -2
- package/dist/mcp/augmented-admin.js +5 -5
- package/dist/mcp/direct-chat-channel.js +42 -2
- package/package.json +1 -1
- /package/dist/{chunk-CD3HY46A.js.map → chunk-3ME4JXUG.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-3ME4JXUG.js";
|
|
44
44
|
import {
|
|
45
45
|
AnchorSessionClient,
|
|
46
46
|
CHANNEL_REGISTRY,
|
|
@@ -4829,7 +4829,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4829
4829
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4830
4830
|
import chalk18 from "chalk";
|
|
4831
4831
|
import ora16 from "ora";
|
|
4832
|
-
var cliVersion = true ? "0.28.
|
|
4832
|
+
var cliVersion = true ? "0.28.348" : "dev";
|
|
4833
4833
|
async function fetchLatestVersion() {
|
|
4834
4834
|
const host2 = getHost();
|
|
4835
4835
|
if (!host2) return null;
|
|
@@ -6001,7 +6001,7 @@ function handleError(err) {
|
|
|
6001
6001
|
}
|
|
6002
6002
|
|
|
6003
6003
|
// src/bin/agt.ts
|
|
6004
|
-
var cliVersion2 = true ? "0.28.
|
|
6004
|
+
var cliVersion2 = true ? "0.28.348" : "dev";
|
|
6005
6005
|
var program = new Command();
|
|
6006
6006
|
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");
|
|
6007
6007
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -7107,7 +7107,7 @@ function requireHost() {
|
|
|
7107
7107
|
}
|
|
7108
7108
|
|
|
7109
7109
|
// src/lib/api-client.ts
|
|
7110
|
-
var agtCliVersion = true ? "0.28.
|
|
7110
|
+
var agtCliVersion = true ? "0.28.348" : "dev";
|
|
7111
7111
|
var lastConfigHash = null;
|
|
7112
7112
|
function setConfigHash(hash) {
|
|
7113
7113
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -9556,4 +9556,4 @@ export {
|
|
|
9556
9556
|
managerInstallSystemUnitCommand,
|
|
9557
9557
|
managerUninstallSystemUnitCommand
|
|
9558
9558
|
};
|
|
9559
|
-
//# sourceMappingURL=chunk-
|
|
9559
|
+
//# sourceMappingURL=chunk-3ME4JXUG.js.map
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
resolveEffectivePinRaw,
|
|
47
47
|
safeWriteJsonAtomic,
|
|
48
48
|
setConfigHash
|
|
49
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-3ME4JXUG.js";
|
|
50
50
|
import {
|
|
51
51
|
getProjectDir as getProjectDir2,
|
|
52
52
|
getReadyTasks,
|
|
@@ -9303,7 +9303,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
9303
9303
|
var lastVersionCheckAt = 0;
|
|
9304
9304
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
9305
9305
|
var lastResponsivenessProbeAt = 0;
|
|
9306
|
-
var agtCliVersion = true ? "0.28.
|
|
9306
|
+
var agtCliVersion = true ? "0.28.348" : "dev";
|
|
9307
9307
|
function resolveBrewPath(execFileSync2) {
|
|
9308
9308
|
try {
|
|
9309
9309
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -21331,8 +21331,8 @@ var tailLogsSchema = external_exports.object({
|
|
|
21331
21331
|
agent_id: external_exports.string().min(1).max(64).describe(
|
|
21332
21332
|
"UUID of the agent whose host log to tail. Fails closed (uniform not-found) if you are not authorized for its org."
|
|
21333
21333
|
),
|
|
21334
|
-
log: external_exports.enum(["manager", "pane", "slack-stderr", "telegram-stderr", "manager-state"]).optional().describe(
|
|
21335
|
-
`Which host log to read (default manager). manager = manager.log (lifecycle / respawn / wedge lines); pane = pane.log (the tmux pane \u2014 the agent's visible I/O, what it was "actually doing"); slack-stderr / telegram-stderr = that channel MCP's stderr (crash diagnosis); manager-state = manager-state.json (current per-agent state snapshot).`
|
|
21334
|
+
log: external_exports.enum(["manager", "pane", "slack-stderr", "telegram-stderr", "direct-chat-stderr", "manager-state"]).optional().describe(
|
|
21335
|
+
`Which host log to read (default manager). manager = manager.log (lifecycle / respawn / wedge lines); pane = pane.log (the tmux pane \u2014 the agent's visible I/O, what it was "actually doing"); slack-stderr / telegram-stderr / direct-chat-stderr = that channel MCP's stderr (crash diagnosis, e.g. attachment-download 400s); manager-state = manager-state.json (current per-agent state snapshot).`
|
|
21336
21336
|
),
|
|
21337
21337
|
lines: external_exports.number().int().min(1).max(2e3).optional().describe(
|
|
21338
21338
|
"Trailing lines to return (default 200, max 2000). Output is also byte-capped (~20 KB, newest kept) to stay within SSM limits \u2014 `truncated` flags when it clipped."
|
|
@@ -21342,7 +21342,7 @@ var queryLogsSchema = external_exports.object({
|
|
|
21342
21342
|
agent_id: external_exports.string().min(1).max(64).describe(
|
|
21343
21343
|
"UUID of the agent whose host log to query. Fails closed (uniform not-found) if you are not authorized for its org."
|
|
21344
21344
|
),
|
|
21345
|
-
log: external_exports.enum(["manager", "pane", "slack-stderr", "telegram-stderr", "manager-state"]).optional().describe(
|
|
21345
|
+
log: external_exports.enum(["manager", "pane", "slack-stderr", "telegram-stderr", "direct-chat-stderr", "manager-state"]).optional().describe(
|
|
21346
21346
|
"Which host log to read (default manager). Same allowlist as debug_tail_logs. Time filtering only applies to `manager` (its lines carry an ISO8601 prefix); the others return their byte-capped tail unfiltered (`time_filtered:false`)."
|
|
21347
21347
|
),
|
|
21348
21348
|
since: external_exports.string().min(1).max(40).optional().describe(
|
|
@@ -21667,7 +21667,7 @@ server.tool(
|
|
|
21667
21667
|
);
|
|
21668
21668
|
server.tool(
|
|
21669
21669
|
"debug_tail_logs",
|
|
21670
|
-
"Live-tail an agent's HOST logs over SSM to ground-truth \"what was it actually doing?\" \u2014 the host-reaching read, used after debug_get_agent points at a sick agent. Resolves the agent's current host and returns the trailing lines of ONE allowlisted operational log: { agent_id, code_name, host, log, content (the tail), log_present, lines_requested, truncated, ssm_status }. Logs: `manager` (manager.log \u2014 respawn/wedge/lifecycle), `pane` (pane.log \u2014 the tmux pane, the agent's visible I/O, e.g. a stuck AskUserQuestion), `slack-stderr`/`telegram-stderr` (a channel MCP's crash output), `manager-state` (manager-state.json). Fails closed for an unauthorized org. Only operational logs are reachable \u2014 secret files (.mcp.json, .env.integrations) are NOT. Pass { agent_id, log?, lines? } (lines default 200, max 2000; output ~20 KB-capped, newest kept). Every call is audited as a cross-org host access.",
|
|
21670
|
+
"Live-tail an agent's HOST logs over SSM to ground-truth \"what was it actually doing?\" \u2014 the host-reaching read, used after debug_get_agent points at a sick agent. Resolves the agent's current host and returns the trailing lines of ONE allowlisted operational log: { agent_id, code_name, host, log, content (the tail), log_present, lines_requested, truncated, ssm_status }. Logs: `manager` (manager.log \u2014 respawn/wedge/lifecycle), `pane` (pane.log \u2014 the tmux pane, the agent's visible I/O, e.g. a stuck AskUserQuestion), `slack-stderr`/`telegram-stderr`/`direct-chat-stderr` (a channel MCP's crash output, e.g. attachment-download 400s), `manager-state` (manager-state.json). Fails closed for an unauthorized org. Only operational logs are reachable \u2014 secret files (.mcp.json, .env.integrations) are NOT. Pass { agent_id, log?, lines? } (lines default 200, max 2000; output ~20 KB-capped, newest kept). Every call is audited as a cross-org host access.",
|
|
21671
21671
|
tailLogsSchema.shape,
|
|
21672
21672
|
async (args) => {
|
|
21673
21673
|
try {
|
|
@@ -21680,7 +21680,7 @@ server.tool(
|
|
|
21680
21680
|
);
|
|
21681
21681
|
server.tool(
|
|
21682
21682
|
"debug_query_logs",
|
|
21683
|
-
'Read an agent\'s HOST logs OVER A TIME WINDOW, spanning rotated files \u2014 the historical counterpart to debug_tail_logs. Where tail only shows the live tail of the current file (minutes, and gone once it rotates), this reads the active log AND its logrotate siblings (manager.log.1, manager.log.2.gz, \u2026 14 kept) and filters lines to [since, until]. This is the read path for "did it restart at 4pm YESTERDAY?" \u2014 use it when the answer is older than the live tail or spans a rotation. Returns { agent_id, code_name, host, log, since, until, time_filtered, content, log_present, lines_requested, truncated, ssm_status }. Time filtering applies to `manager` (its lines carry an ISO8601 prefix); `pane`/`slack-stderr`/`telegram-stderr`/`manager-state` return their byte-capped tail unfiltered (time_filtered:false). Only operational logs are reachable \u2014 secret files (.mcp.json, .env.integrations) are NOT. Pass { agent_id, log?, since?, until?, lines? } (since/until ISO8601 UTC e.g. 2026-06-14T16:00:00Z, default unbounded; lines default 1000, max 5000; output ~20 KB-capped, newest kept \u2014 narrow the window if truncated). Fails closed for an unauthorized org; every call is audited as a cross-org host access.',
|
|
21683
|
+
'Read an agent\'s HOST logs OVER A TIME WINDOW, spanning rotated files \u2014 the historical counterpart to debug_tail_logs. Where tail only shows the live tail of the current file (minutes, and gone once it rotates), this reads the active log AND its logrotate siblings (manager.log.1, manager.log.2.gz, \u2026 14 kept) and filters lines to [since, until]. This is the read path for "did it restart at 4pm YESTERDAY?" \u2014 use it when the answer is older than the live tail or spans a rotation. Returns { agent_id, code_name, host, log, since, until, time_filtered, content, log_present, lines_requested, truncated, ssm_status }. Time filtering applies to `manager` (its lines carry an ISO8601 prefix); `pane`/`slack-stderr`/`telegram-stderr`/`direct-chat-stderr`/`manager-state` return their byte-capped tail unfiltered (time_filtered:false). Only operational logs are reachable \u2014 secret files (.mcp.json, .env.integrations) are NOT. Pass { agent_id, log?, since?, until?, lines? } (since/until ISO8601 UTC e.g. 2026-06-14T16:00:00Z, default unbounded; lines default 1000, max 5000; output ~20 KB-capped, newest kept \u2014 narrow the window if truncated). Fails closed for an unauthorized org; every call is audited as a cross-org host access.',
|
|
21684
21684
|
queryLogsSchema.shape,
|
|
21685
21685
|
async (args) => {
|
|
21686
21686
|
try {
|
|
@@ -30251,7 +30251,8 @@ import {
|
|
|
30251
30251
|
readdirSync as readdirSync4,
|
|
30252
30252
|
existsSync as existsSync6,
|
|
30253
30253
|
renameSync as renameSync5,
|
|
30254
|
-
unlinkSync as unlinkSync3
|
|
30254
|
+
unlinkSync as unlinkSync3,
|
|
30255
|
+
createWriteStream
|
|
30255
30256
|
} from "fs";
|
|
30256
30257
|
|
|
30257
30258
|
// src/direct-chat-inbound-attachments.ts
|
|
@@ -30329,6 +30330,9 @@ function buildAttachmentMeta(items) {
|
|
|
30329
30330
|
if (firstImage?.path) meta.image_path = firstImage.path;
|
|
30330
30331
|
return meta;
|
|
30331
30332
|
}
|
|
30333
|
+
function redactPresignSignature(url) {
|
|
30334
|
+
return url.replace(/([?&]X-Amz-Signature=)[^&]+/gi, "$1<redacted>").replace(/([?&]X-Amz-Security-Token=)[^&]+/gi, "$1<redacted>");
|
|
30335
|
+
}
|
|
30332
30336
|
async function downloadInboundAttachment(att, dir, deps) {
|
|
30333
30337
|
const base = {
|
|
30334
30338
|
filename: att.filename,
|
|
@@ -30341,7 +30345,18 @@ async function downloadInboundAttachment(att, dir, deps) {
|
|
|
30341
30345
|
}
|
|
30342
30346
|
try {
|
|
30343
30347
|
const res = await deps.fetchUrl(att.download_url);
|
|
30344
|
-
if (!res.ok)
|
|
30348
|
+
if (!res.ok) {
|
|
30349
|
+
let s3Body = "";
|
|
30350
|
+
try {
|
|
30351
|
+
const raw = await res.bytes();
|
|
30352
|
+
s3Body = new TextDecoder().decode(raw.slice(0, 600)).replace(/\s+/g, " ").trim();
|
|
30353
|
+
} catch {
|
|
30354
|
+
}
|
|
30355
|
+
deps.warn(
|
|
30356
|
+
`direct-chat inbound download HTTP ${res.status} for ${att.filename} url=${redactPresignSignature(att.download_url)} s3Body=${s3Body}`
|
|
30357
|
+
);
|
|
30358
|
+
return { ...base, error: `download HTTP ${res.status}` };
|
|
30359
|
+
}
|
|
30345
30360
|
if (res.contentLength != null && res.contentLength > MAX_INBOUND_ATTACHMENT_BYTES) {
|
|
30346
30361
|
return { ...base, error: "exceeds the 10 MB inbound limit" };
|
|
30347
30362
|
}
|
|
@@ -34987,6 +35002,31 @@ var INBOUND_ATTACHMENTS_DIR = resolveInboundAttachmentsDir({
|
|
|
34987
35002
|
homeDir: homedir3()
|
|
34988
35003
|
});
|
|
34989
35004
|
var AGT_AGENT_CODE_NAME = process.env.AGT_AGENT_CODE_NAME;
|
|
35005
|
+
var directChatStderrLogStream = null;
|
|
35006
|
+
if (AGT_AGENT_CODE_NAME) {
|
|
35007
|
+
try {
|
|
35008
|
+
const logDir = join10(homedir3(), ".augmented", AGT_AGENT_CODE_NAME);
|
|
35009
|
+
mkdirSync5(logDir, { recursive: true });
|
|
35010
|
+
directChatStderrLogStream = createWriteStream(
|
|
35011
|
+
join10(logDir, "direct-chat-channel-stderr.log"),
|
|
35012
|
+
{ flags: "a", mode: 384 }
|
|
35013
|
+
);
|
|
35014
|
+
directChatStderrLogStream.on("error", () => {
|
|
35015
|
+
directChatStderrLogStream = null;
|
|
35016
|
+
});
|
|
35017
|
+
const origWrite = process.stderr.write.bind(process.stderr);
|
|
35018
|
+
process.stderr.write = (chunk, ...rest) => {
|
|
35019
|
+
try {
|
|
35020
|
+
const buf = typeof chunk === "string" ? chunk : String(chunk);
|
|
35021
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
35022
|
+
directChatStderrLogStream?.write(`[${ts}] ${buf}${buf.endsWith("\n") ? "" : "\n"}`);
|
|
35023
|
+
} catch {
|
|
35024
|
+
}
|
|
35025
|
+
return origWrite(chunk, ...rest);
|
|
35026
|
+
};
|
|
35027
|
+
} catch {
|
|
35028
|
+
}
|
|
35029
|
+
}
|
|
34990
35030
|
var PROGRESS_HEARTBEAT_PATH = AGT_AGENT_CODE_NAME ? join10(homedir3(), ".augmented", AGT_AGENT_CODE_NAME, "channel-progress-heartbeat.json") : null;
|
|
34991
35031
|
var DIRECT_CHAT_PENDING_INBOUND_DIR = AGT_AGENT_CODE_NAME ? join10(homedir3(), ".augmented", AGT_AGENT_CODE_NAME, "direct-chat-pending-inbound") : null;
|
|
34992
35032
|
var DIRECT_CHAT_DELIVERY_LEDGER_DIR = AGT_AGENT_CODE_NAME ? join10(homedir3(), ".augmented", AGT_AGENT_CODE_NAME, ".agt-inbound-delivery-ledger") : null;
|
package/package.json
CHANGED
|
File without changes
|