@theokit/sdk 4.49.0 → 4.51.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{agent-JA4ILE5O.cjs → agent-B2WU3JP6.cjs} +10 -9
  3. package/dist/{agent-JA4ILE5O.cjs.map → agent-B2WU3JP6.cjs.map} +1 -1
  4. package/dist/{agent-GKX5FE5K.js → agent-DI2QQHSJ.js} +9 -8
  5. package/dist/{agent-GKX5FE5K.js.map → agent-DI2QQHSJ.js.map} +1 -1
  6. package/dist/{chunk-3NLOQEJR.js → chunk-34XOCZJO.js} +5 -16
  7. package/dist/chunk-34XOCZJO.js.map +1 -0
  8. package/dist/{chunk-64TJCXY5.cjs → chunk-3G6ZDZ6L.cjs} +5 -5
  9. package/dist/{chunk-64TJCXY5.cjs.map → chunk-3G6ZDZ6L.cjs.map} +1 -1
  10. package/dist/{chunk-JO76RWCA.cjs → chunk-72HEBGWN.cjs} +4 -4
  11. package/dist/{chunk-JO76RWCA.cjs.map → chunk-72HEBGWN.cjs.map} +1 -1
  12. package/dist/{chunk-XARLSCKA.js → chunk-ACHVCIDQ.js} +11 -11
  13. package/dist/chunk-ACHVCIDQ.js.map +1 -0
  14. package/dist/{chunk-RJBHWM6D.js → chunk-E54KDYOE.js} +3 -3
  15. package/dist/{chunk-RJBHWM6D.js.map → chunk-E54KDYOE.js.map} +1 -1
  16. package/dist/{chunk-2S6B5B2A.js → chunk-E7WDXT4X.js} +3 -3
  17. package/dist/{chunk-2S6B5B2A.js.map → chunk-E7WDXT4X.js.map} +1 -1
  18. package/dist/{chunk-TSK4VVBW.cjs → chunk-F7OBYH2X.cjs} +52 -52
  19. package/dist/chunk-F7OBYH2X.cjs.map +1 -0
  20. package/dist/{chunk-6FSQ3CHQ.js → chunk-JGYYNDAZ.js} +5 -6
  21. package/dist/chunk-JGYYNDAZ.js.map +1 -0
  22. package/dist/{chunk-UU7MAO2D.cjs → chunk-OKLYRPKL.cjs} +4 -16
  23. package/dist/chunk-OKLYRPKL.cjs.map +1 -0
  24. package/dist/{chunk-EON4YTR6.js → chunk-R2A3WIJY.js} +3 -3
  25. package/dist/{chunk-EON4YTR6.js.map → chunk-R2A3WIJY.js.map} +1 -1
  26. package/dist/chunk-RIAM53CP.js +22 -0
  27. package/dist/chunk-RIAM53CP.js.map +1 -0
  28. package/dist/{chunk-GH52NOCL.cjs → chunk-RWMNTFHZ.cjs} +9 -9
  29. package/dist/{chunk-GH52NOCL.cjs.map → chunk-RWMNTFHZ.cjs.map} +1 -1
  30. package/dist/{chunk-MZQHVN7C.js → chunk-SEZJGV7C.js} +3 -3
  31. package/dist/{chunk-MZQHVN7C.js.map → chunk-SEZJGV7C.js.map} +1 -1
  32. package/dist/{chunk-FAUKVJCC.cjs → chunk-UQHIEUDY.cjs} +3 -3
  33. package/dist/{chunk-FAUKVJCC.cjs.map → chunk-UQHIEUDY.cjs.map} +1 -1
  34. package/dist/{chunk-UJ7HK7BX.js → chunk-VK7SIDYI.js} +3 -3
  35. package/dist/{chunk-UJ7HK7BX.js.map → chunk-VK7SIDYI.js.map} +1 -1
  36. package/dist/chunk-VKJ7V7EB.cjs +25 -0
  37. package/dist/chunk-VKJ7V7EB.cjs.map +1 -0
  38. package/dist/{chunk-74VVGK7P.cjs → chunk-WUUSAMFC.cjs} +5 -5
  39. package/dist/{chunk-74VVGK7P.cjs.map → chunk-WUUSAMFC.cjs.map} +1 -1
  40. package/dist/{chunk-XA3TSBAH.cjs → chunk-XABN5HY6.cjs} +4 -5
  41. package/dist/chunk-XABN5HY6.cjs.map +1 -0
  42. package/dist/{compact-session-UUCBTBCZ.cjs → compact-session-FKYCJRAK.cjs} +4 -3
  43. package/dist/{compact-session-UUCBTBCZ.cjs.map → compact-session-FKYCJRAK.cjs.map} +1 -1
  44. package/dist/{compact-session-GF2CBKXB.js → compact-session-LF4YOT5S.js} +4 -3
  45. package/dist/{compact-session-GF2CBKXB.js.map → compact-session-LF4YOT5S.js.map} +1 -1
  46. package/dist/context/index.cjs +6 -5
  47. package/dist/context/index.cjs.map +1 -1
  48. package/dist/context/index.js +3 -2
  49. package/dist/context/index.js.map +1 -1
  50. package/dist/cron.cjs +9 -8
  51. package/dist/cron.js +8 -7
  52. package/dist/eval.cjs +8 -7
  53. package/dist/eval.cjs.map +1 -1
  54. package/dist/eval.js +7 -6
  55. package/dist/eval.js.map +1 -1
  56. package/dist/filesystem/index.cjs +6 -5
  57. package/dist/filesystem/index.cjs.map +1 -1
  58. package/dist/filesystem/index.js +2 -1
  59. package/dist/filesystem/index.js.map +1 -1
  60. package/dist/{index-manager-YFFEPISE.cjs → index-manager-34ELCOAP.cjs} +6 -5
  61. package/dist/{index-manager-YFFEPISE.cjs.map → index-manager-34ELCOAP.cjs.map} +1 -1
  62. package/dist/index-manager-OMJVYS2U.js +12 -0
  63. package/dist/{index-manager-X5IPG2JL.js.map → index-manager-OMJVYS2U.js.map} +1 -1
  64. package/dist/index.cjs +183 -35
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.cts +320 -1
  67. package/dist/index.d.ts +320 -1
  68. package/dist/index.js +152 -13
  69. package/dist/index.js.map +1 -1
  70. package/dist/{inject-session-I3HK3AHB.cjs → inject-session-J7Y6XACY.cjs} +4 -4
  71. package/dist/{inject-session-I3HK3AHB.cjs.map → inject-session-J7Y6XACY.cjs.map} +1 -1
  72. package/dist/{inject-session-NR64GB3T.js → inject-session-MWRJENH4.js} +3 -3
  73. package/dist/{inject-session-NR64GB3T.js.map → inject-session-MWRJENH4.js.map} +1 -1
  74. package/dist/internal/memory/adapters/index.cjs +2 -1
  75. package/dist/internal/memory/adapters/index.js +2 -1
  76. package/dist/internal/security/index.cjs +9 -8
  77. package/dist/internal/security/index.js +2 -1
  78. package/dist/path-safety.cjs +9 -8
  79. package/dist/path-safety.js +2 -1
  80. package/dist/skills.cjs +5 -4
  81. package/dist/skills.js +3 -2
  82. package/dist/workflow.cjs +11 -10
  83. package/dist/workflow.js +3 -2
  84. package/package.json +1 -1
  85. package/dist/chunk-3NLOQEJR.js.map +0 -1
  86. package/dist/chunk-6FSQ3CHQ.js.map +0 -1
  87. package/dist/chunk-TSK4VVBW.cjs.map +0 -1
  88. package/dist/chunk-UU7MAO2D.cjs.map +0 -1
  89. package/dist/chunk-XA3TSBAH.cjs.map +0 -1
  90. package/dist/chunk-XARLSCKA.js.map +0 -1
  91. package/dist/index-manager-X5IPG2JL.js +0 -11
