xedoc-cli 0.1.10 → 0.1.12

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 (44) hide show
  1. package/README.md +25 -5
  2. package/bin/xedoc.mjs +12 -0
  3. package/build/client/assets/api.workspaces.directories-B0tllRDq.js +0 -0
  4. package/build/client/assets/app-layout-Bl4qOwh7.js +1 -0
  5. package/build/client/assets/app-shell-D4VZoy6V.js +2 -0
  6. package/build/client/assets/chat-5ZSZb1GN.js +1 -0
  7. package/build/client/assets/{connect-BDvoix-O.js → connect-xfBRZuAz.js} +1 -1
  8. package/build/client/assets/document-title-bwEcQkgI.js +1 -0
  9. package/build/client/assets/{entry.client-BQZeV9JD.js → entry.client-Bt-W9tr6.js} +1 -1
  10. package/build/client/assets/{ghostty-web-CgkkAFeT.js → ghostty-web-BBN5ya0J.js} +1 -1
  11. package/build/client/assets/home-D-i6W4Ao.js +1 -0
  12. package/build/client/assets/{jsx-runtime-Cal6WBdn.js → jsx-runtime-BUWBtJLv.js} +1 -1
  13. package/build/client/assets/{label-BpA-r6tL.js → label-BLnKkf67.js} +1 -1
  14. package/build/client/assets/manifest-9317aaeb.js +1 -0
  15. package/build/client/assets/{react-dom-D4MOkHq2.js → react-dom-Bppadr6u.js} +1 -1
  16. package/build/client/assets/root-B6reKqFo.js +1 -0
  17. package/build/client/assets/root-BDyfnfyW.css +2 -0
  18. package/build/client/assets/{session-provider-QLGSjKmA.js → session-provider-BFqptX_P.js} +1 -1
  19. package/build/server/index.js +1 -1
  20. package/package.json +1 -1
  21. package/prisma/schema.prisma +22 -0
  22. package/server/sqlite-setup.mjs +63 -0
  23. package/build/client/assets/app-layout-C4u5Bq0m.js +0 -1
  24. package/build/client/assets/app-shell-B9UBObFu.js +0 -2
  25. package/build/client/assets/chat-Qrq1zFrn.js +0 -1
  26. package/build/client/assets/document-title-RYIi5OZD.js +0 -1
  27. package/build/client/assets/home-CqUa9wVl.js +0 -1
  28. package/build/client/assets/manifest-746c227f.js +0 -1
  29. package/build/client/assets/root-KOlmIkbz.css +0 -2
  30. package/build/client/assets/root-xm0qUlcY.js +0 -1
  31. /package/build/client/assets/{__vite-browser-external-2447137e-Bb2UaVfr.js → __vite-browser-external-2447137e-DSxSsOOp.js} +0 -0
  32. /package/build/client/assets/{api.accounts._accountId.authenticate-Bp51NHGy.js → api.accounts._accountId.authenticate-CLzgv3py.js} +0 -0
  33. /package/build/client/assets/{api.accounts._accountId.authenticate.callback-DLgNMRyd.js → api.accounts._accountId.authenticate.callback-Bqhz8sDl.js} +0 -0
  34. /package/build/client/assets/{api.accounts._accountId.models-DGbCmT_9.js → api.accounts._accountId.models-VIVpVZrj.js} +0 -0
  35. /package/build/client/assets/{api.accounts._accountId.rate-limits-DZh4HPLO.js → api.accounts._accountId.personalization-z2pU64qI.js} +0 -0
  36. /package/build/client/assets/{api.chats-DZ_6Q7rY.js → api.accounts._accountId.rate-limits-C9iUvNFt.js} +0 -0
  37. /package/build/client/assets/{api.chats._chatId-BEX87qHo.js → api.chats-C6-gVaXw.js} +0 -0
  38. /package/build/client/assets/{api.chats._chatId.context-v4G0lNKq.js → api.chats._chatId-DaXHa-ln.js} +0 -0
  39. /package/build/client/assets/{api.chats._chatId.files-BrN7O-wM.js → api.chats._chatId.context-DlBgjpCD.js} +0 -0
  40. /package/build/client/assets/{api.chats._chatId.git._operation-CiUW8Knm.js → api.chats._chatId.files-DVZKcoNV.js} +0 -0
  41. /package/build/client/assets/{api.chats._chatId.interrupt-2DlVPDlX.js → api.chats._chatId.git._operation-8Xtyz4hF.js} +0 -0
  42. /package/build/client/assets/{api.chats._chatId.messages-cDawTuvN.js → api.chats._chatId.interrupt-B71lrxkc.js} +0 -0
  43. /package/build/client/assets/{api.chats._chatId.server-requests._requestId.respond-CTlCffOk.js → api.chats._chatId.messages-iVzJcgvw.js} +0 -0
  44. /package/build/client/assets/{api.workspaces.directories-nVoleT74.js → api.chats._chatId.server-requests._requestId.respond-BLhOUK8A.js} +0 -0
