@namzu/sdk 53.2.2 → 55.0.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 (278) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/agents/QueryAgent.d.ts.map +1 -1
  3. package/dist/agents/QueryAgent.js +1 -0
  4. package/dist/agents/QueryAgent.js.map +1 -1
  5. package/dist/compaction/context-breakdown.d.ts +85 -0
  6. package/dist/compaction/context-breakdown.d.ts.map +1 -0
  7. package/dist/compaction/context-breakdown.js +149 -0
  8. package/dist/compaction/context-breakdown.js.map +1 -0
  9. package/dist/compaction/extractor.d.ts.map +1 -1
  10. package/dist/compaction/extractor.js +5 -1
  11. package/dist/compaction/extractor.js.map +1 -1
  12. package/dist/compaction/managers/structured.d.ts.map +1 -1
  13. package/dist/compaction/managers/structured.js +5 -0
  14. package/dist/compaction/managers/structured.js.map +1 -1
  15. package/dist/compaction/manual.d.ts.map +1 -1
  16. package/dist/compaction/manual.js +6 -0
  17. package/dist/compaction/manual.js.map +1 -1
  18. package/dist/compaction/serializer.d.ts +6 -0
  19. package/dist/compaction/serializer.d.ts.map +1 -1
  20. package/dist/compaction/serializer.js +21 -3
  21. package/dist/compaction/serializer.js.map +1 -1
  22. package/dist/compaction/token-estimate.d.ts +2 -0
  23. package/dist/compaction/token-estimate.d.ts.map +1 -1
  24. package/dist/compaction/token-estimate.js +4 -0
  25. package/dist/compaction/token-estimate.js.map +1 -1
  26. package/dist/compaction/verifier.d.ts.map +1 -1
  27. package/dist/compaction/verifier.js +27 -6
  28. package/dist/compaction/verifier.js.map +1 -1
  29. package/dist/constants/compaction/index.d.ts +1 -0
  30. package/dist/constants/compaction/index.d.ts.map +1 -1
  31. package/dist/constants/compaction/index.js +1 -0
  32. package/dist/constants/compaction/index.js.map +1 -1
  33. package/dist/manager/resident/proposal.d.ts +2 -2
  34. package/dist/manager/resident/store.d.ts +4 -4
  35. package/dist/prompt/coding-agent-doctrine.d.ts +3 -3
  36. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  37. package/dist/prompt/coding-agent-doctrine.js +18 -20
  38. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  39. package/dist/public-runtime.d.ts +8 -3
  40. package/dist/public-runtime.d.ts.map +1 -1
  41. package/dist/public-runtime.js +7 -2
  42. package/dist/public-runtime.js.map +1 -1
  43. package/dist/runtime/cache-clock.d.ts +39 -0
  44. package/dist/runtime/cache-clock.d.ts.map +1 -0
  45. package/dist/runtime/cache-clock.js +48 -0
  46. package/dist/runtime/cache-clock.js.map +1 -0
  47. package/dist/runtime/query/checkpoint.d.ts +12 -2
  48. package/dist/runtime/query/checkpoint.d.ts.map +1 -1
  49. package/dist/runtime/query/checkpoint.js +42 -8
  50. package/dist/runtime/query/checkpoint.js.map +1 -1
  51. package/dist/runtime/query/compact-session.d.ts +37 -2
  52. package/dist/runtime/query/compact-session.d.ts.map +1 -1
  53. package/dist/runtime/query/compact-session.js +77 -3
  54. package/dist/runtime/query/compact-session.js.map +1 -1
  55. package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
  56. package/dist/runtime/query/executor/tool-call-admission.js +3 -0
  57. package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
  58. package/dist/runtime/query/executor.d.ts +39 -1
  59. package/dist/runtime/query/executor.d.ts.map +1 -1
  60. package/dist/runtime/query/executor.js +115 -7
  61. package/dist/runtime/query/executor.js.map +1 -1
  62. package/dist/runtime/query/index.d.ts +18 -0
  63. package/dist/runtime/query/index.d.ts.map +1 -1
  64. package/dist/runtime/query/index.js +20 -1
  65. package/dist/runtime/query/index.js.map +1 -1
  66. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  67. package/dist/runtime/query/iteration/index.js +25 -8
  68. package/dist/runtime/query/iteration/index.js.map +1 -1
  69. package/dist/runtime/query/iteration/phases/context.d.ts +24 -2
  70. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  71. package/dist/runtime/query/iteration/phases/context.js +22 -22
  72. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  73. package/dist/runtime/query/iteration/phases/per-call-review.d.ts +78 -0
  74. package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -0
  75. package/dist/runtime/query/iteration/phases/per-call-review.js +494 -0
  76. package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -0
  77. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  78. package/dist/runtime/query/iteration/phases/tool-review.js +129 -62
  79. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  80. package/dist/runtime/query/iteration/step-context.d.ts +14 -0
  81. package/dist/runtime/query/iteration/step-context.d.ts.map +1 -1
  82. package/dist/runtime/query/iteration/step-context.js +29 -0
  83. package/dist/runtime/query/iteration/step-context.js.map +1 -1
  84. package/dist/runtime/query/iteration/step-shaping.d.ts.map +1 -1
  85. package/dist/runtime/query/iteration/step-shaping.js +6 -2
  86. package/dist/runtime/query/iteration/step-shaping.js.map +1 -1
  87. package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
  88. package/dist/runtime/query/prepare-turn.js +16 -3
  89. package/dist/runtime/query/prepare-turn.js.map +1 -1
  90. package/dist/runtime/query/project-instructions.d.ts +24 -5
  91. package/dist/runtime/query/project-instructions.d.ts.map +1 -1
  92. package/dist/runtime/query/project-instructions.js +107 -35
  93. package/dist/runtime/query/project-instructions.js.map +1 -1
  94. package/dist/runtime/query/prompt.d.ts +6 -0
  95. package/dist/runtime/query/prompt.d.ts.map +1 -1
  96. package/dist/runtime/query/prompt.js +10 -49
  97. package/dist/runtime/query/prompt.js.map +1 -1
  98. package/dist/runtime/query/resume-pending.d.ts +8 -0
  99. package/dist/runtime/query/resume-pending.d.ts.map +1 -1
  100. package/dist/runtime/query/resume-pending.js +101 -0
  101. package/dist/runtime/query/resume-pending.js.map +1 -1
  102. package/dist/runtime/query/review-policy.d.ts +18 -0
  103. package/dist/runtime/query/review-policy.d.ts.map +1 -1
  104. package/dist/runtime/query/review-policy.js +10 -0
  105. package/dist/runtime/query/review-policy.js.map +1 -1
  106. package/dist/runtime/query/steering.d.ts +55 -56
  107. package/dist/runtime/query/steering.d.ts.map +1 -1
  108. package/dist/runtime/query/steering.js +78 -72
  109. package/dist/runtime/query/steering.js.map +1 -1
  110. package/dist/store/budget/disk.js +4 -1
  111. package/dist/store/budget/disk.js.map +1 -1
  112. package/dist/tools/admit-facts.d.ts.map +1 -1
  113. package/dist/tools/admit-facts.js +6 -0
  114. package/dist/tools/admit-facts.js.map +1 -1
  115. package/dist/tools/builtins/bash.d.ts +8 -0
  116. package/dist/tools/builtins/bash.d.ts.map +1 -1
  117. package/dist/tools/builtins/bash.js +36 -27
  118. package/dist/tools/builtins/bash.js.map +1 -1
  119. package/dist/tools/builtins/browser.d.ts.map +1 -1
  120. package/dist/tools/builtins/browser.js +38 -12
  121. package/dist/tools/builtins/browser.js.map +1 -1
  122. package/dist/tools/builtins/edit-apply.d.ts +7 -4
  123. package/dist/tools/builtins/edit-apply.d.ts.map +1 -1
  124. package/dist/tools/builtins/edit-apply.js +3 -0
  125. package/dist/tools/builtins/edit-apply.js.map +1 -1
  126. package/dist/tools/builtins/edit.d.ts.map +1 -1
  127. package/dist/tools/builtins/edit.js +31 -11
  128. package/dist/tools/builtins/edit.js.map +1 -1
  129. package/dist/tools/builtins/exit-semantics.d.ts +31 -0
  130. package/dist/tools/builtins/exit-semantics.d.ts.map +1 -0
  131. package/dist/tools/builtins/exit-semantics.js +198 -0
  132. package/dist/tools/builtins/exit-semantics.js.map +1 -0
  133. package/dist/tools/builtins/job.js +1 -1
  134. package/dist/tools/builtins/job.js.map +1 -1
  135. package/dist/tools/builtins/skill.js +1 -1
  136. package/dist/tools/builtins/skill.js.map +1 -1
  137. package/dist/tools/builtins/structuredOutput.js +1 -1
  138. package/dist/tools/builtins/structuredOutput.js.map +1 -1
  139. package/dist/tools/builtins/verify-outputs.js +1 -1
  140. package/dist/tools/builtins/verify-outputs.js.map +1 -1
  141. package/dist/tools/builtins/write-file.js +11 -6
  142. package/dist/tools/builtins/write-file.js.map +1 -1
  143. package/dist/tools/coordinator/ask-user-question.d.ts +6 -0
  144. package/dist/tools/coordinator/ask-user-question.d.ts.map +1 -1
  145. package/dist/tools/coordinator/ask-user-question.js +6 -1
  146. package/dist/tools/coordinator/ask-user-question.js.map +1 -1
  147. package/dist/tools/coordinator/index.d.ts.map +1 -1
  148. package/dist/tools/coordinator/index.js +10 -3
  149. package/dist/tools/coordinator/index.js.map +1 -1
  150. package/dist/tools/memory/delete.js +1 -1
  151. package/dist/tools/memory/delete.js.map +1 -1
  152. package/dist/tools/memory/read.js +1 -1
  153. package/dist/tools/memory/read.js.map +1 -1
  154. package/dist/tools/memory/save.d.ts.map +1 -1
  155. package/dist/tools/memory/save.js +4 -3
  156. package/dist/tools/memory/save.js.map +1 -1
  157. package/dist/tools/memory/search.js +1 -1
  158. package/dist/tools/memory/search.js.map +1 -1
  159. package/dist/tools/memory/update.js +1 -1
  160. package/dist/tools/memory/update.js.map +1 -1
  161. package/dist/tools/schedules/loop-tool.d.ts.map +1 -1
  162. package/dist/tools/schedules/loop-tool.js +4 -2
  163. package/dist/tools/schedules/loop-tool.js.map +1 -1
  164. package/dist/tools/schedules/schedule-tool.js +2 -2
  165. package/dist/tools/schedules/schedule-tool.js.map +1 -1
  166. package/dist/tools/task/create.js +1 -1
  167. package/dist/tools/task/create.js.map +1 -1
  168. package/dist/tools/untrusted-envelope.js +1 -1
  169. package/dist/tools/untrusted-envelope.js.map +1 -1
  170. package/dist/toolsets/manager.d.ts.map +1 -1
  171. package/dist/toolsets/manager.js +6 -1
  172. package/dist/toolsets/manager.js.map +1 -1
  173. package/dist/turn/evidence-query.d.ts.map +1 -1
  174. package/dist/turn/evidence-query.js +16 -1
  175. package/dist/turn/evidence-query.js.map +1 -1
  176. package/dist/turn/evidence-recall.js +1 -1
  177. package/dist/turn/evidence-recall.js.map +1 -1
  178. package/dist/types/agent/base.d.ts +7 -0
  179. package/dist/types/agent/base.d.ts.map +1 -1
  180. package/dist/types/common/index.d.ts +19 -0
  181. package/dist/types/common/index.d.ts.map +1 -1
  182. package/dist/types/common/index.js +9 -0
  183. package/dist/types/common/index.js.map +1 -1
  184. package/dist/types/hitl/index.d.ts +66 -0
  185. package/dist/types/hitl/index.d.ts.map +1 -1
  186. package/dist/types/hitl/index.js.map +1 -1
  187. package/dist/types/message/index.d.ts +8 -0
  188. package/dist/types/message/index.d.ts.map +1 -1
  189. package/dist/types/message/index.js +12 -2
  190. package/dist/types/message/index.js.map +1 -1
  191. package/dist/types/message/notice-frame.d.ts +41 -0
  192. package/dist/types/message/notice-frame.d.ts.map +1 -0
  193. package/dist/types/message/notice-frame.js +65 -0
  194. package/dist/types/message/notice-frame.js.map +1 -0
  195. package/dist/types/provider/chat.d.ts +8 -0
  196. package/dist/types/provider/chat.d.ts.map +1 -1
  197. package/dist/types/provider/config.d.ts +6 -0
  198. package/dist/types/provider/config.d.ts.map +1 -1
  199. package/dist/types/session/checkpoint.d.ts +52 -0
  200. package/dist/types/session/checkpoint.d.ts.map +1 -1
  201. package/dist/types/session/checkpoint.js +5 -0
  202. package/dist/types/session/checkpoint.js.map +1 -1
  203. package/dist/types/session/events.d.ts +9 -0
  204. package/dist/types/session/events.d.ts.map +1 -1
  205. package/dist/types/session/events.js.map +1 -1
  206. package/dist/types/session/records.d.ts +181 -6
  207. package/dist/types/session/records.d.ts.map +1 -1
  208. package/dist/types/session/records.js +1 -1
  209. package/dist/types/session/records.js.map +1 -1
  210. package/dist/types/tool/presentation.d.ts +17 -1
  211. package/dist/types/tool/presentation.d.ts.map +1 -1
  212. package/package.json +1 -1
  213. package/src/agents/QueryAgent.ts +1 -0
  214. package/src/compaction/context-breakdown.ts +228 -0
  215. package/src/compaction/extractor.ts +8 -1
  216. package/src/compaction/managers/structured.ts +3 -0
  217. package/src/compaction/manual.ts +5 -0
  218. package/src/compaction/serializer.ts +28 -3
  219. package/src/compaction/token-estimate.ts +5 -0
  220. package/src/compaction/verifier.ts +32 -6
  221. package/src/constants/compaction/index.ts +1 -0
  222. package/src/prompt/coding-agent-doctrine.ts +18 -20
  223. package/src/public-runtime.ts +24 -2
  224. package/src/runtime/cache-clock.ts +67 -0
  225. package/src/runtime/query/checkpoint.ts +49 -8
  226. package/src/runtime/query/compact-session.ts +101 -3
  227. package/src/runtime/query/executor/tool-call-admission.ts +3 -0
  228. package/src/runtime/query/executor.ts +165 -15
  229. package/src/runtime/query/index.ts +45 -1
  230. package/src/runtime/query/iteration/index.ts +27 -6
  231. package/src/runtime/query/iteration/phases/context.ts +37 -11
  232. package/src/runtime/query/iteration/phases/per-call-review.ts +598 -0
  233. package/src/runtime/query/iteration/phases/tool-review.ts +168 -83
  234. package/src/runtime/query/iteration/step-context.ts +29 -0
  235. package/src/runtime/query/iteration/step-shaping.ts +6 -2
  236. package/src/runtime/query/prepare-turn.ts +18 -1
  237. package/src/runtime/query/project-instructions.ts +119 -38
  238. package/src/runtime/query/prompt.ts +11 -54
  239. package/src/runtime/query/resume-pending.ts +131 -0
  240. package/src/runtime/query/review-policy.ts +28 -0
  241. package/src/runtime/query/steering.ts +100 -96
  242. package/src/store/budget/disk.ts +4 -1
  243. package/src/tools/admit-facts.ts +6 -0
  244. package/src/tools/builtins/bash.ts +38 -28
  245. package/src/tools/builtins/browser.ts +38 -12
  246. package/src/tools/builtins/edit-apply.ts +12 -2
  247. package/src/tools/builtins/edit.ts +38 -12
  248. package/src/tools/builtins/exit-semantics.ts +198 -0
  249. package/src/tools/builtins/job.ts +1 -1
  250. package/src/tools/builtins/skill.ts +1 -1
  251. package/src/tools/builtins/structuredOutput.ts +1 -1
  252. package/src/tools/builtins/verify-outputs.ts +1 -1
  253. package/src/tools/builtins/write-file.ts +11 -6
  254. package/src/tools/coordinator/ask-user-question.ts +12 -1
  255. package/src/tools/coordinator/index.ts +10 -3
  256. package/src/tools/memory/delete.ts +1 -1
  257. package/src/tools/memory/read.ts +1 -1
  258. package/src/tools/memory/save.ts +4 -3
  259. package/src/tools/memory/search.ts +1 -1
  260. package/src/tools/memory/update.ts +1 -1
  261. package/src/tools/schedules/loop-tool.ts +4 -2
  262. package/src/tools/schedules/schedule-tool.ts +2 -2
  263. package/src/tools/task/create.ts +1 -1
  264. package/src/tools/untrusted-envelope.ts +1 -1
  265. package/src/toolsets/manager.ts +6 -1
  266. package/src/turn/evidence-query.ts +19 -1
  267. package/src/turn/evidence-recall.ts +1 -1
  268. package/src/types/agent/base.ts +8 -0
  269. package/src/types/common/index.ts +27 -0
  270. package/src/types/hitl/index.ts +67 -0
  271. package/src/types/message/index.ts +20 -2
  272. package/src/types/message/notice-frame.ts +88 -0
  273. package/src/types/provider/chat.ts +8 -0
  274. package/src/types/provider/config.ts +6 -0
  275. package/src/types/session/checkpoint.ts +5 -0
  276. package/src/types/session/events.ts +6 -0
  277. package/src/types/session/records.ts +1 -1
  278. package/src/types/tool/presentation.ts +16 -0