package/dist/index.d.cts CHANGED
@@ -806,6 +806,122 @@ declare class AgentFactory {
806
806
  static create(common: Partial<AgentOptions>): AgentFactory;
807
807
  }
808
808
 
809
+ /**
810
+ * Decide whether a tool call proceeds, and say WHY — as a typed signal rather than a tool result.
811
+ *
812
+ * When a veto is delivered as an ordinary tool result, the MODEL reads it as output: it sees a
813
+ * string, concludes the tool failed for some reason, and retries or works around it. A denial, an
814
+ * error, and a tool that legitimately returned the word "denied" become indistinguishable to
815
+ * everything downstream — including the surface that should be telling the user what happened.
816
+ *
817
+ * ## What is generic, and what is not
818
+ *
819
+ * The RULE is a precedence: an explicit per-tool decision outranks the mode, a convenience mode does
820
+ * not overturn an explicit refusal, and anything undecided falls to the mode. The VOCABULARY is not
821
+ * — which tools exist belongs to the product and arrives as data. Nothing here names one.
822
+ *
823
+ * Deliberately separate from the blast-radius policy: that one answers "what does this action
824
+ * reach", this one answers "who said yes". Keeping them apart is what lets a product gate on reach
825
+ * without re-implementing the mode ladder, and compose both where it needs to.
826
+ *
827
+ * @public
828
+ */
829
+ /** What the operator chose for everything not decided per tool. @public */
830
+ type ApprovalMode = "ask" | "never-ask" | "refuse-all";
831
+ /** @public */
832
+ type ApprovalOutcome = "allow" | "ask" | "deny";
833
+ /** @public */
834
+ type ApprovalReason = "explicitly-allowed" | "explicitly-denied" | "mode-ask" | "mode-never-ask" | "mode-refuse-all";
835
+ /** @public */
836
+ interface ApprovalInput {
837
+ readonly tool: string;
838
+ readonly mode: ApprovalMode;
839
+ /** Tools the operator allowed once and for all. */
840
+ readonly allowed?: readonly string[];
841
+ /** Tools the operator refused. Outranks `allowed` and every mode. */
842
+ readonly denied?: readonly string[];
843
+ }
844
+ /** @public */
845
+ interface ApprovalDecision {
846
+ readonly outcome: ApprovalOutcome;
847
+ readonly reason: ApprovalReason;
848
+ /** The tool the decision was about, so a surface names it without re-deriving it. */
849
+ readonly tool: string;
850
+ }
851
+ /**
852
+ * @returns the outcome, why it was reached, and the tool it was about.
853
+ * @public
854
+ */
855
+ declare function decideApproval(input: ApprovalInput): ApprovalDecision;
856
+
857
+ /**
858
+ * Decide an action by what it REACHES and whether it can be undone — not by its name.
859
+ *
860
+ * A sandbox answers "which files may this process touch", and that is a different question from the
861
+ * one that decides whether an action is safe. A tool that drops a production database touches no
862
+ * file the sandbox cares about; a tool that lists pods reaches an entire cluster while writing
863
+ * nothing. Confinement covers the disk, not the reach.
864
+ *
865
+ * With nothing better available, every product gates on the tool's NAME: an allowlist of strings
866
+ * that says nothing about what the tool does, drifts the moment one is renamed, and cannot be
867
+ * reasoned about by anyone who did not write it. A guard each product re-implements is a guard some
868
+ * product forgets.
869
+ *
870
+ * ## What is generic here, and what is not
871
+ *
872
+ * The RULE is: an action declares the scope it reaches and whether it is reversible, and a policy
873
+ * decides from those two facts plus what the operator granted. The VOCABULARY is not — which scopes
874
+ * exist ("cluster:prod", "billing-account", "the laptop") belongs to the product and arrives as
875
+ * data. Nothing in this module names a scope, the same way the security floor names no sandbox mode
876
+ * and the trust posture names no capability.
877
+ *
878
+ * ## Why the reason is part of the answer
879
+ *
880
+ * "The sandbox stopped this" and "you never granted reach to that scope" are different facts with
881
+ * different fixes, and an operator told the wrong one widens the wrong thing. So a decision carries
882
+ * WHY — the same reason a trust posture reports its `source` and a wiring record distinguishes
883
+ * withheld-by-trust from never-configured.
884
+ *
885
+ * @public
886
+ */
887
+ /** What an action reaches, and whether it can be taken back. @public */
888
+ interface DeclaredAction {
889
+ /**
890
+ * The product's name for what this action reaches. An empty string is treated as UNDECLARED and
891
+ * refused: a tool that forgot to declare is not a tool that reaches nothing.
892
+ */
893
+ readonly scope: string;
894
+ /**
895
+ * Whether the action can be undone. Reversible actions inside a granted scope proceed;
896
+ * irreversible ones ask, because granting reach is not granting destruction.
897
+ */
898
+ readonly reversible: boolean;
899
+ }
900
+ /** @public */
901
+ interface BlastRadiusInput {
902
+ readonly action: DeclaredAction;
903
+ /** Scopes the operator granted reach to. Empty grants nothing — never everything. */
904
+ readonly granted: readonly string[];
905
+ /** Scopes where the operator pre-approved irreversible actions, so an unattended run can work. */
906
+ readonly irreversibleAllowed?: readonly string[];
907
+ }
908
+ /** @public */
909
+ type BlastRadiusOutcome = "allow" | "require-approval" | "refuse";
910
+ /** Why the decision came out that way. Rendered to the operator and read by an audit. @public */
911
+ type BlastRadiusReason = "within-granted-scope" | "irreversible" | "scope-not-granted" | "scope-undeclared";
912
+ /** @public */
913
+ interface BlastRadiusDecision {
914
+ readonly outcome: BlastRadiusOutcome;
915
+ readonly reason: BlastRadiusReason;
916
+ /** The scope the decision was made about, so a surface can name it without re-deriving it. */
917
+ readonly scope: string;
918
+ }
919
+ /**
920
+ * @returns the outcome with the reason and the scope it was decided on.
921
+ * @public
922
+ */
923
+ declare function evaluateBlastRadius(input: BlastRadiusInput): BlastRadiusDecision;
924
+
809
925
  /**
810
926
  * computeCost — apply pricing entries to a TokenUsage and produce a
811
927
  * CostBreakdown (ADRs D377, D378).
@@ -1067,6 +1183,48 @@ declare class UnicodeNormalizer {
1067
1183
  static create(opts?: UnicodeNormalizerOptions): Processor;
1068
1184
  }
1069
1185
 
1186
+ /**
1187
+ * Report whether a credential resolved — never what it is.
1188
+ *
1189
+ * Every agent product grows a "why can't I use this model?" surface: a doctor command, a status
1190
+ * panel, a startup diagnostic. Each needs to know whether a credential resolved, and each is one
1191
+ * careless line from printing it. The line is careless precisely because it is convenient — the
1192
+ * value is right there, and whoever is debugging a routing problem wants to see it.
1193
+ *
1194
+ * So presence-only is the DEFAULT here rather than each consumer's discipline. Discipline is what
1195
+ * every product has until the day it does not, and a leaked key is not a defect anyone can withdraw.
1196
+ *
1197
+ * ## Why a fingerprint and not a prefix
1198
+ *
1199
+ * A report has to be actionable: two people asking "is it the same key?" need something to compare.
1200
+ * The convenient answer — the first eight characters — is still the secret, and it is enough to
1201
+ * identify a key in a breach corpus. A hash is not.
1202
+ *
1203
+ * @public
1204
+ */
1205
+ /** @public */
1206
+ interface CredentialInput {
1207
+ /** The product's name for the provider. This module never knows one of its own. */
1208
+ readonly provider: string;
1209
+ /** The resolved secret, or `undefined`/empty when nothing resolved. */
1210
+ readonly value: string | undefined;
1211
+ /** Where it came from, in the product's vocabulary — `env`, `file`, `keychain`, `oauth`. */
1212
+ readonly source: string;
1213
+ }
1214
+ /** @public */
1215
+ interface CredentialReport {
1216
+ readonly provider: string;
1217
+ readonly present: boolean;
1218
+ readonly source: string;
1219
+ /** Eight hex characters of a hash. Absent when no credential resolved. Never a prefix. */
1220
+ readonly fingerprint?: string;
1221
+ }
1222
+ /**
1223
+ * @returns a report safe to log, render and attach to a support bundle.
1224
+ * @public
1225
+ */
1226
+ declare function describeCredential(input: CredentialInput): CredentialReport;
1227
+
1070
1228
  /**
1071
1229
  * Plugin contract — RUNTIME value + type re-exports (T1.1, ADRs D97-D101).
1072
1230
  *
@@ -2019,6 +2177,87 @@ type MutableEnv = Record<string, string | undefined>;
2019
2177
  */
