@sema-agent/server 7.135.0 → 7.137.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 +237 -2
- package/USAGE.md +146 -41
- package/deploy/sema-up/README.md +15 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +7 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +7 -1
- package/dist/approval-card.d.ts +60 -4
- package/dist/approval-card.js +18 -1
- package/dist/approval-content-kind.d.ts +7 -0
- package/dist/approval-content-kind.js +8 -1
- 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/auth-bridge.d.ts +34 -5
- package/dist/auth-bridge.js +22 -5
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/execution-env.d.ts +24 -1
- package/dist/boot/execution-env.js +69 -6
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/reapers.d.ts +3 -0
- package/dist/boot/reapers.js +15 -1
- package/dist/boot/resolve-spec.d.ts +4 -0
- package/dist/boot/resolve-spec.js +24 -22
- package/dist/boot/runner-deps.js +4 -2
- package/dist/boot/stage-03-store-backend.d.ts +1 -1
- package/dist/boot/stage-04-stores.d.ts +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +4 -2
- package/dist/boot/stage-05-execution-env.js +11 -2
- package/dist/boot/stage-06-runners.d.ts +4 -2
- package/dist/boot/stage-06-runners.js +5 -1
- package/dist/boot/stage-07-capability-layer.d.ts +5 -2
- package/dist/boot/stage-07-capability-layer.js +1 -1
- package/dist/boot/stage-08-reapers.d.ts +5 -2
- package/dist/boot/stage-08-reapers.js +2 -1
- package/dist/boot/stage-09-leader.d.ts +5 -2
- package/dist/boot/stage-10-http-server.d.ts +5 -2
- package/dist/boot/stage-10-http-server.js +3 -2
- package/dist/boot/stores.d.ts +1 -1
- package/dist/boot/stores.js +2 -3
- package/dist/boot/web-admin.js +10 -17
- package/dist/brain.js +12 -3
- 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 +3 -3
- package/dist/budget.js +4 -0
- 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 +5 -4
- 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 +3 -7
- package/dist/capability-facts.js +3 -5
- package/dist/center-credential-renewer.js +5 -1
- package/dist/center-credential.d.ts +18 -4
- package/dist/center-credential.js +18 -3
- 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 +3 -3
- package/dist/config-catalog.js +21 -16
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +1 -1
- package/dist/config-invariants.js +8 -0
- package/dist/config-lkg.d.ts +0 -38
- package/dist/config-lkg.js +1 -83
- package/dist/config-types.d.ts +21 -4
- package/dist/config.d.ts +1 -1
- package/dist/config.js +60 -16
- package/dist/deployment-governance.d.ts +2 -2
- package/dist/deployment-governance.js +7 -9
- package/dist/deployment-shape.d.ts +1 -1
- package/dist/device-ws-protocol.d.ts +1 -0
- package/dist/device-ws-protocol.js +2 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/file-history-disclosure.d.ts +8 -4
- package/dist/file-history-disclosure.js +24 -6
- package/dist/fleet-client.d.ts +32 -1
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +7 -3
- package/dist/fleet-lease.js +31 -23
- package/dist/hooks/classic-stations.d.ts +11 -54
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +4 -4
- package/dist/hooks/hook-runner.js +2 -2
- package/dist/http/admission.js +10 -7
- 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 +76 -16
- package/dist/http/checkpoint-ctx.js +45 -1
- package/dist/http/dispatch.js +24 -19
- package/dist/http/durable-run-leg.d.ts +5 -1
- package/dist/http/durable-run-leg.js +1 -1
- package/dist/http/health-self-report.d.ts +2 -2
- package/dist/http/mcp-remote-text.d.ts +5 -0
- package/dist/http/mcp-remote-text.js +7 -0
- package/dist/http/principal-gate.d.ts +15 -10
- package/dist/http/principal-gate.js +48 -9
- package/dist/http/resume-ctx-read.d.ts +2 -16
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +2 -20
- package/dist/http/resume-legs.js +52 -38
- package/dist/http/route-ctx.d.ts +8 -2
- package/dist/http/routes/approvals-assistant.d.ts +0 -2
- package/dist/http/routes/approvals-assistant.js +65 -16
- package/dist/http/routes/capabilities.js +11 -1
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +5 -7
- package/dist/http/routes/runs.js +4 -3
- package/dist/http/routes/session-sync.js +70 -12
- package/dist/http/routes/sessions.js +20 -15
- package/dist/http/routes/tasks.js +8 -6
- package/dist/http/server.d.ts +4 -0
- package/dist/http/stored-body-replay.d.ts +3 -3
- package/dist/http/stored-body-replay.js +6 -1
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/wire-types.d.ts +57 -30
- package/dist/identity-source.d.ts +65 -0
- package/dist/identity-source.js +45 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/memory-store-refusal.d.ts +3 -3
- package/dist/model-entry-refusal.d.ts +2 -0
- package/dist/model-entry-refusal.js +11 -0
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-select.d.ts +6 -17
- package/dist/model-select.js +0 -3
- package/dist/namespaced-rule-name.d.ts +1 -1
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/fail-open.d.ts +19 -7
- package/dist/observability/fail-open.js +19 -7
- package/dist/observability/metrics.js +2 -2
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.js +1 -0
- 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 +4 -3
- package/dist/parked-decide.js +29 -9
- package/dist/peer-directory.d.ts +2 -1
- package/dist/peer-directory.js +7 -5
- package/dist/permission-rule-list.d.ts +2 -2
- package/dist/plugins/approval-ask-store-sql.d.ts +8 -0
- package/dist/plugins/approval-ask-store-sql.js +3 -0
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/checkpoint-index-columns.d.ts +50 -1
- package/dist/plugins/checkpoint-index-columns.js +28 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +46 -12
- package/dist/plugins/checkpoint-store-sql.js +64 -35
- package/dist/plugins/file-history-store-sql.d.ts +6 -0
- package/dist/plugins/file-history-store-sql.js +37 -37
- 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 +112 -0
- package/dist/plugins/k8s-pod-reaper.js +122 -0
- package/dist/plugins/local-checkpoint-store.d.ts +3 -6
- package/dist/plugins/local-checkpoint-store.js +7 -6
- package/dist/plugins/memory-run-store.js +2 -0
- package/dist/plugins/one-time-migrations.d.ts +49 -37
- package/dist/plugins/one-time-migrations.js +87 -128
- 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 +16 -17
- package/dist/plugins/pg-pool.js +4 -0
- package/dist/plugins/pg-session-storage.js +2 -2
- package/dist/plugins/remote-env-adb.d.ts +3 -0
- package/dist/plugins/remote-env-adb.js +1 -0
- package/dist/plugins/remote-env-device.d.ts +3 -0
- package/dist/plugins/remote-env-device.js +4 -0
- package/dist/plugins/remote-env-e2b.d.ts +3 -0
- package/dist/plugins/remote-env-e2b.js +1 -0
- 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 +7 -1
- package/dist/plugins/remote-env-host.js +7 -1
- package/dist/plugins/remote-env-k8s.d.ts +154 -14
- package/dist/plugins/remote-env-k8s.js +300 -21
- package/dist/plugins/remote-env-local-docker.d.ts +3 -0
- package/dist/plugins/remote-env-local-docker.js +1 -0
- package/dist/plugins/remote-env-ssh.d.ts +3 -0
- package/dist/plugins/remote-env-ssh.js +1 -0
- package/dist/plugins/run-store-sql.js +10 -4
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/session-ownership.d.ts +17 -3
- package/dist/plugins/session-ownership.js +19 -5
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-errors.d.ts +60 -0
- package/dist/plugins/sql-errors.js +64 -1
- package/dist/plugins/store-contracts.d.ts +10 -1
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +10 -0
- package/dist/plugins/tidb-pool.js +8 -1
- package/dist/plugins/tidb-session-store.js +2 -2
- package/dist/plugins/web-search.d.ts +1 -1
- package/dist/plugins/web-search.js +2 -2
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +5 -0
- package/dist/request-key-closure.js +5 -2
- 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 +7 -4
- package/dist/run-local.d.ts +2 -2
- package/dist/runs.js +2 -1
- package/dist/runtime-caps-resolver.js +1 -1
- 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/sandbox-pkg-source.d.ts +28 -1
- package/dist/sandbox-pkg-source.js +1 -2
- package/dist/sealed-key.d.ts +19 -0
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +16 -4
- package/dist/security.js +8 -3
- package/dist/server-secret-env.d.ts +6 -0
- package/dist/server-secret-env.js +14 -0
- package/dist/session-error-wire.d.ts +14 -6
- package/dist/session-error-wire.js +2 -1
- package/dist/session-incarnation.d.ts +16 -5
- package/dist/session-incarnation.js +7 -4
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-policy-wire.js +2 -2
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync.d.ts +15 -3
- package/dist/session-sync.js +5 -2
- package/dist/spec-fields.d.ts +43 -13
- package/dist/spec-fields.js +33 -12
- 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 +52 -81
- package/dist/task-a2a.js +219 -89
- package/dist/task-mcp.d.ts +7 -15
- package/dist/task-mcp.js +16 -51
- package/dist/task-settings.d.ts +2 -2
- package/dist/tool-approval.d.ts +35 -12
- package/dist/tool-approval.js +59 -39
- package/dist/tool-rule-names.d.ts +5 -0
- package/dist/trace/core-keyset-guard.d.ts +5 -5
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/exit-seat.js +37 -13
- package/dist/trace/ledger-sink.d.ts +4 -5
- package/dist/trace/ledger-sink.js +3 -7
- package/dist/trace/project.d.ts +37 -3
- package/dist/trace/project.js +20 -6
- package/dist/trace/redact.d.ts +40 -12
- package/dist/trace/redact.js +332 -128
- package/dist/trace/self-minted-wire.d.ts +641 -0
- package/dist/trace/self-minted-wire.js +201 -0
- package/dist/trace/wire-projection-faces.d.ts +5 -3
- package/dist/trace/wire-projection-faces.js +7 -3
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +13 -4
- package/dist/url-refusal.js +8 -2
- package/dist/web-admin-client/apply-effective.js +0 -1
- package/dist/web-admin-client/center-request.d.ts +20 -2
- package/dist/web-admin-client/center-request.js +40 -5
- package/dist/web-admin-client/http-client.js +6 -6
- package/dist/web-admin-client/types.d.ts +5 -5
- package/dist/workspace-space.d.ts +27 -0
- package/dist/workspace-space.js +26 -0
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +11 -5
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +2 -1
- package/scripts/drain-check.mysql.sql +3 -1
- package/scripts/drain-check.pg.sql +3 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/wire-changes/server@7.137.0.json +825 -0
- package/dist/url-credential.d.ts +0 -52
- package/dist/url-credential.js +0 -49
package/dist/trace/project.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { type SafeText } from "./exit-seat.js";
|
|
|
31
31
|
import { type SemaProvenanceInput } from "./sema-provenance.js";
|
|
32
32
|
import type { LedgerEventType } from "./ledger-events.js";
|
|
33
33
|
import type { InstructionsSegment } from "../instruction-selection.js";
|
|
34
|
+
import type { RunSkillEntry } from "../capabilities/skills.js";
|
|
34
35
|
/** 账本写口的统一签名 —— `type` 是**闭集**(`ledger-events.ts`):新型必须先登记,否则调用点编译红
|
|
35
36
|
* (codex 交叉复审 F2:别名门 `ap("x")` 与动态首参让纯词法门结构性抓不全)。 */
|
|
36
37
|
type AppendFn = (type: LedgerEventType, data: unknown) => Promise<void>;
|
|
@@ -387,6 +388,25 @@ export declare function taskProgressEventData(ev: {
|
|
|
387
388
|
currentAction?: SafeText;
|
|
388
389
|
workflowAgentLabel?: SafeText;
|
|
389
390
|
}>;
|
|
391
|
+
/** park 账本行(`suspended` / `needs_review`)的 `data` 形 —— {@link parkEventData} 的产物。 */
|
|
392
|
+
export interface ParkEventData {
|
|
393
|
+
/** 暂停因由上的门(没有暂停因由 ⇒ `null`:同步口兜底行、重开行)。 */
|
|
394
|
+
readonly gate: Extract<TaskResult["terminal"], {
|
|
395
|
+
kind: "paused";
|
|
396
|
+
}>["gate"] | null;
|
|
397
|
+
/** [ref] 待批工具调用身份 —— 调用方先 graft(`graftParkToolCallId`)再交进来;tool-less park 缺席。 */
|
|
398
|
+
readonly toolCallId?: string;
|
|
399
|
+
/** 门身份(7.137.0):与运维队列 / 收件行同名、同一只读法(`durableRowIdentity`:过信任边界,读不出 ⇒ 缺席 + 计数)。决断方据它回显 `plan_review` 的 `checkpointId`。 */
|
|
400
|
+
readonly checkpointId?: string;
|
|
401
|
+
/** 重开臂:续跑腿失败而店说卡又 pending ⇒ 行回到 park,这一位带那次失败码(`null` = 码缺席);普通 park 缺席。 */
|
|
402
|
+
readonly reopened?: string | null;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* park 账本行的**唯一**构造器 —— 三类写者同经这一只:后台腿与同步 detach 腿(`LedgerSink.appendParked`)、续跑腿的再停两臂与重开臂(`resume-legs.ts`)。
|
|
406
|
+
* 键律见 {@link ParkEventData}。恢复凭据 token 只进门身份的信任边界判,**永不**进行(调用方交未封口的结果时 token 在因由上;交已封口的结果时它已被摘,判据退化为形判)。
|
|
407
|
+
* 门身份读法与三处 durable 读面同一只(`durableRowIdentity`,face `run-events-park`):没有暂停因由的行不问身份(没有门可认);有因由而读不出 ⇒ 键缺席 + 计一次。
|
|
408
|
+
*/
|
|
409
|
+
export declare function parkEventData(result: unknown, reopened?: string | null): ParkEventData;
|
|
390
410
|
/**
|
|
391
411
|
* The `task_started` payload(core 7.50.0):一只委派子代**起跑**的那一帧 —— 每周期一只(首派 / 复活;耐久续跑腿不铸),
|
|
392
412
|
* 序在子代的 `wiring_manifest` 之后、它的首个 `task_progress` 与首次模型请求之前。
|
|
@@ -832,6 +852,20 @@ export declare function toolRosterDeltaEventData(ev: {
|
|
|
832
852
|
eventId?: unknown;
|
|
833
853
|
parentToolCallId?: unknown;
|
|
834
854
|
}): Record<string, unknown> | undefined;
|
|
855
|
+
/**
|
|
856
|
+
* `wiring_manifest` 上**本仓自铸**的段 —— core 的 manifest 里没有它们(属主不在引擎),所以不从 `ev` 读:每条投帧的腿把自己的陈述**一次交齐**。
|
|
857
|
+
* 键集 = `wire-projection-faces.ts` 租户行的 `minted`(编译期双向绑定在 `core-keyset-guard.ts`:多一段 / 少一段都红)。第二参**必传**、每一键**必填**
|
|
858
|
+
* (值可以是 `undefined`)—— 漏递的腿当场 tsc 红,而不是静默投出一个「缺席」(缺席在 wire 上是一句话:「这条腿对这件事没有陈述」)。
|
|
859
|
+
* · `instructions`([ref],7.111.0)—— 这条腿的 project-memory loader 选中的指令文件链成员 `{ selected: string[] }`;值来自腿的
|
|
860
|
+
* `InstructionSelectionLeg.segment()`。`undefined` ⇒ 段缺席;`{ selected: [] }` ⇒ 显式空(走了链、没选中)。
|
|
861
|
+
* · `skills`(7.137.0)—— 这条 run 交给引擎的技能名册(`{ name, description, source }[]`,与场景卡技能清单同一张形);值来自 spec 字段 `runSkillsOf(spec)`
|
|
862
|
+
* (唯一铸点 = resolveSpec 出口的 `buildRunSkills`)。**run 级** ⇒ 只投根腿 / 续跑腿的帧,委派子代的帧(`parentToolCallId` 在场)不投(子代的技能由它自己的定义决定);
|
|
863
|
+
* `[]` = 零技能(含 `disableSkills`);`undefined` ⇒ 段缺席(这条腿的 spec 不是本仓装配的)。`description` 过上 wire 的自由文本出口 {@link sanitizeWireText}。
|
|
864
|
+
*/
|
|
865
|
+
export interface LegWiringSections {
|
|
866
|
+
readonly instructions: InstructionsSegment | undefined;
|
|
867
|
+
readonly skills: readonly RunSkillEntry[] | undefined;
|
|
868
|
+
}
|
|
835
869
|
/**
|
|
836
870
|
* `wiring_manifest.sessionRules` 段的**处置表**(core 7.55.0 [ref];[ref] 起新面写表 —— 门 `core-keyset-guard.ts` ⑥b 读 `TableCoreKeys`,core 给段加成员 ⇒ tsc 红,
|
|
837
871
|
* 先判受众再写进表)。唯一一位 `childrenReadLive` 是布尔才出门(读法拒 ⇒ 表的丢弃口计一次)。裁定 = 两个出口都投(理由在 ⑥b 段注)。
|
|
@@ -845,7 +879,7 @@ export declare function wiringManifestEventData(ev: {
|
|
|
845
879
|
manifest?: unknown;
|
|
846
880
|
eventId?: unknown;
|
|
847
881
|
parentToolCallId?: unknown;
|
|
848
|
-
},
|
|
882
|
+
}, minted: LegWiringSections): Record<string, unknown>;
|
|
849
883
|
/**
|
|
850
884
|
* `wiring_manifest` 的 **operator 投影**([ref] 件一)—— {@link wiringManifestEventData} 的租户形加上
|
|
851
885
|
* `governance` 段与 core 的真 `configFingerprint`。
|
|
@@ -881,7 +915,7 @@ export declare function wiringManifestOperatorEventData(ev: {
|
|
|
881
915
|
manifest?: unknown;
|
|
882
916
|
eventId?: unknown;
|
|
883
917
|
parentToolCallId?: unknown;
|
|
884
|
-
},
|
|
918
|
+
}, minted: LegWiringSections): Record<string, unknown>;
|
|
885
919
|
/**
|
|
886
920
|
* `wiring_manifest` 的**唯一分叉点**([ref])—— 两条知道调用方身份的 live 消费腿共用它:
|
|
887
921
|
* `/v1/tasks/stream` 的 SSE 帧,与 `POST /v1/tasks`(非流式)200 体里的 `wiringManifest` 起手回执。
|
|
@@ -902,7 +936,7 @@ export declare function wiringManifestFaceEventData(ev: {
|
|
|
902
936
|
manifest?: unknown;
|
|
903
937
|
eventId?: unknown;
|
|
904
938
|
parentToolCallId?: unknown;
|
|
905
|
-
}, operatorFace: boolean,
|
|
939
|
+
}, operatorFace: boolean, minted: LegWiringSections): Record<string, unknown>;
|
|
906
940
|
/**
|
|
907
941
|
* `human_input`(core 5.14.0 [ref] 新 `TaskEvent` 臂)—— 「谁把什么喂进了这条 run」的生命周期账本
|
|
908
942
|
* 帧(objective / 实时 steer / nextTurn / parked-steer 续跑 / wake 五个载体共用一个投影点)。
|
package/dist/trace/project.js
CHANGED
|
@@ -11,6 +11,7 @@ import { semaProvenanceOrAbsent } from "./sema-provenance.js";
|
|
|
11
11
|
import { resupplyFields, terminalFrameFacetFields } from "./task-notification-facets.js";
|
|
12
12
|
import { dropProjectedFace } from "./projection-drop.js";
|
|
13
13
|
import { projectByTable } from "./projection-table.js";
|
|
14
|
+
import { durableRowIdentity } from "../checkpoint-identity.js";
|
|
14
15
|
export async function appendModelUsageDelta(append, modelUsage, taskId) {
|
|
15
16
|
const delta = modelUsage?.drain(taskId);
|
|
16
17
|
if (delta) {
|
|
@@ -292,6 +293,16 @@ export function taskProgressEventData(ev) {
|
|
|
292
293
|
...identityFields(ev),
|
|
293
294
|
};
|
|
294
295
|
}
|
|
296
|
+
export function parkEventData(result, reopened) {
|
|
297
|
+
const r = (result ?? {});
|
|
298
|
+
const paused = r.terminal?.kind === "paused" ? r.terminal : undefined;
|
|
299
|
+
return {
|
|
300
|
+
gate: paused !== undefined ? paused.gate : null,
|
|
301
|
+
...(typeof r.toolCallId === "string" ? { toolCallId: r.toolCallId } : {}),
|
|
302
|
+
...(paused !== undefined ? durableRowIdentity("run-events-park", paused.checkpointId, paused.token) : {}),
|
|
303
|
+
...(reopened !== undefined ? { reopened } : {}),
|
|
304
|
+
};
|
|
305
|
+
}
|
|
295
306
|
export function taskStartedEventData(ev) {
|
|
296
307
|
return {
|
|
297
308
|
taskId: ev.taskId,
|
|
@@ -460,7 +471,7 @@ export function toolRosterDeltaEventData(ev) {
|
|
|
460
471
|
export const WIRING_SESSION_RULES_DISPOSITIONS = {
|
|
461
472
|
childrenReadLive: { forward: (raw) => typeof raw === "boolean" },
|
|
462
473
|
};
|
|
463
|
-
export function wiringManifestEventData(ev,
|
|
474
|
+
export function wiringManifestEventData(ev, minted) {
|
|
464
475
|
const str = (v) => (typeof v === "string" && v.length > 0 ? v : undefined);
|
|
465
476
|
const bool = (v) => (typeof v === "boolean" ? v : undefined);
|
|
466
477
|
const num = (v) => (typeof v === "number" && Number.isFinite(v) ? v : undefined);
|
|
@@ -695,12 +706,15 @@ export function wiringManifestEventData(ev, instructions) {
|
|
|
695
706
|
...(lsp !== undefined ? { lsp } : {}),
|
|
696
707
|
...(hands !== undefined ? { hands } : {}),
|
|
697
708
|
...(writeProtection !== undefined ? { writeProtection } : {}),
|
|
698
|
-
...(instructions !== undefined ? { instructions: { selected: [...instructions.selected] } } : {}),
|
|
709
|
+
...(minted.instructions !== undefined ? { instructions: { selected: [...minted.instructions.selected] } } : {}),
|
|
710
|
+
...(minted.skills !== undefined && typeof ev.parentToolCallId !== "string"
|
|
711
|
+
? { skills: minted.skills.map((e) => ({ name: e.name, description: sanitizeWireText(e.description), source: e.source })) }
|
|
712
|
+
: {}),
|
|
699
713
|
...identityFields(ev),
|
|
700
714
|
};
|
|
701
715
|
}
|
|
702
|
-
export function wiringManifestOperatorEventData(ev,
|
|
703
|
-
const tenant = wiringManifestEventData(ev,
|
|
716
|
+
export function wiringManifestOperatorEventData(ev, minted) {
|
|
717
|
+
const tenant = wiringManifestEventData(ev, minted);
|
|
704
718
|
const str = (v) => (typeof v === "string" && v.length > 0 ? v : undefined);
|
|
705
719
|
const bool = (v) => (typeof v === "boolean" ? v : undefined);
|
|
706
720
|
const sec = (v) => (typeof v === "object" && v !== null && !Array.isArray(v) ? { ...v } : undefined);
|
|
@@ -744,8 +758,8 @@ export function wiringManifestOperatorEventData(ev, instructions) {
|
|
|
744
758
|
...(str(m.configFingerprint) !== undefined ? { configFingerprint: m.configFingerprint } : {}),
|
|
745
759
|
};
|
|
746
760
|
}
|
|
747
|
-
export function wiringManifestFaceEventData(ev, operatorFace,
|
|
748
|
-
return operatorFace ? wiringManifestOperatorEventData(ev,
|
|
761
|
+
export function wiringManifestFaceEventData(ev, operatorFace, minted) {
|
|
762
|
+
return operatorFace ? wiringManifestOperatorEventData(ev, minted) : wiringManifestEventData(ev, minted);
|
|
749
763
|
}
|
|
750
764
|
export function humanInputEventData(ev) {
|
|
751
765
|
const str = (v) => (typeof v === "string" && v.length > 0 ? v : undefined);
|
package/dist/trace/redact.d.ts
CHANGED
|
@@ -65,16 +65,6 @@ declare const DISPLAY_SAFE_URL_TOKEN = "\u00ABredacted:url\u00BB";
|
|
|
65
65
|
/** [ref]:出网代理 URL 的回显尺(`outbound-dispatcher.ts` `displayProxyUrl`)形不干净时整只用**同一枚**占位 —— 单独一行导出,
|
|
66
66
|
* 上面那行字面量保持 `const NAME = "…";` 形(`test/api-notice-text-freeze.test.ts` §6 的冻结扫描按这一形认替换 token)。 */
|
|
67
67
|
export { DISPLAY_SAFE_URL_TOKEN };
|
|
68
|
-
/**
|
|
69
|
-
* 名表的**只读导出**([ref]:第四处消费 —— 受理口的 URL 凭据判官 `url-credential.ts`;文档同步钉按它对表)。
|
|
70
|
-
* 表的属主仍是本模块的 {@link CREDENTIAL_NAME_ANCHORS};加一个名字只改那一处,本数组与下面的谓词随之现算。
|
|
71
|
-
*/
|
|
72
|
-
export declare const CREDENTIAL_PARAM_NAMES: readonly string[];
|
|
73
|
-
/**
|
|
74
|
-
* 「这个**已解码**的参数名是不是凭据名」([ref] 第四处消费)。入参是收方读到的那一形(`URLSearchParams` 解过一次码的名字),
|
|
75
|
-
* 判法与本模块 URL 参数臂同读 —— 同一只判定 {@link credentialNameAnchor}:整名在表里(ASCII 大小写不敏感,不做 Unicode 折叠)。
|
|
76
|
-
*/
|
|
77
|
-
export declare function isCredentialParamName(decodedName: string): boolean;
|
|
78
68
|
/**
|
|
79
69
|
* 🔴 **取证相的重扫模式(测试座,[ref])** —— 生产恒 `"incremental"`;`"full"` 是**参照语义** = 「没有可复用的上一次执行」:
|
|
80
70
|
* 每级五条取证臂整段重跑、URL 臂每段重扫,既不读足迹也不回放(池把每一级的脏区间当作「未知」交下去,与级 0 同一个读法)。
|
|
@@ -135,6 +125,44 @@ export declare function setRedactionObserver(fn: ((patternLabel: string, count:
|
|
|
135
125
|
* · `single-line`:出口在读者看见之前把文本压成一行(出口座的日志字段行 / 标题行:空白控制字符被删或折成空格)⇒ ①②③④。
|
|
136
126
|
*/
|
|
137
127
|
export type RedactionLayout = "multi-line" | "single-line";
|
|
128
|
+
/**
|
|
129
|
+
* 一段文本相对「它所在的那一整段」的**范围**(闭集两形;调用方对自己交来的文本的陈述,不是旋钮):
|
|
130
|
+
* · `whole`:这就是全部。所有「见收尾才认」的结构臂走到末尾仍没见收尾 ⇒ 这一起点不成 —— 判据 = 声明正则(`test/trace-redact.test.ts` 的真值表钉着扫描器与声明正则逐跨度等价);
|
|
131
|
+
* · `head`:这只是更长文本的头一段(出口座对有界行只扫一段头,见 `trace/exit-seat.ts` 的扫描窗),并带 **`emitEnd`** —— 调用方真会往外交的那一段的终点(**原文下标**;出口座的出门区终点,
|
|
132
|
+
* 其后的窗内余量只喂脱敏器、不出门)。窗几何只有调用方知道,脱敏器不猜、不抄第二份。**一条律,所有臂同读:结构的判定走到这一段末尾还没走完 ⇒ 判定在更远处(未决)⇒ 从结构起点遮到这一段的末尾
|
|
133
|
+
* (fail-closed:起点在、判定要看窗外,明文不许出门);而未决尾只在它的起点 `< emitEnd` 时才算** —— 起点在余量里的,对出门字节零作用(出门的至多到 `emitEnd`;余量只喂脱敏器、不出门,
|
|
134
|
+
* 其后的原文也不再被扫):不产跨度、不记 `redactions_applied_total`、不参与解重叠、也不参与档位盖章(候选不存在,所以不盖住也不截断别的候选)。取舍在池收尾的一处({@link armPool}:收集之后、解重叠之前;读的是臂收上来的原始起点,经 {@link StartReach} 问回原文下标),
|
|
135
|
+
* 臂自己只管把未决那一支标出来({@link SecretSpan.undecided})。
|
|
136
|
+
* 未决只有两种,同读一条臂:
|
|
137
|
+
* ① **收尾没见到** —— JSON 串值(要收尾引号)· URL authority(要 `@`;authority 一路走到末尾没有 `/` / 空白,里面有没有 `@` 都读成还在 userinfo 里)·
|
|
138
|
+
* SSH2 / PEM 栅栏(要收尾栅栏)· 带引号的强锚值(要收尾引号)· PuTTY 容器(终止符之后到末尾没见下一个版本头);
|
|
139
|
+
* ② **起头没读完**(起头本身不设长度上界,起点可以离末尾很远)—— PEM 起始栅栏行(标签之后到末尾一枚 `-----` 都没有,已读到的部分也还可能是合法栅栏行的前缀)· PuTTY 版本头(`<数字串>: ` 没写完)·
|
|
140
|
+
* 无头 .ppk 字段(`Private-Lines: <数字串>` 之后下一个体行的判定没走完)· 词法关键字臂(`Bearer` / `Basic` / `token`)的起头(完整关键字之后跟着不设长度上界的分隔段、值被窗尾切在窗外,见 {@link undecidedKeywordStart};
|
|
141
|
+
* 关键字写了一半 / 关键字紧贴值的起点离窗尾至多几十个字符,不另立一支)。
|
|
142
|
+
* PuTTY 容器臂的「无合格终止 ⇒ 吃到输入末尾」本来就是这一律在整段文本上的形,两种范围都吃到末尾;区别只在留痕 —— 整段读法上它是兜底(记 `server.redact.ppk-eat-to-end`),
|
|
143
|
+
* head 读法上终止可能在更远处,是未决(不记)。**未决一律不记 fail-open**:它是这一律的正常读数,不是回退;
|
|
144
|
+
* 由裸形 / 关键字 / 查询参数 / 环境变量赋值等**不靠收尾**的臂认出的凭据(值到字符类的自然右界)两种范围读法逐字相同;关键字臂只多上面 ② 里那一条未决尾。
|
|
145
|
+
*/
|
|
146
|
+
export type RedactionExtent = {
|
|
147
|
+
readonly kind: "whole";
|
|
148
|
+
} | {
|
|
149
|
+
readonly kind: "head";
|
|
150
|
+
readonly emitEnd: number;
|
|
151
|
+
};
|
|
152
|
+
/** 整段读法(`RedactionExtent` 的 `whole` 形;不带数据,一个值)。 */
|
|
153
|
+
export declare const WHOLE_EXTENT: RedactionExtent;
|
|
154
|
+
/**
|
|
155
|
+
* 🔴 **出口座扫描窗的单位 = 读法单元,不是原始码元**(修复验证腿 high ①):从 `from`(缺省 0)起数 `units` 个**读法单元**(各读法里最少的那一读 —— 删得最多的 —— 剩下的码元),
|
|
156
|
+
* 返回原文里的终点(含 `≥ units` 个读法单元的前缀,至多是最短那一个的两倍;文本不够长 ⇒ `text.length`)。格式字符 / 控制字符 / 转义写法的不可见字符不计数:它们在读法格里被删,
|
|
157
|
+
* 整段读法认得出的凭据(`sk-` + 18 位 + 五千个零宽空格 + 余下 12 位)靠它们之后的字节凑够最短长度 —— 窗若按原始码元计,填充一撑就把证据推到窗外,窗读法只见前缀而漏。
|
|
158
|
+
* `from`:出门区与余量**各自从自己的起点数**(窗 = 出门区〔从头数半窗〕+ 余量〔从出门区终点起再数半窗〕),不是各自从头数「第一个 ≥ units 的终点」—— 后者遇到不可见填充会按翻倍
|
|
159
|
+
* 跳到同一个终点,余量塌成 0,被窗尾切开的凭据在出门区里露出半截(修复验证 r3 high)。
|
|
160
|
+
* 取舍:不可见填充很大的文本,窗随之延伸(最坏延伸到整段 = 整段读法的代价),换来「窗里的读法单元数恒 ≥ `units`」这一个不变量 —— 窗里每一读的视图都不短于 `units`。
|
|
161
|
+
* 终点不落在转义写法中间:前缀末尾还没写完的转义写法({@link trailingPartialEscapeStart},在读法后文本上判,{@link shortestReading})不计数、窗延伸到它写完 —— 出门区终点与窗尾都因此落在转义的边上,余量从干净的边起数。
|
|
162
|
+
* 复杂度:**第一趟**若可见占比 ≥ 一半(少量换行 / 色码)按占比补足缺口,均匀的文本一两趟落在终点附近;补不足(或占比低)的趟一律至少翻倍 —— 总趟数 O(log 终点)、总功 O(终点),
|
|
163
|
+
* 不存在逐趟只前进几个码元的爬行(4095 个可见 + 4000 个控制字符曾因此平方,K=4000 约 0.2–0.3 s)。判据与读法格同源(同一批切除点收集器,零第二份「什么算不可见」)。
|
|
164
|
+
*/
|
|
165
|
+
export declare function readingHeadEnd(text: string, layout: RedactionLayout, units: number, from?: number): number;
|
|
138
166
|
export declare function redactSecrets(text: string, opts?: {
|
|
139
167
|
observe?: boolean;
|
|
140
168
|
json?: boolean;
|
|
@@ -195,7 +223,7 @@ export type RedactionSpan = {
|
|
|
195
223
|
readonly repl: string;
|
|
196
224
|
};
|
|
197
225
|
export type { RedactionScope };
|
|
198
|
-
export declare function proposeRedactionSpans(text: string, scope: RedactionScope, layout: RedactionLayout): readonly RedactionSpan[];
|
|
226
|
+
export declare function proposeRedactionSpans(text: string, scope: RedactionScope, layout: RedactionLayout, extent: RedactionExtent): readonly RedactionSpan[];
|
|
199
227
|
/**
|
|
200
228
|
* 🔴 环 + 深度预算(2026-07-25 补)。原实现是纯递归、**既不记已访问节点也不限深度**,而它的调用位置是
|
|
201
229
|
* **最不可信的边界**:`toolStart`/`toolEnd` 把工具的 `args`/`output`/`structured` 直接喂进来。后果两条:
|
|
@@ -232,7 +260,7 @@ export declare function redactedPreview(value: unknown, cap?: number): string |
|
|
|
232
260
|
*
|
|
233
261
|
* 🔴 **[ref] 展示半场(7.90.0 / core 7.24.0):两条正交的律合成一次,名表的射程缩到不可约的那一半**。
|
|
234
262
|
* 改前内部只有一条:`redactSecrets(new URL(raw).href)` —— 自由文本那条**名单制**的律,query 的值只在键名
|
|
235
|
-
*
|
|
263
|
+
* 落在凭据名表 `CREDENTIAL_PARAM_NAMES`(或值本身像个密钥)时才遮,于是**没人列过的那个键名**就是它的盲点
|
|
236
264
|
* (`?sig=…` / `?auth=…` / 部署自定义的网关参数名)。现在前面先跑 core 的 `displayUrlOf`,它是**位置制**的:
|
|
237
265
|
* · userinfo **落地**(不是遮成记号 —— 它从**解析**组合 `scheme://host + path + query`,userinfo 结构上
|
|
238
266
|
* 进不了产物);凭据在 userinfo 这件事本身仍然响亮,只不过是在**声明关口**响
|