kanban-lite 1.0.9 → 1.0.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.
Files changed (38) hide show
  1. package/dist/cli.js +1015 -407
  2. package/dist/extension.js +897 -347
  3. package/dist/mcp-server.js +550 -189
  4. package/dist/sdk/index.cjs +1223 -0
  5. package/dist/sdk/index.mjs +1168 -0
  6. package/dist/sdk/sdk/KanbanSDK.d.ts +39 -21
  7. package/dist/sdk/sdk/index.d.ts +4 -3
  8. package/dist/sdk/sdk/migration.d.ts +6 -0
  9. package/dist/sdk/sdk/types.d.ts +3 -5
  10. package/dist/sdk/shared/config.d.ts +23 -10
  11. package/dist/sdk/shared/types.d.ts +18 -4
  12. package/dist/standalone-webview/index.js +27 -27
  13. package/dist/standalone-webview/index.js.map +1 -1
  14. package/dist/standalone-webview/style.css +1 -1
  15. package/dist/standalone.js +831 -328
  16. package/dist/webview/index.js +45 -45
  17. package/dist/webview/index.js.map +1 -1
  18. package/dist/webview/style.css +1 -1
  19. package/package.json +4 -3
  20. package/src/cli/index.ts +217 -95
  21. package/src/extension/KanbanPanel.ts +49 -22
  22. package/src/mcp-server/index.ts +138 -62
  23. package/src/sdk/KanbanSDK.ts +283 -77
  24. package/src/sdk/__tests__/KanbanSDK.test.ts +5 -5
  25. package/src/sdk/__tests__/migration.test.ts +269 -0
  26. package/src/sdk/__tests__/multi-board.test.ts +449 -0
  27. package/src/sdk/index.ts +4 -3
  28. package/src/sdk/migration.ts +52 -0
  29. package/src/sdk/types.ts +3 -6
  30. package/src/shared/config.ts +144 -22
  31. package/src/shared/types.ts +14 -5
  32. package/src/standalone/__tests__/server.integration.test.ts +38 -37
  33. package/src/standalone/server.ts +239 -21
  34. package/src/webview/App.tsx +17 -7
  35. package/src/webview/components/Toolbar.tsx +99 -3
  36. package/src/webview/store/index.ts +11 -3
  37. package/.kanban/backlog/1-test1.md +0 -30
  38. package/.kanban.json +0 -42
@@ -1,32 +1,50 @@
1
- import type { Comment, Feature, FeatureStatus, KanbanColumn } from '../shared/types';
1
+ import type { Comment, Feature, KanbanColumn, BoardInfo } from '../shared/types';
2
+ import type { BoardConfig } from '../shared/config';
2
3
  import type { CardDisplaySettings } from '../shared/types';
4
+ import type { Priority } from '../shared/types';
3
5
  import type { CreateCardInput } from './types';
