@nylorun/runtime 0.26.0-beta → 0.28.0-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 +171 -0
- package/README.md +18 -14
- package/dist/adapters/execution/restate.d.ts +15 -18
- package/dist/adapters/execution/restate.js +31 -27
- package/dist/adapters/replication/pgoutput.d.ts +1 -1
- package/dist/adapters/replication/pgoutput.js +3 -2
- package/dist/adapters/sandbox/local.js +8 -5
- package/dist/adapters/sandbox/virtual.js +2 -2
- package/dist/adapters/streams/s2.d.ts +1 -1
- package/dist/adapters/streams/s2.js +18 -14
- package/dist/api/a2a/card.d.ts +4 -3
- package/dist/api/a2a/card.js +4 -4
- package/dist/api/a2a/endpoint.js +3 -4
- package/dist/api/a2a/protocol.js +4 -0
- package/dist/api/a2a/routes.d.ts +2 -6
- package/dist/api/a2a/routes.js +30 -25
- package/dist/api/ag-ui/endpoint.js +2 -3
- package/dist/api/ag-ui/routes.js +8 -11
- package/dist/api/components.d.ts +6789 -3405
- package/dist/api/components.js +43 -30
- package/dist/api/gate/keys.js +7 -4
- package/dist/api/gate/routes.d.ts +6 -2
- package/dist/api/gate/routes.js +15 -11
- package/dist/api/http/app.js +9 -4
- package/dist/api/http/body.d.ts +17 -3
- package/dist/api/http/body.js +35 -7
- package/dist/api/http/respond.js +6 -2
- package/dist/api/http/routes/access.js +5 -4
- package/dist/api/http/routes/agent-manifests.d.ts +10 -0
- package/dist/api/http/routes/agent-manifests.js +135 -0
- package/dist/api/http/routes/agents.d.ts +11 -0
- package/dist/api/http/routes/agents.js +418 -0
- package/dist/api/http/routes/artifacts.js +21 -9
- package/dist/api/http/routes/coverage.d.ts +4 -4
- package/dist/api/http/routes/coverage.js +13 -7
- package/dist/api/http/routes/files.d.ts +2 -1
- package/dist/api/http/routes/files.js +31 -5
- package/dist/api/http/routes/mcp.js +3 -3
- package/dist/api/http/routes/me.d.ts +1 -1
- package/dist/api/http/routes/me.js +1 -2
- package/dist/api/http/routes/memories.d.ts +9 -0
- package/dist/api/http/routes/memories.js +152 -0
- package/dist/api/http/routes/reads.d.ts +10 -111
- package/dist/api/http/routes/reads.js +51 -29
- package/dist/api/http/routes/sessions.js +26 -54
- package/dist/api/http/routes/tenant.d.ts +2 -2
- package/dist/api/http/routes/tenant.js +77 -24
- package/dist/api/http/routes/triggers.d.ts +10 -0
- package/dist/api/http/routes/triggers.js +180 -0
- package/dist/api/inbound-files.d.ts +3 -9
- package/dist/api/inbound-files.js +18 -24
- package/dist/api/openapi.js +73 -47
- package/dist/artifacts/disk.d.ts +10 -14
- package/dist/artifacts/disk.js +99 -95
- package/dist/artifacts/files.d.ts +13 -4
- package/dist/artifacts/files.js +27 -9
- package/dist/artifacts/folder-upload.d.ts +75 -0
- package/dist/artifacts/folder-upload.js +263 -0
- package/dist/artifacts/folders.d.ts +14 -8
- package/dist/artifacts/folders.js +19 -11
- package/dist/artifacts/links.js +7 -6
- package/dist/artifacts/parts.d.ts +9 -14
- package/dist/artifacts/parts.js +11 -9
- package/dist/artifacts/pipe.d.ts +15 -0
- package/dist/artifacts/pipe.js +71 -0
- package/dist/artifacts/quota.d.ts +36 -0
- package/dist/artifacts/quota.js +44 -0
- package/dist/artifacts/service.d.ts +25 -1
- package/dist/artifacts/service.js +72 -27
- package/dist/blob/fs.js +2 -1
- package/dist/blob/s3.d.ts +6 -2
- package/dist/blob/s3.js +9 -7
- package/dist/blob/types.d.ts +1 -1
- package/dist/blob/types.js +1 -1
- package/dist/core/flow-host.d.ts +0 -1
- package/dist/core/limits.d.ts +11 -35
- package/dist/core/limits.js +5 -73
- package/dist/core/sandbox-routes.js +0 -1
- package/dist/core/turn-manifest.d.ts +1 -2
- package/dist/core/turn-manifest.js +4 -28
- package/dist/execution/memory.d.ts +8 -5
- package/dist/execution/memory.js +8 -6
- package/dist/execution/types.d.ts +1 -6
- package/dist/execution/types.js +0 -5
- package/dist/gates/contract.d.ts +3 -2
- package/dist/gates/contract.js +1 -1
- package/dist/gates/egress-credentials.js +5 -4
- package/dist/gates/egress.d.ts +13 -13
- package/dist/gates/egress.js +19 -21
- package/dist/gates/fixture-model.js +13 -2
- package/dist/gates/handler.d.ts +1 -3
- package/dist/gates/handler.js +4 -3
- package/dist/gates/http-client.d.ts +4 -3
- package/dist/gates/http-client.js +5 -7
- package/dist/gates/http-tool.d.ts +24 -4
- package/dist/gates/http-tool.js +41 -13
- package/dist/gates/in-process.d.ts +2 -1
- package/dist/gates/in-process.js +17 -9
- package/dist/gates/inflight.d.ts +2 -2
- package/dist/gates/inflight.js +3 -2
- package/dist/gates/journal.js +5 -7
- package/dist/gates/mcp-handler.d.ts +4 -3
- package/dist/gates/mcp-handler.js +15 -5
- package/dist/gates/meter.js +6 -5
- package/dist/gates/model-gate.d.ts +11 -2
- package/dist/gates/policy.d.ts +34 -6
- package/dist/gates/policy.js +66 -18
- package/dist/gates/provider-gate.d.ts +22 -0
- package/dist/gates/provider-gate.js +30 -0
- package/dist/gates/tool-calls.d.ts +1 -3
- package/dist/gates/tool-calls.js +2 -3
- package/dist/gates/tool-client.d.ts +1 -1
- package/dist/gates/tool-client.js +5 -6
- package/dist/gates/tool-contract.d.ts +8 -5
- package/dist/gates/tool-contract.js +1 -1
- package/dist/gates/tool-gate.d.ts +18 -7
- package/dist/gates/tool-gate.js +49 -7
- package/dist/harness/calls.d.ts +27 -25
- package/dist/harness/calls.js +40 -46
- package/dist/harness/executors.d.ts +10 -3
- package/dist/harness/executors.js +53 -23
- package/dist/harness/main.js +2 -2
- package/dist/harness/pod.d.ts +2 -2
- package/dist/harness/pod.js +7 -6
- package/dist/harness/run-tokens.d.ts +4 -1
- package/dist/harness/run-tokens.js +6 -2
- package/dist/harness/service.d.ts +17 -14
- package/dist/harness/service.js +21 -35
- package/dist/harness/setup.d.ts +0 -2
- package/dist/harness/setup.js +21 -15
- package/dist/harness/ws-client.d.ts +2 -2
- package/dist/harness/ws-client.js +7 -5
- package/dist/harness/ws-port.d.ts +3 -4
- package/dist/harness/ws-port.js +3 -4
- package/dist/harness-api/artifacts.d.ts +20 -0
- package/dist/harness-api/artifacts.js +478 -0
- package/dist/harness-api/in-process.d.ts +2 -2
- package/dist/harness-api/in-process.js +18 -16
- package/dist/harness-api/record.d.ts +10 -9
- package/dist/harness-api/record.js +113 -157
- package/dist/harness-api/renew.d.ts +1 -1
- package/dist/harness-api/renew.js +2 -2
- package/dist/harness-api/server.d.ts +1 -16
- package/dist/harness-api/server.js +86 -73
- package/dist/harness-api/start.d.ts +27 -5
- package/dist/harness-api/start.js +102 -19
- package/dist/harness-api/tool-journal.d.ts +15 -10
- package/dist/harness-api/tool-journal.js +26 -24
- package/dist/harness-api/workspace.d.ts +0 -4
- package/dist/harness-api/workspace.js +4 -47
- package/dist/harness-api/ws-server.js +10 -10
- package/dist/host/create-host.js +2 -3
- package/dist/host/execution.js +2 -3
- package/dist/host/gates.d.ts +2 -9
- package/dist/host/gates.js +15 -12
- package/dist/host/http.d.ts +2 -4
- package/dist/host/http.js +5 -29
- package/dist/host/main.js +10 -3
- package/dist/host/operate.js +12 -3
- package/dist/host/stack-config.d.ts +11 -0
- package/dist/host/stack-config.js +21 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/infra/index.js +2 -1
- package/dist/infra/readiness.d.ts +0 -2
- package/dist/infra/readiness.js +4 -3
- package/dist/keys/client.d.ts +1 -0
- package/dist/keys/client.js +2 -3
- package/dist/keys/contract.d.ts +0 -2
- package/dist/keys/contract.js +0 -2
- package/dist/keys/egress-ca.d.ts +0 -2
- package/dist/keys/egress-ca.js +2 -3
- package/dist/keys/keys.d.ts +15 -4
- package/dist/keys/keys.js +22 -1
- package/dist/keys/webhooks.d.ts +25 -0
- package/dist/keys/webhooks.js +62 -0
- package/dist/keys/x509.d.ts +8 -4
- package/dist/keys/x509.js +14 -5
- package/dist/management-openapi.json +3043 -1954
- package/dist/mcp/connect.d.ts +35 -26
- package/dist/mcp/connect.js +112 -141
- package/dist/mcp/pool.d.ts +27 -22
- package/dist/mcp/pool.js +34 -48
- package/dist/mcp/preview.d.ts +12 -5
- package/dist/mcp/preview.js +43 -26
- package/dist/mcp/snapshot.d.ts +35 -86
- package/dist/mcp/snapshot.js +93 -135
- package/dist/memory/service.d.ts +97 -0
- package/dist/memory/service.js +335 -0
- package/dist/memory/tool.d.ts +36 -0
- package/dist/memory/tool.js +84 -0
- package/dist/model/auth-store.js +5 -3
- package/dist/model/capabilities.d.ts +1 -1
- package/dist/model/catalog.d.ts +9 -36
- package/dist/model/catalog.js +6 -33
- package/dist/model/descriptor.d.ts +51 -0
- package/dist/model/descriptor.js +83 -0
- package/dist/model/models.d.ts +0 -3
- package/dist/model/models.js +3 -5
- package/dist/model/native-blocks.js +1 -1
- package/dist/model/pi-model.d.ts +16 -5
- package/dist/model/pi-model.js +86 -105
- package/dist/openapi.json +13653 -9986
- package/dist/reads/cursor.js +3 -1
- package/dist/reads/types.d.ts +3 -3
- package/dist/record/agent.d.ts +27 -0
- package/dist/record/agent.js +46 -0
- package/dist/record/append.d.ts +34 -2
- package/dist/record/append.js +50 -1
- package/dist/record/index.d.ts +2 -2
- package/dist/record/index.js +2 -2
- package/dist/redact.d.ts +1 -1
- package/dist/redact.js +3 -2
- package/dist/sandbox/egress-token.d.ts +3 -3
- package/dist/sandbox/egress-token.js +3 -3
- package/dist/sandbox/join.js +8 -7
- package/dist/sandbox/manager.d.ts +41 -41
- package/dist/sandbox/manager.js +112 -44
- package/dist/sandbox/placement.d.ts +2 -2
- package/dist/sandbox/placement.js +7 -10
- package/dist/sandbox/pods/client.d.ts +1 -10
- package/dist/sandbox/pods/client.js +8 -4
- package/dist/sandbox/pods/lifecycle.d.ts +25 -17
- package/dist/sandbox/pods/lifecycle.js +51 -29
- package/dist/sandbox/pods/network-gate.d.ts +4 -5
- package/dist/sandbox/pods/network-gate.js +7 -7
- package/dist/sandbox/pods/reconcile.js +14 -3
- package/dist/sandbox/pods/spec.js +8 -5
- package/dist/sandbox/policy.d.ts +7 -1
- package/dist/sandbox/policy.js +10 -3
- package/dist/sandbox/resolve.d.ts +11 -6
- package/dist/sandbox/resolve.js +19 -9
- package/dist/sandbox/setup.d.ts +6 -2
- package/dist/sandbox/setup.js +47 -14
- package/dist/sandbox/share.d.ts +5 -14
- package/dist/sandbox/share.js +5 -34
- package/dist/sandbox/skills.d.ts +7 -13
- package/dist/sandbox/skills.js +16 -31
- package/dist/sandbox/tenant-config.d.ts +2 -2
- package/dist/sandbox/tenant-config.js +4 -3
- package/dist/sandbox/tools.d.ts +7 -1
- package/dist/sandbox/tools.js +26 -26
- package/dist/sandbox/types.d.ts +10 -3
- package/dist/sandbox/types.js +9 -0
- package/dist/store/postgres/connect.d.ts +6 -5
- package/dist/store/postgres/connect.js +14 -11
- package/dist/store/postgres/control.js +13 -13
- package/dist/store/postgres/drizzle/0028_artifact_write_keys.sql +2 -0
- package/dist/store/postgres/drizzle/0029_protocol_15.sql +11 -0
- package/dist/store/postgres/drizzle/0030_protocol_15_runtime_block.sql +11 -0
- package/dist/store/postgres/drizzle/0031_protocol_15_mcp_snapshot.sql +8 -0
- package/dist/store/postgres/drizzle/0032_agents.sql +54 -0
- package/dist/store/postgres/drizzle/0033_agent_versions.sql +7 -0
- package/dist/store/postgres/drizzle/0034_protocol_17_session_queue.sql +13 -0
- package/dist/store/postgres/drizzle/0035_t4_triggers.sql +41 -0
- package/dist/store/postgres/drizzle/0036_t5_memories.sql +30 -0
- package/dist/store/postgres/drizzle/meta/_journal.json +63 -0
- package/dist/store/postgres/reads.js +17 -82
- package/dist/store/postgres/record-writer.d.ts +4 -4
- package/dist/store/postgres/record-writer.js +9 -9
- package/dist/store/postgres/schema.d.ts +1382 -151
- package/dist/store/postgres/schema.js +191 -37
- package/dist/store/postgres/store.js +384 -105
- package/dist/store/postgres/tenant.js +1 -2
- package/dist/store/types.d.ts +172 -57
- package/dist/store/types.js +0 -1
- package/dist/streams/relay/core.d.ts +3 -3
- package/dist/streams/relay/core.js +9 -10
- package/dist/tenant/advance.js +41 -39
- package/dist/tenant/agent-manifests.d.ts +72 -0
- package/dist/tenant/agent-manifests.js +359 -0
- package/dist/tenant/agent-versions.d.ts +126 -0
- package/dist/tenant/agent-versions.js +389 -0
- package/dist/tenant/agents.d.ts +230 -0
- package/dist/tenant/{environments.js → agents.js} +493 -328
- package/dist/tenant/auth.d.ts +1 -1
- package/dist/tenant/auth.js +3 -3
- package/dist/tenant/commands.d.ts +63 -2
- package/dist/tenant/commands.js +240 -90
- package/dist/tenant/context.d.ts +57 -33
- package/dist/tenant/context.js +6 -2
- package/dist/tenant/definition-files.d.ts +25 -4
- package/dist/tenant/definition-files.js +85 -47
- package/dist/tenant/effects.js +15 -51
- package/dist/tenant/ephemeral.js +2 -1
- package/dist/tenant/history.d.ts +1 -1
- package/dist/tenant/history.js +1 -1
- package/dist/tenant/host-token.d.ts +3 -3
- package/dist/tenant/host-token.js +11 -10
- package/dist/tenant/http.d.ts +5 -8
- package/dist/tenant/http.js +9 -0
- package/dist/tenant/identity-file.d.ts +29 -6
- package/dist/tenant/identity-file.js +45 -15
- package/dist/tenant/issuers.d.ts +5 -5
- package/dist/tenant/issuers.js +34 -26
- package/dist/tenant/jwt.d.ts +8 -2
- package/dist/tenant/jwt.js +10 -2
- package/dist/tenant/limits.d.ts +87 -0
- package/dist/tenant/limits.js +172 -0
- package/dist/tenant/memories.d.ts +38 -0
- package/dist/tenant/memories.js +119 -0
- package/dist/tenant/module.d.ts +4 -1
- package/dist/tenant/module.js +9 -8
- package/dist/tenant/outbound.d.ts +11 -14
- package/dist/tenant/outbound.js +10 -15
- package/dist/tenant/reset.js +2 -2
- package/dist/tenant/run-grants.d.ts +6 -0
- package/dist/tenant/run-grants.js +7 -2
- package/dist/tenant/run-token.d.ts +0 -4
- package/dist/tenant/run-token.js +6 -11
- package/dist/tenant/runtime-limits.d.ts +24 -0
- package/dist/tenant/runtime-limits.js +27 -0
- package/dist/tenant/runtime.d.ts +1 -1
- package/dist/tenant/runtime.js +38 -43
- package/dist/tenant/session-streams.js +7 -6
- package/dist/tenant/session.d.ts +1 -1
- package/dist/tenant/session.js +1 -1
- package/dist/tenant/sessions.d.ts +28 -45
- package/dist/tenant/sessions.js +89 -209
- package/dist/tenant/signing-keys.d.ts +1 -1
- package/dist/tenant/signing-keys.js +5 -6
- package/dist/tenant/status.js +10 -10
- package/dist/tenant/streams.js +18 -20
- package/dist/tenant/sweep.d.ts +1 -21
- package/dist/tenant/sweep.js +51 -51
- package/dist/tenant/transcript.d.ts +70 -23
- package/dist/tenant/transcript.js +28 -22
- package/dist/tenant/triggers.d.ts +143 -0
- package/dist/tenant/triggers.js +715 -0
- package/dist/tenant/turn-timing.d.ts +11 -1
- package/dist/tenant/turn-timing.js +3 -1
- package/dist/tenant/types.d.ts +9 -14
- package/dist/tenant/worker.d.ts +4 -10
- package/dist/tenant/worker.js +10 -14
- package/dist/traces/ids.js +5 -1
- package/dist/traces/map.d.ts +10 -7
- package/dist/traces/map.js +16 -12
- package/dist/traces/otlp.d.ts +3 -3
- package/dist/traces/otlp.js +5 -3
- package/dist/traces/projector.d.ts +9 -4
- package/dist/traces/projector.js +13 -7
- package/dist/traces/read.js +6 -1
- package/dist/tuning.d.ts +390 -0
- package/dist/tuning.js +677 -0
- package/dist/vault/headers.js +4 -2
- package/dist/vault/service.d.ts +13 -8
- package/dist/vault/service.js +61 -17
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +13 -12
- package/dist/api/http/routes/environment-manifests.d.ts +0 -9
- package/dist/api/http/routes/environment-manifests.js +0 -118
- package/dist/api/http/routes/environments.d.ts +0 -11
- package/dist/api/http/routes/environments.js +0 -332
- package/dist/artifacts/export.d.ts +0 -8
- package/dist/artifacts/export.js +0 -204
- package/dist/artifacts/media-types.d.ts +0 -30
- package/dist/artifacts/media-types.js +0 -137
- package/dist/artifacts/workspace.d.ts +0 -60
- package/dist/artifacts/workspace.js +0 -45
- package/dist/media.d.ts +0 -10
- package/dist/media.js +0 -58
- package/dist/record/environment.d.ts +0 -25
- package/dist/record/environment.js +0 -44
- package/dist/sandbox/runtime-tools.d.ts +0 -9
- package/dist/sandbox/runtime-tools.js +0 -16
- package/dist/sandbox/session-sandbox.d.ts +0 -16
- package/dist/sandbox/session-sandbox.js +0 -77
- package/dist/tenant/artifact-tool.d.ts +0 -13
- package/dist/tenant/artifact-tool.js +0 -243
- package/dist/tenant/environment-manifests.d.ts +0 -57
- package/dist/tenant/environment-manifests.js +0 -200
- package/dist/tenant/environments.d.ts +0 -174
- package/dist/tenant/skill-tool.d.ts +0 -20
- package/dist/tenant/skill-tool.js +0 -67
- package/dist/tenant/tool-results.d.ts +0 -57
- package/dist/tenant/tool-results.js +0 -298
- package/dist/tenant/tool-search.d.ts +0 -39
- package/dist/tenant/tool-search.js +0 -103
package/dist/vault/headers.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Runtime sets itself, so a credential can never replace them.
|
|
5
5
|
*/
|
|
6
6
|
import { VaultError } from "./error.js";
|
|
7
|
+
import { hostTuning } from "../tuning.js";
|
|
7
8
|
/** Headers the MCP transport and the HTTP tool call own. */
|
|
8
9
|
const RESERVED_HEADERS = new Set([
|
|
9
10
|
"host",
|
|
@@ -25,13 +26,14 @@ const RESERVED_HEADERS = new Set([
|
|
|
25
26
|
export function credentialSecrets(headers, identity) {
|
|
26
27
|
const skip = identity?.header.toLowerCase();
|
|
27
28
|
const secrets = new Set();
|
|
29
|
+
const least = hostTuning().harness.scrubMinChars;
|
|
28
30
|
for (const [name, value] of Object.entries(headers)) {
|
|
29
31
|
if (name.toLowerCase() === skip)
|
|
30
32
|
continue;
|
|
31
|
-
if (value.length >=
|
|
33
|
+
if (value.length >= least)
|
|
32
34
|
secrets.add(value);
|
|
33
35
|
const bearer = /^bearer\s+(\S+)\s*$/iu.exec(value)?.[1];
|
|
34
|
-
if (bearer !== undefined && bearer.length >=
|
|
36
|
+
if (bearer !== undefined && bearer.length >= least)
|
|
35
37
|
secrets.add(bearer);
|
|
36
38
|
}
|
|
37
39
|
return [...secrets];
|
package/dist/vault/service.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CredentialCoverage, CredentialCoverageRequest, CredentialIdentity,
|
|
1
|
+
import type { CredentialCoverage, CredentialCoverageRequest, CredentialIdentity, EnvironmentSecretSlot, AgentSecretView, HostModelProviderInfo, HostModelView, PutAgentSecretRequest, PutHostModelRequest, CustomModelSettings, ModelInput, SelectHostModelRequest } from "@nylorun/core/contracts";
|
|
2
2
|
import type { AgentManifest, WorkflowManifest } from "@nylorun/core/define";
|
|
3
3
|
import type { SessionStore, Tx, VaultCredentialRow } from "../store/types.js";
|
|
4
4
|
export declare const HOST_VAULT_ID = "host";
|
|
@@ -101,16 +101,16 @@ export declare class VaultService {
|
|
|
101
101
|
dropped: string[];
|
|
102
102
|
}>;
|
|
103
103
|
/**
|
|
104
|
-
* `PUT /v1/
|
|
104
|
+
* `PUT /v1/agents/{id}/secrets/{name}`: creates or replaces one credential. The same
|
|
105
105
|
* name and type keeps the credential's id and re-seals its value and binding; another type
|
|
106
106
|
* replaces it. Refused (`409 credential_conflict`) when another credential of the vault is
|
|
107
107
|
* bound to one of its hosts or to its URL. Runs under the Environment row's lock, which also
|
|
108
108
|
* orders it with session opens and deletes, and counts as the Environment's use.
|
|
109
109
|
*/
|
|
110
|
-
putEnvironmentSecret(environmentId: string, name: string, body:
|
|
110
|
+
putEnvironmentSecret(environmentId: string, name: string, body: PutAgentSecretRequest, actor: string): Promise<AgentSecretView>;
|
|
111
111
|
/** The Environment's secrets: names, types and bindings, never values. */
|
|
112
|
-
listEnvironmentSecrets(environmentId: string): Promise<
|
|
113
|
-
getEnvironmentSecret(environmentId: string, name: string): Promise<
|
|
112
|
+
listEnvironmentSecrets(environmentId: string): Promise<AgentSecretView[]>;
|
|
113
|
+
getEnvironmentSecret(environmentId: string, name: string): Promise<AgentSecretView>;
|
|
114
114
|
deleteEnvironmentSecret(environmentId: string, name: string, actor: string): Promise<{
|
|
115
115
|
id: string;
|
|
116
116
|
}>;
|
|
@@ -154,9 +154,9 @@ export declare class VaultService {
|
|
|
154
154
|
url: string;
|
|
155
155
|
}): Promise<AuthorizeResult>;
|
|
156
156
|
/**
|
|
157
|
-
* What a session
|
|
158
|
-
* (`credentialNeeds`), decided as `authorize` decides a call:
|
|
159
|
-
*
|
|
157
|
+
* What a session on Agent `request.agentId` would send for each URL `manifest` (its manifest
|
|
158
|
+
* version's loop manifest) names (`credentialNeeds`), decided as `authorize` decides a call:
|
|
159
|
+
* the credential of the Agent's vault bound to the URL. Reads no secret, writes no audit row.
|
|
160
160
|
*/
|
|
161
161
|
coverage(manifest: AgentManifest | WorkflowManifest, request: CredentialCoverageRequest): Promise<CredentialCoverage>;
|
|
162
162
|
getHostModel(): Promise<HostModelView>;
|
|
@@ -204,4 +204,9 @@ type HostSecretPayload = {
|
|
|
204
204
|
};
|
|
205
205
|
export declare function modelBinding(row: VaultCredentialRow): ModelBinding;
|
|
206
206
|
export declare function hostModelAad(provider: string, model: string): Buffer;
|
|
207
|
+
/**
|
|
208
|
+
* Whether the credential in `row` fills secret slot `slot` (D64): of the slot's type, with its
|
|
209
|
+
* binding (the hosts and header of an `environment_secret`, the URL of a `bearer` or `headers`).
|
|
210
|
+
*/
|
|
211
|
+
export declare function slotHolds(slot: EnvironmentSecretSlot, row: Pick<VaultCredentialRow, "type" | "bindingJson">): boolean;
|
|
207
212
|
export {};
|
package/dist/vault/service.js
CHANGED
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
* sealEnvironmentSecretCopies(from, vaultId, slots | null): Promise<SealedSecretCopies>
|
|
19
19
|
* insertEnvironmentSecretCopies(t: Tx, vaultId, from, actor, sealed): Promise<{ copied; dropped }>
|
|
20
20
|
*
|
|
21
|
-
* // Its secrets (`/v1/
|
|
21
|
+
* // Its secrets (`/v1/agents/{id}/secrets`): each opens its own transaction and writes its
|
|
22
22
|
* // audit rows in it. A put needs the vault key, so callers reach it through `Keys`.
|
|
23
|
-
* putEnvironmentSecret(environmentId, name, body:
|
|
24
|
-
* listEnvironmentSecrets(environmentId): Promise<
|
|
25
|
-
* getEnvironmentSecret(environmentId, name): Promise<
|
|
23
|
+
* putEnvironmentSecret(environmentId, name, body: PutAgentSecretRequest, actor): Promise<AgentSecretView>
|
|
24
|
+
* listEnvironmentSecrets(environmentId): Promise<AgentSecretView[]>
|
|
25
|
+
* getEnvironmentSecret(environmentId, name): Promise<AgentSecretView>
|
|
26
26
|
* deleteEnvironmentSecret(environmentId, name, actor): Promise<{ id: string }>
|
|
27
27
|
*
|
|
28
28
|
* // The shell's variables of a session's sandbox, in the caller's transaction (R2c).
|
|
@@ -231,7 +231,7 @@ export class VaultService {
|
|
|
231
231
|
}
|
|
232
232
|
// --- an Environment's secrets ----------------------------------------------------
|
|
233
233
|
/**
|
|
234
|
-
* `PUT /v1/
|
|
234
|
+
* `PUT /v1/agents/{id}/secrets/{name}`: creates or replaces one credential. The same
|
|
235
235
|
* name and type keeps the credential's id and re-seals its value and binding; another type
|
|
236
236
|
* replaces it. Refused (`409 credential_conflict`) when another credential of the vault is
|
|
237
237
|
* bound to one of its hosts or to its URL. Runs under the Environment row's lock, which also
|
|
@@ -333,9 +333,12 @@ export class VaultService {
|
|
|
333
333
|
if (!vault)
|
|
334
334
|
return {};
|
|
335
335
|
const environment = {};
|
|
336
|
+
const live = await liveFilter(t, environmentId);
|
|
336
337
|
for (const row of await t.credentialsForVault(vault.id)) {
|
|
337
338
|
if (row.type !== "environment_secret" && row.type !== "environment_variable")
|
|
338
339
|
continue;
|
|
340
|
+
if (!live(row))
|
|
341
|
+
continue;
|
|
339
342
|
const binding = JSON.parse(row.bindingJson);
|
|
340
343
|
if (row.type === "environment_secret")
|
|
341
344
|
environment[binding.secretName] = ENVIRONMENT_SECRET_SENTINEL;
|
|
@@ -398,8 +401,10 @@ export class VaultService {
|
|
|
398
401
|
});
|
|
399
402
|
return { result: { status: "refused", url, credentialIds: [], reason: "vault_missing" } };
|
|
400
403
|
}
|
|
404
|
+
const live = await liveFilter(t, environmentId);
|
|
401
405
|
const matches = (await t.credentialsForVault(vault.id))
|
|
402
406
|
.filter(isUserCredential)
|
|
407
|
+
.filter(live)
|
|
403
408
|
.filter((row) => bindingUrl(row) === url)
|
|
404
409
|
.sort((a, b) => a.id.localeCompare(b.id));
|
|
405
410
|
if (matches.length === 0)
|
|
@@ -466,18 +471,19 @@ export class VaultService {
|
|
|
466
471
|
}
|
|
467
472
|
// --- coverage --------------------------------------------------------------------
|
|
468
473
|
/**
|
|
469
|
-
* What a session
|
|
470
|
-
* (`credentialNeeds`), decided as `authorize` decides a call:
|
|
471
|
-
*
|
|
474
|
+
* What a session on Agent `request.agentId` would send for each URL `manifest` (its manifest
|
|
475
|
+
* version's loop manifest) names (`credentialNeeds`), decided as `authorize` decides a call:
|
|
476
|
+
* the credential of the Agent's vault bound to the URL. Reads no secret, writes no audit row.
|
|
472
477
|
*/
|
|
473
478
|
async coverage(manifest, request) {
|
|
474
|
-
const environmentId = request.
|
|
479
|
+
const environmentId = request.agentId;
|
|
475
480
|
return this.store.tx(async (t) => {
|
|
476
481
|
const credentials = [];
|
|
477
|
-
|
|
482
|
+
{
|
|
478
483
|
const vault = await this.environmentVault(t, environmentId);
|
|
484
|
+
const live = await liveFilter(t, environmentId);
|
|
479
485
|
for (const row of await t.credentialsForVault(vault.id))
|
|
480
|
-
if (isUserCredential(row))
|
|
486
|
+
if (isUserCredential(row) && live(row))
|
|
481
487
|
credentials.push({ row, url: bindingUrl(row) });
|
|
482
488
|
}
|
|
483
489
|
const entries = credentialNeeds(manifest).map((need) => {
|
|
@@ -495,7 +501,6 @@ export class VaultService {
|
|
|
495
501
|
});
|
|
496
502
|
return {
|
|
497
503
|
agentId: request.agentId,
|
|
498
|
-
environmentId: environmentId ?? null,
|
|
499
504
|
complete: entries.every((entry) => entry.status === "covered"),
|
|
500
505
|
entries,
|
|
501
506
|
};
|
|
@@ -634,7 +639,7 @@ export class VaultService {
|
|
|
634
639
|
? await t.vaultOfEnvironment(environmentId)
|
|
635
640
|
: undefined;
|
|
636
641
|
if (!vault)
|
|
637
|
-
throw new VaultError(404, "
|
|
642
|
+
throw new VaultError(404, "Agent not found");
|
|
638
643
|
return vault;
|
|
639
644
|
}
|
|
640
645
|
async ensureHostVault(t) {
|
|
@@ -749,18 +754,18 @@ function bindingUrl(row) {
|
|
|
749
754
|
/** Where a credential is, for coverage: never its value. */
|
|
750
755
|
function coverageCredential(environmentId, row) {
|
|
751
756
|
const via = JSON.parse(row.bindingJson).via;
|
|
752
|
-
return { environmentId, name: row.name, ...(via === undefined ? {} : { via }) };
|
|
757
|
+
return { agentId: environmentId, name: row.name, ...(via === undefined ? {} : { via }) };
|
|
753
758
|
}
|
|
754
759
|
/** One coverage entry, with the sentence that says what the session would do. */
|
|
755
760
|
function coverageEntry(need, url, credential, environmentId, invalid) {
|
|
756
761
|
const required = need.kind === "http";
|
|
757
762
|
const where = environmentId === undefined
|
|
758
|
-
? "Without an
|
|
759
|
-
: `
|
|
763
|
+
? "Without an Agent, no credential is sent"
|
|
764
|
+
: `Agent ${environmentId} holds no credential for this URL`;
|
|
760
765
|
const message = invalid !== undefined
|
|
761
766
|
? `No credential can be bound to this URL (${invalid}).`
|
|
762
767
|
: credential !== undefined
|
|
763
|
-
? `Sends '${credential.name}' from
|
|
768
|
+
? `Sends '${credential.name}' from Agent ${credential.agentId}${credential.via ? ` through ${credential.via}` : ""}.`
|
|
764
769
|
: required
|
|
765
770
|
? `${where}: each call fails with http.credential.`
|
|
766
771
|
: `${where}: the server is called without one, which only a public server accepts.`;
|
|
@@ -1027,6 +1032,45 @@ async function environmentSecretsFor(t, environmentId, host) {
|
|
|
1027
1032
|
const vault = await t.vaultOfEnvironment(environmentId);
|
|
1028
1033
|
if (!vault)
|
|
1029
1034
|
return [];
|
|
1035
|
+
const live = await liveFilter(t, environmentId);
|
|
1030
1036
|
return (await t.credentialsForVault(vault.id)).filter((row) => row.type === "environment_secret" &&
|
|
1037
|
+
live(row) &&
|
|
1031
1038
|
(credentialBinding(row).allowedHosts ?? []).includes(lower));
|
|
1032
1039
|
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Whether the credential in `row` fills secret slot `slot` (D64): of the slot's type, with its
|
|
1042
|
+
* binding (the hosts and header of an `environment_secret`, the URL of a `bearer` or `headers`).
|
|
1043
|
+
*/
|
|
1044
|
+
export function slotHolds(slot, row) {
|
|
1045
|
+
if (row.type !== slot.type)
|
|
1046
|
+
return false;
|
|
1047
|
+
const binding = JSON.parse(row.bindingJson);
|
|
1048
|
+
if (slot.type === "environment_variable")
|
|
1049
|
+
return true;
|
|
1050
|
+
if (slot.type === "environment_secret") {
|
|
1051
|
+
const hosts = (list) => canonical([...(list ?? [])].map((host) => host.toLowerCase()).sort());
|
|
1052
|
+
const inject = slot.inject ? { header: slot.inject.header, format: slot.inject.format } : null;
|
|
1053
|
+
return hosts(slot.allowedHosts) === hosts(binding.allowedHosts) && canonical(inject) === canonical(binding.inject ?? null);
|
|
1054
|
+
}
|
|
1055
|
+
try {
|
|
1056
|
+
return normalizeVaultUrl(slot.url) === binding.url;
|
|
1057
|
+
}
|
|
1058
|
+
catch {
|
|
1059
|
+
return false;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Which of Agent `environmentId`'s credentials are live (track T3, D73): with secret slots in the
|
|
1064
|
+
* runtime it applies, only those that fill a slot of the name (`slotHolds`). Another stays in the
|
|
1065
|
+
* vault, dormant: a slot the version dropped, or one whose binding changed until it gets a value
|
|
1066
|
+
* again. Without slots, every one.
|
|
1067
|
+
*/
|
|
1068
|
+
async function liveFilter(t, environmentId) {
|
|
1069
|
+
const slots = (await t.environment(environmentId))?.applied.secrets;
|
|
1070
|
+
if (slots === undefined)
|
|
1071
|
+
return () => true;
|
|
1072
|
+
return (row) => {
|
|
1073
|
+
const slot = slots[row.name];
|
|
1074
|
+
return slot !== undefined && slotHolds(slot, row);
|
|
1075
|
+
};
|
|
1076
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RUNTIME_VERSION = "0.
|
|
1
|
+
export declare const RUNTIME_VERSION = "0.28.0-beta";
|
package/dist/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Kept in step with package.json by runtime/server/scripts/check-package.mjs, which runs in npm run check.
|
|
2
2
|
// release:prepare also rewrites this when it bumps @nylorun/runtime.
|
|
3
|
-
export const RUNTIME_VERSION = "0.
|
|
3
|
+
export const RUNTIME_VERSION = "0.28.0-beta";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0-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",
|
|
@@ -61,17 +61,18 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@ag-ui/core": "~1.0.2",
|
|
63
63
|
"@asteasolutions/zod-to-openapi": "^9.1.0",
|
|
64
|
-
"@earendil-works/pi-ai": "
|
|
65
|
-
"@hono/node-server": "^2.1.
|
|
64
|
+
"@earendil-works/pi-ai": "1.2.0",
|
|
65
|
+
"@hono/node-server": "^2.1.5",
|
|
66
66
|
"@hono/zod-openapi": "^1.6.3",
|
|
67
67
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
68
|
-
"@nylorun/core": "0.
|
|
69
|
-
"@nylorun/harness": "0.
|
|
70
|
-
"@restatedev/restate-sdk": "1.17.
|
|
71
|
-
"@restatedev/restate-sdk-clients": "1.17.
|
|
68
|
+
"@nylorun/core": "0.24.0-beta",
|
|
69
|
+
"@nylorun/harness": "0.29.0-beta",
|
|
70
|
+
"@restatedev/restate-sdk": "1.17.3",
|
|
71
|
+
"@restatedev/restate-sdk-clients": "1.17.3",
|
|
72
72
|
"@s2-dev/streamstore": "0.28.0",
|
|
73
73
|
"aws4fetch": "1.0.20",
|
|
74
|
-
"
|
|
74
|
+
"croner": "^9.1.0",
|
|
75
|
+
"drizzle-orm": "^0.45.4",
|
|
75
76
|
"hono": "^4.13.13",
|
|
76
77
|
"jose": "^6.2.12",
|
|
77
78
|
"just-bash": "3.6.0",
|
|
@@ -80,18 +81,18 @@
|
|
|
80
81
|
"postgres": "^3.4.9",
|
|
81
82
|
"ws": "^8.22.0",
|
|
82
83
|
"yaml": "^2.9.1",
|
|
83
|
-
"zod": "^4.6.
|
|
84
|
+
"zod": "^4.6.7"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
87
|
"@a2a-js/sdk": "~1.3.0",
|
|
87
88
|
"@ag-ui/client": "1.0.2",
|
|
88
|
-
"@scalar/openapi-parser": "^0.29.
|
|
89
|
-
"@types/node": "^26.6.
|
|
89
|
+
"@scalar/openapi-parser": "^0.29.13",
|
|
90
|
+
"@types/node": "^26.6.5",
|
|
90
91
|
"@types/pg": "^8.23.1",
|
|
91
92
|
"@types/ws": "^8.18.2",
|
|
92
93
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
93
94
|
"drizzle-kit": "^0.31.11",
|
|
94
95
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
95
|
-
"vitest": "^5.0.
|
|
96
|
+
"vitest": "^5.0.4"
|
|
96
97
|
}
|
|
97
98
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environment manifests (`/v1/environment-manifests/**`, protocol 14, D63): save, read, list and
|
|
3
|
-
* delete the named, versioned definitions Environments are made from. A save never changes an
|
|
4
|
-
* Environment. Reading needs what reading an Environment needs; saving and deleting need
|
|
5
|
-
* `environments:write`, from any client (Q12).
|
|
6
|
-
*/
|
|
7
|
-
import type { OpenAPIHono } from "@hono/zod-openapi";
|
|
8
|
-
import type { TenantEnv } from "../app.js";
|
|
9
|
-
export declare function environmentManifestRoutes(api: OpenAPIHono<TenantEnv>): void;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { isEnvironmentManifestName, PutEnvironmentManifestRequestSchema } from "@nylorun/core/contracts";
|
|
3
|
-
import { DeleteEnvironmentManifestResponse, EnvironmentManifestPlan, EnvironmentManifestVersions, EnvironmentManifestView, ListEnvironmentManifestsResponse, PutEnvironmentManifestRequest, SaveEnvironmentManifestResponse, } from "../../components.js";
|
|
4
|
-
import { fail } from "../../../tenant/http.js";
|
|
5
|
-
import { deleteEnvironmentManifest, environmentManifestVersions, getEnvironmentManifest, listEnvironmentManifests, saveEnvironmentManifest, } from "../../../tenant/environment-manifests.js";
|
|
6
|
-
import { readJson } from "../body.js";
|
|
7
|
-
import { tenantRoute } from "../define.js";
|
|
8
|
-
import { jsonResponse } from "../respond.js";
|
|
9
|
-
const READ = {
|
|
10
|
-
credentials: ["application", "subject", "token"],
|
|
11
|
-
scopes: ["sessions:own", "environments:write"],
|
|
12
|
-
};
|
|
13
|
-
const WRITE = {
|
|
14
|
-
credentials: ["application", "subject", "token"],
|
|
15
|
-
scopes: ["environments:write"],
|
|
16
|
-
};
|
|
17
|
-
const json = (schema, description) => ({
|
|
18
|
-
description,
|
|
19
|
-
content: { "application/json": { schema } },
|
|
20
|
-
});
|
|
21
|
-
const namePath = z.object({
|
|
22
|
-
name: z.string().meta({ description: "The environment manifest's name, such as `analyst-box`" }),
|
|
23
|
-
});
|
|
24
|
-
function nameOf(value) {
|
|
25
|
-
if (!isEnvironmentManifestName(value))
|
|
26
|
-
return fail(400, "An environment manifest's name is 1-64 letters, digits, '.', '_' and '-', starting with a letter or digit");
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
function versionOf(value) {
|
|
30
|
-
const version = Number(value);
|
|
31
|
-
if (!Number.isInteger(version) || version < 1)
|
|
32
|
-
return fail(400, "version is a positive integer");
|
|
33
|
-
return version;
|
|
34
|
-
}
|
|
35
|
-
/** `If-Match: <version>` (or `"<version>"`), when sent. */
|
|
36
|
-
function ifMatchOf(value) {
|
|
37
|
-
if (value === undefined || value.trim() === "")
|
|
38
|
-
return undefined;
|
|
39
|
-
const version = Number(value.trim().replace(/^W\//, "").replace(/^"|"$/g, ""));
|
|
40
|
-
if (!Number.isInteger(version) || version < 0)
|
|
41
|
-
return fail(400, "If-Match is the version you read: a whole number, 0 for none yet");
|
|
42
|
-
return version;
|
|
43
|
-
}
|
|
44
|
-
export function environmentManifestRoutes(api) {
|
|
45
|
-
tenantRoute(api, READ, {
|
|
46
|
-
method: "get",
|
|
47
|
-
path: "/v1/environment-manifests",
|
|
48
|
-
tags: ["Environment manifests"],
|
|
49
|
-
summary: "List environment manifests",
|
|
50
|
-
description: "Each manifest's latest version, by name, with how many Environments were made from it.",
|
|
51
|
-
responses: { 200: json(ListEnvironmentManifestsResponse, "The manifests") },
|
|
52
|
-
}, async (c) => jsonResponse(200, await listEnvironmentManifests(c.env.tenant)));
|
|
53
|
-
tenantRoute(api, WRITE, {
|
|
54
|
-
method: "put",
|
|
55
|
-
path: "/v1/environment-manifests/{name}",
|
|
56
|
-
tags: ["Environment manifests"],
|
|
57
|
-
summary: "Save an environment manifest",
|
|
58
|
-
description: "Saves the manifest as its next version, or answers the latest unchanged when nothing differs. No Environment changes: an Environment keeps the version it was made from, and a fork moves it to another (D63). `If-Match: <version>` refuses the save with `412 manifest_changed` when the latest version is no longer the one you read (`0` for a manifest that does not exist yet). With `?dryRun=true` the answer is the plan: the changes, every reason a save would be refused (`errors`), warnings, and how many Environments stay on older versions; nothing is saved. Clients drop a file's `$schema` before they send it.",
|
|
59
|
-
request: {
|
|
60
|
-
params: namePath,
|
|
61
|
-
query: z.object({
|
|
62
|
-
dryRun: z.enum(["true", "false"]).optional().meta({ description: "`true`: answer the plan and save nothing" }),
|
|
63
|
-
}),
|
|
64
|
-
body: { required: true, content: { "application/json": { schema: PutEnvironmentManifestRequest } } },
|
|
65
|
-
},
|
|
66
|
-
responses: {
|
|
67
|
-
200: json(z.union([SaveEnvironmentManifestResponse, EnvironmentManifestPlan]), "The version saved, or the plan with dryRun"),
|
|
68
|
-
400: { description: "The manifest breaks the Tenant's limits or names files the Runtime cannot use" },
|
|
69
|
-
412: { description: "If-Match named a version that is no longer the latest (`manifest_changed`)" },
|
|
70
|
-
},
|
|
71
|
-
}, async (c) => {
|
|
72
|
-
const name = nameOf(c.req.param("name"));
|
|
73
|
-
const body = PutEnvironmentManifestRequestSchema.parse(await readJson(c.req.raw));
|
|
74
|
-
const ifMatch = ifMatchOf(c.req.header("if-match"));
|
|
75
|
-
const options = ifMatch === undefined ? {} : { ifMatch };
|
|
76
|
-
return jsonResponse(200, c.req.query("dryRun") === "true"
|
|
77
|
-
? await saveEnvironmentManifest(c.env.tenant, name, body, c.get("scope"), { ...options, dryRun: true })
|
|
78
|
-
: await saveEnvironmentManifest(c.env.tenant, name, body, c.get("scope"), options));
|
|
79
|
-
});
|
|
80
|
-
tenantRoute(api, READ, {
|
|
81
|
-
method: "get",
|
|
82
|
-
path: "/v1/environment-manifests/{name}",
|
|
83
|
-
tags: ["Environment manifests"],
|
|
84
|
-
summary: "Get an environment manifest",
|
|
85
|
-
description: "Its latest version.",
|
|
86
|
-
request: { params: namePath },
|
|
87
|
-
responses: { 200: json(EnvironmentManifestView, "The latest version") },
|
|
88
|
-
}, async (c) => jsonResponse(200, await getEnvironmentManifest(c.env.tenant, nameOf(c.req.param("name")))));
|
|
89
|
-
tenantRoute(api, READ, {
|
|
90
|
-
method: "get",
|
|
91
|
-
path: "/v1/environment-manifests/{name}/versions",
|
|
92
|
-
tags: ["Environment manifests"],
|
|
93
|
-
summary: "List an environment manifest's versions",
|
|
94
|
-
description: "Every version, newest first, with who saved it and how many Environments were made from it.",
|
|
95
|
-
request: { params: namePath },
|
|
96
|
-
responses: { 200: json(EnvironmentManifestVersions, "The versions") },
|
|
97
|
-
}, async (c) => jsonResponse(200, await environmentManifestVersions(c.env.tenant, nameOf(c.req.param("name")))));
|
|
98
|
-
tenantRoute(api, READ, {
|
|
99
|
-
method: "get",
|
|
100
|
-
path: "/v1/environment-manifests/{name}/versions/{version}",
|
|
101
|
-
tags: ["Environment manifests"],
|
|
102
|
-
summary: "Get one version of an environment manifest",
|
|
103
|
-
request: { params: namePath.extend({ version: z.string().meta({ description: "The version number" }) }) },
|
|
104
|
-
responses: { 200: json(EnvironmentManifestView, "The version") },
|
|
105
|
-
}, async (c) => jsonResponse(200, await getEnvironmentManifest(c.env.tenant, nameOf(c.req.param("name")), versionOf(c.req.param("version")))));
|
|
106
|
-
tenantRoute(api, WRITE, {
|
|
107
|
-
method: "delete",
|
|
108
|
-
path: "/v1/environment-manifests/{name}",
|
|
109
|
-
tags: ["Environment manifests"],
|
|
110
|
-
summary: "Delete an environment manifest",
|
|
111
|
-
description: "Deletes every version. Refused while any Environment was made from one (`409 manifest_in_use`).",
|
|
112
|
-
request: { params: namePath },
|
|
113
|
-
responses: {
|
|
114
|
-
200: json(DeleteEnvironmentManifestResponse, "Deleted, or there was none"),
|
|
115
|
-
409: { description: "An Environment was made from one of its versions (`manifest_in_use`)" },
|
|
116
|
-
},
|
|
117
|
-
}, async (c) => jsonResponse(200, await deleteEnvironmentManifest(c.env.tenant, nameOf(c.req.param("name")))));
|
|
118
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environments (`/v1/environments/**`, protocol 11, D55, D56): create, find or change one by id,
|
|
3
|
-
* read it, list them by label, read its lifecycle stream, stop, reset and delete it, and write
|
|
4
|
-
* its vault's secrets. Ids may hold `/`, sent percent-encoded as one path segment
|
|
5
|
-
* (`users%2Falice%2Fweb`). A token caller reaches only the ids its Environment grants match,
|
|
6
|
-
* and changes them only with `environments:write`. Secret values are write-only: no route reads
|
|
7
|
-
* one back.
|
|
8
|
-
*/
|
|
9
|
-
import type { OpenAPIHono } from "@hono/zod-openapi";
|
|
10
|
-
import type { TenantEnv } from "../app.js";
|
|
11
|
-
export declare function environmentRoutes(api: OpenAPIHono<TenantEnv>): void;
|