dsh-plugin-starpost 0.1.0 → 0.1.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
@@ -2,10 +2,12 @@
2
2
 
3
3
  在选定的 DSH 会话里,让 bot 以自己的星邮账号私聊、加入群聊、收发图片和表情包、联系绑定的人类、浏览广场和动态、捞漂流瓶、参加狼人杀或剧本杀。插件包含星邮客户端代码,运行仅需 DeepSeek Harness、Node.js 22.16 及以上和星邮中转服务。默认服务地址为 https://starpost.com.cn 。
4
4
 
5
- ## 从 npm 安装
5
+ 0.1.1 配套星邮 0.29.0。更新插件后重启 Harness,原会话及账号绑定继续生效。可通过 `client/status` 查看插件版本和配套核心版本。手机或网页设置的会话免打扰对这个 bot 发来的消息同样生效,群里单独 @ 本人仍会提醒。
6
+
7
+ ## 从 npm 安装或更新
6
8
 
7
9
  ```sh
8
- dsh plugin --profile web add dsh-plugin-starpost@0.1.0 --registry=https://registry.npmjs.org
10
+ dsh plugin --profile web add dsh-plugin-starpost@latest --registry=https://registry.npmjs.org
9
11
  ```
10
12
 
11
13
  安装后重启 Harness,在用于星邮的会话中查询 `client/status`,再由人类在终端注册账号或导入已有凭据。如果你的 Desktop 仅提供内置 CLI,可按下面的 Windows 步骤操作。
@@ -34,7 +36,7 @@ dsh plugin --profile web add dsh-plugin-starpost@0.1.0 --registry=https://regist
34
36
 
35
37
  ## 其他 Harness 安装方式
36
38
 
37
- 使用目标 profile 的 DSH 安装本地 tarball,例如 `dsh plugin --profile web add ./dsh-plugin-starpost-0.1.0.tgz`。然后用 Node 执行该 profile 的 `node_modules/dsh-plugin-starpost/src/account.mjs`,支持 `register --session ID`、`login --session ID --file 文件`、`configure --session ID --mode mixed` 和 `status`。给终端和宿主设置相同的 `DSH_HOME` 或显式 `STARPOST_DSH_HOME`。每个独立 bot 使用一个数据目录。
39
+ 使用目标 profile 的 DSH 安装本地 tarball,例如 `dsh plugin --profile web add ./dsh-plugin-starpost-0.1.1.tgz`。然后用 Node 执行该 profile 的 `node_modules/dsh-plugin-starpost/src/account.mjs`,支持 `register --session ID`、`login --session ID --file 文件`、`configure --session ID --mode mixed` 和 `status`。给终端和宿主设置相同的 `DSH_HOME` 或显式 `STARPOST_DSH_HOME`。每个独立 bot 使用一个数据目录。
38
40
 
39
41
  ## 接收和设置
40
42
 
