@tivility/dsh-session-share 0.3.5 → 0.3.6

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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A link that opens one session.
4
4
 
5
+ Targets DeepSeek Harness **0.1.x** (`@deepseek-ai/dsh-* ~0.1.1-rc.2`).
6
+
5
7
  ## The gap this fills
6
8
 
7
9
  The harness's GUI opens wherever it was left. There is no URL that means *this
@@ -28,7 +28,7 @@ import { ShareLink } from './ShareLink.js';
28
28
  export { ShareLink } from './ShareLink.js';
29
29
  export { SHARE_NS } from './namespace.js';
30
30
  /** Client-side services this plugin drives. */
31
- export const inject = ['sessions', 'slots', 'locale'];
31
+ export const inject = ['sessions', 'uiWorkspace', 'slots', 'locale'];
32
32
  /**
33
33
  * Remove the parameter from the address bar once it has been acted on.
34
34
  *
@@ -62,7 +62,7 @@ function openRequestedSession(ctx) {
62
62
  const state = ctx.sessions.list.getSnapshot();
63
63
  if (state.byId[requested] !== undefined) {
64
64
  done = true;
65
- ctx.sessions.open(requested);
65
+ ctx.uiWorkspace.openSession(requested);
66
66
  stripParam();
67
67
  return;
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AA4CzC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,MAAM,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ChB,CAAC"}
package/lib/client.js CHANGED
@@ -186,6 +186,7 @@ function ShareLink({ sessionId, t }) {
186
186
  /** Client-side services this plugin drives. */
187
187
  const inject = [
188
188
  "sessions",
189
+ "uiWorkspace",
189
190
  "slots",
190
191
  "locale"
191
192
  ];
