@theokit/sdk 4.47.0 → 4.48.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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.48.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+
3
9
  ## 4.47.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -2197,6 +2197,29 @@ function resolveTrustPosture(input) {
2197
2197
  return { level, source, allows };
2198
2198
  }
2199
2199
 
2200
+ // src/wiring-record.ts
2201
+ var UngatedCapabilityError = class extends chunkYULF6FPB_cjs.TheokitAgentError {
2202
+ name = "UngatedCapabilityError";
2203
+ };
2204
+ function recordWiring(input) {
2205
+ const record = {};
2206
+ for (const [capability, requested] of Object.entries(input.requested)) {
2207
+ const allowed = input.posture.allows[capability];
2208
+ if (allowed === void 0) {
2209
+ throw new UngatedCapabilityError(
2210
+ `capability \`${capability}\` was recorded as wired but the posture does not gate it; gated capabilities are: ${Object.keys(input.posture.allows).join(", ") || "(none)"}`
2211
+ );
2212
+ }
2213
+ record[capability] = {
2214
+ // Copied, not aliased. See the @returns note.
2215
+ active: allowed ? [...requested] : [],
2216
+ requested: [...requested],
2217
+ suppressedByTrust: !allowed && requested.length > 0
2218
+ };
2219
+ }
2220
+ return record;
2221
+ }
2222
+
2200
2223
  Object.defineProperty(exports, "GOAL_CONTINUATION_MARKER", {
2201
2224
  enumerable: true,
2202
2225
  get: function () { return chunkOBA6YK2R_cjs.GOAL_CONTINUATION_MARKER; }
@@ -2344,6 +2367,7 @@ exports.Squad = Squad;
2344
2367
  exports.Task = Task;
2345
2368
  exports.Theokit = Theokit;
2346
2369
  exports.TokenLimiter = TokenLimiter;
2370
+ exports.UngatedCapabilityError = UngatedCapabilityError;
2347
2371
  exports.UnicodeNormalizer = UnicodeNormalizer;
2348
2372
  exports.applyMode = applyMode;
2349
2373
  exports.applySecurityFloor = applySecurityFloor;
@@ -2359,6 +2383,7 @@ exports.mkMemoryId = mkMemoryId;
2359
2383
  exports.normalizeSchema = normalizeSchema;
2360
2384
  exports.normalizeUsage = normalizeUsage;
2361
2385
  exports.preflightCheck = preflightCheck;
2386
+ exports.recordWiring = recordWiring;
2362
2387
  exports.resolveTrustPosture = resolveTrustPosture;
2363
2388
  exports.runGoalLoop = runGoalLoop;
2364
2389
  exports.scopedConversationId = scopedConversationId;