@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.
- package/README.md +20 -10
- package/lib/client.js +3125 -3125
- package/lib/index.js +5703 -5656
- package/lib/types/client/SettingsPage.d.ts +67 -67
- package/lib/types/client/SubagentCard.d.ts +57 -57
- package/lib/types/client/SubagentTreeView.d.ts +64 -64
- package/lib/types/client/index.d.ts +29 -29
- package/lib/types/client/locales.d.ts +13 -13
- package/lib/types/index.d.ts +42 -42
- package/lib/types/projection.d.ts +200 -214
- package/lib/types/repair.d.ts +66 -66
- package/lib/types/rpc.d.ts +69 -61
- package/package.json +19 -18
package/lib/types/rpc.d.ts
CHANGED
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RPC
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
+
"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.
|
|
53
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.1.
|
|
54
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.
|
|
55
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-tool": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-session
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
67
|
-
"@deepseek-ai/dsh-util-values": "^0.1.
|
|
68
|
-
"cordis": "^4.0.
|
|
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",
|