@integrity-labs/agt-cli 0.27.11 → 0.27.12

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
@@ -27,7 +27,7 @@ import {
27
27
  success,
28
28
  table,
29
29
  warn
30
- } from "../chunk-KJE777CX.js";
30
+ } from "../chunk-DFXRKR76.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-YSBGIXJG.js";
56
+ } from "../chunk-TOMBC7IE.js";
57
57
 
58
58
  // src/bin/agt.ts
59
59
  import { join as join15 } from "path";
@@ -4630,7 +4630,7 @@ import { execFileSync, execSync } from "child_process";
4630
4630
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4631
4631
  import chalk18 from "chalk";
4632
4632
  import ora16 from "ora";
4633
- var cliVersion = true ? "0.27.11" : "dev";
4633
+ var cliVersion = true ? "0.27.12" : "dev";
4634
4634
  async function fetchLatestVersion() {
4635
4635
  const host2 = getHost();
4636
4636
  if (!host2) return null;
@@ -5162,7 +5162,7 @@ function handleError(err) {
5162
5162
  }
5163
5163
 
5164
5164
  // src/bin/agt.ts
5165
- var cliVersion2 = true ? "0.27.11" : "dev";
5165
+ var cliVersion2 = true ? "0.27.12" : "dev";
5166
5166
  var program = new Command();
5167
5167
  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");
5168
5168
  program.hook("preAction", (thisCommand) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  claudeModelAlias,
3
3
  isClaudeFastMode
4
- } from "./chunk-YSBGIXJG.js";
4
+ } from "./chunk-TOMBC7IE.js";
5
5
  import {
6
6
  reapOrphanChannelMcps
7
7
  } from "./chunk-XWVM4KPK.js";
@@ -1116,4 +1116,4 @@ export {
1116
1116
  stopAllSessionsAndWait,
1117
1117
  getProjectDir
1118
1118
  };
1119
- //# sourceMappingURL=chunk-GN4XPQWJ.js.map
1119
+ //# sourceMappingURL=chunk-7JFYAP7Y.js.map
@@ -9,7 +9,65 @@ import {
9
9
  parseDeliveryTarget,
10
10
  registerFramework,
11
11
  wrapScheduledTaskPrompt
12
- } from "./chunk-YSBGIXJG.js";
12
+ } from "./chunk-TOMBC7IE.js";
13
+
14
+ // ../../packages/core/dist/provisioning/provisioner.js
15
+ import { createHash } from "crypto";
16
+ function sha256(content) {
17
+ return createHash("sha256").update(content, "utf8").digest("hex");
18
+ }
19
+ function provision(input, frameworkId = "openclaw") {
20
+ const adapter = getFramework(frameworkId);
21
+ const artifacts = adapter.buildArtifacts(input);
22
+ const charterHash = sha256(input.charterContent);
23
+ const toolsHash = sha256(input.toolsContent);
24
+ const teamDir = `.augmented/${input.agent.code_name}`;
25
+ return {
26
+ teamDir,
27
+ artifacts,
28
+ charterHash,
29
+ toolsHash
30
+ };
31
+ }
32
+
33
+ // ../../packages/core/dist/provisioning/hook-env.js
34
+ function augmentedHookPath(currentPath) {
35
+ const extras = [
36
+ "/home/linuxbrew/.linuxbrew/bin",
37
+ "/opt/homebrew/bin",
38
+ "/usr/local/bin",
39
+ "/usr/bin",
40
+ "/bin"
41
+ ];
42
+ const seen = /* @__PURE__ */ new Set();
43
+ const parts = [];
44
+ const push = (p) => {
45
+ if (!p || seen.has(p))
46
+ return;
47
+ seen.add(p);
48
+ parts.push(p);
49
+ };
50
+ for (const p of (currentPath ?? "").split(":"))
51
+ push(p);
52
+ for (const p of extras)
53
+ push(p);
54
+ return parts.join(":");
55
+ }
56
+ function extractCommandNotFound(stderr) {
57
+ if (!stderr)
58
+ return null;
59
+ const SAFE_CMD = /^[A-Za-z][A-Za-z0-9._-]{0,63}$/;
60
+ for (const line of stderr.split(/\r?\n/)) {
61
+ const m = line.match(/^(?:bash|sh): (?:line \d+: )?([^:\s]+): command not found$/);
62
+ if (m?.[1]) {
63
+ const rawCmd = m[1].trim();
64
+ const cmd = rawCmd.split("/").pop() ?? rawCmd;
65
+ if (SAFE_CMD.test(cmd))
66
+ return cmd;
67
+ }
68
+ }
69
+ return null;
70
+ }
13
71
 
