@integrity-labs/agt-cli 0.28.1113 → 0.28.1114

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.
@@ -39850,8 +39850,38 @@ import { join as join10 } from "path";
39850
39850
  import { existsSync as existsSync4, readFileSync as readFileSync8 } from "fs";
39851
39851
  import { homedir as homedir2 } from "os";
39852
39852
  import { join as join9 } from "path";
39853
- function defaultFlagsCachePath() {
39854
- return join9(homedir2(), ".augmented", "flags-cache.json");
39853
+ function hasUsableFlags(path) {
39854
+ try {
39855
+ if (!existsSync4(path)) return false;
39856
+ const parsed = JSON.parse(readFileSync8(path, "utf8"));
39857
+ if (!parsed || typeof parsed !== "object") return false;
39858
+ const flags = parsed.flags;
39859
+ return !!flags && typeof flags === "object" && !Array.isArray(flags);
39860
+ } catch {
39861
+ return false;
39862
+ }
39863
+ }
39864
+ function cacheUpdatedAt(path) {
39865
+ try {
39866
+ if (!existsSync4(path)) return void 0;
39867
+ const parsed = JSON.parse(readFileSync8(path, "utf8"));
39868
+ if (!parsed || typeof parsed !== "object") return void 0;
39869
+ const u = parsed.updated_at;
39870
+ return typeof u === "string" && u.length > 0 ? u : void 0;
39871
+ } catch {
39872
+ return void 0;
39873
+ }
39874
+ }
39875
+ function defaultFlagsCachePath(env2 = process.env) {
39876
+ const hostWide = join9(homedir2(), ".augmented", "flags-cache.json");
39877
+ const agentId = env2["AGT_AGENT_ID"]?.trim();
39878
+ if (!agentId) return hostWide;
39879
+ const perAgent = join9(homedir2(), ".augmented", agentId, "flags-cache.json");
39880
+ if (!hasUsableFlags(perAgent)) return hostWide;
39881
+ const hostWideAt = cacheUpdatedAt(hostWide);
39882
+ const perAgentAt = cacheUpdatedAt(perAgent);
39883
+ if (hostWideAt && (!perAgentAt || perAgentAt < hostWideAt)) return hostWide;
39884
+ return perAgent;
39855
39885
  }
39856
39886
  function envBoolean(raw) {
39857
39887
  if (raw === void 0) return void 0;
@@ -39878,7 +39908,7 @@ function resolveHostBooleanFlag(opts) {
39878
39908
  const env2 = opts.env ?? process.env;
39879
39909
  const envValue = envBoolean(env2[opts.envVar]);
39880
39910
  if (envValue !== void 0) return envValue;
39881
- const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath());
39911
+ const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath(env2));
39882
39912
  if (cached2 !== void 0) return cached2;
39883
39913
  return opts.defaultValue;
39884
39914
  }
@@ -39909,7 +39939,7 @@ function cachedMaintenanceMode(path) {
39909
39939
  }
39910
39940
  }
39911
39941
  function resolveMaintenanceMode(opts) {
39912
- const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath());
39942
+ const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath(opts?.env));
39913
39943
  if (cached2 !== void 0) return cached2;
39914
39944
  return "off";
39915
39945
  }
