@namzu/sdk 45.0.0 → 46.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/dist/authorization/gate.d.ts +5 -2
  3. package/dist/authorization/gate.d.ts.map +1 -1
  4. package/dist/authorization/gate.js +35 -4
  5. package/dist/authorization/gate.js.map +1 -1
  6. package/dist/authorization/rules.d.ts.map +1 -1
  7. package/dist/authorization/rules.js +56 -6
  8. package/dist/authorization/rules.js.map +1 -1
  9. package/dist/authorization/shell-lexer.d.ts +38 -0
  10. package/dist/authorization/shell-lexer.d.ts.map +1 -1
  11. package/dist/authorization/shell-lexer.js +88 -57
  12. package/dist/authorization/shell-lexer.js.map +1 -1
  13. package/dist/bridge/a2a/mapper.d.ts.map +1 -1
  14. package/dist/bridge/a2a/mapper.js +2 -0
  15. package/dist/bridge/a2a/mapper.js.map +1 -1
  16. package/dist/bridge/sse/mapper.d.ts.map +1 -1
  17. package/dist/bridge/sse/mapper.js +1 -0
  18. package/dist/bridge/sse/mapper.js.map +1 -1
  19. package/dist/directory/types.d.ts +2 -0
  20. package/dist/directory/types.d.ts.map +1 -1
  21. package/dist/directory/types.js.map +1 -1
  22. package/dist/manager/resident/outbox.d.ts +4 -4
  23. package/dist/pricing/catalogue.generated.d.ts.map +1 -1
  24. package/dist/pricing/catalogue.generated.js +28 -4
  25. package/dist/pricing/catalogue.generated.js.map +1 -1
  26. package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
  27. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  28. package/dist/prompt/coding-agent-doctrine.js +1 -0
  29. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  30. package/dist/public-runtime.d.ts +6 -3
  31. package/dist/public-runtime.d.ts.map +1 -1
  32. package/dist/public-runtime.js +14 -2
  33. package/dist/public-runtime.js.map +1 -1
  34. package/dist/public-tools.d.ts +7 -2
  35. package/dist/public-tools.d.ts.map +1 -1
  36. package/dist/public-tools.js +15 -2
  37. package/dist/public-tools.js.map +1 -1
  38. package/dist/public-types.d.ts +8 -2
  39. package/dist/public-types.d.ts.map +1 -1
  40. package/dist/registry/tool/callable.d.ts +22 -0
  41. package/dist/registry/tool/callable.d.ts.map +1 -0
  42. package/dist/registry/tool/callable.js +29 -0
  43. package/dist/registry/tool/callable.js.map +1 -0
  44. package/dist/registry/tool/execute.d.ts.map +1 -1
  45. package/dist/registry/tool/execute.js +8 -1
  46. package/dist/registry/tool/execute.js.map +1 -1
  47. package/dist/runtime/query/declined.d.ts +12 -0
  48. package/dist/runtime/query/declined.d.ts.map +1 -0
  49. package/dist/runtime/query/declined.js +12 -0
  50. package/dist/runtime/query/declined.js.map +1 -0
  51. package/dist/runtime/query/executor/tool-call-admission.d.ts +37 -11
  52. package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
  53. package/dist/runtime/query/executor/tool-call-admission.js +38 -12
  54. package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
  55. package/dist/runtime/query/executor.d.ts +7 -3
  56. package/dist/runtime/query/executor.d.ts.map +1 -1
  57. package/dist/runtime/query/executor.js +32 -7
  58. package/dist/runtime/query/executor.js.map +1 -1
  59. package/dist/runtime/query/index.d.ts.map +1 -1
  60. package/dist/runtime/query/index.js +1 -0
  61. package/dist/runtime/query/index.js.map +1 -1
  62. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  63. package/dist/runtime/query/iteration/index.js +7 -0
  64. package/dist/runtime/query/iteration/index.js.map +1 -1
  65. package/dist/runtime/query/iteration/phases/context.d.ts +6 -0
  66. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  67. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  68. package/dist/runtime/query/iteration/phases/handoff.d.ts +22 -0
  69. package/dist/runtime/query/iteration/phases/handoff.d.ts.map +1 -0
  70. package/dist/runtime/query/iteration/phases/handoff.js +65 -0
  71. package/dist/runtime/query/iteration/phases/handoff.js.map +1 -0
  72. package/dist/runtime/query/iteration/phases/index.d.ts +1 -0
  73. package/dist/runtime/query/iteration/phases/index.d.ts.map +1 -1
  74. package/dist/runtime/query/iteration/phases/index.js +1 -0
  75. package/dist/runtime/query/iteration/phases/index.js.map +1 -1
  76. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  77. package/dist/runtime/query/iteration/phases/tool-review.js +8 -3
  78. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  79. package/dist/runtime/query/resume-pending.d.ts.map +1 -1
  80. package/dist/runtime/query/resume-pending.js +3 -2
  81. package/dist/runtime/query/resume-pending.js.map +1 -1
  82. package/dist/runtime/query/review-policy.d.ts +43 -0
  83. package/dist/runtime/query/review-policy.d.ts.map +1 -1
  84. package/dist/runtime/query/review-policy.js +63 -19
  85. package/dist/runtime/query/review-policy.js.map +1 -1
  86. package/dist/schedules/cron.d.ts +21 -0
  87. package/dist/schedules/cron.d.ts.map +1 -0
  88. package/dist/schedules/cron.js +167 -0
  89. package/dist/schedules/cron.js.map +1 -0
  90. package/dist/schedules/describe.d.ts +14 -0
  91. package/dist/schedules/describe.d.ts.map +1 -0
  92. package/dist/schedules/describe.js +133 -0
  93. package/dist/schedules/describe.js.map +1 -0
  94. package/dist/schedules/errors.d.ts +11 -0
  95. package/dist/schedules/errors.d.ts.map +1 -0
  96. package/dist/schedules/errors.js +15 -0
  97. package/dist/schedules/errors.js.map +1 -0
  98. package/dist/schedules/evaluate.d.ts +35 -0
  99. package/dist/schedules/evaluate.d.ts.map +1 -0
  100. package/dist/schedules/evaluate.js +158 -0
  101. package/dist/schedules/evaluate.js.map +1 -0
  102. package/dist/schedules/index.d.ts +11 -0
  103. package/dist/schedules/index.d.ts.map +1 -0
  104. package/dist/schedules/index.js +8 -0
  105. package/dist/schedules/index.js.map +1 -0
  106. package/dist/schedules/next-fire.d.ts +50 -0
  107. package/dist/schedules/next-fire.d.ts.map +1 -0
  108. package/dist/schedules/next-fire.js +250 -0
  109. package/dist/schedules/next-fire.js.map +1 -0
  110. package/dist/schedules/spec.d.ts +30 -0
  111. package/dist/schedules/spec.d.ts.map +1 -0
  112. package/dist/schedules/spec.js +169 -0
  113. package/dist/schedules/spec.js.map +1 -0
  114. package/dist/schedules/types.d.ts +144 -0
  115. package/dist/schedules/types.d.ts.map +1 -0
  116. package/dist/schedules/types.js +11 -0
  117. package/dist/schedules/types.js.map +1 -0
  118. package/dist/schedules/tz.d.ts +44 -0
  119. package/dist/schedules/tz.d.ts.map +1 -0
  120. package/dist/schedules/tz.js +141 -0
  121. package/dist/schedules/tz.js.map +1 -0
  122. package/dist/skills/index.d.ts +1 -1
  123. package/dist/skills/index.d.ts.map +1 -1
  124. package/dist/skills/index.js +1 -1
  125. package/dist/skills/index.js.map +1 -1
  126. package/dist/skills/loader.d.ts +16 -3
  127. package/dist/skills/loader.d.ts.map +1 -1
  128. package/dist/skills/loader.js +48 -4
  129. package/dist/skills/loader.js.map +1 -1
  130. package/dist/skills/registry.d.ts +6 -0
  131. package/dist/skills/registry.d.ts.map +1 -1
  132. package/dist/skills/registry.js +1 -0
  133. package/dist/skills/registry.js.map +1 -1
  134. package/dist/tools/builtins/browser-url.d.ts +83 -0
  135. package/dist/tools/builtins/browser-url.d.ts.map +1 -0
  136. package/dist/tools/builtins/browser-url.js +240 -0
  137. package/dist/tools/builtins/browser-url.js.map +1 -0
  138. package/dist/tools/builtins/browser.d.ts +367 -0
  139. package/dist/tools/builtins/browser.d.ts.map +1 -0
  140. package/dist/tools/builtins/browser.js +704 -0
  141. package/dist/tools/builtins/browser.js.map +1 -0
  142. package/dist/tools/builtins/computer-use-coordinates.d.ts +65 -0
  143. package/dist/tools/builtins/computer-use-coordinates.d.ts.map +1 -0
  144. package/dist/tools/builtins/computer-use-coordinates.js +123 -0
  145. package/dist/tools/builtins/computer-use-coordinates.js.map +1 -0
  146. package/dist/tools/builtins/computer-use-image.d.ts +77 -0
  147. package/dist/tools/builtins/computer-use-image.d.ts.map +1 -0
  148. package/dist/tools/builtins/computer-use-image.js +223 -0
  149. package/dist/tools/builtins/computer-use-image.js.map +1 -0
  150. package/dist/tools/builtins/computer-use.d.ts +519 -14
  151. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  152. package/dist/tools/builtins/computer-use.js +1188 -183
  153. package/dist/tools/builtins/computer-use.js.map +1 -1
  154. package/dist/tools/builtins/index.d.ts +2 -1
  155. package/dist/tools/builtins/index.d.ts.map +1 -1
  156. package/dist/tools/builtins/index.js +1 -1
  157. package/dist/tools/builtins/index.js.map +1 -1
  158. package/dist/tools/builtins/skill.d.ts +74 -0
  159. package/dist/tools/builtins/skill.d.ts.map +1 -1
  160. package/dist/tools/builtins/skill.js +214 -159
  161. package/dist/tools/builtins/skill.js.map +1 -1
  162. package/dist/tools/defineTool.d.ts +4 -0
  163. package/dist/tools/defineTool.d.ts.map +1 -1
  164. package/dist/tools/defineTool.js +8 -0
  165. package/dist/tools/defineTool.js.map +1 -1
  166. package/dist/tools/schedules/index.d.ts +5 -0
  167. package/dist/tools/schedules/index.d.ts.map +1 -0
  168. package/dist/tools/schedules/index.js +4 -0
  169. package/dist/tools/schedules/index.js.map +1 -0
  170. package/dist/tools/schedules/loop-tool.d.ts +14 -0
  171. package/dist/tools/schedules/loop-tool.d.ts.map +1 -0
  172. package/dist/tools/schedules/loop-tool.js +81 -0
  173. package/dist/tools/schedules/loop-tool.js.map +1 -0
  174. package/dist/tools/schedules/present.d.ts +16 -0
  175. package/dist/tools/schedules/present.d.ts.map +1 -0
  176. package/dist/tools/schedules/present.js +71 -0
  177. package/dist/tools/schedules/present.js.map +1 -0
  178. package/dist/tools/schedules/prompt-scan.d.ts +17 -0
  179. package/dist/tools/schedules/prompt-scan.d.ts.map +1 -0
  180. package/dist/tools/schedules/prompt-scan.js +92 -0
  181. package/dist/tools/schedules/prompt-scan.js.map +1 -0
  182. package/dist/tools/schedules/schedule-tool.d.ts +17 -0
  183. package/dist/tools/schedules/schedule-tool.d.ts.map +1 -0
  184. package/dist/tools/schedules/schedule-tool.js +418 -0
  185. package/dist/tools/schedules/schedule-tool.js.map +1 -0
  186. package/dist/tools/schedules/types.d.ts +252 -0
  187. package/dist/tools/schedules/types.d.ts.map +1 -0
  188. package/dist/tools/schedules/types.js +11 -0
  189. package/dist/tools/schedules/types.js.map +1 -0
  190. package/dist/types/authorization/index.d.ts +107 -9
  191. package/dist/types/authorization/index.d.ts.map +1 -1
  192. package/dist/types/authorization/index.js +16 -1
  193. package/dist/types/authorization/index.js.map +1 -1
  194. package/dist/types/browser/index.d.ts +280 -0
  195. package/dist/types/browser/index.d.ts.map +1 -0
  196. package/dist/types/browser/index.js +12 -0
  197. package/dist/types/browser/index.js.map +1 -0
  198. package/dist/types/computer-use/index.d.ts +176 -0
  199. package/dist/types/computer-use/index.d.ts.map +1 -1
  200. package/dist/types/computer-use/index.js.map +1 -1
  201. package/dist/types/session/events.d.ts +6 -0
  202. package/dist/types/session/events.d.ts.map +1 -1
  203. package/dist/types/session/events.js.map +1 -1
  204. package/dist/types/session/records.d.ts +23 -0
  205. package/dist/types/session/records.d.ts.map +1 -1
  206. package/dist/types/session/records.js +9 -0
  207. package/dist/types/session/records.js.map +1 -1
  208. package/dist/types/tool/index.d.ts +60 -0
  209. package/dist/types/tool/index.d.ts.map +1 -1
  210. package/dist/types/tool/index.js.map +1 -1
  211. package/dist/types/tool/presentation.d.ts +7 -0
  212. package/dist/types/tool/presentation.d.ts.map +1 -1
  213. package/dist/utils/frontmatter.d.ts +18 -2
  214. package/dist/utils/frontmatter.d.ts.map +1 -1
  215. package/dist/utils/frontmatter.js +13 -3
  216. package/dist/utils/frontmatter.js.map +1 -1
  217. package/dist/utils/id.d.ts +8 -0
  218. package/dist/utils/id.d.ts.map +1 -1
  219. package/dist/utils/id.js +12 -0
  220. package/dist/utils/id.js.map +1 -1
  221. package/package.json +3 -1
  222. package/src/authorization/gate.ts +37 -4
  223. package/src/authorization/rules.ts +55 -7
  224. package/src/authorization/shell-lexer.ts +109 -51
  225. package/src/bridge/a2a/mapper.ts +2 -0
  226. package/src/bridge/sse/mapper.ts +1 -0
  227. package/src/directory/types.ts +2 -0
  228. package/src/pricing/catalogue.generated.ts +28 -4
  229. package/src/pricing/rates.source.json +27 -6
  230. package/src/prompt/coding-agent-doctrine.ts +1 -0
  231. package/src/public-runtime.ts +43 -1
  232. package/src/public-tools.ts +54 -1
  233. package/src/public-types.ts +55 -0
  234. package/src/registry/tool/callable.ts +37 -0
  235. package/src/registry/tool/execute.ts +8 -1
  236. package/src/runtime/query/declined.ts +12 -0
  237. package/src/runtime/query/executor/tool-call-admission.ts +60 -16
  238. package/src/runtime/query/executor.ts +36 -5
  239. package/src/runtime/query/index.ts +1 -0
  240. package/src/runtime/query/iteration/index.ts +8 -0
  241. package/src/runtime/query/iteration/phases/context.ts +6 -0
  242. package/src/runtime/query/iteration/phases/handoff.ts +74 -0
  243. package/src/runtime/query/iteration/phases/index.ts +1 -0
  244. package/src/runtime/query/iteration/phases/tool-review.ts +11 -4
  245. package/src/runtime/query/resume-pending.ts +3 -2
  246. package/src/runtime/query/review-policy.ts +107 -18
  247. package/src/schedules/cron.ts +202 -0
  248. package/src/schedules/describe.ts +138 -0
  249. package/src/schedules/errors.ts +15 -0
  250. package/src/schedules/evaluate.ts +178 -0
  251. package/src/schedules/index.ts +18 -0
  252. package/src/schedules/next-fire.ts +257 -0
  253. package/src/schedules/spec.ts +210 -0
  254. package/src/schedules/types.ts +163 -0
  255. package/src/schedules/tz.ts +155 -0
  256. package/src/skills/index.ts +1 -1
  257. package/src/skills/loader.ts +55 -4
  258. package/src/skills/registry.ts +8 -0
  259. package/src/tools/builtins/browser-url.ts +251 -0
  260. package/src/tools/builtins/browser.ts +817 -0
  261. package/src/tools/builtins/computer-use-coordinates.ts +144 -0
  262. package/src/tools/builtins/computer-use-image.ts +278 -0
  263. package/src/tools/builtins/computer-use.ts +1485 -191
  264. package/src/tools/builtins/index.ts +7 -1
  265. package/src/tools/builtins/skill.ts +304 -156
  266. package/src/tools/defineTool.ts +13 -0
  267. package/src/tools/schedules/index.ts +4 -0
  268. package/src/tools/schedules/loop-tool.ts +85 -0
  269. package/src/tools/schedules/present.ts +88 -0
  270. package/src/tools/schedules/prompt-scan.ts +96 -0
  271. package/src/tools/schedules/schedule-tool.ts +482 -0
  272. package/src/tools/schedules/types.ts +265 -0
  273. package/src/types/authorization/index.ts +81 -2
  274. package/src/types/browser/index.ts +341 -0
  275. package/src/types/computer-use/index.ts +202 -0
  276. package/src/types/session/events.ts +6 -0
  277. package/src/types/session/records.ts +10 -0
  278. package/src/types/tool/index.ts +61 -0
  279. package/src/types/tool/presentation.ts +7 -0
  280. package/src/utils/frontmatter.ts +29 -3
  281. package/src/utils/id.ts +14 -0
