@hop-top/kit 0.5.0-alpha.1 → 0.5.0-alpha.11

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 (293) hide show
  1. package/CHANGELOG.md +275 -0
  2. package/LICENSE +1 -1
  3. package/LICENSE-cobra.txt +174 -0
  4. package/NOTICE +15 -0
  5. package/README.md +55 -259
  6. package/dist/aim-DZHwwiIc.d.ts +139 -0
  7. package/dist/aim.d.ts +1 -116
  8. package/dist/aim.js +13 -414
  9. package/dist/alias-D9_qFlyP.d.ts +174 -0
  10. package/dist/alias.d.ts +2 -73
  11. package/dist/alias.js +27 -207
  12. package/dist/api-DAexsu2H.d.ts +77 -0
  13. package/dist/api.d.ts +1 -62
  14. package/dist/api.js +10 -164
  15. package/dist/auth-2-jfgiHn.d.ts +34 -0
  16. package/dist/auth.d.ts +1 -26
  17. package/dist/auth.js +6 -40
  18. package/dist/chunk-3FIKGFKI.js +54 -0
  19. package/dist/chunk-4FMALWYB.js +669 -0
  20. package/dist/chunk-4GPCWBBA.js +143 -0
  21. package/dist/chunk-4UE5TCMQ.js +104 -0
  22. package/dist/chunk-65VPWMPV.js +1134 -0
  23. package/dist/chunk-6HFAEZ52.js +29 -0
  24. package/dist/chunk-6SVOHNIC.js +17 -0
  25. package/dist/chunk-BDNNPRX6.js +41 -0
  26. package/dist/chunk-BRNEKPWX.js +37 -0
  27. package/dist/chunk-BXJ2J27B.js +219 -0
  28. package/dist/chunk-CSJWB6D3.js +151 -0
  29. package/dist/chunk-CXBZTONY.js +65 -0
  30. package/dist/chunk-EE4M2UOF.js +818 -0
  31. package/dist/chunk-GFRAYYRD.js +817 -0
  32. package/dist/chunk-IVQHLI56.js +1890 -0
  33. package/dist/chunk-IZ6Q4SE3.js +178 -0
  34. package/dist/chunk-JKMQSAJP.js +174 -0
  35. package/dist/chunk-K7E34Q3A.js +1445 -0
  36. package/dist/chunk-KVG7YCTS.js +115 -0
  37. package/dist/chunk-L23O2FFE.js +51 -0
  38. package/dist/chunk-MFVUENZR.js +1549 -0
  39. package/dist/chunk-ML7D5DWY.js +263 -0
  40. package/dist/chunk-MQXYDYRD.js +968 -0
  41. package/dist/chunk-POR5L2DG.js +247 -0
  42. package/dist/chunk-QJVSKKRQ.js +369 -0
  43. package/dist/chunk-QQQYCWSC.js +240 -0
  44. package/dist/chunk-R5U7XKVJ.js +16 -0
  45. package/dist/chunk-RYKLVOVK.js +309 -0
  46. package/dist/chunk-SNVGDYX7.js +187 -0
  47. package/dist/chunk-T6OZMPPV.js +68 -0
  48. package/dist/chunk-UKZIAQA7.js +26 -0
  49. package/dist/chunk-VGOA5Y7S.js +251 -0
  50. package/dist/chunk-VWGP4NVJ.js +513 -0
  51. package/dist/chunk-WBVO43HU.js +355 -0
  52. package/dist/chunk-WUOAQVOA.js +86 -0
  53. package/dist/chunk-XJTRY453.js +868 -0
  54. package/dist/chunk-YOBAUCVN.js +583 -0
  55. package/dist/cli-RSRk1M36.d.ts +707 -0
  56. package/dist/cli.d.ts +7 -309
  57. package/dist/cli.js +125 -945
  58. package/dist/completion-csVun6SP.d.ts +112 -0
  59. package/dist/completion-values-By-mnjNt.d.ts +142 -0
  60. package/dist/completion-values.d.ts +1 -0
  61. package/dist/completion-values.js +29 -0
  62. package/dist/completion.d.ts +3 -0
  63. package/dist/completion.js +34 -0
  64. package/dist/compliance-AxFf-uMy.d.ts +60 -0
  65. package/dist/compliance.d.ts +1 -0
  66. package/dist/compliance.js +17 -0
  67. package/dist/config-CaK60ByQ.d.ts +241 -0
  68. package/dist/config.d.ts +1 -97
  69. package/dist/config.js +8 -78
  70. package/dist/errcorrect-BcX1Ft0K.d.ts +44 -0
  71. package/dist/errcorrect.d.ts +1 -37
  72. package/dist/errcorrect.js +8 -68
  73. package/dist/error-Do8Qji43.d.ts +231 -0
  74. package/dist/id/index.d.ts +2 -83
  75. package/dist/id/index.js +14 -65
  76. package/dist/index-BKJZClJx.d.ts +1486 -0
  77. package/dist/index-C3Zw4wDJ.d.ts +359 -0
  78. package/dist/index-CGE5yLBj.d.ts +328 -0
  79. package/dist/index-VLDcI5NF.d.ts +95 -0
  80. package/dist/index.d.ts +37 -0
  81. package/dist/index.js +132 -0
  82. package/dist/llm-DYuR7_uX.d.ts +1069 -0
  83. package/dist/llm-anthropic-Cd_I2xXB.d.ts +67 -0
  84. package/dist/llm-anthropic.d.ts +2 -0
  85. package/dist/llm-anthropic.js +13 -0
  86. package/dist/llm-openai-DyFrucmV.d.ts +87 -0
  87. package/dist/llm-openai.d.ts +2 -0
  88. package/dist/llm-openai.js +19 -0
  89. package/dist/llm.d.ts +1 -188
  90. package/dist/llm.js +101 -356
  91. package/dist/log-CkaxMX3U.d.ts +115 -0
  92. package/dist/log.d.ts +2 -0
  93. package/dist/log.js +14 -0
  94. package/dist/mcp/index.d.ts +4 -0
  95. package/dist/mcp/index.js +185 -0
  96. package/dist/netpolicy-Brx5XZUB.d.ts +151 -0
  97. package/dist/netpolicy.d.ts +1 -0
  98. package/dist/netpolicy.js +25 -0
  99. package/dist/output-CjZWmL8s.d.ts +420 -0
  100. package/dist/output.d.ts +3 -213
  101. package/dist/output.js +135 -447
  102. package/dist/parity-CvMuYcVI.d.ts +61 -0
  103. package/dist/progress-CAzyxeWl.d.ts +38 -0
  104. package/dist/progress.d.ts +1 -30
  105. package/dist/progress.js +6 -55
  106. package/dist/provenance-SMFHm5gx.d.ts +30 -0
  107. package/dist/provenance.d.ts +1 -24
  108. package/dist/provenance.js +6 -31
  109. package/dist/routellm-B0nv59mH.d.ts +111 -0
  110. package/dist/routellm.d.ts +2 -64
  111. package/dist/routellm.js +13 -255
  112. package/dist/rpc-D31Lg0Kc.d.ts +32 -0
  113. package/dist/rpc.d.ts +2 -25
  114. package/dist/rpc.js +4 -98
  115. package/dist/safety-CUaYEjZc.d.ts +30 -0
  116. package/dist/safety.d.ts +1 -24
  117. package/dist/safety.js +6 -43
  118. package/dist/scope-BrhYB4ij.d.ts +141 -0
  119. package/dist/scope.d.ts +1 -121
  120. package/dist/scope.js +20 -377
  121. package/dist/serve-D8yWMrTc.d.ts +646 -0
  122. package/dist/serve.d.ts +3 -0
  123. package/dist/serve.js +75 -0
  124. package/dist/sqlstore.js +6 -39
  125. package/dist/stream-CrjeCp0M.d.ts +44 -0
  126. package/dist/stream.d.ts +1 -35
  127. package/dist/stream.js +8 -51
  128. package/dist/telemetry/index.d.ts +1 -315
  129. package/dist/telemetry/index.js +26 -599
  130. package/dist/toolspec-DcPwwoAZ.d.ts +368 -0
  131. package/dist/toolspec.d.ts +2 -0
  132. package/dist/toolspec.js +37 -0
  133. package/dist/tui/index.d.ts +6 -298
  134. package/dist/tui/index.js +17 -381
  135. package/dist/upgrade-C3RWGwRi.d.ts +125 -0
  136. package/dist/upgrade.d.ts +1 -95
  137. package/dist/upgrade.js +6 -114
  138. package/dist/xdg-DB7Shoib.d.ts +179 -0
  139. package/dist/xdg.d.ts +1 -169
  140. package/dist/xdg.js +14 -128
  141. package/package.json +192 -24
  142. package/src/README.md +15 -0
  143. package/src/alias.conformance.test.ts +250 -0
  144. package/src/alias.test.ts +206 -2
  145. package/src/alias.ts +196 -21
  146. package/src/cli.help-command.test.ts +105 -0
  147. package/src/cli.offline.test.ts +93 -0
  148. package/src/cli.parity.test.ts +192 -0
  149. package/src/cli.root.conformance.test.ts +166 -0
  150. package/src/cli.test.ts +95 -1
  151. package/src/cli.ts +234 -25
  152. package/src/completion-scripts.ts +16 -0
  153. package/src/completion-values.test.ts +76 -16
  154. package/src/completion-values.ts +170 -66
  155. package/src/completion.conformance.test.ts +298 -0
  156. package/src/completion.test.ts +268 -145
  157. package/src/completion.ts +772 -121
  158. package/src/compliance.test.ts +196 -2
  159. package/src/compliance.ts +440 -20
  160. package/src/config-merge.test.ts +425 -0
  161. package/src/config.test.ts +228 -1
  162. package/src/config.ts +429 -16
  163. package/src/delegation.test.ts +299 -0
  164. package/src/delegation.ts +807 -0
  165. package/src/gen/crud_pb.ts +7 -7
  166. package/src/id/README.md +38 -0
  167. package/src/id/contract.test.ts +1 -1
  168. package/src/id/index.test.ts +1 -1
  169. package/src/id/index.ts +3 -2
  170. package/src/index.test.ts +71 -0
  171. package/src/index.ts +46 -0
  172. package/src/llm-anthropic.conformance.test.ts +1135 -0
  173. package/src/llm-anthropic.test.ts +152 -0
  174. package/src/llm-anthropic.ts +940 -0
  175. package/src/llm-choice-hermetic.test.ts +335 -0
  176. package/src/llm-config.test.ts +232 -0
  177. package/src/llm-config.ts +106 -0
  178. package/src/llm-endpoint.ts +254 -0
  179. package/src/llm-error.ts +17 -0
  180. package/src/llm-errors.ts +152 -0
  181. package/src/llm-file.ts +126 -0
  182. package/src/llm-http.ts +317 -0
  183. package/src/llm-keys.ts +167 -0
  184. package/src/llm-media.conformance.test.ts +87 -0
  185. package/src/llm-media.test.ts +279 -0
  186. package/src/llm-media.ts +322 -0
  187. package/src/llm-openai.conformance.test.ts +407 -0
  188. package/src/llm-openai.test.ts +510 -0
  189. package/src/llm-openai.ts +708 -0
  190. package/src/llm-payload.ts +155 -0
  191. package/src/llm-quote.ts +46 -0
  192. package/src/llm-routellm.conformance.test.ts +44 -0
  193. package/src/llm-toolnames.conformance.test.ts +112 -0
  194. package/src/llm-toolnames.test.ts +132 -0
  195. package/src/llm-toolnames.ts +298 -0
  196. package/src/llm-uri.ts +99 -0
  197. package/src/llm.test.ts +43 -15
  198. package/src/llm.toolcall.test.ts +175 -0
  199. package/src/llm.ts +602 -190
  200. package/src/log.parity.test.ts +105 -0
  201. package/src/log.test.ts +270 -1
  202. package/src/log.ts +228 -49
  203. package/src/mcp/README.md +63 -0
  204. package/src/mcp/args-separator.test.ts +164 -0
  205. package/src/mcp/args.test.ts +223 -0
  206. package/src/mcp/args.ts +160 -0
  207. package/src/mcp/audit.test.ts +520 -0
  208. package/src/mcp/audit.ts +70 -0
  209. package/src/mcp/bridge.test.ts +250 -0
  210. package/src/mcp/bridge.ts +286 -0
  211. package/src/mcp/conformance.test.ts +357 -0
  212. package/src/mcp/dispatch.ts +359 -0
  213. package/src/mcp/identity.test.ts +166 -0
  214. package/src/mcp/identity.ts +72 -0
  215. package/src/mcp/index.ts +176 -0
  216. package/src/mcp/legacy-notify.test.ts +59 -0
  217. package/src/mcp/legacy.ts +367 -0
  218. package/src/mcp/mcp.test.ts +707 -0
  219. package/src/mcp/modern-confirm.test.ts +520 -0
  220. package/src/mcp/modern-confirm.ts +484 -0
  221. package/src/mcp/modern.ts +788 -0
  222. package/src/mcp/stdio.test.ts +313 -0
  223. package/src/mcp/stdio.ts +254 -0
  224. package/src/mcp/tasks.ts +82 -0
  225. package/src/mcp/testtree.ts +250 -0
  226. package/src/mcp/toolname.test.ts +147 -0
  227. package/src/mcp/types.ts +689 -0
  228. package/src/netpolicy.test.ts +280 -0
  229. package/src/netpolicy.ts +256 -0
  230. package/src/output/README.md +46 -0
  231. package/src/output/builtins.ts +5 -5
  232. package/src/output/dispatch.ts +10 -2
  233. package/src/output/error.ts +459 -0
  234. package/src/output/formatter.ts +29 -5
  235. package/src/output/formatters/README.md +50 -0
  236. package/src/output/formatters/csv.ts +48 -12
  237. package/src/output/formatters/json.ts +4 -25
  238. package/src/output/formatters/project.ts +34 -0
  239. package/src/output/formatters/table.ts +8 -6
  240. package/src/output/formatters/text.ts +7 -3
  241. package/src/output/formatters/yaml.ts +5 -22
  242. package/src/output/projection.test.ts +298 -0
  243. package/src/output/projection.ts +33 -59
  244. package/src/output/template.ts +11 -21
  245. package/src/output.surface.test.ts +41 -0
  246. package/src/output.ts +64 -3
  247. package/src/plan.ts +89 -0
  248. package/src/policy.ts +472 -0
  249. package/src/published-types.test.ts +133 -0
  250. package/src/routellm.test.ts +209 -28
  251. package/src/routellm.toolcall.test.ts +521 -0
  252. package/src/routellm.ts +213 -177
  253. package/src/router/README.md +44 -0
  254. package/src/router/server.test.ts +41 -0
  255. package/src/router/server.ts +11 -0
  256. package/src/safety.test.ts +19 -9
  257. package/src/scope-defaults.json +29 -29
  258. package/src/serve.test.ts +1257 -0
  259. package/src/serve.ts +1665 -0
  260. package/src/sideeffect.ts +105 -0
  261. package/src/telemetry/README.md +48 -0
  262. package/src/telemetry/client.test.ts +31 -0
  263. package/src/telemetry/client.ts +12 -6
  264. package/src/telemetry/offline.test.ts +64 -0
  265. package/src/toolspec-internal.ts +279 -0
  266. package/src/toolspec-manifest.test.ts +167 -0
  267. package/src/toolspec-manifest.ts +415 -0
  268. package/src/toolspec-spec-schemas.ts +12 -0
  269. package/src/toolspec-spec.test.ts +273 -0
  270. package/src/toolspec-spec.ts +458 -0
  271. package/src/toolspec.from-command.test.ts +350 -0
  272. package/src/toolspec.test.ts +2 -2
  273. package/src/toolspec.ts +222 -0
  274. package/src/triton/README.md +34 -0
  275. package/src/tui/README.md +42 -0
  276. package/src/tui/parity.test.ts +120 -31
  277. package/src/tui/parity.ts +58 -7
  278. package/src/upgrade.test.ts +291 -0
  279. package/src/upgrade.ts +116 -7
  280. package/src/wizard.test.ts +7 -7
  281. package/test/llm/conformance-helpers.ts +100 -0
  282. package/test/output/csv.test.ts +164 -0
  283. package/test/output/dispatch.test.ts +1 -2
  284. package/test/output/error.test.ts +277 -0
  285. package/test/output/smoke-capture.ts +2 -2
  286. package/test/output/smoke.test.ts +2 -2
  287. package/test/output/taxonomy-contract.test.ts +148 -0
  288. package/test/setup-env.ts +16 -0
  289. package/test/toolspec/fixture.ts +79 -0
  290. package/tsconfig.json +3 -1
  291. package/tsconfig.test.json +10 -0
  292. package/vitest.config.ts +9 -0
  293. package/src/tui/parity.json +0 -74
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.15.0 with parameter "target=ts"
2
2
  // @generated from file crud.proto (package crud.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
