@integrity-labs/agt-cli 0.28.746 → 0.28.748

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.
Files changed (24) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-4JHG7DJW.js → chunk-3LQYVRKX.js} +2 -2
  3. package/dist/{chunk-PD3Y3C46.js → chunk-DFOBTAPL.js} +176 -2
  4. package/dist/chunk-DFOBTAPL.js.map +1 -0
  5. package/dist/{chunk-EQMRNMLX.js → chunk-G7GWXCPV.js} +4 -4
  6. package/dist/{claude-pair-runtime-LEWSA5RI.js → claude-pair-runtime-QOHDIQBD.js} +2 -2
  7. package/dist/lib/manager-worker.js +56 -19
  8. package/dist/lib/manager-worker.js.map +1 -1
  9. package/dist/mcp/direct-chat-channel.js +15 -0
  10. package/dist/mcp/index.js +73 -0
  11. package/dist/mcp/origami.js +15 -0
  12. package/dist/mcp/slack-channel.js +15 -0
  13. package/dist/mcp/telegram-channel.js +128 -4
  14. package/dist/{persistent-session-5FNVPGNL.js → persistent-session-VX5THUBN.js} +3 -3
  15. package/dist/{responsiveness-probe-NQIXADTX.js → responsiveness-probe-PMH4Z3MU.js} +3 -3
  16. package/dist/{session-auth-dead-3UZTQDWC.js → session-auth-dead-3FTENJFF.js} +2 -2
  17. package/package.json +1 -1
  18. package/dist/chunk-PD3Y3C46.js.map +0 -1
  19. /package/dist/{chunk-4JHG7DJW.js.map → chunk-3LQYVRKX.js.map} +0 -0
  20. /package/dist/{chunk-EQMRNMLX.js.map → chunk-G7GWXCPV.js.map} +0 -0
  21. /package/dist/{claude-pair-runtime-LEWSA5RI.js.map → claude-pair-runtime-QOHDIQBD.js.map} +0 -0
  22. /package/dist/{persistent-session-5FNVPGNL.js.map → persistent-session-VX5THUBN.js.map} +0 -0
  23. /package/dist/{responsiveness-probe-NQIXADTX.js.map → responsiveness-probe-PMH4Z3MU.js.map} +0 -0
  24. /package/dist/{session-auth-dead-3UZTQDWC.js.map → session-auth-dead-3FTENJFF.js.map} +0 -0
package/dist/bin/agt.js CHANGED
@@ -41,12 +41,12 @@ import {
41
41
  success,
42
42
  table,
43
43
  warn
44
- } from "../chunk-EQMRNMLX.js";
44
+ } from "../chunk-G7GWXCPV.js";
45
45
  import {
46
46
  getProjectDir,
47
47
  isSessionResumeDisabled,
48
48
  readDirectChatSessionState
49
- } from "../chunk-4JHG7DJW.js";
49
+ } from "../chunk-3LQYVRKX.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-PD3Y3C46.js";
82
+ } from "../chunk-DFOBTAPL.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.746" : "dev";
5470
+ var cliVersion = true ? "0.28.748" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6654,7 +6654,7 @@ function handleError(err) {
6654
6654
  }
6655
6655
 
6656
6656
  // src/bin/agt.ts
6657
- var cliVersion2 = true ? "0.28.746" : "dev";
6657
+ var cliVersion2 = true ? "0.28.748" : "dev";
6658
6658
  var program = new Command();
6659
6659
  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");
6660
6660
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -17,7 +17,7 @@ import {
17
17
  rotateDailySession,
18
18
  sessionFileExists,
19
19
  todayLocalIso
20
- } from "./chunk-PD3Y3C46.js";
20
+ } from "./chunk-DFOBTAPL.js";
21
21
  import {
22
22
  reapOrphanChannelMcps
23
23
  } from "./chunk-XWVM4KPK.js";
@@ -4929,4 +4929,4 @@ export {
4929
4929
  stopAllSessionsAndWait,
4930
4930
  getProjectDir
4931
4931
  };
