@telorun/http-server 0.17.0 → 0.17.1
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
CHANGED
package/README.md
CHANGED
|
@@ -27,8 +27,8 @@ Language- and framework-agnostic HTTP server for Telo. Declarative routes, schem
|
|
|
27
27
|
kind: Telo.Application
|
|
28
28
|
metadata: { name: hello-http, version: 1.0.0 }
|
|
29
29
|
imports:
|
|
30
|
-
Http: std/http-server
|
|
31
|
-
JS: std/javascript
|
|
30
|
+
Http: std/http-server@0.19.1
|
|
31
|
+
JS: std/javascript@0.7.0
|
|
32
32
|
targets: [ !ref Server ]
|
|
33
33
|
---
|
|
34
34
|
kind: Http.Server
|
|
@@ -56,7 +56,7 @@ routes:
|
|
|
56
56
|
description: Name to greet.
|
|
57
57
|
examples: [ "Ada" ]
|
|
58
58
|
inputs:
|
|
59
|
-
name: "
|
|
59
|
+
name: !cel "request.params.name"
|
|
60
60
|
handler: !ref Greet
|
|
61
61
|
returns:
|
|
62
62
|
- status: 200
|
|
@@ -69,7 +69,7 @@ routes:
|
|
|
69
69
|
type: string
|
|
70
70
|
description: The greeting.
|
|
71
71
|
examples: [ "Hello, Ada!" ]
|
|
72
|
-
body: { message: "
|
|
72
|
+
body: { message: !cel "result.message" }
|
|
73
73
|
---
|
|
74
74
|
kind: JS.Script
|
|
75
75
|
metadata: { name: Greet }
|
|
@@ -2,7 +2,7 @@ import { CatchEntry, ReturnEntry } from "@telorun/http-dispatch";
|
|
|
2
2
|
import { type Invocable, type KindRef, type ResourceContext, type ResourceInstance, type RuntimeResource } from "@telorun/sdk";
|
|
3
3
|
import { FastifyInstance } from "fastify";
|
|
4
4
|
/** A mounted Telo.Mount instance (Http.Api, Mcp.HttpEndpoint, …). The kernel injects the
|
|
5
|
-
* live instance into a mount's `mount` slot (x-telo-ref
|
|
5
|
+
* live instance into a mount's `mount` slot (x-telo-ref `Telo.Mount`) — cross-module refs
|
|
6
6
|
* resolve to an imported library's exported mount — and every mountable exposes register(). */
|
|
7
7
|
interface Mountable {
|
|
8
8
|
register(app: FastifyInstance, prefix: string): void | Promise<void>;
|
|
@@ -189,7 +189,7 @@ class HttpServer {
|
|
|
189
189
|
for (const mount of mounts) {
|
|
190
190
|
const prefix = mount.path || "";
|
|
191
191
|
// `mount.mount` is the live Telo.Mount instance injected by the kernel at Phase 5
|
|
192
|
-
// (x-telo-ref
|
|
192
|
+
// (x-telo-ref `Telo.Mount`) — a same-module or imported-library mount, uniformly.
|
|
193
193
|
const api = mount.mount;
|
|
194
194
|
if (!api || typeof api.register !== "function") {
|
|
195
195
|
throw new Error(`Failed to mount at "${prefix}": mount target did not resolve to a Telo.Mount instance`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/http-server",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Telo HTTP Server module - HTTP server and API resource kinds for Telo manifests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"ajv": "^8.17.1",
|
|
50
50
|
"ajv-formats": "^3.0.1",
|
|
51
51
|
"fastify": "^5.7.2",
|
|
52
|
-
"@telorun/http-dispatch": "0.4.
|
|
52
|
+
"@telorun/http-dispatch": "0.4.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^20.0.0",
|
|
56
56
|
"typescript": "^5.0.0",
|
|
57
57
|
"vitest": "^2.1.8",
|
|
58
|
-
"@telorun/sdk": "0.
|
|
58
|
+
"@telorun/sdk": "0.56.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@telorun/sdk": "*"
|
|
@@ -22,7 +22,7 @@ import Fastify, { FastifyInstance } from "fastify";
|
|
|
22
22
|
import { fastifyReplySink } from "./fastify-reply-sink.js";
|
|
23
23
|
|
|
24
24
|
/** A mounted Telo.Mount instance (Http.Api, Mcp.HttpEndpoint, …). The kernel injects the
|
|
25
|
-
* live instance into a mount's `mount` slot (x-telo-ref
|
|
25
|
+
* live instance into a mount's `mount` slot (x-telo-ref `Telo.Mount`) — cross-module refs
|
|
26
26
|
* resolve to an imported library's exported mount — and every mountable exposes register(). */
|
|
27
27
|
interface Mountable {
|
|
28
28
|
register(app: FastifyInstance, prefix: string): void | Promise<void>;
|
|
@@ -59,7 +59,7 @@ type HttpServerResource = RuntimeResource & {
|
|
|
59
59
|
};
|
|
60
60
|
mounts?: Array<{
|
|
61
61
|
path?: string;
|
|
62
|
-
// x-telo-ref
|
|
62
|
+
// x-telo-ref `Telo.Mount`: Phase 5 replaces this slot with the live mounted
|
|
63
63
|
// instance (Http.Api, Mcp.HttpEndpoint, …), local or imported.
|
|
64
64
|
mount?: Mountable;
|
|
65
65
|
}>;
|
|
@@ -270,7 +270,7 @@ class HttpServer implements ResourceInstance {
|
|
|
270
270
|
for (const mount of mounts) {
|
|
271
271
|
const prefix = mount.path || "";
|
|
272
272
|
// `mount.mount` is the live Telo.Mount instance injected by the kernel at Phase 5
|
|
273
|
-
// (x-telo-ref
|
|
273
|
+
// (x-telo-ref `Telo.Mount`) — a same-module or imported-library mount, uniformly.
|
|
274
274
|
const api = mount.mount;
|
|
275
275
|
if (!api || typeof api.register !== "function") {
|
|
276
276
|
throw new Error(
|