@integrity-labs/agt-cli 0.27.7-test.6 → 0.27.8-test.8
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 +131 -37
- package/dist/bin/agt.js.map +1 -1
- package/dist/{chunk-AACMX6LE.js → chunk-DHF75YYA.js} +185 -60
- package/dist/chunk-DHF75YYA.js.map +1 -0
- package/dist/{chunk-GN4XPQWJ.js → chunk-F4NG4EXD.js} +37 -28
- package/dist/chunk-F4NG4EXD.js.map +1 -0
- package/dist/{chunk-YSBGIXJG.js → chunk-HT6EETEL.js} +1 -1
- package/dist/{claude-pair-runtime-ZBQKBBMT.js → claude-pair-runtime-OBAJZDXK.js} +2 -2
- package/dist/lib/manager-worker.js +14 -10
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +9 -462
- package/dist/mcp/index.js +44 -25
- package/dist/mcp/slack-channel.js +315 -604
- package/dist/mcp/telegram-channel.js +251 -513
- package/dist/{persistent-session-ICYFLUAM.js → persistent-session-SBSOZG74.js} +3 -3
- package/dist/{responsiveness-probe-WZNQ2762.js → responsiveness-probe-DU4IJ2RZ.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-AACMX6LE.js.map +0 -1
- package/dist/chunk-GN4XPQWJ.js.map +0 -1
- /package/dist/{chunk-YSBGIXJG.js.map → chunk-HT6EETEL.js.map} +0 -0
- /package/dist/{claude-pair-runtime-ZBQKBBMT.js.map → claude-pair-runtime-OBAJZDXK.js.map} +0 -0
- /package/dist/{persistent-session-ICYFLUAM.js.map → persistent-session-SBSOZG74.js.map} +0 -0
- /package/dist/{responsiveness-probe-WZNQ2762.js.map → responsiveness-probe-DU4IJ2RZ.js.map} +0 -0
package/dist/bin/agt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ApiError,
|
|
4
|
-
|
|
4
|
+
PROD_AGT_HOST,
|
|
5
5
|
api,
|
|
6
6
|
error,
|
|
7
7
|
exchangeApiKey,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
success,
|
|
28
28
|
table,
|
|
29
29
|
warn
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-DHF75YYA.js";
|
|
31
31
|
import {
|
|
32
32
|
CHANNEL_REGISTRY,
|
|
33
33
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
renderTemplate,
|
|
54
54
|
resolveChannels,
|
|
55
55
|
serializeManifestForSlackCli
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-HT6EETEL.js";
|
|
57
57
|
|
|
58
58
|
// src/bin/agt.ts
|
|
59
59
|
import { join as join15 } from "path";
|
|
@@ -1557,8 +1557,9 @@ async function provisionCommand(codeName, options) {
|
|
|
1557
1557
|
import chalk10 from "chalk";
|
|
1558
1558
|
import ora10 from "ora";
|
|
1559
1559
|
import { spawn } from "child_process";
|
|
1560
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync7 } from "fs";
|
|
1561
|
-
import { join as join10 } from "path";
|
|
1560
|
+
import { existsSync as existsSync6, readFileSync as readFileSync5, writeFileSync as writeFileSync7 } from "fs";
|
|
1561
|
+
import { dirname as dirname3, join as join10 } from "path";
|
|
1562
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1562
1563
|
|
|
1563
1564
|
// src/lib/impersonate-flag.ts
|
|
1564
1565
|
var ENV_VAR = "AGT_IMPERSONATE_ENABLED";
|
|
@@ -1996,12 +1997,67 @@ function buildIntroduction(input4) {
|
|
|
1996
1997
|
const lines = [`I'm ${spokenName}${codeSuffix}${roleClause}.`, ""];
|
|
1997
1998
|
if (integrations.length > 0) {
|
|
1998
1999
|
lines.push(`Connected integrations: ${integrations.join(", ")}.`);
|
|
2000
|
+
lines.push("");
|
|
2001
|
+
lines.push(
|
|
2002
|
+
"If the operator asks what you can do, call each MCP server's `tools/list` and report the actual tool inventory. Do not narrate capabilities from CHARTER.md \u2014 it describes intent, not runtime state. Tools that fail to enumerate (server failed to spawn, env missing, etc.) should be reported as such, not silently omitted."
|
|
2003
|
+
);
|
|
1999
2004
|
} else {
|
|
2000
2005
|
lines.push("No integrations are connected.");
|
|
2001
2006
|
}
|
|
2002
2007
|
return lines.join("\n");
|
|
2003
2008
|
}
|
|
2004
2009
|
|
|
2010
|
+
// src/lib/impersonate-mcp-rewrite.ts
|
|
2011
|
+
var SERVER_HOME_MCP_PATH_RE = /^\/home\/[^/]+\/\.augmented\/_mcp\/([^/]+)$/;
|
|
2012
|
+
function rewriteMcpJsonForImpersonation(mcpJson, ctx) {
|
|
2013
|
+
const parsed = JSON.parse(mcpJson);
|
|
2014
|
+
if (!isPlainObject(parsed)) {
|
|
2015
|
+
throw new Error(
|
|
2016
|
+
`rewriteMcpJsonForImpersonation: expected an object at the JSON root, got ${typeof parsed}`
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
const servers = parsed["mcpServers"];
|
|
2020
|
+
if (!isPlainObject(servers)) {
|
|
2021
|
+
throw new Error(
|
|
2022
|
+
"rewriteMcpJsonForImpersonation: expected an object-typed `mcpServers` field"
|
|
2023
|
+
);
|
|
2024
|
+
}
|
|
2025
|
+
const rewrittenServers = {};
|
|
2026
|
+
for (const [serverName, raw] of Object.entries(servers)) {
|
|
2027
|
+
rewrittenServers[serverName] = rewriteServerEntry(raw, ctx);
|
|
2028
|
+
}
|
|
2029
|
+
const out = { ...parsed, mcpServers: rewrittenServers };
|
|
2030
|
+
return JSON.stringify(out, null, 2);
|
|
2031
|
+
}
|
|
2032
|
+
function rewriteServerEntry(raw, ctx) {
|
|
2033
|
+
if (!isPlainObject(raw)) return raw;
|
|
2034
|
+
let args = raw["args"];
|
|
2035
|
+
if (Array.isArray(args)) {
|
|
2036
|
+
args = args.map((arg) => {
|
|
2037
|
+
if (typeof arg !== "string") return arg;
|
|
2038
|
+
const m = SERVER_HOME_MCP_PATH_RE.exec(arg);
|
|
2039
|
+
if (!m) return arg;
|
|
2040
|
+
return `${ctx.cliMcpBundleDir}/${m[1]}`;
|
|
2041
|
+
});
|
|
2042
|
+
}
|
|
2043
|
+
const env = isPlainObject(raw["env"]) ? { ...raw["env"] } : {};
|
|
2044
|
+
fillIfEmpty(env, "AGT_HOST", ctx.apiHost);
|
|
2045
|
+
fillIfEmpty(env, "AGT_API_KEY", ctx.impersonationToken);
|
|
2046
|
+
fillIfEmpty(env, "HOME", ctx.operatorHome);
|
|
2047
|
+
fillIfEmpty(env, "AGT_AGENT_ID", ctx.agentId);
|
|
2048
|
+
fillIfEmpty(env, "AGT_AGENT_CODE_NAME", ctx.agentCodeName);
|
|
2049
|
+
return { ...raw, args, env };
|
|
2050
|
+
}
|
|
2051
|
+
function fillIfEmpty(env, key, value) {
|
|
2052
|
+
const current = env[key];
|
|
2053
|
+
if (typeof current !== "string" || current.length === 0) {
|
|
2054
|
+
env[key] = value;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
function isPlainObject(v) {
|
|
2058
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2005
2061
|
// src/commands/impersonate.ts
|
|
2006
2062
|
var SWAP_FILES = ["CLAUDE.md", ".mcp.json"];
|
|
2007
2063
|
var AGENT_IMPERSONATION_HEADER = "X-Agent-Impersonation";
|
|
@@ -2041,7 +2097,7 @@ async function impersonateConnectCommand(token, options = {}) {
|
|
|
2041
2097
|
isSilent: json
|
|
2042
2098
|
});
|
|
2043
2099
|
spinner.start();
|
|
2044
|
-
const host2 = (options.apiHost ??
|
|
2100
|
+
const host2 = (options.apiHost ?? PROD_AGT_HOST).replace(/\/+$/, "");
|
|
2045
2101
|
let bundle;
|
|
2046
2102
|
try {
|
|
2047
2103
|
const res = await fetch(`${host2}/impersonate/agent/redeem`, {
|
|
@@ -2071,7 +2127,14 @@ async function impersonateConnectCommand(token, options = {}) {
|
|
|
2071
2127
|
);
|
|
2072
2128
|
writeFileSync7(
|
|
2073
2129
|
join10(personaDir, ".mcp.json"),
|
|
2074
|
-
bundle.artifacts[".mcp.json"]
|
|
2130
|
+
rewriteMcpJsonForImpersonation(bundle.artifacts[".mcp.json"], {
|
|
2131
|
+
operatorHome: process.env.HOME ?? "",
|
|
2132
|
+
cliMcpBundleDir: resolveCliMcpBundleDir(),
|
|
2133
|
+
impersonationToken: bundle.token,
|
|
2134
|
+
apiHost: host2,
|
|
2135
|
+
agentId: bundle.agent.agent_id,
|
|
2136
|
+
agentCodeName: bundle.agent.code_name
|
|
2137
|
+
})
|
|
2075
2138
|
);
|
|
2076
2139
|
spinner.text = "Swapping persona files\u2026";
|
|
2077
2140
|
const projectCwd = options.workdir ? ensureImpersonateWorkdir(bundle.agent.code_name) : process.cwd();
|
|
@@ -2353,6 +2416,18 @@ function readMcpIntegrations(path) {
|
|
|
2353
2416
|
return [];
|
|
2354
2417
|
}
|
|
2355
2418
|
}
|
|
2419
|
+
function resolveCliMcpBundleDir() {
|
|
2420
|
+
const moduleDir = dirname3(fileURLToPath2(import.meta.url));
|
|
2421
|
+
const candidates = [
|
|
2422
|
+
join10(moduleDir, "mcp"),
|
|
2423
|
+
join10(moduleDir, "..", "mcp"),
|
|
2424
|
+
join10(moduleDir, "..", "..", "mcp")
|
|
2425
|
+
];
|
|
2426
|
+
for (const candidate of candidates) {
|
|
2427
|
+
if (existsSync6(join10(candidate, "index.js"))) return candidate;
|
|
2428
|
+
}
|
|
2429
|
+
return candidates[candidates.length - 1];
|
|
2430
|
+
}
|
|
2356
2431
|
function buildImpersonateClaudeLaunch(projectCwd, inheritEnv = process.env, agentId = null) {
|
|
2357
2432
|
const env = {
|
|
2358
2433
|
...inheritEnv,
|
|
@@ -3012,7 +3087,7 @@ function terminate(child) {
|
|
|
3012
3087
|
// src/commands/manager-watch.tsx
|
|
3013
3088
|
import { useEffect, useState, useMemo } from "react";
|
|
3014
3089
|
import { render, Box, Text, useApp, useInput } from "ink";
|
|
3015
|
-
import { existsSync as
|
|
3090
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6, statSync, openSync, readSync, closeSync } from "fs";
|
|
3016
3091
|
import { homedir as homedir4 } from "os";
|
|
3017
3092
|
import { join as join12 } from "path";
|
|
3018
3093
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3044,7 +3119,7 @@ function managerWatchCommand(opts = {}) {
|
|
|
3044
3119
|
}
|
|
3045
3120
|
function readState(stateFile) {
|
|
3046
3121
|
try {
|
|
3047
|
-
if (!
|
|
3122
|
+
if (!existsSync7(stateFile)) return null;
|
|
3048
3123
|
const raw = readFileSync6(stateFile, "utf-8");
|
|
3049
3124
|
return JSON.parse(raw);
|
|
3050
3125
|
} catch {
|
|
@@ -3052,7 +3127,7 @@ function readState(stateFile) {
|
|
|
3052
3127
|
}
|
|
3053
3128
|
}
|
|
3054
3129
|
function tailLogFile(logFile, lines) {
|
|
3055
|
-
if (!
|
|
3130
|
+
if (!existsSync7(logFile)) return [];
|
|
3056
3131
|
try {
|
|
3057
3132
|
const fileSize = statSync(logFile).size;
|
|
3058
3133
|
if (fileSize === 0) return [];
|
|
@@ -3293,7 +3368,7 @@ function truncate(s, max) {
|
|
|
3293
3368
|
return s.length > max ? `${s.slice(0, Math.max(0, max - 1))}\u2026` : s;
|
|
3294
3369
|
}
|
|
3295
3370
|
function streamLogFile(logFile) {
|
|
3296
|
-
if (!
|
|
3371
|
+
if (!existsSync7(logFile)) {
|
|
3297
3372
|
process.stderr.write(`No manager log found at ${logFile}.
|
|
3298
3373
|
Start the manager first: agt manager start
|
|
3299
3374
|
`);
|
|
@@ -3339,14 +3414,14 @@ Start the manager first: agt manager start
|
|
|
3339
3414
|
// src/commands/agent.ts
|
|
3340
3415
|
import chalk14 from "chalk";
|
|
3341
3416
|
import JSON52 from "json5";
|
|
3342
|
-
import { readFileSync as readFileSync7, existsSync as
|
|
3417
|
+
import { readFileSync as readFileSync7, existsSync as existsSync8 } from "fs";
|
|
3343
3418
|
import { join as join13 } from "path";
|
|
3344
3419
|
async function agentShowCommand(codeName, opts) {
|
|
3345
3420
|
const json = isJsonMode();
|
|
3346
3421
|
const unifiedDir = join13(opts.configDir, codeName, "provision");
|
|
3347
3422
|
const legacyDir = join13(opts.configDir, codeName, "claudecode", "provision");
|
|
3348
|
-
const agentDir =
|
|
3349
|
-
const hasLocalConfig =
|
|
3423
|
+
const agentDir = existsSync8(unifiedDir) ? unifiedDir : legacyDir;
|
|
3424
|
+
const hasLocalConfig = existsSync8(agentDir);
|
|
3350
3425
|
let apiChannels = null;
|
|
3351
3426
|
let apiAgent = null;
|
|
3352
3427
|
if (getApiKey()) {
|
|
@@ -3380,7 +3455,7 @@ async function agentShowCommand(codeName, opts) {
|
|
|
3380
3455
|
let agentState = null;
|
|
3381
3456
|
if (hasLocalConfig) {
|
|
3382
3457
|
const charterPath = join13(agentDir, "CHARTER.md");
|
|
3383
|
-
if (
|
|
3458
|
+
if (existsSync8(charterPath)) {
|
|
3384
3459
|
const raw = readFileSync7(charterPath, "utf-8");
|
|
3385
3460
|
const parsed = extractFrontmatter(raw);
|
|
3386
3461
|
if (parsed.frontmatter) {
|
|
@@ -3388,7 +3463,7 @@ async function agentShowCommand(codeName, opts) {
|
|
|
3388
3463
|
}
|
|
3389
3464
|
}
|
|
3390
3465
|
const toolsPath = join13(agentDir, "TOOLS.md");
|
|
3391
|
-
if (
|
|
3466
|
+
if (existsSync8(toolsPath)) {
|
|
3392
3467
|
const raw = readFileSync7(toolsPath, "utf-8");
|
|
3393
3468
|
const parsed = extractFrontmatter(raw);
|
|
3394
3469
|
if (parsed.frontmatter) {
|
|
@@ -3396,7 +3471,7 @@ async function agentShowCommand(codeName, opts) {
|
|
|
3396
3471
|
}
|
|
3397
3472
|
}
|
|
3398
3473
|
const openclawPath = join13(agentDir, "openclaw.json5");
|
|
3399
|
-
if (
|
|
3474
|
+
if (existsSync8(openclawPath)) {
|
|
3400
3475
|
try {
|
|
3401
3476
|
const raw = readFileSync7(openclawPath, "utf-8");
|
|
3402
3477
|
openclawConfig = JSON52.parse(raw);
|
|
@@ -3404,7 +3479,7 @@ async function agentShowCommand(codeName, opts) {
|
|
|
3404
3479
|
}
|
|
3405
3480
|
}
|
|
3406
3481
|
const statePath = join13(opts.configDir, "manager-state.json");
|
|
3407
|
-
if (
|
|
3482
|
+
if (existsSync8(statePath)) {
|
|
3408
3483
|
try {
|
|
3409
3484
|
const raw = readFileSync7(statePath, "utf-8");
|
|
3410
3485
|
const state = JSON.parse(raw);
|
|
@@ -3743,8 +3818,8 @@ async function kanbanRecurringDisableCommand(titleOrId, opts) {
|
|
|
3743
3818
|
}
|
|
3744
3819
|
|
|
3745
3820
|
// src/commands/setup.ts
|
|
3746
|
-
import { existsSync as
|
|
3747
|
-
import { join as join14, dirname as
|
|
3821
|
+
import { existsSync as existsSync9, readFileSync as readFileSync8, writeFileSync as writeFileSync8, mkdirSync as mkdirSync7, accessSync, constants as fsConstants } from "fs";
|
|
3822
|
+
import { join as join14, dirname as dirname4 } from "path";
|
|
3748
3823
|
import { homedir as homedir5 } from "os";
|
|
3749
3824
|
import chalk16 from "chalk";
|
|
3750
3825
|
import ora14 from "ora";
|
|
@@ -3759,7 +3834,7 @@ function detectShellProfile() {
|
|
|
3759
3834
|
return fishConfig;
|
|
3760
3835
|
}
|
|
3761
3836
|
const bashrc = join14(home, ".bashrc");
|
|
3762
|
-
if (
|
|
3837
|
+
if (existsSync9(bashrc)) return bashrc;
|
|
3763
3838
|
return join14(home, ".bash_profile");
|
|
3764
3839
|
}
|
|
3765
3840
|
function maybeWriteSystemWideEnv(apiUrl, apiKey, consoleUrl) {
|
|
@@ -3786,7 +3861,7 @@ function quoteForFishShell(value) {
|
|
|
3786
3861
|
}
|
|
3787
3862
|
function writeEtcEnvironment(apiUrl, apiKey, consoleUrl) {
|
|
3788
3863
|
const envPath = "/etc/environment";
|
|
3789
|
-
if (!
|
|
3864
|
+
if (!existsSync9(envPath)) return false;
|
|
3790
3865
|
try {
|
|
3791
3866
|
accessSync(envPath, fsConstants.W_OK);
|
|
3792
3867
|
} catch {
|
|
@@ -3812,7 +3887,7 @@ function writeEtcEnvironment(apiUrl, apiKey, consoleUrl) {
|
|
|
3812
3887
|
}
|
|
3813
3888
|
function writeProfileDScript(apiUrl, apiKey, consoleUrl) {
|
|
3814
3889
|
const profileD = "/etc/profile.d";
|
|
3815
|
-
if (!
|
|
3890
|
+
if (!existsSync9(profileD)) return false;
|
|
3816
3891
|
try {
|
|
3817
3892
|
accessSync(profileD, fsConstants.W_OK);
|
|
3818
3893
|
} catch {
|
|
@@ -3835,7 +3910,7 @@ function writeProfileDScript(apiUrl, apiKey, consoleUrl) {
|
|
|
3835
3910
|
}
|
|
3836
3911
|
function ensureBashrcSourcesProfileD() {
|
|
3837
3912
|
const bashrc = "/etc/bashrc";
|
|
3838
|
-
if (!
|
|
3913
|
+
if (!existsSync9(bashrc)) return false;
|
|
3839
3914
|
try {
|
|
3840
3915
|
accessSync(bashrc, fsConstants.W_OK);
|
|
3841
3916
|
} catch {
|
|
@@ -3881,7 +3956,7 @@ function buildExportLines(shell, apiUrl, apiKey, consoleUrl) {
|
|
|
3881
3956
|
lines.push("");
|
|
3882
3957
|
return lines.join("\n");
|
|
3883
3958
|
}
|
|
3884
|
-
async function setupCommand(token) {
|
|
3959
|
+
async function setupCommand(token, options = {}) {
|
|
3885
3960
|
const json = isJsonMode();
|
|
3886
3961
|
const shortTokenPattern = /^[A-HJ-NP-Z2-9]{4}-[A-HJ-NP-Z2-9]{4}$/i;
|
|
3887
3962
|
const legacyTokenPattern = /^prov_[a-f0-9]{64}$/i;
|
|
@@ -3896,11 +3971,24 @@ async function setupCommand(token) {
|
|
|
3896
3971
|
return;
|
|
3897
3972
|
}
|
|
3898
3973
|
const normalizedToken = shortTokenPattern.test(token) ? token.toUpperCase() : token.toLowerCase();
|
|
3899
|
-
|
|
3974
|
+
const apiHostFlag = options.apiHost?.trim();
|
|
3975
|
+
const envHost = process.env["AGT_HOST"]?.trim();
|
|
3976
|
+
const apiUrl = apiHostFlag || envHost;
|
|
3900
3977
|
if (!apiUrl) {
|
|
3901
|
-
|
|
3902
|
-
if (
|
|
3903
|
-
|
|
3978
|
+
const msg = "Cannot determine API host for token exchange. Pass --api-host <url> or set AGT_HOST before running `agt setup`.\n Production: --api-host https://api.augmented.team\n Non-prod stage: --api-host https://<stage>.api.staging.augmented.team\n Local development: --api-host http://api.agt.localhost:1355";
|
|
3979
|
+
if (json) {
|
|
3980
|
+
jsonOutput({ ok: false, error: msg });
|
|
3981
|
+
} else {
|
|
3982
|
+
error(msg);
|
|
3983
|
+
}
|
|
3984
|
+
process.exitCode = 1;
|
|
3985
|
+
return;
|
|
3986
|
+
}
|
|
3987
|
+
if (!json) {
|
|
3988
|
+
if (apiHostFlag) {
|
|
3989
|
+
info(`Exchanging token against ${chalk16.bold(apiUrl)} (from --api-host)`);
|
|
3990
|
+
} else {
|
|
3991
|
+
info(`Exchanging token against ${chalk16.bold(apiUrl)} (from AGT_HOST)`);
|
|
3904
3992
|
}
|
|
3905
3993
|
}
|
|
3906
3994
|
const spinner = ora14({ text: "Exchanging provisioning token\u2026", isSilent: json });
|
|
@@ -3968,12 +4056,12 @@ async function setupCommand(token) {
|
|
|
3968
4056
|
);
|
|
3969
4057
|
}
|
|
3970
4058
|
const exportLines = buildExportLines(shell, finalApiUrl, setupResult.api_key, consoleUrl);
|
|
3971
|
-
const profileDir =
|
|
3972
|
-
if (!
|
|
4059
|
+
const profileDir = dirname4(profilePath);
|
|
4060
|
+
if (!existsSync9(profileDir)) {
|
|
3973
4061
|
mkdirSync7(profileDir, { recursive: true });
|
|
3974
4062
|
}
|
|
3975
4063
|
const marker = "# Augmented (agt) host configuration";
|
|
3976
|
-
const current =
|
|
4064
|
+
const current = existsSync9(profilePath) ? readFileSync8(profilePath, "utf-8") : "";
|
|
3977
4065
|
let updated;
|
|
3978
4066
|
if (current.includes(marker)) {
|
|
3979
4067
|
updated = current.replace(
|
|
@@ -4552,10 +4640,10 @@ async function acpxCloseCommand(agent2, _opts, cmd) {
|
|
|
4552
4640
|
|
|
4553
4641
|
// src/commands/update.ts
|
|
4554
4642
|
import { execFileSync, execSync } from "child_process";
|
|
4555
|
-
import { existsSync as
|
|
4643
|
+
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4556
4644
|
import chalk18 from "chalk";
|
|
4557
4645
|
import ora16 from "ora";
|
|
4558
|
-
var cliVersion = true ? "0.27.
|
|
4646
|
+
var cliVersion = true ? "0.27.8-test.8" : "dev";
|
|
4559
4647
|
async function fetchLatestVersion() {
|
|
4560
4648
|
const host2 = getHost();
|
|
4561
4649
|
if (!host2) return null;
|
|
@@ -4659,7 +4747,7 @@ function performUpdate(version) {
|
|
|
4659
4747
|
function detectBrewOwner() {
|
|
4660
4748
|
for (const prefix of ["/home/linuxbrew/.linuxbrew", "/opt/homebrew", "/usr/local"]) {
|
|
4661
4749
|
const cellar = `${prefix}/Cellar`;
|
|
4662
|
-
if (!
|
|
4750
|
+
if (!existsSync10(cellar)) continue;
|
|
4663
4751
|
try {
|
|
4664
4752
|
return execSync(`stat -c %U "${cellar}" 2>/dev/null || stat -f %Su "${cellar}"`, { encoding: "utf-8" }).trim() || null;
|
|
4665
4753
|
} catch {
|
|
@@ -5087,7 +5175,7 @@ function handleError(err) {
|
|
|
5087
5175
|
}
|
|
5088
5176
|
|
|
5089
5177
|
// src/bin/agt.ts
|
|
5090
|
-
var cliVersion2 = true ? "0.27.
|
|
5178
|
+
var cliVersion2 = true ? "0.27.8-test.8" : "dev";
|
|
5091
5179
|
var program = new Command();
|
|
5092
5180
|
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");
|
|
5093
5181
|
program.hook("preAction", (thisCommand) => {
|
|
@@ -5097,7 +5185,13 @@ program.hook("preAction", (thisCommand) => {
|
|
|
5097
5185
|
}
|
|
5098
5186
|
});
|
|
5099
5187
|
program.command("whoami").description("Show the authenticated host, team, and user from AGT_API_KEY").action(whoamiCommand);
|
|
5100
|
-
program.command("setup <token>").description("One-command host setup: exchange provisioning token, configure env vars, verify, and start manager").
|
|
5188
|
+
program.command("setup <token>").description("One-command host setup: exchange provisioning token, configure env vars, verify, and start manager").option(
|
|
5189
|
+
"--api-host <url>",
|
|
5190
|
+
// ENG-5831: required when AGT_HOST is not set in the shell — the setup
|
|
5191
|
+
// command no longer silently defaults to prod. Mirrors `agt impersonate
|
|
5192
|
+
// connect --api-host` (ENG-5773).
|
|
5193
|
+
"API host to exchange the provisioning token against. Takes precedence over AGT_HOST. Required when AGT_HOST is unset (e.g. https://test.api.staging.augmented.team for the test stage; https://api.augmented.team for prod)."
|
|
5194
|
+
).action(setupCommand);
|
|
5101
5195
|
var team = program.command("team").description("Manage teams");
|
|
5102
5196
|
team.command("list").description("List teams you belong to").action(teamListCommand);
|
|
5103
5197
|
team.command("create <name>").description("Create a new team and set it as active").action(teamCreateCommand);
|