pi-proactive 0.2.0-beta.5 → 0.2.0-beta.7

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 (1398) hide show
  1. package/BREAKING-CHANGES.md +27 -0
  2. package/CHANGELOG.md +78 -0
  3. package/README.md +32 -14
  4. package/app/app.mjs +1378 -0
  5. package/daemon/run-daemon.mjs +268 -0
  6. package/manual/USAGE.html +76 -0
  7. package/package.json +12 -6
  8. package/skills/pi-proactive/SKILL.md +11 -16
  9. package/tools/daemon-common.mjs +289 -0
  10. package/tools/daemon-install.mjs +488 -0
  11. package/tools/daemon-uninstall.mjs +302 -0
  12. package/tools/enumerate-residue.mjs +487 -0
  13. package/tools/verify-windows.mjs +358 -0
  14. package/node_modules/typebox/build/compile/code.d.mts +0 -12
  15. package/node_modules/typebox/build/compile/code.mjs +0 -65
  16. package/node_modules/typebox/build/compile/compile.d.mts +0 -6
  17. package/node_modules/typebox/build/compile/compile.mjs +0 -12
  18. package/node_modules/typebox/build/compile/index.d.mts +0 -8
  19. package/node_modules/typebox/build/compile/index.mjs +0 -14
  20. package/node_modules/typebox/build/compile/validator.d.mts +0 -35
  21. package/node_modules/typebox/build/compile/validator.mjs +0 -91
  22. package/node_modules/typebox/build/error/errors.d.mts +0 -208
  23. package/node_modules/typebox/build/error/errors.mjs +0 -18
  24. package/node_modules/typebox/build/error/index.d.mts +0 -1
  25. package/node_modules/typebox/build/error/index.mjs +0 -1
  26. package/node_modules/typebox/build/format/_registry.d.mts +0 -15
  27. package/node_modules/typebox/build/format/_registry.mjs +0 -96
  28. package/node_modules/typebox/build/format/date.d.mts +0 -6
  29. package/node_modules/typebox/build/format/date.mjs +0 -19
  30. package/node_modules/typebox/build/format/date_time.d.mts +0 -6
  31. package/node_modules/typebox/build/format/date_time.mjs +0 -11
  32. package/node_modules/typebox/build/format/duration.d.mts +0 -5
  33. package/node_modules/typebox/build/format/duration.mjs +0 -8
  34. package/node_modules/typebox/build/format/email.d.mts +0 -5
  35. package/node_modules/typebox/build/format/email.mjs +0 -8
  36. package/node_modules/typebox/build/format/format.d.mts +0 -22
  37. package/node_modules/typebox/build/format/format.mjs +0 -22
  38. package/node_modules/typebox/build/format/hostname.d.mts +0 -7
  39. package/node_modules/typebox/build/format/hostname.mjs +0 -10
  40. package/node_modules/typebox/build/format/idn_email.d.mts +0 -5
  41. package/node_modules/typebox/build/format/idn_email.mjs +0 -8
  42. package/node_modules/typebox/build/format/idn_hostname.d.mts +0 -8
  43. package/node_modules/typebox/build/format/idn_hostname.mjs +0 -11
  44. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +0 -3
  45. package/node_modules/typebox/build/format/idna/format/bidi.mjs +0 -98
  46. package/node_modules/typebox/build/format/idna/format/puny.d.mts +0 -3
  47. package/node_modules/typebox/build/format/idna/format/puny.mjs +0 -144
  48. package/node_modules/typebox/build/format/idna/hostname.d.mts +0 -1
  49. package/node_modules/typebox/build/format/idna/hostname.mjs +0 -16
  50. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +0 -1
  51. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +0 -43
  52. package/node_modules/typebox/build/format/idna/index.d.mts +0 -2
  53. package/node_modules/typebox/build/format/idna/index.mjs +0 -2
  54. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +0 -1
  55. package/node_modules/typebox/build/format/idna/label/ascii.mjs +0 -9
  56. package/node_modules/typebox/build/format/idna/label/puny.d.mts +0 -1
  57. package/node_modules/typebox/build/format/idna/label/puny.mjs +0 -28
  58. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +0 -1
  59. package/node_modules/typebox/build/format/idna/label/unicode.mjs +0 -106
  60. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +0 -30
  61. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +0 -70
  62. package/node_modules/typebox/build/format/index.d.mts +0 -4
  63. package/node_modules/typebox/build/format/index.mjs +0 -4
  64. package/node_modules/typebox/build/format/ipv4.d.mts +0 -5
  65. package/node_modules/typebox/build/format/ipv4.mjs +0 -8
  66. package/node_modules/typebox/build/format/ipv6.d.mts +0 -5
  67. package/node_modules/typebox/build/format/ipv6.mjs +0 -8
  68. package/node_modules/typebox/build/format/iri.d.mts +0 -5
  69. package/node_modules/typebox/build/format/iri.mjs +0 -35
  70. package/node_modules/typebox/build/format/iri_reference.d.mts +0 -5
  71. package/node_modules/typebox/build/format/iri_reference.mjs +0 -14
  72. package/node_modules/typebox/build/format/json_pointer.d.mts +0 -6
  73. package/node_modules/typebox/build/format/json_pointer.mjs +0 -9
  74. package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +0 -6
  75. package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +0 -9
  76. package/node_modules/typebox/build/format/regex.d.mts +0 -5
  77. package/node_modules/typebox/build/format/regex.mjs +0 -13
  78. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +0 -6
  79. package/node_modules/typebox/build/format/relative_json_pointer.mjs +0 -9
  80. package/node_modules/typebox/build/format/time.d.mts +0 -5
  81. package/node_modules/typebox/build/format/time.mjs +0 -32
  82. package/node_modules/typebox/build/format/uri.d.mts +0 -5
  83. package/node_modules/typebox/build/format/uri.mjs +0 -8
  84. package/node_modules/typebox/build/format/uri_reference.d.mts +0 -5
  85. package/node_modules/typebox/build/format/uri_reference.mjs +0 -8
  86. package/node_modules/typebox/build/format/uri_template.d.mts +0 -5
  87. package/node_modules/typebox/build/format/uri_template.mjs +0 -9
  88. package/node_modules/typebox/build/format/url.d.mts +0 -6
  89. package/node_modules/typebox/build/format/url.mjs +0 -8
  90. package/node_modules/typebox/build/format/uuid.d.mts +0 -6
  91. package/node_modules/typebox/build/format/uuid.mjs +0 -9
  92. package/node_modules/typebox/build/guard/emit.d.mts +0 -56
  93. package/node_modules/typebox/build/guard/emit.mjs +0 -191
  94. package/node_modules/typebox/build/guard/globals.d.mts +0 -35
  95. package/node_modules/typebox/build/guard/globals.mjs +0 -90
  96. package/node_modules/typebox/build/guard/guard.d.mts +0 -71
  97. package/node_modules/typebox/build/guard/guard.mjs +0 -221
  98. package/node_modules/typebox/build/guard/index.d.mts +0 -6
  99. package/node_modules/typebox/build/guard/index.mjs +0 -6
  100. package/node_modules/typebox/build/guard/native.d.mts +0 -20
  101. package/node_modules/typebox/build/guard/native.mjs +0 -60
  102. package/node_modules/typebox/build/guard/string.d.mts +0 -6
  103. package/node_modules/typebox/build/guard/string.mjs +0 -168
  104. package/node_modules/typebox/build/index.d.mts +0 -8
  105. package/node_modules/typebox/build/index.mjs +0 -14
  106. package/node_modules/typebox/build/schema/build.d.mts +0 -39
  107. package/node_modules/typebox/build/schema/build.mjs +0 -118
  108. package/node_modules/typebox/build/schema/check.d.mts +0 -6
  109. package/node_modules/typebox/build/schema/check.mjs +0 -14
  110. package/node_modules/typebox/build/schema/compile.d.mts +0 -23
  111. package/node_modules/typebox/build/schema/compile.mjs +0 -46
  112. package/node_modules/typebox/build/schema/engine/_context.d.mts +0 -30
  113. package/node_modules/typebox/build/schema/engine/_context.mjs +0 -124
  114. package/node_modules/typebox/build/schema/engine/_exact_optional.d.mts +0 -3
  115. package/node_modules/typebox/build/schema/engine/_exact_optional.mjs +0 -20
  116. package/node_modules/typebox/build/schema/engine/_externals.d.mts +0 -7
  117. package/node_modules/typebox/build/schema/engine/_externals.mjs +0 -25
  118. package/node_modules/typebox/build/schema/engine/_functions.d.mts +0 -6
  119. package/node_modules/typebox/build/schema/engine/_functions.mjs +0 -65
  120. package/node_modules/typebox/build/schema/engine/_reducer.d.mts +0 -4
  121. package/node_modules/typebox/build/schema/engine/_reducer.mjs +0 -45
  122. package/node_modules/typebox/build/schema/engine/_refine.d.mts +0 -6
  123. package/node_modules/typebox/build/schema/engine/_refine.mjs +0 -29
  124. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +0 -2
  125. package/node_modules/typebox/build/schema/engine/_regexp.mjs +0 -4
  126. package/node_modules/typebox/build/schema/engine/_stack.d.mts +0 -22
  127. package/node_modules/typebox/build/schema/engine/_stack.mjs +0 -209
  128. package/node_modules/typebox/build/schema/engine/_unique.d.mts +0 -2
  129. package/node_modules/typebox/build/schema/engine/_unique.mjs +0 -5
  130. package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +0 -6
  131. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +0 -60
  132. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -9
  133. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +0 -123
  134. package/node_modules/typebox/build/schema/engine/allOf.d.mts +0 -6
  135. package/node_modules/typebox/build/schema/engine/allOf.mjs +0 -47
  136. package/node_modules/typebox/build/schema/engine/anyOf.d.mts +0 -6
  137. package/node_modules/typebox/build/schema/engine/anyOf.mjs +0 -52
  138. package/node_modules/typebox/build/schema/engine/boolean.d.mts +0 -5
  139. package/node_modules/typebox/build/schema/engine/boolean.mjs +0 -25
  140. package/node_modules/typebox/build/schema/engine/const.d.mts +0 -6
  141. package/node_modules/typebox/build/schema/engine/const.mjs +0 -30
  142. package/node_modules/typebox/build/schema/engine/contains.d.mts +0 -6
  143. package/node_modules/typebox/build/schema/engine/contains.mjs +0 -54
  144. package/node_modules/typebox/build/schema/engine/dependencies.d.mts +0 -6
  145. package/node_modules/typebox/build/schema/engine/dependencies.mjs +0 -45
  146. package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +0 -6
  147. package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +0 -40
  148. package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +0 -6
  149. package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +0 -38
  150. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +0 -6
  151. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +0 -25
  152. package/node_modules/typebox/build/schema/engine/enum.d.mts +0 -6
  153. package/node_modules/typebox/build/schema/engine/enum.mjs +0 -33
  154. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +0 -6
  155. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +0 -25
  156. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +0 -6
  157. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +0 -25
  158. package/node_modules/typebox/build/schema/engine/format.d.mts +0 -6
  159. package/node_modules/typebox/build/schema/engine/format.mjs +0 -26
  160. package/node_modules/typebox/build/schema/engine/if.d.mts +0 -6
  161. package/node_modules/typebox/build/schema/engine/if.mjs +0 -47
  162. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -48
  163. package/node_modules/typebox/build/schema/engine/index.mjs +0 -54
  164. package/node_modules/typebox/build/schema/engine/items.d.mts +0 -6
  165. package/node_modules/typebox/build/schema/engine/items.mjs +0 -88
  166. package/node_modules/typebox/build/schema/engine/maxContains.d.mts +0 -6
  167. package/node_modules/typebox/build/schema/engine/maxContains.mjs +0 -42
  168. package/node_modules/typebox/build/schema/engine/maxItems.d.mts +0 -6
  169. package/node_modules/typebox/build/schema/engine/maxItems.mjs +0 -25
  170. package/node_modules/typebox/build/schema/engine/maxLength.d.mts +0 -6
  171. package/node_modules/typebox/build/schema/engine/maxLength.mjs +0 -25
  172. package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +0 -6
  173. package/node_modules/typebox/build/schema/engine/maxProperties.mjs +0 -25
  174. package/node_modules/typebox/build/schema/engine/maximum.d.mts +0 -6
  175. package/node_modules/typebox/build/schema/engine/maximum.mjs +0 -25
  176. package/node_modules/typebox/build/schema/engine/minContains.d.mts +0 -6
  177. package/node_modules/typebox/build/schema/engine/minContains.mjs +0 -51
  178. package/node_modules/typebox/build/schema/engine/minItems.d.mts +0 -6
  179. package/node_modules/typebox/build/schema/engine/minItems.mjs +0 -25
  180. package/node_modules/typebox/build/schema/engine/minLength.d.mts +0 -6
  181. package/node_modules/typebox/build/schema/engine/minLength.mjs +0 -25
  182. package/node_modules/typebox/build/schema/engine/minProperties.d.mts +0 -6
  183. package/node_modules/typebox/build/schema/engine/minProperties.mjs +0 -25
  184. package/node_modules/typebox/build/schema/engine/minimum.d.mts +0 -6
  185. package/node_modules/typebox/build/schema/engine/minimum.mjs +0 -25
  186. package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +0 -6
  187. package/node_modules/typebox/build/schema/engine/multipleOf.mjs +0 -25
  188. package/node_modules/typebox/build/schema/engine/not.d.mts +0 -6
  189. package/node_modules/typebox/build/schema/engine/not.mjs +0 -39
  190. package/node_modules/typebox/build/schema/engine/oneOf.d.mts +0 -6
  191. package/node_modules/typebox/build/schema/engine/oneOf.mjs +0 -59
  192. package/node_modules/typebox/build/schema/engine/pattern.d.mts +0 -6
  193. package/node_modules/typebox/build/schema/engine/pattern.mjs +0 -29
  194. package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +0 -6
  195. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +0 -45
  196. package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +0 -6
  197. package/node_modules/typebox/build/schema/engine/prefixItems.mjs +0 -35
  198. package/node_modules/typebox/build/schema/engine/properties.d.mts +0 -6
  199. package/node_modules/typebox/build/schema/engine/properties.mjs +0 -75
  200. package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +0 -6
  201. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +0 -37
  202. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +0 -6
  203. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +0 -25
  204. package/node_modules/typebox/build/schema/engine/ref.d.mts +0 -6
  205. package/node_modules/typebox/build/schema/engine/ref.mjs +0 -52
  206. package/node_modules/typebox/build/schema/engine/required.d.mts +0 -6
  207. package/node_modules/typebox/build/schema/engine/required.mjs +0 -32
  208. package/node_modules/typebox/build/schema/engine/schema.d.mts +0 -9
  209. package/node_modules/typebox/build/schema/engine/schema.mjs +0 -362
  210. package/node_modules/typebox/build/schema/engine/type.d.mts +0 -6
  211. package/node_modules/typebox/build/schema/engine/type.mjs +0 -70
  212. package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +0 -6
  213. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +0 -51
  214. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +0 -6
  215. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +0 -51
  216. package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +0 -6
  217. package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +0 -51
  218. package/node_modules/typebox/build/schema/errors.d.mts +0 -6
  219. package/node_modules/typebox/build/schema/errors.mjs +0 -18
  220. package/node_modules/typebox/build/schema/index.d.mts +0 -3
  221. package/node_modules/typebox/build/schema/index.mjs +0 -9
  222. package/node_modules/typebox/build/schema/intern/index.d.mts +0 -1
  223. package/node_modules/typebox/build/schema/intern/index.mjs +0 -1
  224. package/node_modules/typebox/build/schema/intern/intern.d.mts +0 -14
  225. package/node_modules/typebox/build/schema/intern/intern.mjs +0 -259
  226. package/node_modules/typebox/build/schema/parse.d.mts +0 -14
  227. package/node_modules/typebox/build/schema/parse.mjs +0 -32
  228. package/node_modules/typebox/build/schema/pointer/index.d.mts +0 -2
  229. package/node_modules/typebox/build/schema/pointer/index.mjs +0 -2
  230. package/node_modules/typebox/build/schema/pointer/pointer.d.mts +0 -10
  231. package/node_modules/typebox/build/schema/pointer/pointer.mjs +0 -106
  232. package/node_modules/typebox/build/schema/pointer/pointer_get.d.mts +0 -9
  233. package/node_modules/typebox/build/schema/pointer/pointer_get.mjs +0 -2
  234. package/node_modules/typebox/build/schema/resolve/index.d.mts +0 -1
  235. package/node_modules/typebox/build/schema/resolve/index.mjs +0 -1
  236. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +0 -35
  237. package/node_modules/typebox/build/schema/resolve/resolve.mjs +0 -327
  238. package/node_modules/typebox/build/schema/schema.d.mts +0 -11
  239. package/node_modules/typebox/build/schema/schema.mjs +0 -11
  240. package/node_modules/typebox/build/schema/static/_canonical.d.mts +0 -7
  241. package/node_modules/typebox/build/schema/static/_canonical.mjs +0 -2
  242. package/node_modules/typebox/build/schema/static/_comparer.d.mts +0 -6
  243. package/node_modules/typebox/build/schema/static/_comparer.mjs +0 -2
  244. package/node_modules/typebox/build/schema/static/_elements.d.mts +0 -18
  245. package/node_modules/typebox/build/schema/static/_elements.mjs +0 -2
  246. package/node_modules/typebox/build/schema/static/additionalProperties.d.mts +0 -7
  247. package/node_modules/typebox/build/schema/static/additionalProperties.mjs +0 -3
  248. package/node_modules/typebox/build/schema/static/allOf.d.mts +0 -3
  249. package/node_modules/typebox/build/schema/static/allOf.mjs +0 -2
  250. package/node_modules/typebox/build/schema/static/anyOf.d.mts +0 -3
  251. package/node_modules/typebox/build/schema/static/anyOf.mjs +0 -2
  252. package/node_modules/typebox/build/schema/static/const.d.mts +0 -1
  253. package/node_modules/typebox/build/schema/static/const.mjs +0 -2
  254. package/node_modules/typebox/build/schema/static/enum.d.mts +0 -1
  255. package/node_modules/typebox/build/schema/static/enum.mjs +0 -2
  256. package/node_modules/typebox/build/schema/static/if.d.mts +0 -15
  257. package/node_modules/typebox/build/schema/static/if.mjs +0 -2
  258. package/node_modules/typebox/build/schema/static/index.d.mts +0 -1
  259. package/node_modules/typebox/build/schema/static/index.mjs +0 -1
  260. package/node_modules/typebox/build/schema/static/items.d.mts +0 -7
  261. package/node_modules/typebox/build/schema/static/items.mjs +0 -2
  262. package/node_modules/typebox/build/schema/static/oneOf.d.mts +0 -3
  263. package/node_modules/typebox/build/schema/static/oneOf.mjs +0 -2
  264. package/node_modules/typebox/build/schema/static/patternProperties.d.mts +0 -7
  265. package/node_modules/typebox/build/schema/static/patternProperties.mjs +0 -2
  266. package/node_modules/typebox/build/schema/static/prefixItems.d.mts +0 -3
  267. package/node_modules/typebox/build/schema/static/prefixItems.mjs +0 -2
  268. package/node_modules/typebox/build/schema/static/properties.d.mts +0 -32
  269. package/node_modules/typebox/build/schema/static/properties.mjs +0 -2
  270. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +0 -5
  271. package/node_modules/typebox/build/schema/static/propertyNames.mjs +0 -3
  272. package/node_modules/typebox/build/schema/static/ref.d.mts +0 -8
  273. package/node_modules/typebox/build/schema/static/ref.mjs +0 -3
  274. package/node_modules/typebox/build/schema/static/required.d.mts +0 -3
  275. package/node_modules/typebox/build/schema/static/required.mjs +0 -3
  276. package/node_modules/typebox/build/schema/static/schema.d.mts +0 -59
  277. package/node_modules/typebox/build/schema/static/schema.mjs +0 -2
  278. package/node_modules/typebox/build/schema/static/static.d.mts +0 -4
  279. package/node_modules/typebox/build/schema/static/static.mjs +0 -3
  280. package/node_modules/typebox/build/schema/static/type.d.mts +0 -4
  281. package/node_modules/typebox/build/schema/static/type.mjs +0 -3
  282. package/node_modules/typebox/build/schema/static/unevaluatedProperties.d.mts +0 -7
  283. package/node_modules/typebox/build/schema/static/unevaluatedProperties.mjs +0 -3
  284. package/node_modules/typebox/build/schema/types/_refine.d.mts +0 -13
  285. package/node_modules/typebox/build/schema/types/_refine.mjs +0 -18
  286. package/node_modules/typebox/build/schema/types/additionalItems.d.mts +0 -9
  287. package/node_modules/typebox/build/schema/types/additionalItems.mjs +0 -14
  288. package/node_modules/typebox/build/schema/types/additionalProperties.d.mts +0 -9
  289. package/node_modules/typebox/build/schema/types/additionalProperties.mjs +0 -14
  290. package/node_modules/typebox/build/schema/types/allOf.d.mts +0 -9
  291. package/node_modules/typebox/build/schema/types/allOf.mjs +0 -15
  292. package/node_modules/typebox/build/schema/types/anchor.d.mts +0 -8
  293. package/node_modules/typebox/build/schema/types/anchor.mjs +0 -12
  294. package/node_modules/typebox/build/schema/types/anyOf.d.mts +0 -9
  295. package/node_modules/typebox/build/schema/types/anyOf.mjs +0 -15
  296. package/node_modules/typebox/build/schema/types/const.d.mts +0 -9
  297. package/node_modules/typebox/build/schema/types/const.mjs +0 -12
  298. package/node_modules/typebox/build/schema/types/contains.d.mts +0 -9
  299. package/node_modules/typebox/build/schema/types/contains.mjs +0 -14
  300. package/node_modules/typebox/build/schema/types/default.d.mts +0 -9
  301. package/node_modules/typebox/build/schema/types/default.mjs +0 -12
  302. package/node_modules/typebox/build/schema/types/defs.d.mts +0 -6
  303. package/node_modules/typebox/build/schema/types/defs.mjs +0 -12
  304. package/node_modules/typebox/build/schema/types/dependencies.d.mts +0 -11
  305. package/node_modules/typebox/build/schema/types/dependencies.mjs +0 -16
  306. package/node_modules/typebox/build/schema/types/dependentRequired.d.mts +0 -9
  307. package/node_modules/typebox/build/schema/types/dependentRequired.mjs +0 -15
  308. package/node_modules/typebox/build/schema/types/dependentSchemas.d.mts +0 -9
  309. package/node_modules/typebox/build/schema/types/dependentSchemas.mjs +0 -15
  310. package/node_modules/typebox/build/schema/types/dynamicAnchor.d.mts +0 -8
  311. package/node_modules/typebox/build/schema/types/dynamicAnchor.mjs +0 -12
  312. package/node_modules/typebox/build/schema/types/dynamicRef.d.mts +0 -8
  313. package/node_modules/typebox/build/schema/types/dynamicRef.mjs +0 -12
  314. package/node_modules/typebox/build/schema/types/else.d.mts +0 -9
  315. package/node_modules/typebox/build/schema/types/else.mjs +0 -14
  316. package/node_modules/typebox/build/schema/types/enum.d.mts +0 -9
  317. package/node_modules/typebox/build/schema/types/enum.mjs +0 -13
  318. package/node_modules/typebox/build/schema/types/exclusiveMaximum.d.mts +0 -9
  319. package/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs +0 -13
  320. package/node_modules/typebox/build/schema/types/exclusiveMinimum.d.mts +0 -9
  321. package/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs +0 -13
  322. package/node_modules/typebox/build/schema/types/format.d.mts +0 -9
  323. package/node_modules/typebox/build/schema/types/format.mjs +0 -13
  324. package/node_modules/typebox/build/schema/types/id.d.mts +0 -9
  325. package/node_modules/typebox/build/schema/types/id.mjs +0 -13
  326. package/node_modules/typebox/build/schema/types/if.d.mts +0 -9
  327. package/node_modules/typebox/build/schema/types/if.mjs +0 -14
  328. package/node_modules/typebox/build/schema/types/index.d.mts +0 -51
  329. package/node_modules/typebox/build/schema/types/index.mjs +0 -57
  330. package/node_modules/typebox/build/schema/types/items.d.mts +0 -19
  331. package/node_modules/typebox/build/schema/types/items.mjs +0 -26
  332. package/node_modules/typebox/build/schema/types/maxContains.d.mts +0 -9
  333. package/node_modules/typebox/build/schema/types/maxContains.mjs +0 -13
  334. package/node_modules/typebox/build/schema/types/maxItems.d.mts +0 -9
  335. package/node_modules/typebox/build/schema/types/maxItems.mjs +0 -13
  336. package/node_modules/typebox/build/schema/types/maxLength.d.mts +0 -9
  337. package/node_modules/typebox/build/schema/types/maxLength.mjs +0 -13
  338. package/node_modules/typebox/build/schema/types/maxProperties.d.mts +0 -9
  339. package/node_modules/typebox/build/schema/types/maxProperties.mjs +0 -13
  340. package/node_modules/typebox/build/schema/types/maximum.d.mts +0 -9
  341. package/node_modules/typebox/build/schema/types/maximum.mjs +0 -13
  342. package/node_modules/typebox/build/schema/types/minContains.d.mts +0 -9
  343. package/node_modules/typebox/build/schema/types/minContains.mjs +0 -13
  344. package/node_modules/typebox/build/schema/types/minItems.d.mts +0 -9
  345. package/node_modules/typebox/build/schema/types/minItems.mjs +0 -13
  346. package/node_modules/typebox/build/schema/types/minLength.d.mts +0 -9
  347. package/node_modules/typebox/build/schema/types/minLength.mjs +0 -13
  348. package/node_modules/typebox/build/schema/types/minProperties.d.mts +0 -9
  349. package/node_modules/typebox/build/schema/types/minProperties.mjs +0 -13
  350. package/node_modules/typebox/build/schema/types/minimum.d.mts +0 -9
  351. package/node_modules/typebox/build/schema/types/minimum.mjs +0 -13
  352. package/node_modules/typebox/build/schema/types/multipleOf.d.mts +0 -9
  353. package/node_modules/typebox/build/schema/types/multipleOf.mjs +0 -13
  354. package/node_modules/typebox/build/schema/types/not.d.mts +0 -9
  355. package/node_modules/typebox/build/schema/types/not.mjs +0 -14
  356. package/node_modules/typebox/build/schema/types/oneOf.d.mts +0 -9
  357. package/node_modules/typebox/build/schema/types/oneOf.mjs +0 -15
  358. package/node_modules/typebox/build/schema/types/pattern.d.mts +0 -9
  359. package/node_modules/typebox/build/schema/types/pattern.mjs +0 -14
  360. package/node_modules/typebox/build/schema/types/patternProperties.d.mts +0 -9
  361. package/node_modules/typebox/build/schema/types/patternProperties.mjs +0 -15
  362. package/node_modules/typebox/build/schema/types/prefixItems.d.mts +0 -8
  363. package/node_modules/typebox/build/schema/types/prefixItems.mjs +0 -14
  364. package/node_modules/typebox/build/schema/types/properties.d.mts +0 -9
  365. package/node_modules/typebox/build/schema/types/properties.mjs +0 -15
  366. package/node_modules/typebox/build/schema/types/propertyNames.d.mts +0 -9
  367. package/node_modules/typebox/build/schema/types/propertyNames.mjs +0 -15
  368. package/node_modules/typebox/build/schema/types/recursiveAnchor.d.mts +0 -12
  369. package/node_modules/typebox/build/schema/types/recursiveAnchor.mjs +0 -19
  370. package/node_modules/typebox/build/schema/types/recursiveRef.d.mts +0 -8
  371. package/node_modules/typebox/build/schema/types/recursiveRef.mjs +0 -12
  372. package/node_modules/typebox/build/schema/types/ref.d.mts +0 -9
  373. package/node_modules/typebox/build/schema/types/ref.mjs +0 -13
  374. package/node_modules/typebox/build/schema/types/required.d.mts +0 -9
  375. package/node_modules/typebox/build/schema/types/required.mjs +0 -14
  376. package/node_modules/typebox/build/schema/types/schema.d.mts +0 -9
  377. package/node_modules/typebox/build/schema/types/schema.mjs +0 -14
  378. package/node_modules/typebox/build/schema/types/then.d.mts +0 -9
  379. package/node_modules/typebox/build/schema/types/then.mjs +0 -14
  380. package/node_modules/typebox/build/schema/types/type.d.mts +0 -9
  381. package/node_modules/typebox/build/schema/types/type.mjs +0 -15
  382. package/node_modules/typebox/build/schema/types/unevaluatedItems.d.mts +0 -9
  383. package/node_modules/typebox/build/schema/types/unevaluatedItems.mjs +0 -14
  384. package/node_modules/typebox/build/schema/types/unevaluatedProperties.d.mts +0 -9
  385. package/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs +0 -14
  386. package/node_modules/typebox/build/schema/types/uniqueItems.d.mts +0 -9
  387. package/node_modules/typebox/build/schema/types/uniqueItems.mjs +0 -13
  388. package/node_modules/typebox/build/system/arguments/arguments.d.mts +0 -5
  389. package/node_modules/typebox/build/system/arguments/arguments.mjs +0 -9
  390. package/node_modules/typebox/build/system/arguments/index.d.mts +0 -1
  391. package/node_modules/typebox/build/system/arguments/index.mjs +0 -1
  392. package/node_modules/typebox/build/system/environment/environment.d.mts +0 -1
  393. package/node_modules/typebox/build/system/environment/environment.mjs +0 -1
  394. package/node_modules/typebox/build/system/environment/evaluate.d.mts +0 -9
  395. package/node_modules/typebox/build/system/environment/evaluate.mjs +0 -37
  396. package/node_modules/typebox/build/system/environment/index.d.mts +0 -1
  397. package/node_modules/typebox/build/system/environment/index.mjs +0 -1
  398. package/node_modules/typebox/build/system/hashing/hash.d.mts +0 -4
  399. package/node_modules/typebox/build/system/hashing/hash.mjs +0 -232
  400. package/node_modules/typebox/build/system/hashing/index.d.mts +0 -1
  401. package/node_modules/typebox/build/system/hashing/index.mjs +0 -1
  402. package/node_modules/typebox/build/system/index.d.mts +0 -4
  403. package/node_modules/typebox/build/system/index.mjs +0 -4
  404. package/node_modules/typebox/build/system/locale/_config.d.mts +0 -7
  405. package/node_modules/typebox/build/system/locale/_config.mjs +0 -15
  406. package/node_modules/typebox/build/system/locale/_locale.d.mts +0 -40
  407. package/node_modules/typebox/build/system/locale/_locale.mjs +0 -40
  408. package/node_modules/typebox/build/system/locale/ar_001.d.mts +0 -3
  409. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -40
  410. package/node_modules/typebox/build/system/locale/bn_BD.d.mts +0 -3
  411. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -40
  412. package/node_modules/typebox/build/system/locale/cs_CZ.d.mts +0 -3
  413. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -40
  414. package/node_modules/typebox/build/system/locale/de_DE.d.mts +0 -3
  415. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -40
  416. package/node_modules/typebox/build/system/locale/el_GR.d.mts +0 -3
  417. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -40
  418. package/node_modules/typebox/build/system/locale/en_US.d.mts +0 -3
  419. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -39
  420. package/node_modules/typebox/build/system/locale/es_419.d.mts +0 -3
  421. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -40
  422. package/node_modules/typebox/build/system/locale/es_AR.d.mts +0 -3
  423. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -40
  424. package/node_modules/typebox/build/system/locale/es_ES.d.mts +0 -3
  425. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -40
  426. package/node_modules/typebox/build/system/locale/es_MX.d.mts +0 -3
  427. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -40
  428. package/node_modules/typebox/build/system/locale/fa_IR.d.mts +0 -3
  429. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -40
  430. package/node_modules/typebox/build/system/locale/fil_PH.d.mts +0 -3
  431. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -40
  432. package/node_modules/typebox/build/system/locale/fr_CA.d.mts +0 -3
  433. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -40
  434. package/node_modules/typebox/build/system/locale/fr_FR.d.mts +0 -3
  435. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -40
  436. package/node_modules/typebox/build/system/locale/ha_NG.d.mts +0 -3
  437. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -40
  438. package/node_modules/typebox/build/system/locale/hi_IN.d.mts +0 -3
  439. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -40
  440. package/node_modules/typebox/build/system/locale/hu_HU.d.mts +0 -3
  441. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -40
  442. package/node_modules/typebox/build/system/locale/id_ID.d.mts +0 -3
  443. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -40
  444. package/node_modules/typebox/build/system/locale/index.d.mts +0 -1
  445. package/node_modules/typebox/build/system/locale/index.mjs +0 -1
  446. package/node_modules/typebox/build/system/locale/it_IT.d.mts +0 -3
  447. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -40
  448. package/node_modules/typebox/build/system/locale/ja_JP.d.mts +0 -3
  449. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -40
  450. package/node_modules/typebox/build/system/locale/ko_KR.d.mts +0 -3
  451. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -40
  452. package/node_modules/typebox/build/system/locale/ms_MY.d.mts +0 -3
  453. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -40
  454. package/node_modules/typebox/build/system/locale/nl_NL.d.mts +0 -3
  455. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -40
  456. package/node_modules/typebox/build/system/locale/pl_PL.d.mts +0 -3
  457. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -40
  458. package/node_modules/typebox/build/system/locale/pt_BR.d.mts +0 -3
  459. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -40
  460. package/node_modules/typebox/build/system/locale/pt_PT.d.mts +0 -3
  461. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -40
  462. package/node_modules/typebox/build/system/locale/ro_RO.d.mts +0 -3
  463. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -40
  464. package/node_modules/typebox/build/system/locale/ru_RU.d.mts +0 -3
  465. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -40
  466. package/node_modules/typebox/build/system/locale/sv_SE.d.mts +0 -3
  467. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -40
  468. package/node_modules/typebox/build/system/locale/sw_TZ.d.mts +0 -3
  469. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -40
  470. package/node_modules/typebox/build/system/locale/th_TH.d.mts +0 -3
  471. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -40
  472. package/node_modules/typebox/build/system/locale/tr_TR.d.mts +0 -3
  473. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -40
  474. package/node_modules/typebox/build/system/locale/uk_UA.d.mts +0 -3
  475. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -40
  476. package/node_modules/typebox/build/system/locale/ur_PK.d.mts +0 -3
  477. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -40
  478. package/node_modules/typebox/build/system/locale/vi_VN.d.mts +0 -3
  479. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -40
  480. package/node_modules/typebox/build/system/locale/yo_NG.d.mts +0 -3
  481. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -40
  482. package/node_modules/typebox/build/system/locale/zh_Hans.d.mts +0 -3
  483. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -40
  484. package/node_modules/typebox/build/system/locale/zh_Hant.d.mts +0 -3
  485. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -40
  486. package/node_modules/typebox/build/system/memory/assign.d.mts +0 -14
  487. package/node_modules/typebox/build/system/memory/assign.mjs +0 -12
  488. package/node_modules/typebox/build/system/memory/clone.d.mts +0 -5
  489. package/node_modules/typebox/build/system/memory/clone.mjs +0 -113
  490. package/node_modules/typebox/build/system/memory/create.d.mts +0 -8
  491. package/node_modules/typebox/build/system/memory/create.mjs +0 -29
  492. package/node_modules/typebox/build/system/memory/discard.d.mts +0 -4
  493. package/node_modules/typebox/build/system/memory/discard.mjs +0 -18
  494. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  495. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
  496. package/node_modules/typebox/build/system/memory/index.d.mts +0 -1
  497. package/node_modules/typebox/build/system/memory/index.mjs +0 -1
  498. package/node_modules/typebox/build/system/memory/memory.d.mts +0 -6
  499. package/node_modules/typebox/build/system/memory/memory.mjs +0 -7
  500. package/node_modules/typebox/build/system/memory/metrics.d.mts +0 -14
  501. package/node_modules/typebox/build/system/memory/metrics.mjs +0 -8
  502. package/node_modules/typebox/build/system/memory/update.d.mts +0 -7
  503. package/node_modules/typebox/build/system/memory/update.mjs +0 -33
  504. package/node_modules/typebox/build/system/settings/index.d.mts +0 -1
  505. package/node_modules/typebox/build/system/settings/index.mjs +0 -1
  506. package/node_modules/typebox/build/system/settings/settings.d.mts +0 -80
  507. package/node_modules/typebox/build/system/settings/settings.mjs +0 -36
  508. package/node_modules/typebox/build/system/system.d.mts +0 -6
  509. package/node_modules/typebox/build/system/system.mjs +0 -6
  510. package/node_modules/typebox/build/system/unreachable/index.d.mts +0 -1
  511. package/node_modules/typebox/build/system/unreachable/index.mjs +0 -1
  512. package/node_modules/typebox/build/system/unreachable/unreachable.d.mts +0 -3
  513. package/node_modules/typebox/build/system/unreachable/unreachable.mjs +0 -6
  514. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +0 -11
  515. package/node_modules/typebox/build/type/action/_add_immutable.mjs +0 -11
  516. package/node_modules/typebox/build/type/action/_add_optional.d.mts +0 -11
  517. package/node_modules/typebox/build/type/action/_add_optional.mjs +0 -11
  518. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +0 -11
  519. package/node_modules/typebox/build/type/action/_add_readonly.mjs +0 -11
  520. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +0 -11
  521. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +0 -11
  522. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +0 -11
  523. package/node_modules/typebox/build/type/action/_remove_optional.mjs +0 -11
  524. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +0 -11
  525. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +0 -11
  526. package/node_modules/typebox/build/type/action/capitalize.d.mts +0 -11
  527. package/node_modules/typebox/build/type/action/capitalize.mjs +0 -11
  528. package/node_modules/typebox/build/type/action/conditional.d.mts +0 -12
  529. package/node_modules/typebox/build/type/action/conditional.mjs +0 -13
  530. package/node_modules/typebox/build/type/action/constructor_parameters.d.mts +0 -11
  531. package/node_modules/typebox/build/type/action/constructor_parameters.mjs +0 -11
  532. package/node_modules/typebox/build/type/action/evaluate.d.mts +0 -11
  533. package/node_modules/typebox/build/type/action/evaluate.mjs +0 -11
  534. package/node_modules/typebox/build/type/action/exclude.d.mts +0 -11
  535. package/node_modules/typebox/build/type/action/exclude.mjs +0 -11
  536. package/node_modules/typebox/build/type/action/extract.d.mts +0 -11
  537. package/node_modules/typebox/build/type/action/extract.mjs +0 -11
  538. package/node_modules/typebox/build/type/action/index.d.mts +0 -30
  539. package/node_modules/typebox/build/type/action/index.mjs +0 -30
  540. package/node_modules/typebox/build/type/action/indexed.d.mts +0 -14
  541. package/node_modules/typebox/build/type/action/indexed.mjs +0 -14
  542. package/node_modules/typebox/build/type/action/instance_type.d.mts +0 -11
  543. package/node_modules/typebox/build/type/action/instance_type.mjs +0 -11
  544. package/node_modules/typebox/build/type/action/interface.d.mts +0 -14
  545. package/node_modules/typebox/build/type/action/interface.mjs +0 -22
  546. package/node_modules/typebox/build/type/action/keyof.d.mts +0 -11
  547. package/node_modules/typebox/build/type/action/keyof.mjs +0 -11
  548. package/node_modules/typebox/build/type/action/lowercase.d.mts +0 -11
  549. package/node_modules/typebox/build/type/action/lowercase.mjs +0 -11
  550. package/node_modules/typebox/build/type/action/mapped.d.mts +0 -13
  551. package/node_modules/typebox/build/type/action/mapped.mjs +0 -13
  552. package/node_modules/typebox/build/type/action/module.d.mts +0 -13
  553. package/node_modules/typebox/build/type/action/module.mjs +0 -13
  554. package/node_modules/typebox/build/type/action/non_nullable.d.mts +0 -11
  555. package/node_modules/typebox/build/type/action/non_nullable.mjs +0 -11
  556. package/node_modules/typebox/build/type/action/omit.d.mts +0 -14
  557. package/node_modules/typebox/build/type/action/omit.mjs +0 -14
  558. package/node_modules/typebox/build/type/action/parameters.d.mts +0 -11
  559. package/node_modules/typebox/build/type/action/parameters.mjs +0 -11
  560. package/node_modules/typebox/build/type/action/partial.d.mts +0 -11
  561. package/node_modules/typebox/build/type/action/partial.mjs +0 -11
  562. package/node_modules/typebox/build/type/action/pick.d.mts +0 -14
  563. package/node_modules/typebox/build/type/action/pick.mjs +0 -14
  564. package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -16
  565. package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -19
  566. package/node_modules/typebox/build/type/action/required.d.mts +0 -11
  567. package/node_modules/typebox/build/type/action/required.mjs +0 -11
  568. package/node_modules/typebox/build/type/action/return_type.d.mts +0 -11
  569. package/node_modules/typebox/build/type/action/return_type.mjs +0 -11
  570. package/node_modules/typebox/build/type/action/uncapitalize.d.mts +0 -11
  571. package/node_modules/typebox/build/type/action/uncapitalize.mjs +0 -11
  572. package/node_modules/typebox/build/type/action/uppercase.d.mts +0 -11
  573. package/node_modules/typebox/build/type/action/uppercase.mjs +0 -11
  574. package/node_modules/typebox/build/type/action/with.d.mts +0 -11
  575. package/node_modules/typebox/build/type/action/with.mjs +0 -11
  576. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +0 -20
  577. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +0 -66
  578. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +0 -21
  579. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +0 -79
  580. package/node_modules/typebox/build/type/engine/call/resolve_arguments.d.mts +0 -13
  581. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +0 -33
  582. package/node_modules/typebox/build/type/engine/call/resolve_target.d.mts +0 -25
  583. package/node_modules/typebox/build/type/engine/call/resolve_target.mjs +0 -27
  584. package/node_modules/typebox/build/type/engine/conditional/index.d.mts +0 -1
  585. package/node_modules/typebox/build/type/engine/conditional/index.mjs +0 -1
  586. package/node_modules/typebox/build/type/engine/conditional/instantiate.d.mts +0 -12
  587. package/node_modules/typebox/build/type/engine/conditional/instantiate.mjs +0 -23
  588. package/node_modules/typebox/build/type/engine/constructor_parameters/index.d.mts +0 -1
  589. package/node_modules/typebox/build/type/engine/constructor_parameters/index.mjs +0 -1
  590. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +0 -14
  591. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +0 -25
  592. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +0 -8
  593. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +0 -16
  594. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +0 -21
  595. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +0 -45
  596. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +0 -22
  597. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +0 -47
  598. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +0 -28
  599. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +0 -47
  600. package/node_modules/typebox/build/type/engine/cyclic/index.d.mts +0 -6
  601. package/node_modules/typebox/build/type/engine/cyclic/index.mjs +0 -6
  602. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +0 -17
  603. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +0 -31
  604. package/node_modules/typebox/build/type/engine/cyclic/target.d.mts +0 -10
  605. package/node_modules/typebox/build/type/engine/cyclic/target.mjs +0 -16
  606. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  607. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  608. package/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.d.mts +0 -8
  609. package/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs +0 -9
  610. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +0 -15
  611. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +0 -37
  612. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +0 -11
  613. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +0 -18
  614. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +0 -37
  615. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +0 -60
  616. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +0 -12
  617. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +0 -33
  618. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +0 -26
  619. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +0 -56
  620. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +0 -6
  621. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +0 -10
  622. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +0 -8
  623. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +0 -8
  624. package/node_modules/typebox/build/type/engine/evaluate/instantiate.d.mts +0 -8
  625. package/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs +0 -12
  626. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +0 -20
  627. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +0 -31
  628. package/node_modules/typebox/build/type/engine/exclude/index.d.mts +0 -1
  629. package/node_modules/typebox/build/type/engine/exclude/index.mjs +0 -1
  630. package/node_modules/typebox/build/type/engine/exclude/instantiate.d.mts +0 -9
  631. package/node_modules/typebox/build/type/engine/exclude/instantiate.mjs +0 -16
  632. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +0 -10
  633. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +0 -22
  634. package/node_modules/typebox/build/type/engine/extract/index.d.mts +0 -1
  635. package/node_modules/typebox/build/type/engine/extract/index.mjs +0 -1
  636. package/node_modules/typebox/build/type/engine/extract/instantiate.d.mts +0 -9
  637. package/node_modules/typebox/build/type/engine/extract/instantiate.mjs +0 -16
  638. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +0 -10
  639. package/node_modules/typebox/build/type/engine/extract/operation.mjs +0 -22
  640. package/node_modules/typebox/build/type/engine/helpers/index.d.mts +0 -3
  641. package/node_modules/typebox/build/type/engine/helpers/index.mjs +0 -3
  642. package/node_modules/typebox/build/type/engine/helpers/keys.d.mts +0 -3
  643. package/node_modules/typebox/build/type/engine/helpers/keys.mjs +0 -8
  644. package/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.d.mts +0 -7
  645. package/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs +0 -15
  646. package/node_modules/typebox/build/type/engine/helpers/union.d.mts +0 -7
  647. package/node_modules/typebox/build/type/engine/helpers/union.mjs +0 -3
  648. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +0 -10
  649. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +0 -14
  650. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +0 -10
  651. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +0 -14
  652. package/node_modules/typebox/build/type/engine/index.d.mts +0 -31
  653. package/node_modules/typebox/build/type/engine/index.mjs +0 -37
  654. package/node_modules/typebox/build/type/engine/indexable/from_cyclic.d.mts +0 -6
  655. package/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs +0 -8
  656. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +0 -5
  657. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +0 -8
  658. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +0 -6
  659. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +0 -8
  660. package/node_modules/typebox/build/type/engine/indexable/from_intersect.d.mts +0 -5
  661. package/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs +0 -8
  662. package/node_modules/typebox/build/type/engine/indexable/from_literal.d.mts +0 -3
  663. package/node_modules/typebox/build/type/engine/indexable/from_literal.mjs +0 -5
  664. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +0 -5
  665. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +0 -8
  666. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +0 -19
  667. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +0 -25
  668. package/node_modules/typebox/build/type/engine/indexable/from_union.d.mts +0 -4
  669. package/node_modules/typebox/build/type/engine/indexable/from_union.mjs +0 -7
  670. package/node_modules/typebox/build/type/engine/indexable/to_indexable.d.mts +0 -9
  671. package/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs +0 -14
  672. package/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.d.mts +0 -10
  673. package/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs +0 -12
  674. package/node_modules/typebox/build/type/engine/indexed/array_indexer.d.mts +0 -12
  675. package/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs +0 -18
  676. package/node_modules/typebox/build/type/engine/indexed/from_array.d.mts +0 -15
  677. package/node_modules/typebox/build/type/engine/indexed/from_array.mjs +0 -35
  678. package/node_modules/typebox/build/type/engine/indexed/from_object.d.mts +0 -16
  679. package/node_modules/typebox/build/type/engine/indexed/from_object.mjs +0 -40
  680. package/node_modules/typebox/build/type/engine/indexed/from_tuple.d.mts +0 -13
  681. package/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs +0 -35
  682. package/node_modules/typebox/build/type/engine/indexed/from_type.d.mts +0 -11
  683. package/node_modules/typebox/build/type/engine/indexed/from_type.mjs +0 -14
  684. package/node_modules/typebox/build/type/engine/indexed/index.d.mts +0 -1
  685. package/node_modules/typebox/build/type/engine/indexed/index.mjs +0 -1
  686. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +0 -16
  687. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +0 -28
  688. package/node_modules/typebox/build/type/engine/instance_type/index.d.mts +0 -1
  689. package/node_modules/typebox/build/type/engine/instance_type/index.mjs +0 -1
  690. package/node_modules/typebox/build/type/engine/instance_type/instantiate.d.mts +0 -12
  691. package/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs +0 -21
  692. package/node_modules/typebox/build/type/engine/instantiate.d.mts +0 -178
  693. package/node_modules/typebox/build/type/engine/instantiate.mjs +0 -158
  694. package/node_modules/typebox/build/type/engine/interface/index.d.mts +0 -1
  695. package/node_modules/typebox/build/type/engine/interface/index.mjs +0 -1
  696. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +0 -15
  697. package/node_modules/typebox/build/type/engine/interface/instantiate.mjs +0 -23
  698. package/node_modules/typebox/build/type/engine/intrinsics/from_literal.d.mts +0 -5
  699. package/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs +0 -9
  700. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +0 -6
  701. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +0 -8
  702. package/node_modules/typebox/build/type/engine/intrinsics/from_type.d.mts +0 -10
  703. package/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs +0 -13
  704. package/node_modules/typebox/build/type/engine/intrinsics/from_union.d.mts +0 -6
  705. package/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs +0 -7
  706. package/node_modules/typebox/build/type/engine/intrinsics/index.d.mts +0 -1
  707. package/node_modules/typebox/build/type/engine/intrinsics/index.mjs +0 -1
  708. package/node_modules/typebox/build/type/engine/intrinsics/instantiate.d.mts +0 -38
  709. package/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs +0 -52
  710. package/node_modules/typebox/build/type/engine/intrinsics/mapping.d.mts +0 -9
  711. package/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs +0 -4
  712. package/node_modules/typebox/build/type/engine/keyof/from_any.d.mts +0 -6
  713. package/node_modules/typebox/build/type/engine/keyof/from_any.mjs +0 -8
  714. package/node_modules/typebox/build/type/engine/keyof/from_array.d.mts +0 -4
  715. package/node_modules/typebox/build/type/engine/keyof/from_array.mjs +0 -5
  716. package/node_modules/typebox/build/type/engine/keyof/from_object.d.mts +0 -10
  717. package/node_modules/typebox/build/type/engine/keyof/from_object.mjs +0 -20
  718. package/node_modules/typebox/build/type/engine/keyof/from_record.d.mts +0 -4
  719. package/node_modules/typebox/build/type/engine/keyof/from_record.mjs +0 -5
  720. package/node_modules/typebox/build/type/engine/keyof/from_tuple.d.mts +0 -5
  721. package/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs +0 -7
  722. package/node_modules/typebox/build/type/engine/keyof/from_type.d.mts +0 -15
  723. package/node_modules/typebox/build/type/engine/keyof/from_type.mjs +0 -23
  724. package/node_modules/typebox/build/type/engine/keyof/index.d.mts +0 -1
  725. package/node_modules/typebox/build/type/engine/keyof/index.mjs +0 -1
  726. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +0 -16
  727. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +0 -29
  728. package/node_modules/typebox/build/type/engine/mapped/index.d.mts +0 -1
  729. package/node_modules/typebox/build/type/engine/mapped/index.mjs +0 -1
  730. package/node_modules/typebox/build/type/engine/mapped/instantiate.d.mts +0 -10
  731. package/node_modules/typebox/build/type/engine/mapped/instantiate.mjs +0 -15
  732. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +0 -22
  733. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +0 -42
  734. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +0 -17
  735. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +0 -39
  736. package/node_modules/typebox/build/type/engine/module/index.d.mts +0 -1
  737. package/node_modules/typebox/build/type/engine/module/index.mjs +0 -1
  738. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +0 -19
  739. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +0 -36
  740. package/node_modules/typebox/build/type/engine/non_nullable/index.d.mts +0 -1
  741. package/node_modules/typebox/build/type/engine/non_nullable/index.mjs +0 -1
  742. package/node_modules/typebox/build/type/engine/non_nullable/instantiate.d.mts +0 -14
  743. package/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs +0 -22
  744. package/node_modules/typebox/build/type/engine/object/collapse.d.mts +0 -12
  745. package/node_modules/typebox/build/type/engine/object/collapse.mjs +0 -14
  746. package/node_modules/typebox/build/type/engine/object/from_cyclic.d.mts +0 -6
  747. package/node_modules/typebox/build/type/engine/object/from_cyclic.mjs +0 -8
  748. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +0 -5
  749. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +0 -8
  750. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +0 -17
  751. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +0 -22
  752. package/node_modules/typebox/build/type/engine/object/from_object.d.mts +0 -3
  753. package/node_modules/typebox/build/type/engine/object/from_object.mjs +0 -4
  754. package/node_modules/typebox/build/type/engine/object/from_tuple.d.mts +0 -6
  755. package/node_modules/typebox/build/type/engine/object/from_tuple.mjs +0 -9
  756. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +0 -16
  757. package/node_modules/typebox/build/type/engine/object/from_type.mjs +0 -23
  758. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +0 -12
  759. package/node_modules/typebox/build/type/engine/object/from_union.mjs +0 -19
  760. package/node_modules/typebox/build/type/engine/object/index.d.mts +0 -1
  761. package/node_modules/typebox/build/type/engine/object/index.mjs +0 -1
  762. package/node_modules/typebox/build/type/engine/omit/from_type.d.mts +0 -12
  763. package/node_modules/typebox/build/type/engine/omit/from_type.mjs +0 -18
  764. package/node_modules/typebox/build/type/engine/omit/index.d.mts +0 -1
  765. package/node_modules/typebox/build/type/engine/omit/index.mjs +0 -1
  766. package/node_modules/typebox/build/type/engine/omit/instantiate.d.mts +0 -9
  767. package/node_modules/typebox/build/type/engine/omit/instantiate.mjs +0 -16
  768. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +0 -10
  769. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +0 -14
  770. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +0 -10
  771. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +0 -14
  772. package/node_modules/typebox/build/type/engine/parameters/index.d.mts +0 -1
  773. package/node_modules/typebox/build/type/engine/parameters/index.mjs +0 -1
  774. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +0 -14
  775. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +0 -25
  776. package/node_modules/typebox/build/type/engine/partial/from_cyclic.d.mts +0 -10
  777. package/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs +0 -11
  778. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +0 -5
  779. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +0 -8
  780. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +0 -5
  781. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +0 -8
  782. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +0 -8
  783. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +0 -11
  784. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +0 -14
  785. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +0 -20
  786. package/node_modules/typebox/build/type/engine/partial/from_union.d.mts +0 -5
  787. package/node_modules/typebox/build/type/engine/partial/from_union.mjs +0 -7
  788. package/node_modules/typebox/build/type/engine/partial/index.d.mts +0 -1
  789. package/node_modules/typebox/build/type/engine/partial/index.mjs +0 -1
  790. package/node_modules/typebox/build/type/engine/partial/instantiate.d.mts +0 -9
  791. package/node_modules/typebox/build/type/engine/partial/instantiate.mjs +0 -15
  792. package/node_modules/typebox/build/type/engine/patterns/index.d.mts +0 -2
  793. package/node_modules/typebox/build/type/engine/patterns/index.mjs +0 -2
  794. package/node_modules/typebox/build/type/engine/patterns/pattern.d.mts +0 -6
  795. package/node_modules/typebox/build/type/engine/patterns/pattern.mjs +0 -11
  796. package/node_modules/typebox/build/type/engine/patterns/template.d.mts +0 -7
  797. package/node_modules/typebox/build/type/engine/patterns/template.mjs +0 -20
  798. package/node_modules/typebox/build/type/engine/pick/from_type.d.mts +0 -13
  799. package/node_modules/typebox/build/type/engine/pick/from_type.mjs +0 -20
  800. package/node_modules/typebox/build/type/engine/pick/index.d.mts +0 -1
  801. package/node_modules/typebox/build/type/engine/pick/index.mjs +0 -1
  802. package/node_modules/typebox/build/type/engine/pick/instantiate.d.mts +0 -9
  803. package/node_modules/typebox/build/type/engine/pick/instantiate.mjs +0 -16
  804. package/node_modules/typebox/build/type/engine/priority/index.d.mts +0 -1
  805. package/node_modules/typebox/build/type/engine/priority/index.mjs +0 -1
  806. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +0 -20
  807. package/node_modules/typebox/build/type/engine/priority/priority.mjs +0 -27
  808. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +0 -10
  809. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +0 -14
  810. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +0 -10
  811. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +0 -14
  812. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +0 -5
  813. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +0 -7
  814. package/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.d.mts +0 -10
  815. package/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs +0 -11
  816. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +0 -5
  817. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +0 -8
  818. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +0 -5
  819. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +0 -8
  820. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +0 -8
  821. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +0 -11
  822. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +0 -5
  823. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +0 -7
  824. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +0 -18
  825. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +0 -25
  826. package/node_modules/typebox/build/type/engine/readonly_object/from_union.d.mts +0 -5
  827. package/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs +0 -7
  828. package/node_modules/typebox/build/type/engine/readonly_object/index.d.mts +0 -1
  829. package/node_modules/typebox/build/type/engine/readonly_object/index.mjs +0 -1
  830. package/node_modules/typebox/build/type/engine/readonly_object/instantiate.d.mts +0 -9
  831. package/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs +0 -15
  832. package/node_modules/typebox/build/type/engine/record/from_key.d.mts +0 -24
  833. package/node_modules/typebox/build/type/engine/record/from_key.mjs +0 -40
  834. package/node_modules/typebox/build/type/engine/record/from_key_any.d.mts +0 -4
  835. package/node_modules/typebox/build/type/engine/record/from_key_any.mjs +0 -6
  836. package/node_modules/typebox/build/type/engine/record/from_key_boolean.d.mts +0 -7
  837. package/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs +0 -5
  838. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +0 -6
  839. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +0 -8
  840. package/node_modules/typebox/build/type/engine/record/from_key_integer.d.mts +0 -5
  841. package/node_modules/typebox/build/type/engine/record/from_key_integer.mjs +0 -7
  842. package/node_modules/typebox/build/type/engine/record/from_key_intersect.d.mts +0 -5
  843. package/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs +0 -8
  844. package/node_modules/typebox/build/type/engine/record/from_key_literal.d.mts +0 -11
  845. package/node_modules/typebox/build/type/engine/record/from_key_literal.mjs +0 -10
  846. package/node_modules/typebox/build/type/engine/record/from_key_number.d.mts +0 -5
  847. package/node_modules/typebox/build/type/engine/record/from_key_number.mjs +0 -7
  848. package/node_modules/typebox/build/type/engine/record/from_key_string.d.mts +0 -5
  849. package/node_modules/typebox/build/type/engine/record/from_key_string.mjs +0 -12
  850. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +0 -8
  851. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +0 -12
  852. package/node_modules/typebox/build/type/engine/record/from_key_union.d.mts +0 -20
  853. package/node_modules/typebox/build/type/engine/record/from_key_union.mjs +0 -39
  854. package/node_modules/typebox/build/type/engine/record/index.d.mts +0 -1
  855. package/node_modules/typebox/build/type/engine/record/index.mjs +0 -1
  856. package/node_modules/typebox/build/type/engine/record/instantiate.d.mts +0 -9
  857. package/node_modules/typebox/build/type/engine/record/instantiate.mjs +0 -17
  858. package/node_modules/typebox/build/type/engine/record/record_create.d.mts +0 -3
  859. package/node_modules/typebox/build/type/engine/record/record_create.mjs +0 -7
  860. package/node_modules/typebox/build/type/engine/ref/index.d.mts +0 -1
  861. package/node_modules/typebox/build/type/engine/ref/index.mjs +0 -1
  862. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +0 -6
  863. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +0 -10
  864. package/node_modules/typebox/build/type/engine/required/from_cyclic.d.mts +0 -10
  865. package/node_modules/typebox/build/type/engine/required/from_cyclic.mjs +0 -11
  866. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +0 -5
  867. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +0 -8
  868. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +0 -5
  869. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +0 -8
  870. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +0 -8
  871. package/node_modules/typebox/build/type/engine/required/from_object.mjs +0 -11
  872. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +0 -14
  873. package/node_modules/typebox/build/type/engine/required/from_type.mjs +0 -20
  874. package/node_modules/typebox/build/type/engine/required/from_union.d.mts +0 -5
  875. package/node_modules/typebox/build/type/engine/required/from_union.mjs +0 -7
  876. package/node_modules/typebox/build/type/engine/required/index.d.mts +0 -1
  877. package/node_modules/typebox/build/type/engine/required/index.mjs +0 -1
  878. package/node_modules/typebox/build/type/engine/required/instantiate.d.mts +0 -9
  879. package/node_modules/typebox/build/type/engine/required/instantiate.mjs +0 -15
  880. package/node_modules/typebox/build/type/engine/rest/index.d.mts +0 -1
  881. package/node_modules/typebox/build/type/engine/rest/index.mjs +0 -1
  882. package/node_modules/typebox/build/type/engine/rest/spread.d.mts +0 -12
  883. package/node_modules/typebox/build/type/engine/rest/spread.mjs +0 -19
  884. package/node_modules/typebox/build/type/engine/return_type/index.d.mts +0 -1
  885. package/node_modules/typebox/build/type/engine/return_type/index.mjs +0 -1
  886. package/node_modules/typebox/build/type/engine/return_type/instantiate.d.mts +0 -12
  887. package/node_modules/typebox/build/type/engine/return_type/instantiate.mjs +0 -21
  888. package/node_modules/typebox/build/type/engine/template_literal/create.d.mts +0 -1
  889. package/node_modules/typebox/build/type/engine/template_literal/create.mjs +0 -5
  890. package/node_modules/typebox/build/type/engine/template_literal/decode.d.mts +0 -30
  891. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +0 -81
  892. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +0 -33
  893. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +0 -81
  894. package/node_modules/typebox/build/type/engine/template_literal/index.d.mts +0 -6
  895. package/node_modules/typebox/build/type/engine/template_literal/index.mjs +0 -6
  896. package/node_modules/typebox/build/type/engine/template_literal/instantiate.d.mts +0 -9
  897. package/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs +0 -15
  898. package/node_modules/typebox/build/type/engine/template_literal/is_finite.d.mts +0 -12
  899. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +0 -26
  900. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.d.mts +0 -6
  901. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +0 -10
  902. package/node_modules/typebox/build/type/engine/template_literal/static.d.mts +0 -18
  903. package/node_modules/typebox/build/type/engine/template_literal/static.mjs +0 -2
  904. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +0 -16
  905. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +0 -26
  906. package/node_modules/typebox/build/type/engine/tuple/to_object.d.mts +0 -12
  907. package/node_modules/typebox/build/type/engine/tuple/to_object.mjs +0 -14
  908. package/node_modules/typebox/build/type/engine/with/index.d.mts +0 -1
  909. package/node_modules/typebox/build/type/engine/with/index.mjs +0 -1
  910. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +0 -8
  911. package/node_modules/typebox/build/type/engine/with/instantiate.mjs +0 -14
  912. package/node_modules/typebox/build/type/extends/any.d.mts +0 -9
  913. package/node_modules/typebox/build/type/extends/any.mjs +0 -12
  914. package/node_modules/typebox/build/type/extends/array.d.mts +0 -20
  915. package/node_modules/typebox/build/type/extends/array.mjs +0 -21
  916. package/node_modules/typebox/build/type/extends/bigint.d.mts +0 -7
  917. package/node_modules/typebox/build/type/extends/bigint.mjs +0 -9
  918. package/node_modules/typebox/build/type/extends/boolean.d.mts +0 -7
  919. package/node_modules/typebox/build/type/extends/boolean.mjs +0 -9
  920. package/node_modules/typebox/build/type/extends/constructor.d.mts +0 -10
  921. package/node_modules/typebox/build/type/extends/constructor.mjs +0 -17
  922. package/node_modules/typebox/build/type/extends/dependent.d.mts +0 -6
  923. package/node_modules/typebox/build/type/extends/dependent.mjs +0 -6
  924. package/node_modules/typebox/build/type/extends/enum.d.mts +0 -7
  925. package/node_modules/typebox/build/type/extends/enum.mjs +0 -7
  926. package/node_modules/typebox/build/type/extends/extends.d.mts +0 -13
  927. package/node_modules/typebox/build/type/extends/extends.mjs +0 -17
  928. package/node_modules/typebox/build/type/extends/extends_left.d.mts +0 -53
  929. package/node_modules/typebox/build/type/extends/extends_left.mjs +0 -80
  930. package/node_modules/typebox/build/type/extends/extends_right.d.mts +0 -27
  931. package/node_modules/typebox/build/type/extends/extends_right.mjs +0 -49
  932. package/node_modules/typebox/build/type/extends/function.d.mts +0 -10
  933. package/node_modules/typebox/build/type/extends/function.mjs +0 -17
  934. package/node_modules/typebox/build/type/extends/index.d.mts +0 -2
  935. package/node_modules/typebox/build/type/extends/index.mjs +0 -2
  936. package/node_modules/typebox/build/type/extends/inference.d.mts +0 -34
  937. package/node_modules/typebox/build/type/extends/inference.mjs +0 -62
  938. package/node_modules/typebox/build/type/extends/integer.d.mts +0 -8
  939. package/node_modules/typebox/build/type/extends/integer.mjs +0 -10
  940. package/node_modules/typebox/build/type/extends/intersect.d.mts +0 -6
  941. package/node_modules/typebox/build/type/extends/intersect.mjs +0 -15
  942. package/node_modules/typebox/build/type/extends/literal.d.mts +0 -18
  943. package/node_modules/typebox/build/type/extends/literal.mjs +0 -44
  944. package/node_modules/typebox/build/type/extends/never.d.mts +0 -8
  945. package/node_modules/typebox/build/type/extends/never.mjs +0 -9
  946. package/node_modules/typebox/build/type/extends/null.d.mts +0 -7
  947. package/node_modules/typebox/build/type/extends/null.mjs +0 -9
  948. package/node_modules/typebox/build/type/extends/number.d.mts +0 -7
  949. package/node_modules/typebox/build/type/extends/number.mjs +0 -9
  950. package/node_modules/typebox/build/type/extends/object.d.mts +0 -32
  951. package/node_modules/typebox/build/type/extends/object.mjs +0 -109
  952. package/node_modules/typebox/build/type/extends/parameters.d.mts +0 -15
  953. package/node_modules/typebox/build/type/extends/parameters.mjs +0 -28
  954. package/node_modules/typebox/build/type/extends/record.d.mts +0 -13
  955. package/node_modules/typebox/build/type/extends/record.mjs +0 -23
  956. package/node_modules/typebox/build/type/extends/result.d.mts +0 -24
  957. package/node_modules/typebox/build/type/extends/result.mjs +0 -36
  958. package/node_modules/typebox/build/type/extends/return_type.d.mts +0 -7
  959. package/node_modules/typebox/build/type/extends/return_type.mjs +0 -9
  960. package/node_modules/typebox/build/type/extends/string.d.mts +0 -7
  961. package/node_modules/typebox/build/type/extends/string.mjs +0 -9
  962. package/node_modules/typebox/build/type/extends/symbol.d.mts +0 -7
  963. package/node_modules/typebox/build/type/extends/symbol.mjs +0 -9
  964. package/node_modules/typebox/build/type/extends/template_literal.d.mts +0 -6
  965. package/node_modules/typebox/build/type/extends/template_literal.mjs +0 -7
  966. package/node_modules/typebox/build/type/extends/tuple.d.mts +0 -22
  967. package/node_modules/typebox/build/type/extends/tuple.mjs +0 -61
  968. package/node_modules/typebox/build/type/extends/undefined.d.mts +0 -8
  969. package/node_modules/typebox/build/type/extends/undefined.mjs +0 -10
  970. package/node_modules/typebox/build/type/extends/union.d.mts +0 -11
  971. package/node_modules/typebox/build/type/extends/union.mjs +0 -24
  972. package/node_modules/typebox/build/type/extends/unknown.d.mts +0 -9
  973. package/node_modules/typebox/build/type/extends/unknown.mjs +0 -12
  974. package/node_modules/typebox/build/type/extends/void.d.mts +0 -7
  975. package/node_modules/typebox/build/type/extends/void.mjs +0 -9
  976. package/node_modules/typebox/build/type/index.d.mts +0 -5
  977. package/node_modules/typebox/build/type/index.mjs +0 -5
  978. package/node_modules/typebox/build/type/script/index.d.mts +0 -1
  979. package/node_modules/typebox/build/type/script/index.mjs +0 -1
  980. package/node_modules/typebox/build/type/script/mapping.d.mts +0 -356
  981. package/node_modules/typebox/build/type/script/mapping.mjs +0 -528
  982. package/node_modules/typebox/build/type/script/parser.d.mts +0 -256
  983. package/node_modules/typebox/build/type/script/parser.mjs +0 -140
  984. package/node_modules/typebox/build/type/script/script.d.mts +0 -16
  985. package/node_modules/typebox/build/type/script/script.mjs +0 -22
  986. package/node_modules/typebox/build/type/script/token/bigint.d.mts +0 -8
  987. package/node_modules/typebox/build/type/script/token/bigint.mjs +0 -14
  988. package/node_modules/typebox/build/type/script/token/const.d.mts +0 -11
  989. package/node_modules/typebox/build/type/script/token/const.mjs +0 -18
  990. package/node_modules/typebox/build/type/script/token/ident.d.mts +0 -16
  991. package/node_modules/typebox/build/type/script/token/ident.mjs +0 -26
  992. package/node_modules/typebox/build/type/script/token/index.d.mts +0 -12
  993. package/node_modules/typebox/build/type/script/token/index.mjs +0 -12
  994. package/node_modules/typebox/build/type/script/token/integer.d.mts +0 -11
  995. package/node_modules/typebox/build/type/script/token/integer.mjs +0 -19
  996. package/node_modules/typebox/build/type/script/token/internal/char.d.mts +0 -75
  997. package/node_modules/typebox/build/type/script/token/internal/char.mjs +0 -26
  998. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +0 -1
  999. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +0 -15
  1000. package/node_modules/typebox/build/type/script/token/internal/many.d.mts +0 -7
  1001. package/node_modules/typebox/build/type/script/token/internal/many.mjs +0 -14
  1002. package/node_modules/typebox/build/type/script/token/internal/match.d.mts +0 -6
  1003. package/node_modules/typebox/build/type/script/token/internal/match.mjs +0 -11
  1004. package/node_modules/typebox/build/type/script/token/internal/optional.d.mts +0 -5
  1005. package/node_modules/typebox/build/type/script/token/internal/optional.mjs +0 -9
  1006. package/node_modules/typebox/build/type/script/token/internal/take.d.mts +0 -6
  1007. package/node_modules/typebox/build/type/script/token/internal/take.mjs +0 -30
  1008. package/node_modules/typebox/build/type/script/token/internal/trim.d.mts +0 -19
  1009. package/node_modules/typebox/build/type/script/token/internal/trim.mjs +0 -34
  1010. package/node_modules/typebox/build/type/script/token/number.d.mts +0 -11
  1011. package/node_modules/typebox/build/type/script/token/number.mjs +0 -19
  1012. package/node_modules/typebox/build/type/script/token/rest.d.mts +0 -4
  1013. package/node_modules/typebox/build/type/script/token/rest.mjs +0 -9
  1014. package/node_modules/typebox/build/type/script/token/span.d.mts +0 -11
  1015. package/node_modules/typebox/build/type/script/token/span.mjs +0 -24
  1016. package/node_modules/typebox/build/type/script/token/string.d.mts +0 -11
  1017. package/node_modules/typebox/build/type/script/token/string.mjs +0 -20
  1018. package/node_modules/typebox/build/type/script/token/unsigned_integer.d.mts +0 -16
  1019. package/node_modules/typebox/build/type/script/token/unsigned_integer.mjs +0 -26
  1020. package/node_modules/typebox/build/type/script/token/unsigned_number.d.mts +0 -17
  1021. package/node_modules/typebox/build/type/script/token/unsigned_number.mjs +0 -38
  1022. package/node_modules/typebox/build/type/script/token/until.d.mts +0 -7
  1023. package/node_modules/typebox/build/type/script/token/until.mjs +0 -21
  1024. package/node_modules/typebox/build/type/script/token/until_1.d.mts +0 -5
  1025. package/node_modules/typebox/build/type/script/token/until_1.mjs +0 -12
  1026. package/node_modules/typebox/build/type/types/_codec.d.mts +0 -30
  1027. package/node_modules/typebox/build/type/types/_codec.mjs +0 -60
  1028. package/node_modules/typebox/build/type/types/_immutable.d.mts +0 -9
  1029. package/node_modules/typebox/build/type/types/_immutable.mjs +0 -18
  1030. package/node_modules/typebox/build/type/types/_optional.d.mts +0 -9
  1031. package/node_modules/typebox/build/type/types/_optional.mjs +0 -18
  1032. package/node_modules/typebox/build/type/types/_readonly.d.mts +0 -9
  1033. package/node_modules/typebox/build/type/types/_readonly.mjs +0 -18
  1034. package/node_modules/typebox/build/type/types/_refine.d.mts +0 -24
  1035. package/node_modules/typebox/build/type/types/_refine.mjs +0 -36
  1036. package/node_modules/typebox/build/type/types/any.d.mts +0 -10
  1037. package/node_modules/typebox/build/type/types/any.mjs +0 -18
  1038. package/node_modules/typebox/build/type/types/array.d.mts +0 -18
  1039. package/node_modules/typebox/build/type/types/array.mjs +0 -25
  1040. package/node_modules/typebox/build/type/types/bigint.d.mts +0 -12
  1041. package/node_modules/typebox/build/type/types/bigint.mjs +0 -21
  1042. package/node_modules/typebox/build/type/types/boolean.d.mts +0 -11
  1043. package/node_modules/typebox/build/type/types/boolean.mjs +0 -17
  1044. package/node_modules/typebox/build/type/types/call.d.mts +0 -16
  1045. package/node_modules/typebox/build/type/types/call.mjs +0 -23
  1046. package/node_modules/typebox/build/type/types/constructor.d.mts +0 -18
  1047. package/node_modules/typebox/build/type/types/constructor.mjs +0 -24
  1048. package/node_modules/typebox/build/type/types/cyclic.d.mts +0 -16
  1049. package/node_modules/typebox/build/type/types/cyclic.mjs +0 -29
  1050. package/node_modules/typebox/build/type/types/deferred.d.mts +0 -13
  1051. package/node_modules/typebox/build/type/types/deferred.mjs +0 -16
  1052. package/node_modules/typebox/build/type/types/dependent.d.mts +0 -17
  1053. package/node_modules/typebox/build/type/types/dependent.mjs +0 -24
  1054. package/node_modules/typebox/build/type/types/enum.d.mts +0 -18
  1055. package/node_modules/typebox/build/type/types/enum.mjs +0 -22
  1056. package/node_modules/typebox/build/type/types/function.d.mts +0 -21
  1057. package/node_modules/typebox/build/type/types/function.mjs +0 -25
  1058. package/node_modules/typebox/build/type/types/generic.d.mts +0 -13
  1059. package/node_modules/typebox/build/type/types/generic.mjs +0 -17
  1060. package/node_modules/typebox/build/type/types/identifier.d.mts +0 -11
  1061. package/node_modules/typebox/build/type/types/identifier.mjs +0 -17
  1062. package/node_modules/typebox/build/type/types/index.d.mts +0 -45
  1063. package/node_modules/typebox/build/type/types/index.mjs +0 -51
  1064. package/node_modules/typebox/build/type/types/infer.d.mts +0 -15
  1065. package/node_modules/typebox/build/type/types/infer.mjs +0 -20
  1066. package/node_modules/typebox/build/type/types/integer.d.mts +0 -12
  1067. package/node_modules/typebox/build/type/types/integer.mjs +0 -21
  1068. package/node_modules/typebox/build/type/types/intersect.d.mts +0 -15
  1069. package/node_modules/typebox/build/type/types/intersect.mjs +0 -24
  1070. package/node_modules/typebox/build/type/types/literal.d.mts +0 -31
  1071. package/node_modules/typebox/build/type/types/literal.mjs +0 -62
  1072. package/node_modules/typebox/build/type/types/never.d.mts +0 -12
  1073. package/node_modules/typebox/build/type/types/never.mjs +0 -22
  1074. package/node_modules/typebox/build/type/types/null.d.mts +0 -11
  1075. package/node_modules/typebox/build/type/types/null.mjs +0 -17
  1076. package/node_modules/typebox/build/type/types/number.d.mts +0 -12
  1077. package/node_modules/typebox/build/type/types/number.mjs +0 -21
  1078. package/node_modules/typebox/build/type/types/object.d.mts +0 -18
  1079. package/node_modules/typebox/build/type/types/object.mjs +0 -28
  1080. package/node_modules/typebox/build/type/types/parameter.d.mts +0 -17
  1081. package/node_modules/typebox/build/type/types/parameter.mjs +0 -21
  1082. package/node_modules/typebox/build/type/types/properties.d.mts +0 -43
  1083. package/node_modules/typebox/build/type/types/properties.mjs +0 -15
  1084. package/node_modules/typebox/build/type/types/record.d.mts +0 -52
  1085. package/node_modules/typebox/build/type/types/record.mjs +0 -66
  1086. package/node_modules/typebox/build/type/types/ref.d.mts +0 -19
  1087. package/node_modules/typebox/build/type/types/ref.mjs +0 -18
  1088. package/node_modules/typebox/build/type/types/rest.d.mts +0 -11
  1089. package/node_modules/typebox/build/type/types/rest.mjs +0 -17
  1090. package/node_modules/typebox/build/type/types/schema.d.mts +0 -176
  1091. package/node_modules/typebox/build/type/types/schema.mjs +0 -15
  1092. package/node_modules/typebox/build/type/types/static.d.mts +0 -45
  1093. package/node_modules/typebox/build/type/types/static.mjs +0 -3
  1094. package/node_modules/typebox/build/type/types/string.d.mts +0 -12
  1095. package/node_modules/typebox/build/type/types/string.mjs +0 -22
  1096. package/node_modules/typebox/build/type/types/symbol.d.mts +0 -11
  1097. package/node_modules/typebox/build/type/types/symbol.mjs +0 -17
  1098. package/node_modules/typebox/build/type/types/template_literal.d.mts +0 -28
  1099. package/node_modules/typebox/build/type/types/template_literal.mjs +0 -37
  1100. package/node_modules/typebox/build/type/types/this.d.mts +0 -14
  1101. package/node_modules/typebox/build/type/types/this.mjs +0 -17
  1102. package/node_modules/typebox/build/type/types/tuple.d.mts +0 -38
  1103. package/node_modules/typebox/build/type/types/tuple.mjs +0 -25
  1104. package/node_modules/typebox/build/type/types/undefined.d.mts +0 -11
  1105. package/node_modules/typebox/build/type/types/undefined.mjs +0 -17
  1106. package/node_modules/typebox/build/type/types/union.d.mts +0 -15
  1107. package/node_modules/typebox/build/type/types/union.mjs +0 -24
  1108. package/node_modules/typebox/build/type/types/unknown.d.mts +0 -10
  1109. package/node_modules/typebox/build/type/types/unknown.mjs +0 -17
  1110. package/node_modules/typebox/build/type/types/unsafe.d.mts +0 -10
  1111. package/node_modules/typebox/build/type/types/unsafe.mjs +0 -20
  1112. package/node_modules/typebox/build/type/types/void.d.mts +0 -11
  1113. package/node_modules/typebox/build/type/types/void.mjs +0 -17
  1114. package/node_modules/typebox/build/typebox.d.mts +0 -69
  1115. package/node_modules/typebox/build/typebox.mjs +0 -85
  1116. package/node_modules/typebox/build/value/assert/assert.d.mts +0 -14
  1117. package/node_modules/typebox/build/value/assert/assert.mjs +0 -28
  1118. package/node_modules/typebox/build/value/assert/index.d.mts +0 -1
  1119. package/node_modules/typebox/build/value/assert/index.mjs +0 -1
  1120. package/node_modules/typebox/build/value/check/check.d.mts +0 -5
  1121. package/node_modules/typebox/build/value/check/check.mjs +0 -11
  1122. package/node_modules/typebox/build/value/check/index.d.mts +0 -1
  1123. package/node_modules/typebox/build/value/check/index.mjs +0 -1
  1124. package/node_modules/typebox/build/value/clean/additional.d.mts +0 -2
  1125. package/node_modules/typebox/build/value/clean/additional.mjs +0 -6
  1126. package/node_modules/typebox/build/value/clean/clean.d.mts +0 -15
  1127. package/node_modules/typebox/build/value/clean/clean.mjs +0 -17
  1128. package/node_modules/typebox/build/value/clean/from_array.d.mts +0 -2
  1129. package/node_modules/typebox/build/value/clean/from_array.mjs +0 -8
  1130. package/node_modules/typebox/build/value/clean/from_cyclic.d.mts +0 -2
  1131. package/node_modules/typebox/build/value/clean/from_cyclic.mjs +0 -6
  1132. package/node_modules/typebox/build/value/clean/from_intersect.d.mts +0 -2
  1133. package/node_modules/typebox/build/value/clean/from_intersect.mjs +0 -26
  1134. package/node_modules/typebox/build/value/clean/from_object.d.mts +0 -2
  1135. package/node_modules/typebox/build/value/clean/from_object.mjs +0 -31
  1136. package/node_modules/typebox/build/value/clean/from_record.d.mts +0 -2
  1137. package/node_modules/typebox/build/value/clean/from_record.mjs +0 -32
  1138. package/node_modules/typebox/build/value/clean/from_ref.d.mts +0 -2
  1139. package/node_modules/typebox/build/value/clean/from_ref.mjs +0 -8
  1140. package/node_modules/typebox/build/value/clean/from_tuple.d.mts +0 -2
  1141. package/node_modules/typebox/build/value/clean/from_tuple.mjs +0 -14
  1142. package/node_modules/typebox/build/value/clean/from_type.d.mts +0 -2
  1143. package/node_modules/typebox/build/value/clean/from_type.mjs +0 -21
  1144. package/node_modules/typebox/build/value/clean/from_union.d.mts +0 -2
  1145. package/node_modules/typebox/build/value/clean/from_union.mjs +0 -12
  1146. package/node_modules/typebox/build/value/clean/index.d.mts +0 -1
  1147. package/node_modules/typebox/build/value/clean/index.mjs +0 -1
  1148. package/node_modules/typebox/build/value/clone/clone.d.mts +0 -5
  1149. package/node_modules/typebox/build/value/clone/clone.mjs +0 -12
  1150. package/node_modules/typebox/build/value/clone/index.d.mts +0 -1
  1151. package/node_modules/typebox/build/value/clone/index.mjs +0 -1
  1152. package/node_modules/typebox/build/value/codec/callback.d.mts +0 -2
  1153. package/node_modules/typebox/build/value/codec/callback.mjs +0 -25
  1154. package/node_modules/typebox/build/value/codec/decode.d.mts +0 -12
  1155. package/node_modules/typebox/build/value/codec/decode.mjs +0 -52
  1156. package/node_modules/typebox/build/value/codec/encode.d.mts +0 -12
  1157. package/node_modules/typebox/build/value/codec/encode.mjs +0 -52
  1158. package/node_modules/typebox/build/value/codec/from_array.d.mts +0 -2
  1159. package/node_modules/typebox/build/value/codec/from_array.mjs +0 -35
  1160. package/node_modules/typebox/build/value/codec/from_cyclic.d.mts +0 -2
  1161. package/node_modules/typebox/build/value/codec/from_cyclic.mjs +0 -8
  1162. package/node_modules/typebox/build/value/codec/from_intersect.d.mts +0 -2
  1163. package/node_modules/typebox/build/value/codec/from_intersect.mjs +0 -58
  1164. package/node_modules/typebox/build/value/codec/from_object.d.mts +0 -2
  1165. package/node_modules/typebox/build/value/codec/from_object.mjs +0 -42
  1166. package/node_modules/typebox/build/value/codec/from_record.d.mts +0 -2
  1167. package/node_modules/typebox/build/value/codec/from_record.mjs +0 -39
  1168. package/node_modules/typebox/build/value/codec/from_ref.d.mts +0 -2
  1169. package/node_modules/typebox/build/value/codec/from_ref.mjs +0 -31
  1170. package/node_modules/typebox/build/value/codec/from_tuple.d.mts +0 -2
  1171. package/node_modules/typebox/build/value/codec/from_tuple.mjs +0 -32
  1172. package/node_modules/typebox/build/value/codec/from_type.d.mts +0 -2
  1173. package/node_modules/typebox/build/value/codec/from_type.mjs +0 -22
  1174. package/node_modules/typebox/build/value/codec/from_union.d.mts +0 -2
  1175. package/node_modules/typebox/build/value/codec/from_union.mjs +0 -39
  1176. package/node_modules/typebox/build/value/codec/has.d.mts +0 -5
  1177. package/node_modules/typebox/build/value/codec/has.mjs +0 -93
  1178. package/node_modules/typebox/build/value/codec/index.d.mts +0 -3
  1179. package/node_modules/typebox/build/value/codec/index.mjs +0 -3
  1180. package/node_modules/typebox/build/value/convert/convert.d.mts +0 -13
  1181. package/node_modules/typebox/build/value/convert/convert.mjs +0 -15
  1182. package/node_modules/typebox/build/value/convert/from_additional.d.mts +0 -6
  1183. package/node_modules/typebox/build/value/convert/from_additional.mjs +0 -18
  1184. package/node_modules/typebox/build/value/convert/from_array.d.mts +0 -2
  1185. package/node_modules/typebox/build/value/convert/from_array.mjs +0 -7
  1186. package/node_modules/typebox/build/value/convert/from_bigint.d.mts +0 -2
  1187. package/node_modules/typebox/build/value/convert/from_bigint.mjs +0 -6
  1188. package/node_modules/typebox/build/value/convert/from_boolean.d.mts +0 -2
  1189. package/node_modules/typebox/build/value/convert/from_boolean.mjs +0 -6
  1190. package/node_modules/typebox/build/value/convert/from_cyclic.d.mts +0 -2
  1191. package/node_modules/typebox/build/value/convert/from_cyclic.mjs +0 -6
  1192. package/node_modules/typebox/build/value/convert/from_enum.d.mts +0 -2
  1193. package/node_modules/typebox/build/value/convert/from_enum.mjs +0 -6
  1194. package/node_modules/typebox/build/value/convert/from_integer.d.mts +0 -2
  1195. package/node_modules/typebox/build/value/convert/from_integer.mjs +0 -6
  1196. package/node_modules/typebox/build/value/convert/from_intersect.d.mts +0 -2
  1197. package/node_modules/typebox/build/value/convert/from_intersect.mjs +0 -8
  1198. package/node_modules/typebox/build/value/convert/from_literal.d.mts +0 -2
  1199. package/node_modules/typebox/build/value/convert/from_literal.mjs +0 -44
  1200. package/node_modules/typebox/build/value/convert/from_null.d.mts +0 -2
  1201. package/node_modules/typebox/build/value/convert/from_null.mjs +0 -6
  1202. package/node_modules/typebox/build/value/convert/from_number.d.mts +0 -2
  1203. package/node_modules/typebox/build/value/convert/from_number.mjs +0 -6
  1204. package/node_modules/typebox/build/value/convert/from_object.d.mts +0 -2
  1205. package/node_modules/typebox/build/value/convert/from_object.mjs +0 -28
  1206. package/node_modules/typebox/build/value/convert/from_record.d.mts +0 -2
  1207. package/node_modules/typebox/build/value/convert/from_record.mjs +0 -23
  1208. package/node_modules/typebox/build/value/convert/from_ref.d.mts +0 -2
  1209. package/node_modules/typebox/build/value/convert/from_ref.mjs +0 -8
  1210. package/node_modules/typebox/build/value/convert/from_string.d.mts +0 -2
  1211. package/node_modules/typebox/build/value/convert/from_string.mjs +0 -6
  1212. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +0 -2
  1213. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +0 -6
  1214. package/node_modules/typebox/build/value/convert/from_tuple.d.mts +0 -2
  1215. package/node_modules/typebox/build/value/convert/from_tuple.mjs +0 -11
  1216. package/node_modules/typebox/build/value/convert/from_type.d.mts +0 -2
  1217. package/node_modules/typebox/build/value/convert/from_type.mjs +0 -43
  1218. package/node_modules/typebox/build/value/convert/from_undefined.d.mts +0 -2
  1219. package/node_modules/typebox/build/value/convert/from_undefined.mjs +0 -6
  1220. package/node_modules/typebox/build/value/convert/from_union.d.mts +0 -2
  1221. package/node_modules/typebox/build/value/convert/from_union.mjs +0 -13
  1222. package/node_modules/typebox/build/value/convert/from_void.d.mts +0 -2
  1223. package/node_modules/typebox/build/value/convert/from_void.mjs +0 -6
  1224. package/node_modules/typebox/build/value/convert/index.d.mts +0 -1
  1225. package/node_modules/typebox/build/value/convert/index.mjs +0 -1
  1226. package/node_modules/typebox/build/value/convert/try/index.d.mts +0 -1
  1227. package/node_modules/typebox/build/value/convert/try/index.mjs +0 -1
  1228. package/node_modules/typebox/build/value/convert/try/try.d.mts +0 -8
  1229. package/node_modules/typebox/build/value/convert/try/try.mjs +0 -8
  1230. package/node_modules/typebox/build/value/convert/try/try_array.d.mts +0 -2
  1231. package/node_modules/typebox/build/value/convert/try/try_array.mjs +0 -6
  1232. package/node_modules/typebox/build/value/convert/try/try_bigint.d.mts +0 -2
  1233. package/node_modules/typebox/build/value/convert/try/try_bigint.mjs +0 -45
  1234. package/node_modules/typebox/build/value/convert/try/try_boolean.d.mts +0 -2
  1235. package/node_modules/typebox/build/value/convert/try/try_boolean.mjs +0 -41
  1236. package/node_modules/typebox/build/value/convert/try/try_null.d.mts +0 -2
  1237. package/node_modules/typebox/build/value/convert/try/try_null.mjs +0 -44
  1238. package/node_modules/typebox/build/value/convert/try/try_number.d.mts +0 -2
  1239. package/node_modules/typebox/build/value/convert/try/try_number.mjs +0 -44
  1240. package/node_modules/typebox/build/value/convert/try/try_result.d.mts +0 -8
  1241. package/node_modules/typebox/build/value/convert/try/try_result.mjs +0 -17
  1242. package/node_modules/typebox/build/value/convert/try/try_string.d.mts +0 -2
  1243. package/node_modules/typebox/build/value/convert/try/try_string.mjs +0 -12
  1244. package/node_modules/typebox/build/value/convert/try/try_undefined.d.mts +0 -2
  1245. package/node_modules/typebox/build/value/convert/try/try_undefined.mjs +0 -44
  1246. package/node_modules/typebox/build/value/create/create.d.mts +0 -5
  1247. package/node_modules/typebox/build/value/create/create.mjs +0 -11
  1248. package/node_modules/typebox/build/value/create/error.d.mts +0 -5
  1249. package/node_modules/typebox/build/value/create/error.mjs +0 -7
  1250. package/node_modules/typebox/build/value/create/from_array.d.mts +0 -2
  1251. package/node_modules/typebox/build/value/create/from_array.mjs +0 -10
  1252. package/node_modules/typebox/build/value/create/from_bigint.d.mts +0 -2
  1253. package/node_modules/typebox/build/value/create/from_bigint.mjs +0 -7
  1254. package/node_modules/typebox/build/value/create/from_boolean.d.mts +0 -2
  1255. package/node_modules/typebox/build/value/create/from_boolean.mjs +0 -4
  1256. package/node_modules/typebox/build/value/create/from_constructor.d.mts +0 -2
  1257. package/node_modules/typebox/build/value/create/from_constructor.mjs +0 -10
  1258. package/node_modules/typebox/build/value/create/from_cyclic.d.mts +0 -2
  1259. package/node_modules/typebox/build/value/create/from_cyclic.mjs +0 -6
  1260. package/node_modules/typebox/build/value/create/from_default.d.mts +0 -3
  1261. package/node_modules/typebox/build/value/create/from_default.mjs +0 -10
  1262. package/node_modules/typebox/build/value/create/from_enum.d.mts +0 -2
  1263. package/node_modules/typebox/build/value/create/from_enum.mjs +0 -6
  1264. package/node_modules/typebox/build/value/create/from_function.d.mts +0 -2
  1265. package/node_modules/typebox/build/value/create/from_function.mjs +0 -6
  1266. package/node_modules/typebox/build/value/create/from_integer.d.mts +0 -2
  1267. package/node_modules/typebox/build/value/create/from_integer.mjs +0 -8
  1268. package/node_modules/typebox/build/value/create/from_intersect.d.mts +0 -2
  1269. package/node_modules/typebox/build/value/create/from_intersect.mjs +0 -8
  1270. package/node_modules/typebox/build/value/create/from_literal.d.mts +0 -2
  1271. package/node_modules/typebox/build/value/create/from_literal.mjs +0 -4
  1272. package/node_modules/typebox/build/value/create/from_never.d.mts +0 -2
  1273. package/node_modules/typebox/build/value/create/from_never.mjs +0 -5
  1274. package/node_modules/typebox/build/value/create/from_null.d.mts +0 -2
  1275. package/node_modules/typebox/build/value/create/from_null.mjs +0 -4
  1276. package/node_modules/typebox/build/value/create/from_number.d.mts +0 -2
  1277. package/node_modules/typebox/build/value/create/from_number.mjs +0 -8
  1278. package/node_modules/typebox/build/value/create/from_object.d.mts +0 -2
  1279. package/node_modules/typebox/build/value/create/from_object.mjs +0 -9
  1280. package/node_modules/typebox/build/value/create/from_record.d.mts +0 -2
  1281. package/node_modules/typebox/build/value/create/from_record.mjs +0 -8
  1282. package/node_modules/typebox/build/value/create/from_ref.d.mts +0 -2
  1283. package/node_modules/typebox/build/value/create/from_ref.mjs +0 -9
  1284. package/node_modules/typebox/build/value/create/from_string.d.mts +0 -2
  1285. package/node_modules/typebox/build/value/create/from_string.mjs +0 -9
  1286. package/node_modules/typebox/build/value/create/from_symbol.d.mts +0 -2
  1287. package/node_modules/typebox/build/value/create/from_symbol.mjs +0 -4
  1288. package/node_modules/typebox/build/value/create/from_template_literal.d.mts +0 -2
  1289. package/node_modules/typebox/build/value/create/from_template_literal.mjs +0 -11
  1290. package/node_modules/typebox/build/value/create/from_tuple.d.mts +0 -2
  1291. package/node_modules/typebox/build/value/create/from_tuple.mjs +0 -5
  1292. package/node_modules/typebox/build/value/create/from_type.d.mts +0 -2
  1293. package/node_modules/typebox/build/value/create/from_type.mjs +0 -61
  1294. package/node_modules/typebox/build/value/create/from_undefined.d.mts +0 -2
  1295. package/node_modules/typebox/build/value/create/from_undefined.mjs +0 -4
  1296. package/node_modules/typebox/build/value/create/from_union.d.mts +0 -2
  1297. package/node_modules/typebox/build/value/create/from_union.mjs +0 -9
  1298. package/node_modules/typebox/build/value/create/from_void.d.mts +0 -2
  1299. package/node_modules/typebox/build/value/create/from_void.mjs +0 -4
  1300. package/node_modules/typebox/build/value/create/index.d.mts +0 -2
  1301. package/node_modules/typebox/build/value/create/index.mjs +0 -2
  1302. package/node_modules/typebox/build/value/default/default.d.mts +0 -13
  1303. package/node_modules/typebox/build/value/default/default.mjs +0 -15
  1304. package/node_modules/typebox/build/value/default/from_array.d.mts +0 -2
  1305. package/node_modules/typebox/build/value/default/from_array.mjs +0 -12
  1306. package/node_modules/typebox/build/value/default/from_cyclic.d.mts +0 -2
  1307. package/node_modules/typebox/build/value/default/from_cyclic.mjs +0 -7
  1308. package/node_modules/typebox/build/value/default/from_default.d.mts +0 -3
  1309. package/node_modules/typebox/build/value/default/from_default.mjs +0 -13
  1310. package/node_modules/typebox/build/value/default/from_intersect.d.mts +0 -2
  1311. package/node_modules/typebox/build/value/default/from_intersect.mjs +0 -9
  1312. package/node_modules/typebox/build/value/default/from_object.d.mts +0 -2
  1313. package/node_modules/typebox/build/value/default/from_object.mjs +0 -32
  1314. package/node_modules/typebox/build/value/default/from_record.d.mts +0 -2
  1315. package/node_modules/typebox/build/value/default/from_record.mjs +0 -26
  1316. package/node_modules/typebox/build/value/default/from_ref.d.mts +0 -2
  1317. package/node_modules/typebox/build/value/default/from_ref.mjs +0 -9
  1318. package/node_modules/typebox/build/value/default/from_tuple.d.mts +0 -2
  1319. package/node_modules/typebox/build/value/default/from_tuple.mjs +0 -14
  1320. package/node_modules/typebox/build/value/default/from_type.d.mts +0 -2
  1321. package/node_modules/typebox/build/value/default/from_type.mjs +0 -25
  1322. package/node_modules/typebox/build/value/default/from_union.d.mts +0 -2
  1323. package/node_modules/typebox/build/value/default/from_union.mjs +0 -14
  1324. package/node_modules/typebox/build/value/default/index.d.mts +0 -1
  1325. package/node_modules/typebox/build/value/default/index.mjs +0 -1
  1326. package/node_modules/typebox/build/value/delta/diff.d.mts +0 -10
  1327. package/node_modules/typebox/build/value/delta/diff.mjs +0 -135
  1328. package/node_modules/typebox/build/value/delta/edit.d.mts +0 -24
  1329. package/node_modules/typebox/build/value/delta/edit.mjs +0 -17
  1330. package/node_modules/typebox/build/value/delta/index.d.mts +0 -3
  1331. package/node_modules/typebox/build/value/delta/index.mjs +0 -3
  1332. package/node_modules/typebox/build/value/delta/patch.d.mts +0 -8
  1333. package/node_modules/typebox/build/value/delta/patch.mjs +0 -42
  1334. package/node_modules/typebox/build/value/equal/equal.d.mts +0 -2
  1335. package/node_modules/typebox/build/value/equal/equal.mjs +0 -6
  1336. package/node_modules/typebox/build/value/equal/index.d.mts +0 -1
  1337. package/node_modules/typebox/build/value/equal/index.mjs +0 -1
  1338. package/node_modules/typebox/build/value/errors/errors.d.mts +0 -6
  1339. package/node_modules/typebox/build/value/errors/errors.mjs +0 -12
  1340. package/node_modules/typebox/build/value/errors/index.d.mts +0 -1
  1341. package/node_modules/typebox/build/value/errors/index.mjs +0 -1
  1342. package/node_modules/typebox/build/value/hash/hash.d.mts +0 -6
  1343. package/node_modules/typebox/build/value/hash/hash.mjs +0 -10
  1344. package/node_modules/typebox/build/value/hash/index.d.mts +0 -1
  1345. package/node_modules/typebox/build/value/hash/index.mjs +0 -1
  1346. package/node_modules/typebox/build/value/index.d.mts +0 -20
  1347. package/node_modules/typebox/build/value/index.mjs +0 -29
  1348. package/node_modules/typebox/build/value/parse/index.d.mts +0 -1
  1349. package/node_modules/typebox/build/value/parse/index.mjs +0 -1
  1350. package/node_modules/typebox/build/value/parse/parse.d.mts +0 -11
  1351. package/node_modules/typebox/build/value/parse/parse.mjs +0 -47
  1352. package/node_modules/typebox/build/value/pipeline/index.d.mts +0 -1
  1353. package/node_modules/typebox/build/value/pipeline/index.mjs +0 -1
  1354. package/node_modules/typebox/build/value/pipeline/pipeline.d.mts +0 -10
  1355. package/node_modules/typebox/build/value/pipeline/pipeline.mjs +0 -15
  1356. package/node_modules/typebox/build/value/pointer/index.d.mts +0 -1
  1357. package/node_modules/typebox/build/value/pointer/index.mjs +0 -1
  1358. package/node_modules/typebox/build/value/repair/error.d.mts +0 -7
  1359. package/node_modules/typebox/build/value/repair/error.mjs +0 -8
  1360. package/node_modules/typebox/build/value/repair/from_array.d.mts +0 -2
  1361. package/node_modules/typebox/build/value/repair/from_array.mjs +0 -39
  1362. package/node_modules/typebox/build/value/repair/from_enum.d.mts +0 -2
  1363. package/node_modules/typebox/build/value/repair/from_enum.mjs +0 -6
  1364. package/node_modules/typebox/build/value/repair/from_intersect.d.mts +0 -2
  1365. package/node_modules/typebox/build/value/repair/from_intersect.mjs +0 -8
  1366. package/node_modules/typebox/build/value/repair/from_object.d.mts +0 -2
  1367. package/node_modules/typebox/build/value/repair/from_object.mjs +0 -33
  1368. package/node_modules/typebox/build/value/repair/from_record.d.mts +0 -2
  1369. package/node_modules/typebox/build/value/repair/from_record.mjs +0 -33
  1370. package/node_modules/typebox/build/value/repair/from_ref.d.mts +0 -2
  1371. package/node_modules/typebox/build/value/repair/from_ref.mjs +0 -9
  1372. package/node_modules/typebox/build/value/repair/from_template_literal.d.mts +0 -2
  1373. package/node_modules/typebox/build/value/repair/from_template_literal.mjs +0 -7
  1374. package/node_modules/typebox/build/value/repair/from_tuple.d.mts +0 -2
  1375. package/node_modules/typebox/build/value/repair/from_tuple.mjs +0 -12
  1376. package/node_modules/typebox/build/value/repair/from_type.d.mts +0 -2
  1377. package/node_modules/typebox/build/value/repair/from_type.mjs +0 -88
  1378. package/node_modules/typebox/build/value/repair/from_union.d.mts +0 -2
  1379. package/node_modules/typebox/build/value/repair/from_union.mjs +0 -24
  1380. package/node_modules/typebox/build/value/repair/from_unknown.d.mts +0 -2
  1381. package/node_modules/typebox/build/value/repair/from_unknown.mjs +0 -12
  1382. package/node_modules/typebox/build/value/repair/index.d.mts +0 -1
  1383. package/node_modules/typebox/build/value/repair/index.mjs +0 -1
  1384. package/node_modules/typebox/build/value/repair/repair.d.mts +0 -17
  1385. package/node_modules/typebox/build/value/repair/repair.mjs +0 -20
  1386. package/node_modules/typebox/build/value/shared/index.d.mts +0 -3
  1387. package/node_modules/typebox/build/value/shared/index.mjs +0 -4
  1388. package/node_modules/typebox/build/value/shared/optional_undefined.d.mts +0 -2
  1389. package/node_modules/typebox/build/value/shared/optional_undefined.mjs +0 -15
  1390. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +0 -7
  1391. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +0 -72
  1392. package/node_modules/typebox/build/value/shared/union_score_select.d.mts +0 -3
  1393. package/node_modules/typebox/build/value/shared/union_score_select.mjs +0 -51
  1394. package/node_modules/typebox/build/value/value.d.mts +0 -15
  1395. package/node_modules/typebox/build/value/value.mjs +0 -15
  1396. package/node_modules/typebox/license +0 -23
  1397. package/node_modules/typebox/package.json +0 -87
  1398. package/node_modules/typebox/readme.md +0 -371