@@ -0,0 +1,78 @@
1
+ import type { AuthorizationGate } from '../../../../authorization/index.js';
2
+ import type { HITLResumeDecision, ToolCallDeclined, ToolCallSummary } from '../../../../types/hitl/index.js';
3
+ import type { ToolCall } from '../../../../types/message/index.js';
4
+ import type { CallAdmission, ReviewedExecution } from '../../executor.js';
5
+ import { type IterationContext } from './context.js';
6
+ /** What a call is told when a refusal elsewhere in its batch ended the turn before it started. */
7
+ export declare const REFUSED_WITH_THE_TURN = "An earlier call in this batch was refused and the turn was stopped, so this call was not run. Wait for the user.";
8
+ /** What a call is told when the answer to it could not be taken. */
9
+ export declare const UNANSWERED_CALL = "No answer was given for this call, so it was not run. Ask again if it is still needed.";
10
+ /**
11
+ * A person's words, made safe to print: control characters (an escape
12
+ * sequence among them) become spaces, line breaks and tabs stay, and the
13
+ * length is capped by code point.
14
+ */
15
+ export declare function cleanPersonNote(note: string | undefined): string;
16
+ /** What the walk needs from the review phase; keeps this file free of that file's closures. */
17
+ export interface PerCallReviewDeps {
18
+ readonly ctx: IterationContext & {
19
+ readonly verificationGate?: AuthorizationGate;
20
+ };
21
+ readonly iteration: number;
22
+ readonly toolCalls: readonly ToolCall[];
23
+ readonly summaries: () => readonly ToolCallSummary[];
24
+ /** Ids the review may not release: the operator's policy denied them. */
25
+ readonly gateDenied: ReadonlyMap<string, string>;
26
+ readonly reviewAllowed: () => boolean;
27
+ /**
28
+ * Calls that carry no summary because their preparation failed: they run
29
+ * nothing, the executor answers them with the reason, so they need no yes.
30
+ */
31
+ readonly unreviewedIds: ReadonlySet<string>;
32
+ /** The shared checks that follow an approval or a refusal; see `runToolReview`. */
33
+ readonly settleEscalations: (denials: Map<string, string>, confirmed: readonly string[] | undefined, calls: readonly ToolCallSummary[]) => Promise<void>;
34
+ readonly recordGrantAudits: (decision: HITLResumeDecision, calls: readonly ToolCallSummary[]) => Promise<void>;
35
+ readonly evaluateGate: (call: ToolCallSummary) => 'allow' | 'deny' | 'review' | undefined;
36
+ }
37
+ /**
38
+ * The per-call review of one batch: it answers the executor's question "may this
39
+ * call start" by asking about that call alone, and keeps every question that is
40
+ * open at once consistent with the others.
41
+ *
42
+ * - An answer that grants something (a remembered approval, a changed rule or
43
+ * mode on the host's side) re-checks the questions still open, and any call
44
+ * the new state covers is let through unasked. A re-check never refuses.
45
+ * - A plain refusal ends the turn: the questions still open close, calls not
46
+ * yet started are refused without being asked, calls in flight are cancelled.
47
+ * - Every refusal and every call that could not be matched to a reviewed
48
+ * summary is a refusal. Nothing is approved by the absence of an answer.
49
+ */
50
+ export declare class PerCallReview implements ReviewedExecution {
51
+ #private;
52
+ /** Refusals settled before the walk, from the question asked of several calls at once. */
53
+ readonly denials: Map<string, string>;
54
+ readonly declines: Map<string, ToolCallDeclined>;
55
+ constructor(deps: PerCallReviewDeps);
56
+ get ended(): AbortSignal;
57
+ /** A refusal (or the host) ended the turn. */
58
+ get endsTurn(): boolean;
59
+ /** How many calls the walk refused, asked or not. */
60
+ get refusedCount(): number;
61
+ /** The host stopped the turn rather than a person refusing a call. */
62
+ get cancelled(): boolean;
63
+ /** Stop listening for changes. Called when the walk is over, whichever way it ended. */
64
+ dispose(): void;
65
+ /**
66
+ * The questions that are about the batch rather than about one call, asked
67
+ * first and together. Their answers are settled here, before anything starts.
68
+ */
69
+ askTogetherFirst(): Promise<void>;
70
+ /** Answers the executor: may this call start. */
71
+ admit(call: ToolCall): Promise<CallAdmission>;
72
+ /**
73
+ * Re-check every question still open against the rules and approvals as they
74
+ * are now. Only ever approves.
75
+ */
76
+ recheck(): Promise<void>;
77
+ }
78
+ //# sourceMappingURL=per-call-review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-call-review.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/query/iteration/phases/per-call-review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EACX,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,cAAc,CAAA;AAE1E,kGAAkG;AAClG,eAAO,MAAM,qBAAqB,qHACiF,CAAA;AAEnH,oEAAoE;AACpE,eAAO,MAAM,eAAe,2FAC6D,CAAA;AAczF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAgBhE;AAgCD,+FAA+F;AAC/F,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG;QAChC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,CAAA;KAC7C,CAAA;IACD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,E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C,iDAAiD;IAC3C,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;IAyDnD;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CA2TxB"}
@@ -0,0 +1,494 @@
1
+ var _a;
2
+ import { DECLINED_TOOL_CALL_FEEDBACK } from '../../declined.js';
3
+ import { DECLINED_NOTE_MAX_CHARS } from '../../executor.js';
4
+ import { supersededByRecovery } from '../../resume-pending.js';
5
+ import { awaitDecisionDurably } from './context.js';
6
+ /** What a call is told when a refusal elsewhere in its batch ended the turn before it started. */
7
+ export const REFUSED_WITH_THE_TURN = 'An earlier call in this batch was refused and the turn was stopped, so this call was not run. Wait for the user.';
8
+ /** What a call is told when the answer to it could not be taken. */
9
+ export const UNANSWERED_CALL = 'No answer was given for this call, so it was not run. Ask again if it is still needed.';
10
+ const EDIT_NOT_OFFERED = 'Editing a call while it is asked about is not offered, so this call was not run. Ask again with the input you want.';
11
+ const PAUSED_CALL = 'The turn was asked to wait before this call could be answered, so it was not run. Ask again if it is still needed.';
12
+ const NOT_THIS_QUESTION = 'That answer was not an answer to a question about a tool call, so this call was not run.';
13
+ /** The audit trail keeps a person's reason, cut short and without control characters. */
14
+ const AUDIT_NOTE_MAX_CHARS = 500;
15
+ /**
16
+ * A person's words, made safe to print: control characters (an escape
17
+ * sequence among them) become spaces, line breaks and tabs stay, and the
18
+ * length is capped by code point.
19
+ */
20
+ export function cleanPersonNote(note) {
21
+ if (note === undefined)
22
+ return '';
23
+ let out = '';
24
+ let inGap = false;
25
+ for (const ch of note) {
26
+ const code = ch.codePointAt(0);
27
+ const control = code <= 0x08 || (code >= 0x0b && code <= 0x1f) || (code >= 0x7f && code <= 0x9f);
28
+ if (control) {
29
+ if (!inGap)
30
+ out += ' ';
31
+ inGap = true;
32
+ continue;
33
+ }
34
+ inGap = false;
35
+ out += ch;
36
+ }
37
+ return Array.from(out.trim()).slice(0, DECLINED_NOTE_MAX_CHARS).join('');
38
+ }
39
+ /**
40
+ * The per-call review of one batch: it answers the executor's question "may this
41
+ * call start" by asking about that call alone, and keeps every question that is
42
+ * open at once consistent with the others.
43
+ *
44
+ * - An answer that grants something (a remembered approval, a changed rule or
45
+ * mode on the host's side) re-checks the questions still open, and any call
46
+ * the new state covers is let through unasked. A re-check never refuses.
47
+ * - A plain refusal ends the turn: the questions still open close, calls not
48
+ * yet started are refused without being asked, calls in flight are cancelled.
49
+ * - Every refusal and every call that could not be matched to a reviewed
50
+ * summary is a refusal. Nothing is approved by the absence of an answer.
51
+ */
52
+ export class PerCallReview {
53
+ #deps;
54
+ #endController = new AbortController();
55
+ #open = new Set();
56
+ #approvedTogether = new Set();
57
+ /** Refusals settled before the walk, from the question asked of several calls at once. */
58
+ denials = new Map();
59
+ declines = new Map();
60
+ #endsTurn = false;
61
+ #cancelled = false;
62
+ #refused = 0;
63
+ #checking;
64
+ #checkAgain = false;
65
+ #unsubscribe;
66
+ /**
67
+ * The end of the line of calls waiting to open their question. Questions open
68
+ * one after another in the order the calls were admitted, which is the order
69
+ * the model wrote them, whatever each call's own checks take to finish.
70
+ */
71
+ #line = Promise.resolve();
72
+ constructor(deps) {
73
+ this.#deps = deps;
74
+ this.#unsubscribe = deps.ctx.perCallReview?.onRulesChanged?.(() => {
75
+ void this.recheck();
76
+ });
77
+ }
78
+ get ended() {
79
+ return this.#endController.signal;
80
+ }
81
+ /** A refusal (or the host) ended the turn. */
82
+ get endsTurn() {
83
+ return this.#endsTurn;
84
+ }
85
+ /** How many calls the walk refused, asked or not. */
86
+ get refusedCount() {
87
+ return this.#refused;
88
+ }
89
+ /** The host stopped the turn rather than a person refusing a call. */
90
+ get cancelled() {
91
+ return this.#cancelled;
92
+ }
93
+ /** Stop listening for changes. Called when the walk is over, whichever way it ended. */
94
+ dispose() {
95
+ this.#unsubscribe?.();
96
+ this.#unsubscribe = undefined;
97
+ }
98
+ /**
99
+ * The questions that are about the batch rather than about one call, asked
100
+ * first and together. Their answers are settled here, before anything starts.
101
+ */
102
+ async askTogetherFirst() {
103
+ const config = this.#deps.ctx.perCallReview;
104
+ if (!config?.askTogether)
105
+ return;
106
+ const askable = this.#deps
107
+ .summaries()
108
+ .filter((call) => !this.#deps.gateDenied.has(call.id) && !this.#skipsAsk(call));
109
+ if (askable.length === 0)
110
+ return;
111
+ const wanted = new Set(config.askTogether(askable));
112
+ const together = askable.filter((call) => wanted.has(call.id));
113
+ if (together.length === 0)
114
+ return;
115
+ const interpreted = await this.#ask(together);
116
+ for (const call of together) {
117
+ const verdict = interpreted.verdicts.get(call.id) ?? {
118
+ run: false,
119
+ reason: UNANSWERED_CALL,
120
+ };
121
+ if (verdict.run) {
122
+ this.#approvedTogether.add(call.id);
123
+ }
124
+ else {
125
+ this.denials.set(call.id, verdict.reason);
126
+ if (verdict.declined)
127
+ this.declines.set(call.id, verdict.declined);
128
+ }
129
+ }
130
+ this.#noteEnd(interpreted);
131
+ }
132
+ /** Answers the executor: may this call start. */
133
+ async admit(call) {
134
+ // Taken synchronously, so the place in line is the order of the asking.
135
+ const before = this.#line;
136
+ let leave;
137
+ this.#line = new Promise((resolve) => {
138
+ leave = resolve;
139
+ });
140
+ try {
141
+ const verdict = await this.#decide(call, before, leave);
142
+ if (!verdict.run)
143
+ this.#refused += 1;
144
+ return verdict;
145
+ }
146
+ finally {
147
+ leave();
148
+ }
149
+ }
150
+ async #decide(call, before, leave) {
151
+ await before;
152
+ if (this.ended.aborted)
153
+ return { run: false, reason: REFUSED_WITH_THE_TURN };
154
+ if (this.#approvedTogether.has(call.id))
155
+ return { run: true };
156
+ const summary = this.#deps.summaries().find((candidate) => candidate.id === call.id);
157
+ if (summary === undefined) {
158
+ // A call whose preparation failed runs nothing; the executor answers it
159
+ // with the reason. Any other call that has no summary was never shown,
160
+ // and a call nobody saw is not approved.
161
+ return this.#deps.unreviewedIds.has(call.id)
162
+ ? { run: true }
163
+ : { run: false, reason: UNANSWERED_CALL };
164
+ }
165
+ if (this.#skipsAsk(summary))
166
+ return { run: true };
167
+ // A call that waited for its turn is checked against the rules, grants and
168
+ // mode as they are now: an earlier answer may have remembered a rule that
169
+ // covers it, and nobody is asked about what is already settled.
170
+ if (await this.#coveredNow(summary)) {
171
+ await this.#deps.ctx.recorder.recordAudit({
172
+ what: { action: 'tool_call', tool: summary.name },
173
+ outcome: 'approved',
174
+ reason: 'a rule, an earlier approval or the permission mode changed while this call waited for its turn and now covers it; it was approved without being shown',
175
+ });
176
+ return { run: true };
177
+ }
178
+ const interpreted = await this.#ask([summary], leave);
179
+ this.#noteEnd(interpreted);
180
+ const verdict = interpreted.verdicts.get(summary.id) ?? {
181
+ run: false,
182
+ reason: UNANSWERED_CALL,
183
+ };
184
+ if (!verdict.run) {
185
+ this.#deps.ctx.log.info('A tool call was refused', {
186
+ 'namzu.tool.names': [summary.name],
187
+ });
188
+ return verdict;
189
+ }
190
+ return { run: true };
191
+ }
192
+ /**
193
+ * Re-check every question still open against the rules and approvals as they
194
+ * are now. Only ever approves.
195
+ */
196
+ recheck() {
197
+ if (this.#checking) {
198
+ this.#checkAgain = true;
199
+ return this.#checking;
200
+ }
201
+ this.#checking = (async () => {
202
+ try {
203
+ do {
204
+ this.#checkAgain = false;
205
+ for (const ask of [...this.#open]) {
206
+ if (!ask.recheckable || ask.closedBy !== undefined || this.ended.aborted)
207
+ continue;
208
+ if (await this.#coveredNow(ask.calls[0])) {
209
+ // The person may have answered while this was being worked out.
210
+ if (!this.#open.has(ask) || ask.closedBy !== undefined)
211
+ continue;
212
+ ask.closedBy = 'covered';
213
+ ask.controller.abort();
214
+ }
215
+ }
216
+ } while (this.#checkAgain);
217
+ }
218
+ finally {
219
+ this.#checking = undefined;
220
+ }
221
+ })();
222
+ return this.#checking;
223
+ }
224
+ /** Calls a re-check must never wave through: they exist to put a question to a person. */
225
+ static #alwaysAsked(call) {
226
+ return (call.escalation !== undefined ||
227
+ call.requiresApproval === true ||
228
+ call.authorization?.askRule === true ||
229
+ call.authorization?.explicitReview === true ||
230
+ call.hookPermission?.decision === 'ask');
231
+ }
232
+ async #coveredNow(call) {
233
+ if (_a.#alwaysAsked(call) || this.#deps.gateDenied.has(call.id))
234
+ return false;
235
+ const { ctx } = this.#deps;
236
+ // The host's veto comes before every approval path, the turn's own included.
237
+ if (await this.#vetoed(ctx.perCallReview?.neverCover, call))
238
+ return false;
239
+ if (!this.#deps.reviewAllowed()) {
240
+ if (this.#deps.evaluateGate(call) === 'allow')
241
+ return true;
242
+ if (ctx.toolGrants?.covers(call))
243
+ return true;
244
+ }
245
+ try {
246
+ return (await ctx.perCallReview?.covers?.(call)) === true;
247
+ }
248
+ catch {
249
+ // A host predicate that fails is not a yes.
250
+ return false;
251
+ }
252
+ }
253
+ /** A host predicate that throws vetoes: a failure is never a yes. */
254
+ async #vetoed(veto, call) {
255
+ if (!veto)
256
+ return false;
257
+ try {
258
+ return (await veto(call)) !== false;
259
+ }
260
+ catch {
261
+ return true;
262
+ }
263
+ }
264
+ /** Whether the turn's own rules and earlier approvals let this call run unasked. */
265
+ #skipsAsk(call) {
266
+ if (this.#deps.reviewAllowed())
267
+ return false;
268
+ if (call.authorization?.decision === 'allow')
269
+ return !_a.#alwaysAsked(call);
270
+ return !_a.#alwaysAsked(call) && this.#deps.ctx.toolGrants?.covers(call) === true;
271
+ }
272
+ #noteEnd(interpreted) {
273
+ if (!interpreted.endsTurn && !interpreted.cancelled)
274
+ return;
275
+ this.#end(interpreted.cancelled);
276
+ }
277
+ #end(cancelled) {
278
+ if (this.#endsTurn)
279
+ return;
280
+ this.#endsTurn = true;
281
+ this.#cancelled = cancelled;
282
+ for (const ask of this.#open) {
283
+ ask.closedBy ??= 'ended';
284
+ ask.controller.abort();
285
+ }
286
+ this.#endController.abort(new Error('the user stopped the turn'));
287
+ }
288
+ /** One request to the handler about `calls`, and what its answer means for each. */
289
+ async #ask(calls, opened) {
290
+ const { ctx, iteration } = this.#deps;
291
+ const checkpoint = await ctx.checkpointMgr.create(ctx.recorder, iteration);
292
+ await ctx.emitEvent({
293
+ type: 'tool_review_requested',
294
+ turnId: ctx.recorder.turnId,
295
+ toolCalls: [...calls],
296
+ iteration,
297
+ });
298
+ const asked = {
299
+ calls,
300
+ controller: new AbortController(),
301
+ recheckable: calls.length === 1,
302
+ };
303
+ this.#open.add(asked);
304
+ let decision;
305
+ try {
306
+ const answer = awaitDecisionDurably(ctx, checkpoint, {
307
+ type: 'tool_review',
308
+ sessionId: ctx.recorder.sessionId,
309
+ turnId: ctx.recorder.turnId,
310
+ checkpointId: checkpoint.id,
311
+ toolCalls: [...calls],
312
+ perCall: true,
313
+ }, {
314
+ signal: asked.controller.signal,
315
+ closedAs: () => {
316
+ asked.closedHere = true;
317
+ return asked.closedBy === 'covered'
318
+ ? { action: 'approve_tools' }
319
+ : { action: 'reject_tools', feedback: REFUSED_WITH_THE_TURN };
320
+ },
321
+ });
322
+ // The handler has been given the question: the next call may open its own.
323
+ opened?.();
324
+ decision = await answer;
325
+ }
326
+ finally {
327
+ this.#open.delete(asked);
328
+ }
329
+ // Only an answer the close itself supplied counts as the close: a person
330
+ // who answered first has answered, and a re-check that landed a moment
331
+ // later does not turn their No into a yes.
332
+ if (asked.closedHere && asked.closedBy === 'covered') {
333
+ await ctx.emitEvent({
334
+ type: 'tool_review_completed',
335
+ turnId: ctx.recorder.turnId,
336
+ decision: 'approved',
337
+ });
338
+ for (const call of calls) {
339
+ await ctx.recorder.recordAudit({
340
+ what: { action: 'tool_call', tool: call.name },
341
+ outcome: 'approved',
342
+ reason: 'a rule, an earlier approval or the permission mode changed while this call waited and now covers it; it was approved without being shown',
343
+ });
344
+ }
345
+ return this.#settle({ action: 'approve_tools' }, calls, new Map(calls.map((call) => [call.id, { run: true }])), false, false, false);
346
+ }
347
+ if (asked.closedHere && asked.closedBy === 'ended') {
348
+ await ctx.emitEvent({
349
+ type: 'tool_review_completed',
350
+ turnId: ctx.recorder.turnId,
351
+ decision: 'rejected',
352
+ });
353
+ return {
354
+ verdicts: new Map(calls.map((call) => [call.id, { run: false, reason: REFUSED_WITH_THE_TURN }])),
355
+ endsTurn: false,
356
+ cancelled: false,
357
+ paused: false,
358
+ };
359
+ }
360
+ const interpreted = this.#interpret(decision, calls);
361
+ await ctx.emitEvent({
362
+ type: 'tool_review_completed',
363
+ turnId: ctx.recorder.turnId,
364
+ decision: decisionLabel(decision, interpreted),
365
+ });
366
+ if (interpreted.paused) {
367
+ await ctx.checkpointMgr
368
+ .unpark(checkpoint.id, supersededByRecovery(decision))
369
+ .catch(() => null);
370
+ }
371
+ return this.#settle(decision, calls, interpreted.verdicts, interpreted.endsTurn, interpreted.cancelled, interpreted.paused);
372
+ }
373
+ /** The checks that follow an answer, then the answer's side effects. */
374
+ async #settle(decision, calls, verdicts, endsTurn, cancelled, paused) {
375
+ const { ctx } = this.#deps;
376
+ const denials = new Map();
377
+ for (const call of calls) {
378
+ const verdict = verdicts.get(call.id);
379
+ if (verdict && !verdict.run)
380
+ denials.set(call.id, verdict.reason);
381
+ }
382
+ const confirmed = decision.action === 'approve_tools' || decision.action === 'modify_tools'
383
+ ? decision.confirmedEscalations
384
+ : undefined;
385
+ await this.#deps.settleEscalations(denials, confirmed, calls);
386
+ const result = new Map();
387
+ for (const call of calls) {
388
+ const prior = verdicts.get(call.id) ?? {
389
+ run: false,
390
+ reason: UNANSWERED_CALL,
391
+ };
392
+ const reason = denials.get(call.id);
393
+ // An escape the answer did not confirm turns a yes into a refusal here.
394
+ result.set(call.id, prior.run && reason !== undefined ? { run: false, reason } : prior);
395
+ }
396
+ const approvedCalls = calls.filter((call) => result.get(call.id)?.run === true);
397
+ if (decision.action === 'approve_tools' && approvedCalls.length > 0) {
398
+ if (decision.remember)
399
+ ctx.toolGrants?.grant(decision.remember);
400
+ await this.#deps.recordGrantAudits(decision, approvedCalls);
401
+ // What was just remembered may cover a question still open.
402
+ if (decision.remember)
403
+ void this.recheck();
404
+ }
405
+ for (const call of calls) {
406
+ const verdict = result.get(call.id);
407
+ if (verdict && !verdict.run && verdict.declined) {
408
+ const note = cleanPersonNote(verdict.declined.note);
409
+ await ctx.recorder.recordAudit({
410
+ what: { action: 'tool_call', tool: call.name },
411
+ outcome: 'refused',
412
+ reason: `declined by the person${note ? `: ${Array.from(note).slice(0, AUDIT_NOTE_MAX_CHARS).join('')}` : ''}`,
413
+ });
414
+ }
415
+ }
416
+ return { verdicts: result, endsTurn, cancelled, paused };
417
+ }
418
+ #interpret(decision, calls) {
419
+ const verdicts = new Map();
420
+ const refuseAll = (verdict) => {
421
+ for (const call of calls)
422
+ verdicts.set(call.id, verdict);
423
+ };
424
+ let endsTurn = false;
425
+ let cancelled = false;
426
+ let paused = false;
427
+ switch (decision.action) {
428
+ case 'approve_tools':
429
+ case 'continue':
430
+ for (const call of calls)
431
+ verdicts.set(call.id, { run: true });
432
+ break;
433
+ case 'reject_tools': {
434
+ const note = cleanPersonNote(decision.declined?.note);
435
+ refuseAll({
436
+ run: false,
437
+ reason: decision.feedback
438
+ ? Array.from(decision.feedback)
439
+ .slice(0, DECLINED_NOTE_MAX_CHARS * 2)
440
+ .join('')
441
+ : DECLINED_TOOL_CALL_FEEDBACK,
442
+ ...(decision.declined ? { declined: note ? { note } : {} } : {}),
443
+ });
444
+ endsTurn = decision.endTurn === true;
445
+ break;
446
+ }
447
+ case 'modify_tools': {
448
+ for (const call of calls) {
449
+ const mods = decision.modifications.filter((mod) => mod.toolCallId === call.id);
450
+ if (mods.some((mod) => mod.action === 'deny')) {
451
+ verdicts.set(call.id, {
452
+ run: false,
453
+ reason: DECLINED_TOOL_CALL_FEEDBACK,
454
+ declined: {},
455
+ });
456
+ }
457
+ else if (mods.some((mod) => mod.action === 'modify')) {
458
+ verdicts.set(call.id, { run: false, reason: EDIT_NOT_OFFERED });
459
+ }
460
+ else if (mods.some((mod) => mod.action === 'approve')) {
461
+ verdicts.set(call.id, { run: true });
462
+ }
463
+ else {
464
+ verdicts.set(call.id, { run: false, reason: UNANSWERED_CALL });
465
+ }
466
+ }
467
+ break;
468
+ }
469
+ case 'pause':
470
+ refuseAll({ run: false, reason: PAUSED_CALL });
471
+ paused = true;
472
+ break;
473
+ case 'abort':
474
+ refuseAll({ run: false, reason: REFUSED_WITH_THE_TURN });
475
+ cancelled = true;
476
+ break;
477
+ default:
478
+ // A plan or question answer to a tool question: not an answer to it.
479
+ this.#deps.ctx.log.warn('Unexpected decision during a per-call tool review', {
480
+ 'namzu.runtime.action': decision.action,
481
+ });
482
+ refuseAll({ run: false, reason: NOT_THIS_QUESTION });
483
+ }
484
+ return { verdicts, endsTurn, cancelled, paused };
485
+ }
486
+ }
487
+ _a = PerCallReview;
488
+ function decisionLabel(decision, interpreted) {
489
+ if (decision.action === 'modify_tools')
490
+ return 'modified';
491
+ const refused = [...interpreted.verdicts.values()].some((verdict) => !verdict.run);
492
+ return refused ? 'rejected' : 'approved';
493
+ }
494
+ //# sourceMappingURL=per-call-review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-call-review.js","sourceRoot":"","sources":["../../../../../src/runtime/query/iteration/phases/per-call-review.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAyB,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAE1E,kGAAkG;AAClG,MAAM,CAAC,MAAM,qBAAqB,GACjC,kHAAkH,CAAA;AAEnH,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAC3B,wFAAwF,CAAA;AAEzF,MAAM,gBAAgB,GACrB,qHAAqH,CAAA;AAEtH,MAAM,WAAW,GAChB,oHAAoH,CAAA;AAErH,MAAM,iBAAiB,GACtB,0FAA0F,CAAA;AAE3F,yFAAyF;AACzF,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEhC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAwB;IACvD,I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