@wowyuarm/dsh-agent-team 0.1.14-alpha.2 → 0.1.15
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 +6 -4
- package/README.zh.md +6 -4
- package/cordis.patch.yml +3 -1
- package/package.json +51 -46
- package/packages/agent-team/README.md +2 -2
- package/packages/agent-team/README.zh.md +2 -2
- package/packages/agent-team/core-skills/member-memory-manager/SKILL.md +30 -0
- package/packages/agent-team/lib/context-continuity-host.js +90 -0
- package/packages/agent-team/lib/context-projection.js +266 -489
- package/packages/agent-team/lib/context-source.js +4 -72
- package/packages/agent-team/lib/human-avatar.js +61 -0
- package/packages/agent-team/lib/human-profile.js +157 -0
- package/packages/agent-team/lib/human-update-check.js +119 -0
- package/packages/agent-team/lib/index.js +464 -254
- package/packages/agent-team/lib/ledger.js +120 -15
- package/packages/agent-team/lib/member-context.js +6 -3
- package/packages/agent-team/lib/member-runtime.js +1 -1
- package/packages/agent-team/lib/pressure-policy.js +6 -1
- package/packages/agent-team/lib/typert.host.js +489 -33
- package/packages/agent-team/lib/typert.remote-client.d.ts +15 -3
- package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
- package/packages/agent-team/lib/typert.remote-client.js +250 -28
- package/packages/agent-team/lib/types/context-continuity-host.d.ts +84 -0
- package/packages/agent-team/lib/types/context-continuity-host.d.ts.map +1 -0
- package/packages/agent-team/lib/types/context-projection.d.ts +130 -185
- package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -1
- package/packages/agent-team/lib/types/context-source.d.ts +4 -35
- package/packages/agent-team/lib/types/context-source.d.ts.map +1 -1
- package/packages/agent-team/lib/types/human-avatar.d.ts +29 -0
- package/packages/agent-team/lib/types/human-avatar.d.ts.map +1 -0
- package/packages/agent-team/lib/types/human-profile.d.ts +116 -0
- package/packages/agent-team/lib/types/human-profile.d.ts.map +1 -0
- package/packages/agent-team/lib/types/human-update-check.d.ts +73 -0
- package/packages/agent-team/lib/types/human-update-check.d.ts.map +1 -0
- package/packages/agent-team/lib/types/index.d.ts +153 -41
- package/packages/agent-team/lib/types/index.d.ts.map +1 -1
- package/packages/agent-team/lib/types/ledger.d.ts +31 -2
- package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
- package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
- package/packages/agent-team/lib/types/pressure-policy.d.ts +6 -0
- package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types/entities.d.ts +17 -0
- package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
- package/packages/agent-team/lib/types/types/requests-results.d.ts +81 -0
- package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
- package/packages/client-agent-team/README.md +1 -1
- package/packages/client-agent-team/README.zh.md +1 -1
- package/packages/client-agent-team/lib/client.js +1545 -303
- package/packages/client-agent-team/lib/client.js.map +1 -1
- package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts +15 -0
- package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/HumanSettingsSection.js +115 -0
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +6 -2
- package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts +22 -1
- package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamAvatarStack.js +25 -2
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts +6 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +67 -29
- package/packages/client-agent-team/lib/types/client/TeamComposer.js +2 -2
- package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +1 -1
- package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamConversation.js +12 -5
- package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts +4 -1
- package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamInboxPage.js +22 -7
- package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts +11 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +66 -5
- package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts +18 -3
- package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamMessage.js +213 -67
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +5 -0
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +52 -26
- package/packages/client-agent-team/lib/types/client/avatar-image.d.ts +21 -0
- package/packages/client-agent-team/lib/types/client/avatar-image.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/avatar-image.js +9 -0
- package/packages/client-agent-team/lib/types/client/human-identity.d.ts +90 -0
- package/packages/client-agent-team/lib/types/client/human-identity.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/human-identity.js +96 -0
- package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/index.js +76 -4
- package/packages/client-agent-team/lib/types/client/locales.d.ts +72 -2
- package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/locales.js +78 -2
- package/packages/client-agent-team/lib/types/client/refs.d.ts +71 -0
- package/packages/client-agent-team/lib/types/client/refs.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/refs.js +181 -0
- package/packages/client-agent-team/lib/types/client/slots.d.ts +9 -3
- package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +57 -9
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
- package/packages/client-agent-team/lib/types/client/team-formatters.js +85 -17
- package/packages/tool-agent-team/README.md +2 -2
- package/packages/tool-agent-team/README.zh.md +2 -2
- package/packages/tool-agent-team/lib/context-tools.js +20 -6
- package/packages/tool-agent-team/lib/index.js +2 -2
- package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -1
- package/packages/agent-team/lib/context-management.js +0 -371
- package/packages/agent-team/lib/types/context-management.d.ts +0 -154
- package/packages/agent-team/lib/types/context-management.d.ts.map +0 -1
- package/packages/client-agent-team/lib/types/client/task-refs.d.ts +0 -31
- package/packages/client-agent-team/lib/types/client/task-refs.d.ts.map +0 -1
- package/packages/client-agent-team/lib/types/client/task-refs.js +0 -99
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
export function useAvatarImage(url) {
|
|
3
|
+
const [broken, setBroken] = useState(undefined);
|
|
4
|
+
return {
|
|
5
|
+
src: url === undefined || url === broken ? undefined : url,
|
|
6
|
+
failed: () => { if (url !== undefined)
|
|
7
|
+
setBroken(url); },
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import type { AgentTeamHumanProfileResult } from '@wowyuarm/dsh-agent-team/types';
|
|
3
|
+
/**
|
|
4
|
+
* The Client's one projection of the Human identity.
|
|
5
|
+
*
|
|
6
|
+
* The durable facts live in the Host: the display name and the avatar
|
|
7
|
+
* reference in the Team Host row's own Config, the avatar bytes in the
|
|
8
|
+
* persistent avatar store. This store is the only place the Team Client reads
|
|
9
|
+
* them, so every seat that names or draws the Human — message rows, member
|
|
10
|
+
* refs, mention chips, the settings page — shows one rename and one face, and a
|
|
11
|
+
* single refresh after a write moves all of them together. Writes go back
|
|
12
|
+
* through the Host's `setHumanProfile` Remote, which owns the profile entry the
|
|
13
|
+
* Client would otherwise have to name.
|
|
14
|
+
*
|
|
15
|
+
* Seats render before the first read settles; `name` stays undefined until then
|
|
16
|
+
* and every caller falls back to its own localized name for the Human. Reads
|
|
17
|
+
* are demand-driven: the first subscriber starts the read, so a Client that
|
|
18
|
+
* never opens Team mode or the profile page never calls the Remote.
|
|
19
|
+
*/
|
|
20
|
+
/** One read of the Human identity, replaced wholesale on every change. */
|
|
21
|
+
export interface TeamHumanIdentitySnapshot {
|
|
22
|
+
/**
|
|
23
|
+
* `loading` until the first read settles, `ready` while an accepted value
|
|
24
|
+
* stands (also when a later refresh failed), `unavailable` when no value was
|
|
25
|
+
* ever accepted — the one state that hands the page a retry.
|
|
26
|
+
*/
|
|
27
|
+
readonly status: 'loading' | 'ready' | 'unavailable';
|
|
28
|
+
/** Host-resolved display name; undefined before the first accepted read. */
|
|
29
|
+
readonly name?: string | undefined;
|
|
30
|
+
/** Configured avatar reference; undefined means the identity fallback is the avatar. */
|
|
31
|
+
readonly avatarRef?: string | undefined;
|
|
32
|
+
/** Avatar bytes as a data URL for `<img>`; undefined renders the fallback. */
|
|
33
|
+
readonly avatarUrl?: string | undefined;
|
|
34
|
+
/** Bundle version for the settings footnote. */
|
|
35
|
+
readonly version?: string | undefined;
|
|
36
|
+
/** Repository home the footnote links to. */
|
|
37
|
+
readonly repoUrl?: string | undefined;
|
|
38
|
+
readonly updateAvailable: boolean;
|
|
39
|
+
readonly latestVersion?: string | undefined;
|
|
40
|
+
/** Last failure, kept beside the last accepted value so a page can report it. */
|
|
41
|
+
readonly error?: string | undefined;
|
|
42
|
+
}
|
|
43
|
+
/** Read-side face every consumer binds: the seats' hook and the settings page alike. */
|
|
44
|
+
export interface TeamHumanIdentitySource {
|
|
45
|
+
getSnapshot(): TeamHumanIdentitySnapshot;
|
|
46
|
+
subscribe(listener: () => void): () => void;
|
|
47
|
+
}
|
|
48
|
+
/** The settings page's extra face: re-read after a failed or superseded read. */
|
|
49
|
+
export interface TeamHumanIdentityFace extends TeamHumanIdentitySource {
|
|
50
|
+
refresh(): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
/** Host calls the store reads through; one loader per Client context. */
|
|
53
|
+
export interface TeamHumanIdentityLoader {
|
|
54
|
+
loadProfile: () => Promise<RemoteResult<AgentTeamHumanProfileResult>>;
|
|
55
|
+
/** Resolve one avatar reference to a displayable URL; null falls back to the initial. */
|
|
56
|
+
loadAvatarUrl: (avatarRef: string) => Promise<string | null>;
|
|
57
|
+
}
|
|
58
|
+
export declare class TeamHumanIdentity implements TeamHumanIdentityFace {
|
|
59
|
+
private snapshot;
|
|
60
|
+
private readonly listeners;
|
|
61
|
+
private reading;
|
|
62
|
+
private readonly loader;
|
|
63
|
+
constructor(loader: TeamHumanIdentityLoader);
|
|
64
|
+
readonly getSnapshot: () => TeamHumanIdentitySnapshot;
|
|
65
|
+
/**
|
|
66
|
+
* Observe the identity, starting the first read when nobody has read yet.
|
|
67
|
+
* @param listener - invoked after every snapshot replacement.
|
|
68
|
+
* @returns the disposer removing this listener.
|
|
69
|
+
*/
|
|
70
|
+
readonly subscribe: (listener: () => void) => (() => void);
|
|
71
|
+
/**
|
|
72
|
+
* Re-read the Host projection. Concurrent callers share one round trip, and a
|
|
73
|
+
* failed refresh keeps the last accepted value beside the reported error —
|
|
74
|
+
* the seats never blank out because a background read failed.
|
|
75
|
+
* @returns settlement of this read (or of the read already in flight).
|
|
76
|
+
*/
|
|
77
|
+
refresh(): Promise<void>;
|
|
78
|
+
dispose(): void;
|
|
79
|
+
private read;
|
|
80
|
+
/**
|
|
81
|
+
* Record one read failure. A value that was already accepted stays on screen
|
|
82
|
+
* (the seats never blank out over a background read), and only an identity
|
|
83
|
+
* that never loaded becomes `unavailable` — the state that offers a retry.
|
|
84
|
+
*/
|
|
85
|
+
private fail;
|
|
86
|
+
private commit;
|
|
87
|
+
}
|
|
88
|
+
/** Subscribe one rendered seat to the identity. */
|
|
89
|
+
export declare function useHumanIdentity(identity: TeamHumanIdentitySource): TeamHumanIdentitySnapshot;
|
|
90
|
+
//# sourceMappingURL=human-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human-identity.d.ts","sourceRoot":"","sources":["../../../src/client/human-identity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF;;;;;;;;;;;;;;;;GAgBG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,aAAa,CAAA;IACpD,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,wFAAwF;IACxF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3C,iFAAiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,wFAAwF;AACxF,MAAM,WAAW,uBAAuB;IACtC,WAAW,IAAI,yBAAyB,CAAA;IACxC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,iFAAiF;AACjF,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAED,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,2BAA2B,CAAC,CAAC,CAAA;IACrE,yFAAyF;IACzF,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAC7D;AAID,qBAAa,iBAAkB,YAAW,qBAAqB;IAC7D,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwB;IAClD,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;gBAEpC,MAAM,EAAE,uBAAuB;IAI3C,QAAQ,CAAC,WAAW,QAAO,yBAAyB,CAAiB;IAErE;;;;OAIG;IACH,QAAQ,CAAC,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAIxD;IAED;;;;;OAKG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IASxB,OAAO,IAAI,IAAI;YAID,IAAI;IAkClB;;;;OAIG;IACH,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,MAAM;CAIf;AAED,mDAAmD;AACnD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,yBAAyB,CAE7F"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
const INITIAL = { status: 'loading', updateAvailable: false };
|
|
3
|
+
export class TeamHumanIdentity {
|
|
4
|
+
snapshot = INITIAL;
|
|
5
|
+
listeners = new Set();
|
|
6
|
+
reading;
|
|
7
|
+
loader;
|
|
8
|
+
constructor(loader) {
|
|
9
|
+
this.loader = loader;
|
|
10
|
+
}
|
|
11
|
+
getSnapshot = () => this.snapshot;
|
|
12
|
+
/**
|
|
13
|
+
* Observe the identity, starting the first read when nobody has read yet.
|
|
14
|
+
* @param listener - invoked after every snapshot replacement.
|
|
15
|
+
* @returns the disposer removing this listener.
|
|
16
|
+
*/
|
|
17
|
+
subscribe = (listener) => {
|
|
18
|
+
this.listeners.add(listener);
|
|
19
|
+
if (this.snapshot.status === 'loading' && this.reading === undefined)
|
|
20
|
+
void this.refresh();
|
|
21
|
+
return () => { this.listeners.delete(listener); };
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Re-read the Host projection. Concurrent callers share one round trip, and a
|
|
25
|
+
* failed refresh keeps the last accepted value beside the reported error —
|
|
26
|
+
* the seats never blank out because a background read failed.
|
|
27
|
+
* @returns settlement of this read (or of the read already in flight).
|
|
28
|
+
*/
|
|
29
|
+
refresh() {
|
|
30
|
+
if (this.reading !== undefined)
|
|
31
|
+
return this.reading;
|
|
32
|
+
const reading = this.read().finally(() => {
|
|
33
|
+
if (this.reading === reading)
|
|
34
|
+
this.reading = undefined;
|
|
35
|
+
});
|
|
36
|
+
this.reading = reading;
|
|
37
|
+
return reading;
|
|
38
|
+
}
|
|
39
|
+
dispose() {
|
|
40
|
+
this.listeners.clear();
|
|
41
|
+
}
|
|
42
|
+
async read() {
|
|
43
|
+
let profile;
|
|
44
|
+
try {
|
|
45
|
+
const result = await this.loader.loadProfile();
|
|
46
|
+
if (!result.ok) {
|
|
47
|
+
this.fail(result.error.message);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
profile = result.value;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
// A dropped connection surfaces as a thrown carrier error, not a result:
|
|
54
|
+
// both are read failures and both keep whatever value already stands.
|
|
55
|
+
this.fail(error instanceof Error ? error.message : String(error));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
// Bytes are immutable per reference, so one fetch serves every later
|
|
59
|
+
// refresh that still carries the same avatar.
|
|
60
|
+
const avatarUrl = profile.avatarRef === undefined
|
|
61
|
+
? undefined
|
|
62
|
+
: profile.avatarRef === this.snapshot.avatarRef && this.snapshot.avatarUrl !== undefined
|
|
63
|
+
? this.snapshot.avatarUrl
|
|
64
|
+
: (await this.loader.loadAvatarUrl(profile.avatarRef)) ?? undefined;
|
|
65
|
+
this.commit({
|
|
66
|
+
status: 'ready',
|
|
67
|
+
name: profile.name,
|
|
68
|
+
...(profile.avatarRef === undefined ? {} : { avatarRef: profile.avatarRef }),
|
|
69
|
+
...(avatarUrl === undefined ? {} : { avatarUrl }),
|
|
70
|
+
version: profile.version,
|
|
71
|
+
repoUrl: profile.repoUrl,
|
|
72
|
+
updateAvailable: profile.updateAvailable,
|
|
73
|
+
...(profile.latestVersion === undefined ? {} : { latestVersion: profile.latestVersion }),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Record one read failure. A value that was already accepted stays on screen
|
|
78
|
+
* (the seats never blank out over a background read), and only an identity
|
|
79
|
+
* that never loaded becomes `unavailable` — the state that offers a retry.
|
|
80
|
+
*/
|
|
81
|
+
fail(message) {
|
|
82
|
+
const held = this.snapshot;
|
|
83
|
+
this.commit(held.name === undefined
|
|
84
|
+
? { ...held, status: 'unavailable', error: message }
|
|
85
|
+
: { ...held, status: 'ready', error: message });
|
|
86
|
+
}
|
|
87
|
+
commit(snapshot) {
|
|
88
|
+
this.snapshot = snapshot;
|
|
89
|
+
for (const listener of this.listeners)
|
|
90
|
+
listener();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Subscribe one rendered seat to the identity. */
|
|
94
|
+
export function useHumanIdentity(identity) {
|
|
95
|
+
return useSyncExternalStore(identity.subscribe, identity.getSnapshot, identity.getSnapshot);
|
|
96
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AA6CnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK5C,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAEnD,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC9F,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIhD,eAAO,MAAM,MAAM,UAElB,CAAA;AAuBD,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,IAAI,EAAE,OAAO,CAAA;KACd;CACF;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,cAAc,EAAE,cAAc,CAAA;QAC9B,UAAU,EAAE,cAAc,CAAA;KAC3B;CACF;AAsQD,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7D"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import agentTeamRemote from '@wowyuarm/dsh-agent-team/remote';
|
|
2
|
+
import { HumanSettingsSection } from "./HumanSettingsSection.js";
|
|
3
|
+
import { TeamHumanIdentity } from "./human-identity.js";
|
|
4
|
+
import { bytesToBase64 } from "./attachment-preview.js";
|
|
2
5
|
import { TeamNavigation } from "./navigation.js";
|
|
3
6
|
import { TeamChangeStream, TeamReadStream } from "./team-changes.js";
|
|
4
7
|
import { TeamDraftStore } from "./drafts.js";
|
|
@@ -31,7 +34,7 @@ function currentMainSessionId(ctx) {
|
|
|
31
34
|
* target.
|
|
32
35
|
*/
|
|
33
36
|
const openedMemberSessions = new WeakMap();
|
|
34
|
-
function registerModeShadow(ctx, navigation, changes, reads, drafts, name, component, extraInject,
|
|
37
|
+
function registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, name, component, extraInject,
|
|
35
38
|
// Keyed seats (`main`) address one panel by key; the reserved 'conversation'
|
|
36
39
|
// key is where the shipped Conversation registers, so the Team seat shadows
|
|
37
40
|
// that same panel instead of adding a second one.
|
|
@@ -58,6 +61,7 @@ entryKey) {
|
|
|
58
61
|
subscribeReads: (listener) => reads.subscribe(listener),
|
|
59
62
|
subscribeChanges: (scope, listener) => changes.subscribe(scope, listener),
|
|
60
63
|
drafts,
|
|
64
|
+
humanIdentity,
|
|
61
65
|
loadMembers: (request) => ctx.remote.agentTeam.members(request),
|
|
62
66
|
joinChannel: (request) => ctx.remote.agentTeam.joinChannel(request),
|
|
63
67
|
removeChannelMember: (request) => ctx.remote.agentTeam.removeChannelMember(request),
|
|
@@ -111,6 +115,7 @@ entryKey) {
|
|
|
111
115
|
changeTask: (request) => ctx.remote.agentTeam.changeTask(request),
|
|
112
116
|
promoteThread: (request) => ctx.remote.agentTeam.promoteThread(request),
|
|
113
117
|
resolveTaskRefs: (request) => ctx.remote.agentTeam.resolveTaskRefs(request),
|
|
118
|
+
resolveThreadRefs: (request) => ctx.remote.agentTeam.resolveThreadRefs(request),
|
|
114
119
|
} : {}),
|
|
115
120
|
...(name === 'sidebar.workspaces' ? {
|
|
116
121
|
addMember: (request) => ctx.remote.agentTeam.addMember(request),
|
|
@@ -139,9 +144,26 @@ function applyUi(ctx) {
|
|
|
139
144
|
const disposeNavigation = ctx.reflect.provide('teamNavigation', navigation);
|
|
140
145
|
const drafts = new TeamDraftStore();
|
|
141
146
|
const disposeDrafts = ctx.reflect.provide('teamDrafts', drafts);
|
|
147
|
+
// The Human's own identity: one projection every seat reads, refreshed once
|
|
148
|
+
// after a profile write so a rename reaches the timeline and the member refs
|
|
149
|
+
// without a reload. Reads are demand-driven — the first seat that subscribes
|
|
150
|
+
// starts the read. The profile page writes back through the Team Remote, so
|
|
151
|
+
// the Client never names the Host's own profile entry.
|
|
152
|
+
const humanIdentity = new TeamHumanIdentity({
|
|
153
|
+
loadProfile: () => ctx.remote.agentTeam.humanProfile({}),
|
|
154
|
+
loadAvatarUrl: async (avatarRef) => {
|
|
155
|
+
// Avatar bytes ride the dedicated avatar Remote (never the TTL-bound
|
|
156
|
+
// attachment cache); a data URL is what an `<img>` seat can show directly.
|
|
157
|
+
const result = await ctx.remote.agentTeam.getHumanAvatar({ avatarRef });
|
|
158
|
+
if (!result.ok || !result.value.mediaType.startsWith('image/'))
|
|
159
|
+
return null;
|
|
160
|
+
return `data:${result.value.mediaType};base64,${result.value.bytesBase64}`;
|
|
161
|
+
},
|
|
162
|
+
});
|
|
142
163
|
ctx.effect(() => () => {
|
|
143
164
|
navigation.dispose();
|
|
144
165
|
drafts.dispose();
|
|
166
|
+
humanIdentity.dispose();
|
|
145
167
|
void disposeNavigation();
|
|
146
168
|
void disposeDrafts();
|
|
147
169
|
}, 'agent-team: navigation service');
|
|
@@ -211,9 +233,59 @@ function applyUi(ctx) {
|
|
|
211
233
|
},
|
|
212
234
|
}),
|
|
213
235
|
}, TeamFooterAction));
|
|
214
|
-
registerModeShadow(ctx, navigation, changes, reads, drafts, 'sidebar.workspaces', TeamWorkspaceBrowser);
|
|
215
|
-
registerModeShadow(ctx, navigation, changes, reads, drafts, 'main', TeamConversation, undefined, 'conversation');
|
|
216
|
-
registerModeShadow(ctx, navigation, changes, reads, drafts, 'sidebar.settings', TeamMembersAction, () => ({ loadMemberGroups }));
|
|
236
|
+
registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, 'sidebar.workspaces', TeamWorkspaceBrowser);
|
|
237
|
+
registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, 'main', TeamConversation, undefined, 'conversation');
|
|
238
|
+
registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, 'sidebar.settings', TeamMembersAction, () => ({ loadMemberGroups }));
|
|
239
|
+
// The Human profile page: one settings section, ordered between General (0)
|
|
240
|
+
// and Models (10) so identity sits near the top. Writes go through the Team
|
|
241
|
+
// Remote, which answers with the Host's own rejection reason (a name
|
|
242
|
+
// collides, an empty one), and the shared identity re-reads afterwards, so a
|
|
243
|
+
// rename lands in the timeline and the member refs at the same moment the
|
|
244
|
+
// page shows it.
|
|
245
|
+
ctx.slots.inject('settings.section', () => ctx.slots.register({
|
|
246
|
+
name: 'settings.section',
|
|
247
|
+
id: 'team-human',
|
|
248
|
+
order: 5,
|
|
249
|
+
label: () => ctx.locale.bind(NS)('humanSettingsNav'),
|
|
250
|
+
locale: NS,
|
|
251
|
+
inject: () => ({
|
|
252
|
+
identity: humanIdentity,
|
|
253
|
+
saveName: async (name) => {
|
|
254
|
+
const saved = await ctx.remote.agentTeam.setHumanProfile({ name });
|
|
255
|
+
if (!saved.ok)
|
|
256
|
+
return saved.error.message;
|
|
257
|
+
await humanIdentity.refresh();
|
|
258
|
+
return undefined;
|
|
259
|
+
},
|
|
260
|
+
uploadAvatar: async (file) => {
|
|
261
|
+
const put = await ctx.remote.agentTeam.putHumanAvatar({
|
|
262
|
+
name: file.name,
|
|
263
|
+
...(file.type === '' ? {} : { mediaType: file.type }),
|
|
264
|
+
bytesBase64: bytesToBase64(new Uint8Array(await file.arrayBuffer())),
|
|
265
|
+
});
|
|
266
|
+
if (!put.ok)
|
|
267
|
+
return put.error.message;
|
|
268
|
+
const saved = await ctx.remote.agentTeam.setHumanProfile({ avatarRef: put.value.avatarRef });
|
|
269
|
+
if (!saved.ok)
|
|
270
|
+
return saved.error.message;
|
|
271
|
+
await humanIdentity.refresh();
|
|
272
|
+
return undefined;
|
|
273
|
+
},
|
|
274
|
+
removeAvatar: async () => {
|
|
275
|
+
const { avatarRef } = humanIdentity.getSnapshot();
|
|
276
|
+
if (avatarRef === undefined)
|
|
277
|
+
return undefined;
|
|
278
|
+
// Bytes first, then the reference: a failed clear leaves a readable
|
|
279
|
+
// avatar instead of a reference to bytes nobody can load.
|
|
280
|
+
await ctx.remote.agentTeam.removeHumanAvatar({ avatarRef });
|
|
281
|
+
const cleared = await ctx.remote.agentTeam.setHumanProfile({ avatarRef: null });
|
|
282
|
+
if (!cleared.ok)
|
|
283
|
+
return cleared.error.message;
|
|
284
|
+
await humanIdentity.refresh();
|
|
285
|
+
return undefined;
|
|
286
|
+
},
|
|
287
|
+
}),
|
|
288
|
+
}, HumanSettingsSection));
|
|
217
289
|
}
|
|
218
290
|
export async function apply(ctx) {
|
|
219
291
|
const disposeRemote = await ctx.remote.$mount(agentTeamRemote);
|
|
@@ -111,6 +111,28 @@ export declare const zh: {
|
|
|
111
111
|
readonly timelineLabel: "消息时间线";
|
|
112
112
|
readonly taskClosedNotice: "任务已关闭,重新打开后可继续讨论";
|
|
113
113
|
readonly human: "Human";
|
|
114
|
+
readonly humanSettingsNav: "我的资料";
|
|
115
|
+
readonly humanSettingsTitle: "我的资料";
|
|
116
|
+
readonly humanSettingsIntro: "这是 Agent Team 的资料页:名字用在 Team 的消息与成员列表里,头像出现在你发出的消息旁。";
|
|
117
|
+
readonly humanSettingsName: "名字";
|
|
118
|
+
readonly humanSettingsNameHint: "Agents 用这个名字 @ 到你;改名只对之后的消息生效。";
|
|
119
|
+
readonly humanSettingsNameEmpty: "名字不能为空。";
|
|
120
|
+
readonly humanSettingsNameFailed: "名字没保存上:{message}";
|
|
121
|
+
readonly humanSettingsAvatar: "头像";
|
|
122
|
+
readonly humanSettingsAvatarHint: "只收图片,最大 10MB;移除或损坏时回退为默认头像。";
|
|
123
|
+
readonly humanSettingsSave: "保存";
|
|
124
|
+
readonly humanSettingsSaving: "正在保存…";
|
|
125
|
+
readonly humanSettingsUpload: "上传头像";
|
|
126
|
+
readonly humanSettingsUploading: "正在上传…";
|
|
127
|
+
readonly humanSettingsReplace: "更换头像";
|
|
128
|
+
readonly humanSettingsRemoveAvatar: "移除头像";
|
|
129
|
+
readonly humanSettingsAvatarNotImage: "只收图片文件。";
|
|
130
|
+
readonly humanSettingsAvatarTooLarge: "图片不能超过 10MB。";
|
|
131
|
+
readonly humanSettingsAvatarFailed: "头像没能保存:{message}";
|
|
132
|
+
readonly humanSettingsLoading: "正在载入资料…";
|
|
133
|
+
readonly humanSettingsUnavailable: "资料读不出来:{message}";
|
|
134
|
+
readonly humanSettingsVersion: "版本 {version}";
|
|
135
|
+
readonly humanSettingsUpdateAvailable: "有新版本 {version},去查看发布说明";
|
|
114
136
|
readonly taskStatusTodo: "待处理";
|
|
115
137
|
readonly taskStatusInProgress: "进行中";
|
|
116
138
|
readonly taskStatusInReview: "待验收";
|
|
@@ -123,6 +145,8 @@ export declare const zh: {
|
|
|
123
145
|
readonly openTaskUnread: "打开 Task #{number}({count} 条新动态)";
|
|
124
146
|
readonly openThreadUnread: "打开讨论({count} 条新动态)";
|
|
125
147
|
readonly threadLabel: "讨论";
|
|
148
|
+
readonly channelLabel: "频道 · {name}";
|
|
149
|
+
readonly memberLabel: "成员 · @{name}";
|
|
126
150
|
readonly recentActivity: "最近活动 {time}";
|
|
127
151
|
readonly replyAction: "回复";
|
|
128
152
|
readonly claimers: "由 {names} 处理";
|
|
@@ -147,7 +171,18 @@ export declare const zh: {
|
|
|
147
171
|
readonly autoReadIncomplete: "仍有未读更新未能自动读取";
|
|
148
172
|
readonly olderHistory: "更早历史";
|
|
149
173
|
readonly runtimeRisk: "当前运行风险";
|
|
150
|
-
readonly
|
|
174
|
+
readonly riskClassSessionRefused: "会话被拒绝";
|
|
175
|
+
readonly riskClassSessionUnreadable: "会话不可读";
|
|
176
|
+
readonly riskClassPresetComposition: "预设装配失败";
|
|
177
|
+
readonly riskClassRollover: "上下文交接中";
|
|
178
|
+
readonly riskClassRuntime: "运行时故障";
|
|
179
|
+
readonly riskClassActivation: "激活失败";
|
|
180
|
+
readonly riskSessionRefused: "{member} 当前不可用";
|
|
181
|
+
readonly riskSessionUnreadable: "{member} 的会话无法读取";
|
|
182
|
+
readonly riskPresetComposition: "{member} 的预设无法装配";
|
|
183
|
+
readonly riskRollover: "{member} 正在交接上下文";
|
|
184
|
+
readonly riskRuntime: "{member} 遇到运行时故障";
|
|
185
|
+
readonly riskActivation: "{member} 激活失败";
|
|
151
186
|
readonly acceptTask: "验收";
|
|
152
187
|
readonly closeTask: "关闭任务";
|
|
153
188
|
readonly reopenTask: "重新打开";
|
|
@@ -288,6 +323,28 @@ export declare const en: {
|
|
|
288
323
|
readonly timelineLabel: "Message timeline";
|
|
289
324
|
readonly taskClosedNotice: "This task is closed; reopen it to continue the discussion";
|
|
290
325
|
readonly human: "Human";
|
|
326
|
+
readonly humanSettingsNav: "Profile";
|
|
327
|
+
readonly humanSettingsTitle: "Profile";
|
|
328
|
+
readonly humanSettingsIntro: "This is your Agent Team profile: the name applies to Team messages and member lists, and the avatar appears beside your messages.";
|
|
329
|
+
readonly humanSettingsName: "Name";
|
|
330
|
+
readonly humanSettingsNameHint: "Agents @ you by this name; a rename applies to later messages only.";
|
|
331
|
+
readonly humanSettingsNameEmpty: "A name is required.";
|
|
332
|
+
readonly humanSettingsNameFailed: "The name was not saved: {message}";
|
|
333
|
+
readonly humanSettingsAvatar: "Avatar";
|
|
334
|
+
readonly humanSettingsAvatarHint: "Images only, up to 10MB; removing it — or unreadable bytes — falls back to the default avatar.";
|
|
335
|
+
readonly humanSettingsSave: "Save";
|
|
336
|
+
readonly humanSettingsSaving: "Saving…";
|
|
337
|
+
readonly humanSettingsUpload: "Upload avatar";
|
|
338
|
+
readonly humanSettingsUploading: "Uploading…";
|
|
339
|
+
readonly humanSettingsReplace: "Replace avatar";
|
|
340
|
+
readonly humanSettingsRemoveAvatar: "Remove avatar";
|
|
341
|
+
readonly humanSettingsAvatarNotImage: "Images only.";
|
|
342
|
+
readonly humanSettingsAvatarTooLarge: "The image must be 10MB or smaller.";
|
|
343
|
+
readonly humanSettingsAvatarFailed: "The avatar was not saved: {message}";
|
|
344
|
+
readonly humanSettingsLoading: "Loading profile…";
|
|
345
|
+
readonly humanSettingsUnavailable: "The profile could not be read: {message}";
|
|
346
|
+
readonly humanSettingsVersion: "Version {version}";
|
|
347
|
+
readonly humanSettingsUpdateAvailable: "New version {version} available — see the release notes";
|
|
291
348
|
readonly taskStatusTodo: "To do";
|
|
292
349
|
readonly taskStatusInProgress: "In progress";
|
|
293
350
|
readonly taskStatusInReview: "In review";
|
|
@@ -300,6 +357,8 @@ export declare const en: {
|
|
|
300
357
|
readonly openTaskUnread: "Open Task #{number} ({count} new updates)";
|
|
301
358
|
readonly openThreadUnread: "Open thread ({count} new updates)";
|
|
302
359
|
readonly threadLabel: "Thread";
|
|
360
|
+
readonly channelLabel: "Channel · {name}";
|
|
361
|
+
readonly memberLabel: "Member · @{name}";
|
|
303
362
|
readonly recentActivity: "Last activity {time}";
|
|
304
363
|
readonly replyAction: "Reply";
|
|
305
364
|
readonly claimers: "Handled by {names}";
|
|
@@ -324,7 +383,18 @@ export declare const en: {
|
|
|
324
383
|
readonly autoReadIncomplete: "Some unread updates could not be read automatically";
|
|
325
384
|
readonly olderHistory: "Older history";
|
|
326
385
|
readonly runtimeRisk: "Current runtime risk";
|
|
327
|
-
readonly
|
|
386
|
+
readonly riskClassSessionRefused: "Session refused";
|
|
387
|
+
readonly riskClassSessionUnreadable: "Session unreadable";
|
|
388
|
+
readonly riskClassPresetComposition: "Preset composition failed";
|
|
389
|
+
readonly riskClassRollover: "Context rollover";
|
|
390
|
+
readonly riskClassRuntime: "Runtime failure";
|
|
391
|
+
readonly riskClassActivation: "Activation failed";
|
|
392
|
+
readonly riskSessionRefused: "{member} is unavailable";
|
|
393
|
+
readonly riskSessionUnreadable: "{member} has an unreadable Session";
|
|
394
|
+
readonly riskPresetComposition: "{member} has an uncomposable preset";
|
|
395
|
+
readonly riskRollover: "{member} is rolling over its context";
|
|
396
|
+
readonly riskRuntime: "{member} hit a runtime failure";
|
|
397
|
+
readonly riskActivation: "{member} failed to activate";
|
|
328
398
|
readonly acceptTask: "Accept";
|
|
329
399
|
readonly closeTask: "Close task";
|
|
330
400
|
readonly reopenTask: "Reopen";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuNL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqNL,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,EAAE,CAAA"}
|
|
@@ -111,6 +111,28 @@ export const zh = {
|
|
|
111
111
|
timelineLabel: '消息时间线',
|
|
112
112
|
taskClosedNotice: '任务已关闭,重新打开后可继续讨论',
|
|
113
113
|
human: 'Human',
|
|
114
|
+
humanSettingsNav: '我的资料',
|
|
115
|
+
humanSettingsTitle: '我的资料',
|
|
116
|
+
humanSettingsIntro: '这是 Agent Team 的资料页:名字用在 Team 的消息与成员列表里,头像出现在你发出的消息旁。',
|
|
117
|
+
humanSettingsName: '名字',
|
|
118
|
+
humanSettingsNameHint: 'Agents 用这个名字 @ 到你;改名只对之后的消息生效。',
|
|
119
|
+
humanSettingsNameEmpty: '名字不能为空。',
|
|
120
|
+
humanSettingsNameFailed: '名字没保存上:{message}',
|
|
121
|
+
humanSettingsAvatar: '头像',
|
|
122
|
+
humanSettingsAvatarHint: '只收图片,最大 10MB;移除或损坏时回退为默认头像。',
|
|
123
|
+
humanSettingsSave: '保存',
|
|
124
|
+
humanSettingsSaving: '正在保存…',
|
|
125
|
+
humanSettingsUpload: '上传头像',
|
|
126
|
+
humanSettingsUploading: '正在上传…',
|
|
127
|
+
humanSettingsReplace: '更换头像',
|
|
128
|
+
humanSettingsRemoveAvatar: '移除头像',
|
|
129
|
+
humanSettingsAvatarNotImage: '只收图片文件。',
|
|
130
|
+
humanSettingsAvatarTooLarge: '图片不能超过 10MB。',
|
|
131
|
+
humanSettingsAvatarFailed: '头像没能保存:{message}',
|
|
132
|
+
humanSettingsLoading: '正在载入资料…',
|
|
133
|
+
humanSettingsUnavailable: '资料读不出来:{message}',
|
|
134
|
+
humanSettingsVersion: '版本 {version}',
|
|
135
|
+
humanSettingsUpdateAvailable: '有新版本 {version},去查看发布说明',
|
|
114
136
|
taskStatusTodo: '待处理',
|
|
115
137
|
taskStatusInProgress: '进行中',
|
|
116
138
|
taskStatusInReview: '待验收',
|
|
@@ -123,6 +145,8 @@ export const zh = {
|
|
|
123
145
|
openTaskUnread: '打开 Task #{number}({count} 条新动态)',
|
|
124
146
|
openThreadUnread: '打开讨论({count} 条新动态)',
|
|
125
147
|
threadLabel: '讨论',
|
|
148
|
+
channelLabel: '频道 · {name}',
|
|
149
|
+
memberLabel: '成员 · @{name}',
|
|
126
150
|
recentActivity: '最近活动 {time}',
|
|
127
151
|
replyAction: '回复',
|
|
128
152
|
claimers: '由 {names} 处理',
|
|
@@ -147,7 +171,22 @@ export const zh = {
|
|
|
147
171
|
autoReadIncomplete: '仍有未读更新未能自动读取',
|
|
148
172
|
olderHistory: '更早历史',
|
|
149
173
|
runtimeRisk: '当前运行风险',
|
|
150
|
-
|
|
174
|
+
// The diagnostic's structured class is the localizable axis: it names what
|
|
175
|
+
// kind of problem this is, while the Host detail stays English and moves to
|
|
176
|
+
// the row's title. One label names the class, one sentence states it of the
|
|
177
|
+
// Member.
|
|
178
|
+
riskClassSessionRefused: '会话被拒绝',
|
|
179
|
+
riskClassSessionUnreadable: '会话不可读',
|
|
180
|
+
riskClassPresetComposition: '预设装配失败',
|
|
181
|
+
riskClassRollover: '上下文交接中',
|
|
182
|
+
riskClassRuntime: '运行时故障',
|
|
183
|
+
riskClassActivation: '激活失败',
|
|
184
|
+
riskSessionRefused: '{member} 当前不可用',
|
|
185
|
+
riskSessionUnreadable: '{member} 的会话无法读取',
|
|
186
|
+
riskPresetComposition: '{member} 的预设无法装配',
|
|
187
|
+
riskRollover: '{member} 正在交接上下文',
|
|
188
|
+
riskRuntime: '{member} 遇到运行时故障',
|
|
189
|
+
riskActivation: '{member} 激活失败',
|
|
151
190
|
acceptTask: '验收',
|
|
152
191
|
closeTask: '关闭任务',
|
|
153
192
|
reopenTask: '重新打开',
|
|
@@ -288,6 +327,28 @@ export const en = {
|
|
|
288
327
|
timelineLabel: 'Message timeline',
|
|
289
328
|
taskClosedNotice: 'This task is closed; reopen it to continue the discussion',
|
|
290
329
|
human: 'Human',
|
|
330
|
+
humanSettingsNav: 'Profile',
|
|
331
|
+
humanSettingsTitle: 'Profile',
|
|
332
|
+
humanSettingsIntro: 'This is your Agent Team profile: the name applies to Team messages and member lists, and the avatar appears beside your messages.',
|
|
333
|
+
humanSettingsName: 'Name',
|
|
334
|
+
humanSettingsNameHint: 'Agents @ you by this name; a rename applies to later messages only.',
|
|
335
|
+
humanSettingsNameEmpty: 'A name is required.',
|
|
336
|
+
humanSettingsNameFailed: 'The name was not saved: {message}',
|
|
337
|
+
humanSettingsAvatar: 'Avatar',
|
|
338
|
+
humanSettingsAvatarHint: 'Images only, up to 10MB; removing it — or unreadable bytes — falls back to the default avatar.',
|
|
339
|
+
humanSettingsSave: 'Save',
|
|
340
|
+
humanSettingsSaving: 'Saving…',
|
|
341
|
+
humanSettingsUpload: 'Upload avatar',
|
|
342
|
+
humanSettingsUploading: 'Uploading…',
|
|
343
|
+
humanSettingsReplace: 'Replace avatar',
|
|
344
|
+
humanSettingsRemoveAvatar: 'Remove avatar',
|
|
345
|
+
humanSettingsAvatarNotImage: 'Images only.',
|
|
346
|
+
humanSettingsAvatarTooLarge: 'The image must be 10MB or smaller.',
|
|
347
|
+
humanSettingsAvatarFailed: 'The avatar was not saved: {message}',
|
|
348
|
+
humanSettingsLoading: 'Loading profile…',
|
|
349
|
+
humanSettingsUnavailable: 'The profile could not be read: {message}',
|
|
350
|
+
humanSettingsVersion: 'Version {version}',
|
|
351
|
+
humanSettingsUpdateAvailable: 'New version {version} available — see the release notes',
|
|
291
352
|
taskStatusTodo: 'To do',
|
|
292
353
|
taskStatusInProgress: 'In progress',
|
|
293
354
|
taskStatusInReview: 'In review',
|
|
@@ -300,6 +361,8 @@ export const en = {
|
|
|
300
361
|
openTaskUnread: 'Open Task #{number} ({count} new updates)',
|
|
301
362
|
openThreadUnread: 'Open thread ({count} new updates)',
|
|
302
363
|
threadLabel: 'Thread',
|
|
364
|
+
channelLabel: 'Channel · {name}',
|
|
365
|
+
memberLabel: 'Member · @{name}',
|
|
303
366
|
recentActivity: 'Last activity {time}',
|
|
304
367
|
replyAction: 'Reply',
|
|
305
368
|
claimers: 'Handled by {names}',
|
|
@@ -324,7 +387,20 @@ export const en = {
|
|
|
324
387
|
autoReadIncomplete: 'Some unread updates could not be read automatically',
|
|
325
388
|
olderHistory: 'Older history',
|
|
326
389
|
runtimeRisk: 'Current runtime risk',
|
|
327
|
-
|
|
390
|
+
// See the zh block: the structured class names the kind of problem, the
|
|
391
|
+
// sentence states it of the Member, and the Host detail rides the title.
|
|
392
|
+
riskClassSessionRefused: 'Session refused',
|
|
393
|
+
riskClassSessionUnreadable: 'Session unreadable',
|
|
394
|
+
riskClassPresetComposition: 'Preset composition failed',
|
|
395
|
+
riskClassRollover: 'Context rollover',
|
|
396
|
+
riskClassRuntime: 'Runtime failure',
|
|
397
|
+
riskClassActivation: 'Activation failed',
|
|
398
|
+
riskSessionRefused: '{member} is unavailable',
|
|
399
|
+
riskSessionUnreadable: '{member} has an unreadable Session',
|
|
400
|
+
riskPresetComposition: '{member} has an uncomposable preset',
|
|
401
|
+
riskRollover: '{member} is rolling over its context',
|
|
402
|
+
riskRuntime: '{member} hit a runtime failure',
|
|
403
|
+
riskActivation: '{member} failed to activate',
|
|
328
404
|
acceptTask: 'Accept',
|
|
329
405
|
closeTask: 'Close task',
|
|
330
406
|
reopenTask: 'Reopen',
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
2
|
+
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import type { AgentTeamChannel, AgentTeamChannelRef, AgentTeamClientMemberStatus, AgentTeamMemberId, AgentTeamResolveTaskRefsRequest, AgentTeamResolveTaskRefsResult, AgentTeamResolveThreadRefsRequest, AgentTeamResolveThreadRefsResult, AgentTeamTaskRef, AgentTeamThreadRef } from '@wowyuarm/dsh-agent-team/types';
|
|
4
|
+
/** Navigation facts for one branded Task ref, resolved once per session. */
|
|
5
|
+
export interface ResolvedTaskRef {
|
|
6
|
+
readonly taskRef: AgentTeamTaskRef;
|
|
7
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
8
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
9
|
+
readonly taskNumber: number;
|
|
10
|
+
}
|
|
11
|
+
/** Navigation facts for one branded Thread ref, resolved once per session. */
|
|
12
|
+
export interface ResolvedThreadRef {
|
|
13
|
+
readonly threadRef: AgentTeamThreadRef;
|
|
14
|
+
readonly channelRef: AgentTeamChannelRef;
|
|
15
|
+
readonly taskRef?: AgentTeamTaskRef;
|
|
16
|
+
readonly taskNumber?: number;
|
|
17
|
+
/** Opening-line gist distinguishing one Thread chip from another. */
|
|
18
|
+
readonly title: string;
|
|
19
|
+
}
|
|
20
|
+
/** One roster-resolved Member behind a `member:` chip. */
|
|
21
|
+
export interface ResolvedMemberRef {
|
|
22
|
+
readonly memberId: AgentTeamMemberId;
|
|
23
|
+
/** Bare handle without the `@`; the chip renders it. */
|
|
24
|
+
readonly handle: string;
|
|
25
|
+
/** Present for agent Members; absent for the Human (no session to open). */
|
|
26
|
+
readonly sessionId?: SessionId;
|
|
27
|
+
/** Only active agent Members open a session — mirrors the agent card rule. */
|
|
28
|
+
readonly openable: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Compare refs by branded prefix plus hyphen-stripped UUID, so abbreviated spellings line up with their full form. */
|
|
31
|
+
export declare function refKeyOf(ref: string): string;
|
|
32
|
+
/** React binding: re-renders the caller when any Task ref resolution lands. */
|
|
33
|
+
export declare const useResolvedTaskRefVersion: () => number;
|
|
34
|
+
export declare const cachedResolvedTaskRef: (ref: AgentTeamTaskRef) => ResolvedTaskRef | undefined;
|
|
35
|
+
/** Store one Task resolution (click path) and wake every rendered link. */
|
|
36
|
+
export declare const rememberResolvedTaskRef: (entry: ResolvedTaskRef) => void;
|
|
37
|
+
export declare const resolveUnknownTaskRefs: (refs: readonly AgentTeamTaskRef[], lookup: (refs: readonly AgentTeamTaskRef[]) => Promise<readonly ResolvedTaskRef[]>) => Promise<void>;
|
|
38
|
+
/** React binding: re-renders the caller when any Thread ref resolution lands. */
|
|
39
|
+
export declare const useResolvedThreadRefVersion: () => number;
|
|
40
|
+
export declare const cachedResolvedThreadRef: (ref: AgentTeamThreadRef) => ResolvedThreadRef | undefined;
|
|
41
|
+
/** Store one Thread resolution (click path) and wake every rendered link. */
|
|
42
|
+
export declare const rememberResolvedThreadRef: (entry: ResolvedThreadRef) => void;
|
|
43
|
+
export declare const resolveUnknownThreadRefs: (refs: readonly AgentTeamThreadRef[], lookup: (refs: readonly AgentTeamThreadRef[]) => Promise<readonly ResolvedThreadRef[]>) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Click-path Task lookup: remember every resolved entry and hand them back
|
|
46
|
+
* for immediate navigation (see hostRefLookup for the ordering contract).
|
|
47
|
+
*/
|
|
48
|
+
export declare const hostTaskRefLookup: (resolveTaskRefs: (request: AgentTeamResolveTaskRefsRequest) => Promise<RemoteResult<AgentTeamResolveTaskRefsResult>>, workspaceId: AgentTeamResolveTaskRefsRequest["workspaceId"]) => ((taskRefs: readonly AgentTeamTaskRef[]) => Promise<readonly ResolvedTaskRef[]>);
|
|
49
|
+
/**
|
|
50
|
+
* Click-path Thread lookup: remember every resolved entry and hand them back
|
|
51
|
+
* for immediate navigation (see hostRefLookup for the ordering contract).
|
|
52
|
+
*/
|
|
53
|
+
export declare const hostThreadRefLookup: (resolveThreadRefs: (request: AgentTeamResolveThreadRefsRequest) => Promise<RemoteResult<AgentTeamResolveThreadRefsResult>>, workspaceId: AgentTeamResolveThreadRefsRequest["workspaceId"]) => ((threadRefs: readonly AgentTeamThreadRef[]) => Promise<readonly ResolvedThreadRef[]>);
|
|
54
|
+
/** Resolve one Task ref through the Host and jump to its home Channel Thread. */
|
|
55
|
+
export declare const jumpToTaskThread: (resolveTaskRefs: (request: AgentTeamResolveTaskRefsRequest) => Promise<RemoteResult<AgentTeamResolveTaskRefsResult>>, workspaceId: AgentTeamResolveTaskRefsRequest["workspaceId"], taskRef: AgentTeamTaskRef, selectThread: (threadRef: AgentTeamThreadRef, channelRef?: AgentTeamChannelRef, taskRef?: AgentTeamTaskRef, taskNumber?: number) => void) => void;
|
|
56
|
+
/** Resolve one Thread ref through the Host and jump to its home Channel Thread. */
|
|
57
|
+
export declare const jumpToThread: (resolveThreadRefs: (request: AgentTeamResolveThreadRefsRequest) => Promise<RemoteResult<AgentTeamResolveThreadRefsResult>>, workspaceId: AgentTeamResolveThreadRefsRequest["workspaceId"], threadRef: AgentTeamThreadRef, selectThread: (threadRef: AgentTeamThreadRef, channelRef?: AgentTeamChannelRef, taskRef?: AgentTeamTaskRef, taskNumber?: number) => void) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Display name for one authored channel ref, or undefined when the loaded
|
|
60
|
+
* roster does not know it — the caller keeps plain text. Archived Channels
|
|
61
|
+
* never resolve: they are gone from every Team surface, so their refs are
|
|
62
|
+
* not links either.
|
|
63
|
+
*/
|
|
64
|
+
export declare const rosterChannelName: (channels: readonly AgentTeamChannel[], channelRef: AgentTeamChannelRef) => string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Roster facts for one authored member ref, or undefined when nobody on the
|
|
67
|
+
* roster answers to it — the caller keeps plain text. The Human resolves to
|
|
68
|
+
* a handle with no session: informative, never a link.
|
|
69
|
+
*/
|
|
70
|
+
export declare const rosterMember: (members: readonly AgentTeamClientMemberStatus[], humanMemberId: AgentTeamMemberId | undefined, humanHandle: string, memberRef: AgentTeamMemberId) => ResolvedMemberRef | undefined;
|
|
71
|
+
//# sourceMappingURL=refs.d.ts.map
|