@langify-org/dsh-side-chat 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja.md CHANGED
@@ -6,7 +6,7 @@ DeepSeek Harness の会話を止めずに、その会話について横で質問
6
6
 
7
7
  ## 必要なもの
8
8
 
9
- - Web UI のある DSH `>=0.2.1-rc.3 <0.3.0-0`。
9
+ - Web UI のある DSH `>=0.2.1-rc.5 <0.3.0-0`。
10
10
 
11
11
  ## 導入
12
12
 
@@ -18,7 +18,7 @@ DSH の Web 版や Desktop 版では **Plugins** ページから追加できま
18
18
 
19
19
  ## 使い方
20
20
 
21
- assistant のメッセージの下にあるボタンの列で、サイドチャットのボタンを押します。会話が fork されて `サイドチャット: <会話のタイトル>` という名前が付き、右サイドバーに開くので、普通の会話と同じように話せます。セッション一覧でサイドチャットを選ぶと、元の会話が開き、その横にサイドチャットが開きます。
21
+ assistant のメッセージの下にあるボタンの列でサイドチャットのボタンを押すか、右サイドバーのガイドで **サイドチャット** を押します。会話が fork されて `サイドチャット: <会話のタイトル>` という名前が付き、右サイドバーに開くので、普通の会話と同じように話せます。セッション一覧でサイドチャットを選ぶと、元の会話が開き、その横にサイドチャットが開きます。
22
22
 
23
23
  - サイドチャットは、どのメッセージで押しても、会話の最後に終わった turn から始まります。メインの会話のその後の turn は届かず、サイドチャットの内容もメインの会話には届きません。
24
24
  - モデルに、サイドチャットであること、メインの作業を再開せず質問に答えること、サイドチャットで頼まれない限り変更を加えないことを伝えます。この指示はチャットには表示されません。
package/README.md CHANGED
@@ -6,7 +6,7 @@ Ask a side question about a DeepSeek Harness conversation without interrupting i
6
6
 
7
7
  ## Requirements
8
8
 
9
- - DSH `>=0.2.1-rc.3 <0.3.0-0` with the Web UI.
9
+ - DSH `>=0.2.1-rc.5 <0.3.0-0` with the Web UI.
10
10
 
11
11
  ## Install
12
12
 
@@ -18,7 +18,7 @@ In DSH Web and Desktop you can also add it from the **Plugins** page.
18
18
 
19
19
  ## Usage
20
20
 
21
- Click the side-chat button in an assistant message's action row. The conversation is forked, titled `Side chat: <conversation title>`, and opens in the right sidebar, where you talk to it as in any conversation. Selecting a side chat in the session list opens its source conversation with the side chat beside it.
21
+ Click the side-chat button in an assistant message's action row, or **Side chat** in the right sidebar's guide. The conversation is forked, titled `Side chat: <conversation title>`, and opens in the right sidebar, where you talk to it as in any conversation. Selecting a side chat in the session list opens its source conversation with the side chat beside it.
22
22
 
23
23
  - The side chat starts from the conversation's latest completed turn, whichever message you clicked. Later turns of the main conversation do not reach it, and nothing in the side chat reaches the main conversation.
24
24
  - The model is told it is in a side chat: to answer questions rather than resume the main task, and not to make changes unless you ask in the side chat. You do not see this instruction in the chat.
package/README.zh.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## 环境要求
8
8
 
9
- - 带 Web UI 的 DSH `>=0.2.1-rc.3 <0.3.0-0`。
9
+ - 带 Web UI 的 DSH `>=0.2.1-rc.5 <0.3.0-0`。
10
10
 
11
11
  ## 安装
12
12
 
@@ -18,7 +18,7 @@ dsh plugin --profile <profile> add @langify-org/dsh-side-chat
18
18
 
19
19
  ## 使用
20
20
 
21
- 点击 assistant 消息操作栏中的旁路对话按钮。对话会被 fork,命名为 `旁路对话: <对话标题>`,并在右侧边栏中打开,可以像普通对话一样交谈。在会话列表中选择旁路对话时,会打开其来源对话,并在旁边打开该旁路对话。
21
+ 点击 assistant 消息操作栏中的旁路对话按钮,或右侧边栏引导页中的 **旁路对话**。对话会被 fork,命名为 `旁路对话: <对话标题>`,并在右侧边栏中打开,可以像普通对话一样交谈。在会话列表中选择旁路对话时,会打开其来源对话,并在旁边打开该旁路对话。
22
22
 
23
23
  - 无论点击哪条消息,旁路对话都从对话最近一个已完成的轮次开始。主对话之后的轮次不会传入,旁路对话的内容也不会传到主对话。
24
24
  - 模型会被告知它处于旁路对话中:回答问题而不是继续主任务,除非在旁路对话中被要求,否则不做任何修改。这条指示不会显示在对话中。