package/dist/mcp/index.js CHANGED
@@ -46189,8 +46189,38 @@ var StdioServerTransport = class {
46189
46189
  import { existsSync as existsSync2, readFileSync as readFileSync4 } from "fs";
46190
46190
  import { homedir as homedir2 } from "os";
46191
46191
  import { join as join6 } from "path";
46192
- function defaultFlagsCachePath() {
46193
- return join6(homedir2(), ".augmented", "flags-cache.json");
46192
+ function hasUsableFlags(path) {
46193
+ try {
46194
+ if (!existsSync2(path)) return false;
46195
+ const parsed = JSON.parse(readFileSync4(path, "utf8"));
46196
+ if (!parsed || typeof parsed !== "object") return false;
46197
+ const flags = parsed.flags;
46198
+ return !!flags && typeof flags === "object" && !Array.isArray(flags);
46199
+ } catch {
46200
+ return false;
46201
+ }
46202
+ }
46203
+ function cacheUpdatedAt(path) {
46204
+ try {
46205
+ if (!existsSync2(path)) return void 0;
46206
+ const parsed = JSON.parse(readFileSync4(path, "utf8"));
46207
+ if (!parsed || typeof parsed !== "object") return void 0;
46208
+ const u = parsed.updated_at;
46209
+ return typeof u === "string" && u.length > 0 ? u : void 0;
46210
+ } catch {
46211
+ return void 0;
46212
+ }
46213
+ }
46214
+ function defaultFlagsCachePath(env2 = process.env) {
46215
+ const hostWide = join6(homedir2(), ".augmented", "flags-cache.json");
46216
+ const agentId = env2["AGT_AGENT_ID"]?.trim();
46217
+ if (!agentId) return hostWide;
46218
+ const perAgent = join6(homedir2(), ".augmented", agentId, "flags-cache.json");
46219
+ if (!hasUsableFlags(perAgent)) return hostWide;
46220
+ const hostWideAt = cacheUpdatedAt(hostWide);
46221
+ const perAgentAt = cacheUpdatedAt(perAgent);
46222
+ if (hostWideAt && (!perAgentAt || perAgentAt < hostWideAt)) return hostWide;
46223
+ return perAgent;
46194
46224
  }
46195
46225
  function envBoolean(raw) {
46196
46226
  if (raw === void 0) return void 0;
@@ -46227,7 +46257,7 @@ function cachedMaintenanceMode(path) {
46227
46257
  }
46228
46258
  }
46229
46259
  function resolveMaintenanceMode(opts) {
46230
- const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath());
46260
+ const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath(opts?.env));
46231
46261
  if (cached2 !== void 0) return cached2;
46232
46262
  return "off";
46233
46263
  }
@@ -30673,8 +30673,38 @@ function isSlackDirectMessage(channelId) {
30673
30673
  import { existsSync, readFileSync } from "fs";
30674
30674
  import { homedir } from "os";
30675
30675
  import { join } from "path";
30676
- function defaultFlagsCachePath() {
30677
- return join(homedir(), ".augmented", "flags-cache.json");
30676
+ function hasUsableFlags(path) {
30677
+ try {
30678
+ if (!existsSync(path)) return false;
30679
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
30680
+ if (!parsed || typeof parsed !== "object") return false;
30681
+ const flags = parsed.flags;
30682
+ return !!flags && typeof flags === "object" && !Array.isArray(flags);
30683
+ } catch {
30684
+ return false;
30685
+ }
30686
+ }
30687
+ function cacheUpdatedAt(path) {
30688
+ try {
30689
+ if (!existsSync(path)) return void 0;
30690
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
30691
+ if (!parsed || typeof parsed !== "object") return void 0;
30692
+ const u = parsed.updated_at;
30693
+ return typeof u === "string" && u.length > 0 ? u : void 0;
30694
+ } catch {
30695
+ return void 0;
30696
+ }
30697
+ }
30698
+ function defaultFlagsCachePath(env2 = process.env) {
30699
+ const hostWide = join(homedir(), ".augmented", "flags-cache.json");
30700
+ const agentId = env2["AGT_AGENT_ID"]?.trim();
30701
+ if (!agentId) return hostWide;
30702
+ const perAgent = join(homedir(), ".augmented", agentId, "flags-cache.json");
30703
+ if (!hasUsableFlags(perAgent)) return hostWide;
30704
+ const hostWideAt = cacheUpdatedAt(hostWide);
30705
+ const perAgentAt = cacheUpdatedAt(perAgent);
30706
+ if (hostWideAt && (!perAgentAt || perAgentAt < hostWideAt)) return hostWide;
30707
+ return perAgent;
30678
30708
  }
30679
30709
  function envBoolean(raw) {
30680
30710
  if (raw === void 0) return void 0;
@@ -30701,7 +30731,7 @@ function resolveHostBooleanFlag(opts) {
30701
30731
  const env2 = opts.env ?? process.env;
30702
30732
  const envValue = envBoolean(env2[opts.envVar]);
30703
30733
  if (envValue !== void 0) return envValue;
30704
- const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath());
30734
+ const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath(env2));
30705
30735
  if (cached2 !== void 0) return cached2;
30706
30736
  return opts.defaultValue;
30707
30737
  }
@@ -30737,7 +30767,7 @@ function resolveGhostReplyMode(opts) {
30737
30767
  if (modeOverride !== void 0) return modeOverride;
30738
30768
  const legacyOverride = parseGhostReplyMode(env2["AGT_GHOST_REPLY_INTENT_CLASSIFIER_ENABLED"]);
30739
30769
  if (legacyOverride !== void 0) return legacyOverride;
30740
- const cached2 = cachedGhostReplyMode(opts?.cachePath ?? defaultFlagsCachePath());
30770
+ const cached2 = cachedGhostReplyMode(opts?.cachePath ?? defaultFlagsCachePath(env2));
30741
30771
  if (cached2 !== void 0) return cached2;
30742
30772
  return "off";
30743
30773
  }
@@ -30768,7 +30798,7 @@ function cachedMaintenanceMode(path) {
30768
30798
  }
30769
30799
  }
