@ontrails/core 1.0.0-beta.2 → 1.0.0-beta.21
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.
- package/CHANGELOG.md +283 -5
- package/README.md +113 -33
- package/package.json +11 -1
- package/src/activation-provenance.ts +111 -0
- package/src/activation-source-compatibility.ts +430 -0
- package/src/activation-source-projection.ts +221 -0
- package/src/activation-source.ts +91 -0
- package/src/blob-ref.ts +51 -0
- package/src/branded.ts +1 -1
- package/src/compose-batch.ts +69 -0
- package/src/compose-schema.ts +36 -0
- package/src/context.ts +44 -10
- package/src/contour.ts +346 -0
- package/src/derive.ts +59 -18
- package/src/detours.ts +8 -0
- package/src/draft.ts +342 -0
- package/src/error-projection.ts +51 -0
- package/src/errors.ts +309 -48
- package/src/execute.ts +1577 -0
- package/src/fire.ts +1169 -0
- package/src/index.ts +477 -32
- package/src/internal/fork-ctx.ts +69 -0
- package/src/layer-projection.ts +193 -0
- package/src/layer.ts +43 -6
- package/src/observe.ts +361 -0
- package/src/path-security.ts +1 -1
- package/src/permits.ts +12 -0
- package/src/redaction/patterns.ts +6 -3
- package/src/resilience.ts +11 -11
- package/src/resource-config.ts +792 -0
- package/src/resource.ts +194 -0
- package/src/result.ts +36 -4
- package/src/run.ts +76 -0
- package/src/schedule-runtime.ts +689 -0
- package/src/schedule.ts +326 -0
- package/src/serialization.ts +119 -39
- package/src/signal-diagnostics.ts +633 -0
- package/src/signal-ref.ts +87 -0
- package/src/signal.ts +104 -0
- package/src/store/accessor-protocol.ts +56 -0
- package/src/store/index.ts +4 -0
- package/src/structured-examples.ts +248 -0
- package/src/surface-derivation.ts +91 -0
- package/src/surface-filter.ts +176 -0
- package/src/surface-versioning.ts +42 -0
- package/src/topo.ts +769 -57
- package/src/tracing.ts +345 -0
- package/src/trail.ts +1161 -29
- package/src/trails/derive-trail.ts +842 -0
- package/src/trails/index.ts +9 -0
- package/src/trails/ingest.ts +139 -0
- package/src/trails-db.ts +208 -0
- package/src/transport-error-map.ts +174 -0
- package/src/type-utils.ts +87 -0
- package/src/types.ts +254 -12
- package/src/validate-established-topo.ts +69 -0
- package/src/validate-topo.ts +442 -35
- package/src/validation.ts +152 -4
- package/src/version-marker.ts +716 -0
- package/src/version-resolution.ts +308 -0
- package/src/version-runtime.ts +120 -0
- package/src/webhook.ts +278 -0
- package/src/workspace.ts +1 -1
- package/src/zod-wrappers.ts +72 -0
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/adapters.d.ts +0 -39
- package/dist/adapters.d.ts.map +0 -1
- package/dist/adapters.js +0 -2
- package/dist/adapters.js.map +0 -1
- package/dist/blob-ref.d.ts +0 -20
- package/dist/blob-ref.d.ts.map +0 -1
- package/dist/blob-ref.js +0 -22
- package/dist/blob-ref.js.map +0 -1
- package/dist/branded.d.ts +0 -36
- package/dist/branded.d.ts.map +0 -1
- package/dist/branded.js +0 -89
- package/dist/branded.js.map +0 -1
- package/dist/collections.d.ts +0 -31
- package/dist/collections.d.ts.map +0 -1
- package/dist/collections.js +0 -60
- package/dist/collections.js.map +0 -1
- package/dist/context.d.ts +0 -10
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -15
- package/dist/context.js.map +0 -1
- package/dist/derive.d.ts +0 -33
- package/dist/derive.d.ts.map +0 -1
- package/dist/derive.js +0 -122
- package/dist/derive.js.map +0 -1
- package/dist/errors.d.ts +0 -83
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -142
- package/dist/errors.js.map +0 -1
- package/dist/event.d.ts +0 -45
- package/dist/event.d.ts.map +0 -1
- package/dist/event.js +0 -17
- package/dist/event.js.map +0 -1
- package/dist/fetch.d.ts +0 -15
- package/dist/fetch.d.ts.map +0 -1
- package/dist/fetch.js +0 -102
- package/dist/fetch.js.map +0 -1
- package/dist/guards.d.ts +0 -17
- package/dist/guards.d.ts.map +0 -1
- package/dist/guards.js +0 -25
- package/dist/guards.js.map +0 -1
- package/dist/health.d.ts +0 -18
- package/dist/health.d.ts.map +0 -1
- package/dist/health.js +0 -5
- package/dist/health.js.map +0 -1
- package/dist/hike.d.ts +0 -36
- package/dist/hike.d.ts.map +0 -1
- package/dist/hike.js +0 -20
- package/dist/hike.js.map +0 -1
- package/dist/index.d.ts +0 -34
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -38
- package/dist/index.js.map +0 -1
- package/dist/job.d.ts +0 -24
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -17
- package/dist/job.js.map +0 -1
- package/dist/layer.d.ts +0 -17
- package/dist/layer.d.ts.map +0 -1
- package/dist/layer.js +0 -21
- package/dist/layer.js.map +0 -1
- package/dist/path-security.d.ts +0 -28
- package/dist/path-security.d.ts.map +0 -1
- package/dist/path-security.js +0 -63
- package/dist/path-security.js.map +0 -1
- package/dist/patterns/bulk.d.ts +0 -15
- package/dist/patterns/bulk.d.ts.map +0 -1
- package/dist/patterns/bulk.js +0 -14
- package/dist/patterns/bulk.js.map +0 -1
- package/dist/patterns/change.d.ts +0 -10
- package/dist/patterns/change.d.ts.map +0 -1
- package/dist/patterns/change.js +0 -10
- package/dist/patterns/change.js.map +0 -1
- package/dist/patterns/date-range.d.ts +0 -10
- package/dist/patterns/date-range.d.ts.map +0 -1
- package/dist/patterns/date-range.js +0 -10
- package/dist/patterns/date-range.js.map +0 -1
- package/dist/patterns/index.d.ts +0 -9
- package/dist/patterns/index.d.ts.map +0 -1
- package/dist/patterns/index.js +0 -9
- package/dist/patterns/index.js.map +0 -1
- package/dist/patterns/pagination.d.ts +0 -18
- package/dist/patterns/pagination.d.ts.map +0 -1
- package/dist/patterns/pagination.js +0 -18
- package/dist/patterns/pagination.js.map +0 -1
- package/dist/patterns/progress.d.ts +0 -11
- package/dist/patterns/progress.d.ts.map +0 -1
- package/dist/patterns/progress.js +0 -11
- package/dist/patterns/progress.js.map +0 -1
- package/dist/patterns/sorting.d.ts +0 -13
- package/dist/patterns/sorting.d.ts.map +0 -1
- package/dist/patterns/sorting.js +0 -10
- package/dist/patterns/sorting.js.map +0 -1
- package/dist/patterns/status.d.ts +0 -15
- package/dist/patterns/status.d.ts.map +0 -1
- package/dist/patterns/status.js +0 -9
- package/dist/patterns/status.js.map +0 -1
- package/dist/patterns/timestamps.d.ts +0 -10
- package/dist/patterns/timestamps.d.ts.map +0 -1
- package/dist/patterns/timestamps.js +0 -10
- package/dist/patterns/timestamps.js.map +0 -1
- package/dist/redaction/index.d.ts +0 -4
- package/dist/redaction/index.d.ts.map +0 -1
- package/dist/redaction/index.js +0 -3
- package/dist/redaction/index.js.map +0 -1
- package/dist/redaction/patterns.d.ts +0 -9
- package/dist/redaction/patterns.d.ts.map +0 -1
- package/dist/redaction/patterns.js +0 -39
- package/dist/redaction/patterns.js.map +0 -1
- package/dist/redaction/redactor.d.ts +0 -27
- package/dist/redaction/redactor.d.ts.map +0 -1
- package/dist/redaction/redactor.js +0 -89
- package/dist/redaction/redactor.js.map +0 -1
- package/dist/resilience.d.ts +0 -34
- package/dist/resilience.d.ts.map +0 -1
- package/dist/resilience.js +0 -164
- package/dist/resilience.js.map +0 -1
- package/dist/result.d.ts +0 -57
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -145
- package/dist/result.js.map +0 -1
- package/dist/serialization.d.ts +0 -27
- package/dist/serialization.d.ts.map +0 -1
- package/dist/serialization.js +0 -115
- package/dist/serialization.js.map +0 -1
- package/dist/topo.d.ts +0 -18
- package/dist/topo.d.ts.map +0 -1
- package/dist/topo.js +0 -74
- package/dist/topo.js.map +0 -1
- package/dist/trail.d.ts +0 -83
- package/dist/trail.d.ts.map +0 -1
- package/dist/trail.js +0 -16
- package/dist/trail.js.map +0 -1
- package/dist/types.d.ts +0 -46
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/validate-topo.d.ts +0 -24
- package/dist/validate-topo.d.ts.map +0 -1
- package/dist/validate-topo.js +0 -108
- package/dist/validate-topo.js.map +0 -1
- package/dist/validation.d.ts +0 -27
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -134
- package/dist/validation.js.map +0 -1
- package/dist/workspace.d.ts +0 -25
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -57
- package/dist/workspace.js.map +0 -1
- package/src/__tests__/blob-ref.test.ts +0 -103
- package/src/__tests__/branded.test.ts +0 -148
- package/src/__tests__/collections.test.ts +0 -126
- package/src/__tests__/context.test.ts +0 -66
- package/src/__tests__/derive.test.ts +0 -159
- package/src/__tests__/errors.test.ts +0 -309
- package/src/__tests__/event.test.ts +0 -82
- package/src/__tests__/fetch.test.ts +0 -217
- package/src/__tests__/guards.test.ts +0 -102
- package/src/__tests__/hike.test.ts +0 -117
- package/src/__tests__/job.test.ts +0 -98
- package/src/__tests__/layer.test.ts +0 -224
- package/src/__tests__/path-security.test.ts +0 -114
- package/src/__tests__/patterns.test.ts +0 -273
- package/src/__tests__/redaction.test.ts +0 -244
- package/src/__tests__/resilience.test.ts +0 -246
- package/src/__tests__/result.test.ts +0 -155
- package/src/__tests__/serialization.test.ts +0 -236
- package/src/__tests__/topo.test.ts +0 -184
- package/src/__tests__/trail.test.ts +0 -179
- package/src/__tests__/validate-topo.test.ts +0 -201
- package/src/__tests__/validation.test.ts +0 -283
- package/src/__tests__/workspace.test.ts +0 -183
- package/src/adapters.ts +0 -68
- package/src/event.ts +0 -77
- package/src/health.ts +0 -23
- package/src/hike.ts +0 -77
- package/src/job.ts +0 -20
- package/tsconfig.json +0 -9
- 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,79 +9,507 @@ 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,
|
|
17
20
|
InternalError,
|
|
18
21
|
AuthError,
|
|
19
22
|
CancelledError,
|
|
23
|
+
DerivationError,
|
|
24
|
+
RecoverableCompletionError,
|
|
25
|
+
codesByCategory,
|
|
26
|
+
errorClasses,
|
|
27
|
+
errorCategories,
|
|
20
28
|
exitCodeMap,
|
|
21
29
|
statusCodeMap,
|
|
22
30
|
jsonRpcCodeMap,
|
|
23
31
|
retryableMap,
|
|
32
|
+
RetryExhaustedError,
|
|
24
33
|
isRetryable,
|
|
25
34
|
isTrailsError,
|
|
26
35
|
} from './errors.js';
|
|
27
|
-
export type {
|
|
36
|
+
export type {
|
|
37
|
+
DynamicErrorClassRegistryEntry,
|
|
38
|
+
ErrorCategory,
|
|
39
|
+
ErrorCategoryCodes,
|
|
40
|
+
ErrorClassConstructor,
|
|
41
|
+
ErrorClassRegistryEntry,
|
|
42
|
+
FixedErrorClassRegistryEntry,
|
|
43
|
+
} from './errors.js';
|
|
44
|
+
export {
|
|
45
|
+
createSurfaceErrorMapper,
|
|
46
|
+
mapSurfaceError,
|
|
47
|
+
projectErrorClassSurface,
|
|
48
|
+
projectPublicSurfaceError,
|
|
49
|
+
projectSurfaceError,
|
|
50
|
+
surfaceErrorMap,
|
|
51
|
+
surfaceErrorRegistry,
|
|
52
|
+
surfaceNames,
|
|
53
|
+
} from './transport-error-map.js';
|
|
54
|
+
export type {
|
|
55
|
+
ErrorClassSurfaceProjection,
|
|
56
|
+
SurfaceErrorCode,
|
|
57
|
+
SurfaceErrorMapper,
|
|
58
|
+
SurfaceErrorMappings,
|
|
59
|
+
SurfaceErrorProjection,
|
|
60
|
+
SurfaceName,
|
|
61
|
+
} from './transport-error-map.js';
|
|
62
|
+
export {
|
|
63
|
+
INTERNAL_ERROR_PUBLIC_MESSAGE,
|
|
64
|
+
projectErrorDiagnostics,
|
|
65
|
+
redactErrorContext,
|
|
66
|
+
redactErrorStack,
|
|
67
|
+
redactErrorString,
|
|
68
|
+
} from './error-projection.js';
|
|
69
|
+
export type { ErrorDiagnosticsProjection } from './error-projection.js';
|
|
28
70
|
|
|
29
71
|
// Types
|
|
30
72
|
export type {
|
|
73
|
+
Detour,
|
|
74
|
+
DetourAttempt,
|
|
31
75
|
Implementation,
|
|
32
76
|
TrailContext,
|
|
33
|
-
|
|
77
|
+
TrailContextInit,
|
|
78
|
+
ComposeBatchOptions,
|
|
79
|
+
ComposeOptions,
|
|
80
|
+
ComposeFn,
|
|
81
|
+
FireFn,
|
|
82
|
+
LogLevel,
|
|
83
|
+
LogFormatter,
|
|
84
|
+
LogRecord,
|
|
85
|
+
LogSink,
|
|
86
|
+
PermitRequirement,
|
|
34
87
|
ProgressCallback,
|
|
35
88
|
ProgressEvent,
|
|
36
89
|
Logger,
|
|
37
|
-
|
|
90
|
+
ResourceLookup,
|
|
91
|
+
} from './types.js';
|
|
92
|
+
export { basePermitSchema } from './permits.js';
|
|
93
|
+
export type { BasePermit } from './permits.js';
|
|
94
|
+
export {
|
|
95
|
+
LAYER_INPUTS_KEY,
|
|
96
|
+
SURFACE_KEY,
|
|
97
|
+
SURFACE_LAYER_NAMES_KEY,
|
|
38
98
|
} from './types.js';
|
|
99
|
+
export {
|
|
100
|
+
ACTIVATION_PROVENANCE_KEY,
|
|
101
|
+
buildActivationProvenanceTraceAttrs,
|
|
102
|
+
getActivationProvenance,
|
|
103
|
+
withActivationProvenance,
|
|
104
|
+
} from './activation-provenance.js';
|
|
105
|
+
export type {
|
|
106
|
+
ActivationProvenance,
|
|
107
|
+
ActivationProvenanceCarrier,
|
|
108
|
+
ActivationProvenanceSource,
|
|
109
|
+
} from './activation-provenance.js';
|
|
39
110
|
|
|
40
111
|
// Context factory
|
|
41
|
-
export { createTrailContext } from './context.js';
|
|
112
|
+
export { createTrailContext, passthroughTrace } from './context.js';
|
|
113
|
+
|
|
114
|
+
// Resource
|
|
115
|
+
export {
|
|
116
|
+
createResourceLookup,
|
|
117
|
+
findDuplicateResourceId,
|
|
118
|
+
isResource,
|
|
119
|
+
resource,
|
|
120
|
+
} from './resource.js';
|
|
121
|
+
export { drainResources, resolveResourceConfig } from './resource-config.js';
|
|
122
|
+
export type {
|
|
123
|
+
ResourceConfigValues,
|
|
124
|
+
ResourceDrainReport,
|
|
125
|
+
} from './resource-config.js';
|
|
126
|
+
export type {
|
|
127
|
+
AnyResource,
|
|
128
|
+
Resource,
|
|
129
|
+
ResourceContext,
|
|
130
|
+
ResourceOverrideMap,
|
|
131
|
+
ResourceSpec,
|
|
132
|
+
ResourceUnmockable,
|
|
133
|
+
} from './resource.js';
|
|
42
134
|
|
|
43
135
|
// Trail
|
|
44
|
-
export {
|
|
45
|
-
|
|
136
|
+
export {
|
|
137
|
+
activationSourceKinds,
|
|
138
|
+
getActivationWherePredicate,
|
|
139
|
+
isActivationEntrySpec,
|
|
140
|
+
isActivationSource,
|
|
141
|
+
isKnownActivationSourceKind,
|
|
142
|
+
} from './activation-source.js';
|
|
143
|
+
export type {
|
|
144
|
+
ActivationEntry,
|
|
145
|
+
ActivationEntrySpec,
|
|
146
|
+
ActivationSource,
|
|
147
|
+
ActivationSourceKind,
|
|
148
|
+
ActivationSourceMeta,
|
|
149
|
+
ActivationSourceRef,
|
|
150
|
+
ActivationWhere,
|
|
151
|
+
ActivationWhereExample,
|
|
152
|
+
ActivationWherePredicate,
|
|
153
|
+
ActivationWhereSpec,
|
|
154
|
+
BuiltinActivationSourceKind,
|
|
155
|
+
} from './activation-source.js';
|
|
156
|
+
export {
|
|
157
|
+
activationSourceDeclarationSignature,
|
|
158
|
+
activationSourceKey,
|
|
159
|
+
projectActivationSourceDeclaration,
|
|
160
|
+
} from './activation-source-projection.js';
|
|
161
|
+
export type { ActivationSourceProjection } from './activation-source-projection.js';
|
|
162
|
+
export {
|
|
163
|
+
deriveSupportedTrailVersions,
|
|
164
|
+
getTrailVersionEntryKind,
|
|
165
|
+
hasDeprecatedTrailVersionGuidance,
|
|
166
|
+
intentValues,
|
|
167
|
+
isArchivedTrailVersionEntry,
|
|
168
|
+
isDeprecatedTrailVersionEntry,
|
|
169
|
+
isLiveTrailVersionEntry,
|
|
170
|
+
trail,
|
|
171
|
+
} from './trail.js';
|
|
172
|
+
export {
|
|
173
|
+
TRAIL_VERSION_MARKER_LENGTH,
|
|
174
|
+
TRAIL_VERSION_MARKER_MIN_PREFIX_LENGTH,
|
|
175
|
+
assertTrailVersionMarker,
|
|
176
|
+
assertUniqueTrailVersionMarkers,
|
|
177
|
+
canonicalizeTrailVersionMarkerContent,
|
|
178
|
+
deriveCurrentTrailVersionMarker,
|
|
179
|
+
deriveCurrentTrailVersionMarkerContent,
|
|
180
|
+
deriveShortestUnambiguousTrailVersionMarkerPrefix,
|
|
181
|
+
deriveTrailVersionEntryMarker,
|
|
182
|
+
deriveTrailVersionEntryMarkerContent,
|
|
183
|
+
deriveTrailVersionMarker,
|
|
184
|
+
deriveTrailVersionMarkers,
|
|
185
|
+
normalizeTrailVersionMarkerPrefix,
|
|
186
|
+
resolveTrailVersionMarkerPrefix,
|
|
187
|
+
} from './version-marker.js';
|
|
188
|
+
export {
|
|
189
|
+
parseTrailIdVersionReference,
|
|
190
|
+
resolveTrailVersion,
|
|
191
|
+
} from './version-resolution.js';
|
|
192
|
+
export type {
|
|
193
|
+
AnyTrail,
|
|
194
|
+
BlazeInput,
|
|
195
|
+
Intent,
|
|
196
|
+
Trail,
|
|
197
|
+
TrailVersionEntry,
|
|
198
|
+
TrailVersionEntryKind,
|
|
199
|
+
TrailVersionArchivedStatus,
|
|
200
|
+
TrailVersionDeprecatedStatus,
|
|
201
|
+
TrailVersionForkEntry,
|
|
202
|
+
TrailVersionRevisionEntry,
|
|
203
|
+
TrailVersions,
|
|
204
|
+
TrailVersionStatus,
|
|
205
|
+
TrailVersionTranspose,
|
|
206
|
+
TrailVersionTransposeInput,
|
|
207
|
+
TrailVersionTransposeOutput,
|
|
208
|
+
TrailSpec,
|
|
209
|
+
TrailExample,
|
|
210
|
+
TrailExampleSignalAssertion,
|
|
211
|
+
TrailVisibility,
|
|
212
|
+
VersionContract,
|
|
213
|
+
VersionEntry,
|
|
214
|
+
} from './trail.js';
|
|
215
|
+
export type {
|
|
216
|
+
TrailVersionMarkerBinding,
|
|
217
|
+
TrailVersionMarkerRecord,
|
|
218
|
+
TrailVersionMarkerResolution,
|
|
219
|
+
} from './version-marker.js';
|
|
220
|
+
export type {
|
|
221
|
+
ParsedTrailVersionReference,
|
|
222
|
+
ResolvedTrailVersion,
|
|
223
|
+
TrailVersionReference,
|
|
224
|
+
} from './version-resolution.js';
|
|
225
|
+
export {
|
|
226
|
+
filterSurfaceTrails,
|
|
227
|
+
matchesTrailPattern,
|
|
228
|
+
shouldIncludeTrailForSurface,
|
|
229
|
+
} from './surface-filter.js';
|
|
230
|
+
export type { SurfaceFilterOptions } from './surface-filter.js';
|
|
231
|
+
export { deriveSurfaceTrailVersionProjections } from './surface-versioning.js';
|
|
232
|
+
export type { SurfaceTrailVersionProjection } from './surface-versioning.js';
|
|
233
|
+
export {
|
|
234
|
+
shouldValidateSurfaceTopo,
|
|
235
|
+
validateSurfaceTopo,
|
|
236
|
+
withSurfaceLayerNames,
|
|
237
|
+
withSurfaceMarker,
|
|
238
|
+
} from './surface-derivation.js';
|
|
239
|
+
export type {
|
|
240
|
+
BaseSurfaceOptions,
|
|
241
|
+
SurfaceConfigValues,
|
|
242
|
+
SurfaceSelectionOptions,
|
|
243
|
+
SurfaceMarkedContext,
|
|
244
|
+
SurfaceValidationOptions,
|
|
245
|
+
} from './surface-derivation.js';
|
|
246
|
+
export {
|
|
247
|
+
deriveStructuredSignalExamples,
|
|
248
|
+
deriveStructuredTrailExamples,
|
|
249
|
+
} from './structured-examples.js';
|
|
250
|
+
export type {
|
|
251
|
+
StructuredSignalExample,
|
|
252
|
+
StructuredSignalExampleProvenance,
|
|
253
|
+
StructuredTrailExample,
|
|
254
|
+
StructuredTrailExampleKind,
|
|
255
|
+
StructuredTrailExampleProvenance,
|
|
256
|
+
StructuredTrailExampleSignalAssertion,
|
|
257
|
+
} from './structured-examples.js';
|
|
46
258
|
|
|
47
|
-
//
|
|
48
|
-
export {
|
|
49
|
-
|
|
259
|
+
// Type utilities
|
|
260
|
+
export type {
|
|
261
|
+
ComposeInput,
|
|
262
|
+
TrailInput,
|
|
263
|
+
TrailOutput,
|
|
264
|
+
TrailResult,
|
|
265
|
+
} from './type-utils.js';
|
|
266
|
+
export { inputOf, outputOf } from './type-utils.js';
|
|
50
267
|
|
|
51
|
-
//
|
|
52
|
-
export {
|
|
53
|
-
export type {
|
|
268
|
+
// Signal
|
|
269
|
+
export { signal } from './signal.js';
|
|
270
|
+
export type { AnySignal, Signal, SignalSpec } from './signal.js';
|
|
271
|
+
export { schedule, validateScheduleSource } from './schedule.js';
|
|
272
|
+
export type {
|
|
273
|
+
ScheduleSource,
|
|
274
|
+
ScheduleSpec,
|
|
275
|
+
ScheduleValidationIssue,
|
|
276
|
+
} from './schedule.js';
|
|
277
|
+
export {
|
|
278
|
+
getWebhookHeader,
|
|
279
|
+
getWebhookHeaders,
|
|
280
|
+
validateWebhookSource,
|
|
281
|
+
verifyWebhookRequest,
|
|
282
|
+
webhook,
|
|
283
|
+
webhookMethods,
|
|
284
|
+
} from './webhook.js';
|
|
285
|
+
export type {
|
|
286
|
+
WebhookMethod,
|
|
287
|
+
WebhookMethodInput,
|
|
288
|
+
WebhookSource,
|
|
289
|
+
WebhookSpec,
|
|
290
|
+
WebhookValidationIssue,
|
|
291
|
+
WebhookVerify,
|
|
292
|
+
WebhookVerifyHeaders,
|
|
293
|
+
WebhookVerifyRequest,
|
|
294
|
+
} from './webhook.js';
|
|
295
|
+
export { createScheduleRuntime } from './schedule-runtime.js';
|
|
296
|
+
export type {
|
|
297
|
+
ScheduleCronFactory,
|
|
298
|
+
ScheduleCronHandler,
|
|
299
|
+
ScheduleCronJob,
|
|
300
|
+
ScheduleRuntime,
|
|
301
|
+
ScheduleRuntimeLogger,
|
|
302
|
+
ScheduleRuntimeOptions,
|
|
303
|
+
ScheduleRuntimeRegistrationReport,
|
|
304
|
+
ScheduleRuntimeRunRecord,
|
|
305
|
+
ScheduleRuntimeRunStatus,
|
|
306
|
+
ScheduleRuntimeSkipReason,
|
|
307
|
+
ScheduleRuntimeStartReport,
|
|
308
|
+
ScheduleRuntimeState,
|
|
309
|
+
ScheduleRuntimeStopReport,
|
|
310
|
+
ScheduleRuntimeWarning,
|
|
311
|
+
ScheduleRuntimeWarningCode,
|
|
312
|
+
} from './schedule-runtime.js';
|
|
313
|
+
export {
|
|
314
|
+
SIGNAL_DIAGNOSTICS_SINK_KEY,
|
|
315
|
+
SIGNAL_DIAGNOSTICS_STRICT_MODE_KEY,
|
|
316
|
+
createSignalFireSuppressedDiagnostic,
|
|
317
|
+
createSignalHandlerFailedDiagnostic,
|
|
318
|
+
createSignalHandlerRejectedDiagnostic,
|
|
319
|
+
createSignalInvalidDiagnostic,
|
|
320
|
+
createSignalPredicateFailedDiagnostic,
|
|
321
|
+
createSignalUnknownDiagnostic,
|
|
322
|
+
recordSignalDiagnostic,
|
|
323
|
+
shouldPromoteSignalDiagnostic,
|
|
324
|
+
signalDiagnosticDefinitions,
|
|
325
|
+
summarizeSignalPayload,
|
|
326
|
+
} from './signal-diagnostics.js';
|
|
327
|
+
export type {
|
|
328
|
+
CreateSignalFireSuppressedDiagnosticInput,
|
|
329
|
+
CreateSignalHandlerDiagnosticInput,
|
|
330
|
+
CreateSignalInvalidDiagnosticInput,
|
|
331
|
+
SignalDiagnostic,
|
|
332
|
+
SignalDiagnosticCategory,
|
|
333
|
+
SignalDiagnosticCause,
|
|
334
|
+
SignalDiagnosticCode,
|
|
335
|
+
SignalDiagnosticCommonInput,
|
|
336
|
+
SignalDiagnosticContext,
|
|
337
|
+
SignalDiagnosticLevel,
|
|
338
|
+
SignalDiagnosticPathSegment,
|
|
339
|
+
SignalDiagnosticRecordResult,
|
|
340
|
+
SignalDiagnosticSchemaIssue,
|
|
341
|
+
SignalDiagnosticSink,
|
|
342
|
+
SignalDiagnosticOrigin,
|
|
343
|
+
SignalDiagnosticSourceLocation,
|
|
344
|
+
SignalDiagnosticStrictMode,
|
|
345
|
+
SignalFireSuppressedDiagnostic,
|
|
346
|
+
SignalHandlerFailedDiagnostic,
|
|
347
|
+
SignalHandlerRejectedDiagnostic,
|
|
348
|
+
SignalInvalidDiagnostic,
|
|
349
|
+
SignalPredicateFailedDiagnostic,
|
|
350
|
+
SignalPayloadShape,
|
|
351
|
+
SignalPayloadSummary,
|
|
352
|
+
SignalUnknownDiagnostic,
|
|
353
|
+
} from './signal-diagnostics.js';
|
|
354
|
+
export {
|
|
355
|
+
attachLateBoundSignalRef,
|
|
356
|
+
cloneSignalWithId,
|
|
357
|
+
createLateBoundSignalMarker,
|
|
358
|
+
getLateBoundSignalRef,
|
|
359
|
+
parseLateBoundSignalMarker,
|
|
360
|
+
} from './signal-ref.js';
|
|
361
|
+
export type {
|
|
362
|
+
LateBoundSignalMarker,
|
|
363
|
+
LateBoundSignalRef,
|
|
364
|
+
} from './signal-ref.js';
|
|
365
|
+
|
|
366
|
+
// Contour
|
|
367
|
+
export { contour } from './contour.js';
|
|
368
|
+
export {
|
|
369
|
+
CONTOUR_ID_METADATA,
|
|
370
|
+
getContourIdMetadata,
|
|
371
|
+
getContourReferences,
|
|
372
|
+
} from './contour.js';
|
|
373
|
+
export type {
|
|
374
|
+
AnyContour,
|
|
375
|
+
Contour,
|
|
376
|
+
ContourIdBrand,
|
|
377
|
+
ContourIdMetadata,
|
|
378
|
+
ContourIdSchema,
|
|
379
|
+
ContourIdValue,
|
|
380
|
+
ContourOptions,
|
|
381
|
+
ContourReference,
|
|
382
|
+
} from './contour.js';
|
|
54
383
|
|
|
55
384
|
// Topo
|
|
56
385
|
export { topo } from './topo.js';
|
|
57
|
-
export type { Topo } from './topo.js';
|
|
386
|
+
export type { Topo, TopoIdentity } from './topo.js';
|
|
387
|
+
|
|
388
|
+
// Generic trails-db helpers (shared framework infrastructure per ADR-0014).
|
|
389
|
+
// The topo-store public API that previously lived here moved to
|
|
390
|
+
// `@ontrails/topographer` per ADR-0042.
|
|
391
|
+
export {
|
|
392
|
+
deriveTrailsDbPath,
|
|
393
|
+
deriveTrailsDir,
|
|
394
|
+
ensureSubsystemSchema,
|
|
395
|
+
ensureTrailsWorkspace,
|
|
396
|
+
openReadTrailsDb,
|
|
397
|
+
openWriteTrailsDb,
|
|
398
|
+
WORKSPACE_GITIGNORE_CONTENT,
|
|
399
|
+
WORKSPACE_GITIGNORE_LINES,
|
|
400
|
+
} from './trails-db.js';
|
|
401
|
+
export type {
|
|
402
|
+
EnsureSubsystemSchemaOptions,
|
|
403
|
+
TrailsDbLocationOptions,
|
|
404
|
+
} from './trails-db.js';
|
|
405
|
+
|
|
406
|
+
// Draft state
|
|
407
|
+
export {
|
|
408
|
+
DRAFT_ID_PREFIX,
|
|
409
|
+
deriveDraftReport,
|
|
410
|
+
isDraftId,
|
|
411
|
+
validateDraftFreeTopo,
|
|
412
|
+
} from './draft.js';
|
|
413
|
+
export type {
|
|
414
|
+
DraftDependency,
|
|
415
|
+
DraftDependencyKind,
|
|
416
|
+
DraftFinding,
|
|
417
|
+
DraftReport,
|
|
418
|
+
} from './draft.js';
|
|
58
419
|
|
|
59
420
|
// Topo validation
|
|
60
421
|
export { validateTopo } from './validate-topo.js';
|
|
61
422
|
export type { TopoIssue } from './validate-topo.js';
|
|
423
|
+
export { validateEstablishedTopo } from './validate-established-topo.js';
|
|
62
424
|
|
|
63
425
|
// Layer
|
|
64
426
|
export { composeLayers } from './layer.js';
|
|
65
|
-
export type { Layer } from './layer.js';
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
427
|
+
export type { Layer, LayerInputSchema } from './layer.js';
|
|
428
|
+
export {
|
|
429
|
+
collectAttachedTypedLayers,
|
|
430
|
+
LAYER_FIELD_RESERVED_NAMES,
|
|
431
|
+
LAYER_FIELD_RESERVED_NAMES_KEBAB,
|
|
432
|
+
projectLayerFieldName,
|
|
433
|
+
} from './layer-projection.js';
|
|
71
434
|
export type {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} from './
|
|
435
|
+
AttachedLayerScope,
|
|
436
|
+
AttachedTypedLayer,
|
|
437
|
+
LayerFieldProjection,
|
|
438
|
+
LayerFieldRenameReason,
|
|
439
|
+
ProjectedLayerField,
|
|
440
|
+
RenamedLayerFieldProjection,
|
|
441
|
+
} from './layer-projection.js';
|
|
79
442
|
|
|
80
443
|
// Derive
|
|
81
|
-
export { deriveFields } from './derive.js';
|
|
444
|
+
export { deriveCliPath, deriveFields } from './derive.js';
|
|
82
445
|
export type { Field, FieldOverride } from './derive.js';
|
|
83
446
|
|
|
447
|
+
// Compose schema
|
|
448
|
+
export { buildComposeValidationSchema } from './compose-schema.js';
|
|
449
|
+
export {
|
|
450
|
+
claimNextComposeBatchIndex,
|
|
451
|
+
createComposeBatchValidationResults,
|
|
452
|
+
normalizeComposeBatchConcurrency,
|
|
453
|
+
} from './compose-batch.js';
|
|
454
|
+
|
|
455
|
+
// Execute
|
|
456
|
+
export { DETOUR_MAX_ATTEMPTS_CAP } from './detours.js';
|
|
457
|
+
export { executeTrail } from './execute.js';
|
|
458
|
+
export type { ExecuteTrailOptions } from './execute.js';
|
|
459
|
+
|
|
460
|
+
// Intrinsic tracing
|
|
461
|
+
export {
|
|
462
|
+
clearTraceSink,
|
|
463
|
+
createActivationTraceRecord,
|
|
464
|
+
createTraceRecord,
|
|
465
|
+
getTraceContext,
|
|
466
|
+
getTraceSink,
|
|
467
|
+
NOOP_SINK,
|
|
468
|
+
registerTraceSink,
|
|
469
|
+
TRACE_CONTEXT_KEY,
|
|
470
|
+
traceContextFromRecord,
|
|
471
|
+
writeActivationTraceRecord,
|
|
472
|
+
} from './tracing.js';
|
|
473
|
+
export type {
|
|
474
|
+
ActivationTraceRecordName,
|
|
475
|
+
SignalTraceRecordName,
|
|
476
|
+
TraceContext,
|
|
477
|
+
TraceRecord,
|
|
478
|
+
TraceSink,
|
|
479
|
+
} from './tracing.js';
|
|
480
|
+
export type { TraceFn } from './types.js';
|
|
481
|
+
|
|
482
|
+
// Observe
|
|
483
|
+
export {
|
|
484
|
+
createObserveLogger,
|
|
485
|
+
isLogSink,
|
|
486
|
+
isLogger,
|
|
487
|
+
isObserveInput,
|
|
488
|
+
isTraceSink,
|
|
489
|
+
normalizeObserve,
|
|
490
|
+
} from './observe.js';
|
|
491
|
+
export type {
|
|
492
|
+
ObserveCapabilities,
|
|
493
|
+
ObserveConfig,
|
|
494
|
+
ObserveInput,
|
|
495
|
+
TopoOptions,
|
|
496
|
+
} from './observe.js';
|
|
497
|
+
|
|
498
|
+
// Run
|
|
499
|
+
export { run } from './run.js';
|
|
500
|
+
export type { RunOptions } from './run.js';
|
|
501
|
+
|
|
502
|
+
// Trail factories
|
|
503
|
+
export { deriveTrail, ingest } from './trails/index.js';
|
|
504
|
+
export type {
|
|
505
|
+
DeriveTrailInput,
|
|
506
|
+
DeriveTrailOperation,
|
|
507
|
+
DeriveTrailOutput,
|
|
508
|
+
DeriveTrailSpec,
|
|
509
|
+
IngestOptions,
|
|
510
|
+
IngestTransform,
|
|
511
|
+
} from './trails/index.js';
|
|
512
|
+
|
|
84
513
|
// Validation
|
|
85
514
|
export {
|
|
86
515
|
validateInput,
|
|
@@ -88,6 +517,10 @@ export {
|
|
|
88
517
|
formatZodIssues,
|
|
89
518
|
zodToJsonSchema,
|
|
90
519
|
} from './validation.js';
|
|
520
|
+
export {
|
|
521
|
+
stripDefaultWrappers,
|
|
522
|
+
stripDefaultsFromShape,
|
|
523
|
+
} from './zod-wrappers.js';
|
|
91
524
|
|
|
92
525
|
// Serialization
|
|
93
526
|
export { serializeError, deserializeError } from './serialization.js';
|
|
@@ -98,7 +531,7 @@ export {
|
|
|
98
531
|
retry,
|
|
99
532
|
withTimeout,
|
|
100
533
|
shouldRetry,
|
|
101
|
-
|
|
534
|
+
deriveBackoffDelay,
|
|
102
535
|
} from './resilience.js';
|
|
103
536
|
export type { RetryOptions } from './resilience.js';
|
|
104
537
|
|
|
@@ -113,7 +546,7 @@ export {
|
|
|
113
546
|
nonEmptyString,
|
|
114
547
|
positiveInt,
|
|
115
548
|
shortId,
|
|
116
|
-
|
|
549
|
+
deriveIdHash,
|
|
117
550
|
} from './branded.js';
|
|
118
551
|
export type {
|
|
119
552
|
Branded,
|
|
@@ -124,15 +557,27 @@ export type {
|
|
|
124
557
|
} from './branded.js';
|
|
125
558
|
|
|
126
559
|
// Path Security
|
|
127
|
-
export { securePath, isPathSafe,
|
|
560
|
+
export { securePath, isPathSafe, deriveSafePath } from './path-security.js';
|
|
128
561
|
|
|
129
562
|
// Workspace
|
|
130
563
|
export {
|
|
131
564
|
findWorkspaceRoot,
|
|
132
565
|
isInsideWorkspace,
|
|
133
|
-
|
|
566
|
+
deriveRelativePath,
|
|
134
567
|
} from './workspace.js';
|
|
135
568
|
|
|
569
|
+
// Blob
|
|
570
|
+
export {
|
|
571
|
+
BLOB_REF_SCHEMA_META_KEY,
|
|
572
|
+
blobRefDescriptorSchema,
|
|
573
|
+
blobRefJsonSchema,
|
|
574
|
+
blobRefSchema,
|
|
575
|
+
createBlobRef,
|
|
576
|
+
isBlobRef,
|
|
577
|
+
toBlobRefDescriptor,
|
|
578
|
+
} from './blob-ref.js';
|
|
579
|
+
export type { BlobRef, BlobRefDescriptor } from './blob-ref.js';
|
|
580
|
+
|
|
136
581
|
// Guards
|
|
137
582
|
export {
|
|
138
583
|
isDefined,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal helper for "forking" a trail context.
|
|
3
|
+
*
|
|
4
|
+
* Several execution sites need to derive a child context from a parent
|
|
5
|
+
* context while **resetting** a well-known set of bound closures (`compose`,
|
|
6
|
+
* `fire`, `resource`). Those closures capture the parent scope, so reusing
|
|
7
|
+
* them on the child would re-enter execution with the wrong attribution,
|
|
8
|
+
* the wrong resource scope, or the wrong fan-out identity. The reset list
|
|
9
|
+
* is the same at every fork site.
|
|
10
|
+
*
|
|
11
|
+
* Codifying the reset list in one helper keeps that contract in a single
|
|
12
|
+
* place. Callers supply the overrides they need (typically `env`,
|
|
13
|
+
* `extensions`, and `logger`) and let the helper handle the reset.
|
|
14
|
+
*
|
|
15
|
+
* This module is internal — do not export it from the package entry point.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* The helper is intentionally generic over the concrete context shape. Some
|
|
19
|
+
* callers work with the fully-resolved `TrailContext` produced inside the
|
|
20
|
+
* executor; others work with `Partial<TrailContextInit>` during consumer
|
|
21
|
+
* context derivation in `fire.ts`. Both shapes share the same reset keys.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import type { TrailContext, TrailContextInit } from '../types.js';
|
|
25
|
+
|
|
26
|
+
/** Keys cleared by default when forking a context. */
|
|
27
|
+
export type ForkCtxResetKey = 'compose' | 'fire' | 'resource';
|
|
28
|
+
|
|
29
|
+
/** Override fields callers are allowed to apply when forking a context. */
|
|
30
|
+
export type ForkCtxOverrides = Readonly<
|
|
31
|
+
Partial<Pick<TrailContext, 'env' | 'extensions' | 'logger'>>
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
const DEFAULT_RESET_KEYS: readonly ForkCtxResetKey[] = [
|
|
35
|
+
'compose',
|
|
36
|
+
'fire',
|
|
37
|
+
'resource',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Fork a parent context into a child context.
|
|
42
|
+
*
|
|
43
|
+
* Spreads the parent, clears each reset key to `undefined`, and applies the
|
|
44
|
+
* supplied overrides last so callers may replace logger, env, and extensions
|
|
45
|
+
* with branch-local values.
|
|
46
|
+
*
|
|
47
|
+
* The generic parameter is constrained to the minimal shape the helper
|
|
48
|
+
* reads and writes. This lets the helper serve both `TrailContext`
|
|
49
|
+
* (executor scope) and `Partial<TrailContextInit>` (fire-consumer scope)
|
|
50
|
+
* without widening the public surface of either type.
|
|
51
|
+
*/
|
|
52
|
+
export const forkCtx = <
|
|
53
|
+
TCtx extends Partial<
|
|
54
|
+
Pick<
|
|
55
|
+
TrailContextInit,
|
|
56
|
+
'compose' | 'env' | 'extensions' | 'fire' | 'logger' | 'resource'
|
|
57
|
+
>
|
|
58
|
+
>,
|
|
59
|
+
>(
|
|
60
|
+
parentCtx: TCtx,
|
|
61
|
+
overrides: ForkCtxOverrides = {},
|
|
62
|
+
reset: readonly ForkCtxResetKey[] = DEFAULT_RESET_KEYS
|
|
63
|
+
): TCtx => {
|
|
64
|
+
const forked: TCtx = { ...parentCtx };
|
|
65
|
+
for (const key of reset) {
|
|
66
|
+
forked[key as keyof TCtx] = undefined as TCtx[keyof TCtx];
|
|
67
|
+
}
|
|
68
|
+
return { ...forked, ...overrides };
|
|
69
|
+
};
|