@loicngr/kobo 1.8.5 → 1.8.6

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 (70) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/mcp-server/kobo-tasks-handlers.js +18 -0
  3. package/dist/mcp-server/kobo-tasks-server.js +458 -297
  4. package/dist/server/db/migrations.js +16 -0
  5. package/dist/server/db/schema.js +1 -0
  6. package/dist/server/routes/workspaces.js +2 -1
  7. package/dist/server/services/auto-loop-service.js +17 -4
  8. package/dist/server/services/forge/types.js +9 -4
  9. package/package.json +6 -2
  10. package/src/client/dist/spa/assets/{ActivityFeed-NeOuB4hK.js → ActivityFeed-Cru3Y4vS.js} +1 -1
  11. package/src/client/dist/spa/assets/{ChangelogPage-DYhK35Uj.js → ChangelogPage-Bg-DDspc.js} +1 -1
  12. package/src/client/dist/spa/assets/{ClosePopup-SUgOzeRa.js → ClosePopup-HRef5kSi.js} +1 -1
  13. package/src/client/dist/spa/assets/CreatePage-C-2rBnTd.css +1 -0
  14. package/src/client/dist/spa/assets/CreatePage-DqZTSsVk.js +2 -0
  15. package/src/client/dist/spa/assets/DiffViewer-D_yY4zph.js +8 -0
  16. package/src/client/dist/spa/assets/{HealthPage-CcYmw0qz.js → HealthPage-DuOcnPX7.js} +1 -1
  17. package/src/client/dist/spa/assets/{MainLayout-E8V_3jtB.js → MainLayout-C4VC4R3n.js} +3 -3
  18. package/src/client/dist/spa/assets/QBtnGroup-CLMT4pWA.js +1 -0
  19. package/src/client/dist/spa/assets/QBtnToggle-Bnfx8-LH.js +1 -0
  20. package/src/client/dist/spa/assets/{QChip-C_hQ8zDG.js → QChip-UP-CYKPe.js} +1 -1
  21. package/src/client/dist/spa/assets/{QExpansionItem-CDMqMrBW.js → QExpansionItem-BGl-iIpb.js} +1 -1
  22. package/src/client/dist/spa/assets/{QScrollArea-5SknWwXm.js → QScrollArea-BsnAIb_6.js} +1 -1
  23. package/src/client/dist/spa/assets/{QSelect-DdFxTwDW.js → QSelect-DHWr1DWW.js} +1 -1
  24. package/src/client/dist/spa/assets/{QTooltip-wdRYvb7_.js → QTooltip-1Cqe-wzt.js} +1 -1
  25. package/src/client/dist/spa/assets/{SearchPage-CHcHBahe.js → SearchPage-CQ_Rw4cC.js} +1 -1
  26. package/src/client/dist/spa/assets/{SettingsPage-D4WRKgef.js → SettingsPage-Xt75bNBF.js} +1 -1
  27. package/src/client/dist/spa/assets/{TouchPan-CGfbFZ29.js → TouchPan-8v88x-k5.js} +1 -1
  28. package/src/client/dist/spa/assets/{WorkspacePage-ZMocf3BW.js → WorkspacePage-n6XL6ra6.js} +3 -3
  29. package/src/client/dist/spa/assets/build-path-tree-CsEz_AvN.js +1 -0
  30. package/src/client/dist/spa/assets/{cssMode-DtrJq-En.js → cssMode-DaW1C4P4.js} +1 -1
  31. package/src/client/dist/spa/assets/{documents-BbpzccXz.js → documents-DsG4t5fl.js} +1 -1
  32. package/src/client/dist/spa/assets/{editor.api2-CinEgB5d.js → editor.api2-Bjz6ygpj.js} +1 -1
  33. package/src/client/dist/spa/assets/{editor.main-BRcMV3rU.js → editor.main-CLBGHEET.js} +2 -2
  34. package/src/client/dist/spa/assets/{expand-template-BT_OMXXZ.js → expand-template-BtZ2WHZx.js} +1 -1
  35. package/src/client/dist/spa/assets/{formatters-D24DKtIv.js → formatters-CzrIaq3v.js} +1 -1
  36. package/src/client/dist/spa/assets/{freemarker2-CjI8M1Pj.js → freemarker2-CQz_-RAv.js} +1 -1
  37. package/src/client/dist/spa/assets/{handlebars-BrrbROQJ.js → handlebars-D3T_RE92.js} +1 -1
  38. package/src/client/dist/spa/assets/{html-Dt61THwD.js → html-C19hlQ10.js} +1 -1
  39. package/src/client/dist/spa/assets/{htmlMode-tb4PrwZE.js → htmlMode-CcKHMqav.js} +1 -1
  40. package/src/client/dist/spa/assets/i18n-gU9Nz2Dy.js +1 -0
  41. package/src/client/dist/spa/assets/{index-DY-0-pzs.js → index-C1u3FMCQ.js} +6 -6
  42. package/src/client/dist/spa/assets/{javascript-CbNLIl6K.js → javascript-BtbPTi_2.js} +1 -1
  43. package/src/client/dist/spa/assets/{jsonMode-9OB1NWBc.js → jsonMode-M6yQyl3x.js} +1 -1
  44. package/src/client/dist/spa/assets/{kobo-commands-BAFoc4XT.js → kobo-commands-CRSnRjVe.js} +1 -1
  45. package/src/client/dist/spa/assets/{layout-C_Qy9YRS.js → layout-CGI1vMRN.js} +1 -1
  46. package/src/client/dist/spa/assets/{liquid-2Xnhq08h.js → liquid-DhD-glYJ.js} +1 -1
  47. package/src/client/dist/spa/assets/{lspLanguageFeatures-Cd0LZuqI.js → lspLanguageFeatures-DsxRGZID.js} +1 -1
  48. package/src/client/dist/spa/assets/{mdx-BcFCQf8z.js → mdx-BQKAfE4m.js} +1 -1
  49. package/src/client/dist/spa/assets/{monaco.contribution-BFELAVjU.js → monaco.contribution-BxeTJn7e.js} +2 -2
  50. package/src/client/dist/spa/assets/{network-auth-HNTN0Fqx.js → network-auth-ClL9UkXB.js} +1 -1
  51. package/src/client/dist/spa/assets/{project-color-CnA7qsFT.js → project-color-hgkIRO39.js} +1 -1
  52. package/src/client/dist/spa/assets/{python-mxDs2yew.js → python-7eduqhxd.js} +1 -1
  53. package/src/client/dist/spa/assets/{razor-Dwp1v9Mw.js → razor-DsfMRZhn.js} +1 -1
  54. package/src/client/dist/spa/assets/{render-chat-markdown-C66I22rl.js → render-chat-markdown-jyoLsnBV.js} +18 -18
  55. package/src/client/dist/spa/assets/{tsMode-DmV0n4aC.js → tsMode-BBuJqcnA.js} +1 -1
  56. package/src/client/dist/spa/assets/{typescript-CPU1RgLJ.js → typescript-C1QMF4IF.js} +1 -1
  57. package/src/client/dist/spa/assets/{use-onboarding-ockQMKKz.js → use-onboarding-CR4gkqI9.js} +1 -1
  58. package/src/client/dist/spa/assets/{use-quasar-CCWojS5V.js → use-quasar-B65SkvJp.js} +1 -1
  59. package/src/client/dist/spa/assets/{workers-BUpbuYJJ.js → workers-kAnE9Ph9.js} +1 -1
  60. package/src/client/dist/spa/assets/{xml-BCZKO1fH.js → xml-DlrR7f2a.js} +1 -1
  61. package/src/client/dist/spa/assets/{yaml-DT8wC8CS.js → yaml-CNExkyN_.js} +1 -1
  62. package/src/client/dist/spa/index.html +1 -1
  63. package/src/mcp-server/README.md +46 -1
  64. package/src/mcp-server/kobo-tasks-handlers.ts +37 -0
  65. package/src/mcp-server/kobo-tasks-server.ts +496 -328
  66. package/src/client/dist/spa/assets/CreatePage-0WIKLSHx.js +0 -2
  67. package/src/client/dist/spa/assets/CreatePage-Cyo8mr_a.css +0 -1
  68. package/src/client/dist/spa/assets/DiffViewer-JFUB2IjX.js +0 -8
  69. package/src/client/dist/spa/assets/build-path-tree-B2W0g5KD.js +0 -1
  70. package/src/client/dist/spa/assets/i18n-D5hQoijX.js +0 -1
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><html><head><title>Kōbō</title><link rel=icon type=image/svg+xml href=/favicon.svg><meta charset=utf-8><meta name=description content="Kōbō — multi-workspace agent manager for Claude Code"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width,height=device-height"> <script type="module" crossorigin src="/assets/index-DY-0-pzs.js"></script>
1
+ <!DOCTYPE html><html><head><title>Kōbō</title><link rel=icon type=image/svg+xml href=/favicon.svg><meta charset=utf-8><meta name=description content="Kōbō — multi-workspace agent manager for Claude Code"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width,height=device-height"> <script type="module" crossorigin src="/assets/index-C1u3FMCQ.js"></script>
2
2
  <link rel="modulepreload" crossorigin href="/assets/chunk-QTnfLwEv.js">
