@integrity-labs/agt-cli 0.28.756 → 0.28.758

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
@@ -41,12 +41,12 @@ import {
41
41
  success,
42
42
  table,
43
43
  warn
44
- } from "../chunk-UFL5XDJF.js";
44
+ } from "../chunk-ZUCWB2AP.js";
45
45
  import {
46
46
  getProjectDir,
47
47
  isSessionResumeDisabled,
48
48
  readDirectChatSessionState
49
- } from "../chunk-VA6UHKFG.js";
49
+ } from "../chunk-4GGLPSVH.js";
50
50
  import {
51
51
  AnchorSessionClient,
52
52
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-GPDHLGBD.js";
82
+ } from "../chunk-SD2Y6ZOB.js";
83
83
  import "../chunk-XWVM4KPK.js";
84
84
 
85
85
  // src/bin/agt.ts
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.756" : "dev";
5470
+ var cliVersion = true ? "0.28.758" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6658,7 +6658,7 @@ function handleError(err) {
6658
6658
  }
6659
6659
 
6660
6660
  // src/bin/agt.ts
6661
- var cliVersion2 = true ? "0.28.756" : "dev";
6661
+ var cliVersion2 = true ? "0.28.758" : "dev";
6662
6662
  var program = new Command();
6663
6663
  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");
