@ontrails/core 1.0.0-beta.5 → 1.0.0-beta.50

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