2020
2178
  declare function loadProjectEnv(env?: MutableEnv, load?: (() => void) | undefined): void;
2021
2179
 
2180
+ /**
2181
+ * Decide which session artifacts may be deleted — and never delete them.
2182
+ *
2183
+ * This package creates session artifacts (transcripts, locks, temp files) and cleans up only what is
2184
+ * in flight in the operation doing the cleaning: a lock it just released, a `.tmp` from a failed
2185
+ * atomic write. Nothing collects the rest, so every consumer either writes its own collector or lets
2186
+ * the directory grow without bound — and a hand-rolled collector on the path that deletes a user's
2187
+ * transcript is the worst place for each product to learn the same lessons separately.
2188
+ *
2189
+ * ## Planning is not deleting, deliberately
2190
+ *
2191
+ * A function that decided AND deleted could not be tested without a filesystem, and the case that
2192
+ * matters most — "we could not establish whether this session is live" — would have to be simulated
2193
+ * rather than asserted. Here the decision is pure: the plan IS the dry run, and executing it is a
2194
+ * separate act on a value someone can read first. That separation is the dry-run guarantee, rather
2195
+ * than a flag that has to be remembered.
2196
+ *
2197
+ * ## The tri-state
2198
+ *
2199
+ * `keep`, `reap`, `undetermined`. An artifact whose liveness could not be established is never
2200
+ * reaped and never quietly counted as dead. Collapsing "could not determine" into "not there" is how
2201
+ * a collector deletes a session running on another machine, or behind a mount that answered slowly.
2202
+ * The third bucket costs a branch and buys the only guarantee worth having on this path.
2203
+ *
2204
+ * @public
2205
+ */
2206
+
2207
+ /** Raised when a retention policy cannot be honoured as written. @public */
2208
+ declare class RetentionPolicyError extends TheokitAgentError {
2209
+ readonly name = "RetentionPolicyError";
2210
+ }
2211
+ /** @public */
2212
+ interface ReapableArtifact {
2213
+ readonly id: string;
2214
+ /** Epoch milliseconds. Compared against an injected `nowMs`, never against a read clock. */
2215
+ readonly lastModifiedMs: number;
2216
+ /**
2217
+ * Whether a writer still holds this artifact. `"unknown"` when the caller could not establish it —
2218
+ * a stale lock behind a slow mount, a PID on another host — and it is honoured as a third answer
2219
+ * rather than folded into `false`.
2220
+ */
2221
+ readonly live: boolean | "unknown";
2222
+ }
2223
+ /** @public */
2224
+ interface RetentionPolicy {
2225
+ /** Artifacts strictly older than this are candidates. The boundary itself is kept. */
2226
+ readonly maxAgeMs: number;
2227
+ /**
2228
+ * A FLOOR on how many artifacts survive: "you will always have your last N sessions". When
2229
+ * liveness and the retention window already spare N or more, this changes nothing; when they
2230
+ * spare fewer, the newest of the remainder are spared until the count reaches N.
2231
+ *
2232
+ * Undetermined artifacts do NOT count toward the floor. Their liveness was never established, so
2233
+ * counting them would let a transient mount failure satisfy the floor with artifacts nobody
2234
+ * confirmed exist as sessions — and quietly delete the ones that do.
2235
+ */
2236
+ readonly keepLast: number;
2237
+ }
2238
+ /** Why an artifact survived. @public */
2239
+ type KeepReason = "live" | "within-retention" | "keep-last";
2240
+ /** @public */
2241
+ interface KeptArtifact extends ReapableArtifact {
2242
+ readonly reason: KeepReason;
2243
+ }
2244
+ /** @public */
2245
+ interface ReapPlan {
2246
+ /** Safe to delete. Everything here was decided, not defaulted. */
2247
+ readonly reap: readonly ReapableArtifact[];
2248
+ readonly keep: readonly KeptArtifact[];
2249
+ /** Liveness could not be established. Never deleted, never counted as kept. */
2250
+ readonly undetermined: readonly ReapableArtifact[];
2251
+ }
2252
+ /** @public */
2253
+ interface ReapPlanInput {
2254
+ readonly artifacts: readonly ReapableArtifact[];
2255
+ readonly retention: RetentionPolicy;
2256
+ /** Injected so the plan is reproducible and testable; this module never reads a clock. */
2257
+ readonly nowMs: number;
2258
+ }
2259
+ declare function planReaping(input: ReapPlanInput): ReapPlan;
2260
+
2022
2261
  /** The internal JSON-Schema shape the synthetic `output` tool consumes. */