6664
6664
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -18,7 +18,7 @@ import {
18
18
  rotateDailySession,
19
19
  sessionFileExists,
20
20
  todayLocalIso
21
- } from "./chunk-GPDHLGBD.js";
21
+ } from "./chunk-SD2Y6ZOB.js";
22
22
  import {
23
23
  reapOrphanChannelMcps
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -4934,4 +4934,4 @@ export {
4934
4934
  stopAllSessionsAndWait,
4935
4935
  getProjectDir
4936
4936
  };
4937
- //# sourceMappingURL=chunk-VA6UHKFG.js.map
4937
+ //# sourceMappingURL=chunk-4GGLPSVH.js.map
@@ -240,6 +240,31 @@ function identifierMemoryName(url) {
240
240
  var AGENT_IDENTIFIER_RULE = "An identifier the work depends on is never an ephemeral detail: when a message gives you a URL, file, folder, document or ticket id, save the identifier itself, verbatim, before you reply \u2014 as its own short entry, not folded into prose. A note that a link is coming is not a substitute for the link. You can always re-derive a summary; you can never re-derive an identifier without asking the person for it again.";
241
241
  var EXTRACTOR_IDENTIFIER_RULE = 'An identifier is ALWAYS durable, and is the one exception to "no one-off task details": if the conversation contains a URL, file, folder, document or ticket id that the work depends on, emit it as a "reference" memory with the identifier copied EXACTLY as it appeared \u2014 never paraphrased, never shortened, never described. Conversation history does not survive a restart, so an identifier that is only described is lost.';
242
242
 
243
+ // ../../packages/core/dist/provisioning/frameworks/claudecode/agent-rules.js
244
+ var AGENT_RULES_SECTION_START = "<!-- AGT:RULES_START -->";
245
+ var AGENT_RULES_SECTION_END = "<!-- AGT:RULES_END -->";
246
+ var MAX_AGENT_RULES = 8;
247
+ var MAX_AGENT_RULE_CHARS = 200;
248
+ var MAX_AGENT_RULES_CHARS = MAX_AGENT_RULES * (MAX_AGENT_RULE_CHARS + 4);
249
+ function buildAgentRulesSection(rules) {
250
+ const kept = rules.map((r) => r.text.trim()).filter(Boolean).filter((t) => t.length <= MAX_AGENT_RULE_CHARS).slice(0, MAX_AGENT_RULES);
251
+ if (kept.length === 0)
252
+ return "";
253
+ const lines = kept.map((t) => `- ${t}`).join("\n");
254
+ return `${AGENT_RULES_SECTION_START}
255
+ ## Standing rules from your people
256
+
257
+ Rules your team has asked you to follow every time, in their words. They are not
258
+ task-specific \u2014 they apply on every turn regardless of what you are doing. If one
259
+ ever conflicts with a guardrail above, the guardrail wins and you should say so
260
+ rather than silently picking one.
261
+
262
+ ${lines}
263
+ ${AGENT_RULES_SECTION_END}
264
+
265
+ `;
266
+ }
267
+
243
268
  // ../../packages/core/dist/provisioning/frameworks/claudecode/identity.js
244
269
  var SCRATCH_RETENTION_DAYS = 7;
245
270
  var CLAUDE_MD_CHARS_PER_TOKEN = 3.57;
@@ -936,6 +961,7 @@ function generateClaudeMd(input) {
936
961
  const renderIntegrations = input.renderIntegrationsSection === true;
937
962
  const integrationsSection = renderIntegrations ? buildIntegrationsSection(integrations) : "";
938
963
  const capabilityPromptSection = buildCapabilityPromptSection(integrations, renderIntegrations);
964
+ const agentRulesSection = buildAgentRulesSection(input.agentRules ?? []);
939
965
  const kanbanWorkPolicySection = buildKanbanWorkPolicySection();
940
966
  const platformStorageSection = buildPlatformStorageSection(input.hasWorkflows);
941
967
  const skillAuthoringSection = buildSkillAuthoringSection();
@@ -1109,7 +1135,7 @@ are defined in \`CHARTER.md\`.
1109
1135
  - Enforcement: Follow CHARTER.md constraints strictly.
1110
1136
  - Tools: MCP tools in your session are authorized \u2014 call them when the task needs them. A **permission denial** (explicit "not authorized" / 403-with-policy-message) is a guardrail signal: don't retry it. Every other error MUST be re-confirmed by an actual fresh tool call before you tell the user about it \u2014 see \xA7 Integration trust calibration.
1111
1137
 
1112
- ${guardrailsSection}## Approval acknowledgements
1138
+ ${guardrailsSection}${agentRulesSection}## Approval acknowledgements
1113
1139
 
1114
1140
  This applies to **any** deferred-approval tool \u2014 anything returning \`pending\` that
1115
1141
  resolves later via a notification (AWS access grants, channel posts needing a human
@@ -10014,15 +10040,69 @@ function assessAuthConfigLinkage(input) {
10014
10040
  // ../../packages/core/dist/integrations/composio-account-probe.js
10015
10041
  var PROBE_TIMEOUT_MS = 1e4;
10016
10042
  var COMPOSIO_API_BASE = "https://backend.composio.dev";
10043
+ var BODY_SNIPPET_MAX = 300;
10044
+ async function readErrorBodySnippet(res, apiKey) {
10045
+ let text;
10046
+ try {
10047
+ text = await res.text();
10048
+ } catch {
10049
+ return void 0;
10050
+ }
10051
+ const redacted = apiKey ? text.split(apiKey).join("\xABredacted\xBB") : text;
10052
+ const trimmed = redacted.trim();
10053
+ if (!trimmed)
10054
+ return void 0;
10055
+ return trimmed.length > BODY_SNIPPET_MAX ? `${trimmed.slice(0, BODY_SNIPPET_MAX)}\u2026` : trimmed;
10056
+ }
10057
+ var NULL_BODY_STATUSES = /* @__PURE__ */ new Set([101, 204, 205, 304]);
10058
+ var BODY_MAX_BYTES = 1024 * 1024;
10017
10059
  async function timedFetch(fetchImpl, url, init) {
10018
10060
  const controller = new AbortController();
10019
10061
  const timer = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS);
10020
10062
  try {
10021
- return await fetchImpl(url, { ...init, signal: controller.signal });
10063
+ const res = await fetchImpl(url, { ...init, signal: controller.signal });
10064
+ if (NULL_BODY_STATUSES.has(res.status))
10065
+ return res;
10066
+ const body = await readBoundedBody(res, controller);
10067
+ return new Response(body, {
10068
+ status: res.status,
10069
+ statusText: res.statusText,
10070
+ headers: res.headers
10071
+ });
10022
10072
  } finally {
10023
10073
  clearTimeout(timer);
10024
10074
  }
10025
10075
  }
10076
+ async function readBoundedBody(res, controller) {
10077
+ const stream = res.body;
10078
+ if (!stream)
10079
+ return await res.text();
10080
+ const reader = stream.getReader();
10081
+ const chunks = [];
10082
+ let total = 0;
10083
+ for (; ; ) {
10084
+ const { done, value } = await reader.read();
10085
+ if (done)
10086
+ break;
10087
+ if (!value)
10088
+ continue;
10089
+ total += value.byteLength;
10090
+ if (total > BODY_MAX_BYTES) {
10091
+ controller.abort();
10092
+ await reader.cancel().catch(() => {
10093
+ });
10094
+ throw new Error(`Composio response body exceeded ${BODY_MAX_BYTES} bytes`);
10095
+ }
10096
+ chunks.push(value);
10097
+ }
10098
+ const merged = new Uint8Array(total);
10099
+ let offset = 0;
10100
+ for (const chunk of chunks) {
10101
+ merged.set(chunk, offset);
10102
+ offset += chunk.byteLength;
10103
+ }
10104
+ return new TextDecoder().decode(merged);
10105
+ }
10026
10106
  async function probeComposioAccount(params, fetchImpl = fetch) {
10027
10107
  const { connectedAccountId, apiKey, expectedUserId } = params;
10028
10108
  const base = params.apiBase ?? COMPOSIO_API_BASE;
@@ -10056,6 +10136,19 @@ async function probeComposioAccount(params, fetchImpl = fetch) {
10056
10136
  details: { connectedAccountId, httpStatus: res.status }
10057
10137
  };
10058
10138
  }
10139
+ if (res.status === 401 || res.status === 403) {
10140
+ const body = await readErrorBodySnippet(res, apiKey);
10141
+ return {
10142
+ status: "unverified",
10143
+ cause: "access_restricted",
10144
+ message: `Composio refused our API key (HTTP ${res.status}) \u2014 access restriction on our side, not a problem with this account; do not reconnect` + (body ? `. Composio said: ${body}` : ""),
10145
+ details: {
10146
+ connectedAccountId,
10147
+ httpStatus: res.status,
10148
+ ...body ? { responseBody: body } : {}
10149
+ }
10150
+ };
10151
+ }
10059
10152
  return {
10060
10153
  status: "down",
10061
10154
  message: `Composio account ${connectedAccountId} not found (HTTP ${res.status}) \u2014 reconnect required`,
@@ -10499,13 +10592,13 @@ async function probeComposioMcpToolCall(config, fetchImpl = fetch) {
10499
10592
 
10500
10593
  // ../../packages/core/dist/integrations/connectivity-http-probes.js
10501
10594
  var PROBE_TIMEOUT_MS2 = 1e4;
10502
- var NULL_BODY_STATUSES = /* @__PURE__ */ new Set([101, 204, 205, 304]);
10595
+ var NULL_BODY_STATUSES2 = /* @__PURE__ */ new Set([101, 204, 205, 304]);
10503
10596
  async function timedFetch2(fetchImpl, url, init) {
10504
10597
  const controller = new AbortController();
10505
10598
  const timer = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS2);
10506
10599
  try {
10507
10600
  const res = await fetchImpl(url, { ...init, signal: controller.signal });
10508
- if (NULL_BODY_STATUSES.has(res.status))
10601
+ if (NULL_BODY_STATUSES2.has(res.status))
10509
10602
  return res;
10510
10603
  const body = await res.text();
10511
10604
  return new Response(body, {
@@ -13222,4 +13315,4 @@ export {
13222
13315
  peekCurrentSession,
13223
13316
  readDailySessionPin
13224
13317
  };
13225
- //# sourceMappingURL=chunk-GPDHLGBD.js.map
13318
+ //# sourceMappingURL=chunk-SD2Y6ZOB.js.map