@sema-agent/server 7.141.0 → 7.143.0
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/MIGRATION.md +657 -0
- package/USAGE.md +102 -30
- package/dist/adoption/plan.js +22 -0
- package/dist/approval-ask-audit-store.d.ts +61 -43
- package/dist/approval-ask-audit-store.js +69 -44
- package/dist/approval-ask-machine.d.ts +15 -7
- package/dist/approval-ask-machine.js +10 -4
- package/dist/approval-card.d.ts +126 -27
- package/dist/approval-card.js +103 -23
- package/dist/approval-crash-convergence.d.ts +17 -7
- package/dist/approval-crash-convergence.js +94 -22
- package/dist/approval-deny-reasons.d.ts +34 -30
- package/dist/approval-deny-reasons.js +21 -6
- package/dist/approval-policy-settlement.d.ts +1 -1
- package/dist/approval-queue-kind.d.ts +27 -0
- package/dist/approval-queue-kind.js +6 -0
- package/dist/approval-reconciler.d.ts +41 -9
- package/dist/approval-reconciler.js +45 -42
- package/dist/audit.js +4 -2
- package/dist/auth-bridge.d.ts +9 -6
- package/dist/auth-bridge.js +9 -3
- package/dist/boot/adoption.js +2 -1
- package/dist/boot/budget-tracing.d.ts +17 -1
- package/dist/boot/budget-tracing.js +10 -6
- package/dist/boot/device-lane.d.ts +1 -1
- package/dist/boot/execution-env.d.ts +24 -4
- package/dist/boot/execution-env.js +26 -23
- package/dist/boot/execution-lane.js +2 -1
- package/dist/boot/exit-boundary.js +5 -4
- package/dist/boot/governance-seams.d.ts +26 -41
- package/dist/boot/governance-seams.js +61 -28
- package/dist/boot/late-binds.d.ts +7 -4
- package/dist/boot/late-binds.js +3 -1
- package/dist/boot/leader.js +2 -4
- package/dist/boot/memory-consolidation.d.ts +0 -8
- package/dist/boot/memory-consolidation.js +5 -4
- package/dist/boot/parked-revive-gate.js +2 -1
- package/dist/boot/permission-rules-audit.d.ts +0 -28
- package/dist/boot/permission-rules-audit.js +2 -1
- package/dist/boot/read-deny-anchor-audit.js +2 -1
- package/dist/boot/reapers.js +9 -7
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +19 -10
- package/dist/boot/retention-lane.js +5 -3
- package/dist/boot/runner-deps.d.ts +10 -7
- package/dist/boot/runner-deps.js +20 -29
- package/dist/boot/runtime-caps.js +3 -2
- package/dist/boot/session-faces.js +4 -3
- package/dist/boot/shutdown.d.ts +9 -0
- package/dist/boot/shutdown.js +19 -4
- package/dist/boot/stage-02-web-admin-pull.js +3 -0
- package/dist/boot/stage-03-store-backend.d.ts +4 -1
- package/dist/boot/stage-03-store-backend.js +1 -2
- package/dist/boot/stage-04-stores.d.ts +5 -2
- package/dist/boot/stage-04-stores.js +6 -7
- package/dist/boot/stage-05-execution-env.d.ts +6 -3
- package/dist/boot/stage-05-execution-env.js +8 -6
- package/dist/boot/stage-06-runners.d.ts +6 -3
- package/dist/boot/stage-06-runners.js +3 -4
- package/dist/boot/stage-07-capability-layer.d.ts +6 -3
- package/dist/boot/stage-07-capability-layer.js +7 -2
- package/dist/boot/stage-08-reapers.d.ts +6 -3
- package/dist/boot/stage-08-reapers.js +3 -2
- package/dist/boot/stage-09-leader.d.ts +6 -3
- package/dist/boot/stage-10-http-server.d.ts +6 -3
- package/dist/boot/stage-10-http-server.js +14 -5
- package/dist/boot/stores.d.ts +5 -2
- package/dist/boot/stores.js +10 -9
- package/dist/boot/web-admin.d.ts +5 -1
- package/dist/boot/web-admin.js +48 -36
- package/dist/boot/webfetch-summarize-lane.js +2 -1
- package/dist/boot/workflow-orchestration.js +3 -2
- package/dist/capabilities/builtin-tools.d.ts +2 -1
- package/dist/capabilities/builtin-tools.js +2 -4
- package/dist/capabilities/composite-members.d.ts +2 -1
- package/dist/capabilities/composite-members.js +2 -1
- package/dist/capabilities/hands-lane.d.ts +9 -39
- package/dist/capabilities/hands-lane.js +8 -13
- package/dist/capabilities/mcp-probe.d.ts +3 -2
- package/dist/capabilities/scenarios.d.ts +11 -1
- package/dist/capabilities/scenarios.js +1 -0
- package/dist/capabilities/skills.d.ts +1 -17
- package/dist/capabilities/skills.js +0 -8
- package/dist/capability-facts.d.ts +31 -7
- package/dist/capability-facts.js +27 -4
- package/dist/card-void.d.ts +6 -9
- package/dist/config-catalog.js +2 -1
- package/dist/config-dir-trust.js +58 -29
- package/dist/config-invariants.d.ts +7 -1
- package/dist/config-invariants.js +7 -0
- package/dist/config-provider.d.ts +10 -0
- package/dist/config-provider.js +15 -4
- package/dist/config-root-migration.d.ts +13 -0
- package/dist/config-root-migration.js +99 -0
- package/dist/config-types.d.ts +19 -8
- package/dist/config.d.ts +10 -3
- package/dist/config.js +18 -4
- package/dist/delegated-session-owner.d.ts +5 -3
- package/dist/delegated-session-owner.js +1 -1
- package/dist/device-ws-protocol.d.ts +1 -0
- package/dist/device-ws-protocol.js +2 -1
- package/dist/env-model-table-gate.d.ts +53 -0
- package/dist/env-model-table-gate.js +53 -0
- package/dist/execution-lane-caps.d.ts +2 -1
- package/dist/fleet/fleet-bus.d.ts +34 -55
- package/dist/fleet/fleet-bus.js +35 -100
- package/dist/fleet/fleet-reconciler.d.ts +4 -4
- package/dist/fleet/fleet-reconciler.js +1 -1
- package/dist/fleet/subagent-tail-bus.d.ts +14 -11
- package/dist/fleet/subagent-tail-bus.js +15 -28
- package/dist/hooks/hook-runner.d.ts +6 -0
- package/dist/hooks/hook-runner.js +58 -8
- package/dist/host-decision.d.ts +54 -20
- package/dist/host-decision.js +42 -14
- package/dist/http/admission.d.ts +1 -1
- package/dist/http/admission.js +7 -3
- package/dist/http/approval-sweeps.js +11 -8
- package/dist/http/caller-trust.d.ts +1 -1
- package/dist/http/dispatch.js +4 -2
- package/dist/http/durable-run-leg.js +2 -2
- package/dist/http/engine-refusal.d.ts +16 -0
- package/dist/http/engine-refusal.js +17 -0
- package/dist/http/execution-context.d.ts +2 -2
- package/dist/http/idempotency.d.ts +1 -1
- package/dist/http/memory-compliance-failure-reply.d.ts +1 -3
- package/dist/http/memory-compliance-failure-reply.js +4 -6
- package/dist/http/owner-access.d.ts +11 -0
- package/dist/http/owner-access.js +13 -0
- package/dist/http/principal-gate.d.ts +3 -1
- package/dist/http/principal-gate.js +17 -8
- package/dist/http/resume-legs.d.ts +21 -7
- package/dist/http/resume-legs.js +76 -58
- package/dist/http/resume-restatement.d.ts +39 -0
- package/dist/http/resume-restatement.js +25 -0
- package/dist/http/route-ctx.d.ts +35 -10
- package/dist/http/route-ctx.js +1 -1
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/approvals-assistant.d.ts +9 -1
- package/dist/http/routes/approvals-assistant.js +142 -31
- package/dist/http/routes/attachments.js +18 -0
- package/dist/http/routes/capabilities.js +16 -4
- package/dist/http/routes/memory-policy.d.ts +2 -2
- package/dist/http/routes/memory-policy.js +27 -7
- package/dist/http/routes/notify-wake.js +23 -25
- package/dist/http/routes/rules.js +48 -13
- package/dist/http/routes/runs.js +12 -11
- package/dist/http/routes/session-memory-sync.d.ts +91 -0
- package/dist/http/routes/session-memory-sync.js +174 -0
- package/dist/http/routes/session-sync.js +13 -20
- package/dist/http/routes/sessions-list.d.ts +2 -1
- package/dist/http/routes/sessions.d.ts +2 -2
- package/dist/http/routes/sessions.js +22 -23
- package/dist/http/routes/tasks.js +34 -54
- package/dist/http/run-read-face.d.ts +7 -0
- package/dist/http/run-read-face.js +9 -3
- package/dist/http/send.d.ts +5 -0
- package/dist/http/send.js +9 -2
- package/dist/http/server.d.ts +27 -15
- package/dist/http/server.js +4 -6
- package/dist/http/stored-body-replay.js +15 -4
- package/dist/http/submit-replay.d.ts +4 -3
- package/dist/http/submit-replay.js +2 -2
- package/dist/http/sync-submit-body.d.ts +21 -4
- package/dist/http/sync-submit-body.js +13 -0
- package/dist/http/wire-types.d.ts +17 -7
- package/dist/identity-source.d.ts +21 -2
- package/dist/identity-source.js +6 -0
- package/dist/leader/leader.js +5 -2
- package/dist/leader/wire.d.ts +7 -1
- package/dist/leader/wire.js +6 -5
- package/dist/leg-facts.d.ts +37 -0
- package/dist/leg-facts.js +15 -0
- package/dist/memory-bundle-engine.d.ts +1 -4
- package/dist/memory-bundle-engine.js +2 -2
- package/dist/memory-incident-sink.d.ts +19 -6
- package/dist/memory-incident-sink.js +8 -4
- package/dist/memory-operator-faces.d.ts +30 -66
- package/dist/memory-operator-faces.js +17 -88
- package/dist/memory-scope-stores.d.ts +38 -40
- package/dist/memory-scope-stores.js +51 -36
- package/dist/memory-scope.d.ts +0 -9
- package/dist/memory-scope.js +0 -9
- package/dist/memory-sync-client.d.ts +21 -21
- package/dist/memory-sync-client.js +62 -43
- package/dist/memory-sync-identity.d.ts +24 -0
- package/dist/memory-sync-identity.js +57 -0
- package/dist/memory-sync.d.ts +27 -5
- package/dist/memory-sync.js +29 -7
- package/dist/model-plane-face.d.ts +13 -7
- package/dist/model-plane-face.js +2 -1
- package/dist/observability/fail-open.d.ts +47 -14
- package/dist/observability/fail-open.js +37 -11
- package/dist/observability/run-terminal.d.ts +92 -34
- package/dist/observability/run-terminal.js +171 -162
- package/dist/orchestration/workflow-completion-inbox.d.ts +5 -19
- package/dist/orchestration/workflow-completion-inbox.js +0 -12
- package/dist/orchestration/workflow-notify-journal.d.ts +3 -2
- package/dist/orchestration/workflow-park-decision.d.ts +8 -3
- package/dist/orchestration/workflow-park-decision.js +5 -3
- package/dist/org-delivery-gate.d.ts +11 -0
- package/dist/org-delivery-gate.js +19 -1
- package/dist/parked-decide.d.ts +13 -9
- package/dist/parked-decide.js +7 -7
- package/dist/parked-revive-surface.js +1 -1
- package/dist/peer-inbound-face.d.ts +127 -0
- package/dist/peer-inbound-face.js +158 -0
- package/dist/permission-rule-list.d.ts +13 -9
- package/dist/permission-rule-list.js +7 -3
- package/dist/plugins/approval-ask-store-file.d.ts +14 -4
- package/dist/plugins/approval-ask-store-file.js +64 -11
- package/dist/plugins/approval-ask-store-memory.d.ts +2 -1
- package/dist/plugins/approval-ask-store-memory.js +17 -14
- package/dist/plugins/approval-ask-store-sql.d.ts +70 -23
- package/dist/plugins/approval-ask-store-sql.js +79 -30
- package/dist/plugins/checkpoint-store-sql.d.ts +4 -4
- package/dist/plugins/checkpoint-store-sql.js +9 -7
- package/dist/plugins/file-history-store-sql.d.ts +24 -18
- package/dist/plugins/file-history-store-sql.js +24 -19
- package/dist/plugins/file-run-store.d.ts +35 -1
- package/dist/plugins/file-run-store.js +108 -9
- package/dist/plugins/imported-layer-root-retirement.d.ts +82 -0
- package/dist/plugins/imported-layer-root-retirement.js +96 -0
- package/dist/plugins/local-checkpoint-store.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.js +2 -2
- package/dist/plugins/local-session-store.d.ts +42 -9
- package/dist/plugins/local-session-store.js +83 -33
- package/dist/plugins/local-task-attachment-store.d.ts +12 -2
- package/dist/plugins/local-task-attachment-store.js +67 -43
- package/dist/plugins/mailbox-recipient-lifecycle.d.ts +9 -31
- package/dist/plugins/mailbox-recipient-lifecycle.js +4 -0
- package/dist/plugins/mailbox-store-sql.d.ts +12 -8
- package/dist/plugins/mailbox-store-sql.js +76 -7
- package/dist/plugins/memory-key-guards.d.ts +3 -3
- package/dist/plugins/memory-run-store.d.ts +6 -1
- package/dist/plugins/memory-run-store.js +11 -1
- package/dist/plugins/memory-sync-store-pg.d.ts +15 -0
- package/dist/plugins/memory-sync-store-pg.js +21 -0
- package/dist/plugins/memory-sync-store-tidb.d.ts +2 -0
- package/dist/plugins/memory-sync-store-tidb.js +13 -1
- package/dist/plugins/one-time-migrations.d.ts +58 -2
- package/dist/plugins/one-time-migrations.js +161 -4
- package/dist/plugins/org-delivery-quota-store.d.ts +1 -1
- package/dist/plugins/org-delivery-quota-store.js +2 -12
- package/dist/plugins/park-commit-watch.d.ts +1 -1
- package/dist/plugins/permission-rule-store-file.d.ts +10 -1
- package/dist/plugins/permission-rule-store-file.js +15 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +31 -1
- package/dist/plugins/permission-rule-store-sql.js +35 -2
- package/dist/plugins/remote-env-device.d.ts +8 -11
- package/dist/plugins/remote-env-device.js +6 -3
- package/dist/plugins/remote-env-e2b.d.ts +23 -4
- package/dist/plugins/remote-env-e2b.js +111 -28
- package/dist/plugins/remote-env-k8s.d.ts +61 -22
- package/dist/plugins/remote-env-k8s.js +133 -33
- package/dist/plugins/remote-env-local-docker.d.ts +15 -3
- package/dist/plugins/remote-env-local-docker.js +40 -12
- package/dist/plugins/retention-store-sql.d.ts +2 -2
- package/dist/plugins/run-store-sql.d.ts +9 -1
- package/dist/plugins/run-store-sql.js +9 -1
- package/dist/plugins/sandbox-read-floor.d.ts +5 -7
- package/dist/plugins/sandbox-read-floor.js +2 -7
- package/dist/plugins/sql-errors.d.ts +10 -1
- package/dist/plugins/sql-errors.js +13 -0
- package/dist/plugins/store-backend.d.ts +33 -35
- package/dist/plugins/store-backend.js +10 -1
- package/dist/plugins/store-contracts.d.ts +50 -1
- package/dist/plugins/store-contracts.js +6 -0
- package/dist/plugins/task-attachment-store.d.ts +112 -14
- package/dist/plugins/task-attachment-store.js +207 -29
- package/dist/plugins/tool-result-store-sql.d.ts +9 -8
- package/dist/plugins/tool-result-store-sql.js +23 -2
- package/dist/plugins/wiring-section-codec.d.ts +32 -0
- package/dist/plugins/wiring-section-codec.js +55 -0
- package/dist/plugins/workspace-fill.d.ts +60 -0
- package/dist/plugins/workspace-fill.js +106 -0
- package/dist/project-bundle.d.ts +38 -0
- package/dist/project-bundle.js +609 -0
- package/dist/rule-entry-list.d.ts +3 -2
- package/dist/rule-entry-list.js +5 -1
- package/dist/rules-consent.d.ts +28 -5
- package/dist/rules-consent.js +40 -28
- package/dist/run-local.js +11 -13
- package/dist/runs.d.ts +12 -8
- package/dist/runs.js +6 -8
- package/dist/runtime-governance.d.ts +1 -1
- package/dist/sandbox-egress-policy.d.ts +4 -1
- package/dist/sandbox-egress-policy.js +3 -1
- package/dist/sandbox-git-plane.d.ts +31 -12
- package/dist/sandbox-git-plane.js +24 -4
- package/dist/security.d.ts +9 -0
- package/dist/security.js +8 -0
- package/dist/server-secret-env.d.ts +4 -0
- package/dist/session-error-wire.d.ts +36 -0
- package/dist/session-error-wire.js +13 -0
- package/dist/session-incarnation.d.ts +1 -1
- package/dist/session-notify-door.d.ts +106 -0
- package/dist/session-notify-door.js +93 -0
- package/dist/session-sync.d.ts +9 -14
- package/dist/session-sync.js +5 -5
- package/dist/session-workspace.d.ts +3 -13
- package/dist/session-workspace.js +0 -9
- package/dist/standing-answer-grant.d.ts +5 -0
- package/dist/standing-answer-grant.js +10 -0
- package/dist/stores-sql/session-policy-store-sql.d.ts +4 -2
- package/dist/stores-sql/session-policy-store-sql.js +3 -13
- package/dist/task-mcp.d.ts +1 -1
- package/dist/task-settings.d.ts +21 -10
- package/dist/task-settings.js +46 -13
- package/dist/terminal.d.ts +39 -19
- package/dist/terminal.js +65 -22
- package/dist/tool-approval.d.ts +56 -37
- package/dist/tool-approval.js +78 -71
- package/dist/trace/core-keyset-guard.d.ts +134 -14
- package/dist/trace/engine-notice-wire.d.ts +9 -3
- package/dist/trace/engine-notice-wire.js +7 -3
- package/dist/trace/exit-seat.d.ts +9 -2
- package/dist/trace/exit-seat.js +1 -0
- package/dist/trace/ledger-sink.d.ts +10 -6
- package/dist/trace/ledger-sink.js +2 -2
- package/dist/trace/model-segment.d.ts +55 -25
- package/dist/trace/model-segment.js +101 -33
- package/dist/trace/project.d.ts +25 -5
- package/dist/trace/project.js +22 -0
- package/dist/trace/redact.d.ts +61 -9
- package/dist/trace/redact.js +1490 -468
- package/dist/trace/self-minted-wire.d.ts +745 -24
- package/dist/trace/self-minted-wire.js +239 -9
- package/dist/trace/wire-projection-faces.d.ts +2 -2
- package/dist/trace/wire-projection-faces.js +2 -2
- package/dist/verifier-pause-card.d.ts +33 -5
- package/dist/verifier-pause-card.js +15 -10
- package/dist/web-admin-client/apply-effective.d.ts +12 -16
- package/dist/web-admin-client/apply-effective.js +109 -9
- package/dist/web-admin-client/effective-keys.js +2 -0
- package/dist/web-admin-client/types.d.ts +4 -0
- package/dist/workspace-space.d.ts +19 -3
- package/dist/workspace-space.js +8 -4
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +3 -1
- package/package.json +3 -2
- package/wire-changes/server@7.142.0.json +639 -0
- package/wire-changes/server@7.143.0.json +1167 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expandTiers, modelOriginOf, resolveTaskModel as coreResolveTaskModel } from "@sema-agent/core";
|
|
2
|
-
import { CATALOG_REPLACES_ENV_MODELS_CODE, WEB_ADMIN_ENV, narrowAtMention, resolveActiveTiers, resolveCatalogDefaultModel } from "@sema-agent/settings-schema";
|
|
2
|
+
import { CATALOG_REPLACES_ENV_MODELS_CODE, SandboxGitConfig, WEB_ADMIN_ENV, envModelsDecisionTag, formatConfigPath, narrowAtMention, resolveActiveTiers, resolveCatalogDefaultModel, sanitizeZodError } from "@sema-agent/settings-schema";
|
|
3
3
|
import { modelKeyPoison } from "../key-resolver.js";
|
|
4
|
-
import { buildEnvModelIdNotServedNotice, mintCapabilityKeys, readAtMention, servedModelTableLeg } from "../model-select.js";
|
|
5
|
-
import { applyAutoCompactWindow, buildModelCostKey, ownCredentialHitsInForce, parseAutonomy, unmatchableToolNamesRefusal } from "../config.js";
|
|
4
|
+
import { DEFAULT_MODEL_REF, buildEnvModelIdNotServedNotice, mintCapabilityKeys, readAtMention, servedModelTableLeg } from "../model-select.js";
|
|
5
|
+
import { applyAutoCompactWindow, buildModelCostKey, isRosterGateArmed, ownCredentialHitsInForce, parseAutonomy, unmatchableToolNamesRefusal } from "../config.js";
|
|
6
6
|
import { NAME_TABLE_BEHAVIOR } from "../namespaced-rule-name.js";
|
|
7
7
|
import { buildModelCompat, readModelCompat } from "../model-compat.js";
|
|
8
8
|
import { buildModelHeadersKey } from "../model-entry-headers.js";
|
|
@@ -17,6 +17,7 @@ import { gateIntentUnserviceableReason } from "../approval.js";
|
|
|
17
17
|
import { refusedGroups } from "./apply-ledger.js";
|
|
18
18
|
import { judgeConfigCandidate } from "./candidate-gate.js";
|
|
19
19
|
import { declareServerWithheldEnv, withdrawServerWithheldEnv } from "../server-secret-env.js";
|
|
20
|
+
import { MODEL_ROUTE_ENV_KEYS } from "../model-route-gap.js";
|
|
20
21
|
const charsPerTokenOf = (v) => (typeof v === "number" && Number.isFinite(v) && v > 0 ? v : undefined);
|
|
21
22
|
function envDerivedModel(config) {
|
|
22
23
|
const m = config.envModel;
|
|
@@ -65,6 +66,35 @@ export function mutateInPlace(target, source) {
|
|
|
65
66
|
}
|
|
66
67
|
const appliedGeneration = new WeakMap();
|
|
67
68
|
const envModelPlane = new WeakMap();
|
|
69
|
+
function envModelTableOf(config) {
|
|
70
|
+
const table = envModelPlaneOf(config).models;
|
|
71
|
+
const mainId = envDerivedModel(config).id;
|
|
72
|
+
const out = [];
|
|
73
|
+
if (mainId !== "" && Object.hasOwn(table, mainId))
|
|
74
|
+
out.push({ id: mainId, slot: "main", env: MODEL_ROUTE_ENV_KEYS.mainId });
|
|
75
|
+
for (const key of Object.keys(table))
|
|
76
|
+
if (key !== DEFAULT_MODEL_REF && key !== mainId)
|
|
77
|
+
out.push({ id: key, slot: "cheap", env: MODEL_ROUTE_ENV_KEYS.cheapId });
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
const unreadableDecisionsSaid = new WeakMap();
|
|
81
|
+
function warnUnreadableEnvModelsDecision(config, source, logger) {
|
|
82
|
+
const decision = source.envModels;
|
|
83
|
+
if (decision.kind !== "unreadable" || logger === undefined)
|
|
84
|
+
return;
|
|
85
|
+
const said = unreadableDecisionsSaid.get(config) ?? new Set();
|
|
86
|
+
unreadableDecisionsSaid.set(config, said);
|
|
87
|
+
const tag = envModelsDecisionTag(decision);
|
|
88
|
+
if (said.has(tag))
|
|
89
|
+
return;
|
|
90
|
+
said.add(tag);
|
|
91
|
+
logger.warn("config_env_models_unreadable", {
|
|
92
|
+
dir: source.root,
|
|
93
|
+
reason: decision.reason,
|
|
94
|
+
...(decision.reason === "io" ? { errno: decision.errno } : { digest: decision.digest }),
|
|
95
|
+
note: "the config root's env-model-table decision does not read — it is never read as a confirmation, so a local catalog that manages the model plane does not replace the declared env model table; fix or rewrite the file (a supported writer overwrites it whole), said once per content",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
68
98
|
function envModelPlaneOf(config) {
|
|
69
99
|
let snap = envModelPlane.get(config);
|
|
70
100
|
if (snap === undefined) {
|
|
@@ -135,6 +165,7 @@ export function applyEffective(config, eff, logger, opts) {
|
|
|
135
165
|
}
|
|
136
166
|
}
|
|
137
167
|
const servedBefore = servedModelTableLeg(config);
|
|
168
|
+
const sandboxGitBefore = config.sandboxGit;
|
|
138
169
|
commitStaged(config, staged);
|
|
139
170
|
if (ordered)
|
|
140
171
|
appliedGeneration.set(config, gen);
|
|
@@ -163,12 +194,16 @@ export function applyEffective(config, eff, logger, opts) {
|
|
|
163
194
|
if (notServed !== undefined)
|
|
164
195
|
logger?.warn(notServed.event, notServed.fields);
|
|
165
196
|
}
|
|
197
|
+
if (mp !== undefined)
|
|
198
|
+
warnDanglingEnvBindings(config, staged.modelPlaneGroup.envBindingsDangling ?? [], logger);
|
|
166
199
|
if (staged.approvalGate.next !== undefined)
|
|
167
200
|
logger?.info("web_admin_runtime", { version: staged.version, approvalRequire: staged.approvalGate.next });
|
|
168
201
|
if (Object.keys(staged.hot.infoLine).length > 0)
|
|
169
202
|
logger?.info("web_admin_runtime_hot", staged.hot.infoLine);
|
|
170
203
|
if (Object.keys(staged.projects).length > 0)
|
|
171
204
|
logger?.info("web_admin_projects", { projects: Object.keys(staged.projects) });
|
|
205
|
+
if (JSON.stringify(sandboxGitBefore) !== JSON.stringify(staged.sandboxGit))
|
|
206
|
+
logger?.info("web_admin_sandbox_git", { version: staged.version, origins: staged.sandboxGit?.origins.map((e) => e.origin) ?? null });
|
|
172
207
|
return true;
|
|
173
208
|
}
|
|
174
209
|
function declareCandidateWithheldEnv(seats, modelApiKeyEnv, version) {
|
|
@@ -216,6 +251,10 @@ function commitStaged(config, staged) {
|
|
|
216
251
|
if (staged.hot.setCommandPolicy)
|
|
217
252
|
config.commandPolicy = staged.hot.commandPolicyNext;
|
|
218
253
|
mutateInPlace(config.projects, staged.projects);
|
|
254
|
+
if (staged.sandboxGit !== undefined)
|
|
255
|
+
config.sandboxGit = staged.sandboxGit;
|
|
256
|
+
else
|
|
257
|
+
delete config.sandboxGit;
|
|
219
258
|
}
|
|
220
259
|
export const MODEL_PLANE_DOMAINS = ["models"];
|
|
221
260
|
const MODEL_PLANE_SURFACES = {
|
|
@@ -247,8 +286,8 @@ export const PLANE_REFUSAL_INVARIANT_OF = {
|
|
|
247
286
|
"config.model_refused_name_minted": "refused-names-not-minted",
|
|
248
287
|
"config.model_route_endpoint_missing": "model-route-endpoint",
|
|
249
288
|
"config.gateway_fallback_without_primary": "model-route-endpoint",
|
|
289
|
+
[CATALOG_REPLACES_ENV_MODELS_CODE]: "env-table-replacement-acknowledged",
|
|
250
290
|
};
|
|
251
|
-
export const ENGINE_MINTED_PLANE_REFUSAL_CODES = [CATALOG_REPLACES_ENV_MODELS_CODE];
|
|
252
291
|
function modelPlaneGroupReport(group) {
|
|
253
292
|
return {
|
|
254
293
|
applied: MODEL_PLANE_DOMAINS.flatMap((d) => (group.stages[d] !== undefined ? MODEL_PLANE_SURFACES[d] : [])),
|
|
@@ -256,6 +295,46 @@ function modelPlaneGroupReport(group) {
|
|
|
256
295
|
};
|
|
257
296
|
}
|
|
258
297
|
const ROLE_BINDING_UNAVAILABLE_HINT = "alias/tier expansion cannot mint this name, so the engine does not hold it: a strict seat (default, classifier) refuses the task loud; any other role reads as unset and falls back along its own chain with a model.role_defaulted notice (refused only when nothing on that chain resolves) — bind the role to a usable model, or make the entry usable (see the entry's own warn)";
|
|
298
|
+
function danglingEnvBindingsOf(envRoles, centerRoles, envTable, served) {
|
|
299
|
+
const out = [];
|
|
300
|
+
for (const [role, spec] of Object.entries(envRoles)) {
|
|
301
|
+
if (Object.hasOwn(centerRoles, role))
|
|
302
|
+
continue;
|
|
303
|
+
const name = typeof spec === "string" ? spec : spec !== null && typeof spec === "object" && "model" in spec && typeof spec.model === "string" ? spec.model : undefined;
|
|
304
|
+
if (name === undefined || Object.hasOwn(served, name))
|
|
305
|
+
continue;
|
|
306
|
+
const entry = envTable.find((e) => e.id === name);
|
|
307
|
+
if (entry !== undefined)
|
|
308
|
+
out.push({ role, name, env: entry.env });
|
|
309
|
+
}
|
|
310
|
+
return out;
|
|
311
|
+
}
|
|
312
|
+
const ROLE_DEFAULTED_NOTICE = "model.role_defaulted";
|
|
313
|
+
const danglingEnvNamesSaid = new WeakMap();
|
|
314
|
+
function warnDanglingEnvBindings(config, dangling, logger) {
|
|
315
|
+
if (logger === undefined || dangling.length === 0)
|
|
316
|
+
return;
|
|
317
|
+
const said = danglingEnvNamesSaid.get(config) ?? new Set();
|
|
318
|
+
danglingEnvNamesSaid.set(config, said);
|
|
319
|
+
const byName = new Map();
|
|
320
|
+
for (const d of dangling) {
|
|
321
|
+
const row = byName.get(d.name) ?? { env: d.env, roles: [] };
|
|
322
|
+
row.roles.push(d.role);
|
|
323
|
+
byName.set(d.name, row);
|
|
324
|
+
}
|
|
325
|
+
for (const [name, row] of byName) {
|
|
326
|
+
if (said.has(name))
|
|
327
|
+
continue;
|
|
328
|
+
said.add(name);
|
|
329
|
+
logger.warn("config_env_role_binding_dangling", {
|
|
330
|
+
model: name,
|
|
331
|
+
env: row.env,
|
|
332
|
+
roles: row.roles,
|
|
333
|
+
engineNotice: ROLE_DEFAULTED_NOTICE,
|
|
334
|
+
note: `the env role base binds ${row.roles.join(", ")} to ${row.env} "${name}", but the adopted catalog serves no entry by that name (tier expansion included) — the engine reads ${row.roles.length > 1 ? "these roles" : "that role"} as unset and falls back along the role chain (each task says ${ROLE_DEFAULTED_NOTICE}); bind the role in the catalog's roles, or name a catalog entry "${name}" — said once per process`,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
259
338
|
export const NO_CENTER_EFFECTIVE = deepFreeze({ version: 0, updatedAt: "", models: { models: [], roles: {} }, mcp: { servers: [] } });
|
|
260
339
|
export const isNoCenterEffective = (eff) => eff === NO_CENTER_EFFECTIVE;
|
|
261
340
|
function deepFreeze(v) {
|
|
@@ -285,7 +364,7 @@ function stageEnvModelPlane(config) {
|
|
|
285
364
|
},
|
|
286
365
|
};
|
|
287
366
|
}
|
|
288
|
-
function stageModelPlane(config, eff, logger, sealedKeys) {
|
|
367
|
+
function stageModelPlane(config, eff, source, logger, sealedKeys) {
|
|
289
368
|
if (isNoCenterEffective(eff))
|
|
290
369
|
return stageEnvModelPlane(config);
|
|
291
370
|
const enabled = (eff.models?.models ?? []).filter((m) => m.enabled !== false);
|
|
@@ -306,6 +385,13 @@ function stageModelPlane(config, eff, logger, sealedKeys) {
|
|
|
306
385
|
});
|
|
307
386
|
return { stages: {}, rejected: { keys: MODEL_PLANE_GROUP_KEYS, reason, invariant, code }, refused: verdict.refused };
|
|
308
387
|
};
|
|
388
|
+
const envTable = envModelTableOf(config);
|
|
389
|
+
const envTableRefusal = crossInvariant("env-table-replacement-acknowledged").check({ live: config, next: config, candidate: { envTable, envTableIsPlaceholder: isRosterGateArmed(config.webAdmin), source } });
|
|
390
|
+
if (envTableRefusal !== undefined) {
|
|
391
|
+
if (source.kind === "local")
|
|
392
|
+
warnUnreadableEnvModelsDecision(config, source, logger);
|
|
393
|
+
return refuse(CATALOG_REPLACES_ENV_MODELS_CODE, envTableRefusal, { ...(source.kind === "local" ? { decision: source.envModels.kind } : {}), envModels: envTable.map((e) => ({ id: e.id, env: e.env })) });
|
|
394
|
+
}
|
|
309
395
|
if (verdict.malformed.length > 0)
|
|
310
396
|
return refuse(REFUSED_NAME_MINTED_CODE, malformedDroppedCarrierRefusal(verdict.malformed), { entries: [...verdict.malformed] });
|
|
311
397
|
const usable = verdict.usable;
|
|
@@ -422,6 +508,7 @@ function stageModelPlane(config, eff, logger, sealedKeys) {
|
|
|
422
508
|
}
|
|
423
509
|
const atMention = stageAtMention(eff.models?.atMention, new Set(usable.map((m) => m.name)), logger);
|
|
424
510
|
const defaultModel = models.default;
|
|
511
|
+
const envBindingsDangling = danglingEnvBindingsOf(envPlane.roles, centerRoles, envModelTableOf(config), expandTiers(models, activeTiers) ?? models);
|
|
425
512
|
const plane = {
|
|
426
513
|
models,
|
|
427
514
|
model: defaultModel,
|
|
@@ -435,7 +522,7 @@ function stageModelPlane(config, eff, logger, sealedKeys) {
|
|
|
435
522
|
atMention,
|
|
436
523
|
infoLine: { count: usable.length, ...(Object.keys(verdict.refused).length > 0 ? refusedNamesLogFields("unavailable", Object.keys(verdict.refused)) : {}), default: defaultModel.id, defaultSource: picked.source, roles: Object.keys(roles), tiers: Object.keys(activeTiers), atMention: atMention.mode, sealedKeys: Object.values(modelApiKeys).filter((v) => typeof v === "string").length, sealedPoisoned: Object.values(modelApiKeys).filter((v) => typeof v !== "string").length },
|
|
437
524
|
};
|
|
438
|
-
return { stages: { models: plane }, defaultName: picked.name, refused: verdict.refused };
|
|
525
|
+
return { stages: { models: plane }, defaultName: picked.name, refused: verdict.refused, ...(envBindingsDangling.length > 0 ? { envBindingsDangling } : {}) };
|
|
439
526
|
}
|
|
440
527
|
}
|
|
441
528
|
export function collabTemplatesNotExecuted(eff) {
|
|
@@ -449,7 +536,7 @@ function stageEffective(config, eff, logger, opts) {
|
|
|
449
536
|
note: "empty/unpublished effective config — using env + built-in fallback; publish a config or unset CONFIG_PUBLISH_MODE",
|
|
450
537
|
});
|
|
451
538
|
}
|
|
452
|
-
const modelPlaneGroup = stageModelPlane(config, eff, logger, opts.sealedKeys);
|
|
539
|
+
const modelPlaneGroup = stageModelPlane(config, eff, opts.catalogSource, logger, opts.sealedKeys);
|
|
453
540
|
const notExecuted = collabTemplatesNotExecuted(eff);
|
|
454
541
|
if (notExecuted.length > 0)
|
|
455
542
|
logger?.warn("web_admin_collab_not_executed", { version: eff.version, templates: notExecuted, note: COLLAB_NOT_EXECUTED_NOTE });
|
|
@@ -472,6 +559,7 @@ function stageEffective(config, eff, logger, opts) {
|
|
|
472
559
|
...(Array.isArray(r.defaultScopes) ? { defaultScopes: r.defaultScopes.filter((x) => typeof x === "string") } : {}),
|
|
473
560
|
};
|
|
474
561
|
}
|
|
562
|
+
const sandboxGit = stageSandboxGit(eff, logger);
|
|
475
563
|
return {
|
|
476
564
|
version: typeof eff.version === "number" && Number.isFinite(eff.version) ? eff.version : 0,
|
|
477
565
|
modelPlaneGroup,
|
|
@@ -479,8 +567,20 @@ function stageEffective(config, eff, logger, opts) {
|
|
|
479
567
|
limits,
|
|
480
568
|
hot,
|
|
481
569
|
projects,
|
|
570
|
+
sandboxGit,
|
|
482
571
|
};
|
|
483
572
|
}
|
|
573
|
+
const SANDBOX_GIT_REFUSED_EFFECT = "the block is read as routing no git origins (the live plane reading stays no_caller_credential — no_origins is the plane's last premise and is never reached while the caller credential is absent; no new sandbox pod carries the credential broker) — the rest of this candidate applies; fix the block at the console (it is judged by the contract's SandboxGitConfig)";
|
|
574
|
+
function stageSandboxGit(eff, logger) {
|
|
575
|
+
if (eff.sandboxGit === undefined)
|
|
576
|
+
return undefined;
|
|
577
|
+
const judged = SandboxGitConfig.safeParse(eff.sandboxGit);
|
|
578
|
+
if (judged.success)
|
|
579
|
+
return judged.data;
|
|
580
|
+
const issues = sanitizeZodError(judged.error).issues.map((i) => `${i.path.length === 0 ? "sandboxGit" : `sandboxGit.${formatConfigPath(i.path.map((seg) => (typeof seg === "number" ? seg : String(seg))))}`}: ${i.message}`);
|
|
581
|
+
logger?.warn("web_admin_sandbox_git_refused", { version: typeof eff.version === "number" ? eff.version : 0, issues, effect: SANDBOX_GIT_REFUSED_EFFECT });
|
|
582
|
+
return undefined;
|
|
583
|
+
}
|
|
484
584
|
export function centerManagedConfigKeys(eff) {
|
|
485
585
|
const out = new Set();
|
|
486
586
|
if (!eff)
|
|
@@ -649,9 +749,9 @@ function engineDefaultOfSelect(select, models, activeTiers) {
|
|
|
649
749
|
const name = Object.keys(models).find((n) => models[n] === origin);
|
|
650
750
|
return name !== undefined ? { name } : { unresolved: "the engine picked a model object that is not an entry of the usable catalog" };
|
|
651
751
|
}
|
|
652
|
-
export function logEffectiveDiff(config, eff, logger) {
|
|
752
|
+
export function logEffectiveDiff(config, eff, catalogSource, logger) {
|
|
653
753
|
const enabled = (eff.models?.models ?? []).filter((m) => m.enabled !== false);
|
|
654
|
-
const plane = stageModelPlane(config, eff, undefined, undefined);
|
|
754
|
+
const plane = stageModelPlane(config, eff, catalogSource, undefined, undefined);
|
|
655
755
|
const refused = plane.refused ?? {};
|
|
656
756
|
const centerModels = enabled.map((m) => ({ name: m.name, id: m.id, provider: m.provider, apiKeyEnv: m.apiKeyEnv ?? null, tier: m.tier ?? null }));
|
|
657
757
|
const envModels = Object.entries(config.models).map(([name, m]) => ({ name, id: m.id, provider: m.provider }));
|
|
@@ -13,6 +13,7 @@ const EFFECTIVE_CONFIG_KEY_TABLE = {
|
|
|
13
13
|
plugins: true,
|
|
14
14
|
readFace: true,
|
|
15
15
|
prompts: true,
|
|
16
|
+
sandboxGit: true,
|
|
16
17
|
};
|
|
17
18
|
export const EFFECTIVE_CONFIG_KEYS = Object.keys(EFFECTIVE_CONFIG_KEY_TABLE);
|
|
18
19
|
export const EFFECTIVE_ENVELOPE_KEYS = ["version", "updatedAt"];
|
|
@@ -25,6 +26,7 @@ export const GOVERNANCE_DOMAIN_KEYS = Object.keys(GOVERNANCE_DOMAIN_KEY_TABLE);
|
|
|
25
26
|
export const NON_DOMAIN_EFFECTIVE_KEYS = {
|
|
26
27
|
a2a: "R-15 裁开域([4384]),但 settings-schema 至 1.3.0 未开(DOMAINS 无 a2a)——S-31 件2 BLOCKED on schema:远端腿靠 readEffectiveWire 的 open-world verbatim 透传(DESIGN-269),本地腿不可达(FileConfigStore 只读 PORTABLE_DOMAINS)。schema 开域之日按墓碑流程收线。",
|
|
27
28
|
readFace: "R-15 裁**暂不开域**([4384]:env 逐键恒赢语义下收益薄,⚪ 呈现制过渡)——#A4 的远端腿同靠 open-world 透传;本地腿四键由 env / 引擎默认独占。若来日改裁开域,同上墓碑机制。",
|
|
29
|
+
sandboxGit: "契约的 wire-only 键(settings-schema 14.7.0 `EffectiveWire.sandboxGit`):web-admin 按部署登记册投影,不是存储域 —— `buildEffective` 从不产它、`readEffectiveWire` 逐字承运;判它的唯一座位 `SandboxGitConfig` 在 stageEffective 调一次。本地腿不可达(`config.d` 只读便携域)⇒ 本地配置源恒缺席(沙箱 git 平面读 `no_origins`)。",
|
|
28
30
|
};
|
|
29
31
|
export const DOMAINS_NOT_CONSUMED_BY_SERVER = {
|
|
30
32
|
rosters: "center 写面域:center 端 resolveEffectiveForWorker 把 roster 解析进 per-worker /effective 的 models 视图——server 消费的是解析产物,不读原始域。",
|
|
@@ -392,6 +392,10 @@ export interface EffectiveConfig {
|
|
|
392
392
|
/** prompts 域(中心层;wire 形只有一种 = 契约包 `EffectivePromptsWire` `{ schemaVersion: 2, artifact }`)—— 判法只在候选判官一处
|
|
393
393
|
* (`prompts-domain-validate.ts` 的 `judgePromptsWire`,经 `judgeConfigCandidate`),本 interface 只声明键位存在(unknown:判官是唯一解释者,这里不复刻形)。 */
|
|
394
394
|
prompts?: unknown;
|
|
395
|
+
/** 沙箱 git 平面的有效配置块(契约 `EffectiveWire.sandboxGit`:wire-only 的非域顶层键,web-admin 按部署登记册投影,读腿逐字承运、不判)——
|
|
396
|
+
* 可选、无默认:缺席 = 这个部署没有投影这一块。本 interface 只声明键位(unknown:与 `prompts` 同形);判它的唯一座位是契约 `SandboxGitConfig`,
|
|
397
|
+
* 在 `stageEffective` 里调一次(判过 ⇒ `config.sandboxGit`;判不过 ⇒ 当作没有任何 origin + 一行 `web_admin_sandbox_git_refused`,契约 §12.8)。 */
|
|
398
|
+
sandboxGit?: unknown;
|
|
395
399
|
}
|
|
396
400
|
/** (stage7 P5,registry-core 0.8 `execution` 域): the center-resolved per-principal execution
|
|
397
401
|
* ruling riding the caps view. `required=false` / ruling absent = no enforcement (legacy). `allowedLanes` is
|
|
@@ -105,10 +105,26 @@ export declare const WORKSPACE_SNAPSHOT_EXCLUDE_INVALID = "config.workspace_snap
|
|
|
105
105
|
* path pattern, never a secret, so it is echoed.
|
|
106
106
|
*/
|
|
107
107
|
export declare function parseWorkspaceSnapshotExclude(raw: string | undefined): readonly string[];
|
|
108
|
-
/**
|
|
109
|
-
|
|
108
|
+
/**
|
|
109
|
+
* What one snapshot id names — a closed set, spelled by the id's first segment (its family), written only by {@link mintSnapshotId} and read
|
|
110
|
+
* only by {@link snapshotIdHolds}:
|
|
111
|
+
* - `archive` — an archive was packed and put under this id (`kata-…`): a restore of it asks the store for that object, and an object that is
|
|
112
|
+
* not there is a dangling restore point. Every id minted before the family said more than this is one;
|
|
113
|
+
* - `nothing` — nothing was packed: the env held no pod when it parked (nothing had touched its hand), so no object is ever put under this id
|
|
114
|
+
* (`nopack-…`): there is no workspace of the park to restore, and a resume of it is a new connect (`plugins/remote-env-k8s.ts`, `resumeVM`).
|
|
115
|
+
* The id never reaches the wire: it lives in the engine's checkpoint and in operator lines.
|
|
116
|
+
*/
|
|
117
|
+
export type SnapshotHolds = "archive" | "nothing";
|
|
118
|
+
/** Mint one snapshot id: `<family>-<owner>-<ts36>-<rand>` — the family says what the id names ({@link SnapshotHolds}), the owner who wrote it
|
|
119
|
+
* (see {@link SNAPSHOT_OWNER_NONE}). The time and random parts only keep ids unique; nothing reads them back. */
|
|
120
|
+
export declare function mintSnapshotId(incarnation: string | undefined, holds: SnapshotHolds): string;
|
|
121
|
+
/** What a snapshot id names ({@link SnapshotHolds}) — the ONE reading of the family {@link mintSnapshotId} wrote. Only an id of exactly the minted
|
|
122
|
+
* `nothing` form reads as `nothing`; every other id — this adapter's archives, ids minted before the family said what they name, anything else (a
|
|
123
|
+
* malformed `nopack-…` included) — names an archive, so its restore goes through the one key-segment judge (an id that is not a plain key segment
|
|
124
|
+
* is refused before any pod or request) and then asks the store and judges what comes back. */
|
|
125
|
+
export declare function snapshotIdHolds(id: string): SnapshotHolds;
|
|
110
126
|
/** Whether an object name in the park partition (`<snapshotId>.tar.gz`, or any single-segment name) carries the mark of THIS occupant incarnation.
|
|
111
|
-
* An empty incarnation owns nothing; `none` and unmarked names are never owned (fail closed). */
|
|
127
|
+
* An empty incarnation owns nothing; `none` and unmarked names are never owned (fail closed). Only an archive's id names an object. */
|
|
112
128
|
export declare function snapshotNameOwnedBy(name: string, incarnation: string): boolean;
|
|
113
129
|
/** One ended space, as the reclaim seat is told of it: the session whose space ended (its park lane's partition) and the space key
|
|
114
130
|
* (the occupant's incarnation — the `space/` partition, the cache volume's label and, through {@link snapshotNameOwnedBy}, the owner mark of
|
package/dist/workspace-space.js
CHANGED
|
@@ -67,18 +67,22 @@ function snapshotExcludeItemProblem(item) {
|
|
|
67
67
|
}
|
|
68
68
|
const SNAPSHOT_OWNER_NONE = "none";
|
|
69
69
|
const SNAPSHOT_OWNER_HEX_LENGTH = 16;
|
|
70
|
-
const SNAPSHOT_ID_FAMILY = "kata";
|
|
70
|
+
const SNAPSHOT_ID_FAMILY = { archive: "kata", nothing: "nopack" };
|
|
71
71
|
function snapshotOwnerOf(incarnation) {
|
|
72
72
|
if (incarnation === undefined || incarnation === "")
|
|
73
73
|
return SNAPSHOT_OWNER_NONE;
|
|
74
74
|
return createHash("sha256").update(incarnation).digest("hex").slice(0, SNAPSHOT_OWNER_HEX_LENGTH);
|
|
75
75
|
}
|
|
76
|
-
export function mintSnapshotId(incarnation) {
|
|
77
|
-
return `${SNAPSHOT_ID_FAMILY}-${snapshotOwnerOf(incarnation)}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
76
|
+
export function mintSnapshotId(incarnation, holds) {
|
|
77
|
+
return `${SNAPSHOT_ID_FAMILY[holds]}-${snapshotOwnerOf(incarnation)}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
78
|
+
}
|
|
79
|
+
const NOTHING_ID_FORM = new RegExp(`^${SNAPSHOT_ID_FAMILY.nothing}-(?:${SNAPSHOT_OWNER_NONE}|[0-9a-f]{${SNAPSHOT_OWNER_HEX_LENGTH}})-[0-9a-z]+-[0-9a-z]*$`);
|
|
80
|
+
export function snapshotIdHolds(id) {
|
|
81
|
+
return NOTHING_ID_FORM.test(id) ? "nothing" : "archive";
|
|
78
82
|
}
|
|
79
83
|
export function snapshotNameOwnedBy(name, incarnation) {
|
|
80
84
|
if (incarnation === "")
|
|
81
85
|
return false;
|
|
82
|
-
return name.startsWith(`${SNAPSHOT_ID_FAMILY}-${snapshotOwnerOf(incarnation)}-`);
|
|
86
|
+
return name.startsWith(`${SNAPSHOT_ID_FAMILY.archive}-${snapshotOwnerOf(incarnation)}-`);
|
|
83
87
|
}
|
|
84
88
|
//# sourceMappingURL=workspace-space.js.map
|
|
@@ -341,7 +341,7 @@ base64 inside JSON fields.
|
|
|
341
341
|
| Constant | Value | Meaning |
|
|
342
342
|
|---|---|---|
|
|
343
343
|
| `DEVICE_WS_PATH` | `/v1/device/ws` | the upgrade path (prefer the `wsPath` from `/v1/capabilities`) |
|
|
344
|
-
| `DEVICE_PROTOCOL_VERSION` | `
|
|
344
|
+
| `DEVICE_PROTOCOL_VERSION` | `4` | the protocol revision this server speaks (the highest it accepts) |
|
|
345
345
|
| `DEVICE_MIN_PROTOCOL_VERSION` | `1` | the lowest revision it accepts; below it (or above the highest), a loud `helloReject` — never a silent downgrade |
|
|
346
346
|
| `DEVICE_HELLO_DOMAIN_TAG` | `sema.device.hello.v1` | the handshake signature domain tag (§1.3) |
|
|
347
347
|
|
|
@@ -371,6 +371,7 @@ the union of the rows up to *N*, and the full set at the current revision is the
|
|
|
371
371
|
| `1` | `aborted`, `already_exists`, `auth_failed`, `callback_error`, `invalid`, `is_directory`, `not_directory`, `not_found`, `not_supported`, `outcome_unknown`, `permission_denied`, `precondition_failed`, `shell_unavailable`, `spawn_error`, `suspended`, `target_unavailable`, `timeout`, `transport_lost`, `unknown` |
|
|
372
372
|
| `2` | `liveness_no_output` |
|
|
373
373
|
| `3` | `name_too_long` |
|
|
374
|
+
| `4` | `symlink_loop` |
|
|
374
375
|
|
|
375
376
|
Rules: adding a frame or a field is additive and does not raise the revision; adding a word to a closed set the
|
|
376
377
|
server *accepts from you* (today: the `errorCode` set) raises `DEVICE_PROTOCOL_VERSION` and adds a row here; a
|
|
@@ -590,6 +591,7 @@ with, and an executor sends only the words of the revision it declared (§1.2).
|
|
|
590
591
|
| `shell_unavailable` | no shell / the executable could not be resolved — the command **never started** |
|
|
591
592
|
| `spawn_error` | the process could not be spawned |
|
|
592
593
|
| `suspended` | the work was suspended rather than completed |
|
|
594
|
+
| `symlink_loop` | the path runs into a looping chain of symbolic links (a link to itself, a cycle of links, or a chain past the platform's follow limit; POSIX `ELOOP`). It is not an absence: upstream a directory probe reads it as "this path leads to no directory", and a check of where a path lands reads it as unresolved, like `unknown`. A device that cannot tell a loop apart keeps answering `unknown`. On an exec instruction it is a protocol violation and the server reads it as `unknown` |
|
|
593
595
|
| `target_unavailable` | the target could not be reached; the work **never started** |
|
|
594
596
|
| `timeout` | **you** enforced `timeoutMs`, killed the work, and are reporting it |
|
|
595
597
|
| `transport_lost` | a transport the device itself depends on went away |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.143.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
"build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@
|
|
72
|
+
"@modelcontextprotocol/server": "2.4.0",
|
|
73
|
+
"@sema-agent/core": "7.61.0",
|
|
73
74
|
"@sema-agent/settings-schema": "16.0.0",
|
|
74
75
|
"e2b": "^2.28.0",
|
|
75
76
|
"libsodium-wrappers": "^0.8.4",
|