agentfootprint 14.1.0 → 14.2.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 (577) hide show
  1. package/CAPABILITIES.md +2 -0
  2. package/dist/adapters/observability/auditKeptByContract.js +4 -1
  3. package/dist/adapters/observability/auditKeptByContract.js.map +1 -1
  4. package/dist/context-bisect/ablation.js +29 -4
  5. package/dist/context-bisect/ablation.js.map +1 -1
  6. package/dist/context-bisect/bisect.js +30 -8
  7. package/dist/context-bisect/bisect.js.map +1 -1
  8. package/dist/context-bisect/conclusion.js +228 -0
  9. package/dist/context-bisect/conclusion.js.map +1 -0
  10. package/dist/context-bisect/conclusionTypes.js +6 -0
  11. package/dist/context-bisect/conclusionTypes.js.map +1 -0
  12. package/dist/context-bisect/format.js +98 -0
  13. package/dist/context-bisect/format.js.map +1 -0
  14. package/dist/context-bisect/index.js.map +1 -1
  15. package/dist/context-bisect/localize.js +25 -96
  16. package/dist/context-bisect/localize.js.map +1 -1
  17. package/dist/context-bisect/toBacktrackTrace.js +6 -1
  18. package/dist/context-bisect/toBacktrackTrace.js.map +1 -1
  19. package/dist/context-bisect/types.js +4 -0
  20. package/dist/context-bisect/types.js.map +1 -1
  21. package/dist/core/agent/arguments/ask/constants.js +30 -0
  22. package/dist/core/agent/arguments/ask/constants.js.map +1 -0
  23. package/dist/core/agent/arguments/ask/context.js +120 -0
  24. package/dist/core/agent/arguments/ask/context.js.map +1 -0
  25. package/dist/core/agent/arguments/ask/fields.js +307 -0
  26. package/dist/core/agent/arguments/ask/fields.js.map +1 -0
  27. package/dist/core/agent/arguments/ask/replyFields.js +48 -0
  28. package/dist/core/agent/arguments/ask/replyFields.js.map +1 -0
  29. package/dist/core/agent/arguments/ask/types.js +3 -0
  30. package/dist/core/agent/arguments/ask/types.js.map +1 -0
  31. package/dist/core/agent/arguments/ask/validation.js +195 -0
  32. package/dist/core/agent/arguments/ask/validation.js.map +1 -0
  33. package/dist/core/agent/arguments/ask/windowBinding/answer.js +84 -0
  34. package/dist/core/agent/arguments/ask/windowBinding/answer.js.map +1 -0
  35. package/dist/core/agent/arguments/ask/windowBinding/editedZone.js +29 -0
  36. package/dist/core/agent/arguments/ask/windowBinding/editedZone.js.map +1 -0
  37. package/dist/core/agent/arguments/ask/windowBinding/fills.js +85 -0
  38. package/dist/core/agent/arguments/ask/windowBinding/fills.js.map +1 -0
  39. package/dist/core/agent/arguments/ask/windowBinding/question.js +44 -0
  40. package/dist/core/agent/arguments/ask/windowBinding/question.js.map +1 -0
  41. package/dist/core/agent/arguments/ask/windowBinding/types.js +3 -0
  42. package/dist/core/agent/arguments/ask/windowBinding/types.js.map +1 -0
  43. package/dist/core/agent/arguments/ask/windowBinding.js +9 -0
  44. package/dist/core/agent/arguments/ask/windowBinding.js.map +1 -0
  45. package/dist/core/agent/arguments/ask/windowReply.js +69 -0
  46. package/dist/core/agent/arguments/ask/windowReply.js.map +1 -0
  47. package/dist/core/agent/arguments/ask.js +48 -898
  48. package/dist/core/agent/arguments/ask.js.map +1 -1
  49. package/dist/core/agent/arguments/dispatch.js +3 -3
  50. package/dist/core/agent/arguments/pendingPrivateAsk.js +3 -1
  51. package/dist/core/agent/arguments/pendingPrivateAsk.js.map +1 -1
  52. package/dist/core/agent/arguments/serve/assumed.js +110 -0
  53. package/dist/core/agent/arguments/serve/assumed.js.map +1 -0
  54. package/dist/core/agent/arguments/serve/clock.js +169 -0
  55. package/dist/core/agent/arguments/serve/clock.js.map +1 -0
  56. package/dist/core/agent/arguments/serve/fills.js +113 -0
  57. package/dist/core/agent/arguments/serve/fills.js.map +1 -0
  58. package/dist/core/agent/arguments/serve/refusals.js +158 -0
  59. package/dist/core/agent/arguments/serve/refusals.js.map +1 -0
  60. package/dist/core/agent/arguments/serve/schema.js +124 -0
  61. package/dist/core/agent/arguments/serve/schema.js.map +1 -0
  62. package/dist/core/agent/arguments/serve/values.js +21 -0
  63. package/dist/core/agent/arguments/serve/values.js.map +1 -0
  64. package/dist/core/agent/arguments/serve/windows.js +328 -0
  65. package/dist/core/agent/arguments/serve/windows.js.map +1 -0
  66. package/dist/core/agent/arguments/serve.js +32 -984
  67. package/dist/core/agent/arguments/serve.js.map +1 -1
  68. package/dist/core/agent/assessment/compose.js +2 -2
  69. package/dist/core/agent/assessment/compose.js.map +1 -1
  70. package/dist/core/agent/assessment/integrityReasons.js +5 -1
  71. package/dist/core/agent/assessment/integrityReasons.js.map +1 -1
  72. package/dist/core/agent/assessment/stage.js +1 -1
  73. package/dist/core/agent/buildAgentChart.js +1 -1
  74. package/dist/core/agent/findings/types.js.map +1 -1
  75. package/dist/core/agent/middleware/rewrites.js +2 -2
  76. package/dist/core/agent/middleware/rewrites.js.map +1 -1
  77. package/dist/core/agent/stages/answerCoverage.js +1 -1
  78. package/dist/core/agent/stages/argumentAsk.js +4 -3
  79. package/dist/core/agent/stages/argumentAsk.js.map +1 -1
  80. package/dist/core/agent/stages/callLLM.js +1 -1
  81. package/dist/core/agent/stages/callLLM.js.map +1 -1
  82. package/dist/core/agent/stages/prepareFinal.js +1 -1
  83. package/dist/core/agent/stages/toolCalls/execution/deliveredResult.js +1 -1
  84. package/dist/core/agent/stages/toolCalls/execution/deliveredResult.js.map +1 -1
  85. package/dist/core/agent/stages/toolCalls/helpers/sourceNote.js +1 -1
  86. package/dist/core/slots/buildToolsSlot.js +2 -2
  87. package/dist/core/slots/buildToolsSlot.js.map +1 -1
  88. package/dist/debug.js.map +1 -1
  89. package/dist/esm/adapters/observability/auditKeptByContract.js +4 -1
  90. package/dist/esm/adapters/observability/auditKeptByContract.js.map +1 -1
  91. package/dist/esm/context-bisect/ablation.d.ts +8 -0
  92. package/dist/esm/context-bisect/ablation.js +24 -3
  93. package/dist/esm/context-bisect/ablation.js.map +1 -1
  94. package/dist/esm/context-bisect/bisect.d.ts +15 -15
  95. package/dist/esm/context-bisect/bisect.js +27 -5
  96. package/dist/esm/context-bisect/bisect.js.map +1 -1
  97. package/dist/esm/context-bisect/conclusion.d.ts +51 -0
  98. package/dist/esm/context-bisect/conclusion.js +223 -0
  99. package/dist/esm/context-bisect/conclusion.js.map +1 -0
  100. package/dist/esm/context-bisect/conclusionTypes.d.ts +75 -0
  101. package/dist/esm/context-bisect/conclusionTypes.js +5 -0
  102. package/dist/esm/context-bisect/conclusionTypes.js.map +1 -0
  103. package/dist/esm/context-bisect/format.d.ts +10 -0
  104. package/dist/esm/context-bisect/format.js +94 -0
  105. package/dist/esm/context-bisect/format.js.map +1 -0
  106. package/dist/esm/context-bisect/index.d.ts +1 -1
  107. package/dist/esm/context-bisect/index.js.map +1 -1
  108. package/dist/esm/context-bisect/localize.d.ts +8 -10
  109. package/dist/esm/context-bisect/localize.js +24 -94
  110. package/dist/esm/context-bisect/localize.js.map +1 -1
  111. package/dist/esm/context-bisect/toBacktrackTrace.js +6 -1
  112. package/dist/esm/context-bisect/toBacktrackTrace.js.map +1 -1
  113. package/dist/esm/context-bisect/types.d.ts +33 -4
  114. package/dist/esm/context-bisect/types.js +4 -0
  115. package/dist/esm/context-bisect/types.js.map +1 -1
  116. package/dist/esm/core/agent/arguments/ask/constants.d.ts +16 -0
  117. package/dist/esm/core/agent/arguments/ask/constants.js +27 -0
  118. package/dist/esm/core/agent/arguments/ask/constants.js.map +1 -0
  119. package/dist/esm/core/agent/arguments/ask/context.d.ts +23 -0
  120. package/dist/esm/core/agent/arguments/ask/context.js +115 -0
  121. package/dist/esm/core/agent/arguments/ask/context.js.map +1 -0
  122. package/dist/esm/core/agent/arguments/ask/fields.d.ts +42 -0
  123. package/dist/esm/core/agent/arguments/ask/fields.js +300 -0
  124. package/dist/esm/core/agent/arguments/ask/fields.js.map +1 -0
  125. package/dist/esm/core/agent/arguments/ask/replyFields.d.ts +9 -0
  126. package/dist/esm/core/agent/arguments/ask/replyFields.js +42 -0
  127. package/dist/esm/core/agent/arguments/ask/replyFields.js.map +1 -0
  128. package/dist/esm/core/agent/arguments/ask/types.d.ts +195 -0
  129. package/dist/esm/core/agent/arguments/ask/types.js +2 -0
  130. package/dist/esm/core/agent/arguments/ask/types.js.map +1 -0
  131. package/dist/esm/core/agent/arguments/ask/validation.d.ts +42 -0
  132. package/dist/esm/core/agent/arguments/ask/validation.js +188 -0
  133. package/dist/esm/core/agent/arguments/ask/validation.js.map +1 -0
  134. package/dist/esm/core/agent/arguments/ask/windowBinding/answer.d.ts +17 -0
  135. package/dist/esm/core/agent/arguments/ask/windowBinding/answer.js +80 -0
  136. package/dist/esm/core/agent/arguments/ask/windowBinding/answer.js.map +1 -0
  137. package/dist/esm/core/agent/arguments/ask/windowBinding/editedZone.d.ts +11 -0
  138. package/dist/esm/core/agent/arguments/ask/windowBinding/editedZone.js +25 -0
  139. package/dist/esm/core/agent/arguments/ask/windowBinding/editedZone.js.map +1 -0
  140. package/dist/esm/core/agent/arguments/ask/windowBinding/fills.d.ts +18 -0
  141. package/dist/esm/core/agent/arguments/ask/windowBinding/fills.js +81 -0
  142. package/dist/esm/core/agent/arguments/ask/windowBinding/fills.js.map +1 -0
  143. package/dist/esm/core/agent/arguments/ask/windowBinding/question.d.ts +6 -0
  144. package/dist/esm/core/agent/arguments/ask/windowBinding/question.js +40 -0
  145. package/dist/esm/core/agent/arguments/ask/windowBinding/question.js.map +1 -0
  146. package/dist/esm/core/agent/arguments/ask/windowBinding/types.d.ts +35 -0
  147. package/dist/esm/core/agent/arguments/ask/windowBinding/types.js +2 -0
  148. package/dist/esm/core/agent/arguments/ask/windowBinding/types.js.map +1 -0
  149. package/dist/esm/core/agent/arguments/ask/windowBinding.d.ts +4 -0
  150. package/dist/esm/core/agent/arguments/ask/windowBinding.js +4 -0
  151. package/dist/esm/core/agent/arguments/ask/windowBinding.js.map +1 -0
  152. package/dist/esm/core/agent/arguments/ask/windowReply.d.ts +11 -0
  153. package/dist/esm/core/agent/arguments/ask/windowReply.js +65 -0
  154. package/dist/esm/core/agent/arguments/ask/windowReply.js.map +1 -0
  155. package/dist/esm/core/agent/arguments/ask.d.ts +9 -259
  156. package/dist/esm/core/agent/arguments/ask.js +20 -885
  157. package/dist/esm/core/agent/arguments/ask.js.map +1 -1
  158. package/dist/esm/core/agent/arguments/dispatch.d.ts +4 -4
  159. package/dist/esm/core/agent/arguments/dispatch.js +4 -4
  160. package/dist/esm/core/agent/arguments/pendingPrivateAsk.d.ts +1 -1
  161. package/dist/esm/core/agent/arguments/pendingPrivateAsk.js +3 -1
  162. package/dist/esm/core/agent/arguments/pendingPrivateAsk.js.map +1 -1
  163. package/dist/esm/core/agent/arguments/serve/assumed.d.ts +63 -0
  164. package/dist/esm/core/agent/arguments/serve/assumed.js +112 -0
  165. package/dist/esm/core/agent/arguments/serve/assumed.js.map +1 -0
  166. package/dist/esm/core/agent/arguments/serve/clock.d.ts +104 -0
  167. package/dist/esm/core/agent/arguments/serve/clock.js +162 -0
  168. package/dist/esm/core/agent/arguments/serve/clock.js.map +1 -0
  169. package/dist/esm/core/agent/arguments/serve/fills.d.ts +65 -0
  170. package/dist/esm/core/agent/arguments/serve/fills.js +109 -0
  171. package/dist/esm/core/agent/arguments/serve/fills.js.map +1 -0
  172. package/dist/esm/core/agent/arguments/serve/refusals.d.ts +67 -0
  173. package/dist/esm/core/agent/arguments/serve/refusals.js +148 -0
  174. package/dist/esm/core/agent/arguments/serve/refusals.js.map +1 -0
  175. package/dist/esm/core/agent/arguments/serve/schema.d.ts +67 -0
  176. package/dist/esm/core/agent/arguments/serve/schema.js +119 -0
  177. package/dist/esm/core/agent/arguments/serve/schema.js.map +1 -0
  178. package/dist/esm/core/agent/arguments/serve/values.d.ts +11 -0
  179. package/dist/esm/core/agent/arguments/serve/values.js +16 -0
  180. package/dist/esm/core/agent/arguments/serve/values.js.map +1 -0
  181. package/dist/esm/core/agent/arguments/serve/windows.d.ts +60 -0
  182. package/dist/esm/core/agent/arguments/serve/windows.js +324 -0
  183. package/dist/esm/core/agent/arguments/serve/windows.js.map +1 -0
  184. package/dist/esm/core/agent/arguments/serve.d.ts +12 -417
  185. package/dist/esm/core/agent/arguments/serve.js +7 -973
  186. package/dist/esm/core/agent/arguments/serve.js.map +1 -1
  187. package/dist/esm/core/agent/assessment/compose.d.ts +2 -2
  188. package/dist/esm/core/agent/assessment/compose.js +2 -2
  189. package/dist/esm/core/agent/assessment/compose.js.map +1 -1
  190. package/dist/esm/core/agent/assessment/integrityReasons.js +5 -1
  191. package/dist/esm/core/agent/assessment/integrityReasons.js.map +1 -1
  192. package/dist/esm/core/agent/assessment/stage.js +1 -1
  193. package/dist/esm/core/agent/buildAgentChart.d.ts +1 -1
  194. package/dist/esm/core/agent/buildAgentChart.js +1 -1
  195. package/dist/esm/core/agent/evidence/figures.d.ts +1 -1
  196. package/dist/esm/core/agent/evidence/figures.js +1 -1
  197. package/dist/esm/core/agent/findings/types.d.ts +2 -2
  198. package/dist/esm/core/agent/findings/types.js.map +1 -1
  199. package/dist/esm/core/agent/middleware/rewrites.d.ts +1 -1
  200. package/dist/esm/core/agent/middleware/rewrites.js +2 -2
  201. package/dist/esm/core/agent/middleware/rewrites.js.map +1 -1
  202. package/dist/esm/core/agent/stages/answerCoverage.d.ts +1 -1
  203. package/dist/esm/core/agent/stages/answerCoverage.js +1 -1
  204. package/dist/esm/core/agent/stages/argumentAsk.d.ts +1 -1
  205. package/dist/esm/core/agent/stages/argumentAsk.js +4 -3
  206. package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
  207. package/dist/esm/core/agent/stages/callLLM.js +1 -1
  208. package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
  209. package/dist/esm/core/agent/stages/prepareFinal.d.ts +1 -1
  210. package/dist/esm/core/agent/stages/prepareFinal.js +1 -1
  211. package/dist/esm/core/agent/stages/seed.d.ts +2 -2
  212. package/dist/esm/core/agent/stages/toolCalls/contracts/access.d.ts +1 -1
  213. package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.js +1 -1
  214. package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.js.map +1 -1
  215. package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.d.ts +1 -1
  216. package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.js +1 -1
  217. package/dist/esm/core/agent/types.d.ts +1 -1
  218. package/dist/esm/core/slots/buildToolsSlot.d.ts +4 -4
  219. package/dist/esm/core/slots/buildToolsSlot.js +2 -2
  220. package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
  221. package/dist/esm/debug.d.ts +1 -1
  222. package/dist/esm/debug.js.map +1 -1
  223. package/dist/esm/events/payloads/agent.d.ts +1 -1
  224. package/dist/esm/index.d.ts +1 -1
  225. package/dist/esm/lib/saidByPerson.d.ts +2 -2
  226. package/dist/esm/lib/saidByPerson.js +2 -2
  227. package/dist/esm/locales/timeAsk.d.ts +2 -2
  228. package/dist/esm/locales/timeAsk.js +3 -1
  229. package/dist/esm/locales/timeAsk.js.map +1 -1
  230. package/dist/esm/semantics/coverage/answer.d.ts +3 -3
  231. package/dist/esm/semantics/coverage/answer.js +2 -2
  232. package/dist/esm/semantics/coverage/period.d.ts +1 -1
  233. package/dist/esm/semantics/coverage/period.js +1 -1
  234. package/dist/esm/semantics/coverage/timeLimitFacts.d.ts +1 -1
  235. package/dist/esm/semantics/coverage/timeLimitFacts.js +1 -1
  236. package/dist/esm/semantics/coverage/timeLimits.d.ts +1 -1
  237. package/dist/esm/semantics/coverage/timeLimits.js +1 -1
  238. package/dist/esm/time/ask.d.ts +8 -3
  239. package/dist/esm/time/ask.js +7 -0
  240. package/dist/esm/time/ask.js.map +1 -1
  241. package/dist/esm/time/forms.js +2 -2
  242. package/dist/esm/time/forms.js.map +1 -1
  243. package/dist/esm/time/readers/english/atoms.d.ts +3 -0
  244. package/dist/esm/time/readers/english/atoms.js +164 -0
  245. package/dist/esm/time/readers/english/atoms.js.map +1 -0
  246. package/dist/esm/time/readers/english/grammar.d.ts +49 -0
  247. package/dist/esm/time/readers/english/grammar.js +128 -0
  248. package/dist/esm/time/readers/english/grammar.js.map +1 -0
  249. package/dist/esm/time/readers/english/types.d.ts +11 -0
  250. package/dist/esm/time/readers/english/types.js +2 -0
  251. package/dist/esm/time/readers/english/types.js.map +1 -0
  252. package/dist/esm/time/readers/english/zones.d.ts +13 -0
  253. package/dist/esm/time/readers/english/zones.js +116 -0
  254. package/dist/esm/time/readers/english/zones.js.map +1 -0
  255. package/dist/esm/time/readers/english.d.ts +6 -13
  256. package/dist/esm/time/readers/english.js +10 -327
  257. package/dist/esm/time/readers/english.js.map +1 -1
  258. package/dist/esm/time/readingAsk.d.ts +1 -1
  259. package/dist/esm/time/readingAsk.js +11 -3
  260. package/dist/esm/time/readingAsk.js.map +1 -1
  261. package/dist/esm/time/reply/classify.d.ts +2 -0
  262. package/dist/esm/time/reply/classify.js +28 -0
  263. package/dist/esm/time/reply/classify.js.map +1 -0
  264. package/dist/esm/time/reply/decision.d.ts +2 -0
  265. package/dist/esm/time/reply/decision.js +28 -0
  266. package/dist/esm/time/reply/decision.js.map +1 -0
  267. package/dist/esm/time/reply/decode.d.ts +3 -0
  268. package/dist/esm/time/reply/decode.js +25 -0
  269. package/dist/esm/time/reply/decode.js.map +1 -0
  270. package/dist/esm/time/reply/project.d.ts +5 -0
  271. package/dist/esm/time/reply/project.js +36 -0
  272. package/dist/esm/time/reply/project.js.map +1 -0
  273. package/dist/esm/time/reply/resolve.d.ts +4 -0
  274. package/dist/esm/time/reply/resolve.js +63 -0
  275. package/dist/esm/time/reply/resolve.js.map +1 -0
  276. package/dist/esm/time/reply/types.d.ts +71 -0
  277. package/dist/esm/time/reply/types.js +14 -0
  278. package/dist/esm/time/reply/types.js.map +1 -0
  279. package/dist/esm/time/reply.d.ts +3 -0
  280. package/dist/esm/time/reply.js +3 -0
  281. package/dist/esm/time/reply.js.map +1 -0
  282. package/dist/esm/time/replyForm/bindings.d.ts +22 -0
  283. package/dist/esm/time/replyForm/bindings.js +55 -0
  284. package/dist/esm/time/replyForm/bindings.js.map +1 -0
  285. package/dist/esm/time/replyForm.d.ts +3 -0
  286. package/dist/esm/time/replyForm.js +3 -0
  287. package/dist/esm/time/replyForm.js.map +1 -0
  288. package/dist/esm/time/replyRecord.d.ts +8 -0
  289. package/dist/esm/time/replyRecord.js +26 -0
  290. package/dist/esm/time/replyRecord.js.map +1 -0
  291. package/dist/esm/time/resolve/agreement.d.ts +6 -0
  292. package/dist/esm/time/resolve/agreement.js +26 -0
  293. package/dist/esm/time/resolve/agreement.js.map +1 -0
  294. package/dist/esm/time/resolve/calendar.d.ts +22 -0
  295. package/dist/esm/time/resolve/calendar.js +145 -0
  296. package/dist/esm/time/resolve/calendar.js.map +1 -0
  297. package/dist/esm/time/resolve/lookback.d.ts +6 -0
  298. package/dist/esm/time/resolve/lookback.js +51 -0
  299. package/dist/esm/time/resolve/lookback.js.map +1 -0
  300. package/dist/esm/time/resolve/points.d.ts +24 -0
  301. package/dist/esm/time/resolve/points.js +97 -0
  302. package/dist/esm/time/resolve/points.js.map +1 -0
  303. package/dist/esm/time/resolve/types.d.ts +11 -0
  304. package/dist/esm/time/resolve/types.js +2 -0
  305. package/dist/esm/time/resolve/types.js.map +1 -0
  306. package/dist/esm/time/resolve/wallClock.d.ts +28 -0
  307. package/dist/esm/time/resolve/wallClock.js +70 -0
  308. package/dist/esm/time/resolve/wallClock.js.map +1 -0
  309. package/dist/esm/time/resolve/zones.d.ts +57 -0
  310. package/dist/esm/time/resolve/zones.js +147 -0
  311. package/dist/esm/time/resolve/zones.js.map +1 -0
  312. package/dist/esm/time/resolve.d.ts +2 -13
  313. package/dist/esm/time/resolve.js +28 -492
  314. package/dist/esm/time/resolve.js.map +1 -1
  315. package/dist/esm/time/resolveRecord.d.ts +6 -1
  316. package/dist/esm/time/resolveRecord.js +2 -0
  317. package/dist/esm/time/resolveRecord.js.map +1 -1
  318. package/dist/esm/time/rows/meaning.d.ts +2 -0
  319. package/dist/esm/time/rows/meaning.js +27 -0
  320. package/dist/esm/time/rows/meaning.js.map +1 -0
  321. package/dist/esm/time/rows/types.d.ts +225 -0
  322. package/dist/esm/time/rows/types.js +2 -0
  323. package/dist/esm/time/rows/types.js.map +1 -0
  324. package/dist/esm/time/rows.d.ts +9 -210
  325. package/dist/esm/time/rows.js +19 -6
  326. package/dist/esm/time/rows.js.map +1 -1
  327. package/dist/esm/time/windows.d.ts +2 -0
  328. package/dist/esm/time/windows.js +3 -2
  329. package/dist/esm/time/windows.js.map +1 -1
  330. package/dist/esm/tools/declare.d.ts +1 -1
  331. package/dist/esm/tools/declare.js +1 -1
  332. package/dist/esm/tools/inputRequest/data.d.ts +4 -0
  333. package/dist/esm/tools/inputRequest/data.js +27 -0
  334. package/dist/esm/tools/inputRequest/data.js.map +1 -0
  335. package/dist/esm/tools/inputRequest/response.d.ts +36 -0
  336. package/dist/esm/tools/inputRequest/response.js +65 -0
  337. package/dist/esm/tools/inputRequest/response.js.map +1 -0
  338. package/dist/esm/tools/inputRequest.d.ts +3 -11
  339. package/dist/esm/tools/inputRequest.js +5 -90
  340. package/dist/esm/tools/inputRequest.js.map +1 -1
  341. package/dist/lib/saidByPerson.js +2 -2
  342. package/dist/locales/timeAsk.js +3 -1
  343. package/dist/locales/timeAsk.js.map +1 -1
  344. package/dist/semantics/coverage/answer.js +2 -2
  345. package/dist/semantics/coverage/period.js +1 -1
  346. package/dist/semantics/coverage/timeLimitFacts.js +1 -1
  347. package/dist/semantics/coverage/timeLimits.js +1 -1
  348. package/dist/time/ask.js +8 -1
  349. package/dist/time/ask.js.map +1 -1
  350. package/dist/time/forms.js +2 -2
  351. package/dist/time/forms.js.map +1 -1
  352. package/dist/time/readers/english/atoms.js +168 -0
  353. package/dist/time/readers/english/atoms.js.map +1 -0
  354. package/dist/time/readers/english/grammar.js +132 -0
  355. package/dist/time/readers/english/grammar.js.map +1 -0
  356. package/dist/time/readers/english/types.js +3 -0
  357. package/dist/time/readers/english/types.js.map +1 -0
  358. package/dist/time/readers/english/zones.js +121 -0
  359. package/dist/time/readers/english/zones.js.map +1 -0
  360. package/dist/time/readers/english.js +24 -336
  361. package/dist/time/readers/english.js.map +1 -1
  362. package/dist/time/readingAsk.js +10 -2
  363. package/dist/time/readingAsk.js.map +1 -1
  364. package/dist/time/reply/classify.js +32 -0
  365. package/dist/time/reply/classify.js.map +1 -0
  366. package/dist/time/reply/decision.js +32 -0
  367. package/dist/time/reply/decision.js.map +1 -0
  368. package/dist/time/reply/decode.js +29 -0
  369. package/dist/time/reply/decode.js.map +1 -0
  370. package/dist/time/reply/project.js +41 -0
  371. package/dist/time/reply/project.js.map +1 -0
  372. package/dist/time/reply/resolve.js +67 -0
  373. package/dist/time/reply/resolve.js.map +1 -0
  374. package/dist/time/reply/types.js +18 -0
  375. package/dist/time/reply/types.js.map +1 -0
  376. package/dist/time/reply.js +7 -0
  377. package/dist/time/reply.js.map +1 -0
  378. package/dist/time/replyForm/bindings.js +60 -0
  379. package/dist/time/replyForm/bindings.js.map +1 -0
  380. package/dist/time/replyForm.js +8 -0
  381. package/dist/time/replyForm.js.map +1 -0
  382. package/dist/time/replyRecord.js +30 -0
  383. package/dist/time/replyRecord.js.map +1 -0
  384. package/dist/time/resolve/agreement.js +31 -0
  385. package/dist/time/resolve/agreement.js.map +1 -0
  386. package/dist/time/resolve/calendar.js +151 -0
  387. package/dist/time/resolve/calendar.js.map +1 -0
  388. package/dist/time/resolve/lookback.js +55 -0
  389. package/dist/time/resolve/lookback.js.map +1 -0
  390. package/dist/time/resolve/points.js +101 -0
  391. package/dist/time/resolve/points.js.map +1 -0
  392. package/dist/time/resolve/types.js +3 -0
  393. package/dist/time/resolve/types.js.map +1 -0
  394. package/dist/time/resolve/wallClock.js +78 -0
  395. package/dist/time/resolve/wallClock.js.map +1 -0
  396. package/dist/time/resolve/zones.js +154 -0
  397. package/dist/time/resolve/zones.js.map +1 -0
  398. package/dist/time/resolve.js +34 -498
  399. package/dist/time/resolve.js.map +1 -1
  400. package/dist/time/resolveRecord.js +2 -0
  401. package/dist/time/resolveRecord.js.map +1 -1
  402. package/dist/time/rows/meaning.js +31 -0
  403. package/dist/time/rows/meaning.js.map +1 -0
  404. package/dist/time/rows/types.js +3 -0
  405. package/dist/time/rows/types.js.map +1 -0
  406. package/dist/time/rows.js +20 -6
  407. package/dist/time/rows.js.map +1 -1
  408. package/dist/time/windows.js +3 -2
  409. package/dist/time/windows.js.map +1 -1
  410. package/dist/tools/declare.js +1 -1
  411. package/dist/tools/inputRequest/data.js +34 -0
  412. package/dist/tools/inputRequest/data.js.map +1 -0
  413. package/dist/tools/inputRequest/response.js +71 -0
  414. package/dist/tools/inputRequest/response.js.map +1 -0
  415. package/dist/tools/inputRequest.js +31 -116
  416. package/dist/tools/inputRequest.js.map +1 -1
  417. package/dist/types/adapters/observability/auditKeptByContract.d.ts.map +1 -1
  418. package/dist/types/context-bisect/ablation.d.ts +8 -0
  419. package/dist/types/context-bisect/ablation.d.ts.map +1 -1
  420. package/dist/types/context-bisect/bisect.d.ts +15 -15
  421. package/dist/types/context-bisect/bisect.d.ts.map +1 -1
  422. package/dist/types/context-bisect/conclusion.d.ts +52 -0
  423. package/dist/types/context-bisect/conclusion.d.ts.map +1 -0
  424. package/dist/types/context-bisect/conclusionTypes.d.ts +76 -0
  425. package/dist/types/context-bisect/conclusionTypes.d.ts.map +1 -0
  426. package/dist/types/context-bisect/format.d.ts +11 -0
  427. package/dist/types/context-bisect/format.d.ts.map +1 -0
  428. package/dist/types/context-bisect/index.d.ts +1 -1
  429. package/dist/types/context-bisect/index.d.ts.map +1 -1
  430. package/dist/types/context-bisect/localize.d.ts +8 -10
  431. package/dist/types/context-bisect/localize.d.ts.map +1 -1
  432. package/dist/types/context-bisect/toBacktrackTrace.d.ts.map +1 -1
  433. package/dist/types/context-bisect/types.d.ts +33 -4
  434. package/dist/types/context-bisect/types.d.ts.map +1 -1
  435. package/dist/types/core/agent/arguments/ask/constants.d.ts +17 -0
  436. package/dist/types/core/agent/arguments/ask/constants.d.ts.map +1 -0
  437. package/dist/types/core/agent/arguments/ask/context.d.ts +24 -0
  438. package/dist/types/core/agent/arguments/ask/context.d.ts.map +1 -0
  439. package/dist/types/core/agent/arguments/ask/fields.d.ts +43 -0
  440. package/dist/types/core/agent/arguments/ask/fields.d.ts.map +1 -0
  441. package/dist/types/core/agent/arguments/ask/replyFields.d.ts +10 -0
  442. package/dist/types/core/agent/arguments/ask/replyFields.d.ts.map +1 -0
  443. package/dist/types/core/agent/arguments/ask/types.d.ts +196 -0
  444. package/dist/types/core/agent/arguments/ask/types.d.ts.map +1 -0
  445. package/dist/types/core/agent/arguments/ask/validation.d.ts +43 -0
  446. package/dist/types/core/agent/arguments/ask/validation.d.ts.map +1 -0
  447. package/dist/types/core/agent/arguments/ask/windowBinding/answer.d.ts +18 -0
  448. package/dist/types/core/agent/arguments/ask/windowBinding/answer.d.ts.map +1 -0
  449. package/dist/types/core/agent/arguments/ask/windowBinding/editedZone.d.ts +12 -0
  450. package/dist/types/core/agent/arguments/ask/windowBinding/editedZone.d.ts.map +1 -0
  451. package/dist/types/core/agent/arguments/ask/windowBinding/fills.d.ts +19 -0
  452. package/dist/types/core/agent/arguments/ask/windowBinding/fills.d.ts.map +1 -0
  453. package/dist/types/core/agent/arguments/ask/windowBinding/question.d.ts +7 -0
  454. package/dist/types/core/agent/arguments/ask/windowBinding/question.d.ts.map +1 -0
  455. package/dist/types/core/agent/arguments/ask/windowBinding/types.d.ts +36 -0
  456. package/dist/types/core/agent/arguments/ask/windowBinding/types.d.ts.map +1 -0
  457. package/dist/types/core/agent/arguments/ask/windowBinding.d.ts +5 -0
  458. package/dist/types/core/agent/arguments/ask/windowBinding.d.ts.map +1 -0
  459. package/dist/types/core/agent/arguments/ask/windowReply.d.ts +12 -0
  460. package/dist/types/core/agent/arguments/ask/windowReply.d.ts.map +1 -0
  461. package/dist/types/core/agent/arguments/ask.d.ts +9 -259
  462. package/dist/types/core/agent/arguments/ask.d.ts.map +1 -1
  463. package/dist/types/core/agent/arguments/dispatch.d.ts +4 -4
  464. package/dist/types/core/agent/arguments/pendingPrivateAsk.d.ts +1 -1
  465. package/dist/types/core/agent/arguments/pendingPrivateAsk.d.ts.map +1 -1
  466. package/dist/types/core/agent/arguments/serve/assumed.d.ts +64 -0
  467. package/dist/types/core/agent/arguments/serve/assumed.d.ts.map +1 -0
  468. package/dist/types/core/agent/arguments/serve/clock.d.ts +105 -0
  469. package/dist/types/core/agent/arguments/serve/clock.d.ts.map +1 -0
  470. package/dist/types/core/agent/arguments/serve/fills.d.ts +66 -0
  471. package/dist/types/core/agent/arguments/serve/fills.d.ts.map +1 -0
  472. package/dist/types/core/agent/arguments/serve/refusals.d.ts +68 -0
  473. package/dist/types/core/agent/arguments/serve/refusals.d.ts.map +1 -0
  474. package/dist/types/core/agent/arguments/serve/schema.d.ts +68 -0
  475. package/dist/types/core/agent/arguments/serve/schema.d.ts.map +1 -0
  476. package/dist/types/core/agent/arguments/serve/values.d.ts +12 -0
  477. package/dist/types/core/agent/arguments/serve/values.d.ts.map +1 -0
  478. package/dist/types/core/agent/arguments/serve/windows.d.ts +61 -0
  479. package/dist/types/core/agent/arguments/serve/windows.d.ts.map +1 -0
  480. package/dist/types/core/agent/arguments/serve.d.ts +12 -417
  481. package/dist/types/core/agent/arguments/serve.d.ts.map +1 -1
  482. package/dist/types/core/agent/assessment/compose.d.ts +2 -2
  483. package/dist/types/core/agent/assessment/integrityReasons.d.ts.map +1 -1
  484. package/dist/types/core/agent/buildAgentChart.d.ts +1 -1
  485. package/dist/types/core/agent/evidence/figures.d.ts +1 -1
  486. package/dist/types/core/agent/findings/types.d.ts +2 -2
  487. package/dist/types/core/agent/findings/types.d.ts.map +1 -1
  488. package/dist/types/core/agent/middleware/rewrites.d.ts +1 -1
  489. package/dist/types/core/agent/stages/answerCoverage.d.ts +1 -1
  490. package/dist/types/core/agent/stages/argumentAsk.d.ts +1 -1
  491. package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
  492. package/dist/types/core/agent/stages/prepareFinal.d.ts +1 -1
  493. package/dist/types/core/agent/stages/seed.d.ts +2 -2
  494. package/dist/types/core/agent/stages/toolCalls/contracts/access.d.ts +1 -1
  495. package/dist/types/core/agent/stages/toolCalls/helpers/sourceNote.d.ts +1 -1
  496. package/dist/types/core/agent/types.d.ts +1 -1
  497. package/dist/types/core/slots/buildToolsSlot.d.ts +4 -4
  498. package/dist/types/debug.d.ts +1 -1
  499. package/dist/types/debug.d.ts.map +1 -1
  500. package/dist/types/events/payloads/agent.d.ts +1 -1
  501. package/dist/types/index.d.ts +1 -1
  502. package/dist/types/index.d.ts.map +1 -1
  503. package/dist/types/lib/saidByPerson.d.ts +2 -2
  504. package/dist/types/locales/timeAsk.d.ts +2 -2
  505. package/dist/types/locales/timeAsk.d.ts.map +1 -1
  506. package/dist/types/semantics/coverage/answer.d.ts +3 -3
  507. package/dist/types/semantics/coverage/period.d.ts +1 -1
  508. package/dist/types/semantics/coverage/timeLimitFacts.d.ts +1 -1
  509. package/dist/types/semantics/coverage/timeLimits.d.ts +1 -1
  510. package/dist/types/time/ask.d.ts +8 -3
  511. package/dist/types/time/ask.d.ts.map +1 -1
  512. package/dist/types/time/readers/english/atoms.d.ts +4 -0
  513. package/dist/types/time/readers/english/atoms.d.ts.map +1 -0
  514. package/dist/types/time/readers/english/grammar.d.ts +50 -0
  515. package/dist/types/time/readers/english/grammar.d.ts.map +1 -0
  516. package/dist/types/time/readers/english/types.d.ts +12 -0
  517. package/dist/types/time/readers/english/types.d.ts.map +1 -0
  518. package/dist/types/time/readers/english/zones.d.ts +14 -0
  519. package/dist/types/time/readers/english/zones.d.ts.map +1 -0
  520. package/dist/types/time/readers/english.d.ts +6 -13
  521. package/dist/types/time/readers/english.d.ts.map +1 -1
  522. package/dist/types/time/readingAsk.d.ts +1 -1
  523. package/dist/types/time/readingAsk.d.ts.map +1 -1
  524. package/dist/types/time/reply/classify.d.ts +3 -0
  525. package/dist/types/time/reply/classify.d.ts.map +1 -0
  526. package/dist/types/time/reply/decision.d.ts +3 -0
  527. package/dist/types/time/reply/decision.d.ts.map +1 -0
  528. package/dist/types/time/reply/decode.d.ts +4 -0
  529. package/dist/types/time/reply/decode.d.ts.map +1 -0
  530. package/dist/types/time/reply/project.d.ts +6 -0
  531. package/dist/types/time/reply/project.d.ts.map +1 -0
  532. package/dist/types/time/reply/resolve.d.ts +5 -0
  533. package/dist/types/time/reply/resolve.d.ts.map +1 -0
  534. package/dist/types/time/reply/types.d.ts +72 -0
  535. package/dist/types/time/reply/types.d.ts.map +1 -0
  536. package/dist/types/time/reply.d.ts +4 -0
  537. package/dist/types/time/reply.d.ts.map +1 -0
  538. package/dist/types/time/replyForm/bindings.d.ts +23 -0
  539. package/dist/types/time/replyForm/bindings.d.ts.map +1 -0
  540. package/dist/types/time/replyForm.d.ts +4 -0
  541. package/dist/types/time/replyForm.d.ts.map +1 -0
  542. package/dist/types/time/replyRecord.d.ts +9 -0
  543. package/dist/types/time/replyRecord.d.ts.map +1 -0
  544. package/dist/types/time/resolve/agreement.d.ts +7 -0
  545. package/dist/types/time/resolve/agreement.d.ts.map +1 -0
  546. package/dist/types/time/resolve/calendar.d.ts +23 -0
  547. package/dist/types/time/resolve/calendar.d.ts.map +1 -0
  548. package/dist/types/time/resolve/lookback.d.ts +7 -0
  549. package/dist/types/time/resolve/lookback.d.ts.map +1 -0
  550. package/dist/types/time/resolve/points.d.ts +25 -0
  551. package/dist/types/time/resolve/points.d.ts.map +1 -0
  552. package/dist/types/time/resolve/types.d.ts +12 -0
  553. package/dist/types/time/resolve/types.d.ts.map +1 -0
  554. package/dist/types/time/resolve/wallClock.d.ts +29 -0
  555. package/dist/types/time/resolve/wallClock.d.ts.map +1 -0
  556. package/dist/types/time/resolve/zones.d.ts +58 -0
  557. package/dist/types/time/resolve/zones.d.ts.map +1 -0
  558. package/dist/types/time/resolve.d.ts +2 -13
  559. package/dist/types/time/resolve.d.ts.map +1 -1
  560. package/dist/types/time/resolveRecord.d.ts +6 -1
  561. package/dist/types/time/resolveRecord.d.ts.map +1 -1
  562. package/dist/types/time/rows/meaning.d.ts +3 -0
  563. package/dist/types/time/rows/meaning.d.ts.map +1 -0
  564. package/dist/types/time/rows/types.d.ts +226 -0
  565. package/dist/types/time/rows/types.d.ts.map +1 -0
  566. package/dist/types/time/rows.d.ts +9 -210
  567. package/dist/types/time/rows.d.ts.map +1 -1
  568. package/dist/types/time/windows.d.ts +2 -0
  569. package/dist/types/time/windows.d.ts.map +1 -1
  570. package/dist/types/tools/declare.d.ts +1 -1
  571. package/dist/types/tools/inputRequest/data.d.ts +5 -0
  572. package/dist/types/tools/inputRequest/data.d.ts.map +1 -0
  573. package/dist/types/tools/inputRequest/response.d.ts +37 -0
  574. package/dist/types/tools/inputRequest/response.d.ts.map +1 -0
  575. package/dist/types/tools/inputRequest.d.ts +3 -11
  576. package/dist/types/tools/inputRequest.d.ts.map +1 -1
  577. package/package.json +1 -1