14
72
  // ../../packages/core/dist/integrations/registry.js
15
73
  var INTEGRATION_REGISTRY = [
@@ -174,7 +232,15 @@ var INTEGRATION_REGISTRY = [
174
232
  { id: "qmd:search", name: "Search Memory", description: "Semantic + keyword search over indexed memory files", access: "read" },
175
233
  { id: "qmd:get", name: "Get Memory", description: "Read memory files by path and line range", access: "read" }
176
234
  ],
177
- beta: true
235
+ beta: true,
236
+ // ENG-5815: migrated from buildMcpJson's hardcoded if-block. qmd is
237
+ // the simplest of the four pre-data-driven entries — no env, no
238
+ // conditional logic, just `qmd mcp`. The byte-identical render is
239
+ // pinned by claudecode-qmd-data-driven.test.ts.
240
+ nativeMcp: {
241
+ command: "qmd",
242
+ args: ["mcp"]
243
+ }
178
244
  },
179
245
  {
180
246
  id: "v0",
@@ -310,6 +376,35 @@ var INTEGRATION_REGISTRY = [
310
376
  },
311
377
  docs_url: "https://www.coderabbit.ai/cli"
312
378
  },
379
+ {
380
+ id: "aws",
381
+ name: "AWS",
382
+ category: "infrastructure",
383
+ description: "Amazon Web Services \u2014 query AWS APIs (EC2, S3, IAM, Lambda, etc.) via AWS Labs' official AWS API MCP server",
384
+ supported_auth_types: ["api_key", "managed", "none"],
385
+ capabilities: [
386
+ { id: "aws:read", name: "Read AWS Resources", description: "List and describe AWS resources across services (EC2, S3, IAM, Lambda, \u2026)", access: "read" },
387
+ { id: "aws:write", name: "Write AWS Resources", description: "Create and update AWS resources. Pair with an aws-no-destructive-ops guardrail.", access: "write" }
388
+ ],
389
+ docs_url: "https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server",
390
+ beta: true,
391
+ // ENG-5815: first integration shipped purely via the data-driven
392
+ // path — buildMcpJson never grew an `aws` if-block. The AWS Labs
393
+ // AWS API MCP server runs through uvx (Python tooling), which the
394
+ // host bootstrap installs alongside python3. Credentials are
395
+ // resolved via the standard AWS_* env / shared credentials file
396
+ // chain on the host; the spec doesn't override them.
397
+ nativeMcp: {
398
+ command: "uvx",
399
+ args: ["awslabs.aws-api-mcp-server@latest"],
400
+ env: {
401
+ AWS_REGION: "{{empty_if_no_env.AWS_REGION}}",
402
+ AWS_PROFILE: "{{empty_if_no_env.AWS_PROFILE}}",
403
+ PATH: "{{process_env.PATH}}",
404
+ HOME: "{{process_env.HOME}}"
405
+ }
406
+ }
407
+ },
313
408
  {
314
409
  id: "custom",
315
410
  name: "Custom Integration",
@@ -326,45 +421,6 @@ function getIntegration(id) {
326
421
  return integrationMap.get(id);
327
422
  }
328
423
 
329
- // ../../packages/core/dist/provisioning/hook-env.js
330
- function augmentedHookPath(currentPath) {
331
- const extras = [
332
- "/home/linuxbrew/.linuxbrew/bin",
333
- "/opt/homebrew/bin",
334
- "/usr/local/bin",
335
- "/usr/bin",
336
- "/bin"
337
- ];
338
- const seen = /* @__PURE__ */ new Set();
339
- const parts = [];
340
- const push = (p) => {
341
- if (!p || seen.has(p))
342
- return;
343
- seen.add(p);
344
- parts.push(p);
345
- };
346
- for (const p of (currentPath ?? "").split(":"))
347
- push(p);
348
- for (const p of extras)
349
- push(p);
350
- return parts.join(":");
351
- }
352
- function extractCommandNotFound(stderr) {
353
- if (!stderr)
354
- return null;
355
- const SAFE_CMD = /^[A-Za-z][A-Za-z0-9._-]{0,63}$/;
356
- for (const line of stderr.split(/\r?\n/)) {
357
- const m = line.match(/^(?:bash|sh): (?:line \d+: )?([^:\s]+): command not found$/);
358
- if (m?.[1]) {
359
- const rawCmd = m[1].trim();
360
- const cmd = rawCmd.split("/").pop() ?? rawCmd;
361
- if (SAFE_CMD.test(cmd))
362
- return cmd;
363
- }
364
- }
365
- return null;
366
- }
367
-
368
424
  // ../../packages/core/dist/provisioning/frameworks/openclaw/index.js
369
425
  import { execFile, spawn } from "child_process";
370
426
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, existsSync as existsSync2, unlinkSync as unlinkSync2, chmodSync as chmodSync2, renameSync as renameSync2, symlinkSync } from "fs";
@@ -3515,6 +3571,66 @@ function buildRemoteMcpEntry(definitionId) {
3515
3571
  };
