@benz-ai-x/dsh-24pa 0.2.1-alpha.2.2 → 0.2.1-alpha.2.4

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
@@ -47,7 +47,7 @@ dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.1-alpha.1.6
47
47
 
48
48
  # dsh 0.2.1-alpha.2 host (preset synced to standard.patch.yml of that baseline;
49
49
  # the peer check rejects cross-baseline installs, so alpha.2 hosts need this line)
50
- dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.1-alpha.2.2
50
+ dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.1-alpha.2.4
51
51
 
52
52
  # dsh 0.2.0-rc.2 host — line frozen at 0.2.0-rc.2.3, no further releases (also add the two schedule companions for digests)
53
53
  dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.0-rc.2.3
@@ -194,6 +194,7 @@ These limits define when this assistant needs special operational care. They are
194
194
  This Dev Note is working context for maintainers: open questions and undecided directions. It is explicitly non-authoritative — shipped behavior and limits live in the sections above and in the package code.
195
195
 
196
196
  - **Multi-baseline verification** — regression runs select the runtime with `DSH_BIN` and append the rc.2 schedule companions with `PA24_E2E_EXTRA_PLUGINS`; the active baseline is 0.2.1-alpha.2 plain (156/156), while 0.2.0-rc.2 and 0.2.1-alpha.1 remain covered by the dual-API fallback paths.
197
+ - **Preset patch is generated** — `cordis.patch.yml` is produced by `scripts/sync-preset.mjs` from the `@deepseek-ai/dsh-web-app` standard preset pinned as a devDependency; never edit it by hand. On a new dsh baseline, bump the pin and run `npm run preset:sync`; `npm run preset:check` and unit tests fail when the checked-in copy drifts.
197
198
  - **Local harness adjacency** — dev type-checking links vendored peers from an adjacent `deepseek-harness` checkout through `scripts/link-peer.mjs`; registry installs never depend on that checkout.
198
199
 
199
200
  </details>
package/README.zh.md CHANGED
@@ -47,7 +47,7 @@ dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.1-alpha.1.6
47
47
 
48
48
  # dsh 0.2.1-alpha.2 宿主(预设已同步该基线的 standard.patch.yml;peer 检查拒绝
49
49
  # 跨基线安装,alpha.2 宿主须装此线)
50
- dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.1-alpha.2.2
50
+ dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.1-alpha.2.4
51
51
 
52
52
  # dsh 0.2.0-rc.2 宿主——该线已冻结于 0.2.0-rc.2.3、不再迭代(简报功能另需两个 schedule 伴随件)
53
53
  dsh plugin --profile <name> add @benz-ai-x/dsh-24pa@0.2.0-rc.2.3
@@ -194,6 +194,7 @@ dsh 0.2.0-rc.2 宿主上,安装上述 schedule 伴随件之前,简报与会
194
194
  本备注是面向维护者的工作上下文:待决问题与未定方向。它明确不具权威性——已交付的行为与限制以正文章节与包代码为准。
195
195
 
196
196
  - **多基线验证**——回归运行用 `DSH_BIN` 选运行时、`PA24_E2E_EXTRA_PLUGINS` 附加 rc.2 的 schedule 伴随件;当前活跃基线为 0.2.1-alpha.2 无附加(156/156),0.2.0-rc.2 与 0.2.1-alpha.1 由双 API 回退路径保持兼容。
197
+ - **预设补丁为生成物**——`cordis.patch.yml` 由 `scripts/sync-preset.mjs` 对 devDependency 钉住的 `@deepseek-ai/dsh-web-app` 标准预设应用 delta 生成,勿手改;换新 dsh 基线时先改 pin 再跑 `npm run preset:sync`,`npm run preset:check` 与单测守护已提交副本不漂移。
197
198
  - **本地 harness 相邻性**——dev 类型检查经 `scripts/link-peer.mjs` 从相邻的 `deepseek-harness` checkout 链接 vendored peers;registry 安装不依赖该 checkout。
198
199
 
199
200
  </details>
