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

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 (107) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/README.md +333 -9
  3. package/dist/aim-CTp-kJW2.d.ts +139 -0
  4. package/dist/aim.d.ts +1 -116
  5. package/dist/alias-dhhr08Ei.d.ts +88 -0
  6. package/dist/alias.d.ts +2 -73
  7. package/dist/api-miiso81x.d.ts +77 -0
  8. package/dist/api.d.ts +1 -62
  9. package/dist/auth-2-jfgiHn.d.ts +34 -0
  10. package/dist/auth.d.ts +1 -26
  11. package/dist/cli-DLygZLi9.d.ts +450 -0
  12. package/dist/cli.d.ts +6 -309
  13. package/dist/cli.js +192 -63
  14. package/dist/config-BUY7_W2n.d.ts +103 -0
  15. package/dist/config.d.ts +1 -97
  16. package/dist/errcorrect-BcX1Ft0K.d.ts +44 -0
  17. package/dist/errcorrect.d.ts +1 -37
  18. package/dist/error-DISJKeDu.d.ts +144 -0
  19. package/dist/id/index.d.ts +2 -83
  20. package/dist/index-Bc5c7Ty5.d.ts +328 -0
  21. package/dist/index-C3Zw4wDJ.d.ts +359 -0
  22. package/dist/index-MLrRDvEG.d.ts +1073 -0
  23. package/dist/index-QSffbLnj.d.ts +94 -0
  24. package/dist/index.d.ts +28 -0
  25. package/dist/index.js +6794 -0
  26. package/dist/llm-B5XUWH8T.d.ts +231 -0
  27. package/dist/llm.d.ts +1 -188
  28. package/dist/mcp/index.d.ts +2 -0
  29. package/dist/mcp/index.js +1453 -0
  30. package/dist/netpolicy-asvCfwi8.d.ts +138 -0
  31. package/dist/netpolicy.d.ts +1 -0
  32. package/dist/netpolicy.js +118 -0
  33. package/dist/output-4aXs91GY.d.ts +396 -0
  34. package/dist/output.d.ts +3 -213
  35. package/dist/output.js +567 -43
  36. package/dist/progress-CAzyxeWl.d.ts +38 -0
  37. package/dist/progress.d.ts +1 -30
  38. package/dist/provenance-SMFHm5gx.d.ts +30 -0
  39. package/dist/provenance.d.ts +1 -24
  40. package/dist/routellm-PGSt2D1y.d.ts +75 -0
  41. package/dist/routellm.d.ts +2 -64
  42. package/dist/rpc-D5xLEf8V.d.ts +32 -0
  43. package/dist/rpc.d.ts +2 -25
  44. package/dist/safety-CUaYEjZc.d.ts +30 -0
  45. package/dist/safety.d.ts +1 -24
  46. package/dist/scope-BrhYB4ij.d.ts +141 -0
  47. package/dist/scope.d.ts +1 -121
  48. package/dist/serve-DE-jscpb.d.ts +646 -0
  49. package/dist/serve.d.ts +3 -0
  50. package/dist/serve.js +1019 -0
  51. package/dist/stream-CrjeCp0M.d.ts +44 -0
  52. package/dist/stream.d.ts +1 -35
  53. package/dist/telemetry/index.d.ts +1 -315
  54. package/dist/telemetry/index.js +12 -1
  55. package/dist/tui/index.d.ts +5 -298
  56. package/dist/tui/index.js +3 -10
  57. package/dist/upgrade-p_zh3pvV.d.ts +102 -0
  58. package/dist/upgrade.d.ts +1 -95
  59. package/dist/xdg-DB7Shoib.d.ts +179 -0
  60. package/dist/xdg.d.ts +1 -169
  61. package/package.json +26 -3
  62. package/src/cli.offline.test.ts +93 -0
  63. package/src/cli.parity.test.ts +192 -0
  64. package/src/cli.ts +112 -12
  65. package/src/index.test.ts +58 -0
  66. package/src/index.ts +37 -0
  67. package/src/log.parity.test.ts +105 -0
  68. package/src/log.ts +64 -13
  69. package/src/mcp/bridge.test.ts +150 -0
  70. package/src/mcp/bridge.ts +246 -0
  71. package/src/mcp/conformance.test.ts +336 -0
  72. package/src/mcp/dispatch.ts +313 -0
  73. package/src/mcp/index.ts +138 -0
  74. package/src/mcp/legacy.ts +314 -0
  75. package/src/mcp/mcp.test.ts +697 -0
  76. package/src/mcp/modern-confirm.test.ts +520 -0
  77. package/src/mcp/modern-confirm.ts +452 -0
  78. package/src/mcp/modern.ts +723 -0
  79. package/src/mcp/tasks.ts +82 -0
  80. package/src/mcp/testtree.ts +250 -0
  81. package/src/mcp/types.ts +504 -0
  82. package/src/netpolicy.test.ts +202 -0
  83. package/src/netpolicy.ts +231 -0
  84. package/src/output/dispatch.ts +10 -2
  85. package/src/output/error.ts +316 -0
  86. package/src/output/formatter.ts +29 -5
  87. package/src/output/formatters/csv.ts +48 -12
  88. package/src/output/formatters/json.ts +4 -25
  89. package/src/output/formatters/project.ts +34 -0
  90. package/src/output/formatters/table.ts +8 -6
  91. package/src/output/formatters/text.ts +7 -3
  92. package/src/output/formatters/yaml.ts +5 -22
  93. package/src/output/projection.test.ts +298 -0
  94. package/src/output/projection.ts +33 -59
  95. package/src/output/template.ts +11 -21
  96. package/src/output.surface.test.ts +41 -0
  97. package/src/output.ts +41 -3
  98. package/src/serve.test.ts +1257 -0
  99. package/src/serve.ts +1665 -0
  100. package/src/telemetry/client.test.ts +31 -0
  101. package/src/telemetry/client.ts +7 -1
  102. package/src/telemetry/offline.test.ts +64 -0
  103. package/src/tui/parity.test.ts +120 -31
  104. package/src/tui/parity.ts +58 -7
  105. package/test/output/csv.test.ts +164 -0
  106. package/test/output/error.test.ts +246 -0
  107. package/src/tui/parity.json +0 -74