3516
3572
  }
3517
3573
 
3574
+ // ../../packages/core/dist/provisioning/native-mcp.js
3575
+ function buildNativeMcpEntry(spec, ctx) {
3576
+ const resolvedCommand = resolveTemplate(spec.command, ctx);
3577
+ if (resolvedCommand.omit) {
3578
+ throw new Error("NativeMcpSpec: empty_if_no_env is only valid in env values (not in `command`)");
3579
+ }
3580
+ const command = resolvedCommand.value;
3581
+ const args = spec.args.map((a, i) => {
3582
+ const resolved = resolveTemplate(a, ctx);
3583
+ if (resolved.omit) {
3584
+ throw new Error(`NativeMcpSpec: empty_if_no_env is only valid in env values (not in args[${i}])`);
3585
+ }
3586
+ return resolved.value;
3587
+ });
3588
+ if (spec.env === void 0) {
3589
+ return { command, args };
3590
+ }
3591
+ const env = {};
3592
+ for (const [k, raw] of Object.entries(spec.env)) {
3593
+ const { value, omit } = resolveTemplate(raw, ctx);
3594
+ if (omit)
3595
+ continue;
3596
+ env[k] = value;
3597
+ }
3598
+ return { command, args, env };
3599
+ }
3600
+ function resolveTemplate(input, ctx) {
3601
+ const TOKEN = /\{\{([^}]+)\}\}/g;
3602
+ const hasEmptyIfNoEnv = /\{\{\s*empty_if_no_env\./.test(input);
3603
+ const isWholeValueEmptyIfNoEnv = /^\{\{\s*empty_if_no_env\.[^}]+\}\}$/.test(input);
3604
+ if (hasEmptyIfNoEnv && !isWholeValueEmptyIfNoEnv) {
3605
+ throw new Error(`NativeMcpSpec: empty_if_no_env must be the sole content of the value, never mixed with literal text or other tokens (value: ${JSON.stringify(input)})`);
3606
+ }
3607
+ let omit = false;
3608
+ const value = input.replace(TOKEN, (whole, expr) => {
3609
+ const trimmed = expr.trim();
3610
+ if (trimmed === "agent_id")
3611
+ return ctx.agentId;
3612
+ if (trimmed === "agent_code_name")
3613
+ return ctx.agentCodeName;
3614
+ if (trimmed === "integration_id")
3615
+ return ctx.integration?.id ?? "";
3616
+ if (trimmed.startsWith("process_env.")) {
3617
+ const name = trimmed.slice("process_env.".length);
3618
+ return process.env[name] ?? "";
3619
+ }
3620
+ if (trimmed.startsWith("empty_if_no_env.")) {
3621
+ const name = trimmed.slice("empty_if_no_env.".length);
3622
+ const v = process.env[name] ?? "";
3623
+ if (v.length === 0) {
3624
+ omit = true;
3625
+ return "";
3626
+ }
3627
+ return v;
3628
+ }
3629
+ return whole;
3630
+ });
3631
+ return { value, omit };
3632
+ }
3633
+
3518
3634
  // ../../packages/core/dist/provisioning/frameworks/claudecode/index.js