package/dist/client.cjs CHANGED
@@ -8,7 +8,7 @@ window.__ModuleLoader__.load({
8
8
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
9
9
  let zod = require("zod");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
- // ../../node_modules/.pnpm/@deepseek-ai+dsh-brand@0.2.1-rc.3_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-brand/lib/index.js
11
+ // ../../node_modules/.pnpm/@deepseek-ai+dsh-brand@0.2.1-rc.5_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-brand/lib/index.js
12
12
  /**
13
13
  * Duplicate-install-safe nominal primitive helpers.
14
14
  *
@@ -30,7 +30,7 @@ window.__ModuleLoader__.load({
30
30
  function brandString(value) {
31
31
  return value;
32
32
  }
33
- // ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.2.1-rc.3_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-scope@0._bda3f588c471e2856bac008b536eda6e/node_modules/@deepseek-ai/dsh-session/lib/types/types.js
33
+ // ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.2.1-rc.5_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-scope@0._1afa55f8edfbf99388e776171daf732a/node_modules/@deepseek-ai/dsh-session/lib/types/types.js
34
34
  /**
35
35
  * Brand a string as a {@link SessionId}.
36
36
  * @param id - the raw session id string.
@@ -125,6 +125,9 @@ window.__ModuleLoader__.load({
125
125
  const en = {
126
126
  title: "Side chat",
127
127
  action: "Ask in a side chat",
128
+ guide: "Ask about this conversation without interrupting it",
129
+ starting: "Starting a side chat…",
130
+ retry: "Retry",
128
131
  "error.invalid_request": "The request was invalid: {message}",
129
132
  "error.fork_failed": "The side chat could not start: {message}",
130
133
  "error.internal_error": "Something went wrong: {message}",
@@ -133,6 +136,9 @@ window.__ModuleLoader__.load({
133
136
  const zh = {
134
137
  title: "旁路对话",
135
138
  action: "在旁路对话中提问",
139
+ guide: "在不打断当前对话的情况下提问",
140
+ starting: "正在启动旁路对话…",
141
+ retry: "重试",
136
142
  "error.invalid_request": "请求无效:{message}",
137
143
  "error.fork_failed": "旁路对话启动失败:{message}",
138
144
  "error.internal_error": "出现错误:{message}",
@@ -141,11 +147,58 @@ window.__ModuleLoader__.load({
141
147
  const ja = {
142
148
  title: "サイドチャット",
143
149
  action: "サイドチャットで質問する",
150
+ guide: "今の会話を止めずに質問する",
151
+ starting: "サイドチャットを始めています…",
152
+ retry: "もう一度",
144
153
  "error.invalid_request": "リクエストが正しくありません:{message}",
145
154
  "error.fork_failed": "サイドチャットを始められませんでした:{message}",
146
155
  "error.internal_error": "エラーが起きました:{message}",
147
156
  "error.unexpected": "エラーが起きました:{message}"
148
157
  };
158
+ // src/client/start-page.tsx
159
+ /** The guide card's page: starts a side chat at once and is replaced by it. */
160
+ function StartPage({ start, describe, t, useTabInfo }) {
161
+ const { tab } = useTabInfo();
162
+ const [attempt, setAttempt] = (0, react.useState)(0);
163
+ const [error, setError] = (0, react.useState)();
164
+ const started = (0, react.useRef)(-1);
165
+ (0, react.useEffect)(() => {
166
+ if (started.current === attempt) return;
167
+ started.current = attempt;
168
+ setError(void 0);
169
+ start(tab.id).catch((failure) => {
170
+ if (!tab.signal.aborted) setError(describe(failure));
171
+ });
172
+ }, [
173
+ attempt,
174
+ start,
175
+ describe,
176
+ tab.id,
177
+ tab.signal
178
+ ]);
179
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
180
+ role: error === void 0 ? "status" : "alert",
181
+ style: styles.page,
182
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: error ?? t("starting") }), error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
183
+ variant: "outline",
184
+ size: "sm",
185
+ onClick: () => setAttempt((n) => n + 1),
186
+ children: t("retry")
187
+ })]
188
+ });
189
+ }
190
+ const styles = { page: {
191
+ height: "100%",
192
+ display: "flex",
193
+ flexDirection: "column",
194
+ alignItems: "center",
195
+ justifyContent: "center",
196
+ gap: 12,
197
+ padding: 16,
198
+ textAlign: "center",
199
+ overflowWrap: "anywhere",
200
+ color: "var(--dsw-alias-label-secondary)"
201
+ } };
149
202
  // src/client/index.tsx
150
203
  const inject = [
151
204
  "connection",
@@ -158,6 +211,8 @@ window.__ModuleLoader__.load({
158
211
  ];
159
212
  const KIND = "langify-side-chat";
160
213
  const TAB_ID = "langify-side-chat/chat";
214
+ const START_KIND = "langify-side-chat-new";
215
+ const START_ID = "langify-side-chat/new";
161
216
  const RPC_TIMEOUT_MS = 6e4;
162
217
  const ACTION_CLASS = "langify-side-chat-action";
163
218
  const ACTION_CSS = `.${ACTION_CLASS}{width:calc(28px + var(--dsh-content-font-delta,0px));height:calc(28px + var(--dsh-content-font-delta,0px));border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:6px;display:inline-flex}.${ACTION_CLASS} svg{width:calc(15px + var(--dsh-content-font-delta,0px));height:calc(15px + var(--dsh-content-font-delta,0px))}.${ACTION_CLASS}:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.${ACTION_CLASS}:disabled{cursor:default;opacity:.4}`;
@@ -196,8 +251,12 @@ window.__ModuleLoader__.load({
196
251
  } }
197
252
  }, ChatTab)), "side-chat: chat tab");
