@fish-under-sea/dsh-agent-teams-fish 2.1.0 → 2.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.en.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # @fish-under-sea/dsh-agent-teams-fish
2
2
 
3
- **2.1.0 · Upstream v0.1.30 synced · dsh-fish bundle member · Durable teams with Fish vendor artwork**
3
+ **2.1.1 · Upstream v0.1.30 synced · dsh-fish bundle member · Durable teams with Fish vendor artwork**
4
4
 
5
5
  [简体中文](README.md)
6
6
 
7
7
  ## Installation and Compatibility
8
8
 
9
- Since 2.1.0 this package lives in the [Fish-under-sea/dsh-fish](https://github.com/Fish-under-sea/dsh-fish) bundle repository as the workspace member `packages/dsh-agent-teams-fish`, built, versioned and released together with the other members; the former standalone repository no longer evolves separately.
9
+ Since 2.1.1 this package lives in the [Fish-under-sea/dsh-fish](https://github.com/Fish-under-sea/dsh-fish) bundle repository as the workspace member `packages/dsh-agent-teams-fish`, built, versioned and released together with the other members; the former standalone repository no longer evolves separately.
10
10
 
11
11
  ```sh
12
12
  # Bundle install (recommended, includes every member)
13
- dsh plugin --profile <profile> add @fish-under-sea/dsh-fish@2.1.0
13
+ dsh plugin --profile <profile> add @fish-under-sea/dsh-fish@2.1.1
14
14
 
15
15
  # Or install this member alone
16
- dsh plugin --profile <profile> add @fish-under-sea/dsh-agent-teams-fish@2.1.0
16
+ dsh plugin --profile <profile> add @fish-under-sea/dsh-agent-teams-fish@2.1.1
17
17
  ```
18
18
 
19
19
  The bundle already includes this member; do not mount twice. Restart DSH after installation. Requires Node `>=24.9`. Recommended Host: `0.2.2-rc.3`; older targets such as `0.2.2-rc.2` and `0.2.2-rc.1` remain supported. [compatibility.json](compatibility.json) is the exact support authority; desktop and core versions are distinct.
@@ -48,9 +48,9 @@ Maintainers decide when to build and check before a release. Runtime approvals a
48
48
 
49
49
  ## Attribution and History
50
50
 
51
- Based on [NanmiCoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams) (original author Relakkes / 程序员阿江). MIT. Upstream READMEs, NOTICE and release history are preserved. The source baseline follows upstream tag v0.1.30 (commit 4354b0f); since 2.1.0 the package is vendored into the dsh-fish bundle repository and versioned with it.
51
+ Based on [NanmiCoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams) (original author Relakkes / 程序员阿江). MIT. Upstream READMEs, NOTICE and release history are preserved. The source baseline follows upstream tag v0.1.30 (commit 4354b0f); since 2.1.1 the package is vendored into the dsh-fish bundle repository and versioned with it.
52
52
 
53
- - [2.1.0](release-notes/v2.1.0.md)
53
+ - [2.1.1](release-notes/v2.1.1.md)
54
54
  - [1.1.0](release-notes/v1.1.0.md)
55
55
  - [1.0.2](release-notes/v1.0.2.md)
56
56
  - [1.0.1](release-notes/v1.0.1.md)
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # @fish-under-sea/dsh-agent-teams-fish
2
2
 
3
- **2.1.0 · 同步上游 v0.1.30 · dsh-fish 聚合成员 · 持久团队协作与 Fish 厂商美术**
3
+ **2.1.1 · 同步上游 v0.1.30 · dsh-fish 聚合成员 · 持久团队协作与 Fish 厂商美术**
4
4
 
5
5
  [English](README.en.md)
6
6
 
7
7
  ## 安装与兼容
8
8
 
9
- 自 2.1.0 起,本包并入 [Fish-under-sea/dsh-fish](https://github.com/Fish-under-sea/dsh-fish) 聚合仓库,作为工作区成员 `packages/dsh-agent-teams-fish` 与其它成员统一构建、统一版本、统一发布;原独立仓库不再单独演进。
9
+ 自 2.1.1 起,本包并入 [Fish-under-sea/dsh-fish](https://github.com/Fish-under-sea/dsh-fish) 聚合仓库,作为工作区成员 `packages/dsh-agent-teams-fish` 与其它成员统一构建、统一版本、统一发布;原独立仓库不再单独演进。
10
10
 
11
11
  ```sh
12
12
  # 聚合安装(推荐,含全部成员)
13
- dsh plugin --profile <profile> add @fish-under-sea/dsh-fish@2.1.0
13
+ dsh plugin --profile <profile> add @fish-under-sea/dsh-fish@2.1.1
14
14
 
15
15
  # 或单独安装本成员
16
- dsh plugin --profile <profile> add @fish-under-sea/dsh-agent-teams-fish@2.1.0
16
+ dsh plugin --profile <profile> add @fish-under-sea/dsh-agent-teams-fish@2.1.1
17
17
  ```
18
18
 
19
19
  聚合已包含本成员,不要重复挂载。安装后重启 DSH。Node 要求 `>=24.9`。推荐宿主 `0.2.2-rc.3`;`0.2.2-rc.2`、`0.2.2-rc.1` 等旧版本仍在支持列表内。精确支持列表以 [compatibility.json](compatibility.json) 为唯一事实源,不以桌面应用版本推断核心版本。
@@ -48,9 +48,9 @@ pnpm --filter @fish-under-sea/dsh-agent-teams-fish verify
48
48
 
49
49
  ## 来源与记录
50
50
 
51
- 基于 [NanmiCoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams)(原作者 Relakkes / 程序员阿江)。MIT。保留上游 README、NOTICE 和历史发布说明。源码基线为上游 tag v0.1.30(commit 4354b0f);自 2.1.0 起并入 dsh-fish 聚合仓库,版本随聚合统一。
51
+ 基于 [NanmiCoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams)(原作者 Relakkes / 程序员阿江)。MIT。保留上游 README、NOTICE 和历史发布说明。源码基线为上游 tag v0.1.30(commit 4354b0f);自 2.1.1 起并入 dsh-fish 聚合仓库,版本随聚合统一。
52
52
 
53
- - [2.1.0](release-notes/v2.1.0.md)
53
+ - [2.1.1](release-notes/v2.1.1.md)
54
54
  - [1.1.0](release-notes/v1.1.0.md)
55
55
  - [1.0.2](release-notes/v1.0.2.md)
56
56
  - [1.0.1](release-notes/v1.0.1.md)
package/lib/index.js CHANGED
@@ -38,8 +38,23 @@ import { authenticatedWebRoutes, readJsonRequest, RequestBodyError, writeJsonWit
38
38
  const WEB_SERVER_KEYS = ['webServer', 'httpServer'];
39
39
  /** Workspace registry service key candidates, newest first. */
40
40
  const WORKSPACE_KEYS = ['workspaceRegistry', 'workspace'];
41
- function nativeTeamMode(ctx) {
42
- return ctx.agentTeams;
41
+ /** Resolve the optional native team-mode service without requiring injection. */
42
+ export function nativeTeamMode(ctx) {
43
+ // The native team-mode service is optional (older Hosts do not mount it), so
44
+ // it is intentionally not in `inject`. Reading `ctx.agentTeams` directly
45
+ // throws "cannot get property ... without inject" during tool-availability
46
+ // resolution; `ctx.get` is the inject-free lookup for optional services.
47
+ let get;
48
+ try {
49
+ get = ctx.get;
50
+ }
51
+ catch {
52
+ // A context with a guarded property trap still must not break tool assembly.
53
+ return undefined;
54
+ }
55
+ return typeof get === 'function'
56
+ ? get.call(ctx, 'agentTeams')
57
+ : undefined;
43
58
  }
44
59
  export const name = 'agent-teams';
45
60
  export const inject = ['tools', 'llm', 'subagents', 'systemPrompt', 'agents'];
@@ -20,8 +20,21 @@
20
20
  */
21
21
  import type { Context } from '@deepseek-ai/cordis';
22
22
  import z from '@deepseek-ai/schemastery';
23
+ import type { Agent } from '@deepseek-ai/dsh-agent';
23
24
  import { type TeamProfileConfig } from './profiles.ts';
24
25
  import { type MemberToolPolicy } from './tool-policies.ts';
26
+ /**
27
+ * Native 0.2.1-rc.3+ team-mode service (row id `agent-team`). It owns the
28
+ * durable per-Session `agentTeam` projection the model menu reads. Fish does
29
+ * not use its task tools or UI (those rows are disabled; Fish owns both), only
30
+ * the saved on/off switch, so the model-menu toggle can drive Fish AgentTeams.
31
+ */
32
+ interface NativeTeamModeService {
33
+ isEnabled(agent: Agent): boolean;
34
+ setEnabled(agent: Agent, enabled: boolean, signal?: AbortSignal): Promise<void>;
35
+ }
36
+ /** Resolve the optional native team-mode service without requiring injection. */
37
+ export declare function nativeTeamMode(ctx: Context): NativeTeamModeService | undefined;
25
38
  export declare const name = "agent-teams";
26
39
  export declare const inject: string[];
27
40
  /** Plugin configuration. */
@@ -110,3 +123,4 @@ export declare function resolveArtwork(name: string, options: {
110
123
  customArtDir?: string;
111
124
  }): Promise<ResolvedArtwork | undefined>;
112
125
  export declare function apply(ctx: Context, config: Config): void;
126
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fish-under-sea/dsh-agent-teams-fish",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "AgentTeams 多智能体团队协作(DeepSeek Harness 插件):自然语言组队、成员与任务依赖 DAG、信箱通信、右侧栏树状监测 —— 上游 NanmiCoder/dsh-agent-teams 的补充版,新增自定义美术目录、十八厂商头像(十个有厂商 × 岗位全套)与厂商商标徽标。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Regression: the optional native team-mode service must be looked up through
3
+ * `ctx.get`, never through the `ctx.agentTeams` property. Cordis throws
4
+ * "cannot get property \"agentTeams\" without inject" when an optional service
5
+ * is read as a property during tool-availability resolution, which broke every
6
+ * `agent_teams_*` tool in Hosts that mount neither the service nor our inject.
7
+ */
8
+ import assert from 'node:assert/strict'
9
+ import { test } from 'node:test'
10
+ import { nativeTeamMode } from '../lib/index.js'
11
+
12
+ const service = {
13
+ isEnabled: agent => agent.id === 'enabled-captain',
14
+ setEnabled: async () => undefined,
15
+ }
16
+
17
+ /** A Cordis-like context: only `get` is safe before an optional service is injected. */
18
+ function optionalServiceContext(value) {
19
+ return new Proxy({ get(name) { return name === 'agentTeams' ? value : undefined } }, {
20
+ get(target, property, receiver) {
21
+ if (property in target) return Reflect.get(target, property, receiver)
22
+ throw new Error(`cannot get property "${String(property)}" without inject`)
23
+ },
24
+ })
25
+ }
26
+
27
+ test('optional team-mode service is resolved through ctx.get without inject', () => {
28
+ const ctx = optionalServiceContext(service)
29
+ assert.equal(nativeTeamMode(ctx), service)
30
+ // The exact expression the tool `when` callback evaluates must not throw.
31
+ assert.doesNotThrow(() => nativeTeamMode(ctx)?.isEnabled({ id: 'enabled-captain' }))
32
+ assert.equal(nativeTeamMode(ctx)?.isEnabled({ id: 'enabled-captain' }), true)
33
+ assert.equal(nativeTeamMode(ctx)?.isEnabled({ id: 'other' }), false)
34
+ })
35
+
36
+ test('absent optional service resolves to undefined and remains legacy-enabled', () => {
37
+ const ctx = optionalServiceContext(undefined)
38
+ assert.equal(nativeTeamMode(ctx), undefined)
39
+ assert.doesNotThrow(() => nativeTeamMode(ctx)?.isEnabled({ id: 'any' }))
40
+ })
41
+
42
+ test('contexts without ctx.get never touch the service property', () => {
43
+ const ctx = new Proxy({}, { get(_target, property) {
44
+ throw new Error(`cannot get property "${String(property)}" without inject`)
45
+ } })
46
+ assert.equal(nativeTeamMode(ctx), undefined)
47
+ })
package/src/index.ts CHANGED
@@ -65,8 +65,22 @@ interface NativeTeamModeService {
65
65
  setEnabled(agent: Agent, enabled: boolean, signal?: AbortSignal): Promise<void>
66
66
  }
67
67
 
68
- function nativeTeamMode(ctx: Context): NativeTeamModeService | undefined {
69
- return (ctx as unknown as { agentTeams?: NativeTeamModeService }).agentTeams
68
+ /** Resolve the optional native team-mode service without requiring injection. */
69
+ export function nativeTeamMode(ctx: Context): NativeTeamModeService | undefined {
70
+ // The native team-mode service is optional (older Hosts do not mount it), so
71
+ // it is intentionally not in `inject`. Reading `ctx.agentTeams` directly
72
+ // throws "cannot get property ... without inject" during tool-availability
73
+ // resolution; `ctx.get` is the inject-free lookup for optional services.
74
+ let get: ((name: string) => unknown) | undefined
75
+ try {
76
+ get = (ctx as unknown as { get?: (name: string) => unknown }).get
77
+ } catch {
78
+ // A context with a guarded property trap still must not break tool assembly.
79
+ return undefined
80
+ }
81
+ return typeof get === 'function'
82
+ ? get.call(ctx, 'agentTeams') as NativeTeamModeService | undefined
83
+ : undefined
70
84
  }
71
85
 
72
86
  export const name = 'agent-teams'