@bizagent/dsh 0.0.0-stage → 1.0.0
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 +124 -0
- package/LICENSE +21 -0
- package/README.md +61 -2
- package/cordis.patch.yml +14 -0
- package/docs/README.md +23 -0
- package/docs/architecture.md +154 -0
- package/docs/concepts.md +192 -0
- package/docs/configuration.md +154 -0
- package/docs/quickstart.md +103 -0
- package/docs/quickstart.zh-CN.md +86 -0
- package/docs/tools.md +607 -0
- package/docs/user-guide.zh-CN.md +132 -0
- package/docs/verification.md +69 -0
- package/examples/README.md +64 -0
- package/examples/demo-runtime.mjs +71 -0
- package/examples/learning-lab.mjs +263 -0
- package/examples/scenarios.mjs +45 -0
- package/lib/agent-preset.d.ts +20 -0
- package/lib/agent-preset.js +46 -0
- package/lib/agent-session-address.d.ts +14 -0
- package/lib/agent-session-address.js +15 -0
- package/lib/agent-session-coordinator.d.ts +24 -0
- package/lib/agent-session-coordinator.js +101 -0
- package/lib/cli.d.ts +3 -0
- package/lib/cli.js +142 -0
- package/lib/client-types/agent-session-address.d.ts +13 -0
- package/lib/client-types/client/agent-mentions.d.ts +3 -0
- package/lib/client-types/client/api.d.ts +180 -0
- package/lib/client-types/client/components.d.ts +22 -0
- package/lib/client-types/client/controller.d.ts +23 -0
- package/lib/client-types/client/frame-participants.d.ts +5 -0
- package/lib/client-types/client/home-name.d.ts +9 -0
- package/lib/client-types/client/human-inbox.d.ts +8 -0
- package/lib/client-types/client/index.d.ts +13 -0
- package/lib/client-types/client/locales.d.ts +796 -0
- package/lib/client-types/client/markdown.d.ts +12 -0
- package/lib/client-types/client/project-artifact-link.d.ts +10 -0
- package/lib/client-types/client/project-outcome-review-inbox.d.ts +13 -0
- package/lib/client-types/client/projects.d.ts +11 -0
- package/lib/client-types/client/sample-guide.d.ts +9 -0
- package/lib/client-types/client/session-resource.d.ts +34 -0
- package/lib/client-types/client/session-surfaces.d.ts +24 -0
- package/lib/client-types/client/styles.d.ts +1 -0
- package/lib/client-types/config.d.ts +55 -0
- package/lib/client-types/cron.d.ts +8 -0
- package/lib/client-types/domain.d.ts +818 -0
- package/lib/client-types/frame-reference.d.ts +4 -0
- package/lib/client-types/home-directory.d.ts +5 -0
- package/lib/client-types/home-space.d.ts +49 -0
- package/lib/client-types/home-store.d.ts +125 -0
- package/lib/client-types/inbox-stalled-topic.d.ts +15 -0
- package/lib/client-types/inbox-wake-policy.d.ts +18 -0
- package/lib/client-types/known-format.d.ts +2 -0
- package/lib/client-types/learning-scheduler.d.ts +36 -0
- package/lib/client-types/learning-session-runner.d.ts +49 -0
- package/lib/client-types/learning-trigger.d.ts +17 -0
- package/lib/client-types/learning-usage.d.ts +17 -0
- package/lib/client-types/ledger.d.ts +190 -0
- package/lib/client-types/local-owner.d.ts +7 -0
- package/lib/client-types/message-source.d.ts +9 -0
- package/lib/client-types/organization-location.d.ts +19 -0
- package/lib/client-types/project-ledger.d.ts +182 -0
- package/lib/client-types/project-seat-context.d.ts +17 -0
- package/lib/client-types/safe-file.d.ts +23 -0
- package/lib/client-types/sample-organization.d.ts +9 -0
- package/lib/client-types/service.d.ts +596 -0
- package/lib/client-types/shared-knowledge.d.ts +116 -0
- package/lib/client-types/ui-contract.d.ts +276 -0
- package/lib/client-types/untrusted-text.d.ts +15 -0
- package/lib/client-types/work-ledger.d.ts +108 -0
- package/lib/client-types/work-output-eval.d.ts +15 -0
- package/lib/client-types/worklog-ledger.d.ts +88 -0
- package/lib/client-types/worklog-snapshot.d.ts +33 -0
- package/lib/client.js +5463 -0
- package/lib/config.d.ts +56 -0
- package/lib/config.js +115 -0
- package/lib/cron.d.ts +9 -0
- package/lib/cron.js +127 -0
- package/lib/domain.d.ts +819 -0
- package/lib/domain.js +662 -0
- package/lib/frame-admission.d.ts +6 -0
- package/lib/frame-admission.js +39 -0
- package/lib/frame-reference.d.ts +5 -0
- package/lib/frame-reference.js +12 -0
- package/lib/home-archive.d.ts +17 -0
- package/lib/home-archive.js +177 -0
- package/lib/home-directory.d.ts +6 -0
- package/lib/home-directory.js +38 -0
- package/lib/home-space.d.ts +50 -0
- package/lib/home-space.js +120 -0
- package/lib/home-store.d.ts +126 -0
- package/lib/home-store.js +837 -0
- package/lib/host.d.ts +22 -0
- package/lib/host.js +15 -0
- package/lib/human-inbox-transport.d.ts +23 -0
- package/lib/human-inbox-transport.js +105 -0
- package/lib/human-notification-runner.d.ts +83 -0
- package/lib/human-notification-runner.js +138 -0
- package/lib/human-notification-webhook.d.ts +18 -0
- package/lib/human-notification-webhook.js +102 -0
- package/lib/human-turn-completion.d.ts +61 -0
- package/lib/human-turn-completion.js +157 -0
- package/lib/inbox-return-notifier.d.ts +46 -0
- package/lib/inbox-return-notifier.js +279 -0
- package/lib/inbox-stalled-escalation-runner.d.ts +31 -0
- package/lib/inbox-stalled-escalation-runner.js +68 -0
- package/lib/inbox-stalled-topic.d.ts +16 -0
- package/lib/inbox-stalled-topic.js +44 -0
- package/lib/inbox-wake-policy.d.ts +19 -0
- package/lib/inbox-wake-policy.js +28 -0
- package/lib/inbox-wake-runner.d.ts +45 -0
- package/lib/inbox-wake-runner.js +481 -0
- package/lib/index.d.ts +29 -0
- package/lib/index.js +480 -0
- package/lib/known-format.d.ts +3 -0
- package/lib/known-format.js +8 -0
- package/lib/learning-scheduler.d.ts +37 -0
- package/lib/learning-scheduler.js +182 -0
- package/lib/learning-session-runner.d.ts +50 -0
- package/lib/learning-session-runner.js +435 -0
- package/lib/learning-trigger.d.ts +18 -0
- package/lib/learning-trigger.js +92 -0
- package/lib/learning-usage.d.ts +18 -0
- package/lib/learning-usage.js +49 -0
- package/lib/ledger.d.ts +191 -0
- package/lib/ledger.js +752 -0
- package/lib/local-human-host.d.ts +11 -0
- package/lib/local-human-host.js +191 -0
- package/lib/local-human-token.d.ts +9 -0
- package/lib/local-human-token.js +32 -0
- package/lib/local-owner.d.ts +8 -0
- package/lib/local-owner.js +26 -0
- package/lib/message-source.d.ts +10 -0
- package/lib/message-source.js +2 -0
- package/lib/organization-location.d.ts +20 -0
- package/lib/organization-location.js +80 -0
- package/lib/organization-workspace.d.ts +22 -0
- package/lib/organization-workspace.js +32 -0
- package/lib/project-ledger.d.ts +183 -0
- package/lib/project-ledger.js +189 -0
- package/lib/project-review-transport.d.ts +23 -0
- package/lib/project-review-transport.js +155 -0
- package/lib/project-seat-context.d.ts +18 -0
- package/lib/project-seat-context.js +34 -0
- package/lib/proposal-review-transport.d.ts +26 -0
- package/lib/proposal-review-transport.js +104 -0
- package/lib/route-guard.d.ts +31 -0
- package/lib/route-guard.js +80 -0
- package/lib/safe-file.d.ts +24 -0
- package/lib/safe-file.js +93 -0
- package/lib/sample-organization.d.ts +10 -0
- package/lib/sample-organization.js +46 -0
- package/lib/service.d.ts +597 -0
- package/lib/service.js +4076 -0
- package/lib/session-surface.d.ts +11 -0
- package/lib/session-surface.js +109 -0
- package/lib/shared-knowledge-review-transport.d.ts +28 -0
- package/lib/shared-knowledge-review-transport.js +85 -0
- package/lib/shared-knowledge.d.ts +117 -0
- package/lib/shared-knowledge.js +240 -0
- package/lib/tools.d.ts +7 -0
- package/lib/tools.js +955 -0
- package/lib/ui-contract.d.ts +277 -0
- package/lib/ui-contract.js +12 -0
- package/lib/ui-host.d.ts +24 -0
- package/lib/ui-host.js +471 -0
- package/lib/untrusted-text.d.ts +16 -0
- package/lib/untrusted-text.js +50 -0
- package/lib/work-ledger.d.ts +109 -0
- package/lib/work-ledger.js +107 -0
- package/lib/work-output-eval.d.ts +16 -0
- package/lib/work-output-eval.js +58 -0
- package/lib/work-runner.d.ts +47 -0
- package/lib/work-runner.js +352 -0
- package/lib/worklog-ledger.d.ts +89 -0
- package/lib/worklog-ledger.js +91 -0
- package/lib/worklog-snapshot.d.ts +34 -0
- package/lib/worklog-snapshot.js +100 -0
- package/lib/writer-guard.d.ts +11 -0
- package/lib/writer-guard.js +207 -0
- package/package.json +172 -4
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { AgentOptions, AgentRegistry } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { SessionQueryEngine } from '@deepseek-ai/dsh-session-query';
|
|
4
|
+
type Agents = Pick<AgentRegistry, 'get' | 'create' | 'resume'>;
|
|
5
|
+
type Sessions = Pick<SessionQueryEngine, 'listSessions'>;
|
|
6
|
+
/**
|
|
7
|
+
* Wrap the Agent factory so plugin-created Sessions join a DSH agent preset, as Sessions created
|
|
8
|
+
* by the DSH host do. The preset supplies the model-facing built-in tools (files, shell, search,
|
|
9
|
+
* subagents); without joining one, an Agent sees only globally registered tools and cannot read
|
|
10
|
+
* or change its Workspace. A new Session records the resolved preset on its header, and a resumed
|
|
11
|
+
* Session rejoins the preset it recorded (or the current default for Sessions created before this
|
|
12
|
+
* existed). A deployment with no preset roster keeps the plain host composition.
|
|
13
|
+
*
|
|
14
|
+
* A caller that names no model gets the host's current default, which is also what DSH's own
|
|
15
|
+
* session controller passes. DSH does not restore a resumed Session's model by itself, and an
|
|
16
|
+
* Agent without one fails every turn while assembling its system prompt.
|
|
17
|
+
*/
|
|
18
|
+
export declare function withAgentPreset(ctx: Context, agents: Agents, sessions: Sessions, defaultModel: () => AgentOptions): Agents;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=agent-preset.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap the Agent factory so plugin-created Sessions join a DSH agent preset, as Sessions created
|
|
3
|
+
* by the DSH host do. The preset supplies the model-facing built-in tools (files, shell, search,
|
|
4
|
+
* subagents); without joining one, an Agent sees only globally registered tools and cannot read
|
|
5
|
+
* or change its Workspace. A new Session records the resolved preset on its header, and a resumed
|
|
6
|
+
* Session rejoins the preset it recorded (or the current default for Sessions created before this
|
|
7
|
+
* existed). A deployment with no preset roster keeps the plain host composition.
|
|
8
|
+
*
|
|
9
|
+
* A caller that names no model gets the host's current default, which is also what DSH's own
|
|
10
|
+
* session controller passes. DSH does not restore a resumed Session's model by itself, and an
|
|
11
|
+
* Agent without one fails every turn while assembling its system prompt.
|
|
12
|
+
*/
|
|
13
|
+
export function withAgentPreset(ctx, agents, sessions, defaultModel) {
|
|
14
|
+
const compose = async (presetId, setup) => {
|
|
15
|
+
const roster = ctx.get('agentPresets');
|
|
16
|
+
if (roster === undefined)
|
|
17
|
+
return { setup };
|
|
18
|
+
const id = (await roster.resolve(presetId)).id;
|
|
19
|
+
const joined = async (agentCtx, agent) => {
|
|
20
|
+
await roster.mount(agentCtx, id);
|
|
21
|
+
return setup?.(agentCtx, agent);
|
|
22
|
+
};
|
|
23
|
+
return { id, setup: joined };
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
get: id => agents.get(id),
|
|
27
|
+
create: async (options) => {
|
|
28
|
+
const composed = await compose(options.meta?.agentPreset, options.setup);
|
|
29
|
+
return agents.create({
|
|
30
|
+
agentOptions: defaultModel(),
|
|
31
|
+
...options,
|
|
32
|
+
...(composed.id === undefined ? {} : { meta: { ...options.meta, agentPreset: composed.id } }),
|
|
33
|
+
...(composed.setup === undefined ? {} : { setup: composed.setup }),
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
resume: async (options) => {
|
|
37
|
+
const record = (await sessions.listSessions())
|
|
38
|
+
.find(item => String(item.header.id) === String(options.resumeSessionId));
|
|
39
|
+
const recorded = record?.header?.agentPreset;
|
|
40
|
+
const composed = await compose(typeof recorded === 'string' ? recorded : undefined, options.setup);
|
|
41
|
+
return agents.resume({ agentOptions: defaultModel(), ...options,
|
|
42
|
+
...(composed.setup === undefined ? {} : { setup: composed.setup }) });
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=agent-preset.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HomeAddress } from './domain.js';
|
|
2
|
+
/** One durable Principal per long-term Home. Ordinary DSH Sessions are not Principals. */
|
|
3
|
+
export declare function principalSessionId(address: string): string;
|
|
4
|
+
export declare function projectMainAddress(projectId: string): `project:${string}`;
|
|
5
|
+
/** The Main is a separate Session and reuses the lead Agent's Home. */
|
|
6
|
+
export declare function projectMainSessionId(projectId: string): string;
|
|
7
|
+
export interface AgentSessionAddress {
|
|
8
|
+
kind: 'principal' | 'project-main';
|
|
9
|
+
homeAddress: HomeAddress;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
logicalAddress: string;
|
|
12
|
+
projectId?: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=agent-session-address.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { parseHomeAddress, stableId } from './domain.js';
|
|
2
|
+
/** One durable Principal per long-term Home. Ordinary DSH Sessions are not Principals. */
|
|
3
|
+
export function principalSessionId(address) {
|
|
4
|
+
return stableId('principal-session', parseHomeAddress(address));
|
|
5
|
+
}
|
|
6
|
+
export function projectMainAddress(projectId) {
|
|
7
|
+
if (!/^project-[a-f0-9]{20}$/.test(projectId))
|
|
8
|
+
throw new Error('invalid Project ID');
|
|
9
|
+
return `project:${projectId}`;
|
|
10
|
+
}
|
|
11
|
+
/** The Main is a separate Session and reuses the lead Agent's Home. */
|
|
12
|
+
export function projectMainSessionId(projectId) {
|
|
13
|
+
return stableId('project-main-session', projectMainAddress(projectId));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=agent-session-address.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AgentOptions, AgentRegistry } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import type { SessionQueryEngine } from '@deepseek-ai/dsh-session-query';
|
|
3
|
+
import { type AgentSessionAddress } from './agent-session-address.js';
|
|
4
|
+
import type { BizAgentService } from './service.js';
|
|
5
|
+
type Agents = Pick<AgentRegistry, 'get' | 'create' | 'resume'>;
|
|
6
|
+
type Sessions = Pick<SessionQueryEngine, 'listSessions'>;
|
|
7
|
+
/** Owns only the runtime handles it opens. Session IDs and Home bindings survive process restarts. */
|
|
8
|
+
export declare class AgentSessionCoordinator {
|
|
9
|
+
private readonly agents;
|
|
10
|
+
private readonly sessions;
|
|
11
|
+
private readonly service;
|
|
12
|
+
private readonly creationModel?;
|
|
13
|
+
private readonly handles;
|
|
14
|
+
private readonly pending;
|
|
15
|
+
private closing;
|
|
16
|
+
constructor(agents: Agents, sessions: Sessions, service: BizAgentService, creationModel?: (() => AgentOptions) | undefined);
|
|
17
|
+
openPrincipal(homeInput: string): Promise<AgentSessionAddress>;
|
|
18
|
+
openProjectMain(projectId: string): Promise<AgentSessionAddress>;
|
|
19
|
+
private open;
|
|
20
|
+
private openOne;
|
|
21
|
+
close(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=agent-session-coordinator.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { nowIso, parseHomeAddress } from './domain.js';
|
|
2
|
+
import { principalSessionId, projectMainAddress, projectMainSessionId } from './agent-session-address.js';
|
|
3
|
+
/** Owns only the runtime handles it opens. Session IDs and Home bindings survive process restarts. */
|
|
4
|
+
export class AgentSessionCoordinator {
|
|
5
|
+
agents;
|
|
6
|
+
sessions;
|
|
7
|
+
service;
|
|
8
|
+
creationModel;
|
|
9
|
+
handles = new Map();
|
|
10
|
+
pending = new Map();
|
|
11
|
+
closing = false;
|
|
12
|
+
constructor(agents, sessions, service, creationModel) {
|
|
13
|
+
this.agents = agents;
|
|
14
|
+
this.sessions = sessions;
|
|
15
|
+
this.service = service;
|
|
16
|
+
this.creationModel = creationModel;
|
|
17
|
+
}
|
|
18
|
+
openPrincipal(homeInput) {
|
|
19
|
+
const homeAddress = parseHomeAddress(homeInput);
|
|
20
|
+
return this.open({ kind: 'principal', homeAddress,
|
|
21
|
+
logicalAddress: homeAddress, sessionId: principalSessionId(homeAddress) });
|
|
22
|
+
}
|
|
23
|
+
openProjectMain(projectId) {
|
|
24
|
+
const project = this.service.projectLedger?.get(projectId);
|
|
25
|
+
if (!project || project.driver !== projectMainAddress(projectId)) {
|
|
26
|
+
throw new Error('Project has no current Main address');
|
|
27
|
+
}
|
|
28
|
+
return this.open({ kind: 'project-main', homeAddress: project.lead,
|
|
29
|
+
logicalAddress: project.driver, sessionId: projectMainSessionId(projectId), projectId });
|
|
30
|
+
}
|
|
31
|
+
open(address) {
|
|
32
|
+
if (this.closing)
|
|
33
|
+
throw new Error('Agent Session coordinator is closing');
|
|
34
|
+
const pending = this.pending.get(address.sessionId);
|
|
35
|
+
if (pending)
|
|
36
|
+
return pending;
|
|
37
|
+
const task = this.openOne(address);
|
|
38
|
+
this.pending.set(address.sessionId, task);
|
|
39
|
+
void task.finally(() => { if (this.pending.get(address.sessionId) === task)
|
|
40
|
+
this.pending.delete(address.sessionId); })
|
|
41
|
+
.catch(() => undefined);
|
|
42
|
+
return task;
|
|
43
|
+
}
|
|
44
|
+
async openOne(address) {
|
|
45
|
+
const home = this.service.store.getHome(address.homeAddress);
|
|
46
|
+
if (home.status !== 'active')
|
|
47
|
+
throw new Error('Agent Home is not active');
|
|
48
|
+
const workspace = this.service.store.homeWorkspacePath(address.homeAddress);
|
|
49
|
+
const binding = this.service.ledger.getBinding(address.sessionId);
|
|
50
|
+
if (binding && (binding.homeAddress !== address.homeAddress || binding.cwd !== workspace)) {
|
|
51
|
+
throw new Error('Agent Session is bound to a different Home or Workspace');
|
|
52
|
+
}
|
|
53
|
+
if (!binding)
|
|
54
|
+
await this.service.ledger.putBinding({ sessionId: address.sessionId,
|
|
55
|
+
homeAddress: address.homeAddress, cwd: workspace, boundAt: nowIso() });
|
|
56
|
+
const sessionId = address.sessionId;
|
|
57
|
+
const record = (await this.sessions.listSessions())
|
|
58
|
+
.find(item => String(item.header.id) === address.sessionId);
|
|
59
|
+
if (record && record.header.cwd !== workspace) {
|
|
60
|
+
throw new Error('persisted Agent Session Workspace differs from its Home');
|
|
61
|
+
}
|
|
62
|
+
if (record && !record.persisted && !this.agents.get(sessionId)) {
|
|
63
|
+
throw new Error('Agent Session exists but cannot be resumed');
|
|
64
|
+
}
|
|
65
|
+
let agent = this.agents.get(sessionId);
|
|
66
|
+
if (!agent) {
|
|
67
|
+
const setup = (agentCtx) => {
|
|
68
|
+
agentCtx.systemPrompt.section({ name: 'bizagent:agent-session-mode', order: 50,
|
|
69
|
+
text: address.kind === 'principal'
|
|
70
|
+
? `This is the unique long-term Principal for ${address.homeAddress}. Keep its conversation continuous. A Principal turn does not require a worklog.`
|
|
71
|
+
: `This is the dedicated Project Main for ${address.logicalAddress}, acting as ${address.homeAddress}. Use this execution conversation to coordinate this Project, read its current record before decisions, and keep project work separate from the long-term Principal. The Home's AGENTS.md is the execution guide when present; record work in the Project and Worklog as appropriate.`,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const handle = record
|
|
75
|
+
? await this.agents.resume({ resumeSessionId: sessionId, setup })
|
|
76
|
+
: await this.agents.create({ sessionId, meta: { cwd: workspace }, setup,
|
|
77
|
+
...(this.creationModel === undefined ? {} : { agentOptions: this.creationModel() }) });
|
|
78
|
+
this.handles.set(address.sessionId, handle);
|
|
79
|
+
agent = handle.agent;
|
|
80
|
+
}
|
|
81
|
+
if (String(agent.id) !== address.sessionId
|
|
82
|
+
|| String(agent.session.header.id) !== address.sessionId
|
|
83
|
+
|| agent.session.header.cwd !== workspace) {
|
|
84
|
+
const handle = this.handles.get(address.sessionId);
|
|
85
|
+
if (handle) {
|
|
86
|
+
this.handles.delete(address.sessionId);
|
|
87
|
+
await handle.dispose();
|
|
88
|
+
}
|
|
89
|
+
throw new Error('Agent Session identity or Workspace differs from the durable address');
|
|
90
|
+
}
|
|
91
|
+
return address;
|
|
92
|
+
}
|
|
93
|
+
async close() {
|
|
94
|
+
this.closing = true;
|
|
95
|
+
await Promise.allSettled(this.pending.values());
|
|
96
|
+
const handles = [...this.handles.values()];
|
|
97
|
+
this.handles.clear();
|
|
98
|
+
await Promise.all(handles.map(handle => handle.dispose()));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=agent-session-coordinator.js.map
|
package/lib/cli.d.ts
ADDED
package/lib/cli.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { defaultHomeRoot } from './config.js';
|
|
5
|
+
import { HomeStore } from './home-store.js';
|
|
6
|
+
import { exportHomeArchive, importHomeArchive, verifyHomeArchive } from './home-archive.js';
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
try {
|
|
9
|
+
await main(args);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
process.stderr.write(`bizagent: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
}
|
|
15
|
+
async function main(argv) {
|
|
16
|
+
const parsed = parseGlobalOptions(argv);
|
|
17
|
+
const [command, ...rest] = parsed.args;
|
|
18
|
+
if (command === undefined || command === 'help' || command === '--help' || command === '-h') {
|
|
19
|
+
printHelp();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (command === 'archive') {
|
|
23
|
+
const [action, path] = rest;
|
|
24
|
+
if (!path || rest.length !== 2)
|
|
25
|
+
throw new Error('archive requires one source or destination path');
|
|
26
|
+
if (action === 'export') {
|
|
27
|
+
const manifest = await exportHomeArchive(parsed.root, path);
|
|
28
|
+
print({ archive: resolve(path), rootDigest: manifest.rootDigest, files: manifest.files.length });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (action === 'verify') {
|
|
32
|
+
const manifest = await verifyHomeArchive(path);
|
|
33
|
+
print({ verified: true, archive: resolve(path), rootDigest: manifest.rootDigest, files: manifest.files.length });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (action === 'import') {
|
|
37
|
+
const manifest = await importHomeArchive(path, parsed.root);
|
|
38
|
+
print({ imported: true, root: parsed.root, rootDigest: manifest.rootDigest, files: manifest.files.length });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
throw new Error(`unknown archive action: ${action ?? '(missing)'}`);
|
|
42
|
+
}
|
|
43
|
+
const store = new HomeStore(parsed.root);
|
|
44
|
+
await store.initialize();
|
|
45
|
+
switch (command) {
|
|
46
|
+
case 'init': {
|
|
47
|
+
const address = option(rest, '--default-home') ?? 'personal:default';
|
|
48
|
+
const identityFile = option(rest, '--identity-file');
|
|
49
|
+
const identity = identityFile === undefined ? undefined : await readFile(resolve(identityFile), 'utf8');
|
|
50
|
+
const home = await store.createHome({ address, ...(identity !== undefined ? { identity } : {}) });
|
|
51
|
+
print({ root: store.root, home });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
case 'home': {
|
|
55
|
+
await homeCommand(store, rest);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
case 'doctor': {
|
|
59
|
+
const report = await store.doctor();
|
|
60
|
+
print(report);
|
|
61
|
+
if (!report.ok)
|
|
62
|
+
process.exitCode = 2;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
case 'reindex': {
|
|
66
|
+
await store.reload();
|
|
67
|
+
print({ reindexed: true, root: store.root, homes: store.listHomes().length });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
throw new Error(`unknown command: ${command}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function homeCommand(store, argv) {
|
|
75
|
+
const [subcommand, address] = argv;
|
|
76
|
+
switch (subcommand) {
|
|
77
|
+
case 'list':
|
|
78
|
+
print({ homes: store.listHomes() });
|
|
79
|
+
return;
|
|
80
|
+
case 'create': {
|
|
81
|
+
if (address === undefined || address.startsWith('--')) {
|
|
82
|
+
throw new Error('home create requires a canonical address');
|
|
83
|
+
}
|
|
84
|
+
const name = option(argv.slice(2), '--name');
|
|
85
|
+
const owner = option(argv.slice(2), '--owner');
|
|
86
|
+
const identityFile = option(argv.slice(2), '--identity-file');
|
|
87
|
+
const identity = identityFile === undefined ? undefined : await readFile(resolve(identityFile), 'utf8');
|
|
88
|
+
const home = await store.createHome({
|
|
89
|
+
address,
|
|
90
|
+
...(name !== undefined ? { displayName: name } : {}),
|
|
91
|
+
...(owner !== undefined ? { owner } : {}),
|
|
92
|
+
...(identity !== undefined ? { identity } : {}),
|
|
93
|
+
});
|
|
94
|
+
print({ home });
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
default:
|
|
98
|
+
throw new Error(`unknown home command: ${subcommand ?? '(missing)'}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function parseGlobalOptions(argv) {
|
|
102
|
+
const result = [];
|
|
103
|
+
let root;
|
|
104
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
105
|
+
const value = argv[index];
|
|
106
|
+
if (value === '--root') {
|
|
107
|
+
root = argv[index + 1];
|
|
108
|
+
if (root === undefined)
|
|
109
|
+
throw new Error('--root requires a path');
|
|
110
|
+
index += 1;
|
|
111
|
+
}
|
|
112
|
+
else if (value !== undefined) {
|
|
113
|
+
result.push(value);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { root: resolve(root ?? defaultHomeRoot()), args: result };
|
|
117
|
+
}
|
|
118
|
+
function option(argv, name) {
|
|
119
|
+
const index = argv.indexOf(name);
|
|
120
|
+
if (index < 0)
|
|
121
|
+
return undefined;
|
|
122
|
+
const value = argv[index + 1];
|
|
123
|
+
if (value === undefined || value.startsWith('--'))
|
|
124
|
+
throw new Error(`${name} requires a value`);
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
function print(value) {
|
|
128
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
129
|
+
}
|
|
130
|
+
function printHelp() {
|
|
131
|
+
process.stdout.write(`BizAgent v0.1-alpha.2\n\n`);
|
|
132
|
+
process.stdout.write(`Usage:\n`);
|
|
133
|
+
process.stdout.write(` bizagent [--root PATH] init [--default-home ADDRESS] [--identity-file FILE]\n`);
|
|
134
|
+
process.stdout.write(` bizagent [--root PATH] home create ADDRESS [--name NAME] [--owner OWNER] [--identity-file FILE]\n`);
|
|
135
|
+
process.stdout.write(` bizagent [--root PATH] home list\n`);
|
|
136
|
+
process.stdout.write(` bizagent [--root PATH] doctor\n`);
|
|
137
|
+
process.stdout.write(` bizagent [--root PATH] reindex\n`);
|
|
138
|
+
process.stdout.write(` bizagent [--root PATH] archive export DIRECTORY\n`);
|
|
139
|
+
process.stdout.write(` bizagent archive verify DIRECTORY\n`);
|
|
140
|
+
process.stdout.write(` bizagent --root NEW_EMPTY_HOME_ROOT archive import DIRECTORY\n`);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HomeAddress } from './domain.js';
|
|
2
|
+
/** One durable Principal per long-term Home. Ordinary DSH Sessions are not Principals. */
|
|
3
|
+
export declare function principalSessionId(address: string): string;
|
|
4
|
+
export declare function projectMainAddress(projectId: string): `project:${string}`;
|
|
5
|
+
/** The Main is a separate Session and reuses the lead Agent's Home. */
|
|
6
|
+
export declare function projectMainSessionId(projectId: string): string;
|
|
7
|
+
export interface AgentSessionAddress {
|
|
8
|
+
kind: 'principal' | 'project-main';
|
|
9
|
+
homeAddress: HomeAddress;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
logicalAddress: string;
|
|
12
|
+
projectId?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { InputTriggerSource } from '@deepseek-ai/dsh-client-ui-input-trigger/client';
|
|
2
|
+
import type { BizAgentUiPort } from './api.js';
|
|
3
|
+
export declare function createAgentMentionSource(api: Pick<BizAgentUiPort, 'agentDirectory' | 'resolveAgentTarget'>): InputTriggerSource;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { type UiSessionContext, type UiSessionSummary, type UiAgentDirectory, type UiAgentTarget, type UiCreateHomeRequest, type UiCreateOrganizationRequest, type UiFrameParticipation, type UiHomeDetail, type UiLearningSchedule, type UiMemoryUseOutcomes, type UiOverview, type UiProjectList, type UiProjectDetail, type UiProjectReviewAccess, type UiProjectOutcomeReviewInbox, type UiProposalDecisionRequest, type UiHumanInboxList, type UiHumanInboxDetail } from '../ui-contract.js';
|
|
2
|
+
export interface UiSharedKnowledgeReviews {
|
|
3
|
+
count: number;
|
|
4
|
+
proposals: Array<{
|
|
5
|
+
proposal: {
|
|
6
|
+
id: string;
|
|
7
|
+
fromAddress: string;
|
|
8
|
+
target: {
|
|
9
|
+
scope: 'common';
|
|
10
|
+
} | {
|
|
11
|
+
scope: 'line';
|
|
12
|
+
line: string;
|
|
13
|
+
};
|
|
14
|
+
description: string;
|
|
15
|
+
body: string;
|
|
16
|
+
status: 'pending' | 'accepted' | 'rejected';
|
|
17
|
+
};
|
|
18
|
+
actions: {
|
|
19
|
+
accept: boolean;
|
|
20
|
+
reject: boolean;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface BizAgentUiPort {
|
|
25
|
+
sessionContext(sessionId: string, signal?: AbortSignal): Promise<UiSessionContext>;
|
|
26
|
+
sessionCatalog(signal?: AbortSignal): Promise<{
|
|
27
|
+
sessions: UiSessionSummary[];
|
|
28
|
+
}>;
|
|
29
|
+
/** `viaToken` is false when DSH's own browser login already identifies the person. */
|
|
30
|
+
localHumanStatus?(signal?: AbortSignal): Promise<{
|
|
31
|
+
available: boolean;
|
|
32
|
+
authenticated: boolean;
|
|
33
|
+
viaToken?: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
setLocalHumanToken?(token: string | undefined): Promise<boolean>;
|
|
36
|
+
openAgentSession?(input: {
|
|
37
|
+
homeAddress: string;
|
|
38
|
+
} | {
|
|
39
|
+
projectId: string;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
kind: 'principal' | 'project-main';
|
|
42
|
+
homeAddress: string;
|
|
43
|
+
logicalAddress: string;
|
|
44
|
+
sessionId: string;
|
|
45
|
+
workspacePath: string;
|
|
46
|
+
projectId?: string;
|
|
47
|
+
}>;
|
|
48
|
+
agentDirectory(sessionId: string, query: string, signal?: AbortSignal): Promise<UiAgentDirectory>;
|
|
49
|
+
resolveAgentTarget(sessionId: string, target: string, signal?: AbortSignal): Promise<UiAgentTarget>;
|
|
50
|
+
frameParticipation(sessionId: string, signal?: AbortSignal): Promise<UiFrameParticipation>;
|
|
51
|
+
overview(signal?: AbortSignal): Promise<UiOverview>;
|
|
52
|
+
humanInbox(direction: 'incoming' | 'outgoing', pendingOnly: boolean, beforeMessageId?: string, signal?: AbortSignal): Promise<UiHumanInboxList | undefined>;
|
|
53
|
+
humanInboxDetail(messageId: string, signal?: AbortSignal): Promise<UiHumanInboxDetail>;
|
|
54
|
+
setHumanNotificationPreference(enabled: boolean, expectedRevision: number): Promise<{
|
|
55
|
+
preference: UiHumanInboxList['notificationPreference'];
|
|
56
|
+
}>;
|
|
57
|
+
handleHumanInbox(messageId: string): Promise<unknown>;
|
|
58
|
+
replyHumanInbox(messageId: string, subject: string, body: string, idempotencyKey: string): Promise<unknown>;
|
|
59
|
+
home(address: string, signal?: AbortSignal): Promise<UiHomeDetail>;
|
|
60
|
+
revealSession(sessionId: string): Promise<{
|
|
61
|
+
sessionId: string;
|
|
62
|
+
workspacePath?: string;
|
|
63
|
+
}>;
|
|
64
|
+
learningSchedule(home: string, signal?: AbortSignal): Promise<UiLearningSchedule>;
|
|
65
|
+
memoryUseOutcomes(sessionId: string, assetId: string, beforeWorkId?: string, signal?: AbortSignal): Promise<UiMemoryUseOutcomes>;
|
|
66
|
+
configureLearningSchedule(home: string, expectedRevision: number, enabled: boolean, cron: string, dailyRuns: number): Promise<UiLearningSchedule>;
|
|
67
|
+
createHome(request: UiCreateHomeRequest, signal?: AbortSignal): Promise<UiHomeDetail>;
|
|
68
|
+
createOrganization(request: UiCreateOrganizationRequest, signal?: AbortSignal): Promise<UiOverview>;
|
|
69
|
+
createSampleOrganization?(signal?: AbortSignal): Promise<UiOverview>;
|
|
70
|
+
decideProposal(request: UiProposalDecisionRequest, signal?: AbortSignal): Promise<UiHomeDetail>;
|
|
71
|
+
proposalReviewActions?(ownerAddress: string, proposalId: string, signal?: AbortSignal): Promise<{
|
|
72
|
+
accept: boolean;
|
|
73
|
+
reject: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
sharedKnowledgeReviews?(signal?: AbortSignal): Promise<UiSharedKnowledgeReviews | undefined>;
|
|
76
|
+
decideSharedKnowledge?(input: {
|
|
77
|
+
proposalId: string;
|
|
78
|
+
action: 'accept' | 'reject';
|
|
79
|
+
decision: string;
|
|
80
|
+
}): Promise<unknown>;
|
|
81
|
+
projects(sessionId: string, beforeProjectId?: string, signal?: AbortSignal): Promise<UiProjectList>;
|
|
82
|
+
projectDetail(sessionId: string, projectId: string, signal?: AbortSignal): Promise<UiProjectDetail>;
|
|
83
|
+
projectReviewAccess?(projectId: string, signal?: AbortSignal): Promise<UiProjectReviewAccess | undefined>;
|
|
84
|
+
projectOutcomeReviewInbox?(offset?: number, signal?: AbortSignal): Promise<UiProjectOutcomeReviewInbox | undefined>;
|
|
85
|
+
reviewProjectAsHuman?(input: {
|
|
86
|
+
projectId: string;
|
|
87
|
+
claimId: string;
|
|
88
|
+
expectedRevision: number;
|
|
89
|
+
decision: 'accept' | 'rework';
|
|
90
|
+
reason: string;
|
|
91
|
+
}): Promise<unknown>;
|
|
92
|
+
downloadProjectReviewArtifact?(input: {
|
|
93
|
+
projectId: string;
|
|
94
|
+
claimId: string;
|
|
95
|
+
artifactPath: string;
|
|
96
|
+
workId?: string;
|
|
97
|
+
}): Promise<Blob>;
|
|
98
|
+
}
|
|
99
|
+
export declare class BizAgentUiHttpError extends Error {
|
|
100
|
+
readonly status: number;
|
|
101
|
+
readonly code?: string | undefined;
|
|
102
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
103
|
+
}
|
|
104
|
+
export declare class BizAgentUiHttpPort implements BizAgentUiPort {
|
|
105
|
+
private localHumanToken;
|
|
106
|
+
sessionContext(sessionId: string, signal?: AbortSignal): Promise<UiSessionContext>;
|
|
107
|
+
sessionCatalog(signal?: AbortSignal): Promise<{
|
|
108
|
+
sessions: UiSessionSummary[];
|
|
109
|
+
}>;
|
|
110
|
+
private humanHeaders;
|
|
111
|
+
localHumanStatus(signal?: AbortSignal): Promise<{
|
|
112
|
+
available: boolean;
|
|
113
|
+
authenticated: boolean;
|
|
114
|
+
viaToken?: boolean;
|
|
115
|
+
}>;
|
|
116
|
+
/** Hosts without DSH's browser login: verify a local Bearer token and keep it in page memory. */
|
|
117
|
+
setLocalHumanToken(token: string | undefined): Promise<boolean>;
|
|
118
|
+
openAgentSession(input: {
|
|
119
|
+
homeAddress: string;
|
|
120
|
+
} | {
|
|
121
|
+
projectId: string;
|
|
122
|
+
}): Promise<{
|
|
123
|
+
kind: 'principal' | 'project-main';
|
|
124
|
+
homeAddress: string;
|
|
125
|
+
logicalAddress: string;
|
|
126
|
+
sessionId: string;
|
|
127
|
+
workspacePath: string;
|
|
128
|
+
projectId?: string;
|
|
129
|
+
}>;
|
|
130
|
+
revealSession(sessionId: string): Promise<{
|
|
131
|
+
sessionId: string;
|
|
132
|
+
workspacePath?: string;
|
|
133
|
+
}>;
|
|
134
|
+
agentDirectory(sessionId: string, query: string, signal?: AbortSignal): Promise<UiAgentDirectory>;
|
|
135
|
+
resolveAgentTarget(sessionId: string, target: string, signal?: AbortSignal): Promise<UiAgentTarget>;
|
|
136
|
+
frameParticipation(sessionId: string, signal?: AbortSignal): Promise<UiFrameParticipation>;
|
|
137
|
+
overview(signal?: AbortSignal): Promise<UiOverview>;
|
|
138
|
+
humanInbox(direction: 'incoming' | 'outgoing', pendingOnly: boolean, beforeMessageId?: string, signal?: AbortSignal): Promise<UiHumanInboxList | undefined>;
|
|
139
|
+
humanInboxDetail(messageId: string, signal?: AbortSignal): Promise<UiHumanInboxDetail>;
|
|
140
|
+
setHumanNotificationPreference(enabled: boolean, expectedRevision: number): Promise<{
|
|
141
|
+
preference: UiHumanInboxList['notificationPreference'];
|
|
142
|
+
}>;
|
|
143
|
+
handleHumanInbox(messageId: string): Promise<unknown>;
|
|
144
|
+
replyHumanInbox(messageId: string, subject: string, body: string, idempotencyKey: string): Promise<unknown>;
|
|
145
|
+
home(address: string, signal?: AbortSignal): Promise<UiHomeDetail>;
|
|
146
|
+
learningSchedule(home: string, signal?: AbortSignal): Promise<UiLearningSchedule>;
|
|
147
|
+
memoryUseOutcomes(sessionId: string, assetId: string, beforeWorkId?: string, signal?: AbortSignal): Promise<UiMemoryUseOutcomes>;
|
|
148
|
+
configureLearningSchedule(home: string, expectedRevision: number, enabled: boolean, cron: string, dailyRuns: number): Promise<UiLearningSchedule>;
|
|
149
|
+
createHome(input: UiCreateHomeRequest, signal?: AbortSignal): Promise<UiHomeDetail>;
|
|
150
|
+
createSampleOrganization(signal?: AbortSignal): Promise<UiOverview>;
|
|
151
|
+
createOrganization(input: UiCreateOrganizationRequest, signal?: AbortSignal): Promise<UiOverview>;
|
|
152
|
+
decideProposal(input: UiProposalDecisionRequest, signal?: AbortSignal): Promise<UiHomeDetail>;
|
|
153
|
+
proposalReviewActions(ownerAddress: string, proposalId: string, signal?: AbortSignal): Promise<{
|
|
154
|
+
accept: boolean;
|
|
155
|
+
reject: boolean;
|
|
156
|
+
}>;
|
|
157
|
+
sharedKnowledgeReviews(signal?: AbortSignal): Promise<UiSharedKnowledgeReviews | undefined>;
|
|
158
|
+
decideSharedKnowledge(input: {
|
|
159
|
+
proposalId: string;
|
|
160
|
+
action: 'accept' | 'reject';
|
|
161
|
+
decision: string;
|
|
162
|
+
}): Promise<unknown>;
|
|
163
|
+
projects(sessionId: string, beforeProjectId?: string, signal?: AbortSignal): Promise<UiProjectList>;
|
|
164
|
+
projectDetail(sessionId: string, projectId: string, signal?: AbortSignal): Promise<UiProjectDetail>;
|
|
165
|
+
projectReviewAccess(projectId: string, signal?: AbortSignal): Promise<UiProjectReviewAccess | undefined>;
|
|
166
|
+
projectOutcomeReviewInbox(offset?: number, signal?: AbortSignal): Promise<UiProjectOutcomeReviewInbox | undefined>;
|
|
167
|
+
reviewProjectAsHuman(input: {
|
|
168
|
+
projectId: string;
|
|
169
|
+
claimId: string;
|
|
170
|
+
expectedRevision: number;
|
|
171
|
+
decision: 'accept' | 'rework';
|
|
172
|
+
reason: string;
|
|
173
|
+
}): Promise<unknown>;
|
|
174
|
+
downloadProjectReviewArtifact(input: {
|
|
175
|
+
projectId: string;
|
|
176
|
+
claimId: string;
|
|
177
|
+
artifactPath: string;
|
|
178
|
+
workId?: string;
|
|
179
|
+
}): Promise<Blob>;
|
|
180
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
import type { BizAgentUiPort } from './api.js';
|
|
3
|
+
import type { BizAgentUiController, DashboardTarget } from './controller.js';
|
|
4
|
+
export interface BizAgentUiFace {
|
|
5
|
+
controller: BizAgentUiController;
|
|
6
|
+
api: BizAgentUiPort;
|
|
7
|
+
openDashboard: (target?: DashboardTarget) => void;
|
|
8
|
+
closeDashboard: () => void;
|
|
9
|
+
openAgentSession: (input: {
|
|
10
|
+
homeAddress: string;
|
|
11
|
+
} | {
|
|
12
|
+
projectId: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
/** Start a new chat in the DSH Workspace for this folder, adding the Workspace if needed. */
|
|
15
|
+
openWorkspaceChat: (path: string) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
type LauncherProps = PropsRuntime<'sidebar.footer.action'> & InjectFace<BizAgentUiFace> & PropsLocale<'bizagent'>;
|
|
18
|
+
type DashboardProps = PropsRuntime<'main'> & InjectFace<BizAgentUiFace> & PropsLocale<'bizagent'>;
|
|
19
|
+
export declare function BizAgentMark(): import("react").JSX.Element;
|
|
20
|
+
export declare function BizAgentLauncher({ wide, controller, api, openDashboard, t }: LauncherProps): import("react").JSX.Element;
|
|
21
|
+
export declare function BizAgentDashboard({ controller, api, openAgentSession, openWorkspaceChat, closeDashboard, t, useSessions, useWorkspaces }: DashboardProps): import("react").JSX.Element | null;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type DashboardView = 'organization' | 'learning' | 'projects' | 'humanInbox';
|
|
2
|
+
export interface DashboardTarget {
|
|
3
|
+
view?: DashboardView;
|
|
4
|
+
homeAddress?: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
assetId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BizAgentUiSnapshot {
|
|
10
|
+
readonly open: boolean;
|
|
11
|
+
readonly revision: number;
|
|
12
|
+
readonly target?: DashboardTarget;
|
|
13
|
+
}
|
|
14
|
+
export declare class BizAgentUiController {
|
|
15
|
+
private snapshot;
|
|
16
|
+
private readonly listeners;
|
|
17
|
+
getSnapshot: () => BizAgentUiSnapshot;
|
|
18
|
+
subscribe: (listener: () => void) => (() => void);
|
|
19
|
+
open(target?: DashboardTarget): void;
|
|
20
|
+
close(): void;
|
|
21
|
+
toggle(): void;
|
|
22
|
+
private setOpen;
|
|
23
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
import type { SessionSurfaceFace } from './session-surfaces.js';
|
|
3
|
+
type FrameDockProps = PropsRuntime<'conversation.input.dock'> & InjectFace<Pick<SessionSurfaceFace, 'surfaces' | 'openDashboard'>> & PropsLocale<'bizagent'>;
|
|
4
|
+
export declare function FrameParticipationDock({ sessionId, useSession, surfaces, openDashboard, t }: FrameDockProps): import("react").JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name to show for a Home. BizAgent creates the person's default Home with its address as its
|
|
3
|
+
* name; a personal Home nobody has named is the person's own and shows as such.
|
|
4
|
+
*/
|
|
5
|
+
export declare function homeName(home: {
|
|
6
|
+
address: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
scope?: 'personal' | 'organization' | undefined;
|
|
9
|
+
}, t: (key: 'session.personal') => string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
import type { BizAgentUiPort } from './api.js';
|
|
3
|
+
type T = PropsLocale<'bizagent'>['t'];
|
|
4
|
+
export declare function HumanInboxDashboard({ api, t }: {
|
|
5
|
+
api: BizAgentUiPort;
|
|
6
|
+
t: T;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export {};
|