@@ -11,7 +11,7 @@ import type { JsonObject, Message } from "@bufbuild/protobuf";
11
11
  * Describes the file crud.proto.
12
12
  */
13
13
  export const file_crud: GenFile = /*@__PURE__*/
14
- f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uY3J1ZC52MS5HZXRSZXF1ZXN0GhQuY3J1ZC52MS5HZXRSZXNwb25zZRIzCgRMaXN0EhQuY3J1ZC52MS5MaXN0UmVxdWVzdBoVLmNydWQudjEuTGlzdFJlc3BvbnNlEjkKBlVwZGF0ZRIWLmNydWQudjEuVXBkYXRlUmVxdWVzdBoXLmNydWQudjEuVXBkYXRlUmVzcG9uc2USOQoGRGVsZXRlEhYuY3J1ZC52MS5EZWxldGVSZXF1ZXN0GhcuY3J1ZC52MS5EZWxldGVSZXNwb25zZUKBAQoLY29tLmNydWQudjFCCUNydWRQcm90b1ABWipob3AudG9wL2tpdC9jb250cmFjdHMvcHJvdG8vY3J1ZC92MTtjcnVkdjGiAgNDWFiqAgdDcnVkLlYxygIHQ3J1ZFxWMeICE0NydWRcVjFcR1BCTWV0YWRhdGHqAghDcnVkOjpWMWIGcHJvdG8z", [file_google_protobuf_struct]);
15
15
 
