dsh-lark-agent 0.2.0 → 0.3.1

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
@@ -16,7 +16,7 @@ dsh-lark-agent adds a Feishu / Lark private chat to a running DeepSeek Harness:
16
16
 
17
17
  Before you start:
18
18
 
19
- - DeepSeek Harness is running, can chat, and has a default model selected: PC App `0.2.1-rc.2`, or Web / `dsh` CLI `0.1.1-rc.2`.
19
+ - DeepSeek Harness is running, can chat, and has a default model selected: PC App `0.2.1-rc.3` (`0.2.1-rc.2` also works), or Web / `dsh` CLI `0.1.1-rc.2`.
20
20
  - The official Lark CLI is installed on the same machine **before** you enable the plugin (needs Node.js / npm):
21
21
 
22
22
  ```sh
@@ -53,6 +53,8 @@ Then restart `dsh web`.
53
53
 
54
54
  ### Update
55
55
 
56
+ When a new version is out, the Feishu settings page shows a notice with these steps (in the desktop app it also opens the plugin list for you).
57
+
56
58
  1. On the Feishu settings page, click **暂停连接** (pause) and back up as described in [Upgrade](https://github.com/Nirvana-Jie/dsh-lark-agent/blob/main/DEVELOPMENT.md#升级).
57
59
  2. Desktop app: the Add plugin dialog says third-party plugins must be uninstalled before a new version is installed, so uninstall `dsh-lark-agent` on the Plugins page and add it again (this in-app upgrade hasn't been tested end to end yet; an earlier source build is listed as `dsh-larkbot`). CLI: run `dsh plugin --profile web update dsh-lark-agent@latest`, then restart `dsh web`.
58
60
  3. Click **恢复连接** (resume) and check that the bot replies.
@@ -72,24 +74,24 @@ The Feishu entry works only while the host is online: not when the app is closed
72
74
 
73
75
  | In Feishu, you… | The assistant… |
74
76
  | --- | --- |
75
- | Send a request | Works on it with Harness's own tools (web search, reading pages, workspace files and more), streaming the reply live into one card, with its thinking and tool steps folded inside |
77
+ | Send a request | Works on it with Harness's own tools (web search, reading pages, workspace files and more), streaming the reply live into one card; its thinking and tool steps are folded inside, step by step as in the app, and the card ends with the model, thinking depth and permission mode it used |
76
78
  | Ask for something that needs your OK | Sends a confirmation card: tap **允许一次** (allow once) or **拒绝** (deny); no answer within 5 minutes means it won't run |
77
79
  | Get asked to choose by Harness | Sends a choice card: tap an option, or fill it in and submit |
78
- | Use `/permission`, or 权限模式 in the model settings card | Switches between read-only, workspace edits and full access, like the app's permission selector; full access stops asking |
80
+ | Use `/permission`, or **设置 → 权限模式** (Settings → Permission mode) in the bottom menu | Switches between read-only, workspace edits and full access, like the app's permission selector; full access stops asking. The card you tap updates in place and turns green when done |
79
81
  | Ask for the result file | Sends files from its workspace straight to the chat |
80
82
  | Say "lead with the conclusion from now on" | Remembers the preference |
81
83
  | Keep chatting, or use `/sessions`, `/new` | Continues the topic, returns to an earlier one, or starts fresh |
82
84
  | Ask for a bar chart of some numbers | Replies with a native Feishu chart card |
83
85
  | Ask it to let you pick between options first | Sends a form card and continues once you submit |
84
- | Ask for an architecture diagram or a report | Creates a Feishu doc (with a whiteboard for diagrams) shared read-only with you alone; in App `0.2.1-rc.2`, opening that Feishu session in the app also shows a local preview |
85
- | Use `/model`, `/thinking` | Switches between the host's configured models and thinking depth |
86
+ | Ask for an architecture diagram or a report | Creates a Feishu doc (with a whiteboard for diagrams) shared read-only with you alone; in App `0.2.1-rc.2` / `rc.3`, opening that Feishu session in the app also shows a local preview |
87
+ | Use `/model`, `/thinking` | Switches between the host's configured models and thinking depth, in sync with Harness on your computer (App `0.2.1-rc.2` / `rc.3`) |
86
88
 
87
89
  By default it answers only your own private chat. In that chat the assistant is your Harness itself: the tools it can use and the actions that need your confirmation follow the permission settings on your computer. Sessions and memory stay on the computer running Harness; messages pass through Feishu and your model provider.
88
90
 
89
91
  ## Good to know
90
92
 
91
93
  - **More docs**: commands, privacy, upgrades, the chat bottom menu, team deployment and troubleshooting are in [DEVELOPMENT.md](https://github.com/Nirvana-Jie/dsh-lark-agent/blob/main/DEVELOPMENT.md) (Chinese).
92
- - **Compatibility**: verified with PC App `0.2.1-rc.2` and `dsh` CLI / Web `0.1.1-rc.2`; other versions, platforms and tenants are not yet verified.
94
+ - **Compatibility**: fully verified with PC App `0.2.1-rc.2` and `dsh` CLI / Web `0.1.1-rc.2`. PC App `0.2.1-rc.3` passes the real-host contract tests, and the plugin loads and connects on it (first-time QR setup on rc.3 is not tested yet). Other versions, platforms and tenants are not yet verified.
93
95
  - **Language**: the settings page, the bot's built-in messages (`/help`, status text, card buttons, bottom menu) and the intro video are in Chinese.
94
96
 
95
97
  ## License
@@ -20,7 +20,8 @@ export interface BotMenuNode {
20
20
  }
21
21
  /**
22
22
  * Public Application Ability PATCH payload. Publishing is a separate admin action.
23
- * Five flat nodes fit both documented floating-menu limit variants.
23
+ * Three top-level nodes with three children fit both documented floating-menu
24
+ * limit variants (at most five per level and ten in all).
24
25
  * Text actions cannot separate a friendly label from the text they send.
25
26
  */
26
27
  export declare function buildBotMenuAbility(): {
package/dist/bot-menu.js CHANGED
@@ -6,7 +6,6 @@ export const BOT_MENU_COMMANDS = Object.freeze({
6
6
  'dsh.sessions': '/sessions',
7
7
  'dsh.model': '/model',
8
8
  'dsh.thinking': '/thinking',
9
- // Optional: not in the default five-node menu; an owner may add it under 设置.
10
9
  'dsh.permission': '/permission',
11
10
  });
12
11
  export function botMenuCommand(eventKey) {
@@ -16,7 +15,8 @@ export function botMenuCommand(eventKey) {
16
15
  }
17
16
  /**
18
17
  * Public Application Ability PATCH payload. Publishing is a separate admin action.
19
- * Five flat nodes fit both documented floating-menu limit variants.
18
+ * Three top-level nodes with three children fit both documented floating-menu
19
+ * limit variants (at most five per level and ten in all).
20
20
  * Text actions cannot separate a friendly label from the text they send.
21
21
  */
22
22
  export function buildBotMenuAbility() {
@@ -26,6 +26,7 @@ export function buildBotMenuAbility() {
26
26
  { menu_id: 'dsh_settings', sort: 2, default_name: '设置', menu_content_type: 3 },
27
27
  { menu_id: 'dsh_model', parent_menu_id: 'dsh_settings', sort: 0, default_name: '模型', menu_content_type: 2, event_key: 'dsh.model' },
28
28
  { menu_id: 'dsh_thinking', parent_menu_id: 'dsh_settings', sort: 1, default_name: '思考深度', menu_content_type: 2, event_key: 'dsh.thinking' },
29
+ { menu_id: 'dsh_permission', parent_menu_id: 'dsh_settings', sort: 2, default_name: '权限模式', menu_content_type: 2, event_key: 'dsh.permission' },
29
30
  ] } };
30
31
  }
31
32
  /** Pure review/export plan: this module never invokes an API or changes an app. */
package/dist/bridge.d.ts CHANGED
@@ -16,6 +16,10 @@ export interface Runtime {
16
16
  catalog?(): Promise<ModelCatalog>;
17
17
  resolveModelSelection?(selection?: ModelSelection): Promise<ModelSelection>;
18
18
  permissionOptions?(): PermissionOption[];
19
+ /** Harness sessions share their model choice with the App (see RuntimeSession.sharesModelSelection). */
20
+ sharesModelSelection?(): boolean;
21
+ /** Make a choice the App's default for new sessions, as the App's model selector does. */
22
+ saveDefaultModel?(selection: ModelSelection): Promise<void>;
19
23
  }
20
24
  export interface BotState {
21
25
  sessions: Pick<SessionStore, 'current' | 'list' | 'add' | 'activate' | 'archive' | 'rename' | 'touch'> & Partial<Pick<SessionStore, 'rebindNative'>>;
@@ -99,6 +103,8 @@ export declare class BotBridge {
99
103
  accept(raw: unknown): Promise<void>;
100
104
  private acceptMessage;
101
105
  private process;
106
+ /** The model, thinking depth and permission mode a reply runs with, by name. */
107
+ private settingsLine;
102
108
  /** Whether this message's reply streams into a live card, which makes the typing reaction redundant. */
103
109
  private streams;
104
110
  private liveTransport;
@@ -114,6 +120,16 @@ export declare class BotBridge {
114
120
  private answerInteraction;
115
121
  /** Send files the host's delivery tool presented, from this user's workspace only. */
116
122
  private deliverFiles;
123
+ /** A private-chat click on a settings or topic panel, which can update the clicked card. */
124
+ private inPlace;
125
+ /**
126
+ * Run a panel click and show its progress and result on the clicked card. That
127
+ * card exists, so a failed progress frame never holds back the result, and an
128
+ * unconfirmed update is never followed by another message.
129
+ */
130
+ private panelInPlace;
131
+ /** Redraw a stale card with the current state, without running its command. */
132
+ private refreshPanel;
117
133
  private commandFeedback;
118
134
  private context;
119
135
  private sessionContext;
@@ -123,16 +139,29 @@ export declare class BotBridge {
123
139
  private unload;
124
140
  private command;
125
141
  private harness;
142
+ /**
143
+ * The owner's harness chat on the App host shares model and thinking depth
144
+ * with the App, like any App session; an administrator's fixed route does not.
145
+ */
146
+ private sharedModel;
147
+ /** Record what an opened session runs as the chat's copy: the first capture, or a shared session's own record. */
148
+ private mirrorModel;
126
149
  /** The host's presets, from the live session when there is one. Undefined when the host offers none. */
127
150
  private permissionView;
128
151
  /** What this chat runs: the live session's preset, else the chat's saved choice. */
129
152
  private permissionChoice;
130
153
  /** Owner-only: switch this private chat's Harness permission preset, like the App's selector. */
131
154
  private permissionCommand;
132
- /** Bring a newly opened harness session to the chat's saved permission preset. */
155
+ /** Bring a newly opened harness session to the chat's choice, or a new one without a choice to the App's default. */
133
156
  private applyPermission;
157
+ /** A preset changed in the App on this chat's live session becomes the chat's choice, so new sessions keep it. */
158
+ private adoptPermission;
134
159
  private modelState;
135
160
  private modelCommand;
161
+ /**
162
+ * The management card for a command. `card` describes a click being shown on
163
+ * its own card: the switch in flight, its refusal, or a refresh of a stale card.
164
+ */
136
165
  private commandPanel;
137
166
  private reply;
138
167
  private artifactContext;