package/client.js CHANGED
@@ -299,7 +299,7 @@ window.__ModuleLoader__.load({
299
299
  } else if (tab === 'work') {
300
300
  const roleNames = { memo: '备忘整理' };
301
301
  const readyItems = (state.readiness?.items || []).map(item => {
302
- const labels = { host: '宿主', config: '配置', postgres: 'PostgreSQL', workspace: '工作区', feishu: '飞书接入', sessions: '固定会话' };
302
+ const labels = { host: '宿主', config: '配置', postgres: '业务账本', workspace: '工作区', feishu: '飞书接入', sessions: '固定会话' };
303
303
  const tier = item.state === 'ok' ? 'ok' : item.state === 'error' ? 'error' : 'warn';
304
304
  return h('div', { key: item.id, className: 'pa24-ready-item pa24-tone-' + STATUS[tier][1] },
305
305
  icon(STATUS[tier][2], { width: 17, height: 17 }),
@@ -404,7 +404,7 @@ window.__ModuleLoader__.load({
404
404
  if (next === null) return; e.preventDefault(); selectTab(tabItems[next][0]); e.currentTarget.parentElement.querySelectorAll('[role=tab]')[next].focus();
405
405
  } }, icon(name, { width: 17, height: 17 }), t(id)))),
406
406
  h('div', { id: 'pa24-content', role: 'tabpanel', 'aria-labelledby': 'pa24-tab-' + tab, tabIndex: 0 }, content),
407
- h('footer', { className: 'pa24-footer' }, icon('shield', { width: 13, height: 13 }), '数据保存在本机(PostgreSQL);配置与记忆通过对话维护,界面只显示真实结果。')));
407
+ h('footer', { className: 'pa24-footer' }, icon('shield', { width: 13, height: 13 }), '数据保存在本机(业务账本随工作区配置,默认 SQLite、可选 PostgreSQL);配置与记忆通过对话维护,界面只显示真实结果。')));
408
408
  }
409
409
 
410
410
  // F20: 企微接入面板模块——对标飞书接入:渠道配置、CLI 与身份、
package/cordis.patch.yml CHANGED
@@ -1,15 +1,21 @@
1
+ # GENERATED by packages/24pa/scripts/sync-preset.mjs from the
2
+ # @deepseek-ai/dsh-web-app standard preset (baseline 0.2.1-alpha.2).
3
+ # Do not edit by hand: run "npm run preset:sync" and commit the diff;
4
+ # "npm run preset:check" guards the checked-in copy against drift.
5
+ #
1
6
  # 24私助(24PA)formal bundle: one assistant preset plus the host plugin row.
2
7
  # The preset carries the full standard-mode capability base (persona merged into
3
8
  # the assistant identity), enables ralph / subagent_codex / subagent_claude_code,
4
- # and omits tool-schedule by design: reminders stay on the PostgreSQL ledger.
5
- # subagent_codex / subagent_claude_code mount only after their provider bundles
6
- # (@deepseek-ai/dsh-subagent-codex / -claude-code) are installed into the profile.
7
- # Synced to standard.patch.yml of dsh 0.2.1-alpha.2: plan-mode guidance wording,
8
- # persona cwd suffix removal, subagent spawn/fork backgroundMode back to package
9
- # defaults (upstream dropped the explicit continuable override). The ralph /
10
- # subagent_codex / subagent_claude_code rows stay enabled here by design:
11
- # alpha.2 moved them out of standard into the experimental catalog, but the
12
- # packages ship with the installation and keep resolving.
9
+ # and omits tool-schedule by design: reminders stay on the ledger, so the
10
+ # schedule toolFilter denies and modelSelectionSettings drop with it.
11
+ # tool-plugin-manager stays out (profile plugin management is not a pa24
12
+ # capability). subagent_codex / subagent_claude_code mount only after their
13
+ # provider bundles (@deepseek-ai/dsh-subagent-codex / -claude-code) are installed
14
+ # into the profile; the ralph / subagent_codex / subagent_claude_code rows stay
15
+ # enabled by design even where the baseline's own catalog moved them to
16
+ # experimental — the packages ship with the installation and keep resolving.
17
+ # The host plugin row below is pa24-owned and never derives
18
+ # from the standard preset.
13
19
  - insert:
14
20
  - id: pa24-preset
15
21
  name: '@deepseek-ai/dsh-agent-preset'
@@ -60,7 +66,7 @@
60
66
  name: '@deepseek-ai/dsh-plan-mode'
61
67
  config:
62
68
  section: |
63
- You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
69
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
64
70
 
65
71
  Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
66
72
 
package/lib/lock.js CHANGED
@@ -1,16 +1,25 @@
1
1
  import { open, readFile, rename, unlink } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
- // The dsh web Host has no built-in second-instance guard, so the plugin
4
- // refuses to become the active writer when another live process still holds
5
- // the state-directory lock (P01: a second active Host is rejected).
6
3
  export class HostAlreadyActive extends Error {
7
4
  holder;
8
5
  constructor(holder) {
9
- super(`已有活跃的24私助 Host(pid ${holder.pid},自 ${holder.startedAt} 运行);同一状态目录只允许一个写实例。`);
6
+ super(`已有活跃的24私助 Host(pid ${holder.pid},自 ${holder.startedAt} 运行` +
7
+ describeHolder(holder) +
8
+ `,锁文件 ${holder.path});同一状态目录只允许一个写实例。`);
10
9
  this.holder = holder;
11
10
  this.name = 'HostAlreadyActive';
12
11
  }
13
12
  }
