@sema-agent/server 7.130.0 → 7.132.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 +396 -0
- package/README.md +13 -6
- package/README.zh-CN.md +9 -5
- package/USAGE.md +187 -50
- package/dist/approval-card.d.ts +3 -1
- package/dist/approval-card.js +2 -3
- package/dist/audit.d.ts +7 -10
- package/dist/audit.js +4 -1
- package/dist/auth-bridge.d.ts +4 -0
- package/dist/auth-bridge.js +10 -11
- package/dist/bench/s1/live-deps.js +2 -0
- package/dist/boot/deployment-mods.d.ts +31 -0
- package/dist/boot/deployment-mods.js +26 -0
- package/dist/boot/execution-env.d.ts +1 -1
- package/dist/boot/execution-env.js +19 -6
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/read-deny-anchor-audit.d.ts +17 -0
- package/dist/boot/read-deny-anchor-audit.js +36 -0
- package/dist/boot/resolve-spec.d.ts +1 -5
- package/dist/boot/resolve-spec.js +56 -61
- package/dist/boot/runner-deps.d.ts +19 -8
- package/dist/boot/runner-deps.js +14 -2
- package/dist/boot/session-faces.d.ts +1 -7
- package/dist/boot/stage-02-web-admin-pull.js +9 -1
- package/dist/boot/stage-03-store-backend.d.ts +1 -1
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +4 -4
- package/dist/boot/stage-05-execution-env.js +7 -10
- package/dist/boot/stage-06-runners.d.ts +2 -2
- package/dist/boot/stage-06-runners.js +5 -4
- package/dist/boot/stage-07-capability-layer.d.ts +2 -2
- package/dist/boot/stage-07-capability-layer.js +3 -3
- package/dist/boot/stage-08-reapers.d.ts +2 -2
- package/dist/boot/stage-09-leader.d.ts +3 -9
- package/dist/boot/stage-10-http-server.d.ts +3 -9
- package/dist/boot/stage-10-http-server.js +12 -10
- package/dist/boot/stores.d.ts +1 -1
- package/dist/boot/stores.js +5 -6
- package/dist/boot/web-admin.d.ts +0 -3
- package/dist/boot/web-admin.js +35 -35
- package/dist/brain.js +17 -22
- package/dist/budget.js +5 -4
- package/dist/caller-text-echo.d.ts +20 -0
- package/dist/caller-text-echo.js +24 -0
- package/dist/capabilities/brand-identity.d.ts +26 -0
- package/dist/capabilities/brand-identity.js +27 -0
- package/dist/capabilities/builtin-tools.js +2 -1
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +32 -59
- package/dist/capabilities/center-prompts.js +18 -32
- package/dist/capabilities/composite-members.d.ts +1 -0
- package/dist/capabilities/composite-members.js +1 -0
- package/dist/capabilities/engine-capabilities.js +2 -1
- package/dist/capabilities/hands-lane.d.ts +9 -6
- package/dist/capabilities/hands-lane.js +3 -3
- package/dist/capabilities/host-tool-names.d.ts +17 -0
- package/dist/capabilities/host-tool-names.js +15 -0
- package/dist/capabilities/mcp-probe.d.ts +14 -1
- package/dist/capabilities/mcp-probe.js +22 -133
- package/dist/capabilities/repo-tools.js +4 -3
- package/dist/capabilities/scenarios.d.ts +42 -47
- package/dist/capabilities/scenarios.js +19 -35
- package/dist/capabilities/select-environment-tool.js +2 -1
- package/dist/capabilities/send-user-file-tool.d.ts +0 -1
- package/dist/capabilities/send-user-file-tool.js +2 -2
- package/dist/capabilities/skills.d.ts +19 -4
- package/dist/capabilities/skills.js +30 -10
- package/dist/capabilities/tool-defer.js +2 -1
- package/dist/config-catalog.js +22 -11
- package/dist/config-invariants.js +2 -2
- package/dist/config-lkg.d.ts +9 -9
- package/dist/config-lkg.js +20 -4
- package/dist/config-provider.d.ts +3 -1
- package/dist/config-provider.js +14 -6
- package/dist/config-types.d.ts +13 -9
- package/dist/config.d.ts +2 -2
- package/dist/config.js +34 -20
- package/dist/device-ws-protocol.d.ts +1 -1
- package/dist/device-ws-protocol.js +1 -0
- package/dist/elicitation.d.ts +7 -0
- package/dist/elicitation.js +20 -5
- package/dist/env-name-allowlist-knobs.d.ts +12 -2
- package/dist/env-name-allowlist-knobs.js +5 -4
- package/dist/exec-bounds.d.ts +15 -3
- package/dist/exec-bounds.js +4 -0
- package/dist/execution-lane-caps.d.ts +9 -2
- package/dist/execution-lane-caps.js +11 -0
- package/dist/hooks/classic-stations.d.ts +86 -0
- package/dist/hooks/classic-stations.js +27 -0
- package/dist/hooks/hook-llm.d.ts +8 -5
- package/dist/hooks/hook-llm.js +80 -37
- package/dist/hooks/hook-runner.d.ts +273 -75
- package/dist/hooks/hook-runner.js +293 -317
- package/dist/http/admission.d.ts +8 -2
- package/dist/http/admission.js +103 -59
- package/dist/http/approval-sweeps.js +59 -18
- package/dist/http/checkpoint-ctx.d.ts +36 -18
- package/dist/http/checkpoint-ctx.js +14 -10
- package/dist/http/claimed-run.d.ts +13 -0
- package/dist/http/claimed-run.js +15 -0
- package/dist/http/device-placement.js +5 -10
- package/dist/http/dispatch.d.ts +0 -4
- package/dist/http/dispatch.js +6 -10
- package/dist/http/durable-run-leg.d.ts +2 -1
- package/dist/http/durable-run-leg.js +5 -3
- package/dist/http/health-self-report.d.ts +7 -5
- package/dist/http/health-self-report.js +4 -18
- package/dist/http/principal-gate.d.ts +23 -6
- package/dist/http/principal-gate.js +24 -5
- package/dist/http/refusal-body.d.ts +21 -0
- package/dist/http/refusal-body.js +4 -0
- package/dist/http/request-guards.d.ts +27 -0
- package/dist/http/request-guards.js +24 -3
- package/dist/http/resume-legs.d.ts +25 -0
- package/dist/http/resume-legs.js +48 -26
- package/dist/http/routes/approvals-assistant.js +1 -1
- package/dist/http/routes/capabilities.js +7 -17
- package/dist/http/routes/diagnostics.js +1 -1
- package/dist/http/routes/rules.js +2 -2
- package/dist/http/routes/runs.js +13 -17
- package/dist/http/routes/session-sync.js +4 -2
- package/dist/http/routes/sessions.js +23 -11
- package/dist/http/routes/shared-memory.js +2 -13
- package/dist/http/routes/side-query.js +2 -3
- package/dist/http/routes/tasks.js +34 -19
- package/dist/http/scenario-read-face.d.ts +14 -0
- package/dist/http/scenario-read-face.js +5 -0
- package/dist/http/send.d.ts +13 -1
- package/dist/http/send.js +12 -1
- package/dist/http/server.d.ts +37 -23
- package/dist/http/server.js +30 -4
- package/dist/http/stored-body-replay.d.ts +10 -3
- package/dist/http/stored-body-replay.js +27 -6
- package/dist/http/submit-ctx.d.ts +25 -0
- package/dist/http/submit-ctx.js +39 -0
- package/dist/http/wire-types.d.ts +18 -5
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/lane-home-probe.d.ts +43 -0
- package/dist/lane-home-probe.js +35 -0
- package/dist/limit-refusal.d.ts +47 -0
- package/dist/limit-refusal.js +12 -0
- package/dist/main.js +1 -1
- package/dist/mcp-assertion-header.d.ts +3 -11
- package/dist/mcp-assertion-header.js +3 -9
- package/dist/mcp-tool-faces.d.ts +5 -0
- package/dist/mcp-tool-faces.js +5 -1
- package/dist/memory-scope.d.ts +1 -1
- package/dist/model-entry-refusal.d.ts +1 -7
- package/dist/model-provider.d.ts +39 -12
- package/dist/model-provider.js +19 -2
- package/dist/model-route-endpoint.d.ts +52 -12
- package/dist/model-route-endpoint.js +48 -26
- package/dist/model-route-gap.d.ts +5 -4
- package/dist/model-route-gap.js +1 -1
- package/dist/model-select.d.ts +58 -0
- package/dist/model-select.js +31 -0
- package/dist/namespaced-rule-name.d.ts +7 -4
- package/dist/namespaced-rule-name.js +4 -3
- package/dist/observability/cost-taxonomy.d.ts +7 -7
- package/dist/observability/fail-open.d.ts +53 -12
- package/dist/observability/fail-open.js +47 -7
- package/dist/observability/metrics.js +3 -1
- package/dist/observability/prompt-manifest.d.ts +47 -82
- package/dist/observability/prompt-manifest.js +119 -17
- package/dist/observability/run-terminal.js +14 -6
- package/dist/observability/secret-env-scrub.d.ts +13 -1
- package/dist/observability/secret-env-scrub.js +13 -1
- package/dist/observability/tool-trace.d.ts +16 -21
- package/dist/observability/tool-trace.js +51 -42
- package/dist/per-task-image.d.ts +7 -1
- package/dist/per-task-image.js +3 -3
- package/dist/plain-string-record.d.ts +25 -0
- package/dist/plain-string-record.js +32 -0
- package/dist/plugins/blob-backend.d.ts +68 -13
- package/dist/plugins/blob-backend.js +53 -10
- package/dist/plugins/checkpoint-store-sql.d.ts +14 -4
- package/dist/plugins/checkpoint-store-sql.js +39 -26
- package/dist/plugins/k8s-bg-scripts.d.ts +11 -0
- package/dist/plugins/k8s-bg-scripts.js +22 -0
- package/dist/plugins/local-checkpoint-store.js +5 -2
- package/dist/plugins/local-session-store.js +3 -3
- package/dist/plugins/one-time-migrations.d.ts +147 -91
- package/dist/plugins/one-time-migrations.js +372 -208
- package/dist/plugins/permission-rule-store-sql.d.ts +13 -7
- package/dist/plugins/permission-rule-store-sql.js +4 -18
- package/dist/plugins/pg-session-storage.d.ts +4 -5
- package/dist/plugins/pg-session-storage.js +7 -17
- package/dist/plugins/remote-env-adb.d.ts +6 -0
- package/dist/plugins/remote-env-adb.js +9 -4
- package/dist/plugins/remote-env-device.js +3 -0
- package/dist/plugins/remote-env-e2b.d.ts +1 -1
- package/dist/plugins/remote-env-e2b.js +21 -9
- package/dist/plugins/remote-env-host.d.ts +9 -9
- package/dist/plugins/remote-env-host.js +10 -32
- package/dist/plugins/remote-env-k8s.d.ts +95 -26
- package/dist/plugins/remote-env-k8s.js +265 -90
- package/dist/plugins/remote-env-local-docker.d.ts +20 -1
- package/dist/plugins/remote-env-local-docker.js +77 -9
- package/dist/plugins/remote-env-ssh.d.ts +15 -0
- package/dist/plugins/remote-env-ssh.js +109 -3
- package/dist/plugins/remote-shell.d.ts +0 -1
- package/dist/plugins/remote-shell.js +1 -2
- package/dist/plugins/retention-store-sql.js +6 -2
- package/dist/plugins/schema-consistency.d.ts +54 -0
- package/dist/plugins/schema-consistency.js +52 -0
- package/dist/plugins/session-epoch-anchor.d.ts +13 -0
- package/dist/plugins/session-epoch-anchor.js +23 -0
- package/dist/plugins/shared-memory-store-sql.d.ts +9 -3
- package/dist/plugins/shared-memory-store-sql.js +5 -16
- package/dist/plugins/sql-driver.d.ts +141 -0
- package/dist/plugins/sql-driver.js +115 -1
- package/dist/plugins/sql-errors.d.ts +41 -0
- package/dist/plugins/sql-errors.js +36 -0
- package/dist/plugins/store-backend.js +2 -1
- package/dist/plugins/tidb-session-storage.d.ts +7 -11
- package/dist/plugins/tidb-session-storage.js +6 -16
- package/dist/plugins/tidb-session-store.js +1 -1
- package/dist/prompts-domain-validate.d.ts +17 -61
- package/dist/prompts-domain-validate.js +9 -119
- package/dist/question.d.ts +18 -9
- package/dist/question.js +21 -13
- package/dist/request-key-closure.d.ts +4 -4
- package/dist/request-key-closure.js +18 -13
- package/dist/rule-entry-list.d.ts +134 -24
- package/dist/rule-entry-list.js +162 -30
- package/dist/run-local.d.ts +3 -3
- package/dist/run-local.js +26 -25
- package/dist/runs.d.ts +48 -2
- package/dist/runs.js +61 -2
- package/dist/server-secret-env.d.ts +44 -18
- package/dist/server-secret-env.js +49 -8
- package/dist/session-incarnation.d.ts +15 -5
- package/dist/session-incarnation.js +16 -9
- package/dist/session-titler.js +12 -2
- package/dist/spec-fields.d.ts +34 -18
- package/dist/spec-fields.js +46 -53
- package/dist/sql-engine-posture.d.ts +29 -4
- package/dist/sql-engine-posture.js +36 -1
- package/dist/stored-request-hooks-m20.d.ts +23 -0
- package/dist/stored-request-hooks-m20.js +124 -0
- package/dist/stored-request-tool-axes-m19.d.ts +20 -5
- package/dist/stored-request-tool-axes-m19.js +30 -2
- package/dist/task-a2a.d.ts +9 -1
- package/dist/task-a2a.js +73 -47
- package/dist/task-mcp.d.ts +54 -102
- package/dist/task-mcp.js +194 -92
- package/dist/task-settings.d.ts +47 -25
- package/dist/task-settings.js +46 -61
- package/dist/text-bidi.d.ts +3 -46
- package/dist/text-bidi.js +3 -3
- package/dist/tool-approval.d.ts +1 -1
- package/dist/trace/core-keyset-guard.d.ts +24 -4
- package/dist/trace/engine-notice-wire.d.ts +11 -3
- package/dist/trace/engine-notice-wire.js +8 -1
- package/dist/trace/ledger-events.d.ts +3 -1
- package/dist/trace/ledger-sink.d.ts +29 -0
- package/dist/trace/ledger-sink.js +15 -1
- package/dist/trace/model-segment.js +1 -1
- package/dist/trace/project.d.ts +25 -6
- package/dist/trace/project.js +68 -22
- package/dist/trace/wire-projection-faces.d.ts +80 -2
- package/dist/trace/wire-projection-faces.js +23 -1
- package/dist/user-authored-text.d.ts +7 -0
- package/dist/user-authored-text.js +3 -0
- package/dist/web-admin-client/apply-effective.js +10 -5
- package/dist/web-admin-client/candidate-gate.d.ts +6 -6
- package/dist/web-admin-client/candidate-gate.js +3 -3
- package/dist/web-admin-client/http-client.js +0 -6
- package/dist/web-admin-client/read-warnings.d.ts +13 -0
- package/dist/web-admin-client/read-warnings.js +10 -0
- package/dist/web-admin-client/skills-mcp.d.ts +3 -0
- package/dist/web-admin-client/skills-mcp.js +9 -6
- package/dist/web-admin-client/types.d.ts +3 -4
- package/dist/workspace-cache.d.ts +35 -0
- package/dist/workspace-cache.js +36 -0
- package/dist/workspace-space.d.ts +3 -2
- package/dist/workspace-space.js +2 -0
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +8 -1
- package/package.json +4 -4
- package/scripts/drain-check-local.mjs +37 -3
- package/scripts/drain-check.mysql.sql +30 -2
- package/scripts/drain-check.pg.sql +29 -2
- package/dist/capabilities/memory-notice.d.ts +0 -138
- package/dist/capabilities/memory-notice.js +0 -64
- package/dist/capabilities/prompt.d.ts +0 -17
- package/dist/capabilities/prompt.js +0 -6
- package/dist/mcp-content-origin.d.ts +0 -34
- package/dist/mcp-content-origin.js +0 -10
- package/dist/tool-axis-words.d.ts +0 -27
- package/dist/tool-axis-words.js +0 -9
- package/dist/wire-name-bound.d.ts +0 -14
- package/dist/wire-name-bound.js +0 -13
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { describeToolCatalog, HANDS_BAND_TAGS, NO_PERSISTENT_MEMORY_NOTICE } from "@sema-agent/core";
|
|
2
|
-
import { hasConstitutionAnchors } from "../task-settings.js";
|
|
3
|
-
import { executionLaneCaps } from "../execution-lane-caps.js";
|
|
4
|
-
export function persistencePathToolNamesOf(entries) {
|
|
5
|
-
const names = new Set();
|
|
6
|
-
for (const e of entries) {
|
|
7
|
-
if (!e.mountedBy.some((tag) => HANDS_BAND_TAGS.has(tag)))
|
|
8
|
-
continue;
|
|
9
|
-
if ((e.face.effect ?? "write") === "read")
|
|
10
|
-
continue;
|
|
11
|
-
const pt = e.face.pathTarget;
|
|
12
|
-
if (!((pt !== undefined && pt.access !== "read") || e.face.family === "shell"))
|
|
13
|
-
continue;
|
|
14
|
-
names.add(e.name);
|
|
15
|
-
}
|
|
16
|
-
if (names.size === 0) {
|
|
17
|
-
throw new Error("core tool catalog yields no hand-band persistence path (file-write target or writable shell) — " +
|
|
18
|
-
"the #148 disclosure would start claiming 'no persistent memory' on every machine that HAS hands. " +
|
|
19
|
-
"Re-read core's rosterCanPersist inference and re-derive persistencePathToolNamesOf.");
|
|
20
|
-
}
|
|
21
|
-
return Object.freeze([...names]);
|
|
22
|
-
}
|
|
23
|
-
export const KNOWN_PERSISTENCE_TOOL_NAMES = persistencePathToolNamesOf(describeToolCatalog());
|
|
24
|
-
export const NO_PERSISTENT_MEMORY_SECTION_ID = "sema/memory.no-persistent";
|
|
25
|
-
export function buildNoticeLaneFacts(lane) {
|
|
26
|
-
const caps = executionLaneCaps(lane);
|
|
27
|
-
return { handsWired: caps.coreRemoteExecutionEnv === "supported", filePlaneRemote: caps.hostFilePlane !== "supported" };
|
|
28
|
-
}
|
|
29
|
-
export function noPersistentMemoryNotice(facts) {
|
|
30
|
-
if (facts.memoryFaceMounted)
|
|
31
|
-
return "silent";
|
|
32
|
-
if (facts.declaredCapable !== undefined)
|
|
33
|
-
return facts.declaredCapable ? "silent" : "disclose";
|
|
34
|
-
if (facts.hands === "none" || facts.handsReadOnly)
|
|
35
|
-
return "disclose";
|
|
36
|
-
if (!facts.handsWired)
|
|
37
|
-
return "disclose";
|
|
38
|
-
if (facts.filePlaneRemote)
|
|
39
|
-
return "disclose";
|
|
40
|
-
return "roster";
|
|
41
|
-
}
|
|
42
|
-
export function rosterLeavesPersistencePath(tools) {
|
|
43
|
-
return tools.some((t) => KNOWN_PERSISTENCE_TOOL_NAMES.includes(t.name));
|
|
44
|
-
}
|
|
45
|
-
const NOTICE_BLOCK = { id: NO_PERSISTENT_MEMORY_SECTION_ID, slot: "behavior", text: NO_PERSISTENT_MEMORY_NOTICE };
|
|
46
|
-
function mountNotice(decls) {
|
|
47
|
-
const assembledIdentity = decls.find((d) => d.slot === "identity" && hasConstitutionAnchors(d.text));
|
|
48
|
-
if (!assembledIdentity)
|
|
49
|
-
return [...decls, NOTICE_BLOCK];
|
|
50
|
-
return decls.map((d) => (d === assembledIdentity ? { id: d.id, slot: d.slot, text: `${d.text}\n\n${NO_PERSISTENT_MEMORY_NOTICE}` } : d));
|
|
51
|
-
}
|
|
52
|
-
export function withNoPersistentMemoryNotice(provider, when) {
|
|
53
|
-
const due = (ctx) => when === "disclose" || !rosterLeavesPersistencePath(ctx.tools);
|
|
54
|
-
if (provider?.stableBlocks) {
|
|
55
|
-
const blocks = provider.stableBlocks.bind(provider);
|
|
56
|
-
return { ...provider, stableBlocks: (ctx) => (due(ctx) ? mountNotice(blocks(ctx)) : blocks(ctx)) };
|
|
57
|
-
}
|
|
58
|
-
if (provider?.stableSystem) {
|
|
59
|
-
const stable = provider.stableSystem.bind(provider);
|
|
60
|
-
return { ...provider, stableSystem: (ctx) => (due(ctx) ? `${stable(ctx)}\n\n${NO_PERSISTENT_MEMORY_NOTICE}` : stable(ctx)) };
|
|
61
|
-
}
|
|
62
|
-
return { stableBlocks: (ctx) => (due(ctx) ? [NOTICE_BLOCK] : []) };
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=memory-notice.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { PromptProvider } from "@sema-agent/core";
|
|
2
|
-
/**
|
|
3
|
-
* Build a scenario's prompt provider from just its ROLE base, on core 1.243's 提示词主权 contract:
|
|
4
|
-
* `stableSystem` returns ONLY the role layer (base + the task's own systemPrompt) and **core appends
|
|
5
|
-
* the constitution structurally** — harness/safety blocks (Truth/CYBER_RISK/URL_SAFETY), mode blocks,
|
|
6
|
-
* AND the memory safety/hygiene guidance (`constitutionBlocks`), plus the volatile `<user_memory>`
|
|
7
|
-
* tail LAST ([ref] prefix-cache discipline; guarded in CI by `assertPromptCacheFriendly`).
|
|
8
|
-
*
|
|
9
|
-
* History: the pre-1.243 seam made this helper's whole-prompt replacement silently DROP
|
|
10
|
-
* core's constitution — oa/code-review/team ran with zero safety blocks. Same batch also moved
|
|
11
|
-
* MEMORY_SAFETY/MEMORY_HYGIENE into the constitution layer, so the hand-composition this helper used
|
|
12
|
-
* to do (core 1.62, [ref]) would now DOUBLE-inject them — both removed; core owns the discipline
|
|
13
|
-
* (consolidation mutual-exclusion included). This stays a thin role-layer join so scenarios don't
|
|
14
|
-
* re-implement the same two-line body five times.
|
|
15
|
-
*/
|
|
16
|
-
export declare function stablePrompt(base: string): PromptProvider;
|
|
17
|
-
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [ref](core 5.60.0)—— `McpServerSpec.contentOrigin` 的**闭词表单一属主**。
|
|
3
|
-
*
|
|
4
|
-
* core 给 MCP 条目开了一个**内容出处声明**座位:一台 server 的整套工具的结果算 `"local"`(部署自己
|
|
5
|
-
* 写的)/ `"execution"`(执行环境产物,`execIsExternalContent` 仍能收紧)/ `"external"`(第三方内容,
|
|
6
|
-
* 显式 PIN —— 它同时**取消** `trustedTools` 的按名豁免)。缺席 = pre-378 逐字节现行为(协议命名空间
|
|
7
|
-
* 一律判 external,fail-closed)。它只影响**记忆写治理**(会话污染标记),core 明写「no gate/policy/
|
|
8
|
-
* roster effect」——与审批门、角色表、工具白名单都无关。
|
|
9
|
-
*
|
|
10
|
-
* ## 为什么值得一个自己的模块
|
|
11
|
-
* 本仓有**两个**平面会拿到这个键(部署面 center 下发 / 请求面 body),两边都要判「词在不在表里」。
|
|
12
|
-
* 一条安全轴上的判据有两份实现,就是其中一份将来漂开的方式(`mcpInjectionHonored` 顶注里那句
|
|
13
|
-
* 「判据只有一只谓词,不许两处各判一半」的同款理由)。⇒ 表与谓词都只有这一份。
|
|
14
|
-
*
|
|
15
|
-
* ## 闭集纪律(CLAUDE.md:安全轴上未知词必须是**编译**错误)
|
|
16
|
-
* 下面两条 `AssertNever` 是**双向**钉:
|
|
17
|
-
* · core 给 `ToolContentOrigin` 加词而本表没跟 ⇒ `_ContentOriginCovers` 残余非 never ⇒ tsc 红;
|
|
18
|
-
* · 本表写错/写多一个词 ⇒ `_ContentOriginNoStray` 残余非 never ⇒ tsc 红。
|
|
19
|
-
* 单向钉挡不住第二种(手滑把 `"local"` 打成 `"locale"` 只会让一个合法声明被静默拒),所以两条都要。
|
|
20
|
-
*/
|
|
21
|
-
import type { ToolContentOrigin } from "@sema-agent/core";
|
|
22
|
-
/** core `ToolContentOrigin` 的执法副本 —— **唯一**一份(见模块头注)。 */
|
|
23
|
-
export declare const CONTENT_ORIGIN_WORDS: readonly ["local", "execution", "external"];
|
|
24
|
-
/**
|
|
25
|
-
* 词表内?—— 两个平面共用的**那一只**谓词。
|
|
26
|
-
*
|
|
27
|
-
* 🔴 严判:非串(数字 / 布尔 / null / 对象)与大小写不符(`"LOCAL"`)一律**不在词表内**。core 的
|
|
28
|
-
* `ToolContentOrigin` 是字面量联合,不做规范化;本层替它「宽容一下」等于自造第二份值域语义,而这条
|
|
29
|
-
* 轴上宽容的方向恰好是**放宽信任**(把一个写坏的声明当成 `"local"` 读)。
|
|
30
|
-
*/
|
|
31
|
-
export declare function isContentOriginWord(v: unknown): v is ToolContentOrigin;
|
|
32
|
-
/** 坏值的**可打印**摘要(进 400 文案 / warn 元数据)——中和 + 截长,绝不把任意长度的调用方输入原样回显。 */
|
|
33
|
-
export declare function describeBadContentOrigin(v: unknown): string;
|
|
34
|
-
//# sourceMappingURL=mcp-content-origin.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const CONTENT_ORIGIN_WORDS = ["local", "execution", "external"];
|
|
2
|
-
const WORDS = new Set(CONTENT_ORIGIN_WORDS);
|
|
3
|
-
export function isContentOriginWord(v) {
|
|
4
|
-
return typeof v === "string" && WORDS.has(v);
|
|
5
|
-
}
|
|
6
|
-
export function describeBadContentOrigin(v) {
|
|
7
|
-
const raw = typeof v === "string" ? JSON.stringify(v) : v === null ? "null" : Array.isArray(v) ? "array" : typeof v;
|
|
8
|
-
return raw.length > 64 ? `${raw.slice(0, 64)}…` : raw;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=mcp-content-origin.js.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* S-249(DT-13)—— per-tool **风险轴覆写**的值域词表与谓词(读者:**A2A 请求腿**;以及一次性迁移 M19 的升级前读法 `stored-request-tool-axes-m19.ts`,随 M19 的登记行退役)。
|
|
3
|
-
*
|
|
4
|
-
* ## 历史与现状
|
|
5
|
-
* 修前 `task-mcp.ts` 与 `task-a2a.ts` 各自在请求腿上逐键校验同一个三成员结构(`effect` / `egress` / `irreversibility`),两个**闭集词表**是手抄的字面串,
|
|
6
|
-
* 没有一份钉在 core 的型上;S-249 把词表收到本文件并**两向钉死在 core 的型上**(core 加词 ⇒ 正向门红;本表留了 core 已没有的词 ⇒ 反向门红),两条腿读同一只谓词。
|
|
7
|
-
*
|
|
8
|
-
* 之后 MCP 面的 `toolAxes` 判官整个换给了**引擎**:core 7.51.2 起根导出 `readMcpToolAxes`(整份声明一坏全拒、不默认),部署腿(`web-admin-client/skills-mcp.ts`)
|
|
9
|
-
* 与请求腿(`task-mcp.ts`)都问它,本仓不再有 MCP 面的自铸读者、也不再 import 本文件的谓词。**A2A 面引擎没有对应的判官**(core 暂无 `readA2aToolAxes`),
|
|
10
|
-
* 所以 A2A 请求腿(`task-a2a.ts`)仍用本文件的谓词;引擎一旦给 A2A 也立一只判官,本文件随之退役。另一个读者是 M19 的迁移读者:续跑重放腿把升级前存下的
|
|
11
|
-
* `mcpServers[].toolAxes` 按升级前那只读者的读法重读一次(产物再交引擎的判官),那段读法当年就读本文件的谓词,逐字搬回;它不是 MCP 面的第二只判官。
|
|
12
|
-
*
|
|
13
|
-
* 下面的同型钉(A2A 的轴型与 MCP 的轴型逐字同声明)仍有意义:A2A 的词表跟着引擎 MCP 面的轴型走,哪一边加词、改词,另一边在这里当场红。
|
|
14
|
-
*
|
|
15
|
-
* 🔴 **只管值域,不管处置**:A2A 腿对坏值的处置是整条拒(MCP 面是引擎判官的「整份全拒」;两面方向一致),M19 的迁移读者剔坏成员(升级前的读法),判据与理由写在各自的调用点。
|
|
16
|
-
*/
|
|
17
|
-
import type { McpServerSpec, ToolEffect } from "@sema-agent/core";
|
|
18
|
-
/** 一条 per-tool 轴覆写的形。取 MCP 那一面作代表 —— 下面的同型钉证明 A2A 面与它逐字同声明。 */
|
|
19
|
-
export type ToolAxisEntry = NonNullable<McpServerSpec["toolAxes"]>[string];
|
|
20
|
-
/** 轴覆写上那个**两词**的不可逆档(⚠️ 与 `AskOrigin` 面的**三词** `never|maybe|always` 不是同一个词表:
|
|
21
|
-
* 覆写面只收两极,`maybe` 是引擎按工具自己的声明定的,调用方说不出口)。 */
|
|
22
|
-
export type ToolAxisIrreversibility = NonNullable<ToolAxisEntry["irreversibility"]>;
|
|
23
|
-
/** 值是不是一个合法的 `effect` 词(A2A 请求腿与 M19 的迁移读者读它)。 */
|
|
24
|
-
export declare function isToolEffect(v: unknown): v is ToolEffect;
|
|
25
|
-
/** 值是不是一个合法的**覆写面** `irreversibility` 词(A2A 请求腿与 M19 的迁移读者读它)。 */
|
|
26
|
-
export declare function isToolAxisIrreversibility(v: unknown): v is ToolAxisIrreversibility;
|
|
27
|
-
//# sourceMappingURL=tool-axis-words.d.ts.map
|
package/dist/tool-axis-words.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const TOOL_EFFECT_WORDS = ["read", "write", "idempotent"];
|
|
2
|
-
const TOOL_AXIS_IRREVERSIBILITY_WORDS = ["always", "never"];
|
|
3
|
-
export function isToolEffect(v) {
|
|
4
|
-
return typeof v === "string" && TOOL_EFFECT_WORDS.includes(v);
|
|
5
|
-
}
|
|
6
|
-
export function isToolAxisIrreversibility(v) {
|
|
7
|
-
return typeof v === "string" && TOOL_AXIS_IRREVERSIBILITY_WORDS.includes(v);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=tool-axis-words.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 这个申报名能用吗 —— 四个收口共用的**那一只**谓词。
|
|
3
|
-
*
|
|
4
|
-
* 严判:非串、空串、超 `TOOL_WIRE_NAME_MAX_CHARS` 一律不可用。本层不做截断/规范化 —— 截短一个名字
|
|
5
|
-
* 就是**换一个身份**(core 自己 7.13.0 起正是为此把截断改成拒),而被换掉身份的那台 server 上挂的
|
|
6
|
-
* allowTools / toolFaces 收窄声明会一起对不上号。
|
|
7
|
-
*/
|
|
8
|
-
export declare function isUsableWireName(v: unknown): v is string;
|
|
9
|
-
/**
|
|
10
|
-
* 坏名的**可打印**摘要(进 warn 元数据)——中和 + 截长,绝不把任意长度的申报串原样回显进日志。
|
|
11
|
-
* 长度如实带上:运维要的是「我那个名字长了多少」,不是一屏乱码。
|
|
12
|
-
*/
|
|
13
|
-
export declare function describeBadWireName(v: unknown): string;
|
|
14
|
-
//# sourceMappingURL=wire-name-bound.d.ts.map
|
package/dist/wire-name-bound.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TOOL_WIRE_NAME_MAX_CHARS } from "@sema-agent/core";
|
|
2
|
-
export function isUsableWireName(v) {
|
|
3
|
-
return typeof v === "string" && v.length > 0 && v.length <= TOOL_WIRE_NAME_MAX_CHARS;
|
|
4
|
-
}
|
|
5
|
-
export function describeBadWireName(v) {
|
|
6
|
-
if (typeof v !== "string")
|
|
7
|
-
return v === null ? "null" : Array.isArray(v) ? "array" : typeof v;
|
|
8
|
-
if (v.length === 0)
|
|
9
|
-
return "empty";
|
|
10
|
-
const head = v.length > 32 ? `${JSON.stringify(v.slice(0, 32))}…` : JSON.stringify(v);
|
|
11
|
-
return `${head} (${v.length} chars > ${TOOL_WIRE_NAME_MAX_CHARS})`;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=wire-name-bound.js.map
|