3519
3635
  var VALID_CODE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
3520
3636
  var SECRET_FILE_MODE = 384;
@@ -4426,12 +4542,16 @@ function buildMcpJson(input) {
4426
4542
  HOME: process.env["HOME"] ?? ""
4427
4543
  }
4428
4544
  };
4429
- const hasQmd = input.integrations?.some((i) => i.definition_id === "qmd");
4430
- if (hasQmd) {
4431
- mcpServers["qmd"] = {
4432
- command: "qmd",
4433
- args: ["mcp"]
4434
- };
4545
+ for (const integration of input.integrations ?? []) {
4546
+ const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
4547
+ if (!def?.nativeMcp)
4548
+ continue;
4549
+ const key = def.nativeMcp.key ?? integration.definition_id;
4550
+ mcpServers[key] = buildNativeMcpEntry(def.nativeMcp, {
4551
+ agentId: input.agent.agent_id,
4552
+ agentCodeName: input.agent.code_name,
4553
+ integration
4554
+ });
4435
4555
  }
4436
4556
  const xeroIntegration = input.integrations?.find((i) => i.definition_id === "xero");
4437
4557
  if (xeroIntegration) {
@@ -5215,9 +5335,16 @@ ${sections}`
5215
5335
  chmodSync4(envPath, SECRET_FILE_MODE);
5216
5336
  }
5217
5337
  writeXurlStoreForIntegrations(decryptedIntegrations);
5218
- const hasQmd = integrations.some((i) => i.definition_id === "qmd");
5219
- if (hasQmd) {
5220
- this.writeMcpServer(codeName, "qmd", { command: "qmd", args: ["mcp"] });
5338
+ for (const integration of decryptedIntegrations) {
5339
+ const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
5340
+ if (!def?.nativeMcp)
5341
+ continue;
5342
+ const key = def.nativeMcp.key ?? integration.definition_id;
5343
+ this.writeMcpServer(codeName, key, buildNativeMcpEntry(def.nativeMcp, {
5344
+ agentId: agentId ?? "",
5345
+ agentCodeName: codeName,
5346
+ integration
5347
+ }));
5221
5348
  }
5222
5349
  const xeroIntegration = integrations.find((i) => i.definition_id === "xero");
5223
5350
  if (xeroIntegration) {
@@ -5276,16 +5403,15 @@ ${sections}`
5276
5403
  }
5277
5404
  }
