@ontrails/core 0.2.0

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 (86) hide show
  1. package/CHANGELOG.md +849 -0
  2. package/README.md +190 -0
  3. package/package.json +36 -0
  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 +90 -0
  9. package/src/branded.ts +135 -0
  10. package/src/collections.ts +99 -0
  11. package/src/compose-batch.ts +69 -0
  12. package/src/compose-schema.ts +36 -0
  13. package/src/context.ts +66 -0
  14. package/src/derive.ts +485 -0
  15. package/src/detours.ts +8 -0
  16. package/src/diagnostics.ts +21 -0
  17. package/src/draft.ts +350 -0
  18. package/src/entity.ts +346 -0
  19. package/src/error-rendering.ts +87 -0
  20. package/src/errors.ts +483 -0
  21. package/src/execute.ts +1577 -0
  22. package/src/fetch.ts +138 -0
  23. package/src/fire.ts +1172 -0
  24. package/src/glob.ts +81 -0
  25. package/src/guards.ts +37 -0
  26. package/src/index.ts +704 -0
  27. package/src/internal/fork-ctx.ts +69 -0
  28. package/src/layer-field-rendering.ts +193 -0
  29. package/src/layer.ts +81 -0
  30. package/src/observe.ts +361 -0
  31. package/src/path-scope.ts +66 -0
  32. package/src/path-security.ts +98 -0
  33. package/src/patterns/bulk.ts +16 -0
  34. package/src/patterns/change.ts +12 -0
  35. package/src/patterns/date-range.ts +12 -0
  36. package/src/patterns/index.ts +8 -0
  37. package/src/patterns/pagination.ts +22 -0
  38. package/src/patterns/progress.ts +13 -0
  39. package/src/patterns/sorting.ts +14 -0
  40. package/src/patterns/status.ts +11 -0
  41. package/src/patterns/timestamps.ts +12 -0
  42. package/src/permits.ts +12 -0
  43. package/src/queue.ts +163 -0
  44. package/src/redaction/index.ts +3 -0
  45. package/src/redaction/patterns.ts +50 -0
  46. package/src/redaction/redactor.ts +178 -0
  47. package/src/resilience.ts +234 -0
  48. package/src/resource-config.ts +804 -0
  49. package/src/resource.ts +194 -0
  50. package/src/result.ts +212 -0
  51. package/src/run.ts +76 -0
  52. package/src/runtime-builtins.ts +69 -0
  53. package/src/schedule-runtime.ts +689 -0
  54. package/src/schedule.ts +326 -0
  55. package/src/serialization.ts +265 -0
  56. package/src/sha256.ts +136 -0
  57. package/src/signal-diagnostics.ts +633 -0
  58. package/src/signal-ref.ts +111 -0
  59. package/src/signal.ts +104 -0
  60. package/src/store/accessor-protocol.ts +56 -0
  61. package/src/store/index.ts +4 -0
  62. package/src/structured-examples.ts +248 -0
  63. package/src/surface-derivation.ts +91 -0
  64. package/src/surface-filter.ts +101 -0
  65. package/src/surface-overlay.ts +694 -0
  66. package/src/surface-versioning.ts +42 -0
  67. package/src/topo.ts +835 -0
  68. package/src/tracing.ts +346 -0
  69. package/src/trail-id-glob.ts +15 -0
  70. package/src/trail.ts +1351 -0
  71. package/src/trails/derive-trail.ts +835 -0
  72. package/src/trails/index.ts +9 -0
  73. package/src/trails/ingest.ts +152 -0
  74. package/src/trails-db.ts +212 -0
  75. package/src/transport-error-map.ts +163 -0
  76. package/src/type-utils.ts +87 -0
  77. package/src/types.ts +300 -0
  78. package/src/validate-established-topo.ts +73 -0
  79. package/src/validate-topo.ts +725 -0
  80. package/src/validation.ts +330 -0
  81. package/src/version-marker.ts +716 -0
  82. package/src/version-resolution.ts +308 -0
  83. package/src/version-runtime.ts +120 -0
  84. package/src/webhook.ts +461 -0
  85. package/src/workspace.ts +244 -0
  86. package/src/zod-wrappers.ts +72 -0