2023
2262
  type NormalizedJsonSchema = Record<string, unknown>;
2024
2263
  /**
@@ -2154,6 +2393,51 @@ interface SecurityFloorInput {
2154
2393
  */
2155
2394
  declare function applySecurityFloor(input: SecurityFloorInput): string | undefined;
2156
2395
 
2396
+ /**
2397
+ * Refuse to destroy a session another process is still writing.
2398
+ *
2399
+ * Every agent product that lets a user delete or overwrite a session needs this, and the failure is
2400
+ * unrecoverable in the worst way: a transcript removed underneath a running session takes with it
2401
+ * everything that session had not flushed, and nothing errors. The user sees a successful delete.
2402
+ *
2403
+ * ## The ordering is the point
2404
+ *
2405
+ * The check runs BEFORE anything is mutated. Removing a registry entry and then refusing leaves a
2406
+ * session that can be neither opened nor deleted — worse than either outcome on its own. So this is
2407
+ * a function the caller passes through rather than a flag it may consult afterwards: the throw is
2408
+ * what stops the mutation, and there is no way to read the answer and forget to act on it.
2409
+ *
2410
+ * ## What is generic, and what is not
2411
+ *
2412
+ * The RULE is: a session declared live is not destroyable, and refusing says which one and why. The
2413
+ * VOCABULARY is not — how a product decides liveness (a pointer file, the newest transcript, a
2414
+ * lease, an active registry entry) is its own. Nothing here touches a filesystem.
2415
+ *
2416
+ * @public
2417
+ */
2418
+
2419
+ /** Why the destruction was refused. @public */
2420
+ type LiveSessionReason = "session-is-live" | "liveness-undetermined";
2421
+ /** @public */
2422
+ declare class LiveSessionError extends TheokitAgentError {
2423
+ readonly name = "LiveSessionError";
2424
+ readonly sessionId: string;
2425
+ readonly reason: LiveSessionReason;
2426
+ constructor(sessionId: string, reason: LiveSessionReason);
2427
+ }
2428
+ /**
2429
+ * Throw unless `sessionId` is safe to destroy.
2430
+ *
2431
+ * @param live - the sessions the product declares live, or `undefined` when it could not tell.
2432
+ * The distinction is load-bearing: an EMPTY set is a legitimate answer (nothing is open), while
2433
+ * `undefined` refuses. A product that swallowed a read error and returned `[]` would hand this
2434
+ * guard the one input that disables it entirely, on exactly the path that destroys data.
2435
+ * @throws LiveSessionError naming the session and the reason — "close that session" and "the guard
2436
+ * could not read" have different fixes, and conflating them sends the user to close nothing.
2437
+ * @public
2438
+ */
2439
+ declare function guardSessionDestruction(sessionId: string, live: readonly string[] | undefined): void;
2440
+
2157
2441
  /**
2158
2442
  * M3 #62 — scoped session state.
2159
2443
  *
@@ -2642,6 +2926,41 @@ declare class Theokit {
2642
2926
  };
2643
2927
  }
2644
2928
 
2929
+ /**
2930
+ * Attach a blast-radius declaration to a tool, so the approval layer gates on what the tool DOES.
2931
+ *
2932
+ * Without this the only key available to a policy is the tool's NAME, which says nothing about the
2933
+ * action, drifts the moment a tool is renamed, and cannot be reviewed by anyone who did not write
2934
+ * it. `delete_namespace` and `list_pods` differ by a word.
2935
+ *
2936
+ * ## Why a wrapper rather than a field on the input schema
2937
+ *
2938
+ * `inputSchema` is what the MODEL sees. Blast radius is not for the model — it is for the approval
2939
+ * layer — and putting it there would leak policy into the prompt and let a model-authored argument
2940
+ * influence its own gate. The declaration rides alongside the tool instead, under a symbol so it
2941
+ * cannot collide with a tool's own properties or be serialised into a prompt by accident.
2942
+ *
2943
+ * @public
2944
+ */
2945
+
2946
+ /** @public */
2947
+ type WithBlastRadius<T> = T & {
2948
+ readonly [DECLARED]?: DeclaredAction;
2949
+ };
2950
+ /**
2951
+ * @returns the same tool, with its action declared. The tool is not otherwise altered — the model
2952
+ * must see exactly what it saw before.
2953
+ * @public
2954
+ */
2955
+ declare function withBlastRadius<T extends object>(tool: T, action: DeclaredAction): WithBlastRadius<T>;
2956
+ /**
2957
+ * @returns the declared action, or `undefined` when the tool never declared one — NOT an empty
2958
+ * action. "Never declared" and "declared as reaching nothing" are different facts, and collapsing
2959
+ * them is how an unreviewed tool passes as harmless.
2960
+ * @public
2961
+ */
2962
+ declare function describeAction(tool: object): DeclaredAction | undefined;
2963
+
2645
2964
  /**
2646
2965
  * SE7 — `ToolError`: thrown FROM a tool `handler` to report a failure back to
2647
2966
  * the model with structured content (text and/or an image), not just a string.
@@ -2892,4 +3211,4 @@ interface WiringRecordInput<K extends string> {
2892
3211
  */