4932
- //# sourceMappingURL=chunk-4JHG7DJW.js.map
4932
+ //# sourceMappingURL=chunk-3LQYVRKX.js.map
@@ -77,6 +77,161 @@ function resolveAvatarEnvUrl(raw) {
77
77
  // ../../packages/core/dist/provisioning/platform-storage.js
78
78
  var PLATFORM_STORAGE_RULE = "Store durable, reusable work you build (repeatable procedures, recurring responsibilities, scheduled automation, orchestration scripts) through the Augmented Team platform tools, never as loose local files, unless the user explicitly requests a different destination. Platform artifacts are versioned, reviewable, and survive re-provisioning; loose local files are wiped on the next provision rebuild, reach no one else, and bypass review. Ephemeral scratch files for the task at hand are fine on disk.";
79
79
 
80
+ // ../../packages/core/dist/memory/identifier-capture.js
81
+ var URL_RE = /\bhttps?:\/\/[^\s<>"'`]+/gi;
82
+ var TRAILING_PUNCT = /* @__PURE__ */ new Set([".", ",", ";", ":", "!", "?", ")", "]", "}", ">", '"', "'", "\u2019", "\u201D"]);
83
+ function trimUrlPunctuation(raw) {
84
+ let out = raw;
85
+ for (; ; ) {
86
+ const last = out.at(-1);
87
+ if (last === void 0 || !TRAILING_PUNCT.has(last))
88
+ return out;
89
+ if (last === ")" && countOf(out, "(") >= countOf(out, ")"))
90
+ return out;
91
+ out = out.slice(0, -1);
92
+ }
93
+ }
94
+ function countOf(s, ch) {
95
+ let n = 0;
96
+ for (const c of s)
97
+ if (c === ch)
98
+ n += 1;
99
+ return n;
100
+ }
101
+ function findIdentifierUrls(text) {
102
+ const seen = /* @__PURE__ */ new Set();
103
+ const out = [];
104
+ for (const m of text.matchAll(URL_RE)) {
105
+ const url = trimUrlPunctuation(m[0]);
106
+ if (!url || seen.has(url))
107
+ continue;
108
+ seen.add(url);
109
+ out.push(url);
110
+ }
111
+ return out;
112
+ }
113
+ var SECRET_PARAM_TOKENS = /* @__PURE__ */ new Set([
114
+ "token",
115
+ "password",
116
+ "passwd",
117
+ "pwd",
118
+ "secret",
119
+ "auth",
120
+ "bearer",
121
+ "signature",
122
+ "sig",
123
+ "credential",
124
+ "credentials",
125
+ "session",
126
+ "jwt",
127
+ "apikey",
128
+ // An OAuth authorization code and a one-time passcode are credentials, not
129
+ // identifiers (CodeRabbit). `code` does have benign uses (`?code=US`,
130
+ // `?code=PROMO10`); redacting those costs a query value, whereas persisting a
131
+ // real authorization code into a durable, searchable store is a credential in
132
+ // the memory table. Redaction is the cheaper error.
133
+ "code",
134
+ "otp"
135
+ ]);
136
+ var SECRET_PARAM_SUBSTRINGS = ["apikey", "accesstoken", "authtoken", "sessiontoken"];
137
+ var REDACTED_PARAM_VALUE = "redacted";
138
+ function isSecretParamName(name) {
139
+ const n = name.toLowerCase();
140
+ const tokens = n.split(/[^a-z0-9]+/).filter(Boolean);
141
+ if (tokens.some((t) => SECRET_PARAM_TOKENS.has(t)))
142
+ return true;
143
+ return SECRET_PARAM_SUBSTRINGS.some((h) => n.includes(h));
144
+ }
145
+ function scrubUrlSecrets(url) {
146
+ let u;
147
+ try {
148
+ u = new URL(url);
149
+ } catch {
150
+ return url;
151
+ }
152
+ let touched = false;
153
+ if (u.username || u.password) {
154
+ u.username = "";
155
+ u.password = "";
156
+ touched = true;
157
+ }
158
+ for (const key of [...u.searchParams.keys()]) {
159
+ if (isSecretParamName(key)) {
160
+ u.searchParams.set(key, REDACTED_PARAM_VALUE);
161
+ touched = true;
162
+ }
163
+ }
164
+ if (u.hash.includes("=")) {
165
+ const frag = new URLSearchParams(u.hash.replace(/^#/, ""));
166
+ let fragTouched = false;
167
+ for (const key of [...frag.keys()]) {
168
+ if (isSecretParamName(key)) {
169
+ frag.set(key, REDACTED_PARAM_VALUE);
170
+ fragTouched = true;
171
+ }
172
+ }
173
+ if (fragTouched) {
174
+ u.hash = `#${frag.toString()}`;
175
+ touched = true;
176
+ }
177
+ }
178
+ return touched ? u.toString() : url;
179
+ }
180
+ function scrubPreservingIdentifiers(text, blobPatterns) {
181
+ const spans = [];
182
+ for (const m of text.matchAll(URL_RE)) {
183
+ const trimmed = trimUrlPunctuation(m[0]);
184
+ if (!trimmed)
185
+ continue;
186
+ const start = m.index ?? -1;
187
+ if (start < 0)
188
+ continue;
189
+ spans.push([start, start + trimmed.length]);
190
+ }
191
+ if (spans.length === 0)
192
+ return applyAll(text, blobPatterns);
193
+ let out = "";
194
+ let cursor = 0;
195
+ for (const [start, end] of spans) {
196
+ if (start < cursor)
197
+ continue;
198
+ out += applyAll(text.slice(cursor, start), blobPatterns);
199
+ out += scrubUrlSecrets(text.slice(start, end));
200
+ cursor = end;
201
+ }
202
+ return out + applyAll(text.slice(cursor), blobPatterns);
203
+ }
204
+ function applyAll(text, patterns) {
205
+ let out = text;
206
+ for (const re of patterns)
207
+ out = out.replace(re, "[redacted]");
208
+ return out;
209
+ }
210
+ function fnv1a64(s) {
211
+ const PRIME = 0x100000001b3n;
212
+ const MASK = 0xffffffffffffffffn;
213
+ let h = 0xcbf29ce484222325n;
214
+ for (let i = 0; i < s.length; i += 1) {
215
+ h ^= BigInt(s.charCodeAt(i));
216
+ h = h * PRIME & MASK;
217
+ }
218
+ return h.toString(16).padStart(16, "0");
219
+ }
220
+ var IDENTIFIER_MEMORY_NAME_PREFIX = "link:";
221
+ function identifierMemoryName(url) {
222
+ let host = "";
223
+ try {
224
+ host = new URL(url).host.replace(/^www\./, "");
225
+ } catch {
226
+ host = "link";
227
+ }
228
+ const digest = fnv1a64(url);
229
+ const name = `${IDENTIFIER_MEMORY_NAME_PREFIX} ${host} ${digest}`;
230
+ return name.length <= 80 ? name : `${IDENTIFIER_MEMORY_NAME_PREFIX} ${digest}`;
231
+ }
232
+ 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.";
233
+ 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.';
234
+
80
235
  // ../../packages/core/dist/provisioning/frameworks/claudecode/identity.js
81
236
  var SCRATCH_RETENTION_DAYS = 7;
82
237
  var CLAUDE_MD_CHARS_PER_TOKEN = 3.57;
@@ -121,7 +276,7 @@ context. Two Markdown file types:
121
276
  **Save** when the user says "remember this", and proactively for decisions,
122
277
  preferences, non-obvious conventions, corrections to your approach, and important
123
278
  outcomes. **Don't save** what's derivable from the codebase or git history,
124
- ephemeral task details, or anything already in CHARTER.md / TOOLS.md.
279
+ ephemeral task details, or anything already in CHARTER.md / TOOLS.md. ${AGENT_IDENTIFIER_RULE}
125
280
 
126
281
  **Writing:** append to the daily log (create if missing); update \`MEMORY.md\` by
127
282
  topic, editing or removing stale entries rather than only appending. Before the
@@ -4808,6 +4963,21 @@ var FLAG_REGISTRY = [
4808
4963
  // approval requests; flipping it is a capability change worth confirming.
4809
4964
  sensitive: true
4810
4965
  },
4966
+ {
4967
+ key: "agent-self-pause",
4968
+ description: "CS-1632: let an agent stop ITSELF via the self_pause tool when it believes its channel is compromised or is being used to inject instructions. Writes agents.status=paused with paused_reason=agent_self_pause, and only a human can resume from the console. DEFAULTS ON, unlike most gates here: a safety control that has to be armed in advance is missing on every agent nobody armed, including the one being attacked. Turn it OFF per org if an agent misuses it \u2014 that is the reverse lever, and it is instant and central, which a host env var would not be. NO envVar: the consumer is the API route, and a bare AGT_*_ENABLED gate would trip check-new-env-gates.sh (same reasoning as v2-writes above).",
4969
+ flagType: "boolean",
4970
+ // Declared safe value is TRUE, and that inverts the usual posture on purpose.
4971
+ // For most gates the safe default is "off, ships dark". Here OFF means an
4972
+ // agent under a suspected compromise cannot stop, so a flag-read error must
4973
+ // NOT disable the control — the route evaluates this fail-OPEN.
4974
+ defaultValue: true,
4975
+ // Turning it off removes an agent's ability to stop itself during an
4976
+ // injection attempt; turning it on grants a (possibly prompt-injected) agent
4977
+ // a denial-of-service primitive against itself. Both directions are a
4978
+ // capability change worth confirming.
4979
+ sensitive: true
4980
+ },
4811
4981
  {
4812
4982
  key: "approval-sod",
4813
4983
  description: "Separation-of-duties (SoD) guard for the HITL approval FSM (ENG-6459): off = disabled, shadow = resolve principals + audit conflicts only (no block), enforce = fail-closed refuse of a self-approval or an unresolvable approver. Compares approver vs requesting-human on a canonical organization_people.person_id. This is the org-wide DEFAULT; a per-(team, verb) approval_policies.sod_mode row overrides it (ENG-6678: relax low-risk verbs while keeping enforce on money verbs). Ships dark (off); soak in shadow before enforce.",
@@ -12893,6 +13063,10 @@ export {
12893
13063
  MAX_AVATAR_ENV_URL_BYTES,
12894
13064
  resolveAvatarEnvUrl,
12895
13065
  PLATFORM_STORAGE_RULE,
13066
+ findIdentifierUrls,
13067
+ scrubPreservingIdentifiers,
13068
+ identifierMemoryName,
13069
+ EXTRACTOR_IDENTIFIER_RULE,
12896
13070
  SCRATCH_RETENTION_DAYS,
12897
13071
  CLAUDE_MD_CONTEXT_ALARM_CHARS,
12898
13072
  INTEGRATIONS_SECTION_START,
@@ -13037,4 +13211,4 @@ export {
13037
13211
  peekCurrentSession,
13038
13212
  readDailySessionPin
13039
13213
  };
13040
- //# sourceMappingURL=chunk-PD3Y3C46.js.map
13214
+ //# sourceMappingURL=chunk-DFOBTAPL.js.map