dsh-openwrite 0.2.10 → 0.2.11

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.
@@ -58,5 +58,13 @@ export declare const novelMutationDefinition: ConversationNodeDefinition<Mutatio
58
58
  type TurnSummaryProps = PropsRuntime<'conversation.chat.turnTail'> & PropsLocale<'studio-panel'> & Pick<StudioApiInjected, 'postStudioApi'> & {
59
59
  matched: NovelMutationSummary;
60
60
  };
61
+ /** DSH 0.2 dispatches turnTail as a list; the component owns its selection. */
62
+ export declare function TurnMutationSummaryListView(props: Omit<TurnSummaryProps, 'matched'> & {
63
+ turn: {
64
+ data: {
65
+ get(key: 'dsh-novel-mutations'): NovelMutationSummary | undefined;
66
+ };
67
+ };
68
+ }): import("react").JSX.Element | null;
61
69
  export declare function TurnMutationSummaryView({ matched, openFile, postStudioApi, t }: TurnSummaryProps): import("react").JSX.Element;
62
70
  export {};
@@ -33,6 +33,14 @@
33
33
  "@deepseek-ai/dsh-client-ui-chat"
34
34
  ],
35
35
  "platform": "web"
36
+ },
37
+ "compatibility": {
38
+ "dsh": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.2.0-rc.2",
39
+ "dshReleases": {
40
+ "0.1.2-rc.1": "compatible",
41
+ "0.1.5-alpha.1": "compatible",
42
+ "0.2.0-rc.2": "compatible"
43
+ }
36
44
  }
37
45
  },
38
46
  "files": [
@@ -60,8 +68,8 @@
60
68
  "lucide-react": "^0.468.0"
61
69
  },
62
70
  "peerDependencies": {
63
- "@deepseek-ai/cordis": "4.0.2",
64
- "@deepseek-ai/dsh-host-webserver": "0.1.2-rc.1",
71
+ "@deepseek-ai/cordis": "4.0.2 || ~4.0.4",
72
+ "@deepseek-ai/dsh-host-webserver": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.2.0-rc.2",
65
73
  "react": "^18.2.0",
66
74
  "react-dom": "^18.2.0"
67
75
  },
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "repository": "https://github.com/LiPu-jpg/Openwrite",
3
- "commit": "9108038699f64613f66a3fea21dfdb3841881d25",
4
- "tree": "5f9c8c6786185a8f02dcaae7a39319ac6252b633",
3
+ "commit": "39454dbcd14ea672c6d9fa25eddea26f8ea71591",
4
+ "tree": "8aa774b2aaf6a1bfff3d15d6efb62cd9bff9cb52",
5
5
  "dirty": false,
6
6
  "acquisition": "git-checkout",