@@ -42,6 +42,12 @@ export interface SkillRegistryRef {
42
42
  registeredName: string
43
43
  description: string
44
44
  location: string
45
+ /**
46
+ * The skill's directory as the host reads it. Optional so a registry
47
+ * written before it existed still satisfies this interface; what the
48
+ * `skill` tool hands a host's `resolveModelDirectory` to map.
49
+ */
50
+ directory?: string
45
51
  allowedTools?: string
46
52
  invocation?: 'model' | 'operator' | 'both'
47
53
  }[]
@@ -50,6 +56,7 @@ export interface SkillRegistryRef {
50
56
  registeredName: string
51
57
  description: string
52
58
  location: string
59
+ directory?: string
53
60
  allowedTools?: string
54
61
  invocation?: 'model' | 'operator' | 'both'
55
62
  }[]
@@ -715,6 +722,31 @@ export interface ToolResult {
715
722
  * must not lose: what its controls do, where things are, what failed.
716
723
  */
717
724
  workingState?: readonly import('../../compaction/types.js').WorkingStatePin[]
725
+ /**
726
+ * This result needs a person before the turn can go on — a sign-in page,
727
+ * a CAPTCHA, a second factor, anything the model must not try to answer
728
+ * itself.
729
+ *
730
+ * The result is committed like any other: it reaches the transcript and
731
+ * the session log with the rest of its batch. Then, instead of calling
732
+ * the model again, the kernel writes a checkpoint and ends the segment
733
+ * with `turn_paused` carrying this value. Resuming the turn continues
734
+ * from that checkpoint, and the next step is a model call that sees the
735
+ * results. Inside a delegated child there is no person to hand to, so
736
+ * the child's turn fails with {@link ToolHandoff.reason} instead.
737
+ */
738
+ handoff?: ToolHandoff
739
+ }
740
+
741
+ /**
742
+ * A tool's request to stop the turn for a person. See {@link ToolResult.handoff}.
743
+ */
744
+ export interface ToolHandoff {
745
+ readonly kind: 'human-required'
746
+ /** Operator-facing text: what the person has to do before the turn resumes. */
747
+ readonly reason: string
748
+ /** Structured facts a host can render or act on, such as an origin or a command. */
749
+ readonly detail?: Readonly<Record<string, string>>
718
750
  }
