@sema-agent/server 7.148.0 → 7.150.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 +551 -9
- package/README.md +17 -2
- package/README.zh-CN.md +5 -1
- package/USAGE.md +126 -68
- package/dist/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +33 -33
- package/dist/approval-gate-currency.d.ts +1 -1
- package/dist/approval-leg-origin.d.ts +33 -0
- package/dist/approval-leg-origin.js +4 -0
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +2 -2
- package/dist/auth-bridge.d.ts +9 -1
- package/dist/auth-bridge.js +4 -4
- package/dist/auth-keys.d.ts +10 -1
- package/dist/auth-keys.js +8 -0
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/boot/deferred-sandbox-path-env.d.ts +5 -3
- package/dist/boot/deferred-sandbox-path-env.js +1 -2
- package/dist/boot/execution-env.js +10 -11
- package/dist/boot/execution-lane.d.ts +6 -4
- package/dist/boot/execution-lane.js +3 -1
- package/dist/boot/org-delivery.d.ts +3 -2
- package/dist/boot/parked-revive-gate.d.ts +5 -5
- package/dist/boot/parked-revive-gate.js +2 -3
- package/dist/boot/resolve-spec.d.ts +4 -5
- package/dist/boot/resolve-spec.js +66 -28
- package/dist/boot/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.js +3 -1
- package/dist/boot/session-faces.js +21 -21
- package/dist/boot/stage-01-config.d.ts +1 -0
- package/dist/boot/stage-01-config.js +4 -3
- package/dist/boot/stage-02-web-admin-pull.d.ts +1 -0
- package/dist/boot/stage-02-web-admin-pull.js +10 -2
- package/dist/boot/stage-03-store-backend.d.ts +1 -0
- package/dist/boot/stage-03-store-backend.js +4 -4
- package/dist/boot/stage-04-stores.d.ts +1 -0
- package/dist/boot/stage-05-execution-env.d.ts +1 -0
- package/dist/boot/stage-06-runners.d.ts +2 -1
- package/dist/boot/stage-06-runners.js +1 -2
- package/dist/boot/stage-07-capability-layer.d.ts +2 -1
- package/dist/boot/stage-07-capability-layer.js +1 -1
- package/dist/boot/stage-08-reapers.d.ts +2 -1
- package/dist/boot/stage-09-leader.d.ts +2 -1
- package/dist/boot/stage-10-http-server.d.ts +35 -2
- package/dist/boot/stage-10-http-server.js +9 -4
- package/dist/boot/stores.d.ts +3 -0
- package/dist/boot/stores.js +22 -19
- package/dist/boot/web-admin.d.ts +1 -1
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +70 -60
- package/dist/capability-facts.js +45 -49
- package/dist/card-settle-stored-scope.d.ts +56 -0
- package/dist/card-settle-stored-scope.js +27 -0
- package/dist/card-void.d.ts +7 -12
- package/dist/card-void.js +2 -7
- package/dist/config-catalog.d.ts +12 -0
- package/dist/config-catalog.js +37 -33
- package/dist/config-invariants.d.ts +5 -4
- package/dist/config-invariants.js +4 -4
- package/dist/config-types.d.ts +49 -16
- package/dist/config.d.ts +6 -5
- package/dist/config.js +35 -24
- package/dist/context-window-notice.d.ts +31 -0
- package/dist/context-window-notice.js +28 -0
- package/dist/deployment-governance.d.ts +7 -28
- package/dist/deployment-governance.js +1 -14
- package/dist/deployment-shape.d.ts +20 -11
- package/dist/deployment-shape.js +1 -0
- package/dist/device-ws-hub.d.ts +1 -0
- package/dist/device-ws-hub.js +64 -28
- package/dist/device-ws-protocol.d.ts +20 -6
- package/dist/device-ws-protocol.js +9 -2
- package/dist/engine-identity.d.ts +7 -1
- package/dist/engine-identity.js +5 -0
- package/dist/env-name-allowlist-knobs.d.ts +6 -5
- package/dist/env-name-allowlist-knobs.js +5 -0
- package/dist/execution-lane-caps.d.ts +20 -5
- package/dist/execution-lane-caps.js +18 -4
- package/dist/field-conflict.d.ts +2 -2
- package/dist/fleet/engine-signal.d.ts +14 -1
- package/dist/fleet/engine-signal.js +5 -1
- package/dist/fleet/fleet-reconciler.d.ts +1 -1
- package/dist/fleet/serving-lease.d.ts +18 -3
- package/dist/fleet/serving-lease.js +81 -35
- package/dist/fleet-client.d.ts +13 -11
- package/dist/fleet-client.js +53 -33
- package/dist/history-anchor.js +1 -1
- package/dist/hitl-delivery.d.ts +1 -3
- package/dist/hitl-delivery.js +1 -1
- package/dist/hooks/command-spawn.d.ts +7 -2
- package/dist/hooks/command-spawn.js +13 -6
- package/dist/hooks/hook-runner.d.ts +5 -0
- package/dist/hooks/hook-runner.js +11 -7
- package/dist/http/active-run-conflict.d.ts +3 -7
- package/dist/http/active-run-conflict.js +2 -2
- package/dist/http/admission.js +5 -5
- package/dist/http/approval-sweeps.js +5 -3
- package/dist/http/caller-trust.d.ts +2 -2
- package/dist/http/caller-trust.js +3 -3
- package/dist/http/checkpoint-ctx.d.ts +18 -63
- package/dist/http/checkpoint-ctx.js +1 -24
- package/dist/http/claim-heartbeat.d.ts +6 -6
- package/dist/http/claim-heartbeat.js +6 -6
- package/dist/http/claimed-run.d.ts +16 -9
- package/dist/http/claimed-run.js +8 -0
- package/dist/http/dispatch.js +7 -5
- package/dist/http/durable-run-leg.d.ts +8 -1
- package/dist/http/durable-run-leg.js +34 -15
- package/dist/http/execution-context.d.ts +115 -14
- package/dist/http/execution-context.js +130 -40
- package/dist/http/owner-access.d.ts +246 -21
- package/dist/http/owner-access.js +186 -8
- package/dist/http/principal-gate.d.ts +18 -11
- package/dist/http/principal-gate.js +3 -1
- package/dist/http/readiness.d.ts +4 -2
- package/dist/http/resume-ctx-read.d.ts +14 -3
- package/dist/http/resume-ctx-read.js +24 -3
- package/dist/http/resume-legs.d.ts +35 -3
- package/dist/http/resume-legs.js +262 -106
- package/dist/http/route-ctx.d.ts +29 -11
- package/dist/http/routes/a2a-serve.js +17 -14
- package/dist/http/routes/approvals-assistant.d.ts +3 -2
- package/dist/http/routes/approvals-assistant.js +11 -11
- package/dist/http/routes/capabilities.js +5 -4
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -1
- package/dist/http/routes/diagnostics.js +30 -5
- package/dist/http/routes/mcp-reconnect.js +2 -2
- package/dist/http/routes/memory-origin.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -3
- package/dist/http/routes/principal-inbox.d.ts +3 -1
- package/dist/http/routes/principal-inbox.js +3 -2
- package/dist/http/routes/projects.d.ts +1 -0
- package/dist/http/routes/projects.js +5 -3
- package/dist/http/routes/retention-ops.d.ts +1 -1
- package/dist/http/routes/run-permission-mode.d.ts +1 -1
- package/dist/http/routes/run-permission-mode.js +2 -2
- package/dist/http/routes/runs.d.ts +1 -1
- package/dist/http/routes/runs.js +33 -37
- package/dist/http/routes/session-memory-sync.js +4 -5
- package/dist/http/routes/session-sync.d.ts +24 -5
- package/dist/http/routes/session-sync.js +45 -37
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions.d.ts +1 -1
- package/dist/http/routes/sessions.js +18 -44
- package/dist/http/routes/tasks.js +136 -101
- package/dist/http/routes/trace-usage.js +14 -14
- package/dist/http/routes/workflows.d.ts +1 -0
- package/dist/http/routes/workflows.js +20 -38
- package/dist/http/server.d.ts +12 -9
- package/dist/http/server.js +35 -6
- package/dist/http/stored-body-replay.d.ts +3 -24
- package/dist/http/stored-body-replay.js +2 -12
- package/dist/http/submit-ctx.d.ts +2 -2
- package/dist/http/submit-ctx.js +5 -5
- package/dist/http/submit-replay.d.ts +15 -2
- package/dist/http/submit-replay.js +10 -4
- package/dist/http/wire-types.d.ts +6 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/leader/endpoint.js +9 -8
- package/dist/leg-facts.d.ts +13 -2
- package/dist/leg-facts.js +2 -0
- package/dist/local-store-declaration.d.ts +54 -0
- package/dist/local-store-declaration.js +59 -0
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/mcp-assertion-header.js +1 -1
- package/dist/mcp-authorization-face.d.ts +18 -14
- package/dist/mcp-authorization-face.js +3 -2
- package/dist/memory-project-layer.js +1 -1
- package/dist/memory-scope.d.ts +4 -4
- package/dist/memory-scope.js +4 -4
- package/dist/memory-store-refusal.d.ts +1 -1
- package/dist/memory-sync-client.js +2 -2
- package/dist/model-context-window.d.ts +50 -11
- package/dist/model-context-window.js +20 -1
- package/dist/model-entry-refusal.d.ts +5 -4
- package/dist/model-entry-refusal.js +17 -3
- package/dist/model-reach-scope.d.ts +2 -1
- package/dist/observability/corrupt-read-seat.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +19 -7
- package/dist/observability/fail-open.js +19 -7
- package/dist/observability/logger.d.ts +7 -0
- package/dist/observability/logger.js +3 -1
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/run-terminal.d.ts +1 -1
- package/dist/observability/run-terminal.js +1 -0
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/secret-env-scrub.js +1 -1
- package/dist/org-delivery-gate.d.ts +31 -6
- package/dist/org-delivery-gate.js +7 -4
- package/dist/owner-faces.d.ts +30 -5
- package/dist/owner-faces.js +2 -0
- package/dist/park-row-commit.d.ts +67 -0
- package/dist/park-row-commit.js +76 -0
- package/dist/parked-decide.d.ts +9 -7
- package/dist/parked-decide.js +25 -6
- package/dist/peer-directory.d.ts +1 -1
- package/dist/peer-seat.d.ts +1 -1
- package/dist/peer-seat.js +52 -59
- package/dist/plugins/adoption-log-sql.d.ts +3 -3
- package/dist/plugins/adoption-log-sql.js +19 -19
- package/dist/plugins/approval-ask-store-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-sql.js +3 -5
- package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
- package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
- package/dist/plugins/approval-exemption-skill-m46.d.ts +0 -6
- package/dist/plugins/approval-exemption-skill-m46.js +6 -10
- package/dist/plugins/approval-exemption-store.d.ts +26 -1
- package/dist/plugins/approval-exemption-store.js +28 -19
- package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -3
- package/dist/plugins/ensure-schema-lock-policy.js +75 -9
- package/dist/plugins/exec-path-law.d.ts +34 -0
- package/dist/plugins/exec-path-law.js +13 -0
- package/dist/plugins/file-run-store.d.ts +22 -9
- package/dist/plugins/file-run-store.js +51 -23
- package/dist/plugins/local-checkpoint-store.d.ts +8 -1
- package/dist/plugins/local-checkpoint-store.js +5 -1
- package/dist/plugins/local-data-root-admission.d.ts +52 -0
- package/dist/plugins/local-data-root-admission.js +100 -0
- package/dist/plugins/local-engine-high-water.d.ts +28 -7
- package/dist/plugins/local-engine-high-water.js +27 -22
- package/dist/plugins/local-session-store.d.ts +134 -49
- package/dist/plugins/local-session-store.js +149 -108
- package/dist/plugins/memory-run-store.d.ts +14 -9
- package/dist/plugins/memory-run-store.js +48 -22
- package/dist/plugins/one-time-migration-marker.d.ts +19 -3
- package/dist/plugins/one-time-migration-marker.js +7 -1
- package/dist/plugins/one-time-migrations.d.ts +110 -59
- package/dist/plugins/one-time-migrations.js +224 -136
- package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
- package/dist/plugins/org-delivery-quota-store.js +29 -14
- package/dist/plugins/permission-rule-store-sql.d.ts +1 -1
- package/dist/plugins/permission-rule-store-sql.js +5 -9
- package/dist/plugins/pg-pool.d.ts +1 -1
- package/dist/plugins/pg-pool.js +14 -12
- package/dist/plugins/posix-shell-fs.js +4 -2
- package/dist/plugins/remote-env-adb.js +3 -2
- package/dist/plugins/remote-env-device.d.ts +3 -2
- package/dist/plugins/remote-env-device.js +8 -6
- package/dist/plugins/remote-env-e2b.d.ts +4 -8
- package/dist/plugins/remote-env-e2b.js +21 -15
- package/dist/plugins/remote-env-host.d.ts +51 -10
- package/dist/plugins/remote-env-host.js +97 -31
- package/dist/plugins/remote-env-k8s.js +7 -4
- package/dist/plugins/remote-env-local-docker.d.ts +6 -3
- package/dist/plugins/remote-env-local-docker.js +11 -25
- package/dist/plugins/remote-env-ssh.js +4 -3
- package/dist/plugins/remote-shell.d.ts +3 -1
- package/dist/plugins/remote-shell.js +3 -3
- package/dist/plugins/replica-registration.d.ts +35 -0
- package/dist/plugins/replica-registration.js +48 -0
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +27 -8
- package/dist/plugins/run-store-sql.js +46 -18
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +8 -12
- package/dist/plugins/scenario-prefix-switch-m42.js +9 -6
- package/dist/plugins/schema-consistency.d.ts +91 -5
- package/dist/plugins/schema-consistency.js +189 -7
- package/dist/plugins/schema-drift-sentence.d.ts +6 -5
- package/dist/plugins/schema-drift-sentence.js +13 -5
- package/dist/plugins/serving-requirement.d.ts +49 -0
- package/dist/plugins/serving-requirement.js +53 -0
- package/dist/plugins/session-placement.d.ts +5 -4
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +22 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +6 -0
- package/dist/plugins/stop-then-start-sentence.d.ts +55 -0
- package/dist/plugins/stop-then-start-sentence.js +51 -0
- package/dist/plugins/store-backend.d.ts +23 -9
- package/dist/plugins/store-backend.js +58 -24
- package/dist/plugins/store-contracts.d.ts +45 -5
- package/dist/plugins/store-contracts.js +19 -0
- package/dist/plugins/tidb-pool.d.ts +11 -6
- package/dist/plugins/tidb-pool.js +22 -12
- package/dist/plugins/workspace-custody.d.ts +44 -0
- package/dist/plugins/workspace-custody.js +47 -0
- package/dist/process-instance.d.ts +3 -0
- package/dist/process-instance.js +7 -0
- package/dist/project-context.d.ts +66 -0
- package/dist/project-context.js +70 -0
- package/dist/project-identity.d.ts +8 -7
- package/dist/project-identity.js +40 -17
- package/dist/project-layer-key.d.ts +13 -2
- package/dist/project-layer-key.js +9 -1
- package/dist/question.d.ts +9 -21
- package/dist/question.js +28 -19
- package/dist/read-deny-floor-notice.d.ts +36 -0
- package/dist/read-deny-floor-notice.js +40 -0
- package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
- package/dist/request-declaration-disposition.js +39 -0
- package/dist/run-cancel-card.d.ts +28 -0
- package/dist/run-cancel-card.js +20 -0
- package/dist/run-cancel-context.d.ts +10 -0
- package/dist/run-cancel-context.js +1 -0
- package/dist/run-local.js +28 -13
- package/dist/runs.d.ts +31 -7
- package/dist/runs.js +34 -16
- package/dist/security.d.ts +3 -3
- package/dist/server-secret-env.d.ts +34 -20
- package/dist/server-secret-env.js +61 -18
- package/dist/session-agent.d.ts +4 -12
- package/dist/session-agent.js +0 -6
- package/dist/session-children-retire.d.ts +6 -3
- package/dist/session-children-retire.js +2 -5
- package/dist/session-incarnation.d.ts +18 -4
- package/dist/session-incarnation.js +4 -1
- package/dist/session-notify-door.d.ts +4 -4
- package/dist/session-notify-door.js +5 -6
- package/dist/session-rules-seat.d.ts +4 -3
- package/dist/session-rules-seat.js +3 -11
- package/dist/session-sync.js +3 -3
- package/dist/session-workspace.d.ts +3 -3
- package/dist/store-admission.d.ts +33 -0
- package/dist/store-admission.js +49 -0
- package/dist/store-posture.d.ts +5 -0
- package/dist/store-posture.js +18 -1
- package/dist/stores-sql/checkpoint-store-sql.d.ts +22 -3
- package/dist/stores-sql/checkpoint-store-sql.js +109 -23
- package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
- package/dist/stores-sql/file-history-store-sql.js +3 -5
- package/dist/stores-sql/retention-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +4 -6
- package/dist/task-a2a.d.ts +3 -8
- package/dist/task-a2a.js +25 -27
- package/dist/task-cwd.d.ts +27 -10
- package/dist/task-cwd.js +3 -0
- package/dist/task-mcp.d.ts +3 -3
- package/dist/task-mcp.js +1 -1
- package/dist/task-settings.d.ts +13 -0
- package/dist/task-settings.js +14 -7
- package/dist/terminal.d.ts +2 -0
- package/dist/terminal.js +21 -6
- package/dist/tool-approval.d.ts +50 -41
- package/dist/tool-approval.js +96 -73
- package/dist/trace/engine-notice-wire.d.ts +38 -21
- package/dist/trace/engine-notice-wire.js +25 -4
- package/dist/trace/ledger-sink.d.ts +3 -1
- package/dist/trace/project.d.ts +8 -5
- package/dist/trace/project.js +11 -9
- package/dist/trace/projection-table.d.ts +33 -2
- package/dist/trace/redact.d.ts +12 -0
- package/dist/trace/redact.js +5 -1
- package/dist/trace/self-minted-wire.d.ts +268 -56
- package/dist/trace/self-minted-wire.js +110 -40
- package/dist/trace/tool-card.d.ts +3 -0
- package/dist/trace/tool-card.js +24 -0
- package/dist/trace/tool-output-media.d.ts +2 -1
- package/dist/unattended-permission-mode.d.ts +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +1 -1
- package/dist/web-admin-client/apply-effective.js +22 -9
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/skills-mcp.d.ts +1 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +57 -29
- package/docs/error-text-lexicon.json +317 -0
- package/package.json +4 -2
- package/scripts/embed-minimal.mjs +183 -0
- package/wire-changes/server@7.149.0.json +372 -0
- package/wire-changes/server@7.150.0.json +335 -0
- package/dist/plain-string-record.js +0 -70
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { buildReadDenyFloorSentence } from "./execution-lane-caps.js";
|
|
2
|
+
import { currentModelReachLeg } from "./model-reach-scope.js";
|
|
3
|
+
export const READ_DENY_FLOOR_UNKEPT = "config.read_deny_floor_unkept";
|
|
4
|
+
let installed;
|
|
5
|
+
export function installReadDenyFloorDeployment(deployment) {
|
|
6
|
+
installed = deployment;
|
|
7
|
+
}
|
|
8
|
+
export const RAN_RUNS_CAP = 10_000;
|
|
9
|
+
const ranRuns = new Set();
|
|
10
|
+
function noteRan(runId) {
|
|
11
|
+
ranRuns.delete(runId);
|
|
12
|
+
ranRuns.add(runId);
|
|
13
|
+
while (ranRuns.size > RAN_RUNS_CAP) {
|
|
14
|
+
const oldest = ranRuns.values().next();
|
|
15
|
+
if (oldest.done === true)
|
|
16
|
+
break;
|
|
17
|
+
ranRuns.delete(oldest.value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function presentEngineNotice(notice) {
|
|
21
|
+
if (notice.code !== READ_DENY_FLOOR_UNKEPT || installed === undefined)
|
|
22
|
+
return notice;
|
|
23
|
+
const runId = notice.detail?.runId;
|
|
24
|
+
if (typeof runId === "string" && runId.length > 0)
|
|
25
|
+
noteRan(runId);
|
|
26
|
+
const leg = currentModelReachLeg();
|
|
27
|
+
const message = buildReadDenyFloorSentence(installed.remoteExec.provider, "ran");
|
|
28
|
+
return leg?.taskId !== undefined ? { ...notice, message, sessionId: leg.sessionId, taskId: leg.taskId } : { ...notice, message };
|
|
29
|
+
}
|
|
30
|
+
export function readDenyFloorRefusalMessage(code) {
|
|
31
|
+
if (code !== READ_DENY_FLOOR_UNKEPT || installed === undefined)
|
|
32
|
+
return undefined;
|
|
33
|
+
return buildReadDenyFloorSentence(installed.remoteExec.provider, "refused");
|
|
34
|
+
}
|
|
35
|
+
export function readDenyFloorSummaryOf(runId) {
|
|
36
|
+
if (typeof runId !== "string" || !ranRuns.has(runId) || installed === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
return { code: READ_DENY_FLOOR_UNKEPT, message: buildReadDenyFloorSentence(installed.remoteExec.provider, "ran") };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=read-deny-floor-notice.js.map
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
/** 一个没进副本的成员:名字(调用方写的,原样;回显前由调用点清洗)与它为什么不能交(只说种类,不回显值)。 */
|
|
2
|
-
export interface PlainStringRecordMemberFault {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly fault: string;
|
|
5
|
-
}
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* 请求面一份声明(MCP 条目 / A2A 对端)里每个键的**去处**:处置表机制与唯一拆法 —— 两条请求腿同读。
|
|
3
|
+
*
|
|
4
|
+
* ## 律(一条):「名 → 串」记录从不进交给引擎的声明
|
|
5
|
+
* 引擎的声明收据对带 `headers` / `env` 的声明整条拒(`config.credential_in_declaration`):一份声明至多带一只不透明引用,件由部署的对端座在每次发送时作答。
|
|
6
|
+
* 所以请求面一份声明按它的**处置表**({@link DeclarationDispositionTable};MCP 两臂在 `mcp-assertion-header.ts`,A2A 对端在 `task-a2a.ts`)由 {@link splitDeclaration} 一只函数拆开:
|
|
7
|
+
* 标 `engine` 的键进交给引擎的声明,标 `seat` 的那一张记录(契约包「名 → 串」记录读法 `readPlainStringRecord` 交出的副本 —— MCP `transport.env` / `transport.headers` 与 A2A `headers` 同一只读法)进草稿的件,
|
|
8
|
+
* 标 `withheld` 的键两边都不进。草稿只有胜出者(部署同名者赢)才交给对端座登记,登记换来的引用放进声明的引用位 —— 交给引擎的声明里零件值。
|
|
9
|
+
* 件的名与值由引擎的座答读器在每次发送时判(名不是头名 / 变量名、值带 CR / LF / NUL 等 ⇒ 那一台不发、兄弟照挂),受理只判形、不替它判。
|
|
10
10
|
*/
|
|
11
|
-
export type PlainStringRecordRead = {
|
|
12
|
-
readonly ok: true;
|
|
13
|
-
readonly record: Record<string, string>;
|
|
14
|
-
readonly stripped: readonly PlainStringRecordMemberFault[];
|
|
15
|
-
} | {
|
|
16
|
-
readonly ok: false;
|
|
17
|
-
readonly fault: string;
|
|
18
|
-
readonly member?: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 读一份「名 → 串」记录(见模块头注的律)。成员 = `Object.getOwnPropertyNames` 的每一个名字(不可枚举的也算,与引擎收据同读法),值按属性描述读:
|
|
22
|
-
* 数据属性取值,访问器调一次。先判每个成员的值(`__proto__` 名的成员也判:它的值不是串 ⇒ 整只不交,与 7.131.x 同),再剔 `__proto__` 名。调用方的对象不被交出去、也不被改。
|
|
23
|
-
*/
|
|
24
|
-
export declare function readPlainStringRecord(v: unknown): PlainStringRecordRead;
|
|
25
11
|
/**
|
|
26
12
|
* 请求面一份声明里每个键的**去处**(闭集;{@link splitDeclaration} 对它穷尽 `switch`):
|
|
27
13
|
* · `engine` —— 进交给引擎的声明;
|
|
@@ -60,4 +46,4 @@ export declare function splitDeclaration<R extends object, T extends Declaration
|
|
|
60
46
|
readonly engine: Pick<R, EngineKeysOf<T> & keyof R>;
|
|
61
47
|
readonly pieces?: Readonly<Record<string, string>>;
|
|
62
48
|
};
|
|
63
|
-
//# sourceMappingURL=
|
|
49
|
+
//# sourceMappingURL=request-declaration-disposition.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function declarationKeys(table) {
|
|
2
|
+
return Object.freeze(Object.keys(table));
|
|
3
|
+
}
|
|
4
|
+
export function splitDeclaration(declaration, table) {
|
|
5
|
+
const dispositions = table;
|
|
6
|
+
const engine = {};
|
|
7
|
+
let pieces;
|
|
8
|
+
let seatSeen = false;
|
|
9
|
+
for (const [key, value] of Object.entries(declaration)) {
|
|
10
|
+
if (value === undefined)
|
|
11
|
+
continue;
|
|
12
|
+
const disposition = Object.hasOwn(dispositions, key) ? dispositions[key] : undefined;
|
|
13
|
+
switch (disposition) {
|
|
14
|
+
case "engine":
|
|
15
|
+
engine[key] = value;
|
|
16
|
+
break;
|
|
17
|
+
case "seat": {
|
|
18
|
+
if (seatSeen)
|
|
19
|
+
throw new Error("request declaration: two members are marked as pieces in one disposition table");
|
|
20
|
+
seatSeen = true;
|
|
21
|
+
const record = value;
|
|
22
|
+
if (Object.keys(record).length > 0)
|
|
23
|
+
pieces = record;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case "withheld":
|
|
27
|
+
break;
|
|
28
|
+
case undefined:
|
|
29
|
+
throw new Error(`request declaration: a member the disposition table does not classify (${JSON.stringify(key.slice(0, 40))})`);
|
|
30
|
+
default: {
|
|
31
|
+
const unknownDisposition = disposition;
|
|
32
|
+
void unknownDisposition;
|
|
33
|
+
throw new Error("request declaration: a disposition outside the closed set");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { engine: engine, ...(pieces === undefined ? {} : { pieces }) };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=request-declaration-disposition.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **取消动词在一条 run 的会话上会结算的那一张卡 —— 找法的唯一属主**(怎么结算它是 `card-settle-stored-scope.ts` 全仓共用的那一只)。两个读者同读这里,没有第二份:
|
|
3
|
+
* · `POST /v1/runs/:id/cancel` 的停驻取消腿找卡(`routes/runs.ts` 的 `cancelSuspended`);
|
|
4
|
+
* · 判坏的停驻卡的出路投影(`resume-legs.ts` 的 `rowWayOutOf`:`cancel_run` 当且仅当取消动词会结算**这一张**)。
|
|
5
|
+
*
|
|
6
|
+
* ## 规则一条:取消只读店的列,不读行体
|
|
7
|
+
* 取消要的两样 —— 这条 run 在等哪一张卡、它是不是活 run 的门 —— 都是列上的事实:找卡读归属 / 门型列(`findPendingTokenBySession` 的 run 绑定)。
|
|
8
|
+
* 行体怎么坏(读不成检查点、属主格丢了或与列不一致、整格 `{}`)都不改变取消落不落得下。属主门是路由层的 run 行属主复核(`admitRunById`),不在这里。
|
|
9
|
+
*
|
|
10
|
+
* ## 为什么出路投影问同一问
|
|
11
|
+
* 投影若另按载入的行体判「取消落不落得下」,就是同一件事的第二个读者(行体坏得越厉害,它越说不出出路,而取消恰在那时最需要被指出来)。
|
|
12
|
+
* 所以投影问取消动词自己那一问:有 run 店、那条会话上的 run 停着、取消动词找到的恰是这一张卡({@link cancelSettlesCard})。
|
|
13
|
+
*/
|
|
14
|
+
import type { CheckpointToken } from "@sema-agent/core";
|
|
15
|
+
import type { CheckpointStoreFull, RunStore } from "./plugins/store-backend.js";
|
|
16
|
+
/** 取消动词在 `runSessionId` 这条 run 的会话上会结算的那一张卡;没有 ⇒ `null`。 */
|
|
17
|
+
export declare function runCancelCardOf(cs: Pick<CheckpointStoreFull, "findPendingTokenBySession">, runSessionId: string): Promise<CheckpointToken | null>;
|
|
18
|
+
/** 取消动词要问的 run 行的两口:这条会话上持着认领的 run、它的状态(不带属主的一格事实,只经属主存取器读)。 */
|
|
19
|
+
export type CancelRunReader = Pick<RunStore, "getActiveTaskId" | "getRun">;
|
|
20
|
+
/**
|
|
21
|
+
* 取消动词会不会结算 `token` 这一张 —— 出路投影问的就是这一问,三个条件都是取消口自己的:
|
|
22
|
+
* · 有耐久 run 店(没有 ⇒ 取消口恒 `501 capability.run_store_required`,谈不上结算);
|
|
23
|
+
* · 这张卡归属的 run 会话上持着认领的那条 run **停着**(`suspended` / `needs_review`):取消口只对停着的 run 走结算卡那一腿 ——
|
|
24
|
+
* 终局的 run 是空操作(卡不动),在跑的 run 只挂取消旗(卡不动);归属说不出 —— M49 回填前的老行 —— 也找不到 run;
|
|
25
|
+
* · 取消动词在那条会话上找到的恰是这一张({@link runCancelCardOf};终局后的纯 park 排除在外)。
|
|
26
|
+
*/
|
|
27
|
+
export declare function cancelSettlesCard(cs: Pick<CheckpointStoreFull, "hostSessionOfCard" | "findPendingTokenBySession">, runs: CancelRunReader | undefined, token: CheckpointToken): Promise<boolean>;
|
|
28
|
+
//# sourceMappingURL=run-cancel-card.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LIVE_RUN_GATE_KINDS } from "./plugins/checkpoint-store-face.js";
|
|
2
|
+
import { isParkedRunStatus } from "./plugins/store-contracts.js";
|
|
3
|
+
import { runFactsOf } from "./http/owner-access.js";
|
|
4
|
+
const RUN_CANCEL_CARD = { gateKinds: LIVE_RUN_GATE_KINDS, axis: "run" };
|
|
5
|
+
export function runCancelCardOf(cs, runSessionId) {
|
|
6
|
+
return cs.findPendingTokenBySession(runSessionId, undefined, RUN_CANCEL_CARD);
|
|
7
|
+
}
|
|
8
|
+
export async function cancelSettlesCard(cs, runs, token) {
|
|
9
|
+
if (runs === undefined)
|
|
10
|
+
return false;
|
|
11
|
+
const host = await cs.hostSessionOfCard(token);
|
|
12
|
+
if (typeof host !== "string")
|
|
13
|
+
return false;
|
|
14
|
+
const holder = await runs.getActiveTaskId(host);
|
|
15
|
+
if (holder === undefined)
|
|
16
|
+
return false;
|
|
17
|
+
const run = await runFactsOf(runs, holder);
|
|
18
|
+
return run !== undefined && isParkedRunStatus(run.status) && (await runCancelCardOf(cs, host)) === token;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=run-cancel-card.js.map
|
|
@@ -68,13 +68,23 @@ export declare const CANCELLED_CODE = "cancelled";
|
|
|
68
68
|
* `cause` 是**必填**:本函数是 server 铸取消终局的唯一出口,而每一次取消都有一个发起者 ⇒ 「本仓铸的取消终局上恒有
|
|
69
69
|
* `abortCause`」由签名保证,不靠调用方记得。它走与补码、补快照**同一条**空座闸 —— 引擎给的终局不是无码的 failed
|
|
70
70
|
* (与中止赛跑跑完了 / 引擎自带码)⇒ 整只原样返回,成因也不挂(那条终局不是这次中止的结果,挂上就是「完成了却带着取消便签」)。
|
|
71
|
+
*
|
|
72
|
+
* ## 停驻中的取消:这条 run 已经说过的那一格随终局走(`parkedResult`)
|
|
73
|
+
* park 中直接终局化的取消(`POST /v1/runs/:id/cancel` 的停驻臂)没有引擎终局可补标,合成形是这条 run 的终局 —— 但这条 run 不是没跑过:它停驻时那条结果
|
|
74
|
+
* (出口封口过、落在行上)已经带着 run 级的那一格 **读拒字节地板不守**(`readDenyFloor`,属主 `read-deny-floor-notice.ts`:准备期定下,停驻之前就已在 run 事件流上说过)。
|
|
75
|
+
* 合成形照抄行上那一格:同一句、同一个来源(行),不按取消这一拍的进程重判 —— 取消可以落在另一只副本上、或重启之后,进程内的记录不在那里;店的写口过出口封口时
|
|
76
|
+
* 那一格已在 ⇒ 原样(封口「已挂即原样」)。引擎给了终局的形不读它(那条终局自己带 `runId`,封口按它接)。
|
|
71
77
|
*/
|
|
72
78
|
export declare function mintCancelledResult<R extends PersistedTaskResult>(args: CancelMintArgs & {
|
|
73
79
|
engineResult: R;
|
|
80
|
+
parkedResult?: undefined;
|
|
74
81
|
}): R;
|
|
75
82
|
export declare function mintCancelledResult(args: CancelMintArgs & {
|
|
76
83
|
engineResult?: undefined;
|
|
84
|
+
parkedResult?: ParkedLegResult;
|
|
77
85
|
}): PersistedTaskResult;
|
|
86
|
+
/** 停驻臂交来的那条行上的结果(停驻时出口封口过的;行可以没有结果 ⇒ `null`)。合成形只读它 run 级的那一格。 */
|
|
87
|
+
export type ParkedLegResult = Pick<PersistedTaskResult, "readDenyFloor"> | null;
|
|
78
88
|
/**
|
|
79
89
|
* 被取消的续跑腿、且这张卡被本服务 expire 之后,终局上的那句话 —— **全仓单源**([ref])。
|
|
80
90
|
*
|
|
@@ -34,6 +34,7 @@ export function mintCancelledResult(args) {
|
|
|
34
34
|
stats: { turns: 0, tokens: 0, usageMissing: true },
|
|
35
35
|
...(ctx ? { cancelContext: ctx } : {}),
|
|
36
36
|
abortCause: args.cause,
|
|
37
|
+
...(args.parkedResult?.readDenyFloor !== undefined ? { readDenyFloor: args.parkedResult.readDenyFloor } : {}),
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
export const CARD_SETTLED_BY_CANCEL_MESSAGE = "Cancelled — the approved action never started, and the cancel settled this approval: it cannot be resumed (start a new run to continue)";
|
package/dist/run-local.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DEFAULT_MODEL_REF, pickUserModel } from "./model-select.js";
|
|
3
3
|
import { defaultModelRefusal, modelNotAllowedMessage, modelUnavailableMessage } from "./model-entry-refusal.js";
|
|
4
4
|
import { servedModelTableLeg } from "./model-select.js";
|
|
5
|
-
import { outwardPlane } from "./terminal.js";
|
|
5
|
+
import { outwardPlane, sealResultForExit } from "./terminal.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { realpathSync } from "node:fs";
|
|
8
8
|
import { createInterface } from "node:readline/promises";
|
|
@@ -19,12 +19,13 @@ import { ForkRoutingSessionStore } from "./plugins/fork-routing-session-store.js
|
|
|
19
19
|
import { taskWallClockSec } from "./task-workflow.js";
|
|
20
20
|
import { applyCenterArtifact, centerSourceOnError } from "./capabilities/center-prompts.js";
|
|
21
21
|
import { buildUnpricedCeilingNotice, isRosterGateArmed, loadConfig, logConfigDiagnostics, parseConfigProvider, parseNumOrFailNonNegative } from "./config.js";
|
|
22
|
+
import { admitLocalDataRoot } from "./plugins/local-data-root-admission.js";
|
|
22
23
|
import { openLocalBackend } from "./plugins/store-backend.js";
|
|
23
24
|
import { runAndLogOneTimeMigrations } from "./plugins/one-time-migrations.js";
|
|
24
25
|
import { configLocalRoot, createConfigProvider } from "./config-provider.js";
|
|
25
26
|
import { CONFIG_DOMAIN_INVALID_NOTE, buildCandidateRejectedFields, buildCandidateRejectionNotes, judgeConfigCandidate } from "./web-admin-client/candidate-gate.js";
|
|
26
27
|
import { buildUnreadConfigFileFields, buildUnreadConfigKeyFields } from "./web-admin-client/read-warnings.js";
|
|
27
|
-
import { composeExecutionLane, settleHostLaneShell,
|
|
28
|
+
import { composeExecutionLane, settleHostLaneShell, settleReadDenyFloor } from "./boot/execution-lane.js";
|
|
28
29
|
import { judgeConsolidationValve } from "./boot/memory-consolidation.js";
|
|
29
30
|
import { logConfigDirMigration, migrateLocalConfigDirectory } from "./config-d-migration.js";
|
|
30
31
|
import { logEnvModelsMigration, runEnvModelsMigration } from "./config-root-migration.js";
|
|
@@ -49,6 +50,7 @@ import { createMemoryProjectLayers } from "./memory-project-layer.js";
|
|
|
49
50
|
import { assertProjectLayerOwnable } from "./project-identity.js";
|
|
50
51
|
import { declaredCredential } from "./model-route-gap.js";
|
|
51
52
|
import { judgeServedModelRoute } from "./model-route-endpoint.js";
|
|
53
|
+
import { warnAssumedContextWindows } from "./context-window-notice.js";
|
|
52
54
|
import { startMemorySyncRunner } from "./memory-sync-client.js";
|
|
53
55
|
import { buildPricing, cappedCeiling, createTracer } from "./budget.js";
|
|
54
56
|
import { createSharedRunnerDeps, installDefaultEngineNoticeSeat } from "./boot/runner-deps.js";
|
|
@@ -67,6 +69,7 @@ import { createLspManager } from "./host-lsp-manager.js";
|
|
|
67
69
|
import { installOutboundDispatcher } from "./outbound-dispatcher.js";
|
|
68
70
|
import { announceConfigRootEnclosingWorkspace, provisionSemaConfigDir } from "./sema-config-dir.js";
|
|
69
71
|
import { launchWorkspaceOf } from "./task-cwd.js";
|
|
72
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
70
73
|
import { bindOwnCredentialsConfig, declareServerWithheldEnv } from "./server-secret-env.js";
|
|
71
74
|
export function parseArgs(argv) {
|
|
72
75
|
let objective;
|
|
@@ -356,7 +359,14 @@ export async function runLocal(argv, deps = {}) {
|
|
|
356
359
|
installSecretEnvScrubRecorder({ logger, metrics });
|
|
357
360
|
installDefaultEngineNoticeSeat(logger, metrics);
|
|
358
361
|
logConfigDiagnostics(logger);
|
|
359
|
-
|
|
362
|
+
let admission;
|
|
363
|
+
try {
|
|
364
|
+
admission = admitLocalDataRoot(root);
|
|
365
|
+
}
|
|
366
|
+
catch (e) {
|
|
367
|
+
await printErr(e instanceof Error ? e.message : String(e));
|
|
368
|
+
return 2;
|
|
369
|
+
}
|
|
360
370
|
installOutboundDispatcher(logger);
|
|
361
371
|
const providerInput = { provider: "local", localDir: root, localOwnerUid: loaded.configLocalOwnerUid };
|
|
362
372
|
try {
|
|
@@ -366,8 +376,6 @@ export async function runLocal(argv, deps = {}) {
|
|
|
366
376
|
await printErr(err instanceof Error ? err.message : String(err));
|
|
367
377
|
return 2;
|
|
368
378
|
}
|
|
369
|
-
const envModelsMigration = { root, env: process.env, envTableIsPlaceholder: isRosterGateArmed(loaded.webAdmin) };
|
|
370
|
-
logEnvModelsMigration(logger, envModelsMigration, await runEnvModelsMigration(envModelsMigration));
|
|
371
379
|
logConfigDirMigration(logger, await migrateLocalConfigDirectory(root));
|
|
372
380
|
let config;
|
|
373
381
|
try {
|
|
@@ -377,6 +385,9 @@ export async function runLocal(argv, deps = {}) {
|
|
|
377
385
|
await printErr(err instanceof Error ? err.message : String(err));
|
|
378
386
|
return 2;
|
|
379
387
|
}
|
|
388
|
+
provisionSemaConfigDir(config, logger);
|
|
389
|
+
const envModelsMigration = { root, env: process.env, envTableIsPlaceholder: isRosterGateArmed(config.webAdmin) };
|
|
390
|
+
logEnvModelsMigration(logger, envModelsMigration, await runEnvModelsMigration(envModelsMigration));
|
|
380
391
|
const configProvider = createConfigProvider(providerInput);
|
|
381
392
|
const peerDesk = createPeerDesk({ log: logger });
|
|
382
393
|
const rosterLease = peerDesk.lease("roster");
|
|
@@ -430,6 +441,7 @@ export async function runLocal(argv, deps = {}) {
|
|
|
430
441
|
const routeVerdict = judgeServedModelRoute(config, { envTableIsPlaceholder: false });
|
|
431
442
|
if (routeVerdict !== undefined)
|
|
432
443
|
throw new Error(routeVerdict.reason);
|
|
444
|
+
warnAssumedContextWindows(config, logger, { envTableIsPlaceholder: false });
|
|
433
445
|
const unpricedCeiling = buildUnpricedCeilingNotice(config.models, config);
|
|
434
446
|
if (unpricedCeiling)
|
|
435
447
|
logger.warn(unpricedCeiling.event, unpricedCeiling.fields);
|
|
@@ -464,7 +476,7 @@ export async function runLocal(argv, deps = {}) {
|
|
|
464
476
|
const pricing = buildPricing(config.models);
|
|
465
477
|
let backend;
|
|
466
478
|
try {
|
|
467
|
-
backend = openLocalBackend({ ...config, localDataRoot: root }, { lane: "run-local", onWarn: (msg, fields) => logger.warn(msg, fields), onError: (msg, fields) => logger.error(msg, fields) });
|
|
479
|
+
backend = openLocalBackend({ ...config, localDataRoot: root }, { lane: "run-local", admission, onWarn: (msg, fields) => logger.warn(msg, fields), onError: (msg, fields) => logger.error(msg, fields) });
|
|
468
480
|
}
|
|
469
481
|
catch (e) {
|
|
470
482
|
await printErr(e instanceof Error ? e.message : String(e));
|
|
@@ -487,13 +499,13 @@ export async function runLocal(argv, deps = {}) {
|
|
|
487
499
|
const workspaceDir = launchWorkspace.dir;
|
|
488
500
|
announceConfigRootEnclosingWorkspace(config, logger, launchWorkspace);
|
|
489
501
|
await settleHostLaneShell(config, logger);
|
|
490
|
-
|
|
502
|
+
settleReadDenyFloor(config, logger);
|
|
491
503
|
const homeDirSeat = buildLaneHomeClaim(config);
|
|
492
504
|
const executionEnvFactory = hostRx
|
|
493
505
|
? hostExecutionEnvFactory({
|
|
494
506
|
workspaceDir,
|
|
495
507
|
...homeDirSeat,
|
|
496
|
-
backgroundShell: config
|
|
508
|
+
backgroundShell: DEPLOYMENT_SHAPE_PREDICATES.backgroundShell.holds(config),
|
|
497
509
|
...(hostRx.commandTimeoutMs != null ? { commandTimeoutMs: hostRx.commandTimeoutMs } : {}),
|
|
498
510
|
})
|
|
499
511
|
: undefined;
|
|
@@ -774,21 +786,24 @@ export async function runLocal(argv, deps = {}) {
|
|
|
774
786
|
return 1;
|
|
775
787
|
}
|
|
776
788
|
const unfinishedStop = unfinishedStopOf(result, refusedWithoutPerson);
|
|
789
|
+
const shown = sealResultForExit(result);
|
|
777
790
|
if (args.json) {
|
|
778
|
-
await print(JSON.stringify(
|
|
791
|
+
await print(JSON.stringify(shown, null, 2));
|
|
779
792
|
}
|
|
780
|
-
else if (
|
|
781
|
-
await print(
|
|
793
|
+
else if (shown.terminal.kind === "completed") {
|
|
794
|
+
await print(shown.result);
|
|
782
795
|
if (unfinishedStop !== undefined)
|
|
783
796
|
await printErr(buildUnfinishedStopFooter(unfinishedStop, sessionId));
|
|
784
797
|
}
|
|
785
798
|
else {
|
|
786
|
-
const plane = outwardPlane(
|
|
787
|
-
const salvage =
|
|
799
|
+
const plane = outwardPlane(shown.terminal);
|
|
800
|
+
const salvage = shown.result || shown.salvagedOutput || plane.blockedReason || "";
|
|
788
801
|
if (salvage)
|
|
789
802
|
await print(salvage);
|
|
790
803
|
await printErr(`task ${plane.status}${plane.errorCode ? ` (${plane.errorCode})` : ""}${plane.errorMessage ? `: ${plane.errorMessage}` : ""}`);
|
|
791
804
|
}
|
|
805
|
+
if (!args.json && shown.readDenyFloor !== undefined)
|
|
806
|
+
await printErr(shown.readDenyFloor.message);
|
|
792
807
|
if (result.terminal.kind !== "completed" || unfinishedStop !== undefined)
|
|
793
808
|
exitCode = 1;
|
|
794
809
|
if (memorySync)
|
package/dist/runs.d.ts
CHANGED
|
@@ -9,12 +9,14 @@ import { type RunAbort } from "./run-cancel-context.js";
|
|
|
9
9
|
import type { ModelUsageTracker, PromptManifestTracker } from "./budget.js";
|
|
10
10
|
import type { ElicitationCoordinator } from "./elicitation.js";
|
|
11
11
|
import type { QuestionCoordinator } from "./question.js";
|
|
12
|
+
import type { ApprovalLegOrigin } from "./approval-leg-origin.js";
|
|
12
13
|
import { type ApprovalFrameFamily, type ToolApprovalCoordinator } from "./tool-approval.js";
|
|
13
14
|
import { type FleetRunPublisher } from "./fleet/fleet-bus.js";
|
|
14
15
|
import { type WorkflowCompletionInbox } from "./orchestration/workflow-completion-inbox.js";
|
|
15
16
|
import type { RunAcceptance } from "./run-acceptance.js";
|
|
16
17
|
import type { SessionWorkspaceRecorder } from "./session-workspace.js";
|
|
17
18
|
import type { VerifyRoundsSpec } from "./http/verify-rounds.js";
|
|
19
|
+
import { type ParkLedgerEventType } from "./trace/ledger-events.js";
|
|
18
20
|
import type { UserInputLedger } from "./user-input-ledger.js";
|
|
19
21
|
/**
|
|
20
22
|
* stoppedBy (core 1.252): a service cancel is a USER stop — mark the run's still-running background
|
|
@@ -283,13 +285,21 @@ export declare function parkToolCallId(result: unknown, cs: ParkCheckpointReader
|
|
|
283
285
|
* 不塞进 `checkpointGate`——那是 core 的类型,server 不改其形)。非 park / 无 token / tool-less /
|
|
284
286
|
* 读失败 ⇒ **同一引用**原样返回(键缺席)。graft 不负责 strip——组合序恒为 graft → strip。 */
|
|
285
287
|
export declare function graftParkToolCallId<T>(result: T, cs: ParkCheckpointReader | undefined): Promise<T>;
|
|
288
|
+
/** 一份结果在等的那张卡与它停在的停驻词(暂停因由 ∧ 投影出口给的词是停驻词);不是停驻 ⇒ `undefined`。后台腿的停驻臂与兜底腿、续跑腿的兜底同读它。 */
|
|
289
|
+
export interface HeldPark {
|
|
290
|
+
readonly word: ParkLedgerEventType;
|
|
291
|
+
readonly token: CheckpointToken;
|
|
292
|
+
}
|
|
293
|
+
export declare function heldParkOf(result: TaskResult): HeldPark | undefined;
|
|
286
294
|
/**
|
|
287
|
-
* 🔴 [ref]
|
|
295
|
+
* 🔴 [ref] **手里握着已提交的卡却以终局收场的腿:卡的命运先于认领释放**(后台腿与续跑腿同读这一只;动词 = `card-void.ts` 的结算作废)。
|
|
288
296
|
*
|
|
289
|
-
*
|
|
297
|
+
* 腿要以终局收场(行 `failed`、认领释放),而手里的结果是宿主层停驻 —— 引擎交回结果之前已把卡落进 checkpoint 店,卡在本 run 的会话上 ——
|
|
290
298
|
* ⇒ 先把那张卡按它自己的 scope 作废,调用方再放认领。不作废 ⇒ 待决面上留一张卡,兑现它的 run 已经 `failed`、认领已放:决定口照样受理,
|
|
291
299
|
* 续跑在没有认领的会话上驱动(`resume-legs.ts` 认领缺席的成因清单)。顺序承重:先放认领、后作废 ⇒ 两步之间(作废没做成时一直)就是那一形。
|
|
292
|
-
*
|
|
300
|
+
* 走到这里的只剩「这条 run 真的不再等这张卡」的形:取消落在结果到手之后(两条腿)、暂停结果不是停驻词。
|
|
301
|
+
* 停驻簿记写抛(账本帧 / 用量差 / 结果到手之后的清单行与缓冲文本)**不**走到这里 —— 卡已提交 ⇒ 照常提交停驻({@link commitParkRow}),
|
|
302
|
+
* 簿记只留痕;行的停驻写被店答出拒(行已不是本腿的)由提交口自己作废那张卡。
|
|
293
303
|
*
|
|
294
304
|
* `held` = 手里那份结果过了宿主判官之后的形(判官提上来的嵌套停驻同样算 —— verify 的实现腿 / 修复轮、cascade 的级上卡,都归本 run 的会话)。
|
|
295
305
|
* 不是停驻 ⇒ 零 I/O。不抛:作废没做成 ⇒ 卡回到「留在待决面上、由兜底收割收走」的形,响亮留痕。
|
|
@@ -328,7 +338,16 @@ export declare function voidHeldParkCard(held: {
|
|
|
328
338
|
* only — a suspended run is steered durably via the checkpoint's `setPendingSteer` instead, and only the
|
|
329
339
|
* plain-stream path holds a steerable stream (the verify/cascade branches return a result, not a stream).
|
|
330
340
|
*/
|
|
331
|
-
export declare function runInBackground(runner: Runner, spec: TaskSpec, runStore: RunStore, taskId: string,
|
|
341
|
+
export declare function runInBackground(runner: Runner, spec: TaskSpec, runStore: RunStore, taskId: string,
|
|
342
|
+
/**
|
|
343
|
+
* 本腿停驻的两条事实,只有一个读者 —— 停驻提交({@link commitParkRow}):`legId` = 本腿的持有腿(建行 `createRun` 交回的 `{ ok: true, legId }`,
|
|
344
|
+
* 停驻写只许它落下);`runStaleSec` = 判活窗(秒,`REAP_RUN_STALE_SEC`,活配置;路由层 `deps.config.runStaleSec`;缺席 ⇒ 缺省窗),店故障时再提交的上界。
|
|
345
|
+
* 必填:持有腿是认领交给本腿的,不是读来的 —— 调用方不交它,停驻就无从提交(编译期红,不留运行期的缺席臂)。
|
|
346
|
+
*/
|
|
347
|
+
parkCommit: {
|
|
348
|
+
readonly legId: string;
|
|
349
|
+
readonly runStaleSec: number | undefined;
|
|
350
|
+
}, metrics?: Metrics,
|
|
332
351
|
/** 本跑的属主主体(分区键;行属主 / ALS 读它)。 */
|
|
333
352
|
principal?: string, verify?: VerifyRoundsSpec, // 快审 F1:number 参升整对象——cost 顶随传
|
|
334
353
|
cascade?: CascadeConfig, instrumentDegenerate?: (result: TaskResult) => void, planCacheProbe?: {
|
|
@@ -388,8 +407,8 @@ approval?: {
|
|
|
388
407
|
streamApprovalOn: boolean;
|
|
389
408
|
windowMs: number | undefined;
|
|
390
409
|
windowMarginMs: number;
|
|
391
|
-
declaredFamilies: ReadonlySet<ApprovalFrameFamily>; /**
|
|
392
|
-
|
|
410
|
+
declaredFamilies: ReadonlySet<ApprovalFrameFamily>; /** 出处带车道 + 化身:这条执行上下文的车道与那一读的住客(装配点 `durable-run-leg.ts` 经 `approvalLegOriginOf` 写)。 */
|
|
411
|
+
origin: ApprovalLegOrigin;
|
|
393
412
|
},
|
|
394
413
|
/** 本腿结算用的 checkpoint 店(`deps.checkpointStore`),两件事:①[ref] park 投影腿的读口 —— 在场时 durable park 的
|
|
395
414
|
* `suspended` 事件带 `toolCallId`(graft 见 {@link parkToolCallId});②停驻没落定就以失败收场时作废手里那张卡({@link voidHeldParkCard})。
|
|
@@ -436,7 +455,12 @@ workspaceRecorder?: SessionWorkspaceRecorder,
|
|
|
436
455
|
* 这条 run 交给引擎的技能名册(`wiring_manifest.skills` 段;部署事实 `LegFacts.skills`,`leg-facts.ts`:受理漏斗在复制之前读出)。
|
|
437
456
|
* 缺席 = 嵌入方自带的装配器没铸 ⇒ 账本行不带技能段。
|
|
438
457
|
*/
|
|
439
|
-
runSkills?: readonly RunSkillEntry[]
|
|
458
|
+
runSkills?: readonly RunSkillEntry[],
|
|
459
|
+
/**
|
|
460
|
+
* 这次提交登记的工作目录(部署事实 `LegFacts.registeredCwd`)。只在两条组合腿(verify / cascade)上经 `compositionLegRoot` 交给引擎 ——
|
|
461
|
+
* 梯子的级 / 验证器腿跑在引擎现铸的会话里,工厂按会话读不到它;普通流形跑在根会话上,工厂自己读得到。缺席 = 没登记 ⇒ 每一条腿照旧落临时目录。
|
|
462
|
+
*/
|
|
463
|
+
registeredCwd?: string): Promise<void>;
|
|
440
464
|
/** 一次心跳要的那一面(run 店的带属主刷新;交回「行还在 running 吗」)。 */
|
|
441
465
|
export interface RunHeartbeatStore {
|
|
442
466
|
heartbeat(taskId: string, owner: string | null): Promise<boolean>;
|
package/dist/runs.js
CHANGED
|
@@ -2,6 +2,7 @@ import { runWithVerification, runCascade, defaultTaskRegistry, taskNotificationD
|
|
|
2
2
|
import { atHostBoundary, failureCodeOf, sealResultForExit, outwardPlane, outwardThrownMessage } from "./terminal.js";
|
|
3
3
|
import { voidVerifierPauseCard } from "./verifier-pause-card.js";
|
|
4
4
|
import { voidPendingCard } from "./card-void.js";
|
|
5
|
+
import { commitParkRow } from "./park-row-commit.js";
|
|
5
6
|
import { NOT_IN_ROSTER, entryProblemsFacts } from "./entry-problems.js";
|
|
6
7
|
import { GOVERNANCE_HTTP_STATUS } from "./governance-http-status.js";
|
|
7
8
|
import { TOOL_DECLARATION_HTTP_STATUS } from "./tool-declaration-http-status.js";
|
|
@@ -29,6 +30,7 @@ import { recordFailOpen } from "./observability/fail-open.js";
|
|
|
29
30
|
import { BASELINE_IO_DEADLINE_MS, IoDeadlineExceeded, withinIoDeadline } from "./instruction-source-notice.js";
|
|
30
31
|
import { errorText as errText } from "./observability/err-text.js";
|
|
31
32
|
import { LIVENESS_HEARTBEAT_MS } from "./config-invariants.js";
|
|
33
|
+
import { compositionLegRoot } from "./task-cwd.js";
|
|
32
34
|
export async function backgroundAgentOutput(registry, handle, access, agentStore) {
|
|
33
35
|
const row = registry.getAccessibleTask(handle, access);
|
|
34
36
|
if (!row || row.type !== "background_agent") {
|
|
@@ -302,12 +304,18 @@ export async function graftParkToolCallId(result, cs) {
|
|
|
302
304
|
const id = await parkToolCallId(result, cs);
|
|
303
305
|
return id === undefined ? result : { ...result, toolCallId: id };
|
|
304
306
|
}
|
|
307
|
+
export function heldParkOf(result) {
|
|
308
|
+
if (result.terminal.kind !== "paused")
|
|
309
|
+
return undefined;
|
|
310
|
+
const word = outwardPlane(result.terminal).status;
|
|
311
|
+
return isParkLedgerEventType(word) ? { word, token: result.terminal.token } : undefined;
|
|
312
|
+
}
|
|
305
313
|
export async function voidHeldParkCard(held, hostSessionId, cards, leg) {
|
|
306
314
|
if (held?.terminal.kind !== "paused")
|
|
307
315
|
return;
|
|
308
316
|
await voidPendingCard({ token: held.terminal.token, sessionId: hostSessionId }, cards, "server.park.held-card-void-failed", `leg=${leg}`);
|
|
309
317
|
}
|
|
310
|
-
export async function runInBackground(runner, spec, runStore, taskId, metrics, principal, verify, cascade, instrumentDegenerate, planCacheProbe, persistThinking = false, inflight, preemptable, steerable, modelUsage, elicitation, elicitOwner, captureTurnAnchor, fleetPublisher, captureUserMessageAnchor, question, workflowCompletionInbox, subagentSteer, completionDiagLog, sendUserFile, promptManifests, approval, checkpointCards, pendingEngineNotices, trustedInternals, userInputLedger, acceptance, workspaceRecorder, runSkills) {
|
|
318
|
+
export async function runInBackground(runner, spec, runStore, taskId, parkCommit, metrics, principal, verify, cascade, instrumentDegenerate, planCacheProbe, persistThinking = false, inflight, preemptable, steerable, modelUsage, elicitation, elicitOwner, captureTurnAnchor, fleetPublisher, captureUserMessageAnchor, question, workflowCompletionInbox, subagentSteer, completionDiagLog, sendUserFile, promptManifests, approval, checkpointCards, pendingEngineNotices, trustedInternals, userInputLedger, acceptance, workspaceRecorder, runSkills, registeredCwd) {
|
|
311
319
|
const startedAt = Date.now();
|
|
312
320
|
metrics?.addGauge("runs_active", 1);
|
|
313
321
|
fleetPublisher?.onStart();
|
|
@@ -345,12 +353,12 @@ export async function runInBackground(runner, spec, runStore, taskId, metrics, p
|
|
|
345
353
|
if (approval) {
|
|
346
354
|
const coordinator = approval.coordinator;
|
|
347
355
|
spec.onAsk = approvalLeg.unattended
|
|
348
|
-
? coordinator.boundUnattendedAsk({ owner: elicitOwner ?? owner, taskId, ...(spec.sessionId ? { sessionId: spec.sessionId } : {}),
|
|
356
|
+
? coordinator.boundUnattendedAsk({ owner: elicitOwner ?? owner, taskId, ...(spec.sessionId ? { sessionId: spec.sessionId } : {}), ...approval.origin }, approvalLeg.unattended)
|
|
349
357
|
: coordinator.boundAsk({
|
|
350
358
|
owner: elicitOwner ?? owner,
|
|
351
359
|
taskId,
|
|
352
360
|
...(spec.sessionId ? { sessionId: spec.sessionId } : {}),
|
|
353
|
-
|
|
361
|
+
...approval.origin,
|
|
354
362
|
...(approvalLeg.active ? { legKey: "", ...(legDeadlineMonotonic !== undefined ? { legDeadlineMonotonic } : {}) } : {}),
|
|
355
363
|
});
|
|
356
364
|
}
|
|
@@ -375,23 +383,26 @@ export async function runInBackground(runner, spec, runStore, taskId, metrics, p
|
|
|
375
383
|
let legLive = true;
|
|
376
384
|
const notifiedKeys = new NotifiedKeys();
|
|
377
385
|
const subagentHandleEvictions = [];
|
|
378
|
-
const
|
|
379
|
-
suspended: (sealed) => runStore.setSuspended(taskId, sealed),
|
|
380
|
-
needs_review: (sealed) => runStore.setNeedsReview(taskId, sealed),
|
|
381
|
-
};
|
|
382
|
-
const parkLeg = async (word, res) => {
|
|
386
|
+
const parkLeg = async ({ word, token }, res) => {
|
|
383
387
|
const grafted = await graftParkToolCallId(res, checkpointCards);
|
|
384
388
|
await sink.appendParked(word, grafted);
|
|
385
389
|
const sealed = sealResultForExit(grafted);
|
|
386
390
|
reached = { kind: word, result: sealed };
|
|
387
|
-
await
|
|
391
|
+
const committed = await commitParkRow({
|
|
392
|
+
runStore, taskId, word, result: sealed, card: { token, sessionId: spec.sessionId }, cards: checkpointCards, leg: "bg",
|
|
393
|
+
legId: parkCommit.legId, staleWindowMs: parkCommit.runStaleSec === undefined ? undefined : parkCommit.runStaleSec * 1000,
|
|
394
|
+
});
|
|
395
|
+
if (committed.kind === "ended") {
|
|
396
|
+
reached = undefined;
|
|
397
|
+
settledAsCancel = committed.row?.errorCode === CANCELLED_CODE;
|
|
398
|
+
}
|
|
388
399
|
acceptance?.settle(sealed);
|
|
389
400
|
};
|
|
390
401
|
const settleLegResult = async (engineResult) => {
|
|
391
402
|
const result = atHostBoundary(engineResult);
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
await parkLeg(
|
|
403
|
+
const held = heldParkOf(result);
|
|
404
|
+
if (held !== undefined) {
|
|
405
|
+
await parkLeg(held, result);
|
|
395
406
|
return;
|
|
396
407
|
}
|
|
397
408
|
const settled = causeAtDone !== undefined ? cancelledResult(causeAtDone, result) : result;
|
|
@@ -416,10 +427,13 @@ export async function runInBackground(runner, spec, runStore, taskId, metrics, p
|
|
|
416
427
|
const hitlTransport = createHitlTransport({ ledger: append });
|
|
417
428
|
const unregisterEngineNotice = registerEngineNoticeLeg({
|
|
418
429
|
sessionId: spec.sessionId,
|
|
430
|
+
taskId,
|
|
419
431
|
...(pendingEngineNotices !== undefined ? { pending: pendingEngineNotices } : {}),
|
|
420
432
|
durable: (row) => append("engine_notice", row).then(() => true, () => (recordFailOpen("server.engine-notice.durable-append-failed", `leg=bg code=${row.code} task=${taskId}`), false)),
|
|
421
433
|
});
|
|
422
434
|
try {
|
|
435
|
+
if (typeof parkCommit?.legId !== "string" || parkCommit.legId === "")
|
|
436
|
+
throw new TypeError(`runInBackground: run ${taskId} was started without the holding leg its claim handed back (parkCommit.legId) — refusing to start a run whose park could never be committed`);
|
|
423
437
|
if (userInputLedger && spec.sessionId)
|
|
424
438
|
await userInputLedger.announceUndrained({ sessionId: spec.sessionId, taskId });
|
|
425
439
|
await emitPendingWorkflowCompletions(workflowCompletionInbox, spec.sessionId, elicitOwner ?? owner, (frame) => {
|
|
@@ -476,10 +490,11 @@ export async function runInBackground(runner, spec, runStore, taskId, metrics, p
|
|
|
476
490
|
void sink.appendStatus(e).catch((err) => completionDiagLog?.("status_event_append_failed", { route: "bg-run-composite", taskId, err: err instanceof Error ? err.message : String(err) }));
|
|
477
491
|
},
|
|
478
492
|
};
|
|
493
|
+
const compositeInternals = { ...fwdInternals, ...statusSeat, ...compositionLegRoot(registeredCwd) };
|
|
479
494
|
const compositeLeg = verify !== undefined
|
|
480
|
-
? () => runWithVerification(runner, { ...spec, taskId, signal: cancelCtrl.signal }, verify,
|
|
495
|
+
? () => runWithVerification(runner, { ...spec, taskId, signal: cancelCtrl.signal }, verify, compositeInternals)
|
|
481
496
|
: cascade !== undefined
|
|
482
|
-
? () => runCascade(runner, { ...spec, taskId, signal: cancelCtrl.signal }, cascade,
|
|
497
|
+
? () => runCascade(runner, { ...spec, taskId, signal: cancelCtrl.signal }, cascade, compositeInternals)
|
|
483
498
|
: undefined;
|
|
484
499
|
if (compositeLeg !== undefined) {
|
|
485
500
|
const result = await compositeLeg();
|
|
@@ -550,7 +565,7 @@ export async function runInBackground(runner, spec, runStore, taskId, metrics, p
|
|
|
550
565
|
owner: elicitOwner ?? owner,
|
|
551
566
|
abortSignal: cancelCtrl.signal,
|
|
552
567
|
...(spec.sessionId ? { sessionId: spec.sessionId } : {}),
|
|
553
|
-
|
|
568
|
+
...approval.origin,
|
|
554
569
|
family: "approval_request",
|
|
555
570
|
transport: hitlTransport,
|
|
556
571
|
legKey: "",
|
|
@@ -599,9 +614,12 @@ export async function runInBackground(runner, spec, runStore, taskId, metrics, p
|
|
|
599
614
|
acceptance?.settle(reached.result);
|
|
600
615
|
}
|
|
601
616
|
else if (reached !== undefined) {
|
|
602
|
-
await parkRowWrite[reached.kind](reached.result);
|
|
603
617
|
acceptance?.settle(reached.result);
|
|
604
618
|
}
|
|
619
|
+
else if (thrownCancelCause === undefined && observedDone !== undefined && heldParkOf(atHostBoundary(observedDone)) !== undefined) {
|
|
620
|
+
recordFailOpen("server.runs.terminal-ledger-write-failed", `arm=park-held ${message}`);
|
|
621
|
+
await settleLegResult(observedDone);
|
|
622
|
+
}
|
|
605
623
|
else if (thrownCancelCause !== undefined && observedDone === undefined) {
|
|
606
624
|
const c = cancelledResult(thrownCancelCause);
|
|
607
625
|
settledAsCancel = failureCodeOf(c.terminal) === CANCELLED_CODE;
|
package/dist/security.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export interface SessionRowCellsWriter {
|
|
|
75
75
|
* 而 `DELETE /v1/sessions/:id`(删整条会话)不在其中 —— 同一风险形、爆炸半径**更大**,却没门。
|
|
76
76
|
*
|
|
77
77
|
* 风险形逐字同源(守卫自己的注释):「无 service token + 未开 `ALLOW_UNAUTHED_WRITES`」这一形下
|
|
78
|
-
* fleet 写档(面表 fleet 列的 `dev_open` 格,`owner-faces.ts` 的 `listFilterOf`)判 fleet-wide ⇒
|
|
78
|
+
* fleet 写档(面表 fleet 列的 `dev_open` 格,`owner-faces.ts` 的 `listFilterOf`)判 fleet-wide ⇒ 集群内**任意**不报主体的调用方可对**任意** session 动手(报了主体的调用方只动得到那位主体的,`principal-gate.ts` 的 `actsForDeployment`)。
|
|
79
79
|
* policy 腿担心的是「forged principal 能 tighten/DoS 一个会话的工具」;DELETE 直接把会话删掉。
|
|
80
80
|
*
|
|
81
81
|
* ⇒ 枚举改**族判定**:新增一条破坏性会话路由时自动落进门内,不必记得回来加白名单。
|
|
@@ -135,7 +135,7 @@ export type OwnerAwareSessionStore = SessionStore & {
|
|
|
135
135
|
register?: (sessionId: string, owner: string | null) => Promise<void>;
|
|
136
136
|
/** [ref] placed 分区的元组读口(店的既有读口,一行 PK 读;`undefined` = 普通会话或无此行)。店不交它 = 不实现 placement = 没有 placed 行(无 repo 的内存店)。两个读者:
|
|
137
137
|
* ① 会话面的属主门只在属主为 NULL 时读它一次(无主的 placed 行不是公共行,`http/principal-gate.ts` 的 `sessionOwnerCellOf`);
|
|
138
|
-
* ② `agent` 的唯一读口 `
|
|
138
|
+
* ② `agent` 的唯一读口 `http/owner-access.ts` 的 `readSessionAgent`(会话视图体顶层、运维审批队列的停驻行同读):店没有这一面 ⇒ 键缺席,读面不凭别处另铸子代身份。 */
|
|
139
139
|
placementOf?: (sessionId: string) => Promise<SessionPlacementRecord | undefined>;
|
|
140
140
|
/** E16 — enumerate the caller's sessions (owner-filtered on the session store's OWN owner column).
|
|
141
141
|
* `includeUnowned` = [ref] 窄互认第二臂的**第三条件**(`owner IS NULL`)的 SQL 承载位:置真时
|
|
@@ -190,7 +190,7 @@ export type OwnerAwareSessionStore = SessionStore & {
|
|
|
190
190
|
/** 执行席(规则在 `execution-placement.ts`):根会话行上这一位住客的那一格的唯一读口(`read`)与 place / markMirror 两只写口。三店都有;两只包装原样转发。
|
|
191
191
|
* 缺席 = 会话店没有执行放置(只有不带它的测试走廊 / 嵌入形),调用方各按自己的缺席臂处置。 */
|
|
192
192
|
executionPlacement?: ExecutionPlacementSeat;
|
|
193
|
-
/**
|
|
193
|
+
/** **「被占着」的头读**(读者:`DELETE /v1/sessions/:id` 的属主门 · 认领面 · 同步推送三口的门 —— 都问「这个 id 被占着吗」,经 `session-incarnation.ts` 的 `deletionHeadReadOf` 一只取法):
|
|
194
194
|
* 活行 = {@link headOf} 同答;外加在删的行(会话三态 活 → 在删 → 没了 的中间一态,律在 `session-deletion.ts`;local 另有删序停在第一步之后的标记格)的属主与住客 ——
|
|
195
195
|
* 开始删它的那位属主重发删除(= 接管)就收得完,别的属主得到与「不在」同一句(不可探测)。三只店都交。 */
|
|
196
196
|
deletionHeadOf?: (sessionId: string) => Promise<SessionHead | undefined>;
|