7
- "sourceTreeSha256": "4652d2b793668e877cdf790ff481fc00ab89ac033b6a0788f9f92b589d9bf9ec",
7
+ "sourceTreeSha256": "3ce7aef31bc903e8d14ae39b157efaa9cadd1edde9105015985447f947fed2b2",
8
8
  "components": [
9
9
  {
10
10
  "name": "@deepseek-ai/schemastery",
@@ -2805,6 +2805,46 @@ window.__ModuleLoader__.load({
2805
2805
  .dog-launcher, .dog-node, .dog-backdrop, .dog-dialog, .dog-runtime-pulse { animation: none; transition: none; }
2806
2806
  }
2807
2807
  `;
2808
+ //#endregion
2809
+ //#region src/client/sessionState.ts
2810
+ /** DSH 0.2 folds pending interactions into the unified session status source. */
2811
+ function debuggerSessionState(sessions, uiSession) {
2812
+ const status = uiSession.sessionStatus;
2813
+ const source = status ?? uiSession.pendingInteractions;
2814
+ if (!source || typeof source.getSnapshot !== "function" || typeof source.subscribe !== "function") throw new Error("DSH session UI exposes neither sessionStatus nor pendingInteractions");
2815
+ let lastSessions;
2816
+ let lastStatus;
2817
+ let combined;
2818
+ return {
2819
+ getSnapshot() {
2820
+ const next = sessions.getSnapshot();
2821
+ const pending = source.getSnapshot();
2822
+ if (next !== lastSessions || pending !== lastStatus) {
2823
+ lastSessions = next;
2824
+ lastStatus = pending;
2825
+ const interactions = status ? new Map([...status.getSnapshot()].flatMap(([id, value]) => value.pendingInteraction === void 0 ? [] : [[id, value.pendingInteraction]])) : pending;
2826
+ combined = {
2827
+ ...next,
2828
+ pendingInteractions: interactions
2829
+ };
2830
+ }
2831
+ return combined;
2832
+ },
2833
+ subscribe(listener) {
2834
+ const stopSessions = sessions.subscribe(listener);
2835
+ try {
2836
+ const stopStatus = source.subscribe(listener);
2837
+ return () => {
2838
+ stopStatus();
2839
+ stopSessions();
2840
+ };
2841
+ } catch (error) {
2842
+ stopSessions();
2843
+ throw error;
2844
+ }
2845
+ }
2846
+ };
2847
+ }
2808
2848
  //#endregion
2809
2849
  //#region src/client/index.tsx
2810
2850
  /** The overlay uses the shared trusted RPC transport and canonical session navigator. */
@@ -2816,6 +2856,13 @@ window.__ModuleLoader__.load({
2816
2856
  ];
2817
2857
  /** Register the debugger beside other frame-wide overlays without replacing shipped UI. */
2818
2858
  function apply(ctx) {
2859
+ try {
2860
+ ctx.effect(() => install(ctx), "openwrite-dog: client activation");
2861
+ } catch (error) {
2862
+ console.error("[OpenWrite/DoG] Debugger disabled: client activation failed", error);
2863
+ }
2864
+ }
2865
+ function* install(ctx) {
2819
2866
  const connection = ctx.get("connection");
2820
2867
  const sessions = ctx.get("sessions");
2821
2868
  const call = async (endpoint, payload, signal) => {
@@ -2824,33 +2871,8 @@ window.__ModuleLoader__.load({
2824
2871
  return result.value;
2825
2872
  };
2826
2873
  const openSession = (sessionId, parentSessionId) => openInvocationSession(sessions, sessionId, parentSessionId);
2827
- let lastSessions = sessions.list.getSnapshot();
2828
- let lastPending = ctx.uiSession.pendingInteractions.getSnapshot();
2829
- let combined = {
2830
- ...lastSessions,
2831
- pendingInteractions: lastPending
2832
- };
2833
- const getSessionState = () => {
2834
- const next = sessions.list.getSnapshot();
2835
- const pending = ctx.uiSession.pendingInteractions.getSnapshot();
2836
- if (next !== lastSessions || pending !== lastPending) {
2837
- lastSessions = next;
2838
- lastPending = pending;
2839
- combined = {
2840
- ...next,
2841
- pendingInteractions: pending
2842
- };
2843
- }
2844
- return combined;
2845
- };
2846
- const subscribeSessions = (listener) => {
2847
- const stopSession = sessions.list.subscribe(listener);
2848
- const stopPending = ctx.uiSession.pendingInteractions.subscribe(listener);
2849
- return () => {
2850
- stopSession();
2851
- stopPending();
2852
- };
2853
- };
2874
+ const state = debuggerSessionState(sessions.list, ctx.uiSession);
2875
+ state.getSnapshot();
2854
2876
  const DogDebuggerHost = () => {
2855
2877
  const [request, setRequest] = (0, react.useState)(0);
2856
2878
  (0, react.useEffect)(() => {
@@ -2867,17 +2889,24 @@ window.__ModuleLoader__.load({
2867
2889
  goalId
2868
2890
  }, signal),
2869
2891
  openSession,
2870
- getSessionState,
2871
- subscribeSessions,
2892
+ getSessionState: state.getSnapshot,
2893
+ subscribeSessions: state.subscribe,
2872
2894
  refreshAgentCatalog: (parentSessionId) => sessions.refreshSubagents(parentSessionId)
2873
2895
  }, request);
2874
2896
  };
2875
- ctx.effect(installStyles, "dog-debugger: styles");
2876
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({
2877
- name: "shell.overlay",
2878
- id: "openwrite.dog-debugger",
2879
- order: 80
2880
- }, DogDebuggerHost));
2897
+ yield ctx.effect(installStyles, "dog-debugger: styles");
2898
+ yield ctx.slots.inject("shell.overlay", () => {
2899
+ try {
2900
+ return ctx.slots.register({
2901
+ name: "shell.overlay",
2902
+ id: "openwrite.dog-debugger",
2903
+ order: 80
2904
+ }, DogDebuggerHost);
2905
+ } catch (error) {
2906
+ console.error("[OpenWrite/DoG] Debugger disabled: overlay registration failed", error);
2907
+ return () => {};
2908
+ }
2909
+ });
2881
2910
  }
2882
2911
  function installStyles() {
2883
2912
  if (document.querySelector(`style[data-plugin-css="@dsh-external/dsh-dog/debugger"]`) !== null) return () => void 0;