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

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 +412 -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/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // Result
2
- export { Result } from './result.js';
2
+ export { Result, resultAccessorNames } from './result.js';
3
+ export type { ResultAccessorName } from './result.js';
3
4
 
4
5
  // Errors
5
6
  export {
@@ -8,80 +9,598 @@ export {
8
9
  AmbiguousError,
9
10
  AssertionError,
10
11
  NotFoundError,
12
+ VersionNotSupportedError,
11
13
  AlreadyExistsError,
12
14
  ConflictError,
13
15
  PermissionError,
16
+ PermitError,
14
17
  TimeoutError,
15
18
  RateLimitError,
16
19
  NetworkError,
20
+ WorkspaceShiftError,
17
21
  InternalError,
18
22
  AuthError,
19
23
  CancelledError,
24
+ DerivationError,
25
+ RecoverableCompletionError,
26
+ codesByCategory,
27
+ errorClasses,
28
+ errorCategories,
20
29
  exitCodeMap,
21
30
  statusCodeMap,
22
31
  jsonRpcCodeMap,
23
32
  retryableMap,
33
+ RetryExhaustedError,
24
34
  isRetryable,
25
35
  isTrailsError,
26
36
  } from './errors.js';
27
- export type { ErrorCategory } from './errors.js';
37
+ export type {
38
+ DynamicErrorClassRegistryEntry,
39
+ ErrorCategory,
40
+ ErrorCategoryCodes,
41
+ ErrorClassConstructor,
42
+ ErrorClassRegistryEntry,
43
+ FixedErrorClassRegistryEntry,
44
+ } from './errors.js';
45
+ export {
46
+ createSurfaceErrorMapper,
47
+ mapSurfaceError,
48
+ projectErrorClassSurface,
49
+ projectPublicSurfaceError,
50
+ projectSurfaceError,
51
+ surfaceErrorMap,
52
+ surfaceErrorRegistry,
53
+ surfaceNames,
54
+ } from './transport-error-map.js';
55
+ export type {
56
+ ErrorClassSurfaceProjection,
57
+ SurfaceErrorCode,
58
+ SurfaceErrorMapper,
59
+ SurfaceErrorMappings,
60
+ SurfaceErrorProjection,
61
+ SurfaceName,
62
+ } from './transport-error-map.js';
63
+ export {
64
+ INTERNAL_ERROR_PUBLIC_MESSAGE,
65
+ projectErrorDiagnostics,
66
+ redactErrorContext,
67
+ redactErrorStack,
68
+ redactErrorString,
69
+ } from './error-projection.js';
70
+ export type { ErrorDiagnosticsProjection } from './error-projection.js';
71
+ export type {
72
+ DiagnosticBase,
73
+ DiagnosticSeverity,
74
+ RuleDiagnosticBase,
75
+ } from './diagnostics.js';
28
76
 
29
77
  // Types
30
78
  export type {
79
+ Detour,
80
+ DetourAttempt,
31
81
  Implementation,
32
82
  TrailContext,
33
- FollowFn,
83
+ TrailContextInit,
84
+ ComposeBatchOptions,
85
+ ComposeOptions,
86
+ ComposeFn,
87
+ FireFn,
88
+ LogLevel,
89
+ LogFormatter,
90
+ LogRecord,
91
+ LogSink,
92
+ PermitRequirement,
34
93
  ProgressCallback,
35
94
  ProgressEvent,
36
95
  Logger,
37
- Surface,
96
+ ResourceLookup,
97
+ } from './types.js';
98
+ export { basePermitSchema } from './permits.js';
99
+ export type { BasePermit } from './permits.js';
100
+ export {
101
+ LAYER_INPUTS_KEY,
102
+ SURFACE_KEY,
103
+ SURFACE_LAYER_NAMES_KEY,
38
104
  } from './types.js';
105
+ export {
106
+ ACTIVATION_PROVENANCE_KEY,
107
+ buildActivationProvenanceTraceAttrs,
108
+ getActivationProvenance,
109
+ withActivationProvenance,
110
+ } from './activation-provenance.js';
111
+ export type {
112
+ ActivationProvenance,
113
+ ActivationProvenanceCarrier,
114
+ ActivationProvenanceSource,
115
+ } from './activation-provenance.js';
39
116
 
40
117
  // Context factory
41
- export { createTrailContext } from './context.js';
118
+ export { createTrailContext, passthroughTrace } from './context.js';
119
+
120
+ // Glob and path scope
121
+ export {
122
+ escapeRegExp,
123
+ globToRegExp,
124
+ matchesAnyGlob,
125
+ matchesGlob,
126
+ } from './glob.js';
127
+ export type { GlobConfig } from './glob.js';
128
+ export {
129
+ includedByPathScope,
130
+ matchesAnyPathGlob,
131
+ matchesPathGlob,
132
+ normalizePathScopePath,
133
+ pathScopeSchema,
134
+ } from './path-scope.js';
135
+ export type { PathGlob, PathScope, ScanTargets } from './path-scope.js';
136
+ export { matchesAnyTrailIdGlob, matchesTrailIdGlob } from './trail-id-glob.js';
137
+ export type { TrailIdGlob } from './trail-id-glob.js';
138
+
139
+ // Resource
140
+ export {
141
+ createResourceLookup,
142
+ findDuplicateResourceId,
143
+ isResource,
144
+ resource,
145
+ } from './resource.js';
146
+ export {
147
+ createResources,
148
+ drainResources,
149
+ resolveResourceConfig,
150
+ } from './resource-config.js';
151
+ export type {
152
+ ResolvedResourceScope,
153
+ ResourceConfigValues,
154
+ ResourceDrainReport,
155
+ } from './resource-config.js';
156
+ export type {
157
+ AnyResource,
158
+ Resource,
159
+ ResourceContext,
160
+ ResourceOverrideMap,
161
+ ResourceSpec,
162
+ ResourceUnmockable,
163
+ } from './resource.js';
42
164
 
43
165
  // Trail
44
- export { trail } from './trail.js';
166
+ export {
167
+ activationSourceKinds,
168
+ getActivationWherePredicate,
169
+ isActivationEntrySpec,
170
+ isActivationSource,
171
+ isKnownActivationSourceKind,
172
+ } from './activation-source.js';
173
+ export type {
174
+ ActivationEntry,
175
+ ActivationEntrySpec,
176
+ ActivationSource,
177
+ ActivationSourceKind,
178
+ ActivationSourceMeta,
179
+ ActivationSourceRef,
180
+ ActivationWhere,
181
+ ActivationWhereExample,
182
+ ActivationWherePredicate,
183
+ ActivationWhereSpec,
184
+ BuiltinActivationSourceKind,
185
+ } from './activation-source.js';
186
+ export {
187
+ activationSourceDeclarationSignature,
188
+ activationSourceKey,
189
+ projectActivationSourceDeclaration,
190
+ } from './activation-source-projection.js';
191
+ export type { ActivationSourceProjection } from './activation-source-projection.js';
192
+ export {
193
+ deriveSupportedTrailVersions,
194
+ forkVersion,
195
+ getTrailVersionEntryKind,
196
+ hasDeprecatedTrailVersionGuidance,
197
+ intentValues,
198
+ isArchivedTrailVersionEntry,
199
+ isDeprecatedTrailVersionEntry,
200
+ isLiveTrailVersionEntry,
201
+ trail,
202
+ } from './trail.js';
203
+ export {
204
+ TRAIL_VERSION_MARKER_LENGTH,
205
+ TRAIL_VERSION_MARKER_MIN_PREFIX_LENGTH,
206
+ assertTrailVersionMarker,
207
+ assertUniqueTrailVersionMarkers,
208
+ canonicalizeTrailVersionMarkerContent,
209
+ deriveCurrentTrailVersionMarker,
210
+ deriveCurrentTrailVersionMarkerContent,
211
+ deriveShortestUnambiguousTrailVersionMarkerPrefix,
212
+ deriveTrailVersionEntryMarker,
213
+ deriveTrailVersionEntryMarkerContent,
214
+ deriveTrailVersionMarker,
215
+ deriveTrailVersionMarkers,
216
+ normalizeTrailVersionMarkerPrefix,
217
+ resolveTrailVersionMarkerPrefix,
218
+ } from './version-marker.js';
219
+ export {
220
+ parseTrailIdVersionReference,
221
+ resolveTrailVersion,
222
+ } from './version-resolution.js';
45
223
  export type {
46
224
  AnyTrail,
225
+ ImplementationInput,
47
226
  Intent,
48
227
  Trail,
228
+ TrailVersionEntry,
229
+ TrailVersionEntryKind,
230
+ TrailVersionArchivedStatus,
231
+ TrailVersionDeprecatedStatus,
232
+ TrailVersionForkEntry,
233
+ TrailVersionForkSpec,
234
+ TrailVersionRevisionEntry,
235
+ TrailVersions,
236
+ TrailVersionStatus,
237
+ TrailVersionTranspose,
238
+ TrailVersionTransposeInput,
239
+ TrailVersionTransposeOutput,
49
240
  TrailSpec,
50
241
  TrailExample,
242
+ TrailExampleSignalAssertion,
243
+ TrailVisibility,
244
+ VersionContract,
245
+ VersionEntry,
51
246
  } from './trail.js';
247
+ export type {
248
+ TrailVersionMarkerBinding,
249
+ TrailVersionMarkerRecord,
250
+ TrailVersionMarkerResolution,
251
+ } from './version-marker.js';
252
+ export type {
253
+ ParsedTrailVersionReference,
254
+ ResolvedTrailVersion,
255
+ TrailVersionReference,
256
+ } from './version-resolution.js';
257
+ export {
258
+ filterSurfaceTrails,
259
+ matchesTrailPattern,
260
+ shouldIncludeTrailForSurface,
261
+ } from './surface-filter.js';
262
+ export type { SurfaceFilterOptions } from './surface-filter.js';
263
+ export { deriveSurfaceTrailVersionProjections } from './surface-versioning.js';
264
+ export type { SurfaceTrailVersionProjection } from './surface-versioning.js';
265
+ export {
266
+ shouldValidateSurfaceTopo,
267
+ validateSurfaceTopo,
268
+ withSurfaceLayerNames,
269
+ withSurfaceMarker,
270
+ } from './surface-derivation.js';
271
+ export type {
272
+ BaseSurfaceOptions,
273
+ SurfaceConfigValues,
274
+ SurfaceSelectionOptions,
275
+ SurfaceMarkedContext,
276
+ SurfaceValidationOptions,
277
+ } from './surface-derivation.js';
278
+ export {
279
+ deriveStructuredSignalExamples,
280
+ deriveStructuredTrailExamples,
281
+ } from './structured-examples.js';
282
+ export type {
283
+ StructuredSignalExample,
284
+ StructuredSignalExampleProvenance,
285
+ StructuredTrailExample,
286
+ StructuredTrailExampleKind,
287
+ StructuredTrailExampleProvenance,
288
+ StructuredTrailExampleSignalAssertion,
289
+ } from './structured-examples.js';
290
+
291
+ // Type utilities
292
+ export type {
293
+ ComposeInput,
294
+ TrailInput,
295
+ TrailOutput,
296
+ TrailResult,
297
+ } from './type-utils.js';
298
+ export { inputOf, outputOf } from './type-utils.js';
299
+
300
+ // Signal
301
+ export { signal } from './signal.js';
302
+ export type { AnySignal, Signal, SignalSpec } from './signal.js';
303
+ export { queue, validateQueueSource } from './queue.js';
304
+ export type { QueueSource, QueueSpec, QueueValidationIssue } from './queue.js';
305
+ export { schedule, validateScheduleSource } from './schedule.js';
306
+ export type {
307
+ ScheduleSource,
308
+ ScheduleSpec,
309
+ ScheduleValidationIssue,
310
+ } from './schedule.js';
311
+ export {
312
+ getWebhookHeader,
313
+ getWebhookHeaders,
314
+ matchWebhookPath,
315
+ parseWebhookPathParams,
316
+ validateWebhookSource,
317
+ verifyWebhookRequest,
318
+ webhook,
319
+ webhookMethods,
320
+ webhookPathPatternsOverlap,
321
+ } from './webhook.js';
322
+ export type {
323
+ WebhookMethod,
324
+ WebhookMethodInput,
325
+ WebhookSource,
326
+ WebhookSpec,
327
+ WebhookValidationIssue,
328
+ WebhookVerify,
329
+ WebhookVerifyHeaders,
330
+ WebhookVerifyRequest,
331
+ } from './webhook.js';
332
+ export { createScheduleRuntime } from './schedule-runtime.js';
333
+ export type {
334
+ ScheduleCronFactory,
335
+ ScheduleCronHandler,
336
+ ScheduleCronJob,
337
+ ScheduleRuntime,
338
+ ScheduleRuntimeLogger,
339
+ ScheduleRuntimeOptions,
340
+ ScheduleRuntimeRegistrationReport,
341
+ ScheduleRuntimeRunRecord,
342
+ ScheduleRuntimeRunStatus,
343
+ ScheduleRuntimeSkipReason,
344
+ ScheduleRuntimeStartReport,
345
+ ScheduleRuntimeState,
346
+ ScheduleRuntimeStopReport,
347
+ ScheduleRuntimeWarning,
348
+ ScheduleRuntimeWarningCode,
349
+ } from './schedule-runtime.js';
350
+ export {
351
+ SIGNAL_DIAGNOSTICS_SINK_KEY,
352
+ SIGNAL_DIAGNOSTICS_STRICT_MODE_KEY,
353
+ createSignalFireSuppressedDiagnostic,
354
+ createSignalHandlerFailedDiagnostic,
355
+ createSignalHandlerRejectedDiagnostic,
356
+ createSignalInvalidDiagnostic,
357
+ createSignalPredicateFailedDiagnostic,
358
+ createSignalUnknownDiagnostic,
359
+ recordSignalDiagnostic,
360
+ shouldPromoteSignalDiagnostic,
361
+ signalDiagnosticDefinitions,
362
+ summarizeSignalPayload,
363
+ } from './signal-diagnostics.js';
364
+ export type {
365
+ CreateSignalFireSuppressedDiagnosticInput,
366
+ CreateSignalHandlerDiagnosticInput,
367
+ CreateSignalInvalidDiagnosticInput,
368
+ SignalDiagnostic,
369
+ SignalDiagnosticCategory,
370
+ SignalDiagnosticCause,
371
+ SignalDiagnosticCode,
372
+ SignalDiagnosticCommonInput,
373
+ SignalDiagnosticContext,
374
+ SignalDiagnosticLevel,
375
+ SignalDiagnosticPathSegment,
376
+ SignalDiagnosticRecordResult,
377
+ SignalDiagnosticSchemaIssue,
378
+ SignalDiagnosticSink,
379
+ SignalDiagnosticOrigin,
380
+ SignalDiagnosticSourceLocation,
381
+ SignalDiagnosticStrictMode,
382
+ SignalFireSuppressedDiagnostic,
383
+ SignalHandlerFailedDiagnostic,
384
+ SignalHandlerRejectedDiagnostic,
385
+ SignalInvalidDiagnostic,
386
+ SignalPredicateFailedDiagnostic,
387
+ SignalPayloadShape,
388
+ SignalPayloadSummary,
389
+ SignalUnknownDiagnostic,
390
+ } from './signal-diagnostics.js';
391
+ export {
392
+ attachLateBoundSignalRef,
393
+ cloneSignalWithId,
394
+ createLateBoundSignalMarker,
395
+ getLateBoundSignalRef,
396
+ parseLateBoundSignalMarker,
397
+ } from './signal-ref.js';
398
+ export type {
399
+ LateBoundSignalMarker,
400
+ LateBoundSignalRef,
401
+ } from './signal-ref.js';
52
402
 
53
- // Event
54
- export { event } from './event.js';
55
- export type { AnyEvent, Event, EventSpec } from './event.js';
403
+ // Entity
404
+ export { entity } from './entity.js';
405
+ export {
406
+ ENTITY_ID_METADATA,
407
+ getEntityIdMetadata,
408
+ getEntityReferences,
409
+ } from './entity.js';
410
+ export type {
411
+ AnyEntity,
412
+ Entity,
413
+ EntityIdBrand,
414
+ EntityIdMetadata,
415
+ EntityIdSchema,
416
+ EntityIdValue,
417
+ EntityOptions,
418
+ EntityReference,
419
+ } from './entity.js';
56
420
 
57
421
  // Topo
58
422
  export { topo } from './topo.js';
59
- export type { Topo } from './topo.js';
423
+ export type { Topo, TopoIdentity } from './topo.js';
424
+
425
+ // Surface overlay
426
+ export {
427
+ SURFACES_OVERLAY_NAMESPACE,
428
+ classifySurfaceBinding,
429
+ deriveMcpTrailheadDescription,
430
+ expandCliSurfaceBindings,
431
+ expandMcpSurfaceBindings,
432
+ resolveSurfaceOverlayBindings,
433
+ surfaceBindingsFromLockOverlays,
434
+ surfaceOverlay,
435
+ surfaceOverlayBindingsSchema,
436
+ } from './surface-overlay.js';
437
+ export type {
438
+ CliSurfaceBindingAliases,
439
+ McpSurfaceBindingExpansion,
440
+ OverlayEnvelopeLike,
441
+ OverlayProvenance,
442
+ SurfaceBindingRef,
443
+ SurfaceBindingShape,
444
+ SurfaceBindingValue,
445
+ SurfaceBindings,
446
+ SurfaceOverlay,
447
+ SurfaceOverlayBindings,
448
+ } from './surface-overlay.js';
449
+
450
+ // Generic trails-db helpers (shared framework infrastructure per ADR-0014).
451
+ // The topo-store public API that previously lived here moved to
452
+ // `@ontrails/topography` per ADR-0042.
453
+ export {
454
+ deriveTrailsDbPath,
455
+ deriveTrailsDir,
456
+ deriveTrailsProjectKey,
457
+ deriveTrailsStateDir,
458
+ deriveTrailsStateHome,
459
+ ensureSubsystemSchema,
460
+ ensureTrailsWorkspace,
461
+ openReadTrailsDb,
462
+ openWriteTrailsDb,
463
+ WORKSPACE_GITIGNORE_CONTENT,
464
+ WORKSPACE_GITIGNORE_LINES,
465
+ } from './trails-db.js';
466
+ export type {
467
+ EnsureSubsystemSchemaOptions,
468
+ TrailsDbLocationOptions,
469
+ } from './trails-db.js';
470
+
471
+ // Draft state
472
+ export {
473
+ DRAFT_ID_PREFIX,
474
+ deriveDraftReport,
475
+ isDraftId,
476
+ validateDraftFreeTopo,
477
+ } from './draft.js';
478
+ export type {
479
+ DraftDependency,
480
+ DraftDependencyKind,
481
+ DraftDiagnostic,
482
+ DraftFinding,
483
+ DraftReport,
484
+ } from './draft.js';
60
485
 
61
486
  // Topo validation
62
- export { validateTopo } from './validate-topo.js';
63
- export type { TopoIssue } from './validate-topo.js';
487
+ export { getTopoDiagnostics, validateTopo } from './validate-topo.js';
488
+ export type {
489
+ TopoDiagnostic,
490
+ TopoDiagnosticCode,
491
+ TopoIssue,
492
+ TopoMissingReference,
493
+ TopoReferenceKind,
494
+ TopoReferenceOwnerKind,
495
+ } from './validate-topo.js';
496
+ export { validateEstablishedTopo } from './validate-established-topo.js';
64
497
 
65
498
  // Layer
66
499
  export { composeLayers } from './layer.js';
67
- export type { Layer } from './layer.js';
500
+ export type { Layer, LayerInputSchema } from './layer.js';
501
+ export {
502
+ collectAttachedTypedLayers,
503
+ LAYER_FIELD_RESERVED_NAMES,
504
+ LAYER_FIELD_RESERVED_NAMES_KEBAB,
505
+ projectLayerFieldName,
506
+ } from './layer-projection.js';
507
+ export type {
508
+ AttachedLayerScope,
509
+ AttachedTypedLayer,
510
+ LayerFieldProjection,
511
+ LayerFieldRenameReason,
512
+ ProjectedLayerField,
513
+ RenamedLayerFieldProjection,
514
+ } from './layer-projection.js';
515
+
516
+ // Derive
517
+ export {
518
+ deriveCliPath,
519
+ deriveFields,
520
+ deriveMcpToolName,
521
+ deriveTrailCliCommandProjection,
522
+ normalizeCliCommandPath,
523
+ } from './derive.js';
524
+ export type {
525
+ CliCommandAliasInput,
526
+ CliCommandPathInput,
527
+ CliCommandRoute,
528
+ CliCommandRouteKind,
529
+ CliCommandRouteSource,
530
+ DeriveTrailCliCommandProjectionOptions,
531
+ Field,
532
+ FieldOverride,
533
+ TrailCliCommandProjection,
534
+ TrailCliProjection,
535
+ } from './derive.js';
536
+
537
+ // Compose schema
538
+ export { buildComposeValidationSchema } from './compose-schema.js';
539
+ export {
540
+ claimNextComposeBatchIndex,
541
+ createComposeBatchValidationResults,
542
+ normalizeComposeBatchConcurrency,
543
+ } from './compose-batch.js';
68
544
 
69
- // Health
70
- export type { HealthStatus, HealthResult } from './health.js';
545
+ // Execute
546
+ export { DETOUR_MAX_ATTEMPTS_CAP } from './detours.js';
547
+ export { executeTrail } from './execute.js';
548
+ export type { ExecuteTrailOptions } from './execute.js';
71
549
 
72
- // Adapters
550
+ // Intrinsic tracing
551
+ export {
552
+ clearTraceSink,
553
+ createActivationTraceRecord,
554
+ createSignalTraceRecord,
555
+ createTraceRecord,
556
+ getTraceContext,
557
+ getTraceSink,
558
+ NOOP_SINK,
559
+ registerTraceSink,
560
+ TRACE_CONTEXT_KEY,
561
+ traceContextFromRecord,
562
+ writeActivationTraceRecord,
563
+ writeSignalTraceRecord,
564
+ } from './tracing.js';
73
565
  export type {
74
- IndexAdapter,
75
- StorageAdapter,
76
- CacheAdapter,
77
- SearchOptions,
78
- SearchResult,
79
- StorageOptions,
80
- } from './adapters.js';
566
+ ActivationTraceRecordName,
567
+ SignalTraceRecordName,
568
+ TraceContext,
569
+ TraceRecord,
570
+ TraceSink,
571
+ } from './tracing.js';
572
+ export type { TraceFn } from './types.js';
81
573
 