package/app/app.mjs ADDED
@@ -0,0 +1,1378 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * pi-proactive App —— **pi-agent 的 shim / wrapper**(最小可用外壳 · M1a)。
4
+ *
5
+ * 定位(docs/product/app-shell/APP-SPEC.md §0):App **不实现**任何 agent / 调度 / 主动性逻辑;
6
+ * 它只做三件事 —— 启动(shim)· 注入(wrapper)· 呈现(通知 / 只读面板)。
7
+ * 底下跑的就是**真 pi-agent 本体**(`pi --mode rpc --no-session -e <pi-proactive 包>`)。
8
+ *
9
+ * 六个域(与 APP-SPEC §1 一一对应):
10
+ * D1 注入 启动参数 = `pi --mode rpc --no-session -e <包路径>`;**可证明** = 进程内扩展清单含 pi-proactive。
11
+ * D2 承载 专属短路径 agent 根 `/tmp/pp-app-<pid>`(unix socket 路径上限 100B → 端点必须建得出来)。
12
+ * D3 驱动 JSONL 命令/响应**按 id 关联**(不是按顺序)。
13
+ * D4 呈现 系统通知(macOS osascript,通道可插拔、不可用时**明确降级**)+ 只读监督面板(复用 supervisor-web)。
14
+ * D5 生命周期 单实例锁 · 二次启动回执「已在运行」· 退出**零残留**(进程/socket/临时根/锁/日志)。
15
+ * D6 引导 ≤3 步、一次只问一件事、任何一步可「算了」且零残留 + **三问话术**(它是谁/在干什么/怎么让它做事)。
16
+ *
17
+ * 硬纪律:
18
+ * - 零第三方依赖(只用 Node 内置);纯 .mjs(npm 包内不得有 .ts)。
19
+ * - **状态等待代替固定等待**:等扩展真的注册了才叫就绪;超时 ⇒ 报【未就绪】+ 诊断(禁止 sleep 后假装成功)。
20
+ * - **单次注入**:只用 `-e`,不写用户 settings.json(不污染用户环境)。
21
+ * - **不写凭据**:沿用宿主 pi 的认证(共享模式)或环境里的 API key;App 自己不存任何凭据。
22
+ * - **不碰用户既有项目**:只读监督面;写操作留 pi-agent。
23
+ *
24
+ * 用法:`node app/app.mjs <start|stop|status|describe|guide|ask> [选项]`
25
+ */
26
+ import { spawn, spawnSync } from "node:child_process";
27
+ import { createHash } from "node:crypto";
28
+ import fs from "node:fs";
29
+ import os from "node:os";
30
+ import path from "node:path";
31
+ import { fileURLToPath, pathToFileURL } from "node:url";
32
+
33
+ const here = path.dirname(fileURLToPath(import.meta.url));
34
+
35
+ /** 包根:`<pkg>/app` → `<pkg>`(npm 安装后 = 已安装的 pi-proactive 包)。 */
36
+ export const DEFAULT_PKG_ROOT = path.resolve(here, "..");
37
+
38
+ /** unix socket 路径上限(字节)—— 与 pi-proactive/src/socket.ts 的 MAX_SOCKET_PATH_BYTES 同口径。 */
39
+ export const MAX_SOCKET_PATH_BYTES = 100;
40
+
41
+ /** App 实例的默认 agentId(短 → 端点路径短且可预测)。 */
42
+ export const APP_AGENT_ID = "app";
43
+
44
+ /** 端点落在 `<agentRoot>/proactive/run/`(与 src/socket.ts 的布局一致)。 */
45
+ const RUN_SUBDIR = path.join("proactive", "run");
46
+
47
+ /** 通知记录(证据)落在 `<agentRoot>/proactive/app/`。 */
48
+ const APP_SUBDIR = path.join("proactive", "app");
49
+
50
+ const MISSING_PI_MESSAGE =
51
+ "未找到 pi 可执行文件(--pi-bin 未给、PI_BIN 未设、PATH 里也没有 pi)。\n" +
52
+ "安装指引:npm i -g @earendil-works/pi-coding-agent\n" +
53
+ "或用 --pi-bin /绝对路径/pi(或环境变量 PI_BIN=/绝对路径/pi)指定已安装的 pi。";
54
+
55
+ // ------------------------------------------------------------------ 小工具
56
+
57
+ function errText(err) {
58
+ return err instanceof Error ? err.message : String(err);
59
+ }
60
+
61
+ /**
62
+ * 进程是否存活。
63
+ * EPERM = 活着但不属于当前用户;僵尸(Z)= 已退出、只是等父进程收尸 → 不算活着。
64
+ */
65
+ function isAlive(pid) {
66
+ if (!pid || pid <= 0) return false;
67
+ try {
68
+ process.kill(pid, 0);
69
+ } catch (err) {
70
+ return Boolean(err && err.code === "EPERM");
71
+ }
72
+ try {
73
+ const out = spawnSync("ps", ["-o", "state=", "-p", String(pid)], { encoding: "utf8" });
74
+ if ((out.stdout || "").trim().startsWith("Z")) return false;
75
+ } catch {
76
+ /* ignore */
77
+ }
78
+ return true;
79
+ }
80
+
81
+ /** 可执行文件判定(存在 + 是文件 + 有执行位)。 */
82
+ function isExecutableFile(p) {
83
+ try {
84
+ const st = fs.statSync(p);
85
+ if (!st.isFile()) return false;
86
+ fs.accessSync(p, fs.constants.X_OK);
87
+ return true;
88
+ } catch {
89
+ return false;
90
+ }
91
+ }
92
+
93
+ /** 短路径临时根:优先 /tmp(macOS 的 os.tmpdir() 很长,会吃掉 socket 路径预算)。 */
94
+ function defaultTmpDir() {
95
+ try {
96
+ if (fs.statSync("/tmp").isDirectory()) return "/tmp";
97
+ } catch {
98
+ /* ignore */
99
+ }
100
+ return os.tmpdir();
101
+ }
102
+
103
+ function uid() {
104
+ return typeof process.getuid === "function" ? process.getuid() : 0;
105
+ }
106
+
107
+ /** agentId → 文件名安全化(与扩展 sanitizeSocketFileName 同口径:`/` `\` `#` 空白 → `-`)。 */
108
+ function sanitizeName(name) {
109
+ return String(name).replace(/[/\\#\s]/g, "-") || "unknown";
110
+ }
111
+
112
+ /**
113
+ * 端点路径(与 src/socket.ts 的 socketPathFor **同规则**):
114
+ * 常规名 `<sanitized(agentId)>.sock`;完整路径超 100B → 降级为 `h-<sha256 前 16 位>.sock`。
115
+ * 判定只依赖 (agentId, agentDir) → 与扩展服务端推出同一个路径。
116
+ */
117
+ function socketPathFor(agentId, agentRoot) {
118
+ const runDir = path.join(agentRoot, RUN_SUBDIR);
119
+ const natural = path.join(runDir, `${sanitizeName(agentId)}.sock`);
120
+ if (Buffer.byteLength(natural, "utf8") <= MAX_SOCKET_PATH_BYTES) return natural;
121
+ const hashed = `h-${createHash("sha256").update(String(agentId), "utf8").digest("hex").slice(0, 16)}.sock`;
122
+ return path.join(runDir, hashed);
123
+ }
124
+
125
+ // ------------------------------------------------------------------ D2 承载
126
+
127
+ /**
128
+ * 算出本次实例的「承载面」:agent 根 / 端点 / 日志 / 锁。
129
+ * - dedicated(默认):`/tmp/pp-app-<pid>`(**专属短路径**)→ 我们拥有它 → 退出可整体删除;
130
+ * - shared:沿用宿主 pi 的 agent 根(PI_CODING_AGENT_DIR 或 ~/.pi/agent)→ **我们不拥有** → 只删自己的产物;
131
+ * - 显式 agentDir:覆盖根目录,同样**不拥有**。
132
+ */
133
+ export function resolveInstance(opts = {}) {
134
+ const env = opts.env || process.env;
135
+ const pid = opts.pid || process.pid;
136
+ const agentRootKind = opts.agentRootKind === "shared" ? "shared" : "dedicated";
137
+ const explicit = opts.agentDir ? String(opts.agentDir) : "";
138
+ const tmpDir = opts.tmpDir || defaultTmpDir();
139
+ const dedicatedRoot = path.join(tmpDir, `pp-app-${pid}`);
140
+ const sharedRoot = env.PI_CODING_AGENT_DIR ? env.PI_CODING_AGENT_DIR : path.join(os.homedir(), ".pi", "agent");
141
+ const agentRoot = explicit || (agentRootKind === "shared" ? sharedRoot : dedicatedRoot);
142
+ return composeInstance({
143
+ agentRootKind,
144
+ agentRoot,
145
+ ownsAgentRoot: agentRootKind !== "shared" && explicit === "",
146
+ agentId: env.PI_PROACTIVE_AGENT_ID ? env.PI_PROACTIVE_AGENT_ID : APP_AGENT_ID,
147
+ logPath: path.join(tmpDir, `pp-app-${pid}.log`),
148
+ // 锁与实例无关(跨实例才能检出「已在运行」)→ 按 uid 隔离,避免跨用户互相挡。
149
+ lockPath: path.join(tmpDir, `pp-app-${uid()}.lock`),
150
+ pkgRoot: opts.pkgRoot || env.PI_PROACTIVE_PKG_ROOT || DEFAULT_PKG_ROOT,
151
+ });
152
+ }
153
+
154
+ /** 由原始字段算出完整实例描述(端点路径与长度预算统一在这里算)。 */
155
+ function composeInstance(raw) {
156
+ const socketPath = socketPathFor(raw.agentId, raw.agentRoot);
157
+ const socketPathBytes = Buffer.byteLength(socketPath, "utf8");
158
+ return {
159
+ agentRootKind: raw.agentRootKind,
160
+ dedicated: raw.agentRootKind === "dedicated",
161
+ ownsAgentRoot: Boolean(raw.ownsAgentRoot),
162
+ agentRoot: raw.agentRoot,
163
+ agentId: raw.agentId,
164
+ socketPath,
165
+ socketPathBytes,
166
+ // 如实标记:超长 = 端点建不出来 → 后续检查必须判「未触发」,不得判「不残留」。
167
+ socketOverBudget: socketPathBytes > MAX_SOCKET_PATH_BYTES,
168
+ logPath: raw.logPath,
169
+ lockPath: raw.lockPath,
170
+ pkgRoot: raw.pkgRoot,
171
+ };
172
+ }
173
+
174
+ /**
175
+ * 锁文件是「现在跑着的是哪个实例」的**唯一真源**:
176
+ * stop / status 必须按锁里记的路径清理与汇报 —— 否则会拿自己的 pid 去清别人的实例(清不到 = 残留)。
177
+ */
178
+ function instanceFromLock(lock, fallback) {
179
+ if (!lock) return fallback;
180
+ return composeInstance({
181
+ agentRootKind: lock.agentRootKind || fallback.agentRootKind,
182
+ agentRoot: lock.agentRoot || fallback.agentRoot,
183
+ ownsAgentRoot: lock.ownsAgentRoot === undefined ? fallback.ownsAgentRoot : Boolean(lock.ownsAgentRoot),
184
+ agentId: lock.agentId || fallback.agentId,
185
+ logPath: lock.logPath || fallback.logPath,
186
+ lockPath: fallback.lockPath,
187
+ pkgRoot: lock.pkgRoot || fallback.pkgRoot,
188
+ });
189
+ }
190
+
191
+ /** 找真实存在的端点(run/*.sock);没有则返回 null(= **未触发**,不是「不残留」)。 */
192
+ export function findEndpoint(agentRoot) {
193
+ const dir = path.join(agentRoot, RUN_SUBDIR);
194
+ let names;
195
+ try {
196
+ names = fs.readdirSync(dir);
197
+ } catch {
198
+ return null;
199
+ }
200
+ const sock = names.filter((n) => n.endsWith(".sock")).sort()[0];
201
+ if (!sock) return null;
202
+ const p = path.join(dir, sock);
203
+ return { path: p, bytes: Buffer.byteLength(p, "utf8") };
204
+ }
205
+
206
+ /** 本机是否有我们留下的 launchd 单元(本 App 不装单元 —— 检查即证明)。 */
207
+ function listLaunchdUnits() {
208
+ const dir = path.join(os.homedir(), "Library", "LaunchAgents");
209
+ try {
210
+ return fs
211
+ .readdirSync(dir)
212
+ .filter((n) => n.startsWith("pp-app") && n.endsWith(".plist"))
213
+ .sort();
214
+ } catch {
215
+ return [];
216
+ }
217
+ }
218
+
219
+ /** 残留终检(进程 / 端点 / 目录 / 锁 / 日志 / launchd)。 */
220
+ /** 残留终检(进程 / 端点 / 目录 / 锁 / 日志 / launchd)。 */
221
+ export function residueReport(instance, lock) {
222
+ const endpoint = findEndpoint(instance.agentRoot);
223
+ return {
224
+ // 「残留」= 停完之后**还在外面跑着**的进程;本进程自己不算残留。
225
+ appProcessAlive: isAlive(lock && lock.pid) && (!lock || lock.pid !== process.pid),
226
+ piProcessAlive: isAlive(lock && lock.piPid),
227
+ socketExists: fs.existsSync(instance.socketPath),
228
+ endpointExists: endpoint !== null,
229
+ agentRootExists: fs.existsSync(instance.agentRoot),
230
+ lockExists: fs.existsSync(instance.lockPath),
231
+ logExists: fs.existsSync(instance.logPath),
232
+ launchdUnits: listLaunchdUnits(),
233
+ };
234
+ }
235
+
236
+ // ------------------------------------------------------------------ D1 注入
237
+
238
+ /**
239
+ * 定位 pi 可执行文件:--pi-bin > PI_BIN > PATH。
240
+ * 找不到 → 抛错并给安装指引(**不静默降级、不假装在跑**)。
241
+ */
242
+ export function resolvePiBin(opts = {}) {
243
+ const env = opts.env || process.env;
244
+ const explicit = opts.piBin ? String(opts.piBin) : "";
245
+ const fromEnv = env.PI_BIN ? String(env.PI_BIN) : "";
246
+ for (const cand of [
247
+ { bin: explicit, source: "arg" },
248
+ { bin: fromEnv, source: "env" },
249
+ ]) {
250
+ if (!cand.bin) continue;
251
+ if (!isExecutableFile(cand.bin)) {
252
+ throw new Error(
253
+ `指定的 pi 可执行文件不可用:${cand.bin}(来源:${cand.source === "arg" ? "--pi-bin" : "PI_BIN"})—— ` +
254
+ "请给出真实存在且可执行的绝对路径",
255
+ );
256
+ }
257
+ return { bin: cand.bin, source: cand.source };
258
+ }
259
+ for (const dir of (env.PATH || "").split(path.delimiter)) {
260
+ if (!dir) continue;
261
+ const cand = path.join(dir, "pi");
262
+ if (isExecutableFile(cand)) return { bin: cand, source: "path" };
263
+ }
264
+ throw new Error(MISSING_PI_MESSAGE);
265
+ }
266
+
267
+ /**
268
+ * 启动参数:`pi --mode rpc --no-session -e <pi-proactive 包路径>`。
269
+ * - `--mode rpc`:JSONL 命令/响应/事件;
270
+ * - `--no-session`:不落会话文件;
271
+ * - `-e/--extension`:pi 官方的「单次调用试一个包」→ 天然幂等、**不写用户 settings.json**。
272
+ */
273
+ export function buildLaunchArgs(opts = {}) {
274
+ const pkgRoot = opts.pkgRoot || DEFAULT_PKG_ROOT;
275
+ return ["--mode", "rpc", "--no-session", "-e", pkgRoot];
276
+ }
277
+
278
+ /** 子进程环境:把 agent 根与身份显式交给扩展(**不写任何凭据文件**)。 */
279
+ function buildChildEnv(opts = {}) {
280
+ const env = opts.env || process.env;
281
+ const instance = opts.instance;
282
+ return {
283
+ ...env,
284
+ PI_CODING_AGENT_DIR: instance.agentRoot,
285
+ PI_PROACTIVE_AGENT_ID: instance.agentId,
286
+ // App 下的会话以【协调者】角色运行(DESIGN §9 G-4)。
287
+ PI_PROACTIVE_ROLE: "coordinator",
288
+ };
289
+ }
290
+
291
+ /**
292
+ * 凭据可用性(**如实**判定,不静默):
293
+ * 共享模式沿用宿主 pi 的 auth.json;专属模式下只能靠环境里的 API key。
294
+ * 都没有 → 明说「能看不能做」。
295
+ */
296
+ /**
297
+ * 平台支持判定(**macOS 优先**;Windows 分支留给后续,但**不得**写成「应该能行」)。
298
+ * 未实现的平台 ⇒ 明确报错,不假装能跑。
299
+ */
300
+ export function platformSupport(platform = process.platform) {
301
+ if (platform === "win32") {
302
+ return {
303
+ supported: false,
304
+ reason:
305
+ "本 App 目前只实现了 macOS / Linux(unix domain socket + 系统通知通道);" +
306
+ "Windows 分支**尚未实现**(端点与通道的落位方式都不同)→ 明确报错,不假装能跑。",
307
+ };
308
+ }
309
+ return { supported: true, reason: "" };
310
+ }
311
+
312
+ /**
313
+ * 凭据可用性(**如实**判定,不静默):
314
+ * 共享模式沿用宿主 pi 的 auth.json;专属模式下只能靠环境里的 API key。
315
+ * 都没有 → 明说「能看不能做」。
316
+ */
317
+ export function detectCredential(agentRoot, env = process.env) {
318
+ const authFile = path.join(agentRoot, "auth.json");
319
+ try {
320
+ const raw = JSON.parse(fs.readFileSync(authFile, "utf8"));
321
+ const providers = Object.entries(raw || {}).filter(
322
+ ([, v]) => v && typeof v === "object" && Object.keys(v).length > 0,
323
+ );
324
+ if (providers.length > 0) {
325
+ return {
326
+ ok: true,
327
+ source: "auth.json",
328
+ detail: `已找到模型凭据(${authFile}:${providers.map(([k]) => k).join("、")})`,
329
+ };
330
+ }
331
+ // pi 会在**新建**的 agent 根写一个空的 `{}` → 那不是凭据(不得据此说「能做事」)。
332
+ } catch {
333
+ /* 没有或读不了 → 继续看环境变量 */
334
+ }
335
+ for (const [key, value] of Object.entries(env || {})) {
336
+ if (key.endsWith("_API_KEY") && typeof value === "string" && value.trim() !== "") {
337
+ return { ok: true, source: "env", detail: `已找到模型凭据(环境变量 ${key})` };
338
+ }
339
+ }
340
+ return {
341
+ ok: false,
342
+ source: "none",
343
+ detail: "这个环境里没有模型凭据(既没有登录文件,也没有 API key 环境变量)→ 我现在只能看、不能做事",
344
+ };
345
+ }
346
+
347
+ // ------------------------------------------------------------------ D3 驱动(JSONL)
348
+
349
+ /**
350
+ * pi 子进程的 JSONL 会话:命令按 **id** 关联响应(不是按顺序)。
351
+ * 事件(extension_ui_request 等)走监听器。
352
+ */
353
+ export function createRpcSession(child) {
354
+ const pending = new Map();
355
+ const listeners = [];
356
+ let buf = "";
357
+ let seq = 0;
358
+
359
+ const onData = (chunk) => {
360
+ buf += String(chunk);
361
+ let idx;
362
+ while ((idx = buf.indexOf("\n")) >= 0) {
363
+ const line = buf.slice(0, idx).replace(/\r$/, "");
364
+ buf = buf.slice(idx + 1);
365
+ if (!line.trim()) continue;
366
+ let rec;
367
+ try {
368
+ rec = JSON.parse(line);
369
+ } catch {
370
+ continue;
371
+ }
372
+ if (rec && rec.type === "response" && rec.id !== undefined && pending.has(rec.id)) {
373
+ const resolve = pending.get(rec.id);
374
+ pending.delete(rec.id);
375
+ resolve(rec);
376
+ continue;
377
+ }
378
+ for (const cb of listeners) {
379
+ try {
380
+ cb(rec);
381
+ } catch {
382
+ /* 监听器出错不得影响协议 */
383
+ }
384
+ }
385
+ }
386
+ };
387
+ child.stdout.on("data", onData);
388
+
389
+ return {
390
+ /** 发一条命令并等它的响应(超时 ⇒ reject,绝不无限等)。 */
391
+ request(command, timeoutMs = 10_000) {
392
+ const id = command.id || `pp-${Date.now()}-${++seq}`;
393
+ const full = { ...command, id };
394
+ return new Promise((resolve, reject) => {
395
+ const timer = setTimeout(() => {
396
+ pending.delete(id);
397
+ reject(new Error(`RPC ${command.type} 超时(${timeoutMs}ms)`));
398
+ }, timeoutMs);
399
+ pending.set(id, (rec) => {
400
+ clearTimeout(timer);
401
+ resolve(rec);
402
+ });
403
+ child.stdin.write(`${JSON.stringify(full)}\n`, (err) => {
404
+ if (err) {
405
+ clearTimeout(timer);
406
+ pending.delete(id);
407
+ reject(err);
408
+ }
409
+ });
410
+ });
411
+ },
412
+ /** 订阅非响应记录(事件 / extension_ui_request)。 */
413
+ onRecord(cb) {
414
+ listeners.push(cb);
415
+ return () => {
416
+ const i = listeners.indexOf(cb);
417
+ if (i >= 0) listeners.splice(i, 1);
418
+ };
419
+ },
420
+ /** 发送一条命令(不等响应)。 */
421
+ send(command) {
422
+ const full = { ...command, id: command.id || `pp-${Date.now()}-${++seq}` };
423
+ child.stdin.write(`${JSON.stringify(full)}\n`);
424
+ return full.id;
425
+ },
426
+ };
427
+ }
428
+
429
+ // ------------------------------------------------------------------ 单实例锁
430
+
431
+ function readLock(lockPath) {
432
+ try {
433
+ const obj = JSON.parse(fs.readFileSync(lockPath, "utf8"));
434
+ return obj && typeof obj === "object" ? obj : null;
435
+ } catch {
436
+ return null;
437
+ }
438
+ }
439
+
440
+ /** 独占创建锁文件(EEXIST = 已经有实例占位)。 */
441
+ function createLock(lockPath, payload) {
442
+ fs.writeFileSync(lockPath, JSON.stringify(payload, null, 2), { flag: "wx", mode: 0o600 });
443
+ }
444
+
445
+ /** 覆盖锁内容(我们已持有它)→ 临时文件 + rename(原子替换)。 */
446
+ function updateLock(lockPath, payload) {
447
+ const tmp = `${lockPath}.${process.pid}.tmp`;
448
+ fs.writeFileSync(tmp, JSON.stringify(payload, null, 2), { mode: 0o600 });
449
+ fs.renameSync(tmp, lockPath);
450
+ }
451
+
452
+ function removeLock(lockPath) {
453
+ try {
454
+ fs.unlinkSync(lockPath);
455
+ } catch {
456
+ /* ignore */
457
+ }
458
+ }
459
+
460
+ // ------------------------------------------------------------------ 清理 / 残留
461
+
462
+ /** 删掉本次实例自己的产物(共享模式下**不**删用户的 agent 根)。 */
463
+ function cleanupArtifacts(instance, lock) {
464
+ const agentId = (lock && lock.agentId) || instance.agentId;
465
+ try {
466
+ fs.unlinkSync(path.join(instance.agentRoot, RUN_SUBDIR, `${sanitizeName(agentId)}.sock`));
467
+ } catch {
468
+ /* ignore */
469
+ }
470
+ try {
471
+ fs.unlinkSync(path.join(instance.agentRoot, "proactive", "agents", `${sanitizeName(agentId)}.json`));
472
+ } catch {
473
+ /* ignore */
474
+ }
475
+ if (instance.ownsAgentRoot) {
476
+ try {
477
+ fs.rmSync(instance.agentRoot, { recursive: true, force: true });
478
+ } catch {
479
+ /* ignore */
480
+ }
481
+ }
482
+ try {
483
+ fs.unlinkSync(instance.logPath);
484
+ } catch {
485
+ /* ignore */
486
+ }
487
+ }
488
+
489
+ // ------------------------------------------------------------------ D4 呈现(复用既有资产)
490
+
491
+ /**
492
+ * 加载包内模块(**产物态 build/src/*.js 优先,源码态 src/*.ts 兜底**)。
493
+ * 与 tools/cli.mjs 的 loadSupervisorModule 同一套路:动态 import 的 specifier 是绝对 file:// URL
494
+ * (.mjs 不能写 .ts 后缀的相对导入 —— 门禁 G3 也是这个口径)。
495
+ */
496
+ export async function loadPiModule(base, pkgRoot = DEFAULT_PKG_ROOT) {
497
+ const candidates = [path.join(pkgRoot, "build", "src", `${base}.js`), path.join(pkgRoot, "src", `${base}.ts`)];
498
+ for (const file of candidates) {
499
+ if (!fs.existsSync(file)) continue;
500
+ return await import(pathToFileURL(file).href);
501
+ }
502
+ throw new Error(`包内缺少模块 ${base}(期望 build/src/${base}.js 或 src/${base}.ts)—— 请重新安装 pi-proactive`);
503
+ }
504
+
505
+ /**
506
+ * 设备级通知通道(**可插拔**):复用 src/notify.ts 的 macOS osascript 通道与四段载荷。
507
+ * 不可用时**明确降级**(不静默):返回 available=false + 原因。
508
+ */
509
+ export async function createNotifier(opts = {}) {
510
+ const notify = await loadPiModule("notify", opts.pkgRoot);
511
+ const channel = notify.createMacChannel({
512
+ ...(opts.exec ? { exec: opts.exec } : {}),
513
+ ...(opts.available ? { available: opts.available } : {}),
514
+ });
515
+ return {
516
+ channel: channel.id,
517
+ available: (() => {
518
+ try {
519
+ return channel.isAvailable();
520
+ } catch {
521
+ return false;
522
+ }
523
+ })(),
524
+ /** 发一条通知(绝不抛错:通知失败不得让 App 崩)。 */
525
+ async send(text, meta = {}) {
526
+ const payload = notify.buildContactPayload({
527
+ why: meta.why ?? "pi 助理有事要告诉你",
528
+ ask: String(text),
529
+ consequence: meta.consequence ?? "先不用你做什么也可以",
530
+ howToDisable: meta.howToDisable ?? "在 Pi 会话里说「别烦我」",
531
+ ...(meta.title ? { title: meta.title } : {}),
532
+ });
533
+ try {
534
+ const res = await channel.send(payload);
535
+ return { ok: Boolean(res.ok), detail: res.detail, payload };
536
+ } catch (err) {
537
+ return { ok: false, detail: errText(err), payload };
538
+ }
539
+ },
540
+ };
541
+ }
542
+
543
+ /** 只读监督面板(复用 src/supervisor-web.ts:只监听 127.0.0.1、只读、单一数据源)。 */
544
+ export async function startPanel(opts = {}) {
545
+ const web = await loadPiModule("supervisor-web", opts.pkgRoot);
546
+ const handle = await web.startSupervisorWeb({
547
+ agentDir: opts.agentDir,
548
+ port: opts.port ?? 0,
549
+ ...(opts.agentId ? { agentId: opts.agentId } : {}),
550
+ });
551
+ return { url: handle.url, port: handle.port, close: () => handle.close() };
552
+ }
553
+
554
+ // ------------------------------------------------------------------ D6 引导与可发现性
555
+
556
+ /**
557
+ * 三问话术(**D2 判据**:App 启动后能一句话回答「它是谁 / 在干什么 / 怎么让它做事」)。
558
+ * 约束:零必读概念(不出现 agent-dir / 预算 / 宿主 / 端口 …),人话,一句一答。
559
+ * 文本**逐字写在产物里** → 第三方可直接读到(不依赖运行时的隐藏上下文)。
560
+ */
561
+ export function describeApp() {
562
+ return {
563
+ who: "我是 pi 助理:一个住在你这台机器上的帮手。你不用一直守着它——有事它会主动来找你。",
564
+ what: "它在做三件事:记住你交给它的任务、盯着该发生的变化、到点或者达成时告诉你。",
565
+ how: "直接对它说人话就行,比如「盯着 CI 变绿」「有人找我时告诉我」「别烦我」。要它真的替你做事,这个环境里得有模型凭据;没有的话它会明确告诉你。",
566
+ };
567
+ }
568
+
569
+ /**
570
+ * 首启引导(≤3 步 · 一次只问一件事 · 每步都能「算了」· 零必读概念)。
571
+ * 「算了」= 收工退出,且不留任何残留。
572
+ */
573
+ export function guideSteps() {
574
+ return [
575
+ { id: "stay", question: "要我以后常驻吗?", options: ["要", "算了"], cancel: "算了" },
576
+ { id: "watch", question: "要我盯着什么吗?说一句话就行。", options: ["说一句话", "算了"], cancel: "算了" },
577
+ { id: "ping", question: "有事我这样找你行吗?(系统通知)", options: ["行", "算了"], cancel: "算了" },
578
+ ];
579
+ }
580
+
581
+ // ------------------------------------------------------------------ 回执
582
+
583
+ function baseReceipt(instance) {
584
+ return {
585
+ status: "not-running",
586
+ agentRootKind: instance.agentRootKind,
587
+ agentRoot: instance.agentRoot,
588
+ agentId: instance.agentId,
589
+ socketPath: instance.socketPath,
590
+ socketPathBytes: instance.socketPathBytes,
591
+ socketOverBudget: instance.socketOverBudget,
592
+ lockPath: instance.lockPath,
593
+ logPath: instance.logPath,
594
+ pkgRoot: instance.pkgRoot,
595
+ };
596
+ }
597
+
598
+ // ------------------------------------------------------------------ 运行中的会话(进程内)
599
+
600
+ /** 本进程内已启动的会话(按锁路径索引)→ `ask` 等命令可以复用同一份 JSONL 连接。 */
601
+ const sessions = new Map();
602
+
603
+ /** 通知去重集合(按事件 id)→ 同一事件不弹两次。 */
604
+ const notifiedIds = new Set();
605
+
606
+ // ------------------------------------------------------------------ 启动 / 停止 / 状态
607
+
608
+ /**
609
+ * 启动 App:拉起 pi → **等就绪信号**(不是 sleep)→ 拉起只读面板 → 注册通知通道 → 回执。
610
+ *
611
+ * 就绪判定(两道,都要真证据):
612
+ * ① AC1:RPC `get_commands` 的**进程内**扩展清单里有来自本包的扩展入口;
613
+ * ② AC2:`<agentRoot>/proactive/run/*.sock` 真实出现。
614
+ * 任一不满足 → **明确失败**(报【未就绪】+ 诊断),不静默降级、不假装在跑。
615
+ */
616
+ export async function startApp(opts = {}) {
617
+ const instance = resolveInstance(opts);
618
+ const base = baseReceipt(instance);
619
+ const timeoutMs = opts.timeoutMs || 30_000;
620
+
621
+ // --- 平台:macOS / Linux 优先(unix socket + osascript/notify-send);Windows 分支**未实现**
622
+ // → 明确报错,不写「应该能行」。
623
+ const platform = platformSupport();
624
+ if (!platform.supported) {
625
+ return { ...base, status: "error", error: platform.reason };
626
+ }
627
+ // --- 单实例锁:已有活实例 → 幂等回执「已在运行」(不产生第二份实例/第二份通知注册)
628
+ const existing = readLock(instance.lockPath);
629
+ if (existing) {
630
+ if (isAlive(existing.pid)) {
631
+ const running = instanceFromLock(existing, instance);
632
+ return {
633
+ ...baseReceipt(running),
634
+ status: "already-running",
635
+ pid: existing.pid,
636
+ piPid: existing.piPid,
637
+ piBin: existing.piBin,
638
+ piBinSource: existing.piBinSource,
639
+ launchArgs: existing.launchArgs,
640
+ panelUrl: existing.panelUrl,
641
+ evidence: existing.evidence,
642
+ residue: residueReport(running, existing),
643
+ };
644
+ }
645
+ // 陈旧锁(进程已死)→ 清掉它和它的残留,再来一次
646
+ cleanupArtifacts(instanceFromLock(existing, instance), existing);
647
+ removeLock(instance.lockPath);
648
+ }
649
+
650
+ // --- 定位 pi(找不到 → 明确报错 + 安装指引)
651
+ let pi;
652
+ try {
653
+ pi = resolvePiBin({ piBin: opts.piBin, env: opts.env });
654
+ } catch (err) {
655
+ return { ...base, status: "error", error: errText(err) };
656
+ }
657
+
658
+ // --- 占锁(独占):抢不到 = 别的实例刚起来 → 幂等回执
659
+ try {
660
+ createLock(instance.lockPath, {
661
+ pid: process.pid,
662
+ piPid: 0,
663
+ agentRootKind: instance.agentRootKind,
664
+ agentRoot: instance.agentRoot,
665
+ ownsAgentRoot: instance.ownsAgentRoot,
666
+ agentId: instance.agentId,
667
+ logPath: instance.logPath,
668
+ pkgRoot: instance.pkgRoot,
669
+ piBin: pi.bin,
670
+ piBinSource: pi.source,
671
+ launchArgs: buildLaunchArgs({ pkgRoot: instance.pkgRoot }),
672
+ startedAt: Date.now(),
673
+ });
674
+ } catch (err) {
675
+ if (err && err.code === "EEXIST") {
676
+ const lock = readLock(instance.lockPath);
677
+ if (lock && isAlive(lock.pid)) {
678
+ const running = instanceFromLock(lock, instance);
679
+ return {
680
+ ...baseReceipt(running),
681
+ status: "already-running",
682
+ pid: lock.pid,
683
+ piPid: lock.piPid,
684
+ panelUrl: lock.panelUrl,
685
+ evidence: lock.evidence,
686
+ residue: residueReport(running, lock),
687
+ };
688
+ }
689
+ return { ...base, status: "error", error: `锁文件存在但无法判定归属:${instance.lockPath}` };
690
+ }
691
+ return { ...base, status: "error", error: `写锁失败:${errText(err)}` };
692
+ }
693
+
694
+ // --- 拉起 pi
695
+ let child = null;
696
+ let stderrTail = "";
697
+ try {
698
+ fs.mkdirSync(instance.agentRoot, { recursive: true, mode: 0o700 });
699
+ const logFd = fs.openSync(instance.logPath, "a", 0o600);
700
+ try {
701
+ child = spawn(pi.bin, buildLaunchArgs({ pkgRoot: instance.pkgRoot }), {
702
+ env: buildChildEnv({ instance, env: opts.env }),
703
+ stdio: ["pipe", "pipe", "pipe"],
704
+ });
705
+ } finally {
706
+ fs.closeSync(logFd);
707
+ }
708
+ } catch (err) {
709
+ removeLock(instance.lockPath);
710
+ return { ...base, status: "error", error: `启动 pi 失败:${errText(err)}` };
711
+ }
712
+ child.stderr.on("data", (c) => {
713
+ stderrTail = (stderrTail + String(c)).slice(-2000);
714
+ try {
715
+ fs.appendFileSync(instance.logPath, String(c));
716
+ } catch {
717
+ /* ignore */
718
+ }
719
+ });
720
+
721
+ const session = createRpcSession(child);
722
+ const exited = new Promise((resolve) => child.on("exit", (code) => resolve(code)));
723
+ let exitInfo = null;
724
+ void exited.then((code) => {
725
+ exitInfo = { code };
726
+ });
727
+
728
+ const lockPayload = {
729
+ ...(readLock(instance.lockPath) || {}),
730
+ piPid: child.pid,
731
+ piBin: pi.bin,
732
+ piBinSource: pi.source,
733
+ launchArgs: buildLaunchArgs({ pkgRoot: instance.pkgRoot }),
734
+ };
735
+ try {
736
+ updateLock(instance.lockPath, lockPayload);
737
+ } catch {
738
+ /* ignore */
739
+ }
740
+
741
+ // --- 就绪判定(状态等待,超时 ⇒ 报【未就绪】+ 诊断)
742
+ const ready = await waitReady(session, instance, timeoutMs, () => exitInfo, () => stderrTail);
743
+ if (!ready.ok) {
744
+ killChild(child);
745
+ cleanupArtifacts(instance, { agentId: instance.agentId });
746
+ removeLock(instance.lockPath);
747
+ return { ...base, status: "error", error: `未就绪:${ready.reason}`, evidence: ready.evidence };
748
+ }
749
+
750
+ // --- 通知通道(可插拔;不可用 ⇒ 明确降级提示,面板仍在)
751
+ let notifier = null;
752
+ let notifyDegraded = "";
753
+ try {
754
+ notifier = await createNotifier({
755
+ pkgRoot: instance.pkgRoot,
756
+ ...(opts.notifyExec ? { exec: opts.notifyExec } : {}),
757
+ ...(opts.notifyAvailable ? { available: opts.notifyAvailable } : {}),
758
+ });
759
+ if (!notifier.available) {
760
+ notifyDegraded = `系统通知不可用(通道 ${notifier.channel} 在这台机器上不可用)→ 面板仍在,通知改在会话里给你`;
761
+ }
762
+ } catch (err) {
763
+ notifyDegraded = `系统通知通道初始化失败:${errText(err)} → 面板仍在`;
764
+ }
765
+
766
+ // --- 通知记录(证据)+ 去重
767
+ const notificationRecordPath = path.join(instance.agentRoot, APP_SUBDIR, "notifications.jsonl");
768
+ const notificationState = { count: 0, last: null };
769
+ const unsubscribe = session.onRecord((rec) => {
770
+ if (!rec || rec.type !== "extension_ui_request" || rec.method !== "notify") return;
771
+ const eventId = String(rec.id || rec.message || "");
772
+ if (eventId && notifiedIds.has(eventId)) return; // 同一事件不弹两次
773
+ if (eventId) notifiedIds.add(eventId);
774
+ const message = String(rec.message ?? "");
775
+ const done = notifier
776
+ ? notifier.send(message, { title: rec.notifyType === "error" ? "助理出错了" : "助理找你有事" })
777
+ : Promise.resolve({ ok: false, detail: "无通知通道" });
778
+ void done.then((res) => {
779
+ notificationState.count += 1;
780
+ notificationState.last = { eventId, message, ok: Boolean(res.ok), detail: res.detail };
781
+ try {
782
+ fs.mkdirSync(path.dirname(notificationRecordPath), { recursive: true });
783
+ fs.appendFileSync(
784
+ notificationRecordPath,
785
+ `${JSON.stringify({ ts: Date.now(), eventId, message, ok: Boolean(res.ok), detail: res.detail })}\n`,
786
+ );
787
+ } catch {
788
+ /* 记录失败不得影响主流程 */
789
+ }
790
+ if (opts.onNotify) opts.onNotify(notificationState.last);
791
+ });
792
+ });
793
+
794
+ // --- 只读监督面板(可失败降级,不阻塞主流程)
795
+ let panel = null;
796
+ let panelDegraded = "";
797
+ try {
798
+ panel = await startPanel({
799
+ pkgRoot: instance.pkgRoot,
800
+ agentDir: instance.agentRoot,
801
+ port: opts.panelPort ?? 0,
802
+ agentId: instance.agentId,
803
+ });
804
+ } catch (err) {
805
+ panelDegraded = `监督面板起不来:${errText(err)} → 其余功能不受影响`;
806
+ }
807
+
808
+ // --- 凭据如实判定(不静默)
809
+ const credential = detectCredential(instance.agentRoot, opts.env || process.env);
810
+
811
+ // --- 写锁(供退出清理与幂等判定)
812
+ try {
813
+ updateLock(instance.lockPath, {
814
+ ...lockPayload,
815
+ evidence: ready.evidence,
816
+ panelUrl: panel ? panel.url : undefined,
817
+ notifications: notificationState.count,
818
+ });
819
+ } catch {
820
+ /* ignore */
821
+ }
822
+
823
+ sessions.set(instance.lockPath, { child, session, panel, unsubscribe, instance });
824
+
825
+ return {
826
+ ...base,
827
+ status: "started",
828
+ pid: process.pid,
829
+ piPid: child.pid,
830
+ piBin: pi.bin,
831
+ piBinSource: pi.source,
832
+ launchArgs: lockPayload.launchArgs,
833
+ panelUrl: panel ? panel.url : undefined,
834
+ panelPort: panel ? panel.port : undefined,
835
+ notify: {
836
+ channel: notifier ? notifier.channel : "none",
837
+ available: Boolean(notifier && notifier.available),
838
+ ...(notifyDegraded ? { degraded: notifyDegraded } : {}),
839
+ },
840
+ ...(panelDegraded ? { panelDegraded } : {}),
841
+ credential,
842
+ evidence: ready.evidence,
843
+ supervisor: await collectSupervisorSnapshot(instance),
844
+ notificationRecordPath,
845
+ notifications: notificationState,
846
+ guidance: { steps: guideSteps(), nextStep: guideSteps()[0] },
847
+ residue: residueReport(instance, { pid: process.pid, piPid: child.pid }),
848
+ session: { child, session, panel, unsubscribe, instance },
849
+ };
850
+ }
851
+
852
+ /** 等就绪信号(AC1 扩展注册 + AC2 端点出现)。返回 {ok, reason, evidence}。 */
853
+ async function waitReady(session, instance, timeoutMs, exitInfo, stderrTail) {
854
+ const evidence = {
855
+ extensionListSource: "rpc:get_commands",
856
+ endpointExists: false,
857
+ registryFile: path.join(instance.agentRoot, "proactive", "agents", `${sanitizeName(instance.agentId)}.json`),
858
+ };
859
+ const diagnose = (reason) => {
860
+ const pkgExt = path.join(instance.pkgRoot, "build", "extensions", "proactive.js");
861
+ const built = fs.existsSync(pkgExt);
862
+ return (
863
+ `${reason}\n` +
864
+ `诊断:包路径=${instance.pkgRoot}|扩展入口${built ? "存在" : "**不存在**(请先构建:bash pi-proactive/tools/build-release.sh)"}|` +
865
+ `端点目录=${path.join(instance.agentRoot, RUN_SUBDIR)}|端点预算=${instance.socketPathBytes}B/${MAX_SOCKET_PATH_BYTES}B` +
866
+ (instance.socketOverBudget ? "(**超预算** → 端点建不出来)" : "") +
867
+ `\n子进程退出=${exitInfo() ? JSON.stringify(exitInfo()) : "仍在运行"}|stderr 末尾=${(stderrTail() || "").slice(-400) || "(空)"}`
868
+ );
869
+ };
870
+
871
+ // ① 进程内扩展清单必须含 pi-proactive(AC1 的**取证**)
872
+ let commands = [];
873
+ try {
874
+ const res = await session.request({ type: "get_commands" }, Math.min(timeoutMs, 15_000));
875
+ commands = (res && res.data && res.data.commands) || [];
876
+ } catch (err) {
877
+ return {
878
+ ok: false,
879
+ reason: diagnose(`读不到 pi 进程内的扩展清单(${errText(err)})`),
880
+ evidence,
881
+ };
882
+ }
883
+ const hit = commands.find(
884
+ (c) =>
885
+ c &&
886
+ c.source === "extension" &&
887
+ typeof (c.sourceInfo && c.sourceInfo.path) === "string" &&
888
+ c.sourceInfo.path.startsWith(instance.pkgRoot),
889
+ );
890
+ evidence.extensionPath = hit ? hit.sourceInfo.path : undefined;
891
+ evidence.extensionCommand = hit ? hit.name : undefined;
892
+ evidence.extensionCount = commands.length;
893
+ if (!hit) {
894
+ return {
895
+ ok: false,
896
+ reason: diagnose(
897
+ `注入未生效:pi 进程内的扩展清单里没有来自 ${instance.pkgRoot} 的扩展(source=extension)`,
898
+ ),
899
+ evidence,
900
+ };
901
+ }
902
+
903
+ // ② 端点必须**真的出现**(AC2)
904
+ const endpoint = await waitForEndpoint(instance, timeoutMs);
905
+ evidence.endpointExists = endpoint !== null;
906
+ evidence.endpointPath = endpoint ? endpoint.path : undefined;
907
+ evidence.endpointBytes = endpoint ? endpoint.bytes : undefined;
908
+ if (!endpoint) {
909
+ return {
910
+ ok: false,
911
+ reason: diagnose(
912
+ `端点未出现(**未触发**,不是「不残留」):${path.join(instance.agentRoot, RUN_SUBDIR)} 下没有 *.sock`,
913
+ ),
914
+ evidence,
915
+ };
916
+ }
917
+ return { ok: true, evidence };
918
+ }
919
+
920
+ /** 等端点出现(返回端点信息;超时 = null = 未触发)。 */
921
+ async function waitForEndpoint(instance, timeoutMs) {
922
+ const deadline = Date.now() + timeoutMs;
923
+ for (;;) {
924
+ const ep = findEndpoint(instance.agentRoot);
925
+ if (ep) return ep;
926
+ if (Date.now() >= deadline) return null;
927
+ await new Promise((r) => setTimeout(r, 100));
928
+ }
929
+ }
930
+
931
+ /** 只读监督快照(命令面口径 —— 与面板同一份聚合,数字必然逐字一致)。 */
932
+ async function collectSupervisorSnapshot(instance) {
933
+ try {
934
+ const state = await loadPiModule("supervisor-state", instance.pkgRoot);
935
+ return state.collectSupervisorState({ agentDir: instance.agentRoot, agentId: instance.agentId });
936
+ } catch {
937
+ return undefined;
938
+ }
939
+ }
940
+
941
+ /** 终止 pi 子进程(先 TERM 后 KILL)。 */
942
+ function killChild(child) {
943
+ if (!child || child.exitCode !== null) return;
944
+ try {
945
+ child.kill("SIGTERM");
946
+ } catch {
947
+ /* ignore */
948
+ }
949
+ const timer = setTimeout(() => {
950
+ try {
951
+ child.kill("SIGKILL");
952
+ } catch {
953
+ /* ignore */
954
+ }
955
+ }, 3_000);
956
+ timer.unref?.();
957
+ }
958
+
959
+ /** 等一个 pid 消失(最多 ms)。 */
960
+ async function waitGone(pid, ms) {
961
+ const deadline = Date.now() + ms;
962
+ while (Date.now() < deadline) {
963
+ if (!isAlive(pid)) return true;
964
+ await new Promise((r) => setTimeout(r, 100));
965
+ }
966
+ return !isAlive(pid);
967
+ }
968
+
969
+ /**
970
+ * 停止 App:停 App 进程(它会带走 pi)→ 兜底杀 pi → 清残留 → 回执残留终检。
971
+ * 没在跑 → 幂等回执「未在运行」。
972
+ */
973
+ export async function stopApp(opts = {}) {
974
+ const instance = resolveInstance(opts);
975
+ const lock = readLock(instance.lockPath);
976
+ if (!lock) {
977
+ return { ...baseReceipt(instance), status: "not-running", residue: residueReport(instance, null) };
978
+ }
979
+ // 清理目标 = 锁里记的那个实例(不是本进程 pid 派生的路径 —— 否则清的是自己,不是它)。
980
+ const target = instanceFromLock(lock, instance);
981
+ const live = sessions.get(instance.lockPath);
982
+ if (live) {
983
+ if (live.unsubscribe) live.unsubscribe();
984
+ if (live.panel) await live.panel.close().catch(() => {});
985
+ killChild(live.child);
986
+ sessions.delete(instance.lockPath);
987
+ }
988
+ // App 进程(不是自己就杀)
989
+ if (lock.pid && lock.pid !== process.pid && isAlive(lock.pid)) {
990
+ try {
991
+ process.kill(lock.pid, "SIGTERM");
992
+ } catch {
993
+ /* ignore */
994
+ }
995
+ if (!(await waitGone(lock.pid, 5_000))) {
996
+ try {
997
+ process.kill(lock.pid, "SIGKILL");
998
+ } catch {
999
+ /* ignore */
1000
+ }
1001
+ await waitGone(lock.pid, 2_000);
1002
+ }
1003
+ }
1004
+ // pi 子进程
1005
+ if (lock.piPid && isAlive(lock.piPid)) {
1006
+ try {
1007
+ process.kill(lock.piPid, "SIGTERM");
1008
+ } catch {
1009
+ /* ignore */
1010
+ }
1011
+ if (!(await waitGone(lock.piPid, 5_000))) {
1012
+ try {
1013
+ process.kill(lock.piPid, "SIGKILL");
1014
+ } catch {
1015
+ /* ignore */
1016
+ }
1017
+ await waitGone(lock.piPid, 2_000);
1018
+ }
1019
+ }
1020
+ cleanupArtifacts(target, lock);
1021
+ removeLock(instance.lockPath);
1022
+ return {
1023
+ ...baseReceipt(target),
1024
+ status: "stopped",
1025
+ pid: lock.pid,
1026
+ piPid: lock.piPid,
1027
+ residue: residueReport(target, lock),
1028
+ };
1029
+ }
1030
+
1031
+ /** 状态查询:如实反映在跑 / 没在跑(附与面板同源的只读快照)。 */
1032
+ export async function statusApp(opts = {}) {
1033
+ const instance = resolveInstance(opts);
1034
+ const lock = readLock(instance.lockPath);
1035
+ if (!lock) {
1036
+ return {
1037
+ ...baseReceipt(instance),
1038
+ status: "not-running",
1039
+ residue: residueReport(instance, null),
1040
+ supervisor: await collectSupervisorSnapshot(instance),
1041
+ };
1042
+ }
1043
+ const target = instanceFromLock(lock, instance);
1044
+ const running = isAlive(lock.pid);
1045
+ return {
1046
+ ...baseReceipt(target),
1047
+ status: running ? "running" : "not-running",
1048
+ pid: lock.pid,
1049
+ piPid: lock.piPid,
1050
+ piBin: lock.piBin,
1051
+ piBinSource: lock.piBinSource,
1052
+ launchArgs: lock.launchArgs,
1053
+ panelUrl: lock.panelUrl,
1054
+ evidence: lock.evidence,
1055
+ residue: residueReport(target, lock),
1056
+ supervisor: await collectSupervisorSnapshot(target),
1057
+ };
1058
+ }
1059
+
1060
+ /**
1061
+ * 下发一条 prompt 并等 **id 关联**的响应(AC3 / D3 驱动)。
1062
+ * 进程内已有实例 → 复用同一份 JSONL 连接;否则起一个一次性实例(起 → 问 → 停)。
1063
+ */
1064
+ export async function askApp(opts = {}) {
1065
+ const instance = resolveInstance(opts);
1066
+ const live = sessions.get(instance.lockPath);
1067
+ if (live) {
1068
+ const request = { type: "prompt", message: String(opts.message ?? "") };
1069
+ try {
1070
+ const response = await live.session.request(request, opts.timeoutMs || 30_000);
1071
+ return { ok: true, request: { ...request, id: response.id }, response, reused: true };
1072
+ } catch (err) {
1073
+ return { ok: false, error: errText(err), request };
1074
+ }
1075
+ }
1076
+ const started = await startApp(opts);
1077
+ if (started.status !== "started") {
1078
+ return { ok: false, error: String(started.error ?? `启动失败(${started.status})`) };
1079
+ }
1080
+ const liveSession = started.session;
1081
+ const request = { type: "prompt", message: String(opts.message ?? "") };
1082
+ try {
1083
+ const response = await liveSession.session.request(request, opts.timeoutMs || 30_000);
1084
+ await stopApp(opts);
1085
+ return { ok: true, request: { ...request, id: response.id }, response, reused: false };
1086
+ } catch (err) {
1087
+ await stopApp(opts);
1088
+ return { ok: false, error: errText(err), request };
1089
+ }
1090
+ }
1091
+
1092
+ // ------------------------------------------------------------------ CLI
1093
+
1094
+ const USAGE = `pi-proactive App —— pi-agent 的 shim / wrapper(最小可用外壳)
1095
+
1096
+ 用法:
1097
+ app.mjs start [--shared] [--agent-dir DIR] [--pi-bin PATH] [--pkg-root DIR] [--tmp-dir DIR] [--json]
1098
+ app.mjs stop [--json]
1099
+ app.mjs status [--json]
1100
+ app.mjs describe [--json] 三问:它是谁 / 在干什么 / 怎么让它做事
1101
+ app.mjs guide [--json] 首启引导(≤3 步)
1102
+ app.mjs ask "<要它做的事>" [--json]
1103
+
1104
+ 说明:
1105
+ start 拉起 pi(--mode rpc --no-session -e <pi-proactive 包>)并常驻;等**扩展真的注册**才算就绪;
1106
+ 二次启动回执「已在运行」(不产生第二份实例)。
1107
+ stop 停止并做残留终检(进程 / socket / 临时根 / 锁 / 日志 / launchd)。
1108
+ status 如实汇报当前状态(含只读监督快照)。
1109
+ describe 三问话术(零必读概念)。
1110
+ guide 首启引导的步骤。
1111
+ ask 经 JSONL 下发一条 prompt 并回带 id 关联的响应。
1112
+
1113
+ 选项:
1114
+ --shared 用宿主 pi 的 agent 根(默认:专属短路径 /tmp/pp-app-<pid>)
1115
+ --agent-dir DIR 显式指定 agent 根(不会被 App 删除)
1116
+ --pi-bin PATH 指定 pi 可执行文件(默认:PI_BIN > PATH)
1117
+ --pkg-root DIR 指定 pi-proactive 包路径(默认:本包自身)
1118
+ --tmp-dir DIR 临时根的基目录(默认 /tmp)
1119
+ --json 机器可读回执(每行一个 JSON)`;
1120
+
1121
+ /** 控制词:「算了」= 收工退出(零残留);「退出」= 直接退出。 */
1122
+ const CANCEL_WORDS = ["算了", "cancel"];
1123
+ const QUIT_WORDS = ["退出", "quit", "exit"];
1124
+
1125
+ function parseArgs(argv) {
1126
+ const flags = { json: false };
1127
+ const rest = [];
1128
+ for (let i = 0; i < argv.length; i++) {
1129
+ const a = argv[i];
1130
+ if (a === "--json") flags.json = true;
1131
+ else if (a === "--shared") flags.shared = true;
1132
+ else if (a === "--agent-dir") flags.agentDir = argv[++i];
1133
+ else if (a === "--pi-bin") flags.piBin = argv[++i];
1134
+ else if (a === "--pkg-root") flags.pkgRoot = argv[++i];
1135
+ else if (a === "--tmp-dir") flags.tmpDir = argv[++i];
1136
+ else if (a === "--help" || a === "-h") flags.help = true;
1137
+ else if (a.startsWith("--")) throw new Error(`未知参数:${a}`);
1138
+ else rest.push(a);
1139
+ }
1140
+ return { flags, rest };
1141
+ }
1142
+
1143
+ function printReceipt(receipt, json) {
1144
+ if (json) {
1145
+ const { session, ...rest } = receipt;
1146
+ process.stdout.write(`${JSON.stringify(rest)}\n`);
1147
+ return;
1148
+ }
1149
+ const lines = [
1150
+ `状态:${receipt.status}`,
1151
+ `agent 根:${receipt.agentRoot}(${receipt.agentRootKind})`,
1152
+ `端点:${receipt.socketPath}(${receipt.socketPathBytes}B / 上限 ${MAX_SOCKET_PATH_BYTES}B${receipt.socketOverBudget ? " · 超长!" : ""})`,
1153
+ ];
1154
+ if (receipt.piPid) lines.push(`pi 进程:${receipt.piPid}(${receipt.piBin || "?"})`);
1155
+ if (receipt.panelUrl) lines.push(`监督面板(只读):${receipt.panelUrl}`);
1156
+ if (receipt.notify) {
1157
+ lines.push(
1158
+ `系统通知:${receipt.notify.available ? `可用(${receipt.notify.channel})` : `**不可用** · ${receipt.notify.degraded || "已降级"}`}`,
1159
+ );
1160
+ }
1161
+ if (receipt.credential) lines.push(`凭据:${receipt.credential.detail}`);
1162
+ if (receipt.evidence) {
1163
+ lines.push(`注入证据:${receipt.evidence.extensionListSource} → ${receipt.evidence.extensionPath || "(无)"}`);
1164
+ lines.push(`端点已出现:${receipt.evidence.endpointExists ? "是" : "否"}`);
1165
+ }
1166
+ if (receipt.residue) {
1167
+ const r = receipt.residue;
1168
+ lines.push(
1169
+ `残留终检:进程 ${r.appProcessAlive || r.piProcessAlive ? "有" : "无"} · 端点 ${r.endpointExists ? "有" : "无"} · ` +
1170
+ `agent 根 ${r.agentRootExists ? "有" : "无"} · 锁 ${r.lockExists ? "有" : "无"} · launchd ${r.launchdUnits.length}`,
1171
+ );
1172
+ }
1173
+ if (receipt.error) lines.push(`错误:${receipt.error}`);
1174
+ process.stdout.write(`${lines.join("\n")}\n`);
1175
+ }
1176
+
1177
+ /** 引导问句(一行一步,零必读概念)。 */
1178
+ function printGuidance(step) {
1179
+ process.stdout.write(`下一步:${step.question}(${step.options.join(" / ")})\n`);
1180
+ }
1181
+
1182
+ async function main(argv) {
1183
+ const cmd = argv[0];
1184
+ let parsed;
1185
+ try {
1186
+ parsed = parseArgs(argv.slice(1));
1187
+ } catch (err) {
1188
+ process.stderr.write(`${errText(err)}\n${USAGE}\n`);
1189
+ return 2;
1190
+ }
1191
+ const { flags, rest } = parsed;
1192
+ if (!cmd || flags.help || cmd === "help") {
1193
+ process.stdout.write(`${USAGE}\n`);
1194
+ return cmd ? 0 : 2;
1195
+ }
1196
+ const opts = {
1197
+ agentRootKind: flags.shared ? "shared" : "dedicated",
1198
+ agentDir: flags.agentDir,
1199
+ piBin: flags.piBin,
1200
+ pkgRoot: flags.pkgRoot,
1201
+ tmpDir: flags.tmpDir,
1202
+ };
1203
+
1204
+ if (cmd === "describe") {
1205
+ const d = describeApp();
1206
+ if (flags.json) {
1207
+ process.stdout.write(`${JSON.stringify(d)}\n`);
1208
+ return 0;
1209
+ }
1210
+ process.stdout.write(`它是谁:${d.who}\n在干什么:${d.what}\n怎么让它做事:${d.how}\n`);
1211
+ return 0;
1212
+ }
1213
+ if (cmd === "guide") {
1214
+ const steps = guideSteps();
1215
+ if (flags.json) {
1216
+ process.stdout.write(`${JSON.stringify({ steps })}\n`);
1217
+ return 0;
1218
+ }
1219
+ process.stdout.write(`${steps.map((s, i) => `${i + 1}. ${s.question}(${s.options.join(" / ")})`).join("\n")}\n`);
1220
+ return 0;
1221
+ }
1222
+ if (cmd === "status") {
1223
+ const receipt = await statusApp(opts);
1224
+ printReceipt(receipt, flags.json);
1225
+ return 0;
1226
+ }
1227
+ if (cmd === "stop") {
1228
+ const receipt = await stopApp(opts);
1229
+ printReceipt(receipt, flags.json);
1230
+ return 0;
1231
+ }
1232
+ if (cmd === "ask") {
1233
+ const message = rest.join(" ").trim();
1234
+ if (!message) {
1235
+ process.stderr.write(`ask 需要一句话:app.mjs ask "<要它做的事>"\n`);
1236
+ return 2;
1237
+ }
1238
+ const result = await askApp({ ...opts, message });
1239
+ if (flags.json) {
1240
+ process.stdout.write(`${JSON.stringify(result)}\n`);
1241
+ } else if (result.ok) {
1242
+ process.stdout.write(`${JSON.stringify(result.response)}\n`);
1243
+ } else {
1244
+ process.stderr.write(`ask 失败:${String(result.error)}\n`);
1245
+ }
1246
+ return result.ok ? 0 : 1;
1247
+ }
1248
+ if (cmd !== "start") {
1249
+ process.stderr.write(`未知子命令:${cmd}\n${USAGE}\n`);
1250
+ return 2;
1251
+ }
1252
+
1253
+ // --- start:拉起并常驻(App 就是 pi 的守护者:它持有 pi 的 stdin/stdout)
1254
+ const receipt = await startApp(opts);
1255
+ printReceipt(receipt, flags.json);
1256
+ if (receipt.status === "error") return 2;
1257
+ if (receipt.status !== "started") {
1258
+ // already-running → 幂等回执(不常驻第二份实例)
1259
+ process.stdout.write("已在运行(没有起第二份)\n");
1260
+ return 0;
1261
+ }
1262
+ const live = receipt.session;
1263
+ const steps = guideSteps();
1264
+ let stepIndex = 0;
1265
+ printGuidance(steps[0]);
1266
+
1267
+ let stopping = false;
1268
+ const shutdown = async (reason) => {
1269
+ if (stopping) return;
1270
+ stopping = true;
1271
+ if (live) {
1272
+ if (live.unsubscribe) live.unsubscribe();
1273
+ if (live.panel) await live.panel.close().catch(() => {});
1274
+ try {
1275
+ live.child.stdin.end();
1276
+ } catch {
1277
+ /* ignore */
1278
+ }
1279
+ const deadline = Date.now() + 3_000;
1280
+ while (live.child.exitCode === null && Date.now() < deadline) {
1281
+ await new Promise((r) => setTimeout(r, 50));
1282
+ }
1283
+ killChild(live.child);
1284
+ }
1285
+ const instance = resolveInstance(opts);
1286
+ cleanupArtifacts(instance, { agentId: instance.agentId });
1287
+ removeLock(instance.lockPath);
1288
+ sessions.delete(instance.lockPath);
1289
+ process.stdout.write(`${reason}\n`);
1290
+ process.exit(0);
1291
+ };
1292
+
1293
+ process.on("SIGINT", () => void shutdown("收到中断,收工(不留残留)"));
1294
+ process.on("SIGTERM", () => void shutdown("收到结束信号,收工(不留残留)"));
1295
+ if (live) {
1296
+ live.child.on("exit", () => {
1297
+ if (!stopping) void shutdown("助理进程退出了,收工(不留残留)");
1298
+ });
1299
+ }
1300
+
1301
+ // 会话驱动:stdin 的一行 = 一条 prompt(按 id 关联响应)
1302
+ const promptOf = async (text) => {
1303
+ try {
1304
+ const res = await live.session.request({ type: "prompt", message: text }, 120_000);
1305
+ process.stdout.write(`${JSON.stringify(res)}\n`);
1306
+ } catch (err) {
1307
+ process.stdout.write(`下发失败:${errText(err)}\n`);
1308
+ }
1309
+ };
1310
+
1311
+ if (process.stdin.isTTY) {
1312
+ // 交互式:一问一答推进引导;任何一步都能「算了」→ 零残留
1313
+ process.stdin.setEncoding("utf8");
1314
+ let buffer = "";
1315
+ process.stdin.on("data", (chunk) => {
1316
+ buffer += String(chunk);
1317
+ let i;
1318
+ while ((i = buffer.indexOf("\n")) >= 0) {
1319
+ const line = buffer.slice(0, i).trim();
1320
+ buffer = buffer.slice(i + 1);
1321
+ if (!line) continue;
1322
+ if (CANCEL_WORDS.includes(line)) {
1323
+ void shutdown("好,收工(不留残留)");
1324
+ return;
1325
+ }
1326
+ if (QUIT_WORDS.includes(line)) {
1327
+ void shutdown("退出(不留残留)");
1328
+ return;
1329
+ }
1330
+ if (stepIndex < steps.length && (line === steps[stepIndex].options[0] || line === "要" || line === "是")) {
1331
+ stepIndex += 1;
1332
+ if (stepIndex < steps.length) {
1333
+ printGuidance(steps[stepIndex]);
1334
+ } else {
1335
+ process.stdout.write("好,都记下了。接下来直接跟我说要做什么就行。\n");
1336
+ }
1337
+ continue;
1338
+ }
1339
+ // 其余一律当作「要它做的事」
1340
+ stepIndex = steps.length;
1341
+ void promptOf(line);
1342
+ }
1343
+ });
1344
+ } else {
1345
+ process.stdin.setEncoding("utf8");
1346
+ let buffer = "";
1347
+ process.stdin.on("data", (chunk) => {
1348
+ buffer += String(chunk);
1349
+ let i;
1350
+ while ((i = buffer.indexOf("\n")) >= 0) {
1351
+ const line = buffer.slice(0, i).trim();
1352
+ buffer = buffer.slice(i + 1);
1353
+ if (!line) continue;
1354
+ if (CANCEL_WORDS.includes(line) || QUIT_WORDS.includes(line)) {
1355
+ void shutdown("好,收工(不留残留)");
1356
+ return;
1357
+ }
1358
+ void promptOf(line);
1359
+ }
1360
+ });
1361
+ }
1362
+
1363
+ // 常驻:等信号
1364
+ await new Promise(() => {});
1365
+ return 0;
1366
+ }
1367
+
1368
+ const isMain = process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url;
1369
+ if (isMain) {
1370
+ main(process.argv.slice(2))
1371
+ .then((code) => {
1372
+ process.exitCode = code;
1373
+ })
1374
+ .catch((err) => {
1375
+ process.stderr.write(`[pi-proactive app] 未预期错误:${errText(err)}\n`);
1376
+ process.exitCode = 1;
1377
+ });
1378
+ }