16
16
  /**
17
17
  * @generated from message crud.v1.CreateRequest
@@ -22,7 +22,7 @@ export type CreateRequest = Message<"crud.v1.CreateRequest"> & {
22
22
  *
23
23
  * @generated from field: google.protobuf.Struct entity = 1;
24
24
  */
25
- entity?: JsonObject;
25
+ entity?: JsonObject | undefined;
26
26
  };
27
27
 
28
28
  /**
@@ -41,7 +41,7 @@ export type CreateResponse = Message<"crud.v1.CreateResponse"> & {
41
41
  *
42
42
  * @generated from field: google.protobuf.Struct entity = 1;
43
43
  */
44
- entity?: JsonObject;
44
+ entity?: JsonObject | undefined;
45
45
  };
46
46
 
47
47
  /**
@@ -75,7 +75,7 @@ export type GetResponse = Message<"crud.v1.GetResponse"> & {
75
75
  /**
76
76
  * @generated from field: google.protobuf.Struct entity = 1;
77
77
  */
78
- entity?: JsonObject;
78
+ entity?: JsonObject | undefined;
79
79
  };
80
80
 
81
81
  /**
@@ -149,7 +149,7 @@ export type UpdateRequest = Message<"crud.v1.UpdateRequest"> & {
149
149
  /**
150
150
  * @generated from field: google.protobuf.Struct entity = 1;
151
151
  */