30770
30800
  function resolveMaintenanceMode(opts) {
30771
- const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath());
30801
+ const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath(opts?.env));
30772
30802
  if (cached2 !== void 0) return cached2;
30773
30803
  return "off";
30774
30804
  }
@@ -30802,7 +30832,7 @@ function resolveSlackHotThreadMode(opts) {
30802
30832
  const env2 = opts?.env ?? process.env;
30803
30833
  const modeOverride = parseSlackHotThreadMode(env2["AGT_SLACK_HOT_THREAD_GUARD_MODE"]);
30804
30834
  if (modeOverride !== void 0) return modeOverride;
30805
- const cached2 = cachedSlackHotThreadMode(opts?.cachePath ?? defaultFlagsCachePath());
30835
+ const cached2 = cachedSlackHotThreadMode(opts?.cachePath ?? defaultFlagsCachePath(env2));
30806
30836
  if (cached2 !== void 0) return cached2;
30807
30837
  return "off";
30808
30838
  }
@@ -30838,7 +30868,7 @@ function resolveSlackScheduledChannelGuardMode(opts) {
30838
30868
  env2["AGT_SLACK_SCHEDULED_CHANNEL_GUARD_MODE"]
30839
30869
  );
30840
30870
  if (modeOverride !== void 0) return modeOverride;
30841
- const cached2 = cachedSlackScheduledChannelGuardMode(opts?.cachePath ?? defaultFlagsCachePath());
30871
+ const cached2 = cachedSlackScheduledChannelGuardMode(opts?.cachePath ?? defaultFlagsCachePath(env2));
30842
30872
  if (cached2 !== void 0) return cached2;
30843
30873
  return "shadow";
30844
30874
  }