@@ -26,977 +26,11 @@
26
26
  * ruled argument, no sentence here prints its value — it says the value is
27
27
  * hidden by the tool's view instead.
28
28
  */
29
- import { carriesArgumentView } from '../../toolShownArgs.js';
30
- import { ASSUMED_BLOCK_HEADING } from '../../../semantics/coverage/answer.js';
31
- import { renderTimeLimits } from '../../../semantics/coverage/timeLimits.js';
32
- import { argumentRewritesOf } from '../middleware/rewrites.js';
33
- import { isRefused, periodFactsOf, periodFormsOf, rulesOf, } from '../../../tools/declare.js';
34
- import { HIDDEN_VALUE } from './rows.js';
35
- import { LIBRARY_NOTE_OPENING } from '../../../lib/saidByPerson.js';
36
- import { convertForTool, formArguments, granularityMsOf, toolFacts, } from '../../../time/convert.js';
37
- import { windowToConvert } from '../../../time/windows.js';
38
- import { presentInstant, presentRange } from '../../../time/present.js';
39
- const isPlainObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
40
- /** A declared value as a sentence prints it: a string quoted, a number or boolean bare. */
41
- export function printedValue(value) {
42
- return typeof value === 'string' ? JSON.stringify(value) : String(value);
43
- }
44
- /**
45
- * The sentence a ruled `assume` property carries in the served schema: what the
46
- * library does when the call leaves the argument out, and what the record
47
- * keeps. It promises nothing a later path can break — not that the call runs
48
- * (permission may deny it), only what fills a value that is left out.
49
- */
50
- export function assumeSentence(value, hidden) {
51
- return hidden
52
- ? "If left out, the tool's rule fills a declared value (hidden by the tool's view), recorded as assumed."
53
- : `If left out, the tool's rule fills ${printedValue(value)}, recorded as assumed.`;
54
- }
55
- // LENS · tool-description · persistent-history
56
- // reads: the tool's own `ask` rule — nothing about the call, the model or the person
57
- // law: says what the model may do and what the record keeps; promises no outcome (the call may still
58
- // be denied by permission, refused, or asked about again).
59
- /**
60
- * The sentence a ruled `ask` property carries in the served schema: the rule
61
- * asks the person for the value, so the model may leave it out — and should,
62
- * unless the person gave it. No value is printed: an `ask` rule has no default.
63
- */
64
- export const ASK_SENTENCE = "The tool's rule asks the person for this value; leave it out unless the person gave it.";
65
- // LENS · tool-description · persistent-history
66
- // reads: the tool's own `ask` rule and the declared-sources arm — nothing about the call, the model or
67
- // the person
68
- // law: says what the model may do and where it declares it; promises no outcome (the call may still be
69
- // denied by permission, refused, or asked about again).
70
- /**
71
- * The sentence a ruled `ask` property carries under DECLARED SOURCES
72
- * (`.findings({ argumentSources: true })`, `.inputsLayer({ argumentSources:
73
- * true })`) in place of `ASK_SENTENCE`: the same rule, and — at the place the
74
- * model decides whether to send the value — where it says the person gave it.
75
- * Under the arm a present value with no traced source is asked of the person
76
- * (`resolve.ts`), so "leave it out unless the person gave it" alone told the
77
- * model that SENDING the value was the whole of its statement: in the paid
78
- * step-5 run (`bench/inputs/runs/haiku45-step5`) it left the period out on 32
79
- * of 32 calls where the person gave none — and a period the person HAD given
80
- * was traced to their words, unasked, on 7 of 88 calls.
81
- */
82
- export const ASK_SOURCES_SENTENCE = "The tool's rule asks the person for this value; leave it out unless the person gave it, and " +
83
- 'then quote their words for it in `_findings.from`.';
84
- function withSentence(property, sentence) {
85
- const description = property.description;
86
- const text = typeof description === 'string' && description.trim() !== ''
87
- ? `${description.trimEnd()} ${sentence}`
88
- : sentence;
89
- return { ...property, description: text };
90
- }
91
- // FOLD · the one owner of how a ruled tool's schema is SERVED
92
- // consumers read this and never re-derive it: core/slots/buildToolsSlot.ts · commitWire (the one
93
- // decoration site, through `rulesOnWire`) and core/agent/stages/seed.ts (its static twin), each
94
- // loading this module through `import()` under the arm; servedView rebuilds from the committed
95
- // list, so the decoration is a pure function of (schema, tool).
96
- /**
97
- * The served copy of a ruled tool's schema: every argument an `assume` or an
98
- * `ask` rule governs leaves `required` (the library fills it, or asks the
99
- * person for it, when the call leaves it out) and its property's description
100
- * gains the rule's sentence (an `ask` rule's names `_findings.from` under the
101
- * sources arm, `options.sources`). A rebuilt copy — the registry schema, which
102
- * `validateToolArgs` judges and `mcpServe` serves, is never edited. The SAME
103
- * reference back for a tool with no rules, rules that cannot be read (the
104
- * dispatch re-read refuses its calls) or no tool at all (a chart with no
105
- * claimant record) — so an agent whose tools declare nothing serves the bytes
106
- * it always did.
107
- *
108
- * @example
109
- * ```ts
110
- * withArgumentRules(searchLogs.schema, searchLogs).inputSchema.required; // ['service']
111
- * ```
112
- */
113
- export function withArgumentRules(schema, tool, options) {
114
- const rules = rulesOf(tool);
115
- if (rules === undefined || isRefused(rules))
116
- return schema;
117
- const served = rules.ruled.filter((r) => (r.rule === 'assume' && r.assume !== undefined) || (r.rule === 'ask' && r.ask !== undefined));
118
- if (served.length === 0)
119
- return schema;
120
- const input = schema.inputSchema;
121
- const properties = isPlainObject(input.properties) ? { ...input.properties } : {};
122
- for (const r of served) {
123
- const property = properties[r.argument];
124
- if (!isPlainObject(property))
125
- continue;
126
- if (r.rule === 'ask') {
127
- const sentence = options?.sources === true ? ASK_SOURCES_SENTENCE : ASK_SENTENCE;
128
- properties[r.argument] = withSentence(property, sentence);
129
- continue;
130
- }
131
- const value = r.assume;
132
- properties[r.argument] = withSentence(property, assumeSentence(value, carriesArgumentView(tool)));
133
- }
134
- const ruledNames = new Set(served.map((r) => r.argument));
135
- const required = Array.isArray(input.required)
136
- ? input.required.filter((name) => !(typeof name === 'string' && ruledNames.has(name)))
137
- : undefined;
138
- const { required: _required, ...rest } = input;
139
- void _required;
140
- return {
141
- ...schema,
142
- inputSchema: {
143
- ...rest,
144
- properties,
145
- ...(required !== undefined && required.length > 0 && { required }),
146
- },
147
- };
148
- }
149
- /**
150
- * The served list with each ruled tool's schema decorated (`withArgumentRules`,
151
- * from the rules of the implementation that WINS each name), or the SAME list
152
- * when no served schema changed — so an armed agent whose wire carries no
153
- * ruled tool commits the bytes it always did. The tools slot's one decoration
154
- * site (`core/slots/buildToolsSlot.ts` · `commitWire`) calls it under the arm.
155
- * `optionsOf` gives each schema its own `ServeOptions`: under declared sources
156
- * one wire can hold a tool that carries `_findings.from` beside a provider's
157
- * tool whose author owns `_findings`, which does not.
158
- */
159
- export function rulesOnWire(served, winningTools, optionsOf) {
160
- let changed = false;
161
- const decorated = served.map((schema) => {
162
- const next = withArgumentRules(schema, winningTools.get(schema.name), optionsOf?.(schema));
163
- if (next !== schema)
164
- changed = true;
165
- return next;
166
- });
167
- return changed ? decorated : served;
168
- }
169
- /** A converted value as the line prints it — an object form's as JSON. */
170
- function printedArgument(value) {
171
- return typeof value === 'object' && value !== null
172
- ? JSON.stringify(value)
173
- : printedValue(value);
174
- }
175
- /** The served tools (in served order) whose winning implementation declares period forms. */
176
- function periodToolsOf(served, winningTools) {
177
- const out = [];
178
- for (const schema of served) {
179
- const tool = winningTools.get(schema.name);
180
- const rules = rulesOf(tool);
181
- if (tool === undefined || rules === undefined || isRefused(rules))
182
- continue;
183
- const forms = periodFormsOf(rules.period);
184
- if (forms.length === 0)
185
- continue;
186
- out.push({ name: schema.name, tool, forms, facts: periodFactsOf(rules.period) });
187
- }
188
- return out;
189
- }
190
- /** Whose one window of the person's words is — the line's source clause. */
191
- function whoseWindow(w) {
192
- if (w.source === 'answered') {
193
- return w.answer === 'edited'
194
- ? 'the window the person gave when asked what their words meant'
195
- : 'the window the person confirmed when asked what their words meant';
196
- }
197
- return "a reading of the person's words they have not confirmed, not their words";
198
- }
199
- /**
200
- * A window for a person, in its zone, to the minute with its end AS SAID — the last minute inside
201
- * the half-open range (`time/present.ts` · `presentRange`); the ISO interval if it cannot be.
202
- */
203
- function presentedWindow(w) {
204
- try {
205
- return presentRange(w.range, { zone: w.zone }, 'minute');
206
- }
207
- catch {
208
- return `${w.range.from}/${w.range.to}`;
209
- }
210
- }
211
- /** One tool's values for one settled window — exact, else the wider read the fill would use, said so. */
212
- function toolValues(pt, w, windows) {
213
- const ctx = {
214
- now: windows.now,
215
- zone: w.zone,
216
- ...(windows.appZone !== undefined && { appZone: windows.appZone }),
217
- granularityMs: granularityMsOf(pt.facts),
218
- };
219
- // The one answer (`convertForTool`) over the one input (`windowToConvert`) the fill and the time
220
- // ask's answer also use: the values named here are the values the call is handed, and a window
221
- // the tool would refuse is named for no tool.
222
- const read = convertForTool(windowToConvert(w), pt.forms, pt.facts, ctx);
223
- if ('refused' in read)
224
- return undefined;
225
- const conversion = read.conversion;
226
- const values = Object.entries(conversion.values).map(([argument, value]) => carriesArgumentView(pt.tool)
227
- ? `${argument} (hidden by the tool's view)`
228
- : `${argument} ${printedArgument(value)}`);
229
- const wider = 'sent' in conversion ? ' (a wider read than the words named)' : '';
230
- return `${pt.name} ${values.join(', ')}${wider}`;
231
- }
232
- /** The settled half: each window, whose it is, and each tool's values for it. */
233
- function settledSentence(tools, windows) {
234
- const clauses = [];
235
- for (const w of windows.windows) {
236
- if (w.quote === undefined)
237
- continue;
238
- const values = tools.flatMap((pt) => toolValues(pt, w, windows) ?? []);
239
- if (values.length === 0)
240
- continue;
241
- clauses.push(`“${w.quote}” is ${presentedWindow(w)}, ${whoseWindow(w)} — ${values.join('; ')}`);
242
- }
243
- if (clauses.length === 0)
244
- return undefined;
245
- const these = clauses.length === 1 ? 'that window' : 'those windows';
246
- return (`The person's time words, as the library holds them: ${clauses.join('. ')}. ` +
247
- `A call may pass these values as written; an answer built on them states ${these}.`);
248
- }
249
- /**
250
- * The control half: the window the person set in the app's time control (the run's `time.window`,
251
- * `source: 'control'`, TQ26) — the person's own, like an answer — in their zone, with each served
252
- * period tool's values for it, the same conversion the fill uses. So an app never writes its own
253
- * prompt text for a window it set from a UI. The window is a fact about the person's TURN, not
254
- * about a tool (G14): with no served period tool that can read it, the sentence still names it —
255
- * without values, and without a permission to pass any.
256
- */
257
- function controlSentence(tools, windows) {
258
- const w = windows.control;
259
- if (w === undefined)
260
- return undefined;
261
- const values = tools.flatMap((pt) => toolValues(pt, w, windows) ?? []);
262
- // Under an unknown zone (G15) the window is spelled in UTC — the zone the presented window
263
- // already names — and the line says why, once.
264
- const unknown = windows.zoneUnknown === true ? ` (${UNKNOWN_ZONE_CLAUSE})` : '';
265
- const named = `The window the person set in the app's time control is ${presentedWindow(w)}${unknown}`;
266
- if (values.length === 0)
267
- return `${named}. An answer built on it states that window.`;
268
- return (`${named} — ${values.join('; ')}. A call may pass these values as written; an answer built ` +
269
- 'on them states that window.');
270
- }
271
- /**
272
- * The pending half: the quotes no one has confirmed. Before any call ran on a window of the
273
- * model's own, the one move that asks the person — the call with the period left out — named as
274
- * the next step, with the two moves that do not (a question in the reply, a written window).
275
- * After one did, the limit the answer states instead, as a CONCLUSION about the results in hand:
276
- * whose reading their window is and what the answer names — never a story of the call that ran
277
- * and never a negation of a confirmation. Measured twice: "the person has not confirmed it" drew
278
- * "You're right… I apologize" on 37/37 answers (T6b round 1); "the call that ran carried a window
279
- * written into the call, not one the person confirmed", under the library's opening, still drew it
280
- * on 7/10 (`bench/time/runs/haiku45-t6b-r2`, stopped) — a past-tense account of the call reads as
281
- * the person's complaint, whoever the opening says is talking.
282
- */
283
- function pendingSentence(allTools, windows) {
284
- // A tool that refused a quote cannot confirm it: the quote is pending only for the tools that
285
- // did not, and one every served period tool refused is the refused half's alone.
286
- const pending = (windows.pending ?? []).filter((q) => allTools.some((t) => !refusedFor(windows, q, t.name)));
287
- if (pending.length === 0)
288
- return undefined;
289
- const tools = allTools.filter((t) => pending.some((q) => !refusedFor(windows, q, t.name)));
290
- const quotes = pending.map((q) => `“${q}”`).join(', ');
291
- if (windows.ranUnconfirmed === true) {
292
- return (`The results for ${quotes} cover the window written into the call — the assistant's own ` +
293
- `reading of those words. So the answer gives those results and names that window as the ` +
294
- `assistant's reading of ${quotes}.`);
295
- }
296
- const leftOut = tools.flatMap((pt) => {
297
- const args = [...new Set(pt.forms.flatMap((f) => formArguments(f).map((a) => a.argument)))];
298
- return args.length === 0 ? [] : [{ name: pt.name, args: args.join(', ') }];
299
- });
300
- if (leftOut.length === 0)
301
- return undefined;
302
- const unread = (windows.pendingUnread ?? []).filter((q) => pending.includes(q));
303
- if (unread.length > 0) {
304
- return unreadSentence(pending, windows.pendingZones ?? [], unread, leftOut.map((c) => `${c.name} with ${c.args} left out`).join(', or '));
305
- }
306
- const calls = leftOut.map((c) => `${c.name} is called with ${c.args} left out`);
307
- return (`The window for ${quotes} is not settled yet: ${formClause(pending, windows.pendingZones)} ` +
308
- `${calls.join(', or ')} (or the call is refused with the reason). So the next step is that ` +
309
- 'call — not a question about the time in the reply, and not a window written into the call, ' +
310
- 'which would run unconfirmed.');
311
- }
312
- /**
313
- * What the library's own form does for the pending quotes, up to "opens when": it shows its
314
- * reading to confirm — or, for a quote it holds no reading of (`ReaderWindows.pendingZones`: a
315
- * zone it cannot resolve), it asks which time zone the words name and shows no reading. Words it
316
- * could not read at all (`ReaderWindows.pendingUnread`) are {@link unreadSentence}'s.
317
- */
318
- function formClause(pending, zones = []) {
319
- const zoned = pending.filter((q) => zones.includes(q));
320
- const read = pending.filter((q) => !zones.includes(q));
321
- if (zoned.length === 0) {
322
- return ("the person confirms it in the library's own form, which shows its reading of those " +
323
- 'words with the zone and opens when');
324
- }
325
- const zq = zoned.map((q) => `“${q}”`).join(', ');
326
- if (read.length === 0) {
327
- return ('the library holds no reading of those words until it knows which time zone they name, ' +
328
- 'so its own form asks the person for that zone, and it opens when');
329
- }
330
- const rq = read.map((q) => `“${q}”`).join(', ');
331
- return (`the person confirms ${rq} in the library's own form, which shows its reading of those ` +
332
- `words with the zone, and names the time zone of ${zq}, which the library holds no reading ` +
333
- 'of until it knows it; the form opens when');
334
- }
335
- /**
336
- * The pending half when some of the person's words were not read at all
337
- * (`ReaderWindows.pendingUnread`): the library's CONCLUSION and the ONE next step, in that order —
338
- * it could not read those words, so the next step is the call with the period left out, which
339
- * opens its own form (asking which time they meant, nothing filled in; beside it, a reading to
340
- * confirm and a zone to name, each quote with what the form does for it) — then the two moves
341
- * that are not it, said as what not to do.
342
- *
343
- * WHY THIS SHAPE. The line before it opened "The window for … is not settled yet: the library
344
- * could not read those words, so its own form asks the person which time they meant … So the next
345
- * step is that call — not a question about the time in the reply". Haiku 4.5 answered it with a
346
- * question in prose and no call on 15/15 `yesterday-morning` runs of the T6b bench
347
- * (`bench/time/runs/haiku45-t6b-v2`), and again in the 2026-10-01 demo video ("which clients had
348
- * slow operations yesterday morning"): "could not read" read as permission to ask, and the next
349
- * step came last. So the step comes first, as the conclusion of what the library could not read,
350
- * and the reply's question is named as the move NOT to make (`bench/time/RULE-unread.md`).
351
- */
352
- function unreadSentence(pending, zones, unread, leftOut) {
353
- const listed = (qs) => qs.map((q) => `“${q}”`).join(', ');
354
- const zoned = pending.filter((q) => zones.includes(q) && !unread.includes(q));
355
- const read = pending.filter((q) => !zones.includes(q) && !unread.includes(q));
356
- const alone = zoned.length === 0 && read.length === 0;
357
- const does = [
358
- alone
359
- ? 'asks the person which time they meant, with nothing filled in'
360
- : `asks the person which time ${listed(unread)} meant, with nothing filled in`,
361
- ...(read.length > 0
362
- ? [`shows its reading of ${listed(read)} with the zone for the person to confirm`]
363
- : []),
364
- ...(zoned.length > 0
365
- ? [
366
- `asks the time zone of ${listed(zoned)}, which the library holds no reading of until it knows it`,
367
- ]
368
- : []),
369
- ];
370
- const doing = does.length === 1
371
- ? does[0]
372
- : `${does.slice(0, -1).join(', ')}, and ${does[does.length - 1]}`;
373
- return (`The library could not read ${listed(unread)}, so the next step is to call ${leftOut}: ` +
374
- `that call opens the library's own form, which ${doing} (or the call is refused with the ` +
375
- 'reason). Do not ask about the time in the reply — the form asks it — and do not write a ' +
376
- 'window into the call, which would run unconfirmed.');
377
- }
378
- // LENS · late-line · request-ephemeral
379
- // reads: the person's windows a SERVED period tool refused this turn before dispatch (`windows.ts` ·
380
- // `readerWindowsOf`, `refused`: the quote, the tool and the reason code) and that tool's
381
- // declared facts
382
- // law: the library's CONCLUSION about a call that did not run: past tense for the refusal, the
383
- // reason in the tool's declared facts only (the one text `timeRefusal` also serves — never the
384
- // window's value), then what an answer states; it names no next move for that window.
385
- /**
386
- * The refused half of the served time line: each window of the person's a
387
- * served period tool refused before dispatch — the call's reason in the same
388
- * words its result read ({@link timeRefusal}), then the conclusion an answer
389
- * states. A refused window is not a pending one to ask about again: the T6b
390
- * bench's future case asked the same refused call five times and ran out of
391
- * budget while the pending half kept naming that call as the next step.
392
- * `undefined` when nothing was refused.
393
- */
394
- function refusedSentence(tools, windows) {
395
- const byName = new Map(tools.map((t) => [t.name, t]));
396
- const refused = (windows.refused ?? []).filter((r) => byName.has(r.toolName));
397
- if (refused.length === 0)
398
- return undefined;
399
- const clauses = refused.map((r) => {
400
- // The person's window was refused before a form was chosen: the tool's facts (`toolFacts`).
401
- const pt = byName.get(r.toolName);
402
- const facts = toolFacts(pt.forms, pt.facts);
403
- return `${r.toolName} was not run for “${r.quote}”: ${refusalReason(r.refused, facts, r.argument)}.`;
404
- });
405
- const names = [...new Set(refused.map((r) => r.toolName))];
406
- const conclusion = refused.length === 1
407
- ? `So the answer tells the person that ${names[0]} could not read that time, and claims ` +
408
- `nothing about it from ${names[0]}.`
409
- : 'So the answer tells the person which of those times each tool could not read, and ' +
410
- 'claims nothing about them from that tool.';
411
- return `${clauses.join(' ')} ${conclusion}`;
412
- }
413
- /** Whether `tool` refused the person's window for `quote` this turn. */
414
- const refusedFor = (windows, quote, tool) => (windows.refused ?? []).some((r) => r.quote === quote && r.toolName === tool);
415
- // LENS · late-line · request-ephemeral
416
- // reads: the turn's settled windows of the person's words (each mention's quote, its one window and
417
- // WHOSE it is — the person's answer in the time ask, or a model reader's reading), the
418
- // quotes still pending (a rule reading the person has not answered — `bind.ts` ·
419
- // `pendingQuotesOf`), the turn's clock, and the SERVED tools' declared period forms and
420
- // facts — converted by the one owner (`time/convert.ts`)
421
- // law: the library's CONCLUSION, never raw facts: a settled window is named with its source (a
422
- // reading is never called the person's words) and the values each tool takes, as a
423
- // permission ("may pass"); a pending quote names no window and no reading (a proposal is not
424
- // a fact the model may pass) — only that it is not confirmed and the one move that asks the
425
- // person. Whether a call is filled, bound or refused is decided at dispatch and recorded there.
426
- /**
427
- * The ONE served time line (TQ13; step T6b's serving placement): one
428
- * request-only `user` line appended LAST to the request, at the decision
429
- * point — composed at the tools slot's one decoration site
430
- * (`core/slots/buildToolsSlot.ts` · `commitWire`) from the tools it really
431
- * serves, carried to `callLLM` on `timeLine`, and rebuilt by
432
- * `time-travel/servedView.ts` from the same committed key. Four parts:
433
- *
434
- * - SETTLED — each window the person confirmed or gave in the time ask (or a
435
- * `model` reader's reading), in the person's zone, WHOSE it is, and each
436
- * served period tool's values for it — the exact conversion, else the wider
437
- * one the fill would use (said so); a value the tool's view hides is named
438
- * hidden. So the model never re-derives a window from words, and the answer
439
- * states the window it was built on.
440
- * - CONTROL — the window the person set in the app's time control, in
441
- * their zone, with each served period tool's values for it; with none
442
- * (no period tool served, or none can read it) the window alone (G14).
443
- * - REFUSED — a window of the person's a served period tool refused before
444
- * dispatch this turn: the refusal's reason in the result's own words, then
445
- * what an answer states. That quote is no longer pending for that tool.
446
- * - PENDING — a proposal the person has not answered is no window yet, and a
447
- * call that writes its own window runs as sent, unconfirmed (§ 7.3). The
448
- * line names the next step — the call with the period arguments left out,
449
- * so the library's own form confirms the window with the person — and the
450
- * two moves that are not it (a question about the time in the reply, a
451
- * written window). Once a call of the turn already ran on a written window
452
- * (`ranUnconfirmed`), it names the limit an answer states instead.
453
- *
454
- * `undefined` when no part has anything to say — a turn with no time words
455
- * and no control window serves no line at all; with no served period tool
456
- * only the control half can speak. The halves carry no opening: {@link timeLine} composes the served line and
457
- * opens it, once, with {@link TIME_LINE_SOURCE}.
458
- *
459
- * @example
460
- * ```ts
461
- * timeWindowsLine(served, winningTools, { now, windows: [], pending: ['yesterday'] });
462
- * // 'The window for “yesterday” is not settled yet: the person confirms it in the library's own
463
- * // form, which shows its reading of those words with the zone and opens when client_activity
464
- * // is called with start_time, end_time left out (or the call is refused with the reason). So
465
- * // the next step is that call — not a question about the time in the reply, and not a window
466
- * // written into the call, which would run unconfirmed.'
467
- * ```
468
- */
469
- export function timeWindowsLine(served, winningTools, windows) {
470
- const tools = periodToolsOf(served, winningTools);
471
- // The control window is the person's turn's, served whether or not a period tool is (G14); the
472
- // other halves speak about period tools only.
473
- if (tools.length === 0)
474
- return controlSentence(tools, windows);
475
- const halves = [
476
- settledSentence(tools, windows),
477
- controlSentence(tools, windows),
478
- refusedSentence(tools, windows),
479
- pendingSentence(tools, windows),
480
- ].filter((h) => h !== undefined);
481
- return halves.length === 0 ? undefined : halves.join(' ');
482
- }
483
- /**
484
- * The served time limits from the Tools mount's `timeLimits` FACTS
485
- * (`semantics/coverage/timeLimitFacts.ts` · `TimeLimitFacts`): rendered for the MODEL
486
- * (`semantics/coverage/timeLimits.ts` · `renderTimeLimits` — the one composer the
487
- * limits block asks too), then {@link timeLimitsSentence}. The facts cross
488
- * the mount unrendered so the renderer loads here, under the arm, and never
489
- * on the graph a plain agent loads.
490
- *
491
- * @example
492
- * ```ts
493
- * timeLimitsLine(undefined); // undefined — the turn's reads match what was asked
494
- * ```
495
- */
496
- export function timeLimitsLine(facts) {
497
- return timeLimitsSentence(renderTimeLimits(facts, 'model'));
498
- }
499
- // LENS · late-line · request-ephemeral
500
- // reads: the turn's `period` rows whose result checks hold and its `source-clock` rows, composed by
501
- // the ONE owner of the limits lines (`semantics/coverage/timeLimits.ts` · `timeLimitLinesOf`,
502
- // audience `model`) — the same lines the limits block prints for the person after the answer
503
- // law: the library's CONCLUSION about what each call READ against what it ASKED (step T8), both
504
- // ranges in the person's zone, and what an answer built on it states; it names what the record
505
- // holds for calls that already ran and promises nothing a later call can break. A source that
506
- // holds none or part of the asked time is named with ITS span in the person's zone (`held`):
507
- // the zone conversion is the library's, never the model's.
508
- /**
509
- * The time limits an answer states (time step T8's serving placement): the
510
- * result checks that hold this turn — a read narrower, wider or shifted from
511
- * what was asked, a window older than the source keeps, sources on different
512
- * clocks — served to the MODEL as the library's conclusion, LATE, at the
513
- * decision point, in the ONE served time line (TQ13) after the windows'
514
- * halves. The step-7b bench showed why: raw facts on a result are not
515
- * compared by the model, a conclusion served at the decision point is.
516
- *
517
- * `undefined` when nothing holds — a turn whose reads match what was asked
518
- * serves no sentence at all. It carries no opening: {@link timeLine} opens
519
- * the served line once with {@link TIME_LINE_SOURCE}.
520
- *
521
- * @example
522
- * ```ts
523
- * timeLimitsSentence({ period: ['client_activity read less than was asked — asked: …; read: …'], clocks: [] });
524
- * // 'The time the tools read is not the time asked about — client_activity read less than was
525
- * // asked — asked: …; read: …. So the answer to the person states the time each result read and
526
- * // claims nothing about time no result read.'
527
- * ```
528
- */
529
- export function timeLimitsSentence(lines) {
530
- if (lines === undefined)
531
- return undefined;
532
- const parts = [];
533
- if (lines.period.length > 0) {
534
- parts.push(`the time the tools read is not the time asked about — ${lines.period.join('; ')}. So ` +
535
- `the answer to the person states the time each result read and claims nothing about ` +
536
- `time no result read.`);
537
- }
538
- // A source that holds none or only part of the asked time (take 3): the spans in the person's
539
- // zone, so the answer names what the source holds without converting a UTC instant itself.
540
- if (lines.held !== undefined && lines.held.length > 0) {
541
- parts.push(`what the sources hold is not all of the time asked about — ${lines.held.join('; ')}. So ` +
542
- `the answer to the person states what each source holds and claims nothing about the ` +
543
- `time it does not hold.`);
544
- }
545
- if (lines.clocks.length > 0) {
546
- parts.push(`Clocks: ${lines.clocks.join('; ')}.`);
547
- }
548
- if (parts.length === 0)
549
- return undefined;
550
- const capital = (part) => part.charAt(0).toUpperCase() + part.slice(1);
551
- return parts.map(capital).join(' ');
552
- }
553
- /** What a line says when the run's clock zone is unknown (G15) — the zone is never guessed. */
554
- export const UNKNOWN_ZONE_CLAUSE = "the person's time zone is not known";
555
- // LENS · late-line · request-ephemeral
556
- // reads: the turn's `clock` row — its `now` and zone (`zoneSource: 'unknown'` → the UTC spelling)
557
- // law: the library's clock as a CONCLUSION, one short sentence, to the minute, the weekday named
558
- // (a model re-derives a weekday wrong), the zone always named — and named as not known when
559
- // it is, never guessed (G15).
560
- /**
561
- * The run clock, for the model (G16): the turn's `now` to the minute, its
562
- * weekday and date in the person's zone, the zone named — so the model never
563
- * answers "today" or "this morning" from its training date. Under `.time()`
564
- * it is the first part of the ONE served time line on every request; never
565
- * without it. `undefined` when there is no clock (or it cannot be spelled).
566
- *
567
- * @example
568
- * ```ts
569
- * clockSentence({ now: '2026-10-09T15:40:00Z', zone: 'America/Los_Angeles' });
570
- * // "This turn's time: Friday 2026-10-09 08:40 America/Los_Angeles (UTC-07:00)."
571
- * clockSentence({ now: '2026-10-09T15:40:00Z', zone: 'UTC', zoneUnknown: true });
572
- * // "This turn's time: Friday 2026-10-09 15:40 UTC (the person's time zone is not known)."
573
- * ```
574
- */
575
- export function clockSentence(clock) {
576
- if (clock === undefined)
577
- return undefined;
578
- const ms = Date.parse(clock.now);
579
- if (!Number.isFinite(ms))
580
- return undefined;
581
- try {
582
- const minute = new Date(Math.floor(ms / 60_000) * 60_000).toISOString();
583
- const at = presentInstant(minute, { zone: clock.zone });
584
- const weekday = new Intl.DateTimeFormat('en-US', {
585
- weekday: 'long',
586
- timeZone: clock.zone,
587
- }).format(ms);
588
- const unknown = clock.zoneUnknown === true ? ` (${UNKNOWN_ZONE_CLAUSE})` : '';
589
- return `This turn's time: ${weekday} ${at}${unknown}.`;
590
- }
591
- catch {
592
- return undefined;
593
- }
594
- }
595
- /**
596
- * The ONE served time line's opening: WHO says it — the library, not the
597
- * person. The line is a request-only `user` message, so an unmarked one reads
598
- * as the person talking. Measured twice: the T8 bench's first paid round
599
- * (stopped at 41 runs) — 15 of 15 answers to the limits sentence opened
600
- * "You're right" / "I apologize", and naming the library alone (round 1,
601
- * stopped at 46) still drew "Thank you for the clarification"; the T6b paid
602
- * run, whose windows halves carried no opening — 37 of 37 answers after the
603
- * unconfirmed-call sentence opened "You're right… I apologize". So it also
604
- * says the note is no correction, and how an answer uses it. It says nothing
605
- * about WHEN to answer: the pending half names a call as the next step.
606
- * Applied once, by {@link timeLine}, whichever halves the line holds.
607
- *
608
- * The bytes are the authorship registry's (`lib/saidByPerson.ts` ·
609
- * `LIBRARY_NOTE_OPENING`, one of `LIBRARY_AUTHORED_PREFIXES`), so the line
610
- * that is served LAST on every request under `.time()` is never read as the
611
- * person's words by `isSaidByPerson` — the last `role: 'user'` message of a
612
- * request is the library's, and "this turn" is not (G17).
613
- */
614
- export const TIME_LINE_SOURCE = LIBRARY_NOTE_OPENING;
615
- // LENS · late-line · request-ephemeral
616
- // reads: the composed halves of the turn's ONE served time line — the person's windows
617
- // (`timeWindowsLine`) and the time limits (`timeLimitsLine`) — and nothing else
618
- // law: one line, one opening: the source is said ONCE, first, whichever halves are present; no half
619
- // carries its own, so the opening never repeats inside the line.
620
- /**
621
- * The ONE served time line (TQ13): its parts in order — the windows' halves,
622
- * then the limits — opened ONCE with {@link TIME_LINE_SOURCE}. The tools
623
- * slot's one decoration site (`core/slots/buildToolsSlot.ts` · `commitWire`)
624
- * calls it, `callLLM` appends the result LAST to the request, and
625
- * `time-travel/servedView.ts` rebuilds it byte for byte from the same
626
- * committed `timeLine` key. `undefined` when no part has anything to say — a
627
- * turn with nothing to say serves no line (and without `.time()` nothing here
628
- * runs at all).
629
- *
630
- * @example
631
- * ```ts
632
- * timeLine([undefined, timeLimitsLine(facts)]);
633
- * // '[A note from the library that runs the tools — …] The time the tools read is not …'
634
- * timeLine([undefined, undefined]); // undefined
635
- * ```
636
- */
637
- export function timeLine(parts) {
638
- const present = parts.filter((p) => p !== undefined && p.length > 0);
639
- return present.length === 0 ? undefined : [TIME_LINE_SOURCE, ...present].join(' ');
640
- }
641
- // LENS · tool-result · persistent-history
642
- // reads: the call's own fill (`argumentResolutions`, the layer's entry for this toolCallId), kept only
643
- // where the call RAN with it (`dispatch.ts` · `fillsThatRan` — a middleware may rewrite one)
644
- // law: may omit, never deny; every clause anchored to the call it was composed on — past tense,
645
- // naming the call this result answers, so a later call of the turn re-reading it reads a true sentence.
646
- /**
647
- * The past-tense note ToolCalls appends to the result of a call that RAN on a
648
- * value the library filled — one bracket per filled argument the call really
649
- * ran with (a clause whose fill a before-tool middleware rewrote is left
650
- * out), after the tool's own bytes. The message then carries `toolChars`, and
651
- * every reader of a result's content as the TOOL's words reads through that
652
- * cut (`lib/toolBytes.ts` · `toolBytesOf`): the evidence index, the answer's
653
- * standing and the answer account's in-view results, the unsupported-argument
654
- * seam's grounded corpus and the empty-lookup seam's producer corpus. The
655
- * value is kept in the note because the model needs it to reason about what
656
- * ran ("no errors in 2h"); it is never evidence for that value, and it never
657
- * hides a reading of the tool's own bytes.
658
- *
659
- * @example
660
- * ```ts
661
- * filledNote('search_logs', [{ argument: 'window', value: '2h', hidden: false }]);
662
- * // '\n\n[window was not in the search_logs call this result answers; the call ran with "2h",
663
- * // the value the tool's rule assumes — recorded as assumed, not as the person's.]'
664
- * ```
665
- */
666
- export function filledNote(toolName, fills, options) {
667
- return fills
668
- .map((f) => f.source === 'answered'
669
- ? answeredClause(toolName, f, options?.sources === true)
670
- : f.source === 'window'
671
- ? windowClause(toolName, f)
672
- : assumedClause(toolName, f))
673
- .join('');
674
- }
675
- /** A filled value as a note prints it — an object form's value as JSON. */
676
- function printedFill(value) {
677
- return typeof value === 'object' ? JSON.stringify(value) : printedValue(value);
678
- }
679
- // LENS · tool-result · persistent-history
680
- // reads: the call's window fill (`argumentResolutions`: the turn's ONE window of the person's, converted
681
- // into the tool's form — `time/bind.ts`), kept only where the call RAN with it, and whose window
682
- // it was (the person's words, a model reader's unconfirmed reading of them, a UI control)
683
- // law: may omit, never deny; past tense, naming the call this result answers; a reading of the person's
684
- // words is never called their words.
685
- /** The clause for a value the turn's one window of the person's filled (the time layer, step T5a). */
686
- function windowClause(toolName, f) {
687
- const whose = f.from === 'control'
688
- ? 'from the window the person set in the app — recorded as set in the app'
689
- : f.from === 'answered'
690
- ? 'from the window the person chose when asked what their words meant — recorded as ' +
691
- "the person's answer"
692
- : f.from === 'derived-from-reading'
693
- ? "from a reading of the person's words they have not confirmed — recorded as a reading, " +
694
- "not as the person's"
695
- : "from the window the person's own words gave — recorded as the person's";
696
- const wider = f.wider === 'reads-more'
697
- ? "; the tool's form could not hold that window exactly, so the value reads a wider one — " +
698
- 'recorded as wider than asked'
699
- : f.wider === 'tool-trims'
700
- ? "; the tool's form could not hold that window exactly, so the value reads a wider one, " +
701
- 'and the tool declares that it drops the rows outside the asked window'
702
- : '';
703
- return f.hidden
704
- ? `\n\n[${f.argument} was not in the ${toolName} call this result answers; the call ran with ` +
705
- `a value ${whose} (the value is hidden by the tool's view)${wider}.]`
706
- : `\n\n[${f.argument} was not in the ${toolName} call this result answers; the call ran with ` +
707
- `${printedFill(f.value)}, ${whose}${wider}.]`;
708
- }
709
- function assumedClause(toolName, f) {
710
- return f.hidden
711
- ? `\n\n[${f.argument} was not in the ${toolName} call this result answers; the call ran ` +
712
- "with the value the tool's rule assumes (the value is hidden by the tool's view) — " +
713
- "recorded as assumed, not as the person's.]"
714
- : `\n\n[${f.argument} was not in the ${toolName} call this result answers; the call ran ` +
715
- `with ${printedFill(f.value)}, the value the tool's rule assumes — recorded as ` +
716
- "assumed, not as the person's.]";
717
- }
718
- /**
719
- * The clause an answered note gains under declared sources: a later call may
720
- * name the person's answer as its source — `turn`, checked against the
721
- * ledger's `answered` rows (`checks.ts` · `checkTurn`). A permission, never a
722
- * promise: the claim is still checked. In the paid step-5 run the model sent
723
- * an answered period again on the next turn with no `from` entry (and so was
724
- * asked again) or left it out (and so was asked again): nothing it was served
725
- * said an earlier ANSWER was a source it could name.
726
- */
727
- export const ANSWERED_SOURCE_CLAUSE = "; a later call may cite that answer in `_findings.from` with source 'turn'";
728
- // LENS · tool-result · persistent-history
729
- // reads: the call's answered fill (the batch ask's answer bound to this toolCallId), kept only where the
730
- // call RAN with it (`dispatch.ts` · `fillsThatRan`), the value the call had carried, if any, and
731
- // whether declared sources are armed (the `turn` clause)
732
- // law: may omit, never deny; past tense, naming the call this result answers; the `turn` clause is a
733
- // permission ("may cite"), never an outcome — the claim is checked like any other.
734
- function answeredClause(toolName, f, sources) {
735
- const before = f.carried === undefined
736
- ? 'the call had left it out'
737
- : f.hidden
738
- ? 'the call had carried a value of its own'
739
- : `the call had carried ${printedValue(f.carried)}`;
740
- // A hidden answer is on the record as 'REDACTED' — a `turn` claim for it cannot be checked
741
- // (`checks.ts` · `checkTurn`: `uncheckable`), so its clause offers none.
742
- return f.hidden
743
- ? `\n\n[${f.argument} in the ${toolName} call this result answers was chosen by the person ` +
744
- `when asked (the value is hidden by the tool's view; ${before}).]`
745
- : `\n\n[${f.argument} = ${printedFill(f.value)} in the ${toolName} call this result answers ` +
746
- `was chosen by the person when asked (${before})${sources ? ANSWERED_SOURCE_CLAUSE : ''}.]`;
747
- }
748
- // ─── The refusals ───────────────────────────────────────────────────────
749
- // LENS · tool-result · persistent-history
750
- // reads: the dispatch re-read of the tool's rules (`tools/declare.ts` · `rulesOf`) — the assert's own sentence
751
- // law: may omit, never deny; every clause anchored to the call it was composed on.
752
- /** The result a call reads when its tool's rules could not be read at dispatch. */
753
- export function unreadableRulesRefusal(toolName, reason) {
754
- const why = reason.replace(/^defineTool\('[^']*'\):\s*/, '');
755
- return `${toolName} was not run on that call: its argument rules could not be read (${why}).`;
756
- }
757
- // LENS · tool-result · persistent-history
758
- // reads: nothing but the tool's declaration — the agent was built without the inputs layer
759
- // law: may omit, never deny; every clause anchored to the call it was composed on.
760
- /**
761
- * The result a call reads when its tool declares argument rules and the agent
762
- * was built without the inputs layer (a ToolProvider served the tool, and the
763
- * build could not see it) — refused rather than run unruled, because
764
- * configured-and-inert looks exactly like configured-and-working.
765
- */
766
- export function unmountedRulesRefusal(toolName) {
767
- return `${toolName} was not run on that call: it declares argument rules this agent was not built to apply.`;
768
- }
769
- // LENS · tool-result · persistent-history
770
- // reads: the batch ask's settled state — the arguments whose answers never fit, and the rule they failed
771
- // law: may omit, never deny; every clause anchored to the call it was composed on.
772
- /**
773
- * The result a call reads when the person was asked for a ruled argument
774
- * `MAX_ASK_ROUNDS` times and no answer fitted what the tool accepts — the call
775
- * does not run. `expected` is the property schema's own expectation (never the
776
- * person's answer).
777
- */
778
- export function unansweredRefusal(toolName, unanswered) {
779
- const names = unanswered.map((u) => u.argument).join(', ');
780
- const rules = unanswered.flatMap((u) => u.expected !== undefined ? [`${u.argument}: ${u.expected}`] : []);
781
- return (`${toolName} was not run on that call: the person's answers for ${names} did not fit what ` +
782
- `the tool accepts${rules.length > 0 ? ` (${rules.join('; ')})` : ''}.`);
783
- }
784
- // LENS · tool-result · persistent-history
785
- // reads: nothing but the fact that this batch already paused once, for the library's own ask
786
- // law: may omit, never deny; past tense, anchored to the call; names no destination.
787
- /**
788
- * The result a call reads when it needed a person — its check-in consent gate
789
- * tripped, or the tool itself asked to pause — in a batch that had ALREADY
790
- * paused once, to ask the person for argument values: a resumed batch has no
791
- * second pause to give (at most one human question per resume). The call did
792
- * not finish; nothing about it is decided for the person.
793
- */
794
- export function secondPauseRefusal(toolName, why) {
795
- const need = why === 'check-in'
796
- ? 'its check-in consent gate needed a person’s approval for those arguments'
797
- : 'the tool asked to pause for a person';
798
- return (`${toolName} was not run to completion on that call: ${need}, and this batch had already ` +
799
- 'paused once — to ask the person for argument values — so there was no second pause to ' +
800
- 'ask with.');
801
- }
802
- // LENS · tool-result · persistent-history
803
- // reads: the call's `call-window` decision (`time/bind.ts` · `callWindowOf`: the window it asked
804
- // for against the tool's DECLARED facts — `direction`, `retention`, `maxRange`, a `day`-only form,
805
- // a sent wall time the zone skips, a person's window no declared form can read) and those facts'
806
- // own spellings
807
- // law: may omit, never deny; past tense, anchored to the call; prints no window value (it may be the
808
- // person's) — only the tool's declared facts and an argument name; says what the model may do and
809
- // promises no outcome.
810
- /**
811
- * The result a call reads when it was refused BEFORE DISPATCH on its window
812
- * (the time layer, step T5b — time design § 7.2): the window breaks one of the
813
- * tool's declared facts, spans days for a tool that reads one day per call, a
814
- * sent wall time is one the zone's clocks skip, or no form the tool declares
815
- * can read the person's window, exactly or wider (`no-form-holds` — the tool's
816
- * own default never stands in for it). Splitting a window into several calls
817
- * is the model's choice, never the library's.
818
- *
819
- * @example
820
- * ```ts
821
- * timeRefusal('search_logs', 'time-future', { direction: 'past' });
822
- * // 'search_logs was not run on that call: the window it asked for had not happened yet, and the
823
- * // tool declares that its source holds only the past.'
824
- * ```
825
- */
826
- export function timeRefusal(toolName, refusal, facts, argument) {
827
- return `${toolName} was not run on that call: ${refusalReason(refusal, facts, argument)}.`;
828
- }
829
- /**
830
- * Why a window was refused before dispatch, in the tool's declared facts and
831
- * an argument name only — never the window's value. ONE text per code: the
832
- * refused call's result ({@link timeRefusal}) and the served line's
833
- * conclusion (`refusedSentence`) both say it.
834
- */
835
- function refusalReason(refusal, facts, argument) {
836
- switch (refusal) {
837
- case 'time-future':
838
- return ('the window it asked for had not happened yet, and the tool declares that its source ' +
839
- 'holds only the past');
840
- case 'time-past':
841
- return ('the window it asked for had already ended, and the tool declares that its source ' +
842
- 'holds only the future');
843
- case 'beyond-retention':
844
- return ('the window it asked for was wholly older than the oldest data the tool declares its ' +
845
- `source keeps (${facts.retention ?? 'its retention'})`);
846
- case 'over-max-range':
847
- return ('the window it asked for was wider than the tool declares it reads at once ' +
848
- `(maxRange ${facts.maxRange ?? 'undeclared'}); narrower windows, one call each, may be ` +
849
- 'proposed instead');
850
- case 'multi-day':
851
- return ('the window it asked for spanned more than one calendar day, and the tool reads one day ' +
852
- 'per call; one call per day may be proposed instead');
853
- case 'dst-gap':
854
- return (`the wall time sent for ${argument ?? 'its period'} does not exist in the tool's zone — ` +
855
- 'the clocks skip it at a daylight-saving change');
856
- case 'no-form-holds':
857
- return ('no period form the tool declares can read the window it asked for, exactly or by ' +
858
- 'reading a wider one' +
859
- (facts.maxRange !== undefined
860
- ? `, within the most the tool declares it reads at once (maxRange ${facts.maxRange})`
861
- : ''));
862
- }
863
- }
864
- // LENS · tool-result · persistent-history
865
- // reads: the tool's name and the NAMES of the arguments whose answers the refused call carried
866
- // (`kept.ts` keeps their values)
867
- // law: past tense, anchored to the call it was composed on, so a later call of the turn re-reading it
868
- // (after the kept answer was used) still reads a true sentence; says what the model may do and promises
869
- // no outcome (a call proposed again may still be denied, refused, paused or asked); prints no value.
870
- /**
871
- * The clause a refusal by the one-question law gains when the refused call
872
- * carried the person's answers: they were KEPT for the tool's next call that
873
- * leaves those arguments out (`kept.ts`), so the model may propose the call
874
- * again without them. Empty when the call carried none.
875
- *
876
- * @example
877
- * ```ts
878
- * keptAnswersNote('purge_logs', ['window']);
879
- * // " The person's answer for window was kept for the next purge_logs call that leaves it out,
880
- * // so the call may be proposed again without window."
881
- * ```
882
- */
883
- export function keptAnswersNote(toolName, argumentNames) {
884
- if (argumentNames.length === 0)
885
- return '';
886
- if (argumentNames.length === 1) {
887
- const [name] = argumentNames;
888
- return (` The person's answer for ${name} was kept for the next ${toolName} call that leaves ` +
889
- `it out, so the call may be proposed again without ${name}.`);
890
- }
891
- const names = `${argumentNames.slice(0, -1).join(', ')} and ${argumentNames.at(-1)}`;
892
- return (` The person's answers for ${names} were kept for the next ${toolName} call that leaves ` +
893
- 'them out, so the call may be proposed again without them.');
894
- }
895
- // ─── The "Assumed" block (under `.limitsTravelWithTheAnswer()`) ───────────
896
- /**
897
- * The block's opening line. Stable — tests and readers match on it. Owned by
898
- * the appended section's one composer (`semantics/coverage/answer.ts`), beside the
899
- * limits block's heading, so a reader of an answer's text finds every block
900
- * the framework appends through one module; re-exported here, where the block
901
- * is composed.
902
- */
903
- export { ASSUMED_BLOCK_HEADING };
904
- /**
905
- * The "Assumed" block: one line per distinct (tool, argument, value) of this
906
- * turn's `default` rows, in the order the rows were filed. Composed by the
907
- * framework from the rows — the model does not write it, so it cannot drop
908
- * it. Empty string when there is nothing assumed.
909
- */
910
- export function assumedBlock(lines) {
911
- const seen = new Set();
912
- const printed = [];
913
- for (const line of lines) {
914
- const key = JSON.stringify([line.toolName, line.argument, line.hidden ? '' : line.value]);
915
- if (seen.has(key))
916
- continue;
917
- seen.add(key);
918
- printed.push(line.hidden
919
- ? `- ${line.argument} (its value is hidden by the tool's view) (${line.toolName})`
920
- : `- ${line.argument} = ${JSON.stringify(line.value)} (${line.toolName})`);
921
- }
922
- return printed.length === 0 ? '' : `${ASSUMED_BLOCK_HEADING}\n${printed.join('\n')}`;
923
- }
924
- /**
925
- * The "Assumed" block for THIS turn, read off the record: every `default`
926
- * argument row of `turn`, in the order it was filed, less each row a
927
- * before-tool rewrite superseded (its call ran with the rewrite's value, not
928
- * the one the row names). `readDecisions` hands over `middlewareDecisions`; it
929
- * is asked only when a row exists (a run with nothing assumed never reads the
930
- * key), and is absent on an agent with no before-tool chain, whose record can
931
- * hold no tool rewrite. `''` when nothing is assumed. The final branch's armed
932
- * variant (`stages/prepareFinal.ts` · `prepareFinalWithLimitsAndAssumedStage`)
933
- * calls it through `import()`.
934
- *
935
- * @example
936
- * ```ts
937
- * assumedBlockOf(state.findingsLedger ?? [], state.turnNumber, undefined);
938
- * // "Assumed (a tool's rule, not your words):\n- window = \"2h\" (search_logs)"
939
- * ```
940
- */
941
- export function assumedBlockOf(ledger, turn, readDecisions) {
942
- return assumedBlock(assumedLinesFor(ledger, turn, readDecisions));
943
- }
944
- // FOLD · the one reading of "what was assumed this turn"
945
- // consumers read this and never re-derive it: the prose "Assumed" block (`assumedBlockOf`, above),
946
- // a TYPED answer's limits as data (`stages/answerCoverage.ts` · `withAnswerCoverage` — the
947
- // `assumed` list on `answerCoverage`) and the answer layer's standing line
948
- // (`assessment/stage.ts` · `assessAnswerStage`). Same rows, same view, same order — so the block,
949
- // the data and the line cannot disagree about which values were assumed.
950
- /**
951
- * This turn's assumed values, as the "Assumed" block's lines: every `default`
952
- * argument row of `turn`, in the order it was filed, less each row a
953
- * before-tool rewrite superseded (its call ran with the rewrite's value, not
954
- * the one the row names). `readDecisions` hands over `middlewareDecisions`; it
955
- * is asked only when a row exists, and is absent on an agent with no
956
- * before-tool chain, whose record can hold no tool rewrite. `[]` when nothing
957
- * is assumed. The block prints each distinct (tool, argument, value) once.
958
- *
959
- * @example
960
- * ```ts
961
- * assumedLinesFor(state.findingsLedger ?? [], state.turnNumber, undefined);
962
- * // [{ toolName: 'search_logs', argument: 'window', value: '2h', hidden: false }]
963
- * ```
964
- */
965
- export function assumedLinesFor(ledger, turn, readDecisions) {
966
- const rows = defaultRowsOf(ledger, turn);
967
- const rewrites = readDecisions !== undefined && rows.length > 0
968
- ? argumentRewritesOf(readDecisions())
969
- : undefined;
970
- return assumedLinesOf(rows, rewrites);
971
- }
972
- const isArgumentRow = (row) => row.kind === 'argument';
973
- /** This turn's `default` argument rows, in the order they were filed. */
974
- function defaultRowsOf(ledger, turn) {
975
- const rows = [];
976
- for (const row of ledger) {
977
- if (isArgumentRow(row) && row.turn === turn && row.source === 'default')
978
- rows.push(row);
979
- }
980
- return rows;
981
- }
982
- /**
983
- * The rows as the "Assumed" block names them — every row a before-tool
984
- * rewrite superseded left out: its call ran with the rewrite's value, not
985
- * the one the row names (`middleware/rewrites.ts` · `argumentRewritesOf`).
986
- */
987
- function assumedLinesOf(rows, rewrites) {
988
- const lines = [];
989
- for (const row of rows) {
990
- if (rewrites?.get(row.toolCallId)?.has(row.argument) === true)
991
- continue;
992
- const value = row.value ?? '';
993
- lines.push({
994
- toolName: row.toolName,
995
- argument: row.argument,
996
- value,
997
- hidden: value === HIDDEN_VALUE,
998
- });
999
- }
1000
- return lines;
1001
- }
29
+ export { printedValue, assumeSentence } from './serve/values.js';
30
+ export { ASK_SENTENCE, ASK_SOURCES_SENTENCE, withArgumentRules, rulesOnWire, } from './serve/schema.js';
31
+ export { timeWindowsLine } from './serve/windows.js';
32
+ export { timeLimitsLine, timeLimitsSentence, UNKNOWN_ZONE_CLAUSE, clockSentence, TIME_LINE_SOURCE, timeLine, } from './serve/clock.js';
33
+ export { filledNote, ANSWERED_SOURCE_CLAUSE } from './serve/fills.js';
34
+ export { unreadableRulesRefusal, unmountedRulesRefusal, unansweredRefusal, secondPauseRefusal, timeRefusal, keptAnswersNote, } from './serve/refusals.js';
35
+ export { ASSUMED_BLOCK_HEADING, assumedBlock, assumedBlockOf, assumedLinesFor, } from './serve/assumed.js';
1002
36
  //# sourceMappingURL=serve.js.map