152
- entity?: JsonObject;
152
+ entity?: JsonObject | undefined;
153
153
  };
154
154
 
155
155
  /**
@@ -166,7 +166,7 @@ export type UpdateResponse = Message<"crud.v1.UpdateResponse"> & {
166
166
  /**
167
167
  * @generated from field: google.protobuf.Struct entity = 1;
168
168
  */
169
- entity?: JsonObject;
169
+ entity?: JsonObject | undefined;
170
170
  };
171
171
 
172
172
  /**
@@ -0,0 +1,38 @@
1
+ # id
2
+
3
+ ## What it answers
4
+
5
+ How to mint and parse kit entity IDs so that Go, Python, Rust and PHP produce the same string for the same `(prefix, uuid)`. Canonical wire form: `<prefix>_<26-char-base32>`, a Crockford-base32 UUIDv7 behind a lowercase prefix. Wrong module for URI composition such as `tlc://task/task_...`: use `@hop-top/cite`.
6
+
7
+ ## Use it when
8
+
9
+ - new entity: `newId('task')`
10
+ - validate or split an incoming id: `parse(s)` returns `{ prefix, uuid }` and throws on malformed input
11
+ - compile-time prefix safety: `Typed<'task'>` with `newTyped` / `parseTyped`
12
+
13
+ ## Quick start
14
+
15
+ ```ts
16
+ import { newId, parse } from '@hop-top/kit/id';
17
+
18
+ const id = newId('task');
19
+ console.log(id, parse(id).uuid);
20
+ ```
21
+
22
+ ## Contract
23
+
24
+ - Thin wrapper over `typeid-js`; the string returned by `newId` is the JSON wire form and round-trips losslessly through `parse`.
25
+ - Prefix grammar and length limit follow the typeid spec pinned in the fixture; a divergence is a wire-format break.
26
+ - No transitive dependency on the URI registry, by design.
27
+ - Parity: [`contracts/typeid-v1/fixtures.json`](../../../../contracts/typeid-v1/fixtures.json), replayed by [`contract.test.ts`](contract.test.ts).
28
+
29
+ ## Neighbours
30
+
31
+ - `@hop-top/cite`: URI composition on top of the canonical string
32
+ - `@hop-top/kit/sqlstore`: persistence keyed by these ids
33
+ - Go reference: `go/core/id`; Python port: [`hop_top_kit/id`](../../../py/hop_top_kit/id/README.md)
34
+
35
+ ## See also
36
+
37
+ - [`docs/announcements/2026-05-typeid-primitive.md`](../../../../docs/announcements/2026-05-typeid-primitive.md)
38
+ - [`docs/adopters/reference/go-primitives.md`](../../../../docs/adopters/reference/go-primitives.md)
@@ -1,4 +1,4 @@
1
- // Cross-language parity contract test (tlc T-0753).
1
+ // Cross-language parity contract test.
2
2
  //
3
3
  // Loads contracts/typeid-v1/fixtures.json from the repo root and
4
4
  // asserts that this TS SDK's encode (via typeid-js's TypeID.fromUUID)
@@ -10,7 +10,7 @@ import {
10
10
  } from './index';
11
11
 
12
12
  // Canonical fixture set — these EXACT uuid inputs are shared with the
13
- // other language SDKs so future cross-language parity work (T-0753)
13
+ // other language SDKs so future cross-language parity work
14
14
  // finds matching outputs. Do not mutate without coordinating across
15
15
  // sdk/{go,rs,py,php}.
16
16
  const FIXTURES: ReadonlyArray<{ prefix: string; uuid: string }> = [
package/src/id/index.ts CHANGED
@@ -3,7 +3,8 @@
3
3
  * @package @hop-top/kit
4
4
  *
5
5
  * TypeID primitive — thin wrapper around `typeid-js` (jetify-com)
6
- * implementing the cross-language kit API SHAPE per ADR 0001.
6
+ * implementing the cross-language kit API SHAPE per
7
+ * docs/announcements/2026-05-typeid-primitive.md.
7
8
  *
8
9
  * Canonical wire form: `<prefix>_<26-char-base32>` where the suffix is
9
10
  * a Crockford-base32-encoded UUIDv7. The TS surface adds a
@@ -13,7 +14,7 @@
13
14
  * URI composition (e.g. `tlc://task/task_…`) is NOT in this module —
14
15
  * callers should use the `@hop-top/cite` package directly. This
15
16
  * keeps `kit/id` free of any transitive dependency on the URI
16
- * registry, per the ADR's scope boundary.
17
+ * registry.
17
18
  */