719
751
 
720
752
  /**
@@ -810,6 +842,23 @@ export interface ToolDefinition<TInput = unknown> extends ToolPresentation<TInpu
810
842
  * the safe direction to be wrong in.
811
843
  */
812
844
  pathArgument?: string
845
+ /**
846
+ * The argument that holds an absolute URL the tool has already
847
+ * canonicalised in its input schema — one spelling, no whitespace.
848
+ *
849
+ * Declared so an `argument_pattern` rule tests the URL whole. Without it
850
+ * the rule reads every argument as a possible command line, and a URL's
851
+ * query separators (`&`, `;`, `|`) cut it into "segments": an `allow` for
852
+ * `^https://github\.com(?:[/?#]|$)` then declined
853
+ * `https://github.com/search?q=a&type=code`, because `type=code` is not
854
+ * GitHub. A `deny` or `review` is unaffected either way; only an `allow`
855
+ * needed every segment to match.
856
+ *
857
+ * Declare it only for an argument the input schema itself canonicalises
858
+ * to a URL. A free-text argument that happens to hold one keeps the
859
+ * command-line reading, which is the safe direction to be wrong in.
860
+ */
861
+ urlArgument?: string
813
862
  /**
814
863
  * The boolean argument by which a call asks to run outside the turn's
815
864
  * sandbox, when the tool offers that at all (the shipped `bash` does).
@@ -885,6 +934,18 @@ export interface ToolDefinition<TInput = unknown> extends ToolPresentation<TInpu
885
934
  isReadOnly?(input: TInput): boolean
886
935
  isDestructive?(input: TInput): boolean
887
936
  isConcurrencySafe?(input: TInput): boolean
937
+ /**
938
+ * This call sends what is on the operator's screen to the model provider:
939
+ * a screenshot, the titles of the open windows, a window's accessibility
940
+ * tree.
941
+ *
942
+ * Orthogonal to {@link isReadOnly}: a screenshot changes nothing and is
943
+ * still the one read a person may want to allow before it happens. A
944
+ * review policy given a consent record (`createReviewHandler`'s
945
+ * `screenConsent`) asks once per session before the first such call.
946
+ * Absent means the tool never does.
947
+ */
948
+ capturesScreen?(input: TInput): boolean
888
949
 
