@integrity-labs/agt-cli 0.27.11 → 0.27.13

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-Q4MWFZ5Y.js";
31
31
  import {
32
32
  CHANNEL_REGISTRY,
33
33
  DEPLOYMENT_TEMPLATES,
@@ -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.13" : "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.13" : "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) => {
@@ -174,7 +174,15 @@ var INTEGRATION_REGISTRY = [
174
174
  { id: "qmd:search", name: "Search Memory", description: "Semantic + keyword search over indexed memory files", access: "read" },
175
175
  { id: "qmd:get", name: "Get Memory", description: "Read memory files by path and line range", access: "read" }
176
176
  ],
177
- beta: true
177
+ beta: true,
178
+ // ENG-5815: migrated from buildMcpJson's hardcoded if-block. qmd is
179
+ // the simplest of the four pre-data-driven entries — no env, no
180
+ // conditional logic, just `qmd mcp`. The byte-identical render is
181
+ // pinned by claudecode-qmd-data-driven.test.ts.
182
+ nativeMcp: {
183
+ command: "qmd",
184
+ args: ["mcp"]
185
+ }
178
186
  },
179
187
  {
180
188
  id: "v0",
@@ -310,6 +318,35 @@ var INTEGRATION_REGISTRY = [
310
318
  },
311
319
  docs_url: "https://www.coderabbit.ai/cli"
312
320
  },
321
+ {
322
+ id: "aws",
323
+ name: "AWS",
324
+ category: "infrastructure",
325
+ description: "Amazon Web Services \u2014 query AWS APIs (EC2, S3, IAM, Lambda, etc.) via AWS Labs' official AWS API MCP server",
326
+ supported_auth_types: ["api_key", "managed", "none"],
327
+ capabilities: [
328
+ { id: "aws:read", name: "Read AWS Resources", description: "List and describe AWS resources across services (EC2, S3, IAM, Lambda, \u2026)", access: "read" },
329
+ { id: "aws:write", name: "Write AWS Resources", description: "Create and update AWS resources. Pair with an aws-no-destructive-ops guardrail.", access: "write" }
330
+ ],
331
+ docs_url: "https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server",
332
+ beta: true,
333
+ // ENG-5815: first integration shipped purely via the data-driven
334
+ // path — buildMcpJson never grew an `aws` if-block. The AWS Labs
335
+ // AWS API MCP server runs through uvx (Python tooling), which the
336
+ // host bootstrap installs alongside python3. Credentials are
337
+ // resolved via the standard AWS_* env / shared credentials file
338
+ // chain on the host; the spec doesn't override them.
339
+ nativeMcp: {
340
+ command: "uvx",
341
+ args: ["awslabs.aws-api-mcp-server@latest"],
342
+ env: {
343
+ AWS_REGION: "{{empty_if_no_env.AWS_REGION}}",
344
+ AWS_PROFILE: "{{empty_if_no_env.AWS_PROFILE}}",
345
+ PATH: "{{process_env.PATH}}",
346
+ HOME: "{{process_env.HOME}}"
347
+ }
348
+ }
349
+ },
313
350
  {
314
351
  id: "custom",
315
352
  name: "Custom Integration",
@@ -3515,6 +3552,66 @@ function buildRemoteMcpEntry(definitionId) {
3515
3552
  };
3516
3553
  }
3517
3554
 
