@owlmeans/route 0.1.18-rc.8 → 0.1.18-rc.9
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/README.md
CHANGED
|
@@ -17,7 +17,7 @@ context that asks, so the same declaration serves a server and a browser alike.
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
bun add @owlmeans/route
|
|
20
|
+
bun add @owlmeans/route@^0.1.18-rc.8
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
@@ -106,7 +106,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
106
106
|
your project's skill store (`.agents/skills/`):
|
|
107
107
|
|
|
108
108
|
```sh
|
|
109
|
-
npx @owlmeans/agent-skills
|
|
109
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.12
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/route",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.9",
|
|
5
|
+
"generatedAt": "2026-09-04T22:43:25.449Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/route
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/route": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/route": "^0.1.18-rc.9"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
@@ -18,11 +18,15 @@ user-invocable: false
|
|
|
18
18
|
| `frontend(options?, default?)` | Mark a route as a React page (web only) |
|
|
19
19
|
| `backend(options?, method?)` | Mark a route as a backend endpoint |
|
|
20
20
|
| `socket(options?, secondary?)` | A backend route answering over `RouteProtocols.SOCKET` |
|
|
21
|
-
| `job(options?, secondary?)` | A backend route carried by the queue (`RouteProtocols.QUEUE`)
|
|
21
|
+
| `job(options?, secondary?)` | A backend route carried by the queue (`RouteProtocols.QUEUE`); its declaration adds `queue`, `reply` and `timeout` |
|
|
22
22
|
| `service(alias, options?)` | Point a route at a named service |
|
|
23
23
|
| `RouteMethod` | enum of GET, POST, PUT, PATCH, DELETE |
|
|
24
24
|
| `RouteProtocols` | enum of WEB (`http`), SOCKET (`ws`), QUEUE (`queue`) |
|
|
25
|
+
| `rtype(type, options?)` | The primitive `frontend()` / `backend()` are built from |
|
|
26
|
+
| `createRoute(alias, path, opts?)` / `makeRouteModel(decl)` | The declaration and its wrapper, when you need them apart |
|
|
27
|
+
| `BasicRoute` | `{ type, service?, host?, port?, base?, internalHost?, internalPort? }` |
|
|
25
28
|
| `RouteDeclaration` | The immutable declaration `route()` produces |
|
|
29
|
+
| `RouteOptions` | `Partial<RouteDeclaration>` — what the marker helpers return |
|
|
26
30
|
| `RouteModel` | `{ route }` — the model wrapping a declaration |
|
|
27
31
|
| `RouteAddress` | `{ host, port, base, secure, protocol }` — where a route answers |
|
|
28
32
|
| `CommonServiceRoute` / `ResolvedServiceRoute` | A service entry, and one that knows its host |
|
|
@@ -40,24 +44,35 @@ the same declaration serve a client and a server at once.
|
|
|
40
44
|
|
|
41
45
|
A route names the protocol it answers on, and an application binds one by registering a transport
|
|
42
46
|
service under `transportAlias(protocol)`. So the protocol is what decides whether a call travels as
|
|
43
|
-
an HTTP request, a socket frame or a queued job — the call site never says.
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
an HTTP request, a socket frame or a queued job — the call site never says. Both `transportAlias`
|
|
48
|
+
and the `EntrypointTransport` contract a transport implements are exported by `@owlmeans/entrypoint`,
|
|
49
|
+
not by this package; a route only names the protocol.
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
`job()` is `backend()` with `RouteProtocols.QUEUE`. Three declaration fields matter only for that
|
|
52
|
+
protocol: `queue` (which queue carries it), `reply` and `timeout`. `reply: false` resolves once the
|
|
53
|
+
broker has taken the job — the value is the job's identity and the outcome is `Accepted`, not the
|
|
54
|
+
job's result; the default is to wait for the result.
|
|
48
55
|
|
|
49
|
-
|
|
56
|
+
## Subpath Exports
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
58
|
+
`./utils` holds two kinds of helper, and their signatures differ. The six that answer *where* a
|
|
59
|
+
route lives take `(context, declaration)`, because that is a question about the asking context. The
|
|
60
|
+
other four are pure functions over a declaration or a service entry and take **no context**.
|
|
61
|
+
Passing one to them resolves nothing: `overrideParams(ctx, decl)` writes route fields straight into
|
|
62
|
+
the context object instead.
|
|
63
|
+
|
|
64
|
+
| Helper | Signature | Answers |
|
|
65
|
+
|--------|-----------|---------|
|
|
66
|
+
| `resolvePath` | `(context, route)` | Every ancestor's segment, then this one |
|
|
67
|
+
| `resolveMount` | `(context, route)` | `base` + the full path — what a server mounts and a client requests |
|
|
68
|
+
| `resolveService` | `(context, route)` | The service the declaration answers on: the one it names, else the default of its app type, else the first of that type |
|
|
69
|
+
| `resolveAddress` | `(context, route)` | The `RouteAddress`; a hop over a service's INTERNAL host is never TLS |
|
|
70
|
+
| `isLocalRoute` | `(context, route)` | Does the route belong to the service the asking context IS? |
|
|
71
|
+
| `getParentRoute` | `(context, route)` | The parent declaration, with parentship-cycle detection |
|
|
72
|
+
| `overrideParams` | `(route, overrides?, filter?)` | Fill in **only the blank** fields of `route` from `overrides`; `filter` narrows it to the listed keys. Mutates `route` and returns nothing |
|
|
73
|
+
| `prependBase` | `(route, path)` | `path` prefixed with `route.base`, or `path` when there is no base |
|
|
74
|
+
| `isServiceRoute` | `(obj?)` | Type guard: is this a service entry (`type` + `service`, `type` a known `AppType`)? |
|
|
75
|
+
| `isServiceRouteResolved` | `(route)` | Type guard: does that service entry name a host? |
|
|
61
76
|
|
|
62
77
|
Application code rarely calls these directly — `@owlmeans/entrypoint` exposes them as `path()`,
|
|
63
78
|
`mount()`, `service()`, `address()` and `isLocal()` on the entrypoint itself.
|
|
@@ -85,5 +100,7 @@ entrypoint(
|
|
|
85
100
|
## Depends On
|
|
86
101
|
|
|
87
102
|
- `@owlmeans/context` — `AppType`, and the entrypoint registry the address helpers walk
|
|
88
|
-
|
|
89
|
-
-
|
|
103
|
+
|
|
104
|
+
That is the only dependency. The address helpers signal a mis-wired route tree by throwing
|
|
105
|
+
`SyntaxError` — an unconfigured service, an unresolved host, a parentship cycle — so the process
|
|
106
|
+
crashes on a wiring mistake instead of serving a wrong URL.
|
package/build/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,eAAO,MAAM,KAAK,EAAE,oBAAoB,CAAC,UAAU,CACH,CAAA;AAEhD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,eAAO,MAAM,KAAK,EAAE,oBAAoB,CAAC,UAAU,CACH,CAAA;AAEhD,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,MAM5C,CAAA;AAED,eAAO,MAAM,KAAK,SAAU,OAAO,SAAS,YAAY,GAAG,MAAM,KAAG,OAAO,CAAC,YAAY,CAEvF,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,YAAY,GAAG,MAAM,GAAG,IAAI,WAAW,YAAY,GAAG,WAAW,KAAG,OAAO,CAAC,YAAY,CAQtH,CAAA;AAED,eAAO,MAAM,OAAO,YAAa,MAAM,SAAS,OAAO,CAAC,YAAY,CAAC,KAAG,OAAO,CAAC,YAAY,CAI3F,CAAA;AAED,eAAO,MAAM,MAAM,UAAW,YAAY,GAAG,MAAM,GAAG,IAAI,cAAc,YAAY,KAAG,OAAO,CAAC,YAAY,CAM1G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,GAAG,UAAW,YAAY,GAAG,MAAM,GAAG,IAAI,cAAc,YAAY,KAAG,OAAO,CAAC,YAAY,CAMvG,CAAA;AAED,eAAO,MAAM,QAAQ,UAAW,YAAY,GAAG,MAAM,GAAG,IAAI,QAAQ,YAAY,GAAG,OAAO,KAAG,OAAO,CAAC,YAAY,CAQhH,CAAA"}
|
package/build/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAG5D,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAG5D,eAAO,MAAM,cAAc,UAAW,gBAAgB,KAAG,UAAyB,CAAA;AAElF,eAAO,MAAM,WAAW,EAAE,oBAAoB,CAAC,gBAAgB,CAS9D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/utils/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAc,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAkC,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvH,KAAK,MAAM,GAAG,WAAW,CAAA;AAWzB,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/utils/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAc,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAkC,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvH,KAAK,MAAM,GAAG,WAAW,CAAA;AAWzB,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,WAC/D,CAAC,SAAS,gBAAgB,KAClC,gBAAgB,GAAG,IAWrB,CAAA;AAED,eAAO,MAAM,cAAc,UAAW,gBAAgB,cAAc,OAAO,CAAC,gBAAgB,CAAC,WAAW,MAAM,EAAE,SAO/G,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,WAC/D,CAAC,SAAS,gBAAgB,KAClC,oBA4BF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,WAC5D,CAAC,SAAS,gBAAgB,KAClC,MASF,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,WAC7D,CAAC,SAAS,gBAAgB,KAClC,MAOF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,WAC/D,CAAC,SAAS,gBAAgB,KAClC,YAYF,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,WAC7D,CAAC,SAAS,gBAAgB,KAClC,OAAyE,CAAA;AAgB5E,eAAO,MAAM,WAAW,UAAW,gBAAgB,QAAQ,MAAM,WAGvD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/utils/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAE3E,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/utils/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAE3E,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,GAAG,IAAI,kBAEM,CAAA;AAE3D,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,UAAW,kBAAkB,KAAG,KAAK,IAAI,oBAC5B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/route",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
31
|
+
"@owlmeans/context": "^0.1.18-rc.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@owlmeans/dep-config": "workspace:*",
|