@ontrails/core 1.0.0-beta.15 → 1.0.0-beta.17
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 +69 -0
- package/README.md +64 -19
- package/package.json +9 -8
- 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/context.ts +4 -0
- package/src/{internal/cross-batch.ts → cross-batch.ts} +3 -11
- package/src/detours.ts +8 -0
- package/src/draft.ts +4 -0
- package/src/error-projection.ts +51 -0
- package/src/errors.ts +192 -39
- package/src/execute.ts +443 -44
- package/src/fire.ts +965 -91
- package/src/index.ts +285 -38
- package/src/layer-projection.ts +192 -0
- package/src/layer.ts +32 -1
- package/src/observe.ts +361 -0
- package/src/permits.ts +12 -0
- package/src/redaction/patterns.ts +6 -3
- package/src/resilience.ts +8 -8
- package/src/resource-config.ts +477 -44
- package/src/resource.ts +21 -1
- package/src/result.ts +18 -0
- package/src/run.ts +2 -2
- package/src/schedule-runtime.ts +689 -0
- package/src/schedule.ts +324 -0
- package/src/serialization.ts +90 -57
- package/src/signal-diagnostics.ts +633 -0
- package/src/{internal/signal-ref.ts → signal-ref.ts} +1 -1
- package/src/signal.ts +37 -0
- package/src/store/accessor-protocol.ts +5 -5
- package/src/structured-examples.ts +245 -0
- package/src/surface-derivation.ts +91 -0
- package/src/surface-filter.ts +7 -13
- package/src/topo.ts +386 -6
- package/src/tracing.ts +345 -0
- package/src/trail.ts +168 -22
- package/src/trails/derive-trail.ts +1 -1
- package/src/trails/ingest.ts +7 -15
- package/src/{internal/trails-db.ts → trails-db.ts} +42 -21
- package/src/transport-error-map.ts +146 -28
- package/src/types.ts +82 -28
- package/src/validate-established-topo.ts +6 -0
- package/src/validate-topo.ts +212 -5
- package/src/validation.ts +58 -1
- package/src/webhook.ts +276 -0
- package/src/{internal/zod-wrappers.ts → zod-wrappers.ts} +0 -6
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +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 -22
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -37
- package/dist/context.js.map +0 -1
- package/dist/contour.d.ts +0 -81
- package/dist/contour.d.ts.map +0 -1
- package/dist/contour.js +0 -176
- package/dist/contour.js.map +0 -1
- package/dist/cross-schema.d.ts +0 -18
- package/dist/cross-schema.d.ts.map +0 -1
- package/dist/cross-schema.js +0 -29
- package/dist/cross-schema.js.map +0 -1
- package/dist/derive.d.ts +0 -44
- package/dist/derive.d.ts.map +0 -1
- package/dist/derive.js +0 -149
- package/dist/derive.js.map +0 -1
- package/dist/draft.d.ts +0 -28
- package/dist/draft.d.ts.map +0 -1
- package/dist/draft.js +0 -157
- package/dist/draft.js.map +0 -1
- package/dist/errors.d.ts +0 -141
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -185
- package/dist/errors.js.map +0 -1
- package/dist/execute.d.ts +0 -52
- package/dist/execute.d.ts.map +0 -1
- package/dist/execute.js +0 -511
- package/dist/execute.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/fire.d.ts +0 -43
- package/dist/fire.d.ts.map +0 -1
- package/dist/fire.js +0 -185
- package/dist/fire.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/index.d.ts +0 -59
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -61
- package/dist/index.js.map +0 -1
- package/dist/internal/cross-batch.d.ts +0 -44
- package/dist/internal/cross-batch.d.ts.map +0 -1
- package/dist/internal/cross-batch.js +0 -58
- package/dist/internal/cross-batch.js.map +0 -1
- package/dist/internal/fork-ctx.d.ts +0 -41
- package/dist/internal/fork-ctx.d.ts.map +0 -1
- package/dist/internal/fork-ctx.js +0 -47
- package/dist/internal/fork-ctx.js.map +0 -1
- package/dist/internal/signal-ref.d.ts +0 -15
- package/dist/internal/signal-ref.d.ts.map +0 -1
- package/dist/internal/signal-ref.js +0 -41
- package/dist/internal/signal-ref.js.map +0 -1
- package/dist/internal/topo-saves.d.ts +0 -53
- package/dist/internal/topo-saves.d.ts.map +0 -1
- package/dist/internal/topo-saves.js +0 -449
- package/dist/internal/topo-saves.js.map +0 -1
- package/dist/internal/topo-snapshots.d.ts +0 -57
- package/dist/internal/topo-snapshots.d.ts.map +0 -1
- package/dist/internal/topo-snapshots.js +0 -372
- package/dist/internal/topo-snapshots.js.map +0 -1
- package/dist/internal/topo-store-read.d.ts +0 -70
- package/dist/internal/topo-store-read.d.ts.map +0 -1
- package/dist/internal/topo-store-read.js +0 -221
- package/dist/internal/topo-store-read.js.map +0 -1
- package/dist/internal/topo-store.d.ts +0 -26
- package/dist/internal/topo-store.d.ts.map +0 -1
- package/dist/internal/topo-store.js +0 -621
- package/dist/internal/topo-store.js.map +0 -1
- package/dist/internal/tracing.d.ts +0 -98
- package/dist/internal/tracing.d.ts.map +0 -1
- package/dist/internal/tracing.js +0 -102
- package/dist/internal/tracing.js.map +0 -1
- package/dist/internal/trails-db.d.ts +0 -16
- package/dist/internal/trails-db.d.ts.map +0 -1
- package/dist/internal/trails-db.js +0 -118
- package/dist/internal/trails-db.js.map +0 -1
- package/dist/internal/zod-wrappers.d.ts +0 -40
- package/dist/internal/zod-wrappers.d.ts.map +0 -1
- package/dist/internal/zod-wrappers.js +0 -59
- package/dist/internal/zod-wrappers.js.map +0 -1
- package/dist/layer.d.ts +0 -23
- 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/resource-config.d.ts +0 -22
- package/dist/resource-config.d.ts.map +0 -1
- package/dist/resource-config.js +0 -210
- package/dist/resource-config.js.map +0 -1
- package/dist/resource.d.ts +0 -74
- package/dist/resource.d.ts.map +0 -1
- package/dist/resource.js +0 -61
- package/dist/resource.js.map +0 -1
- package/dist/result.d.ts +0 -57
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -156
- package/dist/result.js.map +0 -1
- package/dist/run.d.ts +0 -28
- package/dist/run.d.ts.map +0 -1
- package/dist/run.js +0 -35
- package/dist/run.js.map +0 -1
- package/dist/serialization.d.ts +0 -27
- package/dist/serialization.d.ts.map +0 -1
- package/dist/serialization.js +0 -154
- package/dist/serialization.js.map +0 -1
- package/dist/signal.d.ts +0 -33
- package/dist/signal.d.ts.map +0 -1
- package/dist/signal.js +0 -17
- package/dist/signal.js.map +0 -1
- package/dist/store/accessor-protocol.d.ts +0 -51
- package/dist/store/accessor-protocol.d.ts.map +0 -1
- package/dist/store/accessor-protocol.js +0 -2
- package/dist/store/accessor-protocol.js.map +0 -1
- package/dist/store/index.d.ts +0 -2
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js +0 -2
- package/dist/store/index.js.map +0 -1
- package/dist/surface-filter.d.ts +0 -13
- package/dist/surface-filter.d.ts.map +0 -1
- package/dist/surface-filter.js +0 -76
- package/dist/surface-filter.js.map +0 -1
- package/dist/topo-store.d.ts +0 -62
- package/dist/topo-store.d.ts.map +0 -1
- package/dist/topo-store.js +0 -319
- package/dist/topo-store.js.map +0 -1
- package/dist/topo.d.ts +0 -39
- package/dist/topo.d.ts.map +0 -1
- package/dist/topo.js +0 -241
- package/dist/topo.js.map +0 -1
- package/dist/trail.d.ts +0 -163
- package/dist/trail.d.ts.map +0 -1
- package/dist/trail.js +0 -75
- package/dist/trail.js.map +0 -1
- package/dist/trails/derive-trail.d.ts +0 -66
- package/dist/trails/derive-trail.d.ts.map +0 -1
- package/dist/trails/derive-trail.js +0 -378
- package/dist/trails/derive-trail.js.map +0 -1
- package/dist/trails/index.d.ts +0 -5
- package/dist/trails/index.d.ts.map +0 -1
- package/dist/trails/index.js +0 -3
- package/dist/trails/index.js.map +0 -1
- package/dist/trails/ingest.d.ts +0 -24
- package/dist/trails/ingest.d.ts.map +0 -1
- package/dist/trails/ingest.js +0 -63
- package/dist/trails/ingest.js.map +0 -1
- package/dist/transport-error-map.d.ts +0 -106
- package/dist/transport-error-map.d.ts.map +0 -1
- package/dist/transport-error-map.js +0 -24
- package/dist/transport-error-map.js.map +0 -1
- package/dist/type-checks.test-d.d.ts +0 -71
- package/dist/type-checks.test-d.d.ts.map +0 -1
- package/dist/type-checks.test-d.js +0 -12
- package/dist/type-checks.test-d.js.map +0 -1
- package/dist/type-utils.d.ts +0 -33
- package/dist/type-utils.d.ts.map +0 -1
- package/dist/type-utils.js +0 -12
- package/dist/type-utils.js.map +0 -1
- package/dist/types.d.ts +0 -177
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/validate-established-topo.d.ts +0 -76
- package/dist/validate-established-topo.d.ts.map +0 -1
- package/dist/validate-established-topo.js +0 -43
- package/dist/validate-established-topo.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 -193
- 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 -165
- 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 -77
- package/src/__tests__/contour.test.ts +0 -263
- package/src/__tests__/derive-trail.test.ts +0 -668
- package/src/__tests__/derive.test.ts +0 -260
- package/src/__tests__/errors.test.ts +0 -427
- package/src/__tests__/execute.test.ts +0 -1563
- package/src/__tests__/fetch.test.ts +0 -217
- package/src/__tests__/fire.test.ts +0 -1056
- package/src/__tests__/fork-ctx.test.ts +0 -83
- package/src/__tests__/guards.test.ts +0 -102
- package/src/__tests__/ingest.test.ts +0 -191
- package/src/__tests__/layer.test.ts +0 -125
- 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__/resource.test.ts +0 -204
- package/src/__tests__/result.test.ts +0 -155
- package/src/__tests__/run.test.ts +0 -181
- package/src/__tests__/serialization.test.ts +0 -401
- package/src/__tests__/service-config.test.ts +0 -224
- package/src/__tests__/signal.test.ts +0 -82
- package/src/__tests__/surface-filter.test.ts +0 -196
- package/src/__tests__/topo-store-read.test.ts +0 -256
- package/src/__tests__/topo-store.test.ts +0 -869
- package/src/__tests__/topo.test.ts +0 -573
- package/src/__tests__/trail-permit.test.ts +0 -60
- package/src/__tests__/trail.test.ts +0 -426
- package/src/__tests__/trails-db.test.ts +0 -198
- package/src/__tests__/transport-error-map.test.ts +0 -82
- package/src/__tests__/type-utils.test.ts +0 -118
- package/src/__tests__/validate-topo.test.ts +0 -611
- package/src/__tests__/validation.test.ts +0 -336
- package/src/__tests__/workspace.test.ts +0 -183
- package/src/__tests__/zod-wrappers.test.ts +0 -62
- package/src/internal/topo-snapshots.ts +0 -517
- package/src/internal/topo-store-read.ts +0 -481
- package/src/internal/topo-store.ts +0 -1192
- package/src/internal/tracing.ts +0 -187
- package/src/topo-store.ts +0 -510
- package/src/type-checks.test-d.ts +0 -106
- package/tsconfig.json +0 -9
- package/tsconfig.tests.json +0 -10
- package/tsconfig.tsbuildinfo +0 -1
package/dist/topo.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Application entry point — scans module exports to build a topology graph.
|
|
3
|
-
*/
|
|
4
|
-
import { ValidationError } from './errors.js';
|
|
5
|
-
import { getLateBoundSignalRef, parseLateBoundSignalMarker, } from './internal/signal-ref.js';
|
|
6
|
-
import { isResource } from './resource.js';
|
|
7
|
-
const isRegistrable = (value) => {
|
|
8
|
-
if (typeof value !== 'object' || value === null) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
const { kind } = value;
|
|
12
|
-
return kind === 'contour' || kind === 'trail' || kind === 'signal';
|
|
13
|
-
};
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
// Topo implementation
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
|
-
const createTopo = (identity, contours, trails, signals, resources) => ({
|
|
18
|
-
contourCount: contours.size,
|
|
19
|
-
contourIds() {
|
|
20
|
-
return [...contours.keys()];
|
|
21
|
-
},
|
|
22
|
-
contours,
|
|
23
|
-
count: trails.size,
|
|
24
|
-
get(id) {
|
|
25
|
-
return trails.get(id);
|
|
26
|
-
},
|
|
27
|
-
getContour(contourName) {
|
|
28
|
-
return contours.get(contourName);
|
|
29
|
-
},
|
|
30
|
-
getResource(id) {
|
|
31
|
-
return resources.get(id);
|
|
32
|
-
},
|
|
33
|
-
has(id) {
|
|
34
|
-
return trails.has(id);
|
|
35
|
-
},
|
|
36
|
-
hasContour(contourName) {
|
|
37
|
-
return contours.has(contourName);
|
|
38
|
-
},
|
|
39
|
-
hasResource(id) {
|
|
40
|
-
return resources.has(id);
|
|
41
|
-
},
|
|
42
|
-
ids() {
|
|
43
|
-
return [...trails.keys()];
|
|
44
|
-
},
|
|
45
|
-
list() {
|
|
46
|
-
return [...trails.values()];
|
|
47
|
-
},
|
|
48
|
-
listContours() {
|
|
49
|
-
return [...contours.values()];
|
|
50
|
-
},
|
|
51
|
-
listResources() {
|
|
52
|
-
return [...resources.values()];
|
|
53
|
-
},
|
|
54
|
-
listSignals() {
|
|
55
|
-
return [...signals.values()];
|
|
56
|
-
},
|
|
57
|
-
name: identity.name,
|
|
58
|
-
...(identity.version !== undefined && { version: identity.version }),
|
|
59
|
-
...(identity.description !== undefined && {
|
|
60
|
-
description: identity.description,
|
|
61
|
-
}),
|
|
62
|
-
resourceCount: resources.size,
|
|
63
|
-
resourceIds() {
|
|
64
|
-
return [...resources.keys()];
|
|
65
|
-
},
|
|
66
|
-
resources,
|
|
67
|
-
signals,
|
|
68
|
-
trails,
|
|
69
|
-
});
|
|
70
|
-
// ---------------------------------------------------------------------------
|
|
71
|
-
// topo()
|
|
72
|
-
// ---------------------------------------------------------------------------
|
|
73
|
-
const registerUnique = (collection, id, value, duplicateMessage) => {
|
|
74
|
-
const existing = collection.get(id);
|
|
75
|
-
if (existing === value) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (existing !== undefined) {
|
|
79
|
-
throw new ValidationError(duplicateMessage);
|
|
80
|
-
}
|
|
81
|
-
collection.set(id, value);
|
|
82
|
-
};
|
|
83
|
-
const registerContour = (contour, contours) => {
|
|
84
|
-
registerUnique(contours, contour.name, contour, `Duplicate contour name: "${contour.name}"`);
|
|
85
|
-
};
|
|
86
|
-
const registerResourceValue = (resource, resources) => {
|
|
87
|
-
registerUnique(resources, resource.id, resource, `Duplicate resource ID: "${resource.id}"`);
|
|
88
|
-
};
|
|
89
|
-
const registerSignal = (signal, signals) => {
|
|
90
|
-
registerUnique(signals, signal.id, signal, `Duplicate signal ID: "${signal.id}"`);
|
|
91
|
-
};
|
|
92
|
-
const registerResourceSignals = (resource, signals) => {
|
|
93
|
-
for (const derived of resource.signals ?? []) {
|
|
94
|
-
registerSignal(derived, signals);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const registerTrail = (trail, trails) => {
|
|
98
|
-
registerUnique(trails, trail.id, trail, `Duplicate trail ID: "${trail.id}"`);
|
|
99
|
-
};
|
|
100
|
-
const registerLateBoundSignalId = (byToken, signal) => {
|
|
101
|
-
const ref = getLateBoundSignalRef(signal);
|
|
102
|
-
if (!ref) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const ids = byToken.get(ref.token) ?? new Set();
|
|
106
|
-
ids.add(signal.id);
|
|
107
|
-
byToken.set(ref.token, ids);
|
|
108
|
-
};
|
|
109
|
-
const collectLateBoundSignalIdsByToken = (resources) => {
|
|
110
|
-
const byToken = new Map();
|
|
111
|
-
for (const resource of resources.values()) {
|
|
112
|
-
for (const signal of resource.signals ?? []) {
|
|
113
|
-
registerLateBoundSignalId(byToken, signal);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return new Map([...byToken.entries()].map(([token, ids]) => [token, [...ids]]));
|
|
117
|
-
};
|
|
118
|
-
const resolveLateBoundSignalId = (trailId, signalId, lateBoundSignalIdsByToken) => {
|
|
119
|
-
const marker = parseLateBoundSignalMarker(signalId);
|
|
120
|
-
if (!marker) {
|
|
121
|
-
return signalId;
|
|
122
|
-
}
|
|
123
|
-
const matches = lateBoundSignalIdsByToken.get(marker.token) ?? [];
|
|
124
|
-
if (matches.length === 1) {
|
|
125
|
-
return matches[0] ?? signalId;
|
|
126
|
-
}
|
|
127
|
-
if (matches.length === 0) {
|
|
128
|
-
// Intentional throw: split-topo composition (where a trail and the
|
|
129
|
-
// store that backs its signals live in different topos) is not yet
|
|
130
|
-
// supported. Failing loudly here surfaces the case at assembly time
|
|
131
|
-
// instead of silently producing a trail with an unresolved store
|
|
132
|
-
// reference that would misbehave at runtime.
|
|
133
|
-
throw new ValidationError(`Trail "${trailId}" references store-derived signal "${marker.displayId}", but no resource bound in this topo exposes it. ` +
|
|
134
|
-
'This usually means the store that backs this signal is not bound in this topo. ' +
|
|
135
|
-
`Bind the store via resource() in the same topo() call as "${trailId}", or compose this topo with the topo that binds the store. ` +
|
|
136
|
-
'Splitting a trail and its backing store across independent topos is not yet supported.');
|
|
137
|
-
}
|
|
138
|
-
throw new ValidationError(`Trail "${trailId}" references late-bound signal "${marker.displayId}" but it resolves to multiple bound resource signals: ${matches.join(', ')}. Use canonical scoped ids when the same store definition is bound more than once.`);
|
|
139
|
-
};
|
|
140
|
-
const resolveTrailSignalIds = (trailId, signalIds, lateBoundSignalIdsByToken) => {
|
|
141
|
-
let changed = false;
|
|
142
|
-
const ids = Object.freeze(signalIds.map((signalId) => {
|
|
143
|
-
const resolved = resolveLateBoundSignalId(trailId, signalId, lateBoundSignalIdsByToken);
|
|
144
|
-
changed ||= resolved !== signalId;
|
|
145
|
-
return resolved;
|
|
146
|
-
}));
|
|
147
|
-
return { changed, ids };
|
|
148
|
-
};
|
|
149
|
-
const finalizeTrailSignals = (trails, resources) => {
|
|
150
|
-
const lateBoundSignalIdsByToken = collectLateBoundSignalIdsByToken(resources);
|
|
151
|
-
const finalized = new Map();
|
|
152
|
-
for (const trail of trails.values()) {
|
|
153
|
-
const resolvedFires = resolveTrailSignalIds(trail.id, trail.fires ?? [], lateBoundSignalIdsByToken);
|
|
154
|
-
const resolvedOn = resolveTrailSignalIds(trail.id, trail.on ?? [], lateBoundSignalIdsByToken);
|
|
155
|
-
if (!resolvedFires.changed && !resolvedOn.changed) {
|
|
156
|
-
finalized.set(trail.id, trail);
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
finalized.set(trail.id, Object.freeze({
|
|
160
|
-
...trail,
|
|
161
|
-
fires: resolvedFires.ids,
|
|
162
|
-
on: resolvedOn.ids,
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
return finalized;
|
|
166
|
-
};
|
|
167
|
-
/** Register a single registrable value into the appropriate map. */
|
|
168
|
-
const register = (value, contours, trails, signals, resources) => {
|
|
169
|
-
switch (value.kind) {
|
|
170
|
-
case 'contour': {
|
|
171
|
-
registerContour(value, contours);
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
case 'resource': {
|
|
175
|
-
registerResourceValue(value, resources);
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
case 'signal': {
|
|
179
|
-
registerSignal(value, signals);
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
case 'trail': {
|
|
183
|
-
registerTrail(value, trails);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
default: {
|
|
187
|
-
throw new ValidationError('Unsupported registrable value in topo()');
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
const registerTrailContours = (trail, contours, trails, signals, resources) => {
|
|
192
|
-
for (const contour of trail.contours ?? []) {
|
|
193
|
-
register(contour, contours, trails, signals, resources);
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
const markUniqueObject = (value, seenValues) => {
|
|
197
|
-
if (typeof value !== 'object' || value === null) {
|
|
198
|
-
return true;
|
|
199
|
-
}
|
|
200
|
-
if (seenValues.has(value)) {
|
|
201
|
-
return false;
|
|
202
|
-
}
|
|
203
|
-
seenValues.add(value);
|
|
204
|
-
return true;
|
|
205
|
-
};
|
|
206
|
-
const registerModuleValue = (value, contours, trails, signals, resources) => {
|
|
207
|
-
if (isResource(value) || isRegistrable(value)) {
|
|
208
|
-
register(value, contours, trails, signals, resources);
|
|
209
|
-
}
|
|
210
|
-
if (isResource(value)) {
|
|
211
|
-
registerResourceSignals(value, signals);
|
|
212
|
-
}
|
|
213
|
-
if (typeof value === 'object' &&
|
|
214
|
-
value !== null &&
|
|
215
|
-
value.kind === 'trail') {
|
|
216
|
-
registerTrailContours(value, contours, trails, signals, resources);
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
const registerModuleValues = (mod, contours, trails, signals, resources) => {
|
|
220
|
-
const seenValues = new WeakSet();
|
|
221
|
-
for (const value of Object.values(mod)) {
|
|
222
|
-
if (!markUniqueObject(value, seenValues)) {
|
|
223
|
-
continue;
|
|
224
|
-
}
|
|
225
|
-
registerModuleValue(value, contours, trails, signals, resources);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
export const topo = (nameOrIdentity, ...modules) => {
|
|
229
|
-
const identity = typeof nameOrIdentity === 'string'
|
|
230
|
-
? { name: nameOrIdentity }
|
|
231
|
-
: nameOrIdentity;
|
|
232
|
-
const contours = new Map();
|
|
233
|
-
const trails = new Map();
|
|
234
|
-
const signals = new Map();
|
|
235
|
-
const resources = new Map();
|
|
236
|
-
for (const mod of modules) {
|
|
237
|
-
registerModuleValues(mod, contours, trails, signals, resources);
|
|
238
|
-
}
|
|
239
|
-
return createTopo(identity, contours, finalizeTrailSignals(trails, resources), signals, resources);
|
|
240
|
-
};
|
|
241
|
-
//# sourceMappingURL=topo.js.map
|
package/dist/topo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"topo.js","sourceRoot":"","sources":["../src/topo.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA6C3C,MAAM,aAAa,GAAG,CAAC,KAAc,EAAwB,EAAE;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,EAA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MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;YACzC,SAAS;QACX,CAAC;QACD,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,cAAqC,EACrC,GAAG,OAAkC,EAC/B,EAAE;IACR,MAAM,QAAQ,GACZ,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE;QAC1B,CAAC,CAAC,cAAc,CAAC;IAErB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEjD,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,oBAAoB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,UAAU,CACf,QAAQ,EACR,QAAQ,EACR,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC,EACvC,OAAO,EACP,SAAS,CACV,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/trail.d.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { AnyContour } from './contour.js';
|
|
3
|
-
import type { FieldOverride } from './derive.js';
|
|
4
|
-
import type { Result } from './result.js';
|
|
5
|
-
import type { AnyResource } from './resource.js';
|
|
6
|
-
import type { AnySignal } from './signal.js';
|
|
7
|
-
import type { TrailsError } from './errors.js';
|
|
8
|
-
import type { Detour, Implementation, PermitRequirement, TrailContext } from './types.js';
|
|
9
|
-
/**
|
|
10
|
-
* A named example for documentation and testing.
|
|
11
|
-
*
|
|
12
|
-
* The `input` field accepts `Partial<I>` so that fields with schema defaults
|
|
13
|
-
* (e.g. `z.number().default(20)`) can be omitted from examples. The schema
|
|
14
|
-
* fills in defaults at validation time.
|
|
15
|
-
*/
|
|
16
|
-
export interface TrailExample<I, O> {
|
|
17
|
-
/** Human-readable name */
|
|
18
|
-
readonly name: string;
|
|
19
|
-
/** Optional description of what this example demonstrates */
|
|
20
|
-
readonly description?: string | undefined;
|
|
21
|
-
/** The input value — fields with schema defaults may be omitted */
|
|
22
|
-
readonly input: Partial<I>;
|
|
23
|
-
/** Expected output for success-path examples (deep equality) */
|
|
24
|
-
readonly expected?: O | undefined;
|
|
25
|
-
/** Partial output assertion — declared fields must match, others ignored */
|
|
26
|
-
readonly expectedMatch?: Partial<O> | undefined;
|
|
27
|
-
/** Error class name for error-path examples */
|
|
28
|
-
readonly error?: string | undefined;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The input type received by a trail's blaze function.
|
|
32
|
-
*
|
|
33
|
-
* When a trail declares `crossInput`, the runtime merges those fields into
|
|
34
|
-
* the input object before calling blaze. This type makes the compiler aware
|
|
35
|
-
* of the merged shape so developers can access crossInput fields without a
|
|
36
|
-
* cast. Falls back to plain `I` when `CI` is `never` (the default).
|
|
37
|
-
*/
|
|
38
|
-
export type BlazeInput<I, CI> = [CI] extends [never] ? I : I & CI;
|
|
39
|
-
/** Everything needed to define a trail (minus the id) */
|
|
40
|
-
export interface TrailSpec<I, O, CI = never> {
|
|
41
|
-
/** Zod schema for validating input */
|
|
42
|
-
readonly input: z.ZodType<I>;
|
|
43
|
-
/** Zod schema for validating output (optional — some trails are fire-and-forget) */
|
|
44
|
-
readonly output?: z.ZodType<O> | undefined;
|
|
45
|
-
/** The pure function that does the work (sync or async authoring) */
|
|
46
|
-
readonly blaze: Implementation<BlazeInput<I, CI>, O>;
|
|
47
|
-
/** Human-readable description */
|
|
48
|
-
readonly description?: string | undefined;
|
|
49
|
-
/** Declared operational shape for governance, derivation, and agent guidance. */
|
|
50
|
-
readonly pattern?: string | undefined;
|
|
51
|
-
/** Named examples for docs and testing */
|
|
52
|
-
readonly examples?: readonly TrailExample<I, O>[] | undefined;
|
|
53
|
-
/** What this trail does to the world: read, write (default), or destroy */
|
|
54
|
-
readonly intent?: 'read' | 'write' | 'destroy' | undefined;
|
|
55
|
-
/** Trail is idempotent (safe to retry) */
|
|
56
|
-
readonly idempotent?: boolean | undefined;
|
|
57
|
-
/** Whether trailheads expose this trail by default. */
|
|
58
|
-
readonly visibility?: TrailVisibility | undefined;
|
|
59
|
-
/** Arbitrary meta for tooling and filtering */
|
|
60
|
-
readonly meta?: Readonly<Record<string, unknown>> | undefined;
|
|
61
|
-
/** Recovery paths activated when blaze fails with a matching error class. */
|
|
62
|
-
readonly detours?: readonly Detour<I, O, TrailsError>[] | undefined;
|
|
63
|
-
/** Per-field overrides for deriveFields() (labels, hints, options) */
|
|
64
|
-
readonly fields?: Readonly<Record<string, FieldOverride>> | undefined;
|
|
65
|
-
/** Contours this trail operates on. */
|
|
66
|
-
readonly contours?: readonly AnyContour[] | undefined;
|
|
67
|
-
/** IDs or trail objects of downstream trails this trail may invoke via ctx.cross() */
|
|
68
|
-
readonly crosses?: readonly (string | AnyTrail)[] | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Composition-only input schema — merged with `input` for `ctx.cross()` calls,
|
|
71
|
-
* invisible to public trailheads (CLI, MCP, HTTP).
|
|
72
|
-
*
|
|
73
|
-
* Fields here are available in the blaze but are not derived into CLI flags,
|
|
74
|
-
* MCP tool parameters, or HTTP request bodies. Use for data that only makes
|
|
75
|
-
* sense when one trail crosses another (e.g. `forkedFrom`).
|
|
76
|
-
*/
|
|
77
|
-
readonly crossInput?: z.ZodType<CI> | undefined;
|
|
78
|
-
/** Resources this trail may access via resource.from(ctx) */
|
|
79
|
-
readonly resources?: readonly AnyResource[] | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Signals this trail emits via `ctx.fire()`.
|
|
82
|
-
*
|
|
83
|
-
* Accepts either a string id or a `Signal` value. Both forms are
|
|
84
|
-
* normalized to the signal's id at trail definition time, so
|
|
85
|
-
* `trail.fires` is always `readonly string[]`.
|
|
86
|
-
*
|
|
87
|
-
* Note: `crosses` also accepts trail objects (normalized to IDs),
|
|
88
|
-
* following the same pattern as signal references here.
|
|
89
|
-
*/
|
|
90
|
-
readonly fires?: readonly (string | AnySignal)[] | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* Signals that activate this trail (framework auto-subscribes).
|
|
93
|
-
*
|
|
94
|
-
* Accepts either a string id or a `Signal` value. Both forms are
|
|
95
|
-
* normalized to the signal's id at trail definition time.
|
|
96
|
-
*/
|
|
97
|
-
readonly on?: readonly (string | AnySignal)[] | undefined;
|
|
98
|
-
/** Auth requirement: scopes object, 'public', or omitted (undeclared) */
|
|
99
|
-
readonly permit?: PermitRequirement | undefined;
|
|
100
|
-
/** Primary input fields and their order. CLI projects as positional args. */
|
|
101
|
-
readonly args?: readonly string[] | false | undefined;
|
|
102
|
-
}
|
|
103
|
-
/** Intent describes what a trail does to the world */
|
|
104
|
-
export type Intent = 'read' | 'write' | 'destroy';
|
|
105
|
-
/** Whether trailheads expose a trail by default. */
|
|
106
|
-
export type TrailVisibility = 'public' | 'internal';
|
|
107
|
-
/** A fully-defined trail — the unit of work in the Trails system */
|
|
108
|
-
export interface Trail<I, O, CI = never> extends Omit<TrailSpec<I, O, CI>, 'args' | 'blaze' | 'contours' | 'crosses' | 'crossInput' | 'detours' | 'fires' | 'intent' | 'on' | 'resources'> {
|
|
109
|
-
readonly kind: 'trail';
|
|
110
|
-
readonly id: string;
|
|
111
|
-
readonly blaze: Implementation<BlazeInput<I, CI>, O>;
|
|
112
|
-
/** Contours this trail operates on (always present, default []). */
|
|
113
|
-
readonly contours: readonly AnyContour[];
|
|
114
|
-
/** IDs of downstream trails this trail may invoke via ctx.cross() (always present, default []) */
|
|
115
|
-
readonly crosses: readonly string[];
|
|
116
|
-
/** Composition-only input schema, merged with `input` for ctx.cross() calls (optional) */
|
|
117
|
-
readonly crossInput?: z.ZodType<CI> | undefined;
|
|
118
|
-
/** Recovery paths activated when blaze fails with a matching error (always present, default []). */
|
|
119
|
-
readonly detours: readonly Detour<I, O, TrailsError>[];
|
|
120
|
-
/** Resources this trail may access via resource.from(ctx) (always present, default []) */
|
|
121
|
-
readonly resources: readonly AnyResource[];
|
|
122
|
-
/** IDs of signals this trail emits via ctx.fire() (always present, default []) */
|
|
123
|
-
readonly fires: readonly string[];
|
|
124
|
-
/** IDs of signals that activate this trail (always present, default []) */
|
|
125
|
-
readonly on: readonly string[];
|
|
126
|
-
/** What this trail does to the world (always present, default 'write') */
|
|
127
|
-
readonly intent: Intent;
|
|
128
|
-
/** Whether trailheads expose this trail by default (always present, default 'public'). */
|
|
129
|
-
readonly visibility: TrailVisibility;
|
|
130
|
-
/** Primary input fields and their order (always present, default undefined) */
|
|
131
|
-
readonly args?: readonly string[] | false | undefined;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Create a trail definition.
|
|
135
|
-
*
|
|
136
|
-
* Returns a frozen object with `kind: "trail"` and all spec fields.
|
|
137
|
-
* The trail is inert until handed to a runner.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* // ID as first argument (recommended for human authoring)
|
|
142
|
-
* const show = trail("entity.show", {
|
|
143
|
-
* input: z.object({ name: z.string() }),
|
|
144
|
-
* blaze: (input) => Result.ok(entity),
|
|
145
|
-
* });
|
|
146
|
-
*
|
|
147
|
-
* // Full spec object (for programmatic generation)
|
|
148
|
-
* const show = trail({
|
|
149
|
-
* id: "entity.show",
|
|
150
|
-
* input: z.object({ name: z.string() }),
|
|
151
|
-
* blaze: (input) => Result.ok(entity),
|
|
152
|
-
* });
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
export declare function trail<I, O, CI = never>(id: string, spec: TrailSpec<I, O, CI>): Trail<I, O, CI>;
|
|
156
|
-
export declare function trail<I, O, CI = never>(spec: TrailSpec<I, O, CI> & {
|
|
157
|
-
readonly id: string;
|
|
158
|
-
}): Trail<I, O, CI>;
|
|
159
|
-
export type AnyTrail = Omit<Trail<any, any, any>, 'blaze'> & {
|
|
160
|
-
readonly blaze: Implementation<any, any>;
|
|
161
|
-
};
|
|
162
|
-
export type { Implementation, TrailContext, Result };
|
|
163
|
-
//# sourceMappingURL=trail.d.ts.map
|
package/dist/trail.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trail.d.ts","sourceRoot":"","sources":["../src/trail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,YAAY,EACb,MAAM,YAAY,CAAC;AAMpB;;;;;;GAMG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,CAAC;IAChC,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,C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C3E,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,KAAK,GAAG,SAAS,CAAC;CACvD;AAsED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,EACpC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACxB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACnB,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,EACpC,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAClD,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAiDnB,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG;IAC3D,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAC1C,CAAC;AAGF,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/trail.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { createLateBoundSignalMarker, getLateBoundSignalRef, } from './internal/signal-ref.js';
|
|
2
|
-
// ---------------------------------------------------------------------------
|
|
3
|
-
// Factory
|
|
4
|
-
// ---------------------------------------------------------------------------
|
|
5
|
-
/**
|
|
6
|
-
* Canonical scoped-signal id shape: `<scope>:<table>.<event>`.
|
|
7
|
-
*
|
|
8
|
-
* Matches exactly one `:` separating a non-empty scope from a non-empty
|
|
9
|
-
* dotted tail of at least two segments (e.g. `identity:users.created`).
|
|
10
|
-
* The scope forbids only `:` and whitespace so resource ids may contain
|
|
11
|
-
* dots for namespacing (e.g. `demo.store:gists.created`). Tail segments
|
|
12
|
-
* forbid both `:` and `.` so strings like `foo:bar` (no dot) or
|
|
13
|
-
* `a:b.c.d` stay unambiguous.
|
|
14
|
-
*/
|
|
15
|
-
const SCOPED_SIGNAL_ID = /^[^:\s]+:[^:.\s]+(?:\.[^:.\s]+)+$/;
|
|
16
|
-
const normalizeSignalRef = (entry) => {
|
|
17
|
-
if (typeof entry === 'string') {
|
|
18
|
-
return entry;
|
|
19
|
-
}
|
|
20
|
-
const ref = getLateBoundSignalRef(entry);
|
|
21
|
-
if (!ref) {
|
|
22
|
-
return entry.id;
|
|
23
|
-
}
|
|
24
|
-
// Already-scoped canonical ids (e.g. "identity:users.created") must pass
|
|
25
|
-
// through unchanged. Rewriting them to a bare marker token collapses
|
|
26
|
-
// multi-binding cases where the same store definition is bound under two
|
|
27
|
-
// separate resources: both bindings share the late-bound token, so the
|
|
28
|
-
// caller's explicit choice of scope would be lost and topo resolution
|
|
29
|
-
// would throw an ambiguity error.
|
|
30
|
-
//
|
|
31
|
-
// Use a strict predicate that matches the canonical scoped shape
|
|
32
|
-
// `<scope>:<table>.<event>` (exactly one `:` separating a non-empty scope
|
|
33
|
-
// from a non-empty dotted tail of at least two segments). A looser
|
|
34
|
-
// `includes(':')` check would let unscoped ids that happen to contain `:`
|
|
35
|
-
// slip past markerization and then fail to resolve at topo finalization.
|
|
36
|
-
if (SCOPED_SIGNAL_ID.test(entry.id)) {
|
|
37
|
-
return entry.id;
|
|
38
|
-
}
|
|
39
|
-
return createLateBoundSignalMarker(ref, entry.id);
|
|
40
|
-
};
|
|
41
|
-
/** Normalize a crosses entry — trail objects are reduced to their id. */
|
|
42
|
-
const normalizeCrossRef = (entry) => typeof entry === 'string' ? entry : entry.id;
|
|
43
|
-
/** Freeze and normalize all collection fields from a trail spec. */
|
|
44
|
-
const normalizeCollections = (spec) => ({
|
|
45
|
-
args: Array.isArray(spec.args) ? Object.freeze([...spec.args]) : spec.args,
|
|
46
|
-
contours: Object.freeze([...(spec.contours ?? [])]),
|
|
47
|
-
detours: Object.freeze([...(spec.detours ?? [])]),
|
|
48
|
-
fires: Object.freeze((spec.fires ?? []).map(normalizeSignalRef)),
|
|
49
|
-
on: Object.freeze((spec.on ?? []).map(normalizeSignalRef)),
|
|
50
|
-
resources: Object.freeze([...(spec.resources ?? [])]),
|
|
51
|
-
});
|
|
52
|
-
export function trail(idOrSpec, maybeSpec) {
|
|
53
|
-
const resolved = typeof idOrSpec === 'string'
|
|
54
|
-
? { id: idOrSpec, spec: maybeSpec }
|
|
55
|
-
: { id: idOrSpec.id, spec: idOrSpec };
|
|
56
|
-
if (!resolved.spec) {
|
|
57
|
-
throw new TypeError('trail() requires a spec when an id is provided');
|
|
58
|
-
}
|
|
59
|
-
const { blaze, crossInput, crosses: rawCrosses, intent: rawIntent, visibility: rawVisibility,
|
|
60
|
-
// Destructure away fields handled by normalizeCollections
|
|
61
|
-
args: _a, contours: _c, detours: _d, fires: _f, on: _o, resources: _r, ...spec } = resolved.spec;
|
|
62
|
-
const collections = normalizeCollections(resolved.spec);
|
|
63
|
-
return Object.freeze({
|
|
64
|
-
...spec,
|
|
65
|
-
...collections,
|
|
66
|
-
blaze: async (input, ctx) => await blaze(input, ctx),
|
|
67
|
-
crossInput,
|
|
68
|
-
crosses: Object.freeze((rawCrosses ?? []).map(normalizeCrossRef)),
|
|
69
|
-
id: resolved.id,
|
|
70
|
-
intent: rawIntent ?? 'write',
|
|
71
|
-
kind: 'trail',
|
|
72
|
-
visibility: rawVisibility ?? 'public',
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=trail.js.map
|
package/dist/trail.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trail.js","sourceRoot":"","sources":["../src/trail.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAuKlC,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAAG,mCAAmC,CAAC;AAE7D,MAAM,kBAAkB,GAAG,CAAC,KAAyB,EAAU,EAAE;IAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,KAAK,CAAC,EAAE,CAAC;IAClB,CAAC;IAED,yEAAyE;IACzE,qEAAqE;IACrE,yEAAyE;IACzE,uEAAuE;IACvE,sEAAsE;IACtE,kCAAkC;IAClC,EAAE;IACF,iEAAiE;IACjE,0EAA0E;IAC1E,mEAAmE;IACnE,0EAA0E;IAC1E,yEAAyE;IACzE,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC,EAAE,CAAC;IAClB,CAAC;IAED,OAAO,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,yEAAyE;AACzE,MAAM,iBAAiB,GAAG,CAAC,KAAwB,EAAU,EAAE,CAC7D,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;AAE/C,oEAAoE;AACpE,MAAM,oBAAoB,GAAG,CAC3B,IAAyB,EAQzB,EAAE,CAAC,CAAC;IACJ,IAAI,EAAE,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,UAAU,EAAE,aAAa;IACzB,0DAA0D;IAC1D,IAAI,EAAE,EAAE,EACR,QAAQ,EAAE,EAAE,EACZ,OAAO,EAAE,EAAE,EACX,KAAK,EAAE,EAAE,EACT,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,EAAE,EACb,GAAG,IAAI,EACR,GAAG,QAAQ,CAAC,IAAI,CAAC;IAClB,MAAM,WAAW,GAAG,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAExD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,IAAI;QACP,GAAG,WAAW;QACd,KAAK,EAAE,KAAK,EAAE,KAAwB,EAAE,GAAiB,EAAE,EAAE,CAC3D,MAAM,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;QACzB,UAAU;QACV,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACjE,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,MAAM,EAAE,SAAS,IAAI,OAAO;QAC5B,IAAI,EAAE,OAAgB;QACtB,UAAU,EAAE,aAAa,IAAI,QAAQ;KACtC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { AnyContour } from '../contour.js';
|
|
3
|
-
import type { AnyResource } from '../resource.js';
|
|
4
|
-
import type { Trail, TrailSpec } from '../trail.js';
|
|
5
|
-
import type { Implementation } from '../types.js';
|
|
6
|
-
/**
|
|
7
|
-
* CRUD-shaped operations the base trail derivation helper understands.
|
|
8
|
-
*/
|
|
9
|
-
export type DeriveTrailOperation = 'create' | 'read' | 'update' | 'delete' | 'list';
|
|
10
|
-
type ContourInput<TContour extends AnyContour> = z.input<TContour>;
|
|
11
|
-
type ContourOutput<TContour extends AnyContour> = z.output<TContour>;
|
|
12
|
-
type ContourFieldKey<TContour extends AnyContour> = Extract<keyof ContourOutput<TContour>, string>;
|
|
13
|
-
type IdentityKey<TContour extends AnyContour> = Extract<TContour['identity'], keyof ContourInput<TContour> & string>;
|
|
14
|
-
type GeneratedKey<TContour extends AnyContour, TGenerated extends readonly ContourFieldKey<TContour>[] | undefined> = TGenerated extends readonly ContourFieldKey<TContour>[] ? TGenerated[number] : never;
|
|
15
|
-
type CreateInputOf<TContour extends AnyContour, TGenerated extends readonly ContourFieldKey<TContour>[] | undefined> = Omit<ContourInput<TContour>, Extract<GeneratedKey<TContour, TGenerated>, keyof ContourInput<TContour>>>;
|
|
16
|
-
type ReadInputOf<TContour extends AnyContour> = Pick<ContourInput<TContour>, IdentityKey<TContour>>;
|
|
17
|
-
type UpdateInputOf<TContour extends AnyContour, TGenerated extends readonly ContourFieldKey<TContour>[] | undefined> = ReadInputOf<TContour> & Partial<Omit<CreateInputOf<TContour, TGenerated>, IdentityKey<TContour>>>;
|
|
18
|
-
type ListInputOf<TContour extends AnyContour> = Partial<ContourInput<TContour>>;
|
|
19
|
-
/**
|
|
20
|
-
* Input shape derived for one operation against one contour.
|
|
21
|
-
*/
|
|
22
|
-
export type DeriveTrailInput<TContour extends AnyContour, TOperation extends DeriveTrailOperation, TGenerated extends readonly ContourFieldKey<TContour>[] | undefined = readonly ContourFieldKey<TContour>[] | undefined> = TOperation extends 'create' ? CreateInputOf<TContour, TGenerated> : TOperation extends 'read' | 'delete' ? ReadInputOf<TContour> : TOperation extends 'update' ? UpdateInputOf<TContour, TGenerated> : ListInputOf<TContour>;
|
|
23
|
-
/**
|
|
24
|
-
* Output shape derived for one operation against one contour.
|
|
25
|
-
*/
|
|
26
|
-
export type DeriveTrailOutput<TContour extends AnyContour, TOperation extends DeriveTrailOperation> = TOperation extends 'delete' ? undefined : TOperation extends 'list' ? ContourOutput<TContour>[] : ContourOutput<TContour>;
|
|
27
|
-
/**
|
|
28
|
-
* Extra authored data accepted by `deriveTrail()` in addition to the
|
|
29
|
-
* operation-derived contract pieces.
|
|
30
|
-
*
|
|
31
|
-
* `blaze` is optional for single-resource calls: when omitted, the helper
|
|
32
|
-
* synthesizes a default blaze that delegates to the resource's accessor via
|
|
33
|
-
* the structural {@link StoreAccessorProtocol}. When multiple resources are
|
|
34
|
-
* declared, an explicit `blaze` is required.
|
|
35
|
-
*/
|
|
36
|
-
export interface DeriveTrailSpec<TContour extends AnyContour, TOperation extends DeriveTrailOperation, TGenerated extends readonly ContourFieldKey<TContour>[] | undefined = readonly ContourFieldKey<TContour>[] | undefined> extends Omit<TrailSpec<DeriveTrailInput<TContour, TOperation, TGenerated>, DeriveTrailOutput<TContour, TOperation>>, 'blaze' | 'contours' | 'examples' | 'input' | 'intent' | 'output' | 'resources'> {
|
|
37
|
-
/**
|
|
38
|
-
* Implementation of the trail. Optional for single-resource calls: when
|
|
39
|
-
* omitted, the helper derives a default blaze from the resource accessor
|
|
40
|
-
* for standard CRUD operations.
|
|
41
|
-
*/
|
|
42
|
-
readonly blaze?: Implementation<DeriveTrailInput<TContour, TOperation, TGenerated>, DeriveTrailOutput<TContour, TOperation>>;
|
|
43
|
-
/**
|
|
44
|
-
* Server-managed fields that should not be writable through derived create
|
|
45
|
-
* and update inputs.
|
|
46
|
-
*/
|
|
47
|
-
readonly generated?: TGenerated;
|
|
48
|
-
/**
|
|
49
|
-
* Resource dependency declared on the derived trail. Pass a single
|
|
50
|
-
* resource for default-blaze synthesis, or an array for multi-resource
|
|
51
|
-
* trails that must provide an explicit `blaze`.
|
|
52
|
-
*/
|
|
53
|
-
readonly resource: AnyResource | readonly AnyResource[];
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Mechanically project one CRUD-shaped trail from a contour declaration.
|
|
57
|
-
*
|
|
58
|
-
* When `spec.blaze` is omitted and the call declares a single resource, the
|
|
59
|
-
* helper derives a default blaze that dispatches to the resource accessor
|
|
60
|
-
* through the structural {@link StoreAccessorProtocol}. Multi-resource calls
|
|
61
|
-
* must supply an explicit blaze and are rejected with {@link DerivationError}
|
|
62
|
-
* at construction time when they do not.
|
|
63
|
-
*/
|
|
64
|
-
export declare const deriveTrail: <TContour extends AnyContour, TOperation extends DeriveTrailOperation, TGenerated extends readonly ContourFieldKey<TContour>[] | undefined = readonly ContourFieldKey<TContour>[] | undefined>(contour: TContour, operation: TOperation, spec: DeriveTrailSpec<TContour, TOperation, TGenerated>) => Trail<DeriveTrailInput<TContour, TOperation, TGenerated>, DeriveTrailOutput<TContour, TOperation>>;
|
|
65
|
-
export {};
|
|
66
|
-
//# sourceMappingURL=derive-trail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"derive-trail.d.ts","sourceRoot":"","sources":["../../src/trails/derive-trail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,OAAO,KAAK,EAAE,KAAK,EAAgB,SAAS,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,aAAa,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,CAAC;AAEX,KAAK,YAAY,CAAC,QAAQ,SAAS,UAAU,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACnE,KAAK,aAAa,CAAC,QAAQ,SAAS,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACrE,KAAK,eAAe,CAAC,QAAQ,SAAS,UAAU,IAAI,OAAO,CACzD,MAAM,aAAa,CAAC,QAAQ,CAAC,EAC7B,MAAM,CACP,CAAC;AACF,KAAK,WAAW,CAAC,QAAQ,SAAS,UAAU,IAAI,OAAO,CACrD,QAAQ,CAAC,UAAU,CAAC,EACpB,MAAM,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