@dsmm/dsmm 0.3.1 → 0.3.2
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/cordis.patch.yml +9 -0
- package/docs/compatibility.md +10 -0
- package/docs/releasing.md +25 -65
- package/docs/roadmap.md +44 -2
- package/lib/client/ChildPermissions.d.ts +43 -0
- package/lib/client/ChildPermissions.js +100 -0
- package/lib/client/ChildrenPanel.d.ts +4 -1
- package/lib/client/ChildrenPanel.js +3 -3
- package/lib/client/DeploymentFields.d.ts +6 -2
- package/lib/client/DeploymentFields.js +8 -6
- package/lib/client/DeploymentPage.d.ts +4 -1
- package/lib/client/DeploymentPage.js +5 -4
- package/lib/client/HistoryContinuation.d.ts +7 -0
- package/lib/client/HistoryContinuation.js +22 -0
- package/lib/client/PermissionPanelEntry.d.ts +8 -0
- package/lib/client/PermissionPanelEntry.js +11 -0
- package/lib/client/PermissionsPanel.d.ts +3 -1
- package/lib/client/PermissionsPanel.js +3 -2
- package/lib/client/ProfilesSection.js +3 -3
- package/lib/client/RoleAvailability.js +1 -1
- package/lib/client/SessionProfiles.js +21 -18
- package/lib/client/TemporaryPermissions.d.ts +21 -0
- package/lib/client/TemporaryPermissions.js +94 -0
- package/lib/client/children-locales.d.ts +4 -4
- package/lib/client/controller.d.ts +17 -0
- package/lib/client/controller.js +101 -18
- package/lib/client/deployment-locales.js +26 -26
- package/lib/client/history-controller.d.ts +29 -0
- package/lib/client/history-controller.js +111 -0
- package/lib/client/history-entry.d.ts +11 -0
- package/lib/client/history-entry.js +106 -0
- package/lib/client/history-locales.d.ts +95 -0
- package/lib/client/history-locales.js +41 -0
- package/lib/client/index.js +16 -3
- package/lib/client/locales.d.ts +6 -0
- package/lib/client/locales.js +104 -92
- package/lib/client/permission-locales.d.ts +26 -0
- package/lib/client/permission-locales.js +55 -35
- package/lib/client/temporary-permission-client.d.ts +20 -0
- package/lib/client/temporary-permission-client.js +52 -0
- package/lib/client/temporary-permission-entry.d.ts +6 -0
- package/lib/client/temporary-permission-entry.js +56 -0
- package/lib/client.js +3881 -1981
- package/lib/history-candidates.d.ts +30 -0
- package/lib/history-candidates.js +176 -0
- package/lib/history-codec.d.ts +11 -0
- package/lib/history-codec.js +102 -0
- package/lib/history-contract.d.ts +44 -0
- package/lib/history-contract.js +2 -0
- package/lib/history-controller.d.ts +42 -0
- package/lib/history-controller.js +329 -0
- package/lib/history-policy.d.ts +4 -0
- package/lib/history-policy.js +8 -0
- package/lib/history-remote.d.ts +28 -0
- package/lib/history-remote.js +17 -0
- package/lib/history-rpc.d.ts +24 -0
- package/lib/history-rpc.js +136 -0
- package/lib/history-support.d.ts +15 -0
- package/lib/history-support.js +21 -0
- package/lib/history-types.d.ts +67 -0
- package/lib/history-types.js +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +24 -6
- package/lib/native-admission.d.ts +21 -0
- package/lib/native-admission.js +206 -16
- package/lib/permission-child-control.d.ts +36 -0
- package/lib/permission-child-control.js +164 -0
- package/lib/permission-control.d.ts +2 -0
- package/lib/permission-control.js +7 -0
- package/lib/permission-controller.js +2 -2
- package/lib/permission-exec-argv.d.ts +32 -0
- package/lib/permission-exec-argv.js +171 -0
- package/lib/permission-fs-search.js +2 -1
- package/lib/permission-fs.js +2 -1
- package/lib/permission-native-rules.js +3 -3
- package/lib/permission-temporary-files.d.ts +19 -0
- package/lib/permission-temporary-files.js +248 -0
- package/lib/permission-temporary-grants.d.ts +106 -0
- package/lib/permission-temporary-grants.js +198 -0
- package/lib/permission-temporary-install.d.ts +25 -0
- package/lib/permission-temporary-install.js +86 -0
- package/lib/permission-temporary-remote.d.ts +19 -0
- package/lib/permission-temporary-remote.js +75 -0
- package/lib/permission-temporary-rpc.d.ts +37 -0
- package/lib/permission-temporary-rpc.js +154 -0
- package/lib/permission-temporary-types.d.ts +47 -0
- package/lib/permission-temporary-types.js +2 -0
- package/lib/permission-temporary-web.d.ts +11 -0
- package/lib/permission-temporary-web.js +154 -0
- package/lib/permission-web.js +2 -1
- package/lib/preset-skills.d.ts +1 -1
- package/lib/preset-skills.js +2 -2
- package/lib/profile-rpc.js +2 -0
- package/lib/profile-runtime.d.ts +12 -1
- package/lib/profile-runtime.js +122 -10
- package/lib/profile-store.d.ts +2 -2
- package/lib/profile-store.js +8 -1
- package/lib/profile-types.d.ts +1 -0
- package/lib/role-invocation.d.ts +1 -1
- package/lib/role-invocation.js +2 -2
- package/lib/role-subagents.js +16 -3
- package/lib/skills.d.ts +1 -0
- package/lib/skills.js +5 -1
- package/package.json +41 -33
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +13291 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +9133 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +156 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +3546 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +431 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +119 -0
- package/patches/dsh-approval-settlement/README.md +41 -0
- package/patches/dsh-approval-settlement/metadata.json +10 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +383 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +55 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +16673 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +29 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +196 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +35 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +40 -0
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
export const PERMISSIONS_NS = "settings.dsmm-permissions";
|
|
2
2
|
export const permissionEn = {
|
|
3
|
+
childPermissions: "Permissions", childEnable: "Allow this child to ask me for approval", childRevoke: "Revoke child approvals",
|
|
4
|
+
childPermissionBoundary: "Future approvals for this live child only. Root grants, siblings and future children are unchanged. Role and sandbox limits remain. Revocation does not cancel an already pending native request or replay work.",
|
|
5
|
+
childUnavailable: "Verified live ownership, policy or approval route is unavailable. Refresh; retired children cannot be revived here.",
|
|
6
|
+
childNoPending: "No native approval is pending for this child.", childEnabled: "This child may request approval.", childDisabled: "Interactive approval is off for this child.",
|
|
7
|
+
childUnconfirmed: "The child permission result is unavailable or unconfirmed. Refresh before retrying.", childProject: "Project", childRole: "Role ceiling", childReadOnly: "Read-only",
|
|
8
|
+
temporaryChildSession: "This child task", temporaryWebBoundary: "Exact scheme, host and port for native Web Fetch only; no subdomains, shell sockets, search, model or MCP access. Existing redirect, DNS, proxy and Fake-IP restrictions remain. A proxy path does not provide local DNS proof.",
|
|
9
|
+
temporaryTitle: "Temporary approvals", temporaryDuration: "Approval duration", temporaryApprove: "Approve", temporaryRevoke: "Revoke", temporaryRefresh: "Refresh", temporaryEmpty: "No active temporary approvals.",
|
|
10
|
+
"temporary:once": "Once only", "temporary:session": "This session", "temporary:15min": "15 minutes", "temporary:1h": "1 hour",
|
|
11
|
+
temporaryBoundary: "Selected tool scope in this live session only; no child inheritance or sandbox upgrade. Revocation stops future handoffs, not effects already started. File scopes do not confine shell processes or guarantee final-inode/hardlink isolation.",
|
|
12
|
+
temporaryUnavailable: "Temporary approval is unavailable or unconfirmed. Refresh, or use the native once-only prompt. No operation is replayed.",
|
|
3
13
|
title: "Permission control", rules: "Global permission rules",
|
|
4
|
-
nativeApproval: "
|
|
5
|
-
root: "Selected
|
|
6
|
-
child: "
|
|
14
|
+
nativeApproval: "Approve commands in the native prompt. Allow approves only that call.",
|
|
15
|
+
root: "Selected main session", noRoot: "Select a main session to view its permission rules.",
|
|
16
|
+
child: "Select this child’s main session to edit Global rules.",
|
|
7
17
|
unknown: "Unavailable / unknown", reading: "Reading…", busy: "Operation pending…",
|
|
8
18
|
executable: "Native Shell registration identity (exact)", command: "Full command (exact)", cwd: "Working directory (exact)", id: "Rule ID", action: "Rule action", match: "Match kind",
|
|
9
19
|
outsideReads: "Outside-workspace reads", webSearch: "Web search", webFetch: "Web fetch", enabled: "Enabled", rule: "Coarse rule",
|
|
10
20
|
inherit: "Inherit native policy", "action:allow": "Allow", "action:ask": "Ask", "action:deny": "Deny",
|
|
11
21
|
"kind:outside-read": "Outside-workspace read", "kind:shell": "Shell operation", "kind:webSearch": "Web search", "kind:webFetch": "Web fetch",
|
|
12
22
|
path: "Canonical path", pathScope: "Path match", exact: "Exact path", tree: "Path and descendants",
|
|
13
|
-
networkLimit: "
|
|
14
|
-
rulesHint: "
|
|
15
|
-
configPolicyHint: "
|
|
16
|
-
configRulesHint: "
|
|
17
|
-
coldHint: "
|
|
18
|
-
nativeCommands: "Exact
|
|
19
|
-
registrationUnresolved: "
|
|
23
|
+
networkLimit: "Web rules cover public web tools only. Private networks, shell commands and sockets remain outside this permission.",
|
|
24
|
+
rulesHint: "Saves Global rules for the selected main session. If profile overrides block saving, edit or clear them in the profile scope above, then refresh.",
|
|
25
|
+
configPolicyHint: "Profile settings override Global settings. Arrays replace inherited lists. Refresh session permissions after saving to check what is effective.",
|
|
26
|
+
configRulesHint: "Edit existing records or imported rules with valid provenance. Use the session rules editor for verified approvals. An empty array clears inherited records.",
|
|
27
|
+
coldHint: "Changing this switch requires a Host restart. Current protection stays active until then. Restart may cancel sessions.",
|
|
28
|
+
nativeCommands: "Exact command rules", nativeCommandsHint: "Default Off. Match the tool, executable, subcommand, ordered arguments, directory and sandbox exactly. No wildcards. Other approval, denial and read-only restrictions still apply. New entries ask for approval and use workspace-write.",
|
|
29
|
+
registrationUnresolved: "Executor identity is unconfirmed. Verify the tool, executable, environment and sandbox before entering exact values.",
|
|
20
30
|
entryId: "Entry ID", tool: "Tool (exact)", nativeExecutable: "Executable (exact)", subcommand: "Subcommand (optional; blank omits)", args: "Ordered arguments (JSON string array)", sandboxMode: "Sandbox mode (exact)", mode: "Native action", addEntry: "Add exact entry", removeEntry: "Remove entry", noEntries: "No exact command entries.", unset: "Unset — restore inheritance", inheritedEntries: "Inherited entries; editing pins a replacement array in this layer.", explicitEntries: "Explicit replacement array in this layer.", invalidEntry: "Invalid exact entry: use unique nonblank IDs, exact nonblank strings, an absolute Host working directory, and a JSON string array. Draft retained; Save locked.",
|
|
21
|
-
rulesUnavailable: "
|
|
31
|
+
rulesUnavailable: "Editing requires an open main session, local editing permission and synchronized rules. Check profile overrides, reconnect and refresh.",
|
|
22
32
|
invalidArgsHint: "Correct invalid argument JSON before removing rows, or explicitly Unset this entire array to restore inheritance. Other fields do not discard invalid text.",
|
|
23
|
-
observedPolicy: "
|
|
24
|
-
profileOverrideState: "
|
|
25
|
-
matchHint: "
|
|
33
|
+
observedPolicy: "Effective policy (including profile overrides)",
|
|
34
|
+
profileOverrideState: "Profile overrides", profileOverrideUnknown: "Unknown. Choose Current DSH profile above to inspect overrides.",
|
|
35
|
+
matchHint: "Match an exact path or directory tree, an exact shell tool/command/directory, or a web tool. Allow does not grant outside-workspace writes. Rules stay active until revoked.",
|
|
26
36
|
source: "Actual source", recordVersion: "Record version", savedAt: "Saved at", operator: "Verified Host operator", imported: "User import", active: "Active record", revoked: "Revoked record",
|
|
27
|
-
base: "Draft
|
|
37
|
+
base: "Draft version", savedRevision: "Saved version", runtimeRevision: "Effective version", runtime: "Rule synchronization", synced: "Synced", updating: "Updating", unsynced: "Unsynced — saving unavailable",
|
|
28
38
|
mounted: "Startup mounted", on: "On", off: "Off", restart: "Independent restart required",
|
|
29
|
-
coverageTitle: "
|
|
39
|
+
coverageTitle: "Tool coverage", coverage: "Last observed for this main session. Executor readiness and network access must be checked separately.",
|
|
30
40
|
coverageUnavailable: "Coverage unavailable / unknown. No trusted live observation was returned.", coverageEmpty: "No trusted tool registrations observed for this Root.",
|
|
31
41
|
coverageRuntime: "Observed consumer state", coverageRevision: "Observed consumer runtime source", toolName: "Observed tool name", toolKind: "Trusted registration kind",
|
|
32
42
|
toolApproval: "Approval boundary", nativeOnce: "Native prompt — once only", toolMemory: "Scoped approval memory", notProvided: "Not provided",
|
|
@@ -35,9 +45,9 @@ export const permissionEn = {
|
|
|
35
45
|
"limit:scopedMemory": "Not provided by native rules.", "limit:webFetch": "Native public-address checks remain authoritative; private-network access is not granted.",
|
|
36
46
|
"limit:webSearchDestinations": "Unsupported.", "limit:proxyAddressBinding": "Depends on the native proxy; no stronger address-binding guarantee.",
|
|
37
47
|
"limit:shellSockets": "Depends on the native executor; no all-Shell or socket firewall.", "limit:providerAuthMcp": "Not covered by these rules.",
|
|
38
|
-
pathEvidence: "
|
|
48
|
+
pathEvidence: "Read checks its active filesystem. Search and shell path checks depend on the executor. Final-file identity, full filesystem confinement and socket isolation are not guaranteed.",
|
|
39
49
|
newRule: "Add exact-match rule", editRule: "Edit rule", stage: "Stage rule", cancel: "Cancel rule edit", stageRevoke: "Stage revocation", unstage: "Remove staged change",
|
|
40
|
-
editor: "Rule draft", staged: "
|
|
50
|
+
editor: "Rule draft", staged: "Unsaved rule changes", noRules: "No saved rules.", save: "Save", discard: "Discard draft and reload", dirty: "Unsaved rules draft", saved: "Rules saved. Check synchronization below.",
|
|
41
51
|
"issue:not-owned": "Root/operator/readonly authority refused. Select the intended Root and refresh.",
|
|
42
52
|
"issue:stale": "Source conflict. Draft retained. Review, then explicitly discard and reload.",
|
|
43
53
|
"issue:cancelled": "Operation cancelled; refresh actual saved state.",
|
|
@@ -50,32 +60,42 @@ export const permissionEn = {
|
|
|
50
60
|
"issue:protocol": "Untrusted or mismatched service response. Refresh or reconnect.",
|
|
51
61
|
};
|
|
52
62
|
export const permissionZh = {
|
|
63
|
+
childPermissions: "权限", childEnable: "允许此子任务向我请求批准", childRevoke: "撤销子任务批准",
|
|
64
|
+
childPermissionBoundary: "仅影响此 live 子任务的后续审批,不继承 Root 批准,不影响同级或未来子任务。角色与沙箱上限不变。撤销不取消已经 pending 的原生请求,也不重放任务。",
|
|
65
|
+
childUnavailable: "可信 live ownership、策略或审批入口不可用。请刷新;这里不能复活已结束的子任务。",
|
|
66
|
+
childNoPending: "此子任务当前没有原生待审批请求。", childEnabled: "此子任务可请求批准。", childDisabled: "此子任务的交互审批已关闭。",
|
|
67
|
+
childUnconfirmed: "子任务权限结果不可用或待确认。请刷新后再重试。", childProject: "项目", childRole: "角色上限", childReadOnly: "只读",
|
|
68
|
+
temporaryChildSession: "本次子任务", temporaryWebBoundary: "仅限原生 Web Fetch 的精确 scheme、主机与端口,不含子域、Shell socket、搜索、模型或 MCP。原有重定向、DNS、代理和 Fake-IP 限制保留;代理路径不提供本地 DNS 证明。",
|
|
69
|
+
temporaryTitle: "临时批准", temporaryDuration: "批准时长", temporaryApprove: "批准", temporaryRevoke: "撤销", temporaryRefresh: "刷新", temporaryEmpty: "没有生效中的临时批准。",
|
|
70
|
+
"temporary:once": "仅本次", "temporary:session": "本次会话", "temporary:15min": "15 分钟", "temporary:1h": "1 小时",
|
|
71
|
+
temporaryBoundary: "仅限当前 live 会话的所选工具范围,不传给子任务、不提升沙箱。撤销阻止后续交接,不回滚已经开始的效果。文件范围不约束 Shell 进程,也不保证最终 inode/hardlink 隔离。",
|
|
72
|
+
temporaryUnavailable: "临时批准不可用或结果待确认。请刷新,或使用原生仅本次审批;不会自动重放操作。",
|
|
53
73
|
title: "权限控制", rules: "全局权限规则",
|
|
54
|
-
nativeApproval: "
|
|
55
|
-
root: "
|
|
74
|
+
nativeApproval: "请在原生提示中批准命令;「允许」仅批准本次调用。",
|
|
75
|
+
root: "所选主会话", noRoot: "请选择主会话以查看权限规则。", child: "请切换到此子会话的主会话后编辑全局规则。",
|
|
56
76
|
unknown: "不可用/未知", reading: "正在读取…", busy: "操作处理中…",
|
|
57
77
|
executable: "原生 Shell 注册身份(精确匹配)", command: "完整命令(精确匹配)", cwd: "工作目录(精确匹配)", id: "规则 ID", action: "规则动作", match: "匹配类型",
|
|
58
78
|
outsideReads: "工作区外读取", webSearch: "网页搜索", webFetch: "网页抓取", enabled: "启用", rule: "粗粒度规则",
|
|
59
79
|
inherit: "继承原生策略", "action:allow": "允许", "action:ask": "询问", "action:deny": "拒绝",
|
|
60
80
|
"kind:outside-read": "工作区外读取", "kind:shell": "Shell 操作", "kind:webSearch": "网页搜索", "kind:webFetch": "网页抓取",
|
|
61
81
|
path: "规范路径", pathScope: "路径匹配", exact: "精确路径", tree: "此路径及子树",
|
|
62
|
-
networkLimit: "
|
|
63
|
-
rulesHint: "
|
|
64
|
-
configPolicyHint: "
|
|
65
|
-
configRulesHint: "
|
|
66
|
-
coldHint: "
|
|
67
|
-
nativeCommands: "
|
|
68
|
-
registrationUnresolved: "
|
|
82
|
+
networkLimit: "网页规则仅覆盖公共网页工具,不包含私网、Shell 命令或 socket 权限。",
|
|
83
|
+
rulesHint: "为所选主会话保存全局规则。若配置覆盖阻止保存,请在上方当前配置范围内编辑或清除覆盖,再刷新。",
|
|
84
|
+
configPolicyHint: "当前配置优先于全局配置,数组整体替换继承列表。保存后请刷新会话权限以检查实际生效状态。",
|
|
85
|
+
configRulesHint: "可编辑已有记录或带合法来源的导入规则。经核验的批准请使用会话规则编辑器。空数组会清除继承的记录。",
|
|
86
|
+
coldHint: "更改此开关需重启宿主,此前保留当前保护。重启可能取消会话。",
|
|
87
|
+
nativeCommands: "精确命令规则", nativeCommandsHint: "默认关闭。精确匹配工具、可执行程序、子命令、有序参数、目录和沙箱,不支持通配符。其他审批、拒绝和只读限制仍有效。新条目使用询问与 workspace-write。",
|
|
88
|
+
registrationUnresolved: "执行器身份尚未确认,请核验工具、可执行程序、环境和沙箱后再填写精确值。",
|
|
69
89
|
entryId: "条目 ID", tool: "工具(精确)", nativeExecutable: "可执行程序(精确)", subcommand: "子命令(可选,留空省略)", args: "有序参数(JSON 字符串数组)", sandboxMode: "沙箱模式(精确)", mode: "原生动作", addEntry: "添加精确条目", removeEntry: "移除条目", noEntries: "没有精确命令条目。", unset: "Unset——恢复继承", inheritedEntries: "继承的条目;编辑后在此层固定为整体替换数组。", explicitEntries: "此层显式整体替换数组。", invalidEntry: "精确条目无效:ID 需唯一且非空,精确字符串不可空,工作目录为宿主绝对路径,参数为 JSON 字符串数组。草稿保留,保存已锁定。",
|
|
70
|
-
rulesUnavailable: "
|
|
90
|
+
rulesUnavailable: "编辑需要已打开的主会话、本地编辑权限和已同步的规则。请检查配置覆盖,重连后刷新。",
|
|
71
91
|
invalidArgsHint: "请修正无效参数 JSON 后再移除条目;也可显式 Unset 整个数组以恢复继承。修改其他字段不会丢弃无效文本。",
|
|
72
|
-
observedPolicy: "
|
|
73
|
-
profileOverrideState: "
|
|
74
|
-
matchHint: "
|
|
92
|
+
observedPolicy: "有效策略(含当前配置覆盖)",
|
|
93
|
+
profileOverrideState: "配置覆盖", profileOverrideUnknown: "未知,请在上方选择当前 DSH 配置查看覆盖值。",
|
|
94
|
+
matchHint: "可匹配精确路径或目录树、精确 Shell 工具与命令及目录,或网页工具。允许不授予工作区外写入权限。规则保留至撤销。",
|
|
75
95
|
source: "实际来源", recordVersion: "记录版本", savedAt: "保存时间", operator: "宿主已核验 operator", imported: "用户导入", active: "有效记录", revoked: "已撤销记录",
|
|
76
|
-
base: "
|
|
96
|
+
base: "草稿版本", savedRevision: "保存版本", runtimeRevision: "生效版本", runtime: "规则同步", synced: "已同步", updating: "同步中", unsynced: "未同步——暂不可保存",
|
|
77
97
|
mounted: "启动时已挂载", on: "开启", off: "关闭", restart: "需要另行重启",
|
|
78
|
-
coverageTitle: "
|
|
98
|
+
coverageTitle: "工具覆盖范围", coverage: "所选主会话最近观测的覆盖范围,执行器就绪和网络访问需另行检查。",
|
|
79
99
|
coverageUnavailable: "覆盖不可用/未知:未返回可信的实时观测。", coverageEmpty: "未观测到此 Root 的可信工具注册。",
|
|
80
100
|
coverageRuntime: "已观测 consumer 状态", coverageRevision: "已观测 consumer 运行时来源", toolName: "已观测工具名称", toolKind: "可信注册类型",
|
|
81
101
|
toolApproval: "批准边界", nativeOnce: "原生提示——仅本次", toolMemory: "作用域批准记忆", notProvided: "不提供",
|
|
@@ -84,9 +104,9 @@ export const permissionZh = {
|
|
|
84
104
|
"limit:scopedMemory": "原生规则不提供。", "limit:webFetch": "仍以原生 public-address 检查为准,不授予私网访问。",
|
|
85
105
|
"limit:webSearchDestinations": "不支持。", "limit:proxyAddressBinding": "依赖原生代理,不提供更强的地址绑定保证。",
|
|
86
106
|
"limit:shellSockets": "依赖原生执行器,不是全部 Shell 或 socket 的防火墙。", "limit:providerAuthMcp": "不在这些规则覆盖范围。",
|
|
87
|
-
pathEvidence: "
|
|
107
|
+
pathEvidence: "读取检查当前文件系统;搜索和 Shell 的路径检查取决于执行器。不保证最终文件身份、完整文件系统或 socket 隔离。",
|
|
88
108
|
newRule: "添加精确匹配规则", editRule: "编辑规则", stage: "暂存规则", cancel: "取消规则编辑", stageRevoke: "暂存撤销", unstage: "移除暂存更改",
|
|
89
|
-
editor: "规则草稿", staged: "
|
|
109
|
+
editor: "规则草稿", staged: "未保存的规则更改", noRules: "尚无已保存规则。", save: "保存", discard: "丢弃草稿并重载", dirty: "规则草稿未保存", saved: "规则已保存,请核对下方同步状态。",
|
|
90
110
|
"issue:not-owned": "Root/operator/只读权限拒绝,请选择目标 Root 后刷新。", "issue:stale": "来源冲突,草稿保留;核对后显式丢弃并重载。", "issue:cancelled": "操作已取消,请刷新实际保存状态。",
|
|
91
111
|
"issue:unavailable": "服务或运行时不可用,草稿保留;已保存与运行时可能不同。", "issue:validation": "宿主拒绝规则,草稿保留;请核对精确字段与原生覆盖。", "issue:not-found": "规则已不存在。",
|
|
92
112
|
"issue:scope-unavailable": "所请求的操作不可用。", "issue:replayed": "操作已不再有效。", "issue:denied": "当前 Root 策略拒绝操作,没有本地绕过入口。",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConnectionHandle } from "@deepseek-ai/dsh-client-connection/client";
|
|
2
|
+
import type { PendingApproval } from "@deepseek-ai/dsh-client-ui-approval/client";
|
|
3
|
+
import type { ChildPermissionRemote, TemporaryPermissionDuration, TemporaryPermissionRemote } from "../permission-temporary-types.js";
|
|
4
|
+
export declare function temporaryPermissionClient(connection: ConnectionHandle, signal: AbortSignal): TemporaryPermissionRemote & ChildPermissionRemote;
|
|
5
|
+
/** Public PendingApproval type only: answers use the native object and first-wins path. */
|
|
6
|
+
export type TemporaryPendingApproval = PendingApproval & {
|
|
7
|
+
readonly requestId?: string;
|
|
8
|
+
readonly deliveryId?: string;
|
|
9
|
+
answer(outcome: "allowed-once" | "rejected", options?: {
|
|
10
|
+
readonly permit?: string;
|
|
11
|
+
readonly retention?: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare function pendingDelivery(pending: TemporaryPendingApproval): {
|
|
15
|
+
requestId: string;
|
|
16
|
+
deliveryId: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export declare function retainAndAnswer(pending: TemporaryPendingApproval, remote: TemporaryPermissionRemote, duration: TemporaryPermissionDuration, current: () => boolean, scope?: string): Promise<void>;
|
|
19
|
+
export declare function answerWithTemporaryPermit(pending: TemporaryPendingApproval, remote: TemporaryPermissionRemote, current: () => boolean): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=temporary-permission-client.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TEMPORARY_PERMISSION_REMOTE, parseTemporaryGrants, parseTemporaryRequest, parseChildPermission } from "../permission-temporary-remote.js";
|
|
2
|
+
export function temporaryPermissionClient(connection, signal) {
|
|
3
|
+
const generation = connection.generation.getSnapshot();
|
|
4
|
+
const check = () => { signal.throwIfAborted(); if (connection.generation.getSnapshot() !== generation)
|
|
5
|
+
throw new Error("Connection generation changed."); };
|
|
6
|
+
async function call(method, args) {
|
|
7
|
+
check();
|
|
8
|
+
const result = await connection.rpc.call("/api", `dsmmTemporaryPermissions/${method}`, { args }, signal);
|
|
9
|
+
check();
|
|
10
|
+
if (!result.ok)
|
|
11
|
+
throw new Error("Temporary permission service unavailable; use the native once-only prompt.");
|
|
12
|
+
const descriptor = TEMPORARY_PERMISSION_REMOTE.descriptors.find(value => value.method === method);
|
|
13
|
+
if (descriptor.result.mode !== "strict")
|
|
14
|
+
throw new Error("Invalid permission protocol.");
|
|
15
|
+
return descriptor.result.create().parse(result.value);
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
async describe(sessionId) { return parseTemporaryGrants(await call("describe", { sessionId })); },
|
|
19
|
+
async request(sessionId, delivery) { return parseTemporaryRequest(await call("request", { sessionId, delivery })); },
|
|
20
|
+
async retain(sessionId, delivery, duration, scope = "exact") { return String(await call("retain", { sessionId, delivery, duration, scope })); },
|
|
21
|
+
async permit(sessionId, delivery) { const value = await call("permit", { sessionId, delivery }); return value === null ? null : String(value); },
|
|
22
|
+
async revoke(sessionId, grantId) { return parseTemporaryGrants(await call("revoke", { sessionId, grantId })); },
|
|
23
|
+
async child(sessionId, childSessionId) { return parseChildPermission(await call("child", { sessionId, childSessionId })); },
|
|
24
|
+
async enableChild(sessionId, childSessionId) { return parseChildPermission(await call("enableChild", { sessionId, childSessionId })); },
|
|
25
|
+
async revokeChild(sessionId, childSessionId) { return parseChildPermission(await call("revokeChild", { sessionId, childSessionId })); },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function pendingDelivery(pending) {
|
|
29
|
+
return pending.requestId && pending.deliveryId ? { requestId: pending.requestId, deliveryId: pending.deliveryId } : undefined;
|
|
30
|
+
}
|
|
31
|
+
export async function retainAndAnswer(pending, remote, duration, current, scope = "exact") {
|
|
32
|
+
if (!current() || !pending.answerable)
|
|
33
|
+
return;
|
|
34
|
+
const delivery = pendingDelivery(pending);
|
|
35
|
+
let retention;
|
|
36
|
+
if (duration !== "once") {
|
|
37
|
+
if (!delivery)
|
|
38
|
+
throw new Error("Scoped approval unsupported.");
|
|
39
|
+
retention = await remote.retain(pending.sessionId, delivery, duration, scope);
|
|
40
|
+
}
|
|
41
|
+
if (current() && pending.answerable)
|
|
42
|
+
await pending.answer("allowed-once", retention === undefined ? undefined : { retention });
|
|
43
|
+
}
|
|
44
|
+
export async function answerWithTemporaryPermit(pending, remote, current) {
|
|
45
|
+
const delivery = pendingDelivery(pending);
|
|
46
|
+
if (!delivery || !current() || !pending.answerable)
|
|
47
|
+
return;
|
|
48
|
+
const permit = await remote.permit(pending.sessionId, delivery);
|
|
49
|
+
if (permit && current() && pending.answerable)
|
|
50
|
+
await pending.answer("allowed-once", { permit });
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=temporary-permission-client.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { TemporaryPermissionRemote } from "../permission-temporary-types.js";
|
|
3
|
+
import type { PermissionController } from "./permission-controller.js";
|
|
4
|
+
/** Approval slots belong to the connection generation; the drawer also borrows its exact current scope. */
|
|
5
|
+
export declare function registerTemporaryPermissionEntry(ctx: Context, permissions: PermissionController): import("@deepseek-ai/dsh-client-store").SnapshotStore<TemporaryPermissionRemote | undefined>;
|
|
6
|
+
//# sourceMappingURL=temporary-permission-entry.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createSnapshotStore } from "@deepseek-ai/dsh-client-store";
|
|
2
|
+
import { registerTemporaryPermissionSlots } from "./TemporaryPermissions.js";
|
|
3
|
+
import { temporaryPermissionClient } from "./temporary-permission-client.js";
|
|
4
|
+
/** Approval slots belong to the connection generation; the drawer also borrows its exact current scope. */
|
|
5
|
+
export function registerTemporaryPermissionEntry(ctx, permissions) {
|
|
6
|
+
const store = createSnapshotStore(undefined);
|
|
7
|
+
void ctx.inject(["connection"], connectionCtx => {
|
|
8
|
+
const connection = connectionCtx.connection;
|
|
9
|
+
let generation = connection.generation.getSnapshot(), lifetime;
|
|
10
|
+
let owner;
|
|
11
|
+
let scopeLifetime, scopeKey = "";
|
|
12
|
+
const bindScope = () => {
|
|
13
|
+
const state = permissions.store.getSnapshot();
|
|
14
|
+
const key = JSON.stringify([state.generation, state.sessionId, state.scope, state.connected]);
|
|
15
|
+
if (key === scopeKey)
|
|
16
|
+
return;
|
|
17
|
+
scopeKey = key;
|
|
18
|
+
scopeLifetime?.abort();
|
|
19
|
+
scopeLifetime = undefined;
|
|
20
|
+
store.set(undefined);
|
|
21
|
+
if (!lifetime || lifetime.signal.aborted || !state.connected || state.sessionId === null || state.scope === "unknown")
|
|
22
|
+
return;
|
|
23
|
+
scopeLifetime = new AbortController();
|
|
24
|
+
store.set(temporaryPermissionClient(connection, AbortSignal.any([lifetime.signal, scopeLifetime.signal])));
|
|
25
|
+
};
|
|
26
|
+
const update = () => {
|
|
27
|
+
const next = connection.generation.getSnapshot();
|
|
28
|
+
if (lifetime && generation === next)
|
|
29
|
+
return;
|
|
30
|
+
generation = next;
|
|
31
|
+
lifetime?.abort();
|
|
32
|
+
lifetime = undefined;
|
|
33
|
+
scopeLifetime?.abort();
|
|
34
|
+
scopeKey = "";
|
|
35
|
+
void owner?.dispose();
|
|
36
|
+
owner = undefined;
|
|
37
|
+
store.set(undefined);
|
|
38
|
+
if (next !== undefined) {
|
|
39
|
+
const current = lifetime = new AbortController();
|
|
40
|
+
owner = connectionCtx.plugin({ name: "dsmm-temporary-permission-generation", apply(ownerCtx) {
|
|
41
|
+
ownerCtx.effect(() => () => current.abort());
|
|
42
|
+
if (current.signal.aborted || connection.generation.getSnapshot() !== next)
|
|
43
|
+
return;
|
|
44
|
+
registerTemporaryPermissionSlots(ownerCtx, connection);
|
|
45
|
+
} });
|
|
46
|
+
}
|
|
47
|
+
bindScope();
|
|
48
|
+
};
|
|
49
|
+
update();
|
|
50
|
+
connectionCtx.effect(() => connection.generation.subscribe(update));
|
|
51
|
+
connectionCtx.effect(() => permissions.store.subscribe(bindScope));
|
|
52
|
+
connectionCtx.effect(() => () => { lifetime?.abort(); scopeLifetime?.abort(); store.set(undefined); }, "dsmm: temporary permission connection lifetime");
|
|
53
|
+
});
|
|
54
|
+
return store;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=temporary-permission-entry.js.map
|