@@ -217,7 +218,7 @@ function openRequestedSession(ctx) {
217
218
  const state = ctx.sessions.list.getSnapshot();
218
219
  if (state.byId[requested] !== void 0) {
219
220
  done = true;
220
- ctx.sessions.open(requested);
221
+ ctx.uiWorkspace.openSession(requested);
221
222
  stripParam();
222
223
  return;
223
224
  }
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["Primitives"],"sources":["param.js","client/locales.js","client/namespace.js","client/ShareLink.js","client/index.js"],"sourcesContent":["/**\n * The one fact both halves of this plugin have to agree on.\n *\n * The query parameter is a constant rather than configuration because the two\n * halves cannot share a configuration value: the browser bundle is fetched\n * outside the loader's config tree and receives only what its own `apply`\n * is handed, while the link the host writes into the system prompt is built\n * on the other side of the wire. A constant is the honest form of a value\n * that must match in two places.\n * @module @tivility/dsh-session-share/param\n */\n/** Query parameter naming the session to open on load. */\nexport const SESSION_PARAM = 'session';\n/**\n * Build the query a share link carries.\n * @param sessionId - the session to open.\n * @returns the query string, question mark included.\n */\nexport function shareQuery(sessionId) {\n return `?${SESSION_PARAM}=${encodeURIComponent(sessionId)}`;\n}\n//# sourceMappingURL=param.js.map","/** Copy for the session-header share control. */\n/** English copy. */\nexport const en = {\n copy: 'Copy link',\n copied: 'Copied',\n hint: 'Copy a link that opens this session',\n};\n/** Chinese copy. */\nexport const zh = {\n copy: '复制链接',\n copied: '已复制',\n hint: '复制一个直接打开这条会话的链接',\n};\n//# sourceMappingURL=locales.js.map","/**\n * The locale namespace this bundle registers, and the key union its copy\n * satisfies.\n *\n * Kept in its own module because the declaration merge below has to be visible\n * to both the registration site and the component, and importing the component\n * from the registration site (or the reverse) would make that a cycle.\n * @module @tivility/dsh-session-share/client/namespace\n */\n/** Locale namespace for the session-header share control. */\nexport const SHARE_NS = 'session.share';\n//# sourceMappingURL=namespace.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * The session header's \"copy link\" control.\n *\n * Without it the feature is unreachable by a person: the link format lives in\n * the system prompt, which teaches the *model* to hand out links, and leaves\n * whoever is looking at the GUI to construct one from a session id they cannot\n * see. This is the one affordance that makes it a feature rather than a\n * convention.\n *\n * The origin comes from `window.location`, so the link is always the address\n * this browser reached the harness at — the loopback URL when that is how you\n * opened it, the LAN address when it is not. Nothing to configure, and nothing\n * that can drift from where the server actually answers.\n * @module @tivility/dsh-session-share/client/ShareLink\n */\nimport { useCallback, useState } from 'react';\nimport * as Primitives from '@deepseek-ai/dsh-client-ui-primitives';\nimport { shareQuery } from '../param.js';\nimport { SHARE_NS } from './namespace.js';\n/** How long the copied state shows, in ms — matched to the harness's own copy controls. */\nconst COPIED_MS = 1000;\nconst { Button, writeClipboard } = Primitives;\n/** The fallback for a host that exports none of the requested names. */\nconst NoIcon = () => null;\n/**\n * Pick the first icon a host's primitives export under any of `names`.\n *\n * The primitives package is not bundled: the page's loader hands this plugin\n * whatever release the host is running. dsh 0.1.7 renamed the fixed-size\n * `…Outline16` icons to weight-suffixed `…OutlineRegular` ones, so a static\n * import resolves to `undefined` on one side of that release and crashes the\n * header slot. Looking the names up at run time keeps one build working on\n * both; a host exporting neither gets no glyph rather than a broken header.\n * @param exports - the primitives module's export table.\n * @param names - candidate export names, newest first.\n * @returns the first function export found, or a component that renders nothing.\n */\nexport function resolveIcon(exports, ...names) {\n for (const name of names) {\n const candidate = exports[name];\n if (typeof candidate === 'function')\n return candidate;\n }\n return NoIcon;\n}\nconst primitiveExports = Primitives;\nconst IconCheck = resolveIcon(primitiveExports, 'IconCheckOutlineRegular', 'IconCheckOutline16');\nconst IconLink = resolveIcon(primitiveExports, 'IconLinkOutlineRegular', 'IconLinkOutline16');\n/**\n * Render the copy-link control for the current session.\n * @param props - composed slot props.\n * @returns the control.\n */\nexport function ShareLink({ sessionId, t }) {\n const [copied, setCopied] = useState(false);\n const url = `${window.location.origin}/${shareQuery(String(sessionId))}`;\n const onCopy = useCallback(() => {\n if (copied)\n return;\n void writeClipboard(url).then((accepted) => {\n // A refused write (denied permission, insecure context) leaves the flag\n // alone: the control must never claim a copy the host declined.\n if (!accepted)\n return;\n setCopied(true);\n window.setTimeout(() => { setCopied(false); }, COPIED_MS);\n });\n }, [copied, url]);\n return (_jsx(Button, { variant: \"ghost\", size: \"sm\", onClick: onCopy, \n // The URL itself is the most useful hover text: it is what gets copied,\n // and seeing it is how someone learns the format exists.\n title: copied ? t('copied') : `${t('hint')}\\n${url}`, icon: copied ? _jsx(IconCheck, { size: 14 }) : _jsx(IconLink, { size: 14 }), children: copied ? t('copied') : t('copy') }));\n}\n//# sourceMappingURL=ShareLink.js.map","/**\n * The browser half: open the session a link names, and offer a way to get one.\n *\n * The harness's GUI has no routing — the whole client is searched in vain for\n * `pushState`, `location.hash`, or `searchParams`. The selected session lives\n * in the sessions manager and is restored from persisted state on load, so a\n * URL naming one has nowhere to be read. This adds that step, and the control\n * that makes it reachable by a person rather than only by the model.\n *\n * It deliberately hides nothing. The sidebar, the other sessions, and the\n * composer are all exactly as they would be — the link decides where you land,\n * not what you can see.\n *\n * ## Why the context is typed here\n *\n * The two halves of this package compile in one TypeScript program, and the\n * node half pulls in the harness's HOST augmentations of `Context` — where\n * `sessions` is a different service with the same name. Importing\n * `ClientContext` would therefore resolve `ctx.sessions` to the host's shape.\n * The harness avoids this with separate client and host programs; this package\n * states the members it uses instead.\n * @module @tivility/dsh-session-share/client\n */\nimport { SESSION_PARAM } from '../param.js';\nimport { en, zh } from './locales.js';\nimport { SHARE_NS } from './namespace.js';\nimport { ShareLink } from './ShareLink.js';\nexport { ShareLink } from './ShareLink.js';\nexport { SHARE_NS } from './namespace.js';\n/** Client-side services this plugin drives. */\nexport const inject = ['sessions', 'slots', 'locale'];\n/**\n * Remove the parameter from the address bar once it has been acted on.\n *\n * The selection is persisted by the runtime, so leaving the parameter in place\n * would make every later reload jump back to the linked session — fighting the\n * user each time they navigate away and refresh. Consuming it once makes the\n * link mean \"start here\", which is what a link means.\n */\nfunction stripParam() {\n const url = new URL(window.location.href);\n if (!url.searchParams.has(SESSION_PARAM))\n return;\n url.searchParams.delete(SESSION_PARAM);\n window.history.replaceState(window.history.state, '', `${url.pathname}${url.search}${url.hash}`);\n}\n/**\n * Open the session a `?session=` parameter names, once the list can carry it.\n * @param ctx - the client root context.\n */\nfunction openRequestedSession(ctx) {\n const requested = new URL(window.location.href).searchParams.get(SESSION_PARAM);\n // No parameter is the overwhelmingly common case — every ordinary visit — so\n // this costs nothing at all when it has nothing to do.\n if (requested === null || requested === '')\n return;\n ctx.effect(() => {\n let done = false;\n const attempt = () => {\n if (done)\n return;\n const state = ctx.sessions.list.getSnapshot();\n if (state.byId[requested] !== undefined) {\n done = true;\n ctx.sessions.open(requested);\n stripParam();\n return;\n }\n // The list arrives asynchronously, so an id that is absent right now may\n // simply not have loaded. The phase is what separates \"not yet\" from \"no\n // such session\" — a timeout would guess at it.\n if (state.phase === 'ready') {\n done = true;\n stripParam();\n ctx.logger?.warn?.(`session-share: no session ${requested} in this harness`);\n }\n };\n const unsubscribe = ctx.sessions.list.subscribe(attempt);\n // The list may already be ready before this plugin activates, in which case\n // no change is ever published and the subscription alone would wait forever.\n attempt();\n return unsubscribe;\n });\n}\n/**\n * Read the link, and offer one.\n * @param ctx - the client root context.\n */\nexport function apply(ctx) {\n openRequestedSession(ctx);\n ctx.effect(() => ctx.locale.register(SHARE_NS, { zh, en }));\n // Declaration-gated since dsh 0.1.3: registering into a slot before its\n // parent declares it throws, so the registration waits behind slots.inject.\n ctx.slots.inject('conversation.session.header.utilities', () => ctx.slots.register({\n // The header's utility band, not the title row: this is a control, and the\n // band beside the breadcrumb is where static session context belongs.\n name: 'conversation.session.header.utilities',\n id: 'session-share',\n locale: SHARE_NS,\n }, ShareLink));\n}\n//# sourceMappingURL=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ives"],"sources":["param.js","client/locales.js","client/namespace.js","client/ShareLink.js","client/index.js"],"sourcesContent":["/**\n * The one fact both halves of this plugin have to agree on.\n *\n * The query parameter is a constant rather than configuration because the two\n * halves cannot share a configuration value: the browser bundle is fetched\n * outside the loader's config tree and receives only what its own `apply`\n * is handed, while the link the host writes into the system prompt is built\n * on the other side of the wire. A constant is the honest form of a value\n * that must match in two places.\n * @module @tivility/dsh-session-share/param\n */\n/** Query parameter naming the session to open on load. */\nexport const SESSION_PARAM = 'session';\n/**\n * Build the query a share link carries.\n * @param sessionId - the session to open.\n * @returns the query string, question mark included.\n */\nexport function shareQuery(sessionId) {\n return `?${SESSION_PARAM}=${encodeURIComponent(sessionId)}`;\n}\n//# sourceMappingURL=param.js.map","/** Copy for the session-header share control. */\n/** English copy. */\nexport const en = {\n copy: 'Copy link',\n copied: 'Copied',\n hint: 'Copy a link that opens this session',\n};\n/** Chinese copy. */\nexport const zh = {\n copy: '复制链接',\n copied: '已复制',\n hint: '复制一个直接打开这条会话的链接',\n};\n//# sourceMappingURL=locales.js.map","/**\n * The locale namespace this bundle registers, and the key union its copy\n * satisfies.\n *\n * Kept in its own module because the declaration merge below has to be visible\n * to both the registration site and the component, and importing the component\n * from the registration site (or the reverse) would make that a cycle.\n * @module @tivility/dsh-session-share/client/namespace\n */\n/** Locale namespace for the session-header share control. */\nexport const SHARE_NS = 'session.share';\n//# sourceMappingURL=namespace.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * The session header's \"copy link\" control.\n *\n * Without it the feature is unreachable by a person: the link format lives in\n * the system prompt, which teaches the *model* to hand out links, and leaves\n * whoever is looking at the GUI to construct one from a session id they cannot\n * see. This is the one affordance that makes it a feature rather than a\n * convention.\n *\n * The origin comes from `window.location`, so the link is always the address\n * this browser reached the harness at — the loopback URL when that is how you\n * opened it, the LAN address when it is not. Nothing to configure, and nothing\n * that can drift from where the server actually answers.\n * @module @tivility/dsh-session-share/client/ShareLink\n */\nimport { useCallback, useState } from 'react';\nimport * as Primitives from '@deepseek-ai/dsh-client-ui-primitives';\nimport { shareQuery } from '../param.js';\nimport { SHARE_NS } from './namespace.js';\n/** How long the copied state shows, in ms — matched to the harness's own copy controls. */\nconst COPIED_MS = 1000;\nconst { Button, writeClipboard } = Primitives;\n/** The fallback for a host that exports none of the requested names. */\nconst NoIcon = () => null;\n/**\n * Pick the first icon a host's primitives export under any of `names`.\n *\n * The primitives package is not bundled: the page's loader hands this plugin\n * whatever release the host is running. dsh 0.1.7 renamed the fixed-size\n * `…Outline16` icons to weight-suffixed `…OutlineRegular` ones, so a static\n * import resolves to `undefined` on one side of that release and crashes the\n * header slot. Looking the names up at run time keeps one build working on\n * both; a host exporting neither gets no glyph rather than a broken header.\n * @param exports - the primitives module's export table.\n * @param names - candidate export names, newest first.\n * @returns the first function export found, or a component that renders nothing.\n */\nexport function resolveIcon(exports, ...names) {\n for (const name of names) {\n const candidate = exports[name];\n if (typeof candidate === 'function')\n return candidate;\n }\n return NoIcon;\n}\nconst primitiveExports = Primitives;\nconst IconCheck = resolveIcon(primitiveExports, 'IconCheckOutlineRegular', 'IconCheckOutline16');\nconst IconLink = resolveIcon(primitiveExports, 'IconLinkOutlineRegular', 'IconLinkOutline16');\n/**\n * Render the copy-link control for the current session.\n * @param props - composed slot props.\n * @returns the control.\n */\nexport function ShareLink({ sessionId, t }) {\n const [copied, setCopied] = useState(false);\n const url = `${window.location.origin}/${shareQuery(String(sessionId))}`;\n const onCopy = useCallback(() => {\n if (copied)\n return;\n void writeClipboard(url).then((accepted) => {\n // A refused write (denied permission, insecure context) leaves the flag\n // alone: the control must never claim a copy the host declined.\n if (!accepted)\n return;\n setCopied(true);\n window.setTimeout(() => { setCopied(false); }, COPIED_MS);\n });\n }, [copied, url]);\n return (_jsx(Button, { variant: \"ghost\", size: \"sm\", onClick: onCopy, \n // The URL itself is the most useful hover text: it is what gets copied,\n // and seeing it is how someone learns the format exists.\n title: copied ? t('copied') : `${t('hint')}\\n${url}`, icon: copied ? _jsx(IconCheck, { size: 14 }) : _jsx(IconLink, { size: 14 }), children: copied ? t('copied') : t('copy') }));\n}\n//# sourceMappingURL=ShareLink.js.map","/**\n * The browser half: open the session a link names, and offer a way to get one.\n *\n * The harness's GUI has no routing — the whole client is searched in vain for\n * `pushState`, `location.hash`, or `searchParams`. The selected session lives\n * in the sessions manager and is restored from persisted state on load, so a\n * URL naming one has nowhere to be read. This adds that step, and the control\n * that makes it reachable by a person rather than only by the model.\n *\n * It deliberately hides nothing. The sidebar, the other sessions, and the\n * composer are all exactly as they would be — the link decides where you land,\n * not what you can see.\n *\n * ## Why the context is typed here\n *\n * The two halves of this package compile in one TypeScript program, and the\n * node half pulls in the harness's HOST augmentations of `Context` — where\n * `sessions` is a different service with the same name. Importing\n * `ClientContext` would therefore resolve `ctx.sessions` to the host's shape.\n * The harness avoids this with separate client and host programs; this package\n * states the members it uses instead.\n * @module @tivility/dsh-session-share/client\n */\nimport { SESSION_PARAM } from '../param.js';\nimport { en, zh } from './locales.js';\nimport { SHARE_NS } from './namespace.js';\nimport { ShareLink } from './ShareLink.js';\nexport { ShareLink } from './ShareLink.js';\nexport { SHARE_NS } from './namespace.js';\n/** Client-side services this plugin drives. */\nexport const inject = ['sessions', 'uiWorkspace', 'slots', 'locale'];\n/**\n * Remove the parameter from the address bar once it has been acted on.\n *\n * The selection is persisted by the runtime, so leaving the parameter in place\n * would make every later reload jump back to the linked session — fighting the\n * user each time they navigate away and refresh. Consuming it once makes the\n * link mean \"start here\", which is what a link means.\n */\nfunction stripParam() {\n const url = new URL(window.location.href);\n if (!url.searchParams.has(SESSION_PARAM))\n return;\n url.searchParams.delete(SESSION_PARAM);\n window.history.replaceState(window.history.state, '', `${url.pathname}${url.search}${url.hash}`);\n}\n/**\n * Open the session a `?session=` parameter names, once the list can carry it.\n * @param ctx - the client root context.\n */\nfunction openRequestedSession(ctx) {\n const requested = new URL(window.location.href).searchParams.get(SESSION_PARAM);\n // No parameter is the overwhelmingly common case — every ordinary visit — so\n // this costs nothing at all when it has nothing to do.\n if (requested === null || requested === '')\n return;\n ctx.effect(() => {\n let done = false;\n const attempt = () => {\n if (done)\n return;\n const state = ctx.sessions.list.getSnapshot();\n if (state.byId[requested] !== undefined) {\n done = true;\n ctx.uiWorkspace.openSession(requested);\n stripParam();\n return;\n }\n // The list arrives asynchronously, so an id that is absent right now may\n // simply not have loaded. The phase is what separates \"not yet\" from \"no\n // such session\" — a timeout would guess at it.\n if (state.phase === 'ready') {\n done = true;\n stripParam();\n ctx.logger?.warn?.(`session-share: no session ${requested} in this harness`);\n }\n };\n const unsubscribe = ctx.sessions.list.subscribe(attempt);\n // The list may already be ready before this plugin activates, in which case\n // no change is ever published and the subscription alone would wait forever.\n attempt();\n return unsubscribe;\n });\n}\n/**\n * Read the link, and offer one.\n * @param ctx - the client root context.\n */\nexport function apply(ctx) {\n openRequestedSession(ctx);\n ctx.effect(() => ctx.locale.register(SHARE_NS, { zh, en }));\n // Declaration-gated since dsh 0.1.3: registering into a slot before its\n // parent declares it throws, so the registration waits behind slots.inject.\n ctx.slots.inject('conversation.session.header.utilities', () => ctx.slots.register({\n // The header's utility band, not the title row: this is a control, and the\n // band beside the breadcrumb is where static session context belongs.\n name: 'conversation.session.header.utilities',\n id: 'session-share',\n locale: SHARE_NS,\n }, ShareLink));\n}\n//# sourceMappingURL=index.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,gBAAgB;;;;;;AAM7B,SAAgB,WAAW,WAAW;AAClC,QAAO,IAAI,cAAc,GAAG,mBAAmB,UAAU;;;;;;;ACjB7D,MAAa,KAAK;CACd,MAAM;CACN,QAAQ;CACR,MAAM;CACT;;AAED,MAAa,KAAK;CACd,MAAM;CACN,QAAQ;CACR,MAAM;CACT;;;;;;;;;;;;;;ACFD,MAAa,WAAW;;;;;;;;;;;;;;;;;;;;ACWxB,MAAM,YAAY;AAClB,MAAM,EAAE,QAAQ,mBAAmBA;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AAI,SAAS,IAAI,OAAO;;;;;;AAMpG,SAAS,qBAAqB,KAAK;CAC/B,MAAM,YAAY,IAAI,IAAI,OAAO,SAAS,KAAK,CAAC,aAAa,IAAI,cAAc;AAG/E,KAAI,cAAc,QAAQ,cAAc,GACpC;AACJ,KAAI,aAAa;EACb,IAAI,OAAO;EACX,MAAM,gBAAgB;AAClB,OAAI,KACA;GACJ,MAAM,QAAQ,IAAI,SAAS,KAAK,aAAa;AAC7C,OAAI,MAAM,KAAK,eAAe,QAAW;AACrC,WAAO;AACP,QAAI,YAAY,YAAY,UAAU;AACtC,gBAAY;AACZ;;AAKJ,OAAI,MAAM,UAAU,SAAS;AACzB,WAAO;AACP,gBAAY;AACZ,QAAI,QAAQ,OAAO,6BAA6B,UAAU,kBAAkB;;;EAGpF,MAAM,cAAc,IAAI,SAAS,KAAK,UAAU,QAAQ;AAGxD,WAAS;AACT,SAAO;GACT;;;;;;AAMN,SAAgB,MAAM,KAAK;AACvB,sBAAqB,IAAI;AACzB,KAAI,aAAa,IAAI,OAAO,SAAS,UAAU;EAAE;EAAI;EAAI,CAAC,CAAC;AAG3D,KAAI,MAAM,OAAO,+CAA+C,IAAI,MAAM,SAAS;EAG/E,MAAM;EACN,IAAI;EACJ,QAAQ;EACX,EAAE,UAAU,CAAC"}
@@ -36,11 +36,14 @@ interface SessionsFace {
36
36
  getSnapshot(): SessionListSnapshot;
37
37
  subscribe(listener: () => void): () => void;
38
38
  };
39
+ }
40
+ /** The workspace navigation service that selects the main-view session (dsh ≥0.2). */
41
+ interface UiWorkspaceFace {
39
42
  /**
40
- * Select a session as current. Fails loud on an id the list does not carry,
41
- * which is why the phase below is consulted first.
43
+ * Select a session and show its conversation as one navigation action. The
44
+ * list phase below is consulted first so only listed ids reach it.
42
45
  */
43
- open(id: string): void;
46
+ openSession(id: string): void;
44
47
  }