13
+ function describeHolder(holder) {
14
+ const parts = [];
15
+ if (holder.argv?.length) {
16
+ const command = holder.argv.join(' ');
17
+ parts.push(`,命令「${command.length > 300 ? `${command.slice(0, 300)}…` : command}」`);
18
+ }
19
+ if (holder.cwd)
20
+ parts.push(`,工作目录 ${holder.cwd}`);
21
+ return parts.join('');
22
+ }
14
23
  function isAlive(pid) {
15
24
  try {
16
25
  process.kill(pid, 0);
@@ -22,7 +31,7 @@ function isAlive(pid) {
22
31
  }
23
32
  export async function acquireHostLock(stateDirectory) {
24
33
  const path = join(stateDirectory, 'host.lock');
25
- const record = { pid: process.pid, startedAt: new Date().toISOString() };
34
+ const record = { pid: process.pid, startedAt: new Date().toISOString(), argv: process.argv, cwd: process.cwd() };
26
35
  let handle;
27
36
  try {
28
37
  handle = await open(path, 'wx', 0o600);
@@ -39,7 +48,13 @@ export async function acquireHostLock(stateDirectory) {
39
48
  }
40
49
  const pid = Number(previous.pid);
41
50
  if (Number.isInteger(pid) && pid > 0 && isAlive(pid)) {
42
- throw new HostAlreadyActive({ pid, startedAt: String(previous.startedAt ?? '未知时间'), path });
51
+ throw new HostAlreadyActive({
52
+ pid,
53
+ startedAt: String(previous.startedAt ?? '未知时间'),
54
+ path,
55
+ ...(Array.isArray(previous.argv) ? { argv: previous.argv } : {}),
56
+ ...(typeof previous.cwd === 'string' ? { cwd: previous.cwd } : {}),
57
+ });
43
58
  }
44
59
  // Stale holder (crashed or unreadable record): archive and take over.
45
60
  await rename(path, `${path}.stale-${Date.now()}`).catch(() => { });
package/lib/runtime.js CHANGED
@@ -5516,7 +5516,7 @@ export class PaRuntime {
5516
5516
  ? `启动未完成:${this.startupError.message}`
5517
5517
  : this.closed
5518
5518
  ? '插件已停止'
5519
- : `24私助 Host 运行中(Node ${process.version},dsh ${versions.dsh},飞书 SDK ${versions.sdk})`,
5519
+ : `24私助 Host 运行中(Node ${process.version},dsh ${versions.dsh},24私助插件 ${versions.plugin},飞书 SDK ${versions.sdk})`,
5520
5520
  });
5521
5521
  items.push({
5522
5522
  id: 'config',
@@ -5614,7 +5614,7 @@ function resolveVersions() {
5614
5614
  return '未解析';
5615
5615
  }
5616
5616
  };
5617
- cachedVersions = { dsh: read('@deepseek-ai/dsh'), sdk: read('@larksuiteoapi/node-sdk') };
5617
+ cachedVersions = { dsh: read('@deepseek-ai/dsh'), sdk: read('@larksuiteoapi/node-sdk'), plugin: read('..') };
5618
5618
  return cachedVersions;
5619
5619
  }
5620
5620
  /** In-process fake used by tests and demo mode to exercise the real pipeline. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@benz-ai-x/dsh-24pa",
3
- "version": "0.2.1-alpha.2.2",
3
+ "version": "0.2.1-alpha.2.4",
4
4
  "description": "24私助(24PA): Feishu-backed personal assistant as a dsh workspace bundle.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -24,6 +24,8 @@
24
24
  "build": "tsc -p tsconfig.json",
25
25
  "test": "vitest run",
26
26
  "test:unit": "vitest run tests/unit",
27
+ "preset:sync": "node scripts/sync-preset.mjs",
28
+ "preset:check": "node scripts/sync-preset.mjs --check",
27
29
  "prepare": "node scripts/link-peer.mjs"
28
30
  },
29
31
  "dependencies": {
@@ -52,10 +54,12 @@
52
54
  }
53
55
  },
54
56
  "devDependencies": {
57
+ "@deepseek-ai/dsh-web-app": "0.2.1-alpha.2",
55
58
  "@types/node": "^22.10.0",
56
59
  "@types/pg": "8.11.10",
57
60
  "typescript": "^5.7.0",
58
- "vitest": "^2.1.0"
61
+ "vitest": "^2.1.0",
62
+ "yaml": "2.9.0"
59
63
  },
60
64
  "dsh": {
61
65
  "bundle": {