@soffits/dsh-plugin-sdk 0.0.0-stage → 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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0
4
+
5
+ - `buildClient` takes an `id`, for a part of a package that has no `package.json` of its own; the header then names that id.
6
+
7
+ ## 0.1.0
8
+
9
+ - First release: @soffits/dsh-host-kit, @soffits/dsh-channel-core, @soffits/dsh-ui-kit and @soffits/dsh-ui-actions in one package. Host helpers at `@soffits/dsh-plugin-sdk/host` (`/host/build`), chat bridge helpers at `/channel` (`/channel/testing`), the item format at `/actions/item`; one row `plugin-sdk` whose browser half provides `ctx.uiKit` and `ctx.uiActions` as before.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sakina
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSE-lucide ADDED
@@ -0,0 +1,45 @@
1
+ The icons in client.js are from Lucide (https://lucide.dev), lucide-static 1.74.0, under its licence below: ISC, and MIT for the icons that come from Feather.
2
+
3
+ ISC License
4
+
5
+ Copyright (c) 2026 Lucide Icons and Contributors
6
+
7
+ Permission to use, copy, modify, and/or distribute this software for any
8
+ purpose with or without fee is hereby granted, provided that the above
9
+ copyright notice and this permission notice appear in all copies.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+
19
+ ---
20
+
21
+ The following Lucide icons are derived from the Feather project:
22
+
23
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
24
+
25
+ The MIT License (MIT) (for the icons listed above)
26
+
27
+ Copyright (c) 2013-present Cole Bemis
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy
30
+ of this software and associated documentation files (the "Software"), to deal
31
+ in the Software without restriction, including without limitation the rights
32
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33
+ copies of the Software, and to permit persons to whom the Software is
34
+ furnished to do so, subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in all
37
+ copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ @soffits/dsh-ui-kit
2
+ Copyright (c) 2026 Sakina. MIT licence (LICENSE).
3
+
4
+ The mention picker in src/client/composer.js follows the approach of dsh-chat
5
+ (https://github.com/baixianger/dsh-chat): mentionable members as chips, inserted
6
+ as tokens that are tracked while they stay in the text.
7
+ dsh-chat is Copyright (c) 2026 Xiang Bai, MIT licence.
8
+
9
+ Icons are from Lucide (ISC), see LICENSE-lucide.
package/README.md CHANGED
@@ -1,3 +1,43 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared parts for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) plugins, in one package.
4
+
5
+ | Part | How a plugin gets it | What it is |
6
+ | --- | --- | --- |
7
+ | [Host helpers](host/README.md) | `import { … } from '@soffits/dsh-plugin-sdk/host'`, and `/host/build` for the client build | Who is asking (people and sign-in), locale files, change notices, event streams, and an esbuild-based build of a plugin's browser module. |
8
+ | [Chat bridge helpers](channel/README.md) | `import { … } from '@soffits/dsh-plugin-sdk/channel'`, and `/channel/testing` for test fakes | Sessions for chat channels, the spool a send command uses, answers and silent replies, subagent boards, voice, model controls. |
9
+ | [Page pieces](ui/README.md) | the browser service `ctx.uiKit` | Tiles, icons (Lucide), times and countdowns, live status, history, chat bubbles and a composer for plugin pages. |
10
+ | [Ask-the-assistant buttons](actions/README.md) | the browser service `ctx.uiActions`, and `/actions/item` for the item format | Buttons that start a conversation or a step about an item, and items drawn in messages. |
11
+
12
+ ## Install
13
+
14
+ A plugin that uses the Host or chat helpers lists `@soffits/dsh-plugin-sdk` in its `dependencies`. A plugin whose page uses `ctx.uiKit` or `ctx.uiActions` needs the SDK installed in the profile, since its browser half provides them:
15
+
16
+ ```bash
17
+ dsh plugin --profile <profile> add @soffits/dsh-plugin-sdk
18
+ ```
19
+
20
+ and names it in its own `package.json`, so the page loads the SDK first:
21
+
22
+ ```json
23
+ "dsh": { "client": { "platform": "web", "inject": ["@soffits/dsh-plugin-sdk"] } }
24
+ ```
25
+
26
+ It brings one row, `plugin-sdk`, with nothing to set and no tools.
27
+
28
+ ## History
29
+
30
+ The SDK was four packages until 0.1.0; their repositories are archived and their history is kept here: [dsh-host-kit](https://github.com/soffits/dsh-host-kit) (`host/`), [dsh-channel-core](https://github.com/soffits/dsh-channel-core) (`channel/`), [dsh-ui-kit](https://github.com/soffits/dsh-ui-kit) (`ui/`), [dsh-ui-actions](https://github.com/soffits/dsh-ui-actions) (`actions/`). The services keep their names (`uiKit`, `uiActions`), so a page that used them works unchanged once the SDK is installed.
31
+
32
+ ## Development
33
+
34
+ ```bash
35
+ npm ci
36
+ npm run build # ui/client.js, actions/client.js, then client.js
37
+ npm run check
38
+ npm test
39
+ ```
40
+
41
+ ## License
42
+
43
+ MIT. The bundled icons are from [Lucide](https://lucide.dev) (ISC, `LICENSE-lucide`).
@@ -0,0 +1,67 @@
1
+ # Ask-the-assistant buttons, `ctx.uiActions`
2
+
3
+ Part of [@soffits/dsh-plugin-sdk](../README.md): the SDK's browser half (service `uiActions`; `/actions/item` for the item format). Its history before the merge is in the archived [soffits/dsh-ui-actions](https://github.com/soffits/dsh-ui-actions) repository.
4
+
5
+ Shared action buttons for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) plugin pages, and a way to ask the agent about an item that keeps the item as a card instead of a lump of text.
6
+
7
+ - **Buttons** for anything a plugin shows (a card, a row, a notification): ask, done, snooze, a custom event, open a link. Same look, phone-sized touch targets, words in the person's language.
8
+ - **Suggested next steps** that start on one tap. Whoever made the item can attach up to three concrete steps ("Pay the invoice from the joint account", "Move it to tomorrow 9:00"); a tap sends that step with the item to the assistant in a new conversation, as the person, with no draft to confirm, and the button links to it. The label is the go-ahead, so it says the step plainly.
9
+ - **Ask about an item.** A new conversation opens with the item attached to the message box as a small removable card (its title and first line), and the person writes their own words beside it. The sent message shows the same card above their words, with the plugin's icon and name. The agent gets the item as a short quote it can read directly:
10
+
11
+ ```
12
+ > Hydro bill due Friday
13
+ > [Item from Inbox (@soffits/dsh-notify-inbox)]
14
+ > Hydro bill of $84.20 is due Friday.
15
+ > context: {"notification":"20261117T170000Z-bill"}
16
+ ```
17
+
18
+ Because the item is ordinary text in the message, it survives copying, editing, queued messages and session search, and a DSH without this plugin still shows a readable quote.
19
+
20
+ It is a client-side library for other plugins; on its own it adds nothing to the page.
21
+
22
+ ## For plugin authors
23
+
24
+ List the package in your `package.json` so your client loads after it, and use the service when it's there (your page still works without it):
25
+
26
+ ```json
27
+ "dsh": { "client": { "platform": "web", "inject": ["@deepseek-ai/dsh-client-locale", "@soffits/dsh-plugin-sdk"] } }
28
+ ```
29
+
30
+ ```js
31
+ apply(ctx) {
32
+ ctx.inject(['uiActions'], scope => {
33
+ scope.effect(() => {
34
+ buttons = scope.uiActions // keep it for rendering
35
+ return scope.uiActions.registerSource({ id: '@you/your-plugin', name: () => t('title'), icon: YourIcon })
36
+ })
37
+ })
38
+ }
39
+
40
+ // in a component
41
+ h(buttons.ActionBar, {
42
+ actions: item.actions, // [{ kind, id, label?, payload? }]
43
+ states: { done: 'pending' }, // your server's view of each press, by action id
44
+ about: { source: '@you/your-plugin', title: item.title, lines: ['Due Friday', '$84.20'], context: { id: item.id } },
45
+ defaultChat: true, // add "Chat about this" when the item declares no chat
46
+ onPress: (action, extra) => post('/api/you/press', { id: item.id, action: action.id, ...extra }),
47
+ })
48
+ ```
49
+
50
+ - `ActionBar({ actions, states, compact, about, defaultChat, onPress })` renders a row of buttons; `compact` shows icons only. `ActionButton({ action, state, compact, about, onPress })` is one button.
51
+ - Kinds: `step` (a suggested next step, sent on one tap: `label` is required and says the step; `payload.prompt` is sent instead when the step needs more words than the label, never more than it authorises; `payload.context`, `payload.session` as for chat; the press goes to `onPress` first so your server records who started what, then the step is sent; at most three, shown first, on their own line, wrapping), `chat` (opens a conversation about `about`; `payload.prompt` starts the person's message, `payload.context` replaces `about.context`, `payload.session` continues a session instead of opening a new one), `done`, `snooze` (a picker unless `payload.until`; `extra.until` goes to `onPress`), `event`, `link` (`payload.url`).
52
+ - `onPress` is your own server call for `done`, `snooze` and `event`; resolve when your server accepted the press. The button shows the press as pending until `states` says `done` or `unhandled`.
53
+ - A button without `label` uses this package's words; give `label` for your own wording. A `label` (and a chat or step `payload.prompt`) is text or a map from language tag to text (`{ "en": "Pay it", "zh": "去付款" }`); the person's language is shown, then its primary tag, then `en`, then the first one.
54
+ - `part: 'steps' | 'buttons'` renders only the steps or only the other buttons, for layouts that place them apart (a narrow row keeps its buttons beside its title and its steps on a line below). Children are placed after the fixed buttons (your own controls on the same line).
55
+ - `chat(about, { prompt, session })` does the same as a chat button, from your own code; `start(about, { instruction, session })` sends like a step and resolves to the session id.
56
+ - `registerSource({ id, name, icon })` names your plugin on item cards; `name` can be a function so it follows the language, `icon` is a component taking `{ size }`. It returns a function that unregisters.
57
+ - `about.lines`: what the item shows, one entry per line (at most 15 are sent); `about.context`: small JSON with the ids and values the agent needs to act on it.
58
+
59
+ The item text format is exported as `@soffits/dsh-plugin-sdk/actions/item` (`itemText`, `parseItem`, `itemRanges`) for tools that read messages.
60
+
61
+ ## Languages
62
+
63
+ The buttons' words are in `locale/<tag>.json` (English, French and Chinese now). Add a language by adding a file with the same keys; DSH falls back to English for anything missing.
64
+
65
+ ## Licence
66
+
67
+ MIT