@owlmeans/server-entrypoint 0.1.18-rc.36 → 0.1.18-rc.37
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/server-entrypoint/SKILL.md +1 -1
- package/build/entrypoint.d.ts +6 -0
- package/build/entrypoint.d.ts.map +1 -0
- package/build/entrypoint.js +38 -0
- package/build/entrypoint.js.map +1 -0
- package/build/helper.d.ts +5 -0
- package/build/helper.d.ts.map +1 -0
- package/build/helper.js +25 -0
- package/build/helper.js.map +1 -0
- package/build/utils/entrypoint.d.ts +3 -0
- package/build/utils/entrypoint.d.ts.map +1 -0
- package/build/utils/entrypoint.js +3 -0
- package/build/utils/entrypoint.js.map +1 -0
- package/build/utils/helper.d.ts +2 -0
- package/build/utils/helper.d.ts.map +1 -0
- package/build/utils/helper.js +2 -0
- package/build/utils/helper.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ and a browser app binds the same protocols with `@owlmeans/client-entrypoint` in
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
bun add @owlmeans/server-entrypoint@^0.1.18-rc.
|
|
13
|
+
bun add @owlmeans/server-entrypoint@^0.1.18-rc.37
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Concepts
|
|
@@ -154,7 +154,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
154
154
|
your project's skill store (`.agents/skills/`):
|
|
155
155
|
|
|
156
156
|
```sh
|
|
157
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
157
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.45
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
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/server-entrypoint",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18-rc.37",
|
|
5
|
+
"generatedAt": "2026-10-01T23:27:48.736Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -7,7 +7,7 @@ user-invocable: false
|
|
|
7
7
|
|
|
8
8
|
# @owlmeans/server-entrypoint
|
|
9
9
|
|
|
10
|
-
**Install:** `bun add @owlmeans/server-entrypoint@^0.1.18-rc.
|
|
10
|
+
**Install:** `bun add @owlmeans/server-entrypoint@^0.1.18-rc.37`
|
|
11
11
|
|
|
12
12
|
Bind the imported protocol object to the implementation that serves it:
|
|
13
13
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ServerRouteModel } from '@owlmeans/server-route';
|
|
2
|
+
import type { ServerEntrypoint, EntrypointOptions, RefedEntrypointHandler } from './types.js';
|
|
3
|
+
import type { CommonEntrypoint } from '@owlmeans/entrypoint';
|
|
4
|
+
import type { CommonRouteModel } from '@owlmeans/route';
|
|
5
|
+
export declare const entrypoint: <R>(arg: CommonEntrypoint | ServerRouteModel<R> | CommonRouteModel, handler?: RefedEntrypointHandler<R>, opts?: EntrypointOptions<R>) => ServerEntrypoint<R>;
|
|
6
|
+
//# sourceMappingURL=entrypoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAiB,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAG5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIvD,eAAO,MAAM,UAAU,GAAI,CAAC,EAC1B,KAAK,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,EAAE,UAAU,sBAAsB,CAAC,CAAC,CAAC,EAAE,OAAO,iBAAiB,CAAC,CAAC,CAAC,KAC/H,gBAAgB,CAAC,CAAC,CAuCpB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isEntrypoint, makeCommonEntrypoint } from './utils/entrypoint.js';
|
|
2
|
+
import { isServerRouteModel, route } from '@owlmeans/server-route';
|
|
3
|
+
import { prependBase } from '@owlmeans/route/utils';
|
|
4
|
+
export const entrypoint = (arg, handler, opts) => {
|
|
5
|
+
const entrypointHandle = { ref: undefined };
|
|
6
|
+
let _entrypoint;
|
|
7
|
+
if (isEntrypoint(arg)) {
|
|
8
|
+
const routeModel = route(arg.route, opts?.intermediate ?? false, opts?.routeOptions);
|
|
9
|
+
_entrypoint = arg;
|
|
10
|
+
_entrypoint.route = routeModel;
|
|
11
|
+
_entrypoint.filter = opts?.filter ?? arg.filter;
|
|
12
|
+
_entrypoint.guards = [...(arg.guards ?? []), ...(opts?.guards ?? [])];
|
|
13
|
+
_entrypoint.gate = opts?.gate ?? arg.gate;
|
|
14
|
+
_entrypoint.gateParams = opts?.gateParams ?? arg.gateParams;
|
|
15
|
+
}
|
|
16
|
+
else if (isServerRouteModel(arg)) {
|
|
17
|
+
_entrypoint = makeCommonEntrypoint(arg, { ...opts });
|
|
18
|
+
_entrypoint.route = arg;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const _route = route(arg, opts?.intermediate ?? false, opts?.routeOptions);
|
|
22
|
+
_entrypoint = makeCommonEntrypoint(_route, { ...opts });
|
|
23
|
+
_entrypoint.route = _route;
|
|
24
|
+
}
|
|
25
|
+
_entrypoint.fixer = opts?.fixer;
|
|
26
|
+
if (handler != null) {
|
|
27
|
+
_entrypoint.handle = handler(entrypointHandle);
|
|
28
|
+
}
|
|
29
|
+
_entrypoint.reinitializeContext = (context) => {
|
|
30
|
+
const newEntrypoint = entrypoint(arg, handler, opts);
|
|
31
|
+
newEntrypoint.ctx = context;
|
|
32
|
+
return newEntrypoint;
|
|
33
|
+
};
|
|
34
|
+
_entrypoint.getPath = () => prependBase(_entrypoint.route.route);
|
|
35
|
+
entrypointHandle.ref = _entrypoint;
|
|
36
|
+
return _entrypoint;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=entrypoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAIlE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,GAA8D,EAAE,OAAmC,EAAE,IAA2B,EAC3G,EAAE;IACvB,MAAM,gBAAgB,GAAqB,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA;IAE7D,IAAI,WAAgC,CAAA;IAEpC,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,IAAI,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAA;QACpF,WAAW,GAAG,GAA0B,CAAA;QACxC,WAAW,CAAC,KAAK,GAAG,UAAU,CAAA;QAC9B,WAAW,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,CAAA;QAC/C,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,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C,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ServerEntrypoint, EntrypointOptions, RefedEntrypointHandler } from './types.js';
|
|
2
|
+
import type { CommonEntrypoint } from '@owlmeans/entrypoint';
|
|
3
|
+
export declare const elevate: <R>(entrypoints: (CommonEntrypoint | ServerEntrypoint<R>)[], alias: string, handler?: RefedEntrypointHandler<R> | boolean | EntrypointOptions<R>, opts?: boolean | EntrypointOptions<R>) => ServerEntrypoint<R>[];
|
|
4
|
+
export declare const guard: <R>(guard: string, opts?: EntrypointOptions<R>) => EntrypointOptions<R>;
|
|
5
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAI7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,eAAO,MAAM,OAAO,GAAI,CAAC,EACvB,aAAa,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,EACvD,OAAO,MAAM,EACb,UAAU,sBAAsB,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,EACpE,OAAO,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,KACpC,gBAAgB,CAAC,CAAC,CAAC,EAuBrB,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,iBAAiB,CAAC,CAAC,CAAC,KAAG,iBAAiB,CAAC,CAAC,CACjD,CAAA"}
|
package/build/helper.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { entrypoint } from './entrypoint.js';
|
|
2
|
+
import { isServerRouteModel } from '@owlmeans/server-route';
|
|
3
|
+
import { createBasicGuard } from './utils/helper.js';
|
|
4
|
+
export const elevate = (entrypoints, alias, handler, opts) => {
|
|
5
|
+
const idx = entrypoints.findIndex(({ route }) => route.route.alias === alias);
|
|
6
|
+
if (idx === -1) {
|
|
7
|
+
throw new SyntaxError(`Entrypoint with alias ${alias} not present`);
|
|
8
|
+
}
|
|
9
|
+
if (typeof handler === 'boolean') {
|
|
10
|
+
opts = handler;
|
|
11
|
+
handler = undefined;
|
|
12
|
+
}
|
|
13
|
+
if (typeof handler === 'object' && typeof handler !== 'function') {
|
|
14
|
+
opts = handler;
|
|
15
|
+
handler = undefined;
|
|
16
|
+
}
|
|
17
|
+
const force = typeof opts === 'object' && opts.force;
|
|
18
|
+
if (isServerRouteModel(entrypoints[idx].route) && !force) {
|
|
19
|
+
throw new SyntaxError(`Entrypoint with alias ${alias} is already elevated`);
|
|
20
|
+
}
|
|
21
|
+
entrypoints[idx] = entrypoint(entrypoints[idx], handler, typeof opts === 'boolean' ? { intermediate: opts } : opts);
|
|
22
|
+
return entrypoints;
|
|
23
|
+
};
|
|
24
|
+
export const guard = (guard, opts) => ({ ...createBasicGuard(guard, opts) });
|
|
25
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAGpD,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,WAAuD,EACvD,KAAa,EACb,OAAoE,EACpE,IAAqC,EACd,EAAE;IACzB,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK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AAsB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../src/utils/entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/utils/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/utils/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/server-entrypoint",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.37",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@owlmeans/context": "^0.1.18-rc.32",
|
|
25
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
25
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.38",
|
|
26
26
|
"@owlmeans/route": "^0.1.18-rc.33",
|
|
27
27
|
"@owlmeans/server-route": "^0.1.18-rc.32"
|
|
28
28
|
},
|