@theokit/sdk 4.47.0 → 4.49.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.49.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d0d62bd: Add `auditEnvReachability`: report config keys with no environment path and no documented opt-out, and opt-outs that no longer exempt anything.
8
+
9
+ ## 4.48.0
10
+
11
+ ### Minor Changes
12
+
13
+ - d9ddcbe: Add `recordWiring`: report which project entities a build requested, which it wired, and which a trust posture withheld — derived from the values handed to the builder rather than from re-reading configuration.
14
+
3
15
  ## 4.47.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -661,6 +661,17 @@ var SkillReadTool = class {
661
661
  }
662
662
  };
663
663
 
664
+ // src/env-reachability.ts
665
+ function auditEnvReachability(input) {
666
+ const reachable = new Set(input.reachable);
667
+ const exempt = new Set(input.optOuts.map((o) => o.key));
668
+ const declared = new Set(input.keys);
669
+ return {
670
+ unreachable: input.keys.filter((k) => !reachable.has(k) && !exempt.has(k)),
671
+ staleOptOuts: input.optOuts.filter((o) => !declared.has(o.key) || reachable.has(o.key)).map((o) => o.key)
672
+ };
673
+ }
674
+
664
675
  // src/event-bus.ts
665
676
  var EventBus = class {
666
677
  handlers = /* @__PURE__ */ new Map();
@@ -2197,6 +2208,29 @@ function resolveTrustPosture(input) {
2197
2208
  return { level, source, allows };
2198
2209
  }
2199
2210
 
2211
+ // src/wiring-record.ts
2212
+ var UngatedCapabilityError = class extends chunkYULF6FPB_cjs.TheokitAgentError {
2213
+ name = "UngatedCapabilityError";
2214
+ };
2215
+ function recordWiring(input) {
2216
+ const record = {};
2217
+ for (const [capability, requested] of Object.entries(input.requested)) {
2218
+ const allowed = input.posture.allows[capability];
2219
+ if (allowed === void 0) {
2220
+ throw new UngatedCapabilityError(
2221
+ `capability \`${capability}\` was recorded as wired but the posture does not gate it; gated capabilities are: ${Object.keys(input.posture.allows).join(", ") || "(none)"}`
2222
+ );
2223
+ }
2224
+ record[capability] = {
2225
+ // Copied, not aliased. See the @returns note.
2226
+ active: allowed ? [...requested] : [],
2227
+ requested: [...requested],
2228
+ suppressedByTrust: !allowed && requested.length > 0
2229
+ };
2230
+ }
2231
+ return record;
2232
+ }
2233
+
2200
2234
  Object.defineProperty(exports, "GOAL_CONTINUATION_MARKER", {
2201
2235
  enumerable: true,
2202
2236
  get: function () { return chunkOBA6YK2R_cjs.GOAL_CONTINUATION_MARKER; }
@@ -2344,9 +2378,11 @@ exports.Squad = Squad;
2344
2378
  exports.Task = Task;
2345
2379
  exports.Theokit = Theokit;
2346
2380
  exports.TokenLimiter = TokenLimiter;
2381
+ exports.UngatedCapabilityError = UngatedCapabilityError;
2347
2382
  exports.UnicodeNormalizer = UnicodeNormalizer;
2348
2383
  exports.applyMode = applyMode;
2349
2384
  exports.applySecurityFloor = applySecurityFloor;
2385
+ exports.auditEnvReachability = auditEnvReachability;
2350
2386
  exports.chargeAndCheckThresholds = chargeAndCheckThresholds;
2351
2387
  exports.createCounterBudgetTracker = createCounterBudgetTracker;
2352
2388
  exports.estimateTokens = estimateTokens;
@@ -2359,6 +2395,7 @@ exports.mkMemoryId = mkMemoryId;
2359
2395
  exports.normalizeSchema = normalizeSchema;
2360
2396
  exports.normalizeUsage = normalizeUsage;
2361
2397
  exports.preflightCheck = preflightCheck;
2398
+ exports.recordWiring = recordWiring;
2362
2399
  exports.resolveTrustPosture = resolveTrustPosture;
2363
2400
  exports.runGoalLoop = runGoalLoop;
2364
2401
  exports.scopedConversationId = scopedConversationId;