@integrity-labs/agt-cli 0.28.315 → 0.28.317
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 +4 -4
- package/dist/{chunk-H6GG7WM3.js → chunk-ORTMG5E3.js} +1 -1
- package/dist/{chunk-H6GG7WM3.js.map → chunk-ORTMG5E3.js.map} +1 -1
- package/dist/{chunk-PNE62JL3.js → chunk-OYOZL3N4.js} +85 -6
- package/dist/{chunk-PNE62JL3.js.map → chunk-OYOZL3N4.js.map} +1 -1
- package/dist/{claude-pair-runtime-V7DKCABP.js → claude-pair-runtime-4PLFHGOI.js} +2 -2
- package/dist/lib/manager-worker.js +19 -15
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/slack-channel.js +26 -10
- package/dist/{persistent-session-OYVPR4R3.js → persistent-session-UZNQVUYB.js} +2 -2
- package/dist/{responsiveness-probe-DFQFCUN2.js → responsiveness-probe-5XF7ZCYF.js} +2 -2
- package/package.json +1 -1
- /package/dist/{claude-pair-runtime-V7DKCABP.js.map → claude-pair-runtime-4PLFHGOI.js.map} +0 -0
- /package/dist/{persistent-session-OYVPR4R3.js.map → persistent-session-UZNQVUYB.js.map} +0 -0
- /package/dist/{responsiveness-probe-DFQFCUN2.js.map → responsiveness-probe-5XF7ZCYF.js.map} +0 -0
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveConnectivityProbe,
|
|
19
19
|
worseConnectivityOutcome,
|
|
20
20
|
wrapScheduledTaskPrompt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ORTMG5E3.js";
|
|
22
22
|
import {
|
|
23
23
|
parsePsRows
|
|
24
24
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -5900,7 +5900,7 @@ function requireHost() {
|
|
|
5900
5900
|
}
|
|
5901
5901
|
|
|
5902
5902
|
// src/lib/api-client.ts
|
|
5903
|
-
var agtCliVersion = true ? "0.28.
|
|
5903
|
+
var agtCliVersion = true ? "0.28.317" : "dev";
|
|
5904
5904
|
var lastConfigHash = null;
|
|
5905
5905
|
function setConfigHash(hash) {
|
|
5906
5906
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -6135,10 +6135,12 @@ function readFlagsCache(path) {
|
|
|
6135
6135
|
const obj = parsed;
|
|
6136
6136
|
const flags = obj["flags"];
|
|
6137
6137
|
if (!flags || typeof flags !== "object") return null;
|
|
6138
|
+
const perAgent = obj["notify_dispatch_by_agent"];
|
|
6138
6139
|
return {
|
|
6139
6140
|
schema_version: typeof obj["schema_version"] === "string" ? obj["schema_version"] : "",
|
|
6140
6141
|
updated_at: typeof obj["updated_at"] === "string" ? obj["updated_at"] : "",
|
|
6141
|
-
flags: { ...flags }
|
|
6142
|
+
flags: { ...flags },
|
|
6143
|
+
notify_dispatch_by_agent: perAgent && typeof perAgent === "object" ? { ...perAgent } : {}
|
|
6142
6144
|
};
|
|
6143
6145
|
} catch {
|
|
6144
6146
|
return null;
|
|
@@ -6183,6 +6185,22 @@ function resolveAllFlags(heartbeatFlags, env = process.env) {
|
|
|
6183
6185
|
}
|
|
6184
6186
|
var HostFlagStore = class {
|
|
6185
6187
|
heartbeatFlags = {};
|
|
6188
|
+
/**
|
|
6189
|
+
* ENG-7682 follow-up: per-agent notify-dispatch values from the heartbeat,
|
|
6190
|
+
* keyed by agent_id. Only agents whose resolved value DIFFERS from the
|
|
6191
|
+
* host-wide value appear here; everyone else falls back to the host-wide
|
|
6192
|
+
* `notify-dispatch` entry. This is what stops one agent's opt-in from fanning
|
|
6193
|
+
* out to every agent the host runs. Held in memory only (re-sent every
|
|
6194
|
+
* heartbeat), not persisted to the flags cache, which is a host-wide map.
|
|
6195
|
+
*/
|
|
6196
|
+
notifyDispatchByAgent = {};
|
|
6197
|
+
/**
|
|
6198
|
+
* The `flags_schema_version` from the most recent heartbeat, retained so a
|
|
6199
|
+
* per-agent-map write (which carries no schema version of its own) persists
|
|
6200
|
+
* the same schema string the host-wide map was last written with rather than
|
|
6201
|
+
* clobbering it to empty. Hydrated from the cache on init().
|
|
6202
|
+
*/
|
|
6203
|
+
lastSchemaVersion = "";
|
|
6186
6204
|
cachePath;
|
|
6187
6205
|
log;
|
|
6188
6206
|
env;
|
|
@@ -6216,6 +6234,8 @@ var HostFlagStore = class {
|
|
|
6216
6234
|
return;
|
|
6217
6235
|
}
|
|
6218
6236
|
this.heartbeatFlags = { ...cached.flags };
|
|
6237
|
+
this.notifyDispatchByAgent = { ...cached.notify_dispatch_by_agent ?? {} };
|
|
6238
|
+
this.lastSchemaVersion = cached.schema_version || "";
|
|
6219
6239
|
const ageSeconds = flagsCacheAgeSeconds(cached, this.cachePath, now);
|
|
6220
6240
|
const age = ageSeconds === null ? "unknown" : `${Math.round(ageSeconds)}s`;
|
|
6221
6241
|
const schema = cached.schema_version || "unknown";
|
|
@@ -6256,11 +6276,23 @@ var HostFlagStore = class {
|
|
|
6256
6276
|
}
|
|
6257
6277
|
}
|
|
6258
6278
|
this.heartbeatFlags = { ...map };
|
|
6279
|
+
this.lastSchemaVersion = schemaVersion ?? "";
|
|
6280
|
+
this.persistCache();
|
|
6281
|
+
}
|
|
6282
|
+
/**
|
|
6283
|
+
* Persist the host-wide flag map AND the per-agent notify-dispatch map to the
|
|
6284
|
+
* last-known-good cache in a single atomic write, so a restart hydrates both
|
|
6285
|
+
* from the same snapshot (ENG-7682 follow-up). Called by every mutator that
|
|
6286
|
+
* changes either map. A write failure is logged and swallowed: the in-memory
|
|
6287
|
+
* state stays authoritative and the next successful heartbeat re-persists.
|
|
6288
|
+
*/
|
|
6289
|
+
persistCache() {
|
|
6259
6290
|
try {
|
|
6260
6291
|
writeFlagsCache(this.cachePath, {
|
|
6261
|
-
schema_version:
|
|
6292
|
+
schema_version: this.lastSchemaVersion,
|
|
6262
6293
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6263
|
-
flags: this.heartbeatFlags
|
|
6294
|
+
flags: this.heartbeatFlags,
|
|
6295
|
+
notify_dispatch_by_agent: this.notifyDispatchByAgent
|
|
6264
6296
|
});
|
|
6265
6297
|
} catch (err) {
|
|
6266
6298
|
this.log(`[flags] cache write failed: ${err.message}`);
|
|
@@ -6296,6 +6328,53 @@ var HostFlagStore = class {
|
|
|
6296
6328
|
if (resolved && typeof resolved.value === "string") return resolved.value;
|
|
6297
6329
|
return definition?.flagType === "enum" ? definition.defaultValue : "";
|
|
6298
6330
|
}
|
|
6331
|
+
/**
|
|
6332
|
+
* ENG-7682 follow-up: merge the heartbeat's per-agent notify-dispatch map.
|
|
6333
|
+
* A missing/non-object map REPLACES with an empty map so a clear (agent
|
|
6334
|
+
* override removed → API stops sending the entry) takes effect within one
|
|
6335
|
+
* poll rather than pinning a stale opt-in. Values that aren't valid
|
|
6336
|
+
* notify-dispatch members are dropped (registry skew / malformed payload).
|
|
6337
|
+
*/
|
|
6338
|
+
applyNotifyDispatchByAgent(map) {
|
|
6339
|
+
const definition = getFlagDefinition("notify-dispatch");
|
|
6340
|
+
if (!map || typeof map !== "object" || !definition) {
|
|
6341
|
+
this.notifyDispatchByAgent = {};
|
|
6342
|
+
this.persistCache();
|
|
6343
|
+
return;
|
|
6344
|
+
}
|
|
6345
|
+
const next = {};
|
|
6346
|
+
for (const [agentId, raw] of Object.entries(map)) {
|
|
6347
|
+
const value = normalizeFlagValue(definition, raw);
|
|
6348
|
+
if (value !== void 0) next[agentId] = value;
|
|
6349
|
+
}
|
|
6350
|
+
this.notifyDispatchByAgent = next;
|
|
6351
|
+
this.persistCache();
|
|
6352
|
+
}
|
|
6353
|
+
/**
|
|
6354
|
+
* ENG-7682 follow-up: resolve an enum flag FOR A SPECIFIC AGENT. Precedence:
|
|
6355
|
+
*
|
|
6356
|
+
* env override -> per-agent heartbeat value -> host-wide value (getString)
|
|
6357
|
+
*
|
|
6358
|
+
* The env override still wins (AGT_NOTIFY_DISPATCH stays the per-process
|
|
6359
|
+
* operator escape hatch); otherwise a per-agent heartbeat value beats the
|
|
6360
|
+
* host-wide one, and an agent with no per-agent entry inherits the host-wide
|
|
6361
|
+
* value unchanged. Only notify-dispatch is threaded per-agent today; other
|
|
6362
|
+
* enum flags stay host-wide, so a non-notify key just delegates to getString.
|
|
6363
|
+
*/
|
|
6364
|
+
getStringForAgent(key, agentId) {
|
|
6365
|
+
const definition = getFlagDefinition(key);
|
|
6366
|
+
if (!definition || definition.flagType !== "enum") return this.getString(key);
|
|
6367
|
+
const envValue = definition.envVar ? coerceEnvValue(definition, this.env[definition.envVar]) : void 0;
|
|
6368
|
+
if (envValue !== void 0 && typeof envValue === "string") return envValue;
|
|
6369
|
+
if (agentId && key === "notify-dispatch") {
|
|
6370
|
+
const perAgent = this.notifyDispatchByAgent[agentId];
|
|
6371
|
+
if (typeof perAgent === "string") {
|
|
6372
|
+
const normalized = normalizeFlagValue(definition, perAgent);
|
|
6373
|
+
if (typeof normalized === "string") return normalized;
|
|
6374
|
+
}
|
|
6375
|
+
}
|
|
6376
|
+
return this.getString(key);
|
|
6377
|
+
}
|
|
6299
6378
|
};
|
|
6300
6379
|
|
|
6301
6380
|
// src/lib/stale-mcp-reaper.ts
|
|
@@ -8199,4 +8278,4 @@ export {
|
|
|
8199
8278
|
managerInstallSystemUnitCommand,
|
|
8200
8279
|
managerUninstallSystemUnitCommand
|
|
8201
8280
|
};
|
|
8202
|
-
//# sourceMappingURL=chunk-
|
|
8281
|
+
//# sourceMappingURL=chunk-OYOZL3N4.js.map
|