dsh-session-messaging 0.1.2 → 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 CHANGED
@@ -4,6 +4,22 @@ All notable changes to this project are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.2.0] - 2026-10-18
8
+
9
+ ### Changed
10
+
11
+ - **Cross-directory peers are allowed by default.** `session_peers` and
12
+ `session_send` now accept sessions whose working directory differs from the
13
+ sender's. Set `sameDirectoryOnly: true` in the plugin configuration to
14
+ restore the previous path restriction.
15
+ - The change is a minor release because it changes default delivery behavior:
16
+ review the peer-content trust boundary before enabling it in shared hosts.
17
+
18
+ ### Tests
19
+
20
+ - Integration coverage now exercises default cross-directory discovery and
21
+ delivery, plus an explicit `sameDirectoryOnly: true` policy test.
22
+
7
23
  ## [0.1.2] - 2026-10-18
8
24
 
9
25
  ### Fixed
package/README.md CHANGED
@@ -3,11 +3,12 @@
3
3
  Cross-session messaging for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh): let **user-launched sessions in the same workspace message each other** to coordinate tasks, declared file-write scopes, and conflicts — without turning them into parent/child subagents.
4
4
 
5
5
  [![CI](https://github.com/XBXyftx/dsh-session-messaging/actions/workflows/ci.yml/badge.svg)](https://github.com/XBXyftx/dsh-session-messaging/actions/workflows/ci.yml)
6
+ [![npm version](https://img.shields.io/npm/v/dsh-session-messaging.svg)](https://www.npmjs.com/package/dsh-session-messaging)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
8
 
8
9
  **English** | [简体中文](README.zh-CN.md)
9
10
 
10
- > Status: early preview (`0.1.0`). Targets dsh `0.2.1-rc.2`. dsh plugin APIs are pre-stable, so expect breaking changes on upstream upgrades.
11
+ > Status: early preview (`0.2.0`). Targets dsh `0.2.1-rc.2`. dsh plugin APIs are pre-stable, so expect breaking changes on upstream upgrades.
11
12
 
12
13
  ## Why
13
14
 
@@ -48,7 +49,7 @@ See [CHANGELOG.md](CHANGELOG.md) for the `0.1.2` entry.
48
49
  - Advisory **write-scope conflict detection**: if a peer declared an overlapping path, the receipt and the message envelope carry a `conflict-warning`.
49
50
  - No new Session event types and no `SESSION_FORMAT_VERSION` change: the relay is a durable `user/message` with a declared `session-message` source.
50
51
  - Bilingual plugin-card metadata and icons (English / 简体中文) for the dsh plugin manager.
51
- - Bounded: message size, per-sender→target rate limit, same-directory scope, top-level-only, live-only, self-send rejected.
52
+ - Bounded: message size, per-sender→target rate limit, top-level-only, live-only, self-send rejected. Cross-directory peers are allowed by default; `sameDirectoryOnly: true` restricts to one working directory.
52
53
 
53
54
  ## How it works
54
55
 
@@ -73,13 +74,21 @@ The envelope always states that the message comes from another session, not the
73
74
 
74
75
  ## Install
75
76
 
77
+ ### From npm (recommended)
78
+
79
+ ```sh
80
+ dsh plugin --profile <profile> add dsh-session-messaging
81
+ ```
82
+
83
+ The package is published as [`dsh-session-messaging`](https://www.npmjs.com/package/dsh-session-messaging) (latest `0.2.0`). For library use: `npm install dsh-session-messaging`.
84
+
76
85
  ### From GitHub
77
86
 
78
87
  ```sh
79
88
  dsh plugin --profile <profile> add github:XBXyftx/dsh-session-messaging
80
89
  ```
81
90
 
82
- The repository ships the built `lib/` output, so installing from git does **not** run a build. If you prefer a registry, `npm publish` from this repository produces the same package (`dsh-session-messaging`).
91
+ The repository ships the built `lib/` output, so a git install does not run a build.
83
92
 
84
93
  ### From a local checkout
85
94
 
@@ -130,7 +139,7 @@ The bundle row accepts validated configuration; every field has a default:
130
139
  maxMessageChars: 4000
131
140
  maxMessagesPerMinute: 12
132
141
  requireTargetOptIn: false # sessions are open to peers by default
133
- sameDirectoryOnly: true
142
+ sameDirectoryOnly: false
134
143
  allowSelfSend: false
135
144
  ```
136
145
 
@@ -141,7 +150,7 @@ The bundle row accepts validated configuration; every field has a default:
141
150
  - **Same process only.** Discovery uses `ctx.agents`; a session that is not live cannot receive a message in this version. Cold-session delivery and cross-process/cross-host messaging are not implemented.
142
151
  - **Advisory scopes, not locks.** dsh has optimistic filesystem version guards (`FS_STALE_VERSION`) but no file locking. `writeScopes` and `conflict-warning` are coordination aids; Bash, formatters, and code generators bypass them.
143
152
  - **In-memory state.** Reception pauses and declared scopes live for the plugin's lifetime and reset on reload/restart.
144
- - **Same working directory by default.** Set `sameDirectoryOnly: false` only if you understand cross-project implications.
153
+ - **Cross-directory by default.** Sessions in different working directories can message each other. Set `sameDirectoryOnly: true` to restore a path boundary; peer content remains untrusted either way.
145
154
  - **No GUI extension.** Messages render as ordinary user messages; a dedicated title/icon for the `session-message` source would require a client plugin or an upstream `ui-chat` change.
146
155
 
147
156
  ## Development
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [English](README.md) | **简体中文**
6
6
 
7
- > 状态:早期预览(`0.1.0`),适配 dsh `0.2.1-rc.2`。dsh 插件 API 仍为 pre-stable,上游升级可能带来破坏性变更。
7
+ > 状态:早期预览(`0.2.0`),适配 dsh `0.2.1-rc.2`。dsh 插件 API 仍为 pre-stable,上游升级可能带来破坏性变更。
8
8
 
9
9
  ## 为什么需要
10
10
 
@@ -45,7 +45,7 @@ macOS 桌面客户端(`0.2.1-rc.2`)真实运行:另一个用户启动的
45
45
  - 建议性**写范围冲突检测**:与 peer 声明重叠时,回执与消息信封带 `conflict-warning`。
46
46
  - 不新增 Session 事件类型、不改 `SESSION_FORMAT_VERSION`:消息就是带 `session-message` source 的 `user/message`。
47
47
  - 插件管理卡片提供中英双语标题、简介与图标(English / 简体中文)。
48
- - 有边界:长度上限、每 sender→target 限频、同目录、仅顶层、仅 live、拒绝自发送。
48
+ - 有边界:长度上限、每 sender→target 限频、仅顶层、仅 live、拒绝自发送。默认允许跨目录对等会话;`sameDirectoryOnly: true` 可收紧为同工作目录。
49
49
 
50
50
  ## 工作原理
51
51
 
@@ -70,13 +70,21 @@ macOS 桌面客户端(`0.2.1-rc.2`)真实运行:另一个用户启动的
70
70
 
71
71
  ## 安装
72
72
 
73
+ ### 从 npm 安装(推荐)
74
+
75
+ ```sh
76
+ dsh plugin --profile <profile> add dsh-session-messaging
77
+ ```
78
+
79
+ 包已发布为 [`dsh-session-messaging`](https://www.npmjs.com/package/dsh-session-messaging)(最新 `0.2.0`)。库用法:`npm install dsh-session-messaging`。
80
+
73
81
  ### 从 GitHub 安装
74
82
 
75
83
  ```sh
76
84
  dsh plugin --profile <profile> add github:XBXyftx/dsh-session-messaging
77
85
  ```
78
86
 
79
- 仓库包含构建好的 `lib/`,从 git 安装**不需要**额外构建。发布到 npm 后也可用包名 `dsh-session-messaging` 安装。
87
+ 仓库包含构建好的 `lib/`,从 git 安装不需要额外构建。
80
88
 
81
89
  ### 本地目录安装
82
90
 
@@ -125,7 +133,7 @@ dsh plugin --profile <profile> add /absolute/path/to/dsh-session-messaging
125
133
  maxMessageChars: 4000
126
134
  maxMessagesPerMinute: 12
127
135
  requireTargetOptIn: false # 默认对 peer 开放
128
- sameDirectoryOnly: true
136
+ sameDirectoryOnly: false
129
137
  allowSelfSend: false
130
138
  ```
131
139
 
@@ -136,7 +144,7 @@ dsh plugin --profile <profile> add /absolute/path/to/dsh-session-messaging
136
144
  - **仅同进程**:发现依赖 `ctx.agents`,非 live 会话本版无法接收;冷会话投递与跨进程/跨机器通信未实现。
137
145
  - **写范围只是建议,不是锁**:dsh 只有乐观版本守卫(`FS_STALE_VERSION`),没有文件锁;Bash、格式化器、代码生成器会绕过写范围提示。
138
146
  - **状态在内存**:暂停接收与写范围声明随插件生命周期存在,重载/重启后重置。
139
- - **默认同目录**:除非理解跨项目影响,否则不要关闭 `sameDirectoryOnly`。
147
+ - **默认允许跨目录**:不同工作目录的会话也可以互发消息。设置 `sameDirectoryOnly: true` 可恢复路径边界;无论是否限制,peer 内容都不可信。
140
148
  - **无 GUI 扩展**:消息按普通 user 消息显示;`session-message` 的专属标题/图标需要 client 插件或上游 `ui-chat` 改动。
141
149
 
142
150
  ## 开发
package/lib/config.d.ts CHANGED
@@ -13,7 +13,7 @@ export interface SessionMessagingConfig {
13
13
  readonly maxMessagesPerMinute: number;
14
14
  /** Require the target session to opt in before it can receive peer messages. Off by default: sessions are mutually visible and can message each other unless they pause reception. */
15
15
  readonly requireTargetOptIn: boolean;
16
- /** Only allow peers whose working directory equals the sender's. */
16
+ /** Restrict peers to the sender's working directory. Off by default: cross-directory peers are allowed. */
17
17
  readonly sameDirectoryOnly: boolean;
18
18
  /** Allow a session to relay to itself (diagnostics only; off by default). */
19
19
  readonly allowSelfSend: boolean;
package/lib/config.js CHANGED
@@ -11,6 +11,6 @@ export const Config = Schema.object({
11
11
  maxMessageChars: Schema.number().min(1).default(DEFAULT_MAX_MESSAGE_CHARS),
12
12
  maxMessagesPerMinute: Schema.number().min(1).default(DEFAULT_MAX_MESSAGES_PER_MINUTE),
13
13
  requireTargetOptIn: Schema.boolean().default(false),
14
- sameDirectoryOnly: Schema.boolean().default(true),
14
+ sameDirectoryOnly: Schema.boolean().default(false),
15
15
  allowSelfSend: Schema.boolean().default(false),
16
16
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-messaging",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Peer messaging between user-launched sessions in one workspace: discover peers, relay coordination messages, pause reception, and get advisory write-scope conflict warnings.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -77,7 +77,7 @@
77
77
  "build": "tsc -p tsconfig.build.json",
78
78
  "typecheck": "tsc -p tsconfig.json",
79
79
  "test": "node --experimental-strip-types --test tests/protocol.test.ts",
80
- "test:integration": "node --experimental-strip-types tests/integration-smoke.ts",
80
+ "test:integration": "node --experimental-strip-types tests/integration-smoke.ts && node --experimental-strip-types tests/directory-policy-smoke.ts",
81
81
  "test:model-e2e": "node --experimental-strip-types tests/model-e2e-smoke.ts"
82
82
  },
83
83
  "dsh": {