floq 1.4.1 → 1.6.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.
Files changed (58) hide show
  1. package/README.ja.md +4 -0
  2. package/README.md +4 -0
  3. package/dist/cli.js +32 -2
  4. package/dist/commands/config.js +2 -1
  5. package/dist/commands/done.js +1 -0
  6. package/dist/commands/insights.js +13 -10
  7. package/dist/commands/move.js +2 -1
  8. package/dist/config.d.ts +3 -0
  9. package/dist/config.js +11 -0
  10. package/dist/db/index.js +36 -0
  11. package/dist/db/schema.d.ts +116 -0
  12. package/dist/db/schema.js +8 -0
  13. package/dist/i18n/en.d.ts +2 -0
  14. package/dist/i18n/en.js +1 -0
  15. package/dist/i18n/ja.js +1 -0
  16. package/dist/index.js +2 -1
  17. package/dist/mcp/server.d.ts +1 -0
  18. package/dist/mcp/server.js +186 -0
  19. package/dist/ui/App.js +7 -4
  20. package/dist/ui/components/GtdDQ.js +4 -1
  21. package/dist/ui/components/GtdMario.js +4 -1
  22. package/dist/ui/components/InsightsModal.js +15 -8
  23. package/dist/ui/components/KanbanBoard.js +3 -0
  24. package/dist/ui/components/KanbanDQ.js +2 -0
  25. package/dist/ui/components/KanbanMario.js +2 -0
  26. package/dist/ui/components/TaskItem.d.ts +2 -1
  27. package/dist/ui/components/TaskItem.js +4 -3
  28. package/dist/ui/history/HistoryContext.js +8 -0
  29. package/dist/ui/history/HistoryManager.d.ts +9 -1
  30. package/dist/ui/history/HistoryManager.js +140 -16
  31. package/dist/ui/history/commands/ConvertToProjectCommand.d.ts +5 -1
  32. package/dist/ui/history/commands/ConvertToProjectCommand.js +13 -0
  33. package/dist/ui/history/commands/CreateCommentCommand.d.ts +5 -1
  34. package/dist/ui/history/commands/CreateCommentCommand.js +22 -0
  35. package/dist/ui/history/commands/CreateTaskCommand.d.ts +5 -1
  36. package/dist/ui/history/commands/CreateTaskCommand.js +26 -1
  37. package/dist/ui/history/commands/DeleteCommentCommand.d.ts +5 -1
  38. package/dist/ui/history/commands/DeleteCommentCommand.js +22 -0
  39. package/dist/ui/history/commands/DeleteTaskCommand.d.ts +7 -2
  40. package/dist/ui/history/commands/DeleteTaskCommand.js +41 -0
  41. package/dist/ui/history/commands/LinkTaskCommand.d.ts +5 -1
  42. package/dist/ui/history/commands/LinkTaskCommand.js +14 -0
  43. package/dist/ui/history/commands/MoveTaskCommand.d.ts +7 -1
  44. package/dist/ui/history/commands/MoveTaskCommand.js +25 -0
  45. package/dist/ui/history/commands/SetContextCommand.d.ts +5 -1
  46. package/dist/ui/history/commands/SetContextCommand.js +14 -0
  47. package/dist/ui/history/commands/SetEffortCommand.d.ts +5 -1
  48. package/dist/ui/history/commands/SetEffortCommand.js +14 -0
  49. package/dist/ui/history/commands/SetFocusCommand.d.ts +5 -1
  50. package/dist/ui/history/commands/SetFocusCommand.js +14 -0
  51. package/dist/ui/history/commands/index.d.ts +1 -0
  52. package/dist/ui/history/commands/index.js +1 -0
  53. package/dist/ui/history/commands/registry.d.ts +2 -0
  54. package/dist/ui/history/commands/registry.js +28 -0
  55. package/dist/ui/history/index.d.ts +2 -2
  56. package/dist/ui/history/index.js +1 -1
  57. package/dist/ui/history/types.d.ts +9 -0
  58. package/package.json +6 -5
