@emiliosp/pi-maestro 0.16.0 → 0.18.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 (1884) hide show
  1. package/ADR.md +6 -4
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +14 -10
  4. package/ROADMAP.md +207 -147
  5. package/TECH_STACK.md +1 -2
  6. package/agents/builder.md +8 -19
  7. package/agents/simplifier.md +0 -11
  8. package/agents/verifier.md +12 -23
  9. package/docs/configuration.md +9 -10
  10. package/docs/glossary.md +5 -3
  11. package/docs/subagent-integration.md +28 -27
  12. package/docs/workflow.md +48 -36
  13. package/extensions/maestro.ts +1 -1
  14. package/package.json +8 -16
  15. package/src/config/schema.ts +0 -6
  16. package/src/delegation/SubSessionManager.ts +102 -0
  17. package/src/delegation/TaskExecutionError.ts +20 -0
  18. package/src/delegation/createChildServices.ts +110 -0
  19. package/src/delegation/executeTask.ts +56 -0
  20. package/src/delegation/readTaskResult.ts +27 -0
  21. package/src/maestro/checks/assertEnvironment.ts +6 -113
  22. package/src/maestro/instructions/getMaestroInstructions.ts +15 -12
  23. package/src/tools/child/record-builder-handoff.ts +28 -30
  24. package/src/tools/child/record-simplifier-handoff.ts +33 -35
  25. package/src/tools/child/record-verifier-handoff.ts +37 -39
  26. package/src/tools/main/run-builder.ts +9 -28
  27. package/src/tools/main/run-simplifier.ts +8 -26
  28. package/src/tools/main/run-verifier.ts +9 -27
  29. package/src/tools/utils/executeRoleTask.ts +57 -0
  30. package/templates/spec.md +23 -11
  31. package/extensions/maestro-subagent.ts +0 -16
  32. package/node_modules/@js-temporal/polyfill/CHANGELOG.md +0 -453
  33. package/node_modules/@js-temporal/polyfill/LICENSE +0 -13
  34. package/node_modules/@js-temporal/polyfill/README.md +0 -90
  35. package/node_modules/@js-temporal/polyfill/dist/index.cjs +0 -2
  36. package/node_modules/@js-temporal/polyfill/dist/index.cjs.map +0 -1
  37. package/node_modules/@js-temporal/polyfill/dist/index.esm.js +0 -2
  38. package/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +0 -1
  39. package/node_modules/@js-temporal/polyfill/dist/index.umd.js +0 -2
  40. package/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +0 -1
  41. package/node_modules/@js-temporal/polyfill/index.d.cts +0 -1215
  42. package/node_modules/@js-temporal/polyfill/index.d.ts +0 -1215
  43. package/node_modules/@js-temporal/polyfill/lib/assert.ts +0 -8
  44. package/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +0 -39
  45. package/node_modules/@js-temporal/polyfill/lib/calendar.ts +0 -2424
  46. package/node_modules/@js-temporal/polyfill/lib/debug.ts +0 -7
  47. package/node_modules/@js-temporal/polyfill/lib/duration.ts +0 -438
  48. package/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +0 -93
  49. package/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +0 -4973
  50. package/node_modules/@js-temporal/polyfill/lib/index.ts +0 -34
  51. package/node_modules/@js-temporal/polyfill/lib/init.ts +0 -43
  52. package/node_modules/@js-temporal/polyfill/lib/instant.ts +0 -138
  53. package/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +0 -242
  54. package/node_modules/@js-temporal/polyfill/lib/intl.ts +0 -758
  55. package/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +0 -162
  56. package/node_modules/@js-temporal/polyfill/lib/legacydate.ts +0 -17
  57. package/node_modules/@js-temporal/polyfill/lib/math.ts +0 -96
  58. package/node_modules/@js-temporal/polyfill/lib/now.ts +0 -48
  59. package/node_modules/@js-temporal/polyfill/lib/plaindate.ts +0 -212
  60. package/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +0 -274
  61. package/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +0 -110
  62. package/node_modules/@js-temporal/polyfill/lib/plaintime.ts +0 -154
  63. package/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +0 -157
  64. package/node_modules/@js-temporal/polyfill/lib/regex.ts +0 -59
  65. package/node_modules/@js-temporal/polyfill/lib/slots.ts +0 -341
  66. package/node_modules/@js-temporal/polyfill/lib/temporal.ts +0 -10
  67. package/node_modules/@js-temporal/polyfill/lib/timeduration.ts +0 -149
  68. package/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +0 -492
  69. package/node_modules/@js-temporal/polyfill/package.json +0 -143
  70. package/node_modules/acorn/CHANGELOG.md +0 -998
  71. package/node_modules/acorn/LICENSE +0 -21
  72. package/node_modules/acorn/README.md +0 -309
  73. package/node_modules/acorn/bin/acorn +0 -4
  74. package/node_modules/acorn/dist/acorn.d.mts +0 -897
  75. package/node_modules/acorn/dist/acorn.d.ts +0 -897
  76. package/node_modules/acorn/dist/acorn.js +0 -6342
  77. package/node_modules/acorn/dist/acorn.mjs +0 -6313
  78. package/node_modules/acorn/dist/bin.js +0 -90
  79. package/node_modules/acorn/package.json +0 -50
  80. package/node_modules/jiti/LICENSE +0 -21
  81. package/node_modules/jiti/README.md +0 -258
  82. package/node_modules/jiti/dist/babel.cjs +0 -257
  83. package/node_modules/jiti/dist/jiti.cjs +0 -1
  84. package/node_modules/jiti/lib/jiti-cli.mjs +0 -34
  85. package/node_modules/jiti/lib/jiti-hooks.mjs +0 -124
  86. package/node_modules/jiti/lib/jiti-native.mjs +0 -121
  87. package/node_modules/jiti/lib/jiti-register.d.mts +0 -1
  88. package/node_modules/jiti/lib/jiti-register.mjs +0 -4
  89. package/node_modules/jiti/lib/jiti-static.mjs +0 -23
  90. package/node_modules/jiti/lib/jiti.cjs +0 -30
  91. package/node_modules/jiti/lib/jiti.d.cts +0 -8
  92. package/node_modules/jiti/lib/jiti.d.mts +0 -8
  93. package/node_modules/jiti/lib/jiti.mjs +0 -29
  94. package/node_modules/jiti/lib/types.d.ts +0 -420
  95. package/node_modules/jiti/package.json +0 -146
  96. package/node_modules/jsbi/LICENSE +0 -176
  97. package/node_modules/jsbi/README.md +0 -173
  98. package/node_modules/jsbi/dist/jsbi-cjs.js +0 -2
  99. package/node_modules/jsbi/dist/jsbi-cjs.js.map +0 -1
  100. package/node_modules/jsbi/dist/jsbi-umd.js +0 -2
  101. package/node_modules/jsbi/dist/jsbi-umd.js.map +0 -1
  102. package/node_modules/jsbi/dist/jsbi.mjs +0 -2
  103. package/node_modules/jsbi/dist/jsbi.mjs.map +0 -1
  104. package/node_modules/jsbi/jsbi.d.ts +0 -43
  105. package/node_modules/jsbi/package.json +0 -35
  106. package/node_modules/pi-subagents/CHANGELOG.md +0 -3081
  107. package/node_modules/pi-subagents/LICENSE +0 -21
  108. package/node_modules/pi-subagents/README.md +0 -129
  109. package/node_modules/pi-subagents/agents/claude-code-writer.md +0 -16
  110. package/node_modules/pi-subagents/agents/claude-code.md +0 -15
  111. package/node_modules/pi-subagents/agents/codex-exec-writer.md +0 -16
  112. package/node_modules/pi-subagents/agents/codex-exec.md +0 -15
  113. package/node_modules/pi-subagents/agents/cursor-agent-writer.md +0 -15
  114. package/node_modules/pi-subagents/agents/cursor-agent.md +0 -14
  115. package/node_modules/pi-subagents/agents/delegate.md +0 -14
  116. package/node_modules/pi-subagents/agents/evidence-auditor.md +0 -35
  117. package/node_modules/pi-subagents/agents/oracle.md +0 -68
  118. package/node_modules/pi-subagents/agents/researcher.md +0 -59
  119. package/node_modules/pi-subagents/agents/reviewer.md +0 -48
  120. package/node_modules/pi-subagents/agents/scout.md +0 -47
  121. package/node_modules/pi-subagents/agents/worker.md +0 -43
  122. package/node_modules/pi-subagents/async-retention-discovery-worker.mjs +0 -180
  123. package/node_modules/pi-subagents/docs/agents.md +0 -627
  124. package/node_modules/pi-subagents/docs/configuration.md +0 -756
  125. package/node_modules/pi-subagents/docs/extension-api.md +0 -661
  126. package/node_modules/pi-subagents/docs/missions.md +0 -162
  127. package/node_modules/pi-subagents/docs/models.md +0 -253
  128. package/node_modules/pi-subagents/docs/observability.md +0 -335
  129. package/node_modules/pi-subagents/docs/standalone-background.md +0 -59
  130. package/node_modules/pi-subagents/docs/tool-reference.md +0 -558
  131. package/node_modules/pi-subagents/docs/watchdog.md +0 -187
  132. package/node_modules/pi-subagents/docs/workflows.md +0 -577
  133. package/node_modules/pi-subagents/index.d.ts +0 -3
  134. package/node_modules/pi-subagents/index.d.ts.map +0 -1
  135. package/node_modules/pi-subagents/index.js +0 -15
  136. package/node_modules/pi-subagents/index.js.map +0 -1
  137. package/node_modules/pi-subagents/inspector-runner.mjs +0 -11
  138. package/node_modules/pi-subagents/install.mjs +0 -93
  139. package/node_modules/pi-subagents/node_modules/yaml/LICENSE +0 -13
  140. package/node_modules/pi-subagents/node_modules/yaml/README.md +0 -172
  141. package/node_modules/pi-subagents/node_modules/yaml/bin.mjs +0 -11
  142. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -88
  143. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -43
  144. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-node.js +0 -109
  145. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -86
  146. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/composer.js +0 -217
  147. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -115
  148. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -198
  149. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -49
  150. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -37
  151. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -207
  152. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -223
  153. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -146
  154. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -34
  155. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -26
  156. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -15
  157. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -13
  158. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/Document.js +0 -335
  159. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/anchors.js +0 -71
  160. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -55
  161. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/createNode.js +0 -88
  162. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/directives.js +0 -176
  163. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/errors.js +0 -57
  164. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/index.js +0 -17
  165. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/log.js +0 -11
  166. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Alias.js +0 -114
  167. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Collection.js +0 -147
  168. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Node.js +0 -38
  169. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Pair.js +0 -36
  170. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -24
  171. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -144
  172. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -113
  173. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -63
  174. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/identity.js +0 -36
  175. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/toJS.js +0 -37
  176. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-scalar.js +0 -214
  177. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-stringify.js +0 -61
  178. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-visit.js +0 -97
  179. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst.js +0 -98
  180. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/lexer.js +0 -717
  181. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/line-counter.js +0 -39
  182. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/parser.js +0 -967
  183. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/public-api.js +0 -102
  184. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/Schema.js +0 -37
  185. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/map.js +0 -17
  186. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/null.js +0 -15
  187. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/seq.js +0 -17
  188. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/string.js +0 -14
  189. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/bool.js +0 -19
  190. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/float.js +0 -43
  191. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/int.js +0 -38
  192. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/schema.js +0 -23
  193. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/json/schema.js +0 -62
  194. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/tags.js +0 -96
  195. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -58
  196. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -26
  197. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -46
  198. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -71
  199. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -64
  200. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -74
  201. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -78
  202. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -39
  203. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -93
  204. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -101
  205. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -146
  206. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringify.js +0 -129
  207. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -153
  208. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -20
  209. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -85
  210. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -24
  211. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -150
  212. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -336
  213. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/util.js +0 -11
  214. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/visit.js +0 -233
  215. package/node_modules/pi-subagents/node_modules/yaml/browser/index.js +0 -5
  216. package/node_modules/pi-subagents/node_modules/yaml/browser/package.json +0 -3
  217. package/node_modules/pi-subagents/node_modules/yaml/dist/cli.d.ts +0 -8
  218. package/node_modules/pi-subagents/node_modules/yaml/dist/cli.mjs +0 -201
  219. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-collection.d.ts +0 -11
  220. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-collection.js +0 -90
  221. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-doc.d.ts +0 -7
  222. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-doc.js +0 -45
  223. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-node.d.ts +0 -29
  224. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-node.js +0 -112
  225. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-scalar.d.ts +0 -5
  226. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-scalar.js +0 -88
  227. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/composer.d.ts +0 -63
  228. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/composer.js +0 -222
  229. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-map.d.ts +0 -6
  230. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-map.js +0 -117
  231. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +0 -11
  232. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-scalar.js +0 -200
  233. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +0 -6
  234. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-seq.js +0 -51
  235. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-end.d.ts +0 -6
  236. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-end.js +0 -39
  237. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +0 -7
  238. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-collection.js +0 -209
  239. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +0 -10
  240. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-scalar.js +0 -225
  241. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-props.d.ts +0 -23
  242. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-props.js +0 -148
  243. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-contains-newline.d.ts +0 -2
  244. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-contains-newline.js +0 -36
  245. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +0 -2
  246. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-empty-scalar-position.js +0 -28
  247. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +0 -3
  248. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-flow-indent-check.js +0 -17
  249. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-map-includes.d.ts +0 -4
  250. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-map-includes.js +0 -15
  251. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/Document.d.ts +0 -141
  252. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/Document.js +0 -337
  253. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/anchors.d.ts +0 -24
  254. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/anchors.js +0 -76
  255. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/applyReviver.d.ts +0 -9
  256. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/applyReviver.js +0 -57
  257. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/createNode.d.ts +0 -17
  258. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/createNode.js +0 -90
  259. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/directives.d.ts +0 -49
  260. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/directives.js +0 -178
  261. package/node_modules/pi-subagents/node_modules/yaml/dist/errors.d.ts +0 -21
  262. package/node_modules/pi-subagents/node_modules/yaml/dist/errors.js +0 -62
  263. package/node_modules/pi-subagents/node_modules/yaml/dist/index.d.ts +0 -25
  264. package/node_modules/pi-subagents/node_modules/yaml/dist/index.js +0 -50
  265. package/node_modules/pi-subagents/node_modules/yaml/dist/log.d.ts +0 -3
  266. package/node_modules/pi-subagents/node_modules/yaml/dist/log.js +0 -19
  267. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Alias.d.ts +0 -29
  268. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Alias.js +0 -116
  269. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Collection.d.ts +0 -73
  270. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Collection.js +0 -151
  271. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Node.d.ts +0 -53
  272. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Node.js +0 -40
  273. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Pair.d.ts +0 -22
  274. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Pair.js +0 -39
  275. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Scalar.d.ts +0 -43
  276. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Scalar.js +0 -27
  277. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLMap.d.ts +0 -53
  278. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLMap.js +0 -147
  279. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +0 -60
  280. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLSeq.js +0 -115
  281. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +0 -4
  282. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/addPairToJSMap.js +0 -65
  283. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/identity.d.ts +0 -23
  284. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/identity.js +0 -53
  285. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/toJS.d.ts +0 -29
  286. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/toJS.js +0 -39
  287. package/node_modules/pi-subagents/node_modules/yaml/dist/options.d.ts +0 -350
  288. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-scalar.d.ts +0 -64
  289. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-scalar.js +0 -218
  290. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-stringify.d.ts +0 -8
  291. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-stringify.js +0 -63
  292. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-visit.d.ts +0 -39
  293. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-visit.js +0 -99
  294. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst.d.ts +0 -109
  295. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst.js +0 -112
  296. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/lexer.d.ts +0 -87
  297. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/lexer.js +0 -719
  298. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/line-counter.d.ts +0 -22
  299. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/line-counter.js +0 -41
  300. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/parser.d.ts +0 -84
  301. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/parser.js +0 -972
  302. package/node_modules/pi-subagents/node_modules/yaml/dist/public-api.d.ts +0 -44
  303. package/node_modules/pi-subagents/node_modules/yaml/dist/public-api.js +0 -107
  304. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/Schema.d.ts +0 -17
  305. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/Schema.js +0 -39
  306. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/map.d.ts +0 -2
  307. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/map.js +0 -19
  308. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/null.d.ts +0 -4
  309. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/null.js +0 -17
  310. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/seq.d.ts +0 -2
  311. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/seq.js +0 -19
  312. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/string.d.ts +0 -2
  313. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/string.js +0 -16
  314. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/bool.d.ts +0 -4
  315. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/bool.js +0 -21
  316. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/float.d.ts +0 -4
  317. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/float.js +0 -47
  318. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/int.d.ts +0 -4
  319. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/int.js +0 -42
  320. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/schema.d.ts +0 -1
  321. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/schema.js +0 -25
  322. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json/schema.d.ts +0 -2
  323. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json/schema.js +0 -64
  324. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json-schema.d.ts +0 -69
  325. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/tags.d.ts +0 -48
  326. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/tags.js +0 -99
  327. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/types.d.ts +0 -92
  328. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +0 -2
  329. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/binary.js +0 -70
  330. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +0 -7
  331. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/bool.js +0 -29
  332. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +0 -4
  333. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/float.js +0 -50
  334. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +0 -5
  335. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/int.js +0 -76
  336. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
  337. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -68
  338. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +0 -22
  339. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/omap.js +0 -77
  340. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +0 -10
  341. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +0 -82
  342. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +0 -1
  343. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -41
  344. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +0 -28
  345. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/set.js +0 -96
  346. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +0 -6
  347. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +0 -105
  348. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +0 -34
  349. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/foldFlowLines.js +0 -151
  350. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringify.d.ts +0 -21
  351. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringify.js +0 -132
  352. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +0 -17
  353. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyCollection.js +0 -155
  354. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyComment.d.ts +0 -10
  355. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyComment.js +0 -24
  356. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +0 -4
  357. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyDocument.js +0 -87
  358. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +0 -2
  359. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyNumber.js +0 -26
  360. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyPair.d.ts +0 -3
  361. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyPair.js +0 -152
  362. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyString.d.ts +0 -9
  363. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyString.js +0 -338
  364. package/node_modules/pi-subagents/node_modules/yaml/dist/test-events.d.ts +0 -4
  365. package/node_modules/pi-subagents/node_modules/yaml/dist/test-events.js +0 -134
  366. package/node_modules/pi-subagents/node_modules/yaml/dist/util.d.ts +0 -16
  367. package/node_modules/pi-subagents/node_modules/yaml/dist/util.js +0 -28
  368. package/node_modules/pi-subagents/node_modules/yaml/dist/visit.d.ts +0 -102
  369. package/node_modules/pi-subagents/node_modules/yaml/dist/visit.js +0 -236
  370. package/node_modules/pi-subagents/node_modules/yaml/package.json +0 -97
  371. package/node_modules/pi-subagents/node_modules/yaml/util.js +0 -2
  372. package/node_modules/pi-subagents/package.json +0 -138
  373. package/node_modules/pi-subagents/prompts/council.md +0 -63
  374. package/node_modules/pi-subagents/prompts/gather-context-and-clarify.md +0 -13
  375. package/node_modules/pi-subagents/prompts/parallel-cleanup.md +0 -59
  376. package/node_modules/pi-subagents/prompts/parallel-research.md +0 -50
  377. package/node_modules/pi-subagents/prompts/parallel-review.md +0 -58
  378. package/node_modules/pi-subagents/prompts/review-loop.md +0 -47
  379. package/node_modules/pi-subagents/runner-peer-loader.mjs +0 -21
  380. package/node_modules/pi-subagents/runner-peer-preload.mjs +0 -30
  381. package/node_modules/pi-subagents/skills/council-mode/SKILL.md +0 -59
  382. package/node_modules/pi-subagents/skills/council-mode/references/pass-contracts.md +0 -150
  383. package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +0 -123
  384. package/node_modules/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +0 -74
  385. package/node_modules/pi-subagents/skills/pi-subagents/references/execution-controls.md +0 -561
  386. package/node_modules/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +0 -165
  387. package/node_modules/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +0 -61
  388. package/node_modules/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +0 -297
  389. package/node_modules/pi-subagents/skills/pi-subagents/references/review-and-validation.md +0 -73
  390. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts +0 -14
  391. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts.map +0 -1
  392. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js +0 -69
  393. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js.map +0 -1
  394. package/node_modules/pi-subagents/src/agents/agent-management.d.ts +0 -28
  395. package/node_modules/pi-subagents/src/agents/agent-management.d.ts.map +0 -1
  396. package/node_modules/pi-subagents/src/agents/agent-management.js +0 -1522
  397. package/node_modules/pi-subagents/src/agents/agent-management.js.map +0 -1
  398. package/node_modules/pi-subagents/src/agents/agent-memory.d.ts +0 -49
  399. package/node_modules/pi-subagents/src/agents/agent-memory.d.ts.map +0 -1
  400. package/node_modules/pi-subagents/src/agents/agent-memory.js +0 -349
  401. package/node_modules/pi-subagents/src/agents/agent-memory.js.map +0 -1
  402. package/node_modules/pi-subagents/src/agents/agent-refinements.d.ts +0 -100
  403. package/node_modules/pi-subagents/src/agents/agent-refinements.d.ts.map +0 -1
  404. package/node_modules/pi-subagents/src/agents/agent-refinements.js +0 -569
  405. package/node_modules/pi-subagents/src/agents/agent-refinements.js.map +0 -1
  406. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts +0 -4
  407. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts.map +0 -1
  408. package/node_modules/pi-subagents/src/agents/agent-scope.js +0 -9
  409. package/node_modules/pi-subagents/src/agents/agent-scope.js.map +0 -1
  410. package/node_modules/pi-subagents/src/agents/agent-selection.d.ts +0 -3
  411. package/node_modules/pi-subagents/src/agents/agent-selection.d.ts.map +0 -1
  412. package/node_modules/pi-subagents/src/agents/agent-selection.js +0 -23
  413. package/node_modules/pi-subagents/src/agents/agent-selection.js.map +0 -1
  414. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts +0 -8
  415. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts.map +0 -1
  416. package/node_modules/pi-subagents/src/agents/agent-serializer.js +0 -206
  417. package/node_modules/pi-subagents/src/agents/agent-serializer.js.map +0 -1
  418. package/node_modules/pi-subagents/src/agents/agents.d.ts +0 -344
  419. package/node_modules/pi-subagents/src/agents/agents.d.ts.map +0 -1
  420. package/node_modules/pi-subagents/src/agents/agents.js +0 -2748
  421. package/node_modules/pi-subagents/src/agents/agents.js.map +0 -1
  422. package/node_modules/pi-subagents/src/agents/builtin-names.d.ts +0 -2
  423. package/node_modules/pi-subagents/src/agents/builtin-names.d.ts.map +0 -1
  424. package/node_modules/pi-subagents/src/agents/builtin-names.js +0 -17
  425. package/node_modules/pi-subagents/src/agents/builtin-names.js.map +0 -1
  426. package/node_modules/pi-subagents/src/agents/chain-serializer.d.ts +0 -7
  427. package/node_modules/pi-subagents/src/agents/chain-serializer.d.ts.map +0 -1
  428. package/node_modules/pi-subagents/src/agents/chain-serializer.js +0 -319
  429. package/node_modules/pi-subagents/src/agents/chain-serializer.js.map +0 -1
  430. package/node_modules/pi-subagents/src/agents/frontmatter.d.ts +0 -16
  431. package/node_modules/pi-subagents/src/agents/frontmatter.d.ts.map +0 -1
  432. package/node_modules/pi-subagents/src/agents/frontmatter.js +0 -142
  433. package/node_modules/pi-subagents/src/agents/frontmatter.js.map +0 -1
  434. package/node_modules/pi-subagents/src/agents/global-npm-root.d.ts +0 -7
  435. package/node_modules/pi-subagents/src/agents/global-npm-root.d.ts.map +0 -1
  436. package/node_modules/pi-subagents/src/agents/global-npm-root.js +0 -58
  437. package/node_modules/pi-subagents/src/agents/global-npm-root.js.map +0 -1
  438. package/node_modules/pi-subagents/src/agents/identity.d.ts +0 -8
  439. package/node_modules/pi-subagents/src/agents/identity.d.ts.map +0 -1
  440. package/node_modules/pi-subagents/src/agents/identity.js +0 -30
  441. package/node_modules/pi-subagents/src/agents/identity.js.map +0 -1
  442. package/node_modules/pi-subagents/src/agents/proactive-skills.d.ts +0 -36
  443. package/node_modules/pi-subagents/src/agents/proactive-skills.d.ts.map +0 -1
  444. package/node_modules/pi-subagents/src/agents/proactive-skills.js +0 -156
  445. package/node_modules/pi-subagents/src/agents/proactive-skills.js.map +0 -1
  446. package/node_modules/pi-subagents/src/agents/runtime-agent-events.d.ts +0 -27
  447. package/node_modules/pi-subagents/src/agents/runtime-agent-events.d.ts.map +0 -1
  448. package/node_modules/pi-subagents/src/agents/runtime-agent-events.js +0 -53
  449. package/node_modules/pi-subagents/src/agents/runtime-agent-events.js.map +0 -1
  450. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.d.ts +0 -64
  451. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.d.ts.map +0 -1
  452. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.js +0 -395
  453. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.js.map +0 -1
  454. package/node_modules/pi-subagents/src/agents/skills.d.ts +0 -35
  455. package/node_modules/pi-subagents/src/agents/skills.d.ts.map +0 -1
  456. package/node_modules/pi-subagents/src/agents/skills.js +0 -718
  457. package/node_modules/pi-subagents/src/agents/skills.js.map +0 -1
  458. package/node_modules/pi-subagents/src/api/agents.d.ts +0 -5
  459. package/node_modules/pi-subagents/src/api/agents.d.ts.map +0 -1
  460. package/node_modules/pi-subagents/src/api/agents.js +0 -3
  461. package/node_modules/pi-subagents/src/api/agents.js.map +0 -1
  462. package/node_modules/pi-subagents/src/api/background-work.d.ts +0 -39
  463. package/node_modules/pi-subagents/src/api/background-work.d.ts.map +0 -1
  464. package/node_modules/pi-subagents/src/api/background-work.js +0 -165
  465. package/node_modules/pi-subagents/src/api/background-work.js.map +0 -1
  466. package/node_modules/pi-subagents/src/api/capability-ceiling.d.ts +0 -2
  467. package/node_modules/pi-subagents/src/api/capability-ceiling.d.ts.map +0 -1
  468. package/node_modules/pi-subagents/src/api/capability-ceiling.js +0 -2
  469. package/node_modules/pi-subagents/src/api/capability-ceiling.js.map +0 -1
  470. package/node_modules/pi-subagents/src/api/child-tool-plan.d.ts +0 -2
  471. package/node_modules/pi-subagents/src/api/child-tool-plan.d.ts.map +0 -1
  472. package/node_modules/pi-subagents/src/api/child-tool-plan.js +0 -2
  473. package/node_modules/pi-subagents/src/api/child-tool-plan.js.map +0 -1
  474. package/node_modules/pi-subagents/src/api/control-channel.d.ts +0 -2
  475. package/node_modules/pi-subagents/src/api/control-channel.d.ts.map +0 -1
  476. package/node_modules/pi-subagents/src/api/control-channel.js +0 -2
  477. package/node_modules/pi-subagents/src/api/control-channel.js.map +0 -1
  478. package/node_modules/pi-subagents/src/api/delegation.d.ts +0 -113
  479. package/node_modules/pi-subagents/src/api/delegation.d.ts.map +0 -1
  480. package/node_modules/pi-subagents/src/api/delegation.js +0 -9
  481. package/node_modules/pi-subagents/src/api/delegation.js.map +0 -1
  482. package/node_modules/pi-subagents/src/api/external-job-provider.d.ts +0 -58
  483. package/node_modules/pi-subagents/src/api/external-job-provider.d.ts.map +0 -1
  484. package/node_modules/pi-subagents/src/api/external-job-provider.js +0 -140
  485. package/node_modules/pi-subagents/src/api/external-job-provider.js.map +0 -1
  486. package/node_modules/pi-subagents/src/api/external-runs.d.ts +0 -48
  487. package/node_modules/pi-subagents/src/api/external-runs.d.ts.map +0 -1
  488. package/node_modules/pi-subagents/src/api/external-runs.js +0 -246
  489. package/node_modules/pi-subagents/src/api/external-runs.js.map +0 -1
  490. package/node_modules/pi-subagents/src/api/inspectors.d.ts +0 -21
  491. package/node_modules/pi-subagents/src/api/inspectors.d.ts.map +0 -1
  492. package/node_modules/pi-subagents/src/api/inspectors.js +0 -12
  493. package/node_modules/pi-subagents/src/api/inspectors.js.map +0 -1
  494. package/node_modules/pi-subagents/src/api/intercom-bridge.d.ts +0 -2
  495. package/node_modules/pi-subagents/src/api/intercom-bridge.d.ts.map +0 -1
  496. package/node_modules/pi-subagents/src/api/intercom-bridge.js +0 -2
  497. package/node_modules/pi-subagents/src/api/intercom-bridge.js.map +0 -1
  498. package/node_modules/pi-subagents/src/api/preflight.d.ts +0 -179
  499. package/node_modules/pi-subagents/src/api/preflight.d.ts.map +0 -1
  500. package/node_modules/pi-subagents/src/api/preflight.js +0 -410
  501. package/node_modules/pi-subagents/src/api/preflight.js.map +0 -1
  502. package/node_modules/pi-subagents/src/api/project-panes.d.ts +0 -8
  503. package/node_modules/pi-subagents/src/api/project-panes.d.ts.map +0 -1
  504. package/node_modules/pi-subagents/src/api/project-panes.js +0 -8
  505. package/node_modules/pi-subagents/src/api/project-panes.js.map +0 -1
  506. package/node_modules/pi-subagents/src/api/required-child-extensions.d.ts +0 -2
  507. package/node_modules/pi-subagents/src/api/required-child-extensions.d.ts.map +0 -1
  508. package/node_modules/pi-subagents/src/api/required-child-extensions.js +0 -2
  509. package/node_modules/pi-subagents/src/api/required-child-extensions.js.map +0 -1
  510. package/node_modules/pi-subagents/src/api/shared-types.d.ts +0 -2
  511. package/node_modules/pi-subagents/src/api/shared-types.d.ts.map +0 -1
  512. package/node_modules/pi-subagents/src/api/shared-types.js +0 -2
  513. package/node_modules/pi-subagents/src/api/shared-types.js.map +0 -1
  514. package/node_modules/pi-subagents/src/api/workflow-resources.d.ts +0 -3
  515. package/node_modules/pi-subagents/src/api/workflow-resources.d.ts.map +0 -1
  516. package/node_modules/pi-subagents/src/api/workflow-resources.js +0 -2
  517. package/node_modules/pi-subagents/src/api/workflow-resources.js.map +0 -1
  518. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts +0 -8
  519. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts.map +0 -1
  520. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js +0 -30
  521. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js.map +0 -1
  522. package/node_modules/pi-subagents/src/extension/config.d.ts +0 -8
  523. package/node_modules/pi-subagents/src/extension/config.d.ts.map +0 -1
  524. package/node_modules/pi-subagents/src/extension/config.js +0 -283
  525. package/node_modules/pi-subagents/src/extension/config.js.map +0 -1
  526. package/node_modules/pi-subagents/src/extension/control-notices.d.ts +0 -19
  527. package/node_modules/pi-subagents/src/extension/control-notices.d.ts.map +0 -1
  528. package/node_modules/pi-subagents/src/extension/control-notices.js +0 -30
  529. package/node_modules/pi-subagents/src/extension/control-notices.js.map +0 -1
  530. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts +0 -19
  531. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts.map +0 -1
  532. package/node_modules/pi-subagents/src/extension/declaration-pinning.js +0 -154
  533. package/node_modules/pi-subagents/src/extension/declaration-pinning.js.map +0 -1
  534. package/node_modules/pi-subagents/src/extension/doctor.d.ts +0 -35
  535. package/node_modules/pi-subagents/src/extension/doctor.d.ts.map +0 -1
  536. package/node_modules/pi-subagents/src/extension/doctor.js +0 -226
  537. package/node_modules/pi-subagents/src/extension/doctor.js.map +0 -1
  538. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts +0 -7
  539. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts.map +0 -1
  540. package/node_modules/pi-subagents/src/extension/fanout-child.js +0 -278
  541. package/node_modules/pi-subagents/src/extension/fanout-child.js.map +0 -1
  542. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.d.ts +0 -17
  543. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.d.ts.map +0 -1
  544. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.js +0 -245
  545. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.js.map +0 -1
  546. package/node_modules/pi-subagents/src/extension/index.d.ts +0 -19
  547. package/node_modules/pi-subagents/src/extension/index.d.ts.map +0 -1
  548. package/node_modules/pi-subagents/src/extension/index.js +0 -1093
  549. package/node_modules/pi-subagents/src/extension/index.js.map +0 -1
  550. package/node_modules/pi-subagents/src/extension/public-execution.d.ts +0 -71
  551. package/node_modules/pi-subagents/src/extension/public-execution.d.ts.map +0 -1
  552. package/node_modules/pi-subagents/src/extension/public-execution.js +0 -212
  553. package/node_modules/pi-subagents/src/extension/public-execution.js.map +0 -1
  554. package/node_modules/pi-subagents/src/extension/reply-workflow-script.d.ts +0 -12
  555. package/node_modules/pi-subagents/src/extension/reply-workflow-script.d.ts.map +0 -1
  556. package/node_modules/pi-subagents/src/extension/reply-workflow-script.js +0 -70
  557. package/node_modules/pi-subagents/src/extension/reply-workflow-script.js.map +0 -1
  558. package/node_modules/pi-subagents/src/extension/rpc.d.ts +0 -85
  559. package/node_modules/pi-subagents/src/extension/rpc.d.ts.map +0 -1
  560. package/node_modules/pi-subagents/src/extension/rpc.js +0 -726
  561. package/node_modules/pi-subagents/src/extension/rpc.js.map +0 -1
  562. package/node_modules/pi-subagents/src/extension/schemas.d.ts +0 -275
  563. package/node_modules/pi-subagents/src/extension/schemas.d.ts.map +0 -1
  564. package/node_modules/pi-subagents/src/extension/schemas.js +0 -311
  565. package/node_modules/pi-subagents/src/extension/schemas.js.map +0 -1
  566. package/node_modules/pi-subagents/src/extension/steering-notices.d.ts +0 -15
  567. package/node_modules/pi-subagents/src/extension/steering-notices.d.ts.map +0 -1
  568. package/node_modules/pi-subagents/src/extension/steering-notices.js +0 -23
  569. package/node_modules/pi-subagents/src/extension/steering-notices.js.map +0 -1
  570. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts +0 -5
  571. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts.map +0 -1
  572. package/node_modules/pi-subagents/src/extension/subagent-guide.js +0 -116
  573. package/node_modules/pi-subagents/src/extension/subagent-guide.js.map +0 -1
  574. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts +0 -8
  575. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts.map +0 -1
  576. package/node_modules/pi-subagents/src/extension/subagent-options.js +0 -52
  577. package/node_modules/pi-subagents/src/extension/subagent-options.js.map +0 -1
  578. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts +0 -7
  579. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts.map +0 -1
  580. package/node_modules/pi-subagents/src/extension/tool-activation.js +0 -135
  581. package/node_modules/pi-subagents/src/extension/tool-activation.js.map +0 -1
  582. package/node_modules/pi-subagents/src/extension/tool-description.d.ts +0 -20
  583. package/node_modules/pi-subagents/src/extension/tool-description.d.ts.map +0 -1
  584. package/node_modules/pi-subagents/src/extension/tool-description.js +0 -170
  585. package/node_modules/pi-subagents/src/extension/tool-description.js.map +0 -1
  586. package/node_modules/pi-subagents/src/extension/tool-result.d.ts +0 -10
  587. package/node_modules/pi-subagents/src/extension/tool-result.d.ts.map +0 -1
  588. package/node_modules/pi-subagents/src/extension/tool-result.js +0 -17
  589. package/node_modules/pi-subagents/src/extension/tool-result.js.map +0 -1
  590. package/node_modules/pi-subagents/src/extension/upgrade-notice.d.ts +0 -7
  591. package/node_modules/pi-subagents/src/extension/upgrade-notice.d.ts.map +0 -1
  592. package/node_modules/pi-subagents/src/extension/upgrade-notice.js +0 -37
  593. package/node_modules/pi-subagents/src/extension/upgrade-notice.js.map +0 -1
  594. package/node_modules/pi-subagents/src/inspectors/actions.d.ts +0 -25
  595. package/node_modules/pi-subagents/src/inspectors/actions.d.ts.map +0 -1
  596. package/node_modules/pi-subagents/src/inspectors/actions.js +0 -183
  597. package/node_modules/pi-subagents/src/inspectors/actions.js.map +0 -1
  598. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.d.ts +0 -12
  599. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.d.ts.map +0 -1
  600. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.js +0 -63
  601. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.js.map +0 -1
  602. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.d.ts +0 -8
  603. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.d.ts.map +0 -1
  604. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.js +0 -24
  605. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.js.map +0 -1
  606. package/node_modules/pi-subagents/src/inspectors/herdr/actions.d.ts +0 -26
  607. package/node_modules/pi-subagents/src/inspectors/herdr/actions.d.ts.map +0 -1
  608. package/node_modules/pi-subagents/src/inspectors/herdr/actions.js +0 -134
  609. package/node_modules/pi-subagents/src/inspectors/herdr/actions.js.map +0 -1
  610. package/node_modules/pi-subagents/src/inspectors/herdr/client.d.ts +0 -42
  611. package/node_modules/pi-subagents/src/inspectors/herdr/client.d.ts.map +0 -1
  612. package/node_modules/pi-subagents/src/inspectors/herdr/client.js +0 -130
  613. package/node_modules/pi-subagents/src/inspectors/herdr/client.js.map +0 -1
  614. package/node_modules/pi-subagents/src/inspectors/herdr/focus.d.ts +0 -25
  615. package/node_modules/pi-subagents/src/inspectors/herdr/focus.d.ts.map +0 -1
  616. package/node_modules/pi-subagents/src/inspectors/herdr/focus.js +0 -50
  617. package/node_modules/pi-subagents/src/inspectors/herdr/focus.js.map +0 -1
  618. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.d.ts +0 -7
  619. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.d.ts.map +0 -1
  620. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.js +0 -15
  621. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.js.map +0 -1
  622. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.d.ts +0 -137
  623. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.d.ts.map +0 -1
  624. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.js +0 -608
  625. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.js.map +0 -1
  626. package/node_modules/pi-subagents/src/inspectors/inspector-runner.d.ts +0 -24
  627. package/node_modules/pi-subagents/src/inspectors/inspector-runner.d.ts.map +0 -1
  628. package/node_modules/pi-subagents/src/inspectors/inspector-runner.js +0 -162
  629. package/node_modules/pi-subagents/src/inspectors/inspector-runner.js.map +0 -1
  630. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts +0 -9
  631. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts.map +0 -1
  632. package/node_modules/pi-subagents/src/inspectors/plugins.js +0 -83
  633. package/node_modules/pi-subagents/src/inspectors/plugins.js.map +0 -1
  634. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.d.ts +0 -16
  635. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.d.ts.map +0 -1
  636. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.js +0 -33
  637. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.js.map +0 -1
  638. package/node_modules/pi-subagents/src/inspectors/shell-command.d.ts +0 -2
  639. package/node_modules/pi-subagents/src/inspectors/shell-command.d.ts.map +0 -1
  640. package/node_modules/pi-subagents/src/inspectors/shell-command.js +0 -17
  641. package/node_modules/pi-subagents/src/inspectors/shell-command.js.map +0 -1
  642. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts +0 -26
  643. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts.map +0 -1
  644. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js +0 -182
  645. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js.map +0 -1
  646. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts +0 -28
  647. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts.map +0 -1
  648. package/node_modules/pi-subagents/src/inspectors/tmux/client.js +0 -65
  649. package/node_modules/pi-subagents/src/inspectors/tmux/client.js.map +0 -1
  650. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts +0 -8
  651. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts.map +0 -1
  652. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js +0 -15
  653. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js.map +0 -1
  654. package/node_modules/pi-subagents/src/inspectors/types.d.ts +0 -49
  655. package/node_modules/pi-subagents/src/inspectors/types.d.ts.map +0 -1
  656. package/node_modules/pi-subagents/src/inspectors/types.js +0 -2
  657. package/node_modules/pi-subagents/src/inspectors/types.js.map +0 -1
  658. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts +0 -48
  659. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts.map +0 -1
  660. package/node_modules/pi-subagents/src/integrations/herdr-status.js +0 -351
  661. package/node_modules/pi-subagents/src/integrations/herdr-status.js.map +0 -1
  662. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.d.ts +0 -20
  663. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.d.ts.map +0 -1
  664. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.js +0 -54
  665. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.js.map +0 -1
  666. package/node_modules/pi-subagents/src/integrations/program-status.d.ts +0 -31
  667. package/node_modules/pi-subagents/src/integrations/program-status.d.ts.map +0 -1
  668. package/node_modules/pi-subagents/src/integrations/program-status.js +0 -189
  669. package/node_modules/pi-subagents/src/integrations/program-status.js.map +0 -1
  670. package/node_modules/pi-subagents/src/intercom/intercom-bridge.d.ts +0 -59
  671. package/node_modules/pi-subagents/src/intercom/intercom-bridge.d.ts.map +0 -1
  672. package/node_modules/pi-subagents/src/intercom/intercom-bridge.js +0 -194
  673. package/node_modules/pi-subagents/src/intercom/intercom-bridge.js.map +0 -1
  674. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts +0 -80
  675. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +0 -1
  676. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js +0 -992
  677. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js.map +0 -1
  678. package/node_modules/pi-subagents/src/intercom/result-intercom.d.ts +0 -36
  679. package/node_modules/pi-subagents/src/intercom/result-intercom.d.ts.map +0 -1
  680. package/node_modules/pi-subagents/src/intercom/result-intercom.js +0 -373
  681. package/node_modules/pi-subagents/src/intercom/result-intercom.js.map +0 -1
  682. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts +0 -30
  683. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts.map +0 -1
  684. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js +0 -50
  685. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js.map +0 -1
  686. package/node_modules/pi-subagents/src/missions/actions.d.ts +0 -55
  687. package/node_modules/pi-subagents/src/missions/actions.d.ts.map +0 -1
  688. package/node_modules/pi-subagents/src/missions/actions.js +0 -396
  689. package/node_modules/pi-subagents/src/missions/actions.js.map +0 -1
  690. package/node_modules/pi-subagents/src/missions/goal-driver.d.ts +0 -17
  691. package/node_modules/pi-subagents/src/missions/goal-driver.d.ts.map +0 -1
  692. package/node_modules/pi-subagents/src/missions/goal-driver.js +0 -172
  693. package/node_modules/pi-subagents/src/missions/goal-driver.js.map +0 -1
  694. package/node_modules/pi-subagents/src/missions/lifecycle.d.ts +0 -40
  695. package/node_modules/pi-subagents/src/missions/lifecycle.d.ts.map +0 -1
  696. package/node_modules/pi-subagents/src/missions/lifecycle.js +0 -352
  697. package/node_modules/pi-subagents/src/missions/lifecycle.js.map +0 -1
  698. package/node_modules/pi-subagents/src/missions/store.d.ts +0 -22
  699. package/node_modules/pi-subagents/src/missions/store.d.ts.map +0 -1
  700. package/node_modules/pi-subagents/src/missions/store.js +0 -605
  701. package/node_modules/pi-subagents/src/missions/store.js.map +0 -1
  702. package/node_modules/pi-subagents/src/missions/types.d.ts +0 -168
  703. package/node_modules/pi-subagents/src/missions/types.d.ts.map +0 -1
  704. package/node_modules/pi-subagents/src/missions/types.js +0 -10
  705. package/node_modules/pi-subagents/src/missions/types.js.map +0 -1
  706. package/node_modules/pi-subagents/src/missions/workflow-state.d.ts +0 -15
  707. package/node_modules/pi-subagents/src/missions/workflow-state.d.ts.map +0 -1
  708. package/node_modules/pi-subagents/src/missions/workflow-state.js +0 -274
  709. package/node_modules/pi-subagents/src/missions/workflow-state.js.map +0 -1
  710. package/node_modules/pi-subagents/src/policy/authority.d.ts +0 -10
  711. package/node_modules/pi-subagents/src/policy/authority.d.ts.map +0 -1
  712. package/node_modules/pi-subagents/src/policy/authority.js +0 -42
  713. package/node_modules/pi-subagents/src/policy/authority.js.map +0 -1
  714. package/node_modules/pi-subagents/src/profiles/profiles.d.ts +0 -135
  715. package/node_modules/pi-subagents/src/profiles/profiles.d.ts.map +0 -1
  716. package/node_modules/pi-subagents/src/profiles/profiles.js +0 -527
  717. package/node_modules/pi-subagents/src/profiles/profiles.js.map +0 -1
  718. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts +0 -115
  719. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts.map +0 -1
  720. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js +0 -512
  721. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js.map +0 -1
  722. package/node_modules/pi-subagents/src/runs/background/active-run-index.d.ts +0 -13
  723. package/node_modules/pi-subagents/src/runs/background/active-run-index.d.ts.map +0 -1
  724. package/node_modules/pi-subagents/src/runs/background/active-run-index.js +0 -158
  725. package/node_modules/pi-subagents/src/runs/background/active-run-index.js.map +0 -1
  726. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts +0 -298
  727. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts.map +0 -1
  728. package/node_modules/pi-subagents/src/runs/background/async-execution.js +0 -2125
  729. package/node_modules/pi-subagents/src/runs/background/async-execution.js.map +0 -1
  730. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts +0 -33
  731. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +0 -1
  732. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js +0 -908
  733. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js.map +0 -1
  734. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts +0 -59
  735. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts.map +0 -1
  736. package/node_modules/pi-subagents/src/runs/background/async-resume.js +0 -678
  737. package/node_modules/pi-subagents/src/runs/background/async-resume.js.map +0 -1
  738. package/node_modules/pi-subagents/src/runs/background/async-retention.d.ts +0 -45
  739. package/node_modules/pi-subagents/src/runs/background/async-retention.d.ts.map +0 -1
  740. package/node_modules/pi-subagents/src/runs/background/async-retention.js +0 -916
  741. package/node_modules/pi-subagents/src/runs/background/async-retention.js.map +0 -1
  742. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.d.ts +0 -10
  743. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.d.ts.map +0 -1
  744. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.js +0 -25
  745. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.js.map +0 -1
  746. package/node_modules/pi-subagents/src/runs/background/async-status.d.ts +0 -170
  747. package/node_modules/pi-subagents/src/runs/background/async-status.d.ts.map +0 -1
  748. package/node_modules/pi-subagents/src/runs/background/async-status.js +0 -674
  749. package/node_modules/pi-subagents/src/runs/background/async-status.js.map +0 -1
  750. package/node_modules/pi-subagents/src/runs/background/auto-drain.d.ts +0 -17
  751. package/node_modules/pi-subagents/src/runs/background/auto-drain.d.ts.map +0 -1
  752. package/node_modules/pi-subagents/src/runs/background/auto-drain.js +0 -73
  753. package/node_modules/pi-subagents/src/runs/background/auto-drain.js.map +0 -1
  754. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts +0 -27
  755. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts.map +0 -1
  756. package/node_modules/pi-subagents/src/runs/background/await-async-run.js +0 -88
  757. package/node_modules/pi-subagents/src/runs/background/await-async-run.js.map +0 -1
  758. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts +0 -9
  759. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts.map +0 -1
  760. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js +0 -70
  761. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js.map +0 -1
  762. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.d.ts +0 -27
  763. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.d.ts.map +0 -1
  764. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.js +0 -94
  765. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.js.map +0 -1
  766. package/node_modules/pi-subagents/src/runs/background/chain-append.d.ts +0 -35
  767. package/node_modules/pi-subagents/src/runs/background/chain-append.d.ts.map +0 -1
  768. package/node_modules/pi-subagents/src/runs/background/chain-append.js +0 -300
  769. package/node_modules/pi-subagents/src/runs/background/chain-append.js.map +0 -1
  770. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts +0 -52
  771. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +0 -1
  772. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js +0 -187
  773. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js.map +0 -1
  774. package/node_modules/pi-subagents/src/runs/background/completion-batcher.d.ts +0 -52
  775. package/node_modules/pi-subagents/src/runs/background/completion-batcher.d.ts.map +0 -1
  776. package/node_modules/pi-subagents/src/runs/background/completion-batcher.js +0 -120
  777. package/node_modules/pi-subagents/src/runs/background/completion-batcher.js.map +0 -1
  778. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.d.ts +0 -14
  779. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.d.ts.map +0 -1
  780. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.js +0 -49
  781. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.js.map +0 -1
  782. package/node_modules/pi-subagents/src/runs/background/completion-replay.d.ts +0 -48
  783. package/node_modules/pi-subagents/src/runs/background/completion-replay.d.ts.map +0 -1
  784. package/node_modules/pi-subagents/src/runs/background/completion-replay.js +0 -267
  785. package/node_modules/pi-subagents/src/runs/background/completion-replay.js.map +0 -1
  786. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts +0 -171
  787. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts.map +0 -1
  788. package/node_modules/pi-subagents/src/runs/background/control-channel.js +0 -611
  789. package/node_modules/pi-subagents/src/runs/background/control-channel.js.map +0 -1
  790. package/node_modules/pi-subagents/src/runs/background/fleet-view.d.ts +0 -64
  791. package/node_modules/pi-subagents/src/runs/background/fleet-view.d.ts.map +0 -1
  792. package/node_modules/pi-subagents/src/runs/background/fleet-view.js +0 -667
  793. package/node_modules/pi-subagents/src/runs/background/fleet-view.js.map +0 -1
  794. package/node_modules/pi-subagents/src/runs/background/index-segment.d.ts +0 -16
  795. package/node_modules/pi-subagents/src/runs/background/index-segment.d.ts.map +0 -1
  796. package/node_modules/pi-subagents/src/runs/background/index-segment.js +0 -59
  797. package/node_modules/pi-subagents/src/runs/background/index-segment.js.map +0 -1
  798. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.d.ts +0 -60
  799. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.d.ts.map +0 -1
  800. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.js +0 -406
  801. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.js.map +0 -1
  802. package/node_modules/pi-subagents/src/runs/background/notify.d.ts +0 -192
  803. package/node_modules/pi-subagents/src/runs/background/notify.d.ts.map +0 -1
  804. package/node_modules/pi-subagents/src/runs/background/notify.js +0 -897
  805. package/node_modules/pi-subagents/src/runs/background/notify.js.map +0 -1
  806. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.d.ts +0 -11
  807. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.d.ts.map +0 -1
  808. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.js +0 -117
  809. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.js.map +0 -1
  810. package/node_modules/pi-subagents/src/runs/background/parallel-groups.d.ts +0 -4
  811. package/node_modules/pi-subagents/src/runs/background/parallel-groups.d.ts.map +0 -1
  812. package/node_modules/pi-subagents/src/runs/background/parallel-groups.js +0 -47
  813. package/node_modules/pi-subagents/src/runs/background/parallel-groups.js.map +0 -1
  814. package/node_modules/pi-subagents/src/runs/background/pid-namespace.d.ts +0 -3
  815. package/node_modules/pi-subagents/src/runs/background/pid-namespace.d.ts.map +0 -1
  816. package/node_modules/pi-subagents/src/runs/background/pid-namespace.js +0 -20
  817. package/node_modules/pi-subagents/src/runs/background/pid-namespace.js.map +0 -1
  818. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.d.ts +0 -18
  819. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.d.ts.map +0 -1
  820. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.js +0 -97
  821. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.js.map +0 -1
  822. package/node_modules/pi-subagents/src/runs/background/process-terminal.d.ts +0 -22
  823. package/node_modules/pi-subagents/src/runs/background/process-terminal.d.ts.map +0 -1
  824. package/node_modules/pi-subagents/src/runs/background/process-terminal.js +0 -228
  825. package/node_modules/pi-subagents/src/runs/background/process-terminal.js.map +0 -1
  826. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.d.ts +0 -11
  827. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.d.ts.map +0 -1
  828. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.js +0 -37
  829. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.js.map +0 -1
  830. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts +0 -62
  831. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts.map +0 -1
  832. package/node_modules/pi-subagents/src/runs/background/result-files.js +0 -626
  833. package/node_modules/pi-subagents/src/runs/background/result-files.js.map +0 -1
  834. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts +0 -91
  835. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts.map +0 -1
  836. package/node_modules/pi-subagents/src/runs/background/result-watcher.js +0 -797
  837. package/node_modules/pi-subagents/src/runs/background/result-watcher.js.map +0 -1
  838. package/node_modules/pi-subagents/src/runs/background/resume-guidance.d.ts +0 -5
  839. package/node_modules/pi-subagents/src/runs/background/resume-guidance.d.ts.map +0 -1
  840. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js +0 -57
  841. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js.map +0 -1
  842. package/node_modules/pi-subagents/src/runs/background/retained-children.d.ts +0 -25
  843. package/node_modules/pi-subagents/src/runs/background/retained-children.d.ts.map +0 -1
  844. package/node_modules/pi-subagents/src/runs/background/retained-children.js +0 -129
  845. package/node_modules/pi-subagents/src/runs/background/retained-children.js.map +0 -1
  846. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.d.ts +0 -13
  847. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.d.ts.map +0 -1
  848. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.js +0 -91
  849. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.js.map +0 -1
  850. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts +0 -127
  851. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts.map +0 -1
  852. package/node_modules/pi-subagents/src/runs/background/run-child-session.js +0 -626
  853. package/node_modules/pi-subagents/src/runs/background/run-child-session.js.map +0 -1
  854. package/node_modules/pi-subagents/src/runs/background/run-id-query.d.ts +0 -4
  855. package/node_modules/pi-subagents/src/runs/background/run-id-query.d.ts.map +0 -1
  856. package/node_modules/pi-subagents/src/runs/background/run-id-query.js +0 -7
  857. package/node_modules/pi-subagents/src/runs/background/run-id-query.js.map +0 -1
  858. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts +0 -23
  859. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts.map +0 -1
  860. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js +0 -173
  861. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js.map +0 -1
  862. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts +0 -26
  863. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts.map +0 -1
  864. package/node_modules/pi-subagents/src/runs/background/run-status.js +0 -843
  865. package/node_modules/pi-subagents/src/runs/background/run-status.js.map +0 -1
  866. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts +0 -18
  867. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts.map +0 -1
  868. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js +0 -160
  869. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js.map +0 -1
  870. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts +0 -25
  871. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts.map +0 -1
  872. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js +0 -71
  873. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js.map +0 -1
  874. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.d.ts +0 -7
  875. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.d.ts.map +0 -1
  876. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.js +0 -35
  877. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.js.map +0 -1
  878. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts +0 -46
  879. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts.map +0 -1
  880. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js +0 -116
  881. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js.map +0 -1
  882. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.d.ts +0 -14
  883. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.d.ts.map +0 -1
  884. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.js +0 -47
  885. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.js.map +0 -1
  886. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts +0 -128
  887. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +0 -1
  888. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js +0 -1266
  889. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js.map +0 -1
  890. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.d.ts +0 -38
  891. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.d.ts.map +0 -1
  892. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.js +0 -421
  893. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.js.map +0 -1
  894. package/node_modules/pi-subagents/src/runs/background/steering.d.ts +0 -52
  895. package/node_modules/pi-subagents/src/runs/background/steering.d.ts.map +0 -1
  896. package/node_modules/pi-subagents/src/runs/background/steering.js +0 -247
  897. package/node_modules/pi-subagents/src/runs/background/steering.js.map +0 -1
  898. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts +0 -14
  899. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts.map +0 -1
  900. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js +0 -281
  901. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js.map +0 -1
  902. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts +0 -205
  903. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts.map +0 -1
  904. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js +0 -4919
  905. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js.map +0 -1
  906. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts +0 -124
  907. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts.map +0 -1
  908. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js +0 -749
  909. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js.map +0 -1
  910. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts +0 -9
  911. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts.map +0 -1
  912. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js +0 -169
  913. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js.map +0 -1
  914. package/node_modules/pi-subagents/src/runs/background/top-level-async.d.ts +0 -8
  915. package/node_modules/pi-subagents/src/runs/background/top-level-async.d.ts.map +0 -1
  916. package/node_modules/pi-subagents/src/runs/background/top-level-async.js +0 -6
  917. package/node_modules/pi-subagents/src/runs/background/top-level-async.js.map +0 -1
  918. package/node_modules/pi-subagents/src/runs/background/wait-completions.d.ts +0 -29
  919. package/node_modules/pi-subagents/src/runs/background/wait-completions.d.ts.map +0 -1
  920. package/node_modules/pi-subagents/src/runs/background/wait-completions.js +0 -265
  921. package/node_modules/pi-subagents/src/runs/background/wait-completions.js.map +0 -1
  922. package/node_modules/pi-subagents/src/runs/background/wait-config.d.ts +0 -9
  923. package/node_modules/pi-subagents/src/runs/background/wait-config.d.ts.map +0 -1
  924. package/node_modules/pi-subagents/src/runs/background/wait-config.js +0 -47
  925. package/node_modules/pi-subagents/src/runs/background/wait-config.js.map +0 -1
  926. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.d.ts +0 -27
  927. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.d.ts.map +0 -1
  928. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.js +0 -337
  929. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.js.map +0 -1
  930. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts +0 -7
  931. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts.map +0 -1
  932. package/node_modules/pi-subagents/src/runs/background/wait-tool.js +0 -49
  933. package/node_modules/pi-subagents/src/runs/background/wait-tool.js.map +0 -1
  934. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts +0 -31
  935. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts.map +0 -1
  936. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js +0 -90
  937. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js.map +0 -1
  938. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.d.ts +0 -7
  939. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.d.ts.map +0 -1
  940. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.js +0 -82
  941. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.js.map +0 -1
  942. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.d.ts +0 -32
  943. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.d.ts.map +0 -1
  944. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.js +0 -270
  945. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.js.map +0 -1
  946. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts +0 -13
  947. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts.map +0 -1
  948. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js +0 -210
  949. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js.map +0 -1
  950. package/node_modules/pi-subagents/src/runs/foreground/command-action.d.ts +0 -13
  951. package/node_modules/pi-subagents/src/runs/foreground/command-action.d.ts.map +0 -1
  952. package/node_modules/pi-subagents/src/runs/foreground/command-action.js +0 -38
  953. package/node_modules/pi-subagents/src/runs/foreground/command-action.js.map +0 -1
  954. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts +0 -11
  955. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts.map +0 -1
  956. package/node_modules/pi-subagents/src/runs/foreground/execution.js +0 -2181
  957. package/node_modules/pi-subagents/src/runs/foreground/execution.js.map +0 -1
  958. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.d.ts +0 -25
  959. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.d.ts.map +0 -1
  960. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.js +0 -139
  961. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.js.map +0 -1
  962. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.d.ts +0 -12
  963. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.d.ts.map +0 -1
  964. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.js +0 -166
  965. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.js.map +0 -1
  966. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.d.ts +0 -33
  967. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.d.ts.map +0 -1
  968. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.js +0 -139
  969. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.js.map +0 -1
  970. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -303
  971. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +0 -1
  972. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js +0 -7629
  973. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js.map +0 -1
  974. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.d.ts +0 -16
  975. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.d.ts.map +0 -1
  976. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.js +0 -284
  977. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.js.map +0 -1
  978. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.d.ts +0 -44
  979. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.d.ts.map +0 -1
  980. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.js +0 -149
  981. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.js.map +0 -1
  982. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.d.ts +0 -27
  983. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.d.ts.map +0 -1
  984. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.js +0 -109
  985. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.js.map +0 -1
  986. package/node_modules/pi-subagents/src/runs/shared/acceptance.d.ts +0 -145
  987. package/node_modules/pi-subagents/src/runs/shared/acceptance.d.ts.map +0 -1
  988. package/node_modules/pi-subagents/src/runs/shared/acceptance.js +0 -1617
  989. package/node_modules/pi-subagents/src/runs/shared/acceptance.js.map +0 -1
  990. package/node_modules/pi-subagents/src/runs/shared/agent-contract.d.ts +0 -6
  991. package/node_modules/pi-subagents/src/runs/shared/agent-contract.d.ts.map +0 -1
  992. package/node_modules/pi-subagents/src/runs/shared/agent-contract.js +0 -36
  993. package/node_modules/pi-subagents/src/runs/shared/agent-contract.js.map +0 -1
  994. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.d.ts +0 -97
  995. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.d.ts.map +0 -1
  996. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.js +0 -545
  997. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.js.map +0 -1
  998. package/node_modules/pi-subagents/src/runs/shared/background-process-options.d.ts +0 -5
  999. package/node_modules/pi-subagents/src/runs/shared/background-process-options.d.ts.map +0 -1
  1000. package/node_modules/pi-subagents/src/runs/shared/background-process-options.js +0 -7
  1001. package/node_modules/pi-subagents/src/runs/shared/background-process-options.js.map +0 -1
  1002. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.d.ts +0 -58
  1003. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.d.ts.map +0 -1
  1004. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.js +0 -179
  1005. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.js.map +0 -1
  1006. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.d.ts +0 -19
  1007. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.d.ts.map +0 -1
  1008. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.js +0 -105
  1009. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.js.map +0 -1
  1010. package/node_modules/pi-subagents/src/runs/shared/child-commands.d.ts +0 -28
  1011. package/node_modules/pi-subagents/src/runs/shared/child-commands.d.ts.map +0 -1
  1012. package/node_modules/pi-subagents/src/runs/shared/child-commands.js +0 -250
  1013. package/node_modules/pi-subagents/src/runs/shared/child-commands.js.map +0 -1
  1014. package/node_modules/pi-subagents/src/runs/shared/child-hooks.d.ts +0 -32
  1015. package/node_modules/pi-subagents/src/runs/shared/child-hooks.d.ts.map +0 -1
  1016. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js +0 -174
  1017. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js.map +0 -1
  1018. package/node_modules/pi-subagents/src/runs/shared/child-identity.d.ts +0 -24
  1019. package/node_modules/pi-subagents/src/runs/shared/child-identity.d.ts.map +0 -1
  1020. package/node_modules/pi-subagents/src/runs/shared/child-identity.js +0 -41
  1021. package/node_modules/pi-subagents/src/runs/shared/child-identity.js.map +0 -1
  1022. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.d.ts +0 -71
  1023. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.d.ts.map +0 -1
  1024. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.js +0 -89
  1025. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.js.map +0 -1
  1026. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts +0 -118
  1027. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts.map +0 -1
  1028. package/node_modules/pi-subagents/src/runs/shared/child-launch.js +0 -248
  1029. package/node_modules/pi-subagents/src/runs/shared/child-launch.js.map +0 -1
  1030. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.d.ts +0 -14
  1031. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.d.ts.map +0 -1
  1032. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.js +0 -23
  1033. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.js.map +0 -1
  1034. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.d.ts +0 -106
  1035. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.d.ts.map +0 -1
  1036. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.js +0 -39
  1037. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.js.map +0 -1
  1038. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts +0 -172
  1039. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts.map +0 -1
  1040. package/node_modules/pi-subagents/src/runs/shared/child-session.js +0 -589
  1041. package/node_modules/pi-subagents/src/runs/shared/child-session.js.map +0 -1
  1042. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts +0 -77
  1043. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts.map +0 -1
  1044. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js +0 -386
  1045. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js.map +0 -1
  1046. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.d.ts +0 -81
  1047. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.d.ts.map +0 -1
  1048. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.js +0 -256
  1049. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.js.map +0 -1
  1050. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.d.ts +0 -26
  1051. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.d.ts.map +0 -1
  1052. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.js +0 -128
  1053. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.js.map +0 -1
  1054. package/node_modules/pi-subagents/src/runs/shared/context-mode.d.ts +0 -13
  1055. package/node_modules/pi-subagents/src/runs/shared/context-mode.d.ts.map +0 -1
  1056. package/node_modules/pi-subagents/src/runs/shared/context-mode.js +0 -39
  1057. package/node_modules/pi-subagents/src/runs/shared/context-mode.js.map +0 -1
  1058. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.d.ts +0 -27
  1059. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.d.ts.map +0 -1
  1060. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.js +0 -100
  1061. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.js.map +0 -1
  1062. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.d.ts +0 -50
  1063. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.d.ts.map +0 -1
  1064. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js +0 -274
  1065. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js.map +0 -1
  1066. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts +0 -18
  1067. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts.map +0 -1
  1068. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js +0 -24
  1069. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js.map +0 -1
  1070. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.d.ts +0 -17
  1071. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.d.ts.map +0 -1
  1072. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.js +0 -83
  1073. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.js.map +0 -1
  1074. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.d.ts +0 -30
  1075. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.d.ts.map +0 -1
  1076. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.js +0 -146
  1077. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.js.map +0 -1
  1078. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.d.ts +0 -42
  1079. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.d.ts.map +0 -1
  1080. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.js +0 -160
  1081. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.js.map +0 -1
  1082. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts +0 -66
  1083. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts.map +0 -1
  1084. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js +0 -426
  1085. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js.map +0 -1
  1086. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.d.ts +0 -25
  1087. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.d.ts.map +0 -1
  1088. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.js +0 -487
  1089. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.js.map +0 -1
  1090. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.d.ts +0 -45
  1091. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.d.ts.map +0 -1
  1092. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.js +0 -353
  1093. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.js.map +0 -1
  1094. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.d.ts +0 -4
  1095. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.d.ts.map +0 -1
  1096. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.js +0 -9
  1097. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.js.map +0 -1
  1098. package/node_modules/pi-subagents/src/runs/shared/git-environment.d.ts +0 -3
  1099. package/node_modules/pi-subagents/src/runs/shared/git-environment.d.ts.map +0 -1
  1100. package/node_modules/pi-subagents/src/runs/shared/git-environment.js +0 -28
  1101. package/node_modules/pi-subagents/src/runs/shared/git-environment.js.map +0 -1
  1102. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.d.ts +0 -71
  1103. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.d.ts.map +0 -1
  1104. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.js +0 -258
  1105. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.js.map +0 -1
  1106. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.d.ts +0 -148
  1107. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.d.ts.map +0 -1
  1108. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.js +0 -405
  1109. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.js.map +0 -1
  1110. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.d.ts +0 -48
  1111. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.d.ts.map +0 -1
  1112. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.js +0 -247
  1113. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.js.map +0 -1
  1114. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.d.ts +0 -22
  1115. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.d.ts.map +0 -1
  1116. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.js +0 -58
  1117. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.js.map +0 -1
  1118. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts +0 -268
  1119. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts.map +0 -1
  1120. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js +0 -720
  1121. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js.map +0 -1
  1122. package/node_modules/pi-subagents/src/runs/shared/host-step-status.d.ts +0 -34
  1123. package/node_modules/pi-subagents/src/runs/shared/host-step-status.d.ts.map +0 -1
  1124. package/node_modules/pi-subagents/src/runs/shared/host-step-status.js +0 -245
  1125. package/node_modules/pi-subagents/src/runs/shared/host-step-status.js.map +0 -1
  1126. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.d.ts +0 -24
  1127. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.d.ts.map +0 -1
  1128. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.js +0 -127
  1129. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.js.map +0 -1
  1130. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.d.ts +0 -2
  1131. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.d.ts.map +0 -1
  1132. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.js +0 -17
  1133. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.js.map +0 -1
  1134. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.d.ts +0 -33
  1135. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.d.ts.map +0 -1
  1136. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.js +0 -199
  1137. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.js.map +0 -1
  1138. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.d.ts +0 -34
  1139. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.d.ts.map +0 -1
  1140. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.js +0 -419
  1141. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.js.map +0 -1
  1142. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts +0 -87
  1143. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +0 -1
  1144. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +0 -478
  1145. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js.map +0 -1
  1146. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.d.ts +0 -43
  1147. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.d.ts.map +0 -1
  1148. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.js +0 -160
  1149. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.js.map +0 -1
  1150. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts +0 -34
  1151. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts.map +0 -1
  1152. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js +0 -92
  1153. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js.map +0 -1
  1154. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts +0 -106
  1155. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts.map +0 -1
  1156. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js +0 -405
  1157. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js.map +0 -1
  1158. package/node_modules/pi-subagents/src/runs/shared/model-scope.d.ts +0 -69
  1159. package/node_modules/pi-subagents/src/runs/shared/model-scope.d.ts.map +0 -1
  1160. package/node_modules/pi-subagents/src/runs/shared/model-scope.js +0 -172
  1161. package/node_modules/pi-subagents/src/runs/shared/model-scope.js.map +0 -1
  1162. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.d.ts +0 -19
  1163. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.d.ts.map +0 -1
  1164. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.js +0 -199
  1165. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.js.map +0 -1
  1166. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts +0 -136
  1167. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts.map +0 -1
  1168. package/node_modules/pi-subagents/src/runs/shared/nested-events.js +0 -1060
  1169. package/node_modules/pi-subagents/src/runs/shared/nested-events.js.map +0 -1
  1170. package/node_modules/pi-subagents/src/runs/shared/nested-path.d.ts +0 -9
  1171. package/node_modules/pi-subagents/src/runs/shared/nested-path.d.ts.map +0 -1
  1172. package/node_modules/pi-subagents/src/runs/shared/nested-path.js +0 -35
  1173. package/node_modules/pi-subagents/src/runs/shared/nested-path.js.map +0 -1
  1174. package/node_modules/pi-subagents/src/runs/shared/nested-render.d.ts +0 -21
  1175. package/node_modules/pi-subagents/src/runs/shared/nested-render.d.ts.map +0 -1
  1176. package/node_modules/pi-subagents/src/runs/shared/nested-render.js +0 -116
  1177. package/node_modules/pi-subagents/src/runs/shared/nested-render.js.map +0 -1
  1178. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.d.ts +0 -33
  1179. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.d.ts.map +0 -1
  1180. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js +0 -527
  1181. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js.map +0 -1
  1182. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.d.ts +0 -79
  1183. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.d.ts.map +0 -1
  1184. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js +0 -780
  1185. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js.map +0 -1
  1186. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts +0 -170
  1187. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +0 -1
  1188. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js +0 -126
  1189. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js.map +0 -1
  1190. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts +0 -25
  1191. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts.map +0 -1
  1192. package/node_modules/pi-subagents/src/runs/shared/partial-output.js +0 -36
  1193. package/node_modules/pi-subagents/src/runs/shared/partial-output.js.map +0 -1
  1194. package/node_modules/pi-subagents/src/runs/shared/permissions.d.ts +0 -13
  1195. package/node_modules/pi-subagents/src/runs/shared/permissions.d.ts.map +0 -1
  1196. package/node_modules/pi-subagents/src/runs/shared/permissions.js +0 -93
  1197. package/node_modules/pi-subagents/src/runs/shared/permissions.js.map +0 -1
  1198. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.d.ts +0 -28
  1199. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.d.ts.map +0 -1
  1200. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.js +0 -156
  1201. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.js.map +0 -1
  1202. package/node_modules/pi-subagents/src/runs/shared/process-signal.d.ts +0 -16
  1203. package/node_modules/pi-subagents/src/runs/shared/process-signal.d.ts.map +0 -1
  1204. package/node_modules/pi-subagents/src/runs/shared/process-signal.js +0 -22
  1205. package/node_modules/pi-subagents/src/runs/shared/process-signal.js.map +0 -1
  1206. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.d.ts +0 -26
  1207. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.d.ts.map +0 -1
  1208. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.js +0 -51
  1209. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.js.map +0 -1
  1210. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.d.ts +0 -15
  1211. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.d.ts.map +0 -1
  1212. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.js +0 -259
  1213. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.js.map +0 -1
  1214. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts +0 -12
  1215. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts.map +0 -1
  1216. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js +0 -25
  1217. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js.map +0 -1
  1218. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.d.ts +0 -8
  1219. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.d.ts.map +0 -1
  1220. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.js +0 -45
  1221. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.js.map +0 -1
  1222. package/node_modules/pi-subagents/src/runs/shared/session-lease.d.ts +0 -70
  1223. package/node_modules/pi-subagents/src/runs/shared/session-lease.d.ts.map +0 -1
  1224. package/node_modules/pi-subagents/src/runs/shared/session-lease.js +0 -251
  1225. package/node_modules/pi-subagents/src/runs/shared/session-lease.js.map +0 -1
  1226. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts +0 -91
  1227. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts.map +0 -1
  1228. package/node_modules/pi-subagents/src/runs/shared/single-output.js +0 -350
  1229. package/node_modules/pi-subagents/src/runs/shared/single-output.js.map +0 -1
  1230. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.d.ts +0 -21
  1231. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.d.ts.map +0 -1
  1232. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.js +0 -94
  1233. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.js.map +0 -1
  1234. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts +0 -66
  1235. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts.map +0 -1
  1236. package/node_modules/pi-subagents/src/runs/shared/structured-output.js +0 -483
  1237. package/node_modules/pi-subagents/src/runs/shared/structured-output.js.map +0 -1
  1238. package/node_modules/pi-subagents/src/runs/shared/subagent-control.d.ts +0 -50
  1239. package/node_modules/pi-subagents/src/runs/shared/subagent-control.d.ts.map +0 -1
  1240. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js +0 -247
  1241. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js.map +0 -1
  1242. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts +0 -64
  1243. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +0 -1
  1244. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +0 -681
  1245. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +0 -1
  1246. package/node_modules/pi-subagents/src/runs/shared/tool-availability.d.ts +0 -17
  1247. package/node_modules/pi-subagents/src/runs/shared/tool-availability.d.ts.map +0 -1
  1248. package/node_modules/pi-subagents/src/runs/shared/tool-availability.js +0 -30
  1249. package/node_modules/pi-subagents/src/runs/shared/tool-availability.js.map +0 -1
  1250. package/node_modules/pi-subagents/src/runs/shared/tool-budget.d.ts +0 -22
  1251. package/node_modules/pi-subagents/src/runs/shared/tool-budget.d.ts.map +0 -1
  1252. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js +0 -79
  1253. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js.map +0 -1
  1254. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.d.ts +0 -32
  1255. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.d.ts.map +0 -1
  1256. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.js +0 -74
  1257. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.js.map +0 -1
  1258. package/node_modules/pi-subagents/src/runs/shared/usage-budget.d.ts +0 -8
  1259. package/node_modules/pi-subagents/src/runs/shared/usage-budget.d.ts.map +0 -1
  1260. package/node_modules/pi-subagents/src/runs/shared/usage-budget.js +0 -75
  1261. package/node_modules/pi-subagents/src/runs/shared/usage-budget.js.map +0 -1
  1262. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.d.ts +0 -9
  1263. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.d.ts.map +0 -1
  1264. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.js +0 -72
  1265. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.js.map +0 -1
  1266. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.d.ts +0 -4
  1267. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.d.ts.map +0 -1
  1268. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js +0 -18
  1269. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js.map +0 -1
  1270. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.d.ts +0 -32
  1271. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.d.ts.map +0 -1
  1272. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.js +0 -222
  1273. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.js.map +0 -1
  1274. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.d.ts +0 -37
  1275. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.d.ts.map +0 -1
  1276. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.js +0 -179
  1277. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.js.map +0 -1
  1278. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.d.ts +0 -85
  1279. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.d.ts.map +0 -1
  1280. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js +0 -804
  1281. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js.map +0 -1
  1282. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.d.ts +0 -6
  1283. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.d.ts.map +0 -1
  1284. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.js +0 -41
  1285. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.js.map +0 -1
  1286. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.d.ts +0 -39
  1287. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.d.ts.map +0 -1
  1288. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.js +0 -201
  1289. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.js.map +0 -1
  1290. package/node_modules/pi-subagents/src/runs/shared/worktree.d.ts +0 -182
  1291. package/node_modules/pi-subagents/src/runs/shared/worktree.d.ts.map +0 -1
  1292. package/node_modules/pi-subagents/src/runs/shared/worktree.js +0 -1347
  1293. package/node_modules/pi-subagents/src/runs/shared/worktree.js.map +0 -1
  1294. package/node_modules/pi-subagents/src/shared/accessible-dir.d.ts +0 -12
  1295. package/node_modules/pi-subagents/src/shared/accessible-dir.d.ts.map +0 -1
  1296. package/node_modules/pi-subagents/src/shared/accessible-dir.js +0 -37
  1297. package/node_modules/pi-subagents/src/shared/accessible-dir.js.map +0 -1
  1298. package/node_modules/pi-subagents/src/shared/agent-stream-options.d.ts +0 -6
  1299. package/node_modules/pi-subagents/src/shared/agent-stream-options.d.ts.map +0 -1
  1300. package/node_modules/pi-subagents/src/shared/agent-stream-options.js +0 -4
  1301. package/node_modules/pi-subagents/src/shared/agent-stream-options.js.map +0 -1
  1302. package/node_modules/pi-subagents/src/shared/artifacts.d.ts +0 -23
  1303. package/node_modules/pi-subagents/src/shared/artifacts.d.ts.map +0 -1
  1304. package/node_modules/pi-subagents/src/shared/artifacts.js +0 -273
  1305. package/node_modules/pi-subagents/src/shared/artifacts.js.map +0 -1
  1306. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts +0 -20
  1307. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts.map +0 -1
  1308. package/node_modules/pi-subagents/src/shared/atomic-json.js +0 -62
  1309. package/node_modules/pi-subagents/src/shared/atomic-json.js.map +0 -1
  1310. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.d.ts +0 -27
  1311. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.d.ts.map +0 -1
  1312. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.js +0 -87
  1313. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.js.map +0 -1
  1314. package/node_modules/pi-subagents/src/shared/child-cache-retention.d.ts +0 -30
  1315. package/node_modules/pi-subagents/src/shared/child-cache-retention.d.ts.map +0 -1
  1316. package/node_modules/pi-subagents/src/shared/child-cache-retention.js +0 -41
  1317. package/node_modules/pi-subagents/src/shared/child-cache-retention.js.map +0 -1
  1318. package/node_modules/pi-subagents/src/shared/child-session-name.d.ts +0 -9
  1319. package/node_modules/pi-subagents/src/shared/child-session-name.d.ts.map +0 -1
  1320. package/node_modules/pi-subagents/src/shared/child-session-name.js +0 -41
  1321. package/node_modules/pi-subagents/src/shared/child-session-name.js.map +0 -1
  1322. package/node_modules/pi-subagents/src/shared/child-transcript.d.ts +0 -38
  1323. package/node_modules/pi-subagents/src/shared/child-transcript.d.ts.map +0 -1
  1324. package/node_modules/pi-subagents/src/shared/child-transcript.js +0 -226
  1325. package/node_modules/pi-subagents/src/shared/child-transcript.js.map +0 -1
  1326. package/node_modules/pi-subagents/src/shared/completion-owner.d.ts +0 -3
  1327. package/node_modules/pi-subagents/src/shared/completion-owner.d.ts.map +0 -1
  1328. package/node_modules/pi-subagents/src/shared/completion-owner.js +0 -9
  1329. package/node_modules/pi-subagents/src/shared/completion-owner.js.map +0 -1
  1330. package/node_modules/pi-subagents/src/shared/disabled-features.d.ts +0 -92
  1331. package/node_modules/pi-subagents/src/shared/disabled-features.d.ts.map +0 -1
  1332. package/node_modules/pi-subagents/src/shared/disabled-features.js +0 -113
  1333. package/node_modules/pi-subagents/src/shared/disabled-features.js.map +0 -1
  1334. package/node_modules/pi-subagents/src/shared/display-text.d.ts +0 -6
  1335. package/node_modules/pi-subagents/src/shared/display-text.d.ts.map +0 -1
  1336. package/node_modules/pi-subagents/src/shared/display-text.js +0 -155
  1337. package/node_modules/pi-subagents/src/shared/display-text.js.map +0 -1
  1338. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts +0 -5
  1339. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts.map +0 -1
  1340. package/node_modules/pi-subagents/src/shared/edit-distance.js +0 -33
  1341. package/node_modules/pi-subagents/src/shared/edit-distance.js.map +0 -1
  1342. package/node_modules/pi-subagents/src/shared/extension-context.d.ts +0 -22
  1343. package/node_modules/pi-subagents/src/shared/extension-context.d.ts.map +0 -1
  1344. package/node_modules/pi-subagents/src/shared/extension-context.js +0 -40
  1345. package/node_modules/pi-subagents/src/shared/extension-context.js.map +0 -1
  1346. package/node_modules/pi-subagents/src/shared/file-coalescer.d.ts +0 -12
  1347. package/node_modules/pi-subagents/src/shared/file-coalescer.d.ts.map +0 -1
  1348. package/node_modules/pi-subagents/src/shared/file-coalescer.js +0 -35
  1349. package/node_modules/pi-subagents/src/shared/file-coalescer.js.map +0 -1
  1350. package/node_modules/pi-subagents/src/shared/file-lease.d.ts +0 -5
  1351. package/node_modules/pi-subagents/src/shared/file-lease.d.ts.map +0 -1
  1352. package/node_modules/pi-subagents/src/shared/file-lease.js +0 -101
  1353. package/node_modules/pi-subagents/src/shared/file-lease.js.map +0 -1
  1354. package/node_modules/pi-subagents/src/shared/file-system-retry.d.ts +0 -32
  1355. package/node_modules/pi-subagents/src/shared/file-system-retry.d.ts.map +0 -1
  1356. package/node_modules/pi-subagents/src/shared/file-system-retry.js +0 -85
  1357. package/node_modules/pi-subagents/src/shared/file-system-retry.js.map +0 -1
  1358. package/node_modules/pi-subagents/src/shared/fork-context.d.ts +0 -63
  1359. package/node_modules/pi-subagents/src/shared/fork-context.d.ts.map +0 -1
  1360. package/node_modules/pi-subagents/src/shared/fork-context.js +0 -176
  1361. package/node_modules/pi-subagents/src/shared/fork-context.js.map +0 -1
  1362. package/node_modules/pi-subagents/src/shared/fork-session-cwd.d.ts +0 -3
  1363. package/node_modules/pi-subagents/src/shared/fork-session-cwd.d.ts.map +0 -1
  1364. package/node_modules/pi-subagents/src/shared/fork-session-cwd.js +0 -24
  1365. package/node_modules/pi-subagents/src/shared/fork-session-cwd.js.map +0 -1
  1366. package/node_modules/pi-subagents/src/shared/formatters.d.ts +0 -36
  1367. package/node_modules/pi-subagents/src/shared/formatters.d.ts.map +0 -1
  1368. package/node_modules/pi-subagents/src/shared/formatters.js +0 -138
  1369. package/node_modules/pi-subagents/src/shared/formatters.js.map +0 -1
  1370. package/node_modules/pi-subagents/src/shared/jsonl-writer.d.ts +0 -21
  1371. package/node_modules/pi-subagents/src/shared/jsonl-writer.d.ts.map +0 -1
  1372. package/node_modules/pi-subagents/src/shared/jsonl-writer.js +0 -68
  1373. package/node_modules/pi-subagents/src/shared/jsonl-writer.js.map +0 -1
  1374. package/node_modules/pi-subagents/src/shared/launch-contract.d.ts +0 -64
  1375. package/node_modules/pi-subagents/src/shared/launch-contract.d.ts.map +0 -1
  1376. package/node_modules/pi-subagents/src/shared/launch-contract.js +0 -140
  1377. package/node_modules/pi-subagents/src/shared/launch-contract.js.map +0 -1
  1378. package/node_modules/pi-subagents/src/shared/model-info.d.ts +0 -56
  1379. package/node_modules/pi-subagents/src/shared/model-info.d.ts.map +0 -1
  1380. package/node_modules/pi-subagents/src/shared/model-info.js +0 -104
  1381. package/node_modules/pi-subagents/src/shared/model-info.js.map +0 -1
  1382. package/node_modules/pi-subagents/src/shared/model-response-aliases.d.ts +0 -2
  1383. package/node_modules/pi-subagents/src/shared/model-response-aliases.d.ts.map +0 -1
  1384. package/node_modules/pi-subagents/src/shared/model-response-aliases.js +0 -16
  1385. package/node_modules/pi-subagents/src/shared/model-response-aliases.js.map +0 -1
  1386. package/node_modules/pi-subagents/src/shared/node-executable.d.ts +0 -2
  1387. package/node_modules/pi-subagents/src/shared/node-executable.d.ts.map +0 -1
  1388. package/node_modules/pi-subagents/src/shared/node-executable.js +0 -21
  1389. package/node_modules/pi-subagents/src/shared/node-executable.js.map +0 -1
  1390. package/node_modules/pi-subagents/src/shared/opencode-session-headers.d.ts +0 -13
  1391. package/node_modules/pi-subagents/src/shared/opencode-session-headers.d.ts.map +0 -1
  1392. package/node_modules/pi-subagents/src/shared/opencode-session-headers.js +0 -27
  1393. package/node_modules/pi-subagents/src/shared/opencode-session-headers.js.map +0 -1
  1394. package/node_modules/pi-subagents/src/shared/package-version.d.ts +0 -3
  1395. package/node_modules/pi-subagents/src/shared/package-version.d.ts.map +0 -1
  1396. package/node_modules/pi-subagents/src/shared/package-version.js +0 -15
  1397. package/node_modules/pi-subagents/src/shared/package-version.js.map +0 -1
  1398. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts +0 -24
  1399. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts.map +0 -1
  1400. package/node_modules/pi-subagents/src/shared/parent-wake.js +0 -71
  1401. package/node_modules/pi-subagents/src/shared/parent-wake.js.map +0 -1
  1402. package/node_modules/pi-subagents/src/shared/prompt-resources.d.ts +0 -6
  1403. package/node_modules/pi-subagents/src/shared/prompt-resources.d.ts.map +0 -1
  1404. package/node_modules/pi-subagents/src/shared/prompt-resources.js +0 -11
  1405. package/node_modules/pi-subagents/src/shared/prompt-resources.js.map +0 -1
  1406. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts +0 -35
  1407. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts.map +0 -1
  1408. package/node_modules/pi-subagents/src/shared/pruned-fork.js +0 -435
  1409. package/node_modules/pi-subagents/src/shared/pruned-fork.js.map +0 -1
  1410. package/node_modules/pi-subagents/src/shared/required-child-extensions.d.ts +0 -35
  1411. package/node_modules/pi-subagents/src/shared/required-child-extensions.d.ts.map +0 -1
  1412. package/node_modules/pi-subagents/src/shared/required-child-extensions.js +0 -106
  1413. package/node_modules/pi-subagents/src/shared/required-child-extensions.js.map +0 -1
  1414. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts +0 -11
  1415. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts.map +0 -1
  1416. package/node_modules/pi-subagents/src/shared/runtime-module-path.js +0 -17
  1417. package/node_modules/pi-subagents/src/shared/runtime-module-path.js.map +0 -1
  1418. package/node_modules/pi-subagents/src/shared/session-file-trust.d.ts +0 -2
  1419. package/node_modules/pi-subagents/src/shared/session-file-trust.d.ts.map +0 -1
  1420. package/node_modules/pi-subagents/src/shared/session-file-trust.js +0 -21
  1421. package/node_modules/pi-subagents/src/shared/session-file-trust.js.map +0 -1
  1422. package/node_modules/pi-subagents/src/shared/session-identity.d.ts +0 -7
  1423. package/node_modules/pi-subagents/src/shared/session-identity.d.ts.map +0 -1
  1424. package/node_modules/pi-subagents/src/shared/session-identity.js +0 -7
  1425. package/node_modules/pi-subagents/src/shared/session-identity.js.map +0 -1
  1426. package/node_modules/pi-subagents/src/shared/session-tokens.d.ts +0 -3
  1427. package/node_modules/pi-subagents/src/shared/session-tokens.d.ts.map +0 -1
  1428. package/node_modules/pi-subagents/src/shared/session-tokens.js +0 -59
  1429. package/node_modules/pi-subagents/src/shared/session-tokens.js.map +0 -1
  1430. package/node_modules/pi-subagents/src/shared/settings-file-lease.d.ts +0 -5
  1431. package/node_modules/pi-subagents/src/shared/settings-file-lease.d.ts.map +0 -1
  1432. package/node_modules/pi-subagents/src/shared/settings-file-lease.js +0 -39
  1433. package/node_modules/pi-subagents/src/shared/settings-file-lease.js.map +0 -1
  1434. package/node_modules/pi-subagents/src/shared/settings.d.ts +0 -147
  1435. package/node_modules/pi-subagents/src/shared/settings.d.ts.map +0 -1
  1436. package/node_modules/pi-subagents/src/shared/settings.js +0 -248
  1437. package/node_modules/pi-subagents/src/shared/settings.js.map +0 -1
  1438. package/node_modules/pi-subagents/src/shared/shortcuts.d.ts +0 -2
  1439. package/node_modules/pi-subagents/src/shared/shortcuts.d.ts.map +0 -1
  1440. package/node_modules/pi-subagents/src/shared/shortcuts.js +0 -18
  1441. package/node_modules/pi-subagents/src/shared/shortcuts.js.map +0 -1
  1442. package/node_modules/pi-subagents/src/shared/status-format.d.ts +0 -10
  1443. package/node_modules/pi-subagents/src/shared/status-format.d.ts.map +0 -1
  1444. package/node_modules/pi-subagents/src/shared/status-format.js +0 -61
  1445. package/node_modules/pi-subagents/src/shared/status-format.js.map +0 -1
  1446. package/node_modules/pi-subagents/src/shared/thinking-ceiling.d.ts +0 -14
  1447. package/node_modules/pi-subagents/src/shared/thinking-ceiling.d.ts.map +0 -1
  1448. package/node_modules/pi-subagents/src/shared/thinking-ceiling.js +0 -38
  1449. package/node_modules/pi-subagents/src/shared/thinking-ceiling.js.map +0 -1
  1450. package/node_modules/pi-subagents/src/shared/types.d.ts +0 -2748
  1451. package/node_modules/pi-subagents/src/shared/types.d.ts.map +0 -1
  1452. package/node_modules/pi-subagents/src/shared/types.js +0 -270
  1453. package/node_modules/pi-subagents/src/shared/types.js.map +0 -1
  1454. package/node_modules/pi-subagents/src/shared/utf8.d.ts +0 -6
  1455. package/node_modules/pi-subagents/src/shared/utf8.d.ts.map +0 -1
  1456. package/node_modules/pi-subagents/src/shared/utf8.js +0 -13
  1457. package/node_modules/pi-subagents/src/shared/utf8.js.map +0 -1
  1458. package/node_modules/pi-subagents/src/shared/utils.d.ts +0 -73
  1459. package/node_modules/pi-subagents/src/shared/utils.d.ts.map +0 -1
  1460. package/node_modules/pi-subagents/src/shared/utils.js +0 -596
  1461. package/node_modules/pi-subagents/src/shared/utils.js.map +0 -1
  1462. package/node_modules/pi-subagents/src/shared/watch-strategy.d.ts +0 -3
  1463. package/node_modules/pi-subagents/src/shared/watch-strategy.d.ts.map +0 -1
  1464. package/node_modules/pi-subagents/src/shared/watch-strategy.js +0 -6
  1465. package/node_modules/pi-subagents/src/shared/watch-strategy.js.map +0 -1
  1466. package/node_modules/pi-subagents/src/shared/workflow-child-permit.d.ts +0 -59
  1467. package/node_modules/pi-subagents/src/shared/workflow-child-permit.d.ts.map +0 -1
  1468. package/node_modules/pi-subagents/src/shared/workflow-child-permit.js +0 -160
  1469. package/node_modules/pi-subagents/src/shared/workflow-child-permit.js.map +0 -1
  1470. package/node_modules/pi-subagents/src/slash/delegation-adapters.d.ts +0 -153
  1471. package/node_modules/pi-subagents/src/slash/delegation-adapters.d.ts.map +0 -1
  1472. package/node_modules/pi-subagents/src/slash/delegation-adapters.js +0 -310
  1473. package/node_modules/pi-subagents/src/slash/delegation-adapters.js.map +0 -1
  1474. package/node_modules/pi-subagents/src/slash/delegation-json.d.ts +0 -11
  1475. package/node_modules/pi-subagents/src/slash/delegation-json.d.ts.map +0 -1
  1476. package/node_modules/pi-subagents/src/slash/delegation-json.js +0 -118
  1477. package/node_modules/pi-subagents/src/slash/delegation-json.js.map +0 -1
  1478. package/node_modules/pi-subagents/src/slash/delegation-request.d.ts +0 -13
  1479. package/node_modules/pi-subagents/src/slash/delegation-request.d.ts.map +0 -1
  1480. package/node_modules/pi-subagents/src/slash/delegation-request.js +0 -175
  1481. package/node_modules/pi-subagents/src/slash/delegation-request.js.map +0 -1
  1482. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.d.ts +0 -27
  1483. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.d.ts.map +0 -1
  1484. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.js +0 -393
  1485. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.js.map +0 -1
  1486. package/node_modules/pi-subagents/src/slash/prompt-workflows.d.ts +0 -22
  1487. package/node_modules/pi-subagents/src/slash/prompt-workflows.d.ts.map +0 -1
  1488. package/node_modules/pi-subagents/src/slash/prompt-workflows.js +0 -275
  1489. package/node_modules/pi-subagents/src/slash/prompt-workflows.js.map +0 -1
  1490. package/node_modules/pi-subagents/src/slash/selector.d.ts +0 -48
  1491. package/node_modules/pi-subagents/src/slash/selector.d.ts.map +0 -1
  1492. package/node_modules/pi-subagents/src/slash/selector.js +0 -118
  1493. package/node_modules/pi-subagents/src/slash/selector.js.map +0 -1
  1494. package/node_modules/pi-subagents/src/slash/slash-bridge.d.ts +0 -31
  1495. package/node_modules/pi-subagents/src/slash/slash-bridge.d.ts.map +0 -1
  1496. package/node_modules/pi-subagents/src/slash/slash-bridge.js +0 -133
  1497. package/node_modules/pi-subagents/src/slash/slash-bridge.js.map +0 -1
  1498. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts +0 -11
  1499. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts.map +0 -1
  1500. package/node_modules/pi-subagents/src/slash/slash-commands.js +0 -1060
  1501. package/node_modules/pi-subagents/src/slash/slash-commands.js.map +0 -1
  1502. package/node_modules/pi-subagents/src/slash/slash-live-state.d.ts +0 -22
  1503. package/node_modules/pi-subagents/src/slash/slash-live-state.d.ts.map +0 -1
  1504. package/node_modules/pi-subagents/src/slash/slash-live-state.js +0 -264
  1505. package/node_modules/pi-subagents/src/slash/slash-live-state.js.map +0 -1
  1506. package/node_modules/pi-subagents/src/slash/subagent-cost.d.ts +0 -30
  1507. package/node_modules/pi-subagents/src/slash/subagent-cost.d.ts.map +0 -1
  1508. package/node_modules/pi-subagents/src/slash/subagent-cost.js +0 -311
  1509. package/node_modules/pi-subagents/src/slash/subagent-cost.js.map +0 -1
  1510. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts +0 -3
  1511. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts.map +0 -1
  1512. package/node_modules/pi-subagents/src/slash/subagents-admin.js +0 -455
  1513. package/node_modules/pi-subagents/src/slash/subagents-admin.js.map +0 -1
  1514. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts +0 -93
  1515. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts.map +0 -1
  1516. package/node_modules/pi-subagents/src/tui/fleet-status.js +0 -1133
  1517. package/node_modules/pi-subagents/src/tui/fleet-status.js.map +0 -1
  1518. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts +0 -52
  1519. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts.map +0 -1
  1520. package/node_modules/pi-subagents/src/tui/fleet-transcript.js +0 -502
  1521. package/node_modules/pi-subagents/src/tui/fleet-transcript.js.map +0 -1
  1522. package/node_modules/pi-subagents/src/tui/fleet.d.ts +0 -169
  1523. package/node_modules/pi-subagents/src/tui/fleet.d.ts.map +0 -1
  1524. package/node_modules/pi-subagents/src/tui/fleet.js +0 -1432
  1525. package/node_modules/pi-subagents/src/tui/fleet.js.map +0 -1
  1526. package/node_modules/pi-subagents/src/tui/render-helpers.d.ts +0 -24
  1527. package/node_modules/pi-subagents/src/tui/render-helpers.d.ts.map +0 -1
  1528. package/node_modules/pi-subagents/src/tui/render-helpers.js +0 -101
  1529. package/node_modules/pi-subagents/src/tui/render-helpers.js.map +0 -1
  1530. package/node_modules/pi-subagents/src/tui/render.d.ts +0 -61
  1531. package/node_modules/pi-subagents/src/tui/render.d.ts.map +0 -1
  1532. package/node_modules/pi-subagents/src/tui/render.js +0 -3677
  1533. package/node_modules/pi-subagents/src/tui/render.js.map +0 -1
  1534. package/node_modules/pi-subagents/src/tui/running-tone.d.ts +0 -11
  1535. package/node_modules/pi-subagents/src/tui/running-tone.d.ts.map +0 -1
  1536. package/node_modules/pi-subagents/src/tui/running-tone.js +0 -23
  1537. package/node_modules/pi-subagents/src/tui/running-tone.js.map +0 -1
  1538. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts +0 -23
  1539. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts.map +0 -1
  1540. package/node_modules/pi-subagents/src/tui/subagent-messages.js +0 -270
  1541. package/node_modules/pi-subagents/src/tui/subagent-messages.js.map +0 -1
  1542. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts +0 -8
  1543. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts.map +0 -1
  1544. package/node_modules/pi-subagents/src/watchdog/change-signature.js +0 -244
  1545. package/node_modules/pi-subagents/src/watchdog/change-signature.js.map +0 -1
  1546. package/node_modules/pi-subagents/src/watchdog/child-status.d.ts +0 -54
  1547. package/node_modules/pi-subagents/src/watchdog/child-status.d.ts.map +0 -1
  1548. package/node_modules/pi-subagents/src/watchdog/child-status.js +0 -188
  1549. package/node_modules/pi-subagents/src/watchdog/child-status.js.map +0 -1
  1550. package/node_modules/pi-subagents/src/watchdog/diff-tool.d.ts +0 -26
  1551. package/node_modules/pi-subagents/src/watchdog/diff-tool.d.ts.map +0 -1
  1552. package/node_modules/pi-subagents/src/watchdog/diff-tool.js +0 -99
  1553. package/node_modules/pi-subagents/src/watchdog/diff-tool.js.map +0 -1
  1554. package/node_modules/pi-subagents/src/watchdog/emission-guard.d.ts +0 -37
  1555. package/node_modules/pi-subagents/src/watchdog/emission-guard.d.ts.map +0 -1
  1556. package/node_modules/pi-subagents/src/watchdog/emission-guard.js +0 -98
  1557. package/node_modules/pi-subagents/src/watchdog/emission-guard.js.map +0 -1
  1558. package/node_modules/pi-subagents/src/watchdog/guidance.d.ts +0 -4
  1559. package/node_modules/pi-subagents/src/watchdog/guidance.d.ts.map +0 -1
  1560. package/node_modules/pi-subagents/src/watchdog/guidance.js +0 -20
  1561. package/node_modules/pi-subagents/src/watchdog/guidance.js.map +0 -1
  1562. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.d.ts +0 -18
  1563. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.d.ts.map +0 -1
  1564. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.js +0 -490
  1565. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.js.map +0 -1
  1566. package/node_modules/pi-subagents/src/watchdog/model-selection.d.ts +0 -25
  1567. package/node_modules/pi-subagents/src/watchdog/model-selection.d.ts.map +0 -1
  1568. package/node_modules/pi-subagents/src/watchdog/model-selection.js +0 -168
  1569. package/node_modules/pi-subagents/src/watchdog/model-selection.js.map +0 -1
  1570. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.d.ts +0 -21
  1571. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.d.ts.map +0 -1
  1572. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.js +0 -136
  1573. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.js.map +0 -1
  1574. package/node_modules/pi-subagents/src/watchdog/register-child.d.ts +0 -14
  1575. package/node_modules/pi-subagents/src/watchdog/register-child.d.ts.map +0 -1
  1576. package/node_modules/pi-subagents/src/watchdog/register-child.js +0 -129
  1577. package/node_modules/pi-subagents/src/watchdog/register-child.js.map +0 -1
  1578. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts +0 -10
  1579. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts.map +0 -1
  1580. package/node_modules/pi-subagents/src/watchdog/register-main.js +0 -400
  1581. package/node_modules/pi-subagents/src/watchdog/register-main.js.map +0 -1
  1582. package/node_modules/pi-subagents/src/watchdog/render.d.ts +0 -4
  1583. package/node_modules/pi-subagents/src/watchdog/render.d.ts.map +0 -1
  1584. package/node_modules/pi-subagents/src/watchdog/render.js +0 -34
  1585. package/node_modules/pi-subagents/src/watchdog/render.js.map +0 -1
  1586. package/node_modules/pi-subagents/src/watchdog/review.d.ts +0 -37
  1587. package/node_modules/pi-subagents/src/watchdog/review.d.ts.map +0 -1
  1588. package/node_modules/pi-subagents/src/watchdog/review.js +0 -320
  1589. package/node_modules/pi-subagents/src/watchdog/review.js.map +0 -1
  1590. package/node_modules/pi-subagents/src/watchdog/rules.d.ts +0 -22
  1591. package/node_modules/pi-subagents/src/watchdog/rules.d.ts.map +0 -1
  1592. package/node_modules/pi-subagents/src/watchdog/rules.js +0 -59
  1593. package/node_modules/pi-subagents/src/watchdog/rules.js.map +0 -1
  1594. package/node_modules/pi-subagents/src/watchdog/runtime.d.ts +0 -196
  1595. package/node_modules/pi-subagents/src/watchdog/runtime.d.ts.map +0 -1
  1596. package/node_modules/pi-subagents/src/watchdog/runtime.js +0 -867
  1597. package/node_modules/pi-subagents/src/watchdog/runtime.js.map +0 -1
  1598. package/node_modules/pi-subagents/src/watchdog/scope.d.ts +0 -15
  1599. package/node_modules/pi-subagents/src/watchdog/scope.d.ts.map +0 -1
  1600. package/node_modules/pi-subagents/src/watchdog/scope.js +0 -45
  1601. package/node_modules/pi-subagents/src/watchdog/scope.js.map +0 -1
  1602. package/node_modules/pi-subagents/src/watchdog/settings.d.ts +0 -30
  1603. package/node_modules/pi-subagents/src/watchdog/settings.d.ts.map +0 -1
  1604. package/node_modules/pi-subagents/src/watchdog/settings.js +0 -481
  1605. package/node_modules/pi-subagents/src/watchdog/settings.js.map +0 -1
  1606. package/node_modules/pi-subagents/src/watchdog/tool-actions.d.ts +0 -18
  1607. package/node_modules/pi-subagents/src/watchdog/tool-actions.d.ts.map +0 -1
  1608. package/node_modules/pi-subagents/src/watchdog/tool-actions.js +0 -151
  1609. package/node_modules/pi-subagents/src/watchdog/tool-actions.js.map +0 -1
  1610. package/node_modules/pi-subagents/src/watchdog/turn-delta.d.ts +0 -16
  1611. package/node_modules/pi-subagents/src/watchdog/turn-delta.d.ts.map +0 -1
  1612. package/node_modules/pi-subagents/src/watchdog/turn-delta.js +0 -189
  1613. package/node_modules/pi-subagents/src/watchdog/turn-delta.js.map +0 -1
  1614. package/node_modules/pi-subagents/src/watchdog/types.d.ts +0 -142
  1615. package/node_modules/pi-subagents/src/watchdog/types.d.ts.map +0 -1
  1616. package/node_modules/pi-subagents/src/watchdog/types.js +0 -28
  1617. package/node_modules/pi-subagents/src/watchdog/types.js.map +0 -1
  1618. package/node_modules/pi-subagents/src/watchdog/warning-format.d.ts +0 -8
  1619. package/node_modules/pi-subagents/src/watchdog/warning-format.d.ts.map +0 -1
  1620. package/node_modules/pi-subagents/src/watchdog/warning-format.js +0 -60
  1621. package/node_modules/pi-subagents/src/watchdog/warning-format.js.map +0 -1
  1622. package/node_modules/pi-subagents/src/workflows/chat-progress.d.ts +0 -38
  1623. package/node_modules/pi-subagents/src/workflows/chat-progress.d.ts.map +0 -1
  1624. package/node_modules/pi-subagents/src/workflows/chat-progress.js +0 -130
  1625. package/node_modules/pi-subagents/src/workflows/chat-progress.js.map +0 -1
  1626. package/node_modules/pi-subagents/src/workflows/host-command.d.ts +0 -31
  1627. package/node_modules/pi-subagents/src/workflows/host-command.d.ts.map +0 -1
  1628. package/node_modules/pi-subagents/src/workflows/host-command.js +0 -228
  1629. package/node_modules/pi-subagents/src/workflows/host-command.js.map +0 -1
  1630. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts +0 -205
  1631. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts.map +0 -1
  1632. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js +0 -2730
  1633. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js.map +0 -1
  1634. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.d.ts +0 -10
  1635. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.d.ts.map +0 -1
  1636. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.js +0 -166
  1637. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.js.map +0 -1
  1638. package/node_modules/pi-subagents/src/workflows/workflow-checklist.d.ts +0 -128
  1639. package/node_modules/pi-subagents/src/workflows/workflow-checklist.d.ts.map +0 -1
  1640. package/node_modules/pi-subagents/src/workflows/workflow-checklist.js +0 -315
  1641. package/node_modules/pi-subagents/src/workflows/workflow-checklist.js.map +0 -1
  1642. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.d.ts +0 -20
  1643. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.d.ts.map +0 -1
  1644. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.js +0 -179
  1645. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.js.map +0 -1
  1646. package/node_modules/pi-subagents/src/workflows/workflow-preflight.d.ts +0 -59
  1647. package/node_modules/pi-subagents/src/workflows/workflow-preflight.d.ts.map +0 -1
  1648. package/node_modules/pi-subagents/src/workflows/workflow-preflight.js +0 -289
  1649. package/node_modules/pi-subagents/src/workflows/workflow-preflight.js.map +0 -1
  1650. package/node_modules/pi-subagents/src/workflows/workflow-receipt.d.ts +0 -35
  1651. package/node_modules/pi-subagents/src/workflows/workflow-receipt.d.ts.map +0 -1
  1652. package/node_modules/pi-subagents/src/workflows/workflow-receipt.js +0 -455
  1653. package/node_modules/pi-subagents/src/workflows/workflow-receipt.js.map +0 -1
  1654. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts +0 -56
  1655. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts.map +0 -1
  1656. package/node_modules/pi-subagents/src/workflows/workflow-resources.js +0 -272
  1657. package/node_modules/pi-subagents/src/workflows/workflow-resources.js.map +0 -1
  1658. package/node_modules/pi-subagents/src/workflows/workflow-reuse.d.ts +0 -51
  1659. package/node_modules/pi-subagents/src/workflows/workflow-reuse.d.ts.map +0 -1
  1660. package/node_modules/pi-subagents/src/workflows/workflow-reuse.js +0 -103
  1661. package/node_modules/pi-subagents/src/workflows/workflow-reuse.js.map +0 -1
  1662. package/node_modules/pi-subagents/src/workflows/workflow-revival.d.ts +0 -32
  1663. package/node_modules/pi-subagents/src/workflows/workflow-revival.d.ts.map +0 -1
  1664. package/node_modules/pi-subagents/src/workflows/workflow-revival.js +0 -111
  1665. package/node_modules/pi-subagents/src/workflows/workflow-revival.js.map +0 -1
  1666. package/node_modules/pi-subagents/src/workflows/workflow-settlement.d.ts +0 -85
  1667. package/node_modules/pi-subagents/src/workflows/workflow-settlement.d.ts.map +0 -1
  1668. package/node_modules/pi-subagents/src/workflows/workflow-settlement.js +0 -204
  1669. package/node_modules/pi-subagents/src/workflows/workflow-settlement.js.map +0 -1
  1670. package/node_modules/undici/LICENSE +0 -21
  1671. package/node_modules/undici/README.md +0 -797
  1672. package/node_modules/undici/docs/docs/api/Agent.md +0 -291
  1673. package/node_modules/undici/docs/docs/api/BalancedPool.md +0 -297
  1674. package/node_modules/undici/docs/docs/api/CacheStorage.md +0 -188
  1675. package/node_modules/undici/docs/docs/api/CacheStore.md +0 -360
  1676. package/node_modules/undici/docs/docs/api/Client.md +0 -533
  1677. package/node_modules/undici/docs/docs/api/ClientStats.md +0 -93
  1678. package/node_modules/undici/docs/docs/api/Connector.md +0 -198
  1679. package/node_modules/undici/docs/docs/api/ContentType.md +0 -97
  1680. package/node_modules/undici/docs/docs/api/Cookies.md +0 -179
  1681. package/node_modules/undici/docs/docs/api/Debug.md +0 -78
  1682. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +0 -515
  1683. package/node_modules/undici/docs/docs/api/Dispatcher.md +0 -827
  1684. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +0 -171
  1685. package/node_modules/undici/docs/docs/api/Errors.md +0 -524
  1686. package/node_modules/undici/docs/docs/api/EventSource.md +0 -358
  1687. package/node_modules/undici/docs/docs/api/Fetch.md +0 -711
  1688. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -121
  1689. package/node_modules/undici/docs/docs/api/H2CClient.md +0 -385
  1690. package/node_modules/undici/docs/docs/api/Interceptors.md +0 -418
  1691. package/node_modules/undici/docs/docs/api/MockAgent.md +0 -622
  1692. package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -371
  1693. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -206
  1694. package/node_modules/undici/docs/docs/api/MockClient.md +0 -199
  1695. package/node_modules/undici/docs/docs/api/MockErrors.md +0 -63
  1696. package/node_modules/undici/docs/docs/api/MockPool.md +0 -618
  1697. package/node_modules/undici/docs/docs/api/Pool.md +0 -279
  1698. package/node_modules/undici/docs/docs/api/PoolStats.md +0 -141
  1699. package/node_modules/undici/docs/docs/api/ProxyAgent.md +0 -248
  1700. package/node_modules/undici/docs/docs/api/RedirectHandler.md +0 -276
  1701. package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -136
  1702. package/node_modules/undici/docs/docs/api/RetryHandler.md +0 -200
  1703. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -239
  1704. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -361
  1705. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -256
  1706. package/node_modules/undici/docs/docs/api/Util.md +0 -82
  1707. package/node_modules/undici/docs/docs/api/WebSocket.md +0 -536
  1708. package/node_modules/undici/docs/docs/api/api-lifecycle.md +0 -159
  1709. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -66
  1710. package/node_modules/undici/docs/docs/best-practices/crawling.md +0 -60
  1711. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +0 -233
  1712. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +0 -192
  1713. package/node_modules/undici/docs/docs/best-practices/proxy.md +0 -129
  1714. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +0 -226
  1715. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -65
  1716. package/node_modules/undici/docs/docs/getting-started.md +0 -281
  1717. package/node_modules/undici/docs/docs/index.md +0 -784
  1718. package/node_modules/undici/docs/docs/site.json +0 -125
  1719. package/node_modules/undici/docs/docs/type-map.json +0 -79
  1720. package/node_modules/undici/index-fetch.js +0 -65
  1721. package/node_modules/undici/index.d.ts +0 -3
  1722. package/node_modules/undici/index.js +0 -236
  1723. package/node_modules/undici/lib/api/abort-signal.js +0 -59
  1724. package/node_modules/undici/lib/api/api-connect.js +0 -112
  1725. package/node_modules/undici/lib/api/api-pipeline.js +0 -265
  1726. package/node_modules/undici/lib/api/api-request.js +0 -244
  1727. package/node_modules/undici/lib/api/api-stream.js +0 -270
  1728. package/node_modules/undici/lib/api/api-upgrade.js +0 -121
  1729. package/node_modules/undici/lib/api/index.js +0 -7
  1730. package/node_modules/undici/lib/api/readable.js +0 -616
  1731. package/node_modules/undici/lib/cache/memory-cache-store.js +0 -279
  1732. package/node_modules/undici/lib/cache/sqlite-cache-store.js +0 -469
  1733. package/node_modules/undici/lib/core/connect.js +0 -192
  1734. package/node_modules/undici/lib/core/constants.js +0 -120
  1735. package/node_modules/undici/lib/core/diagnostics.js +0 -227
  1736. package/node_modules/undici/lib/core/errors.js +0 -497
  1737. package/node_modules/undici/lib/core/request.js +0 -546
  1738. package/node_modules/undici/lib/core/socks5-client.js +0 -422
  1739. package/node_modules/undici/lib/core/socks5-utils.js +0 -212
  1740. package/node_modules/undici/lib/core/symbols.js +0 -79
  1741. package/node_modules/undici/lib/core/tree.js +0 -160
  1742. package/node_modules/undici/lib/core/util.js +0 -1049
  1743. package/node_modules/undici/lib/dispatcher/agent.js +0 -177
  1744. package/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -217
  1745. package/node_modules/undici/lib/dispatcher/client-h1.js +0 -1801
  1746. package/node_modules/undici/lib/dispatcher/client-h2.js +0 -1781
  1747. package/node_modules/undici/lib/dispatcher/client.js +0 -741
  1748. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -197
  1749. package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -58
  1750. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -110
  1751. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -175
  1752. package/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -135
  1753. package/node_modules/undici/lib/dispatcher/h2c-client.js +0 -51
  1754. package/node_modules/undici/lib/dispatcher/pool-base.js +0 -232
  1755. package/node_modules/undici/lib/dispatcher/pool.js +0 -143
  1756. package/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -395
  1757. package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -38
  1758. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +0 -159
  1759. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +0 -350
  1760. package/node_modules/undici/lib/encoding/index.js +0 -33
  1761. package/node_modules/undici/lib/global.js +0 -82
  1762. package/node_modules/undici/lib/handler/cache-handler.js +0 -818
  1763. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +0 -134
  1764. package/node_modules/undici/lib/handler/decorator-handler.js +0 -72
  1765. package/node_modules/undici/lib/handler/deduplication-handler.js +0 -466
  1766. package/node_modules/undici/lib/handler/redirect-handler.js +0 -238
  1767. package/node_modules/undici/lib/handler/retry-handler.js +0 -594
  1768. package/node_modules/undici/lib/interceptor/cache.js +0 -671
  1769. package/node_modules/undici/lib/interceptor/decompress.js +0 -394
  1770. package/node_modules/undici/lib/interceptor/deduplicate.js +0 -118
  1771. package/node_modules/undici/lib/interceptor/dns.js +0 -582
  1772. package/node_modules/undici/lib/interceptor/dump.js +0 -99
  1773. package/node_modules/undici/lib/interceptor/redirect.js +0 -21
  1774. package/node_modules/undici/lib/interceptor/response-error.js +0 -95
  1775. package/node_modules/undici/lib/interceptor/retry.js +0 -19
  1776. package/node_modules/undici/lib/llhttp/constants.d.ts +0 -195
  1777. package/node_modules/undici/lib/llhttp/constants.js +0 -531
  1778. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -15
  1779. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -15
  1780. package/node_modules/undici/lib/llhttp/utils.d.ts +0 -2
  1781. package/node_modules/undici/lib/llhttp/utils.js +0 -12
  1782. package/node_modules/undici/lib/mock/mock-agent.js +0 -244
  1783. package/node_modules/undici/lib/mock/mock-call-history.js +0 -248
  1784. package/node_modules/undici/lib/mock/mock-client.js +0 -68
  1785. package/node_modules/undici/lib/mock/mock-errors.js +0 -29
  1786. package/node_modules/undici/lib/mock/mock-interceptor.js +0 -227
  1787. package/node_modules/undici/lib/mock/mock-pool.js +0 -68
  1788. package/node_modules/undici/lib/mock/mock-symbols.js +0 -32
  1789. package/node_modules/undici/lib/mock/mock-utils.js +0 -720
  1790. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  1791. package/node_modules/undici/lib/mock/snapshot-agent.js +0 -371
  1792. package/node_modules/undici/lib/mock/snapshot-recorder.js +0 -623
  1793. package/node_modules/undici/lib/mock/snapshot-utils.js +0 -158
  1794. package/node_modules/undici/lib/util/cache.js +0 -758
  1795. package/node_modules/undici/lib/util/date.js +0 -670
  1796. package/node_modules/undici/lib/util/runtime-features.js +0 -93
  1797. package/node_modules/undici/lib/util/stats.js +0 -32
  1798. package/node_modules/undici/lib/util/timers.js +0 -425
  1799. package/node_modules/undici/lib/web/cache/cache.js +0 -862
  1800. package/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  1801. package/node_modules/undici/lib/web/cache/util.js +0 -45
  1802. package/node_modules/undici/lib/web/cookies/constants.js +0 -12
  1803. package/node_modules/undici/lib/web/cookies/index.js +0 -199
  1804. package/node_modules/undici/lib/web/cookies/parse.js +0 -318
  1805. package/node_modules/undici/lib/web/cookies/util.js +0 -352
  1806. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -521
  1807. package/node_modules/undici/lib/web/eventsource/eventsource.js +0 -500
  1808. package/node_modules/undici/lib/web/eventsource/util.js +0 -60
  1809. package/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  1810. package/node_modules/undici/lib/web/fetch/body.js +0 -547
  1811. package/node_modules/undici/lib/web/fetch/constants.js +0 -131
  1812. package/node_modules/undici/lib/web/fetch/data-url.js +0 -596
  1813. package/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -586
  1814. package/node_modules/undici/lib/web/fetch/formdata.js +0 -278
  1815. package/node_modules/undici/lib/web/fetch/global.js +0 -40
  1816. package/node_modules/undici/lib/web/fetch/headers.js +0 -719
  1817. package/node_modules/undici/lib/web/fetch/index.js +0 -2432
  1818. package/node_modules/undici/lib/web/fetch/request.js +0 -1144
  1819. package/node_modules/undici/lib/web/fetch/response.js +0 -639
  1820. package/node_modules/undici/lib/web/fetch/util.js +0 -1530
  1821. package/node_modules/undici/lib/web/infra/index.js +0 -229
  1822. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +0 -9
  1823. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +0 -307
  1824. package/node_modules/undici/lib/web/webidl/index.js +0 -1004
  1825. package/node_modules/undici/lib/web/websocket/connection.js +0 -329
  1826. package/node_modules/undici/lib/web/websocket/constants.js +0 -126
  1827. package/node_modules/undici/lib/web/websocket/events.js +0 -331
  1828. package/node_modules/undici/lib/web/websocket/frame.js +0 -127
  1829. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -105
  1830. package/node_modules/undici/lib/web/websocket/receiver.js +0 -507
  1831. package/node_modules/undici/lib/web/websocket/sender.js +0 -109
  1832. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +0 -104
  1833. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +0 -496
  1834. package/node_modules/undici/lib/web/websocket/util.js +0 -347
  1835. package/node_modules/undici/lib/web/websocket/websocket.js +0 -780
  1836. package/node_modules/undici/package.json +0 -152
  1837. package/node_modules/undici/scripts/strip-comments.js +0 -10
  1838. package/node_modules/undici/types/README.md +0 -6
  1839. package/node_modules/undici/types/agent.d.ts +0 -30
  1840. package/node_modules/undici/types/api.d.ts +0 -43
  1841. package/node_modules/undici/types/balanced-pool.d.ts +0 -30
  1842. package/node_modules/undici/types/cache-interceptor.d.ts +0 -179
  1843. package/node_modules/undici/types/cache.d.ts +0 -36
  1844. package/node_modules/undici/types/client-stats.d.ts +0 -15
  1845. package/node_modules/undici/types/client.d.ts +0 -184
  1846. package/node_modules/undici/types/connector.d.ts +0 -37
  1847. package/node_modules/undici/types/content-type.d.ts +0 -21
  1848. package/node_modules/undici/types/cookies.d.ts +0 -30
  1849. package/node_modules/undici/types/diagnostics-channel.d.ts +0 -74
  1850. package/node_modules/undici/types/dispatcher.d.ts +0 -253
  1851. package/node_modules/undici/types/dispatcher1-wrapper.d.ts +0 -7
  1852. package/node_modules/undici/types/env-http-proxy-agent.d.ts +0 -22
  1853. package/node_modules/undici/types/errors.d.ts +0 -187
  1854. package/node_modules/undici/types/eventsource.d.ts +0 -66
  1855. package/node_modules/undici/types/fetch.d.ts +0 -235
  1856. package/node_modules/undici/types/formdata.d.ts +0 -108
  1857. package/node_modules/undici/types/global-dispatcher.d.ts +0 -9
  1858. package/node_modules/undici/types/global-origin.d.ts +0 -7
  1859. package/node_modules/undici/types/h2c-client.d.ts +0 -73
  1860. package/node_modules/undici/types/handlers.d.ts +0 -16
  1861. package/node_modules/undici/types/header.d.ts +0 -165
  1862. package/node_modules/undici/types/index.d.ts +0 -93
  1863. package/node_modules/undici/types/interceptors.d.ts +0 -82
  1864. package/node_modules/undici/types/mock-agent.d.ts +0 -69
  1865. package/node_modules/undici/types/mock-call-history.d.ts +0 -111
  1866. package/node_modules/undici/types/mock-client.d.ts +0 -27
  1867. package/node_modules/undici/types/mock-errors.d.ts +0 -12
  1868. package/node_modules/undici/types/mock-interceptor.d.ts +0 -98
  1869. package/node_modules/undici/types/mock-pool.d.ts +0 -27
  1870. package/node_modules/undici/types/patch.d.ts +0 -29
  1871. package/node_modules/undici/types/pool-stats.d.ts +0 -19
  1872. package/node_modules/undici/types/pool.d.ts +0 -39
  1873. package/node_modules/undici/types/proxy-agent.d.ts +0 -36
  1874. package/node_modules/undici/types/readable.d.ts +0 -68
  1875. package/node_modules/undici/types/retry-agent.d.ts +0 -8
  1876. package/node_modules/undici/types/retry-handler.d.ts +0 -125
  1877. package/node_modules/undici/types/round-robin-pool.d.ts +0 -39
  1878. package/node_modules/undici/types/snapshot-agent.d.ts +0 -113
  1879. package/node_modules/undici/types/socks5-proxy-agent.d.ts +0 -27
  1880. package/node_modules/undici/types/util.d.ts +0 -18
  1881. package/node_modules/undici/types/utility.d.ts +0 -7
  1882. package/node_modules/undici/types/webidl.d.ts +0 -346
  1883. package/node_modules/undici/types/websocket.d.ts +0 -188
  1884. package/src/tools/utils/pi-subagent-delegation.ts +0 -121
