dsh-plugin-subagent-director 0.2.1 → 0.3.0-beta.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/CHANGELOG.md +60 -21
- package/LICENSE +21 -21
- package/README.md +80 -74
- package/cordis.patch.yml +11 -11
- package/lib/bridge-contract.d.ts +21 -0
- package/lib/bridge-contract.d.ts.map +1 -1
- package/lib/bridge-contract.js +4 -0
- package/lib/bridge-contract.js.map +1 -1
- package/lib/bridge-entry.d.ts +5 -1
- package/lib/bridge-entry.d.ts.map +1 -1
- package/lib/bridge-entry.js +6 -2
- package/lib/bridge-entry.js.map +1 -1
- package/lib/client/SubagentCloseAction.d.ts +32 -0
- package/lib/client/SubagentCloseAction.d.ts.map +1 -0
- package/lib/client/SubagentCloseAction.js +99 -0
- package/lib/client/SubagentCloseAction.js.map +1 -0
- package/lib/client/SubagentModelDock.d.ts +19 -9
- package/lib/client/SubagentModelDock.d.ts.map +1 -1
- package/lib/client/SubagentModelDock.js +79 -4
- package/lib/client/SubagentModelDock.js.map +1 -1
- package/lib/client/index.d.ts +5 -0
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +229 -10
- package/lib/client/index.js.map +1 -1
- package/lib/client/locales.d.ts +1 -1
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +16 -2
- package/lib/client/locales.js.map +1 -1
- package/lib/client/subagent-model.d.ts +13 -0
- package/lib/client/subagent-model.d.ts.map +1 -1
- package/lib/client/subagent-model.js +20 -0
- package/lib/client/subagent-model.js.map +1 -1
- package/lib/close-tool.d.ts +29 -0
- package/lib/close-tool.d.ts.map +1 -0
- package/lib/close-tool.js +60 -0
- package/lib/close-tool.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/lib/remote.d.ts +59 -3
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js +148 -10
- package/lib/remote.js.map +1 -1
- package/lib/route-resolver.d.ts +7 -0
- package/lib/route-resolver.d.ts.map +1 -1
- package/lib/route-resolver.js +10 -1
- package/lib/route-resolver.js.map +1 -1
- package/lib/settings.d.ts.map +1 -1
- package/lib/settings.js +10 -2
- package/lib/settings.js.map +1 -1
- package/package.json +113 -113
|
@@ -4,26 +4,36 @@
|
|
|
4
4
|
* Contributes a single ambient line to the `conversation.composer.dock` seat
|
|
5
5
|
* (the band under the composer card). When the current session is an
|
|
6
6
|
* addressed subagent child it shows the provider/model that child actually
|
|
7
|
-
* ran on
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* ran on:
|
|
8
|
+
* - fast path: the opened transcript's latest assistant message already
|
|
9
|
+
* records provenance/requestConfig (zero extra RPC — see subagent-model.ts);
|
|
10
|
+
* - fallback: current DSH runtimes do not populate those fields, so the
|
|
11
|
+
* dock asks the Host bridge for the child's last `request/header` event
|
|
12
|
+
* (`subagentModel` endpoint) and caches the answer per child session.
|
|
13
|
+
* When neither source proves a model it degrades to a short notice. Ordinary
|
|
14
|
+
* sessions render nothing, so the dock stays clean.
|
|
12
15
|
*
|
|
13
16
|
* The dock is an additive list slot declared by ui-conversation at runtime;
|
|
14
17
|
* we only contribute an occupant, never re-declare it. Our compile-time
|
|
15
18
|
* SlotMap augmentation in index.ts narrows the registration typing.
|
|
16
19
|
*/
|
|
20
|
+
import type { ClientConnectionRpc } from '@deepseek-ai/dsh-client-connection/client';
|
|
17
21
|
import type { ConversationSnapshot } from '@deepseek-ai/dsh-client-runtime/client';
|
|
18
|
-
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
22
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
19
23
|
/** Owner currency of the composer dock as ui-conversation declares it. */
|
|
20
24
|
export interface ComposerDockOwner {
|
|
21
25
|
readonly session: ConversationSnapshot | undefined;
|
|
26
|
+
readonly input: unknown;
|
|
22
27
|
}
|
|
23
|
-
/**
|
|
24
|
-
export
|
|
28
|
+
/** Business face injected by the registration (client/index.ts). */
|
|
29
|
+
export interface SubagentModelDockInjected {
|
|
30
|
+
/** Generic RPC caller for the /subagent-director bridge channel. */
|
|
31
|
+
rpc: ClientConnectionRpc;
|
|
32
|
+
}
|
|
33
|
+
/** Full props of the dock entry: runtime (owner session) + inject + locale. */
|
|
34
|
+
export type SubagentModelDockProps = PropsRuntime<'conversation.composer.dock'> & InjectFace<SubagentModelDockInjected> & PropsLocale<typeof NS>;
|
|
25
35
|
/** Locale namespace shared with the settings page (registered in index apply). */
|
|
26
36
|
export declare const NS: 'settings.subagentDirector';
|
|
27
37
|
/** Render the provider/model readout for an addressed subagent, or nothing. */
|
|
28
|
-
export declare function SubagentModelDock({ session, t, }: SubagentModelDockProps): React.JSX.Element | null;
|
|
38
|
+
export declare function SubagentModelDock({ session, rpc, t, }: SubagentModelDockProps): React.JSX.Element | null;
|
|
29
39
|
//# sourceMappingURL=SubagentModelDock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubagentModelDock.d.ts","sourceRoot":"","sources":["../../src/client/SubagentModelDock.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SubagentModelDock.d.ts","sourceRoot":"","sources":["../../src/client/SubagentModelDock.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAgB9F,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,oEAAoE;AACpE,MAAM,WAAW,yBAAyB;IACxC,oEAAoE;IACpE,GAAG,EAAE,mBAAmB,CAAC;CAC1B;AAED,+EAA+E;AAC/E,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,4BAA4B,CAAC,GAC7E,UAAU,CAAC,yBAAyB,CAAC,GACrC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;AAEzB,kFAAkF;AAClF,eAAO,MAAM,EAAE,EAAG,2BAAoC,CAAC;AA2BvD,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,GAAG,EACH,CAAC,GACF,EAAE,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CA4EnD"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Subagent Director — M3b observability dock readout.
|
|
4
|
+
*
|
|
5
|
+
* Contributes a single ambient line to the `conversation.composer.dock` seat
|
|
6
|
+
* (the band under the composer card). When the current session is an
|
|
7
|
+
* addressed subagent child it shows the provider/model that child actually
|
|
8
|
+
* ran on:
|
|
9
|
+
* - fast path: the opened transcript's latest assistant message already
|
|
10
|
+
* records provenance/requestConfig (zero extra RPC — see subagent-model.ts);
|
|
11
|
+
* - fallback: current DSH runtimes do not populate those fields, so the
|
|
12
|
+
* dock asks the Host bridge for the child's last `request/header` event
|
|
13
|
+
* (`subagentModel` endpoint) and caches the answer per child session.
|
|
14
|
+
* When neither source proves a model it degrades to a short notice. Ordinary
|
|
15
|
+
* sessions render nothing, so the dock stays clean.
|
|
16
|
+
*
|
|
17
|
+
* The dock is an additive list slot declared by ui-conversation at runtime;
|
|
18
|
+
* we only contribute an occupant, never re-declare it. Our compile-time
|
|
19
|
+
* SlotMap augmentation in index.ts narrows the registration typing.
|
|
20
|
+
*/
|
|
21
|
+
import { useEffect, useRef, useState } from 'react';
|
|
22
|
+
import { SUBAGENT_DIRECTOR_RPC_CHANNEL, SUBAGENT_DIRECTOR_RPC_MODEL, } from '../bridge-contract.js';
|
|
23
|
+
import { formatModelRef, isAddressedSubagent, latestSubagentModel, mergeModelLookup, } from './subagent-model.js';
|
|
3
24
|
/** Locale namespace shared with the settings page (registered in index apply). */
|
|
4
25
|
export const NS = 'settings.subagentDirector';
|
|
5
26
|
/** Inline styling using the shared token surface (no CSS pipeline; M2 deviation). */
|
|
@@ -19,12 +40,66 @@ const style = {
|
|
|
19
40
|
},
|
|
20
41
|
};
|
|
21
42
|
/** Render the provider/model readout for an addressed subagent, or nothing. */
|
|
22
|
-
export function SubagentModelDock({ session, t, }) {
|
|
43
|
+
export function SubagentModelDock({ session, rpc, t, }) {
|
|
44
|
+
const [query, setQuery] = useState({ status: 'idle' });
|
|
45
|
+
const cache = useRef(new Map());
|
|
46
|
+
const local = latestSubagentModel(session);
|
|
47
|
+
const childSessionId = session?.subagent?.address?.childSessionId;
|
|
48
|
+
const lastSeq = session && Array.isArray(session.nodes) && session.nodes.length > 0
|
|
49
|
+
? session.nodes[session.nodes.length - 1].seq ?? 0
|
|
50
|
+
: 0;
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!isAddressedSubagent(session)) {
|
|
53
|
+
setQuery({ status: 'idle' });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (local.found || childSessionId === undefined)
|
|
57
|
+
return;
|
|
58
|
+
const cached = cache.current.get(childSessionId);
|
|
59
|
+
if (cached !== undefined) {
|
|
60
|
+
setQuery(cached);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let alive = true;
|
|
64
|
+
setQuery({ status: 'querying' });
|
|
65
|
+
rpc
|
|
66
|
+
.call(SUBAGENT_DIRECTOR_RPC_CHANNEL, SUBAGENT_DIRECTOR_RPC_MODEL, { sessionId: childSessionId })
|
|
67
|
+
.then((result) => {
|
|
68
|
+
if (!alive)
|
|
69
|
+
return;
|
|
70
|
+
let next;
|
|
71
|
+
if (result.ok) {
|
|
72
|
+
const value = result.value;
|
|
73
|
+
next =
|
|
74
|
+
value.found === true
|
|
75
|
+
? { status: 'found', ref: { found: true, provider: value.provider, model: value.model } }
|
|
76
|
+
: { status: 'missing' };
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
next = { status: 'failed' };
|
|
80
|
+
}
|
|
81
|
+
cache.current.set(childSessionId, next);
|
|
82
|
+
setQuery(next);
|
|
83
|
+
})
|
|
84
|
+
.catch(() => {
|
|
85
|
+
if (!alive)
|
|
86
|
+
return;
|
|
87
|
+
const next = { status: 'failed' };
|
|
88
|
+
cache.current.set(childSessionId, next);
|
|
89
|
+
setQuery(next);
|
|
90
|
+
});
|
|
91
|
+
return () => {
|
|
92
|
+
alive = false;
|
|
93
|
+
};
|
|
94
|
+
// Re-query when the child gains new assistant messages (deps on the tail
|
|
95
|
+
// seq) or when the addressed child changes; cache short-circuits repeats.
|
|
96
|
+
}, [session?.sessionId, childSessionId, lastSeq, local.found, rpc]);
|
|
23
97
|
if (!isAddressedSubagent(session))
|
|
24
98
|
return null;
|
|
25
|
-
const
|
|
99
|
+
const remoteLookup = query.status === 'found' ? query.ref : { found: false };
|
|
100
|
+
const lookup = mergeModelLookup(local, remoteLookup);
|
|
26
101
|
if (!lookup.found) {
|
|
27
|
-
return (_jsx("div", { style: style.root, role: "status", children: t('modelNotRecorded') }));
|
|
102
|
+
return (_jsx("div", { style: style.root, role: "status", children: query.status === 'failed' ? t('modelQueryFailed') : t('modelNotRecorded') }));
|
|
28
103
|
}
|
|
29
104
|
const ref = lookup;
|
|
30
105
|
return (_jsxs("div", { style: style.root, role: "status", children: [_jsx("span", { children: t('modelRanOn') }), _jsx("span", { style: style.ref, title: t('modelRanOnTitle', { model: formatModelRef(ref) }), children: formatModelRef(ref) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubagentModelDock.js","sourceRoot":"","sources":["../../src/client/SubagentModelDock.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SubagentModelDock.js","sourceRoot":"","sources":["../../src/client/SubagentModelDock.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIpD,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAE5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GAGjB,MAAM,qBAAqB,CAAC;AAmB7B,kFAAkF;AAClF,MAAM,CAAC,MAAM,EAAE,GAAG,2BAAoC,CAAC;AAUvD,qFAAqF;AACrF,MAAM,KAAK,GAA2C;IACpD,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,iCAAiC;KACzC;IACD,GAAG,EAAE;QACH,KAAK,EAAE,kCAAkC;QACzC,UAAU,EAAE,wCAAwC;KACrD;CACF,CAAC;AAEF,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB,CAAC,EAChC,OAAO,EACP,GAAG,EACH,CAAC,GACsB;IACvB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAa,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,MAAM,KAAK,GAAG,MAAM,CAA0B,IAAI,GAAG,EAAE,CAAC,CAAC;IAEzD,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAA+B,CAAC,CAAC;IACnE,MAAM,cAAc,GAAG,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC;IAClE,MAAM,OAAO,GACX,OAAO,I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AK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,GACtE,CACP,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAqB,MAAM,CAAC;IACrC,OAAO,CACL,eAAK,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAC,QAAQ,aACnC,yBAAO,CAAC,CAAC,YAAY,CAAC,GAAQ,EAC9B,eAAM,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,YAChF,cAAc,CAAC,GAAG,CAAC,GACf,IACH,CACP,CAAC;AACJ,CAAC"}
|
package/lib/client/index.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
25
25
|
readonly input: unknown;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
/** Additive per-session header action row (ui-conversation seat). */
|
|
29
|
+
'conversation.session.header.actions': {
|
|
30
|
+
kind: 'list';
|
|
31
|
+
scope: 'session';
|
|
32
|
+
};
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
export { en, zh };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAIlG,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAA6B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,E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__ModuleLoader__.load({
|
|
|
82
82
|
"bridgeUnavailable": "The Subagent Director settings bridge is not available on this server. Please update/restart the web application so it installs the /subagent-director channel.",
|
|
83
83
|
"modelRanOn": "Subagent ran on",
|
|
84
84
|
"modelNotRecorded": "Subagent model not recorded yet",
|
|
85
|
-
"
|
|
85
|
+
"modelQueryFailed": "Subagent model unavailable",
|
|
86
|
+
"modelRanOnTitle": "Model route: {model}",
|
|
87
|
+
"closeContinuable": "Release subagent",
|
|
88
|
+
"closeContinuableTitle": "Release this continuable subagent (free its resident handle)",
|
|
89
|
+
"closingContinuable": "Releasing…",
|
|
90
|
+
"closedSubagent": "Released",
|
|
91
|
+
"confirmCloseContinuable": "Release continuable subagent “{id}”? It will stop being resident; you can no longer continue it with send_message.",
|
|
92
|
+
"closeFailed": "Release failed: {message}"
|
|
86
93
|
};
|
|
87
94
|
/** Chinese dictionary. */
|
|
88
95
|
const zh = {
|
|
@@ -134,7 +141,14 @@ window.__ModuleLoader__.load({
|
|
|
134
141
|
"bridgeUnavailable": "此服务器尚未提供 Subagent Director 设置桥接通道(/subagent-director)。请重启 Web 应用以安装该通道后再试。",
|
|
135
142
|
"modelRanOn": "子代理实际运行于",
|
|
136
143
|
"modelNotRecorded": "尚未记录到子代理模型",
|
|
137
|
-
"
|
|
144
|
+
"modelQueryFailed": "暂时无法获取子代理模型",
|
|
145
|
+
"modelRanOnTitle": "模型路由:{model}",
|
|
146
|
+
"closeContinuable": "终止可持续状态",
|
|
147
|
+
"closeContinuableTitle": "释放此可持续子代理(解除驻留句柄)",
|
|
148
|
+
"closingContinuable": "正在终止…",
|
|
149
|
+
"closedSubagent": "已终止",
|
|
150
|
+
"confirmCloseContinuable": "终止可持续子代理“{id}”?终止后将不再驻留,无法再用 send_message 继续它。",
|
|
151
|
+
"closeFailed": "终止失败:{message}"
|
|
138
152
|
};
|
|
139
153
|
//#endregion
|
|
140
154
|
//#region src/bridge-contract.ts
|
|
@@ -144,6 +158,10 @@ window.__ModuleLoader__.load({
|
|
|
144
158
|
const SUBAGENT_DIRECTOR_RPC_VIEW = "settingsView";
|
|
145
159
|
/** Endpoint that applies one path-op mutation. */
|
|
146
160
|
const SUBAGENT_DIRECTOR_RPC_MUTATE = "settingsMutate";
|
|
161
|
+
/** Endpoint that releases one resident continuable child of a live parent. */
|
|
162
|
+
const SUBAGENT_DIRECTOR_RPC_CLOSE = "subagentClose";
|
|
163
|
+
/** Endpoint that returns the actual provider/model of one child session. */
|
|
164
|
+
const SUBAGENT_DIRECTOR_RPC_MODEL = "subagentModel";
|
|
147
165
|
//#endregion
|
|
148
166
|
//#region src/client/store-logic.ts
|
|
149
167
|
/** Path of the roles map from the section root. */
|
|
@@ -1451,10 +1469,48 @@ window.__ModuleLoader__.load({
|
|
|
1451
1469
|
function formatModelRef(ref) {
|
|
1452
1470
|
return `${ref.provider}/${ref.model}`;
|
|
1453
1471
|
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Whether this session is a continuable child (the surface where the
|
|
1474
|
+
* "release sustained state" control is meaningful). Reads the catalog
|
|
1475
|
+
* address's mode; ordinary sessions and one-shot children are false.
|
|
1476
|
+
*/
|
|
1477
|
+
function isContinuableChild(snapshot) {
|
|
1478
|
+
if (snapshot === null || snapshot === void 0) return false;
|
|
1479
|
+
const address = snapshot.subagent?.address;
|
|
1480
|
+
return address !== void 0 && address !== null && address.mode === "continuable";
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* Merge a local snapshot-derived lookup with a remote (RPC) lookup: the local
|
|
1484
|
+
* provenance wins when present (the runtime's own record), otherwise the
|
|
1485
|
+
* remote result decides. Kept pure so the dock's data-source preference is
|
|
1486
|
+
* unit-testable without a wire.
|
|
1487
|
+
*/
|
|
1488
|
+
function mergeModelLookup(local, remote) {
|
|
1489
|
+
return local.found ? local : remote;
|
|
1490
|
+
}
|
|
1454
1491
|
//#endregion
|
|
1455
1492
|
//#region src/client/SubagentModelDock.tsx
|
|
1493
|
+
/**
|
|
1494
|
+
* Subagent Director — M3b observability dock readout.
|
|
1495
|
+
*
|
|
1496
|
+
* Contributes a single ambient line to the `conversation.composer.dock` seat
|
|
1497
|
+
* (the band under the composer card). When the current session is an
|
|
1498
|
+
* addressed subagent child it shows the provider/model that child actually
|
|
1499
|
+
* ran on:
|
|
1500
|
+
* - fast path: the opened transcript's latest assistant message already
|
|
1501
|
+
* records provenance/requestConfig (zero extra RPC — see subagent-model.ts);
|
|
1502
|
+
* - fallback: current DSH runtimes do not populate those fields, so the
|
|
1503
|
+
* dock asks the Host bridge for the child's last `request/header` event
|
|
1504
|
+
* (`subagentModel` endpoint) and caches the answer per child session.
|
|
1505
|
+
* When neither source proves a model it degrades to a short notice. Ordinary
|
|
1506
|
+
* sessions render nothing, so the dock stays clean.
|
|
1507
|
+
*
|
|
1508
|
+
* The dock is an additive list slot declared by ui-conversation at runtime;
|
|
1509
|
+
* we only contribute an occupant, never re-declare it. Our compile-time
|
|
1510
|
+
* SlotMap augmentation in index.ts narrows the registration typing.
|
|
1511
|
+
*/
|
|
1456
1512
|
/** Inline styling using the shared token surface (no CSS pipeline; M2 deviation). */
|
|
1457
|
-
const style = {
|
|
1513
|
+
const style$1 = {
|
|
1458
1514
|
root: {
|
|
1459
1515
|
display: "flex",
|
|
1460
1516
|
alignItems: "center",
|
|
@@ -1470,26 +1526,179 @@ window.__ModuleLoader__.load({
|
|
|
1470
1526
|
}
|
|
1471
1527
|
};
|
|
1472
1528
|
/** Render the provider/model readout for an addressed subagent, or nothing. */
|
|
1473
|
-
function SubagentModelDock({ session, t }) {
|
|
1529
|
+
function SubagentModelDock({ session, rpc, t }) {
|
|
1530
|
+
const [query, setQuery] = (0, react.useState)({ status: "idle" });
|
|
1531
|
+
const cache = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
1532
|
+
const local = latestSubagentModel(session);
|
|
1533
|
+
const childSessionId = session?.subagent?.address?.childSessionId;
|
|
1534
|
+
const lastSeq = session && Array.isArray(session.nodes) && session.nodes.length > 0 ? session.nodes[session.nodes.length - 1].seq ?? 0 : 0;
|
|
1535
|
+
(0, react.useEffect)(() => {
|
|
1536
|
+
if (!isAddressedSubagent(session)) {
|
|
1537
|
+
setQuery({ status: "idle" });
|
|
1538
|
+
return;
|
|
1539
|
+
}
|
|
1540
|
+
if (local.found || childSessionId === void 0) return;
|
|
1541
|
+
const cached = cache.current.get(childSessionId);
|
|
1542
|
+
if (cached !== void 0) {
|
|
1543
|
+
setQuery(cached);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
let alive = true;
|
|
1547
|
+
setQuery({ status: "querying" });
|
|
1548
|
+
rpc.call(SUBAGENT_DIRECTOR_RPC_CHANNEL, SUBAGENT_DIRECTOR_RPC_MODEL, { sessionId: childSessionId }).then((result) => {
|
|
1549
|
+
if (!alive) return;
|
|
1550
|
+
let next;
|
|
1551
|
+
if (result.ok) {
|
|
1552
|
+
const value = result.value;
|
|
1553
|
+
next = value.found === true ? {
|
|
1554
|
+
status: "found",
|
|
1555
|
+
ref: {
|
|
1556
|
+
found: true,
|
|
1557
|
+
provider: value.provider,
|
|
1558
|
+
model: value.model
|
|
1559
|
+
}
|
|
1560
|
+
} : { status: "missing" };
|
|
1561
|
+
} else next = { status: "failed" };
|
|
1562
|
+
cache.current.set(childSessionId, next);
|
|
1563
|
+
setQuery(next);
|
|
1564
|
+
}).catch(() => {
|
|
1565
|
+
if (!alive) return;
|
|
1566
|
+
const next = { status: "failed" };
|
|
1567
|
+
cache.current.set(childSessionId, next);
|
|
1568
|
+
setQuery(next);
|
|
1569
|
+
});
|
|
1570
|
+
return () => {
|
|
1571
|
+
alive = false;
|
|
1572
|
+
};
|
|
1573
|
+
}, [
|
|
1574
|
+
session?.sessionId,
|
|
1575
|
+
childSessionId,
|
|
1576
|
+
lastSeq,
|
|
1577
|
+
local.found,
|
|
1578
|
+
rpc
|
|
1579
|
+
]);
|
|
1474
1580
|
if (!isAddressedSubagent(session)) return null;
|
|
1475
|
-
const lookup =
|
|
1581
|
+
const lookup = mergeModelLookup(local, query.status === "found" ? query.ref : { found: false });
|
|
1476
1582
|
if (!lookup.found) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1477
|
-
style: style.root,
|
|
1583
|
+
style: style$1.root,
|
|
1478
1584
|
role: "status",
|
|
1479
|
-
children: t("modelNotRecorded")
|
|
1585
|
+
children: query.status === "failed" ? t("modelQueryFailed") : t("modelNotRecorded")
|
|
1480
1586
|
});
|
|
1481
1587
|
const ref = lookup;
|
|
1482
1588
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1483
|
-
style: style.root,
|
|
1589
|
+
style: style$1.root,
|
|
1484
1590
|
role: "status",
|
|
1485
1591
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelRanOn") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1486
|
-
style: style.ref,
|
|
1592
|
+
style: style$1.ref,
|
|
1487
1593
|
title: t("modelRanOnTitle", { model: formatModelRef(ref) }),
|
|
1488
1594
|
children: formatModelRef(ref)
|
|
1489
1595
|
})]
|
|
1490
1596
|
});
|
|
1491
1597
|
}
|
|
1492
1598
|
//#endregion
|
|
1599
|
+
//#region src/client/SubagentCloseAction.tsx
|
|
1600
|
+
/**
|
|
1601
|
+
* Subagent Director — "release sustained state" header action (issue #1).
|
|
1602
|
+
*
|
|
1603
|
+
* Contributes one button to the `conversation.session.header.actions` seat
|
|
1604
|
+
* (the additive per-session control row beside the session title). It renders
|
|
1605
|
+
* only while the CURRENT session is a continuable subagent child
|
|
1606
|
+
* (snapshot.subagent.address.mode === 'continuable') and otherwise returns
|
|
1607
|
+
* null, so ordinary sessions and one-shot children see nothing.
|
|
1608
|
+
*
|
|
1609
|
+
* Clicking asks the Host bridge's `subagentClose` endpoint to
|
|
1610
|
+
* drainContinuableChildren under the address's durable parent authority; on
|
|
1611
|
+
* success the button turns into a settled label (the child's handle is
|
|
1612
|
+
* released), on failure a short inline error shows the core message.
|
|
1613
|
+
*
|
|
1614
|
+
* The seat is a list slot declared by ui-conversation; the framework session
|
|
1615
|
+
* standard kit supplies `useSession`/`sessionId` (dsh-client-runtime merge),
|
|
1616
|
+
* the registration injects the RPC caller.
|
|
1617
|
+
*/
|
|
1618
|
+
/** Inline styling using the shared token surface (no CSS pipeline; M2 deviation). */
|
|
1619
|
+
const style = {
|
|
1620
|
+
wrap: {
|
|
1621
|
+
display: "inline-flex",
|
|
1622
|
+
alignItems: "center",
|
|
1623
|
+
gap: 8
|
|
1624
|
+
},
|
|
1625
|
+
button: {
|
|
1626
|
+
...dangerButtonStyle,
|
|
1627
|
+
height: 24,
|
|
1628
|
+
fontSize: 12,
|
|
1629
|
+
padding: "0 10px"
|
|
1630
|
+
},
|
|
1631
|
+
settled: {
|
|
1632
|
+
color: token.labelTertiary,
|
|
1633
|
+
fontSize: 12,
|
|
1634
|
+
lineHeight: "16px"
|
|
1635
|
+
},
|
|
1636
|
+
error: {
|
|
1637
|
+
color: token.danger,
|
|
1638
|
+
fontSize: 12,
|
|
1639
|
+
lineHeight: "16px",
|
|
1640
|
+
maxWidth: 260,
|
|
1641
|
+
overflow: "hidden",
|
|
1642
|
+
textOverflow: "ellipsis",
|
|
1643
|
+
whiteSpace: "nowrap"
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
/** Render the release-sustained-state button for a continuable child, or nothing. */
|
|
1647
|
+
function SubagentCloseAction({ useSession, sessionId, rpc, t }) {
|
|
1648
|
+
const session = useSession((s) => s);
|
|
1649
|
+
const [state, setState] = (0, react.useState)("idle");
|
|
1650
|
+
const [error, setError] = (0, react.useState)(null);
|
|
1651
|
+
(0, react.useEffect)(() => {
|
|
1652
|
+
setState("idle");
|
|
1653
|
+
setError(null);
|
|
1654
|
+
}, [sessionId]);
|
|
1655
|
+
if (!isContinuableChild(session)) return null;
|
|
1656
|
+
const address = session.subagent.address;
|
|
1657
|
+
const onClose = async () => {
|
|
1658
|
+
if (state === "closing") return;
|
|
1659
|
+
setState("closing");
|
|
1660
|
+
setError(null);
|
|
1661
|
+
try {
|
|
1662
|
+
const result = await rpc.call(SUBAGENT_DIRECTOR_RPC_CHANNEL, SUBAGENT_DIRECTOR_RPC_CLOSE, {
|
|
1663
|
+
parentSessionId: address.parentSessionId,
|
|
1664
|
+
childSessionId: address.childSessionId
|
|
1665
|
+
});
|
|
1666
|
+
if (result.ok) setState("closed");
|
|
1667
|
+
else {
|
|
1668
|
+
setState("failed");
|
|
1669
|
+
setError(result.error.message);
|
|
1670
|
+
}
|
|
1671
|
+
} catch {
|
|
1672
|
+
setState("failed");
|
|
1673
|
+
}
|
|
1674
|
+
};
|
|
1675
|
+
if (state === "closed") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1676
|
+
style: style.wrap,
|
|
1677
|
+
role: "status",
|
|
1678
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1679
|
+
style: style.settled,
|
|
1680
|
+
children: t("closedSubagent")
|
|
1681
|
+
})
|
|
1682
|
+
});
|
|
1683
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1684
|
+
style: style.wrap,
|
|
1685
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1686
|
+
type: "button",
|
|
1687
|
+
style: style.button,
|
|
1688
|
+
disabled: state === "closing",
|
|
1689
|
+
onClick: () => {
|
|
1690
|
+
if (typeof window === "undefined" || window.confirm(t("confirmCloseContinuable", { id: address.childSessionId }))) onClose();
|
|
1691
|
+
},
|
|
1692
|
+
title: t("closeContinuableTitle", { id: address.childSessionId }),
|
|
1693
|
+
children: state === "closing" ? t("closingContinuable") : t("closeContinuable")
|
|
1694
|
+
}), state === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1695
|
+
style: style.error,
|
|
1696
|
+
role: "alert",
|
|
1697
|
+
children: t("closeFailed", { message: error ?? "" })
|
|
1698
|
+
})]
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
//#endregion
|
|
1493
1702
|
//#region src/client/index.ts
|
|
1494
1703
|
/** Dictionary namespace owned by Subagent Director (bilingual, typed). */
|
|
1495
1704
|
const NS = "settings.subagentDirector";
|
|
@@ -1529,6 +1738,8 @@ window.__ModuleLoader__.load({
|
|
|
1529
1738
|
api: connection.api,
|
|
1530
1739
|
t
|
|
1531
1740
|
});
|
|
1741
|
+
const dockInjected = () => ({ rpc: connection.rpc });
|
|
1742
|
+
const closeInjected = () => ({ rpc: connection.rpc });
|
|
1532
1743
|
ctx.effect(() => {
|
|
1533
1744
|
const refresh = () => refreshIfLoaded(controller);
|
|
1534
1745
|
const disposers = [
|
|
@@ -1552,8 +1763,16 @@ window.__ModuleLoader__.load({
|
|
|
1552
1763
|
name: "conversation.composer.dock",
|
|
1553
1764
|
id: "subagent-director-model",
|
|
1554
1765
|
order: 90,
|
|
1555
|
-
locale: NS
|
|
1766
|
+
locale: NS,
|
|
1767
|
+
inject: dockInjected
|
|
1556
1768
|
}, SubagentModelDock));
|
|
1769
|
+
ctx.slots.inject("conversation.session.header.actions", () => ctx.slots.register({
|
|
1770
|
+
name: "conversation.session.header.actions",
|
|
1771
|
+
id: "subagent-director-close",
|
|
1772
|
+
order: 20,
|
|
1773
|
+
locale: NS,
|
|
1774
|
+
inject: closeInjected
|
|
1775
|
+
}, SubagentCloseAction));
|
|
1557
1776
|
}
|
|
1558
1777
|
//#endregion
|
|
1559
1778
|
exports.NS = NS;
|
package/lib/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,EAAE,EAA4B,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAA6B,MAAM,YAAY,CAAC;AAE7E,OAAO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,MAAM,CAAC,kBAAkB,EAAE,GAAG,EAAE,CACxC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAChB;QACE,IAAI,EAAE,kBAAkB;QACxB,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,GAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,QAAQ;KACjB,EACD,sBAAsB,CACvB,CACF,CAAC;IAEF,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,GAAG,EAAE,CAClD,GAAG,CAAC,KAAK,CAAC,QAAQ,CAChB;QACE,IAAI,EAAE,4BAA4B;QAClC,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,YAAY;KACrB,EACD,iBAAiB,CAClB,CACF,CAAC;IAEF,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qCAAqC,EAAE,GAAG,EAAE,CAC3D,GAAG,CAAC,KAAK,CAAC,QAAQ,CAChB;QACE,IAAI,EAAE,qCAAqC;QAC3C,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,aAAa;KACtB,EACD,mBAAmB,CACpB,CACF,CAAC;AACJ,CAAC"}
|
package/lib/client/locales.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ever reaches the runtime's bilingual balance check.
|
|
6
6
|
*/
|
|
7
7
|
/** Keys for the settings.subagentDirector namespace (bilingual, enforced). */
|
|
8
|
-
export type SubagentDirectorKey = 'nav' | 'sectionIntro' | 'defaultsHeading' | 'defaultsHint' | 'defaultProvider' | 'defaultModel' | 'defaultReasoningEffort' | 'restoreDefaults' | 'provider' | 'model' | 'reasoningEffort' | 'persona' | 'rolesHeading' | 'rolesHint' | 'addRole' | 'emptyRoles' | 'roleId' | 'roleDisplayName' | 'roleDescription' | 'rolePersona' | 'setDefaultRole' | 'defaultRoleBadge' | 'deleteRole' | 'confirmDeleteRole' | 'removeRoleDone' | 'addedRole' | 'roleUpdated' | 'conflict' | 'rejected' | 'fatal' | 'loadError' | 'readonly' | 'save' | 'cancel' | 'edit' | 'retry' | 'fallbackOnInvalid' | 'roleIdPlaceholder' | 'displayNamePlaceholder' | 'descriptionPlaceholder' | 'personaPlaceholder' | 'modelOptional' | 'providerMissing' | 'restoreDone' | 'invalidRoleId' | 'bridgeUnavailable' | 'modelRanOn' | 'modelNotRecorded' | 'modelRanOnTitle';
|
|
8
|
+
export type SubagentDirectorKey = 'nav' | 'sectionIntro' | 'defaultsHeading' | 'defaultsHint' | 'defaultProvider' | 'defaultModel' | 'defaultReasoningEffort' | 'restoreDefaults' | 'provider' | 'model' | 'reasoningEffort' | 'persona' | 'rolesHeading' | 'rolesHint' | 'addRole' | 'emptyRoles' | 'roleId' | 'roleDisplayName' | 'roleDescription' | 'rolePersona' | 'setDefaultRole' | 'defaultRoleBadge' | 'deleteRole' | 'confirmDeleteRole' | 'removeRoleDone' | 'addedRole' | 'roleUpdated' | 'conflict' | 'rejected' | 'fatal' | 'loadError' | 'readonly' | 'save' | 'cancel' | 'edit' | 'retry' | 'fallbackOnInvalid' | 'roleIdPlaceholder' | 'displayNamePlaceholder' | 'descriptionPlaceholder' | 'personaPlaceholder' | 'modelOptional' | 'providerMissing' | 'restoreDone' | 'invalidRoleId' | 'bridgeUnavailable' | 'modelRanOn' | 'modelNotRecorded' | 'modelQueryFailed' | 'modelRanOnTitle' | 'closeContinuable' | 'closeContinuableTitle' | 'closingContinuable' | 'closedSubagent' | 'confirmCloseContinuable' | 'closeFailed';
|
|
9
9
|
/** English dictionary ($subagentDirector). */
|
|
10
10
|
export declare const en: Record<SubagentDirectorKey, string>;
|
|
11
11
|
/** Chinese dictionary. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,wBAAwB,GACxB,iBAAiB,GACjB,UAAU,GACV,OAAO,GACP,iBAAiB,GACjB,SAAS,GACT,cAAc,GACd,WAAW,GACX,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,UAAU,GACV,UAAU,GACV,OAAO,GACP,WAAW,GACX,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,wBAAwB,GACxB,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,mBAAmB,GACnB,YAAY,GACZ,kBAAkB,GAClB,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,wBAAwB,GACxB,iBAAiB,GACjB,UAAU,GACV,OAAO,GACP,iBAAiB,GACjB,SAAS,GACT,cAAc,GACd,WAAW,GACX,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,UAAU,GACV,UAAU,GACV,OAAO,GACP,WAAW,GACX,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,wBAAwB,GACxB,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,mBAAmB,GACnB,YAAY,GACZ,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,uBAAuB,GACvB,oBAAoB,GACpB,gBAAgB,GAChB,yBAAyB,GACzB,aAAa,CAAC;AAElB,8CAA8C;AAC9C,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAyDlD,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAyDlD,CAAC"}
|
package/lib/client/locales.js
CHANGED
|
@@ -54,7 +54,14 @@ export const en = {
|
|
|
54
54
|
"bridgeUnavailable": "The Subagent Director settings bridge is not available on this server. Please update/restart the web application so it installs the /subagent-director channel.",
|
|
55
55
|
"modelRanOn": "Subagent ran on",
|
|
56
56
|
"modelNotRecorded": "Subagent model not recorded yet",
|
|
57
|
-
"
|
|
57
|
+
"modelQueryFailed": "Subagent model unavailable",
|
|
58
|
+
"modelRanOnTitle": "Model route: {model}",
|
|
59
|
+
"closeContinuable": "Release subagent",
|
|
60
|
+
"closeContinuableTitle": "Release this continuable subagent (free its resident handle)",
|
|
61
|
+
"closingContinuable": "Releasing…",
|
|
62
|
+
"closedSubagent": "Released",
|
|
63
|
+
"confirmCloseContinuable": "Release continuable subagent “{id}”? It will stop being resident; you can no longer continue it with send_message.",
|
|
64
|
+
"closeFailed": "Release failed: {message}"
|
|
58
65
|
};
|
|
59
66
|
/** Chinese dictionary. */
|
|
60
67
|
export const zh = {
|
|
@@ -106,6 +113,13 @@ export const zh = {
|
|
|
106
113
|
"bridgeUnavailable": "此服务器尚未提供 Subagent Director 设置桥接通道(/subagent-director)。请重启 Web 应用以安装该通道后再试。",
|
|
107
114
|
"modelRanOn": "子代理实际运行于",
|
|
108
115
|
"modelNotRecorded": "尚未记录到子代理模型",
|
|
109
|
-
"
|
|
116
|
+
"modelQueryFailed": "暂时无法获取子代理模型",
|
|
117
|
+
"modelRanOnTitle": "模型路由:{model}",
|
|
118
|
+
"closeContinuable": "终止可持续状态",
|
|
119
|
+
"closeContinuableTitle": "释放此可持续子代理(解除驻留句柄)",
|
|
120
|
+
"closingContinuable": "正在终止…",
|
|
121
|
+
"closedSubagent": "已终止",
|
|
122
|
+
"confirmCloseContinuable": "终止可持续子代理“{id}”?终止后将不再驻留,无法再用 send_message 继续它。",
|
|
123
|
+
"closeFailed": "终止失败:{message}"
|
|
110
124
|
};
|
|
111
125
|
//# sourceMappingURL=locales.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6DH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,EAAE,GAAwC;IACrD,KAAK,EAAE,mBAAmB;IAC1B,cAAc,EAAE,gIAAgI;IAChJ,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,0DAA0D;IAC1E,iBAAiB,EAAE,UAAU;IAC7B,cAAc,EAAE,OAAO;IACvB,wBAAwB,EAAE,kBAAkB;IAC5C,iBAAiB,EAAE,kBAAkB;IACrC,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,OAAO;IAChB,iBAAiB,EAAE,kBAAkB;IACrC,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,6FAA6F;IAC1G,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,6EAA6E;IAC3F,QAAQ,EAAE,SAAS;IACnB,iBAAiB,EAAE,cAAc;IACjC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AAO;IAC7B,gBAAgB,EAAE,KAAK;IACvB,yBAAyB,EAAE,gDAAgD;IAC3E,aAAa,EAAE,gBAAgB;CAChC,CAAC"}
|
|
@@ -44,4 +44,17 @@ export declare function isAddressedSubagent(snapshot: Pick<ConversationSnapshot,
|
|
|
44
44
|
* so the exact route stays readable in one line.
|
|
45
45
|
*/
|
|
46
46
|
export declare function formatModelRef(ref: SubagentModelRef): string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether this session is a continuable child (the surface where the
|
|
49
|
+
* "release sustained state" control is meaningful). Reads the catalog
|
|
50
|
+
* address's mode; ordinary sessions and one-shot children are false.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isContinuableChild(snapshot: Pick<ConversationSnapshot, 'subagent'> | null | undefined): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Merge a local snapshot-derived lookup with a remote (RPC) lookup: the local
|
|
55
|
+
* provenance wins when present (the runtime's own record), otherwise the
|
|
56
|
+
* remote result decides. Kept pure so the dock's data-source preference is
|
|
57
|
+
* unit-testable without a wire.
|
|
58
|
+
*/
|
|
59
|
+
export declare function mergeModelLookup(local: SubagentModelLookup, remote: SubagentModelLookup): SubagentModelLookup;
|
|
47
60
|
//# sourceMappingURL=subagent-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-model.d.ts","sourceRoot":"","sources":["../../src/client/subagent-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,oBAAoB,EAGpB,oBAAoB,EACrB,MAAM,wCAAwC,CAAC;AAEhD,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,E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AAI,CAwBzB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,GAClE,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,GAClE,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAErB"}
|
|
@@ -78,4 +78,24 @@ export function isAddressedSubagent(snapshot) {
|
|
|
78
78
|
export function formatModelRef(ref) {
|
|
79
79
|
return `${ref.provider}/${ref.model}`;
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether this session is a continuable child (the surface where the
|
|
83
|
+
* "release sustained state" control is meaningful). Reads the catalog
|
|
84
|
+
* address's mode; ordinary sessions and one-shot children are false.
|
|
85
|
+
*/
|
|
86
|
+
export function isContinuableChild(snapshot) {
|
|
87
|
+
if (snapshot === null || snapshot === undefined)
|
|
88
|
+
return false;
|
|
89
|
+
const address = snapshot.subagent?.address;
|
|
90
|
+
return address !== undefined && address !== null && address.mode === 'continuable';
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Merge a local snapshot-derived lookup with a remote (RPC) lookup: the local
|
|
94
|
+
* provenance wins when present (the runtime's own record), otherwise the
|
|
95
|
+
* remote result decides. Kept pure so the dock's data-source preference is
|
|
96
|
+
* unit-testable without a wire.
|
|
97
|
+
*/
|
|
98
|
+
export function mergeModelLookup(local, remote) {
|
|
99
|
+
return local.found ? local : remote;
|
|
100
|
+
}
|
|
81
101
|
//# sourceMappingURL=subagent-model.js.map
|