@@ -1,4 +1,4 @@
1
- import type { UndoableCommand } from '../types.js';
1
+ import type { UndoableCommand, SerializedCommand } from '../types.js';
2
2
  interface SetFocusParams {
3
3
  taskId: string;
4
4
  fromFocused: boolean;
@@ -16,5 +16,9 @@ export declare class SetFocusCommand implements UndoableCommand {
16
16
  constructor(params: SetFocusParams);
17
17
  execute(): Promise<void>;
18
18
  undo(): Promise<void>;
19
+ toJSON(): SerializedCommand;
20
+ static fromJSON(json: {
21
+ data: Record<string, unknown>;
22
+ }): SetFocusCommand;
19
23
  }
20
24
  export {};
@@ -34,4 +34,18 @@ export class SetFocusCommand {
34
34
  })
35
35
  .where(eq(schema.tasks.id, this.taskId));
36
36
  }
37
+ toJSON() {
38
+ return {
39
+ type: 'set_focus',
40
+ data: {
41
+ taskId: this.taskId,
42
+ fromFocused: this.fromFocused,
43
+ toFocused: this.toFocused,
44
+ description: this.description,
45
+ },
46
+ };
47
+ }
48
+ static fromJSON(json) {
49
+ return new SetFocusCommand(json.data);
50
+ }
37
51
  }
@@ -8,3 +8,4 @@ export { DeleteCommentCommand } from './DeleteCommentCommand.js';
8
8
  export { SetContextCommand } from './SetContextCommand.js';
9
9
  export { SetFocusCommand } from './SetFocusCommand.js';
10
10
  export { SetEffortCommand } from './SetEffortCommand.js';
11
+ export { deserializeCommand } from './registry.js';
@@ -8,3 +8,4 @@ export { DeleteCommentCommand } from './DeleteCommentCommand.js';
8
8
  export { SetContextCommand } from './SetContextCommand.js';
9
9
  export { SetFocusCommand } from './SetFocusCommand.js';
10
10
  export { SetEffortCommand } from './SetEffortCommand.js';
11
+ export { deserializeCommand } from './registry.js';
@@ -0,0 +1,2 @@
1
+ import type { UndoableCommand } from '../types.js';
2
+ export declare function deserializeCommand(type: string, data: Record<string, unknown>): UndoableCommand;
@@ -0,0 +1,28 @@
1
+ import { CreateTaskCommand } from './CreateTaskCommand.js';
2
+ import { DeleteTaskCommand } from './DeleteTaskCommand.js';
3
+ import { MoveTaskCommand } from './MoveTaskCommand.js';
4
+ import { LinkTaskCommand } from './LinkTaskCommand.js';
5
+ import { ConvertToProjectCommand } from './ConvertToProjectCommand.js';
6
+ import { CreateCommentCommand } from './CreateCommentCommand.js';
7
+ import { DeleteCommentCommand } from './DeleteCommentCommand.js';
8
+ import { SetContextCommand } from './SetContextCommand.js';
9
+ import { SetFocusCommand } from './SetFocusCommand.js';
10
+ import { SetEffortCommand } from './SetEffortCommand.js';
11
+ const registry = {
12
+ 'create_task': (data) => CreateTaskCommand.fromJSON({ data }),
13
+ 'delete_task': (data) => DeleteTaskCommand.fromJSON({ data }),
14
+ 'move_task': (data) => MoveTaskCommand.fromJSON({ data }),
15
+ 'link_task': (data) => LinkTaskCommand.fromJSON({ data }),
16
+ 'convert_to_project': (data) => ConvertToProjectCommand.fromJSON({ data }),
17
+ 'create_comment': (data) => CreateCommentCommand.fromJSON({ data }),
18
+ 'delete_comment': (data) => DeleteCommentCommand.fromJSON({ data }),
19
+ 'set_context': (data) => SetContextCommand.fromJSON({ data }),
20
+ 'set_focus': (data) => SetFocusCommand.fromJSON({ data }),
21
+ 'set_effort': (data) => SetEffortCommand.fromJSON({ data }),
22
+ };
23
+ export function deserializeCommand(type, data) {
24
+ const deserializer = registry[type];
25
+ if (!deserializer)
26
+ throw new Error(`Unknown command type: ${type}`);
27
+ return deserializer(data);
28
+ }
@@ -1,6 +1,6 @@
1
- export type { UndoableCommand, HistoryState } from './types.js';
1
+ export type { UndoableCommand, HistoryState, SerializedCommand } from './types.js';
2
2
  export { MAX_HISTORY_SIZE } from './types.js';