5278
5405
  if (this.removeMcpServer) {
5406
+ const nativeMcpKeys = INTEGRATION_REGISTRY.filter((d) => d.nativeMcp !== void 0).map((d) => d.nativeMcp.key ?? d.id);
5279
5407
  const integrationDerivedKeys = /* @__PURE__ */ new Set([
5280
- "qmd",
5281
5408
  "xero",
5282
5409
  "postiz",
5283
5410
  "cloud-broker",
5411
+ ...nativeMcpKeys,
5284
5412
  ...Object.entries(OAUTH_PROVIDERS).filter(([, provider]) => Boolean(provider.mcpUrl)).map(([id]) => id)
5285
5413
  ]);
5286
5414
  const expectedKeys = /* @__PURE__ */ new Set();
5287
- if (hasQmd)
5288
- expectedKeys.add("qmd");
5289
5415
  if (xeroIntegration)
5290
5416
  expectedKeys.add("xero");
5291
5417
  if (postizIntegration)
@@ -5293,6 +5419,10 @@ ${sections}`
5293
5419
  if (hasCloudBroker)
5294
5420
  expectedKeys.add("cloud-broker");
5295
5421
  for (const integration of integrations) {
5422
+ const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
5423
+ if (def?.nativeMcp) {
5424
+ expectedKeys.add(def.nativeMcp.key ?? integration.definition_id);
5425
+ }
5296
5426
  if (buildRemoteMcpEntry(integration.definition_id)) {
5297
5427
  expectedKeys.add(integration.definition_id);
5298
5428
  }
@@ -5872,22 +6002,6 @@ var ManagedAgentsAdapter = {
5872
6002
  };
5873
6003
  registerFramework(ManagedAgentsAdapter);
5874
6004
 
5875
- // src/lib/globals.ts
5876
- import chalk from "chalk";
5877
- var _jsonMode = false;
5878
- function setJsonMode(enabled) {
5879
- _jsonMode = enabled;
5880
- if (enabled) {
5881
- chalk.level = 0;
5882
- }
5883
- }
5884
- function isJsonMode() {
5885
- return _jsonMode;
5886
- }
5887
- function jsonOutput(data) {
5888
- console.log(JSON.stringify(data, null, 2));
5889
- }
5890
-
5891
6005
  // src/lib/config.ts
5892
6006
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync6 } from "fs";
5893
6007
  import { join as join6 } from "path";
@@ -6136,23 +6250,20 @@ async function getHostId() {
6136
6250
  return hostId;
6137
6251
  }
6138
6252
 
6139
- // ../../packages/core/dist/provisioning/provisioner.js
6140
- import { createHash } from "crypto";
6141
- function sha256(content) {
6142
- return createHash("sha256").update(content, "utf8").digest("hex");
6253
+ // src/lib/globals.ts
6254
+ import chalk from "chalk";
6255
+ var _jsonMode = false;
6256
+ function setJsonMode(enabled) {
6257
+ _jsonMode = enabled;
6258
+ if (enabled) {
6259
+ chalk.level = 0;
6260
+ }
6143
6261
  }
6144
- function provision(input, frameworkId = "openclaw") {
6145
- const adapter = getFramework(frameworkId);
6146
- const artifacts = adapter.buildArtifacts(input);
6147
- const charterHash = sha256(input.charterContent);
6148
- const toolsHash = sha256(input.toolsContent);
6149
- const teamDir = `.augmented/${input.agent.code_name}`;
6150
- return {
6151
- teamDir,
6152
- artifacts,
6153
- charterHash,
6154
- toolsHash
6155
- };
6262
+ function isJsonMode() {
6263
+ return _jsonMode;
6264
+ }
6265
+ function jsonOutput(data) {
6266
+ console.log(JSON.stringify(data, null, 2));
6156
6267
  }
6157
6268
 
6158
6269
  // src/commands/manager.ts
@@ -6768,17 +6879,15 @@ async function managerUninstallSystemUnitCommand() {
6768
6879
  }
6769
6880
 
6770
6881
  export {
6771
- getIntegration,
6882
+ provision,
6772
6883
  extractCommandNotFound,
6884
+ getIntegration,
6773
6885
  INTEGRATIONS_SECTION_START,
6774
6886
  INTEGRATIONS_SECTION_END,
6775
6887
  estimateActiveTasksTokens,
6776
6888
  provisionStopHook,
6777
6889
  provisionIsolationHook,
6778
6890
  provisionOrientHook,
6779
- setJsonMode,
6780
- isJsonMode,
6781
- jsonOutput,
6782
6891
  getApiKey,
6783
6892
  getActiveTeam,
6784
6893
  setActiveTeam,
@@ -6789,14 +6898,16 @@ export {
6789
6898
  ApiError,
6790
6899
  api,
6791
6900
  getHostId,
6901
+ getManagerPaths,
6902
+ startWatchdog,
6792
6903
  success,
6793
6904
  error,
6794
6905
  warn,
6795
6906
  info,
6796
6907
  table,
6797
- provision,
6798
- getManagerPaths,
6799
- startWatchdog,
6908
+ setJsonMode,
6909
+ isJsonMode,
6910
+ jsonOutput,
6800
6911
  managerStartCommand,
6801
6912
  SUPERVISOR_RESTART_EXIT_CODE,
6802
6913
  managerStopCommand,
@@ -6806,4 +6917,4 @@ export {
6806
6917
  managerInstallSystemUnitCommand,
6807
6918
  managerUninstallSystemUnitCommand
6808
6919
  };
6809
- //# sourceMappingURL=chunk-KJE777CX.js.map
6920
+ //# sourceMappingURL=chunk-DFXRKR76.js.map