@sema-agent/server 7.136.0 → 7.138.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 +501 -139
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/USAGE.md +149 -34
- package/deploy/sema-up/README.md +14 -0
- package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +7 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +7 -1
- package/dist/approval-card.d.ts +21 -14
- package/dist/approval-card.js +1 -0
- package/dist/approval-content-kind.d.ts +6 -0
- package/dist/approval-content-kind.js +7 -0
- package/dist/approval-gate-currency.d.ts +48 -6
- package/dist/approval-gate-currency.js +16 -9
- package/dist/approval-hmac.d.ts +13 -1
- package/dist/approval-hmac.js +1 -1
- package/dist/approval.js +3 -3
- package/dist/audit.js +1 -0
- package/dist/auth-bridge.js +2 -2
- package/dist/background-agent-name.d.ts +5 -0
- package/dist/background-agent-name.js +5 -0
- package/dist/boot/budget-tracing.d.ts +1 -12
- package/dist/boot/deployment-mods.d.ts +46 -16
- package/dist/boot/deployment-mods.js +82 -6
- package/dist/boot/execution-env.d.ts +24 -1
- package/dist/boot/execution-env.js +69 -6
- package/dist/boot/governance-seams.d.ts +10 -17
- package/dist/boot/governance-seams.js +5 -17
- package/dist/boot/leader.d.ts +3 -0
- package/dist/boot/leader.js +1 -0
- package/dist/boot/org-delivery.js +15 -2
- package/dist/boot/reapers.d.ts +3 -0
- package/dist/boot/reapers.js +15 -1
- package/dist/boot/resolve-spec.d.ts +7 -0
- package/dist/boot/resolve-spec.js +36 -26
- package/dist/boot/retention-lane.d.ts +11 -5
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +7 -3
- package/dist/boot/runner-deps.js +1 -0
- package/dist/boot/stage-03-store-backend.d.ts +1 -1
- package/dist/boot/stage-04-stores.d.ts +2 -13
- package/dist/boot/stage-05-execution-env.d.ts +6 -13
- package/dist/boot/stage-05-execution-env.js +17 -5
- package/dist/boot/stage-06-runners.d.ts +6 -13
- package/dist/boot/stage-06-runners.js +10 -3
- package/dist/boot/stage-07-capability-layer.d.ts +7 -13
- package/dist/boot/stage-07-capability-layer.js +3 -3
- package/dist/boot/stage-08-reapers.d.ts +7 -13
- package/dist/boot/stage-08-reapers.js +2 -1
- package/dist/boot/stage-09-leader.d.ts +7 -13
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +7 -13
- package/dist/boot/stage-10-http-server.js +6 -3
- package/dist/boot/stores.d.ts +1 -1
- package/dist/boot/web-admin.d.ts +5 -2
- package/dist/boot/web-admin.js +3 -3
- package/dist/brain.js +5 -5
- package/dist/broker/broker.d.ts +89 -0
- package/dist/broker/broker.js +287 -0
- package/dist/broker/constants.d.ts +39 -0
- package/dist/broker/constants.js +15 -0
- package/dist/broker/http1.d.ts +111 -0
- package/dist/broker/http1.js +256 -0
- package/dist/broker/lease-book.d.ts +87 -0
- package/dist/broker/lease-book.js +142 -0
- package/dist/broker/lease-file.d.ts +60 -0
- package/dist/broker/lease-file.js +127 -0
- package/dist/broker/main.d.ts +2 -0
- package/dist/broker/main.js +20 -0
- package/dist/budget.d.ts +17 -15
- package/dist/budget.js +2 -2
- package/dist/capabilities/composite-members.d.ts +2 -1
- package/dist/capabilities/composite-members.js +2 -1
- package/dist/capabilities/engine-capabilities.js +1 -0
- package/dist/capabilities/mcp-probe.d.ts +36 -11
- package/dist/capabilities/mcp-probe.js +44 -5
- package/dist/capabilities/scenarios.d.ts +23 -8
- package/dist/capabilities/scenarios.js +13 -8
- package/dist/capabilities/skills.d.ts +28 -5
- package/dist/capabilities/skills.js +8 -0
- package/dist/capability-facts.d.ts +6 -0
- package/dist/capability-facts.js +5 -0
- package/dist/center-credential-renewer.js +5 -1
- package/dist/checkpoint-ctx-seal-m28.d.ts +3 -10
- package/dist/checkpoint-ctx-seal-m28.js +1 -1
- package/dist/checkpoint-identity.d.ts +13 -6
- package/dist/config-catalog.js +16 -7
- package/dist/config-types.d.ts +24 -7
- package/dist/config.d.ts +1 -1
- package/dist/config.js +42 -13
- package/dist/deployment-governance.d.ts +2 -2
- package/dist/deployment-governance.js +7 -9
- package/dist/deployment-shape.d.ts +6 -6
- package/dist/device-ws-protocol.d.ts +1 -0
- package/dist/device-ws-protocol.js +2 -1
- package/dist/file-history-disclosure.d.ts +4 -2
- package/dist/file-history-disclosure.js +2 -0
- package/dist/gate-settlement.d.ts +71 -0
- package/dist/gate-settlement.js +40 -0
- package/dist/hooks/classic-stations.d.ts +12 -54
- package/dist/hooks/classic-stations.js +1 -0
- package/dist/hooks/command-spawn.d.ts +2 -2
- package/dist/hooks/hook-runner.js +14 -14
- package/dist/http/admission.js +14 -9
- package/dist/http/approval-sweeps.js +4 -3
- package/dist/http/caller-trust.d.ts +2 -1
- package/dist/http/caller-trust.js +1 -3
- package/dist/http/checkpoint-ctx.d.ts +48 -7
- package/dist/http/checkpoint-ctx.js +40 -0
- package/dist/http/dispatch.d.ts +4 -0
- package/dist/http/dispatch.js +18 -10
- package/dist/http/durable-run-leg.d.ts +5 -1
- package/dist/http/durable-run-leg.js +5 -3
- package/dist/http/health-self-report.d.ts +2 -2
- package/dist/http/memory-compliance-failure-reply.js +3 -0
- package/dist/http/principal-gate.d.ts +15 -10
- package/dist/http/principal-gate.js +48 -9
- package/dist/http/resume-legs.d.ts +7 -31
- package/dist/http/resume-legs.js +185 -126
- package/dist/http/route-ctx.d.ts +38 -53
- package/dist/http/route-ctx.js +2 -5
- package/dist/http/routes/a2a-serve.js +10 -4
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +5 -1
- package/dist/http/routes/approvals-assistant.js +24 -10
- package/dist/http/routes/capabilities.js +23 -11
- package/dist/http/routes/mcp-reconnect.d.ts +3 -2
- package/dist/http/routes/mcp-reconnect.js +7 -7
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/memory-origin.d.ts +1 -1
- package/dist/http/routes/rules.js +3 -3
- package/dist/http/routes/runs.js +13 -8
- package/dist/http/routes/session-sync.js +42 -6
- package/dist/http/routes/sessions.js +6 -3
- package/dist/http/routes/side-query.js +2 -3
- package/dist/http/routes/tasks.js +794 -780
- package/dist/http/server.d.ts +35 -25
- package/dist/http/stored-body-replay.d.ts +3 -3
- package/dist/http/stored-body-replay.js +6 -1
- package/dist/http/wire-types.d.ts +66 -33
- package/dist/identity-source.d.ts +65 -0
- package/dist/identity-source.js +45 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/leader/wire.d.ts +7 -0
- package/dist/leader/wire.js +5 -4
- package/dist/mcp-assertion-header.d.ts +51 -40
- package/dist/mcp-assertion-header.js +10 -11
- package/dist/mcp-authorization-face.d.ts +27 -0
- package/dist/mcp-authorization-face.js +15 -0
- package/dist/memory-operator-faces.d.ts +13 -4
- package/dist/memory-operator-faces.js +1 -17
- package/dist/memory-store-refusal.d.ts +3 -3
- package/dist/memory-sync-client.js +72 -57
- package/dist/memory-sync.d.ts +1 -1
- package/dist/model-entry-refusal.d.ts +2 -0
- package/dist/model-entry-refusal.js +11 -0
- package/dist/model-route-gap.d.ts +6 -22
- package/dist/model-route-gap.js +7 -5
- package/dist/model-select.d.ts +6 -17
- package/dist/model-select.js +0 -3
- package/dist/mods-declaration.d.ts +110 -0
- package/dist/mods-declaration.js +109 -0
- package/dist/namespaced-rule-name.d.ts +1 -1
- package/dist/observability/err-text.d.ts +5 -0
- package/dist/observability/err-text.js +9 -0
- package/dist/observability/fail-open.d.ts +17 -1
- package/dist/observability/fail-open.js +17 -1
- package/dist/observability/metrics.js +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/operator-ask.d.ts +2 -2
- package/dist/org-delivery-gate.js +1 -1
- package/dist/org-memory-admission.d.ts +2 -2
- package/dist/org-memory-admission.js +39 -2
- package/dist/parked-decide.d.ts +15 -2
- package/dist/parked-decide.js +17 -10
- package/dist/peer-directory.js +2 -0
- package/dist/peer-seat.d.ts +150 -0
- package/dist/peer-seat.js +239 -0
- package/dist/permission-rule-list.d.ts +2 -2
- package/dist/permission-rule-vocab.d.ts +7 -7
- package/dist/permission-rule-vocab.js +3 -3
- package/dist/plain-string-record.d.ts +38 -0
- package/dist/plain-string-record.js +38 -0
- package/dist/plugins/background-agent-store-sql.js +6 -3
- package/dist/plugins/caching-session-store.d.ts +5 -0
- package/dist/plugins/caching-session-store.js +6 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +34 -29
- package/dist/plugins/checkpoint-store-sql.js +14 -14
- package/dist/plugins/file-history-store-sql.js +10 -16
- package/dist/plugins/file-run-store.js +8 -2
- package/dist/plugins/k8s-exec-protocol.d.ts +69 -13
- package/dist/plugins/k8s-exec-protocol.js +116 -28
- package/dist/plugins/k8s-pod-delete-failure.d.ts +25 -0
- package/dist/plugins/k8s-pod-delete-failure.js +17 -0
- package/dist/plugins/k8s-pod-reaper.d.ts +106 -0
- package/dist/plugins/k8s-pod-reaper.js +122 -0
- package/dist/plugins/local-checkpoint-store.d.ts +4 -17
- package/dist/plugins/local-checkpoint-store.js +3 -4
- package/dist/plugins/local-session-store.d.ts +66 -27
- package/dist/plugins/local-session-store.js +60 -28
- package/dist/plugins/mailbox-store-sql.d.ts +11 -3
- package/dist/plugins/mailbox-store-sql.js +103 -15
- package/dist/plugins/memory-run-store.js +2 -0
- package/dist/plugins/memory-sync-store-pg.d.ts +16 -5
- package/dist/plugins/memory-sync-store-tidb.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +34 -12
- package/dist/plugins/one-time-migrations.js +51 -9
- package/dist/plugins/permission-rule-store-file.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +17 -17
- package/dist/plugins/permission-rule-store-sql.js +37 -30
- package/dist/plugins/pg-pool.js +4 -0
- package/dist/plugins/pg-session-storage.d.ts +10 -2
- package/dist/plugins/pg-session-storage.js +20 -7
- package/dist/plugins/remote-env-adb.d.ts +6 -1
- package/dist/plugins/remote-env-adb.js +2 -1
- package/dist/plugins/remote-env-device.d.ts +6 -1
- package/dist/plugins/remote-env-device.js +5 -1
- package/dist/plugins/remote-env-e2b.d.ts +5 -0
- package/dist/plugins/remote-env-e2b.js +2 -1
- package/dist/plugins/remote-env-file-error.d.ts +8 -1
- package/dist/plugins/remote-env-file-error.js +7 -1
- package/dist/plugins/remote-env-host.d.ts +10 -2
- package/dist/plugins/remote-env-host.js +8 -2
- package/dist/plugins/remote-env-k8s.d.ts +140 -11
- package/dist/plugins/remote-env-k8s.js +277 -15
- package/dist/plugins/remote-env-local-docker.d.ts +5 -0
- package/dist/plugins/remote-env-local-docker.js +2 -1
- package/dist/plugins/remote-env-ssh.d.ts +6 -1
- package/dist/plugins/remote-env-ssh.js +2 -1
- package/dist/plugins/retention-store-sql.d.ts +14 -2
- package/dist/plugins/retention-store-sql.js +6 -0
- package/dist/plugins/run-store-sql.js +10 -4
- package/dist/plugins/session-fork.d.ts +10 -13
- package/dist/plugins/session-fork.js +5 -25
- package/dist/plugins/session-ownership.d.ts +24 -3
- package/dist/plugins/session-ownership.js +24 -5
- package/dist/plugins/session-workspace-cell.d.ts +17 -0
- package/dist/plugins/session-workspace-cell.js +38 -0
- package/dist/plugins/sql-errors.d.ts +23 -2
- package/dist/plugins/sql-errors.js +15 -0
- package/dist/plugins/store-backend.js +7 -7
- package/dist/plugins/store-contracts.d.ts +10 -1
- package/dist/plugins/store-fault.d.ts +2 -2
- package/dist/plugins/store-fault.js +4 -2
- package/dist/plugins/tidb-pool.js +13 -0
- package/dist/plugins/tidb-session-store.d.ts +17 -2
- package/dist/plugins/tidb-session-store.js +18 -7
- package/dist/plugins/tool-result-store-sql.d.ts +13 -6
- package/dist/plugins/tool-result-store-sql.js +8 -7
- package/dist/plugins/worktree-isolation.d.ts +3 -2
- package/dist/plugins/worktree-isolation.js +1 -7
- package/dist/project-identity.d.ts +1 -14
- package/dist/project-identity.js +0 -4
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +31 -2
- package/dist/request-value-closure.js +7 -1
- package/dist/rule-entry-list.d.ts +3 -2
- package/dist/rule-entry-list.js +2 -2
- package/dist/rules-consent.js +12 -7
- package/dist/run-local.d.ts +2 -2
- package/dist/run-local.js +12 -6
- package/dist/runs.d.ts +7 -1
- package/dist/runs.js +8 -2
- package/dist/runtime-governance.d.ts +5 -5
- package/dist/sandbox-git-lease.d.ts +49 -0
- package/dist/sandbox-git-lease.js +60 -0
- package/dist/sandbox-git-plane.d.ts +84 -0
- package/dist/sandbox-git-plane.js +105 -0
- package/dist/security.d.ts +16 -4
- package/dist/security.js +8 -3
- package/dist/server-secret-env.d.ts +12 -3
- package/dist/server-secret-env.js +18 -2
- package/dist/session-error-wire.d.ts +14 -6
- package/dist/session-error-wire.js +2 -1
- package/dist/session-incarnation.d.ts +4 -5
- package/dist/session-incarnation.js +2 -2
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-policy-wire.js +2 -2
- package/dist/session-sync.d.ts +1 -1
- package/dist/session-workspace.d.ts +130 -0
- package/dist/session-workspace.js +83 -0
- package/dist/spec-fields.d.ts +44 -14
- package/dist/spec-fields.js +33 -12
- package/dist/standing-answer-grant.d.ts +2 -13
- package/dist/standing-answer-grant.js +0 -7
- package/dist/stored-request-prompt-profile-m30.d.ts +49 -0
- package/dist/stored-request-prompt-profile-m30.js +25 -0
- package/dist/task-a2a.d.ts +44 -14
- package/dist/task-a2a.js +46 -20
- package/dist/task-mcp.d.ts +34 -21
- package/dist/task-mcp.js +46 -22
- package/dist/task-settings.d.ts +2 -2
- package/dist/tool-approval.d.ts +43 -9
- package/dist/tool-approval.js +57 -15
- package/dist/tool-rule-names.d.ts +5 -0
- package/dist/trace/core-keyset-guard.d.ts +34 -19
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +4 -0
- package/dist/trace/exit-seat.d.ts +20 -1
- package/dist/trace/exit-seat.js +5 -2
- package/dist/trace/extension-call-face.d.ts +33 -0
- package/dist/trace/extension-call-face.js +39 -0
- package/dist/trace/ledger-sink.d.ts +4 -5
- package/dist/trace/ledger-sink.js +3 -7
- package/dist/trace/project.d.ts +62 -10
- package/dist/trace/project.js +49 -9
- package/dist/trace/redact.d.ts +18 -6
- package/dist/trace/redact.js +154 -60
- package/dist/trace/self-minted-wire.d.ts +500 -7
- package/dist/trace/self-minted-wire.js +182 -1
- package/dist/trace/wire-projection-faces.d.ts +7 -5
- package/dist/trace/wire-projection-faces.js +9 -4
- package/dist/user-authored-text.d.ts +2 -2
- package/dist/user-authored-text.js +16 -1
- package/dist/web-admin-client/apply-effective.js +0 -1
- package/dist/web-admin-client/center-request.d.ts +23 -4
- package/dist/web-admin-client/center-request.js +42 -8
- package/dist/web-admin-client/http-client.js +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +8 -4
- package/dist/web-admin-client/skills-mcp.js +31 -18
- package/dist/web-admin-client/types.d.ts +10 -5
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +11 -5
- package/package.json +3 -3
- package/wire-changes/server@7.137.0.json +825 -0
- package/wire-changes/server@7.138.0.json +446 -0
|
@@ -44,8 +44,8 @@ type _GuardBgNotifReverse = AssertAllKeysHandled<Exclude<BgNotifProjected | BgNo
|
|
|
44
44
|
type RosterProjected = "name" | "agentId" | "sessionId" | "toolUseId" | "owner" | "scope" | "sessionScoped" | "rootSessionId" | "model" | "modelFallback" | "createdAt";
|
|
45
45
|
type _GuardRoster = AssertAllKeysHandled<Exclude<keyof RosterEntry, RosterProjected>>;
|
|
46
46
|
type _GuardRosterReverse = AssertAllKeysHandled<Exclude<RosterProjected, keyof RosterEntry>>;
|
|
47
|
-
type AskProjected = "toolName" | "toolCallId" | "args" | "message" | "sourceTaskId" | "fromSubagent" | "sourceAgentName" | "delegation" | "ruleOffers" | "ruleOffersAbsence" | "allowRuleShadowed" | "probeCause" | "probeReason" | "ruleEvidence" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "readRootCandidate" | "mandated" | "mandate" | "askClass" | "classes" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "approvalCard" | "boundGrantAbsence";
|
|
48
|
-
type AskExcluded = "preview" | "principal" | "riskAxes" | "boundInputHash" | "isDelegatedChild" | "hasBidiControls" | "previewWithheld" | "execCwd" | "authoredBy";
|
|
47
|
+
type AskProjected = "toolName" | "toolCallId" | "args" | "message" | "sourceTaskId" | "fromSubagent" | "sourceAgentName" | "delegation" | "ruleOffers" | "ruleOffersAbsence" | "allowRuleShadowed" | "probeCause" | "probeReason" | "ruleEvidence" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "readRootCandidate" | "mandated" | "mandate" | "askClass" | "classes" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "approvalCard" | "boundGrantAbsence" | "requestedBy";
|
|
48
|
+
type AskExcluded = "preview" | "principal" | "riskAxes" | "boundInputHash" | "isDelegatedChild" | "hasBidiControls" | "previewWithheld" | "execCwd" | "authoredBy" | "editRewritten";
|
|
49
49
|
type _GuardAsk = AssertAllKeysHandled<Exclude<keyof AskRequest, AskProjected | AskExcluded>>;
|
|
50
50
|
type _GuardAskReverse = AssertAllKeysHandled<Exclude<AskProjected | AskExcluded, keyof AskRequest>>;
|
|
51
51
|
type AskFrameServerMinted = "type" | "approvalId" | "argsOmitted" | "outcome" | "governanceForced" | "expiresAtMs" | "expiresInMs" | "serverNowMs" | "parked" | "cause" | "inputHasBidi" | "rememberRefused";
|
|
@@ -54,10 +54,10 @@ type _GuardAskFrameReverse = AssertAllKeysHandled<Exclude<AskProjected | AskFram
|
|
|
54
54
|
type TaskEventHandled = "text_delta" | "reasoning_delta" | "tool_start" | "tool_end" | "turn_end" | "compacted" | "diagnostics" | "message_committed" | "status" | "task_notification" | "task_progress" | "steering_injected" | "workspace_changed" | "done" | "context_usage" | "compaction_outcome" | "human_input" | "wiring_manifest" | "text_end" | "tool_roster_delta" | "tool_progress" | "tool_disclosure" | "task_started" | "compaction_started";
|
|
55
55
|
type _GuardTaskEvent = AssertAllKeysHandled<Exclude<TaskEvent["type"], TaskEventHandled>>;
|
|
56
56
|
type _GuardTaskEventReverse = AssertAllKeysHandled<Exclude<TaskEventHandled, TaskEvent["type"]>>;
|
|
57
|
-
type MailboxProjected = "seq" | "from" | "content" | "sentAt" | "hopChain" | "peerMeta";
|
|
57
|
+
type MailboxProjected = "seq" | "from" | "content" | "sentAt" | "hopChain" | "peerMeta" | "decision" | "id";
|
|
58
58
|
type _GuardMailbox = AssertAllKeysHandled<Exclude<keyof MailboxMessage, MailboxProjected>>;
|
|
59
59
|
type _GuardMailboxReverse = AssertAllKeysHandled<Exclude<MailboxProjected, keyof MailboxMessage>>;
|
|
60
|
-
type MailboxAppendProjected = "from" | "content" | "sentAt" | "hopChain" | "peerMeta";
|
|
60
|
+
type MailboxAppendProjected = "from" | "content" | "sentAt" | "hopChain" | "peerMeta" | "id";
|
|
61
61
|
type _GuardMailboxAppend = AssertAllKeysHandled<Exclude<keyof MailboxAppendMessage, MailboxAppendProjected>>;
|
|
62
62
|
type _GuardMailboxAppendReverse = AssertAllKeysHandled<Exclude<MailboxAppendProjected, keyof MailboxAppendMessage>>;
|
|
63
63
|
type WiringSectionProjected = "schemaVersion" | "leg" | "ask" | "question" | "interaction" | "elicit" | "parkLane" | "session" | "fleet" | "permissionRules" | "modelGate" | "autoMode" | "mcp" | "tools" | "mods" | "lsp" | "hands" | "writeProtection" | "teamRole" | "fileHistory" | "permissionMode" | "sessionRules" | "projectMemory";
|
|
@@ -66,10 +66,11 @@ type _GuardWiringSections = AssertAllKeysHandled<Exclude<keyof WiringManifest, W
|
|
|
66
66
|
type _GuardWiringSectionsReverse = AssertAllKeysHandled<Exclude<WiringSectionProjected | WiringSectionExcluded, keyof WiringManifest>>;
|
|
67
67
|
type WiringSection<K extends keyof WiringManifest> = NonNullable<WiringManifest[K]>;
|
|
68
68
|
type WiringLegHandled = "kind";
|
|
69
|
-
type
|
|
70
|
-
type
|
|
69
|
+
type WiringLegExcluded = "runOrigin";
|
|
70
|
+
type _GuardWiringLeg = AssertAllKeysHandled<Exclude<keyof WiringSection<"leg">, WiringLegHandled | WiringLegExcluded>>;
|
|
71
|
+
type _GuardWiringLegReverse = AssertAllKeysHandled<Exclude<WiringLegHandled | WiringLegExcluded, keyof WiringSection<"leg">>>;
|
|
71
72
|
type WiringModRowKeys = WiringSection<"mods">[number] extends infer R ? (R extends unknown ? keyof R : never) : never;
|
|
72
|
-
type WiringModRowHandled = "name" | "seat" | "tier" | "events" | "observe" | "skipped" | "refusedBy" | "reason";
|
|
73
|
+
type WiringModRowHandled = "name" | "seat" | "tier" | "provenance" | "events" | "observe" | "skipped" | "refusedBy" | "reason";
|
|
73
74
|
type _GuardWiringModRow = AssertAllKeysHandled<Exclude<WiringModRowKeys, WiringModRowHandled>>;
|
|
74
75
|
type _GuardWiringModRowReverse = AssertAllKeysHandled<Exclude<WiringModRowHandled, WiringModRowKeys>>;
|
|
75
76
|
type WiringModSkipKeys = keyof NonNullable<Extract<WiringSection<"mods">[number], {
|
|
@@ -108,7 +109,11 @@ type _GuardSubagentTranscriptTierWords = AssertAllKeysHandled<Exclude<SubagentTr
|
|
|
108
109
|
type _GuardSubagentTranscriptTierWordsReverse = AssertAllKeysHandled<Exclude<SubagentTranscriptTierWords, SubagentTranscriptTier>>;
|
|
109
110
|
type WiringMcpEntry = WiringSection<"mcp">[number];
|
|
110
111
|
type WiringMcpExcluded = "error";
|
|
111
|
-
type WiringMcpHandled = "name" | "source" | "status" | "errorCode" | "delivered" | "httpStatus" | "toolCount" | "liveness" | WiringMcpExcluded;
|
|
112
|
+
type WiringMcpHandled = "name" | "source" | "status" | "errorCode" | "delivered" | "httpStatus" | "toolCount" | "liveness" | "authorization" | WiringMcpExcluded;
|
|
113
|
+
type McpAuthorizationRecord = NonNullable<WiringMcpEntry["authorization"]>;
|
|
114
|
+
type McpAuthorizationTables = typeof import("../mcp-authorization-face.js");
|
|
115
|
+
type _GuardMcpAuthorization = AssertAllKeysHandled<Exclude<keyof McpAuthorizationRecord, TableCoreKeys<McpAuthorizationTables["MCP_AUTHORIZATION_DISPOSITIONS"]>>>;
|
|
116
|
+
type _GuardMcpAuthorizationReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<McpAuthorizationTables["MCP_AUTHORIZATION_DISPOSITIONS"]>, keyof McpAuthorizationRecord>>;
|
|
112
117
|
type _GuardWiringMcp = AssertAllKeysHandled<Exclude<keyof WiringMcpEntry, WiringMcpHandled>>;
|
|
113
118
|
type _GuardWiringMcpReverse = AssertAllKeysHandled<Exclude<WiringMcpHandled, keyof WiringMcpEntry>>;
|
|
114
119
|
type WiringMcpLiveness = NonNullable<WiringMcpEntry["liveness"]>;
|
|
@@ -212,27 +217,27 @@ type _GuardPromptManifestKeysNonEmpty = AssertAllKeysHandled<{
|
|
|
212
217
|
[L in keyof ManifestCore]: [ManifestDeclared<ManifestFaces, L>] extends [never] ? L : never;
|
|
213
218
|
}[keyof ManifestCore]>;
|
|
214
219
|
type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "boundGrantAbsence" | "checkpointId";
|
|
215
|
-
type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceTaskId" | "approvalCard" | "restoreMode" | "previewWithheld" | "authoredBy";
|
|
220
|
+
type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceTaskId" | "approvalCard" | "restoreMode" | "previewWithheld" | "authoredBy" | "runOrigin" | "requestedByCallId";
|
|
216
221
|
type _GuardInboxSummary = AssertAllKeysHandled<Exclude<keyof CheckpointSummary, SummaryProjected | SummaryExcluded>>;
|
|
217
222
|
type _GuardInboxSummaryReverse = AssertAllKeysHandled<Exclude<SummaryProjected | SummaryExcluded, keyof CheckpointSummary>>;
|
|
218
223
|
type ParkArmKeys = keyof Extract<PendingAction, {
|
|
219
224
|
kind: "tool_approval";
|
|
220
225
|
}>;
|
|
221
226
|
type ParkArmQueueProjected = "toolName" | "toolCallId" | "boundInputHash" | "ruleOffers" | "hasBidiControls" | keyof import("../approval-card.js").ParkRowFacts | keyof import("../approval-card.js").SkillCardFacts;
|
|
222
|
-
type ParkArmQueueExcluded = "kind" | "args" | "batchToolCallIds" | "completedCallIds" | "capabilityId" | "contractId" | "shapeDigest" | "implementationRevision" | "family" | "pathTarget" | "hostTarget" | "targets" | "names" | "preview" | "previewWithheld" | "execCwd" | "denialLimitFallback" | "authoredBy";
|
|
227
|
+
type ParkArmQueueExcluded = "kind" | "args" | "batchToolCallIds" | "completedCallIds" | "capabilityId" | "contractId" | "shapeDigest" | "implementationRevision" | "family" | "pathTarget" | "hostTarget" | "targets" | "targetReads" | "names" | "preview" | "previewWithheld" | "execCwd" | "denialLimitFallback" | "authoredBy" | "engineMounted" | "declarationDigest";
|
|
223
228
|
type _GuardParkArmQueue = AssertAllKeysHandled<Exclude<ParkArmKeys, ParkArmQueueProjected | ParkArmQueueExcluded>>;
|
|
224
229
|
type _GuardParkArmQueueReverse = AssertAllKeysHandled<Exclude<ParkArmQueueProjected | ParkArmQueueExcluded, ParkArmKeys>>;
|
|
225
230
|
type _NoDoubleBookParkArmQueue = AssertAllKeysHandled<Extract<ParkArmQueueProjected, ParkArmQueueExcluded>>;
|
|
226
|
-
type TaskSpecWired = "objective" | "principal" | "images" | "sessionId" | "requireExistingSession" | "oneShot" | "clientContext" | "resumeAt" | "resumeAtMode" | "model" | "compactionModel" | "thinking" | "systemPrompt" | "appendSystemPrompt" | "promptRole" | "promptBinding" | "memory" | "suggestNextPrompts" | "restoreFiles" | "acceptPartialRestore" | "rewindFilesTo" | "tools" | "excludeTools" | "deferTools" | "toolMaterializeStrategy" | "
|
|
231
|
+
type TaskSpecWired = "objective" | "principal" | "images" | "sessionId" | "requireExistingSession" | "oneShot" | "clientContext" | "resumeAt" | "resumeAtMode" | "model" | "compactionModel" | "thinking" | "systemPrompt" | "appendSystemPrompt" | "promptRole" | "promptBinding" | "memory" | "suggestNextPrompts" | "restoreFiles" | "acceptPartialRestore" | "rewindFilesTo" | "tools" | "excludeTools" | "deferTools" | "toolMaterializeStrategy" | "promptLean" | "toolPolicy" | "onAsk" | "onQuestion" | "mods" | "durableApproval" | "resourceSuspend" | "resilience" | "finalVerification" | "checkpointStore" | "handsReadOnly" | "memoryPersistenceCapable" | "additionalDirectories" | "additionalReadDirectories" | "enablePlanMode" | "interactiveTools" | "enableFork" | "shellGate" | "approvalReach" | "writeFace" | "mcp" | "a2a" | "skills" | "backgroundScope" | "envFacts" | "limits" | "configOverrides" | "forwardSubagentEvents" | "retainSubagentSessions" | "retainBackgroundProcesses" | "outputSchema" | "outputRetries" | "compaction" | "attachments" | "selfOrchestration" | "getApiKeyAndHeaders" | "interactionPosture" | "agents" | "permissionMode" | "taskId" | "signal" | "preemptSignal" | "maxSuspends" | "skillListingBudgetFraction" | "skillListingMaxDescChars" | "excludeAllTools" | "fileHistory" | "userInvokedSkills" | "outputStyle" | "projectMemory" | "allowedTools" | "allowTools" | "userAttachments" | "readDenyPatterns" | "writeProtectedAdditions" | "complianceAdditionalDenies" | "projectId";
|
|
227
232
|
/** 导出:请求体键闭集门(`request-key-closure.ts`)据它锁「本仓记为未接线的引擎座,提交口不许受理」—— 两处分类只能同向。 */
|
|
228
|
-
export type TaskSpecUnwired = "actor" | "roles" | "lspManager" | "tracer" | "readFace" | "interactiveQuestionFallback" | "alwaysLoadTools" | "restoreGatedTools" | "deferSelfResolve" | "basePolicyForResumeEdit" | "lspDiagnostics" | "streamingToolExecution" | "toolResultThresholdChars" | "peerPresence" | "modelRole" | "enableBlockedReport" | "promptForm" | "advisorModel";
|
|
233
|
+
export type TaskSpecUnwired = "actor" | "roles" | "lspManager" | "tracer" | "readFace" | "interactiveQuestionFallback" | "alwaysLoadTools" | "restoreGatedTools" | "deferSelfResolve" | "basePolicyForResumeEdit" | "lspDiagnostics" | "streamingToolExecution" | "toolResultThresholdChars" | "peerPresence" | "modelRole" | "enableBlockedReport" | "promptForm" | "advisorModel" | "runOrigin" | "planFile" | "classifyAllShell";
|
|
229
234
|
type _GuardTaskSpec = AssertAllKeysHandled<Exclude<keyof TaskSpec, TaskSpecWired | TaskSpecUnwired>>;
|
|
230
235
|
type _GuardTaskSpecReverse = AssertAllKeysHandled<Exclude<TaskSpecWired | TaskSpecUnwired, keyof TaskSpec>>;
|
|
231
|
-
type TaskResultForwarded = "taskId" | "runId" | "sessionId" | "terminal" | "model" | "effectiveReasoning" | "result" | "salvagedOutput" | "remoteEnvFailures" | "apiFailure" | "retryAfterMs" | "degraded" | "structuredOutput" | "rewindNotes" | "haltedOnUserRejection" | "haltedByUser" | "strandedHumanAnswers" | "pendingApproval" | "approvalWaitedMs" | "effectiveReadFace" | "effectiveReadDenyPatterns" | "effectiveWriteFace" | "effectiveMemoryScopes" | "stats" | "editedFiles" | "responseModel" | "compaction";
|
|
236
|
+
type TaskResultForwarded = "taskId" | "runId" | "sessionId" | "terminal" | "model" | "effectiveReasoning" | "result" | "salvagedOutput" | "remoteEnvFailures" | "apiFailure" | "retryAfterMs" | "degraded" | "structuredOutput" | "rewindNotes" | "haltedOnUserRejection" | "haltedByUser" | "strandedHumanAnswers" | "pendingApproval" | "approvalWaitedMs" | "effectiveReadFace" | "effectiveReadDenyPatterns" | "effectiveWriteFace" | "effectiveMemoryScopes" | "stats" | "editedFiles" | "responseModel" | "compaction" | "resultEntryIds";
|
|
232
237
|
type TaskResultStripped = never;
|
|
233
238
|
type _GuardTaskResult = AssertAllKeysHandled<Exclude<keyof TaskResult, TaskResultForwarded | TaskResultStripped>>;
|
|
234
239
|
type _GuardTaskResultReverse = AssertAllKeysHandled<Exclude<TaskResultForwarded | TaskResultStripped, keyof TaskResult>>;
|
|
235
|
-
type PausedCauseForwarded = "kind" | "gate" | "checkpointId" | "restoreMode";
|
|
240
|
+
type PausedCauseForwarded = "kind" | "gate" | "checkpointId" | "restoreMode" | "requestedByCallId";
|
|
236
241
|
type PausedCauseStripped = "token";
|
|
237
242
|
type _GuardPausedCause = AssertAllKeysHandled<Exclude<keyof PausedCause, PausedCauseForwarded | PausedCauseStripped>>;
|
|
238
243
|
type _GuardPausedCauseReverse = AssertAllKeysHandled<Exclude<PausedCauseForwarded | PausedCauseStripped, keyof PausedCause>>;
|
|
@@ -247,7 +252,7 @@ type SessionMemoryStatusProjected = "captureOptedOut" | "committedCount" | "fold
|
|
|
247
252
|
type SessionMemoryStatusExcluded = "writeHome";
|
|
248
253
|
type _GuardSessionMemoryStatus = AssertAllKeysHandled<Exclude<keyof SessionMemoryStatus, SessionMemoryStatusProjected | SessionMemoryStatusExcluded>>;
|
|
249
254
|
type _GuardSessionMemoryStatusReverse = AssertAllKeysHandled<Exclude<SessionMemoryStatusProjected | SessionMemoryStatusExcluded, keyof SessionMemoryStatus>>;
|
|
250
|
-
type SideQueryResultForwarded = "text" | "toolCalls" | "model" | "servedModel" | "degraded" | "responseModel" | "usage" | "usageMissing" | "stopReason" | "errorMessage" | "errorCode" | "errorKind" | "inputTooLongRuledOut";
|
|
255
|
+
type SideQueryResultForwarded = "text" | "toolCalls" | "model" | "servedModel" | "degraded" | "responseModel" | "usage" | "usageMissing" | "stopReason" | "errorMessage" | "errorCode" | "errorKind" | "inputTooLongRuledOut" | "account";
|
|
251
256
|
type SideQueryResultStripped = never;
|
|
252
257
|
type _GuardSideQueryResult = AssertAllKeysHandled<Exclude<keyof SideQueryResult, SideQueryResultForwarded | SideQueryResultStripped>>;
|
|
253
258
|
type _GuardSideQueryResultReverse = AssertAllKeysHandled<Exclude<SideQueryResultForwarded | SideQueryResultStripped, keyof SideQueryResult>>;
|
|
@@ -261,7 +266,7 @@ type GateOutcomeProjected = "disposition" | "settlement" | "origin";
|
|
|
261
266
|
type _GuardGateOutcome = AssertAllKeysHandled<Exclude<keyof GateOutcome, GateOutcomeProjected>>;
|
|
262
267
|
type _GuardGateOutcomeReverse = AssertAllKeysHandled<Exclude<GateOutcomeProjected, keyof GateOutcome>>;
|
|
263
268
|
type GateDispositionKeys = GateDisposition extends infer D ? (D extends object ? keyof D : never) : never;
|
|
264
|
-
type GateDispositionProjected = "kind" | "deniedBy" | "cause" | "classifier" | "released" | "clearedBy" | "mode" | "askClass" | "classes";
|
|
269
|
+
type GateDispositionProjected = "kind" | "deniedBy" | "cause" | "classifier" | "released" | "clearedBy" | "mode" | "askClass" | "classes" | "extension";
|
|
265
270
|
type _GuardGateDisposition = AssertAllKeysHandled<Exclude<GateDispositionKeys, GateDispositionProjected>>;
|
|
266
271
|
type _GuardGateDispositionReverse = AssertAllKeysHandled<Exclude<GateDispositionProjected, GateDispositionKeys>>;
|
|
267
272
|
type SettlementProjected = "kind" | "who" | "when" | "note";
|
|
@@ -301,12 +306,12 @@ type McpReconnectWithheld = "axes" | "dropped" | "warnings";
|
|
|
301
306
|
type _GuardMcpReconnect = AssertAllKeysHandled<Exclude<keyof McpReconnectResult, McpReconnectProjected | McpReconnectWithheld>>;
|
|
302
307
|
type _NoDoubleBookMcpReconnect = AssertAllKeysHandled<Extract<McpReconnectProjected, McpReconnectWithheld>>;
|
|
303
308
|
type _GuardMcpReconnectReverse = AssertAllKeysHandled<Exclude<McpReconnectProjected | McpReconnectWithheld, keyof McpReconnectResult>>;
|
|
304
|
-
type McpRedialStatusProjected = "name" | "status" | "errorCode" | "httpStatus" | "delivered" | "serverInfo" | "error" | "transportClosed";
|
|
309
|
+
type McpRedialStatusProjected = "name" | "status" | "errorCode" | "httpStatus" | "delivered" | "authorization" | "serverInfo" | "error" | "transportClosed";
|
|
305
310
|
type McpRedialStatusWithheld = "toolNames" | "liveness";
|
|
306
311
|
type _GuardMcpRedialStatus = AssertAllKeysHandled<Exclude<keyof McpServerStatus, McpRedialStatusProjected | McpRedialStatusWithheld>>;
|
|
307
312
|
type _NoDoubleBookMcpRedialStatus = AssertAllKeysHandled<Extract<McpRedialStatusProjected, McpRedialStatusWithheld>>;
|
|
308
313
|
type _GuardMcpRedialStatusReverse = AssertAllKeysHandled<Exclude<McpRedialStatusProjected | McpRedialStatusWithheld, keyof McpServerStatus>>;
|
|
309
|
-
type McpPanelStatusProjected = "name" | "status" | "serverInfo" | "toolNames" | "error";
|
|
314
|
+
type McpPanelStatusProjected = "name" | "status" | "serverInfo" | "toolNames" | "error" | "authorization";
|
|
310
315
|
type McpPanelStatusWithheld = "errorCode" | "httpStatus" | "delivered" | "transportClosed" | "liveness";
|
|
311
316
|
type _GuardMcpPanelStatus = AssertAllKeysHandled<Exclude<keyof McpServerStatus, McpPanelStatusProjected | McpPanelStatusWithheld>>;
|
|
312
317
|
type _NoDoubleBookMcpPanelStatus = AssertAllKeysHandled<Extract<McpPanelStatusProjected, McpPanelStatusWithheld>>;
|
|
@@ -323,6 +328,12 @@ type _NoDoubleBookLspOptions = AssertAllKeysHandled<Extract<LspOptionsWired, Lsp
|
|
|
323
328
|
/** ⑯ 账上记过、已接线的 `RunnerDeps` 席([ref] 起 `fileHistoryCapture`)。反向钉:core 改名 / 退役 ⇒ 红。 */
|
|
324
329
|
type RunnerDepsLedgerWired = "fileHistoryCapture";
|
|
325
330
|
type _GuardLedgerRunnerDepsReverse = AssertAllKeysHandled<Exclude<RunnerDepsLedgerWired, keyof RunnerDeps>>;
|
|
331
|
+
type SessionWorkspaceTables = typeof import("../session-workspace.js");
|
|
332
|
+
type WorkspaceChangedArm = Extract<TaskEvent, {
|
|
333
|
+
type: "workspace_changed";
|
|
334
|
+
}>;
|
|
335
|
+
type _GuardSessionWorkspace = AssertAllKeysHandled<Exclude<keyof WorkspaceChangedArm, TableCoreKeys<SessionWorkspaceTables["SESSION_WORKSPACE_DISPOSITIONS"]>>>;
|
|
336
|
+
type _GuardSessionWorkspaceReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<SessionWorkspaceTables["SESSION_WORKSPACE_DISPOSITIONS"]>, keyof WorkspaceChangedArm>>;
|
|
326
337
|
export type CoreKeysetGuards = [
|
|
327
338
|
_GuardNotification,
|
|
328
339
|
_GuardTerminalArm,
|
|
@@ -384,6 +395,8 @@ export type CoreKeysetGuards = [
|
|
|
384
395
|
_GuardWiringModSkipReverse,
|
|
385
396
|
_GuardWiringMcp,
|
|
386
397
|
_GuardWiringMcpReverse,
|
|
398
|
+
_GuardMcpAuthorization,
|
|
399
|
+
_GuardMcpAuthorizationReverse,
|
|
387
400
|
_GuardWiringRules,
|
|
388
401
|
_GuardWiringRulesReverse,
|
|
389
402
|
_GuardWiringModelGate,
|
|
@@ -463,7 +476,9 @@ export type CoreKeysetGuards = [
|
|
|
463
476
|
_GuardLspOptions,
|
|
464
477
|
_NoDoubleBookLspOptions,
|
|
465
478
|
_GuardLspOptionsReverse,
|
|
466
|
-
_GuardLedgerRunnerDepsReverse
|
|
479
|
+
_GuardLedgerRunnerDepsReverse,
|
|
480
|
+
_GuardSessionWorkspace,
|
|
481
|
+
_GuardSessionWorkspaceReverse
|
|
467
482
|
];
|
|
468
483
|
export {};
|
|
469
484
|
//# sourceMappingURL=core-keyset-guard.d.ts.map
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* 同文件 G1 e2e 的全码扇出夹具、以及契约文档附录 D.3 那张表(含**小节标题里的码数** —— 那道门本批
|
|
17
17
|
* 刚立,立完就在下一次加码时自己咬住了)。
|
|
18
18
|
*/
|
|
19
|
-
export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.records_skipped", "server.model_unreachable", "permission.entry_mode_clamped", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored", "route.credential_origin_mismatch", "mods.registration_refused", "config.session_rules_earlier_grammar", "advisor.not_attached"];
|
|
19
|
+
export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.records_skipped", "server.model_unreachable", "permission.entry_mode_clamped", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored", "route.credential_origin_mismatch", "mods.registration_refused", "config.session_rules_earlier_grammar", "advisor.not_attached", "inherit_env.names_withheld", "model.capability_downgraded", "context.image_removed", "mcp.authorization_required"];
|
|
20
20
|
export type EngineNoticeWireCode = (typeof ENGINE_NOTICE_WIRE_CODES)[number];
|
|
21
21
|
/** 白名单谓词(单点):路由与门都读这一个,不许第二处手抄码串。 */
|
|
22
22
|
export declare function isEngineNoticeWireCode(code: string): code is EngineNoticeWireCode;
|
|
@@ -44,6 +44,10 @@ export const ENGINE_NOTICE_WIRE_CODES = [
|
|
|
44
44
|
"mods.registration_refused",
|
|
45
45
|
"config.session_rules_earlier_grammar",
|
|
46
46
|
"advisor.not_attached",
|
|
47
|
+
"inherit_env.names_withheld",
|
|
48
|
+
"model.capability_downgraded",
|
|
49
|
+
"context.image_removed",
|
|
50
|
+
"mcp.authorization_required",
|
|
47
51
|
];
|
|
48
52
|
const WIRE_CODES = new Set(ENGINE_NOTICE_WIRE_CODES);
|
|
49
53
|
export function isEngineNoticeWireCode(code) {
|
|
@@ -13,7 +13,14 @@ export type SafeText = string & {
|
|
|
13
13
|
* · `operator-log-arg`:运维日志字段里模型写的工具入参(`tool_trace` 的 `arg.*`:路径 / 命令 / 模式 / 非对象入参的串形);界 120 码元(含截断记号);
|
|
14
14
|
* · `operator-log-error`:运维日志字段里 hook 一侧的报错 —— hook 命令的 stderr、prompt 条目的载体失败句、起子进程 / 读会话分支抛出的句子;界 300 码元(含截断记号);
|
|
15
15
|
* · `operator-log-message`:运维日志字段里写给人看的一段话 —— hook 输出的 `systemMessage`、Stop 评估者判「做不到」的理由;界 500 码元(含截断记号);
|
|
16
|
-
* · `session-title`:自动标题器落行的会话标题(落库 / 列表面 / `session_titled` 帧同一份);界 80 码元(含截断记号),在 `title`
|
|
16
|
+
* · `session-title`:自动标题器落行的会话标题(落库 / 列表面 / `session_titled` 帧同一份);界 80 码元(含截断记号),在 `title` 列宽之内;
|
|
17
|
+
* · `mcp-remote-text`:MCP 远端失败句(远端可控自由文本,租户面)—— `GET /v1/sessions/:id/mcp` 面板的 `servers[].error` 与 `POST /v1/sessions/:id/mcp/reconnect`
|
|
18
|
+
* 的 `reason` / `status.error` / `listingIncomplete.error`;引擎铸点已抹过请求回显与同主体词表(记号 `[redacted]`),这一行读同一个脱敏器(引擎记号 = 已抹的值,
|
|
19
|
+
* 引擎放过的形照抹);界 200 码元,原样出门(JSON 串值,消费方自己渲染)。
|
|
20
|
+
* · `peer-declaration-sentence`:引擎判官对一份 MCP / A2A 对端声明说的句子(`toolAxes` / `toolFaces` / `sessionMetaKey` / 启动界的原因句,逐字带着声明方写的工具名、键名),
|
|
21
|
+
* 进请求面 400 拒句、续跑重放的丢弃行与重读行、名册的跳过行 —— 读者是调用方与运维,句子已是一行;不设界(拒句要说全判官的话),原样出门。
|
|
22
|
+
* · `boot-refusal-line`:起服拒启的一行拒句 —— 部署座装配的拒句(`mods-declaration.ts`:声明的席名、包名、读包者 / 引擎准入交回的话);它经进程级 fatal 出口原样多行进 stderr,
|
|
23
|
+
* 所以必须在这里先压成一行(一句拒因里的换行会在运维的终端里伪造出第二条日志行);界 512 码元(含截断记号)。
|
|
17
24
|
*/
|
|
18
25
|
declare const EXIT_SEATS: {
|
|
19
26
|
readonly "trace-frame-text": {
|
|
@@ -48,6 +55,18 @@ declare const EXIT_SEATS: {
|
|
|
48
55
|
readonly maxChars: 80;
|
|
49
56
|
readonly emit: "title-line";
|
|
50
57
|
};
|
|
58
|
+
readonly "mcp-remote-text": {
|
|
59
|
+
readonly scope: "free-text";
|
|
60
|
+
readonly maxChars: 200;
|
|
61
|
+
};
|
|
62
|
+
readonly "peer-declaration-sentence": {
|
|
63
|
+
readonly scope: "free-text";
|
|
64
|
+
};
|
|
65
|
+
readonly "boot-refusal-line": {
|
|
66
|
+
readonly scope: "free-text";
|
|
67
|
+
readonly maxChars: 512;
|
|
68
|
+
readonly emit: "log-line";
|
|
69
|
+
};
|
|
51
70
|
};
|
|
52
71
|
export type ExitSeat = keyof typeof EXIT_SEATS;
|
|
53
72
|
/** 设了界的座名。 */
|
package/dist/trace/exit-seat.js
CHANGED
|
@@ -3,7 +3,7 @@ import { CALLER_TEXT_CUT_MARK } from "../caller-text-echo.js";
|
|
|
3
3
|
import { errorKindOf } from "../observability/err-text.js";
|
|
4
4
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
5
5
|
import { OVERSIZED_REDACTION_PLACEHOLDER } from "../observability/run-terminal.js";
|
|
6
|
-
import { proposeRedactionSpans, readingHeadEnd, REDACTION_TOKEN_RE_SRC } from "./redact.js";
|
|
6
|
+
import { proposeRedactionSpans, readingHeadEnd, REDACTION_TOKEN_RE_SRC, WHOLE_EXTENT } from "./redact.js";
|
|
7
7
|
const EXIT_SEATS = {
|
|
8
8
|
"trace-frame-text": { scope: "free-text" },
|
|
9
9
|
"trace-frame-line": { scope: "free-text", maxChars: 300 },
|
|
@@ -12,6 +12,9 @@ const EXIT_SEATS = {
|
|
|
12
12
|
"operator-log-error": { scope: "free-text", maxChars: 300, emit: "log-line" },
|
|
13
13
|
"operator-log-message": { scope: "free-text", maxChars: 500, emit: "log-line" },
|
|
14
14
|
"session-title": { scope: "free-text", maxChars: 80, emit: "title-line" },
|
|
15
|
+
"mcp-remote-text": { scope: "free-text", maxChars: 200 },
|
|
16
|
+
"peer-declaration-sentence": { scope: "free-text" },
|
|
17
|
+
"boot-refusal-line": { scope: "free-text", maxChars: 512, emit: "log-line" },
|
|
15
18
|
};
|
|
16
19
|
export function seatMaxChars(seat) {
|
|
17
20
|
return EXIT_SEATS[seat].maxChars;
|
|
@@ -118,7 +121,7 @@ export function seatText(seat, text) {
|
|
|
118
121
|
out = "";
|
|
119
122
|
else {
|
|
120
123
|
const emitUntil = regionEnd;
|
|
121
|
-
const extent = windowEnd === undefined ?
|
|
124
|
+
const extent = windowEnd === undefined || regionEnd === undefined ? WHOLE_EXTENT : { kind: "head", emitEnd: regionEnd };
|
|
122
125
|
const rendered = renderOnce(head, mergeSpans(proposeRedactionSpans(head, row.scope, layout, extent)), emitUntil);
|
|
123
126
|
out = boundRow(row.emit === undefined ? rendered : emitAs(row.emit, rendered), row, windowEnd !== undefined);
|
|
124
127
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 扩展自己发起 / 代答 / 改写的工具调用在 wire 上的三位 —— `requestedBy`(谁要的这只调用)、`answeredBy`(哪张注册在 `tool.call` 上代替工具体作答)与
|
|
3
|
+
* `tool_end.rewrite`(门放行时交给工具体的参数不是它收进来的那份:放行的那份 + 谁改的)的**唯一读法**。
|
|
4
|
+
*
|
|
5
|
+
* 引擎的事实(core `ExtensionRequester` / `tool_end.answeredBy`):一张注册经 `$.tool.call` 发起的调用,`tool_start` / `tool_end` 与审批卡都带
|
|
6
|
+
* `requestedBy: { kind: "extension", name }`(模型消息带来的调用上缺席);注册在 `tool.call` 站上以自己的结果或拒答代替工具体时,`tool_end` 带
|
|
7
|
+
* `answeredBy: <注册名>`(旁边恒有 `notExecuted: true`)。本仓的部署座装上运维声明的包之后,这两位真能到达 —— 投影它们。
|
|
8
|
+
*
|
|
9
|
+
* 读法(写腿与读腿、帧与卡同一只):
|
|
10
|
+
* · 注册名是**注册方定的串** ⇒ 过 {@link sanitizeWireText}(与 `wiring_manifest.mods[]` 的 `name`、通告 `mods.registration_refused` 同一只出口纪律),
|
|
11
|
+
* 同一张注册在三处的名逐字节相等;
|
|
12
|
+
* · 形不对(`kind` 不是 `"extension"`、`name` 不是非空串、`answeredBy` 不是非空串)⇒ 丢这一位、计一次 `server.trace.projection-input-malformed`
|
|
13
|
+
* (纯归因位:半张归因比没有更坏,不修补);缺席 = 没有这件事(正面事实),不计;
|
|
14
|
+
* · `rewrite`(引擎 7.58.0 `ToolInputRewrite`)整只一位:`by` 每项是改写者(扩展项的注册名同上过出口纪律;`policy` / `approver` 两项无成员),`input` 是工具参数
|
|
15
|
+
* (模型 / 扩展 / 审批人写的)⇒ 经调用方交进来的工具参数投影 —— 与 `tool_start.args` 同一只(`trace/project.ts` 的那一只;本文件不自己答脱敏);
|
|
16
|
+
* `by` 不是非空数组、有一项不在三形里、缺 `input` ⇒ 整只丢 + 计一次。
|
|
17
|
+
* 续跑腿的帧引擎不带它(引擎的未覆盖面),本读法不补。
|
|
18
|
+
*/
|
|
19
|
+
import type { ExtensionRequester, RewriteAuthor } from "@sema-agent/core";
|
|
20
|
+
/** wire 上的发起者位 = 引擎的 `ExtensionRequester` 同形(`name` 已过出口纪律);引擎加一类发起者 ⇒ 这里的形随之,读法下面一处判。 */
|
|
21
|
+
export type ExtensionRequesterFace = Readonly<ExtensionRequester>;
|
|
22
|
+
/** `requestedBy` 的投影(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。`where` 进留痕句(哪一面:`tool_start` / `tool_end` / `tool_approval` / 读腿)。 */
|
|
23
|
+
export declare function extensionRequesterOf(v: unknown, where: string): ExtensionRequesterFace | undefined;
|
|
24
|
+
/** `answeredBy` 的投影(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。 */
|
|
25
|
+
export declare function extensionAnswererOf(v: unknown, where: string): string | undefined;
|
|
26
|
+
/** wire 上的改写记录 = 引擎的 `ToolInputRewrite` 同形(扩展项的 `name` 已过出口纪律、`input` 已脱敏)。 */
|
|
27
|
+
export interface ToolInputRewriteFace {
|
|
28
|
+
readonly by: readonly Readonly<RewriteAuthor>[];
|
|
29
|
+
readonly input: unknown;
|
|
30
|
+
}
|
|
31
|
+
/** `tool_end.rewrite` 的投影(缺席 ⇒ 缺席;形不对 ⇒ 整只丢 + 计一次)。`argsOnWire` = 工具参数上 wire 的那一只投影(与 `tool_start.args` 同一只,调用方交进来)。 */
|
|
32
|
+
export declare function toolInputRewriteOf(v: unknown, where: string, argsOnWire: (args: unknown) => unknown): ToolInputRewriteFace | undefined;
|
|
33
|
+
//# sourceMappingURL=extension-call-face.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { sanitizeWireText } from "./engine-notice-wire.js";
|
|
2
|
+
import { dropProjectedFace } from "./projection-drop.js";
|
|
3
|
+
export function extensionRequesterOf(v, where) {
|
|
4
|
+
if (v === undefined)
|
|
5
|
+
return undefined;
|
|
6
|
+
if (typeof v === "object" && v !== null && "kind" in v && "name" in v && v.kind === "extension" && typeof v.name === "string" && v.name !== "")
|
|
7
|
+
return { kind: "extension", name: sanitizeWireText(v.name) };
|
|
8
|
+
return dropProjectedFace("extension_call.requestedBy is not { kind: extension, name: <non-empty string> } on " + where);
|
|
9
|
+
}
|
|
10
|
+
export function extensionAnswererOf(v, where) {
|
|
11
|
+
if (v === undefined)
|
|
12
|
+
return undefined;
|
|
13
|
+
if (typeof v === "string" && v !== "")
|
|
14
|
+
return sanitizeWireText(v);
|
|
15
|
+
return dropProjectedFace("extension_call.answeredBy is not a non-empty string on " + where);
|
|
16
|
+
}
|
|
17
|
+
const REWRITE_AUTHOR_READERS = {
|
|
18
|
+
extension: (v) => ("name" in v && typeof v.name === "string" && v.name !== "" ? { kind: "extension", name: sanitizeWireText(v.name) } : undefined),
|
|
19
|
+
policy: () => ({ kind: "policy" }),
|
|
20
|
+
approver: () => ({ kind: "approver" }),
|
|
21
|
+
};
|
|
22
|
+
const isRewriteAuthorKind = (kind) => typeof kind === "string" && Object.hasOwn(REWRITE_AUTHOR_READERS, kind);
|
|
23
|
+
function rewriteAuthorOf(v) {
|
|
24
|
+
if (typeof v !== "object" || v === null || !("kind" in v))
|
|
25
|
+
return undefined;
|
|
26
|
+
const kind = v.kind;
|
|
27
|
+
return isRewriteAuthorKind(kind) ? REWRITE_AUTHOR_READERS[kind](v) : undefined;
|
|
28
|
+
}
|
|
29
|
+
export function toolInputRewriteOf(v, where, argsOnWire) {
|
|
30
|
+
if (v === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
if (typeof v === "object" && v !== null && "by" in v && "input" in v && Array.isArray(v.by) && v.by.length > 0) {
|
|
33
|
+
const by = Array.from(v.by, rewriteAuthorOf);
|
|
34
|
+
if (by.every((a) => a !== undefined))
|
|
35
|
+
return { by, input: argsOnWire(v.input) };
|
|
36
|
+
}
|
|
37
|
+
return dropProjectedFace("tool_end.rewrite is not { by: <non-empty list of extension / policy / approver>, input } on " + where);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=extension-call-face.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type TerminalCause } from "@sema-agent/core";
|
|
2
|
-
import { brainStatusEventData } from "./project.js";
|
|
2
|
+
import { brainStatusEventData, type LegWiringSections } from "./project.js";
|
|
3
3
|
import { NotifiedKeys } from "../orchestration/workflow-completion-inbox.js";
|
|
4
4
|
import { type LedgerEventType, type ParkLedgerEventType } from "./ledger-events.js";
|
|
5
|
-
import type { InstructionsSegment } from "../instruction-selection.js";
|
|
6
5
|
/**
|
|
7
6
|
* LedgerSink — the SINGLE "stream event → durable runs-ledger" projection, shared by the background leg
|
|
8
7
|
* (runs.ts `runInBackground`) and the sync `/v1/tasks/stream` detach lane (server.ts, `x-detach-on-disconnect`).
|
|
@@ -152,8 +151,8 @@ export declare function createLedgerSink(opts: {
|
|
|
152
151
|
* 各传自己看得见的那个词(位①=流事件 `ev.type`,位②=账本行 `type`);拿不到类型的打点方
|
|
153
152
|
* (core 的 onActivity 第五席、resume 腿手动打点)省参,`kind` 诚实缺席(见 turn-activity.ts)。 */
|
|
154
153
|
onActivity?: (kind?: string, statusData?: Record<string, unknown>) => void;
|
|
155
|
-
/** [ref]
|
|
156
|
-
*
|
|
157
|
-
|
|
154
|
+
/** 这条腿的 `wiring_manifest` **本仓自铸段**(`LegWiringSections`:[ref] `instructions` 读腿的 `InstructionSelectionLeg.segment`、run 级 `skills` 读 spec 字段
|
|
155
|
+
* `runSkillsOf`)。**必填**:账本行与 live 帧是同一条腿的两个载体,段必须来自同一只腿;在投帧那一刻读(core 推帧之前已 await 过 loader)。 */
|
|
156
|
+
legSections: () => LegWiringSections;
|
|
158
157
|
}): LedgerSink;
|
|
159
158
|
//# sourceMappingURL=ledger-sink.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {} from "@sema-agent/core";
|
|
2
2
|
import { outwardPlane } from "../terminal.js";
|
|
3
3
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
4
|
-
import { modelTextEventData, toolStartEventData, toolEndEventData, taskProgressEventData, taskStartedEventData, taskNotificationEventData, compactedEventData, diagnosticsEventData, brainStatusEventData, steeringInjectedEventData, compactionOutcomeEventData, compactionStartedEventData, workspaceChangedEventData, wiringManifestEventData, toolRosterDeltaEventData, toolDisclosureEventData, humanInputEventData, turnEndEventData, contextUsageEventData } from "./project.js";
|
|
4
|
+
import { modelTextEventData, toolStartEventData, toolEndEventData, taskProgressEventData, taskStartedEventData, taskNotificationEventData, compactedEventData, diagnosticsEventData, brainStatusEventData, steeringInjectedEventData, compactionOutcomeEventData, compactionStartedEventData, workspaceChangedEventData, wiringManifestEventData, toolRosterDeltaEventData, toolDisclosureEventData, humanInputEventData, turnEndEventData, contextUsageEventData, parkEventData } from "./project.js";
|
|
5
5
|
import { NotifiedKeys, taskNotificationStreamKeyOf } from "../orchestration/workflow-completion-inbox.js";
|
|
6
6
|
import { isParkLedgerEventType } from "./ledger-events.js";
|
|
7
7
|
import { isModelSegmentBoundary, reasoningDeltaBytes, reasoningSegmentEventId } from "./model-segment.js";
|
|
@@ -115,7 +115,7 @@ export function createLedgerSink(opts) {
|
|
|
115
115
|
await append("workspace_changed", workspaceChangedEventData(ev));
|
|
116
116
|
break;
|
|
117
117
|
case "wiring_manifest":
|
|
118
|
-
await append("wiring_manifest", wiringManifestEventData(ev, opts.
|
|
118
|
+
await append("wiring_manifest", wiringManifestEventData(ev, opts.legSections()));
|
|
119
119
|
break;
|
|
120
120
|
case "tool_roster_delta": {
|
|
121
121
|
const rosterDelta = toolRosterDeltaEventData(ev);
|
|
@@ -179,11 +179,7 @@ export function createLedgerSink(opts) {
|
|
|
179
179
|
return append("status", statusData);
|
|
180
180
|
};
|
|
181
181
|
const appendParked = (kind, result) => {
|
|
182
|
-
|
|
183
|
-
return append(kind, {
|
|
184
|
-
gate: t?.kind === "paused" ? t.gate : null,
|
|
185
|
-
...(typeof result?.toolCallId === "string" ? { toolCallId: result.toolCallId } : {}),
|
|
186
|
-
});
|
|
182
|
+
return append(kind, parkEventData(result));
|
|
187
183
|
};
|
|
188
184
|
const appendDone = (result) => append("done", { result });
|
|
189
185
|
const onDone = async (result) => {
|
package/dist/trace/project.d.ts
CHANGED
|
@@ -29,8 +29,10 @@ import type { ModelUsageDelta, ModelUsageTracker, PromptManifestRecord } from ".
|
|
|
29
29
|
import type { RunCompanionRecord } from "../observability/prompt-manifest.js";
|
|
30
30
|
import { type SafeText } from "./exit-seat.js";
|
|
31
31
|
import { type SemaProvenanceInput } from "./sema-provenance.js";
|
|
32
|
+
import { type ExtensionRequesterFace, type ToolInputRewriteFace } from "./extension-call-face.js";
|
|
32
33
|
import type { LedgerEventType } from "./ledger-events.js";
|
|
33
34
|
import type { InstructionsSegment } from "../instruction-selection.js";
|
|
35
|
+
import type { RunSkillEntry } from "../capabilities/skills.js";
|
|
34
36
|
/** 账本写口的统一签名 —— `type` 是**闭集**(`ledger-events.ts`):新型必须先登记,否则调用点编译红
|
|
35
37
|
* (codex 交叉复审 F2:别名门 `ap("x")` 与动态首参让纯词法门结构性抓不全)。 */
|
|
36
38
|
type AppendFn = (type: LedgerEventType, data: unknown) => Promise<void>;
|
|
@@ -100,6 +102,8 @@ export type TraceBlock = {
|
|
|
100
102
|
name: string;
|
|
101
103
|
label?: string;
|
|
102
104
|
input: unknown;
|
|
105
|
+
recovered?: true;
|
|
106
|
+
requestedBy?: ExtensionRequesterFace;
|
|
103
107
|
eventId?: string;
|
|
104
108
|
parentToolCallId?: string;
|
|
105
109
|
} | {
|
|
@@ -118,6 +122,11 @@ export type TraceBlock = {
|
|
|
118
122
|
delivered?: McpDelivered;
|
|
119
123
|
gate?: GateOutcome;
|
|
120
124
|
gatedCallId?: string;
|
|
125
|
+
wireName?: string;
|
|
126
|
+
notExecuted?: true;
|
|
127
|
+
answeredBy?: string;
|
|
128
|
+
requestedBy?: ExtensionRequesterFace;
|
|
129
|
+
rewrite?: ToolInputRewriteFace;
|
|
121
130
|
eventId?: string;
|
|
122
131
|
parentToolCallId?: string;
|
|
123
132
|
} | {
|
|
@@ -156,6 +165,7 @@ export declare function toolStartEventData(ev: {
|
|
|
156
165
|
label?: string;
|
|
157
166
|
args: unknown;
|
|
158
167
|
recovered?: true;
|
|
168
|
+
requestedBy?: unknown;
|
|
159
169
|
eventId?: string;
|
|
160
170
|
parentToolCallId?: string;
|
|
161
171
|
}): Record<string, unknown>;
|
|
@@ -294,6 +304,9 @@ export declare function toolEndEventData(ev: {
|
|
|
294
304
|
gatedCallId?: string;
|
|
295
305
|
wireName?: string;
|
|
296
306
|
notExecuted?: true;
|
|
307
|
+
answeredBy?: unknown;
|
|
308
|
+
requestedBy?: unknown;
|
|
309
|
+
rewrite?: unknown;
|
|
297
310
|
eventId?: string;
|
|
298
311
|
parentToolCallId?: string;
|
|
299
312
|
}): Record<string, unknown>;
|
|
@@ -387,6 +400,25 @@ export declare function taskProgressEventData(ev: {
|
|
|
387
400
|
currentAction?: SafeText;
|
|
388
401
|
workflowAgentLabel?: SafeText;
|
|
389
402
|
}>;
|
|
403
|
+
/** park 账本行(`suspended` / `needs_review`)的 `data` 形 —— {@link parkEventData} 的产物。 */
|
|
404
|
+
export interface ParkEventData {
|
|
405
|
+
/** 暂停因由上的门(没有暂停因由 ⇒ `null`:同步口兜底行、重开行)。 */
|
|
406
|
+
readonly gate: Extract<TaskResult["terminal"], {
|
|
407
|
+
kind: "paused";
|
|
408
|
+
}>["gate"] | null;
|
|
409
|
+
/** [ref] 待批工具调用身份 —— 调用方先 graft(`graftParkToolCallId`)再交进来;tool-less park 缺席。 */
|
|
410
|
+
readonly toolCallId?: string;
|
|
411
|
+
/** 门身份(7.137.0):与运维队列 / 收件行同名、同一只读法(`durableRowIdentity`:过信任边界,读不出 ⇒ 缺席 + 计数)。决断方据它回显 `plan_review` 的 `checkpointId`。 */
|
|
412
|
+
readonly checkpointId?: string;
|
|
413
|
+
/** 重开臂:续跑腿失败而店说卡又 pending ⇒ 行回到 park,这一位带那次失败码(`null` = 码缺席);普通 park 缺席。 */
|
|
414
|
+
readonly reopened?: string | null;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* park 账本行的**唯一**构造器 —— 三类写者同经这一只:后台腿与同步 detach 腿(`LedgerSink.appendParked`)、续跑腿的再停两臂与重开臂(`resume-legs.ts`)。
|
|
418
|
+
* 键律见 {@link ParkEventData}。恢复凭据 token 只进门身份的信任边界判,**永不**进行(调用方交未封口的结果时 token 在因由上;交已封口的结果时它已被摘,判据退化为形判)。
|
|
419
|
+
* 门身份读法与三处 durable 读面同一只(`durableRowIdentity`,face `run-events-park`):没有暂停因由的行不问身份(没有门可认);有因由而读不出 ⇒ 键缺席 + 计一次。
|
|
420
|
+
*/
|
|
421
|
+
export declare function parkEventData(result: unknown, reopened?: string | null): ParkEventData;
|
|
390
422
|
/**
|
|
391
423
|
* The `task_started` payload(core 7.50.0):一只委派子代**起跑**的那一帧 —— 每周期一只(首派 / 复活;耐久续跑腿不铸),
|
|
392
424
|
* 序在子代的 `wiring_manifest` 之后、它的首个 `task_progress` 与首次模型请求之前。
|
|
@@ -608,11 +640,11 @@ export declare function compactionStartedEventData(ev: {
|
|
|
608
640
|
parentToolCallId?: unknown;
|
|
609
641
|
}): Record<string, unknown>;
|
|
610
642
|
/** The `workspace_changed` payload([ref]二 core 裁定:[ref] §E13 旧臂,L1 门本车首次撞见——非新增,
|
|
611
|
-
* 是本门扩 TaskEvent
|
|
612
|
-
*
|
|
613
|
-
* RAW 逻辑路径,symlink 不解析]→
|
|
614
|
-
* 惯例]
|
|
615
|
-
*
|
|
643
|
+
* 是本门扩 TaskEvent 臂集时第一次显式处置)。core 7.58.0 起这一帧是腿的**整份快照**:每条经 `prepareExecutionEnv` 装配的腿起点一帧(`cwd` 可与上一帧相同;verify / cascade 的组合入口不经该装配、按契约没有这一帧)、
|
|
644
|
+
* 其后每变一帧(bash `cd` / EnterWorktree / ExitWorktree)。wire 上只投 `cwd`(其余四成员的处置在 `wire-projection-faces.ts` 那一行);
|
|
645
|
+
* cwd 与已展示的工具 args 同信任级[UNTRUSTED,RAW 逻辑路径,symlink 不解析]→ 出口座的有界位[300,与 brainStatusEventData.detail 同
|
|
646
|
+
* 惯例]。消费端按快照读:与已持有的 `cwd` 相同的一帧不渲染成「目录变了」。服务端只如实转发单帧;会话行上的那份最后一帧另由
|
|
647
|
+
* `session-workspace.ts` 的记录座存(不是本投影)。 */
|
|
616
648
|
export declare function workspaceChangedEventData(ev: {
|
|
617
649
|
cwd: string;
|
|
618
650
|
eventId?: string;
|
|
@@ -832,6 +864,20 @@ export declare function toolRosterDeltaEventData(ev: {
|
|
|
832
864
|
eventId?: unknown;
|
|
833
865
|
parentToolCallId?: unknown;
|
|
834
866
|
}): Record<string, unknown> | undefined;
|
|
867
|
+
/**
|
|
868
|
+
* `wiring_manifest` 上**本仓自铸**的段 —— core 的 manifest 里没有它们(属主不在引擎),所以不从 `ev` 读:每条投帧的腿把自己的陈述**一次交齐**。
|
|
869
|
+
* 键集 = `wire-projection-faces.ts` 租户行的 `minted`(编译期双向绑定在 `core-keyset-guard.ts`:多一段 / 少一段都红)。第二参**必传**、每一键**必填**
|
|
870
|
+
* (值可以是 `undefined`)—— 漏递的腿当场 tsc 红,而不是静默投出一个「缺席」(缺席在 wire 上是一句话:「这条腿对这件事没有陈述」)。
|
|
871
|
+
* · `instructions`([ref],7.111.0)—— 这条腿的 project-memory loader 选中的指令文件链成员 `{ selected: string[] }`;值来自腿的
|
|
872
|
+
* `InstructionSelectionLeg.segment()`。`undefined` ⇒ 段缺席;`{ selected: [] }` ⇒ 显式空(走了链、没选中)。
|
|
873
|
+
* · `skills`(7.137.0)—— 这条 run 交给引擎的技能名册(`{ name, description, source }[]`,与场景卡技能清单同一张形);值来自 spec 字段 `runSkillsOf(spec)`
|
|
874
|
+
* (唯一铸点 = resolveSpec 出口的 `buildRunSkills`)。**run 级** ⇒ 只投根腿 / 续跑腿的帧,委派子代的帧(`parentToolCallId` 在场)不投(子代的技能由它自己的定义决定);
|
|
875
|
+
* `[]` = 零技能(含 `disableSkills`);`undefined` ⇒ 段缺席(这条腿的 spec 不是本仓装配的)。`description` 过上 wire 的自由文本出口 {@link sanitizeWireText}。
|
|
876
|
+
*/
|
|
877
|
+
export interface LegWiringSections {
|
|
878
|
+
readonly instructions: InstructionsSegment | undefined;
|
|
879
|
+
readonly skills: readonly RunSkillEntry[] | undefined;
|
|
880
|
+
}
|
|
835
881
|
/**
|
|
836
882
|
* `wiring_manifest.sessionRules` 段的**处置表**(core 7.55.0 [ref];[ref] 起新面写表 —— 门 `core-keyset-guard.ts` ⑥b 读 `TableCoreKeys`,core 给段加成员 ⇒ tsc 红,
|
|
837
883
|
* 先判受众再写进表)。唯一一位 `childrenReadLive` 是布尔才出门(读法拒 ⇒ 表的丢弃口计一次)。裁定 = 两个出口都投(理由在 ⑥b 段注)。
|
|
@@ -845,7 +891,7 @@ export declare function wiringManifestEventData(ev: {
|
|
|
845
891
|
manifest?: unknown;
|
|
846
892
|
eventId?: unknown;
|
|
847
893
|
parentToolCallId?: unknown;
|
|
848
|
-
},
|
|
894
|
+
}, minted: LegWiringSections): Record<string, unknown>;
|
|
849
895
|
/**
|
|
850
896
|
* `wiring_manifest` 的 **operator 投影**([ref] 件一)—— {@link wiringManifestEventData} 的租户形加上
|
|
851
897
|
* `governance` 段与 core 的真 `configFingerprint`。
|
|
@@ -881,7 +927,7 @@ export declare function wiringManifestOperatorEventData(ev: {
|
|
|
881
927
|
manifest?: unknown;
|
|
882
928
|
eventId?: unknown;
|
|
883
929
|
parentToolCallId?: unknown;
|
|
884
|
-
},
|
|
930
|
+
}, minted: LegWiringSections): Record<string, unknown>;
|
|
885
931
|
/**
|
|
886
932
|
* `wiring_manifest` 的**唯一分叉点**([ref])—— 两条知道调用方身份的 live 消费腿共用它:
|
|
887
933
|
* `/v1/tasks/stream` 的 SSE 帧,与 `POST /v1/tasks`(非流式)200 体里的 `wiringManifest` 起手回执。
|
|
@@ -902,7 +948,7 @@ export declare function wiringManifestFaceEventData(ev: {
|
|
|
902
948
|
manifest?: unknown;
|
|
903
949
|
eventId?: unknown;
|
|
904
950
|
parentToolCallId?: unknown;
|
|
905
|
-
}, operatorFace: boolean,
|
|
951
|
+
}, operatorFace: boolean, minted: LegWiringSections): Record<string, unknown>;
|
|
906
952
|
/**
|
|
907
953
|
* `human_input`(core 5.14.0 [ref] 新 `TaskEvent` 臂)—— 「谁把什么喂进了这条 run」的生命周期账本
|
|
908
954
|
* 帧(objective / 实时 steer / nextTurn / parked-steer 续跑 / wake 五个载体共用一个投影点)。
|
|
@@ -968,6 +1014,8 @@ export declare function brainStatusEventData(ev: {
|
|
|
968
1014
|
timeoutMs?: number;
|
|
969
1015
|
providerCondition?: string;
|
|
970
1016
|
providerConditionSource?: string;
|
|
1017
|
+
waitSegment?: string;
|
|
1018
|
+
sleptMs?: number;
|
|
971
1019
|
eventId?: string;
|
|
972
1020
|
parentToolCallId?: string;
|
|
973
1021
|
}): FrameData<{
|
|
@@ -1137,8 +1185,12 @@ export declare function toContractTokens(usage: unknown, usageMissing?: unknown)
|
|
|
1137
1185
|
* (trace SSE 面)对同一账本行的字段选择逐字同构,此前两处独立手写,structured/totalChars/label
|
|
1138
1186
|
* 三次扩字段各改两遍(见两处对偶注)。收一份:两面各自包装键名皮(id/name/input vs 同名),
|
|
1139
1187
|
* 字段集合从此单点演进。 */
|
|
1140
|
-
export declare function toolCallFieldsOf(d: Record<string, unknown>):
|
|
1141
|
-
|
|
1188
|
+
export declare function toolCallFieldsOf(d: Record<string, unknown>): Omit<Extract<TraceBlock, {
|
|
1189
|
+
type: "tool-call";
|
|
1190
|
+
}>, "type">;
|
|
1191
|
+
export declare function toolResultFieldsOf(d: Record<string, unknown>): Omit<Extract<TraceBlock, {
|
|
1192
|
+
type: "tool-result";
|
|
1193
|
+
}>, "type" | "output" | "isError">;
|
|
1142
1194
|
export interface ProjectOpts {
|
|
1143
1195
|
/** Prepend the user turn (the objective is not in the event log; the endpoint supplies it). */
|
|
1144
1196
|
objective?: string;
|