@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,12 @@
|
|
|
1
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
type Translate = PropsLocale<'bizagent'>['t'];
|
|
3
|
+
/**
|
|
4
|
+
* Agent-written Markdown (claims, assets, proposals, mail) rendered with DSH's own renderer, which
|
|
5
|
+
* treats the text as untrusted: raw HTML and unsafe link protocols are disabled.
|
|
6
|
+
*/
|
|
7
|
+
export declare function MarkdownBody({ text, className, t }: {
|
|
8
|
+
text: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
t: Translate;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BizAgentUiPort } from './api.js';
|
|
2
|
+
export declare function ProjectArtifactLink({ api, projectId, claimId, artifactPath, workId, label, errorLabel }: {
|
|
3
|
+
api: BizAgentUiPort;
|
|
4
|
+
projectId: string;
|
|
5
|
+
claimId: string;
|
|
6
|
+
artifactPath: string;
|
|
7
|
+
workId?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
errorLabel: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
import type { UiProjectOutcomeReviewInbox } from '../ui-contract.js';
|
|
3
|
+
import type { BizAgentUiPort } from './api.js';
|
|
4
|
+
type T = PropsLocale<'bizagent'>['t'];
|
|
5
|
+
export declare function ProjectOutcomeReviewInbox({ inbox, api, t, onReviewed, onMore, moreBusy }: {
|
|
6
|
+
inbox: UiProjectOutcomeReviewInbox;
|
|
7
|
+
api: BizAgentUiPort;
|
|
8
|
+
t: T;
|
|
9
|
+
onReviewed: () => void;
|
|
10
|
+
onMore: () => void;
|
|
11
|
+
moreBusy: boolean;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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 ProjectsDashboard({ api, sessionId, initialProjectId, onOpenMain, t }: {
|
|
5
|
+
api: BizAgentUiPort;
|
|
6
|
+
sessionId: string | undefined;
|
|
7
|
+
initialProjectId?: string | undefined;
|
|
8
|
+
onOpenMain?: (projectId: string) => Promise<void>;
|
|
9
|
+
t: T;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
type Translate = PropsLocale<'bizagent'>['t'];
|
|
3
|
+
/** Getting-started steps shown on the sample team's Organization view. */
|
|
4
|
+
export declare function SampleGuide({ onOpenChat, onOpenProjects, t }: {
|
|
5
|
+
onOpenChat: (homeAddress: string) => Promise<void>;
|
|
6
|
+
onOpenProjects: () => void;
|
|
7
|
+
t: Translate;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { UiSessionContext, UiSessionSummary, UiHumanInboxList } from '../ui-contract.js';
|
|
2
|
+
import type { BizAgentUiPort } from './api.js';
|
|
3
|
+
export interface ResourceState<T> {
|
|
4
|
+
data?: T;
|
|
5
|
+
error?: string;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** One request and timer per resource, shared by every surface showing that Session. */
|
|
9
|
+
export declare class SessionResource<T> {
|
|
10
|
+
private readonly fetchValue;
|
|
11
|
+
private readonly interval;
|
|
12
|
+
private snapshot;
|
|
13
|
+
private listeners;
|
|
14
|
+
private request;
|
|
15
|
+
private timer;
|
|
16
|
+
constructor(fetchValue: (signal: AbortSignal) => Promise<T>, interval?: number);
|
|
17
|
+
getSnapshot: () => ResourceState<T>;
|
|
18
|
+
get active(): boolean;
|
|
19
|
+
subscribe: (listener: () => void) => (() => void);
|
|
20
|
+
refresh: () => Promise<void>;
|
|
21
|
+
stop(): void;
|
|
22
|
+
private set;
|
|
23
|
+
}
|
|
24
|
+
export declare class SessionSurfaces {
|
|
25
|
+
private readonly api;
|
|
26
|
+
readonly catalog: SessionResource<{
|
|
27
|
+
sessions: UiSessionSummary[];
|
|
28
|
+
}>;
|
|
29
|
+
readonly inbox: SessionResource<UiHumanInboxList | undefined>;
|
|
30
|
+
private contexts;
|
|
31
|
+
constructor(api: BizAgentUiPort);
|
|
32
|
+
context(sessionId: string): SessionResource<UiSessionContext>;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
import type { DashboardTarget } from './controller.js';
|
|
3
|
+
import type { SessionSurfaces } from './session-resource.js';
|
|
4
|
+
export interface SessionSurfaceFace {
|
|
5
|
+
surfaces: SessionSurfaces;
|
|
6
|
+
openDashboard: (target?: DashboardTarget) => void;
|
|
7
|
+
openSession: (sessionId: string) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
type Locale = PropsLocale<'bizagent'>;
|
|
10
|
+
type Face = InjectFace<SessionSurfaceFace>;
|
|
11
|
+
type HeaderProps = PropsRuntime<'conversation.session.header.actions'> & Locale & Face;
|
|
12
|
+
type ViewProps = PropsRuntime<'conversation.view'> & Locale & Face;
|
|
13
|
+
type LeadingProps = PropsRuntime<'sidebar.session.row.leading'> & Locale & Face;
|
|
14
|
+
type HoverProps = PropsRuntime<'sidebar.session.row.hover'> & Locale & Face;
|
|
15
|
+
type MenuProps = PropsRuntime<'sidebar.workspaces.session.menu.item'> & Locale & Face;
|
|
16
|
+
type TailProps = PropsRuntime<'conversation.chat.turnTail'> & Locale & Face;
|
|
17
|
+
export declare function SessionHomeAction({ surfaces, sessionId, useSession, openDashboard, t }: HeaderProps): import("react").JSX.Element | null;
|
|
18
|
+
export declare function SessionQuickActions({ sessionId, surfaces, openDashboard, t }: HeaderProps): import("react").JSX.Element;
|
|
19
|
+
export declare function SessionRowLeading({ sessionId, surfaces, t }: LeadingProps): import("react").JSX.Element | null;
|
|
20
|
+
export declare function SessionRowHover({ sessionId, surfaces, t }: HoverProps): import("react").JSX.Element | null;
|
|
21
|
+
export declare function SessionRowMenu({ sessionId, surfaces, openDashboard, useMenuOpenState, t }: MenuProps): import("react").JSX.Element | null;
|
|
22
|
+
export declare function SessionWorkView({ sessionId, surfaces, openDashboard, openSession, useSession, viewRequest, completeViewRequest, t }: ViewProps): import("react").JSX.Element;
|
|
23
|
+
export declare function SessionTurnCard({ sessionId, turn, seq, surfaces, openDashboard, t }: TailProps): import("react").JSX.Element | null;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BIZAGENT_UI_CSS: string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Schema from '@deepseek-ai/schemastery';
|
|
2
|
+
import { type ContextBudget, type HomeAddress } from './domain.js';
|
|
3
|
+
export interface LearningScheduleConfig {
|
|
4
|
+
home: string;
|
|
5
|
+
cron: string;
|
|
6
|
+
model: string;
|
|
7
|
+
provider?: string;
|
|
8
|
+
maxTokens?: number;
|
|
9
|
+
dailyRuns?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ResolvedLearningSchedule {
|
|
12
|
+
home: HomeAddress;
|
|
13
|
+
cron: string;
|
|
14
|
+
model: string;
|
|
15
|
+
provider?: string;
|
|
16
|
+
maxTokens?: number;
|
|
17
|
+
dailyRuns: number;
|
|
18
|
+
}
|
|
19
|
+
export interface Config {
|
|
20
|
+
homeRoot?: string;
|
|
21
|
+
defaultHome?: string;
|
|
22
|
+
defaultIdentity?: string;
|
|
23
|
+
autoCreateDefaultHome?: boolean;
|
|
24
|
+
workspaceHomes?: Record<string, string>;
|
|
25
|
+
identityMaxBytes?: number;
|
|
26
|
+
indexMaxBytes?: number;
|
|
27
|
+
learningCheckpointEnabled?: boolean;
|
|
28
|
+
learningSchedulerEnabled?: boolean;
|
|
29
|
+
learningSchedules?: LearningScheduleConfig[];
|
|
30
|
+
timeZone?: string;
|
|
31
|
+
owner?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const Config: Schema<Config>;
|
|
34
|
+
export interface ResolvedConfig {
|
|
35
|
+
homeRoot: string;
|
|
36
|
+
defaultHome?: HomeAddress;
|
|
37
|
+
defaultIdentity?: string;
|
|
38
|
+
autoCreateDefaultHome: boolean;
|
|
39
|
+
workspaceHomes: ReadonlyArray<{
|
|
40
|
+
root: string;
|
|
41
|
+
address: HomeAddress;
|
|
42
|
+
}>;
|
|
43
|
+
budget: ContextBudget;
|
|
44
|
+
learningCheckpointEnabled: boolean;
|
|
45
|
+
learningSchedulerEnabled: boolean;
|
|
46
|
+
learningSchedules: ReadonlyArray<ResolvedLearningSchedule>;
|
|
47
|
+
timeZone: string;
|
|
48
|
+
owner: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function resolveConfig(input?: Config): ResolvedConfig;
|
|
51
|
+
/**
|
|
52
|
+
* `$BIZAGENT_HOME`, else `~/BizAgent`. Data written before the data root moved, at
|
|
53
|
+
* `$DSH_HOME/bizagent`, keeps being used until it is moved, so upgrading never hides it.
|
|
54
|
+
*/
|
|
55
|
+
export declare function defaultHomeRoot(): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The host's IANA time zone, or UTC when the runtime cannot report one. */
|
|
2
|
+
export declare function hostTimeZone(): string;
|
|
3
|
+
/** Validate an IANA time zone name and return its canonical spelling. */
|
|
4
|
+
export declare function resolveTimeZone(timeZone: string): string;
|
|
5
|
+
/** Calendar day (YYYY-MM-DD) of an instant in the given time zone. */
|
|
6
|
+
export declare function zonedDay(time: number, timeZone?: string): string;
|
|
7
|
+
/** Next five-field cron occurrence in `timeZone`, strictly after `after`. */
|
|
8
|
+
export declare function nextCronAt(cron: string, after: number, timeZone?: string): number;
|