@@ -0,0 +1,94 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * @module id
5
+ * @package @hop-top/kit
6
+ *
7
+ * TypeID primitive — thin wrapper around `typeid-js` (jetify-com)
8
+ * implementing the cross-language kit API SHAPE per ADR 0001.
9
+ *
10
+ * Canonical wire form: `<prefix>_<26-char-base32>` where the suffix is
11
+ * a Crockford-base32-encoded UUIDv7. The TS surface adds a
12
+ * template-literal `Typed<P>` for compile-time prefix safety on top of
13
+ * the runtime guarantees provided by `typeid-js`.
14
+ *
15
+ * URI composition (e.g. `tlc://task/task_…`) is NOT in this module —
16
+ * callers should use the `@hop-top/cite` package directly. This
17
+ * keeps `kit/id` free of any transitive dependency on the URI
18
+ * registry, per the ADR's scope boundary.
19
+ */
20
+
21
+ /**
22
+ * Compile-time-typed canonical TypeID string for prefix `P`.
23
+ *
24
+ * The template-literal `${P}_${string}` form means a `Typed<'task'>`
25
+ * is statically distinguishable from a `Typed<'invoice'>` even though
26
+ * both are runtime `string`s. Pair with {@link newTyped} or
27
+ * {@link parseTyped} to mint values whose prefix is enforced both at
28
+ * compile time and at runtime.
29
+ */
30
+ type Typed<P extends string> = `${P}_${string}`;
31
+ /** Parsed components of a canonical TypeID string. */
32
+ interface Parsed {
33
+ /** Prefix segment (everything before the final underscore). */
34
+ prefix: string;
35
+ /** Backing UUID in canonical 8-4-4-4-12 hyphenated form. */
36
+ uuid: string;
37
+ }
38
+ /**
39
+ * Generate a new TypeID with the given prefix, returning the canonical
40
+ * string `<prefix>_<26-char-base32>`.
41
+ *
42
+ * @example
43
+ * newId('task') // => 'task_01h2e8kqv8000000000000000'
44
+ */
45
+ declare function newId(prefix: string): string;
46
+ /**
47
+ * Parse a canonical TypeID string into its prefix and backing UUID.
48
+ *
49
+ * @throws {Error} when the input is not a syntactically valid TypeID
50
+ * (e.g. malformed suffix, illegal prefix characters).
51
+ */
52
+ declare function parse(s: string): Parsed;
53
+ /**
54
+ * Typed variant of {@link newId}. Returns a `Typed<P>` whose static
55
+ * type carries the literal prefix, enabling compile-time discrimination
56
+ * between e.g. `TaskId` and `InvoiceId`.
57
+ */
58
+ declare function newTyped<P extends string>(prefix: P): Typed<P>;
59
+ /**
60
+ * Typed variant of {@link parse}. Validates that the parsed prefix
61
+ * matches the expected `prefix` argument at runtime; returns the
62
+ * canonical string narrowed to `Typed<P>`.
63
+ *
64
+ * @throws {Error} when the parsed prefix does not match `prefix`, or
65
+ * when the input is not a syntactically valid TypeID.
66
+ */
67
+ declare function parseTyped<P extends string>(prefix: P, s: string): Typed<P>;
68
+ /**
69
+ * Zod schema for runtime validation of a `${prefix}_<26-char-base32>`
70
+ * canonical TypeID string.
71
+ *
72
+ * The schema only validates structure (prefix match + 26-char Crockford
73
+ * base32 suffix with the spec's leading-bit constraint). It does not
74
+ * decode the UUIDv7 timestamp; use {@link parse} if you need the
75
+ * underlying UUID.
76
+ *
77
+ * @example
78
+ * const TaskIdSchema = typeIdSchema('task');
79
+ * TaskIdSchema.parse('task_01h2e8kqv8000000000000000');
80
+ */
81
+ declare function typeIdSchema(prefix: string): z.ZodString;
82
+
83
+ type index_Parsed = Parsed;
84
+ type index_Typed<P extends string> = Typed<P>;
85
+ declare const index_newId: typeof newId;
86
+ declare const index_newTyped: typeof newTyped;
87
+ declare const index_parse: typeof parse;
88
+ declare const index_parseTyped: typeof parseTyped;
89
+ declare const index_typeIdSchema: typeof typeIdSchema;
90
+ declare namespace index {
91
+ export { type index_Parsed as Parsed, type index_Typed as Typed, index_newId as newId, index_newTyped as newTyped, index_parse as parse, index_parseTyped as parseTyped, index_typeIdSchema as typeIdSchema };
92
+ }
93
+
94
+ export { type Parsed as P, type Typed as T, newTyped as a, parseTyped as b, index as i, newId as n, parse as p, typeIdSchema as t };
@@ -0,0 +1,28 @@
1
+ export { g as aim } from './aim-CTp-kJW2.js';
2
+ export { c as alias } from './alias-dhhr08Ei.js';
3
+ export { e as api } from './api-miiso81x.js';
4
+ export { a as auth } from './auth-2-jfgiHn.js';
5
+ export { h as cli } from './cli-DLygZLi9.js';
6
+ export { c as config } from './config-BUY7_W2n.js';
7
+ export { e as errcorrect } from './errcorrect-BcX1Ft0K.js';
8
+ export { i as id } from './index-QSffbLnj.js';
9
+ export { s as llm } from './llm-B5XUWH8T.js';
10
+ export { ao as mcp } from './index-MLrRDvEG.js';
11
+ export { n as netpolicy } from './netpolicy-asvCfwi8.js';
12
+ export { l as output } from './output-4aXs91GY.js';
13
+ export { p as progress } from './progress-CAzyxeWl.js';
14
+ export { p as provenance } from './provenance-SMFHm5gx.js';
15
+ export { r as routellm } from './routellm-PGSt2D1y.js';
16
+ export { r as rpc } from './rpc-D5xLEf8V.js';
17
+ export { s as safety } from './safety-CUaYEjZc.js';
18
+ export { s as scope } from './scope-BrhYB4ij.js';
19
+ export { M as serve } from './serve-DE-jscpb.js';
20
+ export { s as stream } from './stream-CrjeCp0M.js';
21
+ export { i as telemetry } from './index-C3Zw4wDJ.js';
22
+ export { i as tui } from './index-Bc5c7Ty5.js';
23
+ export { u as upgrade } from './upgrade-p_zh3pvV.js';
24
+ export { x as xdg } from './xdg-DB7Shoib.js';
25
+ import 'commander';
26
+ import 'node:stream';
27
+ import 'zod';
28
+ import './error-DISJKeDu.js';