@integrity-labs/agt-cli 0.28.652 → 0.28.653
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
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
success,
|
|
41
41
|
table,
|
|
42
42
|
warn
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-CXZEIJRN.js";
|
|
44
44
|
import {
|
|
45
45
|
readDirectChatSessionState
|
|
46
46
|
} from "../chunk-E26EKDFP.js";
|
|
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4909
4909
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4910
4910
|
import chalk18 from "chalk";
|
|
4911
4911
|
import ora16 from "ora";
|
|
4912
|
-
var cliVersion = true ? "0.28.
|
|
4912
|
+
var cliVersion = true ? "0.28.653" : "dev";
|
|
4913
4913
|
async function fetchLatestVersion() {
|
|
4914
4914
|
const host2 = getHost();
|
|
4915
4915
|
if (!host2) return null;
|
|
@@ -6089,7 +6089,7 @@ function handleError(err) {
|
|
|
6089
6089
|
}
|
|
6090
6090
|
|
|
6091
6091
|
// src/bin/agt.ts
|
|
6092
|
-
var cliVersion2 = true ? "0.28.
|
|
6092
|
+
var cliVersion2 = true ? "0.28.653" : "dev";
|
|
6093
6093
|
var program = new Command();
|
|
6094
6094
|
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");
|
|
6095
6095
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -6073,7 +6073,7 @@ function exchangeFailureKind(err) {
|
|
|
6073
6073
|
}
|
|
6074
6074
|
|
|
6075
6075
|
// src/lib/api-client.ts
|
|
6076
|
-
var agtCliVersion = true ? "0.28.
|
|
6076
|
+
var agtCliVersion = true ? "0.28.653" : "dev";
|
|
6077
6077
|
var lastConfigHash = null;
|
|
6078
6078
|
function setConfigHash(hash) {
|
|
6079
6079
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -9815,4 +9815,4 @@ export {
|
|
|
9815
9815
|
managerInstallSystemUnitCommand,
|
|
9816
9816
|
managerUninstallSystemUnitCommand
|
|
9817
9817
|
};
|
|
9818
|
-
//# sourceMappingURL=chunk-
|
|
9818
|
+
//# sourceMappingURL=chunk-CXZEIJRN.js.map
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
safeWriteJsonAtomic,
|
|
56
56
|
setConfigHash,
|
|
57
57
|
tripClass
|
|
58
|
-
} from "../chunk-
|
|
58
|
+
} from "../chunk-CXZEIJRN.js";
|
|
59
59
|
import {
|
|
60
60
|
getProjectDir as getProjectDir2,
|
|
61
61
|
getReadyTasks,
|
|
@@ -12252,7 +12252,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
12252
12252
|
var lastVersionCheckAt = 0;
|
|
12253
12253
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
12254
12254
|
var lastResponsivenessProbeAt = 0;
|
|
12255
|
-
var agtCliVersion = true ? "0.28.
|
|
12255
|
+
var agtCliVersion = true ? "0.28.653" : "dev";
|
|
12256
12256
|
function resolveBrewPath(execFileSync3) {
|
|
12257
12257
|
try {
|
|
12258
12258
|
const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
package/dist/mcp/index.js
CHANGED
|
@@ -22397,10 +22397,32 @@ ${first.duplicate_hint}` : added;
|
|
|
22397
22397
|
import { homedir as homedir3, tmpdir } from "os";
|
|
22398
22398
|
import { basename, isAbsolute, join as join3, resolve as pathResolve, sep } from "path";
|
|
22399
22399
|
|
|
22400
|
-
// src/
|
|
22401
|
-
var SKILL_BODY_PATH_TOOLS = /* @__PURE__ */ new Set(["skill_create", "skill_update"]);
|
|
22400
|
+
// src/host-file-path.ts
|
|
22402
22401
|
var SKILL_BODY_PATH_MAX_BYTES = 512 * 1024;
|
|
22403
|
-
|
|
22402
|
+
var AGT_LIVE_CONTENT_PATH_MAX_BYTES = 2 * 1024 * 1024;
|
|
22403
|
+
var HOST_FILE_PATH_TOOLS = /* @__PURE__ */ new Map([
|
|
22404
|
+
[
|
|
22405
|
+
"skill_create",
|
|
22406
|
+
{ pathArg: "body_path", targetArg: "body", maxBytes: SKILL_BODY_PATH_MAX_BYTES, label: "a skill body" }
|
|
22407
|
+
],
|
|
22408
|
+
[
|
|
22409
|
+
"skill_update",
|
|
22410
|
+
{ pathArg: "body_path", targetArg: "body", maxBytes: SKILL_BODY_PATH_MAX_BYTES, label: "a skill body" }
|
|
22411
|
+
],
|
|
22412
|
+
[
|
|
22413
|
+
"agt_live_publish",
|
|
22414
|
+
{
|
|
22415
|
+
pathArg: "content_path",
|
|
22416
|
+
targetArg: "content",
|
|
22417
|
+
maxBytes: AGT_LIVE_CONTENT_PATH_MAX_BYTES,
|
|
22418
|
+
label: "a published page"
|
|
22419
|
+
}
|
|
22420
|
+
]
|
|
22421
|
+
]);
|
|
22422
|
+
function hostFilePathArg(toolName) {
|
|
22423
|
+
return HOST_FILE_PATH_TOOLS.get(toolName)?.pathArg;
|
|
22424
|
+
}
|
|
22425
|
+
function allowedHostFileRoots(agentDir, path) {
|
|
22404
22426
|
return [path.join(agentDir, "project"), path.join(agentDir, "scratch")];
|
|
22405
22427
|
}
|
|
22406
22428
|
function assertNoSymlinkComponents(target, roots, path, fs) {
|
|
@@ -22425,48 +22447,49 @@ function isContained(candidate, root, sep2) {
|
|
|
22425
22447
|
const rootWithSep = root.endsWith(sep2) ? root : root + sep2;
|
|
22426
22448
|
return candidate.startsWith(rootWithSep);
|
|
22427
22449
|
}
|
|
22428
|
-
function
|
|
22429
|
-
|
|
22430
|
-
|
|
22450
|
+
function resolveHostFilePath(toolName, args, opts) {
|
|
22451
|
+
const spec = HOST_FILE_PATH_TOOLS.get(toolName);
|
|
22452
|
+
if (!spec) return { ok: true, args };
|
|
22453
|
+
const raw = args[spec.pathArg];
|
|
22431
22454
|
if (raw === void 0 || raw === null) return { ok: true, args };
|
|
22432
22455
|
if (typeof raw !== "string" || raw.trim() === "") {
|
|
22433
|
-
return { ok: false, error:
|
|
22456
|
+
return { ok: false, error: `${spec.pathArg} must be a non-empty string.` };
|
|
22434
22457
|
}
|
|
22435
|
-
if (typeof args[
|
|
22458
|
+
if (typeof args[spec.targetArg] === "string") {
|
|
22436
22459
|
return {
|
|
22437
22460
|
ok: false,
|
|
22438
|
-
error:
|
|
22461
|
+
error: `Pass either ${spec.targetArg} or ${spec.pathArg}, not both \u2014 they are two ways to say the same thing and I will not guess which one you meant.`
|
|
22439
22462
|
};
|
|
22440
22463
|
}
|
|
22441
22464
|
const { agentDir, path, fs } = opts;
|
|
22442
|
-
const maxBytes = opts.maxBytes ??
|
|
22443
|
-
const roots =
|
|
22465
|
+
const maxBytes = opts.maxBytes ?? spec.maxBytes;
|
|
22466
|
+
const roots = allowedHostFileRoots(agentDir, path);
|
|
22444
22467
|
const absolute = path.isAbsolute(raw) ? path.resolve(raw) : path.resolve(path.join(agentDir, "project"), raw);
|
|
22445
22468
|
if (!roots.some((r) => isContained(absolute, r, path.sep))) {
|
|
22446
22469
|
return {
|
|
22447
22470
|
ok: false,
|
|
22448
|
-
error:
|
|
22471
|
+
error: `${spec.pathArg} must be inside your own project or scratch directory. Got '${raw}'. Allowed: ${roots.join(", ")}`
|
|
22449
22472
|
};
|
|
22450
22473
|
}
|
|
22451
22474
|
let real;
|
|
22452
22475
|
try {
|
|
22453
22476
|
real = fs.realpathSync(absolute);
|
|
22454
22477
|
} catch {
|
|
22455
|
-
return { ok: false, error:
|
|
22478
|
+
return { ok: false, error: `${spec.pathArg} does not exist or is unreadable: '${raw}'` };
|
|
22456
22479
|
}
|
|
22457
22480
|
if (!roots.some((r) => isContained(real, r, path.sep))) {
|
|
22458
22481
|
return {
|
|
22459
22482
|
ok: false,
|
|
22460
|
-
error:
|
|
22483
|
+
error: `${spec.pathArg} resolves outside your own directories (symlink?). '${raw}' \u2192 '${real}'. Allowed: ${roots.join(", ")}`
|
|
22461
22484
|
};
|
|
22462
22485
|
}
|
|
22463
22486
|
const walkError = assertNoSymlinkComponents(real, roots, path, fs);
|
|
22464
|
-
if (walkError) return { ok: false, error:
|
|
22487
|
+
if (walkError) return { ok: false, error: `${spec.pathArg}: ${walkError}` };
|
|
22465
22488
|
let vetted = null;
|
|
22466
22489
|
try {
|
|
22467
22490
|
vetted = fs.lstatSync(real);
|
|
22468
22491
|
} catch {
|
|
22469
|
-
return { ok: false, error:
|
|
22492
|
+
return { ok: false, error: `${spec.pathArg} vanished before it could be read: '${raw}'` };
|
|
22470
22493
|
}
|
|
22471
22494
|
let fd;
|
|
22472
22495
|
try {
|
|
@@ -22475,7 +22498,7 @@ function resolveSkillBodyPath(toolName, args, opts) {
|
|
|
22475
22498
|
const msg = err.message;
|
|
22476
22499
|
return {
|
|
22477
22500
|
ok: false,
|
|
22478
|
-
error:
|
|
22501
|
+
error: `${spec.pathArg} could not be opened (it may have been replaced mid-check): '${raw}' \u2014 ${msg}`
|
|
22479
22502
|
};
|
|
22480
22503
|
}
|
|
22481
22504
|
try {
|
|
@@ -22483,37 +22506,37 @@ function resolveSkillBodyPath(toolName, args, opts) {
|
|
|
22483
22506
|
try {
|
|
22484
22507
|
stat = fs.fstatSync(fd);
|
|
22485
22508
|
} catch {
|
|
22486
|
-
return { ok: false, error:
|
|
22509
|
+
return { ok: false, error: `${spec.pathArg} could not be inspected: '${raw}'` };
|
|
22487
22510
|
}
|
|
22488
22511
|
if (!stat.isFile()) {
|
|
22489
|
-
return { ok: false, error:
|
|
22512
|
+
return { ok: false, error: `${spec.pathArg} is not a regular file: '${raw}'` };
|
|
22490
22513
|
}
|
|
22491
22514
|
if (stat.ino !== void 0 && vetted.ino !== void 0) {
|
|
22492
22515
|
if (stat.ino !== vetted.ino || stat.dev !== vetted.dev) {
|
|
22493
22516
|
return {
|
|
22494
22517
|
ok: false,
|
|
22495
|
-
error:
|
|
22518
|
+
error: `${spec.pathArg} changed identity between the check and the open (it was replaced): '${raw}'`
|
|
22496
22519
|
};
|
|
22497
22520
|
}
|
|
22498
22521
|
}
|
|
22499
22522
|
if (stat.size > maxBytes) {
|
|
22500
22523
|
return {
|
|
22501
22524
|
ok: false,
|
|
22502
|
-
error:
|
|
22525
|
+
error: `${spec.pathArg} is ${stat.size} bytes, over the ${maxBytes}-byte limit for ${spec.label}.`
|
|
22503
22526
|
};
|
|
22504
22527
|
}
|
|
22505
22528
|
let bytes;
|
|
22506
22529
|
try {
|
|
22507
22530
|
bytes = fs.readFdSync(fd, maxBytes);
|
|
22508
22531
|
} catch (err) {
|
|
22509
|
-
return { ok: false, error:
|
|
22532
|
+
return { ok: false, error: `${spec.pathArg} could not be read: ${err.message}` };
|
|
22510
22533
|
}
|
|
22511
22534
|
if (bytes.byteLength > maxBytes) {
|
|
22512
|
-
return { ok: false, error:
|
|
22535
|
+
return { ok: false, error: `${spec.pathArg} grew past the ${maxBytes}-byte limit while being read.` };
|
|
22513
22536
|
}
|
|
22514
|
-
const
|
|
22515
|
-
const next = { ...args,
|
|
22516
|
-
delete next[
|
|
22537
|
+
const value = fs.decodeUtf8(bytes);
|
|
22538
|
+
const next = { ...args, [spec.targetArg]: value };
|
|
22539
|
+
delete next[spec.pathArg];
|
|
22517
22540
|
return { ok: true, args: next };
|
|
22518
22541
|
} finally {
|
|
22519
22542
|
try {
|
|
@@ -45938,11 +45961,12 @@ async function forwardToolCall(toolName, args) {
|
|
|
45938
45961
|
throw new Error("Cannot forward tool call: AGT_AGENT_ID is not set");
|
|
45939
45962
|
}
|
|
45940
45963
|
let outgoing = args;
|
|
45941
|
-
|
|
45964
|
+
const pathArg = hostFilePathArg(toolName);
|
|
45965
|
+
if (pathArg && args[pathArg] !== void 0) {
|
|
45942
45966
|
if (!AGT_AGENT_CODE_NAME) {
|
|
45943
|
-
throw new Error(
|
|
45967
|
+
throw new Error(`Cannot resolve ${pathArg}: AGT_AGENT_CODE_NAME is not set`);
|
|
45944
45968
|
}
|
|
45945
|
-
const resolved =
|
|
45969
|
+
const resolved = resolveHostFilePath(toolName, args, {
|
|
45946
45970
|
// ADR-0049 / ENG-7891: the per-agent host dir is agent_id-keyed and the
|
|
45947
45971
|
// codename path is only a compatibility SYMLINK. That is not a style
|
|
45948
45972
|
// point here, it is a correctness one: the containment check below
|
|
@@ -45968,7 +45992,7 @@ async function forwardToolCall(toolName, args) {
|
|
|
45968
45992
|
// so an oversize file is detected rather than buffered whole.
|
|
45969
45993
|
lstatSync,
|
|
45970
45994
|
// Raw bytes, decoded only after the byte-length check — see
|
|
45971
|
-
// readFdSync's docblock in
|
|
45995
|
+
// readFdSync's docblock in host-file-path.ts.
|
|
45972
45996
|
readFdSync: (fd, maxBytes) => {
|
|
45973
45997
|
const buf = Buffer.alloc(maxBytes + 1);
|
|
45974
45998
|
let read = 0;
|
package/package.json
CHANGED
|
File without changes
|