@integrity-labs/agt-cli 0.28.826 → 0.28.828

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.
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvIntegrations,
17
17
  shellQuote,
18
18
  summarizeUnanswerablePane
19
- } from "./chunk-Q3JUZZDB.js";
19
+ } from "./chunk-6HTCP6D5.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -357,6 +357,35 @@ function extractCommandNotFound(stderr) {
357
357
  return null;
358
358
  }
359
359
 
360
+ // ../../packages/core/dist/provisioning/channel-write-outcome.js
361
+ var CHANNEL_WRITE_OK = { ok: true };
362
+ function missingCredentialField(field) {
363
+ return { ok: false, reason: "missing_credential_field", field };
364
+ }
365
+ var CHANNEL_WRITE_MCP_JSON_REJECTED = {
366
+ ok: false,
367
+ reason: "mcp_json_rejected"
368
+ };
369
+ function describeChannelWriteFailure(outcome, channelId, trigger) {
370
+ const prefix = `credentials for ${channelId} did not land on disk (trigger=${trigger})`;
371
+ if (!outcome) {
372
+ return `${prefix} and this adapter does not report a cause. Check the channel config for a missing credential field, then the .mcp.json guard rejection printed once per fingerprint on stderr.`;
373
+ }
374
+ if (outcome.ok) {
375
+ return `${prefix} even though the writer reported it wrote. The write path and the on-disk check disagree \u2014 this is not a config problem.`;
376
+ }
377
+ switch (outcome.reason) {
378
+ case "missing_credential_field":
379
+ return `${prefix}: cause=missing_credential_field(${outcome.field}). The ${channelId} channel config has no ${outcome.field}, so the writer returned without writing. Set it on the channel and the next sync converges.`;
380
+ case "mcp_json_rejected":
381
+ return `${prefix}: cause=mcp_json_rejected. The rendered .mcp.json was refused by the secret lint / config validator, so nothing was written. The specific rejection is printed once per fingerprint on stderr.`;
382
+ default: {
383
+ const unknown = outcome;
384
+ return `${prefix}: cause=${unknown.reason ?? "unrecognised"} (unknown to this build).`;
385
+ }
386
+ }
387
+ }
388
+
360
389
  // ../../packages/core/dist/provisioning/frameworks/claudecode/core-knowledge-description.js
361
390
  var CORE_KNOWLEDGE_DESCRIPTION_MAX_CHARS = 1024;
362
391
  var CORE_KNOWLEDGE_TITLE_MAX_CHARS = 80;
@@ -5058,7 +5087,7 @@ ${sections}`
5058
5087
  if (channelId === "telegram") {
5059
5088
  const botToken = config["bot_token"];
5060
5089
  if (!botToken)
5061
- return;
5090
+ return missingCredentialField("bot_token");
5062
5091
  const allowedChats = config["allowed_chats"];
5063
5092
  const localTelegramChannel = join3(getHomeDir(), ".augmented", "_mcp", "telegram-channel.js");
5064
5093
  const resolvedAgtHostForTelegram = process.env["AGT_HOST"]?.trim() || "https://api.augmented.team";
@@ -5149,12 +5178,13 @@ ${sections}`
5149
5178
  }
5150
5179
  mcpConfig2.mcpServers["telegram"] = telegramEntry;
5151
5180
  if (!writeMcpJsonGuarded(codeName, provisionMcpPath, mcpConfig2)) {
5152
- return;
5181
+ return CHANNEL_WRITE_MCP_JSON_REJECTED;
5153
5182
  }
5154
5183
  syncMcpToProject(codeName);
5155
- return;
5184
+ return CHANNEL_WRITE_OK;
5156
5185
  }
5157
5186
  if (isPersistent && (channelId === "discord" || channelId === "slack")) {
5187
+ let wrotePersistentCredential = false;
5158
5188
  const channelDir = join3(getHomeDir(), ".claude", "channels", channelId);
5159
5189
  if (channelId === "discord")
5160
5190
  mkdirSync3(channelDir, { recursive: true });
@@ -5163,6 +5193,7 @@ ${sections}`
5163
5193
  if (botToken) {
5164
5194
  writeFileSync4(join3(channelDir, ".env"), `DISCORD_BOT_TOKEN=${botToken}
5165
5195
  `);
5196
+ wrotePersistentCredential = true;
5166
5197
  }
5167
5198
  } else if (channelId === "slack") {
5168
5199
  const botToken = config["bot_token"];
@@ -5324,9 +5355,10 @@ ${sections}`
5324
5355
  }
5325
5356
  mcpConfig2.mcpServers["slack"] = slackEntry;
5326
5357
  if (!writeMcpJsonGuarded(codeName, provisionMcpPath, mcpConfig2)) {
5327
- return;
5358
+ return CHANNEL_WRITE_MCP_JSON_REJECTED;
5328
5359
  }
5329
5360
  syncMcpToProject(codeName);
5361
+ wrotePersistentCredential = true;
5330
5362
  const staleChannelsPath = join3(getProjectDir2(codeName), ".mcp-channels.json");