4
6
  export declare class KanbanSDK {
5
7
  readonly featuresDir: string;
8
+ private _migrated;
6
9
  constructor(featuresDir: string);
7
10
  get workspaceRoot(): string;
11
+ private _resolveBoardId;
12
+ private _boardDir;
13
+ private _isCompletedStatus;
14
+ private _ensureMigrated;
8
15
  init(): Promise<void>;
9
- listCards(columns?: string[]): Promise<Feature[]>;
10
- getCard(cardId: string): Promise<Feature | null>;
16
+ listBoards(): BoardInfo[];
17
+ createBoard(id: string, name: string, options?: {
18
+ description?: string;
19
+ columns?: KanbanColumn[];
20
+ defaultStatus?: string;
21
+ defaultPriority?: Priority;
22
+ }): BoardInfo;
23
+ deleteBoard(boardId: string): Promise<void>;
24
+ getBoard(boardId: string): BoardConfig;
25
+ updateBoard(boardId: string, updates: Partial<Omit<BoardConfig, 'nextCardId'>>): BoardConfig;
26
+ transferCard(cardId: string, fromBoardId: string, toBoardId: string, targetStatus?: string): Promise<Feature>;
27
+ listCards(columns?: string[], boardId?: string): Promise<Feature[]>;
28
+ getCard(cardId: string, boardId?: string): Promise<Feature | null>;
11
29
  createCard(data: CreateCardInput): Promise<Feature>;
12
- updateCard(cardId: string, updates: Partial<Feature>): Promise<Feature>;
13
- moveCard(cardId: string, newStatus: FeatureStatus, position?: number): Promise<Feature>;
14
- deleteCard(cardId: string): Promise<void>;
15
- getCardsByStatus(status: FeatureStatus): Promise<Feature[]>;
16
- getUniqueAssignees(): Promise<string[]>;
17
- getUniqueLabels(): Promise<string[]>;
18
- addAttachment(cardId: string, sourcePath: string): Promise<Feature>;
19
- removeAttachment(cardId: string, attachment: string): Promise<Feature>;
20
- listAttachments(cardId: string): Promise<string[]>;
21
- listComments(cardId: string): Promise<Comment[]>;
22
- addComment(cardId: string, author: string, content: string): Promise<Feature>;
23
- updateComment(cardId: string, commentId: string, content: string): Promise<Feature>;
24
- deleteComment(cardId: string, commentId: string): Promise<Feature>;
25
- listColumns(): KanbanColumn[];
26
- addColumn(column: KanbanColumn): KanbanColumn[];
27
- updateColumn(columnId: string, updates: Partial<Omit<KanbanColumn, 'id'>>): KanbanColumn[];
28
- removeColumn(columnId: string): Promise<KanbanColumn[]>;
29
- reorderColumns(columnIds: string[]): KanbanColumn[];
30
+ updateCard(cardId: string, updates: Partial<Feature>, boardId?: string): Promise<Feature>;
31
+ moveCard(cardId: string, newStatus: string, position?: number, boardId?: string): Promise<Feature>;
32
+ deleteCard(cardId: string, boardId?: string): Promise<void>;
33
+ getCardsByStatus(status: string, boardId?: string): Promise<Feature[]>;
34
+ getUniqueAssignees(boardId?: string): Promise<string[]>;
35
+ getUniqueLabels(boardId?: string): Promise<string[]>;
36
+ addAttachment(cardId: string, sourcePath: string, boardId?: string): Promise<Feature>;
37
+ removeAttachment(cardId: string, attachment: string, boardId?: string): Promise<Feature>;
38
+ listAttachments(cardId: string, boardId?: string): Promise<string[]>;
39
+ listComments(cardId: string, boardId?: string): Promise<Comment[]>;
40
+ addComment(cardId: string, author: string, content: string, boardId?: string): Promise<Feature>;
41
+ updateComment(cardId: string, commentId: string, content: string, boardId?: string): Promise<Feature>;
42
+ deleteComment(cardId: string, commentId: string, boardId?: string): Promise<Feature>;
43
+ listColumns(boardId?: string): KanbanColumn[];
44
+ addColumn(column: KanbanColumn, boardId?: string): KanbanColumn[];
45
+ updateColumn(columnId: string, updates: Partial<Omit<KanbanColumn, 'id'>>, boardId?: string): KanbanColumn[];
46
+ removeColumn(columnId: string, boardId?: string): Promise<KanbanColumn[]>;
47
+ reorderColumns(columnIds: string[], boardId?: string): KanbanColumn[];
30
48
  getSettings(): CardDisplaySettings;
31
49
  updateSettings(settings: CardDisplaySettings): void;
32
50
  private _readMdFiles;
@@ -1,9 +1,10 @@
1
1
  export { KanbanSDK } from './KanbanSDK';
2
2
  export { parseFeatureFile, serializeFeature } from './parser';
3
3
  export { getFeatureFilePath, ensureDirectories, ensureStatusSubfolders, moveFeatureFile, renameFeatureFile, getStatusFromPath } from './fileUtils';
4
+ export { migrateFileSystemToMultiBoard } from './migration';
4
5
  export type { CreateCardInput } from './types';
5
- export type { KanbanConfig } from '../shared/config';
6
- export type { CardDisplaySettings } from '../shared/types';
7
- export { readConfig, writeConfig, configToSettings, settingsToConfig } from '../shared/config';
6
+ export type { KanbanConfig, BoardConfig } from '../shared/config';
7
+ export type { CardDisplaySettings, BoardInfo } from '../shared/types';
8
+ export { readConfig, writeConfig, configToSettings, settingsToConfig, getBoardConfig, getDefaultBoardId } from '../shared/config';
8
9
  export type { Feature, FeatureStatus, Priority, KanbanColumn } from '../shared/types';
9
10
  export { getTitleFromContent, generateFeatureFilename, DEFAULT_COLUMNS } from '../shared/types';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Migrate a v1 single-board file system layout to v2 multi-board layout.
3
+ * Moves status subdirectories from .kanban/{status}/ into .kanban/boards/default/{status}/.
4
+ * Idempotent: if boards/ already exists, this is a no-op.
5
+ */
6
+ export declare function migrateFileSystemToMultiBoard(featuresDir: string): Promise<void>;
@@ -1,13 +1,11 @@
1
- import type { FeatureStatus, KanbanColumn, Priority } from '../shared/types';
1
+ import type { Priority } from '../shared/types';
2
2
  export interface CreateCardInput {
3
3
  content: string;
4
- status?: FeatureStatus;
4
+ status?: string;
5
5
  priority?: Priority;
6
6
  assignee?: string | null;
7
7
  dueDate?: string | null;
8
8
  labels?: string[];
9
9
  attachments?: string[];
10
- }
11
- export interface BoardConfig {
12
- columns: KanbanColumn[];
10
+ boardId?: string;
13
11
  }
@@ -1,11 +1,20 @@
1
- import type { KanbanColumn, CardDisplaySettings, Priority, FeatureStatus } from './types';
1
+ import type { KanbanColumn, CardDisplaySettings, Priority } from './types';
2
+ export interface BoardConfig {
3
+ name: string;
4
+ description?: string;
5
+ columns: KanbanColumn[];
6
+ nextCardId: number;
7
+ defaultStatus: string;
8
+ defaultPriority: Priority;
9
+ }
2
10
  export interface KanbanConfig {
11
+ version: 2;
12
+ boards: Record<string, BoardConfig>;
13
+ defaultBoard: string;
3
14
  featuresDirectory: string;
4
- defaultPriority: Priority;
5
- defaultStatus: FeatureStatus;
6
- columns: KanbanColumn[];
7
15
  aiAgent: string;
8
- nextCardId: number;
16
+ defaultPriority: Priority;
17
+ defaultStatus: string;
9
18
  showPriorityBadges: boolean;
10
19
  showAssignee: boolean;
11
20
  showDueDate: boolean;
@@ -20,11 +29,15 @@ export declare const CONFIG_FILENAME = ".kanban.json";
20
29
  export declare function configPath(workspaceRoot: string): string;
21
30
  export declare function readConfig(workspaceRoot: string): KanbanConfig;
22
31
  export declare function writeConfig(workspaceRoot: string, config: KanbanConfig): void;
23
- /** Read and increment the nextCardId counter, returning the allocated ID */
24
- export declare function allocateCardId(workspaceRoot: string): number;
25
- /** Ensure nextCardId is ahead of all existing numeric IDs */
26
- export declare function syncCardIdCounter(workspaceRoot: string, existingIds: number[]): void;
27
- /** Extract CardDisplaySettings from a KanbanConfig */
32
+ /** Get the default board ID from config */
33
+ export declare function getDefaultBoardId(workspaceRoot: string): string;
34
+ /** Get board config, using default board if boardId is omitted */
35
+ export declare function getBoardConfig(workspaceRoot: string, boardId?: string): BoardConfig;
36
+ /** Read and increment the nextCardId counter for a board, returning the allocated ID */
37
+ export declare function allocateCardId(workspaceRoot: string, boardId?: string): number;
38
+ /** Ensure nextCardId is ahead of all existing numeric IDs for a board */
39
+ export declare function syncCardIdCounter(workspaceRoot: string, boardId: string, existingIds: number[]): void;
40
+ /** Extract CardDisplaySettings from a KanbanConfig (global settings + fallback defaults) */
28
41
  export declare function configToSettings(config: KanbanConfig): CardDisplaySettings;
29
42
  /** Merge CardDisplaySettings back into a KanbanConfig */
30
43
  export declare function settingsToConfig(config: KanbanConfig, settings: CardDisplaySettings): KanbanConfig;
@@ -1,5 +1,5 @@
1
1
  export type Priority = 'critical' | 'high' | 'medium' | 'low';
2
- export type FeatureStatus = 'backlog' | 'todo' | 'in-progress' | 'review' | 'done';
2
+ export type FeatureStatus = string;
3
3
  export interface Comment {
4
4
  id: string;
5
5
  author: string;
@@ -8,6 +8,7 @@ export interface Comment {
8
8
  }
9
9
  export interface Feature {
10
10
  id: string;
11
+ boardId?: string;
11
12
  status: FeatureStatus;
12
13
  priority: Priority;
13
14
  assignee: string | null;
@@ -22,6 +23,11 @@ export interface Feature {
22
23
  content: string;
23
24
  filePath: string;
24
25
  }
26
+ export interface BoardInfo {
27
+ id: string;
28
+ name: string;
29
+ description?: string;
30
+ }
25
31
  export declare function getTitleFromContent(content: string): string;
26
32
  export declare function generateSlug(title: string): string;
27
33
  export declare function generateFeatureFilename(id: number, title: string): string;
@@ -42,13 +48,15 @@ export interface CardDisplaySettings {
42
48
  compactMode: boolean;
43
49
  markdownEditorMode: boolean;
44
50
  defaultPriority: Priority;
45
- defaultStatus: FeatureStatus;
51
+ defaultStatus: string;
46
52
  }
47
53
  export type ExtensionMessage = {
48
54
  type: 'init';
49
55
  features: Feature[];
50
56
  columns: KanbanColumn[];
51
57
  settings: CardDisplaySettings;
58
+ boards?: BoardInfo[];
59
+ currentBoard?: string;
52
60
  } | {
53
61
  type: 'featuresUpdated';
54
62
  features: Feature[];
@@ -66,7 +74,7 @@ export type ExtensionMessage = {
66
74
  };
67
75
  export interface FeatureFrontmatter {
68
76
  id: string;
69
- status: FeatureStatus;
77
+ status: string;
70
78
  priority: Priority;
71
79
  assignee: string | null;
72
80
  dueDate: string | null;
@@ -82,7 +90,7 @@ export type WebviewMessage = {
82
90
  } | {
83
91
  type: 'createFeature';
84
92
  data: {
85
- status: FeatureStatus;
93
+ status: string;
86
94
  priority: Priority;
87
95
  content: string;
88
96
  assignee: string | null;
@@ -160,4 +168,10 @@ export type WebviewMessage = {
160
168
  type: 'deleteComment';
161
169
  featureId: string;
162
170
  commentId: string;
171
+ } | {
172
+ type: 'switchBoard';
173
+ boardId: string;
174
+ } | {
175
+ type: 'createBoard';
176
+ name: string;
163
177
  };