3
3
  export { HistoryManager, getHistoryManager } from './HistoryManager.js';
4
4
  export { HistoryProvider, useHistoryContext } from './HistoryContext.js';
5
5
  export { useHistory } from './useHistory.js';
6
- export { CreateTaskCommand, DeleteTaskCommand, MoveTaskCommand, LinkTaskCommand, ConvertToProjectCommand, CreateCommentCommand, DeleteCommentCommand, SetContextCommand, SetFocusCommand, SetEffortCommand, } from './commands/index.js';
6
+ export { CreateTaskCommand, DeleteTaskCommand, MoveTaskCommand, LinkTaskCommand, ConvertToProjectCommand, CreateCommentCommand, DeleteCommentCommand, SetContextCommand, SetFocusCommand, SetEffortCommand, deserializeCommand, } from './commands/index.js';
@@ -5,4 +5,4 @@ export { HistoryManager, getHistoryManager } from './HistoryManager.js';
5
5
  export { HistoryProvider, useHistoryContext } from './HistoryContext.js';
6
6
  export { useHistory } from './useHistory.js';
7
7
  // Commands
8
- export { CreateTaskCommand, DeleteTaskCommand, MoveTaskCommand, LinkTaskCommand, ConvertToProjectCommand, CreateCommentCommand, DeleteCommentCommand, SetContextCommand, SetFocusCommand, SetEffortCommand, } from './commands/index.js';
8
+ export { CreateTaskCommand, DeleteTaskCommand, MoveTaskCommand, LinkTaskCommand, ConvertToProjectCommand, CreateCommentCommand, DeleteCommentCommand, SetContextCommand, SetFocusCommand, SetEffortCommand, deserializeCommand, } from './commands/index.js';
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Serialized form of a command for DB persistence
3
+ */
4
+ export interface SerializedCommand {
5
+ type: string;
6
+ data: Record<string, unknown>;
7
+ }
1
8
  /**
2
9
  * Interface for undoable commands (Command Pattern)
3
10
  */
@@ -8,6 +15,8 @@ export interface UndoableCommand {
8
15
  execute(): Promise<void>;
9
16
  /** Undo the command (reverse the operation) */
10
17
  undo(): Promise<void>;
18
+ /** Serialize the command for DB persistence */
19
+ toJSON(): SerializedCommand;
11
20
  }
12
21
  /**
13
22
  * State of the history manager
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floq",
3
- "version": "1.4.1",
3
+ "version": "1.6.0",
4
4
  "description": "Floq - Getting Things Done Task Manager with MS-DOS style themes",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,16 +39,17 @@
39
39
  "dependencies": {
40
40
  "@inkjs/ui": "^2.0.0",
41
41
  "@libsql/client": "^0.17.0",
42
+ "@modelcontextprotocol/sdk": "^1.27.0",
42
43
  "better-sqlite3": "^11.7.0",
43
44
  "commander": "^13.1.0",
44
45
  "drizzle-orm": "^0.39.1",
46
+ "googleapis": "^144.0.0",
47
+ "ical.js": "^2.1.0",
45
48
  "ink": "^5.1.0",
46
49
  "ink-text-input": "^6.0.0",
50
+ "open": "^10.1.0",
47
51
  "react": "^18.3.1",
48
- "uuid": "^11.0.5",
49
- "ical.js": "^2.1.0",
50
- "googleapis": "^144.0.0",
51
- "open": "^10.1.0"
52
+ "uuid": "^11.0.5"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@types/better-sqlite3": "^7.6.12",