889
950
  /**
890
951
  * Opt-in ordering boundary in a direct model tool-call batch. Earlier
@@ -26,6 +26,13 @@ export type ToolCallView =
26
26
  readonly activity?: 'exploration'
27
27
  /** A successful result may add no information beyond the completed call row. */
28
28
  readonly visibility?: 'hidden'
29
+ /**
30
+ * For a result: the person declined on the tool's own screen (a
31
+ * confirmation they cancelled). The call did not succeed, but
32
+ * nothing failed either, so a host draws it as neither: `label` says
33
+ * what did not happen ("Cancelled — nothing was saved").
34
+ */
35
+ readonly outcome?: 'cancelled'
29
36
  }
30
37
  /**
31
38
  * A change to a document. `path` is optional because not every diff is
@@ -132,6 +132,19 @@ export interface FrontmatterOptions {
132
132
  * way.
133
133
  */
134
134
  readonly lists?: readonly string[]
135
+ /**
136
+ * The keys the caller reads. When given, a top-level key it answers
137
+ * `false` for is skipped whole — its value and every indented line under
138
+ * it — and does not appear in the result.
139
+ *
140
+ * The refusals in {@link UNSUPPORTED_YAML} exist so a value the caller
141
+ * USES is never read wrongly. A key nobody reads cannot be read wrongly,
142
+ * and refusing the whole file over it made a skill written for another
143
+ * tool (`argument-hint: [file]`, a `hooks:` block with a list in it)
144
+ * unusable here for the sake of a field this kernel ignores. Absent, every
145
+ * key is parsed and refused exactly as before.
146
+ */
147
+ readonly readsKey?: (key: string) => boolean
135
148
  }