package/src/index.ts ADDED
@@ -0,0 +1,704 @@
1
+ // Result
2
+ export { Result, resultAccessorNames } from './result.js';
3
+ export type { ResultAccessorName } from './result.js';
4
+
5
+ // Errors
6
+ export {
7
+ TrailsError,
8
+ ValidationError,
9
+ AmbiguousError,
10
+ AssertionError,
11
+ NotFoundError,
12
+ VersionNotSupportedError,
13
+ AlreadyExistsError,
14
+ ConflictError,
15
+ PermissionError,
16
+ PermitError,
17
+ TimeoutError,
18
+ RateLimitError,
19
+ NetworkError,
20
+ WorkspaceShiftError,
21
+ InternalError,
22
+ AuthError,
23
+ CancelledError,
24
+ DerivationError,
25
+ RecoverableCompletionError,
26
+ codesByCategory,
27
+ errorClasses,
28
+ errorCategories,
29
+ exitCodeMap,
30
+ statusCodeMap,
31
+ jsonRpcCodeMap,
32
+ retryableMap,
33
+ RetryExhaustedError,
34
+ isRetryable,
35
+ isTrailsError,
36
+ } 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';
80
+
81
+ // Types
82
+ export type {
83
+ Detour,
84
+ DetourAttempt,
85
+ Implementation,
86
+ TrailContext,
87
+ TrailContextInit,
88
+ ComposeBatchOptions,
89
+ ComposeOptions,
90
+ ComposeFn,
91
+ FireFn,
92
+ LogLevel,
93
+ LogFormatter,
94
+ LogRecord,
95
+ LogSink,
96
+ PermitRequirement,
97
+ ProgressCallback,
98
+ ProgressEvent,
99
+ Logger,
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,
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';
120
+
121
+ // Context factory
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';
168
+
169
+ // Trail
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';
227
+ export type {
228
+ AnyTrail,
229
+ ImplementationInput,
230
+ Intent,
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,
244
+ TrailSpec,
245
+ TrailExample,
246
+ TrailExampleSignalAssertion,
247
+ TrailVisibility,
248
+ VersionContract,
249
+ VersionEntry,
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';
294
+
295
+ // Type utilities
296
+ export type {
297
+ ComposeInput,
298
+ TrailInput,
299
+ TrailOutput,
300
+ TrailResult,
301
+ } from './type-utils.js';
302
+ export { inputOf, outputOf } from './type-utils.js';
303
+
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';
424
+
425
+ // Topo
426
+ export { 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';
489
+
490
+ // Topo validation
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';
501
+
502
+ // Layer
503
+ export { composeLayers } 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';
548
+
549
+ // Execute
550
+ export { DETOUR_MAX_ATTEMPTS_CAP } from './detours.js';
551
+ export { executeTrail } from './execute.js';
552
+ export type { ExecuteTrailOptions } from './execute.js';
553
+
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';
569
+ export type {
570
+ ActivationTraceRecordName,
571
+ SignalTraceRecordName,
572
+ TraceContext,
573
+ TraceRecord,
574
+ TraceSink,
575
+ } from './tracing.js';
576
+ export type { TraceFn } from './types.js';
577
+
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';
608
+
609
+ // Validation
610
+ export {
611
+ validateInput,
612
+ validateOutput,
613
+ formatZodIssues,
614
+ zodToJsonSchema,
615
+ } from './validation.js';
616
+ export {
617
+ stripDefaultWrappers,
618
+ stripDefaultsFromShape,
619
+ } from './zod-wrappers.js';
620
+
621
+ // Serialization
622
+ export { serializeError, deserializeError } from './serialization.js';
623
+ export type { SerializedError } from './serialization.js';
624
+
625
+ // Resilience
626
+ export {
627
+ retry,
628
+ withTimeout,
629
+ shouldRetry,
630
+ deriveBackoffDelay,
631
+ } from './resilience.js';
632
+ export type { RetryOptions } from './resilience.js';
633
+
634
+ // Fetch — fromFetch is available as Result.fromFetch()
635
+
636
+ // Branded types
637
+ export {
638
+ brand,
639
+ unbrand,
640
+ uuid,
641
+ email,
642
+ nonEmptyString,
643
+ positiveInt,
644
+ shortId,
645
+ deriveIdHash,
646
+ } from './branded.js';
647
+ export type {
648
+ Branded,
649
+ UUID,
650
+ Email,
651
+ NonEmptyString,
652
+ PositiveInt,
653
+ } from './branded.js';
654
+
655
+ // Path Security
656
+ export { securePath, isPathSafe, deriveSafePath } from './path-security.js';
657
+
658
+ // Workspace
659
+ export {
660
+ deriveRelativePath,
661
+ findWorkspacePackage,
662
+ findWorkspaceRoot,
663
+ isInsideWorkspace,
664
+ listWorkspacePackageDirs,
665
+ listWorkspacePackages,
666
+ listWorkspacePatterns,
667
+ } from './workspace.js';
668
+ export type { WorkspacePackage, WorkspaceRootManifest } from './workspace.js';
669
+
670
+ // Blob
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';
681
+
682
+ // Guards
683
+ export {
684
+ isDefined,
685
+ isNonEmptyString,
686
+ isPlainObject,
687
+ hasProperty,
688
+ assertNever,
689
+ } from './guards.js';
690
+
691
+ // Collections
692
+ export {
693
+ chunk,
694
+ dedupe,
695
+ groupBy,
696
+ sortBy,
697
+ isNonEmptyArray,
698
+ } from './collections.js';
699
+ export type {
700
+ NonEmptyArray,
701
+ DeepPartial,
702
+ Prettify,
703
+ AtLeastOne,
704
+ } from './collections.js';