@openchamber/web 1.13.3 → 1.13.4

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 (125) hide show
  1. package/bin/cli-output.js +0 -7
  2. package/bin/cli.js +132 -5548
  3. package/bin/cli.test.js +674 -0
  4. package/bin/lib/DOCUMENTATION.md +121 -0
  5. package/bin/lib/cli-args.js +726 -0
  6. package/bin/lib/cli-errors.js +18 -0
  7. package/bin/lib/cli-executables.js +54 -0
  8. package/bin/lib/cli-http.js +215 -0
  9. package/bin/lib/cli-lifecycle.js +421 -0
  10. package/bin/lib/cli-log-files.js +93 -0
  11. package/bin/lib/cli-network.js +153 -0
  12. package/bin/lib/cli-paths.js +111 -0
  13. package/bin/lib/cli-ports.js +51 -0
  14. package/bin/lib/cli-process.js +292 -0
  15. package/bin/lib/cli-startup.js +370 -0
  16. package/bin/lib/cli-tunnel-capabilities.js +9 -0
  17. package/bin/lib/cli-tunnel-profiles.js +366 -0
  18. package/bin/lib/cli-tunnel-utils.js +300 -0
  19. package/bin/lib/commands-connect-url.js +173 -0
  20. package/bin/lib/commands-lifecycle.js +396 -0
  21. package/bin/lib/commands-logs.js +110 -0
  22. package/bin/lib/commands-serve.js +396 -0
  23. package/bin/lib/commands-startup.js +64 -0
  24. package/bin/lib/commands-status.js +114 -0
  25. package/bin/lib/commands-tunnel.js +1757 -0
  26. package/bin/lib/commands-update.js +141 -0
  27. package/dist/assets/{DiagramView-BmHROYsX.js → DiagramView-BAoYIAGR.js} +1 -1
  28. package/dist/assets/{MarkdownRendererImpl-DiJE-v5Q.js → MarkdownRendererImpl-B0NE4mIY.js} +3 -3
  29. package/dist/assets/MultiRunWindow-BT4kt6aB.js +1 -0
  30. package/dist/assets/NewWorktreeDialog-Bx-zQyBp.js +167 -0
  31. package/dist/assets/{OnboardingScreen-DpBF8dKJ.js → OnboardingScreen-CbJOPUxm.js} +1 -1
  32. package/dist/assets/{SessionSwitcherDropdown-1xaHUxPK.js → SessionSwitcherDropdown-BbUzUNEi.js} +1 -1
  33. package/dist/assets/{SettingsWindow-ChwLyQAe.js → SettingsWindow-CSb8eo8p.js} +1 -1
  34. package/dist/assets/{TerminalView-DGEBNuAp.js → TerminalView-ME5MOz7S.js} +1 -1
  35. package/dist/assets/es-Bk-yR0w-.js +15 -0
  36. package/dist/assets/fr-f1ibV7QU.js +13 -0
  37. package/dist/assets/index-B82A6jBD.css +1 -0
  38. package/dist/assets/index-BsXkdBYx.js +3 -0
  39. package/dist/assets/ja-D9mS3zWP.js +15 -0
  40. package/dist/assets/ko-Cpl1IA3D.js +15 -0
  41. package/dist/assets/{main-fm_8J7Lk.js → main-D6eC2bnV.js} +2 -2
  42. package/dist/assets/main-fsOGbLGZ.js +214 -0
  43. package/dist/assets/miniChat-DKGU29GZ.js +2 -0
  44. package/dist/assets/mobile-YHQHMYWC.js +2 -0
  45. package/dist/assets/pl-CYke_fxL.js +15 -0
  46. package/dist/assets/pt-BR-Clb6Z8up.js +15 -0
  47. package/dist/assets/renderElectronMiniChatApp-3vxeddJO.js +2 -0
  48. package/dist/assets/{renderMobileApp-6s0G1iIJ.js → renderMobileApp-BrvLHYCY.js} +5 -5
  49. package/dist/assets/uk-CXn8cxXa.js +15 -0
  50. package/dist/assets/{useAppFontEffects-CV5C5O0r.js → useAppFontEffects-b7bqtGFf.js} +124 -119
  51. package/dist/assets/{vendor-.bun-CC_Xso_s.js → vendor-.bun-By2L9XvG.js} +1 -1
  52. package/dist/assets/zh-CN-BRwwlEdG.js +15 -0
  53. package/dist/assets/zh-TW-D5pg5Z8l.js +15 -0
  54. package/dist/index.html +4 -4
  55. package/dist/mini-chat.html +4 -4
  56. package/dist/mobile.html +4 -4
  57. package/package.json +1 -1
  58. package/server/lib/cloudflare-tunnel.js +2 -2
  59. package/server/lib/event-stream/global-hub.js +1 -1
  60. package/server/lib/event-stream/index.js +0 -12
  61. package/server/lib/event-stream/runtime.js +1 -1
  62. package/server/lib/git/service.js +18 -0
  63. package/server/lib/git/service.test.js +48 -0
  64. package/server/lib/notifications/index.js +1 -4
  65. package/server/lib/opencode/agents.js +0 -6
  66. package/server/lib/opencode/commands.js +0 -5
  67. package/server/lib/opencode/config-entity-routes.js +39 -21
  68. package/server/lib/opencode/feature-routes-runtime.js +27 -62
  69. package/server/lib/opencode/lifecycle.js +13 -1
  70. package/server/lib/opencode/npm-registry.js +3 -3
  71. package/server/lib/opencode/proxy.js +3 -3
  72. package/server/lib/opencode/shared.js +0 -6
  73. package/server/lib/opencode/skills.js +0 -2
  74. package/server/lib/opencode/snippets.js +0 -2
  75. package/server/lib/package-manager.js +5 -5
  76. package/server/lib/projects/project-config.js +0 -8
  77. package/server/lib/quota/DOCUMENTATION.md +3 -1
  78. package/server/lib/quota/providers/claude.js +1 -1
  79. package/server/lib/quota/providers/codex.js +1 -1
  80. package/server/lib/quota/providers/copilot.js +1 -1
  81. package/server/lib/quota/providers/cursor.js +1 -1
  82. package/server/lib/quota/providers/google/auth.js +2 -2
  83. package/server/lib/quota/providers/google/index.js +0 -27
  84. package/server/lib/quota/providers/google/transforms.js +1 -1
  85. package/server/lib/quota/providers/index.js +1 -1
  86. package/server/lib/quota/providers/kimi.js +1 -1
  87. package/server/lib/quota/providers/minimax-cn-coding-plan.js +1 -1
  88. package/server/lib/quota/providers/minimax-coding-plan.js +1 -1
  89. package/server/lib/quota/providers/nanogpt.js +1 -1
  90. package/server/lib/quota/providers/ollama-cloud.js +1 -1
  91. package/server/lib/quota/providers/openai.js +4 -4
  92. package/server/lib/quota/providers/openrouter.js +1 -1
  93. package/server/lib/quota/providers/wafer.js +1 -1
  94. package/server/lib/quota/providers/zai.js +1 -1
  95. package/server/lib/quota/providers/zhipuai-coding-plan.js +1 -1
  96. package/server/lib/skills-catalog/cache.js +0 -4
  97. package/server/lib/skills-catalog/clawdhub/api.js +0 -32
  98. package/server/lib/skills-catalog/clawdhub/scan.js +0 -52
  99. package/server/lib/skills-catalog/curated-sources.js +1 -1
  100. package/server/lib/skills-catalog/source.js +5 -0
  101. package/server/lib/terminal/runtime.js +11 -9
  102. package/server/lib/text/summarization.js +1 -1
  103. package/server/lib/tunnels/providers/ngrok.js +1 -1
  104. package/server/lib/tunnels/types.js +2 -2
  105. package/dist/assets/MultiRunWindow-yZoCT7F7.js +0 -1
  106. package/dist/assets/NewWorktreeDialog-CTMiE7Xd.js +0 -167
  107. package/dist/assets/es-CTE-E8we.js +0 -15
  108. package/dist/assets/fr-TVkZpyEo.js +0 -13
  109. package/dist/assets/index-B4pCDMbq.css +0 -1
  110. package/dist/assets/index-D9uMvTQF.js +0 -3
  111. package/dist/assets/ko-D_UCJIIL.js +0 -15
  112. package/dist/assets/main-eAd3a6tx.js +0 -214
  113. package/dist/assets/miniChat-Bbjg31IC.js +0 -2
  114. package/dist/assets/mobile-B3_j_DsB.js +0 -2
  115. package/dist/assets/pl-nDEkk-GZ.js +0 -15
  116. package/dist/assets/pt-BR-B_g2RcgU.js +0 -15
  117. package/dist/assets/renderElectronMiniChatApp-CB13zs6N.js +0 -2
  118. package/dist/assets/uk-CWLhnPGW.js +0 -15
  119. package/dist/assets/zh-CN-BFxe1b5m.js +0 -15
  120. package/dist/assets/zh-TW-n-d-xbGV.js +0 -15
  121. package/server/lib/opencode/index.js +0 -95
  122. package/server/lib/quota/providers/interface.js +0 -55
  123. package/server/lib/skills-catalog/clawdhub/index.js +0 -30
  124. package/server/lib/skills-catalog/index.js +0 -42
  125. package/server/lib/terminal/index.js +0 -31
