@huanlin/dsh-plugin-yet-another-subagent 0.3.0 → 0.4.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.
@@ -1,61 +1,69 @@
1
- /**
2
- * RPC handler: profile list CRUD + tool list on a dedicated `/ya-subagent`
3
- * channel registered via `ctx.connection.rpc.handle('/ya-subagent', ...)`.
4
- *
5
- * A dedicated channel avoids the single-interceptor limit on the shared `/api`
6
- * channel (the Typert gateway owns that slot; staking it here would shadow
7
- * `commands/execute` and every other `/api` endpoint).
8
- *
9
- * Endpoints (all POST, payload shape noted):
10
- * - `profiles.list` payload: {} → { profiles: SubagentProfile[] }
11
- * - `profiles.add` payload: { profile: SubagentProfile } { profiles: ... } | error
12
- * - `profiles.update` payload: { profile: SubagentProfile } → { profiles: ... } | error
13
- * - `profiles.remove` payload: { id: string } → { profiles: ... } | error
14
- * - `tools.list` payload: {} → { tools: { name, description }[] }
15
- *
16
- * Returns the existing RpcResult shape; business errors use the `internal`
17
- * code with a descriptive message (the RpcError code union is closed; we do
18
- * not extend it for plugin-specific failures see design doc §3.5).
19
- *
20
- * @module @huanlin/dsh-plugin-yet-another-subagent/rpc
21
- */
22
- import type { Context } from 'cordis';
23
- import type { SubagentProfile } from './types.ts';
24
- import type { ProfileStore } from './profile-store.ts';
25
- import { type RepairStats } from './repair.ts';
26
- /** Wire shape for `profiles.list` responses. */
27
- export interface ProfileListResponse {
28
- readonly profiles: readonly SubagentProfile[];
29
- }
30
- /** Wire shape for `tools.list` responses. */
31
- export interface ToolListResponse {
32
- readonly tools: readonly {
33
- readonly name: string;
34
- readonly description: string;
35
- }[];
36
- }
37
- /** Wire shape for `profiles.add` request payload. */
38
- export interface ProfileAddPayload {
39
- readonly profile: SubagentProfile;
40
- }
41
- /** Wire shape for `profiles.update` request payload. */
42
- export interface ProfileUpdatePayload {
43
- readonly profile: SubagentProfile;
44
- }
45
- /** Wire shape for `profiles.remove` request payload. */
46
- export interface ProfileRemovePayload {
47
- readonly id: string;
48
- }
49
- /** All ya-subagent RPC endpoint result values. */
50
- export type YaSubagentValue = ProfileListResponse | ToolListResponse | RepairStats;
51
- /**
52
- * Register the ya-subagent RPC channel on the host's connection service.
53
- * `connection` is in the plugin's inject list, so `ctx.connection` is
54
- * directly available; the channel route rolls back on fiber disposal
55
- * (the inner `owner.effect` owns cleanup). Trust and browser authentication
56
- * moved to the physical `/api` carrier in v0.1.2-alpha.1, so channels no
57
- * longer carry an `authority` option.
58
- * @param ctx - host context.
59
- * @param store - profile store.
60
- */
61
- export declare function registerRpc(ctx: Context, store: ProfileStore): void;
1
+ /**
2
+ * RPC surface: profile list CRUD + tool list + session repair, exposed as
3
+ * exact Fetch routes on the shared `/api` channel via
4
+ * `ctx.connection.fetch.register(...)`.
5
+ *
6
+ * Why not a dedicated `rpc.handle` channel: the host-side dedicated-channel
7
+ * registry resolves `webServer` through the connection service's origin
8
+ * context chain, and the web profile mounts the webserver as a sibling
9
+ * loader row never an ancestor of client-connection — so every dedicated
10
+ * channel fails to register with `cannot get property "webServer" without
11
+ * inject`. Exact Fetch routes dispatch inside the already-mounted `/api`
12
+ * carrier instead (the dsh-client-file-upload pattern), inheriting its
13
+ * Host/Origin trust fence and browser authentication for free, and the
14
+ * shared `/api` interceptor slot stays owned by the Typert gateway.
15
+ *
16
+ * Wire endpoints (all POST; URL path `/api/ya-subagent.<endpoint>`, body and
17
+ * response use the Connection client-request / server-response envelopes):
18
+ * - `ya-subagent.profiles.list` payload: {} → { profiles: SubagentProfile[] }
19
+ * - `ya-subagent.profiles.add` payload: { profile: SubagentProfile } → { profiles: ... } | error
20
+ * - `ya-subagent.profiles.update` payload: { profile: SubagentProfile } → { profiles: ... } | error
21
+ * - `ya-subagent.profiles.remove` payload: { id: string } → { profiles: ... } | error
22
+ * - `ya-subagent.tools.list` payload: {} → { tools: { name, description }[] }
23
+ * - `ya-subagent.sessions.repair` payload: {} → RepairStats | error
24
+ *
25
+ * Returns the existing RpcResult shape; business errors use the `internal`
26
+ * code with a descriptive message (the RpcError code union is closed; we do
27
+ * not extend it for plugin-specific failures — see design doc §3.5).
28
+ *
29
+ * @module @huanlin/dsh-plugin-yet-another-subagent/rpc
30
+ */
31
+ import type { Context } from 'cordis';
32
+ import type { SubagentProfile } from './types.ts';
33
+ import type { ProfileStore } from './profile-store.ts';
34
+ import { type RepairStats } from './repair.ts';
35
+ /** Wire shape for `profiles.list` responses. */
36
+ export interface ProfileListResponse {
37
+ readonly profiles: readonly SubagentProfile[];
38
+ }
39
+ /** Wire shape for `tools.list` responses. */
40
+ export interface ToolListResponse {
41
+ readonly tools: readonly {
42
+ readonly name: string;
43
+ readonly description: string;
44
+ }[];
45
+ }
46
+ /** Wire shape for `profiles.add` request payload. */
47
+ export interface ProfileAddPayload {
48
+ readonly profile: SubagentProfile;
49
+ }
50
+ /** Wire shape for `profiles.update` request payload. */
51
+ export interface ProfileUpdatePayload {
52
+ readonly profile: SubagentProfile;
53
+ }
54
+ /** Wire shape for `profiles.remove` request payload. */
55
+ export interface ProfileRemovePayload {
56
+ readonly id: string;
57
+ }
58
+ /** All ya-subagent RPC endpoint result values. */
59
+ export type YaSubagentValue = ProfileListResponse | ToolListResponse | RepairStats;
60
+ /**
61
+ * Register the ya-subagent RPC routes on the host's connection service.
62
+ * `connection` is provided by the host; the routes roll back with the
63
+ * plugin fiber (each `fetch.register` disposer is collected by an effect).
64
+ * Trust and browser authentication live on the physical `/api` carrier, so
65
+ * the routes carry no authority options of their own.
66
+ * @param ctx - host context.
67
+ * @param store - profile store.
68
+ */
69
+ export declare function registerRpc(ctx: Context, store: ProfileStore): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanlin/dsh-plugin-yet-another-subagent",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -49,23 +49,23 @@
49
49
  }