@@ -1,2424 +0,0 @@
1
- import * as ES from './ecmascript';
2
- import { DefineIntrinsic } from './intrinsicclass';
3
- import type { Temporal } from '..';
4
- import type {
5
- BuiltinCalendarId,
6
- CalendarDateRecord,
7
- CalendarFieldsRecord,
8
- CalendarYMD,
9
- DateDuration,
10
- FieldKey,
11
- ISODate,
12
- ISODateToFieldsType,
13
- MonthDayFromFieldsObject,
14
- Overflow,
15
- Resolve
16
- } from './internaltypes';
17
-
18
- function arrayFromSet<T>(src: Set<T>): T[] {
19
- return [...src];
20
- }
21
-
22
- function calendarDateWeekOfYear(id: BuiltinCalendarId, isoDate: ISODate): { week: number; year: number } | undefined {
23
- // Supports only Gregorian and ISO8601 calendar; can be updated to add support for other calendars.
24
- // Returns undefined for calendars without a well-defined week calendar system.
25
- // eslint-disable-next-line max-len
26
- // Also see: https://github.com/unicode-org/icu/blob/ab72ab1d4a3c3f9beeb7d92b0c7817ca93dfdb04/icu4c/source/i18n/calendar.cpp#L1606
27
- if (id !== 'gregory' && id !== 'iso8601') return undefined;
28
- const calendar = impl[id];
29
- let yow = isoDate.year;
30
- const { dayOfWeek, dayOfYear, daysInYear } = calendar.isoToDate(isoDate, {
31
- dayOfWeek: true,
32
- dayOfYear: true,
33
- daysInYear: true
34
- });
35
- const fdow = calendar.getFirstDayOfWeek();
36
- const mdow = calendar.getMinimalDaysInFirstWeek();
37
- ES.uncheckedAssertNarrowedType<number>(fdow, 'guaranteed to exist for iso8601/gregory');
38
- ES.uncheckedAssertNarrowedType<number>(mdow, 'guaranteed to exist for iso8601/gregory');
39
-
40
- // For both the input date and the first day of its calendar year, calculate the day of week
41
- // relative to first day of week in the relevant calendar (e.g., in iso8601, relative to Monday).
42
- let relDow = (dayOfWeek + 7 - fdow) % 7;
43
- // Assuming the year length is less than 7000 days.
44
- let relDowJan1 = (dayOfWeek - dayOfYear + 7001 - fdow) % 7;
45
-
46
- let woy = Math.floor((dayOfYear - 1 + relDowJan1) / 7);
47
- if (7 - relDowJan1 >= mdow) {
48
- ++woy;
49
- }
50
-
51
- // Adjust for weeks at the year end that overlap into the previous or next calendar year.
52
- if (woy == 0) {
53
- // Check for last week of previous year; if true, handle the case for
54
- // first week of next year
55
- const prevYearCalendar = calendar.isoToDate(calendar.dateAdd(isoDate, { years: -1 }, 'constrain'), {
56
- daysInYear: true
57
- });
58
- let prevDoy = dayOfYear + prevYearCalendar.daysInYear;
59
- woy = weekNumber(fdow, mdow, prevDoy, dayOfWeek);
60
- yow--;
61
- } else {
62
- // For it to be week 1 of the next year, dayOfYear must be >= lastDoy - 5
63
- // L-5 L
64
- // doy: 359 360 361 362 363 364 365 001
65
- // dow: 1 2 3 4 5 6 7
66
- let lastDoy = daysInYear;
67
- if (dayOfYear >= lastDoy - 5) {
68
- let lastRelDow = (relDow + lastDoy - dayOfYear) % 7;
69
- if (lastRelDow < 0) {
70
- lastRelDow += 7;
71
- }
72
- if (6 - lastRelDow >= mdow && dayOfYear + 7 - relDow > lastDoy) {
73
- woy = 1;
74
- yow++;
75
- }
76
- }
77
- }
78
- return { week: woy, year: yow };
79
- }
80
-
81
- function ISODateSurpasses(sign: -1 | 0 | 1, y1: number, m1: number, d1: number, isoDate2: ISODate) {
82
- if (y1 !== isoDate2.year) {
83
- if (sign * (y1 - isoDate2.year) > 0) return true;
84
- } else if (m1 !== isoDate2.month) {
85
- if (sign * (m1 - isoDate2.month) > 0) return true;
86
- } else if (d1 !== isoDate2.day) {
87
- if (sign * (d1 - isoDate2.day) > 0) return true;
88
- }
89
- return false;
90
- }
91
-
92
- type ResolveFieldsReturn<Type extends ISODateToFieldsType> = Resolve<
93
- CalendarFieldsRecord & {
94
- year: Type extends 'date' ? number : never;
95
- month: number;
96
- monthCode: string;
97
- day: number;
98
- }
99
- >;
100
-
101
- /**
102
- * Shape of internal implementation of each built-in calendar. Note that
103
- * parameter types are simpler than CalendarProtocol because the `Calendar`
104
- * class performs validation and parameter normalization before handing control
105
- * over to CalendarImpl.
106
- *
107
- * There are two instances of this interface: one for the ISO calendar and
108
- * another that handles logic that's the same across all non-ISO calendars. The
109
- * latter is cloned for each non-ISO calendar at the end of this file.
110
- */
111
- export interface CalendarImpl {
112
- isoToDate<
113
- Request extends Partial<Record<keyof CalendarDateRecord, true>>,
114
- T extends {
115
- [Field in keyof CalendarDateRecord]: Request extends { [K in Field]: true } ? CalendarDateRecord[Field] : never;
116
- }
117
- >(
118
- isoDate: ISODate,
119
- requestedFields: Request
120
- ): T;
121
- getFirstDayOfWeek(): number | undefined;
122
- getMinimalDaysInFirstWeek(): number | undefined;
123
- resolveFields<Type extends ISODateToFieldsType>(
124
- fields: CalendarFieldsRecord,
125
- type: Type
126
- ): asserts fields is ResolveFieldsReturn<Type>;
127
- dateToISO(fields: ResolveFieldsReturn<'date'>, overflow: Overflow): ISODate;
128
- monthDayToISOReferenceDate(fields: ResolveFieldsReturn<'month-day'>, overflow: Overflow): ISODate;
129
- dateAdd(date: ISODate, duration: Partial<DateDuration>, overflow: Overflow): ISODate;
130
- dateUntil(one: ISODate, two: ISODate, largestUnit: 'year' | 'month' | 'week' | 'day'): DateDuration;
131
- extraFields(fields: FieldKey[]): FieldKey[];
132
- fieldKeysToIgnore(keys: FieldKey[]): FieldKey[];
133
- }
134
-
135
- type CalendarImplementations = {
136
- [k in BuiltinCalendarId]: CalendarImpl;
137
- };
138
-
139
- /**
140
- * Implementations for each calendar.
141
- * Registration for each of these calendars happens throughout this file. The ISO and non-ISO calendars are registered
142
- * separately - look for 'iso8601' for the ISO calendar registration, and all non-ISO calendar registrations happens
143
- * at the bottom of the file.
144
- */
145
- const impl: CalendarImplementations = {} as unknown as CalendarImplementations;
146
-
147
- /**
148
- * Implementation for the ISO 8601 calendar. This is the only calendar that's
149
- * guaranteed to be supported by all ECMAScript implementations, including those
150
- * without Intl (ECMA-402) support.
151
- */
152
- impl['iso8601'] = {
153
- resolveFields(fields, type) {
154
- if ((type === 'date' || type === 'year-month') && fields.year === undefined) {
155
- throw new TypeError('year is required');
156
- }
157
- if ((type === 'date' || type === 'month-day') && fields.day === undefined) {
158
- throw new TypeError('day is required');
159
- }
160
- Object.assign(fields, resolveNonLunisolarMonth(fields));
161
- },
162
- dateToISO(fields, overflow) {
163
- return ES.RegulateISODate(fields.year, fields.month, fields.day, overflow);
164
- },
165
- monthDayToISOReferenceDate(fields, overflow) {
166
- const referenceISOYear = 1972;
167
- const { month, day } = ES.RegulateISODate(fields.year ?? referenceISOYear, fields.month, fields.day, overflow);
168
- return { month, day, year: referenceISOYear };
169
- },
170
- extraFields() {
171
- return [];
172
- },
173
- fieldKeysToIgnore(keys) {
174
- const result = new Set<FieldKey>();
175
- for (let ix = 0; ix < keys.length; ix++) {
176
- const key = keys[ix];
177
- result.add(key);
178
- if (key === 'month') {
179
- result.add('monthCode');
180
- } else if (key === 'monthCode') {
181
- result.add('month');
182
- }
183
- }
184
- return arrayFromSet(result);
185
- },
186
- dateAdd(isoDate, { years = 0, months = 0, weeks = 0, days = 0 }, overflow) {
187
- let { year, month, day } = isoDate;
188
- year += years;
189
- month += months;
190
- ({ year, month } = ES.BalanceISOYearMonth(year, month));
191
- ({ year, month, day } = ES.RegulateISODate(year, month, day, overflow));
192
- day += days + 7 * weeks;
193
- return ES.BalanceISODate(year, month, day);
194
- },
195
- dateUntil(one, two, largestUnit) {
196
- const sign = -ES.CompareISODate(one, two);
197
- if (sign === 0) return { years: 0, months: 0, weeks: 0, days: 0 };
198
- ES.uncheckedAssertNarrowedType<-1 | 1>(sign, "the - operator's return type is number");
199
-
200
- let years = 0;
201
- let months = 0;
202
- let intermediate;
203
- if (largestUnit === 'year' || largestUnit === 'month') {
204
- // We can skip right to the neighbourhood of the correct number of years,
205
- // it'll be at least one less than two.year - one.year (unless it's zero)
206
- let candidateYears = two.year - one.year;
207
- if (candidateYears !== 0) candidateYears -= sign;
208
- // loops at most twice
209
- while (!ISODateSurpasses(sign, one.year + candidateYears, one.month, one.day, two)) {
210
- years = candidateYears;
211
- candidateYears += sign;
212
- }
213
-
214
- let candidateMonths = sign;
215
- intermediate = ES.BalanceISOYearMonth(one.year + years, one.month + candidateMonths);
216
- // loops at most 12 times
217
- while (!ISODateSurpasses(sign, intermediate.year, intermediate.month, one.day, two)) {
218
- months = candidateMonths;
219
- candidateMonths += sign;
220
- intermediate = ES.BalanceISOYearMonth(intermediate.year, intermediate.month + sign);
221
- }
222
-
223
- if (largestUnit === 'month') {
224
- months += years * 12;
225
- years = 0;
226
- }
227
- }
228
-
229
- intermediate = ES.BalanceISOYearMonth(one.year + years, one.month + months);
230
- const constrained = ES.ConstrainISODate(intermediate.year, intermediate.month, one.day);
231
-
232
- let weeks = 0;
233
- let days =
234
- ES.ISODateToEpochDays(two.year, two.month - 1, two.day) -
235
- ES.ISODateToEpochDays(constrained.year, constrained.month - 1, constrained.day);
236
-
237
- if (largestUnit === 'week') {
238
- weeks = Math.trunc(days / 7);
239
- days %= 7;
240
- }
241
-
242
- return { years, months, weeks, days };
243
- },
244
- isoToDate<
245
- Request extends Partial<Record<keyof CalendarDateRecord, true>>,
246
- T extends {
247
- [Field in keyof CalendarDateRecord]: Request extends { [K in Field]: true } ? CalendarDateRecord[Field] : never;
248
- }
249
- >({ year, month, day }: ISODate, requestedFields: Request): T {
250
- // requestedFields parameter is not part of the spec text. It's an
251
- // illustration of one way implementations may choose to optimize this
252
- // operation.
253
- const date: Partial<CalendarDateRecord> = {
254
- era: undefined,
255
- eraYear: undefined,
256
- year,
257
- month,
258
- day,
259
- daysInWeek: 7,
260
- monthsInYear: 12
261
- };
262
- if (requestedFields.monthCode) date.monthCode = buildMonthCode(month);
263
- if (requestedFields.dayOfWeek) {
264
- // https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Disparate_variation
265
- const shiftedMonth = month + (month < 3 ? 10 : -2);
266
- const shiftedYear = year - (month < 3 ? 1 : 0);
267
-
268
- const century = Math.floor(shiftedYear / 100);
269
- const yearInCentury = shiftedYear - century * 100;
270
-
271
- const monthTerm = Math.floor(2.6 * shiftedMonth - 0.2);
272
- const yearTerm = yearInCentury + Math.floor(yearInCentury / 4);
273
- const centuryTerm = Math.floor(century / 4) - 2 * century;
274
-
275
- const dow = (day + monthTerm + yearTerm + centuryTerm) % 7;
276
-
277
- date.dayOfWeek = dow + (dow <= 0 ? 7 : 0);
278
- }
279
- if (requestedFields.dayOfYear) {
280
- let days = day;
281
- for (let m = month - 1; m > 0; m--) {
282
- days += ES.ISODaysInMonth(year, m);
283
- }
284
- date.dayOfYear = days;
285
- }
286
- if (requestedFields.weekOfYear) date.weekOfYear = calendarDateWeekOfYear('iso8601', { year, month, day });
287
- if (requestedFields.daysInMonth) date.daysInMonth = ES.ISODaysInMonth(year, month);
288
- if (requestedFields.daysInYear || requestedFields.inLeapYear) {
289
- date.inLeapYear = ES.LeapYear(year);
290
- date.daysInYear = date.inLeapYear ? 366 : 365;
291
- }
292
- return date as T;
293
- },
294
- getFirstDayOfWeek() {
295
- return 1;
296
- },
297
- getMinimalDaysInFirstWeek() {
298
- return 4;
299
- }
300
- };
301
-
302
- // Note: Built-in calendars other than iso8601 are not part of the Temporal
303
- // proposal for ECMA-262. These calendars will be standardized as part of
304
- // ECMA-402. Code below here includes an implementation of these calendars to
305
- // validate the Temporal API and to get feedback. However, native non-ISO
306
- // calendar behavior is at least somewhat implementation-defined, so may not
307
- // match this polyfill's output exactly.
308
- //
309
- // Some ES implementations don't include ECMA-402. For this reason, it's helpful
310
- // to ensure a clean separation between the ISO calendar implementation which is
311
- // a part of ECMA-262 and the non-ISO calendar implementation which requires
312
- // ECMA-402.
313
- //
314
- // To ensure this separation, the implementation is split. A `CalendarImpl`
315
- // interface defines the common operations between both ISO and non-ISO
316
- // calendars.
317
-
318
- /**
319
- * This type is passed through from CalendarImpl#dateFromFields().
320
- * `monthExtra` is additional information used internally to identify lunisolar leap months.
321
- */
322
- type CalendarDateFields = CalendarFieldsRecord & { monthExtra?: string };
323
-
324
- /**
325
- * This is a "fully populated" calendar date record. It's only lacking
326
- * `era`/`eraYear` (which may not be present in all calendars) and `monthExtra`
327
- * which is only used in some cases.
328
- */
329
- type FullCalendarDate = {
330
- era?: string;
331
- eraYear?: number;
332
- year: number;
333
- month: number;
334
- monthCode: string;
335
- day: number;
336
- monthExtra?: string;
337
- };
338
-
339
- // The types below are various subsets of calendar dates
340
- type CalendarYM = { year: number; month: number };
341
- type CalendarYearOnly = { year: number };
342
- type EraAndEraYear = { era: string; eraYear: number };
343
-
344
- function nonLeapMonthCodeNumberPart(monthCode: string) {
345
- if (!monthCode.startsWith('M')) {
346
- throw new RangeError(`Invalid month code: ${monthCode}. Month codes must start with M.`);
347
- }
348
- const month = +monthCode.slice(1);
349
- if (Number.isNaN(month)) throw new RangeError(`Invalid month code: ${monthCode}`);
350
- return month;
351
- }
352
-
353
- function buildMonthCode(month: number, leap = false) {
354
- const digitPart = `${month}`.padStart(2, '0');
355
- const leapMarker = leap ? 'L' : '';
356
- return `M${digitPart}${leapMarker}`;
357
- }
358
-
359
- /**
360
- * Safely merge a month, monthCode pair into an integer month.
361
- * If both are present, make sure they match.
362
- * This logic doesn't work for lunisolar calendars!
363
- * */
364
- function resolveNonLunisolarMonth<T extends { monthCode?: string; month?: number }>(
365
- calendarDate: T,
366
- overflow: Overflow | undefined = undefined,
367
- monthsPerYear = 12
368
- ) {
369
- let { month, monthCode } = calendarDate;
370
- if (monthCode === undefined) {
371
- if (month === undefined) throw new TypeError('Either month or monthCode are required');
372
- // The ISO calendar uses the default (undefined) value because it does
373
- // constrain/reject after this method returns. Non-ISO calendars, however,
374
- // rely on this function to constrain/reject out-of-range `month` values.
375
- if (overflow === 'reject') ES.RejectToRange(month, 1, monthsPerYear);
376
- if (overflow === 'constrain') month = ES.ConstrainToRange(month, 1, monthsPerYear);
377
- monthCode = buildMonthCode(month);
378
- } else {
379
- const numberPart = nonLeapMonthCodeNumberPart(monthCode);
380
- if (monthCode !== buildMonthCode(numberPart)) {
381
- throw new RangeError(`Invalid month code: ${monthCode}`);
382
- }
383
- if (month !== undefined && month !== numberPart) {
384
- throw new RangeError(`monthCode ${monthCode} and month ${month} must match if both are present`);
385
- }
386
- month = numberPart;
387
- if (month < 1 || month > monthsPerYear) throw new RangeError(`Invalid monthCode: ${monthCode}`);
388
- }
389
- return { ...calendarDate, month, monthCode };
390
- }
391
-
392
- function weekNumber(firstDayOfWeek: number, minimalDaysInFirstWeek: number, desiredDay: number, dayOfWeek: number) {
393
- let periodStartDayOfWeek = (dayOfWeek - firstDayOfWeek - desiredDay + 1) % 7;
394
- if (periodStartDayOfWeek < 0) periodStartDayOfWeek += 7;
395
- let weekNo = Math.floor((desiredDay + periodStartDayOfWeek - 1) / 7);
396
- if (7 - periodStartDayOfWeek >= minimalDaysInFirstWeek) {
397
- ++weekNo;
398
- }
399
- return weekNo;
400
- }
401
-
402
- /**
403
- * This prototype implementation of non-ISO calendars makes many repeated calls
404
- * to Intl APIs which may be slow (e.g. >0.2ms). This trivial cache will speed
405
- * up these repeat accesses. Each cache instance is associated (via a WeakMap)
406
- * to a specific Temporal object, which speeds up multiple calendar calls on the
407
- * same Temporal object instance. No invalidation or pruning is necessary
408
- * because each object's cache is thrown away when the object is GC-ed.
409
- */
410
- class OneObjectCache {
411
- map = new Map();
412
- calls = 0;
413
- // now = OneObjectCache.monotonicTimestamp();
414
- hits = 0;
415
- misses = 0;
416
-
417
- // static monotonicTimestamp() {
418
- // return performance?.now() ?? Date.now();
419
- // }
420
-
421
- constructor(cacheToClone?: OneObjectCache) {
422
- if (cacheToClone !== undefined) {
423
- let i = 0;
424
- for (const entry of cacheToClone.map.entries()) {
425
- if (++i > OneObjectCache.MAX_CACHE_ENTRIES) break;
426
- this.map.set(...entry);
427
- }
428
- }
429
- }
430
- get(key: string) {
431
- const result = this.map.get(key);
432
- if (result) {
433
- this.hits++;
434
- this.report();
435
- }
436
- this.calls++;
437
- return result;
438
- }
439
- set(key: string, value: unknown) {
440
- this.map.set(key, value);
441
- this.misses++;
442
- this.report();
443
- }
444
- report() {
445
- // if (this.calls === 0) return;
446
- // const ms = OneObjectCache.monotonicTimestamp() - this.now;
447
- // const hitRate = ((100 * this.hits) / this.calls).toFixed(0);
448
- // const t = `${ms.toFixed(2)}ms`;
449
- // // eslint-disable-next-line no-console
450
- // console.log(`${this.calls} calls in ${t}. Hits: ${this.hits} (${hitRate}%). Misses: ${this.misses}.`);
451
- }
452
- setObject(obj: ISODate) {
453
- if (OneObjectCache.objectMap.get(obj)) throw new RangeError('object already cached');
454
- OneObjectCache.objectMap.set(obj, this);
455
- this.report();
456
- }
457
-
458
- static objectMap = new WeakMap();
459
- static MAX_CACHE_ENTRIES = 1000;
460
-
461
- /**
462
- * Returns a WeakMap-backed cache that's used to store expensive results
463
- * that are associated with a particular Temporal object instance.
464
- *
465
- * @param obj - object to associate with the cache
466
- */
467
- static getCacheForObject(obj: ISODate) {
468
- let cache = OneObjectCache.objectMap.get(obj);
469
- if (!cache) {
470
- cache = new OneObjectCache();
471
- OneObjectCache.objectMap.set(obj, cache);
472
- }
473
- return cache;
474
- }
475
- }
476
-
477
- function toUtcIsoDateString({ isoYear, isoMonth, isoDay }: { isoYear: number; isoMonth: number; isoDay: number }) {
478
- const yearString = ES.ISOYearString(isoYear);
479
- const monthString = ES.ISODateTimePartString(isoMonth);
480
- const dayString = ES.ISODateTimePartString(isoDay);
481
- return `${yearString}-${monthString}-${dayString}T00:00Z`;
482
- }
483
-
484
- function simpleDateDiff(one: CalendarYMD, two: CalendarYMD) {
485
- return {
486
- years: one.year - two.year,
487
- months: one.month - two.month,
488
- days: one.day - two.day
489
- };
490
- }
491
-
492
- /**
493
- * Implementation helper that's common to all non-ISO calendars
494
- */
495
- abstract class HelperBase {
496
- abstract id: BuiltinCalendarId;
497
- abstract monthsInYear(calendarDate: CalendarYearOnly, cache?: OneObjectCache): number;
498
- abstract maximumMonthLength(calendarDate?: CalendarYM): number;
499
- abstract minimumMonthLength(calendarDate?: CalendarYM): number;
500
- abstract maxLengthOfMonthCodeInAnyYear(monthCode: string): number;
501
- abstract estimateIsoDate(calendarDate: CalendarYMD): ISODate;
502
- abstract inLeapYear(calendarDate: CalendarYearOnly, cache?: OneObjectCache): boolean;
503
- abstract calendarType: 'solar' | 'lunar' | 'lunisolar';
504
- reviseIntlEra?<T extends Partial<EraAndEraYear>>(calendarDate: T, isoDate: ISODate): T;
505
- eras: Era[] = [];
506
- checkIcuBugs?(isoDate: ISODate): void;
507
- private formatter?: globalThis.Intl.DateTimeFormat;
508
- getFormatter() {
509
- // `new Intl.DateTimeFormat()` is amazingly slow and chews up RAM. Per
510
- // https://bugs.chromium.org/p/v8/issues/detail?id=6528#c4, we cache one
511
- // DateTimeFormat instance per calendar. Caching is lazy so we only pay for
512
- // calendars that are used. Note that the HelperBase class is extended to
513
- // create each calendar's implementation before any cache is created, so
514
- // each calendar gets its own separate cached formatter.
515
- if (typeof this.formatter === 'undefined') {
516
- this.formatter = new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`, {
517
- day: 'numeric',
518
- month: 'numeric',
519
- year: 'numeric',
520
- era: 'short',
521
- timeZone: 'UTC'
522
- });
523
- }
524
- return this.formatter;
525
- }
526
- getCalendarParts(isoString: string) {
527
- let dateTimeFormat = this.getFormatter();
528
- let legacyDate = new Date(isoString);
529
-
530
- // PlainDate's minimum date -271821-04-19 is one day beyond legacy Date's
531
- // minimum -271821-04-20, because of accommodating all Instants in all time
532
- // zones. If we have -271821-04-19, instead format -271821-04-20 in a time
533
- // zone that pushes the result into the previous day. This is a slow path
534
- // because we create a new Intl.DateTimeFormat.
535
- if (isoString === '-271821-04-19T00:00Z') {
536
- const options = dateTimeFormat.resolvedOptions();
537
- dateTimeFormat = new Intl.DateTimeFormat(options.locale, {
538
- ...(options as Intl.DateTimeFormatOptions),
539
- timeZone: 'Etc/GMT+1'
540
- });
541
- legacyDate = new Date('-271821-04-20T00:00Z');
542
- }
543
-
544
- try {
545
- return dateTimeFormat.formatToParts(legacyDate);
546
- } catch (e) {
547
- throw new RangeError(`Invalid ISO date: ${isoString}`);
548
- }
549
- }
550
- isoToCalendarDate(isoDate: ISODate, cache: OneObjectCache): FullCalendarDate {
551
- const { year: isoYear, month: isoMonth, day: isoDay } = isoDate;
552
- const key = JSON.stringify({ func: 'isoToCalendarDate', isoYear, isoMonth, isoDay, id: this.id });
553
- const cached = cache.get(key);
554
- if (cached) return cached;
555
-
556
- const isoString = toUtcIsoDateString({ isoYear, isoMonth, isoDay });
557
- const parts = this.getCalendarParts(isoString);
558
- const result: Partial<FullCalendarDate> = {};
559
- for (let i = 0; i < parts.length; i++) {
560
- const { type, value } = parts[i];
561
- // TODO: remove this type annotation when `relatedYear` gets into TS lib types
562
- if (type === 'year' || type === ('relatedYear' as Intl.DateTimeFormatPartTypes)) {
563
- if (this.hasEra) {
564
- result.eraYear = +value;
565
- } else {
566
- result.year = +value;
567
- }
568
- }
569
- if (type === 'month') {
570
- const matches = /^([0-9]*)(.*?)$/.exec(value);
571
- if (!matches || matches.length != 3 || (!matches[1] && !matches[2])) {
572
- throw new RangeError(`Unexpected month: ${value}`);
573
- }
574
- // If the month has no numeric part (should only see this for the Hebrew
575
- // calendar with newer FF / Chromium versions; see
576
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1751833) then set a
577
- // placeholder month index of `1` and rely on the derived class to
578
- // calculate the correct month index from the month name stored in
579
- // `monthExtra`.
580
- result.month = matches[1] ? +matches[1] : 1;
581
- if (result.month < 1) {
582
- throw new RangeError(
583
- `Invalid month ${value} from ${isoString}[u-ca-${this.id}]` +
584
- ' (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)'
585
- );
586
- }
587
- if (result.month > 13) {
588
- throw new RangeError(
589
- `Invalid month ${value} from ${isoString}[u-ca-${this.id}]` +
590
- ' (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)'
591
- );
592
- }
593
-
594
- // The ICU formats for the Hebrew calendar no longer support a numeric
595
- // month format. So we'll rely on the derived class to interpret it.
596
- // `monthExtra` is also used on the Chinese calendar to handle a suffix
597
- // "bis" indicating a leap month.
598
- if (matches[2]) result.monthExtra = matches[2];
599
- }
600
- if (type === 'day') result.day = +value;
601
- if (this.hasEra && type === 'era' && value != null && value !== '') {
602
- // The convention for Temporal era values is lowercase, so following
603
- // that convention in this prototype. Punctuation is removed, accented
604
- // letters are normalized, and spaces are replaced with dashes.
605
- // E.g.: "ERA0" => "era0", "Before R.O.C." => "before-roc", "En’ō" => "eno"
606
- // The call to normalize() and the replacement regex deals with era
607
- // names that contain non-ASCII characters like Japanese eras. Also
608
- // ignore extra content in parentheses like JPN era date ranges.
609
- result.era = value
610
- .split(' (')[0]
611
- .normalize('NFD')
612
- .replace(/[^-0-9 \p{L}]/gu, '')
613
- .replace(/ /g, '-')
614
- .toLowerCase();
615
- }
616
- }
617
- if (this.hasEra && result.eraYear === undefined) {
618
- // Node 12 has outdated ICU data that lacks the `relatedYear` field in the
619
- // output of Intl.DateTimeFormat.formatToParts.
620
- throw new RangeError(
621
- `Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`
622
- );
623
- }
624
- // Translate old ICU era codes "ERA0" etc. into canonical era names.
625
- if (this.hasEra) {
626
- const replacement = this.eras.find((e) => result.era === e.genericName);
627
- if (replacement) result.era = replacement.code;
628
- }
629
- // Translate eras that may be handled differently by Temporal vs. by Intl
630
- // (e.g. Japanese pre-Meiji eras). See https://github.com/tc39/proposal-temporal/issues/526.
631
- if (this.reviseIntlEra) {
632
- const { era, eraYear } = this.reviseIntlEra(result, isoDate);
633
- result.era = era;
634
- result.eraYear = eraYear;
635
- }
636
- if (this.checkIcuBugs) this.checkIcuBugs(isoDate);
637
-
638
- const calendarDate = this.adjustCalendarDate(result, cache, 'constrain', true);
639
- if (calendarDate.year === undefined) throw new RangeError(`Missing year converting ${JSON.stringify(isoDate)}`);
640
- if (calendarDate.month === undefined) {
641
- throw new RangeError(`Missing month converting ${JSON.stringify(isoDate)}`);
642
- }
643
- if (calendarDate.day === undefined) throw new RangeError(`Missing day converting ${JSON.stringify(isoDate)}`);
644
- cache.set(key, calendarDate);
645
- // Also cache the reverse mapping
646
- const cacheReverse = (overflow: Overflow) => {
647
- const keyReverse = JSON.stringify({
648
- func: 'calendarToIsoDate',
649
- year: calendarDate.year,
650
- month: calendarDate.month,
651
- day: calendarDate.day,
652
- overflow,
653
- id: this.id
654
- });
655
- cache.set(keyReverse, isoDate);
656
- };
657
- (['constrain', 'reject'] as const).forEach(cacheReverse);
658
- return calendarDate;
659
- }
660
- validateCalendarDate(calendarDate: Partial<FullCalendarDate>): asserts calendarDate is FullCalendarDate {
661
- const { month, year, day, eraYear, monthCode, monthExtra } = calendarDate;
662
- // When there's a suffix (e.g. "5bis" for a leap month in Chinese calendar)
663
- // the derived class must deal with it.
664
- if (monthExtra !== undefined) throw new RangeError('Unexpected `monthExtra` value');
665
- if (year === undefined && eraYear === undefined) throw new TypeError('year or eraYear is required');
666
- if (month === undefined && monthCode === undefined) throw new TypeError('month or monthCode is required');
667
- if (day === undefined) throw new RangeError('Missing day');
668
- if (monthCode !== undefined) {
669
- if (typeof monthCode !== 'string') {
670
- throw new RangeError(`monthCode must be a string, not ${typeof monthCode}`);
671
- }
672
- if (!/^M([01]?\d)(L?)$/.test(monthCode)) {
673
- throw new RangeError(`Invalid monthCode: ${monthCode}`);
674
- }
675
- }
676
- if (this.hasEra) {
677
- if ((calendarDate['era'] === undefined) !== (calendarDate['eraYear'] === undefined)) {
678
- throw new TypeError('properties era and eraYear must be provided together');
679
- }
680
- }
681
- }
682
- /**
683
- * Allows derived calendars to add additional fields and/or to make
684
- * adjustments e.g. to set the era based on the date or to revise the month
685
- * number in lunisolar calendars per
686
- * https://github.com/tc39/proposal-temporal/issues/1203.
687
- *
688
- * The base implementation fills in missing values by assuming the simplest
689
- * possible calendar:
690
- * - no eras
691
- * - non-lunisolar calendar (no leap months)
692
- * */
693
- adjustCalendarDate(
694
- calendarDateParam: Partial<FullCalendarDate>,
695
- cache: OneObjectCache | undefined = undefined,
696
- overflow: Overflow = 'constrain',
697
- // This param is only used by derived classes
698
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
699
- fromLegacyDate = false
700
- ): FullCalendarDate {
701
- if (this.calendarType === 'lunisolar') throw new RangeError('Override required for lunisolar calendars');
702
- let calendarDate = calendarDateParam;
703
- this.validateCalendarDate(calendarDate);
704
- const largestMonth = this.monthsInYear(calendarDate, cache);
705
- let { month, monthCode } = calendarDate;
706
-
707
- ({ month, monthCode } = resolveNonLunisolarMonth(calendarDate, overflow, largestMonth));
708
- return { ...(calendarDate as typeof calendarDate & CalendarYMD), month, monthCode };
709
- }
710
- regulateMonthDayNaive(calendarDate: FullCalendarDate, overflow: Overflow, cache: OneObjectCache): FullCalendarDate {
711
- const largestMonth = this.monthsInYear(calendarDate, cache);
712
- let { month, day } = calendarDate;
713
- if (overflow === 'reject') {
714
- ES.RejectToRange(month, 1, largestMonth);
715
- ES.RejectToRange(day, 1, this.maximumMonthLength(calendarDate));
716
- } else {
717
- month = ES.ConstrainToRange(month, 1, largestMonth);
718
- day = ES.ConstrainToRange(day, 1, this.maximumMonthLength({ ...calendarDate, month }));
719
- }
720
- return { ...calendarDate, month, day };
721
- }
722
- calendarToIsoDate(dateParam: CalendarDateFields, overflow: Overflow = 'constrain', cache: OneObjectCache): ISODate {
723
- const originalDate = dateParam as Partial<FullCalendarDate>;
724
- // First, normalize the calendar date to ensure that (year, month, day)
725
- // are all present, converting monthCode and eraYear if needed.
726
- let date = this.adjustCalendarDate(dateParam, cache, overflow, false);
727
-
728
- // Fix obviously out-of-bounds values. Values that are valid generally, but
729
- // not in this particular year, may not be caught here for some calendars.
730
- // If so, these will be handled lower below.
731
- date = this.regulateMonthDayNaive(date, overflow, cache);
732
-
733
- const { year, month, day } = date;
734
- const key = JSON.stringify({ func: 'calendarToIsoDate', year, month, day, overflow, id: this.id });
735
- let cached = cache.get(key);
736
- if (cached) return cached;
737
- // If YMD are present in the input but the input has been constrained
738
- // already, then cache both the original value and the constrained value.
739
- let keyOriginal;
740
- if (
741
- originalDate.year !== undefined &&
742
- originalDate.month !== undefined &&
743
- originalDate.day !== undefined &&
744
- (originalDate.year !== date.year || originalDate.month !== date.month || originalDate.day !== date.day)
745
- ) {
746
- keyOriginal = JSON.stringify({
747
- func: 'calendarToIsoDate',
748
- year: originalDate.year,
749
- month: originalDate.month,
750
- day: originalDate.day,
751
- overflow,
752
- id: this.id
753
- });
754
- cached = cache.get(keyOriginal);
755
- if (cached) return cached;
756
- }
757
-
758
- // First, try to roughly guess the result
759
- let isoEstimate = this.estimateIsoDate({ year, month, day });
760
- const calculateSameMonthResult = (diffDays: number) => {
761
- // If the estimate is in the same year & month as the target, then we can
762
- // calculate the result exactly and short-circuit any additional logic.
763
- // This optimization assumes that months are continuous. It would break if
764
- // a calendar skipped days, like the Julian->Gregorian switchover. But
765
- // current ICU calendars only skip days (japanese/roc/buddhist) because of
766
- // a bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1173158)
767
- // that's currently worked around by a custom calendarToIsoDate
768
- // implementation in those calendars. So this optimization should be safe
769
- // for all ICU calendars.
770
- let testIsoEstimate = this.addDaysIso(isoEstimate, diffDays);
771
- if (date.day > this.minimumMonthLength(date)) {
772
- // There's a chance that the calendar date is out of range. Throw or
773
- // constrain if so.
774
- let testCalendarDate = this.isoToCalendarDate(testIsoEstimate, cache);
775
- while (testCalendarDate.month !== month || testCalendarDate.year !== year) {
776
- if (overflow === 'reject') {
777
- throw new RangeError(`day ${day} does not exist in month ${month} of year ${year}`);
778
- }
779
- // Back up a day at a time until we're not hanging over the month end
780
- testIsoEstimate = this.addDaysIso(testIsoEstimate, -1);
781
- testCalendarDate = this.isoToCalendarDate(testIsoEstimate, cache);
782
- }
783
- }
784
- return testIsoEstimate;
785
- };
786
- let sign = 0;
787
- let roundtripEstimate = this.isoToCalendarDate(isoEstimate, cache);
788
- let diff = simpleDateDiff(date, roundtripEstimate);
789
- if (diff.years !== 0 || diff.months !== 0 || diff.days !== 0) {
790
- const diffTotalDaysEstimate = diff.years * 365 + diff.months * 30 + diff.days;
791
- isoEstimate = this.addDaysIso(isoEstimate, diffTotalDaysEstimate);
792
- roundtripEstimate = this.isoToCalendarDate(isoEstimate, cache);
793
- diff = simpleDateDiff(date, roundtripEstimate);
794
- if (diff.years === 0 && diff.months === 0) {
795
- isoEstimate = calculateSameMonthResult(diff.days);
796
- } else {
797
- sign = this.compareCalendarDates(date, roundtripEstimate);
798
- }
799
- }
800
- // If the initial guess is not in the same month, then bisect the
801
- // distance to the target, starting with 8 days per step.
802
- let increment = 8;
803
- while (sign) {
804
- isoEstimate = this.addDaysIso(isoEstimate, sign * increment);
805
- const oldRoundtripEstimate = roundtripEstimate;
806
- roundtripEstimate = this.isoToCalendarDate(isoEstimate, cache);
807
- const oldSign = sign;
808
- sign = this.compareCalendarDates(date, roundtripEstimate);
809
- if (sign) {
810
- diff = simpleDateDiff(date, roundtripEstimate);
811
- if (diff.years === 0 && diff.months === 0) {
812
- isoEstimate = calculateSameMonthResult(diff.days);
813
- // Signal the loop condition that there's a match.
814
- sign = 0;
815
- } else if (oldSign && sign !== oldSign) {
816
- if (increment > 1) {
817
- // If the estimate overshot the target, try again with a smaller increment
818
- // in the reverse direction.
819
- increment /= 2;
820
- } else {
821
- // Increment is 1, and neither the previous estimate nor the new
822
- // estimate is correct. The only way that can happen is if the
823
- // original date was an invalid value that will be constrained or
824
- // rejected here.
825
- if (overflow === 'reject') {
826
- throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({ ...originalDate })}`);
827
- } else {
828
- // To constrain, pick the earliest value
829
- const order = this.compareCalendarDates(roundtripEstimate, oldRoundtripEstimate);
830
- // If current value is larger, then back up to the previous value.
831
- if (order > 0) isoEstimate = this.addDaysIso(isoEstimate, -1);
832
- sign = 0;
833
- }
834
- }
835
- }
836
- }
837
- }
838
- cache.set(key, isoEstimate);
839
- if (keyOriginal) cache.set(keyOriginal, isoEstimate);
840
- if (
841
- date.year === undefined ||
842
- date.month === undefined ||
843
- date.day === undefined ||
844
- date.monthCode === undefined ||
845
- (this.hasEra && (date.era === undefined || date.eraYear === undefined))
846
- ) {
847
- throw new RangeError('Unexpected missing property');
848
- }
849
- return isoEstimate;
850
- }
851
- compareCalendarDates(date1: CalendarYMD, date2: CalendarYMD) {
852
- if (date1.year !== date2.year) return ES.ComparisonResult(date1.year - date2.year);
853
- if (date1.month !== date2.month) return ES.ComparisonResult(date1.month - date2.month);
854
- if (date1.day !== date2.day) return ES.ComparisonResult(date1.day - date2.day);
855
- return 0;
856
- }
857
- /** Ensure that a calendar date actually exists. If not, return the closest earlier date. */
858
- regulateDate(calendarDate: CalendarYMD, overflow: Overflow = 'constrain', cache: OneObjectCache): FullCalendarDate {
859
- const isoDate = this.calendarToIsoDate(calendarDate, overflow, cache);
860
- return this.isoToCalendarDate(isoDate, cache);
861
- }
862
- addDaysIso(isoDate: ISODate, days: number): ISODate {
863
- const added = ES.BalanceISODate(isoDate.year, isoDate.month, isoDate.day + days);
864
- return added;
865
- }
866
- addDaysCalendar(calendarDate: CalendarYMD, days: number, cache: OneObjectCache): FullCalendarDate {
867
- const isoDate = this.calendarToIsoDate(calendarDate, 'constrain', cache);
868
- const addedIso = this.addDaysIso(isoDate, days);
869
- const addedCalendar = this.isoToCalendarDate(addedIso, cache);
870
- return addedCalendar;
871
- }
872
- addMonthsCalendar(
873
- calendarDateParam: CalendarYMD,
874
- months: number,
875
- overflow: Overflow,
876
- cache: OneObjectCache
877
- ): CalendarYMD {
878
- let calendarDate = calendarDateParam;
879
- const { day } = calendarDate;
880
- for (let i = 0, absMonths = Math.abs(months); i < absMonths; i++) {
881
- const { month } = calendarDate;
882
- const oldCalendarDate = calendarDate;
883
- const days =
884
- months < 0
885
- ? -Math.max(day, this.daysInPreviousMonth(calendarDate, cache))
886
- : this.daysInMonth(calendarDate, cache);
887
- const isoDate = this.calendarToIsoDate(calendarDate, 'constrain', cache);
888
- let addedIso = this.addDaysIso(isoDate, days);
889
- calendarDate = this.isoToCalendarDate(addedIso, cache);
890
-
891
- // Normally, we can advance one month by adding the number of days in the
892
- // current month. However, if we're at the end of the current month and
893
- // the next month has fewer days, then we rolled over to the after-next
894
- // month. Below we detect this condition and back up until we're back in
895
- // the desired month.
896
- if (months > 0) {
897
- const monthsInOldYear = this.monthsInYear(oldCalendarDate, cache);
898
- while (calendarDate.month - 1 !== month % monthsInOldYear) {
899
- addedIso = this.addDaysIso(addedIso, -1);
900
- calendarDate = this.isoToCalendarDate(addedIso, cache);
901
- }
902
- }
903
-
904
- if (calendarDate.day !== day) {
905
- // try to retain the original day-of-month, if possible
906
- calendarDate = this.regulateDate({ ...calendarDate, day }, 'constrain', cache);
907
- }
908
- }
909
- if (overflow === 'reject' && calendarDate.day !== day) {
910
- throw new RangeError(`Day ${day} does not exist in resulting calendar month`);
911
- }
912
- return calendarDate;
913
- }
914
- addCalendar(
915
- calendarDate: CalendarYMD & { monthCode: string },
916
- { years = 0, months = 0, weeks = 0, days = 0 },
917
- overflow: Overflow,
918
- cache: OneObjectCache
919
- ): FullCalendarDate {
920
- const { year, day, monthCode } = calendarDate;
921
- const addedYears = this.adjustCalendarDate({ year: year + years, monthCode, day }, cache);
922
- const addedMonths = this.addMonthsCalendar(addedYears, months, overflow, cache);
923
- const initialDays = days + weeks * 7;
924
- const addedDays = this.addDaysCalendar(addedMonths, initialDays, cache);
925
- return addedDays;
926
- }
927
- untilCalendar(
928
- calendarOne: FullCalendarDate,
929
- calendarTwo: FullCalendarDate,
930
- largestUnit: Temporal.DateUnit,
931
- cache: OneObjectCache
932
- ): { years: number; months: number; weeks: number; days: number } {
933
- let days = 0;
934
- let weeks = 0;
935
- let months = 0;
936
- let years = 0;
937
- switch (largestUnit) {
938
- case 'day':
939
- days = this.calendarDaysUntil(calendarOne, calendarTwo, cache);
940
- break;
941
- case 'week': {
942
- const totalDays = this.calendarDaysUntil(calendarOne, calendarTwo, cache);
943
- days = totalDays % 7;
944
- weeks = (totalDays - days) / 7;
945
- break;
946
- }
947
- case 'month':
948
- case 'year': {
949
- const sign = this.compareCalendarDates(calendarTwo, calendarOne);
950
- if (!sign) {
951
- return { years: 0, months: 0, weeks: 0, days: 0 };
952
- }
953
- const diffYears = calendarTwo.year - calendarOne.year;
954
- const diffDays = calendarTwo.day - calendarOne.day;
955
- if (largestUnit === 'year' && diffYears) {
956
- let diffInYearSign = 0;
957
- if (calendarTwo.monthCode > calendarOne.monthCode) diffInYearSign = 1;
958
- if (calendarTwo.monthCode < calendarOne.monthCode) diffInYearSign = -1;
959
- if (!diffInYearSign) diffInYearSign = Math.sign(diffDays);
960
- const isOneFurtherInYear = diffInYearSign * sign < 0;
961
- years = isOneFurtherInYear ? diffYears - sign : diffYears;
962
- }
963
- const yearsAdded = years ? this.addCalendar(calendarOne, { years }, 'constrain', cache) : calendarOne;
964
- // Now we have less than one year remaining. Add one month at a time
965
- // until we go over the target, then back up one month and calculate
966
- // remaining days and weeks.
967
- let current;
968
- let next: CalendarYMD = yearsAdded;
969
- do {
970
- months += sign;
971
- current = next;
972
- next = this.addMonthsCalendar(current, sign, 'constrain', cache);
973
- if (next.day !== calendarOne.day) {
974
- // In case the day was constrained down, try to un-constrain it
975
- next = this.regulateDate({ ...next, day: calendarOne.day }, 'constrain', cache);
976
- }
977
- } while (this.compareCalendarDates(calendarTwo, next) * sign >= 0);
978
- months -= sign; // correct for loop above which overshoots by 1
979
- const remainingDays = this.calendarDaysUntil(current, calendarTwo, cache);
980
- days = remainingDays;
981
- break;
982
- }
983
- }
984
- return { years, months, weeks, days };
985
- }
986
- daysInMonth(calendarDate: CalendarYMD, cache: OneObjectCache): number {
987
- // Add enough days to roll over to the next month. One we're in the next
988
- // month, we can calculate the length of the current month. NOTE: This
989
- // algorithm assumes that months are continuous. It would break if a
990
- // calendar skipped days, like the Julian->Gregorian switchover. But current
991
- // ICU calendars only skip days (japanese/roc/buddhist) because of a bug
992
- // (https://bugs.chromium.org/p/chromium/issues/detail?id=1173158) that's
993
- // currently worked around by a custom calendarToIsoDate implementation in
994
- // those calendars. So this code should be safe for all ICU calendars.
995
- const { day } = calendarDate;
996
- const max = this.maximumMonthLength(calendarDate);
997
- const min = this.minimumMonthLength(calendarDate);
998
- // easiest case: we already know the month length if min and max are the same.
999
- if (min === max) return min;
1000
-
1001
- // Add enough days to get into the next month, without skipping it
1002
- const increment = day <= max - min ? max : min;
1003
- const isoDate = this.calendarToIsoDate(calendarDate, 'constrain', cache);
1004
- const addedIsoDate = this.addDaysIso(isoDate, increment);
1005
- const addedCalendarDate = this.isoToCalendarDate(addedIsoDate, cache);
1006
-
1007
- // Now back up to the last day of the original month
1008
- const endOfMonthIso = this.addDaysIso(addedIsoDate, -addedCalendarDate.day);
1009
- const endOfMonthCalendar = this.isoToCalendarDate(endOfMonthIso, cache);
1010
- return endOfMonthCalendar.day;
1011
- }
1012
- daysInPreviousMonth(calendarDate: CalendarYMD, cache: OneObjectCache): number {
1013
- const { day, month, year } = calendarDate;
1014
-
1015
- // Check to see if we already know the month length, and return it if so
1016
- const previousMonthYear = month > 1 ? year : year - 1;
1017
- let previousMonthDate = { year: previousMonthYear, month, day: 1 };
1018
- const previousMonth = month > 1 ? month - 1 : this.monthsInYear(previousMonthDate, cache);
1019
- previousMonthDate = { ...previousMonthDate, month: previousMonth };
1020
- const min = this.minimumMonthLength(previousMonthDate);
1021
- const max = this.maximumMonthLength(previousMonthDate);
1022
- if (min === max) return max;
1023
-
1024
- const isoDate = this.calendarToIsoDate(calendarDate, 'constrain', cache);
1025
- const lastDayOfPreviousMonthIso = this.addDaysIso(isoDate, -day);
1026
- const lastDayOfPreviousMonthCalendar = this.isoToCalendarDate(lastDayOfPreviousMonthIso, cache);
1027
- return lastDayOfPreviousMonthCalendar.day;
1028
- }
1029
- startOfCalendarYear(calendarDate: CalendarYearOnly): CalendarYMD & { monthCode: string } {
1030
- return { year: calendarDate.year, month: 1, monthCode: 'M01', day: 1 };
1031
- }
1032
- startOfCalendarMonth(calendarDate: CalendarYM): CalendarYMD {
1033
- return { year: calendarDate.year, month: calendarDate.month, day: 1 };
1034
- }
1035
- calendarDaysUntil(calendarOne: CalendarYMD, calendarTwo: CalendarYMD, cache: OneObjectCache): number {
1036
- const oneIso = this.calendarToIsoDate(calendarOne, 'constrain', cache);
1037
- const twoIso = this.calendarToIsoDate(calendarTwo, 'constrain', cache);
1038
- return (
1039
- ES.ISODateToEpochDays(twoIso.year, twoIso.month - 1, twoIso.day) -
1040
- ES.ISODateToEpochDays(oneIso.year, oneIso.month - 1, oneIso.day)
1041
- );
1042
- }
1043
- // Override if calendar uses eras
1044
- hasEra = false;
1045
- // See https://github.com/tc39/proposal-temporal/issues/1784
1046
- erasBeginMidYear = false;
1047
- // Override this to shortcut the search space if certain month codes only
1048
- // occur long in the past
1049
- monthDaySearchStartYear(monthCode: string, day: number) {
1050
- void monthCode, day;
1051
- return 1972;
1052
- }
1053
- monthDayFromFields(fields: MonthDayFromFieldsObject, overflow: Overflow, cache: OneObjectCache): ISODate {
1054
- let { era, eraYear, year, month, monthCode, day } = fields;
1055
- if (month !== undefined && year === undefined && (!this.hasEra || era === undefined || eraYear === undefined)) {
1056
- throw new TypeError('when month is present, year (or era and eraYear) are required');
1057
- }
1058
- if (monthCode === undefined || year !== undefined || (this.hasEra && eraYear !== undefined)) {
1059
- // Apply overflow behaviour to year/month/day, to get correct monthCode/day
1060
- ({ monthCode, day } = this.isoToCalendarDate(this.calendarToIsoDate(fields, overflow, cache), cache));
1061
- }
1062
-
1063
- let isoYear, isoMonth, isoDay;
1064
- let closestCalendar, closestIso;
1065
- // Look backwards starting from one of the calendar years spanning ISO year
1066
- // 1972, up to 20 calendar years prior, to find a year that has this month
1067
- // and day. Normal months and days will match immediately, but for leap days
1068
- // and leap months we may have to look for a while. For searches longer than
1069
- // 20 years, override the start date in monthDaySearchStartYear.
1070
- const startDateIso = {
1071
- year: this.monthDaySearchStartYear(monthCode, day),
1072
- month: 12,
1073
- day: 31
1074
- };
1075
- const calendarOfStartDateIso = this.isoToCalendarDate(startDateIso, cache);
1076
- // Note: relies on lexicographical ordering of monthCodes
1077
- const calendarYear =
1078
- calendarOfStartDateIso.monthCode > monthCode ||
1079
- (calendarOfStartDateIso.monthCode === monthCode && calendarOfStartDateIso.day >= day)
1080
- ? calendarOfStartDateIso.year
1081
- : calendarOfStartDateIso.year - 1;
1082
- for (let i = 0; i < 20; i++) {
1083
- const testCalendarDate: FullCalendarDate = this.adjustCalendarDate(
1084
- { day, monthCode, year: calendarYear - i },
1085
- cache
1086
- );
1087
- const isoDate = this.calendarToIsoDate(testCalendarDate, 'constrain', cache);
1088
- const roundTripCalendarDate = this.isoToCalendarDate(isoDate, cache);
1089
- ({ year: isoYear, month: isoMonth, day: isoDay } = isoDate);
1090
- if (roundTripCalendarDate.monthCode === monthCode && roundTripCalendarDate.day === day) {
1091
- return { month: isoMonth, day: isoDay, year: isoYear };
1092
- } else if (overflow === 'constrain') {
1093
- // If the requested day is never present in any instance of this month
1094
- // code, and the round trip date is an instance of this month code with
1095
- // the most possible days, we are as close as we can get.
1096
- const maxDayForMonthCode = this.maxLengthOfMonthCodeInAnyYear(roundTripCalendarDate.monthCode);
1097
- if (
1098
- roundTripCalendarDate.monthCode === monthCode &&
1099
- roundTripCalendarDate.day === maxDayForMonthCode &&
1100
- day > maxDayForMonthCode
1101
- ) {
1102
- return { month: isoMonth, day: isoDay, year: isoYear };
1103
- }
1104
- // non-ISO constrain algorithm tries to find the closest date in a matching month
1105
- if (
1106
- closestCalendar === undefined ||
1107
- (roundTripCalendarDate.monthCode === closestCalendar.monthCode &&
1108
- roundTripCalendarDate.day > closestCalendar.day)
1109
- ) {
1110
- closestCalendar = roundTripCalendarDate;
1111
- closestIso = isoDate;
1112
- }
1113
- }
1114
- }
1115
- if (overflow === 'constrain' && closestIso !== undefined) return closestIso;
1116
- throw new RangeError(`No recent ${this.id} year with monthCode ${monthCode} and day ${day}`);
1117
- }
1118
- getFirstDayOfWeek(): number | undefined {
1119
- return undefined;
1120
- }
1121
- getMinimalDaysInFirstWeek(): number | undefined {
1122
- return undefined;
1123
- }
1124
- }
1125
-
1126
- interface HebrewMonthInfo {
1127
- [m: string]: (
1128
- | {
1129
- leap: undefined;
1130
- regular: number;
1131
- }
1132
- | {
1133
- leap: number;
1134
- regular: undefined;
1135
- }
1136
- | {
1137
- leap: number;
1138
- regular: number;
1139
- }
1140
- ) & {
1141
- monthCode: string;
1142
- days:
1143
- | number
1144
- | {
1145
- min: number;
1146
- max: number;
1147
- };
1148
- };
1149
- }
1150
-
1151
- class HebrewHelper extends HelperBase {
1152
- id = 'hebrew' as const;
1153
- calendarType = 'lunisolar' as const;
1154
- inLeapYear(calendarDate: CalendarYearOnly) {
1155
- const { year } = calendarDate;
1156
- // FYI: In addition to adding a month in leap years, the Hebrew calendar
1157
- // also has per-year changes to the number of days of Heshvan and Kislev.
1158
- // Given that these can be calculated by counting the number of days in
1159
- // those months, I assume that these DO NOT need to be exposed as
1160
- // Hebrew-only prototype fields or methods.
1161
- return (7 * year + 1) % 19 < 7;
1162
- }
1163
- monthsInYear(calendarDate: CalendarYearOnly) {
1164
- return this.inLeapYear(calendarDate) ? 13 : 12;
1165
- }
1166
- minimumMonthLength(calendarDate: CalendarYM) {
1167
- return this.minMaxMonthLength(calendarDate, 'min');
1168
- }
1169
- maximumMonthLength(calendarDate: CalendarYM) {
1170
- return this.minMaxMonthLength(calendarDate, 'max');
1171
- }
1172
- minMaxMonthLength(calendarDate: CalendarYM, minOrMax: 'min' | 'max') {
1173
- const { month, year } = calendarDate;
1174
- const monthCode = this.getMonthCode(year, month);
1175
- const monthInfo = Object.entries(this.months).find((m) => m[1].monthCode === monthCode);
1176
- if (monthInfo === undefined) throw new RangeError(`unmatched Hebrew month: ${month}`);
1177
- const daysInMonth = monthInfo[1].days;
1178
- return typeof daysInMonth === 'number' ? daysInMonth : daysInMonth[minOrMax];
1179
- }
1180
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
1181
- return ['M04', 'M06', 'M08', 'M10', 'M12'].includes(monthCode) ? 29 : 30;
1182
- }
1183
- /** Take a guess at what ISO date a particular calendar date corresponds to */
1184
- estimateIsoDate(calendarDate: CalendarYMD) {
1185
- const { year } = calendarDate;
1186
- return { year: year - 3760, month: 1, day: 1 };
1187
- }
1188
- months: HebrewMonthInfo = {
1189
- Tishri: { leap: 1, regular: 1, monthCode: 'M01', days: 30 },
1190
- Heshvan: { leap: 2, regular: 2, monthCode: 'M02', days: { min: 29, max: 30 } },
1191
- Kislev: { leap: 3, regular: 3, monthCode: 'M03', days: { min: 29, max: 30 } },
1192
- Tevet: { leap: 4, regular: 4, monthCode: 'M04', days: 29 },
1193
- Shevat: { leap: 5, regular: 5, monthCode: 'M05', days: 30 },
1194
- Adar: { leap: undefined, regular: 6, monthCode: 'M06', days: 29 },
1195
- 'Adar I': { leap: 6, regular: undefined, monthCode: 'M05L', days: 30 },
1196
- 'Adar II': { leap: 7, regular: undefined, monthCode: 'M06', days: 29 },
1197
- Nisan: { leap: 8, regular: 7, monthCode: 'M07', days: 30 },
1198
- Iyar: { leap: 9, regular: 8, monthCode: 'M08', days: 29 },
1199
- Sivan: { leap: 10, regular: 9, monthCode: 'M09', days: 30 },
1200
- Tamuz: { leap: 11, regular: 10, monthCode: 'M10', days: 29 },
1201
- Av: { leap: 12, regular: 11, monthCode: 'M11', days: 30 },
1202
- Elul: { leap: 13, regular: 12, monthCode: 'M12', days: 29 }
1203
- };
1204
- getMonthCode(year: number, month: number) {
1205
- if (this.inLeapYear({ year })) {
1206
- return month === 6 ? buildMonthCode(5, true) : buildMonthCode(month < 6 ? month : month - 1);
1207
- } else {
1208
- return buildMonthCode(month);
1209
- }
1210
- }
1211
- override adjustCalendarDate(
1212
- calendarDate: Partial<FullCalendarDate>,
1213
- cache?: OneObjectCache,
1214
- overflow: Overflow = 'constrain',
1215
- fromLegacyDate = false
1216
- ): FullCalendarDate {
1217
- let { year, month, monthCode, day, monthExtra } = calendarDate as Omit<typeof calendarDate, 'day'> & {
1218
- day: number;
1219
- };
1220
- if (year === undefined) throw new TypeError('Missing property: year');
1221
- if (fromLegacyDate) {
1222
- // In Pre Node-14 V8, DateTimeFormat.formatToParts `month: 'numeric'`
1223
- // output returns the numeric equivalent of `month` as a string, meaning
1224
- // that `'6'` in a leap year is Adar I, while `'6'` in a non-leap year
1225
- // means Adar. In this case, `month` will already be correct and no action
1226
- // is needed. However, in Node 14 and later formatToParts returns the name
1227
- // of the Hebrew month (e.g. "Tevet"), so we'll need to look up the
1228
- // correct `month` using the string name as a key.
1229
- if (monthExtra) {
1230
- const monthInfo = this.months[monthExtra];
1231
- if (!monthInfo) throw new RangeError(`Unrecognized month from formatToParts: ${monthExtra}`);
1232
- month = this.inLeapYear({ year }) ? monthInfo.leap : monthInfo.regular;
1233
- }
1234
- // Because we're getting data from legacy Date, then `month` will always be present
1235
- monthCode = this.getMonthCode(year, month as number);
1236
- return { year, month: month as number, day, monthCode };
1237
- } else {
1238
- // When called without input coming from legacy Date output, simply ensure
1239
- // that all fields are present.
1240
- this.validateCalendarDate(calendarDate);
1241
- if (month === undefined) {
1242
- ES.assertExists(monthCode);
1243
- if (monthCode.endsWith('L')) {
1244
- if (monthCode !== 'M05L') {
1245
- throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${monthCode}`);
1246
- }
1247
- month = 6;
1248
- if (!this.inLeapYear({ year })) {
1249
- if (overflow === 'reject') {
1250
- throw new RangeError(`Hebrew monthCode M05L is invalid in year ${year} which is not a leap year`);
1251
- } else {
1252
- // constrain to same day of next month (Adar)
1253
- month = 6;
1254
- monthCode = 'M06';
1255
- }
1256
- }
1257
- } else {
1258
- month = nonLeapMonthCodeNumberPart(monthCode);
1259
- // if leap month is before this one, the month index is one more than the month code
1260
- if (this.inLeapYear({ year }) && month >= 6) month++;
1261
- const largestMonth = this.monthsInYear({ year });
1262
- if (month < 1 || month > largestMonth) throw new RangeError(`Invalid monthCode: ${monthCode}`);
1263
- }
1264
- } else {
1265
- if (overflow === 'reject') {
1266
- ES.RejectToRange(month, 1, this.monthsInYear({ year }));
1267
- ES.RejectToRange(day, 1, this.maximumMonthLength({ year, month }));
1268
- } else {
1269
- month = ES.ConstrainToRange(month, 1, this.monthsInYear({ year }));
1270
- day = ES.ConstrainToRange(day, 1, this.maximumMonthLength({ year, month }));
1271
- }
1272
- if (monthCode === undefined) {
1273
- monthCode = this.getMonthCode(year, month);
1274
- } else {
1275
- const calculatedMonthCode = this.getMonthCode(year, month);
1276
- if (calculatedMonthCode !== monthCode) {
1277
- throw new RangeError(`monthCode ${monthCode} doesn't correspond to month ${month} in Hebrew year ${year}`);
1278
- }
1279
- }
1280
- }
1281
- return { ...calendarDate, day, month, monthCode, year };
1282
- }
1283
- }
1284
- }
1285
-
1286
- /**
1287
- * For Temporal purposes, the Islamic calendar is simple because it's always the
1288
- * same 12 months in the same order.
1289
- */
1290
- abstract class IslamicBaseHelper extends HelperBase {
1291
- abstract override id: BuiltinCalendarId;
1292
- calendarType = 'lunar' as const;
1293
- inLeapYear(calendarDate: CalendarYearOnly, cache: OneObjectCache) {
1294
- const startOfYearCalendar = { year: calendarDate.year, month: 1, monthCode: 'M01', day: 1 };
1295
- const startOfNextYearCalendar = { year: calendarDate.year + 1, month: 1, monthCode: 'M01', day: 1 };
1296
- const result = this.calendarDaysUntil(startOfYearCalendar, startOfNextYearCalendar, cache);
1297
- return result === 355;
1298
- }
1299
- monthsInYear(/* calendarYear, cache */) {
1300
- return 12;
1301
- }
1302
- minimumMonthLength(/* calendarDate */) {
1303
- return 29;
1304
- }
1305
- maximumMonthLength(/* calendarDate */) {
1306
- return 30;
1307
- }
1308
- maxLengthOfMonthCodeInAnyYear(/* monthCode */) {
1309
- return 30;
1310
- }
1311
- DAYS_PER_ISLAMIC_YEAR = 354 + 11 / 30;
1312
- DAYS_PER_ISO_YEAR = 365.2425;
1313
- estimateIsoDate(calendarDate: CalendarYMD) {
1314
- const { year } = this.adjustCalendarDate(calendarDate);
1315
- return { year: Math.floor((year * this.DAYS_PER_ISLAMIC_YEAR) / this.DAYS_PER_ISO_YEAR) + 622, month: 1, day: 1 };
1316
- }
1317
- }
1318
-
1319
- // There are 6 Islamic calendars with the same implementation in this polyfill.
1320
- // They vary only in their ID. They do emit different output from the underlying
1321
- // Intl implementation, but our code for each of them is identical.
1322
- class IslamicHelper extends IslamicBaseHelper {
1323
- id = 'islamic' as const;
1324
- }
1325
- class IslamicUmalquraHelper extends IslamicBaseHelper {
1326
- id = 'islamic-umalqura' as const;
1327
- }
1328
- class IslamicTblaHelper extends IslamicBaseHelper {
1329
- id = 'islamic-tbla' as const;
1330
- }
1331
- class IslamicCivilHelper extends IslamicBaseHelper {
1332
- id = 'islamic-civil' as const;
1333
- }
1334
- class IslamicRgsaHelper extends IslamicBaseHelper {
1335
- id = 'islamic-rgsa' as const;
1336
- }
1337
- class IslamicCcHelper extends IslamicBaseHelper {
1338
- id = 'islamicc' as const;
1339
- }
1340
-
1341
- class PersianHelper extends HelperBase {
1342
- id = 'persian' as const;
1343
- calendarType = 'solar' as const;
1344
- inLeapYear(calendarDate: CalendarYearOnly, cache: OneObjectCache) {
1345
- // If the last month has 30 days, it's a leap year.
1346
- return this.daysInMonth({ year: calendarDate.year, month: 12, day: 1 }, cache) === 30;
1347
- }
1348
- monthsInYear(/* calendarYear, cache */) {
1349
- return 12;
1350
- }
1351
- minimumMonthLength(calendarDate: CalendarYM) {
1352
- const { month } = calendarDate;
1353
- if (month === 12) return 29;
1354
- return month <= 6 ? 31 : 30;
1355
- }
1356
- maximumMonthLength(calendarDate: CalendarYM) {
1357
- const { month } = calendarDate;
1358
- if (month === 12) return 30;
1359
- return month <= 6 ? 31 : 30;
1360
- }
1361
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
1362
- const month = nonLeapMonthCodeNumberPart(monthCode);
1363
- return month <= 6 ? 31 : 30;
1364
- }
1365
- estimateIsoDate(calendarDate: CalendarYMD) {
1366
- const { year } = this.adjustCalendarDate(calendarDate);
1367
- return { year: year + 621, month: 1, day: 1 };
1368
- }
1369
- }
1370
-
1371
- interface IndianMonthInfo {
1372
- [month: number]: {
1373
- length: number;
1374
- month: number;
1375
- day: number;
1376
- leap?: {
1377
- length: number;
1378
- month: number;
1379
- day: number;
1380
- };
1381
- nextYear?: true | undefined;
1382
- };
1383
- }
1384
-
1385
- class IndianHelper extends HelperBase {
1386
- id = 'indian' as const;
1387
- calendarType = 'solar' as const;
1388
- inLeapYear(calendarDate: CalendarYearOnly) {
1389
- // From https://en.wikipedia.org/wiki/Indian_national_calendar:
1390
- // Years are counted in the Saka era, which starts its year 0 in the year 78
1391
- // of the Common Era. To determine leap years, add 78 to the Saka year – if
1392
- // the result is a leap year in the Gregorian calendar, then the Saka year
1393
- // is a leap year as well.
1394
- return isGregorianLeapYear(calendarDate.year + 78);
1395
- }
1396
- monthsInYear(/* calendarYear, cache */) {
1397
- return 12;
1398
- }
1399
- minimumMonthLength(calendarDate: CalendarYM) {
1400
- return this.getMonthInfo(calendarDate).length;
1401
- }
1402
- maximumMonthLength(calendarDate: CalendarYM) {
1403
- return this.getMonthInfo(calendarDate).length;
1404
- }
1405
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
1406
- const month = nonLeapMonthCodeNumberPart(monthCode);
1407
- let monthInfo = this.months[month];
1408
- monthInfo = monthInfo.leap ?? monthInfo;
1409
- return monthInfo.length;
1410
- }
1411
- // Indian months always start at the same well-known Gregorian month and
1412
- // day. So this conversion is easy and fast. See
1413
- // https://en.wikipedia.org/wiki/Indian_national_calendar
1414
- months: IndianMonthInfo = {
1415
- 1: { length: 30, month: 3, day: 22, leap: { length: 31, month: 3, day: 21 } },
1416
- 2: { length: 31, month: 4, day: 21 },
1417
- 3: { length: 31, month: 5, day: 22 },
1418
- 4: { length: 31, month: 6, day: 22 },
1419
- 5: { length: 31, month: 7, day: 23 },
1420
- 6: { length: 31, month: 8, day: 23 },
1421
- 7: { length: 30, month: 9, day: 23 },
1422
- 8: { length: 30, month: 10, day: 23 },
1423
- 9: { length: 30, month: 11, day: 22 },
1424
- 10: { length: 30, month: 12, day: 22 },
1425
- 11: { length: 30, month: 1, nextYear: true, day: 21 },
1426
- 12: { length: 30, month: 2, nextYear: true, day: 20 }
1427
- };
1428
- getMonthInfo(calendarDate: CalendarYM) {
1429
- const { month } = calendarDate;
1430
- let monthInfo = this.months[month];
1431
- if (monthInfo === undefined) throw new RangeError(`Invalid month: ${month}`);
1432
- if (this.inLeapYear(calendarDate) && monthInfo.leap) monthInfo = monthInfo.leap;
1433
- return monthInfo;
1434
- }
1435
- estimateIsoDate(calendarDateParam: CalendarYMD) {
1436
- // FYI, this "estimate" is always the exact ISO date, which makes the Indian
1437
- // calendar fast!
1438
- const calendarDate = this.adjustCalendarDate(calendarDateParam);
1439
- const monthInfo = this.getMonthInfo(calendarDate);
1440
- const isoYear = calendarDate.year + 78 + (monthInfo.nextYear ? 1 : 0);
1441
- const isoMonth = monthInfo.month;
1442
- const isoDay = monthInfo.day;
1443
- const isoDate = ES.BalanceISODate(isoYear, isoMonth, isoDay + calendarDate.day - 1);
1444
- return isoDate;
1445
- }
1446
- // https://bugs.chromium.org/p/v8/issues/detail?id=10529 causes Intl's Indian
1447
- // calendar output to fail for all dates before 0001-01-01 ISO. For example,
1448
- // in Node 12 0000-01-01 is calculated as 6146/12/-583 instead of 10/11/-79 as
1449
- // expected.
1450
- vulnerableToBceBug =
1451
- new Date('0000-01-01T00:00Z').toLocaleDateString('en-US-u-ca-indian', { timeZone: 'UTC' }) !== '10/11/-79 Saka';
1452
- override checkIcuBugs(isoDate: ISODate) {
1453
- if (this.vulnerableToBceBug && isoDate.year < 1) {
1454
- throw new RangeError(
1455
- `calendar '${this.id}' is broken for ISO dates before 0001-01-01` +
1456
- ' (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)'
1457
- );
1458
- }
1459
- }
1460
- }
1461
-
1462
- /**
1463
- * Era metadata defined for each calendar.
1464
- * TODO: instead of optional properties, this should really have rules
1465
- * encoded in the type, e.g. isoEpoch is required unless reverseOf is present.
1466
- * */
1467
- interface InputEra {
1468
- /**
1469
- * Era code, used to populate the 'era' field of Temporal instances.
1470
- * See https://tc39.es/proposal-intl-era-monthcode/#table-eras
1471
- */
1472
- code: string;
1473
-
1474
- /**
1475
- * Names are additionally accepted as alternate era codes on input, and the
1476
- * first name is also output in error messages (and may be the era code if
1477
- * desired.)
1478
- * See https://tc39.es/proposal-intl-era-monthcode/#table-eras
1479
- * If absent, this field defaults to a single element matching the code.
1480
- */
1481
- names?: string[];
1482
-
1483
- /**
1484
- * Signed calendar year where this era begins.Will be
1485
- * 1 (or 0 for zero-based eras) for the anchor era assuming that `year`
1486
- * numbering starts at the beginning of the anchor era, which is true
1487
- * for all ICU calendars except Japanese. If an era starts mid-year
1488
- * then a calendar month and day are included. Otherwise
1489
- * `{ month: 1, day: 1 }` is assumed.
1490
- */
1491
- anchorEpoch?: CalendarYearOnly | CalendarYMD;
1492
-
1493
- /** ISO date of the first day of this era */
1494
- isoEpoch?: { year: number; month: number; day: number };
1495
-
1496
- /**
1497
- * If present, then this era counts years backwards like BC
1498
- * and this property points to the forward era. This must be
1499
- * the last (oldest) era in the array.
1500
- * */
1501
- reverseOf?: string;
1502
-
1503
- /**
1504
- * If true, the era's years are 0-based. If omitted or false,
1505
- * then the era's years are 1-based.
1506
- * */
1507
- hasYearZero?: boolean;
1508
-
1509
- /**
1510
- * Override if this era is the anchor. Not normally used because
1511
- * anchor eras are inferred.
1512
- * */
1513
- isAnchor?: boolean;
1514
- }
1515
- /**
1516
- * Transformation of the `InputEra` type with all fields filled in by
1517
- * `adjustEras()`
1518
- * */
1519
- interface Era {
1520
- /**
1521
- * Era code, used to populate the 'era' field of Temporal instances.
1522
- * See https://tc39.es/proposal-intl-era-monthcode/#table-eras
1523
- */
1524
- code: string;
1525
-
1526
- /**
1527
- * Names are additionally accepted as alternate era codes on input, and the
1528
- * first name is also output in error messages (and may be the era code if
1529
- * desired.)
1530
- * See https://tc39.es/proposal-intl-era-monthcode/#table-eras
1531
- * If absent, this field defaults to a single element matching the code.
1532
- */
1533
- names: string[];
1534
-
1535
- /**
1536
- * alternate name of the era used in old versions of ICU data
1537
- * format is `era{n}` where n is the zero-based index of the era
1538
- * with the oldest era being 0.
1539
- * */
1540
- genericName: string;
1541
-
1542
- /**
1543
- * Signed calendar year where this era begins. Will be 1 (or 0 for zero-based
1544
- * eras) for the anchor era assuming that `year` numbering starts at the
1545
- * beginning of the anchor era, which is true for all ICU calendars except
1546
- * Japanese. For input, the month and day are optional. If an era starts
1547
- * mid-year then a calendar month and day are included.
1548
- * Otherwise `{ month: 1, day: 1 }` is assumed.
1549
- */
1550
- anchorEpoch: CalendarYMD;
1551
-
1552
- /** ISO date of the first day of this era */
1553
- isoEpoch: ISODate;
1554
-
1555
- /**
1556
- * If present, then this era counts years backwards like BC
1557
- * and this property points to the forward era. This must be
1558
- * the last (oldest) era in the array.
1559
- * */
1560
- reverseOf?: Era;
1561
-
1562
- /**
1563
- * If true, the era's years are 0-based. If omitted or false,
1564
- * then the era's years are 1-based.
1565
- * */
1566
- hasYearZero?: boolean;
1567
-
1568
- /**
1569
- * Override if this era is the anchor. Not normally used because
1570
- * anchor eras are inferred.
1571
- * */
1572
- isAnchor?: boolean;
1573
- }
1574
-
1575
- /**
1576
- * This function adds additional metadata that makes it easier to work with
1577
- * eras. Note that it mutates and normalizes the original era objects, which is
1578
- * OK because this is non-observable, internal-only metadata.
1579
- *
1580
- * The result is an array of eras with the shape defined above.
1581
- * */
1582
- function adjustEras(erasParam: InputEra[]): { eras: Era[]; anchorEra: Era } {
1583
- let eras: (InputEra | Era)[] = erasParam;
1584
- if (eras.length === 0) {
1585
- throw new RangeError('Invalid era data: eras are required');
1586
- }
1587
- if (eras.length === 1 && eras[0].reverseOf) {
1588
- throw new RangeError('Invalid era data: anchor era cannot count years backwards');
1589
- }
1590
- if (eras.length === 1 && !eras[0].code) {
1591
- throw new RangeError('Invalid era data: at least one named era is required');
1592
- }
1593
- if (eras.filter((e) => e.reverseOf != null).length > 1) {
1594
- throw new RangeError('Invalid era data: only one era can count years backwards');
1595
- }
1596
-
1597
- // Find the "anchor era" which is the era used for (era-less) `year`. Reversed
1598
- // eras can never be anchors. The era without an `anchorEpoch` property is the
1599
- // anchor.
1600
- let anchorEra: Era | InputEra | undefined;
1601
- eras.forEach((e) => {
1602
- if (e.isAnchor || (!e.anchorEpoch && !e.reverseOf)) {
1603
- if (anchorEra) throw new RangeError('Invalid era data: cannot have multiple anchor eras');
1604
- anchorEra = e;
1605
- e.anchorEpoch = { year: e.hasYearZero ? 0 : 1 };
1606
- } else if (!e.code) {
1607
- throw new RangeError('If era name is blank, it must be the anchor era');
1608
- }
1609
- });
1610
-
1611
- // If the era name is undefined, then it's an anchor that doesn't interact
1612
- // with eras at all. For example, Japanese `year` is always the same as ISO
1613
- // `year`. So this "era" is the anchor era but isn't used for era matching.
1614
- // Strip it from the list that's returned.
1615
- eras = eras.filter((e) => e.code);
1616
-
1617
- eras.forEach((e) => {
1618
- // Some eras are mirror images of another era e.g. B.C. is the reverse of A.D.
1619
- // Replace the string-valued "reverseOf" property with the actual era object
1620
- // that's reversed.
1621
- const { reverseOf } = e;
1622
- if (reverseOf) {
1623
- const reversedEra = eras.find((era) => era.code === reverseOf);
1624
- if (reversedEra === undefined) {
1625
- throw new RangeError(`Invalid era data: unmatched reverseOf era: ${reverseOf}`);
1626
- }
1627
- e.reverseOf = reversedEra as Era; // genericName property added later
1628
- e.anchorEpoch = reversedEra.anchorEpoch;
1629
- e.isoEpoch = reversedEra.isoEpoch;
1630
- }
1631
- type YMD = {
1632
- year: number;
1633
- month: number;
1634
- day: number;
1635
- };
1636
- if ((e.anchorEpoch as YMD).month === undefined) (e.anchorEpoch as YMD).month = 1;
1637
- if ((e.anchorEpoch as YMD).day === undefined) (e.anchorEpoch as YMD).day = 1;
1638
- });
1639
-
1640
- // Ensure that the latest epoch is first in the array. This lets us try to
1641
- // match eras in index order, with the last era getting the remaining older
1642
- // years. Any reverse-signed era must be at the end.
1643
- eras.sort((e1, e2) => {
1644
- if (e1.reverseOf) return 1;
1645
- if (e2.reverseOf) return -1;
1646
- if (!e1.isoEpoch || !e2.isoEpoch) throw new RangeError('Invalid era data: missing ISO epoch');
1647
- return e2.isoEpoch.year - e1.isoEpoch.year;
1648
- });
1649
-
1650
- // If there's a reversed era, then the one before it must be the era that's
1651
- // being reversed.
1652
- const lastEraReversed = eras[eras.length - 1].reverseOf;
1653
- if (lastEraReversed) {
1654
- if (lastEraReversed !== eras[eras.length - 2]) {
1655
- throw new RangeError('Invalid era data: invalid reverse-sign era');
1656
- }
1657
- }
1658
-
1659
- // Finally, add a "genericName" property in the format "era{n} where `n` is
1660
- // zero-based index, with the oldest era being zero. This format is used by
1661
- // older versions of ICU data.
1662
- eras.forEach((e, i) => {
1663
- (e as Era).genericName = `era${eras.length - 1 - i}`;
1664
- });
1665
-
1666
- return { eras: eras as Era[], anchorEra: (anchorEra || eras[0]) as Era };
1667
- }
1668
-
1669
- function isGregorianLeapYear(year: number) {
1670
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
1671
- }
1672
-
1673
- /** Base for all Gregorian-like calendars. */
1674
- abstract class GregorianBaseHelperFixedEpoch extends HelperBase {
1675
- id: BuiltinCalendarId;
1676
- isoEpoch: ISODate;
1677
-
1678
- constructor(id: BuiltinCalendarId, isoEpoch: ISODate) {
1679
- super();
1680
- this.id = id;
1681
- this.isoEpoch = isoEpoch;
1682
- }
1683
- calendarType = 'solar' as const;
1684
- inLeapYear(calendarDate: CalendarYearOnly) {
1685
- const { year } = this.estimateIsoDate({ month: 1, day: 1, year: calendarDate.year });
1686
- return isGregorianLeapYear(year);
1687
- }
1688
- monthsInYear(/* calendarDate */) {
1689
- return 12;
1690
- }
1691
- minimumMonthLength(calendarDate: CalendarYM): number {
1692
- const { month } = calendarDate;
1693
- if (month === 2) return this.inLeapYear(calendarDate) ? 29 : 28;
1694
- return [4, 6, 9, 11].indexOf(month) >= 0 ? 30 : 31;
1695
- }
1696
- maximumMonthLength(calendarDate: CalendarYM): number {
1697
- return this.minimumMonthLength(calendarDate);
1698
- }
1699
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
1700
- const month = nonLeapMonthCodeNumberPart(monthCode);
1701
- return [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
1702
- }
1703
- estimateIsoDate(calendarDateParam: CalendarYMD) {
1704
- const calendarDate = this.adjustCalendarDate(calendarDateParam);
1705
- return ES.RegulateISODate(
1706
- calendarDate.year + this.isoEpoch.year,
1707
- calendarDate.month + this.isoEpoch.month,
1708
- calendarDate.day + this.isoEpoch.day,
1709
- 'constrain'
1710
- );
1711
- }
1712
- }
1713
-
1714
- /** Base for Gregorian-like calendars with eras. */
1715
- abstract class GregorianBaseHelper extends HelperBase {
1716
- id: BuiltinCalendarId;
1717
- anchorEra: Era;
1718
-
1719
- constructor(id: BuiltinCalendarId, originalEras: InputEra[]) {
1720
- super();
1721
- this.id = id;
1722
- const { eras, anchorEra } = adjustEras(originalEras);
1723
- this.anchorEra = anchorEra;
1724
- this.eras = eras;
1725
- }
1726
- override hasEra = true;
1727
- calendarType = 'solar' as const;
1728
- inLeapYear(calendarDate: CalendarYearOnly) {
1729
- // Calendars that don't override this method use the same months and leap
1730
- // years as Gregorian. Once we know the ISO year corresponding to the
1731
- // calendar year, we'll know if it's a leap year or not.
1732
- const { year } = this.estimateIsoDate({ month: 1, day: 1, year: calendarDate.year });
1733
- return isGregorianLeapYear(year);
1734
- }
1735
- monthsInYear(/* calendarDate */) {
1736
- return 12;
1737
- }
1738
- minimumMonthLength(calendarDate: CalendarYM): number {
1739
- const { month } = calendarDate;
1740
- if (month === 2) return this.inLeapYear(calendarDate) ? 29 : 28;
1741
- return [4, 6, 9, 11].indexOf(month) >= 0 ? 30 : 31;
1742
- }
1743
- maximumMonthLength(calendarDate: CalendarYM): number {
1744
- return this.minimumMonthLength(calendarDate);
1745
- }
1746
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
1747
- const month = nonLeapMonthCodeNumberPart(monthCode);
1748
- return [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
1749
- }
1750
- /** Fill in missing parts of the (year, era, eraYear) tuple */
1751
- completeEraYear(
1752
- calendarDate: FullCalendarDate
1753
- ): FullCalendarDate & Required<Pick<FullCalendarDate, 'era' | 'eraYear'>> {
1754
- const checkField = (property: keyof FullCalendarDate, value: string | number | undefined, names?: string[]) => {
1755
- const currentValue = calendarDate[property];
1756
- if (currentValue != null && currentValue != value && !((names || []) as unknown[]).includes(currentValue)) {
1757
- // Prefer displaying an era alias, instead of "gregory-inverse"
1758
- const preferredName = names?.[0];
1759
- const expected = preferredName ? `${value} (also called ${preferredName})` : value;
1760
- throw new RangeError(`Input ${property} ${currentValue} doesn't match calculated value ${expected}`);
1761
- }
1762
- };
1763
- const eraFromYear = (year: number) => {
1764
- let eraYear;
1765
- const adjustedCalendarDate = { ...calendarDate, year };
1766
- const matchingEra = this.eras.find((e, i) => {
1767
- if (i === this.eras.length - 1) {
1768
- if (e.reverseOf) {
1769
- // This is a reverse-sign era (like BCE) which must be the oldest
1770
- // era. Count years backwards.
1771
- if (year > 0) throw new RangeError(`Signed year ${year} is invalid for era ${e.code}`);
1772
- eraYear = e.anchorEpoch.year - year;
1773
- return true;
1774
- }
1775
- // last era always gets all "leftover" (older than epoch) years,
1776
- // so no need for a comparison like below.
1777
- eraYear = year - e.anchorEpoch.year + (e.hasYearZero ? 0 : 1);
1778
- return true;
1779
- }
1780
- const comparison = this.compareCalendarDates(adjustedCalendarDate, e.anchorEpoch);
1781
- if (comparison >= 0) {
1782
- eraYear = year - e.anchorEpoch.year + (e.hasYearZero ? 0 : 1);
1783
- return true;
1784
- }
1785
- return false;
1786
- });
1787
- if (!matchingEra) throw new RangeError(`Year ${year} was not matched by any era`);
1788
- return { eraYear: eraYear as unknown as number, era: matchingEra.code, eraNames: matchingEra.names };
1789
- };
1790
-
1791
- let { year, eraYear, era } = calendarDate;
1792
- if (year != null) {
1793
- const matchData = eraFromYear(year);
1794
- ({ eraYear, era } = matchData);
1795
- checkField('era', era, matchData?.eraNames);
1796
- checkField('eraYear', eraYear);
1797
- } else if (eraYear != null) {
1798
- if (era === undefined) throw new RangeError('era and eraYear must be provided together');
1799
- // TS limitation: https://github.com/microsoft/TypeScript/issues/11498
1800
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1801
- const matchingEra = this.eras.find(({ code, names = [] }) => code === era || names.includes(era!));
1802
- if (!matchingEra) throw new RangeError(`Era ${era} (ISO year ${eraYear}) was not matched by any era`);
1803
- if (matchingEra.reverseOf) {
1804
- year = matchingEra.anchorEpoch.year - eraYear;
1805
- } else {
1806
- year = eraYear + matchingEra.anchorEpoch.year - (matchingEra.hasYearZero ? 0 : 1);
1807
- }
1808
- checkField('year', year);
1809
- // We'll accept dates where the month/day is earlier than the start of
1810
- // the era or after its end as long as it's in the same year. If that
1811
- // happens, we'll adjust the era/eraYear pair to be the correct era for
1812
- // the `year`.
1813
- ({ eraYear, era } = eraFromYear(year));
1814
- } else {
1815
- throw new RangeError('Either year or eraYear and era are required');
1816
- }
1817
- return { ...calendarDate, year, eraYear, era };
1818
- }
1819
- override adjustCalendarDate(
1820
- calendarDateParam: Partial<FullCalendarDate>,
1821
- cache?: OneObjectCache,
1822
- overflow: Overflow = 'constrain'
1823
- ): FullCalendarDate {
1824
- let calendarDate = calendarDateParam;
1825
- // Because this is not a lunisolar calendar, it's safe to convert monthCode to a number
1826
- const { month, monthCode } = calendarDate;
1827
- if (month === undefined) calendarDate = { ...calendarDate, month: nonLeapMonthCodeNumberPart(monthCode as string) };
1828
- this.validateCalendarDate(calendarDate);
1829
- calendarDate = this.completeEraYear(calendarDate);
1830
- return super.adjustCalendarDate(calendarDate, cache, overflow);
1831
- }
1832
- estimateIsoDate(calendarDateParam: CalendarYMD) {
1833
- const calendarDate = this.adjustCalendarDate(calendarDateParam);
1834
- const { year, month, day } = calendarDate;
1835
- const { anchorEra } = this;
1836
- const isoYearEstimate = year + anchorEra.isoEpoch.year - (anchorEra.hasYearZero ? 0 : 1);
1837
- return ES.RegulateISODate(isoYearEstimate, month, day, 'constrain');
1838
- }
1839
- }
1840
-
1841
- /**
1842
- * Some calendars are identical to Gregorian except era and year. For these
1843
- * calendars, we can avoid using Intl.DateTimeFormat and just calculate the
1844
- * year, era, and eraYear. This is faster (because Intl.DateTimeFormat is slow
1845
- * and uses a huge amount of RAM), and it avoids ICU bugs like
1846
- * https://bugs.chromium.org/p/chromium/issues/detail?id=1173158.
1847
- */
1848
- abstract class SameMonthDayAsGregorianBaseHelper extends GregorianBaseHelper {
1849
- constructor(id: BuiltinCalendarId, originalEras: InputEra[]) {
1850
- super(id, originalEras);
1851
- }
1852
- override isoToCalendarDate(isoDate: ISODate): FullCalendarDate {
1853
- // Month and day are same as ISO, so bypass Intl.DateTimeFormat and
1854
- // calculate the year, era, and eraYear here.
1855
- const { year: isoYear, month, day } = isoDate;
1856
- const monthCode = buildMonthCode(month);
1857
- const year = isoYear - this.anchorEra.isoEpoch.year + 1;
1858
- return this.completeEraYear({ year, month, monthCode, day });
1859
- }
1860
- }
1861
- const OrthodoxOps = {
1862
- inLeapYear(calendarDate: CalendarYearOnly) {
1863
- // Leap years happen one year before the Julian leap year. Note that this
1864
- // calendar is based on the Julian calendar which has a leap year every 4
1865
- // years, unlike the Gregorian calendar which doesn't have leap years on
1866
- // years divisible by 100 except years divisible by 400.
1867
- //
1868
- // Note that we're assuming that leap years in before-epoch times match
1869
- // how leap years are defined now. This is probably not accurate but I'm
1870
- // not sure how better to do it.
1871
- const { year } = calendarDate;
1872
- return (year + 1) % 4 === 0;
1873
- },
1874
- monthsInYear(/* calendarDate */) {
1875
- return 13;
1876
- },
1877
- minimumMonthLength(calendarDate: CalendarYM) {
1878
- const { month } = calendarDate;
1879
- // Ethiopian/Coptic calendars have 12 30-day months and an extra 5-6 day 13th month.
1880
- if (month === 13) return this.inLeapYear(calendarDate) ? 6 : 5;
1881
- return 30;
1882
- },
1883
- maximumMonthLength(calendarDate: CalendarYM) {
1884
- return this.minimumMonthLength(calendarDate);
1885
- },
1886
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
1887
- return monthCode === 'M13' ? 6 : 30;
1888
- }
1889
- };
1890
- abstract class OrthodoxBaseHelperFixedEpoch extends GregorianBaseHelperFixedEpoch {
1891
- constructor(id: BuiltinCalendarId, isoEpoch: ISODate) {
1892
- super(id, isoEpoch);
1893
- }
1894
- override inLeapYear = OrthodoxOps.inLeapYear;
1895
- override monthsInYear = OrthodoxOps.monthsInYear;
1896
- override minimumMonthLength = OrthodoxOps.minimumMonthLength;
1897
- override maximumMonthLength = OrthodoxOps.maximumMonthLength;
1898
- override maxLengthOfMonthCodeInAnyYear = OrthodoxOps.maxLengthOfMonthCodeInAnyYear;
1899
- }
1900
- abstract class OrthodoxBaseHelper extends GregorianBaseHelper {
1901
- constructor(id: BuiltinCalendarId, originalEras: InputEra[]) {
1902
- super(id, originalEras);
1903
- }
1904
- override inLeapYear = OrthodoxOps.inLeapYear;
1905
- override monthsInYear = OrthodoxOps.monthsInYear;
1906
- override minimumMonthLength = OrthodoxOps.minimumMonthLength;
1907
- override maximumMonthLength = OrthodoxOps.maximumMonthLength;
1908
- override maxLengthOfMonthCodeInAnyYear = OrthodoxOps.maxLengthOfMonthCodeInAnyYear;
1909
- }
1910
-
1911
- // `coptic` and `ethiopic` calendars are very similar to `ethioaa` calendar,
1912
- // with the following differences:
1913
- // - Coptic uses BCE-like positive numbers for years before its epoch (the other
1914
- // two use negative year numbers before epoch)
1915
- // - Coptic has a different epoch date
1916
- // - Ethiopic has an additional second era that starts at the same date as the
1917
- // zero era of ethioaa.
1918
- class EthioaaHelper extends OrthodoxBaseHelperFixedEpoch {
1919
- constructor() {
1920
- super('ethioaa', { year: -5492, month: 7, day: 17 });
1921
- }
1922
- }
1923
- class CopticHelper extends OrthodoxBaseHelper {
1924
- constructor() {
1925
- super('coptic', [
1926
- { code: 'coptic', isoEpoch: { year: 284, month: 8, day: 29 } },
1927
- { code: 'coptic-inverse', reverseOf: 'coptic' }
1928
- ]);
1929
- }
1930
- }
1931
-
1932
- // Anchor is currently the older era to match ethioaa, but should it be the newer era?
1933
- // See https://github.com/tc39/ecma402/issues/534 for discussion.
1934
- class EthiopicHelper extends OrthodoxBaseHelper {
1935
- constructor() {
1936
- super('ethiopic', [
1937
- { code: 'ethioaa', names: ['ethiopic-amete-alem', 'mundi'], isoEpoch: { year: -5492, month: 7, day: 17 } },
1938
- { code: 'ethiopic', names: ['incar'], isoEpoch: { year: 8, month: 8, day: 27 }, anchorEpoch: { year: 5501 } }
1939
- ]);
1940
- }
1941
- }
1942
-
1943
- class RocHelper extends SameMonthDayAsGregorianBaseHelper {
1944
- constructor() {
1945
- super('roc', [
1946
- { code: 'roc', names: ['minguo'], isoEpoch: { year: 1912, month: 1, day: 1 } },
1947
- { code: 'roc-inverse', names: ['before-roc'], reverseOf: 'roc' }
1948
- ]);
1949
- }
1950
- }
1951
-
1952
- class BuddhistHelper extends GregorianBaseHelperFixedEpoch {
1953
- constructor() {
1954
- super('buddhist', { year: -543, month: 1, day: 1 });
1955
- }
1956
- }
1957
-
1958
- class GregoryHelper extends SameMonthDayAsGregorianBaseHelper {
1959
- constructor() {
1960
- super('gregory', [
1961
- { code: 'gregory', names: ['ad', 'ce'], isoEpoch: { year: 1, month: 1, day: 1 } },
1962
- { code: 'gregory-inverse', names: ['be', 'bce'], reverseOf: 'gregory' }
1963
- ]);
1964
- }
1965
- override reviseIntlEra<T extends Partial<EraAndEraYear>>(calendarDate: T /*, isoDate: IsoDate*/): T {
1966
- let { era, eraYear } = calendarDate;
1967
- // Firefox 96 introduced a bug where the `'short'` format of the era
1968
- // option mistakenly returns the one-letter (narrow) format instead. The
1969
- // code below handles either the correct or Firefox-buggy format. See
1970
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
1971
- if (era === 'b') era = 'gregory-inverse';
1972
- if (era === 'a') era = 'gregory';
1973
- return { era, eraYear } as T;
1974
- }
1975
- override getFirstDayOfWeek() {
1976
- return 1;
1977
- }
1978
- override getMinimalDaysInFirstWeek() {
1979
- return 1;
1980
- }
1981
- }
1982
-
1983
- // NOTE: Only the 5 modern eras (Meiji and later) are included. For dates
1984
- // before Meiji 1, the `ce` and `bce` eras are used. Challenges with pre-Meiji
1985
- // eras include:
1986
- // - Start/end dates of older eras are not precisely defined, which is
1987
- // challenging given Temporal's need for precision
1988
- // - Some era dates and/or names are disputed by historians
1989
- // - As historical research proceeds, new eras are discovered and existing era
1990
- // dates are modified, leading to considerable churn which is not good for
1991
- // Temporal use.
1992
- // - The earliest era (in 645 CE) may not end up being the earliest depending
1993
- // on future historical scholarship
1994
- // - Before Meiji, Japan used a lunar (or lunisolar?) calendar but AFAIK
1995
- // that's not reflected in the ICU implementation.
1996
- //
1997
- // For more discussion: https://github.com/tc39/proposal-temporal/issues/526.
1998
- //
1999
- // Here's a full list of CLDR/ICU eras:
2000
- // https://github.com/unicode-org/icu/blob/master/icu4c/source/data/locales/root.txt#L1582-L1818
2001
- // https://github.com/unicode-org/cldr/blob/master/common/supplemental/supplementalData.xml#L4310-L4546
2002
- //
2003
- // NOTE: Japan started using the Gregorian calendar in 6 Meiji, replacing a
2004
- // lunisolar calendar. So the day before January 1 of 6 Meiji (1873) was not
2005
- // December 31, but December 2, of 5 Meiji (1872). The existing Ecma-402
2006
- // Japanese calendar doesn't seem to take this into account, so neither do we:
2007
- // > args = ['en-ca-u-ca-japanese', { era: 'short' }]
2008
- // > new Date('1873-01-01T12:00').toLocaleString(...args)
2009
- // '1 1, 6 Meiji, 12:00:00 PM'
2010
- // > new Date('1872-12-31T12:00').toLocaleString(...args)
2011
- // '12 31, 5 Meiji, 12:00:00 PM'
2012
- class JapaneseHelper extends SameMonthDayAsGregorianBaseHelper {
2013
- constructor() {
2014
- super('japanese', [
2015
- // The Japanese calendar `year` is just the ISO year, because (unlike other
2016
- // ICU calendars) there's no obvious "default era", we use the ISO year.
2017
- { code: 'reiwa', isoEpoch: { year: 2019, month: 5, day: 1 }, anchorEpoch: { year: 2019, month: 5, day: 1 } },
2018
- { code: 'heisei', isoEpoch: { year: 1989, month: 1, day: 8 }, anchorEpoch: { year: 1989, month: 1, day: 8 } },
2019
- { code: 'showa', isoEpoch: { year: 1926, month: 12, day: 25 }, anchorEpoch: { year: 1926, month: 12, day: 25 } },
2020
- { code: 'taisho', isoEpoch: { year: 1912, month: 7, day: 30 }, anchorEpoch: { year: 1912, month: 7, day: 30 } },
2021
- { code: 'meiji', isoEpoch: { year: 1868, month: 9, day: 8 }, anchorEpoch: { year: 1868, month: 9, day: 8 } },
2022
- { code: 'japanese', names: ['japanese', 'gregory', 'ad', 'ce'], isoEpoch: { year: 1, month: 1, day: 1 } },
2023
- { code: 'japanese-inverse', names: ['japanese-inverse', 'gregory-inverse', 'bc', 'bce'], reverseOf: 'japanese' }
2024
- ]);
2025
- }
2026
-
2027
- override erasBeginMidYear = true;
2028
-
2029
- override reviseIntlEra<T extends Partial<EraAndEraYear>>(calendarDate: T, isoDate: ISODate): T {
2030
- const { era, eraYear } = calendarDate;
2031
- const { year: isoYear } = isoDate;
2032
- if (this.eras.find((e) => e.code === era)) return { era, eraYear } as T;
2033
- return (
2034
- isoYear < 1 ? { era: 'japanese-inverse', eraYear: 1 - isoYear } : { era: 'japanese', eraYear: isoYear }
2035
- ) as T;
2036
- }
2037
- }
2038
-
2039
- interface ChineseMonthInfo {
2040
- [key: string]: { monthIndex: number; daysInMonth: number };
2041
- }
2042
- interface ChineseDraftMonthInfo {
2043
- [key: string]: { monthIndex: number; daysInMonth?: number };
2044
- }
2045
-
2046
- abstract class ChineseBaseHelper extends HelperBase {
2047
- abstract override id: BuiltinCalendarId;
2048
- calendarType = 'lunisolar' as const;
2049
- inLeapYear(calendarDate: CalendarYearOnly, cache: OneObjectCache) {
2050
- const months = this.getMonthList(calendarDate.year, cache);
2051
- return Object.entries(months).length === 13;
2052
- }
2053
- monthsInYear(calendarDate: CalendarYearOnly, cache: OneObjectCache) {
2054
- return this.inLeapYear(calendarDate, cache) ? 13 : 12;
2055
- }
2056
- minimumMonthLength(/* calendarDate */) {
2057
- return 29;
2058
- }
2059
- maximumMonthLength(/* calendarDate */) {
2060
- return 30;
2061
- }
2062
- maxLengthOfMonthCodeInAnyYear(monthCode: string) {
2063
- // See note below about ICU4C vs ICU4X. It is possible this override should
2064
- // always return 30.
2065
- return ['M01L', 'M09L', 'M10L', 'M11L', 'M12L'].includes(monthCode) ? 29 : 30;
2066
- }
2067
- override monthDaySearchStartYear(monthCode: string, day: number) {
2068
- // Note that ICU4C actually has _no_ years in which leap months M01L and
2069
- // M09L through M12L have 30 days. The values marked with (*) here are years
2070
- // in which the leap month occurs with 29 days. ICU4C disagrees with ICU4X
2071
- // here and it is not clear which is correct.
2072
- const monthMap: Record<string, [number, number]> = {
2073
- M01L: [1651, 1651], // *
2074
- M02L: [1947, 1765],
2075
- M03L: [1966, 1955],
2076
- M04L: [1963, 1944],
2077
- M05L: [1971, 1952],
2078
- M06L: [1960, 1941],
2079
- M07L: [1968, 1938],
2080
- M08L: [1957, 1718],
2081
- M09L: [1832, 1832], // *
2082
- M10L: [1870, 1870], // *
2083
- M11L: [1814, 1814], // *
2084
- M12L: [1890, 1890] // *
2085
- };
2086
- const years = monthMap[monthCode] ?? [1972, 1972];
2087
- return day < 30 ? years[0] : years[1];
2088
- }
2089
- getMonthList(calendarYear: number, cache: OneObjectCache): ChineseMonthInfo {
2090
- if (calendarYear === undefined) {
2091
- throw new TypeError('Missing year');
2092
- }
2093
- const key = JSON.stringify({ func: 'getMonthList', calendarYear, id: this.id });
2094
- const cached = cache.get(key);
2095
- if (cached) return cached;
2096
- const dateTimeFormat = this.getFormatter();
2097
- const getCalendarDate = (isoYear: number, daysPastFeb1: number) => {
2098
- const isoStringFeb1 = toUtcIsoDateString({ isoYear, isoMonth: 2, isoDay: 1 });
2099
- const legacyDate = new Date(isoStringFeb1);
2100
- // Now add the requested number of days, which may wrap to the next month.
2101
- legacyDate.setUTCDate(daysPastFeb1 + 1);
2102
- const newYearGuess = dateTimeFormat.formatToParts(legacyDate);
2103
- // The 'month' and 'day' parts are guaranteed to be present because the
2104
- // formatter was created with month and day options.
2105
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2106
- const calendarMonthString = newYearGuess.find((tv) => tv.type === 'month')!.value;
2107
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2108
- const calendarDay = +newYearGuess.find((tv) => tv.type === 'day')!.value;
2109
- const calendarYearPartToVerify = newYearGuess.find((tv) => (tv.type as string) === 'relatedYear');
2110
- let calendarYearToVerify: number | undefined;
2111
- if (calendarYearPartToVerify !== undefined) {
2112
- calendarYearToVerify = +calendarYearPartToVerify.value;
2113
- } else {
2114
- // Node 12 has outdated ICU data that lacks the `relatedYear` field in the
2115
- // output of Intl.DateTimeFormat.formatToParts.
2116
- throw new RangeError(
2117
- `Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`
2118
- );
2119
- }
2120
- return { calendarMonthString, calendarDay, calendarYearToVerify };
2121
- };
2122
-
2123
- // First, find a date close to Chinese New Year. Feb 17 will either be in
2124
- // the first month or near the end of the last month of the previous year.
2125
- let isoDaysDelta = 17;
2126
- let { calendarMonthString, calendarDay, calendarYearToVerify } = getCalendarDate(calendarYear, isoDaysDelta);
2127
-
2128
- // If we didn't guess the first month correctly, add (almost in some months)
2129
- // a lunar month
2130
- if (calendarMonthString !== '1') {
2131
- isoDaysDelta += 29;
2132
- ({ calendarMonthString, calendarDay } = getCalendarDate(calendarYear, isoDaysDelta));
2133
- }
2134
-
2135
- // Now back up to near the start of the first month, but not too near that
2136
- // off-by-one issues matter.
2137
- isoDaysDelta -= calendarDay - 5;
2138
- const result = {} as ChineseDraftMonthInfo;
2139
- let monthIndex = 1;
2140
- let oldCalendarDay: number | undefined;
2141
- let oldMonthString: string | undefined;
2142
- let done = false;
2143
- do {
2144
- ({ calendarMonthString, calendarDay, calendarYearToVerify } = getCalendarDate(calendarYear, isoDaysDelta));
2145
- if (oldCalendarDay) {
2146
- result[oldMonthString as string].daysInMonth = oldCalendarDay + 30 - calendarDay;
2147
- }
2148
- if (calendarYearToVerify !== calendarYear) {
2149
- done = true;
2150
- } else {
2151
- result[calendarMonthString] = { monthIndex: monthIndex++ };
2152
- // Move to the next month. Because months are sometimes 29 days, the day of the
2153
- // calendar month will move forward slowly but not enough to flip over to a new
2154
- // month before the loop ends at 12-13 months.
2155
- isoDaysDelta += 30;
2156
- }
2157
- oldCalendarDay = calendarDay;
2158
- oldMonthString = calendarMonthString;
2159
- } while (!done);
2160
- result[oldMonthString].daysInMonth = oldCalendarDay + 30 - calendarDay;
2161
-
2162
- cache.set(key, result);
2163
- return result as ChineseMonthInfo;
2164
- }
2165
- estimateIsoDate(calendarDate: CalendarYMD) {
2166
- const { year, month } = calendarDate;
2167
- return { year, month: month >= 12 ? 12 : month + 1, day: 1 };
2168
- }
2169
- override adjustCalendarDate(
2170
- calendarDate: Partial<FullCalendarDate>,
2171
- cache: OneObjectCache,
2172
- overflow: Overflow = 'constrain',
2173
- fromLegacyDate = false
2174
- ): FullCalendarDate {
2175
- let { year, month, monthExtra, day, monthCode } = calendarDate;
2176
- if (year === undefined) throw new TypeError('Missing property: year');
2177
- if (fromLegacyDate) {
2178
- // Legacy Date output returns a string that's an integer with an optional
2179
- // "bis" suffix used only by the Chinese/Dangi calendar to indicate a leap
2180
- // month. Below we'll normalize the output.
2181
- if (monthExtra && monthExtra !== 'bis') throw new RangeError(`Unexpected leap month suffix: ${monthExtra}`);
2182
- const monthCode = buildMonthCode(month as number, monthExtra !== undefined);
2183
- const monthString = `${month}${monthExtra || ''}`;
2184
- const months = this.getMonthList(year, cache);
2185
- const monthInfo = months[monthString];
2186
- if (monthInfo === undefined) throw new RangeError(`Unmatched month ${monthString} in Chinese year ${year}`);
2187
- month = monthInfo.monthIndex;
2188
- return { year, month, day: day as number, monthCode };
2189
- } else {
2190
- // When called without input coming from legacy Date output,
2191
- // simply ensure that all fields are present.
2192
- this.validateCalendarDate(calendarDate);
2193
- if (month === undefined) {
2194
- ES.assertExists(monthCode);
2195
- const months = this.getMonthList(year, cache);
2196
- let numberPart = monthCode.replace(/^M|L$/g, (ch) => (ch === 'L' ? 'bis' : ''));
2197
- if (numberPart[0] === '0') numberPart = numberPart.slice(1);
2198
- let monthInfo = months[numberPart];
2199
- month = monthInfo && monthInfo.monthIndex;
2200
-
2201
- // If this leap month isn't present in this year, constrain to the same
2202
- // day of the previous month.
2203
- if (month === undefined && monthCode.endsWith('L') && monthCode != 'M13L' && overflow === 'constrain') {
2204
- const withoutML = +monthCode.replace(/^M0?|L$/g, '');
2205
- monthInfo = months[withoutML];
2206
- if (monthInfo) {
2207
- month = monthInfo.monthIndex;
2208
- monthCode = buildMonthCode(withoutML);
2209
- }
2210
- }
2211
- if (month === undefined) {
2212
- throw new RangeError(`Unmatched month ${monthCode} in Chinese year ${year}`);
2213
- }
2214
- } else if (monthCode === undefined) {
2215
- const months = this.getMonthList(year, cache);
2216
- const monthEntries = Object.entries(months);
2217
- const largestMonth = monthEntries.length;
2218
- if (overflow === 'reject') {
2219
- ES.RejectToRange(month, 1, largestMonth);
2220
- ES.RejectToRange(day as number, 1, this.maximumMonthLength());
2221
- } else {
2222
- month = ES.ConstrainToRange(month, 1, largestMonth);
2223
- day = ES.ConstrainToRange(day, 1, this.maximumMonthLength());
2224
- }
2225
- const matchingMonthEntry = monthEntries.find((entry) => entry[1].monthIndex === month);
2226
- if (matchingMonthEntry === undefined) {
2227
- throw new RangeError(`Invalid month ${month} in Chinese year ${year}`);
2228
- }
2229
- monthCode = buildMonthCode(
2230
- +matchingMonthEntry[0].replace('bis', ''),
2231
- matchingMonthEntry[0].indexOf('bis') !== -1
2232
- );
2233
- } else {
2234
- // Both month and monthCode are present. Make sure they don't conflict.
2235
- const months = this.getMonthList(year, cache);
2236
- let numberPart = monthCode.replace(/^M|L$/g, (ch) => (ch === 'L' ? 'bis' : ''));
2237
- if (numberPart[0] === '0') numberPart = numberPart.slice(1);
2238
- const monthInfo = months[numberPart];
2239
- if (!monthInfo) throw new RangeError(`Unmatched monthCode ${monthCode} in Chinese year ${year}`);
2240
- if (month !== monthInfo.monthIndex) {
2241
- throw new RangeError(`monthCode ${monthCode} doesn't correspond to month ${month} in Chinese year ${year}`);
2242
- }
2243
- }
2244
- return { ...calendarDate, year, month, monthCode, day: day as number };
2245
- }
2246
- }
2247
- }
2248
-
2249
- class ChineseHelper extends ChineseBaseHelper {
2250
- id = 'chinese' as const;
2251
- }
2252
-
2253
- // Dangi (Korean) calendar has same implementation as Chinese
2254
- class DangiHelper extends ChineseBaseHelper {
2255
- id = 'dangi' as const;
2256
- }
2257
-
2258
- /**
2259
- * Common implementation of all non-ISO calendars.
2260
- * Per-calendar id and logic live in `id` and `helper` properties attached later.
2261
- * This split allowed an easy separation between code that was similar between
2262
- * ISO and non-ISO implementations vs. code that was very different.
2263
- */
2264
- class NonIsoCalendar implements CalendarImpl {
2265
- constructor(private readonly helper: HelperBase) {}
2266
- extraFields(fields: FieldKey[]): FieldKey[] {
2267
- if (this.helper.hasEra && fields.includes('year')) {
2268
- return ['era', 'eraYear'];
2269
- }
2270
- return [];
2271
- }
2272
- resolveFields(fields: CalendarFieldsRecord /* , type */) {
2273
- if (this.helper.calendarType !== 'lunisolar') {
2274
- const cache = new OneObjectCache();
2275
- const largestMonth = this.helper.monthsInYear({ year: fields.year ?? 1972 }, cache);
2276
- resolveNonLunisolarMonth(fields, undefined, largestMonth);
2277
- }
2278
- }
2279
- dateToISO(fields: CalendarDateFields, overflow: Overflow) {
2280
- const cache = new OneObjectCache();
2281
- const result = this.helper.calendarToIsoDate(fields, overflow, cache);
2282
- cache.setObject(result);
2283
- return result;
2284
- }
2285
- monthDayToISOReferenceDate(fields: MonthDayFromFieldsObject, overflow: Overflow) {
2286
- const cache = new OneObjectCache();
2287
- const result = this.helper.monthDayFromFields(fields, overflow, cache);
2288
- // result.year is a reference year where this month/day exists in this calendar
2289
- cache.setObject(result);
2290
- return result;
2291
- }
2292
- fieldKeysToIgnore(
2293
- keys: Exclude<keyof Temporal.PlainDateLike, 'calendar'>[]
2294
- ): Exclude<keyof Temporal.PlainDateLike, 'calendar'>[] {
2295
- const result = new Set<(typeof keys)[number]>();
2296
- for (let ix = 0; ix < keys.length; ix++) {
2297
- const key = keys[ix];
2298
- result.add(key);
2299
- switch (key) {
2300
- case 'era':
2301
- result.add('eraYear');
2302
- result.add('year');
2303
- break;
2304
- case 'eraYear':
2305
- result.add('era');
2306
- result.add('year');
2307
- break;
2308
- case 'year':
2309
- result.add('era');
2310
- result.add('eraYear');
2311
- break;
2312
- case 'month':
2313
- result.add('monthCode');
2314
- // See https://github.com/tc39/proposal-temporal/issues/1784
2315
- if (this.helper.erasBeginMidYear) {
2316
- result.add('era');
2317
- result.add('eraYear');
2318
- }
2319
- break;
2320
- case 'monthCode':
2321
- result.add('month');
2322
- if (this.helper.erasBeginMidYear) {
2323
- result.add('era');
2324
- result.add('eraYear');
2325
- }
2326
- break;
2327
- case 'day':
2328
- if (this.helper.erasBeginMidYear) {
2329
- result.add('era');
2330
- result.add('eraYear');
2331
- }
2332
- break;
2333
- }
2334
- }
2335
- return arrayFromSet(result);
2336
- }
2337
- dateAdd(isoDate: ISODate, { years, months, weeks, days }: DateDuration, overflow: Overflow) {
2338
- const cache = OneObjectCache.getCacheForObject(isoDate);
2339
- const calendarDate = this.helper.isoToCalendarDate(isoDate, cache);
2340
- const added = this.helper.addCalendar(calendarDate, { years, months, weeks, days }, overflow, cache);
2341
- const isoAdded = this.helper.calendarToIsoDate(added, 'constrain', cache);
2342
- // The new object's cache starts with the cache of the old object
2343
- if (!OneObjectCache.getCacheForObject(isoAdded)) {
2344
- const newCache = new OneObjectCache(cache);
2345
- newCache.setObject(isoAdded);
2346
- }
2347
- return isoAdded;
2348
- }
2349
- dateUntil(one: ISODate, two: ISODate, largestUnit: Temporal.DateUnit) {
2350
- const cacheOne = OneObjectCache.getCacheForObject(one);
2351
- const cacheTwo = OneObjectCache.getCacheForObject(two);
2352
- const calendarOne = this.helper.isoToCalendarDate(one, cacheOne);
2353
- const calendarTwo = this.helper.isoToCalendarDate(two, cacheTwo);
2354
- const result = this.helper.untilCalendar(calendarOne, calendarTwo, largestUnit, cacheOne);
2355
- return result;
2356
- }
2357
- isoToDate<
2358
- Request extends Partial<Record<keyof CalendarDateRecord, true>>,
2359
- T extends {
2360
- [Field in keyof CalendarDateRecord]: Request extends { [K in Field]: true } ? CalendarDateRecord[Field] : never;
2361
- }
2362
- >(isoDate: ISODate, requestedFields: Request): T {
2363
- const cache = OneObjectCache.getCacheForObject(isoDate);
2364
- const calendarDate: Partial<CalendarDateRecord> & FullCalendarDate = this.helper.isoToCalendarDate(isoDate, cache);
2365
- if (requestedFields.dayOfWeek) {
2366
- calendarDate.dayOfWeek = impl['iso8601'].isoToDate(isoDate, { dayOfWeek: true }).dayOfWeek;
2367
- }
2368
- if (requestedFields.dayOfYear) {
2369
- const startOfYear = this.helper.startOfCalendarYear(calendarDate);
2370
- const diffDays = this.helper.calendarDaysUntil(startOfYear, calendarDate, cache);
2371
- calendarDate.dayOfYear = diffDays + 1;
2372
- }
2373
- if (requestedFields.weekOfYear) calendarDate.weekOfYear = calendarDateWeekOfYear(this.helper.id, isoDate);
2374
- calendarDate.daysInWeek = 7;
2375
- if (requestedFields.daysInMonth) calendarDate.daysInMonth = this.helper.daysInMonth(calendarDate, cache);
2376
- if (requestedFields.daysInYear) {
2377
- const startOfYearCalendar = this.helper.startOfCalendarYear(calendarDate);
2378
- const startOfNextYearCalendar = this.helper.addCalendar(startOfYearCalendar, { years: 1 }, 'constrain', cache);
2379
- calendarDate.daysInYear = this.helper.calendarDaysUntil(startOfYearCalendar, startOfNextYearCalendar, cache);
2380
- }
2381
- if (requestedFields.monthsInYear) calendarDate.monthsInYear = this.helper.monthsInYear(calendarDate, cache);
2382
- if (requestedFields.inLeapYear) calendarDate.inLeapYear = this.helper.inLeapYear(calendarDate, cache);
2383
- return calendarDate as T;
2384
- }
2385
- getFirstDayOfWeek(): number | undefined {
2386
- return this.helper.getFirstDayOfWeek();
2387
- }
2388
- getMinimalDaysInFirstWeek(): number | undefined {
2389
- return this.helper.getMinimalDaysInFirstWeek();
2390
- }
2391
- }
2392
-
2393
- for (const Helper of [
2394
- HebrewHelper,
2395
- PersianHelper,
2396
- EthiopicHelper,
2397
- EthioaaHelper,
2398
- CopticHelper,
2399
- ChineseHelper,
2400
- DangiHelper,
2401
- RocHelper,
2402
- IndianHelper,
2403
- BuddhistHelper,
2404
- GregoryHelper,
2405
- JapaneseHelper,
2406
- IslamicHelper,
2407
- IslamicUmalquraHelper,
2408
- IslamicTblaHelper,
2409
- IslamicCivilHelper,
2410
- IslamicRgsaHelper,
2411
- IslamicCcHelper
2412
- ]) {
2413
- const helper = new Helper();
2414
- // Construct a new NonIsoCalendar instance with the given Helper implementation that contains
2415
- // per-calendar logic.
2416
- impl[helper.id] = new NonIsoCalendar(helper);
2417
- }
2418
-
2419
- function calendarImpl(calendar: BuiltinCalendarId) {
2420
- return impl[calendar];
2421
- }
2422
- // Probably not what the intrinsics mechanism was intended for, but view this as
2423
- // an export of calendarImpl while avoiding circular dependencies
2424
- DefineIntrinsic('calendarImpl', calendarImpl);