package/README.md CHANGED
@@ -4,11 +4,11 @@ xedoc is a single React Router Framework Mode app, built with Vite, for managing
4
4
 
5
5
  ## What It Does
6
6
 
7
- - Stores shared Codex accounts, chat metadata, runs, and live message projections in a local SQLite database through Prisma.
7
+ - Stores shared Codex accounts and per-thread preferences in xedoc SQLite; chat history stays in the root Codex store.
8
8
  - Starts browser or device-code Codex account authentication through the local `codex app-server` JSON-RPC flow.
9
- - Isolates each Codex account with a separate `CODEX_HOME`.
9
+ - Isolates each Codex account with a separate `CODEX_HOME` while sharing Codex chat sessions through the system Codex chat store.
10
10
  - Stores a working directory on each chat so different chats can target different local projects.
11
- - Executes chat prompts against the selected Codex account and reads settled transcripts back from Codex runtime/session data.
11
+ - Executes chat prompts against the selected Codex account and reads settled chat lists/transcripts from the root Codex store.
12
12
  - Serves the ChatGPT-style web UI and `/api/*` resource routes from one same-origin app.
13
13
  - Streams live chat updates through authenticated Socket.IO rooms on `/socket.io`.
14
14
 
@@ -17,7 +17,7 @@ xedoc is a single React Router Framework Mode app, built with Vite, for managing
17
17
  The easiest local install is the npm CLI:
18
18
 
19
19
  ```bash
20
- npx xedoc
20
+ npx xedoc-cli
21
21
  ```
22
22
 
23
23
  By default the CLI creates a SQLite database under the workspace root at
@@ -30,6 +30,7 @@ Common CLI options:
30
30
  - `--port <port>` changes the web server port.
31
31
  - `--workspace-root <path>` changes the directory tree visible to the app.
32
32
  - `--accounts-home <path>` changes where Codex account state is stored.
33
+ - `--shared-chat-home <path>` changes where shared Codex chat sessions are stored.
33
34
  - `--skip-setup` skips SQLite schema setup.
34
35
 
35
36
  For repository development:
@@ -69,12 +70,31 @@ npmjs.com with this GitHub repository and the workflow file
69
70
 
70
71
  ## Codex Account Isolation
71
72
 
72
- Each Codex account runs as its own local `codex app-server` process. The server sets `CODEX_HOME` per account so auth files, config, sessions, cache, and other Codex state stay under:
73
+ Each Codex account runs as its own local `codex app-server` process. The server sets `CODEX_HOME` per account so auth files, config, cache, and other non-chat account state stay under:
73
74
 
74
75
  ```text
75
76
  ~/.xedoc/accounts/<accountId>
76
77
  ```
77
78
 