@@ -14169,8 +14169,38 @@ function emitToolCallMarkupRedactionTelemetry(channel) {
14169
14169
  import { existsSync, readFileSync } from "fs";
14170
14170
  import { homedir } from "os";
14171
14171
  import { join } from "path";
14172
- function defaultFlagsCachePath() {
14173
- return join(homedir(), ".augmented", "flags-cache.json");
14172
+ function hasUsableFlags(path) {
14173
+ try {
14174
+ if (!existsSync(path)) return false;
14175
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
14176
+ if (!parsed || typeof parsed !== "object") return false;
14177
+ const flags = parsed.flags;
14178
+ return !!flags && typeof flags === "object" && !Array.isArray(flags);
14179
+ } catch {
14180
+ return false;
14181
+ }
14182
+ }
14183
+ function cacheUpdatedAt(path) {
14184
+ try {
14185
+ if (!existsSync(path)) return void 0;
14186
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
14187
+ if (!parsed || typeof parsed !== "object") return void 0;
14188
+ const u = parsed.updated_at;
14189
+ return typeof u === "string" && u.length > 0 ? u : void 0;
14190
+ } catch {
14191
+ return void 0;
14192
+ }
14193
+ }
14194
+ function defaultFlagsCachePath(env = process.env) {
14195
+ const hostWide = join(homedir(), ".augmented", "flags-cache.json");
14196
+ const agentId = env["AGT_AGENT_ID"]?.trim();
14197
+ if (!agentId) return hostWide;
14198
+ const perAgent = join(homedir(), ".augmented", agentId, "flags-cache.json");
14199
+ if (!hasUsableFlags(perAgent)) return hostWide;
14200
+ const hostWideAt = cacheUpdatedAt(hostWide);
14201
+ const perAgentAt = cacheUpdatedAt(perAgent);
14202
+ if (hostWideAt && (!perAgentAt || perAgentAt < hostWideAt)) return hostWide;
14203
+ return perAgent;
14174
14204
  }
14175
14205
  function envBoolean(raw) {
14176
14206
  if (raw === void 0) return void 0;
@@ -14197,7 +14227,7 @@ function resolveHostBooleanFlag(opts) {
14197
14227
  const env = opts.env ?? process.env;
14198
14228
  const envValue = envBoolean(env[opts.envVar]);
14199
14229
  if (envValue !== void 0) return envValue;
14200
- const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath());
14230
+ const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath(env));
14201
14231
  if (cached2 !== void 0) return cached2;
14202
14232
  return opts.defaultValue;
14203
14233
  }
@@ -14233,7 +14263,7 @@ function resolveGhostReplyMode(opts) {
14233
14263
  if (modeOverride !== void 0) return modeOverride;
14234
14264
  const legacyOverride = parseGhostReplyMode(env["AGT_GHOST_REPLY_INTENT_CLASSIFIER_ENABLED"]);
14235
14265
  if (legacyOverride !== void 0) return legacyOverride;
14236
- const cached2 = cachedGhostReplyMode(opts?.cachePath ?? defaultFlagsCachePath());
14266
+ const cached2 = cachedGhostReplyMode(opts?.cachePath ?? defaultFlagsCachePath(env));
14237
14267
  if (cached2 !== void 0) return cached2;
14238
14268
  return "off";
14239
14269
  }
@@ -30935,8 +30935,38 @@ var ONBOARDING_DM_ONLY_MESSAGE = "Sorry, I can only be onboarded from a Direct M
30935
30935
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "fs";
30936
30936
  import { homedir as homedir2 } from "os";
30937
30937
  import { join as join2 } from "path";
30938
- function defaultFlagsCachePath() {
30939
- return join2(homedir2(), ".augmented", "flags-cache.json");
30938
+ function hasUsableFlags(path) {
30939
+ try {
30940
+ if (!existsSync2(path)) return false;
30941
+ const parsed = JSON.parse(readFileSync3(path, "utf8"));
30942
+ if (!parsed || typeof parsed !== "object") return false;
30943
+ const flags = parsed.flags;
30944
+ return !!flags && typeof flags === "object" && !Array.isArray(flags);
30945
+ } catch {
30946
+ return false;
30947
+ }
30948
+ }
30949
+ function cacheUpdatedAt(path) {
30950
+ try {
30951
+ if (!existsSync2(path)) return void 0;
30952
+ const parsed = JSON.parse(readFileSync3(path, "utf8"));
30953
+ if (!parsed || typeof parsed !== "object") return void 0;
30954
+ const u = parsed.updated_at;
30955
+ return typeof u === "string" && u.length > 0 ? u : void 0;
30956
+ } catch {
30957
+ return void 0;
30958
+ }
30959
+ }
30960
+ function defaultFlagsCachePath(env2 = process.env) {
30961
+ const hostWide = join2(homedir2(), ".augmented", "flags-cache.json");
30962
+ const agentId = env2["AGT_AGENT_ID"]?.trim();
30963
+ if (!agentId) return hostWide;
30964
+ const perAgent = join2(homedir2(), ".augmented", agentId, "flags-cache.json");
30965
+ if (!hasUsableFlags(perAgent)) return hostWide;
30966
+ const hostWideAt = cacheUpdatedAt(hostWide);
30967
+ const perAgentAt = cacheUpdatedAt(perAgent);
30968
+ if (hostWideAt && (!perAgentAt || perAgentAt < hostWideAt)) return hostWide;
30969
+ return perAgent;
30940
30970
  }
30941
30971
  function envBoolean(raw) {
30942
30972
  if (raw === void 0) return void 0;
@@ -30963,7 +30993,7 @@ function resolveHostBooleanFlag(opts) {
30963
30993
  const env2 = opts.env ?? process.env;
30964
30994
  const envValue = envBoolean(env2[opts.envVar]);
30965
30995
  if (envValue !== void 0) return envValue;
30966
- const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath());
30996
+ const cached2 = cachedBoolean(opts.key, opts.cachePath ?? defaultFlagsCachePath(env2));
30967
30997
  if (cached2 !== void 0) return cached2;
30968
30998
  return opts.defaultValue;
30969
30999
  }
@@ -30999,7 +31029,7 @@ function resolveGhostReplyMode(opts) {
30999
31029
  if (modeOverride !== void 0) return modeOverride;
31000
31030
  const legacyOverride = parseGhostReplyMode(env2["AGT_GHOST_REPLY_INTENT_CLASSIFIER_ENABLED"]);
31001
31031
  if (legacyOverride !== void 0) return legacyOverride;
31002
- const cached2 = cachedGhostReplyMode(opts?.cachePath ?? defaultFlagsCachePath());
31032
+ const cached2 = cachedGhostReplyMode(opts?.cachePath ?? defaultFlagsCachePath(env2));
31003
31033
  if (cached2 !== void 0) return cached2;
31004
31034
  return "off";
31005
31035
  }
@@ -31030,7 +31060,7 @@ function cachedMaintenanceMode(path) {
31030
31060
  }
31031
31061
  }
31032
31062
  function resolveMaintenanceMode(opts) {
31033
- const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath());
31063
+ const cached2 = cachedMaintenanceMode(opts?.cachePath ?? defaultFlagsCachePath(opts?.env));
31034
31064
  if (cached2 !== void 0) return cached2;
31035
31065
  return "off";
31036
31066
  }