@@ -0,0 +1,121 @@
1
+ # CLI Module Map
2
+
3
+ This directory contains the non-entrypoint implementation for the OpenChamber CLI. `packages/web/bin/cli.js` should stay thin: it owns bootstrap, command wiring, top-level dispatch, signal/cancel handling, and compatibility exports. Domain logic belongs in these modules.
4
+
5
+ ## Entrypoint Boundary
6
+
7
+ - `../cli.js`
8
+ - Owns process bootstrap, package/version lookup, command table wiring, signal handlers, top-level error handling, and legacy exports used by tests or external consumers.
9
+ - Injects runtime dependencies into command factories, such as `serveCommand`, `stopCommand`, package-manager loading, cancel cleanup, and foreground server state setters.
10
+ - Should not grow command-specific behavior. If a new branch needs more than dispatch/wiring, move it here into a command or helper module instead.
11
+
12
+ ## Command Modules
13
+
14
+ Command modules implement user-facing commands and preserve output contracts across interactive, non-TTY, `--quiet`, and `--json` modes. They should use `../cli-output.js` for presentation helpers and keep safety validation in command logic, not prompts.
15
+
16
+ - `commands-serve.js`
17
+ - Implements `openchamber serve`.
18
+ - Owns OpenCode CLI checks, port resolution, log rotation, PID/instance registry writes, foreground/background server launch, startup summaries, and foreground shutdown behavior.
19
+
20
+ - `commands-lifecycle.js`
21
+ - Implements `openchamber stop` and `openchamber restart`.
22
+ - Owns lifecycle stop/restart semantics, desktop-managed port rejection, unmanaged instance shutdown attempts, PID/instance cleanup, and restart reuse of stored instance options.
23
+
24
+ - `commands-status.js`
25
+ - Implements `openchamber status`.
26
+ - Formats discovered instances and tunnel readiness/status for human, quiet, and JSON output.
27
+
28
+ - `commands-logs.js`
29
+ - Implements `openchamber logs`.
30
+ - Resolves log files, tails recent lines, and follows log output.
31
+
32
+ - `commands-startup.js`
33
+ - Implements `openchamber startup`.
34
+ - Handles startup subcommand dispatch and presentation around the lower-level startup service helpers.
35
+
36
+ - `commands-connect-url.js`
37
+ - Implements `openchamber connect-url`.
38
+ - Finds or starts a local instance and prints the browser/connect URL according to the selected output mode.
39
+
40
+ - `commands-update.js`
41
+ - Implements `openchamber update`.
42
+ - Loads the package-manager helper, performs update flow, and coordinates restart behavior after updates.
43
+
44
+ - `commands-tunnel.js`
45
+ - Implements `openchamber tunnel` and its subcommands: `profile`, `providers`, `ready`, `doctor`, `status`, `start`, `stop`, and `completion`.
46
+ - Owns tunnel-specific command flow, interactive prompt decisions, managed-local/managed-remote startup, QR display rules, tunnel start/stop API calls, and tunnel profile command handling.
47
+ - Receives `serveCommand` and `stopCommand` by dependency injection. Do not reach back into `cli.js` command globals from this module.
48
+
49
+ ## Shared Helper Modules
50
+
51
+ These modules hold reusable, non-presentational logic for commands.
52
+
53
+ - `cli-args.js`
54
+ - Argument parsing, defaults, help text, completion script generation, and typo suggestions.
55
+
56
+ - `cli-errors.js`
57
+ - CLI exit codes and typed tunnel CLI errors.
58
+
59
+ - `cli-paths.js`
60
+ - Data, run, log, settings, tunnel profile, and managed-local config paths.
61
+
62
+ - `cli-process.js`
63
+ - PID files, instance registry files, process identity checks, runtime metadata checks, and process termination helpers.
64
+
65
+ - `cli-lifecycle.js`
66
+ - Instance discovery, live health probing, attachability checks, provider discovery, and status aggregation used by lifecycle/status/tunnel commands.
67
+
68
+ - `cli-http.js`
69
+ - HTTP helpers for health checks, shutdown requests, JSON API calls, tunnel provider fetches, and system info fetches.
70
+
71
+ - `cli-network.js`
72
+ - Host resolution, URL building, LAN detection, unsafe browser port validation, and UI password/network exposure checks.
73
+
74
+ - `cli-ports.js`
75
+ - Port availability checks and available-port resolution.
76
+
77
+ - `cli-log-files.js`
78
+ - Log rotation, tail reads, and file-follow streaming.
79
+
80
+ - `cli-executables.js`
81
+ - Executable path resolution and PATH lookup helpers.
82
+
83
+ - `cli-startup.js`
84
+ - Native startup service detection, install/uninstall/status helpers, and platform-specific startup command execution.
85
+
86
+ - `cli-tunnel-profiles.js`
87
+ - Tunnel profile normalization, token resolution/redaction, profile storage, migration, file-permission warnings, and managed-remote pair persistence.
88
+
89
+ - `cli-tunnel-utils.js`
90
+ - Tunnel-specific command string builders, TTL parsing/formatting, and replay command helpers.
91
+
92
+ - `cli-tunnel-capabilities.js`
93
+ - Built-in tunnel provider capability fallbacks used when a live server cannot provide tunnel metadata.
94
+
95
+ ## Placement Rules
96
+
97
+ - Add new CLI commands as `commands-*.js` modules and wire them from `cli.js`.
98
+ - Add reusable logic to the narrow helper module that owns the domain. Create a new helper module before mixing unrelated domains into an existing one.
99
+ - Keep command modules responsible for user-visible behavior and mode-specific output. Keep helper modules mostly output-free unless the helper exists specifically for CLI rendering.
100
+ - Preserve output contracts when moving code:
101
+ - `--json` emits JSON only.
102
+ - `--quiet` emits concise essential output.
103
+ - Prompts are gated by `canPrompt(options)`.
104
+ - Validation and policy run in every mode.
105
+ - Prefer dependency injection from `cli.js` for cross-command behavior, especially when one command needs another command's implementation.
106
+ - Do not import `cli.js` from modules in this directory. The dependency direction is `cli.js` -> command modules -> helper modules.
107
+
108
+ ## Verification
109
+
110
+ For CLI behavior changes, run the focused CLI suite from `packages/web`:
111
+
112
+ ```sh
113
+ bun run test -- bin/cli.test.js
114
+ ```
115
+
116
+ Before finalizing source changes that affect CLI behavior, also run:
117
+
118
+ ```sh
119
+ bun run type-check
120
+ bun run lint
121
+ ```