@nylorun/runtime 0.17.0-beta → 0.19.1-beta
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 +155 -0
- package/README.md +89 -58
- package/dist/adapters/execution/restate.d.ts +1 -3
- package/dist/adapters/execution/restate.js +4 -31
- package/dist/adapters/replication/pgoutput.js +1 -1
- package/dist/adapters/sandbox/local.js +1 -1
- package/dist/adapters/sandbox/virtual.js +1 -1
- package/dist/api/ag-ui/routes.js +1 -1
- package/dist/api/ag-ui/translate.d.ts +1 -3
- package/dist/api/ag-ui/translate.js +2 -17
- package/dist/api/components.d.ts +4871 -2614
- package/dist/api/components.js +12 -11
- package/dist/api/gate/routes.d.ts +7 -8
- package/dist/api/gate/routes.js +58 -52
- package/dist/api/http/app.d.ts +6 -0
- package/dist/api/http/app.js +18 -14
- package/dist/api/http/define.d.ts +14 -2
- package/dist/api/http/define.js +34 -15
- package/dist/api/http/routes/access.d.ts +3 -3
- package/dist/api/http/routes/access.js +18 -17
- package/dist/api/http/routes/artifacts.js +2 -4
- package/dist/api/http/routes/files.d.ts +8 -0
- package/dist/api/http/routes/files.js +77 -0
- package/dist/api/http/routes/keys.d.ts +10 -0
- package/dist/api/http/routes/keys.js +64 -0
- package/dist/api/http/routes/me.js +5 -2
- package/dist/api/http/routes/reads.d.ts +66 -0
- package/dist/api/http/routes/reads.js +127 -0
- package/dist/api/http/routes/sandboxes.js +7 -4
- package/dist/api/http/routes/sessions.js +25 -8
- package/dist/api/http/routes/tenant.js +15 -18
- package/dist/api/http/routes/vaults.d.ts +10 -9
- package/dist/api/http/routes/vaults.js +27 -23
- package/dist/api/openapi.d.ts +10 -11
- package/dist/api/openapi.js +288 -63
- package/dist/artifacts/links.js +1 -1
- package/dist/core/flow-host.d.ts +44 -23
- package/dist/core/flow-host.js +88 -106
- package/dist/core/provider.d.ts +4 -1
- package/dist/core/provider.js +6 -1
- package/dist/core/sandbox-routes.d.ts +0 -9
- package/dist/core/sandbox-routes.js +2 -21
- package/dist/execution/memory.d.ts +4 -5
- package/dist/execution/memory.js +11 -25
- package/dist/execution/types.d.ts +3 -33
- package/dist/execution/types.js +2 -12
- package/dist/gates/http-tool.d.ts +86 -0
- package/dist/gates/http-tool.js +197 -0
- package/dist/gates/mcp-handler.d.ts +3 -0
- package/dist/gates/mcp-handler.js +1 -3
- package/dist/gates/meter.d.ts +2 -2
- package/dist/gates/meter.js +6 -0
- package/dist/gates/tenant-vaults.d.ts +5 -9
- package/dist/gates/tool-calls.d.ts +7 -15
- package/dist/gates/tool-calls.js +4 -4
- package/dist/gates/tool-client.d.ts +1 -1
- package/dist/gates/tool-client.js +23 -47
- package/dist/gates/tool-contract.d.ts +27 -39
- package/dist/gates/tool-contract.js +30 -21
- package/dist/gates/tool-gate.d.ts +25 -24
- package/dist/gates/tool-gate.js +11 -7
- package/dist/harness/calls.d.ts +10 -4
- package/dist/harness/calls.js +15 -6
- package/dist/harness/executors.d.ts +1 -1
- package/dist/harness/executors.js +17 -12
- package/dist/harness/main.d.ts +2 -2
- package/dist/harness/main.js +5 -13
- package/dist/harness/service.d.ts +4 -5
- package/dist/harness/service.js +9 -2
- package/dist/harness-api/in-process.js +2 -2
- package/dist/harness-api/record.d.ts +6 -3
- package/dist/harness-api/record.js +65 -72
- package/dist/harness-api/server.d.ts +1 -9
- package/dist/harness-api/server.js +19 -17
- package/dist/harness-api/start.js +1 -5
- package/dist/harness-api/workspace.js +2 -3
- package/dist/harness-api/ws-server.js +1 -1
- package/dist/host/app.d.ts +2 -9
- package/dist/host/app.js +15 -25
- package/dist/host/config-for.d.ts +1 -5
- package/dist/host/config-for.js +0 -3
- package/dist/host/config.d.ts +0 -5
- package/dist/host/create-host.d.ts +3 -33
- package/dist/host/create-host.js +18 -94
- package/dist/host/environment.d.ts +0 -3
- package/dist/host/environment.js +0 -9
- package/dist/host/gates.d.ts +4 -1
- package/dist/host/gates.js +3 -2
- package/dist/host/http.d.ts +1 -2
- package/dist/host/http.js +1 -7
- package/dist/host/index.d.ts +2 -2
- package/dist/host/index.js +2 -2
- package/dist/host/main.js +27 -34
- package/dist/host/operate.d.ts +29 -0
- package/dist/host/operate.js +223 -0
- package/dist/host/stack-config.d.ts +12 -12
- package/dist/host/stack-config.js +5 -32
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/infra/workers.d.ts +1 -1
- package/dist/keys/keys.js +2 -2
- package/dist/management-openapi.json +6491 -0
- package/dist/mcp/connect.d.ts +8 -4
- package/dist/mcp/connect.js +6 -26
- package/dist/mcp/pool.d.ts +5 -9
- package/dist/mcp/pool.js +8 -19
- package/dist/mcp/snapshot.d.ts +8 -2
- package/dist/mcp/snapshot.js +29 -2
- package/dist/media.d.ts +1 -1
- package/dist/media.js +1 -1
- package/dist/model/pi-model.js +3 -0
- package/dist/openapi.json +9372 -17030
- package/dist/reads/access.d.ts +4 -0
- package/dist/reads/access.js +12 -0
- package/dist/reads/cursor.d.ts +11 -0
- package/dist/reads/cursor.js +80 -0
- package/dist/reads/types.d.ts +25 -0
- package/dist/reads/types.js +1 -0
- package/dist/sandbox/manager.d.ts +16 -0
- package/dist/sandbox/manager.js +40 -0
- package/dist/sandbox/session-sandbox.js +13 -3
- package/dist/sandbox/skills.d.ts +13 -0
- package/dist/sandbox/skills.js +46 -0
- package/dist/sandbox/types.d.ts +2 -2
- package/dist/store/ownership.d.ts +9 -0
- package/dist/store/ownership.js +13 -0
- package/dist/store/postgres/connect.d.ts +2 -0
- package/dist/store/postgres/connect.js +29 -0
- package/dist/store/postgres/drizzle/0011_key_roles.sql +3 -0
- package/dist/store/postgres/drizzle/0012_session_reads.sql +8 -0
- package/dist/store/postgres/drizzle/0013_definition_files.sql +16 -0
- package/dist/store/postgres/drizzle/0014_action_endpoints_removed.sql +2 -0
- package/dist/store/postgres/drizzle/meta/_journal.json +28 -0
- package/dist/store/postgres/reads.d.ts +3 -0
- package/dist/store/postgres/reads.js +272 -0
- package/dist/store/postgres/schema.d.ts +294 -489
- package/dist/store/postgres/schema.js +41 -76
- package/dist/store/postgres/store.js +51 -154
- package/dist/store/postgres/tenant.d.ts +34 -2
- package/dist/store/postgres/tenant.js +16 -32
- package/dist/store/types.d.ts +27 -96
- package/dist/store/types.js +0 -1
- package/dist/streams/control.d.ts +0 -2
- package/dist/streams/control.js +0 -5
- package/dist/streams/types.d.ts +1 -10
- package/dist/tenant/advance.d.ts +3 -3
- package/dist/tenant/advance.js +10 -7
- package/dist/tenant/auth.d.ts +14 -9
- package/dist/tenant/auth.js +24 -28
- package/dist/tenant/cause.d.ts +3 -3
- package/dist/tenant/cause.js +1 -1
- package/dist/tenant/commands.d.ts +2 -18
- package/dist/tenant/commands.js +35 -172
- package/dist/tenant/context.d.ts +14 -24
- package/dist/tenant/definition-files.d.ts +24 -0
- package/dist/tenant/definition-files.js +103 -0
- package/dist/tenant/effects.d.ts +18 -20
- package/dist/tenant/effects.js +56 -119
- package/dist/tenant/ephemeral.d.ts +7 -6
- package/dist/tenant/ephemeral.js +3 -11
- package/dist/tenant/host-token.js +1 -1
- package/dist/tenant/jwt.js +1 -1
- package/dist/tenant/module.d.ts +1 -4
- package/dist/tenant/module.js +3 -12
- package/dist/tenant/operator-keys.d.ts +34 -8
- package/dist/tenant/operator-keys.js +50 -18
- package/dist/tenant/outbound.d.ts +10 -1
- package/dist/tenant/outbound.js +44 -27
- package/dist/tenant/paths.d.ts +1 -1
- package/dist/tenant/paths.js +1 -3
- package/dist/tenant/principals.d.ts +11 -2
- package/dist/tenant/principals.js +27 -8
- package/dist/tenant/run-token.js +3 -3
- package/dist/tenant/runtime.d.ts +4 -6
- package/dist/tenant/runtime.js +19 -18
- package/dist/tenant/sandboxes.d.ts +4 -1
- package/dist/tenant/sandboxes.js +11 -0
- package/dist/tenant/scheduler.d.ts +1 -5
- package/dist/tenant/scheduler.js +2 -5
- package/dist/tenant/session-streams.d.ts +2 -1
- package/dist/tenant/session-streams.js +39 -5
- package/dist/tenant/session.d.ts +8 -41
- package/dist/tenant/session.js +0 -37
- package/dist/tenant/sessions.js +16 -8
- package/dist/tenant/signing-keys.d.ts +3 -3
- package/dist/tenant/signing-keys.js +5 -5
- package/dist/tenant/skill-tool.d.ts +20 -0
- package/dist/tenant/skill-tool.js +72 -0
- package/dist/tenant/slim.d.ts +1 -1
- package/dist/tenant/slim.js +1 -1
- package/dist/tenant/status.js +7 -12
- package/dist/tenant/store-pg.d.ts +15 -0
- package/dist/tenant/store-pg.js +7 -3
- package/dist/tenant/streams.d.ts +3 -10
- package/dist/tenant/streams.js +1 -24
- package/dist/tenant/sweep.js +0 -5
- package/dist/tenant/transcript.d.ts +2 -2
- package/dist/tenant/transcript.js +2 -2
- package/dist/tenant/types.d.ts +15 -22
- package/dist/tenant/worker.d.ts +1 -3
- package/dist/tenant/worker.js +3 -8
- package/dist/vault/sources.d.ts +7 -1
- package/dist/vault/sources.js +22 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/admin-openapi.json +0 -904
- package/dist/api/http/routes/actions.d.ts +0 -8
- package/dist/api/http/routes/actions.js +0 -75
- package/dist/api/http/routes/endpoints.d.ts +0 -7
- package/dist/api/http/routes/endpoints.js +0 -100
- package/dist/host/admin-api.d.ts +0 -30
- package/dist/host/admin-api.js +0 -140
- package/dist/mcp/stdio.d.ts +0 -17
- package/dist/mcp/stdio.js +0 -82
- package/dist/tenant/actions.d.ts +0 -14
- package/dist/tenant/actions.js +0 -29
- package/dist/tenant/delivery-token.d.ts +0 -41
- package/dist/tenant/delivery-token.js +0 -104
- package/dist/tenant/delivery.d.ts +0 -62
- package/dist/tenant/delivery.js +0 -481
- package/dist/tenant/endpoints.d.ts +0 -67
- package/dist/tenant/endpoints.js +0 -90
package/dist/tenant/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
import type { HarnessStatus,
|
|
2
|
+
import type { HarnessStatus, HostTenant, TenantEnvelope } from "@nylorun/core/contracts";
|
|
3
3
|
import type { HarnessChannel } from "@nylorun/core/harness-api";
|
|
4
4
|
import type { FlowLimits } from "../core/limits.js";
|
|
5
5
|
import type { HarnessPeer } from "../harness-api/server.js";
|
|
@@ -7,23 +7,20 @@ import type { HostAuthority } from "../sandbox/join.js";
|
|
|
7
7
|
import type { SessionStore } from "../store/types.js";
|
|
8
8
|
import type { SandboxBackend } from "../sandbox/types.js";
|
|
9
9
|
import type { TenantCause } from "./cause.js";
|
|
10
|
-
import type { OperatorKeys } from "./operator-keys.js";
|
|
11
10
|
import type { OutboundPolicy } from "./outbound.js";
|
|
12
11
|
import type { ResolverConfig } from "../vault/sources.js";
|
|
13
12
|
import type { TenantWorker } from "./worker.js";
|
|
14
13
|
export type TenantMode = "shared" | "ephemeral" | "test";
|
|
15
14
|
/**
|
|
16
15
|
* The Tenant directory on the Host root (`<Host root>/tenant/`). The Tenant's data lives in
|
|
17
|
-
* its database; this holds what stays on the Host: the vault key,
|
|
18
|
-
*
|
|
16
|
+
* its database; this holds what stays on the Host: the vault key, logs, and the private home
|
|
17
|
+
* and sandbox directories.
|
|
19
18
|
*/
|
|
20
19
|
export interface TenantPaths {
|
|
21
20
|
root: string;
|
|
22
21
|
kek: string;
|
|
23
22
|
home: string;
|
|
24
|
-
tmp: string;
|
|
25
23
|
sandboxes: string;
|
|
26
|
-
pluginData: string;
|
|
27
24
|
/** The `fs` BlobStore's directory, used when the Host has no Object store. */
|
|
28
25
|
blobs: string;
|
|
29
26
|
logs: string;
|
|
@@ -55,18 +52,14 @@ export interface TenantConfig {
|
|
|
55
52
|
steps?: number;
|
|
56
53
|
ms?: number;
|
|
57
54
|
};
|
|
58
|
-
/**
|
|
59
|
-
* How long a run waits in its lease for a pending Action's outcome (F6.2): the turn goes on
|
|
60
|
-
* at once when the Action endpoint answers in time, and ends its segment as waiting (resumed
|
|
61
|
-
* by replay) otherwise. Default 5 minutes; 0 never waits.
|
|
62
|
-
*/
|
|
63
|
-
actionHoldMs?: number;
|
|
64
55
|
/** Retries and timeouts for model calls (Model Calls §5, §6). Defaults in `piModel`. */
|
|
65
56
|
modelCall?: import("../gates/model-gate.js").ModelCallSettings;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
/**
|
|
58
|
+
* How the Runtime may call MCP servers and HTTP tools (Host settings). Default: http and
|
|
59
|
+
* private addresses allowed.
|
|
60
|
+
*/
|
|
69
61
|
delivery?: OutboundPolicy;
|
|
62
|
+
/** Bounds the default Tenant sweep interval (`sweepIntervalMs`). Default 30 s. */
|
|
70
63
|
leaseMs?: number;
|
|
71
64
|
/** Ownership lease of an advance (§10.6); renewed every third while it runs. Default 30 s. */
|
|
72
65
|
ownerLeaseMs?: number;
|
|
@@ -110,9 +103,6 @@ export interface Logger {
|
|
|
110
103
|
export interface TenantSummary {
|
|
111
104
|
ready: boolean;
|
|
112
105
|
runningSessions: number;
|
|
113
|
-
/** Deliveries to Action endpoints in flight on this process. */
|
|
114
|
-
inFlightDeliveries: number;
|
|
115
|
-
pendingActions: number;
|
|
116
106
|
uncertainEffects: number;
|
|
117
107
|
/** The Tenant's harnesses (F6.2). */
|
|
118
108
|
harness?: HarnessStatus;
|
|
@@ -143,8 +133,8 @@ export interface TenantHandle {
|
|
|
143
133
|
attachHarness?(channel: HarnessChannel, peer: HarnessPeer): () => void;
|
|
144
134
|
/** The Tenant's side of a sandbox pod's join (F7.2); absent without sandbox pods. */
|
|
145
135
|
hostAuthority?(): HostAuthority | undefined;
|
|
146
|
-
/** The Tenant's
|
|
147
|
-
|
|
136
|
+
/** The Tenant's harnesses (F6.2), for `/ready`. */
|
|
137
|
+
harnessStatus?(): HarnessStatus;
|
|
148
138
|
}
|
|
149
139
|
/**
|
|
150
140
|
* The Host's Tenant for a request: open, or unavailable. `cause` says why when opening it
|
|
@@ -183,9 +173,10 @@ export interface TenantModule {
|
|
|
183
173
|
* Undefined otherwise, or once the module is closed.
|
|
184
174
|
*/
|
|
185
175
|
worker(id: string): Promise<TenantWorker | undefined>;
|
|
186
|
-
/** The Tenant
|
|
176
|
+
/** The Tenant, open or why not. */
|
|
187
177
|
tenant(): HostTenant;
|
|
188
|
-
|
|
178
|
+
/** The open Tenant's harnesses (`/ready`); undefined while it is not open. */
|
|
179
|
+
harnessStatus(): HarnessStatus | undefined;
|
|
189
180
|
close(): Promise<void>;
|
|
190
181
|
}
|
|
191
182
|
/**
|
|
@@ -208,6 +199,8 @@ export declare class TenantUnavailableError extends Error {
|
|
|
208
199
|
}
|
|
209
200
|
/** What the Tenant opener hands the Tenant Runtime it opens. */
|
|
210
201
|
export interface OpenedTenant {
|
|
202
|
+
/** The isolated read pool, owned and closed with the Tenant. */
|
|
203
|
+
reads?: import("../reads/types.js").ReadStore;
|
|
211
204
|
/**
|
|
212
205
|
* The Tenant's opened Session Store. The Tenant Runtime owns it from here on and closes it
|
|
213
206
|
* on close or on a failed open.
|
package/dist/tenant/worker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AbortReason } from "@nylorun/core/harness-api";
|
|
2
2
|
import { RunAbort } from "@nylorun/harness/api";
|
|
3
|
-
import type { AdvanceResult,
|
|
3
|
+
import type { AdvanceResult, SandboxResult, SandboxTrigger, DurableExecution, StuckInvocation, WorkerHandlers } from "../execution/types.js";
|
|
4
4
|
import type { Logger } from "./types.js";
|
|
5
5
|
/** This process's Worker id: the `owner` it writes on the sessions it advances (§10.6). */
|
|
6
6
|
export declare const WORKER_ID: string;
|
|
@@ -42,8 +42,6 @@ export interface TenantWorker {
|
|
|
42
42
|
advance(sessionId: string, signal: AbortSignal): Promise<AdvanceResult>;
|
|
43
43
|
/** One pass of the Tenant sweep. */
|
|
44
44
|
sweep(): Promise<void>;
|
|
45
|
-
/** Delivers one Action to its endpoint. Only infrastructure errors throw. */
|
|
46
|
-
deliver?(actionId: string, signal: AbortSignal): Promise<DeliverResult>;
|
|
47
45
|
/** Reconciles one pod sandbox (F7.2). Only infrastructure errors throw. */
|
|
48
46
|
sandbox?(sandboxId: string, trigger: SandboxTrigger, signal: AbortSignal): Promise<SandboxResult>;
|
|
49
47
|
}
|
package/dist/tenant/worker.js
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
*
|
|
5
5
|
* - `TenantWorker` is one open Tenant's handlers: `advance(sessionId, signal)` (§10.5, in
|
|
6
6
|
* `advance.ts`), `sweep()` (the Tenant sweep, in `sweep.ts`) and, optionally,
|
|
7
|
-
* `
|
|
7
|
+
* `sandbox(sandboxId, trigger, signal)` (one pod sandbox's reconcile).
|
|
8
8
|
* - `TenantWorkers` is the registry. Its `handlers` are the `WorkerHandlers` an execution is
|
|
9
9
|
* started with; they dispatch by `tenantId` to the registered `TenantWorker`. A Tenant
|
|
10
10
|
* registers when it opens and unregisters when it closes. A call for a Tenant that is not
|
|
11
11
|
* open here asks the optional `resolve` hook (the Host's, which waits for its Tenant to
|
|
12
12
|
* open, and knows no other); without one,
|
|
13
|
-
* the advance
|
|
14
|
-
*
|
|
15
|
-
* that was not delivered stays pending.
|
|
13
|
+
* the advance returns `done` and the sweep does nothing. Nothing is lost: the Tenant's
|
|
14
|
+
* sweep re-wakes its orphaned sessions once it is open again.
|
|
16
15
|
* - `TenantExecution` pairs an execution with its registry. The Host creates one per process
|
|
17
16
|
* (`host/execution.ts`) and passes it to its Tenant; a Tenant opened without one
|
|
18
17
|
* (tests, ephemeral) gets its own in-process `MemoryExecution`.
|
|
@@ -136,10 +135,6 @@ export class TenantWorkers {
|
|
|
136
135
|
sweep: async (tenantId) => {
|
|
137
136
|
await (await this.find(tenantId))?.sweep();
|
|
138
137
|
},
|
|
139
|
-
deliver: async (tenantId, actionId, signal) => {
|
|
140
|
-
const worker = await this.find(tenantId);
|
|
141
|
-
return worker?.deliver ? worker.deliver(actionId, signal) : DONE;
|
|
142
|
-
},
|
|
143
138
|
sandbox: async (tenantId, sandboxId, trigger, signal) => {
|
|
144
139
|
const worker = await this.find(tenantId);
|
|
145
140
|
return worker?.sandbox ? worker.sandbox(sandboxId, trigger, signal) : {};
|
package/dist/vault/sources.d.ts
CHANGED
|
@@ -13,9 +13,15 @@ export interface CredentialSession {
|
|
|
13
13
|
readonly vaultIds?: readonly string[];
|
|
14
14
|
readonly credentialSelections?: readonly CredentialSelection[];
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* One MCP request: the declared server's URL, its name and the agent that declares it. Or, with
|
|
18
|
+
* `kind: "http"`, an HTTP tool's request: its URL and its `credential` name as `serverName`.
|
|
19
|
+
*/
|
|
17
20
|
export interface McpCredentialRequest {
|
|
21
|
+
/** Default `mcp`. */
|
|
22
|
+
readonly kind?: "mcp" | "http";
|
|
18
23
|
readonly url: string;
|
|
24
|
+
/** The server's name, or the HTTP tool's `credential`: what a credential selection names. */
|
|
19
25
|
readonly serverName?: string;
|
|
20
26
|
/** The agent used as a tool that declares the server; absent for the session's root agent. */
|
|
21
27
|
readonly agentId?: string;
|
package/dist/vault/sources.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where a session's MCP credential comes from (F9 C1): the session's attached
|
|
3
|
-
* then the operator's credential resolver, an HTTP service on the operator's own
|
|
4
|
-
* holds people's own credentials (OSS never stores them, F9-D7).
|
|
2
|
+
* Where a session's MCP or HTTP tool credential comes from (F9 C1): the session's attached
|
|
3
|
+
* vaults first, then the operator's credential resolver, an HTTP service on the operator's own
|
|
4
|
+
* network that holds people's own credentials (OSS never stores them, F9-D7).
|
|
5
5
|
*
|
|
6
|
-
* Both authorize sites call this: the gateway (`gates/tenant-vaults.ts`, remote MCP servers
|
|
7
|
-
* the gates service) and the Tenant (`tenant/effects.ts`, the in-process MCP pool
|
|
6
|
+
* Both authorize sites call this: the gateway (`gates/tenant-vaults.ts`, remote MCP servers and
|
|
7
|
+
* HTTP tools in the gates service) and the Tenant (`tenant/effects.ts`, the in-process MCP pool
|
|
8
|
+
* and Tool Gate).
|
|
8
9
|
*
|
|
9
10
|
* ## The resolver contract
|
|
10
11
|
*
|
|
@@ -22,6 +23,9 @@
|
|
|
22
23
|
* anything else, a bad body, or no answer in 5 s → refused: credential_unavailable
|
|
23
24
|
* ```
|
|
24
25
|
*
|
|
26
|
+
* An HTTP tool's request (R2 M3) names its `credential` instead of a server:
|
|
27
|
+
* `"target": { "kind": "http", "credential": "billing", "agent"?: "support", "url": "https://…" }`.
|
|
28
|
+
*
|
|
25
29
|
* `owner` and `turn` come from the session row, never from the harness. Because authorize runs
|
|
26
30
|
* on every MCP HTTP request, answers (200 and 404) are cached per (owner, url): until
|
|
27
31
|
* `expiresAt`, at most 5 minutes, and 60 s without one. Concurrent misses for one key share one
|
|
@@ -122,12 +126,19 @@ export class CredentialSources {
|
|
|
122
126
|
owner: session.ownerUserId,
|
|
123
127
|
session: session.id,
|
|
124
128
|
turn: session.activeTurnId ?? null,
|
|
125
|
-
target:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
target: request.kind === "http"
|
|
130
|
+
? {
|
|
131
|
+
kind: "http",
|
|
132
|
+
...(request.serverName ? { credential: request.serverName } : {}),
|
|
133
|
+
...(request.agentId ? { agent: request.agentId } : {}),
|
|
134
|
+
url,
|
|
135
|
+
}
|
|
136
|
+
: {
|
|
137
|
+
kind: "mcp",
|
|
138
|
+
...(request.serverName ? { server: request.serverName } : {}),
|
|
139
|
+
...(request.agentId ? { agent: request.agentId } : {}),
|
|
140
|
+
url,
|
|
141
|
+
},
|
|
131
142
|
};
|
|
132
143
|
try {
|
|
133
144
|
const response = await this.fetchImpl(resolver.url, {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RUNTIME_VERSION = "0.
|
|
1
|
+
export declare const RUNTIME_VERSION = "0.19.1-beta";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1-beta",
|
|
4
4
|
"description": "Nylorun Runtime: the agent execution Host on Postgres, Restate and S2, and model providers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"import": "./dist/configuration.js"
|
|
32
32
|
},
|
|
33
33
|
"./openapi.json": "./dist/openapi.json",
|
|
34
|
-
"./
|
|
34
|
+
"./management-openapi.json": "./dist/management-openapi.json",
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@hono/node-server": "^2.1.3",
|
|
66
66
|
"@hono/zod-openapi": "^1.6.3",
|
|
67
67
|
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
68
|
-
"@nylorun/core": "0.
|
|
69
|
-
"@nylorun/harness": "0.
|
|
68
|
+
"@nylorun/core": "0.15.0-beta",
|
|
69
|
+
"@nylorun/harness": "0.23.0-beta",
|
|
70
70
|
"@restatedev/restate-sdk": "1.17.2",
|
|
71
71
|
"@s2-dev/streamstore": "0.28.0",
|
|
72
72
|
"aws4fetch": "1.0.20",
|