198
253
  ctx.effect(() => ctx.slots.inject(CONVERSATION_SLOT, () => ctx.slots.register({ name: CONVERSATION_SLOT }, ConversationPanel)), "side-chat: conversation");
199
- const showChat = (fork) => ctx.sidebarRight.openResource(chatAddress(fork), { kind: KIND });
200
- const open = async (sessionId) => {
254
+ const showChat = (fork, replaceTab) => ctx.sidebarRight.openResource(chatAddress(fork), {
255
+ kind: KIND,
256
+ ...replaceTab === void 0 ? {} : { replaceTab }
257
+ });
258
+ /** Fork `sessionId` into a side chat and show it, in place of `replaceTab` when given. */
259
+ const open = async (sessionId, replaceTab) => {
201
260
  const source = ctx.sessions.list.getSnapshot().byId[SessionId(sessionId)];
202
261
  const title = `${t("title")}: ${source?.title ?? source?.displayTitle ?? sessionId}`;
203
262
  const result = await ctx.connection.rpc.call(RPC_CHANNEL, RPC_METHOD, {
@@ -206,8 +265,28 @@ window.__ModuleLoader__.load({
206
265
  }, AbortSignal.timeout(RPC_TIMEOUT_MS));
207
266
  if (!result.ok) throw new RpcFailure(result.error.code, result.error.message);
208
267
  const fork = createResponseSchema.parse(result.value).sessionId;
209
- showChat(fork);
268
+ showChat(fork, replaceTab);
210
269
  };
270
+ ctx.effect(() => ctx.sidebarRightTabs.register({
271
+ id: START_ID,
272
+ kind: START_KIND,
273
+ title: () => t("title"),
274
+ guide: [{
275
+ id: "new-side-chat",
276
+ order: 30,
277
+ title: () => t("title"),
278
+ description: () => t("guide")
279
+ }]
280
+ }), "side-chat: start page type");
281
+ ctx.effect(() => ctx.slots.inject("sidebar.right.pane.tab", () => ctx.slots.register({
282
+ name: "sidebar.right.pane.tab",
283
+ key: START_ID,
284
+ locale: NAMESPACE,
285
+ inject: (sessionId) => ({
286
+ start: (tab) => open(sessionId, tab),
287
+ describe: (error) => errorText(error, t)
288
+ })
289
+ }, StartPage)), "side-chat: start page");
211
290
  let reopen;
212
291
  ctx.effect(() => ctx.sidebarRight.mounted.subscribe(() => {
213
292
  const shown = ctx.sidebarRight.mounted.getSnapshot();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langify-org/dsh-side-chat",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Ask a side question beside a DeepSeek Harness conversation, in a fork shown in the right sidebar",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -35,28 +35,28 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@deepseek-ai/cordis": "4.0.5",
38
- "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.3",
39
- "@deepseek-ai/dsh-client-connection": "0.2.1-rc.3",
40
- "@deepseek-ai/dsh-client-locale": "0.2.1-rc.3",
41
- "@deepseek-ai/dsh-client-ui-chat": "0.2.1-rc.3",
42
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.3",
43
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.3",
44
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.3",
45
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.3",
46
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.3",
47
- "@deepseek-ai/dsh-llm": "0.2.1-rc.3",
48
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
49
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.3",
38
+ "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.5",
39
+ "@deepseek-ai/dsh-client-connection": "0.2.1-rc.5",
40
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.5",
41
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.1-rc.5",
42
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.5",
43
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
44
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.5",
45
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.5",
46
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.5",
47
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
48
+ "@deepseek-ai/dsh-session": "0.2.1-rc.5",
49
+ "@deepseek-ai/dsh-session-projection": "0.2.1-rc.5",
50
50
  "@types/react": "18.3.31"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@deepseek-ai/cordis": "^4.0.5",
54
- "@deepseek-ai/dsh-client-connection": ">=0.2.1-rc.3 <0.3.0-0",
55
- "@deepseek-ai/dsh-llm": ">=0.2.1-rc.3 <0.3.0-0",
56
- "@deepseek-ai/dsh-session": ">=0.2.1-rc.3 <0.3.0-0"
54
+ "@deepseek-ai/dsh-client-connection": ">=0.2.1-rc.5 <0.3.0-0",
55
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.5 <0.3.0-0",
56
+ "@deepseek-ai/dsh-session": ">=0.2.1-rc.5 <0.3.0-0"
57
57
  },
58
58
  "engines": {
59
- "dsh": ">=0.2.1-rc.3 <0.3.0-0"
59
+ "dsh": ">=0.2.1-rc.5 <0.3.0-0"
60
60
  },
61
61
  "dsh": {
62
62
  "bundle": {