@ontrails/core 1.0.0-beta.4 → 1.0.0-beta.42

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 (247) hide show
  1. package/CHANGELOG.md +414 -12
  2. package/README.md +112 -28
  3. package/package.json +11 -1
  4. package/src/activation-provenance.ts +116 -0
  5. package/src/activation-source-compatibility.ts +430 -0
  6. package/src/activation-source-projection.ts +227 -0
  7. package/src/activation-source.ts +93 -0
  8. package/src/blob-ref.ts +51 -0
  9. package/src/branded.ts +1 -1
  10. package/src/compose-batch.ts +69 -0
  11. package/src/compose-schema.ts +36 -0
  12. package/src/context.ts +59 -11
  13. package/src/derive.ts +271 -19
  14. package/src/detours.ts +8 -0
  15. package/src/diagnostics.ts +21 -0
  16. package/src/draft.ts +350 -0
  17. package/src/entity.ts +346 -0
  18. package/src/error-projection.ts +51 -0
  19. package/src/errors.ts +335 -48
  20. package/src/execute.ts +1577 -0
  21. package/src/fire.ts +1172 -0
  22. package/src/glob.ts +81 -0
  23. package/src/index.ts +568 -32
  24. package/src/internal/fork-ctx.ts +69 -0
  25. package/src/layer-projection.ts +193 -0
  26. package/src/layer.ts +43 -6
  27. package/src/observe.ts +361 -0
  28. package/src/path-scope.ts +66 -0
  29. package/src/path-security.ts +11 -3
  30. package/src/permits.ts +12 -0
  31. package/src/queue.ts +163 -0
  32. package/src/redaction/patterns.ts +6 -3
  33. package/src/resilience.ts +11 -11
  34. package/src/resource-config.ts +804 -0
  35. package/src/resource.ts +194 -0
  36. package/src/result.ts +18 -0
  37. package/src/run.ts +76 -0
  38. package/src/runtime-builtins.ts +69 -0
  39. package/src/schedule-runtime.ts +689 -0
  40. package/src/schedule.ts +326 -0
  41. package/src/serialization.ts +92 -55
  42. package/src/sha256.ts +136 -0
  43. package/src/signal-diagnostics.ts +633 -0
  44. package/src/signal-ref.ts +111 -0
  45. package/src/signal.ts +104 -0
  46. package/src/store/accessor-protocol.ts +56 -0
  47. package/src/store/index.ts +4 -0
  48. package/src/structured-examples.ts +248 -0
  49. package/src/surface-derivation.ts +91 -0
  50. package/src/surface-filter.ts +101 -0
  51. package/src/surface-overlay.ts +694 -0
  52. package/src/surface-versioning.ts +42 -0
  53. package/src/topo.ts +762 -38
  54. package/src/tracing.ts +346 -0
  55. package/src/trail-id-glob.ts +15 -0
  56. package/src/trail.ts +1244 -34
  57. package/src/trails/derive-trail.ts +835 -0
  58. package/src/trails/index.ts +9 -0
  59. package/src/trails/ingest.ts +152 -0
  60. package/src/trails-db.ts +212 -0
  61. package/src/transport-error-map.ts +174 -0
  62. package/src/type-utils.ts +87 -0
  63. package/src/types.ts +254 -12
  64. package/src/validate-established-topo.ts +73 -0
  65. package/src/validate-topo.ts +569 -55
  66. package/src/validation.ts +152 -4
  67. package/src/version-marker.ts +716 -0
  68. package/src/version-resolution.ts +308 -0
  69. package/src/version-runtime.ts +120 -0
  70. package/src/webhook.ts +461 -0
  71. package/src/workspace.ts +183 -16
  72. package/src/zod-wrappers.ts +72 -0
  73. package/.turbo/turbo-build.log +0 -1
  74. package/.turbo/turbo-lint.log +0 -3
  75. package/.turbo/turbo-typecheck.log +0 -1
  76. package/dist/adapters.d.ts +0 -39
  77. package/dist/adapters.d.ts.map +0 -1
  78. package/dist/adapters.js +0 -2
  79. package/dist/adapters.js.map +0 -1
  80. package/dist/blob-ref.d.ts +0 -20
  81. package/dist/blob-ref.d.ts.map +0 -1
  82. package/dist/blob-ref.js +0 -22
  83. package/dist/blob-ref.js.map +0 -1
  84. package/dist/branded.d.ts +0 -36
  85. package/dist/branded.d.ts.map +0 -1
  86. package/dist/branded.js +0 -89
  87. package/dist/branded.js.map +0 -1
  88. package/dist/collections.d.ts +0 -31
  89. package/dist/collections.d.ts.map +0 -1
  90. package/dist/collections.js +0 -60
  91. package/dist/collections.js.map +0 -1
  92. package/dist/context.d.ts +0 -10
  93. package/dist/context.d.ts.map +0 -1
  94. package/dist/context.js +0 -15
  95. package/dist/context.js.map +0 -1
  96. package/dist/derive.d.ts +0 -33
  97. package/dist/derive.d.ts.map +0 -1
  98. package/dist/derive.js +0 -125
  99. package/dist/derive.js.map +0 -1
  100. package/dist/errors.d.ts +0 -83
  101. package/dist/errors.d.ts.map +0 -1
  102. package/dist/errors.js +0 -142
  103. package/dist/errors.js.map +0 -1
  104. package/dist/event.d.ts +0 -45
  105. package/dist/event.d.ts.map +0 -1
  106. package/dist/event.js +0 -17
  107. package/dist/event.js.map +0 -1
  108. package/dist/fetch.d.ts +0 -15
  109. package/dist/fetch.d.ts.map +0 -1
  110. package/dist/fetch.js +0 -102
  111. package/dist/fetch.js.map +0 -1
  112. package/dist/guards.d.ts +0 -17
  113. package/dist/guards.d.ts.map +0 -1
  114. package/dist/guards.js +0 -25
  115. package/dist/guards.js.map +0 -1
  116. package/dist/health.d.ts +0 -18
  117. package/dist/health.d.ts.map +0 -1
  118. package/dist/health.js +0 -5
  119. package/dist/health.js.map +0 -1
  120. package/dist/index.d.ts +0 -34
  121. package/dist/index.d.ts.map +0 -1
  122. package/dist/index.js +0 -38
  123. package/dist/index.js.map +0 -1
  124. package/dist/job.d.ts +0 -24
  125. package/dist/job.d.ts.map +0 -1
  126. package/dist/job.js +0 -17
  127. package/dist/job.js.map +0 -1
  128. package/dist/layer.d.ts +0 -17
  129. package/dist/layer.d.ts.map +0 -1
  130. package/dist/layer.js +0 -21
  131. package/dist/layer.js.map +0 -1
  132. package/dist/path-security.d.ts +0 -28
  133. package/dist/path-security.d.ts.map +0 -1
  134. package/dist/path-security.js +0 -63
  135. package/dist/path-security.js.map +0 -1
  136. package/dist/patterns/bulk.d.ts +0 -15
  137. package/dist/patterns/bulk.d.ts.map +0 -1
  138. package/dist/patterns/bulk.js +0 -14
  139. package/dist/patterns/bulk.js.map +0 -1
  140. package/dist/patterns/change.d.ts +0 -10
  141. package/dist/patterns/change.d.ts.map +0 -1
  142. package/dist/patterns/change.js +0 -10
  143. package/dist/patterns/change.js.map +0 -1
  144. package/dist/patterns/date-range.d.ts +0 -10
  145. package/dist/patterns/date-range.d.ts.map +0 -1
  146. package/dist/patterns/date-range.js +0 -10
  147. package/dist/patterns/date-range.js.map +0 -1
  148. package/dist/patterns/index.d.ts +0 -9
  149. package/dist/patterns/index.d.ts.map +0 -1
  150. package/dist/patterns/index.js +0 -9
  151. package/dist/patterns/index.js.map +0 -1
  152. package/dist/patterns/pagination.d.ts +0 -18
  153. package/dist/patterns/pagination.d.ts.map +0 -1
  154. package/dist/patterns/pagination.js +0 -18
  155. package/dist/patterns/pagination.js.map +0 -1
  156. package/dist/patterns/progress.d.ts +0 -11
  157. package/dist/patterns/progress.d.ts.map +0 -1
  158. package/dist/patterns/progress.js +0 -11
  159. package/dist/patterns/progress.js.map +0 -1
  160. package/dist/patterns/sorting.d.ts +0 -13
  161. package/dist/patterns/sorting.d.ts.map +0 -1
  162. package/dist/patterns/sorting.js +0 -10
  163. package/dist/patterns/sorting.js.map +0 -1
  164. package/dist/patterns/status.d.ts +0 -15
  165. package/dist/patterns/status.d.ts.map +0 -1
  166. package/dist/patterns/status.js +0 -9
  167. package/dist/patterns/status.js.map +0 -1
  168. package/dist/patterns/timestamps.d.ts +0 -10
  169. package/dist/patterns/timestamps.d.ts.map +0 -1
  170. package/dist/patterns/timestamps.js +0 -10
  171. package/dist/patterns/timestamps.js.map +0 -1
  172. package/dist/redaction/index.d.ts +0 -4
  173. package/dist/redaction/index.d.ts.map +0 -1
  174. package/dist/redaction/index.js +0 -3
  175. package/dist/redaction/index.js.map +0 -1
  176. package/dist/redaction/patterns.d.ts +0 -9
  177. package/dist/redaction/patterns.d.ts.map +0 -1
  178. package/dist/redaction/patterns.js +0 -39
  179. package/dist/redaction/patterns.js.map +0 -1
  180. package/dist/redaction/redactor.d.ts +0 -27
  181. package/dist/redaction/redactor.d.ts.map +0 -1
  182. package/dist/redaction/redactor.js +0 -89
  183. package/dist/redaction/redactor.js.map +0 -1
  184. package/dist/resilience.d.ts +0 -34
  185. package/dist/resilience.d.ts.map +0 -1
  186. package/dist/resilience.js +0 -164
  187. package/dist/resilience.js.map +0 -1
  188. package/dist/result.d.ts +0 -57
  189. package/dist/result.d.ts.map +0 -1
  190. package/dist/result.js +0 -156
  191. package/dist/result.js.map +0 -1
  192. package/dist/serialization.d.ts +0 -27
  193. package/dist/serialization.d.ts.map +0 -1
  194. package/dist/serialization.js +0 -153
  195. package/dist/serialization.js.map +0 -1
  196. package/dist/topo.d.ts +0 -16
  197. package/dist/topo.d.ts.map +0 -1
  198. package/dist/topo.js +0 -66
  199. package/dist/topo.js.map +0 -1
  200. package/dist/trail.d.ts +0 -89
  201. package/dist/trail.d.ts.map +0 -1
  202. package/dist/trail.js +0 -18
  203. package/dist/trail.js.map +0 -1
  204. package/dist/types.d.ts +0 -46
  205. package/dist/types.d.ts.map +0 -1
  206. package/dist/types.js +0 -2
  207. package/dist/types.js.map +0 -1
  208. package/dist/validate-topo.d.ts +0 -24
  209. package/dist/validate-topo.d.ts.map +0 -1
  210. package/dist/validate-topo.js +0 -158
  211. package/dist/validate-topo.js.map +0 -1
  212. package/dist/validation.d.ts +0 -27
  213. package/dist/validation.d.ts.map +0 -1
  214. package/dist/validation.js +0 -134
  215. package/dist/validation.js.map +0 -1
  216. package/dist/workspace.d.ts +0 -25
  217. package/dist/workspace.d.ts.map +0 -1
  218. package/dist/workspace.js +0 -57
  219. package/dist/workspace.js.map +0 -1
  220. package/src/__tests__/blob-ref.test.ts +0 -103
  221. package/src/__tests__/branded.test.ts +0 -148
  222. package/src/__tests__/collections.test.ts +0 -126
  223. package/src/__tests__/context.test.ts +0 -66
  224. package/src/__tests__/derive.test.ts +0 -203
  225. package/src/__tests__/errors.test.ts +0 -309
  226. package/src/__tests__/event.test.ts +0 -82
  227. package/src/__tests__/fetch.test.ts +0 -217
  228. package/src/__tests__/guards.test.ts +0 -102
  229. package/src/__tests__/job.test.ts +0 -98
  230. package/src/__tests__/layer.test.ts +0 -212
  231. package/src/__tests__/path-security.test.ts +0 -114
  232. package/src/__tests__/patterns.test.ts +0 -273
  233. package/src/__tests__/redaction.test.ts +0 -244
  234. package/src/__tests__/resilience.test.ts +0 -246
  235. package/src/__tests__/result.test.ts +0 -155
  236. package/src/__tests__/serialization.test.ts +0 -401
  237. package/src/__tests__/topo.test.ts +0 -181
  238. package/src/__tests__/trail.test.ts +0 -217
  239. package/src/__tests__/validate-topo.test.ts +0 -278
  240. package/src/__tests__/validation.test.ts +0 -283
  241. package/src/__tests__/workspace.test.ts +0 -183
  242. package/src/adapters.ts +0 -68
  243. package/src/event.ts +0 -77
  244. package/src/health.ts +0 -23
  245. package/src/job.ts +0 -20
  246. package/tsconfig.json +0 -9
  247. package/tsconfig.tsbuildinfo +0 -1