136
149
 
137
150
  export interface ParsedFrontmatter {
@@ -153,15 +166,19 @@ export interface ParsedFrontmatter {
153
166
  readonly body: string
154
167
  }
155
168
 
169
+ /** Optional behaviour for {@link parseFrontmatter}: the same as {@link FrontmatterOptions}. */
170
+ export type ParseFrontmatterOptions = FrontmatterOptions
171
+
156
172
  /**
157
173
  * Parse a markdown file's `---` frontmatter.
158
174
  *
159
175
  * @param raw The file's full contents. LF and CRLF both parse.
160
176
  * @param source A label for error messages — a path, or a phrase naming the
161
177
  * file. Used verbatim, so the caller controls how its own errors read.
178
+ * @param options See {@link FrontmatterOptions}.
162
179
  * @throws If the frontmatter is absent, unclosed, or uses YAML this reader
163
- * does not implement. It never returns a partial or empty result to stand in
164
- * for a file it could not read.
180
+ * does not implement in a key the caller reads. It never returns a partial
181
+ * or empty result to stand in for a file it could not read.
165
182
  */
166
183
  export function parseFrontmatter(
167
184
  raw: string,
@@ -198,12 +215,15 @@ export function parseFrontmatter(
198
215
  const blocks = new Map<string, Map<string, string>>()
199
216
  const lists = new Map<string, string[]>()
200
217
  let currentKey: string | undefined
218
+ // The current top-level key is one the caller does not read: its value
219
+ // and its indented lines are skipped rather than parsed or refused.
220
+ let skipping = false
201
221
 
202
222
  for (const line of frontmatterRaw.split(LINE_SPLIT)) {
203
223
  if (!line.trim() || line.trimStart().startsWith('#')) continue
204
224
 
205
225
  if (/^\s/.test(line)) {
206
- if (!currentKey) continue
226
+ if (!currentKey || skipping) continue
207
227
 
208
228
  // A block sequence item. Read as a list when the caller named this
209
229
  // key in `options.lists`; refused, not skipped, everywhere else.
@@ -254,6 +274,12 @@ export function parseFrontmatter(
254
274
  const colonIdx = line.indexOf(':')
255
275
  if (colonIdx === -1) continue
256
276
  const key = line.slice(0, colonIdx).trim()
277
+ if (options.readsKey && !options.readsKey(key)) {
278
+ currentKey = key
279
+ skipping = true
280
+ continue
281
+ }
282
+ skipping = false
257
283
  const value = normalizeScalar(line.slice(colonIdx + 1))
258
284
 
259
285
  if (listKeys.has(key) && /^\[.*\]$/.test(value)) {
package/src/utils/id.ts CHANGED
@@ -197,6 +197,20 @@ export function generateDeliverableId(): DeliverableId {
197
197
  return generateId()
198
198
  }
199
199
 
200
+ /**
201
+ * The id of a scheduled job, for a host that stores schedules (the CLI's
202
+ * `NAMZU_HOME/schedule/`). A plain UUIDv7 string: jobs are the host's records,
203
+ * not a kernel entity, so there is no branded kind for them.
204
+ */
205
+ export function generateScheduleJobId(): string {
206
+ return uuidv7()
207
+ }
208
+
209
+ /** The id of one run of a scheduled job. See {@link generateScheduleJobId}. */
210
+ export function generateScheduleRunId(): string {
211
+ return uuidv7()
212
+ }
213
+
200
214
  /** Entity kinds are supplied by a typed field or storage collection. */
201
215
  export interface EntityIdByKind {
202
216
  turn: TurnId