@sema-agent/server 7.138.0 → 7.140.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 +457 -7
- package/README.md +7 -4
- package/README.zh-CN.md +6 -4
- package/USAGE.md +91 -41
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/lib/lanes.json +3 -2
- package/dist/adoption/runner.js +1 -1
- package/dist/adoption/sql.js +1 -1
- package/dist/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +26 -26
- package/dist/bench/s1/arms.d.ts +1 -1
- package/dist/bench/s1/arms.js +1 -3
- package/dist/bench/s1/live-deps.js +3 -2
- package/dist/bench/s1/row.d.ts +5 -2
- package/dist/bench/s1/row.js +2 -22
- package/dist/bench/s1/run-firm.js +2 -2
- package/dist/boot/adoption.js +1 -1
- package/dist/boot/device-lane.d.ts +8 -3
- package/dist/boot/device-lane.js +7 -2
- package/dist/boot/execution-env.d.ts +4 -2
- package/dist/boot/execution-env.js +28 -34
- package/dist/boot/execution-lane.d.ts +9 -1
- package/dist/boot/execution-lane.js +6 -1
- package/dist/boot/governance-seams.d.ts +3 -2
- package/dist/boot/governance-seams.js +9 -11
- package/dist/boot/memory-boundary.d.ts +14 -51
- package/dist/boot/memory-boundary.js +10 -20
- package/dist/boot/memory-consolidation.d.ts +15 -11
- package/dist/boot/memory-consolidation.js +25 -14
- package/dist/boot/resolve-spec.d.ts +4 -6
- package/dist/boot/resolve-spec.js +10 -13
- package/dist/boot/retention-lane.d.ts +5 -5
- package/dist/boot/retention-lane.js +0 -6
- package/dist/boot/runner-deps.d.ts +6 -4
- package/dist/boot/runner-deps.js +3 -1
- package/dist/boot/session-faces.d.ts +0 -3
- package/dist/boot/session-faces.js +15 -8
- package/dist/boot/stage-02-web-admin-pull.js +2 -2
- package/dist/boot/stage-03-store-backend.d.ts +2 -6
- package/dist/boot/stage-03-store-backend.js +2 -3
- package/dist/boot/stage-04-stores.d.ts +2 -6
- package/dist/boot/stage-04-stores.js +5 -5
- package/dist/boot/stage-05-execution-env.d.ts +2 -6
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +2 -6
- package/dist/boot/stage-06-runners.js +2 -3
- package/dist/boot/stage-07-capability-layer.d.ts +2 -6
- package/dist/boot/stage-08-reapers.d.ts +2 -6
- package/dist/boot/stage-09-leader.d.ts +2 -6
- package/dist/boot/stage-09-leader.js +1 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -6
- package/dist/boot/stage-10-http-server.js +7 -6
- package/dist/boot/stores.d.ts +3 -6
- package/dist/boot/stores.js +27 -40
- package/dist/boot/task-list-lane.d.ts +1 -1
- package/dist/boot/task-list-lane.js +1 -1
- package/dist/boot/web-admin.js +37 -11
- package/dist/capabilities/execution-lane.d.ts +2 -2
- package/dist/capabilities/mcp-probe.js +1 -1
- package/dist/capabilities/scenarios.d.ts +1 -1
- package/dist/capability-facts.d.ts +15 -7
- package/dist/capability-facts.js +8 -3
- package/dist/config-catalog.js +9 -8
- package/dist/config-invariants.d.ts +23 -3
- package/dist/config-invariants.js +42 -0
- package/dist/config-provider.d.ts +33 -37
- package/dist/config-provider.js +51 -30
- package/dist/config-types.d.ts +21 -7
- package/dist/config.d.ts +33 -0
- package/dist/config.js +46 -16
- package/dist/delegated-session-owner.d.ts +4 -3
- package/dist/delegated-session-owner.js +1 -1
- package/dist/deployment-shape.d.ts +10 -9
- package/dist/deployment-shape.js +4 -4
- package/dist/device-enrollment.d.ts +41 -2
- package/dist/device-enrollment.js +27 -12
- package/dist/device-store.d.ts +58 -85
- package/dist/device-store.js +19 -49
- package/dist/device-ws-hub.js +2 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -4
- package/dist/exec-cut.d.ts +60 -0
- package/dist/exec-cut.js +36 -0
- package/dist/execution-lane-caps.d.ts +115 -105
- package/dist/execution-lane-caps.js +76 -82
- package/dist/execution-placement.d.ts +259 -0
- package/dist/execution-placement.js +199 -0
- package/dist/field-conflict.d.ts +3 -2
- package/dist/field-conflict.js +1 -0
- package/dist/hosted-posture.d.ts +2 -2
- package/dist/http/admission.js +8 -19
- package/dist/http/checkpoint-ctx.d.ts +21 -12
- package/dist/http/checkpoint-ctx.js +4 -2
- package/dist/http/claimed-run.d.ts +1 -1
- package/dist/http/durable-run-leg.js +9 -5
- package/dist/http/execution-context.d.ts +218 -0
- package/dist/http/execution-context.js +330 -0
- package/dist/http/memory-compliance-failure-reply.d.ts +3 -1
- package/dist/http/memory-compliance-failure-reply.js +5 -0
- package/dist/http/memory-layer-reply.d.ts +30 -0
- package/dist/http/memory-layer-reply.js +24 -0
- package/dist/http/resume-legs.js +63 -36
- package/dist/http/retired-service-deps.d.ts +1 -1
- package/dist/http/retired-service-deps.js +1 -1
- package/dist/http/route-ctx.d.ts +14 -8
- package/dist/http/routes/adoption.js +1 -1
- package/dist/http/routes/background.d.ts +29 -1
- package/dist/http/routes/background.js +29 -2
- package/dist/http/routes/devices.d.ts +13 -19
- package/dist/http/routes/devices.js +21 -26
- package/dist/http/routes/memory-bundle.js +3 -0
- package/dist/http/routes/memory-compliance.js +8 -1
- package/dist/http/routes/memory-consolidation.js +12 -1
- package/dist/http/routes/memory-origin.js +14 -2
- package/dist/http/routes/memory-policy.js +5 -0
- package/dist/http/routes/session-sync.js +110 -15
- package/dist/http/routes/sessions.d.ts +6 -0
- package/dist/http/routes/sessions.js +143 -22
- package/dist/http/routes/side-query.d.ts +12 -4
- package/dist/http/routes/side-query.js +4 -5
- package/dist/http/routes/tasks.js +41 -33
- package/dist/http/server.d.ts +40 -44
- package/dist/http/server.js +13 -2
- package/dist/http/session-inherit-env.d.ts +3 -4
- package/dist/http/session-inherit-env.js +1 -1
- package/dist/http/wire-types.d.ts +8 -12
- package/dist/identity-source.d.ts +1 -1
- package/dist/identity-source.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lane-home-probe.d.ts +68 -42
- package/dist/lane-home-probe.js +53 -30
- package/dist/leader/wire.js +5 -4
- package/dist/memory-bundle-engine.d.ts +16 -9
- package/dist/memory-bundle-engine.js +29 -6
- package/dist/memory-operator-faces.d.ts +85 -30
- package/dist/memory-operator-faces.js +136 -30
- package/dist/memory-project-layer.d.ts +3 -21
- package/dist/memory-project-layer.js +11 -8
- package/dist/memory-scope-stores.d.ts +73 -0
- package/dist/memory-scope-stores.js +86 -0
- package/dist/memory-scope.d.ts +29 -5
- package/dist/memory-scope.js +16 -4
- package/dist/memory-sync-client.d.ts +70 -18
- package/dist/memory-sync-client.js +215 -117
- package/dist/memory-sync.d.ts +1 -1
- package/dist/memory-sync.js +3 -2
- package/dist/observability/cost-taxonomy.d.ts +2 -2
- package/dist/observability/fail-open.d.ts +12 -0
- package/dist/observability/fail-open.js +12 -0
- package/dist/observability/run-terminal.js +0 -1
- package/dist/orchestration/workflow-notify-journal.js +4 -4
- package/dist/org-memory-admission.d.ts +4 -3
- package/dist/org-memory-admission.js +6 -6
- package/dist/parked-decide.d.ts +34 -9
- package/dist/parked-decide.js +12 -19
- package/dist/parked-revive-surface.d.ts +12 -15
- package/dist/parked-revive-surface.js +3 -6
- package/dist/peer-seat.d.ts +13 -7
- package/dist/peer-seat.js +37 -3
- package/dist/plugins/adoption-log-sql.js +4 -4
- package/dist/plugins/approval-ask-store-file.d.ts +7 -0
- package/dist/plugins/approval-ask-store-file.js +11 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +6 -0
- package/dist/plugins/approval-ask-store-memory.js +12 -0
- package/dist/plugins/approval-ask-store-sql.d.ts +22 -5
- package/dist/plugins/approval-ask-store-sql.js +44 -26
- package/dist/plugins/approval-nonce-store.js +4 -4
- package/dist/plugins/blob-backend.d.ts +4 -4
- package/dist/plugins/blob-backend.js +7 -7
- package/dist/plugins/breaker-state-sql.js +2 -2
- package/dist/plugins/caching-session-store.d.ts +6 -2
- package/dist/plugins/caching-session-store.js +9 -3
- package/dist/plugins/checkpoint-index-columns.js +2 -2
- package/dist/plugins/checkpoint-store-sql.d.ts +6 -5
- package/dist/plugins/checkpoint-store-sql.js +21 -23
- package/dist/plugins/device-store-sql.d.ts +25 -51
- package/dist/plugins/device-store-sql.js +68 -122
- package/dist/plugins/ensure-index.d.ts +1 -2
- package/dist/plugins/execution-placement-sql.d.ts +151 -0
- package/dist/plugins/execution-placement-sql.js +223 -0
- package/dist/plugins/file-history-store-sql.d.ts +9 -8
- package/dist/plugins/file-history-store-sql.js +9 -9
- package/dist/plugins/file-run-store.d.ts +6 -1
- package/dist/plugins/file-run-store.js +4 -0
- package/dist/plugins/fork-routing-session-store.d.ts +6 -0
- package/dist/plugins/fork-routing-session-store.js +16 -0
- package/dist/plugins/image-bake-store-sql.js +9 -9
- package/dist/plugins/image-index-sql.js +11 -11
- package/dist/plugins/leader-run-store-sql.js +4 -4
- package/dist/plugins/local-session-store.d.ts +149 -50
- package/dist/plugins/local-session-store.js +382 -107
- package/dist/plugins/mailbox-store-sql.d.ts +2 -1
- package/dist/plugins/mailbox-store-sql.js +4 -4
- package/dist/plugins/memory-engine-tidb.js +5 -5
- package/dist/plugins/memory-key-guards.d.ts +4 -0
- package/dist/plugins/memory-key-guards.js +1 -0
- package/dist/plugins/memory-optout-grant-store-sql.js +1 -1
- package/dist/plugins/memory-run-store.d.ts +1 -1
- package/dist/plugins/memory-sync-store-tidb.js +3 -3
- package/dist/plugins/one-time-migrations.d.ts +117 -8
- package/dist/plugins/one-time-migrations.js +408 -38
- package/dist/plugins/org-delivery-quota-store.js +2 -2
- package/dist/plugins/outcome-ledger-sql.d.ts +2 -2
- package/dist/plugins/outcome-ledger-sql.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +17 -19
- package/dist/plugins/permission-rule-store-sql.js +29 -32
- package/dist/plugins/pg-pool.d.ts +7 -3
- package/dist/plugins/pg-session-storage.d.ts +31 -20
- package/dist/plugins/pg-session-storage.js +120 -52
- package/dist/plugins/remote-env-adb.d.ts +18 -19
- package/dist/plugins/remote-env-adb.js +91 -66
- package/dist/plugins/remote-env-device.d.ts +23 -31
- package/dist/plugins/remote-env-device.js +19 -17
- package/dist/plugins/remote-env-e2b.d.ts +27 -21
- package/dist/plugins/remote-env-e2b.js +91 -45
- package/dist/plugins/remote-env-file-error.d.ts +3 -1
- package/dist/plugins/remote-env-file-error.js +9 -3
- package/dist/plugins/remote-env-host.d.ts +31 -34
- package/dist/plugins/remote-env-host.js +91 -72
- package/dist/plugins/remote-env-k8s.d.ts +13 -29
- package/dist/plugins/remote-env-k8s.js +63 -55
- package/dist/plugins/remote-env-local-docker.d.ts +24 -12
- package/dist/plugins/remote-env-local-docker.js +49 -61
- package/dist/plugins/remote-env-ssh.d.ts +11 -19
- package/dist/plugins/remote-env-ssh.js +74 -57
- package/dist/plugins/remote-shell.d.ts +100 -3
- package/dist/plugins/remote-shell.js +166 -2
- package/dist/plugins/resume-anchor-store-sql.js +2 -2
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.js +2 -2
- package/dist/plugins/retention-store-sql.d.ts +10 -7
- package/dist/plugins/retention-store-sql.js +13 -7
- package/dist/plugins/run-store-sql.d.ts +13 -3
- package/dist/plugins/run-store-sql.js +20 -15
- package/dist/plugins/schema-consistency.d.ts +21 -11
- package/dist/plugins/schema-consistency.js +15 -9
- package/dist/plugins/schema-drift-sentence.d.ts +27 -0
- package/dist/plugins/schema-drift-sentence.js +38 -0
- package/dist/plugins/schema-ensure-legs.d.ts +2 -3
- package/dist/plugins/schema-ensure-legs.js +2 -2
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.js +1 -1
- package/dist/plugins/session-fork.d.ts +54 -0
- package/dist/plugins/session-fork.js +38 -1
- package/dist/plugins/session-row-sql.d.ts +22 -0
- package/dist/plugins/session-row-sql.js +81 -0
- package/dist/plugins/session-rules-column.d.ts +1 -1
- package/dist/plugins/session-rules-column.js +1 -1
- package/dist/plugins/session-store.d.ts +1 -1
- package/dist/plugins/session-workspace-cell.d.ts +1 -1
- package/dist/plugins/session-workspace-cell.js +1 -1
- package/dist/plugins/shared-memory-store-sql.js +2 -2
- package/dist/plugins/sql-driver.d.ts +10 -5
- package/dist/plugins/sql-driver.js +6 -6
- package/dist/plugins/sql-errors.js +1 -1
- package/dist/plugins/store-backend.d.ts +5 -7
- package/dist/plugins/store-backend.js +23 -11
- package/dist/plugins/store-contracts.d.ts +25 -5
- package/dist/plugins/task-list-store-sql.js +11 -11
- package/dist/plugins/tidb-pool.d.ts +12 -7
- package/dist/plugins/tidb-pool.js +13 -7
- package/dist/plugins/tidb-session-storage.js +4 -4
- package/dist/plugins/tidb-session-store.d.ts +57 -26
- package/dist/plugins/tidb-session-store.js +127 -59
- package/dist/plugins/tool-result-store-sql.d.ts +5 -4
- package/dist/plugins/tool-result-store-sql.js +21 -13
- package/dist/plugins/user-input-ledger-sql.js +2 -2
- package/dist/plugins/workflow-journal-store-sql.js +5 -5
- package/dist/plugins/workflow-run-store-sql.js +19 -19
- package/dist/plugins/write-behind-counter.d.ts +2 -3
- package/dist/plugins/write-behind-counter.js +5 -5
- package/dist/project-memory.d.ts +9 -15
- package/dist/project-memory.js +5 -4
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +6 -7
- package/dist/request-value-closure.js +1 -3
- package/dist/resource-suspend.d.ts +14 -12
- package/dist/resource-suspend.js +1 -1
- package/dist/resource-window.d.ts +4 -3
- package/dist/run-local.d.ts +6 -0
- package/dist/run-local.js +34 -35
- package/dist/runs.d.ts +10 -5
- package/dist/runs.js +52 -66
- package/dist/security.d.ts +38 -12
- package/dist/security.js +8 -2
- package/dist/server-secret-env.d.ts +9 -5
- package/dist/session-children-retire.d.ts +27 -9
- package/dist/session-children-retire.js +9 -5
- package/dist/session-incarnation.d.ts +20 -10
- package/dist/session-incarnation.js +5 -3
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-row.d.ts +114 -5
- package/dist/session-row.js +55 -5
- package/dist/session-titler.d.ts +2 -2
- package/dist/sql-engine-posture.d.ts +1 -1
- package/dist/sql-engine-posture.js +1 -1
- package/dist/{plugins → stores-sql}/background-agent-store-sql.d.ts +2 -2
- package/dist/{plugins → stores-sql}/background-agent-store-sql.js +8 -8
- package/dist/{plugins → stores-sql}/session-policy-store-sql.d.ts +7 -5
- package/dist/{plugins → stores-sql}/session-policy-store-sql.js +12 -12
- package/dist/{plugins → stores-sql}/usage-window-store-sql.d.ts +1 -1
- package/dist/{plugins → stores-sql}/usage-window-store-sql.js +3 -3
- package/dist/task-a2a.d.ts +1 -1
- package/dist/task-a2a.js +5 -6
- package/dist/task-cwd.d.ts +6 -1
- package/dist/task-mcp.d.ts +22 -9
- package/dist/task-mcp.js +17 -9
- package/dist/terminal.d.ts +27 -0
- package/dist/terminal.js +6 -0
- package/dist/tool-approval.d.ts +6 -0
- package/dist/tool-approval.js +8 -1
- package/dist/trace/project.d.ts +1 -0
- package/dist/trace/project.js +1 -0
- package/dist/trace/redact.d.ts +3 -1
- package/dist/trace/redact.js +80 -28
- package/dist/trace/self-minted-wire.d.ts +169 -2
- package/dist/trace/self-minted-wire.js +54 -1
- package/dist/url-refusal.d.ts +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +17 -3
- package/dist/web-admin-client/apply-effective.js +20 -10
- package/dist/web-admin-client/candidate-gate.d.ts +11 -7
- package/dist/web-admin-client/candidate-gate.js +1 -1
- package/dist/web-admin-client/http-client.d.ts +5 -4
- package/dist/web-admin-client/http-client.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +7 -17
- package/dist/web-admin-client/read-warnings.js +5 -9
- package/dist/web-admin-client/skills-mcp.js +3 -2
- package/dist/web-admin-client/types.d.ts +6 -0
- package/package.json +3 -3
- package/wire-changes/server@7.139.0.json +348 -0
- package/wire-changes/server@7.140.0.json +184 -0
- package/dist/http/device-placement.d.ts +0 -175
- package/dist/http/device-placement.js +0 -145
package/dist/http/server.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
|
-
import type { MemoryComplianceFaces } from "../memory-operator-faces.js";
|
|
2
|
+
import type { MemoryComplianceFaces, MemoryOriginFaces, SessionMemoryStatusFace } from "../memory-operator-faces.js";
|
|
3
3
|
import type { SideQueryAccounting } from "../budget.js";
|
|
4
4
|
import type { IncomingMessage } from "node:http";
|
|
5
|
-
import { type Runner, type TaskSpec, type TaskResult, type WorkflowRunStore, type MemoryEntry, type MemoryExportBundle, type MemoryImportReport, type
|
|
5
|
+
import { type Runner, type TaskSpec, type TaskResult, type WorkflowRunStore, type MemoryEntry, type MemoryExportBundle, type MemoryImportReport, type ConsolidationRunReceipt, type ConsolidationDriverRunRow, type SideQuerySpec, type SideQueryResult, type Brain, type EngineNotice } from "@sema-agent/core";
|
|
6
6
|
import type { TaskRequestBody } from "./wire-types.js";
|
|
7
7
|
import type { ServiceConfig } from "../config-types.js";
|
|
8
8
|
import { type SessionMirrorRuling } from "../web-admin-client/facade.js";
|
|
9
9
|
import type { RestartSignal } from "@sema-agent/settings-schema/fleet";
|
|
10
10
|
import { type OwnerAwareSessionStore } from "../security.js";
|
|
11
11
|
import type { PeerDesk, PeerLease } from "../peer-seat.js";
|
|
12
|
+
import type { ExecutionRoot, ResolvedTaskSpec } from "./execution-context.js";
|
|
12
13
|
import type { RunStore, ImageIndex, ImageBake, CheckpointStoreFull, ResumeAnchorStore, ApprovalExemptionStore, ApprovalNonceStore, ServiceSessionPolicyStore, ServiceFileHistoryStore, ToolResultStoreFull, StoreBackend } from "../plugins/store-backend.js";
|
|
13
14
|
import type { RuleConsentLane } from "../rules-consent.js";
|
|
14
15
|
import { type MemorySyncRequest, type MemorySyncResponse } from "../memory-sync.js";
|
|
@@ -52,6 +53,8 @@ export interface RequestAuth {
|
|
|
52
53
|
* defaultScopes(memory.scopes 种子)。resume 腿(checkpoint 重建 auth)缺席 — 回落持久化的
|
|
53
54
|
* body.projectId(原始提交已验形),那条回落腿自己再折一次小写,两腿查同一个键。 */
|
|
54
55
|
resolvedProjectId?: string;
|
|
56
|
+
/** authorizer 判过的头(`security.ts` `createAuthorizer` 交出;语义见 `AuthContext.head`)⇒ fresh 执行上下文的 `judged`。自建 authorizer 不给 = 解析器不比住客。 */
|
|
57
|
+
head?: import("@sema-agent/core").SessionHead;
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
57
60
|
* [ref] A8 —— ServiceDeps 的**分组窄接口**。
|
|
@@ -60,7 +63,7 @@ export interface RequestAuth {
|
|
|
60
63
|
* 平铺形的直接后果 = main.ts 一个上千行的装配字面量,键与键之间没有任何「属于同一件事」的编译期表达,
|
|
61
64
|
* 键落错家/从未接线只能靠源码钉逐个盯(1.300/1.301/1.304/1.307/1.310 五起真缺陷都是这个病族)。
|
|
62
65
|
*
|
|
63
|
-
* 药:七个**窄**接口 +
|
|
66
|
+
* 药:七个**窄**接口 + 顶层必填八件。装配点按组构造(每组一个带类型标注的中间 const ⇒ 受 TS 多余
|
|
64
67
|
* 属性检查保护),键放错组当场编译红。
|
|
65
68
|
*
|
|
66
69
|
* 兼容形(本批**不动消费点**):`ServiceDeps` = 平铺视图 ∩ 组槽。旧的平铺构造(96 个测试文件 +
|
|
@@ -68,8 +71,8 @@ export interface RequestAuth {
|
|
|
68
71
|
* 入口摊平回平铺视图,server.ts 内的 ~700 处 `deps.x` 消费点原样保留。消费点迁移是后批的事——
|
|
69
72
|
* 一步到位需要同批改 ~700 处 src + ~800 处 test 键位,与「先立形、后搬家」相比没有额外收益。
|
|
70
73
|
*/
|
|
71
|
-
/** createHttpServer
|
|
72
|
-
*
|
|
74
|
+
/** createHttpServer 的**必填八件**——引擎、部署配置、提交的身份与根会话(authorizer)、请求→TaskSpec 的映射、选路席、side-query 执行席、读口场景门、对端座的 desk。
|
|
75
|
+
* 八者恒在场,故留在顶层(不进任何可选组):没有它们 server 根本起不来,包一层可选组只会把编译期
|
|
73
76
|
* 错误推迟到运行期(本仓 E-HIGH-1 病族的成因就是「可选键从未接线、编译期无声」)。 */
|
|
74
77
|
export interface ServiceCoreDeps {
|
|
75
78
|
runner: Runner;
|
|
@@ -83,9 +86,22 @@ export interface ServiceCoreDeps {
|
|
|
83
86
|
sideQuery: (spec: SideQuerySpec) => Promise<SideQueryResult>;
|
|
84
87
|
config: ServiceConfig;
|
|
85
88
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
+
* Resolve identity + the owned root session BEFORE the spec is built (S6). Throw `HttpError` to reject.
|
|
90
|
+
* 🔴 **必填**:它是一次提交的根会话**唯一**的来源与铸点(体里的 `sessionId` 只由它消费:有属主读的店判属主,单用户嵌入原样采用,
|
|
91
|
+
* 不带 ⇒ 现铸并登记)。省掉是编译错;绕过类型造的 deps 在 {@link createHttpServer} 入口拒启。单用户嵌入传
|
|
92
|
+
* `createAuthorizer(config, runner.sessions)`(包根导出)—— 店没有属主读时它退化为只派 principal 与会话 id。
|
|
93
|
+
*/
|
|
94
|
+
authorize: (ctx: {
|
|
95
|
+
req: IncomingMessage;
|
|
96
|
+
body: TaskRequestBody;
|
|
97
|
+
}) => Promise<RequestAuth>;
|
|
98
|
+
/**
|
|
99
|
+
* Map an inbound request body + resolved auth to a TaskSpec. The SERVICE/deployment owns model
|
|
100
|
+
* + tools + mcp here (callers only supply content). `auth` carries the principal-derived memory scope —
|
|
101
|
+
* prefer it over anything in the body.
|
|
102
|
+
* The root session is NOT the resolver's to write: the return type carries no `sessionId`
|
|
103
|
+
* (`ResolvedTaskSpec`); the server stamps the root the authorizer resolved onto every spec it executes
|
|
104
|
+
* (`http/execution-context.ts` `stampSpecRoot`). A resolver that needs the root reads `opts.execution.root`.
|
|
89
105
|
*/
|
|
90
106
|
/** `opts.leg` (codex R4, appendSystemPrompt 案): "fresh" ⇒ a NEW submit — resolveSpec may fail-loud 400 on
|
|
91
107
|
* combos that would silently discard caller payload (append rider / outputStyle on an append-less pack).
|
|
@@ -108,6 +124,8 @@ export interface ServiceCoreDeps {
|
|
|
108
124
|
* `opts.unattendedLeg`([ref] 候裁 18,codex r3 F1;[ref] ① 改形):续跑家族在 ctx 带无人值守标(`CheckpointCtx.unattendedLeg`)时递 `true` ——
|
|
109
125
|
* 装配器在**全部折叠之后**经首跑同一只合并口 `withUnattendedLeg` 重挂那条腿(`default` + 按类作答的 onAsk)。只由续跑腿
|
|
110
126
|
* 按服务端写的 ctx 位递,绝不从请求体读。 */
|
|
127
|
+
/** `opts.execution`(必填):这条腿的执行上下文(`http/execution-context.ts`;只 `fresh` / `continuation` 两形,`root` 恒在)。装配器要用这条腿的根会话
|
|
128
|
+
* (场景设施的分区键、受理见证)读 `opts.execution.root` —— 它与 server 随后盖进 spec 的根是同一个值,装配器自己不写根。 */
|
|
111
129
|
/** `opts.lease`(必填):这条腿的**宿主租约** —— 装配在它之下登记本腿交给引擎的对端声明(`peerDesk.declare(草稿, opts.lease)`)。
|
|
112
130
|
* 租约由两只漏斗(受理 `prepareSpec` / 续跑 `resolveResumeSpecOrBlocked`)在调用本函数**之前**开、由漏斗的失败出口或拿到产物的那段作用域放;
|
|
113
131
|
* 装配只借用,不放、不留。实现方自铸的声明归自己的 desk 时可以不理它。 */
|
|
@@ -117,7 +135,8 @@ export interface ServiceCoreDeps {
|
|
|
117
135
|
onNotice?: (notice: EngineNotice) => void;
|
|
118
136
|
unattendedLeg?: true;
|
|
119
137
|
lease: PeerLease;
|
|
120
|
-
|
|
138
|
+
execution: ExecutionRoot;
|
|
139
|
+
}) => ResolvedTaskSpec | Promise<ResolvedTaskSpec>;
|
|
121
140
|
/**
|
|
122
141
|
* [ref] 场景 hands lane 选路:按 `resolveSpec` 刚产出的 TaskSpec 取本任务的执行 Runner。
|
|
123
142
|
* 装配点(`boot/stage-10-http-server.ts`)传的是 `createHandsRunnerSelector` —— 选路规则只有那一份实现,
|
|
@@ -146,7 +165,7 @@ export interface ServiceCoreDeps {
|
|
|
146
165
|
* 本层用它开**宿主租约**:受理与续跑两只漏斗在装配之前各开一只(`lease("fresh")` / `lease("resume")`),经 `resolveSpec` 的 `opts.lease` 交给装配,
|
|
147
166
|
* 随产物(`PreparedTaskSubmission.peerLease` / 续跑结果)交给拿到它的那段作用域,在那段作用域的 `finally` 放;活过那段作用域的驱动经 `heldFor` 自持一只。
|
|
148
167
|
* 这只 desk 另有三处用法,不止这两只漏斗:① 探测口 `POST /v1/capabilities/mcp/probe` 的调用方臂在走查里开一只 `probe` 租约(三道前置拒之后开,拨号落地才放);
|
|
149
|
-
* ② 两张会话面板(`GET /v1/sessions/:id/mcp` · `…/a2a`)与探测走查拨名册声明时递它的座(`desk.seat
|
|
168
|
+
* ② 两张会话面板(`GET /v1/sessions/:id/mcp` · `…/a2a`)与探测走查拨名册声明时递它的座(`desk.seat`),不开租约;③ 名册声明在起服时登记在一只进程寿命的 `roster` 租约下
|
|
150
169
|
* (stage-07 / run-local 开,从不放),并且每只 Runner 的 `peerSeat` 是它的座。登记表的两个读数是 `/metrics` 的 `peer_registry_entries` / `peer_registry_holders`。
|
|
151
170
|
* 🔴 **必填**:没有 MCP / A2A 凭据的嵌入也给一只 `createPeerDesk()`(零 IO)—— 一个部署只有一张登记表,缺席不是「没有座」的另一种读法。
|
|
152
171
|
*/
|
|
@@ -371,7 +390,7 @@ export interface ServiceSeamDeps {
|
|
|
371
390
|
deviceStore?: import("../device-store.js").DeviceStore;
|
|
372
391
|
/**
|
|
373
392
|
* [ref](车C 余件):device lane 的**准入链**(`createDeviceEnrollment`)—— 管理面三个写动词
|
|
374
|
-
* (签发 / 注册 / 吊销)与首绑写协议(`
|
|
393
|
+
* (签发 / 注册 / 吊销)与首绑写协议(`commitExecutionContext` 的设备那一支)的**唯一**判据属主。
|
|
375
394
|
*
|
|
376
395
|
* 🔴 为什么路由拿的是它而不是 {@link deviceStore}:enrollment 那一层持着两件路由造不出来的东西 ——
|
|
377
396
|
* ①跨副本限速座(`DeviceEnrollRateLimiter`,§7-T5 ⑤:端点车**必须**传一个,而它由 boot 从既有
|
|
@@ -499,9 +518,7 @@ export interface ServiceSeamDeps {
|
|
|
499
518
|
* (工厂返 undefined),与 compliance/origin 两族同一条 F-9 裁。
|
|
500
519
|
* 🔴 face 的五键**全可选**(core `SessionMemoryStatus`):absent = 该事实源不可读,路由逐键透传缺席,
|
|
501
520
|
* 恒不铸 false/0 替身;`optOutSource:"fault"` = capture 态 indeterminate(383 片2/3 轴直投)。 */
|
|
502
|
-
sessionMemoryStatus?:
|
|
503
|
-
status: (sessionId: string) => Promise<SessionMemoryStatus>;
|
|
504
|
-
};
|
|
521
|
+
sessionMemoryStatus?: SessionMemoryStatusFace;
|
|
505
522
|
/**
|
|
506
523
|
* [ref](core 7.22.0 [ref] W1)—— 本**部署**的自动整理武装事实,`GET /v1/sessions/:id/memory-status`
|
|
507
524
|
* 的 `autoConsolidationArmed` 格。
|
|
@@ -533,25 +550,7 @@ export interface ServiceSeamDeps {
|
|
|
533
550
|
* ——落在副本本地盘上 = pod 重建即永久丢失。全文见 src/memory-operator-faces.ts 头注。
|
|
534
551
|
* 🔴 `listClearances` 是**同步**的(core 的读面就是一次严格 sidecar 读),且账本损坏时**抛**
|
|
535
552
|
* `ControlPlaneCorruptError` —— 那是 fail-closed 信号,不是空数组。 */
|
|
536
|
-
memoryOriginFace?:
|
|
537
|
-
listExternal: (scopes: readonly string[]) => Promise<Array<{
|
|
538
|
-
id: string;
|
|
539
|
-
slug: string;
|
|
540
|
-
scope: string;
|
|
541
|
-
origin: MemoryEntryOrigin;
|
|
542
|
-
provenance: EntryProvenanceAccount;
|
|
543
|
-
}>>;
|
|
544
|
-
listClearances: () => OriginClearanceRow[];
|
|
545
|
-
clear: (entryId: string, input: {
|
|
546
|
-
requestId: string;
|
|
547
|
-
reason: string;
|
|
548
|
-
}) => Promise<{
|
|
549
|
-
entryId: string;
|
|
550
|
-
clearanceId: string;
|
|
551
|
-
origin: MemoryEntryOrigin;
|
|
552
|
-
landedSlug: string;
|
|
553
|
-
}>;
|
|
554
|
-
};
|
|
553
|
+
memoryOriginFace?: MemoryOriginFaces;
|
|
555
554
|
/** [ref](core 5.58.0 `runMemoryConsolidationDriver`):记忆 **consolidation 阀门**的操作面。
|
|
556
555
|
* 启用 `POST /v1/admin/memory/consolidation/run` 与 `GET /v1/admin/memory/consolidation`(两口 operator-only)。
|
|
557
556
|
* main.ts 把它接到 `createMemoryConsolidationFaces` 的产物上。
|
|
@@ -598,6 +597,9 @@ export interface ServiceSeamDeps {
|
|
|
598
597
|
* per-principal 查询走 caps client 的 executionRuling 同车(零额外 RTT);absent = 无 center(单用户/
|
|
599
598
|
* dry-run)⇒ 观测面不接线,零行为差。fail-open:观测失败绝不影响 sync 面本身。 */
|
|
600
599
|
sessionMirrorRuling?: (principal: string | undefined) => Promise<SessionMirrorRuling | undefined>;
|
|
600
|
+
/** 主体的执行车道裁定(caps client 的 `executionRuling`,与场景裁定同车零额外 RTT)—— 执行上下文解析器步 ③ 的唯一输入(`http/execution-context.ts`,
|
|
601
|
+
* 判据 `runtime-caps-resolver.ts` `gateExecutionLane`)。缺席 = 无中心(单用户 / dry-run / 嵌入方)⇒ 不判,与已发同。 */
|
|
602
|
+
executionRuling?: (principal: string | undefined) => Promise<import("../web-admin-client/facade.js").ExecutionRuling | undefined>;
|
|
601
603
|
/** Degenerate-output a/b instrument: on errorCode=output.degenerate, inspect the session's turns to
|
|
602
604
|
* classify where the salvageable answer was (counter + log). Fire-and-forget; no-op otherwise. */
|
|
603
605
|
instrumentDegenerate?: (result: TaskResult) => void;
|
|
@@ -606,7 +608,9 @@ export interface ServiceSeamDeps {
|
|
|
606
608
|
* (手搭测试 deps;生产 main.ts 恒传)。 */
|
|
607
609
|
sideQueryAccounting?: SideQueryAccounting;
|
|
608
610
|
/** [ref](core 7.32.0):parked 赎回面工厂(按行解析驱动哪只 Agent 工具 + 同出一张列表的继承座;属主 `parked-revive-surface.ts`)。
|
|
609
|
-
* 缺席 = 这台部署没有 park 底座(checkpointStore / backgroundAgentStore 任一缺席),bg 赎回臂不接线。
|
|
611
|
+
* 缺席 = 这台部署没有 park 底座(checkpointStore / backgroundAgentStore 任一缺席),bg 赎回臂不接线。
|
|
612
|
+
* 🔴 **在场 ⇒ `sessionStorage` 必须带执行席 `executionPlacement`**:认领之后对根会话住客的唯一判官是执行席上的写口;缺 ⇒ `createHttpServer` 拒启
|
|
613
|
+
* (句子 = `PARKED_REVIVE_EXECUTION_SEAT_REQUIRED`)。 */
|
|
610
614
|
parkedReviveSurface?: import("../parked-revive-surface.js").ParkedReviveSurfaceFactory;
|
|
611
615
|
/** 可选第三件:revive args 的 `subagent_type` roster 成员集([ref] Q1 成员性规则)。当前生产装配
|
|
612
616
|
* **恒缺席**(boot 内建 default 无自定义 agents roster,per-request 的 spec.agents 不进 boot 工具)
|
|
@@ -641,14 +645,6 @@ export interface ServiceObservabilityDeps {
|
|
|
641
645
|
/** **准入/治理面**:身份解析与配额/限流/租约。每一件都是**拒绝**的权力(400/403/429),
|
|
642
646
|
* 缺席 = 该道门不存在(不是「默认放行的门」——两者在事故复盘里语义完全不同)。 */
|
|
643
647
|
export interface ServiceGovernanceDeps {
|
|
644
|
-
/**
|
|
645
|
-
* Resolve identity + the owned session BEFORE the spec is built (S6). Throw `HttpError` to reject.
|
|
646
|
-
* Optional: when omitted, no principal/ownership enforcement (the body's sessionId is used as-is).
|
|
647
|
-
*/
|
|
648
|
-
authorize?: (ctx: {
|
|
649
|
-
req: IncomingMessage;
|
|
650
|
-
body: TaskRequestBody;
|
|
651
|
-
}) => Promise<RequestAuth>;
|
|
652
648
|
/** 鉴权桥(registry-core api/auth-bridge):registry 用户 JWT → principal。缺席=分支不存在
|
|
653
649
|
* (bearer 只认 SERVICE_AUTH_TOKEN(S),现状不变)。 */
|
|
654
650
|
webAdminJwtVerifier?: {
|
|
@@ -811,7 +807,7 @@ export interface ServiceDeploymentDeps {
|
|
|
811
807
|
* 7.132.0 前这一席是 `sqlEngineFacts: () => SqlEngineFacts | null`(只给事实、不给方言);照旧传它 ⇒ `createHttpServer` 起服拒。
|
|
812
808
|
* 🔴 **SQL 后端在场(`backend` 交出了 `mysqlPool()` / `pgPool()`)⇒ 本席必填**,缺席 ⇒ `createHttpServer` 起服拒(席缺席只表示「没有 SQL 后端」,不能是「忘了给」);
|
|
813
809
|
* 本服务自己的装配(`boot/stores.ts` → `stage-10`)按同一个谓词(`sqlPoolsOf`)建立它,恒给。值形也在起服时判(同一只判官 `sqlEngineSeatIssue` 的另一臂):
|
|
814
|
-
* `{ dialect: "
|
|
810
|
+
* `{ dialect: "mysql" | "pg", facts }`,`facts` 是 `null` 或带 `maxRowBytes` / `maxPacketBytes` / `wallSources` 的引擎事实;只改了键名的 `() => facts` 之类 ⇒ 起服拒。 */
|
|
815
811
|
sqlEngine?: import("../plugins/sql-driver.js").SqlEngineReading;
|
|
816
812
|
/** [ref]:**写保护名表**的姿态(`write-protection.ts` 的 boot 期单一推导点 —— 与递给每只 Runner 的
|
|
817
813
|
* `writeProtectedPaths` 座同一份 config 决定)。两个读面共用:`GET /v1/diagnostics/wiring` 的
|
|
@@ -867,7 +863,7 @@ export interface ServiceDepGroups {
|
|
|
867
863
|
deployment?: ServiceDeploymentDeps;
|
|
868
864
|
knobs?: ServiceKnobDeps;
|
|
869
865
|
}
|
|
870
|
-
/** 平铺视图 =
|
|
866
|
+
/** 平铺视图 = 必填八件 + 其余七组的全可选并集。**派生**自组接口,故与分组形永不漂。 */
|
|
871
867
|
export type FlatServiceDeps = ServiceCoreDeps & Partial<ServiceStoreDeps & ServiceCoordinatorDeps & ServiceSeamDeps & ServiceObservabilityDeps & ServiceGovernanceDeps & ServiceDeploymentDeps & ServiceKnobDeps>;
|
|
872
868
|
/** createHttpServer 的入参:两形皆可(平铺=存量,分组=推荐)。同名键两形都给时,**顶层显式键赢**
|
|
873
869
|
* (含显式 `undefined`)——一处装配点只该用一形,混用时以肉眼最近的那个为准。 */
|
package/dist/http/server.js
CHANGED
|
@@ -4,6 +4,7 @@ import { validatePendingSteer } from "@sema-agent/core";
|
|
|
4
4
|
import {} from "../web-admin-client/facade.js";
|
|
5
5
|
import { describeValueShape } from "@sema-agent/settings-schema";
|
|
6
6
|
import { HttpError } from "../security.js";
|
|
7
|
+
import { SessionForkInProgressError } from "../execution-placement.js";
|
|
7
8
|
import {} from "../memory-sync.js";
|
|
8
9
|
import {} from "../orchestration/workflow-agent-steer.js";
|
|
9
10
|
import {} from "../orchestration/workflow-completion-inbox.js";
|
|
@@ -22,6 +23,7 @@ import { createRequestGuards } from "./request-guards.js";
|
|
|
22
23
|
import { sqlEngineSeatIssue } from "../sql-engine-posture.js";
|
|
23
24
|
import { parkDecisionStoreRefusal } from "../orchestration/workflow-park-decision.js";
|
|
24
25
|
import { CHECKPOINT_CTX_SEALING_REQUIRED } from "./checkpoint-ctx.js";
|
|
26
|
+
import { PARKED_REVIVE_EXECUTION_SEAT_REQUIRED } from "../parked-decide.js";
|
|
25
27
|
import { retiredServiceDepsRefusal } from "./retired-service-deps.js";
|
|
26
28
|
import { createAdmission, MAX_SKILL_CONTENT_CHARS, MAX_SYSTEM_PROMPT_CHARS, MAX_OUTPUT_SCHEMA_CHARS, validateUserSkills } from "./admission.js";
|
|
27
29
|
import { createResumeLegs } from "./resume-legs.js";
|
|
@@ -61,6 +63,9 @@ export function createHttpServer(rawDeps) {
|
|
|
61
63
|
if (typeof deps.runnerFor !== "function") {
|
|
62
64
|
throw new Error("createHttpServer: the runnerFor seat is required (it picks each task's Runner from its execution lane) — pass the hands-lane selector, or `runnerFor: () => runner` for a single-Runner embedding; refusing to start rather than run every task on the widest Runner");
|
|
63
65
|
}
|
|
66
|
+
if (typeof deps.authorize !== "function") {
|
|
67
|
+
throw new Error("createHttpServer: the authorize seat is required — it is the only resolver of a submission's root session; pass `createAuthorizer(config, runner.sessions)` for a single-user embedding; refusing to start rather than run submissions on a root nobody attested");
|
|
68
|
+
}
|
|
64
69
|
{
|
|
65
70
|
const retired = retiredServiceDepsRefusal(deps);
|
|
66
71
|
if (retired !== undefined)
|
|
@@ -71,9 +76,9 @@ export function createHttpServer(rawDeps) {
|
|
|
71
76
|
if (issue !== undefined) {
|
|
72
77
|
switch (issue) {
|
|
73
78
|
case "required":
|
|
74
|
-
throw new Error("createHttpServer: sqlEngine is required when a SQL store backend is wired (the backend hands out a SQL pool) — pass the pool's engine reading as sqlEngine: `{ dialect: \"
|
|
79
|
+
throw new Error("createHttpServer: sqlEngine is required when a SQL store backend is wired (the backend hands out a SQL pool) — pass the pool's engine reading as sqlEngine: `{ dialect: \"mysql\" | \"pg\", facts }` where `facts` is read live (a getter) and is null while the pool's connection setup has not succeeded; refusing to start rather than read the database's row and statement limits as absent and admit task bodies the database cannot store");
|
|
75
80
|
case "bad_shape":
|
|
76
|
-
throw new Error(`createHttpServer: sqlEngine must be the SQL pool's engine reading \`{ dialect: "
|
|
81
|
+
throw new Error(`createHttpServer: sqlEngine must be the SQL pool's engine reading \`{ dialect: "mysql" | "pg", facts }\` where \`facts\` is read live (a getter) and is null while the pool's connection setup has not succeeded, otherwise the engine facts object (maxRowBytes, maxPacketBytes and wallSources included) — got ${typeof deps.sqlEngine === "function" ? "a function (the 7.131.x reader \`() => facts\` goes in as \`{ dialect, get facts() { return f(); } }\`)" : describeValueShape(deps.sqlEngine)}; refusing to start rather than answer every task submission with a 500`);
|
|
77
82
|
default: {
|
|
78
83
|
const unhandled = issue;
|
|
79
84
|
throw new Error(`sqlEngine seat issue without a refusal: ${String(unhandled)}`);
|
|
@@ -88,6 +93,8 @@ export function createHttpServer(rawDeps) {
|
|
|
88
93
|
}
|
|
89
94
|
if (deps.checkpointStore !== undefined && deps.checkpointCtxSealing === undefined)
|
|
90
95
|
throw new Error(`createHttpServer: ${CHECKPOINT_CTX_SEALING_REQUIRED}`);
|
|
96
|
+
if (deps.parkedReviveSurface !== undefined && deps.sessionStorage?.executionPlacement === undefined)
|
|
97
|
+
throw new Error(`createHttpServer: ${PARKED_REVIVE_EXECUTION_SEAT_REQUIRED}`);
|
|
91
98
|
const idemCache = new IdempotencyCache();
|
|
92
99
|
const inflightRuns = new Map();
|
|
93
100
|
const preemptableRuns = new DrainYieldingPreemptBook(() => deps.drainState?.draining === true);
|
|
@@ -164,6 +171,10 @@ export function createHttpServer(rawDeps) {
|
|
|
164
171
|
}
|
|
165
172
|
if (sendSessionError(res, err, "open"))
|
|
166
173
|
return;
|
|
174
|
+
if (err instanceof SessionForkInProgressError) {
|
|
175
|
+
sendError(res, 409, err.code, err.message);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
167
178
|
sendError(res, 500, "internal.error", "internal error");
|
|
168
179
|
});
|
|
169
180
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* [ref] × 7.106.0 合并复审 X1(gpt-6 腿 A F1 [high],验证腿 B verified)—— 请求键 `inheritEnv` 的**会话绑定唯一提交点**。
|
|
3
3
|
*
|
|
4
|
-
* ── 分界(与 `
|
|
4
|
+
* ── 分界(与 `execution-context.ts` 认领之后的执行放置提交同一句判据)──────────────────────────────────────────────────
|
|
5
5
|
* 凡需要「这条会话此刻归我这条 run」才成立的事,排在 run 认领之后;其余全排在建任何东西之前。`inheritEnv` 的三道判
|
|
6
6
|
* (值形 / 车道 / 射程)是**读**,住在 `resolveSpec`(两腿同判,任何副作用之前);而「本会话的 host 工厂下一次造环境按哪个词」
|
|
7
7
|
* 是**写**,它只属于一条**被受理**的 run —— 修前它写在 `resolveSpec` 的最后一步,仍先于路由层的拒(`/v1/tasks/stream` 的
|
|
@@ -28,10 +28,9 @@ export interface SessionInheritEnvCommitCtx {
|
|
|
28
28
|
bindSessionInheritEnv?: ((sessionId: string, policy: TaskInheritEnv | undefined) => void) | undefined;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* 在 run 认领之后调用:把受理的那条请求的 `inheritEnv`(缺席 = 清)
|
|
32
|
-
* 不写 —— `"all"` 在那一形已被 `resolveSpec` 响亮拒,`"scrub"` / 缺席与工厂缺省同形。
|
|
31
|
+
* 在 run 认领之后调用:把受理的那条请求的 `inheritEnv`(缺席 = 清)写进本会话(这条 run 的根会话)的绑定。
|
|
33
32
|
*/
|
|
34
|
-
export declare function commitSessionInheritEnv(ctx: SessionInheritEnvCommitCtx, sessionId: string
|
|
33
|
+
export declare function commitSessionInheritEnv(ctx: SessionInheritEnvCommitCtx, sessionId: string, body: {
|
|
35
34
|
readonly inheritEnv?: TaskInheritEnv | undefined;
|
|
36
35
|
}): void;
|
|
37
36
|
//# sourceMappingURL=session-inherit-env.d.ts.map
|
|
@@ -195,7 +195,7 @@ export interface TaskRequestBody {
|
|
|
195
195
|
* after it"). core enforces the "before" edges and the service passes its rejection codes through UNCHANGED for the
|
|
196
196
|
* shell to render: `resume_at.before_target_not_user` (only plain user-message targets),
|
|
197
197
|
* `resume_at.before_root_unsupported` (can't rewind past the session root — start a new session),
|
|
198
|
-
* `rewind_snapshot.unresolvable` (
|
|
198
|
+
* `rewind_snapshot.unresolvable` (restoreFiles: no snapshot at/above the "before" branch point). Only meaningful
|
|
199
199
|
* WITH `resumeAt` — sent alone it's a 400 (fail-loud, not a silent no-op). */
|
|
200
200
|
resumeAtMode?: string;
|
|
201
201
|
/** [ref] Phase3 (reuse-path warm-resume): require the `sessionId` to ALREADY exist. When `true` and the session
|
|
@@ -221,11 +221,6 @@ export interface TaskRequestBody {
|
|
|
221
221
|
/** DV-15: opt-in tolerance for a PARTIAL file restore (default = loud terminal failure carrying the per-file
|
|
222
222
|
* ledger; `true` = keep going and disclose the same ledger on the result's rewindNotes). */
|
|
223
223
|
acceptPartialRestore?: boolean;
|
|
224
|
-
/** RETIRED spelling (whole-tree epoch). Still accepted on the wire: its capture sense (true, no resumeAt) is
|
|
225
|
-
* a tolerated no-op with a deprecation disclosure; its restore sense (true + resumeAt) is a typed rejection
|
|
226
|
-
* naming `restoreFiles` — the restore semantics genuinely changed (whole tree ⇒ tracked set), so that
|
|
227
|
-
* migration is explicit by design (core adjudicates; the server never remaps it silently). */
|
|
228
|
-
rewindFiles?: boolean;
|
|
229
224
|
/** R8 code-only rewind (CC "Restore code" mode): converge the TRACKED set to the history boundary at a prior
|
|
230
225
|
* USER message WITHOUT forking the conversation (the session leaf is untouched — only the files move). The
|
|
231
226
|
* value is the same handle as `resumeAt` (the prompt's taskId); the service resolves it → the entry id. Honored ONLY
|
|
@@ -235,7 +230,7 @@ export interface TaskRequestBody {
|
|
|
235
230
|
* 与 `checkpointStore` 同;没有 `"enabled"` —— 缺席就是「部署说了算」的唯一形,声明只能单向收紧)。`"disabled"` ⇒
|
|
236
231
|
* 这条 run 零历史店调用:编辑照常落盘,但不做首次触碰备份、不铸回合边界、不做 fork 携带;委派出去的子代继承
|
|
237
232
|
* (core `ParentSpecSeat` 从本位铸,本仓零接线)。`wiring_manifest.fileHistory` 报 `"disabled"`。
|
|
238
|
-
* 同一个提交里再要还原(`restoreFiles` / `rewindFilesTo`
|
|
233
|
+
* 同一个提交里再要还原(`restoreFiles` / `rewindFilesTo`)= 体内矛盾 ⇒ **受理时** 400
|
|
239
234
|
* `request.field_conflict`(`request-value-closure.ts` 的 `FILE_HISTORY_DISABLED_NO_RESTORE`):立门时 core 的 `rewind.capture_disabled`
|
|
240
235
|
* 落在会话按 `resumeAt` 分叉之后、拒后不回滚,所以本层在副作用之前拒([ref] / core 7.35.0 [ref] 起 core 在分叉**之前**拒,
|
|
241
236
|
* 本层 400 照旧有效)。续跑腿不过这道门。
|
|
@@ -472,7 +467,7 @@ export interface TaskRequestBody {
|
|
|
472
467
|
* · 仅 `REMOTE_EXEC=device` 的部署接受;其它车道收到它 = **400 响亮拒**(不静默忽略 —— 调用方会
|
|
473
468
|
* 以为自己指定了执行设备,而那条声明从未存在);
|
|
474
469
|
* · 仅**根任务**提交携带(子代无条件继承根绑定,core 为 subagent/cascade/verify 另铸 sessionId);
|
|
475
|
-
* · 首绑 =
|
|
470
|
+
* · 首绑 = 根会话行执行格的 absent → writer(device, D)(按受理那一读的住客定址,并发单赢家);后续根提交:缺席 = 沿用绑定 / 携且同 = 幂等 /
|
|
476
471
|
* 携且异 = 403 `device.identity_mismatch`(**v1 无隐式重绑**,换设备走
|
|
477
472
|
* `POST /v1/devices/sessions/:rootSessionId/rebind`);
|
|
478
473
|
* · resume 家族(`/decide` / `/answer` / `/plan_review` / `/wake`)**不收**这个键:车道随树固定。
|
|
@@ -491,10 +486,11 @@ export interface TaskRequestBody {
|
|
|
491
486
|
/** [ref]⑧/[ref]/[ref] (core 5.23.0 `TaskSpec.oneShot`): this SUBMISSION is one-shot — no later turn exists
|
|
492
487
|
* in which an async background notification could land (the archetypal case is a headless `sema -p` whose
|
|
493
488
|
* process exits when the turn ends). PER-REQUEST on purpose: "does this submission expect to be continued" is
|
|
494
|
-
* a property of the submission, not of the connection it arrived on. core
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
489
|
+
* a property of the submission, not of the connection it arrived on. Since core 7.60.0 it changes when the
|
|
490
|
+
* submission ends: where a one-shot run would end, the engine waits for the background agents and workflow runs
|
|
491
|
+
* it started (a background command or Monitor watch is never waited for), bounded by the run's walltime, a cancel
|
|
492
|
+
* and a 600 s ceiling; a sync submission therefore returns after that background work. It grants nothing, so
|
|
493
|
+
* there is no tenancy gate. Sibling of `interactiveTools` (the same `-p` posture) and passed
|
|
498
494
|
* through the same way: a boolean rides, absent/garbage ⇒ key omitted (core's default = interactive). Rides the
|
|
499
495
|
* persisted body onto resume legs. */
|
|
500
496
|
oneShot?: boolean;
|
|
@@ -43,7 +43,7 @@ export declare const RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS = 64;
|
|
|
43
43
|
* (身份键按字节判等,与 MySQL 协议表级 `utf8mb4_bin` 同形)。
|
|
44
44
|
*/
|
|
45
45
|
export declare const RUN_IDENTITY_COLUMNS: {
|
|
46
|
-
readonly
|
|
46
|
+
readonly mysql: string;
|
|
47
47
|
readonly pg: string;
|
|
48
48
|
};
|
|
49
49
|
/** 元组落盘的三格(SQL 三列 / File 车道 run.json 的三键,同名同义)。 */
|
package/dist/identity-source.js
CHANGED
|
@@ -2,7 +2,7 @@ export const IDENTITY_SOURCES = ["service_token", "sso", "direct_door_jwt"];
|
|
|
2
2
|
export const RUN_IDENTITY_SCOPE_MAX_CHARS = 190;
|
|
3
3
|
export const RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS = 64;
|
|
4
4
|
export const RUN_IDENTITY_COLUMNS = {
|
|
5
|
-
|
|
5
|
+
mysql: [
|
|
6
6
|
"identity_source VARCHAR(32) NULL",
|
|
7
7
|
`identity_scope VARCHAR(${RUN_IDENTITY_SCOPE_MAX_CHARS}) NULL`,
|
|
8
8
|
`identity_principal_inc VARCHAR(${RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS}) NULL`,
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type { TaskRequestBody } from "./http/wire-types.js";
|
|
|
26
26
|
export { ensureCheckpointCtxSealing } from "./sealed-key.js";
|
|
27
27
|
export type { CheckpointCtxSealing } from "./http/checkpoint-ctx.js";
|
|
28
28
|
export { createHttpServer, type ServiceDeps, type RequestAuth, type FlatServiceDeps, type ServiceDepGroups, type ServiceCoreDeps, type ServiceStoreDeps, type ServiceCoordinatorDeps, type ServiceSeamDeps, type ServiceObservabilityDeps, type ServiceGovernanceDeps, type ServiceDeploymentDeps, type ServiceKnobDeps, } from "./http/server.js";
|
|
29
|
+
export type { ExecutionContext, ResolvedTaskSpec, RootedTaskSpec } from "./http/execution-context.js";
|
|
29
30
|
export { createPeerDesk } from "./peer-seat.js";
|
|
30
31
|
export type { PeerDesk, PeerLease, McpDraft, A2aDraft } from "./peer-seat.js";
|
|
31
32
|
export { createSideQueryLane, type KeyResolver, type SideQueryLane, type SideQueryLaneCtx } from "./boot/side-query-lane.js";
|
|
@@ -1,39 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 执行环境的家目录:**主张 × 实测**的唯一判官与唯一的座(纯叶:零值依赖)。
|
|
3
3
|
*
|
|
4
|
-
* ## 病(一)——
|
|
5
|
-
* `REMOTE_EXEC_HOME_DIR
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* ## 病(一)—— 给了家目录却对不上
|
|
5
|
+
* 部署事先给每只执行环境一个家目录:运维声明 `REMOTE_EXEC_HOME_DIR`,或车道自己的出厂答案(声明缺席时 host = 本进程的家目录、e2b = 平台固定用户的
|
|
6
|
+
* `/home/user`;`execution-lane-caps.ts` `executionLaneHomeDir` 一只属主)。它是 `~/` 形权限规则的基、引擎家锚拒读行(`~/.ssh` / `~/.npmrc` …)的落点。
|
|
7
|
+
* 给的是 `/home/y` 而环境里命令真看到的 `$HOME` 是 `/home/x` 时,`Edit(~/.ssh/**)` 守的是 `/home/y`,`/home/x/.ssh` 照读照写,运维与用户零告警:
|
|
8
|
+
* 限制写了不生效且无人知(镜像换代换了用户、e2b 自定义模板换了用户、host 上会话 `settings.env` 改了 `HOME` —— 都是这一形)。
|
|
9
9
|
*
|
|
10
|
-
* ## 病(二)——
|
|
11
|
-
*
|
|
10
|
+
* ## 病(二)—— 没给就恒问人
|
|
11
|
+
* 执行环境没有家目录时,引擎的家锚拒读行放不下 ⇒ 每一次泄内容的递归读(`grep -r` / `rg` / `git grep` / `tar c`)在全 shell 面恒问人、只读面直接拒。
|
|
12
12
|
* 家目录是执行环境自己的事实,车道开环境那一拍问一次就知道 —— 不必要运维手填。
|
|
13
13
|
*
|
|
14
|
-
* ## 律(
|
|
15
|
-
* ·
|
|
16
|
-
* `printf %s "$HOME"
|
|
17
|
-
*
|
|
18
|
-
* ·
|
|
19
|
-
* · **实测也缺席**(问不出 / 答的不是绝对路径,含空串)⇒ 座缺席(引擎失败关闭,不猜、不补 `/`),环境照开(
|
|
20
|
-
*
|
|
14
|
+
* ## 律(一条:读得出就读,读数是真源 —— {@link LaneHomeSeat},每只读得出家目录的适配器各持一只,不各写一份)
|
|
15
|
+
* · **有主张 ⇒ 证**:座 = 主张原样(下单门与引擎 prepare 在环境开起来之前就要基);开环境那一拍读一次(与命令同一条 shell、同一份 env:
|
|
16
|
+
* `printf %s "$HOME"`;host 直接读它自己组合给子进程的那份 env),两者不一致 ⇒ 这只执行环境不开(拒句点名两值与改法),环境答了的判定记在环境上
|
|
17
|
+
* (同一镜像 / 同一目标机再问也是同一个答案,不重试成风暴);读不出同样不开(证不了主张 = 不拿一个没证过的目录去守),但不记 —— 与任何一次建连失败同,下一次重问。
|
|
18
|
+
* · **没主张 ⇒ 实测**:同一拍问同一句;答出绝对路径 ⇒ 座 = 它,之后不再问;
|
|
19
|
+
* · **实测也缺席**(问不出 / 答的不是绝对路径,含空串)⇒ 座缺席(引擎失败关闭,不猜、不补 `/`),环境照开(没主张就没有主张可拒),一行 warn(点名读到了什么与出路)。
|
|
20
|
+
* 读不了家目录的车道(device:设备协议没有读数)不持座 —— 声明就是座,起服披露「来自声明、未实测」(`execution-lane-caps.ts` `buildLaneHomeBootNote`)。
|
|
21
|
+
* 规则基与 422 门在下单那一刻就要家目录,而那一刻执行环境还没开 —— 它们只读主张(`executionLaneHomeDir`);环境开起来时主张被证,证不了的环境不开。
|
|
21
22
|
*/
|
|
22
|
-
/** 探针答案的行首标记:登录脚本 / profile 往 stdout 打的横幅不会被读成家目录 —— 只认带这个标记的那一行(
|
|
23
|
+
/** 探针答案的行首标记:登录脚本 / profile 往 stdout 打的横幅不会被读成家目录 —— 只认带这个标记的那一行(恰一条,见 `markedHome`)。 */
|
|
23
24
|
export declare const LANE_HOME_PROBE_MARKER = "sema-lane-home=";
|
|
24
25
|
/**
|
|
25
26
|
* 执行环境里问家目录的那一句 —— 经车道自己的命令通道跑(同一条 shell、同一份 env),答的就是命令看到的 `$HOME`。
|
|
26
27
|
* 先换一行再打标记行:横幅没以换行收尾时,标记行照样从行首开始。
|
|
27
28
|
*/
|
|
28
29
|
export declare const LANE_HOME_PROBE_COMMAND = "printf '\\nsema-lane-home=%s\\n' \"$HOME\"";
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* 一次问家目录的读数:探针的 stdout 原文(经车道命令通道跑 {@link LANE_HOME_PROBE_COMMAND})/ 直接读到的值(适配器自己组合子进程 env 的车道 —— host:
|
|
32
|
+
* 那份 env 里的 `HOME`;缺席时读子进程 shell 对 `~` 的展开,见 `remote-env-host.ts` `childHome`)/ 没问到(原因)。
|
|
33
|
+
*/
|
|
30
34
|
export type LaneHomeProbe = {
|
|
31
35
|
readonly ok: true;
|
|
32
36
|
readonly stdout: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly ok: true;
|
|
39
|
+
readonly value: string;
|
|
33
40
|
} | {
|
|
34
41
|
readonly ok: false;
|
|
35
42
|
readonly reason: string;
|
|
36
43
|
};
|
|
44
|
+
/** 主张的来源 —— 只进拒句(改法随它):运维声明(`REMOTE_EXEC_HOME_DIR`)/ 车道自己的出厂答案(声明缺席时;没有「删声明」这条路)。 */
|
|
45
|
+
export type LaneHomeSource = "declared" | "lane";
|
|
46
|
+
/** 部署交给一只执行环境的家目录主张:值 + 来源。 */
|
|
47
|
+
export interface LaneHomeClaim {
|
|
48
|
+
readonly home: string;
|
|
49
|
+
readonly source: LaneHomeSource;
|
|
50
|
+
}
|
|
37
51
|
/**
|
|
38
52
|
* 判定:`undefined` = 一致,照开;否则这只环境不开 —— `refusal` 是拒句,`answered` = 环境**答了**它的家目录(不一致 / 不是绝对路径;同一镜像 / 同一登录用户
|
|
39
53
|
* 再问也是同一个答案 ⇒ 调用方记在环境上),`false` = 没答上(探针失败 / 超时 / 非零退出 / 输出里没有标记行 ⇒ 这一次不开、不记、下一次重问)。
|
|
@@ -43,9 +57,17 @@ export type LaneHomeVerdict = {
|
|
|
43
57
|
readonly answered: boolean;
|
|
44
58
|
} | undefined;
|
|
45
59
|
/**
|
|
46
|
-
*
|
|
60
|
+
* 执行环境的路径平台 —— 「绝对」与「同一个目录」两条判据随它:远端车道(k8s / local-docker / ssh / adb / e2b,Linux / Android 的 POSIX shell)= `posix`;
|
|
61
|
+
* win32 宿主上的 host 车道 = `win32`(子进程的 `HOME` 是盘符形)。车道没得选:是环境自己的平台,由持座的适配器说(缺省 `posix`)。
|
|
47
62
|
*/
|
|
48
|
-
export
|
|
63
|
+
export type LanePathFlavor = "posix" | "win32";
|
|
64
|
+
/**
|
|
65
|
+
* 主张 × 实测的判官(全仓唯一一只:每只读得出家目录的适配器经 {@link LaneHomeSeat} 用它,自己不比)。`lane` 只进句子。
|
|
66
|
+
* 拒句闭集 3 形 × 2 来源:实测与主张不一致 / 实测不是绝对路径(含空)/ 没问到;每一句都点名主张(与实测值,有就点名)和改法,不回显任何别的东西。
|
|
67
|
+
* 改法随来源:声明 ⇒「改成实测值或删掉声明」;出厂答案 ⇒ 只有「设成实测值」(没有声明可删)。另一条路两种来源同:让环境的 `HOME` 读主张那个值。
|
|
68
|
+
* 次序:读不出 → 不是绝对路径 → 一致 → 不一致(「绝对」先于「一致」:主张自己是相对串时,一个同样相对的读数也不放行)。
|
|
69
|
+
*/
|
|
70
|
+
export declare function judgeLaneHome(lane: string, claim: LaneHomeClaim, probe: LaneHomeProbe, paths?: LanePathFlavor): LaneHomeVerdict;
|
|
49
71
|
/** 起服与每只环境「家目录答不出」那一行 warn 的事件名 —— 一只 code,起服(车道读不了)与环境(实测缺席)共用。 */
|
|
50
72
|
export declare const LANE_HOME_UNDECLARED_EVENT = "execution_lane_home_undeclared";
|
|
51
73
|
/**
|
|
@@ -55,52 +77,56 @@ export declare const LANE_HOME_UNDECLARED_EVENT = "execution_lane_home_undeclare
|
|
|
55
77
|
export declare function buildHomeAbsentNote(lane: string, cause: string, remedy: string): string;
|
|
56
78
|
/** 车道读不了家目录时的出路(起服那一行):声明它。 */
|
|
57
79
|
export declare const DECLARE_HOME_REMEDY = "Declare the home: REMOTE_EXEC_HOME_DIR=<the absolute path the environment's $HOME reads>";
|
|
80
|
+
/** 读不了家目录的车道(今天只有 device)上声明在场时,起服那一行 warn 的事件名:座 = 声明,没有任何读数证过它。 */
|
|
81
|
+
export declare const LANE_HOME_UNMEASURED_EVENT = "execution_lane_home_unmeasured";
|
|
82
|
+
/**
|
|
83
|
+
* 「这条车道的家目录来自声明、未实测」的一句(纯字符串 ⇒ `build*`)—— 读得出的车道由 {@link judgeLaneHome} 证主张,读不了的车道没有那一步,起服把这件事说出来:
|
|
84
|
+
* 规则落在哪、对不上时会怎样、运维要守住什么。
|
|
85
|
+
*/
|
|
86
|
+
export declare function buildHomeUnmeasuredNote(lane: string, declared: string): string;
|
|
58
87
|
/** 一行「这只环境没有家目录」的事实:交给运维的那一行 warn 的两个字段。 */
|
|
59
88
|
export interface LaneHomeAbsence {
|
|
60
89
|
readonly provider: string;
|
|
61
90
|
readonly note: string;
|
|
62
91
|
}
|
|
63
|
-
/** 这条车道的座怎么长出来:`declared` = 运维声明(`REMOTE_EXEC_HOME_DIR`,boot 期的唯一属主 `executionLaneHomeDir` 的答案);`verifiesDeclared` = 车道对声明对证。 */
|
|
64
|
-
export interface LaneHomeSeatOptions {
|
|
65
|
-
readonly lane: string;
|
|
66
|
-
readonly declared: string | undefined;
|
|
67
|
-
readonly verifiesDeclared: boolean;
|
|
68
|
-
/** 实测缺席时交出那一行 warn(缺席 = 不交;生产装配由 boot 递一只带去重的报告座,见 {@link createLaneHomeAbsenceReporter})。 */
|
|
69
|
-
readonly onAbsent?: ((absence: LaneHomeAbsence) => void) | undefined;
|
|
70
|
-
}
|
|
71
92
|
/**
|
|
72
|
-
*
|
|
93
|
+
* 会读家目录的车道(k8s / local-docker / ssh / adb / e2b / host)的适配器配置里与家目录有关的三个键 —— 文字只写这一处,各配置接口 `extends` 它;
|
|
94
|
+
* {@link LaneHomeSeat} 直接吃它。
|
|
73
95
|
*/
|
|
74
96
|
export interface LaneHomeConfig {
|
|
75
97
|
/**
|
|
76
|
-
* [ref]④ / core [ref] ——
|
|
77
|
-
*
|
|
78
|
-
*
|
|
98
|
+
* [ref]④ / core [ref] —— 部署给本执行环境的 **home 目录主张**(绝对路径,本环境自己的命名空间里):运维声明 `REMOTE_EXEC_HOME_DIR`,或车道出厂答案。
|
|
99
|
+
* `~/…` 形权限规则(`Edit(~/.ssh/**)`)对**跑在本 env 里的调用**就以它为基。值由 `boot/execution-env.ts` 从**唯一属主** `execution-lane-caps.ts` 的
|
|
100
|
+
* `buildLaneHomeClaim` 递进来;adapter 不自算(两处各算一份 = 422 门与引擎对同一条规则给相反答案)。在场 ⇒ 环境开起来时与 `$HOME` 对证,不一致 ⇒ 这只环境不开。
|
|
101
|
+
* 缺席 ⇒ 车道建环境时自己问执行环境的 `$HOME`({@link LaneHomeSeat});实测也缺席 ⇒ 本 env 的 `homeDir` 座缺席,core 对 `~/` 规则判 `unreadable`
|
|
79
102
|
* (fail-closed 的 ask),绝不回落引擎进程自己的 home(那在远端腿上是另一个用户的另一个目录 —— 静默守错目录正是 [ref] 的病)。
|
|
80
103
|
*/
|
|
81
104
|
homeDir?: string;
|
|
82
|
-
/**
|
|
105
|
+
/** {@link homeDir} 的来源(只进拒句的改法):`declared` = `REMOTE_EXEC_HOME_DIR`;`lane` = 车道出厂答案。缺席读作 `declared`。 */
|
|
106
|
+
homeDirSource?: LaneHomeSource;
|
|
107
|
+
/** 实测缺席(没主张、也没问到绝对路径)时交出那一行 warn;缺席 = 不交。生产装配由 boot 递一只带去重的报告座({@link createLaneHomeAbsenceReporter})。 */
|
|
83
108
|
onHomeAbsent?: (absence: LaneHomeAbsence) => void;
|
|
84
109
|
}
|
|
85
110
|
/**
|
|
86
|
-
* 一只执行环境的家目录座 —— `ExecutionEnv.homeDir`
|
|
87
|
-
*
|
|
111
|
+
* 一只执行环境的家目录座 —— `ExecutionEnv.homeDir` 的**唯一取值律**:主张在场 ⇒ 主张(并在开环境时被证);否则 ⇒ 车道开环境时实测到的绝对路径;
|
|
112
|
+
* 实测也缺席 ⇒ `undefined`(引擎失败关闭)。车道只做两件事:`asks` 为真时读一次(命令通道跑 {@link LANE_HOME_PROBE_COMMAND},或直接读自己组合的 env),
|
|
113
|
+
* 把读数交给 {@link settle};`homeDir` 读 {@link home}。
|
|
88
114
|
*/
|
|
89
115
|
export declare class LaneHomeSeat {
|
|
90
116
|
private measured;
|
|
91
117
|
private readonly lane;
|
|
92
|
-
private readonly
|
|
93
|
-
private readonly verifiesDeclared;
|
|
118
|
+
private readonly claim;
|
|
94
119
|
private readonly onAbsent;
|
|
95
|
-
|
|
96
|
-
/**
|
|
120
|
+
private readonly paths;
|
|
121
|
+
/** `paths` = 执行环境自己的路径平台({@link LanePathFlavor};缺省 POSIX —— 只有 win32 宿主上的 host 适配器说 `win32`)。 */
|
|
122
|
+
constructor(lane: string, config: LaneHomeConfig, paths?: LanePathFlavor);
|
|
123
|
+
/** 座:主张胜,否则实测,否则缺席。 */
|
|
97
124
|
get home(): string | undefined;
|
|
98
|
-
/**
|
|
125
|
+
/** 这一拍还要不要问:主张在场 ⇒ 每只新环境 / 每条新连接都问(对证);没主张 ⇒ 问到量出绝对路径为止。 */
|
|
99
126
|
get asks(): boolean;
|
|
100
127
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* 不对证的车道声明在场时不该来问(`asks` 为假),来了照单全收。
|
|
128
|
+
* 收一次读数。主张在场 ⇒ {@link judgeLaneHome}:`undefined` = 一致,否则这只环境不开(拒句 + 记不记见 {@link LaneHomeVerdict});
|
|
129
|
+
* 没主张 ⇒ 读到绝对路径就记下;读不到 / 不是绝对路径 ⇒ 座缺席、交一行 warn、**不拒环境**(`undefined`)—— 没主张就没有主张可拒,引擎对缺席座失败关闭。
|
|
104
130
|
*/
|
|
105
131
|
settle(probe: LaneHomeProbe): LaneHomeVerdict;
|
|
106
132
|
}
|