@@ -68,7 +68,7 @@ import {
68
68
  writeDirectChatSessionState,
69
69
  writeEgressAllowlist,
70
70
  writePersistentClaudeWrapper
71
- } from "./chunk-JX7ZXCNZ.js";
71
+ } from "./chunk-2XQPQOJX.js";
72
72
  import "./chunk-OBZB6MUE.js";
73
73
  import "./chunk-OCMJ5E6J.js";
74
74
  import "./chunk-XWVM4KPK.js";
@@ -145,4 +145,4 @@ export {
145
145
  writeEgressAllowlist,
146
146
  writePersistentClaudeWrapper
147
147
  };
148
- //# sourceMappingURL=persistent-session-6KIQF4O7.js.map
148
+ //# sourceMappingURL=persistent-session-TDPGTHTG.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-JX7ZXCNZ.js";
3
+ } from "./chunk-2XQPQOJX.js";
4
4
  import "./chunk-OBZB6MUE.js";
5
5
  import "./chunk-OCMJ5E6J.js";
6
6
  import "./chunk-XWVM4KPK.js";
@@ -802,4 +802,4 @@ export {
802
802
  readAndResetSlackReplyBindingClassifications,
803
803
  readAndResetSlackReplyTargetClassifications
804
804
  };
805
- //# sourceMappingURL=responsiveness-probe-GGJNITME.js.map
805
+ //# sourceMappingURL=responsiveness-probe-6P7TB4QA.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1113",
3
+ "version": "0.28.1114",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {