@linxin666/dsh-client-ui-task-board-team 0.0.0-stage → 0.4.13
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/LICENSE +202 -0
- package/README.i18n.yaml +6 -0
- package/README.md +66 -2
- package/README.zh.md +67 -0
- package/cordis.patch.yml +14 -0
- package/icon.svg +3 -0
- package/lib/client.js +1117 -0
- package/lib/index.js +2968 -0
- package/lib/types/client/index.d.ts +58 -0
- package/lib/types/client/locales.d.ts +83 -0
- package/lib/types/client/optional-service.d.ts +22 -0
- package/lib/types/client/team/extension.d.ts +29 -0
- package/lib/types/client/team/sections.d.ts +38 -0
- package/lib/types/client/team/settings.d.ts +41 -0
- package/lib/types/client/team/summary.d.ts +34 -0
- package/lib/types/core/contract.d.ts +269 -0
- package/lib/types/core/hub-protocol.d.ts +175 -0
- package/lib/types/core/identity.d.ts +96 -0
- package/lib/types/core/mirror.d.ts +51 -0
- package/lib/types/core/question-report.d.ts +84 -0
- package/lib/types/core/settlement.d.ts +49 -0
- package/lib/types/core/task-record.d.ts +59 -0
- package/lib/types/core/timers.d.ts +20 -0
- package/lib/types/host/bindings.d.ts +92 -0
- package/lib/types/host/channel.d.ts +44 -0
- package/lib/types/host/credentials.d.ts +63 -0
- package/lib/types/host/extension.d.ts +57 -0
- package/lib/types/host/hub-client.d.ts +157 -0
- package/lib/types/host/questions.d.ts +105 -0
- package/lib/types/host/service.d.ts +209 -0
- package/lib/types/host/setup.d.ts +152 -0
- package/lib/types/host/tools.d.ts +19 -0
- package/lib/types/host/waterfall.d.ts +39 -0
- package/lib/types/index.d.ts +152 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +83 -3
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/index.ts +139 -0
- package/src/client/locales.ts +154 -0
- package/src/client/optional-service.ts +30 -0
- package/src/client/team/extension.ts +185 -0
- package/src/client/team/sections.tsx +159 -0
- package/src/client/team/settings.tsx +242 -0
- package/src/client/team/summary.ts +156 -0
- package/src/client/team/team.module.css +122 -0
- package/src/core/contract.ts +326 -0
- package/src/core/hub-protocol.ts +217 -0
- package/src/core/identity.ts +193 -0
- package/src/core/mirror.ts +88 -0
- package/src/core/question-report.ts +144 -0
- package/src/core/settlement.ts +84 -0
- package/src/core/task-record.ts +65 -0
- package/src/core/timers.ts +34 -0
- package/src/host/bindings.ts +211 -0
- package/src/host/channel.ts +97 -0
- package/src/host/credentials.ts +147 -0
- package/src/host/extension.ts +197 -0
- package/src/host/hub-client.ts +287 -0
- package/src/host/questions.ts +275 -0
- package/src/host/service.ts +1421 -0
- package/src/host/setup.ts +259 -0
- package/src/host/tools.ts +70 -0
- package/src/host/waterfall.ts +51 -0
- package/src/index.ts +452 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser half of the task-board team provider extension.
|
|
3
|
+
*
|
|
4
|
+
* It registers this extension's copy, then contributes three seats: the card
|
|
5
|
+
* decoration and the task-detail section (both behind the extension's own
|
|
6
|
+
* switch, which is read from the settings form), and the configuration block
|
|
7
|
+
* inside the board's own settings card (behind the board service alone, because
|
|
8
|
+
* that block is where the switch and the Host Token live).
|
|
9
|
+
*
|
|
10
|
+
* Failure policy: a missing slot registry, locale service or board service is
|
|
11
|
+
* handled, never thrown — the web shell fails the whole boot when a plugin apply
|
|
12
|
+
* throws, and one external plugin must not take the GUI down.
|
|
13
|
+
*
|
|
14
|
+
* @module dsh-task-board-team/client
|
|
15
|
+
*/
|
|
16
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
17
|
+
import { type TeamKey } from './locales.ts';
|
|
18
|
+
/** Locale namespace this half owns. */
|
|
19
|
+
export declare const NS = "task-board-team";
|
|
20
|
+
/** Settings namespace the block edits. */
|
|
21
|
+
export declare const SETTINGS_NAMESPACE = "task-board-team";
|
|
22
|
+
/** Profile entry ids this package's patch rows carry, most specific first. */
|
|
23
|
+
export declare const ENTRY_IDS: readonly string[];
|
|
24
|
+
/** The settings value this extension's own form carries. */
|
|
25
|
+
export interface TeamSettingsValue {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
29
|
+
interface SlotMap {
|
|
30
|
+
/** Provider task-detail section; the board declares and renders it. */
|
|
31
|
+
'task-board.detail.section': {
|
|
32
|
+
kind: 'list';
|
|
33
|
+
scope: 'root';
|
|
34
|
+
owner: import('../core/contract.ts').TaskBoardDetailSectionProps;
|
|
35
|
+
};
|
|
36
|
+
/** Provider settings section; the board declares and renders it. */
|
|
37
|
+
'task-board.settings.section': {
|
|
38
|
+
kind: 'list';
|
|
39
|
+
scope: 'root';
|
|
40
|
+
owner: import('../core/contract.ts').TaskBoardSettingsSectionProps;
|
|
41
|
+
};
|
|
42
|
+
/** Provider card decoration; the board declares and renders it. */
|
|
43
|
+
'task-board.card.decoration': {
|
|
44
|
+
kind: 'list';
|
|
45
|
+
scope: 'root';
|
|
46
|
+
owner: import('../core/contract.ts').TaskBoardCardDecorationProps;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
interface LocaleNamespaceMap {
|
|
50
|
+
/** The team provider extension copy. */
|
|
51
|
+
'task-board-team': TeamKey;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Mount the extension's browser half.
|
|
56
|
+
* @param ctx - the browser plugin context.
|
|
57
|
+
*/
|
|
58
|
+
export declare function apply(ctx: ClientContext): void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy of the team provider's browser half.
|
|
3
|
+
*
|
|
4
|
+
* The Chinese dictionary is the key source: every other locale tracks exactly
|
|
5
|
+
* these keys (the repository gate enforces parity), and no user-facing string is
|
|
6
|
+
* written inline in a component. The third language is carried centrally by
|
|
7
|
+
* dsh-i18n, which is why this module ships zh and en only.
|
|
8
|
+
*
|
|
9
|
+
* @module dsh-task-board-team/client/locales
|
|
10
|
+
*/
|
|
11
|
+
export declare const zh: {
|
|
12
|
+
readonly 'section.title': "团队协作";
|
|
13
|
+
readonly 'section.hub': "Hub 地址";
|
|
14
|
+
readonly 'section.team': "团队 ID";
|
|
15
|
+
readonly 'section.token': "Host Token";
|
|
16
|
+
readonly 'section.token.configured': "已配置(保存在宿主侧,不回显)";
|
|
17
|
+
readonly 'section.token.missing': "未配置";
|
|
18
|
+
readonly 'section.token.placeholder': "粘贴 Host Token,保存后只在宿主侧使用";
|
|
19
|
+
readonly 'section.token.save': "保存 Token";
|
|
20
|
+
readonly 'section.token.clear': "清除 Token";
|
|
21
|
+
readonly 'section.agents': "团队 Agent 绑定";
|
|
22
|
+
readonly 'section.agents.empty': "尚未绑定任何 dsh-agents 成员,本机不会领取任何团队任务";
|
|
23
|
+
readonly 'section.agents.hint': "填写 dsh-agents 的成员 ID,用逗号分隔";
|
|
24
|
+
readonly 'section.questionWait': "本地兜底等待(分钟)";
|
|
25
|
+
readonly 'section.questionWait.hint': "0 = 不设本地上限,一直等到 hub 给出终态(回答、过期或撤回)";
|
|
26
|
+
readonly 'section.save': "保存设置";
|
|
27
|
+
readonly 'section.saved': "已保存";
|
|
28
|
+
readonly 'section.refresh': "立即领取";
|
|
29
|
+
readonly 'section.connection': "连接状态";
|
|
30
|
+
readonly 'section.connection.idle': "未启动";
|
|
31
|
+
readonly 'section.connection.connecting': "正在注册";
|
|
32
|
+
readonly 'section.connection.online': "在线";
|
|
33
|
+
readonly 'section.connection.reconnecting': "正在重连";
|
|
34
|
+
readonly 'section.connection.error': "连接失败";
|
|
35
|
+
readonly 'section.host': "主机";
|
|
36
|
+
readonly 'section.heartbeat': "最近心跳";
|
|
37
|
+
readonly 'section.reconnects': "重连次数";
|
|
38
|
+
readonly 'section.capabilities': "能力";
|
|
39
|
+
readonly 'section.capability.followUp': "后续消息投递";
|
|
40
|
+
readonly 'section.capability.rework': "同会话返工";
|
|
41
|
+
readonly 'section.capability.run': "自动开始执行";
|
|
42
|
+
readonly 'section.capability.available': "可用";
|
|
43
|
+
readonly 'section.capability.missing': "不可用";
|
|
44
|
+
readonly 'section.capability.followUpMissing': "当前看板版本不提供 followUp,评论里 @ 本机 Agent 时只能记在活动流里";
|
|
45
|
+
readonly 'section.capability.reworkMissing': "当前看板版本不提供 rework,收到返工请求时只记录,不会重跑";
|
|
46
|
+
readonly 'section.capability.runMissing': "当前看板版本不提供执行入口,领取到的卡片需要人工在看板上开始";
|
|
47
|
+
readonly 'section.capability.presetPin': "建卡时钉住预设与模型";
|
|
48
|
+
readonly 'section.capability.presetPinMissing': "当前看板版本无法在建卡时钉住 Agent 预设、模型与思考档位,因此领取到的镜像卡没有启动,需要人工处理";
|
|
49
|
+
readonly 'section.problems': "配置问题";
|
|
50
|
+
readonly 'detail.title': "团队协作";
|
|
51
|
+
readonly 'detail.issue': "团队 issue";
|
|
52
|
+
readonly 'detail.assignee': "负责人";
|
|
53
|
+
readonly 'detail.reviewer': "审阅人";
|
|
54
|
+
readonly 'detail.agent': "执行 Agent";
|
|
55
|
+
readonly 'detail.status': "Hub 状态";
|
|
56
|
+
readonly 'detail.comments': "评论";
|
|
57
|
+
readonly 'detail.activity': "活动";
|
|
58
|
+
readonly 'detail.pending': "待回答的问题";
|
|
59
|
+
readonly 'detail.empty': "暂无";
|
|
60
|
+
readonly 'detail.error': "最近错误";
|
|
61
|
+
readonly 'status.todo': "待办";
|
|
62
|
+
readonly 'status.assigned': "已分配";
|
|
63
|
+
readonly 'status.waiting_host': "等待执行节点";
|
|
64
|
+
readonly 'status.running': "执行中";
|
|
65
|
+
readonly 'status.in_review': "待审阅";
|
|
66
|
+
readonly 'status.done': "已完成";
|
|
67
|
+
readonly 'status.canceled': "已取消";
|
|
68
|
+
readonly 'status.failed': "失败";
|
|
69
|
+
readonly unavailable: "本扩展的团队配置尚不可用";
|
|
70
|
+
};
|
|
71
|
+
export type TeamKey = keyof typeof zh;
|
|
72
|
+
export declare const en: Record<TeamKey, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Install the runtime translate seat.
|
|
75
|
+
* @param bound - the locale-bound lookup of this namespace.
|
|
76
|
+
*/
|
|
77
|
+
export declare function setRuntimeTranslate(bound: (key: TeamKey) => string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Translate one key of this namespace.
|
|
80
|
+
* @param key - dictionary key.
|
|
81
|
+
* @returns the localized string.
|
|
82
|
+
*/
|
|
83
|
+
export declare function t(key: TeamKey): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional service access for the browser half.
|
|
3
|
+
*
|
|
4
|
+
* The web shell's context throws when a plugin reads a service it did not
|
|
5
|
+
* declare in its inject contract — an entry that wants to tolerate a deployment
|
|
6
|
+
* without a settings surface or slot registry therefore cannot read those names
|
|
7
|
+
* as plain properties. `ctx.get` resolves the same service without the inject
|
|
8
|
+
* requirement, and answers undefined when nothing serves it.
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-task-board-team/client/optional-service
|
|
11
|
+
*/
|
|
12
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
13
|
+
/**
|
|
14
|
+
* Read one optional service by name, outside the inject contract.
|
|
15
|
+
*
|
|
16
|
+
* One external plugin must never take the GUI down: an unsupported read is
|
|
17
|
+
* reported as "no such service" instead of reaching the shell's boot check.
|
|
18
|
+
* @param ctx - the browser plugin context.
|
|
19
|
+
* @param name - the service name to resolve.
|
|
20
|
+
* @returns the service, or undefined when this deployment serves none.
|
|
21
|
+
*/
|
|
22
|
+
export declare function optionalService(ctx: ClientContext, name: string): unknown;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-half installer for the team provider.
|
|
3
|
+
*
|
|
4
|
+
* A provider's browser half registers its own contributions into the child seats
|
|
5
|
+
* the board declares; it resolves the board's client capability face from the
|
|
6
|
+
* shared service name and adds no HTTP surface of its own. The board publishes
|
|
7
|
+
* that service inside its own apply and the aggregate mounts client children
|
|
8
|
+
* without ordering those applies, so the seats live behind a cordis dependency
|
|
9
|
+
* scope (ctx.inject) rather than a one-shot lookup: the scope mounts when the
|
|
10
|
+
* board serves the service and unloads — releasing every seat — when it is
|
|
11
|
+
* withdrawn.
|
|
12
|
+
*
|
|
13
|
+
* @module dsh-task-board-team/client/team/extension
|
|
14
|
+
*/
|
|
15
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
16
|
+
/** The live switch the installer follows; the settings form supplies it. */
|
|
17
|
+
export interface ExtensionEnabledSource {
|
|
18
|
+
/** Whether the extension is currently enabled (absent config means enabled). */
|
|
19
|
+
read(): boolean;
|
|
20
|
+
/** Observe switch changes; the returned disposer removes the listener. */
|
|
21
|
+
subscribe(listener: () => void): () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Install the team browser half.
|
|
25
|
+
* @param ctx - client context (slot registry).
|
|
26
|
+
* @param source - the extension's live enabled switch.
|
|
27
|
+
* @returns disposer releasing every contribution.
|
|
28
|
+
*/
|
|
29
|
+
export declare function installTeamClientHalf(ctx: ClientContext, source: ExtensionEnabledSource): () => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two rendering seats of the team provider: the task-detail section and the
|
|
3
|
+
* card decoration.
|
|
4
|
+
*
|
|
5
|
+
* Both read the published summary the Host pushes through the board mirror; the
|
|
6
|
+
* card payload itself (the issue id, attempt id and lease) is read off the card
|
|
7
|
+
* the seat was handed, so a mirror card is recognizable even before the first
|
|
8
|
+
* summary arrives.
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-task-board-team/client/team/sections
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactElement } from 'react';
|
|
13
|
+
import type { TaskBoardCardDecorationProps, TaskBoardDetailSectionProps } from '../../core/contract.ts';
|
|
14
|
+
import { type TeamIssueLink } from '../../core/identity.ts';
|
|
15
|
+
/**
|
|
16
|
+
* Translate one hub status.
|
|
17
|
+
* @param status - the collaboration status the hub reported.
|
|
18
|
+
* @returns the localized label, or the raw status for a value this build predates.
|
|
19
|
+
*/
|
|
20
|
+
export declare function statusLabel(status: string | undefined): string;
|
|
21
|
+
/**
|
|
22
|
+
* The hub status badge of one mirrored card.
|
|
23
|
+
* @param props - the card the board renders.
|
|
24
|
+
* @returns the badge, or nothing for a card that mirrors no issue.
|
|
25
|
+
*/
|
|
26
|
+
export declare function TeamCardDecoration({ task }: TaskBoardCardDecorationProps): ReactElement | null;
|
|
27
|
+
/**
|
|
28
|
+
* The team section of one card's detail view.
|
|
29
|
+
* @param props - the card the board renders, plus the action dispatcher.
|
|
30
|
+
* @returns the section, or nothing for a card that mirrors no issue.
|
|
31
|
+
*/
|
|
32
|
+
export declare function TeamDetailSection({ task }: TaskBoardDetailSectionProps): ReactElement | null;
|
|
33
|
+
/**
|
|
34
|
+
* Render the issue identity of one linkage.
|
|
35
|
+
* @param link - the card's linkage back to the hub.
|
|
36
|
+
* @returns the label, e.g. "issue #12".
|
|
37
|
+
*/
|
|
38
|
+
export declare function issueLabel(link: TeamIssueLink): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The team configuration block inside the board's own settings card.
|
|
3
|
+
*
|
|
4
|
+
* It renders what the Host published (hub URL, team id, hostname, whether a Host
|
|
5
|
+
* Token is configured, the live connection state and which optional board
|
|
6
|
+
* capabilities this deployment really serves) and it writes through the board's
|
|
7
|
+
* same-origin action channel, which is the only channel a provider has. A token
|
|
8
|
+
* value travels exactly once, from this input to the Host, and is never read
|
|
9
|
+
* back: the field always renders empty and the status line says whether one is
|
|
10
|
+
* stored.
|
|
11
|
+
*
|
|
12
|
+
* The block stays reachable while the extension is switched off, because it is
|
|
13
|
+
* where the switch is turned back on; it only reports that fact instead of
|
|
14
|
+
* pretending the forms still apply.
|
|
15
|
+
*
|
|
16
|
+
* @module dsh-task-board-team/client/team/settings
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactElement } from 'react';
|
|
19
|
+
import type { TaskBoardSettingsSectionProps } from '../../core/contract.ts';
|
|
20
|
+
import type { TeamExtensionSummary } from '../../host/service.ts';
|
|
21
|
+
/** What the published summary carries about the configuration itself. */
|
|
22
|
+
interface PublishedConfiguration {
|
|
23
|
+
hubUrl?: string;
|
|
24
|
+
teamId?: string;
|
|
25
|
+
hostname?: string;
|
|
26
|
+
tokenConfigured?: boolean;
|
|
27
|
+
questionWaitMinutes?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read the configuration half of one summary.
|
|
31
|
+
* @param summary - the published summary, or undefined.
|
|
32
|
+
* @returns the configuration fields the card renders.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readConfiguration(summary: TeamExtensionSummary | undefined): PublishedConfiguration;
|
|
35
|
+
/**
|
|
36
|
+
* The settings block.
|
|
37
|
+
* @param props - the board's settings seat props.
|
|
38
|
+
* @returns the block.
|
|
39
|
+
*/
|
|
40
|
+
export declare function TeamSettingsSection({ dispatch }: TaskBoardSettingsSectionProps): ReactElement;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TeamExtensionSummary } from '../../host/service.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Take the summaries the board snapshot carries.
|
|
4
|
+
* @param extensions - the snapshot's published extension summaries.
|
|
5
|
+
*/
|
|
6
|
+
export declare function acceptPublishedSummaries(extensions: Readonly<Record<string, unknown>> | undefined): void;
|
|
7
|
+
/** Drop the published summary: a hidden provider must not look like live state. */
|
|
8
|
+
export declare function clearSummary(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Read the live summary.
|
|
11
|
+
* @returns the summary, or undefined before the Host published one.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSummary(): TeamExtensionSummary | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Read one card's collaboration view.
|
|
16
|
+
* @param taskId - the board card id.
|
|
17
|
+
* @returns the view, or undefined when this card mirrors no issue.
|
|
18
|
+
*/
|
|
19
|
+
export declare function cardViewOf(taskId: string): TeamExtensionSummary['cards'][string] | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe one component to the live summary.
|
|
22
|
+
* @returns the current summary and a re-render on every change.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useTeamSummary(): TeamExtensionSummary | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Validate one published payload into the summary shape.
|
|
27
|
+
*
|
|
28
|
+
* A payload from another revision of this extension is read for the fields it
|
|
29
|
+
* does carry and never trusted for the ones it does not, so a version skew
|
|
30
|
+
* degrades one section instead of throwing inside the board's render.
|
|
31
|
+
* @param raw - the opaque payload the board forwarded.
|
|
32
|
+
* @returns the summary, or undefined when it carries no usable shape.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readSummary(raw: unknown): TeamExtensionSummary | undefined;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-shape restatement of the task board's external-provider contract.
|
|
3
|
+
*
|
|
4
|
+
* The board owns this contract (`packages/dsh-task-board/src/core/extension.ts`)
|
|
5
|
+
* and this package may not import the board's internals, so every type and
|
|
6
|
+
* constant the extension consumes is restated here with an identical shape and
|
|
7
|
+
* resolved at runtime through the shared cordis service name. Nothing in this
|
|
8
|
+
* module is a value import of a board package: the declarations are erased and
|
|
9
|
+
* the service lookup is a plain property read.
|
|
10
|
+
*
|
|
11
|
+
* Two capabilities ride the contract as OPTIONAL members (the API version stays
|
|
12
|
+
* 1): `sessions.followUp` and `tasks.rework`. A provider probes for them and
|
|
13
|
+
* degrades visibly where a deployment serves neither, which is what
|
|
14
|
+
* {@link probeTaskBoardCapabilities} reports.
|
|
15
|
+
*
|
|
16
|
+
* @module dsh-task-board-team/core/contract
|
|
17
|
+
*/
|
|
18
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
19
|
+
import type { ExecutionOutcome, TaskRecord, TaskStatus } from './task-record.ts';
|
|
20
|
+
/** Cordis service name the board's host and browser halves each publish. */
|
|
21
|
+
export declare const TASK_BOARD_SERVICE_NAME = "taskBoard";
|
|
22
|
+
/** Contract version this extension was built against. */
|
|
23
|
+
export declare const TASK_BOARD_API_VERSION = 1;
|
|
24
|
+
/** Child seat a provider registers its task-detail section into. */
|
|
25
|
+
export declare const TASK_BOARD_DETAIL_SECTION = "task-board.detail.section";
|
|
26
|
+
/** Child seat a provider registers its settings section into. */
|
|
27
|
+
export declare const TASK_BOARD_SETTINGS_SECTION = "task-board.settings.section";
|
|
28
|
+
/** Child seat a provider registers its card decoration into. */
|
|
29
|
+
export declare const TASK_BOARD_CARD_DECORATION = "task-board.card.decoration";
|
|
30
|
+
/** Largest free text one provider call pushes into an execution, in characters. */
|
|
31
|
+
export declare const TASK_BOARD_MESSAGE_MAX_LENGTH = 4000;
|
|
32
|
+
/** One opaque provider payload the board stores without interpreting. */
|
|
33
|
+
export type TaskBoardExtensionPayload = Record<string, unknown>;
|
|
34
|
+
/** One action the browser half dispatches over the board's same-origin channel. */
|
|
35
|
+
export interface TaskBoardExtensionActionRequest {
|
|
36
|
+
/** Id of the extension the action belongs to. */
|
|
37
|
+
extensionId: string;
|
|
38
|
+
/** Provider-owned action name, routed back to this extension's handleAction. */
|
|
39
|
+
action: string;
|
|
40
|
+
/** Task the action targets, when it targets one. */
|
|
41
|
+
taskId?: string;
|
|
42
|
+
/** Opaque provider payload. */
|
|
43
|
+
payload?: TaskBoardExtensionPayload;
|
|
44
|
+
}
|
|
45
|
+
/** Deliver one extension action through the board's same-origin action channel. */
|
|
46
|
+
export type TaskBoardExtensionDispatch = (request: TaskBoardExtensionActionRequest) => Promise<boolean>;
|
|
47
|
+
/** Draft one provider creates a task from. */
|
|
48
|
+
export interface TaskBoardTaskDraft {
|
|
49
|
+
title: string;
|
|
50
|
+
description: string;
|
|
51
|
+
prompt: string;
|
|
52
|
+
/** Column the created card opens in; absent means the board default. */
|
|
53
|
+
status?: TaskStatus;
|
|
54
|
+
/** Parent card id, when the provider materializes a subtask. */
|
|
55
|
+
parentId?: string;
|
|
56
|
+
/** Workspace the execution must run in; absent leaves the board's own rules. */
|
|
57
|
+
workspaceId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Agent preset the created card's execution must be composed from.
|
|
60
|
+
*
|
|
61
|
+
* Optional in the contract like the two capability members, so a provider
|
|
62
|
+
* passes it and then CHECKS it survived: a board revision that serves no draft
|
|
63
|
+
* preset drops the field silently, and a card that fell back to the deployment
|
|
64
|
+
* default must not be started as if the member's own preset had been pinned.
|
|
65
|
+
*/
|
|
66
|
+
mode?: string;
|
|
67
|
+
/** Pinned model for the created card's execution. */
|
|
68
|
+
model?: string;
|
|
69
|
+
/** Reasoning effort for that model route. */
|
|
70
|
+
reasoningEffort?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Options of {@link TaskBoardTasksFace.create}. */
|
|
73
|
+
export interface TaskBoardCreateOptions {
|
|
74
|
+
/** Opaque payload stored under the creating extension's id. */
|
|
75
|
+
payload?: TaskBoardExtensionPayload;
|
|
76
|
+
/** Create the card off-board: it exists in the ledger but is never shown. */
|
|
77
|
+
hidden?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** One task linked to an extension, with that extension's own payload. */
|
|
80
|
+
export interface TaskBoardLinkedTask {
|
|
81
|
+
task: TaskRecord;
|
|
82
|
+
payload: TaskBoardExtensionPayload;
|
|
83
|
+
}
|
|
84
|
+
/** Task reads and writes the board grants an extension. */
|
|
85
|
+
export interface TaskBoardTasksFace {
|
|
86
|
+
/** Every task in the ledger, most recent mutation last. */
|
|
87
|
+
list(): readonly TaskRecord[];
|
|
88
|
+
/** One task by id, or undefined. */
|
|
89
|
+
get(taskId: string): TaskRecord | undefined;
|
|
90
|
+
/** Create a task through the board's own creation gate. Throws on refusal. */
|
|
91
|
+
create(draft: TaskBoardTaskDraft, options?: TaskBoardCreateOptions): TaskRecord;
|
|
92
|
+
/** Patch a task's content through the board's content gate. Throws when frozen. */
|
|
93
|
+
patchContent(taskId: string, patch: {
|
|
94
|
+
title?: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
prompt?: string;
|
|
97
|
+
}): void;
|
|
98
|
+
/** Move a task through the board's status gates. Throws on refusal. */
|
|
99
|
+
setStatus(taskId: string, status: TaskStatus, initiator?: string): void;
|
|
100
|
+
/** Every task carrying this extension's payload. */
|
|
101
|
+
linked(): readonly TaskBoardLinkedTask[];
|
|
102
|
+
/**
|
|
103
|
+
* Re-run an executed card in its ORIGINAL session with rework instructions.
|
|
104
|
+
*
|
|
105
|
+
* Optional in the contract: a board built against the earlier shape serves
|
|
106
|
+
* none, so a provider probes before using it.
|
|
107
|
+
*/
|
|
108
|
+
rework?(taskId: string, instructions: string, initiator?: string): void;
|
|
109
|
+
}
|
|
110
|
+
/** Execution-session face: delivery into a run the board already has. */
|
|
111
|
+
export interface TaskBoardSessionsFace {
|
|
112
|
+
/** Queue one follow-up user message into the card's current or latest session. */
|
|
113
|
+
followUp(taskId: string, text: string): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
/** Storage face for one extension's own payload on a task. */
|
|
116
|
+
export interface TaskBoardIntegrationFace {
|
|
117
|
+
/** Read this extension's payload, or undefined when the task carries none. */
|
|
118
|
+
read(taskId: string): TaskBoardExtensionPayload | undefined;
|
|
119
|
+
/** Shallow-merge this extension's payload into the task. */
|
|
120
|
+
write(taskId: string, payload: TaskBoardExtensionPayload): void;
|
|
121
|
+
}
|
|
122
|
+
/** Status-change notification. */
|
|
123
|
+
export interface TaskBoardStatusChangedEvent {
|
|
124
|
+
taskId: string;
|
|
125
|
+
status: TaskStatus;
|
|
126
|
+
previous: TaskStatus;
|
|
127
|
+
initiator?: string;
|
|
128
|
+
}
|
|
129
|
+
/** Execution-settlement notification. */
|
|
130
|
+
export interface TaskBoardExecutionSettledEvent {
|
|
131
|
+
taskId: string;
|
|
132
|
+
executionId: string;
|
|
133
|
+
outcome: ExecutionOutcome;
|
|
134
|
+
error?: string;
|
|
135
|
+
}
|
|
136
|
+
/** Task-deletion notification. */
|
|
137
|
+
export interface TaskBoardTaskDeletedEvent {
|
|
138
|
+
taskId: string;
|
|
139
|
+
}
|
|
140
|
+
/** Event subscriptions an extension registers for; every callback runs isolated. */
|
|
141
|
+
export interface TaskBoardEventFace {
|
|
142
|
+
onStatusChanged(callback: (event: TaskBoardStatusChangedEvent) => void): () => void;
|
|
143
|
+
onExecutionSettled(callback: (event: TaskBoardExecutionSettledEvent) => void): () => void;
|
|
144
|
+
onTaskDeleted(callback: (event: TaskBoardTaskDeletedEvent) => void): () => void;
|
|
145
|
+
}
|
|
146
|
+
/** Host capability face handed to one extension while it is started. */
|
|
147
|
+
export interface TaskBoardExtensionHost {
|
|
148
|
+
tasks: TaskBoardTasksFace;
|
|
149
|
+
/** Delivery into a card's execution session; optional member of the contract. */
|
|
150
|
+
sessions?: TaskBoardSessionsFace;
|
|
151
|
+
integration: TaskBoardIntegrationFace;
|
|
152
|
+
events: TaskBoardEventFace;
|
|
153
|
+
/** Publish this extension's read-only summary into the board snapshot. */
|
|
154
|
+
publish(summary: TaskBoardExtensionPayload): void;
|
|
155
|
+
/** Register one model-visible tool; the returned disposer unregisters it. */
|
|
156
|
+
registerTool(definition: ToolDefinition): () => void;
|
|
157
|
+
}
|
|
158
|
+
/** One external provider contributed to the task board. */
|
|
159
|
+
export interface TaskBoardExtension {
|
|
160
|
+
/** Stable extension id; also the key of this extension's integration payload. */
|
|
161
|
+
readonly id: string;
|
|
162
|
+
/** Contract version this extension was built against. */
|
|
163
|
+
readonly apiVersion: number;
|
|
164
|
+
/** Volatile per-extension switch; absent means enabled. Read at use time. */
|
|
165
|
+
enabled?(): boolean;
|
|
166
|
+
/** Acquire the capability face and start any provider-side work. */
|
|
167
|
+
start?(host: TaskBoardExtensionHost): void;
|
|
168
|
+
/** Release provider-side work. Never clears stored data. */
|
|
169
|
+
stop?(): void;
|
|
170
|
+
/** Route one dispatched action; the returned value goes back to the dispatcher. */
|
|
171
|
+
handleAction?(request: TaskBoardExtensionActionRequest): unknown | Promise<unknown>;
|
|
172
|
+
}
|
|
173
|
+
/** Which optional capabilities the board serving this deployment really has. */
|
|
174
|
+
export interface TaskBoardCapabilities {
|
|
175
|
+
/** The board can deliver a follow-up message into an execution session. */
|
|
176
|
+
followUp: boolean;
|
|
177
|
+
/** The board can re-run an executed card in its own session. */
|
|
178
|
+
rework: boolean;
|
|
179
|
+
/** The host process exposes the board's own action surface (see {@link TaskBoardActionSeat}). */
|
|
180
|
+
run: boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The board's in-process action seat.
|
|
184
|
+
*
|
|
185
|
+
* The provider contract covers everything this extension does EXCEPT starting an
|
|
186
|
+
* execution: the capability face has create, patch, move, follow-up and rework,
|
|
187
|
+
* and no member that runs a card. The board's host face does carry the action
|
|
188
|
+
* applier the browser and the remote bridge drive it through, so the row probes
|
|
189
|
+
* for it and records the capability as absent when a deployment serves none —
|
|
190
|
+
* the mirror card is still created and the settings card says this Host cannot
|
|
191
|
+
* start it.
|
|
192
|
+
*/
|
|
193
|
+
export interface TaskBoardActionSeat {
|
|
194
|
+
/** Apply one board action through every gate the board already has. */
|
|
195
|
+
apply(requestId: string, action: Record<string, unknown>, initiator?: string): unknown;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Probe the optional capabilities of the capability face one board handed over.
|
|
199
|
+
* @param host - the capability face a provider was started with.
|
|
200
|
+
* @param run - whether the row found the board's action seat.
|
|
201
|
+
* @returns which optional capabilities this deployment really serves.
|
|
202
|
+
*/
|
|
203
|
+
export declare function probeTaskBoardCapabilities(host: TaskBoardExtensionHost, run: boolean): TaskBoardCapabilities;
|
|
204
|
+
/** Host-half service face published under {@link TASK_BOARD_SERVICE_NAME}. */
|
|
205
|
+
export interface TaskBoardHostFace {
|
|
206
|
+
/** Admit one provider extension; the returned disposer releases it. */
|
|
207
|
+
registerExtension(extension: TaskBoardExtension): () => void;
|
|
208
|
+
/** Whether the board currently runs a given extension. */
|
|
209
|
+
isExtensionEnabled(extensionId: string): boolean;
|
|
210
|
+
/** The board's in-process action seat, when this board revision serves one. */
|
|
211
|
+
apply?(requestId: string, action: Record<string, unknown>, initiator?: string): unknown;
|
|
212
|
+
}
|
|
213
|
+
/** The narrow context seat the resolvers need. */
|
|
214
|
+
export interface ContextSeat {
|
|
215
|
+
get(name: string): unknown;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Resolve the board's host-half face by service name.
|
|
219
|
+
* @param ctx - host context.
|
|
220
|
+
* @returns the host face, or undefined when the board is not loaded.
|
|
221
|
+
*/
|
|
222
|
+
export declare function resolveTaskBoardHostFace(ctx: ContextSeat): TaskBoardHostFace | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Resolve the board's in-process action seat from the same service.
|
|
225
|
+
* @param ctx - host context.
|
|
226
|
+
* @returns the seat, or undefined when this board revision serves no applier.
|
|
227
|
+
*/
|
|
228
|
+
export declare function resolveTaskBoardActionSeat(ctx: ContextSeat): TaskBoardActionSeat | undefined;
|
|
229
|
+
/** Owner props of the task-detail seat. */
|
|
230
|
+
export interface TaskBoardDetailSectionProps {
|
|
231
|
+
task: TaskRecord;
|
|
232
|
+
dispatch: TaskBoardExtensionDispatch;
|
|
233
|
+
}
|
|
234
|
+
/** Owner props of the settings seat. */
|
|
235
|
+
export interface TaskBoardSettingsSectionProps {
|
|
236
|
+
dispatch: TaskBoardExtensionDispatch;
|
|
237
|
+
}
|
|
238
|
+
/** Owner props of the card-decoration seat. */
|
|
239
|
+
export interface TaskBoardCardDecorationProps {
|
|
240
|
+
task: TaskRecord;
|
|
241
|
+
}
|
|
242
|
+
/** Board mirror an extension's browser half observes. */
|
|
243
|
+
export interface TaskBoardClientMirror {
|
|
244
|
+
/** Whether the board's master switch currently runs the extension faces. */
|
|
245
|
+
enabled: boolean;
|
|
246
|
+
/** Tasks the board currently holds. */
|
|
247
|
+
tasks: readonly TaskRecord[];
|
|
248
|
+
/** Published extension summaries, keyed by extension id. */
|
|
249
|
+
extensions: Readonly<Record<string, unknown>>;
|
|
250
|
+
}
|
|
251
|
+
/** Whether a task should be shown on the board; false hides it. */
|
|
252
|
+
export type TaskBoardVisibilityPredicate = (task: TaskRecord) => boolean;
|
|
253
|
+
/** Client capability face the board's browser half provides. */
|
|
254
|
+
export interface TaskBoardClientFace {
|
|
255
|
+
/** Deliver one action through the board's same-origin action channel. */
|
|
256
|
+
dispatch(request: TaskBoardExtensionActionRequest): Promise<boolean>;
|
|
257
|
+
/** Register one card visibility predicate; the returned disposer removes it. */
|
|
258
|
+
registerVisibility(predicate: TaskBoardVisibilityPredicate): () => void;
|
|
259
|
+
/** Subscribe to the board mirror. */
|
|
260
|
+
subscribe(callback: (mirror: TaskBoardClientMirror) => void): () => void;
|
|
261
|
+
/** Read the current board mirror. */
|
|
262
|
+
snapshot(): TaskBoardClientMirror;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Resolve the board's browser-half client face by service name.
|
|
266
|
+
* @param ctx - browser context.
|
|
267
|
+
* @returns the client face, or undefined when the board is not loaded.
|
|
268
|
+
*/
|
|
269
|
+
export declare function resolveTaskBoardClientFace(ctx: ContextSeat): TaskBoardClientFace | undefined;
|