82
- // Derive
83
- export { deriveFields } from './derive.js';
84
- export type { Field, FieldOverride } from './derive.js';
574
+ // Observe
575
+ export {
576
+ createObserveLogger,
577
+ isLogSink,
578
+ isLogger,
579
+ isObserveInput,
580
+ isTraceSink,
581
+ normalizeObserve,
582
+ } from './observe.js';
583
+ export type {
584
+ ObserveCapabilities,
585
+ ObserveConfig,
586
+ ObserveInput,
587
+ TopoOptions,
588
+ } from './observe.js';
589
+
590
+ // Run
591
+ export { run } from './run.js';
592
+ export type { RunOptions } from './run.js';
593
+
594
+ // Trail factories
595
+ export { deriveTrail, ingest } from './trails/index.js';
596
+ export type {
597
+ DeriveTrailInput,
598
+ DeriveTrailOperation,
599
+ DeriveTrailOutput,
600
+ DeriveTrailSpec,
601
+ IngestOptions,
602
+ IngestTransform,
603
+ } from './trails/index.js';
85
604
 
86
605
  // Validation
87
606
  export {
@@ -90,6 +609,10 @@ export {
90
609
  formatZodIssues,
91
610
  zodToJsonSchema,
92
611
  } from './validation.js';
612
+ export {
613
+ stripDefaultWrappers,
614
+ stripDefaultsFromShape,
615
+ } from './zod-wrappers.js';
93
616
 
94
617
  // Serialization
95
618
  export { serializeError, deserializeError } from './serialization.js';
@@ -100,7 +623,7 @@ export {
100
623
  retry,
101
624
  withTimeout,
102
625
  shouldRetry,
103
- getBackoffDelay,
626
+ deriveBackoffDelay,
104
627
  } from './resilience.js';
105
628
  export type { RetryOptions } from './resilience.js';
106
629
 
@@ -115,7 +638,7 @@ export {
115
638
  nonEmptyString,
116
639
  positiveInt,
117
640
  shortId,
118
- hashId,
641
+ deriveIdHash,
119
642
  } from './branded.js';
120
643
  export type {
121
644
  Branded,
@@ -126,18 +649,31 @@ export type {
126
649
  } from './branded.js';
127
650
 
128
651
  // Path Security
129
- export { securePath, isPathSafe, resolveSafePath } from './path-security.js';
652
+ export { securePath, isPathSafe, deriveSafePath } from './path-security.js';
130
653
 
131
654
  // Workspace
132
655
  export {
656
+ deriveRelativePath,
657
+ findWorkspacePackage,
133
658
  findWorkspaceRoot,
134
659
  isInsideWorkspace,
135
- getRelativePath,
660
+ listWorkspacePackageDirs,
661
+ listWorkspacePackages,
662
+ listWorkspacePatterns,
136
663
  } from './workspace.js';
664
+ export type { WorkspacePackage, WorkspaceRootManifest } from './workspace.js';
137
665
 
138
666
  // Blob
139
- export { createBlobRef, isBlobRef } from './blob-ref.js';
140
- export type { BlobRef } from './blob-ref.js';
667
+ export {
668
+ BLOB_REF_SCHEMA_META_KEY,
669
+ blobRefDescriptorSchema,
670
+ blobRefJsonSchema,
671
+ blobRefSchema,
672
+ createBlobRef,
673
+ isBlobRef,
674
+ toBlobRefDescriptor,
675
+ } from './blob-ref.js';
676
+ export type { BlobRef, BlobRefDescriptor } from './blob-ref.js';
141
677
 
142
678
  // Guards
143
679
  export {