dsh-lark-agent 0.2.0 → 0.3.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/dist/replies.js CHANGED
@@ -157,15 +157,27 @@ const column = (elements, extra = {}) => ({
157
157
  tag: 'column', width: 'weighted', weight: 1, direction: 'vertical',
158
158
  vertical_spacing: '4px', padding: '0px', margin: '0px', elements, ...extra,
159
159
  });
160
+ const TONES = {
161
+ normal: { header: 'blue', background: 'grey-50', icon: 'info_outlined', color: 'grey' },
162
+ pending: { header: 'wathet', background: 'blue-50', icon: 'loading_outlined', color: 'blue' },
163
+ success: { header: 'green', background: 'green-50', icon: 'done_outlined', color: 'green' },
164
+ error: { header: 'red', background: 'red-50', icon: 'warning_outlined', color: 'red' },
165
+ muted: { header: 'grey', background: 'grey-50', icon: 'time_outlined', color: 'grey' },
166
+ };
160
167
  /** Trusted application panels only. Model strings never choose components or callback values. */
161
168
  export function renderPanel(panel) {
162
169
  const metrics = (panel.metrics ?? []).filter(metric => metric.label.trim() || metric.value.trim());
163
- const fallbackText = safePlainText([panel.title, panel.subtitle,
170
+ const fallbackText = safePlainText([panel.title, panel.subtitle, panel.status?.text,
164
171
  ...metrics.map(metric => [`${metric.label}:${metric.value}`, metric.note].filter(Boolean).join('\n')),
165
172
  ...panel.sections.map(section => [section.title, section.text].filter(Boolean).join('\n')), panel.note]
166
173
  .filter(Boolean).join('\n\n'));
167
174
  const elements = [];
168
175
  const actions = panel.actions ?? [];
176
+ if (panel.status?.text.trim()) {
177
+ const tone = TONES[panel.status.tone ?? 'normal'];
178
+ elements.push({ tag: 'column_set', flex_mode: 'none', margin: '0px', columns: [column([{ ...md(panel.status.text),
179
+ icon: { tag: 'standard_icon', token: tone.icon, color: tone.color } }], { background_style: tone.background, padding: '8px 12px 8px 12px' })] });
180
+ }
169
181
  for (let start = 0; start < metrics.length; start += 2) {
170
182
  elements.push({ tag: 'column_set', flex_mode: 'none', horizontal_spacing: '8px', margin: '0px',
171
183
  columns: metrics.slice(start, start + 2).map(metric => column([
@@ -206,8 +218,8 @@ export function renderPanel(panel) {
206
218
  for (let start = 0; start < actions.length; start += actionColumns) {
207
219
  elements.push({ tag: 'column_set', flex_mode: panel.actionColumns ? 'none' : 'flow', horizontal_spacing: '8px', margin: '0px', columns: actions.slice(start, start + actionColumns).map(action => column([
208
220
  { tag: 'button', text: title(plainLabel(action.label, panel.actionColumns === 1 ? 64 : 24)), type: action.primary ? 'primary' : 'default', width: 'fill', margin: '0px',
209
- behaviors: [{ type: 'callback', value: { ...action.value } }],
210
- ...(action.confirm ? {
221
+ ...(action.disabled ? { disabled: true } : { behaviors: [{ type: 'callback', value: { ...action.value } }] }),
222
+ ...(action.confirm && !action.disabled ? {
211
223
  icon: { tag: 'standard_icon', token: 'warning_outlined' },
212
224
  confirm: { title: title(plainLabel(action.confirm.title, 80)), text: title(plainLabel(action.confirm.text, 300)) },
213
225
  } : {}),
@@ -222,9 +234,10 @@ export function renderPanel(panel) {
222
234
  return { kind: 'text', text: fallbackText };
223
235
  const card = {
224
236
  schema: '2.0',
225
- config: { compact_width: false, width_mode: 'default', enable_forward: false, enable_forward_interaction: false,
237
+ // Shared from the start, so a click can update this same card in place.
238
+ config: { update_multi: true, compact_width: false, width_mode: 'default', enable_forward: false, enable_forward_interaction: false,
226
239
  enable_markdown_autolink: false, summary: { content: summary } },
227
- header: { template: 'blue', title: title(plainLabel(panel.title, 80)), padding: '10px 16px 10px 16px',
240
+ header: { template: TONES[panel.tone ?? 'normal'].header, title: title(plainLabel(panel.title, 80)), padding: '10px 16px 10px 16px',
228
241
  ...(panel.subtitle?.trim() ? { subtitle: title(safePlainText(panel.subtitle)), vertical_spacing: '4px' } : {}) },
229
242
  body: { direction: 'vertical', vertical_spacing: '8px', padding: '12px 16px 12px 16px', elements },
230
243
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-lark-agent",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Reach your DeepSeek Harness assistant from Feishu / Lark: a dsh plugin built on the official Lark CLI",
5
5
  "keywords": [
6
6
  "deepseek",
@@ -73,13 +73,13 @@
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@deepseek-ai/cordis": "4.0.1 || 4.0.5",
76
- "@deepseek-ai/dsh-agent": "0.1.1-rc.2 || 0.2.1-rc.2",
77
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2 || 0.2.1-rc.2",
78
- "@deepseek-ai/dsh-session": "0.1.1-rc.2 || 0.2.1-rc.2",
79
- "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2 || 0.2.1-rc.2",
80
- "@deepseek-ai/dsh-tools": "0.1.1-rc.2 || 0.2.1-rc.2",
76
+ "@deepseek-ai/dsh-agent": "0.1.1-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3",
77
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3",
78
+ "@deepseek-ai/dsh-session": "0.1.1-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3",
79
+ "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3",
80
+ "@deepseek-ai/dsh-tools": "0.1.1-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3",
81
81
  "@deepseek-ai/schemastery": "3.18.1 || 3.18.5",
82
- "@deepseek-ai/dsh-session-persistence": "0.1.1-rc.2 || 0.2.1-rc.2"
82
+ "@deepseek-ai/dsh-session-persistence": "0.1.1-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@deepseek-ai/cordis": "4.0.1",