package/dist/errors.d.ts DELETED
@@ -1,83 +0,0 @@
1
- /**
2
- * Error taxonomy for @ontrails/core
3
- *
4
- * Provides a structured error hierarchy with category-based mapping
5
- * to exit codes, HTTP status codes, and JSON-RPC error codes.
6
- */
7
- export type ErrorCategory = 'validation' | 'not_found' | 'conflict' | 'permission' | 'timeout' | 'rate_limit' | 'network' | 'internal' | 'auth' | 'cancelled';
8
- export declare abstract class TrailsError extends Error {
9
- abstract readonly category: ErrorCategory;
10
- abstract readonly retryable: boolean;
11
- readonly context?: Record<string, unknown> | undefined;
12
- constructor(message: string, options?: {
13
- cause?: Error;
14
- context?: Record<string, unknown>;
15
- });
16
- }
17
- export declare class ValidationError extends TrailsError {
18
- readonly category: "validation";
19
- readonly retryable: false;
20
- }
21
- export declare class AmbiguousError extends TrailsError {
22
- readonly category: "validation";
23
- readonly retryable: false;
24
- }
25
- export declare class AssertionError extends TrailsError {
26
- readonly category: "internal";
27
- readonly retryable: false;
28
- }
29
- export declare class NotFoundError extends TrailsError {
30
- readonly category: "not_found";
31
- readonly retryable: false;
32
- }
33
- export declare class AlreadyExistsError extends TrailsError {
34
- readonly category: "conflict";
35
- readonly retryable: false;
36
- }
37
- export declare class ConflictError extends TrailsError {
38
- readonly category: "conflict";
39
- readonly retryable: false;
40
- }
41
- export declare class PermissionError extends TrailsError {
42
- readonly category: "permission";
43
- readonly retryable: false;
44
- }
45
- export declare class TimeoutError extends TrailsError {
46
- readonly category: "timeout";
47
- readonly retryable: true;
48
- }
49
- export declare class RateLimitError extends TrailsError {
50
- readonly category: "rate_limit";
51
- readonly retryable: true;
52
- readonly retryAfter?: number | undefined;
53
- constructor(message: string, options?: {
54
- cause?: Error;
55
- context?: Record<string, unknown>;
56
- retryAfter?: number;
57
- });
58
- }
59
- export declare class NetworkError extends TrailsError {
60
- readonly category: "network";
61
- readonly retryable: true;
62
- }
63
- export declare class InternalError extends TrailsError {
64
- readonly category: "internal";
65
- readonly retryable: false;
66
- }
67
- export declare class AuthError extends TrailsError {
68
- readonly category: "auth";
69
- readonly retryable: false;
70
- }
71
- export declare class CancelledError extends TrailsError {
72
- readonly category: "cancelled";
73
- readonly retryable: false;
74
- }
75
- export declare const exitCodeMap: Record<ErrorCategory, number>;
76
- export declare const statusCodeMap: Record<ErrorCategory, number>;
77
- export declare const jsonRpcCodeMap: Record<ErrorCategory, number>;
78
- export declare const retryableMap: Record<ErrorCategory, boolean>;
79
- /** Type guard: narrows unknown to TrailsError */
80
- export declare const isTrailsError: (error?: unknown) => error is TrailsError;
81
- /** Returns true if the error is retryable (TrailsError with retryable category). */
82
- export declare const isRetryable: (error: Error) => boolean;
83
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAMH,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,WAAW,GACX,UAAU,GACV,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,SAAS,GACT,UAAU,GACV,MAAM,GACN,WAAW,CAAC;AAMhB,8BAAsB,WAAY,SAAQ,KAAK;IAC7C,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,OAA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AMX,iDAAiD;AACjD,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,KAAG,KAAK,IAAI,WAC3B,CAAC;AAE/B,oFAAoF;AACpF,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,KAAG,OAK1C,CAAC"}
package/dist/errors.js DELETED
@@ -1,142 +0,0 @@
1
- /* oxlint-disable max-classes-per-file -- error taxonomy requires co-located class definitions */
2
- /**
3
- * Error taxonomy for @ontrails/core
4
- *
5
- * Provides a structured error hierarchy with category-based mapping
6
- * to exit codes, HTTP status codes, and JSON-RPC error codes.
7
- */
8
- // ---------------------------------------------------------------------------
9
- // Base class
10
- // ---------------------------------------------------------------------------
11
- export class TrailsError extends Error {
12
- context;
13
- constructor(message, options) {
14
- super(message, { cause: options?.cause });
15
- this.name = this.constructor.name;
16
- this.context = options?.context;
17
- }
18
- }
19
- // ---------------------------------------------------------------------------
20
- // Concrete error classes
21
- // ---------------------------------------------------------------------------
22
- export class ValidationError extends TrailsError {
23
- category = 'validation';
24
- retryable = false;
25
- }
26
- export class AmbiguousError extends TrailsError {
27
- category = 'validation';
28
- retryable = false;
29
- }
30
- export class AssertionError extends TrailsError {
31
- category = 'internal';
32
- retryable = false;
33
- }
34
- export class NotFoundError extends TrailsError {
35
- category = 'not_found';
36
- retryable = false;
37
- }
38
- export class AlreadyExistsError extends TrailsError {
39
- category = 'conflict';
40
- retryable = false;
41
- }
42
- export class ConflictError extends TrailsError {
43
- category = 'conflict';
44
- retryable = false;
45
- }
46
- export class PermissionError extends TrailsError {
47
- category = 'permission';
48
- retryable = false;
49
- }
50
- export class TimeoutError extends TrailsError {
51
- category = 'timeout';
52
- retryable = true;
53
- }
54
- export class RateLimitError extends TrailsError {
55
- category = 'rate_limit';
56
- retryable = true;
57
- retryAfter;
58
- constructor(message, options) {
59
- super(message, options);
60
- this.retryAfter = options?.retryAfter;
61
- }
62
- }
63
- export class NetworkError extends TrailsError {
64
- category = 'network';
65
- retryable = true;
66
- }
67
- export class InternalError extends TrailsError {
68
- category = 'internal';
69
- retryable = false;
70
- }
71
- export class AuthError extends TrailsError {
72
- category = 'auth';
73
- retryable = false;
74
- }
75
- export class CancelledError extends TrailsError {
76
- category = 'cancelled';
77
- retryable = false;
78
- }
79
- // ---------------------------------------------------------------------------
80
- // Taxonomy maps
81
- // ---------------------------------------------------------------------------
82
- export const exitCodeMap = {
83
- auth: 9,
84
- cancelled: 130,
85
- conflict: 3,
86
- internal: 8,
87
- network: 7,
88
- not_found: 2,
89
- permission: 4,
90
- rate_limit: 6,
91
- timeout: 5,
92
- validation: 1,
93
- };
94
- export const statusCodeMap = {
95
- auth: 401,
96
- cancelled: 499,
97
- conflict: 409,
98
- internal: 500,
99
- network: 502,
100
- not_found: 404,
101
- permission: 403,
102
- rate_limit: 429,
103
- timeout: 504,
104
- validation: 400,
105
- };
106
- export const jsonRpcCodeMap = {
107
- auth: -32_600,
108
- cancelled: -32_603,
109
- conflict: -32_603,
110
- internal: -32_603,
111
- network: -32_603,
112
- not_found: -32_601,
113
- permission: -32_600,
114
- rate_limit: -32_603,
115
- timeout: -32_603,
116
- validation: -32_602,
117
- };
118
- export const retryableMap = {
119
- auth: false,
120
- cancelled: false,
121
- conflict: false,
122
- internal: false,
123
- network: true,
124
- not_found: false,
125
- permission: false,
126
- rate_limit: true,
127
- timeout: true,
128
- validation: false,
129
- };
130
- // ---------------------------------------------------------------------------
131
- // Helper functions
132
- // ---------------------------------------------------------------------------
133
- /** Type guard: narrows unknown to TrailsError */
134
- export const isTrailsError = (error) => error instanceof TrailsError;
135
- /** Returns true if the error is retryable (TrailsError with retryable category). */
136
- export const isRetryable = (error) => {
137
- if (isTrailsError(error)) {
138
- return retryableMap[error.category];
139
- }
140
- return false;
141
- };
142
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG;;;;;GAKG;AAkBH,8EAA8E;AAC9E,aAA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ACf,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,GAAG;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAkC;IAC3D,IAAI,EAAE,CAAC,MAAM;IACb,SAAS,EAAE,CAAC,MAAM;IAClB,QAAQ,EAAE,CAAC,MAAM;IACjB,QAAQ,EAAE,CAAC,MAAM;IACjB,OAAO,EAAE,CAAC,MAAM;IAChB,SAAS,EAAE,CAAC,MAAM;IAClB,UAAU,EAAE,CAAC,MAAM;IACnB,UAAU,EAAE,CAAC,MAAM;IACnB,OAAO,EAAE,CAAC,MAAM;IAChB,UAAU,EAAE,CAAC,MAAM;CACX,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAmC;IAC1D,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,KAAK;CACT,CAAC;AAEX,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAe,EAAwB,EAAE,CACrE,KAAK,YAAY,WAAW,CAAC;AAE/B,oFAAoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAY,EAAW,EAAE;IACnD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
package/dist/event.d.ts DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * Event — a named payload schema with optional provenance metadata.
3
- */
4
- import type { z } from 'zod';
5
- export interface EventSpec<T> {
6
- readonly payload: z.ZodType<T>;
7
- readonly description?: string | undefined;
8
- readonly metadata?: Readonly<Record<string, unknown>> | undefined;
9
- /** Trail IDs that produce this event (e.g. the trails it originates from). */
10
- readonly from?: readonly string[] | undefined;
11
- }
12
- export interface Event<T> {
13
- readonly id: string;
14
- readonly kind: 'event';
15
- readonly payload: z.ZodType<T>;
16
- readonly description?: string | undefined;
17
- readonly metadata?: Readonly<Record<string, unknown>> | undefined;
18
- /** Trail IDs that produce this event (e.g. the trails it originates from). */
19
- readonly from?: readonly string[] | undefined;
20
- }
21
- /**
22
- * Create an event definition.
23
- *
24
- * An event is a named payload schema describing something that happened.
25
- * Returns a frozen object with `kind: "event"` and all spec fields.
26
- *
27
- * @example
28
- * ```typescript
29
- * // ID as first argument
30
- * const updated = event("entity.updated", {
31
- * payload: EntityUpdatedSchema,
32
- * from: ["entity.add", "entity.update"],
33
- * });
34
- *
35
- * // Full spec object (programmatic)
36
- * const updated = event({ id: "entity.updated", payload: ..., from: [...] });
37
- * ```
38
- */
39
- export declare function event<T>(id: string, spec: EventSpec<T>): Event<T>;
40
- export declare function event<T>(spec: EventSpec<T> & {
41
- readonly id: string;
42
- }): Event<T>;
43
- /** Existential type for heterogeneous event collections */
44
- export type AnyEvent = Event<unknown>;
45
- //# sourceMappingURL=event.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAClE,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC/C;AAMD,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAClE,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC/C;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACnE,wBAAgB,KAAK,CAAC,CAAC,EACrB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC3C,KAAK,CAAC,CAAC,CAAC,CAAC;AAkBZ,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC"}
package/dist/event.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Event — a named payload schema with optional provenance metadata.
3
- */
4
- export function event(idOrSpec, maybeSpec) {
5
- const resolvedId = typeof idOrSpec === 'string' ? idOrSpec : idOrSpec.id;
6
- // oxlint-disable-next-line no-non-null-assertion -- overload guarantees maybeSpec when idOrSpec is string
7
- const resolvedSpec = typeof idOrSpec === 'string' ? maybeSpec : idOrSpec;
8
- return Object.freeze({
9
- description: resolvedSpec.description,
10
- from: resolvedSpec.from ? Object.freeze([...resolvedSpec.from]) : undefined,
11
- id: resolvedId,
12
- kind: 'event',
13
- metadata: resolvedSpec.metadata,
14
- payload: resolvedSpec.payload,
15
- });
16
- }
17
- //# sourceMappingURL=event.js.map
package/dist/event.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwDH,MAAM,UAAU,KAAK,CACnB,QAA2D,EAC3D,SAAwB;IAExB,MAAM,UAAU,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;IACzE,0GAA0G;IAC1G,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1E,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,OAAgB;QACtB,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,OAAO,EAAE,YAAY,CAAC,OAAO;KAC9B,CAAC,CAAC;AACL,CAAC"}
package/dist/fetch.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Fetch utilities for @ontrails/core
3
- *
4
- * Wraps the standard fetch API, mapping errors and HTTP status codes
5
- * to the TrailsError taxonomy.
6
- */
7
- import { Result } from './result.js';
8
- /**
9
- * Wrap a fetch call in a Result, mapping failures to TrailsError subclasses.
10
- *
11
- * Network errors become NetworkError. Abort signals become CancelledError.
12
- * HTTP error status codes map to the appropriate error category.
13
- */
14
- export declare const fromFetch: (input: string | URL | Request, init?: RequestInit) => Promise<Result<Response, Error>>;
15
- //# sourceMappingURL=fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA+FrC;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,OAAO,MAAM,GAAG,GAAG,GAAG,OAAO,EAC7B,OAAO,WAAW,KACjB,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAcjC,CAAC"}
package/dist/fetch.js DELETED
@@ -1,102 +0,0 @@
1
- /**
2
- * Fetch utilities for @ontrails/core
3
- *
4
- * Wraps the standard fetch API, mapping errors and HTTP status codes
5
- * to the TrailsError taxonomy.
6
- */
7
- import { AuthError, CancelledError, ConflictError, InternalError, NetworkError, NotFoundError, PermissionError, RateLimitError, TimeoutError, ValidationError, } from './errors.js';
8
- import { Result } from './result.js';
9
- // ---------------------------------------------------------------------------
10
- // Internal helpers (defined before usage)
11
- // ---------------------------------------------------------------------------
12
- const toError = (err) => err instanceof Error ? err : new Error(String(err));
13
- const parseRetryAfter = (header) => {
14
- if (!header) {
15
- return undefined;
16
- }
17
- const seconds = Number(header);
18
- if (Number.isFinite(seconds) && seconds > 0) {
19
- return seconds;
20
- }
21
- // Try parsing as HTTP-date
22
- const date = Date.parse(header);
23
- if (!Number.isNaN(date)) {
24
- const delta = Math.ceil((date - Date.now()) / 1000);
25
- return delta > 0 ? delta : undefined;
26
- }
27
- return undefined;
28
- };
29
- const mapFetchError = (err) => {
30
- if (err instanceof DOMException && err.name === 'AbortError') {
31
- return new CancelledError('Request was aborted', { cause: toError(err) });
32
- }
33
- // TypeError is thrown for network failures in the fetch spec
34
- if (err instanceof TypeError) {
35
- return new NetworkError('Network request failed', { cause: err });
36
- }
37
- return new NetworkError('Network request failed', {
38
- cause: toError(err),
39
- });
40
- };
41
- const statusMappers = {
42
- 401: (ctx) => new AuthError('Unauthorized', { context: ctx }),
43
- 403: (ctx) => new PermissionError('Forbidden', { context: ctx }),
44
- 404: (ctx) => new NotFoundError('Not found', { context: ctx }),
45
- 429: (ctx, response) => {
46
- const retryAfter = parseRetryAfter(response.headers.get('retry-after'));
47
- const opts = {
48
- context: ctx,
49
- };
50
- if (retryAfter !== undefined) {
51
- opts.retryAfter = retryAfter;
52
- }
53
- return new RateLimitError('Rate limited', opts);
54
- },
55
- 500: (ctx) => new InternalError('Internal server error', { context: ctx }),
56
- 502: (ctx) => new NetworkError('Bad gateway', { context: ctx }),
57
- 504: (ctx) => new TimeoutError('Gateway timeout', { context: ctx }),
58
- };
59
- /** Map 4xx status codes not in the explicit mapper to appropriate error types. */
60
- const mapClientError = (status, context) => {
61
- if (status === 400 || status === 422) {
62
- return new ValidationError(`Validation error (${status})`, { context });
63
- }
64
- if (status === 409) {
65
- return new ConflictError(`Conflict (${status})`, { context });
66
- }
67
- return new InternalError(`HTTP error (${status})`, { context });
68
- };
69
- const mapStatusCode = (response) => {
70
- const context = { status: response.status, url: response.url };
71
- const mapper = statusMappers[response.status];
72
- if (mapper) {
73
- return mapper(context, response);
74
- }
75
- if (response.status >= 500) {
76
- return new InternalError(`Server error (${response.status})`, { context });
77
- }
78
- return mapClientError(response.status, context);
79
- };
80
- // ---------------------------------------------------------------------------
81
- // fromFetch
82
- // ---------------------------------------------------------------------------
83
- /**
84
- * Wrap a fetch call in a Result, mapping failures to TrailsError subclasses.
85
- *
86
- * Network errors become NetworkError. Abort signals become CancelledError.
87
- * HTTP error status codes map to the appropriate error category.
88
- */
89
- export const fromFetch = async (input, init) => {
90
- let response;
91
- try {
92
- response = await fetch(input, init);
93
- }
94
- catch (error) {
95
- return Result.err(mapFetchError(error));
96
- }
97
- if (response.ok) {
98
- return Result.ok(response);
99
- }
100
- return Result.err(mapStatusCode(response));
101
- };
102
- //# sour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,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QAC3B,OAAO,IAAI,aAAa,CAAC,iBAAiB,QAAQ,CAAC,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,cAAc,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,KAA6B,EAC7B,IAAkB,EACgB,EAAE;IACpC,IAAI,QAAkB,CAAC;IAEvB,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC7C,CAAC,CAAC"}
package/dist/guards.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Type guards and assertion helpers for @ontrails/core.
3
- */
4
- /** Narrows `T | null | undefined` to `T`. */
5
- export declare const isDefined: <T>(value?: T | null | undefined) => value is T;
6
- /** Returns true when `value` is a string with length > 0. */
7
- export declare const isNonEmptyString: (value?: unknown) => value is string;
8
- /** Returns true when `value` is a plain object (not an array, Date, etc.). */
9
- export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
10
- /** Checks that `obj` is an object with the given key present. */
11
- export declare const hasProperty: <K extends string>(obj: unknown, key: K) => obj is Record<K, unknown>;
12
- /**
13
- * Exhaustive switch helper. Place in the `default` branch to get a compile
14
- * error when a union case is unhandled.
15
- */
16
- export declare const assertNever: (value: never) => never;
17
- //# sourceMappingURL=guards.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6CAA6C;AAC7C,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,KAAK,IAAI,CAC9B,CAAC;AAExC,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,KAAG,KAAK,IAAI,MACb,CAAC;AAEhD,8EAA8E;AAC9E,eAAO,MAAM,aAAa,GACxB,OAAO,OAAO,KACb,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAMjC,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EAC1C,KAAK,OAAO,EACZ,KAAK,CAAC,KACL,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,OAAO,CAC4B,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,KAAG,KAE1C,CAAC"}
package/dist/guards.js DELETED
@@ -1,25 +0,0 @@
1
- /**
2
- * Type guards and assertion helpers for @ontrails/core.
3
- */
4
- /** Narrows `T | null | undefined` to `T`. */
5
- export const isDefined = (value) => value !== null && value !== undefined;
6
- /** Returns true when `value` is a string with length > 0. */
7
- export const isNonEmptyString = (value) => typeof value === 'string' && value.length > 0;
8
- /** Returns true when `value` is a plain object (not an array, Date, etc.). */
9
- export const isPlainObject = (value) => {
10
- if (typeof value !== 'object' || value === null) {
11
- return false;
12
- }
13
- const proto = Object.getPrototypeOf(value);
14
- return proto === Object.prototype || proto === null;
15
- };
16
- /** Checks that `obj` is an object with the given key present. */
17
- export const hasProperty = (obj, key) => typeof obj === 'object' && obj !== null && key in obj;
18
- /**
19
- * Exhaustive switch helper. Place in the `default` branch to get a compile
20
- * error when a union case is unhandled.
21
- */
22
- export const assertNever = (value) => {
23
- throw new Error(`Unexpected value: ${String(value)}`);
24
- };
25
- //# sourceMappingURL=guards.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,KAA4B,EAAc,EAAE,CACvE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAExC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAe,EAAmB,EAAE,CACnE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAEhD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,KAAc,EACoB,EAAE;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAY,CAAC;IACtD,OAAO,KAAK,KAAK,MAAM,CAAC,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AACtD,CAAC,CAAC;AAEF,iEAAiE;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAY,EACZ,GAAM,EACqB,EAAE,CAC7B,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAY,EAAS,EAAE;IACjD,MAAM,IAAI,KAAK,CAAC,qBAAqB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC"}
package/dist/health.d.ts DELETED
@@ -1,18 +0,0 @@
1
- /** Aggregate health status */
2
- export type HealthStatus = 'healthy' | 'degraded' | 'unhealthy';
3
- /** Individual component check result */
4
- export interface HealthCheck {
5
- readonly status: HealthStatus;
6
- readonly message?: string | undefined;
7
- /** Latency in milliseconds */
8
- readonly latency?: number | undefined;
9
- }
10
- /** Full health report returned by a health endpoint */
11
- export interface HealthResult {
12
- readonly status: HealthStatus;
13
- readonly checks: Readonly<Record<string, HealthCheck>>;
14
- readonly version?: string | undefined;
15
- /** Uptime in seconds */
16
- readonly uptime?: number | undefined;
17
- }
18
- //# sourceMappingURL=health.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAIA,8BAA8B;AAC9B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AAEhE,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,8BAA8B;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,wBAAwB;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC"}
package/dist/health.js DELETED
@@ -1,5 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- // Health check types
3
- // ---------------------------------------------------------------------------
4
- export {};
5
- //# sourceMappingURL=health.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.js","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E"}
package/dist/index.d.ts DELETED
@@ -1,34 +0,0 @@
1
- export { Result } from './result.js';
2
- export { TrailsError, ValidationError, AmbiguousError, AssertionError, NotFoundError, AlreadyExistsError, ConflictError, PermissionError, TimeoutError, RateLimitError, NetworkError, InternalError, AuthError, CancelledError, exitCodeMap, statusCodeMap, jsonRpcCodeMap, retryableMap, isRetryable, isTrailsError, } from './errors.js';
3
- export type { ErrorCategory } from './errors.js';
4
- export type { Implementation, TrailContext, FollowFn, ProgressCallback, ProgressEvent, Logger, Surface, } from './types.js';
5
- export { createTrailContext } from './context.js';
6
- export { trail } from './trail.js';
7
- export type { AnyTrail, Intent, Trail, TrailSpec, TrailExample, } from './trail.js';
8
- export { event } from './event.js';
9
- export type { AnyEvent, Event, EventSpec } from './event.js';
10
- export { topo } from './topo.js';
11
- export type { Topo } from './topo.js';
12
- export { validateTopo } from './validate-topo.js';
13
- export type { TopoIssue } from './validate-topo.js';
14
- export { composeLayers } from './layer.js';
15
- export type { Layer } from './layer.js';
16
- export type { HealthStatus, HealthResult } from './health.js';
17
- export type { IndexAdapter, StorageAdapter, CacheAdapter, SearchOptions, SearchResult, StorageOptions, } from './adapters.js';
18
- export { deriveFields } from './derive.js';
19
- export type { Field, FieldOverride } from './derive.js';
20
- export { validateInput, validateOutput, formatZodIssues, zodToJsonSchema, } from './validation.js';
21
- export { serializeError, deserializeError } from './serialization.js';
22
- export type { SerializedError } from './serialization.js';
23
- export { retry, withTimeout, shouldRetry, getBackoffDelay, } from './resilience.js';
24
- export type { RetryOptions } from './resilience.js';
25
- export { brand, unbrand, uuid, email, nonEmptyString, positiveInt, shortId, hashId, } from './branded.js';
26
- export type { Branded, UUID, Email, NonEmptyString, PositiveInt, } from './branded.js';
27
- export { securePath, isPathSafe, resolveSafePath } from './path-security.js';
28
- export { findWorkspaceRoot, isInsideWorkspace, getRelativePath, } from './workspace.js';
29
- export { createBlobRef, isBlobRef } from './blob-ref.js';
30
- export type { BlobRef } from './blob-ref.js';
31
- export { isDefined, isNonEmptyString, isPlainObject, hasProperty, assertNever, } from './guards.js';
32
- export { chunk, dedupe, groupBy, sortBy, isNonEmptyArray, } from './collections.js';
33
- export type { NonEmptyArray, DeepPartial, Prettify, AtLeastOne, } from './collections.js';
34
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACT,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,IAAI,EAAE,M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AS,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,GACX,MAAM,kBAAkB,CAAC"}
package/dist/index.js DELETED
@@ -1,38 +0,0 @@
1
- // Result
2
- export { Result } from './result.js';
3
- // Errors
4
- export { TrailsError, ValidationError, AmbiguousError, AssertionError, NotFoundError, AlreadyExistsError, ConflictError, PermissionError, TimeoutError, RateLimitError, NetworkError, InternalError, AuthError, CancelledError, exitCodeMap, statusCodeMap, jsonRpcCodeMap, retryableMap, isRetryable, isTrailsError, } from './errors.js';
5
- // Context factory
6
- export { createTrailContext } from './context.js';
7
- // Trail
8
- export { trail } from './trail.js';
9
- // Event
10
- export { event } from './event.js';
11
- // Topo
12
- export { topo } from './topo.js';
13
- // Topo validation
14
- export { validateTopo } from './validate-topo.js';
15
- // Layer
16
- export { composeLayers } from './layer.js';
17
- // Derive
18
- export { deriveFields } from './derive.js';
19
- // Validation
20
- export { validateInput, validateOutput, formatZodIssues, zodToJsonSchema, } from './validation.js';
21
- // Serialization
22
- export { serializeError, deserializeError } from './serialization.js';
23
- // Resilience
24
- export { retry, withTimeout, shouldRetry, getBackoffDelay, } from './resilience.js';
25
- // Fetch — fromFetch is available as Result.fromFetch()
26
- // Branded types
27
- export { brand, unbrand, uuid, email, nonEmptyString, positiveInt, shortId, hashId, } from './branded.js';
28
- // Path Security
29
- export { securePath, isPathSafe, resolveSafePath } from './path-security.js';
30
- // Workspace
31
- export { findWorkspaceRoot, isInsideWorkspace, getRelativePath, } from './workspace.js';
32
- // Blob
33
- export { createBlobRef, isBlobRef } from './blob-ref.js';
34
- // Guards
35
- export { isDefined, isNonEmptyString, isPlainObject, hasProperty, assertNever, } from './guards.js';
36
- // Collections
37
- export { chunk, dedupe, groupBy, sortBy, isNonEmptyArray, } from './collections.js';
38
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,SAAS;AACT,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AAcrB,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AASnC,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,QAAQ;AACR,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAgB3C,SAAS;AACT,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,aAAa;AACb,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,gBAAgB;AAChB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtE,aAAa;AACb,OAAO,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,uDAAuD;AAEvD,gBAAgB;AAChB,OAAO,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,cAAc,EACd,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,cAAc,CAAC;AAStB,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,YAAY;AACZ,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO;AACP,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGzD,SAAS;AACT,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,cAAc;AACd,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
package/dist/job.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Proof: job-style output schema composes from existing pattern helpers.
4
- * No dedicated `kind: "job"` needed — regular trails with status+progress output work.
5
- */
6
- export declare const jobOutputSchema: z.ZodObject<{
7
- completedAt: z.ZodOptional<z.ZodString>;
8
- error: z.ZodOptional<z.ZodString>;
9
- jobId: z.ZodString;
10
- result: z.ZodOptional<z.ZodUnknown>;
11
- startedAt: z.ZodOptional<z.ZodString>;
12
- status: z.ZodEnum<{
13
- cancelled: "cancelled";
14
- pending: "pending";
15
- running: "running";
16
- completed: "completed";
17
- failed: "failed";
18
- }>;
19
- current: z.ZodNumber;
20
- percentage: z.ZodOptional<z.ZodNumber>;
21
- total: z.ZodNumber;
22
- }, z.core.$strip>;
23
- export type JobOutput = z.infer<typeof jobOutputSchema>;
24
- //# sourceMappingURL=job.d.ts.map