dsh-project-tasks 0.0.0-stage → 0.1.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.
@@ -0,0 +1,8 @@
1
+ import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ /**
3
+ * Render the checklist glyph at the size the sidebar asks for; the sidebar owns
4
+ * the accessible navigation label.
5
+ * @param props - the sidebar's icon share.
6
+ * @returns decorative checklist icon.
7
+ */
8
+ export declare function TaskBoardIcon({ size }: PropsRuntime<'sidebar.panellist'>): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import type { PropsLocale, PropsRuntime, SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
2
+ /** Minimal workspace-list snapshot the page reads (paths + titles). */
3
+ export interface WorkspaceListView {
4
+ readonly items: readonly {
5
+ readonly path: string;
6
+ readonly title: string;
7
+ }[];
8
+ }
9
+ /** Injected services the page uses. */
10
+ export interface TaskBoardInjected {
11
+ /** Workspace list, for the project selector and default project. */
12
+ readonly useWorkspaces: SnapshotSelectorHook<WorkspaceListView>;
13
+ /** The current session's working directory (its project), when known. */
14
+ readonly currentProject?: string | undefined;
15
+ }
16
+ /** Root-scoped page props. */
17
+ export type TaskBoardPageProps = PropsRuntime<'main'> & TaskBoardInjected & PropsLocale<'taskBoard'>;
18
+ /**
19
+ * Render the task board.
20
+ * @param props - injected services and copy.
21
+ * @returns the global task-board page.
22
+ */
23
+ export declare function TaskBoardPage(props: TaskBoardPageProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ /** Browser client for the /taskboard host routes: typed fetch wrappers
2
+ * (same origin as the GUI) plus the SSE subscription that keeps the board live. */
3
+ import type { BoardState, CreateTaskBody, TaskDto, UpdateTaskBody } from '../types.ts';
4
+ /** Read the full board snapshot. */
5
+ export declare function fetchState(signal?: AbortSignal): Promise<BoardState>;
6
+ /** Create a task. */
7
+ export declare function createTask(input: CreateTaskBody): Promise<TaskDto>;
8
+ /** Update a task (title/description/priority/status/doneSummary/doneFiles). */
9
+ export declare function updateTask(input: UpdateTaskBody): Promise<TaskDto>;
10
+ /** Delete a task. */
11
+ export declare function deleteTask(id: string): Promise<boolean>;
12
+ /** Run a lifecycle action (start/verify/reject/block/unblock) on a task. */
13
+ export declare function taskAction(id: string, action: NonNullable<UpdateTaskBody['action']>, reason?: string): Promise<TaskDto>;
14
+ /** Archive every done task (optionally scoped to a project); returns the count. */
15
+ export declare function archiveDone(project?: string): Promise<number>;
16
+ /** Enable/disable the background auto-claim poller. */
17
+ export declare function setAutoClaim(enabled: boolean): Promise<boolean>;
18
+ /**
19
+ * Subscribe to the board's live state over SSE.
20
+ * @param onState - called with every pushed board state (including the opening one).
21
+ * @returns a function closing the connection.
22
+ */
23
+ export declare function subscribeBoard(onState: (state: BoardState) => void): () => void;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * DSH Task Board, browser half: contributes one global page in the root `main`
3
+ * slot plus its sidebar entry. The page is a three-column kanban of project
4
+ * tasks that talks to the Host `/taskboard` routes and stays live over SSE.
5
+ *
6
+ * Tasks are attributed to a project (workspace path); the human creates and
7
+ * manages them, and an agent processes a project's pending tasks via the
8
+ * Host-side `task_board_*` tools (see the package's Host half).
9
+ */
10
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
11
+ import { type TaskBoardKey } from './locales.ts';
12
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
13
+ interface LocaleNamespaceMap {
14
+ /** Task board copy. */
15
+ 'taskBoard': TaskBoardKey;
16
+ }
17
+ }
18
+ export type { TaskBoardPageProps, TaskBoardInjected } from './TaskBoardPage.tsx';
19
+ /**
20
+ * Required services: the slot registry and dictionaries, the layout that owns
21
+ * the main-panel selection, and the workspace list for the project selector.
22
+ */
23
+ export declare const inject: string[];
24
+ /**
25
+ * Client plugin body: register the dictionaries, the global task board page, and
26
+ * the sidebar entry that selects it.
27
+ * @param ctx - client root context.
28
+ */
29
+ export declare function apply(ctx: ClientContext): void;
@@ -0,0 +1,73 @@
1
+ /** `taskBoard` namespace dictionaries. */
2
+ /** Dictionary namespace owned by this plugin. */
3
+ export declare const NS = "taskBoard";
4
+ /** Simplified Chinese dictionary (source of truth for keys). */
5
+ export declare const zh: {
6
+ 'panel.label': string;
7
+ 'page.title': string;
8
+ 'page.subtitle': string;
9
+ refresh: string;
10
+ loading: string;
11
+ 'auto.label': string;
12
+ 'auto.hint': string;
13
+ 'project.label': string;
14
+ 'project.all': string;
15
+ 'project.unknown': string;
16
+ 'new.action': string;
17
+ 'new.placeholder.title': string;
18
+ 'new.placeholder.description': string;
19
+ 'new.projectPrompt': string;
20
+ 'new.readyNow': string;
21
+ 'new.submit': string;
22
+ 'new.cancel': string;
23
+ 'priority.label': string;
24
+ 'priority.all': string;
25
+ 'priority.low': string;
26
+ 'priority.normal': string;
27
+ 'priority.high': string;
28
+ 'column.draft': string;
29
+ 'column.ready': string;
30
+ 'column.in_progress': string;
31
+ 'column.review': string;
32
+ 'column.done': string;
33
+ 'column.blocked': string;
34
+ 'column.empty.draft': string;
35
+ 'column.empty.ready': string;
36
+ 'column.empty.in_progress': string;
37
+ 'column.empty.review': string;
38
+ 'column.empty.done': string;
39
+ 'column.empty.blocked': string;
40
+ 'act.confirmReady': string;
41
+ 'act.start': string;
42
+ 'act.complete': string;
43
+ 'act.verify': string;
44
+ 'act.reject': string;
45
+ 'act.block': string;
46
+ 'act.unblock': string;
47
+ 'act.archive': string;
48
+ 'act.unarchive': string;
49
+ 'archive.open': string;
50
+ 'archive.back': string;
51
+ 'archive.title': string;
52
+ 'archive.empty': string;
53
+ 'archive.allDone': string;
54
+ 'archive.showMore': string;
55
+ 'archive.showLess': string;
56
+ 'card.claimedBy': string;
57
+ 'card.doneSummary': string;
58
+ 'card.blockedReason': string;
59
+ 'card.delete': string;
60
+ 'card.confirmDelete': string;
61
+ 'card.noSummary': string;
62
+ 'empty.title': string;
63
+ 'empty.hint': string;
64
+ 'error.load': string;
65
+ 'time.now': string;
66
+ 'time.minutes': string;
67
+ 'time.hours': string;
68
+ 'time.days': string;
69
+ };
70
+ /** Type keyed by the Chinese dictionary. */
71
+ export type TaskBoardKey = keyof typeof zh;
72
+ /** English dictionary (must match every key). */
73
+ export declare const en: Record<TaskBoardKey, string>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * DSH Task Board — Host half.
3
+ *
4
+ * Provides a project-scoped task ledger (durable via `storage-domain`), three
5
+ * agent tools (`task_board_list` / `task_board_claim` / `task_board_complete`),
6
+ * a system-prompt section that teaches the model the pull→claim→complete flow,
7
+ * and the `/taskboard` HTTP + SSE routes the browser half reads.
8
+ *
9
+ * Task ownership is derived from the calling session's working directory, so an
10
+ * agent "processes the tasks of the project it is running in" by default.
11
+ */
12
+ import type { Context } from '@deepseek-ai/cordis';
13
+ /** Tools, prompt, and the services this plugin reads lazily. */
14
+ export declare const inject: string[];
15
+ /**
16
+ * Register the host half: open the task domain, expose the tools, the prompt
17
+ * section, and the web routes.
18
+ * @param ctx - host root context.
19
+ */
20
+ export declare function apply(ctx: Context): Promise<void>;
@@ -0,0 +1,3 @@
1
+ /** Model-facing guidance for the task board, registered as a system-prompt
2
+ * section so an agent knows how to pull and process a project's tasks. */
3
+ export declare const PROMPT_TEXT: string;
@@ -0,0 +1,9 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { TaskStore } from './store.ts';
3
+ /**
4
+ * Register the task-board routes on the web server.
5
+ * @param ctx - context carrying `webServer` and the event bus.
6
+ * @param store - the task store.
7
+ * @returns disposer removing all routes and closing SSE connections.
8
+ */
9
+ export declare function registerTaskBoardRoutes(ctx: Context, store: TaskStore): () => void;
@@ -0,0 +1,100 @@
1
+ import type { Domain } from '@deepseek-ai/dsh-storage-domain';
2
+ import type { BoardState, Task, TaskDto, TaskStatus } from './types.ts';
3
+ /** The durable task domain: one `tasks` table keyed by task id. */
4
+ export declare const taskBoardDomain: {
5
+ name: string;
6
+ version: number;
7
+ tables: {
8
+ tasks: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, {
9
+ id: string;
10
+ project: string;
11
+ title: string;
12
+ status: "draft" | "ready" | "in_progress" | "review" | "done" | "blocked";
13
+ priority: "low" | "normal" | "high";
14
+ createdAt: number;
15
+ updatedAt: number;
16
+ description?: string | undefined;
17
+ claimedBy?: {
18
+ sessionId: string;
19
+ at: number;
20
+ } | undefined;
21
+ doneSummary?: string | undefined;
22
+ doneFiles?: string[] | undefined;
23
+ blockedFrom?: "draft" | "ready" | "in_progress" | "review" | "done" | undefined;
24
+ blockedReason?: string | undefined;
25
+ archived?: boolean | undefined;
26
+ }>;
27
+ };
28
+ };
29
+ /** Open handle type for the task domain. */
30
+ export type TaskDomain = Domain<typeof taskBoardDomain>;
31
+ /** Rank a priority for sorting (higher = more urgent). */
32
+ export declare function priorityRank(priority: Task['priority']): number;
33
+ /** Order tasks by priority (high first), then most-recently updated. */
34
+ export declare function byPriorityThenUpdated(a: TaskDto, b: TaskDto): number;
35
+ /** Normalize a project path so the same workspace always buckets together. */
36
+ export declare function normalizeProject(project: string): string;
37
+ /** All task operations plus revision tracking over one open domain. */
38
+ export declare class TaskStore {
39
+ private readonly table;
40
+ private rev;
41
+ private autoClaimFlag;
42
+ private listeners;
43
+ /** @param domain - an opened task-board domain. */
44
+ constructor(domain: TaskDomain);
45
+ /** Snapshot every task (synchronous from the validated in-memory state). */
46
+ all(): TaskDto[];
47
+ /** Current board state with the current revision. */
48
+ state(): BoardState;
49
+ /** Whether the background auto-claim poller is enabled. */
50
+ get autoClaim(): boolean;
51
+ /** Enable/disable the background auto-claim poller. */
52
+ setAutoClaim(enabled: boolean): void;
53
+ /** List tasks, optionally filtered by project and/or a set of statuses. */
54
+ list(filter?: {
55
+ project?: string;
56
+ statuses?: readonly TaskStatus[];
57
+ includeArchived?: boolean;
58
+ }): TaskDto[];
59
+ /** Archive one task (hidden from the live board, kept in the archive view). */
60
+ archive(id: string, now?: number): Promise<TaskDto>;
61
+ /** Restore one archived task to the board. */
62
+ unarchive(id: string, now?: number): Promise<TaskDto>;
63
+ /** Archive every done task (optionally scoped to a project); returns the count. */
64
+ archiveAllDone(project?: string, now?: number): Promise<number>;
65
+ /** Read one task by id. */
66
+ get(id: string): TaskDto | undefined;
67
+ /** Subscribe to board-state changes (called after each durable write). */
68
+ subscribe(listener: (state: BoardState) => void): () => void;
69
+ private emit;
70
+ /** Create one task; defaults to `draft` (not yet finalized). */
71
+ create(input: {
72
+ project: string;
73
+ title: string;
74
+ description?: string;
75
+ priority?: Task['priority'];
76
+ status?: Extract<TaskStatus, 'draft' | 'ready'>;
77
+ }, now?: number): Promise<TaskDto>;
78
+ /** Patch a task; status is free-form (the store does not enforce a graph). */
79
+ update(id: string, patch: Partial<Omit<Task, 'id' | 'project' | 'createdAt'>> & Record<string, unknown>, now?: number): Promise<TaskDto>;
80
+ /**
81
+ * Move a task into in_progress and record its owner. Accepts `draft`, `ready`
82
+ * (and re-claims `in_progress` for a new owner). This is the "start"/claim edge.
83
+ */
84
+ claim(id: string, sessionId: string, now?: number): Promise<TaskDto>;
85
+ /** Complete a task's work: `in_progress → review`, recording summary/files. */
86
+ complete(id: string, input: {
87
+ summary: string;
88
+ files?: readonly string[];
89
+ }, now?: number): Promise<TaskDto>;
90
+ /** Human acceptance: `review → done`. */
91
+ verify(id: string, now?: number): Promise<TaskDto>;
92
+ /** Human rejection of a review: back to `in_progress` (clears the claim owner). */
93
+ reject(id: string, now?: number): Promise<TaskDto>;
94
+ /** Block a task, remembering the state to restore. */
95
+ block(id: string, reason?: string, now?: number): Promise<TaskDto>;
96
+ /** Unblock a task, restoring the state it was blocked from. */
97
+ unblock(id: string, now?: number): Promise<TaskDto>;
98
+ /** Delete a task. */
99
+ remove(id: string): Promise<boolean>;
100
+ }
@@ -0,0 +1,126 @@
1
+ /** Shared task model for the DSH task board: durable records and the JSON DTOs
2
+ * the Host routes and the browser client exchange. */
3
+ import { z } from 'zod';
4
+ /**
5
+ * Lifecycle of one task.
6
+ * Main chain: draft → ready → in_progress → review → done.
7
+ * `blocked` is a side state (waiting on a dependency), plus `blockedFrom`
8
+ * remembers the state to restore.
9
+ */
10
+ export type TaskStatus = 'draft' | 'ready' | 'in_progress' | 'review' | 'done' | 'blocked';
11
+ /** Relative urgency of a task. */
12
+ export type TaskPriority = 'low' | 'normal' | 'high';
13
+ /** Who currently owns an in-progress task. */
14
+ export interface TaskClaim {
15
+ readonly sessionId: string;
16
+ /** Epoch ms when the task was claimed. */
17
+ readonly at: number;
18
+ }
19
+ /** One durable task record. `project` is the normalized workspace path the task
20
+ * belongs to (the owning session's working directory). */
21
+ export interface Task {
22
+ readonly id: string;
23
+ readonly project: string;
24
+ readonly title: string;
25
+ readonly description?: string;
26
+ readonly status: TaskStatus;
27
+ readonly priority: TaskPriority;
28
+ readonly createdAt: number;
29
+ readonly updatedAt: number;
30
+ readonly claimedBy?: TaskClaim;
31
+ /** Summary written when the task was completed (usually by the agent). */
32
+ readonly doneSummary?: string;
33
+ /** Files the completion touched, advisory. */
34
+ readonly doneFiles?: string[];
35
+ /** When `status` is `blocked`, the state to restore on unblock. */
36
+ readonly blockedFrom?: Exclude<TaskStatus, 'blocked'>;
37
+ /** When `status` is `blocked`, an optional reason. */
38
+ readonly blockedReason?: string;
39
+ /** Archived tasks are hidden from the board columns and shown in the archive view. */
40
+ readonly archived?: boolean;
41
+ }
42
+ /** Zod schema guarding every durable task record as read/written by the domain. */
43
+ export declare const taskSchema: z.ZodObject<{
44
+ id: z.ZodString;
45
+ project: z.ZodString;
46
+ title: z.ZodString;
47
+ description: z.ZodOptional<z.ZodString>;
48
+ status: z.ZodEnum<{
49
+ draft: "draft";
50
+ ready: "ready";
51
+ in_progress: "in_progress";
52
+ review: "review";
53
+ done: "done";
54
+ blocked: "blocked";
55
+ }>;
56
+ priority: z.ZodEnum<{
57
+ low: "low";
58
+ normal: "normal";
59
+ high: "high";
60
+ }>;
61
+ createdAt: z.ZodNumber;
62
+ updatedAt: z.ZodNumber;
63
+ claimedBy: z.ZodOptional<z.ZodObject<{
64
+ sessionId: z.ZodString;
65
+ at: z.ZodNumber;
66
+ }, z.core.$strip>>;
67
+ doneSummary: z.ZodOptional<z.ZodString>;
68
+ doneFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
69
+ blockedFrom: z.ZodOptional<z.ZodEnum<{
70
+ draft: "draft";
71
+ ready: "ready";
72
+ in_progress: "in_progress";
73
+ review: "review";
74
+ done: "done";
75
+ }>>;
76
+ blockedReason: z.ZodOptional<z.ZodString>;
77
+ archived: z.ZodOptional<z.ZodBoolean>;
78
+ }, z.core.$strip>;
79
+ /** Browser-facing task DTO (identical shape to the durable record). */
80
+ export type TaskDto = Task;
81
+ /** One board snapshot pushed to clients and returned by `/taskboard/api/state`. */
82
+ export interface BoardState {
83
+ /** Monotonic revision; clients refetch when they detect a gap. */
84
+ readonly rev: number;
85
+ readonly tasks: readonly TaskDto[];
86
+ /** Whether the background auto-claim poller is currently enabled. */
87
+ readonly autoClaim: boolean;
88
+ }
89
+ /** Create-task request body. */
90
+ export interface CreateTaskBody {
91
+ readonly project: string;
92
+ readonly title: string;
93
+ readonly description?: string;
94
+ readonly priority?: TaskPriority;
95
+ /** Initial status; defaults to `draft`. */
96
+ readonly status?: Extract<TaskStatus, 'draft' | 'ready'>;
97
+ }
98
+ /** Update-task request body (partial, status changes supported). */
99
+ export interface UpdateTaskBody {
100
+ readonly id: string;
101
+ readonly title?: string;
102
+ readonly description?: string;
103
+ readonly priority?: TaskPriority;
104
+ readonly status?: TaskStatus;
105
+ readonly doneSummary?: string;
106
+ readonly doneFiles?: string[];
107
+ readonly blockedReason?: string;
108
+ /** Optional lifecycle action that overrides a plain status patch. */
109
+ readonly action?: 'start' | 'claim' | 'verify' | 'reject' | 'block' | 'unblock' | 'archive' | 'unarchive';
110
+ }
111
+ /** Delete-task request body. */
112
+ export interface DeleteTaskBody {
113
+ readonly id: string;
114
+ }
115
+ /** Archive all done request body. */
116
+ export interface ArchiveDoneBody {
117
+ readonly project?: string;
118
+ }
119
+ /** Toggle the auto-claim poller request body. */
120
+ export interface SetAutoClaimBody {
121
+ readonly enabled: boolean;
122
+ }
123
+ /** All lifecycle states, in board order (blocked is rendered as its own column). */
124
+ export declare const TASK_STATUSES: readonly TaskStatus[];
125
+ /** The main chain states that participate in the normal forward flow. */
126
+ export declare const MAIN_CHAIN: readonly Exclude<TaskStatus, 'blocked'>[];
package/package.json CHANGED
@@ -1,6 +1,91 @@
1
1
  {
2
2
  "name": "dsh-project-tasks",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "Project task board for DSH: create tasks that belong to a project (workspace), let an agent pull a project's pending tasks, execute them, and mark them done — a three-column kanban (Todo / In progress / Done) with a host-authoritative task ledger and task_board_* agent tools.",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "hyper",
8
+ "keywords": [
9
+ "dsh-plugin",
10
+ "deepseek-harness",
11
+ "dsh",
12
+ "task",
13
+ "taskboard",
14
+ "kanban",
15
+ "project",
16
+ "agent"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/hyper-open/dsh-task-board.git"
21
+ },
22
+ "homepage": "https://github.com/hyper-open/dsh-task-board#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/hyper-open/dsh-task-board/issues"
25
+ },
26
+ "engines": {
27
+ "dsh": ">=0.2.0 <0.3.0",
28
+ "node": "^22.19.0 || >=24.0.0"
29
+ },
30
+ "main": "lib/index.js",
31
+ "types": "lib/types/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./lib/types/index.d.ts",
35
+ "default": "./lib/index.js"
36
+ },
37
+ "./client": {
38
+ "types": "./lib/types/client/index.d.ts",
39
+ "default": "./lib/client.js"
40
+ },
41
+ "./src/*": "./src/*",
42
+ "./package.json": "./package.json",
43
+ "./cordis.patch.yml": "./cordis.patch.yml"
44
+ },
45
+ "files": [
46
+ "lib/index.js",
47
+ "lib/index.js.map",
48
+ "lib/client.js",
49
+ "lib/client.js.map",
50
+ "lib/types/**/*.d.ts",
51
+ "cordis.patch.yml",
52
+ "README.md",
53
+ "README.zh.md",
54
+ "LICENSE"
55
+ ],
56
+ "dsh": {
57
+ "bundle": {
58
+ "patch": "./cordis.patch.yml"
59
+ },
60
+ "client": {
61
+ "inject": [
62
+ "@deepseek-ai/dsh-client-locale",
63
+ "@deepseek-ai/dsh-client-ui-layout",
64
+ "@deepseek-ai/dsh-client-ui-primitives",
65
+ "@deepseek-ai/dsh-client-ui-renderer",
66
+ "@deepseek-ai/dsh-client-ui-sidebar",
67
+ "@deepseek-ai/dsh-client-ui-slots",
68
+ "@deepseek-ai/dsh-client-ui-workspace"
69
+ ],
70
+ "platform": "web"
71
+ }
72
+ },
73
+ "peerDependencies": {
74
+ "@deepseek-ai/cordis": "^4.0.5",
75
+ "@deepseek-ai/dsh-client-locale": ">=0.2.0-0 <0.3.0",
76
+ "@deepseek-ai/dsh-client-ui-layout": ">=0.2.0-0 <0.3.0",
77
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.2.0-0 <0.3.0",
78
+ "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.0-0 <0.3.0",
79
+ "@deepseek-ai/dsh-client-ui-sidebar": ">=0.2.0-0 <0.3.0",
80
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-0 <0.3.0",
81
+ "@deepseek-ai/dsh-client-ui-workspace": ">=0.2.0-0 <0.3.0"
82
+ },
83
+ "scripts": {
84
+ "link-deps": "node scripts/link-deps.mjs",
85
+ "build": "node scripts/build.mjs",
86
+ "prepare": "node scripts/prepare.mjs"
87
+ },
88
+ "publishConfig": {
89
+ "access": "public"
90
+ }
91
+ }