45
48
  /** The slot registry, narrowed to the one registration this plugin makes. */
46
49
  interface SlotsFace {
@@ -60,6 +63,7 @@ interface LocaleFace {
60
63
  /** The client context members this plugin uses. */
61
64
  interface ShareContext {
62
65
  readonly sessions: SessionsFace;
66
+ readonly uiWorkspace: UiWorkspaceFace;
63
67
  readonly slots: SlotsFace;
64
68
  readonly locale: LocaleFace;
65
69
  effect(run: () => () => void): unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,mDAAmD;AACnD,UAAU,mBAAmB;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAChD,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAA;CACpC;AAED,kEAAkE;AAClE,UAAU,YAAY;IACpB,QAAQ,CAAC,IAAI,EAAE;QACb,WAAW,IAAI,mBAAmB,CAAA;QAClC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;KAC5C,CAAA;IACD;;;OAGG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,6EAA6E;AAC7E,UAAU,SAAS;IACjB,QAAQ,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,IAAI,CAAA;IAC9G,iGAAiG;IACjG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC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ivility/dsh-session-share",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Link straight to one DeepSeek Harness session: the GUI opens on it instead of wherever it was left.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@deepseek-ai/cordis": "*",
51
+ "@deepseek-ai/dsh-agent": ">=0.1.1-rc.2",
51
52
  "@deepseek-ai/dsh-host-webserver": ">=0.1.1-rc.2",
52
- "@deepseek-ai/schemastery": "*",
53
- "@deepseek-ai/dsh-agent": ">=0.1.1-rc.2"
53
+ "@deepseek-ai/schemastery": "*"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@deepseek-ai/dsh-system-prompt": {
@@ -70,7 +70,7 @@
70
70
  "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
71
71
  "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
72
72
  "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
73
- "@deepseek-ai/schemastery": "*",
73
+ "@deepseek-ai/schemastery": "^3.18.4",
74
74
  "@testing-library/react": "^16.1.0",
75
75
  "@types/react": "~18.3.1",
76
76
  "jsdom": "^26.0.0",
@@ -44,11 +44,15 @@ interface SessionsFace {
44
44
  getSnapshot(): SessionListSnapshot
45
45
  subscribe(listener: () => void): () => void
46
46
  }
47
+ }
48
+
49
+ /** The workspace navigation service that selects the main-view session (dsh ≥0.2). */
50
+ interface UiWorkspaceFace {
47
51
  /**
48
- * Select a session as current. Fails loud on an id the list does not carry,
49
- * which is why the phase below is consulted first.
52
+ * Select a session and show its conversation as one navigation action. The
53
+ * list phase below is consulted first so only listed ids reach it.
50
54
  */
51
- open(id: string): void
55
+ openSession(id: string): void
52
56
  }
53
57
 
54
58
  /** The slot registry, narrowed to the one registration this plugin makes. */
@@ -66,6 +70,7 @@ interface LocaleFace {
66
70
  /** The client context members this plugin uses. */
67
71
  interface ShareContext {
68
72
  readonly sessions: SessionsFace
73
+ readonly uiWorkspace: UiWorkspaceFace
69
74
  readonly slots: SlotsFace
70
75
  readonly locale: LocaleFace
71
76
  effect(run: () => () => void): unknown
@@ -73,7 +78,7 @@ interface ShareContext {
73
78
  }
74
79
 
75
80
  /** Client-side services this plugin drives. */
76
- export const inject = ['sessions', 'slots', 'locale']
81
+ export const inject = ['sessions', 'uiWorkspace', 'slots', 'locale']
77
82
 
78
83
  /**
79
84
  * Remove the parameter from the address bar once it has been acted on.
@@ -107,7 +112,7 @@ function openRequestedSession(ctx: ShareContext): void {
107
112
  const state = ctx.sessions.list.getSnapshot()
108
113
  if (state.byId[requested] !== undefined) {
109
114
  done = true
110
- ctx.sessions.open(requested)
115
+ ctx.uiWorkspace.openSession(requested)
111
116
  stripParam()
112
117
  return
113
118
  }