50
50
  },
51
51
  "peerDependencies": {
52
- "@deepseek-ai/dsh-agent": "^0.1.2-rc.1",
53
- "@deepseek-ai/dsh-api-session-controller": "^0.1.2-rc.1",
54
- "@deepseek-ai/dsh-client-connection": "^0.1.2-rc.1",
55
- "@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
56
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-rc.1",
57
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-rc.1",
58
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.2-rc.1",
59
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1",
60
- "@deepseek-ai/dsh-client-ui-tool": "^0.1.2-rc.1",
61
- "@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
62
- "@deepseek-ai/dsh-session": "^0.1.2-rc.1",
63
- "@deepseek-ai/dsh-session-projection": "^0.1.2-rc.1",
64
- "@deepseek-ai/dsh-subagent": "^0.1.2-rc.1",
65
- "@deepseek-ai/dsh-jobs": "^0.1.2-rc.1",
66
- "@deepseek-ai/dsh-tools": "^0.1.2-rc.1",
67
- "@deepseek-ai/dsh-util-values": "^0.1.2-rc.1",
68
- "cordis": "^4.0.0-rc.7",
52
+ "@deepseek-ai/dsh-agent": "^0.1.5-rc.1",
53
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.1",
54
+ "@deepseek-ai/dsh-client-connection": "^0.1.5-rc.1",
55
+ "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.1",
56
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.1",
57
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.1",
58
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.1",
59
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.1",
60
+ "@deepseek-ai/dsh-client-ui-tool": "^0.1.5-rc.1",
61
+ "@deepseek-ai/dsh-jobs": "^0.1.5-rc.1",
62
+ "@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
63
+ "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
64
+ "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.1",
65
+ "@deepseek-ai/dsh-subagent": "^0.1.5-rc.1",
66
+ "@deepseek-ai/dsh-tools": "^0.1.5-rc.1",
67
+ "@deepseek-ai/dsh-util-values": "^0.1.5-rc.1",
68
+ "cordis": "^4.0.1",
69
69
  "react": "^18.2.0",
70
70
  "schemastery": "^3.18.0"
71
71
  },
@@ -132,6 +132,7 @@
132
132
  "@types/node": "^22.0.0",
133
133
  "@types/react": "~18.3.1",
134
134
  "lightningcss": "^1.33.0",
135
+ "schemastery": "^3.18.0",
135
136
  "tsdown": "^0.15.0",
136
137
  "typescript": "^5.9.0",
137
138
  "vitest": "^3.2.0",