79
+ Codex chat data and personalization are centralized separately. By default,
80
+ each account home gets symlinks for `sessions/`, `session_index.jsonl`, Codex
81
+ `state_*.sqlite` chat state files, and `AGENTS.md` pointing at the system Codex
82
+ chat store:
83
+
84
+ ```text
85
+ ~/.codex
86
+ ```
87
+
88
+ Set `CODEX_SHARED_CHAT_HOME` to change the shared chat store. Existing
89
+ per-account chat storage and non-empty personalization files are copied or
90
+ merged into the shared store when safe, then kept as timestamped
91
+ `.pre-shared-*` backups before the symlinks are created.
92
+
93
+ For existing installations, saved account homes are prepared when the app lists
94
+ accounts after upgrade. This migrates old per-account chat storage into the
95
+ shared store without changing each account's `auth.json` or other
96
+ account-specific files.
97
+
78
98
  Set `CODEX_ACCOUNTS_HOME` to change the base directory. This isolates Codex account state only; Codex still runs as the same host user and can access whatever that user can access.
79
99
 
80
100
  Set `CODEX_WORKSPACE_ROOT` to the directory the web app can browse for chat
package/bin/xedoc.mjs CHANGED
@@ -34,6 +34,12 @@ const accountsHome = resolveHomePath(
34
34
  process.env.CODEX_ACCOUNTS_HOME ??
35
35
  join(appHome, "accounts"),
36
36
  )
37
+ const sharedChatHome = resolveHomePath(
38
+ options.sharedChatHome ??
39
+ process.env.CODEX_SHARED_CHAT_HOME ??
40
+ process.env.CODEX_HOME ??
41
+ "~/.codex",
42
+ )
37
43
  const workspaceRoot = resolveHomePath(
38
44
  options.workspaceRoot ?? process.env.CODEX_WORKSPACE_ROOT ?? homedir(),
39
45
  )
@@ -47,6 +53,7 @@ const env = {
47
53
  CODEX_ACCOUNTS_HOME: accountsHome,
48
54
  CODEX_ARGS: options.codexArgs ?? process.env.CODEX_ARGS ?? `${codexBin} app-server`,
49
55
  CODEX_COMMAND: options.codexCommand ?? process.env.CODEX_COMMAND ?? process.execPath,
56
+ CODEX_SHARED_CHAT_HOME: sharedChatHome,
50
57
  CODEX_WORKSPACE_ROOT: workspaceRoot,
51
58
  DATABASE_URL: databaseUrl,
52
59
  HOST: host,
@@ -66,6 +73,7 @@ const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`
66
73
  console.log(`xedoc: ${url}`)
67
74
  console.log("Set the server password in your browser on first visit.")
68
75
  console.log(`Workspace root: ${workspaceRoot}`)
76
+ console.log(`Shared chat store: ${sharedChatHome}`)
69
77
  console.log("Press Ctrl+C to stop.")
70
78
 
71
79
  await runServer(env)
@@ -116,6 +124,9 @@ function assignOption(parsed, name, value) {
116
124
  case "--port":
117
125
  parsed.port = value
118
126
  return
127
+ case "--shared-chat-home":
128
+ parsed.sharedChatHome = value
129
+ return
119
130
  case "--workspace-root":
120
131
  parsed.workspaceRoot = value
121
132
  return
@@ -220,6 +231,7 @@ Options:
220
231
  --host <host> Web server host. Defaults to 127.0.0.1.
221
232
  --workspace-root <path> Directory tree visible in the app. Defaults to your home directory.
222
233
  --accounts-home <path> Codex account state directory. Defaults to ~/.xedoc/accounts.
234
+ --shared-chat-home <path> Shared Codex chat store. Defaults to ~/.codex.
223
235
  --skip-setup Do not create the SQLite database schema.
224
236
  --codex-command <command> Codex command used for new accounts.
225
237
  --codex-args <args> Codex command arguments used for new accounts.
@@ -0,0 +1 @@
1
+ import{M as r,t as s}from"./jsx-runtime-BUWBtJLv.js";import{t}from"./app-shell-D4VZoy6V.js";var a=s(),o=r(function(){return(0,a.jsx)(t,{})});export{o as default};