3555
+ // ../../packages/core/dist/provisioning/native-mcp.js
3556
+ function buildNativeMcpEntry(spec, ctx) {
3557
+ const resolvedCommand = resolveTemplate(spec.command, ctx);
3558
+ if (resolvedCommand.omit) {
3559
+ throw new Error("NativeMcpSpec: empty_if_no_env is only valid in env values (not in `command`)");
3560
+ }
3561
+ const command = resolvedCommand.value;
3562
+ const args = spec.args.map((a, i) => {
3563
+ const resolved = resolveTemplate(a, ctx);
3564
+ if (resolved.omit) {
3565
+ throw new Error(`NativeMcpSpec: empty_if_no_env is only valid in env values (not in args[${i}])`);
3566
+ }
3567
+ return resolved.value;
3568
+ });
3569
+ if (spec.env === void 0) {
3570
+ return { command, args };
3571
+ }
3572
+ const env = {};
3573
+ for (const [k, raw] of Object.entries(spec.env)) {
3574
+ const { value, omit } = resolveTemplate(raw, ctx);
3575
+ if (omit)
3576
+ continue;
3577
+ env[k] = value;
3578
+ }
3579
+ return { command, args, env };
3580
+ }
3581
+ function resolveTemplate(input, ctx) {
3582
+ const TOKEN = /\{\{([^}]+)\}\}/g;
3583
+ const hasEmptyIfNoEnv = /\{\{\s*empty_if_no_env\./.test(input);
3584
+ const isWholeValueEmptyIfNoEnv = /^\{\{\s*empty_if_no_env\.[^}]+\}\}$/.test(input);
3585
+ if (hasEmptyIfNoEnv && !isWholeValueEmptyIfNoEnv) {
3586
+ 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)})`);
3587
+ }
3588
+ let omit = false;
3589
+ const value = input.replace(TOKEN, (whole, expr) => {
3590
+ const trimmed = expr.trim();
3591
+ if (trimmed === "agent_id")
3592
+ return ctx.agentId;
3593
+ if (trimmed === "agent_code_name")
3594
+ return ctx.agentCodeName;
3595
+ if (trimmed === "integration_id")
3596
+ return ctx.integration?.id ?? "";
3597
+ if (trimmed.startsWith("process_env.")) {
3598
+ const name = trimmed.slice("process_env.".length);
3599
+ return process.env[name] ?? "";
3600
+ }
3601
+ if (trimmed.startsWith("empty_if_no_env.")) {
3602
+ const name = trimmed.slice("empty_if_no_env.".length);
3603
+ const v = process.env[name] ?? "";
3604
+ if (v.length === 0) {
3605
+ omit = true;
3606
+ return "";
3607
+ }
3608
+ return v;
3609
+ }
3610
+ return whole;
3611
+ });
3612
+ return { value, omit };
3613
+ }
3614
+
3518
3615
  // ../../packages/core/dist/provisioning/frameworks/claudecode/index.js
3519
3616
  var VALID_CODE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
3520
3617
  var SECRET_FILE_MODE = 384;
@@ -4426,12 +4523,16 @@ function buildMcpJson(input) {
4426
4523
  HOME: process.env["HOME"] ?? ""
4427
4524
  }
4428
4525
  };
4429
- const hasQmd = input.integrations?.some((i) => i.definition_id === "qmd");
4430
- if (hasQmd) {
4431
- mcpServers["qmd"] = {
4432
- command: "qmd",
4433
- args: ["mcp"]
4434
- };
4526
+ for (const integration of input.integrations ?? []) {
4527
+ const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
4528
+ if (!def?.nativeMcp)
4529
+ continue;
4530
+ const key = def.nativeMcp.key ?? integration.definition_id;
4531
+ mcpServers[key] = buildNativeMcpEntry(def.nativeMcp, {
4532
+ agentId: input.agent.agent_id,
4533
+ agentCodeName: input.agent.code_name,
4534
+ integration
4535
+ });
4435
4536
  }
4436
4537
  const xeroIntegration = input.integrations?.find((i) => i.definition_id === "xero");
4437
4538
  if (xeroIntegration) {
@@ -5215,9 +5316,16 @@ ${sections}`
5215
5316
  chmodSync4(envPath, SECRET_FILE_MODE);
5216
5317
  }
5217
5318
  writeXurlStoreForIntegrations(decryptedIntegrations);
5218
- const hasQmd = integrations.some((i) => i.definition_id === "qmd");
5219
- if (hasQmd) {
5220
- this.writeMcpServer(codeName, "qmd", { command: "qmd", args: ["mcp"] });
5319
+ for (const integration of decryptedIntegrations) {
5320
+ const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
5321
+ if (!def?.nativeMcp)
5322
+ continue;
5323
+ const key = def.nativeMcp.key ?? integration.definition_id;
5324
+ this.writeMcpServer(codeName, key, buildNativeMcpEntry(def.nativeMcp, {
5325
+ agentId: agentId ?? "",
5326
+ agentCodeName: codeName,
5327
+ integration
5328
+ }));
5221
5329
  }
5222
5330
  const xeroIntegration = integrations.find((i) => i.definition_id === "xero");
5223
5331
  if (xeroIntegration) {
@@ -5276,16 +5384,15 @@ ${sections}`
5276
5384
  }
5277
5385
  }
5278
5386
  if (this.removeMcpServer) {
5387
+ const nativeMcpKeys = INTEGRATION_REGISTRY.filter((d) => d.nativeMcp !== void 0).map((d) => d.nativeMcp.key ?? d.id);
5279
5388
  const integrationDerivedKeys = /* @__PURE__ */ new Set([
5280
- "qmd",
5281
5389
  "xero",
5282
5390
  "postiz",
5283
5391
  "cloud-broker",
5392
+ ...nativeMcpKeys,
5284
5393
  ...Object.entries(OAUTH_PROVIDERS).filter(([, provider]) => Boolean(provider.mcpUrl)).map(([id]) => id)
5285
5394
  ]);
5286
5395
  const expectedKeys = /* @__PURE__ */ new Set();
5287
- if (hasQmd)
5288
- expectedKeys.add("qmd");
5289
5396
  if (xeroIntegration)
5290
5397
  expectedKeys.add("xero");
5291
5398
  if (postizIntegration)
@@ -5293,6 +5400,10 @@ ${sections}`
5293
5400
  if (hasCloudBroker)
5294
5401
  expectedKeys.add("cloud-broker");
5295
5402
  for (const integration of integrations) {
5403
+ const def = INTEGRATION_REGISTRY.find((d) => d.id === integration.definition_id);
5404
+ if (def?.nativeMcp) {
5405
+ expectedKeys.add(def.nativeMcp.key ?? integration.definition_id);
5406
+ }
5296
5407
  if (buildRemoteMcpEntry(integration.definition_id)) {
5297
5408
  expectedKeys.add(integration.definition_id);
5298
5409
  }
@@ -6806,4 +6917,4 @@ export {
6806
6917
  managerInstallSystemUnitCommand,
6807
6918
  managerUninstallSystemUnitCommand
6808
6919
  };
6809
- //# sourceMappingURL=chunk-KJE777CX.js.map
6920
+ //# sourceMappingURL=chunk-Q4MWFZ5Y.js.map