2893
3212
  declare function recordWiring<K extends string>(input: WiringRecordInput<K>): Readonly<Record<K, WiredEntity>>;
2894
3213
 
2895
- export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeclaredLayer, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, type EnvOptOut, type EnvReachabilityAudit, type EnvReachabilityInput, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, SOVEREIGN_ENV_KEYS, Security, type SecurityFloorInput, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, type SovereignEnvKey, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, type WiredEntity, type WiringRecordInput, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, foldLayers, getPricingEntry, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withCwdMutex };
3214
+ export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type ApprovalDecision, type ApprovalInput, type ApprovalMode, type ApprovalOutcome, type ApprovalReason, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, type BlastRadiusDecision, type BlastRadiusInput, type BlastRadiusOutcome, type BlastRadiusReason, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, type CredentialInput, type CredentialReport, CustomTool, type DeclaredAction, type DeclaredLayer, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, type EnvOptOut, type EnvReachabilityAudit, type EnvReachabilityInput, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, type KeepReason, type KeptArtifact, LayerOrderError, type LayerValues, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LiveSessionError, type LiveSessionReason, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, type ReapPlan, type ReapPlanInput, type ReapableArtifact, type RetentionPolicy, RetentionPolicyError, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, SOVEREIGN_ENV_KEYS, Security, type SecurityFloorInput, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, type SovereignEnvKey, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, type TrustLevel, type TrustPosture, type TrustPostureInput, type TrustSource, UngatedCapabilityError, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, type WiredEntity, type WiringRecordInput, type WithBlastRadius, applySecurityFloor, auditEnvReachability, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, decideApproval, describeAction, describeCredential, estimateTokens, evaluateBlastRadius, extractRawId, foldLayers, getPricingEntry, guardSessionDestruction, inferApiMode, isValidTaskId, loadProjectEnv, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, planReaping, preflightCheck, recordWiring, resolveTrustPosture, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, verifyLayerOrdering, withBlastRadius, withCwdMutex };