@sema-agent/server 7.139.0 → 7.141.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 +471 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +94 -26
- package/dist/adoption/runner.js +1 -1
- package/dist/adoption/sql.js +1 -1
- package/dist/approval-batch-census.d.ts +27 -0
- package/dist/approval-batch-census.js +27 -0
- package/dist/approval-card.d.ts +37 -22
- package/dist/approval-card.js +6 -3
- package/dist/approval.d.ts +15 -0
- package/dist/approval.js +10 -0
- package/dist/audit.d.ts +4 -2
- package/dist/audit.js +2 -2
- 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/boot/adoption.js +1 -1
- package/dist/boot/device-lane.d.ts +11 -0
- package/dist/boot/device-lane.js +16 -0
- package/dist/boot/engine-lease.d.ts +24 -3
- package/dist/boot/engine-lease.js +9 -2
- package/dist/boot/execution-env.js +18 -12
- package/dist/boot/execution-lane.d.ts +8 -0
- package/dist/boot/execution-lane.js +6 -1
- package/dist/boot/memory-boundary.d.ts +16 -53
- package/dist/boot/memory-boundary.js +10 -20
- package/dist/boot/memory-consolidation.d.ts +16 -12
- package/dist/boot/memory-consolidation.js +24 -13
- package/dist/boot/reapers.d.ts +2 -2
- package/dist/boot/resolve-spec.d.ts +3 -5
- package/dist/boot/resolve-spec.js +9 -8
- package/dist/boot/runner-deps.d.ts +3 -3
- package/dist/boot/runner-deps.js +1 -0
- package/dist/boot/session-faces.d.ts +1 -1
- package/dist/boot/session-faces.js +4 -3
- package/dist/boot/shutdown.js +5 -0
- 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 +3 -1
- package/dist/boot/stage-06-runners.d.ts +2 -8
- package/dist/boot/stage-06-runners.js +3 -3
- package/dist/boot/stage-07-capability-layer.d.ts +2 -7
- package/dist/boot/stage-07-capability-layer.js +8 -10
- package/dist/boot/stage-08-reapers.d.ts +2 -7
- package/dist/boot/stage-09-leader.d.ts +2 -7
- package/dist/boot/stage-10-http-server.d.ts +2 -7
- package/dist/boot/stage-10-http-server.js +6 -4
- package/dist/boot/stores.d.ts +3 -6
- package/dist/boot/stores.js +37 -44
- 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 +36 -9
- package/dist/capabilities/execution-lane.d.ts +2 -2
- package/dist/capabilities/scenarios.d.ts +1 -1
- package/dist/capability-facts.d.ts +9 -0
- package/dist/capability-facts.js +9 -0
- package/dist/card-void.d.ts +38 -0
- package/dist/card-void.js +23 -0
- package/dist/config-catalog.js +12 -8
- package/dist/config-provider.d.ts +18 -17
- package/dist/config-provider.js +28 -36
- package/dist/config-types.d.ts +36 -9
- package/dist/config.js +56 -46
- package/dist/delegated-session-owner.d.ts +23 -20
- package/dist/delegated-session-owner.js +2 -2
- package/dist/deployment-shape.d.ts +9 -8
- package/dist/deployment-shape.js +4 -4
- package/dist/device-store.d.ts +7 -0
- package/dist/device-store.js +3 -0
- package/dist/execution-config-root.d.ts +22 -0
- package/dist/execution-config-root.js +35 -0
- package/dist/execution-lane-caps.d.ts +145 -107
- package/dist/execution-lane-caps.js +144 -83
- package/dist/execution-placement.d.ts +3 -0
- package/dist/execution-placement.js +7 -0
- package/dist/fleet/drain-entry.d.ts +3 -0
- package/dist/hosted-posture.d.ts +8 -0
- package/dist/hosted-posture.js +4 -0
- package/dist/http/admission.js +3 -3
- package/dist/http/caller-trust.d.ts +3 -2
- package/dist/http/caller-trust.js +2 -1
- package/dist/http/dispatch.js +4 -0
- package/dist/http/live-frame.d.ts +24 -0
- package/dist/http/live-frame.js +16 -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 +49 -35
- package/dist/http/retired-service-deps.d.ts +1 -1
- package/dist/http/retired-service-deps.js +1 -1
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/adoption.js +1 -1
- package/dist/http/routes/approvals-assistant.js +1 -0
- package/dist/http/routes/capabilities.js +5 -4
- package/dist/http/routes/diagnostics.d.ts +0 -19
- package/dist/http/routes/diagnostics.js +16 -2
- package/dist/http/routes/memory-bundle.d.ts +2 -2
- package/dist/http/routes/memory-bundle.js +4 -1
- package/dist/http/routes/memory-compliance.js +9 -2
- 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 +7 -2
- package/dist/http/routes/run-permission-mode.d.ts +75 -0
- package/dist/http/routes/run-permission-mode.js +170 -0
- package/dist/http/routes/session-sync.d.ts +3 -6
- package/dist/http/routes/session-sync.js +7 -2
- package/dist/http/routes/sessions.js +33 -15
- package/dist/http/routes/tasks.js +67 -68
- package/dist/http/run-read-face.js +3 -3
- package/dist/http/send.d.ts +1 -1
- package/dist/http/send.js +2 -2
- package/dist/http/server.d.ts +14 -27
- package/dist/http/server.js +2 -2
- package/dist/http/sse-log.d.ts +3 -8
- package/dist/http/stored-body-replay.d.ts +3 -3
- package/dist/http/stored-body-replay.js +3 -1
- package/dist/identity-source.d.ts +1 -1
- package/dist/identity-source.js +1 -1
- package/dist/instruction-source-notice.d.ts +7 -0
- package/dist/instruction-source-notice.js +6 -6
- 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/mcp-assertion-header.d.ts +4 -0
- package/dist/mcp-assertion-header.js +5 -0
- 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-posture.d.ts +1 -1
- 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 +33 -9
- package/dist/memory-scope.js +17 -5
- package/dist/memory-sync-client.d.ts +34 -9
- package/dist/memory-sync-client.js +108 -28
- package/dist/observability/fail-open.d.ts +30 -2
- package/dist/observability/fail-open.js +30 -2
- package/dist/observability/metrics.js +0 -1
- package/dist/observability/run-terminal.d.ts +6 -2
- package/dist/observability/run-terminal.js +25 -26
- package/dist/observability/secret-env-scrub.d.ts +20 -1
- package/dist/observability/secret-env-scrub.js +14 -0
- package/dist/orchestration/workflow-completion-inbox.d.ts +5 -2
- package/dist/orchestration/workflow-completion-inbox.js +13 -5
- package/dist/orchestration/workflow-notify-journal.d.ts +5 -3
- package/dist/orchestration/workflow-notify-journal.js +2 -1
- package/dist/permission-mode-admission.d.ts +68 -0
- package/dist/permission-mode-admission.js +23 -0
- package/dist/permission-rule-list.d.ts +55 -6
- package/dist/permission-rule-list.js +52 -5
- package/dist/plugins/adoption-log-sql.js +4 -4
- package/dist/plugins/approval-ask-store-sql.js +14 -14
- 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 -0
- package/dist/plugins/caching-session-store.js +3 -0
- package/dist/plugins/checkpoint-index-columns.js +2 -2
- package/dist/plugins/checkpoint-store-sql.d.ts +65 -17
- package/dist/plugins/checkpoint-store-sql.js +90 -19
- package/dist/plugins/device-store-sql.d.ts +5 -2
- package/dist/plugins/device-store-sql.js +23 -20
- package/dist/plugins/ensure-index.d.ts +1 -2
- package/dist/plugins/execution-placement-sql.d.ts +19 -9
- package/dist/plugins/execution-placement-sql.js +20 -9
- package/dist/plugins/file-history-store-sql.d.ts +2 -2
- package/dist/plugins/file-history-store-sql.js +4 -4
- package/dist/plugins/file-run-store.d.ts +2 -2
- package/dist/plugins/file-run-store.js +1 -1
- package/dist/plugins/fork-routing-session-store.d.ts +10 -32
- package/dist/plugins/fork-routing-session-store.js +2 -61
- package/dist/plugins/image-bake-store-sql.js +9 -9
- package/dist/plugins/image-index-sql.js +11 -11
- package/dist/plugins/k8s-exec-protocol.d.ts +4 -1
- package/dist/plugins/k8s-exec-protocol.js +6 -1
- package/dist/plugins/leader-run-store-sql.js +4 -4
- package/dist/plugins/local-checkpoint-store.d.ts +10 -1
- package/dist/plugins/local-checkpoint-store.js +22 -0
- package/dist/plugins/local-session-store.d.ts +227 -35
- package/dist/plugins/local-session-store.js +518 -37
- package/dist/plugins/local-session-window.d.ts +17 -3
- package/dist/plugins/local-session-window.js +7 -13
- 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-optout-grant-store-sql.js +1 -1
- package/dist/plugins/memory-run-store.d.ts +2 -2
- package/dist/plugins/memory-run-store.js +1 -1
- package/dist/plugins/memory-sync-store-tidb.js +3 -3
- package/dist/plugins/one-time-migrations.d.ts +52 -11
- package/dist/plugins/one-time-migrations.js +101 -39
- package/dist/plugins/org-delivery-quota-store.js +2 -2
- package/dist/plugins/outcome-ledger-sql.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -4
- package/dist/plugins/permission-rule-store-sql.js +16 -16
- package/dist/plugins/pg-pool.js +3 -2
- package/dist/plugins/pg-session-storage.d.ts +2 -0
- package/dist/plugins/pg-session-storage.js +3 -2
- package/dist/plugins/remote-env-adb.d.ts +7 -24
- package/dist/plugins/remote-env-adb.js +22 -5
- package/dist/plugins/remote-env-device.d.ts +2 -28
- package/dist/plugins/remote-env-device.js +2 -1
- package/dist/plugins/remote-env-e2b.d.ts +40 -27
- package/dist/plugins/remote-env-e2b.js +180 -20
- package/dist/plugins/remote-env-file-error.d.ts +1 -1
- package/dist/plugins/remote-env-file-error.js +8 -2
- package/dist/plugins/remote-env-host.d.ts +19 -35
- package/dist/plugins/remote-env-host.js +26 -3
- package/dist/plugins/remote-env-k8s.d.ts +22 -14
- package/dist/plugins/remote-env-k8s.js +150 -26
- package/dist/plugins/remote-env-local-docker.d.ts +27 -24
- package/dist/plugins/remote-env-local-docker.js +91 -24
- package/dist/plugins/remote-env-ssh.d.ts +4 -24
- package/dist/plugins/remote-env-ssh.js +4 -3
- 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 +1 -1
- package/dist/plugins/retention-store-sql.js +6 -6
- package/dist/plugins/run-store-sql.d.ts +3 -3
- package/dist/plugins/run-store-sql.js +19 -18
- package/dist/plugins/sandbox-read-floor.d.ts +273 -0
- package/dist/plugins/sandbox-read-floor.js +608 -0
- package/dist/plugins/schema-consistency.d.ts +6 -6
- package/dist/plugins/schema-consistency.js +1 -1
- 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-ownership.d.ts +2 -1
- package/dist/plugins/session-placement.d.ts +17 -4
- package/dist/plugins/session-placement.js +2 -1
- 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 +18 -20
- package/dist/plugins/session-store.js +4 -12
- 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 +35 -6
- package/dist/plugins/store-backend.js +27 -10
- package/dist/plugins/store-contracts.d.ts +9 -2
- package/dist/plugins/task-list-store-sql.js +11 -11
- package/dist/plugins/tidb-pool.js +7 -6
- package/dist/plugins/tidb-session-storage.js +4 -4
- package/dist/plugins/tidb-session-store.d.ts +4 -1
- package/dist/plugins/tidb-session-store.js +16 -15
- package/dist/plugins/tool-result-store-sql.d.ts +2 -2
- package/dist/plugins/tool-result-store-sql.js +3 -3
- 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/resource-suspend.d.ts +14 -12
- package/dist/resource-suspend.js +1 -1
- package/dist/resource-window.d.ts +4 -3
- package/dist/run-cancel-context.d.ts +34 -0
- package/dist/run-cancel-context.js +7 -0
- package/dist/run-local.js +14 -19
- package/dist/runs.d.ts +47 -16
- package/dist/runs.js +112 -113
- package/dist/security.d.ts +2 -2
- package/dist/server-secret-env.d.ts +2 -1
- package/dist/server-secret-env.js +2 -4
- package/dist/session-error-wire.d.ts +22 -4
- package/dist/session-error-wire.js +16 -0
- package/dist/session-incarnation.d.ts +10 -4
- package/dist/session-incarnation.js +1 -1
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +42 -1
- package/dist/session-sync-kernel.js +17 -0
- package/dist/session-sync.js +16 -4
- package/dist/sql-engine-coordinates.d.ts +49 -0
- package/dist/sql-engine-coordinates.js +27 -0
- package/dist/sql-engine-posture.d.ts +1 -1
- package/dist/sql-engine-posture.js +1 -1
- package/dist/standing-answer-grant.d.ts +31 -2
- package/dist/standing-answer-grant.js +14 -2
- package/dist/store-posture.d.ts +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-mcp.d.ts +21 -8
- package/dist/task-mcp.js +17 -9
- package/dist/task-settings.d.ts +52 -25
- package/dist/task-settings.js +91 -28
- package/dist/terminal.d.ts +103 -19
- package/dist/terminal.js +72 -20
- package/dist/trace/core-keyset-guard.d.ts +79 -2
- package/dist/trace/exit-seat.d.ts +7 -0
- package/dist/trace/exit-seat.js +1 -0
- package/dist/trace/model-segment.d.ts +2 -2
- package/dist/trace/redact.d.ts +3 -1
- package/dist/trace/redact.js +395 -110
- package/dist/trace/self-minted-wire.d.ts +226 -2
- package/dist/trace/self-minted-wire.js +79 -0
- package/dist/verifier-pause-card.d.ts +8 -0
- package/dist/verifier-pause-card.js +19 -0
- package/dist/web-admin-client/apply-effective.d.ts +5 -7
- package/dist/web-admin-client/apply-effective.js +2 -2
- 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/docs/DEVICE-EXECUTOR-PROTOCOL.md +3 -2
- package/package.json +2 -2
- package/wire-changes/server@7.140.0.json +184 -0
- package/wire-changes/server@7.141.0.json +367 -0
package/dist/plugins/pg-pool.js
CHANGED
|
@@ -347,8 +347,9 @@ export const PG_SCHEMA_STATEMENTS = [
|
|
|
347
347
|
enqueued_at_ms BIGINT NOT NULL,
|
|
348
348
|
-- 1.109 delivery envelope. kind NULL = a LEGACY \`workflow_complete\` row (the shape that predates the
|
|
349
349
|
-- envelope); readers must keep treating NULL as that kind, it is not "unknown". payload = the kind's JSON
|
|
350
|
-
-- extras: task_notification: task_type / result / …; workflow_complete: at most {"completionId": …}
|
|
351
|
-
-- engine's own correlation id, verbatim;
|
|
350
|
+
-- extras: task_notification: task_type / result / …; workflow_complete: at most {"completionId": …, "diagnostics": …}
|
|
351
|
+
-- (the engine's own correlation id, verbatim; the engine's diagnostic teaching text, redacted + bounded at enqueue;
|
|
352
|
+
-- each key absent when the engine minted none, NULL when neither).
|
|
352
353
|
kind VARCHAR(24) COLLATE "C",
|
|
353
354
|
payload TEXT COLLATE "C",
|
|
354
355
|
PRIMARY KEY (session_id, run_id),
|
|
@@ -67,6 +67,8 @@ export declare class PgSessionStore implements SessionStore {
|
|
|
67
67
|
readonly durability: "durable";
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
/** 会话耐久声明(TiDB 孪生同格,同一只常量 {@link SESSION_DURABILITY};理由见 `session-placement.ts` 的常量注)。 */
|
|
71
|
+
readonly durability: "durable";
|
|
70
72
|
/** In-flight acquisitions keyed by id, so concurrent acquire(sameId) in one process share one. */
|
|
71
73
|
private readonly pending;
|
|
72
74
|
/** 委派子代孤行那一行 warn 的去处(TiDB 孪生同格)。 */
|
|
@@ -8,7 +8,7 @@ import { scanEpochAnchor } from "./session-epoch-anchor.js";
|
|
|
8
8
|
import { jsonColumnText } from "./sql-json-column.js";
|
|
9
9
|
import { pgSafeJsonStringify } from "./pg-safe-json.js";
|
|
10
10
|
import { toIso } from "./sql-row-helpers.js";
|
|
11
|
-
import { placementCapabilityOf, LIST_PLACED_BATCH, PLACEMENT_SELECT_COLUMNS, placedRowFromRow, placementFromRow, placementInsertValues,
|
|
11
|
+
import { placementCapabilityOf, LIST_PLACED_BATCH, PLACEMENT_SELECT_COLUMNS, placedRowFromRow, placementFromRow, placementInsertValues, SESSION_DURABILITY, SESSION_PLACEMENTS, } from "./session-placement.js";
|
|
12
12
|
import { contentForkRelation, fastForwardSharedContentDiverged } from "../session-sync-content.js";
|
|
13
13
|
import { CLAIM_OWNERLESS_PLACED_SQL, claimOwnerlessParams, createPlacedSessionRow } from "../delegated-session-owner.js";
|
|
14
14
|
import { createLogger } from "../observability/logger.js";
|
|
@@ -188,7 +188,8 @@ export class PgSessionStorage extends BaseSessionStorage {
|
|
|
188
188
|
export class PgSessionStore {
|
|
189
189
|
pool;
|
|
190
190
|
retention;
|
|
191
|
-
placements =
|
|
191
|
+
placements = SESSION_PLACEMENTS;
|
|
192
|
+
durability = SESSION_DURABILITY;
|
|
192
193
|
pending = new Map();
|
|
193
194
|
log;
|
|
194
195
|
executionPlacement;
|
|
@@ -52,28 +52,8 @@ export interface AdbEnvDeps {
|
|
|
52
52
|
* **结构**信号;adb 的 shell v2 没有等价物,所以这里只能靠标记词,**这条臂就把话说在这里**。 */
|
|
53
53
|
export declare function isAdbTransportLost(stderr: string): boolean;
|
|
54
54
|
export declare class RemoteAdbExecutionEnv implements RemoteExecutionEnv {
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
* 就是**命令真正跑的那块文件系统**的权威答案(`posix-shell-fs` 的 `canonicalPath` 原语,在设备 shell 里解到落点)。声明它 = 告诉引擎:整链答不出来是**解析器出了事**
|
|
58
|
-
* (RPC 断、传输掉),不是「一个它看不见的命名空间」⇒ 读边界的执行期复核**拒**,而不是让词法判决站着。
|
|
59
|
-
* 缺席是今天每个适配器的读法(整链沉默 ⇒ 词法判决成立、命令照跑),所以这一声明是**收紧**方向。
|
|
60
|
-
* 严格读法 `=== true`(core `canonicalPathIsAuthoritative`);`isSuspendable` 一族同样严格,对本仓的
|
|
61
|
-
* 布尔字面量零影响(四键都写死字面 `true`/`false`,不存在「非布尔值被读成缺席」那一形 —— 那一形由
|
|
62
|
-
* core 的 `config.execution_env_capability_invalid` 普查响亮播报,本仓的受众表已登记)。
|
|
63
|
-
* 谁该声明由闭集门看着(`test/execution-lane-caps.test.ts` 的逐 lane 对账:新 lane 不表态 = 编译红)。
|
|
64
|
-
*/
|
|
65
|
-
/** `sharesProcessTable`(core 7.57.0,必填):命令跑在设备上(adb shell),不在本进程所在的进程表。 */
|
|
66
|
-
/** 能力块(引擎 [ref],八键必填、各键只经引擎读器读):`hostLocalPaths` = 这条车道答出的路径是不是本进程所在机器上的文件;`externalContentTarget` = 产出是否来自部署信任边界之外;`io` = 文件与 shell 两面真到达目标;`keepsReadFloor` = 是否守住读拒表的字节地板(本车道不守 ⇒ 读拒表非空的 run 被告知,部署要求地板时准备期拒)。 */
|
|
67
|
-
readonly capabilities: {
|
|
68
|
-
isolation: false;
|
|
69
|
-
suspendable: false;
|
|
70
|
-
canonicalPathAuthoritative: true;
|
|
71
|
-
sharesProcessTable: false;
|
|
72
|
-
hostLocalPaths: false;
|
|
73
|
-
externalContentTarget: false;
|
|
74
|
-
io: true;
|
|
75
|
-
keepsReadFloor: false;
|
|
76
|
-
};
|
|
55
|
+
/** 能力块的唯一作者 = `capabilitiesFor`(`execution-lane-caps.ts`;逐键表态与理由在那里,本类零能力字面量)。 */
|
|
56
|
+
readonly capabilities: import("@sema-agent/core").ExecutionEnvCapabilities;
|
|
77
57
|
cwd: string;
|
|
78
58
|
private connected;
|
|
79
59
|
/** 🔴 拆除是**终态**(2026-07-25 补齐:此前本适配器是同族里唯一没有这个概念的一条腿)。
|
|
@@ -85,10 +65,13 @@ export declare class RemoteAdbExecutionEnv implements RemoteExecutionEnv {
|
|
|
85
65
|
private destroyed;
|
|
86
66
|
/** 在飞的那一次懒连接(单飞记忆)——见 {@link ensureConnected}。settle 即清,**不缓存败诺**。 */
|
|
87
67
|
private connectPromise?;
|
|
88
|
-
/** core `ExecutionEnv.homeDir`([ref]):设备 shell 里执行用户的 home ——
|
|
68
|
+
/** core `ExecutionEnv.homeDir`([ref]):设备 shell 里执行用户的 home —— 声明在场 ⇒ 声明(首连时与设备 shell 的 `$HOME` 对证过),否则首连时 `adb shell` 实测的 `$HOME`(Android 常为 `/` 或 `/data/local/tmp` 一类,读到什么填什么,绝对即可),见 {@link LaneHomeSeat}。读时才取(没声明时连上之前缺席)。 */
|
|
89
69
|
get homeDir(): string | undefined;
|
|
90
|
-
/** 家目录的座(
|
|
70
|
+
/** 家目录的座(声明在场 ⇒ 首连时对证 · 否则首连时实测 · 实测缺席 ⇒ 缺席 + 一行 warn)。设备 shell 答得出 `$HOME`,命令里的 `~` / `$HOME` 展开的就是它 ——
|
|
71
|
+
* 声明与它不一致时规则守的是声明那个目录,所以与其余读得出家目录的车道同一只判官、同一句拒。 */
|
|
91
72
|
private readonly homeSeat;
|
|
73
|
+
/** 家目录:设备答了而与声明不一致(或答的不是绝对路径)⇒ 这只环境的拒,记一次、此后每次连接原样回它(同一台设备同一个答案:不重试、不再问)。 */
|
|
74
|
+
private homeRefusal?;
|
|
92
75
|
/** core 7.49.0 [ref]:shell 子进程真拿到的 `CDPATH` 条目 —— 本车道的命令跑在 Android 设备的 shell 里(设备自己的 env),本类不读那份 env ⇒ `"unknown"`(core 契约:说不出就说 unknown,
|
|
93
76
|
* 不许报一张没读过的空表;删除守卫因此对裸 `cd <相对名>` 之后的删除问人,而不是按「没有 CDPATH」放行)。 */
|
|
94
77
|
readonly cdPath: "unknown";
|
|
@@ -9,6 +9,7 @@ import { signalNumber } from "./host-platform.js";
|
|
|
9
9
|
import { buildLivenessCut, commandBoundsOf } from "../exec-bounds.js";
|
|
10
10
|
import { buildCapturedOutput, createCutError } from "../exec-cut.js";
|
|
11
11
|
import { FileError, ExecutionError, RemoteExecutionError, withRetry, RollingTailBuffer, markTruncated, } from "@sema-agent/core";
|
|
12
|
+
import { capabilitiesFor } from "../execution-lane-caps.js";
|
|
12
13
|
import { classifyFsStderr, fileErrorFromExec } from "./remote-env-file-error.js";
|
|
13
14
|
import { createPosixShellFs } from "./posix-shell-fs.js";
|
|
14
15
|
const PROVIDER = "adb";
|
|
@@ -21,14 +22,14 @@ function lazyConnectExecError(e) {
|
|
|
21
22
|
return e.code === "aborted" ? new ExecutionError("aborted", e.message, e) : new ExecutionError("shell_unavailable", `ADB lazy-connect failed: ${e.message}`, e);
|
|
22
23
|
}
|
|
23
24
|
function lazyConnectFileError(e, absPath) {
|
|
24
|
-
return
|
|
25
|
+
return fileErrorFromExec(e, absPath);
|
|
25
26
|
}
|
|
26
27
|
const isTcp = (serial) => /:\d+$/.test(serial);
|
|
27
28
|
export function isAdbTransportLost(stderr) {
|
|
28
29
|
return /device offline|device '.*' not found|no devices\/emulators found|connection reset|protocol fault|device disconnected/i.test(stderr);
|
|
29
30
|
}
|
|
30
31
|
export class RemoteAdbExecutionEnv {
|
|
31
|
-
capabilities = {
|
|
32
|
+
capabilities = capabilitiesFor({ remoteExec: { provider: "adb" } });
|
|
32
33
|
cwd;
|
|
33
34
|
connected = false;
|
|
34
35
|
destroyed = false;
|
|
@@ -37,6 +38,7 @@ export class RemoteAdbExecutionEnv {
|
|
|
37
38
|
return this.homeSeat.home;
|
|
38
39
|
}
|
|
39
40
|
homeSeat;
|
|
41
|
+
homeRefusal;
|
|
40
42
|
cdPath = "unknown";
|
|
41
43
|
withheldEnv = [];
|
|
42
44
|
cfg;
|
|
@@ -52,7 +54,7 @@ export class RemoteAdbExecutionEnv {
|
|
|
52
54
|
retry: { maxAttempts: config.retry?.maxAttempts ?? 3, backoffMs: config.retry?.backoffMs ?? 800 },
|
|
53
55
|
};
|
|
54
56
|
this.cwd = this.cfg.mountPath;
|
|
55
|
-
this.homeSeat = new LaneHomeSeat(
|
|
57
|
+
this.homeSeat = new LaneHomeSeat(PROVIDER, config);
|
|
56
58
|
this.spawnFn = deps?.spawn ?? spawn;
|
|
57
59
|
this.injectedConnectOnce = deps?.connectOnce;
|
|
58
60
|
}
|
|
@@ -65,13 +67,22 @@ export class RemoteAdbExecutionEnv {
|
|
|
65
67
|
async connect(config) {
|
|
66
68
|
if (this.destroyed)
|
|
67
69
|
return { ok: false, error: new RemoteExecutionError("connect_failed", "ADB env destroyed — create a fresh env instead of reviving") };
|
|
70
|
+
if (this.homeRefusal)
|
|
71
|
+
return { ok: false, error: this.homeRefusal };
|
|
68
72
|
const policy = {
|
|
69
73
|
retryableCodes: ["auth_transient", "connect_failed", "timeout"],
|
|
70
74
|
maxAttempts: this.cfg.retry.maxAttempts,
|
|
71
75
|
backoffMs: (failed) => this.cfg.retry.backoffMs * failed,
|
|
72
76
|
};
|
|
73
77
|
const once = this.injectedConnectOnce ?? ((s) => this.connectOnce(s));
|
|
74
|
-
|
|
78
|
+
const refused = new AbortController();
|
|
79
|
+
const halt = config?.abortSignal ? AbortSignal.any([config.abortSignal, refused.signal]) : refused.signal;
|
|
80
|
+
return withRetry(async () => {
|
|
81
|
+
const r = await once(config?.abortSignal);
|
|
82
|
+
if (!r.ok && this.homeRefusal)
|
|
83
|
+
refused.abort();
|
|
84
|
+
return r;
|
|
85
|
+
}, policy, { signal: halt });
|
|
75
86
|
}
|
|
76
87
|
async ensureConnected() {
|
|
77
88
|
if (this.destroyed)
|
|
@@ -127,7 +138,13 @@ export class RemoteAdbExecutionEnv {
|
|
|
127
138
|
const home = await this.adb(this.deviceShellArgs(LANE_HOME_PROBE_COMMAND), { signal, timeoutMs: this.cfg.commandTimeoutMs });
|
|
128
139
|
if (!home.ok && home.error.code === "aborted")
|
|
129
140
|
return { ok: false, error: new RemoteExecutionError("aborted", "connect aborted while reading the device's home") };
|
|
130
|
-
this.homeSeat.settle(home.ok && home.value.exitCode === 0 ? { ok: true, stdout: home.value.stdout } : { ok: false, reason: home.ok ? `exit ${home.value.exitCode}` : home.error.message });
|
|
141
|
+
const verdict = this.homeSeat.settle(home.ok && home.value.exitCode === 0 ? { ok: true, stdout: home.value.stdout } : { ok: false, reason: home.ok ? `exit ${home.value.exitCode}` : home.error.message });
|
|
142
|
+
if (verdict !== undefined) {
|
|
143
|
+
const error = new RemoteExecutionError("connect_failed", verdict.refusal);
|
|
144
|
+
if (verdict.answered)
|
|
145
|
+
this.homeRefusal = error;
|
|
146
|
+
return { ok: false, error };
|
|
147
|
+
}
|
|
131
148
|
}
|
|
132
149
|
this.connected = true;
|
|
133
150
|
return ok(this.workspaceHandle());
|
|
@@ -95,34 +95,8 @@ export declare class RemoteDeviceExecutionEnv implements RemoteExecutionEnv {
|
|
|
95
95
|
/** core 7.56.0 [ref]:shell 子进程继承的环境里收不到的条目 —— 本车道 shell 的环境在设备上**构建**(本进程的 env 从不注入,只有引擎逐次交的 `env`
|
|
96
96
|
* 这条显式授予),没有一条是从本进程继承的 ⇒ `[]`(core 契约:「`[]` when its shell environment is built rather than inherited」)。 */
|
|
97
97
|
readonly withheldEnv: readonly [];
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
* load-bearing 不变量)—— 设备工作区 = 员工机磁盘,真持久 ✅,park-only 降级腿因此合法可用。
|
|
101
|
-
* 谁要把 executor 的工作区改成临时目录,先来改这一行:那一刻这个 `false` 就变成谎话,park 赎回会
|
|
102
|
-
* 落到一个空工作区上而链路上没有任何一层会报错。
|
|
103
|
-
*/
|
|
104
|
-
/**
|
|
105
|
-
* 🔴 **[ref] / core 7.20.0([ref])`canonicalPathAuthoritative: true`** —— 本适配器的 `canonicalPath`
|
|
106
|
-
* 就是**命令真正跑的那块文件系统**的权威答案(设备 WS 协议的**必答** `canonicalPath` op)。声明它 = 告诉引擎:整链答不出来是**解析器出了事**
|
|
107
|
-
* (RPC 断、传输掉),不是「一个它看不见的命名空间」⇒ 读边界的执行期复核**拒**,而不是让词法判决站着。
|
|
108
|
-
* 缺席是今天每个适配器的读法(整链沉默 ⇒ 词法判决成立、命令照跑),所以这一声明是**收紧**方向。
|
|
109
|
-
* 严格读法 `=== true`(core `canonicalPathIsAuthoritative`);`isSuspendable` 一族同样严格,对本仓的
|
|
110
|
-
* 布尔字面量零影响(四键都写死字面 `true`/`false`,不存在「非布尔值被读成缺席」那一形 —— 那一形由
|
|
111
|
-
* core 的 `config.execution_env_capability_invalid` 普查响亮播报,本仓的受众表已登记)。
|
|
112
|
-
* 谁该声明由闭集门看着(`test/execution-lane-caps.test.ts` 的逐 lane 对账:新 lane 不表态 = 编译红)。
|
|
113
|
-
*/
|
|
114
|
-
/** `sharesProcessTable`(core 7.57.0,必填):命令跑在注册设备上(设备执行器),不在本进程所在的进程表。 */
|
|
115
|
-
/** 能力块(引擎 [ref],八键必填、各键只经引擎读器读):`hostLocalPaths` = 这条车道答出的路径是不是本进程所在机器上的文件;`externalContentTarget` = 产出是否来自部署信任边界之外;`io` = 文件与 shell 两面真到达目标;`keepsReadFloor` = 是否守住读拒表的字节地板(本车道不守 ⇒ 读拒表非空的 run 被告知,部署要求地板时准备期拒)。 */
|
|
116
|
-
readonly capabilities: {
|
|
117
|
-
isolation: false;
|
|
118
|
-
suspendable: false;
|
|
119
|
-
canonicalPathAuthoritative: true;
|
|
120
|
-
sharesProcessTable: false;
|
|
121
|
-
hostLocalPaths: false;
|
|
122
|
-
externalContentTarget: true;
|
|
123
|
-
io: true;
|
|
124
|
-
keepsReadFloor: false;
|
|
125
|
-
};
|
|
98
|
+
/** 能力块的唯一作者 = `capabilitiesFor`(`execution-lane-caps.ts`;逐键表态与理由在那里,本类零能力字面量)。 */
|
|
99
|
+
readonly capabilities: import("@sema-agent/core").ExecutionEnvCapabilities;
|
|
126
100
|
cwd: string;
|
|
127
101
|
/** 可选面(presence-typed,见文件头「铁律」段):构造期按设备声明装配,缺席就是缺席。 */
|
|
128
102
|
readLink?: (path: string, abortSignal?: AbortSignal) => Promise<Result<string, FileError>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import { ExecutionError, FileError, RemoteExecutionError, } from "@sema-agent/core";
|
|
3
|
+
import { capabilitiesFor } from "../execution-lane-caps.js";
|
|
3
4
|
import { DEVICE_ERROR_CODES, isDeviceAbsolutePath, } from "../device-store.js";
|
|
4
5
|
import { boundDeviceOf } from "../execution-placement.js";
|
|
5
6
|
import { createCutError, createExecFailure } from "../exec-cut.js";
|
|
@@ -128,7 +129,7 @@ export class RemoteDeviceExecutionEnv {
|
|
|
128
129
|
homeDir;
|
|
129
130
|
cdPath = "unknown";
|
|
130
131
|
withheldEnv = [];
|
|
131
|
-
capabilities = {
|
|
132
|
+
capabilities = capabilitiesFor({ remoteExec: { provider: "device" } });
|
|
132
133
|
cwd;
|
|
133
134
|
readLink;
|
|
134
135
|
writeFileExclusive;
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
* iterator MAY throw `RemoteExecutionError` mid-stream before an `exit` chunk (seam contract, OutputChunk).
|
|
21
21
|
*/
|
|
22
22
|
import { Sandbox, type SandboxOpts, type SandboxConnectOpts } from "e2b";
|
|
23
|
-
import { FileError, ExecutionError, RemoteExecutionError, type ExecutionEnv, type RemoteExecutionEnv, type WorkspaceHandle, type FileInfo, type Result, type SymlinkChain, type OutputChunk, type ExecStreamOptions, type RemoteConnectConfig, type SnapshotId, type SessionToken, type ExecutionEnvFactory, type VmLifecycleOptions, type BackgroundShellCapability, type BackgroundShellId, type BackgroundShellError, type BackgroundSpawnOptions, type BackgroundPoll } from "@sema-agent/core";
|
|
23
|
+
import { FileError, ExecutionError, RemoteExecutionError, type ExecutionEnv, type RemoteExecutionEnv, type WorkspaceHandle, type FileInfo, type Result, type SymlinkChain, type OutputChunk, type ExecStreamOptions, type RemoteConnectConfig, type SnapshotId, type SessionToken, type ExecutionEnvFactory, type VmLifecycleOptions, type BackgroundShellCapability, type BackgroundShellId, type BackgroundShellError, type BackgroundSpawnOptions, type BackgroundPoll, type ExecutionEnvCapabilities } from "@sema-agent/core";
|
|
24
|
+
import { type SandboxReadFloorKnob } from "../execution-lane-caps.js";
|
|
25
|
+
import { type SandboxReadFloor } from "./sandbox-read-floor.js";
|
|
26
|
+
import { type LaneHomeConfig } from "../lane-home-probe.js";
|
|
24
27
|
/** Options accepted by `ExecutionEnv.exec` (core does not re-export the type; derive it from the seam). */
|
|
25
28
|
type ExecOpts = Parameters<ExecutionEnv["exec"]>[1];
|
|
26
29
|
/** Minimal optional observability hooks (kept structural so the adapter stays standalone-testable). */
|
|
@@ -34,22 +37,13 @@ export interface RemoteEnvObservers {
|
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
/** Construction config for {@link RemoteContainerExecutionEnv}. Secrets/resolved values are control-plane supplied. */
|
|
37
|
-
export interface RemoteContainerEnvConfig extends RemoteEnvObservers {
|
|
40
|
+
export interface RemoteContainerEnvConfig extends RemoteEnvObservers, LaneHomeConfig {
|
|
38
41
|
/** E2B API key. Resolved by the trusted control plane from env — never baked into an image or committed. */
|
|
39
42
|
apiKey: string;
|
|
40
43
|
/** E2B template id (image). Defaults to the E2B base template. */
|
|
41
44
|
template?: string;
|
|
42
45
|
/** Sandbox lifetime in ms (E2B billing window). Default {@link DEFAULT_TIMEOUT_MS}. */
|
|
43
46
|
timeoutMs?: number;
|
|
44
|
-
/**
|
|
45
|
-
* [ref]④ / core [ref] —— 本执行环境的 **home 目录**(`ExecutionEnv.homeDir` 座,绝对路径,本环境自己的
|
|
46
|
-
* 命名空间里)。`~/…` 形权限规则(`Edit(~/.ssh/**)`)对**跑在本 env 里的调用**就以它为基。
|
|
47
|
-
* 缺席 ⇒ 本 env 声明「我没有 home」,core 对 `~/` 规则判 `unreadable`(fail-closed 的 ask),
|
|
48
|
-
* 绝不回落引擎进程自己的 home(那在远端腿上是另一个用户的另一个目录 —— 静默守错目录正是 [ref] 的病)。
|
|
49
|
-
* 值由 `boot/execution-env.ts` 从**唯一属主** `execution-lane-caps.ts` 的 `executionLaneHomeDir` 递进来;
|
|
50
|
-
* adapter 不自算(两处各算一份 = 422 门与引擎对同一条规则给相反答案)。
|
|
51
|
-
*/
|
|
52
|
-
homeDir?: string;
|
|
53
47
|
/** Workspace root inside the VM; remote paths normalize against it. Default {@link DEFAULT_MOUNT_PATH}. */
|
|
54
48
|
mountPath?: string;
|
|
55
49
|
/** Outbound network for the sandbox (clay: service needs external-network capability). Default `true`. */
|
|
@@ -79,6 +73,8 @@ export interface RemoteContainerEnvConfig extends RemoteEnvObservers {
|
|
|
79
73
|
* create/connect) — wider than {@link rpcTimeoutMs} so a legit multi-minute transfer is not killed. Default
|
|
80
74
|
* {@link DEFAULT_DATA_TIMEOUT_MS}. */
|
|
81
75
|
dataTimeoutMs?: number;
|
|
76
|
+
/** `SANDBOX_READ_FLOOR`(keep | off;缺席 ⇒ keep):本沙箱守不守读拒表的字节地板 = 读地板模块服务本车道 ∧ 本键不是 off(`sandbox-read-floor.ts`)。 */
|
|
77
|
+
sandboxReadFloor?: SandboxReadFloorKnob;
|
|
82
78
|
}
|
|
83
79
|
/** Minimal slice of the E2B `Sandbox` static API the adapter uses — injectable so tests pass a fake. */
|
|
84
80
|
export interface SandboxApi {
|
|
@@ -88,6 +84,8 @@ export interface SandboxApi {
|
|
|
88
84
|
/** Inject the E2B SDK for tests (a fake `Sandbox`). Defaults to the real SDK. */
|
|
89
85
|
export interface RemoteContainerEnvDeps {
|
|
90
86
|
sandboxApi?: SandboxApi;
|
|
87
|
+
/** 这只环境手里的读地板模块(缺席 ⇒ `createSandboxReadFloor` 按旋钮选;钉注入守地板的模块)。能力块的 `keepsReadFloor` 读它的状态。 */
|
|
88
|
+
readFloor?: SandboxReadFloor;
|
|
91
89
|
}
|
|
92
90
|
/**
|
|
93
91
|
* E2B-backed remote `ExecutionEnv`. **Lazy by default (v1b):** the VM is provisioned on the
|
|
@@ -99,8 +97,9 @@ export interface RemoteContainerEnvDeps {
|
|
|
99
97
|
export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv, BackgroundShellCapability {
|
|
100
98
|
/** Current working directory for relative paths (FileSystem contract; mutable, core may reassign). */
|
|
101
99
|
cwd: string;
|
|
102
|
-
/** core `ExecutionEnv.homeDir`([ref])
|
|
103
|
-
|
|
100
|
+
/** core `ExecutionEnv.homeDir`([ref]):沙箱里执行用户的 home —— 主张在场 ⇒ 主张(每只沙箱建起来 / 恢复时与沙箱里的 `$HOME` 对证过),
|
|
101
|
+
* 否则建沙箱那一拍实测的 `$HOME`,见 {@link LaneHomeSeat}。读时才取(没主张时沙箱建起来之前缺席)。 */
|
|
102
|
+
get homeDir(): string | undefined;
|
|
104
103
|
/** core 7.49.0 [ref]:shell 子进程真拿到的 `CDPATH` 条目 —— 本车道的命令跑在 e2b 沙箱里(模板镜像的 env),本类不读那份 env ⇒ `"unknown"`(core 契约:说不出就说 unknown,
|
|
105
104
|
* 不许报一张没读过的空表;删除守卫因此对裸 `cd <相对名>` 之后的删除问人,而不是按「没有 CDPATH」放行)。 */
|
|
106
105
|
readonly cdPath: "unknown";
|
|
@@ -123,6 +122,10 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
123
122
|
* and the post-await re-check in BOTH async-provision paths ({@link doConnect} and {@link doResumeVM}) against
|
|
124
123
|
* a destroy that races an in-flight provision/restore. */
|
|
125
124
|
private destroyed;
|
|
125
|
+
/** 家目录的座(主张在场 ⇒ 每只沙箱对证 · 否则建沙箱那一拍实测 · 实测缺席 ⇒ 缺席 + 一行 warn)。 */
|
|
126
|
+
private readonly homeSeat;
|
|
127
|
+
/** 家目录:沙箱答了而与主张不一致(或答的不是绝对路径)⇒ 这只环境的拒,记一次、此后每次连接 / 恢复原样回它(同一模板同一个答案:不再建沙箱、不再问)。 */
|
|
128
|
+
private homeRefusal?;
|
|
126
129
|
/** In-flight connect/resume, memoized so concurrent lazy first-use OR resume provisions exactly one VM (no double-bill). */
|
|
127
130
|
private connecting?;
|
|
128
131
|
/** Count of exec/execStream calls in flight — `suspendVM` refuses while > 0 (council #4: never snapshot a running command). */
|
|
@@ -133,20 +136,20 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
133
136
|
* SAME env instance skips the reconnect and every later fs/exec runs against the dead VM. */
|
|
134
137
|
private paused;
|
|
135
138
|
constructor(config: RemoteContainerEnvConfig, deps?: RemoteContainerEnvDeps);
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
/** `
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
/** 能力块的唯一作者 = `capabilitiesFor`(`execution-lane-caps.ts`;逐键表态与理由在那里,本类零能力字面量)。读地板旋钮是它的输入,{@link floor} 由同一只判据、同一个旋钮值选出。 */
|
|
140
|
+
readonly capabilities: ExecutionEnvCapabilities;
|
|
141
|
+
/** 读拒表字节地板模块:沙箱里每一次 `commands.run` 起动都先经它的 `wrap`({@link startIn} → {@link runIn},唯一接缝)。 */
|
|
142
|
+
private readonly floor;
|
|
143
|
+
/**
|
|
144
|
+
* **唯一起动接缝(上半)**:一次起动 → 地板模块 `wrap` → e2b 编码(身份 + 命令行;不守地板 ⇒ 命令与每命令 env 原样,与改前逐字同)。
|
|
145
|
+
* 本适配器对地板零判断;模块拒 ⇒ `spawn_error`,命令从未起。
|
|
146
|
+
*/
|
|
147
|
+
private startIn;
|
|
148
|
+
/** **唯一起动接缝(下半)**:本文件里每一次 `commands.run`(中继除外:那是地板模块自己的进程)都经这里,身份与 env 只取起动编码。 */
|
|
149
|
+
private runIn;
|
|
150
|
+
/** 地板模块的三件原语。引导命令经 {@link startIn}(起动形 `bootstrap`:只在附着中合法);放置 = root 建目录 → `files.write`(root)写暂存件 →
|
|
151
|
+
* root `chmod 0755 && mv -f`;中继 = 以模块给的身份起一只长连后台命令(stdin 开着:`sendStdin` 写答,stdout 回调读问)。 */
|
|
152
|
+
private floorTransport;
|
|
150
153
|
workspaceHandle(): WorkspaceHandle;
|
|
151
154
|
/**
|
|
152
155
|
* Public host for a port inside the sandbox (E2B reverse proxy → `<port>-<id>.e2b.app`). The LSP sidecar
|
|
@@ -217,6 +220,13 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
217
220
|
ok: false;
|
|
218
221
|
error: RemoteExecutionError;
|
|
219
222
|
}>;
|
|
223
|
+
/**
|
|
224
|
+
* 家目录:座要问({@link LaneHomeSeat.asks}:主张在场 ⇒ 对证;没主张 ⇒ 量到绝对路径为止)⇒ 在这只沙箱里问一次 `$HOME`(前台 `commands.run`,与命令同一个
|
|
225
|
+
* 模板缺省用户、同一份沙箱 env),读数交座。返回这只沙箱的拒(`connect_failed`,拒句 = 同一只判官的句子),或 `undefined`(照用)。
|
|
226
|
+
* 沙箱答了的拒记在环境上(同一模板同一个答案);没答上(非零退出 / RPC 失败 / 输出里没有标记行)⇒ 这一次不开、不记,下一次重问;调用方中止 ⇒ `aborted`、不交座。
|
|
227
|
+
* 上界 = 控制面 RPC 的墙钟(`rpcTimeoutMs`:问一个环境变量,不是跑用户命令)。
|
|
228
|
+
*/
|
|
229
|
+
private homeVerdict;
|
|
220
230
|
/** BL-31 — (re)start the periodic sandbox-lifetime extension. `setTimeout(timeoutMs)` resets the auto-kill window
|
|
221
231
|
* from now; we re-arm at ~80% of the (clamped, ≤1h) window so a long-held sandbox never expires mid-run. A no-op
|
|
222
232
|
* when paused/destroyed; `unref`'d so it never keeps the process alive; cleared on destroy. */
|
|
@@ -232,6 +242,9 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
232
242
|
shellId: string;
|
|
233
243
|
};
|
|
234
244
|
}, ExecutionError>>;
|
|
245
|
+
/** 适配器自己的固定命令(文件面助手:readlink / realpath / rm / mktemp / 暂存写的提交)—— 与 {@link exec} 同一条路,起动形 `adapter`。 */
|
|
246
|
+
private execInternal;
|
|
247
|
+
private execAs;
|
|
235
248
|
execStream(command: string, options?: ExecStreamOptions): AsyncIterable<OutputChunk>;
|
|
236
249
|
readonly backgroundCapabilities: {
|
|
237
250
|
readonly supported: true;
|