5331
5363
  if (existsSync4(staleChannelsPath)) {
5332
5364
  try {
@@ -5336,7 +5368,10 @@ ${sections}`
5336
5368
  }
5337
5369
  }
5338
5370
  }
5339
- return;
5371
+ if (!wrotePersistentCredential) {
5372
+ return missingCredentialField("bot_token");
5373
+ }
5374
+ return CHANNEL_WRITE_OK;
5340
5375
  }
5341
5376
  const mcpJsonPath = join3(agentDir, "provision", ".mcp.json");
5342
5377
  mkdirSync3(dirname3(mcpJsonPath), { recursive: true });
@@ -5350,7 +5385,7 @@ ${sections}`
5350
5385
  if (channelId === "discord") {
5351
5386
  const botToken = config["bot_token"];
5352
5387
  if (!botToken)
5353
- return;
5388
+ return missingCredentialField("bot_token");
5354
5389
  mcpServers["discord"] = {
5355
5390
  command: "npx",
5356
5391
  args: ["-y", "@anthropic/claude-code-discord"],
@@ -5360,7 +5395,7 @@ ${sections}`
5360
5395
  const botToken = config["bot_token"];
5361
5396
  const appToken = config["app_token"];
5362
5397
  if (!botToken)
5363
- return;
5398
+ return missingCredentialField("bot_token");
5364
5399
  const localSlackChannel = join3(getHomeDir(), ".augmented", "_mcp", "slack-channel.js");
5365
5400
  const slackThreadAutoFollow = config["thread_auto_follow"];
5366
5401
  const slackAutoFollowEnv = slackThreadAutoFollow && slackThreadAutoFollow !== "off" ? { SLACK_THREAD_AUTO_FOLLOW: slackThreadAutoFollow } : {};
@@ -5486,8 +5521,9 @@ ${sections}`
5486
5521
  } else if (channelId === "msteams") {
5487
5522
  const appId = config["app_id"];
5488
5523
  const clientSecret = config["client_secret"];
5489
- if (!appId || !clientSecret)
5490
- return;
5524
+ if (!appId || !clientSecret) {
5525
+ return missingCredentialField(!appId ? "app_id" : "client_secret");
5526
+ }
5491
5527
  const localTeamsChannel = join3(getHomeDir(), ".augmented", "_mcp", "teams-channel.js");
5492
5528
  const agentDirMs = getAgentDir(codeName);
5493
5529
  try {
@@ -5581,10 +5617,11 @@ ${sections}`
5581
5617
  WHATSAPP_PROVIDER: "baileys"
5582
5618
  }
5583
5619
  };
5584
- if (writeMcpJsonGuarded(codeName, mcpJsonPath, mcpConfig)) {
5585
- syncMcpToProject(codeName);
5620
+ if (!writeMcpJsonGuarded(codeName, mcpJsonPath, mcpConfig)) {
5621
+ return CHANNEL_WRITE_MCP_JSON_REJECTED;
5586
5622
  }
5587
- return;
5623
+ syncMcpToProject(codeName);
5624
+ return CHANNEL_WRITE_OK;
5588
5625
  }
5589
5626
  const projectApiKey = config["project_api_key"];
5590
5627
  const phoneNumberId = config["phone_number_id"];
@@ -5611,11 +5648,15 @@ ${sections}`
5611
5648
  args: [localWhatsappChannel],
5612
5649
  env: whatsappEnv
5613
5650
  };
5651
+ } else {
5652
+ return missingCredentialField(!projectApiKey ? "project_api_key" : "phone_number_id");
5614
5653
  }
5615
5654
  }
5616
- if (writeMcpJsonGuarded(codeName, mcpJsonPath, mcpConfig)) {
5617
- syncMcpToProject(codeName);
5655
+ if (!writeMcpJsonGuarded(codeName, mcpJsonPath, mcpConfig)) {
5656
+ return CHANNEL_WRITE_MCP_JSON_REJECTED;
5618
5657
  }
5658
+ syncMcpToProject(codeName);
5659
+ return CHANNEL_WRITE_OK;
5619
5660
  },
5620
5661
  hasChannelCredentials(codeName, channelId) {
5621
5662
  const provisionMcpPath = join3(getAgentDir(codeName), "provision", ".mcp.json");
@@ -6494,7 +6535,7 @@ function exchangeFailureKind(err) {
6494
6535
  }
6495
6536
 
6496
6537
  // src/lib/api-client.ts
6497
- var agtCliVersion = true ? "0.28.826" : "dev";
6538
+ var agtCliVersion = true ? "0.28.828" : "dev";
6498
6539
  var lastConfigHash = null;
6499
6540
  function setConfigHash(hash) {
6500
6541
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10714,6 +10755,7 @@ function withEvidence(outcome, evidence) {
10714
10755
  export {
10715
10756
  safeWriteJsonAtomic,
10716
10757
  extractCommandNotFound,
10758
+ describeChannelWriteFailure,
10717
10759
  migrateAgentDirToIdKeyed,
10718
10760
  provisionStopHook,
10719
10761
  provisionIsolationHook,
@@ -10801,4 +10843,4 @@ export {
10801
10843
  managerInstallSystemUnitCommand,
10802
10844
  managerUninstallSystemUnitCommand
10803
10845
  };
10804
- //# sourceMappingURL=chunk-JO7QTVLM.js.map
10846
+ //# sourceMappingURL=chunk-FBJFYF3F.js.map