3
3
  <link rel="modulepreload" crossorigin href="/assets/vue.runtime.esm-bundler-JZnIeD9D.js">
4
4
  <link rel="modulepreload" crossorigin href="/assets/QIcon-CfOEsLsF.js">
@@ -8,7 +8,7 @@ Kōbō's Claude Code engine (under `src/server/services/agent/engines/claude-cod
8
8
 
9
9
  | Env var | Purpose |
10
10
  |---|---|
11
- | `KOBO_WORKSPACE_ID` | ID of the current workspace — scopes all queries. **Required**. |
11
+ | `KOBO_WORKSPACE_ID` | ID of the current workspace — scopes all queries. Optional: when unset, the server runs in "global" mode (see [Global tools](#global-tools-workspace-less-mode) below) and only exposes the workspace-management tools; workspace-scoped tools are omitted from the tool list entirely. |
12
12
  | `KOBO_DB_PATH` | Absolute path to Kōbō's SQLite DB. **Required**. |
13
13
  | `KOBO_SETTINGS_PATH` | Absolute path to Kōbō's `settings.json`. Optional — `get_settings` returns an error shape if absent. |
14
14
  | `KOBO_BACKEND_URL` | Base URL of the running Kōbō HTTP backend. Default: `http://localhost:3000`. Used by tools that need runtime state (dev server, git info, workspace transitions). |
@@ -170,6 +170,51 @@ List all images uploaded to the current workspace via Kōbō's chat paste/upload
170
170
 
171
171
  ---
172
172
 
173
+ ### Global tools (workspace-less mode)
174
+
175
+ These 4 tools are always registered, regardless of whether `KOBO_WORKSPACE_ID` is set — they let a Claude Code session that Kōbō did NOT spawn (e.g. a standalone terminal session) discover and manage workspaces instead of being bound to one.
176
+
177
+ #### `list_workspaces`
178
+ List Kōbō workspaces with id, title, status, and creation date. Reads the DB directly — works even when the Kōbō backend server isn't running.
179
+
180
+ **Input:**
181
+ - `include_archived` (boolean, optional) — default `false`
182
+
183
+ **Output:** `Array<{ id, title, status, createdAt }>`
184
+
185
+ ---
186
+
187
+ #### `create_workspace`
188
+ Create a new workspace (git worktree + agent session), like the "Créer" button on the Create page. Requires the Kōbō backend server to be running and reachable at `KOBO_BACKEND_URL` — this API has no automatic branch-name derivation from the workspace name, unlike the UI.
189
+
190
+ **Input:**
191
+ - `name`, `project_path`, `source_branch`, `working_branch` (string, required)
192
+ - `model`, `reasoning_effort`, `engine`, `description` (string, optional)
193
+ - `tasks`, `acceptance_criteria` (string[], optional)
194
+ - `agent_permission_mode` (`plan | bypass | strict | interactive`, optional)
195
+ - `auto_loop` (boolean, optional), `auto_loop_session_mode` (`per_task | continuous`, optional)
196
+ - `skip_setup_script` (boolean, optional)
197
+
198
+ **Output:** created `Workspace`
199
+
200
+ ---
201
+
202
+ #### `archive_workspace`
203
+ Archive a workspace by id, like the "Archiver" action in the workspace context menu. Requires the backend to be running.
204
+
205
+ **Input:**
206
+ - `workspace_id` (string, required) — from `list_workspaces`
207
+
208
+ ---
209
+
210
+ #### `stop_workspace`
211
+ Force-stop the currently running agent session on a workspace, like the red "Arrêter" button in the chat header. Requires the backend to be running. Safe to call when nothing is running.
212
+
213
+ **Input:**
214
+ - `workspace_id` (string, required) — from `list_workspaces`
215
+
216
+ ---
217
+
173
218
  ## Implementation notes
174
219
 
175
220
  - **Handlers** live in `kobo-tasks-handlers.ts` as pure functions taking the DB handle (and sometimes paths) as arguments. This keeps them unit-testable in isolation — see `src/__tests__/kobo-tasks-server.test.ts`.
@@ -59,6 +59,43 @@ export function listTasksHandler(db: Database.Database, workspaceId: string): Ta
59
59
  return rows.map(rowToDto)
60
60
  }
61
61
 
62
+ /** Public-facing representation of a workspace exposed via the global list_workspaces MCP tool. */
63
+ export interface WorkspaceListItemDto {
64
+ id: string
65
+ title: string
66
+ status: string
67
+ createdAt: string
68
+ }
69
+
70
+ interface WorkspaceListRow {
71
+ id: string
72
+ name: string
73
+ status: string
74
+ created_at: string
75
+ }
76
+
77
+ /**
78
+ * List workspaces for the global `list_workspaces` MCP tool. Reads SQLite
79
+ * directly (no backend HTTP dependency) so it works even when the Kōbō
80
+ * server isn't running — the same DB file the backend uses.
81
+ */
82
+ export function listWorkspacesHandler(
83
+ db: Database.Database,
84
+ opts: { includeArchived?: boolean },
85
+ ): WorkspaceListItemDto[] {
86
+ // updated_at can collide at second resolution (e.g. bulk-seeded test data); rowid DESC breaks ties, most-recently-inserted first.
87
+ const sql = opts.includeArchived
88
+ ? 'SELECT id, name, status, created_at FROM workspaces ORDER BY updated_at DESC, rowid DESC'
89
+ : 'SELECT id, name, status, created_at FROM workspaces WHERE archived_at IS NULL ORDER BY updated_at DESC, rowid DESC'
90
+ const rows = db.prepare(sql).all() as WorkspaceListRow[]
91
+ return rows.map((row) => ({
92
+ id: row.id,
93
+ title: row.name,
94
+ status: row.status,
95
+ createdAt: row.created_at,
96
+ }))
97
+ }
98
+
62
99
  /**
63
100
  * Flip the workspace's `auto_loop_ready` flag. Called at the end of a
64
101
  * `/kobo-prep-autoloop` grooming session to unlock the auto-loop toggle.