18
19
 
19
20
  import { typeid, TypeID } from 'typeid-js';
@@ -0,0 +1,71 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+
5
+ import * as kit from './index.js';
6
+
7
+ const pkgDir = join(__dirname, '..');
8
+ const pkg = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8')) as {
9
+ exports: Record<string, Record<string, string>>;
10
+ typesVersions?: Record<string, Record<string, string[]>>;
11
+ scripts: Record<string, string>;
12
+ };
13
+
14
+ /** Map a dist target like './dist/foo/index.js' to its source entry 'src/foo/index.ts'. */
15
+ function srcEntryFor(distTarget: string): string {
16
+ return distTarget.replace(/^\.\/dist\//, 'src/').replace(/\.js$/, '.ts');
17
+ }
18
+
19
+ describe('exports map contract', () => {
20
+ const subpaths = Object.entries(pkg.exports);
21
+
22
+ it('declares at least the root and one subpath', () => {
23
+ expect(subpaths.length).toBeGreaterThan(1);
24
+ expect(pkg.exports['.']).toBeDefined();
25
+ });
26
+
27
+ it.each(subpaths)('%s: every condition target is emitted by the build', (subpath, conditions) => {
28
+ const buildScript = pkg.scripts.build;
29
+ for (const [condition, target] of Object.entries(conditions)) {
30
+ // All runtime conditions must point into dist/.
31
+ expect(target, `${subpath} ${condition}`).toMatch(/^\.\/dist\//);
32
+ const entry = srcEntryFor(condition === 'types' ? target.replace(/\.d\.ts$/, '.js') : target);
33
+ // The source entry must exist on disk...
34
+ expect(existsSync(join(pkgDir, entry)), `${subpath} ${condition}: missing ${entry}`).toBe(true);
35
+ // ...and be listed as a tsup build entry, or the dist target dangles.
36
+ expect(buildScript, `${subpath} ${condition}: ${entry} not in build entries`).toContain(entry);
37
+ }
38
+ });
39
+
40
+ it('root "." exposes the same condition set as the other entries', () => {
41
+ expect(Object.keys(pkg.exports['.']).sort()).toEqual(['default', 'require', 'types']);
42
+ });
43
+
44
+ // moduleResolution node10 ignores `exports`; `typesVersions` is its only
45
+ // route to subpath types, so every subpath needs a matching entry.
46
+ it('typesVersions maps every subpath to its exports types target', () => {
47
+ const expected = Object.fromEntries(
48
+ subpaths
49
+ .filter(([subpath]) => subpath !== '.')
50
+ .map(([subpath, conditions]) => [subpath.replace(/^\.\//, ''), [conditions.types]]),
51
+ );
52
+ expect(pkg.typesVersions).toEqual({ '*': expected });
53
+ });
54
+ });
55
+
56
+ describe('root barrel', () => {
57
+ it('re-exports every public subpath except sqlstore as a namespace', () => {
58
+ // Kebab-case subpaths become camelCase namespaces (completion-values -> completionValues).
59
+ const expected = Object.keys(pkg.exports)
60
+ .filter((p) => p !== '.' && p !== './sqlstore')
61
+ .map((p) => p.replace(/^\.\//, '').replace(/-([a-z])/g, (_, c: string) => c.toUpperCase()));
62
+ for (const name of expected) {
63
+ expect(kit, name).toHaveProperty(name);
64
+ expect(typeof (kit as Record<string, unknown>)[name], name).toBe('object');
65
+ }
66
+ });
67
+
68
+ it('does not eagerly expose sqlstore (native deps stay behind the subpath)', () => {
69
+ expect(kit).not.toHaveProperty('sqlstore');
70
+ });
71
+ });
package/src/index.ts ADDED
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @module index
3
+ * @package @hop-top/kit
4
+ *
5
+ * Root barrel: namespace re-exports of every public subpath, so
6
+ * `require('@hop-top/kit')` / `import ... from '@hop-top/kit'` resolve.
7
+ * Namespaces mirror the package exports map one-to-one; kebab-case
8
+ * subpaths become camelCase namespaces (`completion-values` ->
9
+ * `completionValues`).
10
+ *
11
+ * `sqlstore` is intentionally NOT re-exported here: an eager re-export
12
+ * would load better-sqlite3 native bindings on every bare import of the
13
+ * package. Use the dedicated subpath instead: `@hop-top/kit/sqlstore`.
14
+ */
15
+
16
+ export * as aim from './aim.js';
17
+ export * as alias from './alias.js';
18
+ export * as anthropic from './llm-anthropic.js';
19
+ export * as api from './api.js';
20
+ export * as auth from './auth.js';
21
+ export * as cli from './cli.js';
22
+ export * as completion from './completion.js';
23
+ export * as completionValues from './completion-values.js';
24
+ export * as compliance from './compliance.js';
25
+ export * as config from './config.js';
26
+ export * as errcorrect from './errcorrect.js';
27
+ export * as id from './id/index.js';
28
+ export * as llm from './llm.js';
29
+ export * as log from './log.js';
30
+ export * as mcp from './mcp/index.js';
31
+ export * as netpolicy from './netpolicy.js';
32
+ export * as openai from './llm-openai.js';
33
+ export * as output from './output.js';
34
+ export * as progress from './progress.js';
35
+ export * as provenance from './provenance.js';
36
+ export * as routellm from './routellm.js';
37
+ export * as rpc from './rpc.js';
38
+ export * as safety from './safety.js';
39
+ export * as scope from './scope.js';
40
+ export * as serve from './serve.js';
41
+ export * as stream from './stream.js';
42
+ export * as telemetry from './telemetry/index.js';
43
+ export * as toolspec from './toolspec.js';
44
+ export * as tui from './tui/index.js';
45
+ export * as upgrade from './upgrade.js';
46
+ export * as xdg from './xdg.js';