@dsmm/dsmm 0.3.2 → 0.3.4
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/README.md +2 -2
- package/agent-presets/dsmm-builder/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +3 -2
- package/agent-presets/dsmm-complex/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-creative/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-deep/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-frontend/agent.cordis.yml +4 -2
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +3 -2
- package/agent-presets/dsmm-oracle/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +11 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-research/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +1 -1
- package/cordis.patch.yml +0 -9
- package/docs/agent-presets.md +5 -5
- package/docs/compatibility.md +2 -6
- package/docs/migration-from-ocmm.md +1 -1
- package/docs/native-permissions.md +11 -3
- package/docs/roadmap.md +31 -11
- package/docs/runtime-recovery.md +30 -2
- package/docs/settings-status.md +7 -5
- package/docs/skill-sync.md +13 -14
- package/lib/client/ChildrenPanel.d.ts +1 -4
- package/lib/client/ChildrenPanel.js +3 -3
- package/lib/client/DeploymentFields.js +12 -1
- package/lib/client/DeploymentPage.d.ts +1 -3
- package/lib/client/DeploymentPage.js +30 -18
- package/lib/client/NativeCommandEntries.js +47 -37
- package/lib/client/PermissionRuleEntries.d.ts +17 -0
- package/lib/client/PermissionRuleEntries.js +70 -0
- package/lib/client/PermissionsPanel.d.ts +1 -3
- package/lib/client/PermissionsPanel.js +5 -4
- package/lib/client/children-locales.d.ts +4 -4
- package/lib/client/controller.js +4 -1
- package/lib/client/deployment-locales.d.ts +2 -2
- package/lib/client/deployment-locales.js +8 -9
- package/lib/client/deployment-modules.d.ts +5 -3
- package/lib/client/deployment-modules.js +4 -4
- package/lib/client/deployment-workspace.d.ts +4 -0
- package/lib/client/deployment-workspace.js +37 -11
- package/lib/client/index.js +2 -7
- package/lib/client/locales.js +131 -119
- package/lib/client/permission-controller.d.ts +13 -0
- package/lib/client/permission-controller.js +50 -23
- package/lib/client/permission-locales.d.ts +28 -30
- package/lib/client/permission-locales.js +38 -38
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +8 -8
- package/lib/client.js +2272 -3773
- package/lib/core-permission-authority.js +28 -16
- package/lib/index.d.ts +0 -2
- package/lib/index.js +11 -31
- package/lib/native-admission.d.ts +3 -3
- package/lib/native-admission.js +67 -66
- package/lib/permission-controller.js +1 -1
- package/lib/permission-fs-search.js +1 -2
- package/lib/permission-fs.js +1 -2
- package/lib/permission-native-command.js +6 -4
- package/lib/permission-settings.d.ts +21 -7
- package/lib/permission-settings.js +21 -9
- package/lib/permission-web.js +1 -2
- package/lib/preset-materializer.js +3 -3
- package/lib/preset-registry.d.ts +20 -2
- package/lib/preset-registry.js +46 -17
- package/lib/profile-diagnostics.js +1 -1
- package/lib/profile-remote.js +1 -3
- package/lib/role-identity.d.ts +1 -1
- package/lib/role-identity.js +16 -4
- package/lib/role-policy.d.ts +3 -0
- package/lib/role-policy.js +30 -6
- package/lib/role-subagents.js +6 -4
- package/lib/roles.d.ts +2 -0
- package/lib/roles.js +2 -0
- package/lib/runtime-integration.js +4 -4
- package/lib/settings.d.ts +1 -3
- package/lib/settings.js +8 -10
- package/lib/state.d.ts +4 -1
- package/lib/state.js +37 -6
- package/package.json +1 -5
- package/prompts/deepwork.md +13 -1
- package/prompts/source/agents/orchestrator.md +10 -0
- package/prompts/source/category/coding.md +2 -1
- package/prompts/source/category/complex.md +1 -0
- package/prompts/source/category/deep.md +1 -0
- package/prompts/source/category/frontend.md +3 -1
- package/prompts/source/category/normal-task.md +2 -1
- package/prompts/source/category/quick.md +1 -0
- package/prompts/source/deepwork/claude-opus-5.md +2 -0
- package/prompts/source/deepwork/default.md +12 -0
- package/prompts/source/deepwork/gemini.md +6 -1
- package/prompts/source/deepwork/glm.md +5 -1
- package/prompts/source/deepwork/gpt.md +22 -2
- package/prompts/source/deepwork/kimi-k27.md +2 -0
- package/prompts/source/deepwork/planner.md +3 -1
- package/prompts/source/deepwork/swe-2.md +2 -0
- package/prompts/source/manifest.json +3 -68
- package/prompts/source/shared/dsh-host-contract.md +1 -1
- package/skills/ast-grep/SKILL.md +1 -1
- package/skills/brainstorming/SKILL.md +1 -1
- package/skills/coding-agent-sessions/SKILL.md +1 -1
- package/skills/debugging/SKILL.md +1 -1
- package/skills/dispatching-parallel-agents/SKILL.md +1 -1
- package/skills/frontend/SKILL.md +1 -1
- package/skills/git-master/SKILL.md +1 -1
- package/skills/init-deep/SKILL.md +1 -1
- package/skills/receiving-code-review/SKILL.md +1 -1
- package/skills/remove-ai-slops/SKILL.md +1 -1
- package/skills/requesting-code-review/SKILL.md +1 -1
- package/skills/subagent-driven-development/SKILL.md +1 -1
- package/skills/using-git-worktrees/SKILL.md +1 -1
- package/skills/writing-plans/SKILL.md +1 -1
- package/lib/client/ChildPermissions.d.ts +0 -43
- package/lib/client/ChildPermissions.js +0 -100
- package/lib/client/HistoryContinuation.d.ts +0 -7
- package/lib/client/HistoryContinuation.js +0 -22
- package/lib/client/PermissionPanelEntry.d.ts +0 -8
- package/lib/client/PermissionPanelEntry.js +0 -11
- package/lib/client/TemporaryPermissions.d.ts +0 -21
- package/lib/client/TemporaryPermissions.js +0 -94
- package/lib/client/history-controller.d.ts +0 -29
- package/lib/client/history-controller.js +0 -111
- package/lib/client/history-entry.d.ts +0 -11
- package/lib/client/history-entry.js +0 -106
- package/lib/client/history-locales.d.ts +0 -95
- package/lib/client/history-locales.js +0 -41
- package/lib/client/temporary-permission-client.d.ts +0 -20
- package/lib/client/temporary-permission-client.js +0 -52
- package/lib/client/temporary-permission-entry.d.ts +0 -6
- package/lib/client/temporary-permission-entry.js +0 -56
- package/lib/history-candidates.d.ts +0 -30
- package/lib/history-candidates.js +0 -176
- package/lib/history-codec.d.ts +0 -11
- package/lib/history-codec.js +0 -102
- package/lib/history-contract.d.ts +0 -44
- package/lib/history-contract.js +0 -2
- package/lib/history-controller.d.ts +0 -42
- package/lib/history-controller.js +0 -329
- package/lib/history-policy.d.ts +0 -4
- package/lib/history-policy.js +0 -8
- package/lib/history-remote.d.ts +0 -28
- package/lib/history-remote.js +0 -17
- package/lib/history-rpc.d.ts +0 -24
- package/lib/history-rpc.js +0 -136
- package/lib/history-support.d.ts +0 -15
- package/lib/history-support.js +0 -21
- package/lib/history-types.d.ts +0 -67
- package/lib/history-types.js +0 -2
- package/lib/permission-child-control.d.ts +0 -36
- package/lib/permission-child-control.js +0 -164
- package/lib/permission-exec-argv.d.ts +0 -32
- package/lib/permission-exec-argv.js +0 -171
- package/lib/permission-temporary-files.d.ts +0 -19
- package/lib/permission-temporary-files.js +0 -248
- package/lib/permission-temporary-grants.d.ts +0 -106
- package/lib/permission-temporary-grants.js +0 -198
- package/lib/permission-temporary-install.d.ts +0 -25
- package/lib/permission-temporary-install.js +0 -86
- package/lib/permission-temporary-remote.d.ts +0 -19
- package/lib/permission-temporary-remote.js +0 -75
- package/lib/permission-temporary-rpc.d.ts +0 -37
- package/lib/permission-temporary-rpc.js +0 -154
- package/lib/permission-temporary-types.d.ts +0 -47
- package/lib/permission-temporary-types.js +0 -2
- package/lib/permission-temporary-web.d.ts +0 -11
- package/lib/permission-temporary-web.js +0 -154
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +0 -13291
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +0 -9133
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +0 -156
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +0 -3546
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +0 -431
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +0 -119
- package/patches/dsh-approval-settlement/README.md +0 -41
- package/patches/dsh-approval-settlement/metadata.json +0 -10
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +0 -383
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +0 -55
- package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +0 -16673
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +0 -29
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +0 -196
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +0 -35
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +0 -40
|
@@ -5,7 +5,7 @@ description: "(builtin) Initialize hierarchical AGENTS.md knowledge base"
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -5,7 +5,7 @@ description: Use when receiving code review feedback, before implementing sugges
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -5,7 +5,7 @@ description: "Remove AI-generated code slop from branch changes or an explicit f
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -5,7 +5,7 @@ description: Use when an implemented change benefits from independent review bef
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -5,7 +5,7 @@ description: Use when executing implementation plans with independent tasks in t
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -5,7 +5,7 @@ description: Use ONLY when the user explicitly asks to use a git worktree for is
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -5,7 +5,7 @@ description: Use before complex product behavior implementation, or when an expl
|
|
|
5
5
|
|
|
6
6
|
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
This is a full OCMM source adaptation for DSH 0.2.
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.1-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
10
|
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
11
|
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import type { PropsLocale, PropsRenderSlots } from "@deepseek-ai/dsh-client-ui-slots";
|
|
3
|
-
import type { ConnectionHandle } from "@deepseek-ai/dsh-client-connection/client";
|
|
4
|
-
import type { ISessions } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
5
|
-
import type { UiSession } from "@deepseek-ai/dsh-client-ui-session/client";
|
|
6
|
-
import type { RoleControlChildView } from "../role-control-types.js";
|
|
7
|
-
import { PERMISSIONS_NS } from "./permission-locales.js";
|
|
8
|
-
interface Owner {
|
|
9
|
-
parentSessionId: string;
|
|
10
|
-
child: RoleControlChildView;
|
|
11
|
-
}
|
|
12
|
-
interface Services {
|
|
13
|
-
sessions: ISessions;
|
|
14
|
-
uiSession: UiSession;
|
|
15
|
-
connection: ConnectionHandle;
|
|
16
|
-
}
|
|
17
|
-
type Locale = PropsLocale<typeof PERMISSIONS_NS>;
|
|
18
|
-
type Composer = PropsRenderSlots<"conversation.composer">;
|
|
19
|
-
/** Direct-child card action. Retention is Client-only; it never keeps the Host child alive. */
|
|
20
|
-
export declare function ChildPermissions(props: Owner & Services & Composer & Locale): import("react").JSX.Element | null;
|
|
21
|
-
export declare const CHILD_PERMISSION_SLOTS: {
|
|
22
|
-
readonly "conversation.dsmm-child-permissions": {
|
|
23
|
-
readonly kind: "list";
|
|
24
|
-
readonly scope: "root";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare function registerChildPermissionEntry(ctx: Context): void;
|
|
28
|
-
declare module "@deepseek-ai/dsh-client-ui-slots" {
|
|
29
|
-
interface SlotMap {
|
|
30
|
-
"conversation.dsmm-child-permissions": {
|
|
31
|
-
kind: "list";
|
|
32
|
-
scope: "root";
|
|
33
|
-
owner: Owner;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
declare module "@deepseek-ai/dsh-api-session-controller/client" {
|
|
38
|
-
interface SessionReferenceSourceMap {
|
|
39
|
-
dsmmChildPermissions: unknown;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export {};
|
|
43
|
-
//# sourceMappingURL=ChildPermissions.d.ts.map
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
|
-
import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
|
-
import { temporaryPermissionClient } from "./temporary-permission-client.js";
|
|
5
|
-
import { TemporaryGrants } from "./TemporaryPermissions.js";
|
|
6
|
-
import { PERMISSIONS_NS } from "./permission-locales.js";
|
|
7
|
-
function NativeChildApproval(props) {
|
|
8
|
-
const { active, uiSession, SessionProvider } = props;
|
|
9
|
-
const session = useSyncExternalStore(listener => active.binding.session.subscribe(listener), () => active.binding.session.getSnapshot());
|
|
10
|
-
const statuses = useSyncExternalStore(listener => uiSession.sessionStatus.subscribe(listener), () => uiSession.sessionStatus.getSnapshot());
|
|
11
|
-
if (!props.current())
|
|
12
|
-
return _jsx("p", { className: "dsmm-hint", children: props.t("childUnavailable") });
|
|
13
|
-
return _jsx(SessionProvider, { session: active.reference, children: props.renderSlotChain("conversation.composer", {
|
|
14
|
-
sessionId: active.binding.sessionId, session, pendingInteraction: statuses.get(active.binding.sessionId)?.pendingInteraction,
|
|
15
|
-
}, { fallback: _jsx("p", { className: "dsmm-hint", children: props.t("childNoPending") }) }) });
|
|
16
|
-
}
|
|
17
|
-
/** Direct-child card action. Retention is Client-only; it never keeps the Host child alive. */
|
|
18
|
-
export function ChildPermissions(props) {
|
|
19
|
-
const id = useId(), trigger = useRef(null), heading = useRef(null);
|
|
20
|
-
const generation = useSyncExternalStore(listener => props.connection.generation.subscribe(listener), () => props.connection.generation.getSnapshot());
|
|
21
|
-
useSyncExternalStore(listener => props.sessions.list.subscribe(listener), () => props.sessions.list.getSnapshot());
|
|
22
|
-
const identity = useMemo(() => ({}), [props.parentSessionId, props.child.id, props.sessions, props.uiSession, props.connection, generation]);
|
|
23
|
-
const latest = useRef(identity);
|
|
24
|
-
latest.current = identity;
|
|
25
|
-
const [open, setOpen] = useState(false), [refresh, setRefresh] = useState(0), [active, setActive] = useState();
|
|
26
|
-
const [view, setView] = useState(), [busy, setBusy] = useState(false), [error, setError] = useState(false);
|
|
27
|
-
const current = () => !!active && active.identity === identity && latest.current === identity && !active.signal.aborted
|
|
28
|
-
&& props.connection.generation.getSnapshot() === generation && props.sessions.binding(active.binding.sessionId) === active.binding
|
|
29
|
-
&& active.binding.session.getSnapshot().openState === "open" && !active.binding.session.getSnapshot().removed;
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
setActive(undefined);
|
|
32
|
-
setView(undefined);
|
|
33
|
-
setBusy(false);
|
|
34
|
-
setError(false);
|
|
35
|
-
if (!open || generation === undefined)
|
|
36
|
-
return;
|
|
37
|
-
const abort = new AbortController();
|
|
38
|
-
const reference = props.sessions.retain({ parentSessionId: props.parentSessionId,
|
|
39
|
-
childSessionId: props.child.id, mode: "continuable" }, { source: "dsmmChildPermissions", signal: abort.signal });
|
|
40
|
-
const remote = temporaryPermissionClient(props.connection, abort.signal);
|
|
41
|
-
void reference.ready.then(async (binding) => {
|
|
42
|
-
if (abort.signal.aborted || latest.current !== identity)
|
|
43
|
-
return;
|
|
44
|
-
if (props.sessions.scopeOf(binding.ctx) !== props.child.id || props.sessions.binding(binding.sessionId) !== binding)
|
|
45
|
-
throw new Error("Native child scope changed.");
|
|
46
|
-
setActive({ identity, reference, binding, remote, signal: abort.signal });
|
|
47
|
-
const value = await remote.child(props.parentSessionId, props.child.id);
|
|
48
|
-
if (!abort.signal.aborted && latest.current === identity && props.sessions.binding(binding.sessionId) === binding)
|
|
49
|
-
setView(value);
|
|
50
|
-
}).catch(() => { if (!abort.signal.aborted && latest.current === identity)
|
|
51
|
-
setError(true); });
|
|
52
|
-
return () => { abort.abort(); reference.release(); };
|
|
53
|
-
}, [identity, open, refresh]);
|
|
54
|
-
useEffect(() => { if (open)
|
|
55
|
-
heading.current?.focus(); }, [open]);
|
|
56
|
-
if (props.child.mode !== "continuable" || props.child.parentSessionId !== props.parentSessionId)
|
|
57
|
-
return null;
|
|
58
|
-
const available = current() && !busy && view?.parentSessionId === props.parentSessionId && view.childSessionId === props.child.id;
|
|
59
|
-
async function change(operation) {
|
|
60
|
-
if (!available || !active)
|
|
61
|
-
return;
|
|
62
|
-
const captured = active;
|
|
63
|
-
setBusy(true);
|
|
64
|
-
setError(false);
|
|
65
|
-
try {
|
|
66
|
-
const value = await captured.remote[operation](props.parentSessionId, props.child.id);
|
|
67
|
-
if (latest.current === identity && !captured.signal.aborted)
|
|
68
|
-
setView(value);
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
if (latest.current === identity && !captured.signal.aborted) {
|
|
72
|
-
setView(undefined);
|
|
73
|
-
setError(true);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
finally {
|
|
77
|
-
if (latest.current === identity && !captured.signal.aborted)
|
|
78
|
-
setBusy(false);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return _jsxs("div", { className: "dsmm-child-permissions", children: [_jsx(Button, { ref: trigger, type: "button", variant: "outline", "aria-expanded": open, "aria-controls": id, onClick: () => {
|
|
82
|
-
if (open) {
|
|
83
|
-
setOpen(false);
|
|
84
|
-
trigger.current?.focus();
|
|
85
|
-
}
|
|
86
|
-
else
|
|
87
|
-
setOpen(true);
|
|
88
|
-
}, children: props.t("childPermissions") }), open && _jsxs("section", { id: id, className: "dsmm-zone", "aria-labelledby": `${id}-heading`, "aria-busy": busy, children: [_jsx("h3", { id: `${id}-heading`, ref: heading, tabIndex: -1, children: props.child.label ?? props.child.id }), _jsx("p", { children: props.child.id }), _jsx("p", { className: "dsmm-hint", children: props.t("childPermissionBoundary") }), view && _jsxs(_Fragment, { children: [_jsxs("p", { children: [props.t("childProject"), ": ", view.project] }), _jsxs("p", { children: [props.t("childRole"), ": ", view.role ?? props.t("unknown"), view.readOnly ? ` · ${props.t("childReadOnly")}` : ""] }), _jsx("p", { role: "status", "aria-live": "polite", children: props.t(view.state === "enabled" ? "childEnabled" : view.state === "disabled" ? "childDisabled" : "childUnavailable") })] }), (!current() || !view) && !error && _jsx("p", { role: "status", children: props.t(generation === undefined ? "childUnavailable" : "reading") }), error && _jsx("p", { className: "dsmm-issue", role: "alert", children: props.t("childUnconfirmed") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: !available || !view?.canEnable || view.state === "enabled", onClick: () => void change("enableChild"), children: props.t("childEnable") }), _jsx(Button, { type: "button", variant: "outline", disabled: !available || !view?.canRevoke, onClick: () => void change("revokeChild"), children: props.t("childRevoke") }), _jsx(Button, { type: "button", variant: "outline", disabled: busy || generation === undefined, onClick: () => setRefresh(value => value + 1), children: props.t("temporaryRefresh") })] }), active?.identity === identity && current() && _jsxs(_Fragment, { children: [_jsx(NativeChildApproval, { ...props, active: active, current: current }), view?.state === "enabled" && _jsx(TemporaryGrants, { sessionId: props.child.id, remote: active.remote, t: props.t, child: true })] })] })] });
|
|
89
|
-
}
|
|
90
|
-
export const CHILD_PERMISSION_SLOTS = { "conversation.dsmm-child-permissions": { kind: "list", scope: "root" } };
|
|
91
|
-
export function registerChildPermissionEntry(ctx) {
|
|
92
|
-
void ctx.inject(["sessions", "uiSession", "connection"], scope => {
|
|
93
|
-
scope.slots.inject("conversation.dsmm-child-permissions", () => scope.slots.register({
|
|
94
|
-
name: "conversation.dsmm-child-permissions", id: "dsmm-child-permissions", locale: PERMISSIONS_NS,
|
|
95
|
-
children: { "conversation.composer": { kind: "chain", scope: "session" } },
|
|
96
|
-
inject: () => ({ sessions: scope.sessions, uiSession: scope.uiSession, connection: scope.connection }),
|
|
97
|
-
}, ChildPermissions));
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=ChildPermissions.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HistoryContinuationController } from "./history-controller.js";
|
|
2
|
-
/** Additive continuation controls; this component never opens, replaces, or clears native history. */
|
|
3
|
-
export declare function HistoryContinuation({ controller, locale }: {
|
|
4
|
-
controller: HistoryContinuationController;
|
|
5
|
-
locale?: "en" | "zh";
|
|
6
|
-
}): import("react").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=HistoryContinuation.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useState, useSyncExternalStore } from "react";
|
|
3
|
-
import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
|
-
import { historyLocales } from "./history-locales.js";
|
|
5
|
-
/** Additive continuation controls; this component never opens, replaces, or clears native history. */
|
|
6
|
-
export function HistoryContinuation({ controller, locale = "en" }) {
|
|
7
|
-
const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
8
|
-
const t = historyLocales[locale], id = useId();
|
|
9
|
-
const [preset, setPreset] = useState(""), [profile, setProfile] = useState("");
|
|
10
|
-
const proposal = state.preview;
|
|
11
|
-
const [consent, setConsent] = useState({ proposal: null, pending: false, migration: false });
|
|
12
|
-
const pending = consent.proposal === proposal && consent.pending, migration = consent.proposal === proposal && consent.migration;
|
|
13
|
-
useEffect(() => { setPreset(""); setProfile(""); }, [state.sessionId, controller]);
|
|
14
|
-
const busy = ["loading", "previewing", "confirming"].includes(state.phase);
|
|
15
|
-
const selectable = state.phase === "ready" && state.status?.execution === "authorization-required" && state.status.compatibleHost && state.choices !== null;
|
|
16
|
-
const selectedMatches = proposal?.candidate.preset.id === preset && (proposal?.candidate.profile?.id ?? "") === profile;
|
|
17
|
-
const reason = state.issue?.code ?? (state.status?.compatibleHost === false ? "unsupported-host" : state.status?.reason);
|
|
18
|
-
const notice = state.phase === "disconnected" ? t.disconnected : state.phase === "loading" ? t.loading : state.phase === "previewing" ? t.preparing
|
|
19
|
-
: state.phase === "confirming" || state.status?.execution === "activating" ? t.confirming : state.phase === "unknown" ? t.unknown : state.status?.execution === "active" ? t.active : t.browsing;
|
|
20
|
-
return _jsx("section", { className: "dsmm-profiles", "aria-labelledby": `${id}-heading`, "aria-busy": busy, "data-dsmm-history-continuation": true, children: _jsxs("div", { className: "dsmm-session-scope", children: [_jsx("h3", { id: `${id}-heading`, children: t.title }), _jsx("p", { role: "status", children: notice }), reason && _jsx("p", { role: "alert", children: t.reasons[reason] }), state.issue?.storageEffects === "may-have-committed" && _jsx("p", { children: t.effects }), selectable && _jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-preset`, children: t.preset }), _jsxs("select", { id: `${id}-preset`, value: preset, onChange: event => setPreset(event.currentTarget.value), children: [_jsx("option", { value: "", children: t.choose }), state.choices.presets.map(row => _jsx("option", { value: row.id, children: row.label || row.id }, row.id))] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-profile`, children: t.profile }), _jsxs("select", { id: `${id}-profile`, value: profile, onChange: event => setProfile(event.currentTarget.value), children: [_jsx("option", { value: "", children: t.baseline }), state.choices.profiles.map(row => _jsx("option", { value: row.id, children: row.label || row.id }, row.id))] })] }), _jsx("div", { className: "dsmm-actions", children: _jsx(Button, { type: "button", variant: "outline", disabled: !preset || !state.choices.presets.some(row => row.id === preset), onClick: () => { void controller.preview(state, preset, profile || null); }, children: t.preview }) })] }), proposal && selectedMatches && _jsxs("div", { className: "dsmm-session-scope", "aria-labelledby": `${id}-proposal`, children: [_jsx("h4", { id: `${id}-proposal`, children: t.candidate }), _jsxs("p", { children: [proposal.candidate.preset.label || proposal.candidate.preset.id, " \u00B7 ", proposal.candidate.profile?.label || proposal.candidate.profile?.id || t.baseline] }), _jsxs("p", { children: [t.project, ": ", proposal.cwd] }), _jsxs("p", { children: [t.model, ": ", proposal.candidate.model.provider, "/", proposal.candidate.model.model, proposal.candidate.model.reasoningEffort ? ` (${proposal.candidate.model.reasoningEffort})` : ""] }), _jsxs("p", { children: [t.roles, ": ", proposal.candidate.roles.map(row => row.label || row.id).join(", ")] }), _jsxs("div", { children: [_jsx("h4", { children: t.permissions }), _jsx("ul", { children: proposal.candidate.restrictions.map((text, index) => _jsx("li", { children: text }, index)) })] }), proposal.candidate.differences.length > 0 && _jsxs("div", { children: [_jsx("h4", { children: t.differences }), _jsx("ul", { children: proposal.candidate.differences.map((text, index) => _jsx("li", { children: text }, index)) })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("h4", { children: t.pending }), _jsx("p", { id: `${id}-pending-hint`, children: t.pendingWarning }), proposal.pending.nextTurn.length === 0 && proposal.pending.nextStep.length === 0 ? _jsx("p", { children: t.noPending }) : _jsxs(_Fragment, { children: [_jsx("label", { htmlFor: `${id}-next-turn`, children: t.nextTurn }), _jsx("textarea", { id: `${id}-next-turn`, rows: 5, readOnly: true, value: JSON.stringify(proposal.pending.nextTurn, null, 2) }), _jsx("label", { htmlFor: `${id}-next-step`, children: t.nextStep }), _jsx("textarea", { id: `${id}-next-step`, rows: 5, readOnly: true, value: JSON.stringify(proposal.pending.nextStep, null, 2) })] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: pending, disabled: busy, "aria-describedby": `${id}-pending-hint`, onChange: event => setConsent({ proposal, pending: event.currentTarget.checked, migration }) }), " ", t.consent] }), proposal.migrationRequired && _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: migration, disabled: busy, onChange: event => setConsent({ proposal, pending, migration: event.currentTarget.checked }) }), " ", t.migration] })] }), _jsx("div", { className: "dsmm-actions", children: _jsx(Button, { type: "button", disabled: busy || state.phase !== "ready" || !pending || proposal.migrationRequired && !migration, onClick: () => { void controller.confirm(state, pending, migration); }, children: t.confirm }) })] }), _jsx("div", { className: "dsmm-actions", children: _jsx(Button, { type: "button", variant: "outline", disabled: busy || state.phase === "disconnected", onClick: () => { void controller.refresh(state); }, children: t.refresh }) })] }) });
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=HistoryContinuation.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { HostObservable, PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
|
|
2
|
-
import type { TemporaryPermissionRemote } from "../permission-temporary-types.js";
|
|
3
|
-
import type { PermissionController } from "./permission-controller.js";
|
|
4
|
-
export declare function PermissionPanelEntry({ controller, temporary, t }: PropsLocale<"settings.dsmm-permissions"> & {
|
|
5
|
-
controller: PermissionController;
|
|
6
|
-
temporary?: HostObservable<TemporaryPermissionRemote | undefined>;
|
|
7
|
-
}): import("react").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=PermissionPanelEntry.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useSyncExternalStore } from "react";
|
|
3
|
-
import { PermissionsPanel } from "./PermissionsPanel.js";
|
|
4
|
-
const absent = { getSnapshot: () => undefined, subscribe: () => () => { } };
|
|
5
|
-
export function PermissionPanelEntry({ controller, temporary, t }) {
|
|
6
|
-
const scope = useSyncExternalStore(controller.store.subscribe, controller.store.getSnapshot);
|
|
7
|
-
const source = temporary ?? absent;
|
|
8
|
-
const remote = useSyncExternalStore(source.subscribe, source.getSnapshot);
|
|
9
|
-
return _jsx(PermissionsPanel, { controller: controller, sessionId: scope.sessionId ?? undefined, temporary: remote, t: t });
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=PermissionPanelEntry.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
|
|
2
|
-
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
-
import type { ConnectionHandle } from "@deepseek-ai/dsh-client-connection/client";
|
|
4
|
-
import type { TemporaryPermissionRemote } from "../permission-temporary-types.js";
|
|
5
|
-
import type { TemporaryPendingApproval } from "./temporary-permission-client.js";
|
|
6
|
-
type Locale = PropsLocale<"settings.dsmm-permissions">;
|
|
7
|
-
/** Parent mounts after native approval UI and registers the existing permission dictionaries. */
|
|
8
|
-
export declare function registerTemporaryPermissionSlots(ctx: Context, connection: ConnectionHandle): void;
|
|
9
|
-
/** Render beside the native prompt, never replace its approve/reject/cancel controls. */
|
|
10
|
-
export declare function TemporaryApproval({ pending, remote, t, child }: Locale & {
|
|
11
|
-
pending: TemporaryPendingApproval;
|
|
12
|
-
remote: TemporaryPermissionRemote;
|
|
13
|
-
child?: boolean;
|
|
14
|
-
}): import("react").JSX.Element | null;
|
|
15
|
-
export declare function TemporaryGrants({ sessionId, remote, t, child }: Locale & {
|
|
16
|
-
sessionId: string;
|
|
17
|
-
remote: TemporaryPermissionRemote;
|
|
18
|
-
child?: boolean;
|
|
19
|
-
}): import("react").JSX.Element;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=TemporaryPermissions.d.ts.map
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
|
-
import { answerWithTemporaryPermit, pendingDelivery, retainAndAnswer, temporaryPermissionClient } from "./temporary-permission-client.js";
|
|
5
|
-
import { PERMISSIONS_NS } from "./permission-locales.js";
|
|
6
|
-
const durations = ["once", "session", "15min", "1h"];
|
|
7
|
-
/** Parent mounts after native approval UI and registers the existing permission dictionaries. */
|
|
8
|
-
export function registerTemporaryPermissionSlots(ctx, connection) {
|
|
9
|
-
const lifetime = new AbortController();
|
|
10
|
-
ctx.effect(() => () => lifetime.abort());
|
|
11
|
-
ctx.slots.inject("conversation.composer", () => ctx.slots.register({
|
|
12
|
-
name: "conversation.approval.permissions", priority: 0, locale: PERMISSIONS_NS,
|
|
13
|
-
}, function PermissionSlot(props) {
|
|
14
|
-
const remote = useMemo(() => temporaryPermissionClient(connection, lifetime.signal), [props.pending]);
|
|
15
|
-
const child = props.useSession(snapshot => snapshot.subagent !== undefined);
|
|
16
|
-
return _jsx(TemporaryApproval, { pending: props.pending, remote: remote, t: props.t, child: child }, props.pending.key);
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
/** Render beside the native prompt, never replace its approve/reject/cancel controls. */
|
|
20
|
-
export function TemporaryApproval({ pending, remote, t, child = false }) {
|
|
21
|
-
const id = useId(), [view, setView] = useState(), [duration, setDuration] = useState("once");
|
|
22
|
-
const [busy, setBusy] = useState(false), [error, setError] = useState(false);
|
|
23
|
-
const [scope, setScope] = useState("exact");
|
|
24
|
-
const identity = useRef({ pending, remote, active: true });
|
|
25
|
-
if (identity.current.pending !== pending || identity.current.remote !== remote)
|
|
26
|
-
identity.current = { pending, remote, active: true };
|
|
27
|
-
const captured = identity.current, isCurrent = () => captured.active && identity.current === captured;
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
let current = true;
|
|
30
|
-
setView(undefined);
|
|
31
|
-
setDuration("once");
|
|
32
|
-
setScope("exact");
|
|
33
|
-
setError(false);
|
|
34
|
-
setBusy(false);
|
|
35
|
-
const delivery = pendingDelivery(pending);
|
|
36
|
-
if (delivery)
|
|
37
|
-
void remote.request(pending.sessionId, delivery).then(async (value) => {
|
|
38
|
-
if (!current)
|
|
39
|
-
return;
|
|
40
|
-
setView(value);
|
|
41
|
-
if (value.reusable)
|
|
42
|
-
await answerWithTemporaryPermit(pending, remote, () => current);
|
|
43
|
-
}).catch(() => { if (current)
|
|
44
|
-
setError(true); });
|
|
45
|
-
captured.active = true;
|
|
46
|
-
return () => { current = false; captured.active = false; };
|
|
47
|
-
}, [pending, remote]);
|
|
48
|
-
if (!pendingDelivery(pending))
|
|
49
|
-
return null;
|
|
50
|
-
return _jsxs("section", { className: "dsmm-structured", "aria-label": t("temporaryTitle"), "aria-busy": busy, children: [view && _jsxs(_Fragment, { children: [_jsx("p", { children: view.summary }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: id, children: t("temporaryDuration") }), _jsx("select", { id: id, value: duration, disabled: busy || !pending.answerable, onChange: event => {
|
|
51
|
-
const value = durations.find(value => value === event.currentTarget.value);
|
|
52
|
-
if (value)
|
|
53
|
-
setDuration(value);
|
|
54
|
-
}, children: durations.filter(value => view.reusable || value === "once").map(value => _jsx("option", { value: value, children: t(child && value === "session" ? "temporaryChildSession" : `temporary:${value}`) }, value)) })] }), !!view.scopes?.length && duration !== "once" && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-scope`, children: t("pathScope") }), _jsxs("select", { id: `${id}-scope`, value: scope, disabled: busy || !pending.answerable, onChange: event => setScope(event.currentTarget.value), children: [_jsx("option", { value: "exact", children: view.summary }), view.scopes.map(choice => _jsx("option", { value: choice.id, children: choice.summary }, choice.id))] })] }), _jsx(Button, { variant: "primary", disabled: busy || !pending.answerable, onClick: () => {
|
|
55
|
-
setBusy(true);
|
|
56
|
-
setError(false);
|
|
57
|
-
void retainAndAnswer(pending, remote, duration, isCurrent, scope).catch(() => { if (isCurrent())
|
|
58
|
-
setError(true); }).finally(() => { if (isCurrent())
|
|
59
|
-
setBusy(false); });
|
|
60
|
-
}, children: t("temporaryApprove") })] }), _jsx("p", { className: "dsmm-hint", children: t("temporaryBoundary") }), view?.tool === "web_fetch" && _jsx("p", { className: "dsmm-hint", children: t("temporaryWebBoundary") }), error && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("temporaryUnavailable") })] });
|
|
61
|
-
}
|
|
62
|
-
export function TemporaryGrants({ sessionId, remote, t, child = false }) {
|
|
63
|
-
const [grants, setGrants] = useState(), [busy, setBusy] = useState(false), [error, setError] = useState(false);
|
|
64
|
-
const identity = useRef({ sessionId, remote, active: true });
|
|
65
|
-
if (identity.current.sessionId !== sessionId || identity.current.remote !== remote)
|
|
66
|
-
identity.current = { sessionId, remote, active: true };
|
|
67
|
-
const captured = identity.current, current = () => captured.active && identity.current === captured;
|
|
68
|
-
const accept = (value) => { if (current())
|
|
69
|
-
setGrants(value); };
|
|
70
|
-
const fail = () => { if (current())
|
|
71
|
-
setError(true); };
|
|
72
|
-
const finish = () => { if (current())
|
|
73
|
-
setBusy(false); };
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
let current = true;
|
|
76
|
-
setGrants(undefined);
|
|
77
|
-
setError(false);
|
|
78
|
-
void remote.describe(sessionId).then(value => { if (current)
|
|
79
|
-
setGrants(value); }).catch(() => { if (current)
|
|
80
|
-
setError(true); });
|
|
81
|
-
captured.active = true;
|
|
82
|
-
return () => { current = false; captured.active = false; };
|
|
83
|
-
}, [sessionId, remote]);
|
|
84
|
-
return _jsxs("section", { className: "dsmm-zone", "aria-label": t("temporaryTitle"), "aria-busy": busy, children: [_jsx("h3", { children: t("temporaryTitle") }), grants?.length === 0 && _jsx("p", { children: t("temporaryEmpty") }), grants?.map(grant => _jsxs("fieldset", { children: [_jsx("legend", { children: grant.tool }), _jsx("p", { children: grant.summary }), _jsx("p", { children: t(child && grant.duration === "session" ? "temporaryChildSession" : `temporary:${grant.duration}`) }), grant.tool === "web_fetch" && _jsx("p", { className: "dsmm-hint", children: t("temporaryWebBoundary") }), _jsx(Button, { variant: "outline", disabled: busy, onClick: () => {
|
|
85
|
-
setBusy(true);
|
|
86
|
-
setError(false);
|
|
87
|
-
void remote.revoke(sessionId, grant.id).then(accept).catch(fail).finally(finish);
|
|
88
|
-
}, children: t("temporaryRevoke") })] }, grant.id)), _jsx(Button, { variant: "outline", disabled: busy, onClick: () => {
|
|
89
|
-
setBusy(true);
|
|
90
|
-
setError(false);
|
|
91
|
-
void remote.describe(sessionId).then(accept).catch(fail).finally(finish);
|
|
92
|
-
}, children: t("temporaryRefresh") }), error && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("temporaryUnavailable") }), _jsx("p", { className: "dsmm-hint", children: t("temporaryBoundary") })] });
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=TemporaryPermissions.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { DsmmHistoryRemote } from "../history-remote.js";
|
|
2
|
-
import type { HistoryChoices, HistoryFailure, HistoryPreview, HistoryStatus } from "../history-types.js";
|
|
3
|
-
export interface HistoryClientSnapshot {
|
|
4
|
-
sessionId: string | null;
|
|
5
|
-
phase: "disconnected" | "loading" | "ready" | "previewing" | "confirming" | "unknown";
|
|
6
|
-
status: HistoryStatus | null;
|
|
7
|
-
choices: HistoryChoices | null;
|
|
8
|
-
preview: HistoryPreview | null;
|
|
9
|
-
issue: HistoryFailure | null;
|
|
10
|
-
}
|
|
11
|
-
/** Connection/session generation fences for continuation only; native history and composer stay authoritative. */
|
|
12
|
-
export declare class HistoryContinuationController {
|
|
13
|
-
private scope;
|
|
14
|
-
private state;
|
|
15
|
-
private request;
|
|
16
|
-
private disposed;
|
|
17
|
-
private readonly listeners;
|
|
18
|
-
readonly getSnapshot: () => HistoryClientSnapshot;
|
|
19
|
-
readonly subscribe: (listener: () => void) => (() => void);
|
|
20
|
-
private publish;
|
|
21
|
-
bind(remote: DsmmHistoryRemote | undefined, connection: object | undefined, sessionId: string | null, owner?: object): void;
|
|
22
|
-
/** Observed compatibility only, never a pre-follow navigation or write-admission guard. */
|
|
23
|
-
get historyBrowsingAllowed(): boolean;
|
|
24
|
-
dispose(): void;
|
|
25
|
-
refresh(expected: HistoryClientSnapshot): Promise<void>;
|
|
26
|
-
preview(expected: HistoryClientSnapshot, preset: string, profileId: string | null): Promise<void>;
|
|
27
|
-
confirm(expected: HistoryClientSnapshot, processPending: boolean, acceptMigration: boolean): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=history-controller.d.ts.map
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { parseHistoryChoices, parseHistoryFailure, parseHistoryPreview, parseHistoryResult, parseHistoryStatus } from "../history-codec.js";
|
|
2
|
-
function initial(sessionId = null) { return { sessionId, phase: sessionId === null ? "disconnected" : "loading", status: null, choices: null, preview: null, issue: null }; }
|
|
3
|
-
function value(result, parse) { if (result.ok)
|
|
4
|
-
return parse(result.value); throw result.error; }
|
|
5
|
-
function failure(error, confirming = false) {
|
|
6
|
-
if (error && typeof error === "object" && Reflect.get(error, "code") === "dsmm-history/refused") {
|
|
7
|
-
try {
|
|
8
|
-
return parseHistoryFailure(Reflect.get(error, "details"));
|
|
9
|
-
}
|
|
10
|
-
catch { /* Unknown wire errors cannot authorize a retry. */ }
|
|
11
|
-
}
|
|
12
|
-
return { code: "unavailable", storageEffects: confirming ? "may-have-committed" : "none" };
|
|
13
|
-
}
|
|
14
|
-
/** Connection/session generation fences for continuation only; native history and composer stay authoritative. */
|
|
15
|
-
export class HistoryContinuationController {
|
|
16
|
-
scope;
|
|
17
|
-
state = initial();
|
|
18
|
-
request;
|
|
19
|
-
disposed = false;
|
|
20
|
-
listeners = new Set();
|
|
21
|
-
getSnapshot = () => this.state;
|
|
22
|
-
subscribe = (listener) => { this.listeners.add(listener); return () => this.listeners.delete(listener); };
|
|
23
|
-
publish(next) { this.state = next; for (const listener of this.listeners)
|
|
24
|
-
listener(); }
|
|
25
|
-
bind(remote, connection, sessionId, owner) {
|
|
26
|
-
if (this.disposed)
|
|
27
|
-
return;
|
|
28
|
-
if (this.scope?.remote === remote && this.scope?.connection === connection && this.scope?.sessionId === sessionId && this.scope?.owner === owner)
|
|
29
|
-
return;
|
|
30
|
-
if (!this.scope && (!remote || !connection || !sessionId) && this.state.sessionId === sessionId && this.state.phase === "disconnected")
|
|
31
|
-
return;
|
|
32
|
-
this.scope = remote && connection && sessionId ? { remote, connection, sessionId, owner } : undefined;
|
|
33
|
-
const scope = this.scope;
|
|
34
|
-
this.request = undefined;
|
|
35
|
-
this.publish({ ...initial(sessionId), phase: this.scope ? "loading" : "disconnected" });
|
|
36
|
-
if (scope && this.scope === scope)
|
|
37
|
-
void this.refresh(this.state);
|
|
38
|
-
}
|
|
39
|
-
/** Observed compatibility only, never a pre-follow navigation or write-admission guard. */
|
|
40
|
-
get historyBrowsingAllowed() { return this.state.status?.compatibleHost === true; }
|
|
41
|
-
dispose() { this.scope = undefined; this.request = undefined; this.disposed = true; this.listeners.clear(); }
|
|
42
|
-
async refresh(expected) {
|
|
43
|
-
const scope = this.scope;
|
|
44
|
-
if (!scope || this.state !== expected || this.state.phase === "confirming")
|
|
45
|
-
return;
|
|
46
|
-
const request = this.request = {};
|
|
47
|
-
this.publish({ ...this.state, phase: "loading", preview: null, issue: null });
|
|
48
|
-
if (this.scope !== scope || this.request !== request)
|
|
49
|
-
return;
|
|
50
|
-
try {
|
|
51
|
-
const status = value(await scope.remote.describe(scope.sessionId), parseHistoryStatus);
|
|
52
|
-
if (this.scope !== scope || this.request !== request)
|
|
53
|
-
return;
|
|
54
|
-
if (status.sessionId !== scope.sessionId)
|
|
55
|
-
throw new TypeError("Mismatched history response");
|
|
56
|
-
const choices = status.execution === "authorization-required" ? value(await scope.remote.choices(), parseHistoryChoices) : null;
|
|
57
|
-
if (this.scope !== scope || this.request !== request)
|
|
58
|
-
return;
|
|
59
|
-
this.publish({ sessionId: scope.sessionId, phase: "ready", status, choices, preview: null, issue: null });
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
if (this.scope === scope && this.request === request)
|
|
63
|
-
this.publish({ ...this.state, phase: "ready", issue: failure(error), preview: null });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async preview(expected, preset, profileId) {
|
|
67
|
-
const scope = this.scope;
|
|
68
|
-
if (!scope || this.state !== expected || expected.phase !== "ready" || expected.status?.execution !== "authorization-required" || !expected.status.compatibleHost)
|
|
69
|
-
return;
|
|
70
|
-
const request = this.request = {};
|
|
71
|
-
this.publish({ ...this.state, phase: "previewing", preview: null, issue: null });
|
|
72
|
-
if (this.scope !== scope || this.request !== request)
|
|
73
|
-
return;
|
|
74
|
-
try {
|
|
75
|
-
const preview = value(await scope.remote.preview(scope.sessionId, { sessionId: scope.sessionId, preset, profileId }), parseHistoryPreview);
|
|
76
|
-
if (this.scope !== scope || this.request !== request)
|
|
77
|
-
return;
|
|
78
|
-
if (preview.sessionId !== scope.sessionId || preview.candidate.preset.id !== preset || (preview.candidate.profile?.id ?? null) !== profileId)
|
|
79
|
-
throw new TypeError("Mismatched continuation proposal");
|
|
80
|
-
this.publish({ ...this.state, phase: "ready", preview });
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
if (this.scope === scope && this.request === request)
|
|
84
|
-
this.publish({ ...this.state, phase: "ready", issue: failure(error), preview: null });
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async confirm(expected, processPending, acceptMigration) {
|
|
88
|
-
const scope = this.scope, preview = expected.preview;
|
|
89
|
-
if (!scope || this.state !== expected || expected.phase !== "ready" || !preview || !processPending || preview.migrationRequired && !acceptMigration)
|
|
90
|
-
return;
|
|
91
|
-
const request = this.request = {};
|
|
92
|
-
this.publish({ ...this.state, phase: "confirming", issue: null });
|
|
93
|
-
if (this.scope !== scope || this.request !== request)
|
|
94
|
-
return;
|
|
95
|
-
try {
|
|
96
|
-
const receipt = value(await scope.remote.confirm(scope.sessionId, { sessionId: scope.sessionId, intentId: preview.intentId, processPending, acceptMigration }), parseHistoryResult);
|
|
97
|
-
if (this.scope !== scope || this.request !== request)
|
|
98
|
-
return;
|
|
99
|
-
if (receipt.sessionId !== scope.sessionId)
|
|
100
|
-
throw new TypeError("Mismatched continuation receipt");
|
|
101
|
-
this.publish({ ...this.state, phase: "ready", preview: null, status: { sessionId: scope.sessionId, readable: "readable", compatibleHost: true, execution: "active" } });
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
if (this.scope !== scope || this.request !== request)
|
|
105
|
-
return;
|
|
106
|
-
const issue = failure(error, true);
|
|
107
|
-
this.publish({ ...this.state, phase: issue.storageEffects === "may-have-committed" ? "unknown" : "ready", preview: null, issue });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=history-controller.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import type { LocaleRuntime } from "@deepseek-ai/dsh-client-locale/client";
|
|
3
|
-
import { HistoryContinuationController } from "./history-controller.js";
|
|
4
|
-
export declare function HistoryContinuationEntry({ controller, locale, sessionId }: {
|
|
5
|
-
controller: HistoryContinuationController;
|
|
6
|
-
locale: LocaleRuntime;
|
|
7
|
-
sessionId: string;
|
|
8
|
-
}): import("react").JSX.Element | null;
|
|
9
|
-
/** Read-only native binding observer; Host admission owns all history activation. */
|
|
10
|
-
export declare function registerHistoryContinuation(ctx: Context): void;
|
|
11
|
-
//# sourceMappingURL=history-entry.d.ts.map
|