@ontrails/core 1.0.0-beta.1 → 1.0.0-beta.10
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/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +101 -0
- package/README.md +53 -11
- package/dist/derive.d.ts +1 -1
- package/dist/derive.d.ts.map +1 -1
- package/dist/derive.js +4 -1
- package/dist/derive.js.map +1 -1
- package/dist/dispatch.d.ts +27 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/dispatch.js +34 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/event.d.ts +2 -2
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +1 -1
- package/dist/event.js.map +1 -1
- package/dist/execute.d.ts +30 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +64 -0
- package/dist/execute.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/patterns/status.d.ts +1 -1
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +15 -4
- package/dist/result.js.map +1 -1
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +45 -7
- package/dist/serialization.js.map +1 -1
- package/dist/topo.d.ts +4 -4
- package/dist/topo.d.ts.map +1 -1
- package/dist/topo.js +12 -16
- package/dist/topo.js.map +1 -1
- package/dist/trail.d.ts +16 -10
- package/dist/trail.d.ts.map +1 -1
- package/dist/trail.js +4 -2
- package/dist/trail.js.map +1 -1
- package/dist/type-utils.d.ts +24 -0
- package/dist/type-utils.d.ts.map +1 -0
- package/dist/type-utils.js +12 -0
- package/dist/type-utils.js.map +1 -0
- package/dist/types.d.ts +1 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/validate-topo.d.ts +2 -2
- package/dist/validate-topo.d.ts.map +1 -1
- package/dist/validate-topo.js +59 -9
- package/dist/validate-topo.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/context.test.ts +4 -5
- package/src/__tests__/derive.test.ts +44 -0
- package/src/__tests__/dispatch.test.ts +154 -0
- package/src/__tests__/event.test.ts +5 -5
- package/src/__tests__/execute.test.ts +208 -0
- package/src/__tests__/layer.test.ts +11 -111
- package/src/__tests__/serialization.test.ts +166 -1
- package/src/__tests__/topo.test.ts +101 -79
- package/src/__tests__/trail.test.ts +73 -35
- package/src/__tests__/type-utils.test.ts +90 -0
- package/src/__tests__/validate-topo.test.ts +97 -20
- package/src/derive.ts +12 -2
- package/src/dispatch.ts +54 -0
- package/src/event.ts +3 -3
- package/src/execute.ts +96 -0
- package/src/index.ts +22 -18
- package/src/result.ts +18 -4
- package/src/serialization.ts +56 -11
- package/src/topo.ts +18 -23
- package/src/trail.ts +24 -13
- package/src/type-utils.ts +45 -0
- package/src/types.ts +1 -3
- package/src/validate-topo.ts +70 -10
- package/tsconfig.tsbuildinfo +1 -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/src/__tests__/hike.test.ts +0 -117
- package/src/__tests__/job.test.ts +0 -98
- package/src/adapters.ts +0 -68
- package/src/health.ts +0 -23
- package/src/hike.ts +0 -77
- package/src/job.ts +0 -20
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
# @ontrails/core
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Cleanup and hardening pass across all packages.
|
|
8
|
+
|
|
9
|
+
**core**: Deduplicate `DispatchOptions` as type alias of `ExecuteTrailOptions`. Replace `TrailContext` index signature with typed `extensions` field for type safety. Deep-merge `extensions` in `executeTrail` context resolution. Remove unused `Surface` type, `adapters.ts`, `health.ts`, and `job.ts` proof-of-concept from published package.
|
|
10
|
+
|
|
11
|
+
**cli**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `blaze()` with opt-out via `validate: false`.
|
|
12
|
+
|
|
13
|
+
**http**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `blaze()` with opt-out.
|
|
14
|
+
|
|
15
|
+
**mcp**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `blaze()` with opt-out.
|
|
16
|
+
|
|
17
|
+
**warden**: Project-aware rule context preserved in trail wrappers.
|
|
18
|
+
|
|
19
|
+
## 1.0.0-beta.9
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- Consolidated improvements across all surface packages.
|
|
24
|
+
|
|
25
|
+
**core**: Add `TrailResult<T>` utility type, `topo.ids()` and `topo.count` accessors, `dispatch()` for headless trail execution, and extract shared `executeTrail` pipeline used by CLI/MCP/HTTP.
|
|
26
|
+
|
|
27
|
+
**http**: Detect route path collisions and return `Result` from `buildHttpRoutes()`, wire request `AbortSignal` through to trail context, and make write → POST mapping explicit in intent-to-method lookup.
|
|
28
|
+
|
|
29
|
+
**mcp**: Return `Result` from `buildMcpTools()` on collision instead of throwing.
|
|
30
|
+
|
|
31
|
+
**cli**: Verify exception catching via centralized `executeTrail`.
|
|
32
|
+
|
|
33
|
+
**testing**: Follow context awareness improvements.
|
|
34
|
+
|
|
35
|
+
**warden**: Refactor rules as composable trails with examples.
|
|
36
|
+
|
|
37
|
+
**schema**: Error code and empty body fixes.
|
|
38
|
+
|
|
39
|
+
## 1.0.0-beta.8
|
|
40
|
+
|
|
41
|
+
## 1.0.0-beta.7
|
|
42
|
+
|
|
43
|
+
## 1.0.0-beta.6
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Fix Codex review findings on type-utils and follow-declarations.
|
|
48
|
+
|
|
49
|
+
**core**: `inputOf()`/`outputOf()` now preserve the exact Zod schema subtype instead of widening to `z.ZodType`.
|
|
50
|
+
|
|
51
|
+
**warden**: `follow-declarations` rule now recognizes single-object trail overload, detects any context parameter name (not just `ctx`), matches destructured `follow()` calls, resolves const identifiers in `follow` arrays, and restricts run body extraction to top-level config properties.
|
|
52
|
+
|
|
53
|
+
## 1.0.0-beta.5
|
|
54
|
+
|
|
55
|
+
### Minor Changes
|
|
56
|
+
|
|
57
|
+
- Type utilities and follow-declarations warden rule.
|
|
58
|
+
|
|
59
|
+
**core**: Add `TrailInput<T>`, `TrailOutput<T>` utility types and `inputOf()`, `outputOf()` runtime schema accessors.
|
|
60
|
+
|
|
61
|
+
**warden**: Add `follow-declarations` rule — statically analyzes `ctx.follow()` calls against declared `follow: [...]` arrays. Errors on undeclared calls, warns on unused declarations.
|
|
62
|
+
|
|
63
|
+
## 1.0.0-beta.4
|
|
64
|
+
|
|
65
|
+
### Major Changes
|
|
66
|
+
|
|
67
|
+
- API simplification: unified trail model, intent enum, run, metadata.
|
|
68
|
+
|
|
69
|
+
**BREAKING CHANGES:**
|
|
70
|
+
|
|
71
|
+
- `hike()` removed — use `trail()` with optional `follow: [...]` field
|
|
72
|
+
- `follows` renamed to `follow` (singular, matching `ctx.follow()`)
|
|
73
|
+
- `topo.hikes` removed — single `topo.trails` map
|
|
74
|
+
- `kind: 'hike'` removed — everything is `kind: 'trail'`
|
|
75
|
+
- `readOnly`/`destructive` booleans replaced by `intent: 'read' | 'write' | 'destroy'`
|
|
76
|
+
- `implementation` field renamed to `run`
|
|
77
|
+
- `markers` field renamed to `metadata`
|
|
78
|
+
- `testHike` renamed to `testFollows`, `HikeScenario` to `FollowScenario`
|
|
79
|
+
- `blaze()` now returns the surface handle (`Command` for CLI, `Server` for MCP)
|
|
80
|
+
|
|
81
|
+
## 1.0.0-beta.3
|
|
82
|
+
|
|
83
|
+
### Minor Changes
|
|
84
|
+
|
|
85
|
+
- Bug fixes across all surface packages found via parallel Codex review.
|
|
86
|
+
|
|
87
|
+
**core**: Fix Result.toJson false circular detection on DAGs, deserializeError subclass round-trip, topo cross-kind ID collisions, validateTopo multi-node cycle detection, error example input validation bypass, and deriveFields array type collapse.
|
|
88
|
+
|
|
89
|
+
**cli**: Switch blaze to parseAsync for proper async error handling, add boolean flag negation (--no-flag), and strict number parsing that rejects partial input.
|
|
90
|
+
|
|
91
|
+
**mcp**: Align BlobRef with core (including ReadableStream support) and detect tool-name collisions after normalization.
|
|
92
|
+
|
|
93
|
+
**testing**: Include hikes in testContracts validation, with follow-context awareness.
|
|
94
|
+
|
|
95
|
+
**warden**: Collect hike detour targets, validate detour refs in hike specs, and stop implementation-returns-result from walking into nested function bodies.
|
|
96
|
+
|
|
97
|
+
## 1.0.0-beta.2
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Fix workspace dependency resolution in published packages. Now using bun publish
|
|
102
|
+
which correctly replaces workspace:^ with actual version numbers.
|
|
103
|
+
|
|
3
104
|
## 1.0.0-beta.1
|
|
4
105
|
|
|
5
106
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -11,25 +11,23 @@ import { z } from 'zod';
|
|
|
11
11
|
const greet = trail('greet', {
|
|
12
12
|
input: z.object({ name: z.string().describe('Who to greet') }),
|
|
13
13
|
output: z.object({ message: z.string() }),
|
|
14
|
-
|
|
14
|
+
intent: 'read',
|
|
15
15
|
examples: [
|
|
16
16
|
{ name: 'Hello', input: { name: 'World' }, expected: { message: 'Hello, World!' } },
|
|
17
17
|
],
|
|
18
|
-
|
|
18
|
+
run: (input) => Result.ok({ message: `Hello, ${input.name}!` }),
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const app = topo('myapp', { greet });
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Trails compose other trails through `follow` and `ctx.follow()`:
|
|
25
25
|
|
|
26
26
|
```typescript
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const onboard = hike('entity.onboard', {
|
|
30
|
-
follows: ['entity.add', 'entity.relate'],
|
|
27
|
+
const onboard = trail('entity.onboard', {
|
|
28
|
+
follow: ['entity.add', 'entity.relate'],
|
|
31
29
|
input: z.object({ name: z.string(), type: z.string() }),
|
|
32
|
-
|
|
30
|
+
run: async (input, ctx) => {
|
|
33
31
|
const added = await ctx.follow('entity.add', input);
|
|
34
32
|
if (added.isErr()) return added;
|
|
35
33
|
return Result.ok({ entity: added.value });
|
|
@@ -43,11 +41,55 @@ const onboard = hike('entity.onboard', {
|
|
|
43
41
|
|
|
44
42
|
| Export | What it does |
|
|
45
43
|
| --- | --- |
|
|
46
|
-
| `trail(id, spec)` | Define
|
|
47
|
-
| `hike(id, spec)` | Define a composition that follows other trails via `ctx.follow()` |
|
|
44
|
+
| `trail(id, spec)` | Define a unit of work with typed input and `Result` output; use `follow` for composition |
|
|
48
45
|
| `event(id, spec)` | Define a server-originated push with a typed data schema |
|
|
49
46
|
| `topo(name, ...modules)` | Collect trail modules into a queryable topology |
|
|
50
|
-
| `validateTopo(topo)` | Structural validation:
|
|
47
|
+
| `validateTopo(topo)` | Structural validation: follow targets exist, no cycles, examples parse, output schemas present |
|
|
48
|
+
|
|
49
|
+
### Execution
|
|
50
|
+
|
|
51
|
+
| Export | What it does |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `executeTrail(trail, rawInput, options?)` | Centralized execution pipeline: validates input, builds context, composes layers, runs the implementation. Never throws -- exceptions become `Result.err(InternalError)`. |
|
|
54
|
+
| `dispatch(topo, id, input, options?)` | Headless trail execution by ID. Looks up the trail in the topo, then delegates to `executeTrail`. Returns `Result.err(NotFoundError)` if the ID is not registered. |
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// executeTrail — surface adapters use this directly
|
|
58
|
+
const result = await executeTrail(greet, { name: 'Alice' });
|
|
59
|
+
|
|
60
|
+
// dispatch — no-surface execution by trail ID
|
|
61
|
+
const result = await dispatch(app, 'greet', { name: 'Alice' });
|
|
62
|
+
if (result.isOk()) console.log(result.value);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Topo accessors
|
|
66
|
+
|
|
67
|
+
Beyond the `trail(id, spec)` builder, `Topo` exposes these accessors:
|
|
68
|
+
|
|
69
|
+
| Accessor | What it returns |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `topo.ids()` | `string[]` of all registered trail IDs |
|
|
72
|
+
| `topo.count` | Number of registered trails |
|
|
73
|
+
| `topo.get(id)` | The `Trail` with that ID, or `undefined` |
|
|
74
|
+
| `topo.has(id)` | Whether a trail ID is registered |
|
|
75
|
+
| `topo.list()` | All registered trails as an array |
|
|
76
|
+
|
|
77
|
+
### Type utilities
|
|
78
|
+
|
|
79
|
+
| Export | What it does |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `TrailInput<T>` | Extract the input type from a `Trail` |
|
|
82
|
+
| `TrailOutput<T>` | Extract the output type from a `Trail` |
|
|
83
|
+
| `TrailResult<T>` | `Result<TrailOutput<T>, Error>` -- the Result type for a trail's output |
|
|
84
|
+
| `inputOf(trail)` | Get the input Zod schema from a trail instance |
|
|
85
|
+
| `outputOf(trail)` | Get the output Zod schema (or `undefined`) from a trail instance |
|
|
86
|
+
|
|
87
|
+
### Execution option types
|
|
88
|
+
|
|
89
|
+
| Type | What it describes |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `ExecuteTrailOptions` | Options for `executeTrail`: `ctx`, `signal`, `layers`, `createContext` |
|
|
92
|
+
| `DispatchOptions` | Same shape as `ExecuteTrailOptions`; forwarded by `dispatch` |
|
|
51
93
|
|
|
52
94
|
### Result
|
|
53
95
|
|
package/dist/derive.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { z } from 'zod';
|
|
|
8
8
|
/** A surface-agnostic field descriptor derived from a Zod schema. */
|
|
9
9
|
export interface Field {
|
|
10
10
|
readonly name: string;
|
|
11
|
-
readonly type: 'string' | 'number' | 'boolean' | 'enum' | 'multiselect';
|
|
11
|
+
readonly type: 'string' | 'number' | 'boolean' | 'enum' | 'multiselect' | 'string[]' | 'number[]';
|
|
12
12
|
readonly label: string;
|
|
13
13
|
readonly required: boolean;
|
|
14
14
|
readonly default?: unknown | undefined;
|
package/dist/derive.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,qEAAqE;AACrE,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,qEAAqE;AACrE,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,aAAa,GACb,UAAU,GACV,UAAU,CAAC;IACf,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EACb,SAAS;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC3B,EAAE,GACH,SAAS,CAAC;CACf;AAED,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,OAAO,CAAC,EACb,SAAS;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC3B,EAAE,GACH,SAAS,CAAC;CACf;AAsKD,eAAO,MAAM,YAAY,GACvB,QAAQ,CAAC,CAAC,OAAO,EACjB,YAAY,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KACxC,KAAK,EAeP,CAAC"}
|
package/dist/derive.js
CHANGED
|
@@ -60,7 +60,10 @@ const fieldTypeByDef = {
|
|
|
60
60
|
const entries = element._zod.def['entries'];
|
|
61
61
|
return { options: Object.values(entries), type: 'multiselect' };
|
|
62
62
|
}
|
|
63
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
options: undefined,
|
|
65
|
+
type: elementType === 'number' ? 'number[]' : 'string[]',
|
|
66
|
+
};
|
|
64
67
|
},
|
|
65
68
|
boolean: () => ({ options: undefined, type: 'boolean' }),
|
|
66
69
|
enum: (s) => {
|
package/dist/derive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.js","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"derive.js","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyDH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE,CACvC,GAAG;KACA,UAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC;KACtC,UAAU,CAAC,uBAAuB,EAAE,OAAO,CAAC;KAC5C,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAS7C,8DAA8D;AAC9D,MAAM,YAAY,GAAG,CAAC,OAAqB,EAAg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G,EAAE,KAAK,CAAC,EAAE,EAAE,CACxD,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CACnC,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless trail execution — the "no-surface" surface.
|
|
3
|
+
*
|
|
4
|
+
* Looks up a trail by ID in a topo, then delegates to `executeTrail`.
|
|
5
|
+
* Returns a `Result` and never throws.
|
|
6
|
+
*/
|
|
7
|
+
import type { Topo } from './topo.js';
|
|
8
|
+
import type { ExecuteTrailOptions } from './execute.js';
|
|
9
|
+
import { Result } from './result.js';
|
|
10
|
+
/** Options forwarded to `executeTrail` from `dispatch`. */
|
|
11
|
+
export type DispatchOptions = ExecuteTrailOptions;
|
|
12
|
+
/**
|
|
13
|
+
* Execute a trail by ID from a topo without mounting a surface.
|
|
14
|
+
*
|
|
15
|
+
* Resolves the trail from the topo, then runs it through the standard
|
|
16
|
+
* `executeTrail` pipeline. Returns `Result.err(NotFoundError)` if the
|
|
17
|
+
* trail ID is not registered. Never throws — unexpected exceptions are
|
|
18
|
+
* returned as `Result.err(InternalError)`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const result = await dispatch(myTopo, 'greet', { name: 'Alice' });
|
|
23
|
+
* if (result.isOk()) console.log(result.value);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const dispatch: (topo: Topo, id: string, input: unknown, options?: DispatchOptions) => Promise<Result<unknown, Error>>;
|
|
27
|
+
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAMlD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,GACnB,MAAM,IAAI,EACV,IAAI,MAAM,EACV,OAAO,OAAO,EACd,UAAU,eAAe,KACxB,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAUhC,CAAC"}
|
package/dist/dispatch.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless trail execution — the "no-surface" surface.
|
|
3
|
+
*
|
|
4
|
+
* Looks up a trail by ID in a topo, then delegates to `executeTrail`.
|
|
5
|
+
* Returns a `Result` and never throws.
|
|
6
|
+
*/
|
|
7
|
+
import { executeTrail } from './execute.js';
|
|
8
|
+
import { NotFoundError } from './errors.js';
|
|
9
|
+
import { Result } from './result.js';
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// dispatch()
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
/**
|
|
14
|
+
* Execute a trail by ID from a topo without mounting a surface.
|
|
15
|
+
*
|
|
16
|
+
* Resolves the trail from the topo, then runs it through the standard
|
|
17
|
+
* `executeTrail` pipeline. Returns `Result.err(NotFoundError)` if the
|
|
18
|
+
* trail ID is not registered. Never throws — unexpected exceptions are
|
|
19
|
+
* returned as `Result.err(InternalError)`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const result = await dispatch(myTopo, 'greet', { name: 'Alice' });
|
|
24
|
+
* if (result.isOk()) console.log(result.value);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const dispatch = (topo, id, input, options) => {
|
|
28
|
+
const trail = topo.get(id);
|
|
29
|
+
if (trail === undefined) {
|
|
30
|
+
return Promise.resolve(Result.err(new NotFoundError(`Trail "${id}" not found in topo "${topo.name}"`)));
|
|
31
|
+
}
|
|
32
|
+
return executeTrail(trail, input, options);
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,IAAU,EACV,EAAU,EACV,KAAc,EACd,OAAyB,EACQ,EAAE;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,OAAO,CACpB,MAAM,CAAC,GAAG,CACR,IAAI,aAAa,CAAC,UAAU,EAAE,wBAAwB,IAAI,CAAC,IAAI,GAAG,CAAC,CACpE,CACF,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC,CAAC"}
|
package/dist/event.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { z } from 'zod';
|
|
|
5
5
|
export interface EventSpec<T> {
|
|
6
6
|
readonly payload: z.ZodType<T>;
|
|
7
7
|
readonly description?: string | undefined;
|
|
8
|
-
readonly
|
|
8
|
+
readonly metadata?: Readonly<Record<string, unknown>> | undefined;
|
|
9
9
|
/** Trail IDs that produce this event (e.g. the trails it originates from). */
|
|
10
10
|
readonly from?: readonly string[] | undefined;
|
|
11
11
|
}
|
|
@@ -14,7 +14,7 @@ export interface Event<T> {
|
|
|
14
14
|
readonly kind: 'event';
|
|
15
15
|
readonly payload: z.ZodType<T>;
|
|
16
16
|
readonly description?: string | undefined;
|
|
17
|
-
readonly
|
|
17
|
+
readonly metadata?: Readonly<Record<string, unknown>> | undefined;
|
|
18
18
|
/** Trail IDs that produce this event (e.g. the trails it originates from). */
|
|
19
19
|
readonly from?: readonly string[] | undefined;
|
|
20
20
|
}
|
package/dist/event.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAClE,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC/C;AAMD,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAClE,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC/C;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACnE,wBAAgB,KAAK,CAAC,CAAC,EACrB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC3C,KAAK,CAAC,CAAC,CAAC,CAAC;AAkBZ,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/event.js
CHANGED
|
@@ -10,7 +10,7 @@ export function event(idOrSpec, maybeSpec) {
|
|
|
10
10
|
from: resolvedSpec.from ? Object.freeze([...resolvedSpec.from]) : undefined,
|
|
11
11
|
id: resolvedId,
|
|
12
12
|
kind: 'event',
|
|
13
|
-
|
|
13
|
+
metadata: resolvedSpec.metadata,
|
|
14
14
|
payload: resolvedSpec.payload,
|
|
15
15
|
});
|
|
16
16
|
}
|
package/dist/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwDH,MAAM,UAAU,KAAK,CACnB,QAA2D,EAC3D,SAAwB;IAExB,MAAM,UAAU,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;IACzE,0GAA0G;IAC1G,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1E,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,OAAgB;QACtB,
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwDH,MAAM,UAAU,KAAK,CACnB,QAA2D,EAC3D,SAAwB;IAExB,MAAM,UAAU,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;IACzE,0GAA0G;IAC1G,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1E,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,OAAgB;QACtB,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,OAAO,EAAE,YAAY,CAAC,OAAO;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized trail execution pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Validates input, builds context, composes layers, and runs the
|
|
5
|
+
* implementation. Surfaces (CLI, MCP, HTTP) delegate here instead
|
|
6
|
+
* of reimplementing the pipeline.
|
|
7
|
+
*/
|
|
8
|
+
import type { AnyTrail } from './trail.js';
|
|
9
|
+
import type { Layer } from './layer.js';
|
|
10
|
+
import type { TrailContext } from './types.js';
|
|
11
|
+
import { Result } from './result.js';
|
|
12
|
+
/** Options for executeTrail. */
|
|
13
|
+
export interface ExecuteTrailOptions {
|
|
14
|
+
/** Partial context overrides merged on top of the base context. */
|
|
15
|
+
readonly ctx?: Partial<TrailContext> | undefined;
|
|
16
|
+
/** AbortSignal override (takes final precedence over ctx and factory). */
|
|
17
|
+
readonly signal?: AbortSignal | undefined;
|
|
18
|
+
/** Layers to compose around the implementation. */
|
|
19
|
+
readonly layers?: readonly Layer[] | undefined;
|
|
20
|
+
/** Factory that produces a base TrailContext (takes precedence over defaults). */
|
|
21
|
+
readonly createContext?: (() => TrailContext | Promise<TrailContext>) | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Execute a trail through the standard validate-context-layers-run pipeline.
|
|
25
|
+
*
|
|
26
|
+
* The function never throws -- unexpected exceptions are caught and
|
|
27
|
+
* returned as `Result.err(InternalError)`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const executeTrail: (trail: AnyTrail, rawInput: unknown, options?: ExecuteTrailOptions) => Promise<Result<unknown, Error>>;
|
|
30
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC,gCAAgC;AAChC,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IACjD,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,mDAAmD;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,CAAC;IAC/C,kFAAkF;IAClF,QAAQ,CAAC,aAAa,CAAC,EACnB,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,GAC5C,SAAS,CAAC;CACf;AAoCD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,QAAQ,EACf,UAAU,OAAO,EACjB,UAAU,mBAAmB,KAC5B,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAehC,CAAC"}
|
package/dist/execute.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized trail execution pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Validates input, builds context, composes layers, and runs the
|
|
5
|
+
* implementation. Surfaces (CLI, MCP, HTTP) delegate here instead
|
|
6
|
+
* of reimplementing the pipeline.
|
|
7
|
+
*/
|
|
8
|
+
import { composeLayers } from './layer.js';
|
|
9
|
+
import { createTrailContext } from './context.js';
|
|
10
|
+
import { InternalError } from './errors.js';
|
|
11
|
+
import { Result } from './result.js';
|
|
12
|
+
import { validateInput } from './validation.js';
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Context resolution
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Build a TrailContext from options.
|
|
18
|
+
*
|
|
19
|
+
* Resolution order:
|
|
20
|
+
* 1. Factory (`createContext`) or `createTrailContext()` defaults.
|
|
21
|
+
* 2. Partial `ctx` overrides merged on top.
|
|
22
|
+
* 3. `signal` override takes final precedence.
|
|
23
|
+
*/
|
|
24
|
+
const resolveContext = async (options) => {
|
|
25
|
+
const base = options?.createContext
|
|
26
|
+
? await options.createContext()
|
|
27
|
+
: createTrailContext();
|
|
28
|
+
const withOverrides = options?.ctx
|
|
29
|
+
? {
|
|
30
|
+
...base,
|
|
31
|
+
...options.ctx,
|
|
32
|
+
extensions: { ...base.extensions, ...options.ctx.extensions },
|
|
33
|
+
}
|
|
34
|
+
: base;
|
|
35
|
+
return options?.signal
|
|
36
|
+
? { ...withOverrides, signal: options.signal }
|
|
37
|
+
: withOverrides;
|
|
38
|
+
};
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Pipeline
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* Execute a trail through the standard validate-context-layers-run pipeline.
|
|
44
|
+
*
|
|
45
|
+
* The function never throws -- unexpected exceptions are caught and
|
|
46
|
+
* returned as `Result.err(InternalError)`.
|
|
47
|
+
*/
|
|
48
|
+
export const executeTrail = async (trail, rawInput, options) => {
|
|
49
|
+
try {
|
|
50
|
+
const validated = validateInput(trail.input, rawInput);
|
|
51
|
+
if (validated.isErr()) {
|
|
52
|
+
return validated;
|
|
53
|
+
}
|
|
54
|
+
const ctx = await resolveContext(options);
|
|
55
|
+
const layers = options?.layers ?? [];
|
|
56
|
+
const impl = composeLayers([...layers], trail, trail.run);
|
|
57
|
+
return await impl(validated.value, ctx);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
61
|
+
return Result.err(new InternalError(message));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAoBhD,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,cAAc,GAAG,KAAK,EAC1B,OAA6B,EACN,EAAE;IACzB,MAAM,IAAI,GAAG,OAAO,EAAE,aAAa;QACjC,CAAC,CAAC,MAAM,OAAO,CAAC,aAAa,EAAE;QAC/B,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACzB,MAAM,aAAa,GAAG,OAAO,EAAE,GAAG;QAChC,CAAC,CAAC;YACE,GAAG,IAAI;YACP,GAAG,OAAO,CAAC,GAAG;YACd,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE;SAC9D;QACH,CAAC,CAAC,IAAI,CAAC;IACT,OAAO,OAAO,EAAE,MAAM;QACpB,CAAC,CAAC,EAAE,GAAG,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE;QAC9C,CAAC,CAAC,aAAa,CAAC;AACpB,CAAC,CAAC;AAEF,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,KAAe,EACf,QAAiB,EACjB,OAA6B,EACI,EAAE;IACnC,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;YACtB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1D,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { Result } from './result.js';
|
|
2
2
|
export { TrailsError, ValidationError, AmbiguousError, AssertionError, NotFoundError, AlreadyExistsError, ConflictError, PermissionError, TimeoutError, RateLimitError, NetworkError, InternalError, AuthError, CancelledError, exitCodeMap, statusCodeMap, jsonRpcCodeMap, retryableMap, isRetryable, isTrailsError, } from './errors.js';
|
|
3
3
|
export type { ErrorCategory } from './errors.js';
|
|
4
|
-
export type { Implementation, TrailContext, FollowFn, ProgressCallback, ProgressEvent, Logger,
|
|
4
|
+
export type { Implementation, TrailContext, FollowFn, ProgressCallback, ProgressEvent, Logger, } from './types.js';
|
|
5
5
|
export { createTrailContext } from './context.js';
|
|
6
6
|
export { trail } from './trail.js';
|
|
7
|
-
export type { AnyTrail, Trail, TrailSpec, TrailExample } from './trail.js';
|
|
8
|
-
export {
|
|
9
|
-
export
|
|
7
|
+
export type { AnyTrail, Intent, Trail, TrailSpec, TrailExample, } from './trail.js';
|
|
8
|
+
export type { TrailInput, TrailOutput, TrailResult } from './type-utils.js';
|
|
9
|
+
export { inputOf, outputOf } from './type-utils.js';
|
|
10
10
|
export { event } from './event.js';
|
|
11
11
|
export type { AnyEvent, Event, EventSpec } from './event.js';
|
|
12
12
|
export { topo } from './topo.js';
|
|
@@ -15,10 +15,12 @@ export { validateTopo } from './validate-topo.js';
|
|
|
15
15
|
export type { TopoIssue } from './validate-topo.js';
|
|
16
16
|
export { composeLayers } from './layer.js';
|
|
17
17
|
export type { Layer } from './layer.js';
|
|
18
|
-
export type { HealthStatus, HealthResult } from './health.js';
|
|
19
|
-
export type { IndexAdapter, StorageAdapter, CacheAdapter, SearchOptions, SearchResult, StorageOptions, } from './adapters.js';
|
|
20
18
|
export { deriveFields } from './derive.js';
|
|
21
19
|
export type { Field, FieldOverride } from './derive.js';
|
|
20
|
+
export { executeTrail } from './execute.js';
|
|
21
|
+
export type { ExecuteTrailOptions } from './execute.js';
|
|
22
|
+
export { dispatch } from './dispatch.js';
|
|
23
|
+
export type { DispatchOptions } from './dispatch.js';
|
|
22
24
|
export { validateInput, validateOutput, formatZodIssues, zodToJsonSchema, } from './validation.js';
|
|
23
25
|
export { serializeError, deserializeError } from './serialization.js';
|
|
24
26
|
export type { SerializedError } from './serialization.js';
|
|
@@ -28,6 +30,8 @@ export { brand, unbrand, uuid, email, nonEmptyString, positiveInt, shortId, hash
|
|
|
28
30
|
export type { Branded, UUID, Email, NonEmptyString, PositiveInt, } from './branded.js';
|
|
29
31
|
export { securePath, isPathSafe, resolveSafePath } from './path-security.js';
|
|
30
32
|
export { findWorkspaceRoot, isInsideWorkspace, getRelativePath, } from './workspace.js';
|
|
33
|
+
export { createBlobRef, isBlobRef } from './blob-ref.js';
|
|
34
|
+
export type { BlobRef } from './blob-ref.js';
|
|
31
35
|
export { isDefined, isNonEmptyString, isPlainObject, hasProperty, assertNever, } from './guards.js';
|
|
32
36
|
export { chunk, dedupe, groupBy, sortBy, isNonEmptyArray, } from './collections.js';
|
|
33
37
|
export type { NonEmptyArray, DeepPartial, Prettify, AtLeastOne, } from './collections.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAA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AAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,OAAO,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,cAAc,EACd,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,OAAO,EACP,IAAI,EACJ,KAAK,EACL,cAAc,EACd,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,GACX,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,8 +6,7 @@ export { TrailsError, ValidationError, AmbiguousError, AssertionError, NotFoundE
|
|
|
6
6
|
export { createTrailContext } from './context.js';
|
|
7
7
|
// Trail
|
|
8
8
|
export { trail } from './trail.js';
|
|
9
|
-
|
|
10
|
-
export { hike } from './hike.js';
|
|
9
|
+
export { inputOf, outputOf } from './type-utils.js';
|
|
11
10
|
// Event
|
|
12
11
|
export { event } from './event.js';
|
|
13
12
|
// Topo
|
|
@@ -18,6 +17,10 @@ export { validateTopo } from './validate-topo.js';
|
|
|
18
17
|
export { composeLayers } from './layer.js';
|
|
19
18
|
// Derive
|
|
20
19
|
export { deriveFields } from './derive.js';
|
|
20
|
+
// Execute
|
|
21
|
+
export { executeTrail } from './execute.js';
|
|
22
|
+
// Dispatch
|
|
23
|
+
export { dispatch } from './dispatch.js';
|
|
21
24
|
// Validation
|
|
22
25
|
export { validateInput, validateOutput, formatZodIssues, zodToJsonSchema, } from './validation.js';
|
|
23
26
|
// Serialization
|
|
@@ -31,6 +34,8 @@ export { brand, unbrand, uuid, email, nonEmptyString, positiveInt, shortId, hash
|
|
|
31
34
|
export { securePath, isPathSafe, resolveSafePath } from './path-security.js';
|
|
32
35
|
// Workspace
|
|
33
36
|
export { findWorkspaceRoot, isInsideWorkspace, getRelativePath, } from './workspace.js';
|
|
37
|
+
// Blob
|
|
38
|
+
export { createBlobRef, isBlobRef } from './blob-ref.js';
|
|
34
39
|
// Guards
|
|
35
40
|
export { isDefined, isNonEmptyString, isPlainObject, hasProperty, assertNever, } from './guards.js';
|
|
36
41
|
// Collections
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,SAAS;AACT,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,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AAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtE,aAAa;AACb,OAAO,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,uDAAuD;AAEvD,gBAAgB;AAChB,OAAO,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,cAAc,EACd,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,cAAc,CAAC;AAStB,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,YAAY;AACZ,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO;AACP,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGzD,SAAS;AACT,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,cAAc;AACd,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
|
|
@@ -6,10 +6,10 @@ import { z } from 'zod';
|
|
|
6
6
|
export declare const statusFields: () => z.ZodObject<{
|
|
7
7
|
status: z.ZodEnum<{
|
|
8
8
|
cancelled: "cancelled";
|
|
9
|
+
failed: "failed";
|
|
9
10
|
pending: "pending";
|
|
10
11
|
running: "running";
|
|
11
12
|
completed: "completed";
|
|
12
|
-
failed: "failed";
|
|
13
13
|
}>;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
15
|
//# sourceMappingURL=status.d.ts.map
|
package/dist/result.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,eAA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