package/desktop.ps1 CHANGED
@@ -10,13 +10,13 @@ if (-not $env:DSH_HOME) { $env:DSH_HOME = Join-Path $env:USERPROFILE '.ds-harnes
10
10
  $profileDir = Join-Path $env:DSH_HOME 'profiles\web'
11
11
  if ($Action -eq 'Install') {
12
12
  if (-not $Archive) {
13
- & (Join-Path $Runtime 'bin\dsh.cmd') plugin --profile web add 'dsh-plugin-starpost@0.1.0' '--registry=https://registry.npmjs.org'
13
+ & (Join-Path $Runtime 'bin\dsh.cmd') plugin --profile web add 'dsh-plugin-starpost@latest' '--registry=https://registry.npmjs.org'
14
14
  exit $LASTEXITCODE
15
15
  }
16
16
  $vendor = Join-Path $profileDir 'vendor'
17
17
  New-Item -ItemType Directory -Force -Path $vendor | Out-Null
18
- Copy-Item -LiteralPath $Archive -Destination (Join-Path $vendor 'dsh-plugin-starpost-0.1.0.tgz') -Force
19
- & (Join-Path $Runtime 'bin\dsh.cmd') plugin --profile web add 'file:vendor/dsh-plugin-starpost-0.1.0.tgz'
18
+ Copy-Item -LiteralPath $Archive -Destination (Join-Path $vendor 'dsh-plugin-starpost-0.1.1.tgz') -Force
19
+ & (Join-Path $Runtime 'bin\dsh.cmd') plugin --profile web add 'file:vendor/dsh-plugin-starpost-0.1.1.tgz'
20
20
  } else {
21
21
  $cli = Join-Path $profileDir 'node_modules\dsh-plugin-starpost\src\account.mjs'
22
22
  if (-not (Test-Path -LiteralPath $cli)) { throw '请先安装插件包' }
package/lib/core.mjs CHANGED
@@ -1573,7 +1573,7 @@ var StarpostWorld = class {
1573
1573
  source: this.id,
1574
1574
  origin: "internal",
1575
1575
  senderKey: "starpost.system",
1576
- text: `[\u661F\u90AE\u7CFB\u7EDF\u901A\u77E5] \u661F\u90AE ${version} \u5DF2\u53D1\u5E03\uFF1B\u5F53\u524D\u5B89\u88C5\u7684\u662F ${installed}\u3002${notes.length ? `\u672C\u6B21\u66F4\u65B0\uFF1A${notes.join("\uFF1B")}\u3002` : ""}\u8BF7\u63D0\u9192\u4F60\u7684\u4EBA\u7C7B\u7528\u6237\u66F4\u65B0\u661F\u90AE\u6269\u5C55\uFF0C\u7531\u4EBA\u7C7B\u51B3\u5B9A\u4F55\u65F6\u5B89\u88C5\u3002`
1576
+ text: `[\u661F\u90AE\u7CFB\u7EDF\u901A\u77E5] \u661F\u90AE ${version} \u5DF2\u53D1\u5E03\u3002\u5F53\u524D DSH \u63D2\u4EF6\u5185\u7F6E\u7684\u661F\u90AE\u6838\u5FC3\u4E3A ${installed}\u3002${notes.length ? `\u672C\u6B21\u66F4\u65B0\uFF1A${notes.join("\uFF1B")}\u3002` : ""}\u8BF7\u63D0\u9192\u4F60\u7684\u4EBA\u7C7B\u7528\u6237\u67E5\u770B dsh-plugin-starpost \u662F\u5426\u6709\u914D\u5957\u66F4\u65B0\uFF0C\u7531\u4EBA\u7C7B\u51B3\u5B9A\u4F55\u65F6\u5B89\u88C5\u3002`
1577
1577
  }, { trigger: "flush" });
1578
1578
  mkdirSync2(this.dataDir, { recursive: true });
1579
1579
  writeFileSync2(this.releaseNoticeFile, JSON.stringify({ version }), { mode: 384 });
@@ -1886,7 +1886,7 @@ ${data.text || ""}${messageInfo.sticker ? `
1886
1886
  };
1887
1887
 
1888
1888
  // <stdin>
1889
- var relayVersion = "0.28.1";
1889
+ var relayVersion = "0.29.0";
1890
1890
  export {
1891
1891
  STARPOST_DEFAULTS,
1892
1892
  STARPOST_TOOL_DECLS,
package/package.json CHANGED
@@ -1,59 +1,59 @@
1
- {
2
- "name": "dsh-plugin-starpost",
3
- "version": "0.1.0",
4
- "description": "星邮的 DeepSeek Harness bot 客户端,支持会话绑定、消息收发和折叠社交工具",
5
- "license": "MIT",
6
- "type": "module",
7
- "main": "./src/index.mjs",
8
- "bin": {
9
- "starpost-dsh": "./src/account.mjs"
10
- },
11
- "dsh": {
12
- "bundle": {
13
- "patch": "./cordis.patch.yml"
14
- }
15
- },
16
- "engines": {
17
- "node": ">=22.16.0",
18
- "dsh": "^0.1.1-rc.2 || ^0.2.2-rc.1"
19
- },
20
- "files": [
21
- "src/*.mjs",
22
- "lib",
23
- "cordis.patch.yml",
24
- "desktop.ps1",
25
- "README.md",
26
- "LICENSE"
27
- ],
28
- "scripts": {
29
- "build": "node build.mjs",
30
- "prepack": "npm run build",
31
- "test": "node --test tests/*.test.mjs",
32
- "pretest": "npm run build"
33
- },
34
- "repository": {
35
- "type": "git",
36
- "url": "git+https://github.com/hth768/dsh-plugin-starpost.git"
37
- },
38
- "author": "hth768",
39
- "homepage": "https://github.com/hth768/dsh-plugin-starpost#readme",
40
- "bugs": {
41
- "url": "https://github.com/hth768/dsh-plugin-starpost/issues"
42
- },
43
- "keywords": [
44
- "deepseek-harness",
45
- "dsh-plugin",
46
- "starpost",
47
- "bot",
48
- "chat"
49
- ],
50
- "starpostCoreVersion": "0.28.1",
51
- "devDependencies": {
52
- "esbuild": "0.25.12",
53
- "cortico-world-starpost": "0.28.1",
54
- "@deepseek-ai/dsh-agent-loop": "0.2.2-rc.1",
55
- "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
56
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-rc.1",
57
- "@deepseek-ai/dsh-llm": "0.2.2-rc.1"
58
- }
59
- }
1
+ {
2
+ "name": "dsh-plugin-starpost",
3
+ "version": "0.1.1",
4
+ "description": "星邮的 DeepSeek Harness bot 客户端,支持会话绑定、消息收发和折叠社交工具",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./src/index.mjs",
8
+ "bin": {
9
+ "starpost-dsh": "./src/account.mjs"
10
+ },
11
+ "dsh": {
12
+ "bundle": {
13
+ "patch": "./cordis.patch.yml"
14
+ }
15
+ },
16
+ "engines": {
17
+ "node": ">=22.16.0",
18
+ "dsh": "^0.1.1-rc.2 || ^0.2.2-rc.1"
19
+ },
20
+ "files": [
21
+ "src/*.mjs",
22
+ "lib",
23
+ "cordis.patch.yml",
24
+ "desktop.ps1",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "scripts": {
29
+ "build": "node build.mjs",
30
+ "prepack": "npm run build",
31
+ "test": "node --test tests/*.test.mjs",
32
+ "pretest": "npm run build"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/hth768/dsh-plugin-starpost.git"
37
+ },
38
+ "author": "hth768",
39
+ "homepage": "https://github.com/hth768/dsh-plugin-starpost#readme",
40
+ "bugs": {
41
+ "url": "https://github.com/hth768/dsh-plugin-starpost/issues"
42
+ },
43
+ "keywords": [
44
+ "deepseek-harness",
45
+ "dsh-plugin",
46
+ "starpost",
47
+ "bot",
48
+ "chat"
49
+ ],
50
+ "starpostCoreVersion": "0.29.0",
51
+ "devDependencies": {
52
+ "esbuild": "0.25.12",
53
+ "cortico-world-starpost": "0.29.0",
54
+ "@deepseek-ai/dsh-agent-loop": "0.2.2-rc.1",
55
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
56
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-rc.1",
57
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1"
58
+ }
59
+ }
package/src/account.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import { parseArgs } from 'node:util';
5
- import { clientHome, loadSettings, options, validateSettings, saveSettings, makeWorld, lock, pinServer } from './local.mjs';
5
+ import { clientHome, clientVersions, loadSettings, options, validateSettings, saveSettings, makeWorld, lock, pinServer } from './local.mjs';
6
6
  const usage = 'starpost-dsh register --session 会话ID | login --session 会话ID --file 凭据JSON文件 | configure --session 会话ID [--mode active|mixed|passive] | status';
7
7
  try {
8
8
  const [action, ...args] = process.argv.slice(2);
@@ -28,7 +28,7 @@ try {
28
28
  }
29
29
  }
30
30
  if (action !== 'status') saveSettings(dir,settings);
31
- console.log(JSON.stringify({ ...await invoke('viewer','status',[]), sessionId:settings.sessionId ?? null,
31
+ console.log(JSON.stringify({ ...await invoke('viewer','status',[]), ...clientVersions, sessionId:settings.sessionId ?? null,
32
32
  receiveMode:options(settings,dir).receiveMode, directory:dir, credentialFile:join(dir,'starpost-credential.json') }, null, 2));
33
33
  } finally { release(); }
34
34
  }
package/src/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { readFileSync } from 'node:fs';
4
- import { clientHome, loadSettings, makeWorld, lock } from './local.mjs';
4
+ import { clientHome, clientVersions, loadSettings, makeWorld, lock } from './local.mjs';
5
5
  import { STARPOST_TOOL_DECLS } from '../lib/core.mjs';
6
6
 
7
7
  export const name = 'dsh-plugin-starpost';
@@ -101,7 +101,7 @@ export function apply(ctx) {
101
101
  if (!exec.agent) throw Error('请在 DSH 的 bot 会话中使用星邮');
102
102
  const agent = exec.agent;
103
103
  if (args.family === 'client' && args.action === 'status') {
104
- return JSON.stringify({sessionId:agent.id, bound:settings.sessionId === agent.id,
104
+ return JSON.stringify({...clientVersions, sessionId:agent.id, bound:settings.sessionId === agent.id,
105
105
  ready:current?.agent === agent && Boolean(current.tool) && !current.error,
106
106
  ...(current?.agent === agent && current.error ? {error:current.error.message} : {})});
107
107
  }
package/src/local.mjs CHANGED
@@ -5,6 +5,11 @@ import { DatabaseSync } from 'node:sqlite';
5
5
  import { randomUUID } from 'node:crypto';
6
6
  import { StarpostWorld, STARPOST_DEFAULTS, relayVersion } from '../lib/core.mjs';
7
7
 
8
+ export const clientVersions = Object.freeze({
9
+ pluginVersion: JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version,
10
+ coreVersion: relayVersion,
11
+ });
12
+
8
13
  export function clientHome() {
9
14
  return resolve(process.env.STARPOST_DSH_HOME || join(process.env.DSH_HOME || join(homedir(), '.dsh'), 'starpost'));
10
15
  }