@hjd-hitsz/claudex-web 0.0.0-stage → 4.1.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.
- package/.env.example +27 -0
- package/CHANGELOG.md +495 -0
- package/LICENSE +674 -0
- package/README.md +106 -2
- package/bin/claudex-web.mjs +129 -0
- package/build-info.json +8 -0
- package/client/dist/_baseMerge.js +1 -0
- package/client/dist/abnfDiagram-WEYOIA3C.js +1 -0
- package/client/dist/apl.js +1 -0
- package/client/dist/app.js +392 -0
- package/client/dist/apple-touch-icon.png +0 -0
- package/client/dist/arc.js +1 -0
- package/client/dist/architectureDiagram-ZHVYKT53.js +36 -0
- package/client/dist/asciiarmor.js +1 -0
- package/client/dist/asn1.js +1 -0
- package/client/dist/asterisk.js +1 -0
- package/client/dist/blockDiagram-RJAE7QA3.js +140 -0
- package/client/dist/brainfuck.js +1 -0
- package/client/dist/c4Diagram-XDPPPE54.js +38 -0
- package/client/dist/channel.js +1 -0
- package/client/dist/chunk-2E7WHVMD.js +88 -0
- package/client/dist/chunk-2Q5K7J3B.js +1 -0
- package/client/dist/chunk-4EMNKR2T.js +1 -0
- package/client/dist/chunk-55XCU76K.js +1 -0
- package/client/dist/chunk-5VM5RSS4.js +15 -0
- package/client/dist/chunk-JWPE2WC7.js +1 -0
- package/client/dist/chunk-VQ5W62QI.js +1 -0
- package/client/dist/chunk-XXDRQBXY.js +1 -0
- package/client/dist/chunk-ZCHMQSOR.js +2 -0
- package/client/dist/classDiagram-v2-4MYWR3UA.js +217 -0
- package/client/dist/clike.js +1 -0
- package/client/dist/clojure.js +1 -0
- package/client/dist/cmake.js +1 -0
- package/client/dist/cobol.js +1 -0
- package/client/dist/code-highlight-style.js +13 -0
- package/client/dist/coffeescript.js +1 -0
- package/client/dist/commonlisp.js +1 -0
- package/client/dist/cose-bilkent-JH36ORCC.js +1 -0
- package/client/dist/crystal.js +1 -0
- package/client/dist/css.js +1 -0
- package/client/dist/cynefin-EF2NZ3EQ.js +141 -0
- package/client/dist/cynefinDiagram-WF24UDRP.js +62 -0
- package/client/dist/cypher.js +1 -0
- package/client/dist/cytoscape.esm.js +321 -0
- package/client/dist/d.js +1 -0
- package/client/dist/dagre-NK4GIZVX.js +4 -0
- package/client/dist/defaultLocale.js +1 -0
- package/client/dist/diagram-CBK3MWTC.js +24 -0
- package/client/dist/diagram-I5XIIV2D.js +24 -0
- package/client/dist/diagram-ODIL2UCW.js +30 -0
- package/client/dist/diagram-PFBEJUXE.js +3 -0
- package/client/dist/diagram-RJA3I4VV.js +41 -0
- package/client/dist/diagram-TYUNFSNR.js +200 -0
- package/client/dist/diff.js +1 -0
- package/client/dist/dockerfile.js +1 -0
- package/client/dist/document-editor.js +1040 -0
- package/client/dist/dtd.js +1 -0
- package/client/dist/dylan.js +1 -0
- package/client/dist/ebnf.js +1 -0
- package/client/dist/ebnfDiagram-V4P3TTPT.js +1 -0
- package/client/dist/ecl.js +1 -0
- package/client/dist/eiffel.js +1 -0
- package/client/dist/elk-QONTBCTQ.js +27 -0
- package/client/dist/elm.js +1 -0
- package/client/dist/erDiagram-KYQIGQAA.js +99 -0
- package/client/dist/erlang.js +1 -0
- package/client/dist/factor.js +1 -0
- package/client/dist/favicon.ico +0 -0
- package/client/dist/favicon.png +0 -0
- package/client/dist/fcl.js +1 -0
- package/client/dist/file-panel.js +1 -0
- package/client/dist/flowDiagram-IUGLLWBU.js +213 -0
- package/client/dist/forth.js +1 -0
- package/client/dist/fortran.js +1 -0
- package/client/dist/ganttDiagram-R7GPNTJY.js +292 -0
- package/client/dist/gas.js +1 -0
- package/client/dist/gherkin.js +1 -0
- package/client/dist/gitGraphDiagram-PDYL7XHY.js +106 -0
- package/client/dist/graph.js +1 -0
- package/client/dist/groovy.js +1 -0
- package/client/dist/haskell.js +1 -0
- package/client/dist/haxe.js +1 -0
- package/client/dist/http.js +1 -0
- package/client/dist/idl.js +1 -0
- package/client/dist/index.html +25 -0
- package/client/dist/index.js +2 -0
- package/client/dist/index10.js +1 -0
- package/client/dist/index11.js +1 -0
- package/client/dist/index12.js +1 -0
- package/client/dist/index13.js +7 -0
- package/client/dist/index14.js +1 -0
- package/client/dist/index15.js +1 -0
- package/client/dist/index16.js +6 -0
- package/client/dist/index17.js +1 -0
- package/client/dist/index18.js +3 -0
- package/client/dist/index19.js +1 -0
- package/client/dist/index2.js +1 -0
- package/client/dist/index20.js +1 -0
- package/client/dist/index21.js +1 -0
- package/client/dist/index22.js +1 -0
- package/client/dist/index3.js +1 -0
- package/client/dist/index4.js +1 -0
- package/client/dist/index5.js +1 -0
- package/client/dist/index6.js +13 -0
- package/client/dist/index7.js +1 -0
- package/client/dist/index8.js +1 -0
- package/client/dist/index9.js +1 -0
- package/client/dist/infoDiagram-MVDRKAX5.js +2 -0
- package/client/dist/init.js +1 -0
- package/client/dist/isArrayLikeObject.js +1 -0
- package/client/dist/ishikawaDiagram-HPEHV2GE.js +70 -0
- package/client/dist/javascript.js +1 -0
- package/client/dist/journeyDiagram-BOSHW7O7.js +139 -0
- package/client/dist/julia.js +1 -0
- package/client/dist/kanban-definition-FNSA4HC5.js +89 -0
- package/client/dist/katex.js +257 -0
- package/client/dist/linear.js +1 -0
- package/client/dist/livescript.js +1 -0
- package/client/dist/lua.js +1 -0
- package/client/dist/mathematica.js +1 -0
- package/client/dist/mbox.js +1 -0
- package/client/dist/mermaid.core.js +310 -0
- package/client/dist/mindmap-definition-6OY57UG3.js +98 -0
- package/client/dist/mirc.js +1 -0
- package/client/dist/mllike.js +1 -0
- package/client/dist/modelica.js +1 -0
- package/client/dist/mscgen.js +1 -0
- package/client/dist/mumps.js +1 -0
- package/client/dist/nginx.js +1 -0
- package/client/dist/notification-worker.js +45 -0
- package/client/dist/nsis.js +1 -0
- package/client/dist/ntriples.js +1 -0
- package/client/dist/octave.js +1 -0
- package/client/dist/ordinal.js +1 -0
- package/client/dist/oz.js +1 -0
- package/client/dist/pascal.js +1 -0
- package/client/dist/pegDiagram-ECIUJNBX.js +1 -0
- package/client/dist/perl.js +1 -0
- package/client/dist/pieDiagram-GNMPY74T.js +39 -0
- package/client/dist/pig.js +1 -0
- package/client/dist/powershell.js +1 -0
- package/client/dist/properties.js +1 -0
- package/client/dist/protobuf.js +1 -0
- package/client/dist/pug.js +1 -0
- package/client/dist/puppet.js +1 -0
- package/client/dist/purify.es.js +3 -0
- package/client/dist/python.js +1 -0
- package/client/dist/q.js +1 -0
- package/client/dist/quadrantDiagram-D57K4MC3.js +7 -0
- package/client/dist/r.js +1 -0
- package/client/dist/railroadDiagram-Y72NRBL7.js +1 -0
- package/client/dist/requirementDiagram-EQYSW5RA.js +84 -0
- package/client/dist/rpm.js +1 -0
- package/client/dist/ruby.js +1 -0
- package/client/dist/sankeyDiagram-SY24JHO5.js +40 -0
- package/client/dist/sas.js +1 -0
- package/client/dist/scheme.js +1 -0
- package/client/dist/sequenceDiagram-BLEHNHQU.js +169 -0
- package/client/dist/shell.js +1 -0
- package/client/dist/sieve.js +1 -0
- package/client/dist/simple-mode.js +1 -0
- package/client/dist/sizeCapture-INFHLROL.js +1 -0
- package/client/dist/smalltalk.js +1 -0
- package/client/dist/solr.js +1 -0
- package/client/dist/sparql.js +1 -0
- package/client/dist/spreadsheet.js +1 -0
- package/client/dist/sql.js +1 -0
- package/client/dist/stateDiagram-v2-A6IESKWZ.js +291 -0
- package/client/dist/stex.js +1 -0
- package/client/dist/style.css +1 -0
- package/client/dist/stylus.js +1 -0
- package/client/dist/swift.js +1 -0
- package/client/dist/swimlanes-B3ENRKFQ.js +1 -0
- package/client/dist/swimlanesDiagram-AYQRV4AK.js +8 -0
- package/client/dist/tcl.js +1 -0
- package/client/dist/terminal-panel.js +18 -0
- package/client/dist/textile.js +1 -0
- package/client/dist/tiddlywiki.js +1 -0
- package/client/dist/tiki.js +1 -0
- package/client/dist/timeline-definition-JXYKGLGB.js +120 -0
- package/client/dist/toml.js +1 -0
- package/client/dist/troff.js +1 -0
- package/client/dist/ttcn-cfg.js +1 -0
- package/client/dist/ttcn.js +1 -0
- package/client/dist/turtle.js +1 -0
- package/client/dist/usecaseDiagram-WPOLBNNX.js +370 -0
- package/client/dist/vb.js +1 -0
- package/client/dist/vbscript.js +1 -0
- package/client/dist/velocity.js +1 -0
- package/client/dist/vennDiagram-Q3Y3IDCW.js +34 -0
- package/client/dist/verilog.js +1 -0
- package/client/dist/vhdl.js +1 -0
- package/client/dist/wardleyDiagram-IVAIDKWA.js +78 -0
- package/client/dist/webidl.js +1 -0
- package/client/dist/xquery.js +1 -0
- package/client/dist/xychartDiagram-4URNHDU4.js +7 -0
- package/client/dist/yacas.js +1 -0
- package/client/dist/z80.js +1 -0
- package/docs/architecture/backend-regressions.md +53 -0
- package/docs/architecture/backends.md +115 -0
- package/docs/architecture/behavior.md +228 -0
- package/docs/architecture.md +335 -0
- package/docs/background-tasks.md +39 -0
- package/docs/cli-command-coverage.md +60 -0
- package/docs/deployment.md +289 -0
- package/docs/development.md +396 -0
- package/docs/images/desktop-dark.png +0 -0
- package/docs/images/desktop-light.png +0 -0
- package/docs/images/mobile-sidebar.png +0 -0
- package/docs/images/mobile.png +0 -0
- package/docs/releases/v2.0.0.md +5 -0
- package/docs/releases/v2.1.0.md +6 -0
- package/docs/releases/v2.1.1.md +6 -0
- package/docs/releases/v2.1.2.md +8 -0
- package/docs/releases/v2.2.0.md +11 -0
- package/docs/releases/v2.3.0.md +12 -0
- package/docs/releases/v2.3.1.md +8 -0
- package/docs/releases/v2.4.0.md +8 -0
- package/docs/releases/v2.4.1.md +8 -0
- package/docs/releases/v2.4.2.md +8 -0
- package/docs/releases/v3.0.0.md +9 -0
- package/docs/releases/v3.1.0.md +10 -0
- package/docs/releases/v3.1.1.md +7 -0
- package/docs/releases/v4.0.0-beta.1.md +10 -0
- package/docs/releases/v4.0.0.md +20 -0
- package/docs/releases/v4.0.1.md +10 -0
- package/docs/releases/v4.1.0.md +21 -0
- package/docs/versioning.md +129 -0
- package/package.json +87 -4
- package/packages/translation-engine/LICENSE +674 -0
- package/packages/translation-engine/README.md +69 -0
- package/packages/translation-engine/bin/tokenizer-linux-x64 +0 -0
- package/packages/translation-engine/bin/translate.mjs +29 -0
- package/packages/translation-engine/native/build.mjs +15 -0
- package/packages/translation-engine/native/tokenizer.c +73 -0
- package/packages/translation-engine/package.json +29 -0
- package/packages/translation-engine/src/catalog.mjs +103 -0
- package/packages/translation-engine/src/cpu-runtime.mjs +90 -0
- package/packages/translation-engine/src/download.mjs +94 -0
- package/packages/translation-engine/src/index.mjs +70 -0
- package/packages/translation-engine/src/inference.mjs +177 -0
- package/packages/translation-engine/src/model-store.mjs +197 -0
- package/packages/translation-engine/src/tokenizer.mjs +77 -0
- package/packages/translation-engine/src/worker.mjs +83 -0
- package/scripts/install-services.mjs +135 -0
- package/scripts/restart-when-idle.mjs +125 -0
- package/scripts/start-backend.mjs +29 -0
- package/server/src/agent-messages.mjs +124 -0
- package/server/src/application.mjs +168 -0
- package/server/src/auth.mjs +328 -0
- package/server/src/backends/claude/account.mjs +171 -0
- package/server/src/backends/claude/adapter.mjs +366 -0
- package/server/src/backends/claude/agent-history.mjs +70 -0
- package/server/src/backends/claude/background-tasks.mjs +168 -0
- package/server/src/backends/claude/catalogue.mjs +268 -0
- package/server/src/backends/claude/execution-errors.mjs +44 -0
- package/server/src/backends/claude/execution-session.mjs +396 -0
- package/server/src/backends/claude/git-tool-changes.mjs +77 -0
- package/server/src/backends/claude/goals.mjs +319 -0
- package/server/src/backends/claude/history-actions.mjs +170 -0
- package/server/src/backends/claude/history.mjs +65 -0
- package/server/src/backends/claude/hooks.mjs +232 -0
- package/server/src/backends/claude/input-stream.mjs +24 -0
- package/server/src/backends/claude/messages-request.mjs +34 -0
- package/server/src/backends/claude/messages.mjs +301 -0
- package/server/src/backends/claude/model-options.mjs +18 -0
- package/server/src/backends/claude/native-commands.mjs +48 -0
- package/server/src/backends/claude/native-records.mjs +76 -0
- package/server/src/backends/claude/process-ownership.mjs +82 -0
- package/server/src/backends/claude/project-instructions.mjs +40 -0
- package/server/src/backends/claude/provider-balance.mjs +40 -0
- package/server/src/backends/claude/provider-environment.mjs +95 -0
- package/server/src/backends/claude/provider-transport.mjs +70 -0
- package/server/src/backends/claude/recovery.mjs +54 -0
- package/server/src/backends/claude/runtime.mjs +463 -0
- package/server/src/backends/claude/session-worker.mjs +32 -0
- package/server/src/backends/claude/sessions.mjs +348 -0
- package/server/src/backends/claude/token-usage.mjs +98 -0
- package/server/src/backends/claude/worker-client.mjs +351 -0
- package/server/src/backends/claude/worker-launcher.mjs +119 -0
- package/server/src/backends/claude/worker-location.mjs +43 -0
- package/server/src/backends/claude/worker-revision.mjs +45 -0
- package/server/src/backends/claude/worker-server.mjs +290 -0
- package/server/src/backends/cli-installation.mjs +140 -0
- package/server/src/backends/codex/adapter.mjs +155 -0
- package/server/src/backends/codex/compaction-recovery.mjs +78 -0
- package/server/src/backends/codex/events.mjs +125 -0
- package/server/src/backends/codex/methods.mjs +17 -0
- package/server/src/backends/codex/reference-mcp.mjs +97 -0
- package/server/src/backends/codex/reference-tools.mjs +71 -0
- package/server/src/backends/codex/requests.mjs +170 -0
- package/server/src/backends/codex/subscriptions.mjs +91 -0
- package/server/src/backends/codex/token-usage.mjs +140 -0
- package/server/src/backends/codex/upstream.mjs +148 -0
- package/server/src/backends/configuration.mjs +122 -0
- package/server/src/backends/identity-mapping.mjs +87 -0
- package/server/src/backends/manager.mjs +478 -0
- package/server/src/backends/network-proxy.mjs +55 -0
- package/server/src/backends/provider-presets.mjs +45 -0
- package/server/src/backends/providers.mjs +135 -0
- package/server/src/backends/storage.mjs +39 -0
- package/server/src/bridge/conversation-policy.mjs +29 -0
- package/server/src/bridge/file-operations.mjs +47 -0
- package/server/src/bridge/product-methods.mjs +66 -0
- package/server/src/compaction.mjs +82 -0
- package/server/src/config.mjs +64 -0
- package/server/src/file-content.mjs +99 -0
- package/server/src/file-undo.mjs +142 -0
- package/server/src/http/maintenance.mjs +28 -0
- package/server/src/http/router.mjs +98 -0
- package/server/src/http/static.mjs +62 -0
- package/server/src/product-config.mjs +80 -0
- package/server/src/project-models.mjs +59 -0
- package/server/src/rpc-transport.mjs +21 -0
- package/server/src/server.mjs +29 -0
- package/server/src/service-maintenance-worker.mjs +124 -0
- package/server/src/service-maintenance.mjs +222 -0
- package/server/src/summary-translation.mjs +71 -0
- package/server/src/system-auth.mjs +45 -0
- package/server/src/thread-folders.mjs +76 -0
- package/server/src/thread-names.mjs +264 -0
- package/server/src/thread-projects.mjs +36 -0
- package/server/src/tls.mjs +87 -0
- package/server/src/token-usage-reconciliation.mjs +105 -0
- package/server/src/token-usage.mjs +208 -0
- package/server/src/translation-service.mjs +133 -0
- package/server/src/version.mjs +55 -0
- package/server/src/web-config-migration.mjs +48 -0
- package/server/src/workspace/commands.mjs +33 -0
- package/server/src/workspace/files.mjs +44 -0
- package/server/src/workspace/service.mjs +27 -0
- package/server/src/workspace/terminals.mjs +122 -0
- package/shared/backend-activity.mjs +13 -0
- package/shared/backend-capabilities.mjs +33 -0
- package/shared/backend-identity.mjs +17 -0
- package/shared/compaction-state.mjs +49 -0
- package/shared/file-types.mjs +82 -0
- package/shared/product-contract.mjs +26 -0
- package/shared/rpc-limits.mjs +2 -0
- package/shared/terminal-workspace.mjs +26 -0
package/README.md
CHANGED
|
@@ -1,3 +1,107 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="client/src/assets/claudex-web.svg" width="88" height="88" alt="Claudex Web 图标">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Claudex Web</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>在浏览器中,继续你的 Codex 与 Claude Code 工作。</strong><br>
|
|
9
|
+
在电脑上部署,通过电脑、手机或平板访问同一工作环境。
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="#快速开始">快速开始</a> ·
|
|
14
|
+
<a href="docs/deployment.md">部署指南</a> ·
|
|
15
|
+
<a href="https://github.com/hjd-hitsz/claudex-web/releases">版本更新</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<picture>
|
|
19
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/desktop-dark.png">
|
|
20
|
+
<img src="docs/images/desktop-light.png" alt="Claudex Web 桌面界面:项目列表、账户额度圆环、任务对话、文件变更汇总与 Markdown 文件预览" width="1440">
|
|
21
|
+
</picture>
|
|
22
|
+
|
|
23
|
+
<p align="center"><sub>桌面界面 · 演示数据</sub></p>
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>查看手机界面</summary>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<img src="docs/images/mobile.png" alt="Claudex Web 手机界面:任务对话、文件变更汇总与消息输入框" width="320">
|
|
30
|
+
<img src="docs/images/mobile-sidebar.png" alt="Claudex Web 手机侧栏:项目对话列表与账户额度圆环" width="320">
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
</details>
|
|
34
|
+
|
|
35
|
+
## 快速开始
|
|
36
|
+
|
|
37
|
+
需要 Linux、Node.js 24+、npm 和 systemd。Debian / Ubuntu 安装系统依赖可执行以下命令。
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sudo apt-get install openssl pamtester
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
以运行服务的普通用户安装,安装 npm 上的最新稳定版本。
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @hjd-hitsz/claudex-web
|
|
47
|
+
claudex-web service install
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
浏览器打开 `https://部署电脑的IP:8766`,使用该电脑上运行服务的系统用户名和密码登录。首次访问的证书配置见[证书安装指引](docs/deployment.md#证书配置)。
|
|
51
|
+
|
|
52
|
+
需要开机启动并在退出系统登录后继续运行时,执行 `loginctl enable-linger "$USER"`。
|
|
53
|
+
|
|
54
|
+
## 配置 Codex
|
|
55
|
+
|
|
56
|
+
在网页“设置 → 模型与服务配置”中为 Codex 点击“一键安装”。
|
|
57
|
+
|
|
58
|
+
### 使用 ChatGPT 账户
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
codex login
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 使用自定义模型服务
|
|
65
|
+
|
|
66
|
+
编辑 `~/.codex/config.toml`。合并以下配置,把模型 ID 和地址替换为服务提供的值。`model` 和 `model_provider` 放在文件顶部、所有表头之前。
|
|
67
|
+
|
|
68
|
+
```toml
|
|
69
|
+
model = "your-model-id"
|
|
70
|
+
model_provider = "custom"
|
|
71
|
+
|
|
72
|
+
[model_providers.custom]
|
|
73
|
+
name = "Custom"
|
|
74
|
+
base_url = "https://model.example/v1"
|
|
75
|
+
wire_api = "responses"
|
|
76
|
+
requires_openai_auth = true
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 配置 Claude Code
|
|
80
|
+
|
|
81
|
+
在网页“设置 → 模型与服务配置”中为 Claude Code 点击“一键安装”,然后启用该后端。
|
|
82
|
+
|
|
83
|
+
### 使用 Claude 账户
|
|
84
|
+
|
|
85
|
+
以运行服务的同一系统用户登录,然后在网页模型菜单中选择 Claude 原生模型。
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
claude auth login
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 使用自定义供应商和模型
|
|
92
|
+
|
|
93
|
+
在网页“设置 → Claude Code”的供应商列表中添加服务。
|
|
94
|
+
|
|
95
|
+
DeepSeek 等预置供应商直接填写 API Key。
|
|
96
|
+
|
|
97
|
+
## 更多文档
|
|
98
|
+
|
|
99
|
+
- [部署与维护](docs/deployment.md)包含端口、证书、网络代理、服务管理、升级和故障排查。
|
|
100
|
+
- [开发者指南](docs/development.md)介绍源码运行与开发验证,[架构设计](docs/architecture.md)说明模块边界。
|
|
101
|
+
- [版本更新](https://github.com/hjd-hitsz/claudex-web/releases)与[变更日志](CHANGELOG.md)记录版本变化。
|
|
102
|
+
|
|
103
|
+
## 许可证
|
|
104
|
+
|
|
105
|
+
Copyright (C) 2026 Claudex Web contributors.
|
|
106
|
+
|
|
107
|
+
Claudex Web 采用 [GNU General Public License v3.0](LICENSE)(SPDX:`GPL-3.0-only`)发布。你可以按 GNU GPL 第 3 版的条款使用、复制、修改和分发本项目。担保与责任限制见许可证正文,第三方依赖沿用各自的许可证。
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Claudex Web 命令入口,配置与运行时数据独立于 npm 安装目录。
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { constants } from "node:fs";
|
|
5
|
+
import { copyFile, mkdir } from "node:fs/promises";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { loadEnvFile } from "node:process";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { readConfig } from "../server/src/config.mjs";
|
|
10
|
+
import { readVersion } from "../server/src/version.mjs";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
productDirectories,
|
|
14
|
+
migrateProductConfig,
|
|
15
|
+
} from "../server/src/product-config.mjs";
|
|
16
|
+
|
|
17
|
+
const root = fileURLToPath(new URL("../", import.meta.url));
|
|
18
|
+
const directories = productDirectories();
|
|
19
|
+
const { configDir } = directories;
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const command = args.join(" ") || "start";
|
|
22
|
+
|
|
23
|
+
async function main() {
|
|
24
|
+
if (["--help", "-h", "help"].includes(command)) {
|
|
25
|
+
console.log(`Claudex Web — Codex 与 Claude Code 的浏览器客户端
|
|
26
|
+
|
|
27
|
+
用法:claudex-web [命令]
|
|
28
|
+
start 前台启动网页服务(默认命令)
|
|
29
|
+
backend 前台启动 Codex app-server
|
|
30
|
+
config init 创建用户配置,保留已有配置
|
|
31
|
+
service install 安装并启动 Linux systemd 用户服务
|
|
32
|
+
service status 查看网页与后端服务状态
|
|
33
|
+
service start 启动网页服务及其 Codex 后端
|
|
34
|
+
service stop 停止网页服务
|
|
35
|
+
service restart 重启网页服务
|
|
36
|
+
service restart-when-idle 等待任务与上下文整理结束后重启网页服务
|
|
37
|
+
--version 显示版本与开发构建标识
|
|
38
|
+
version --json 显示完整版本、提交和构建信息
|
|
39
|
+
|
|
40
|
+
配置目录:${configDir}
|
|
41
|
+
可用 CLAUDEX_WEB_CONFIG_DIR 指定配置目录。
|
|
42
|
+
安装 npm 包后执行 claudex-web service install 可启用后台访问。`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (["--version", "-v"].includes(command)) {
|
|
46
|
+
console.log(readVersion().displayVersion);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (command === "version --json") {
|
|
50
|
+
console.log(JSON.stringify(readVersion(), null, 2));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (
|
|
54
|
+
![
|
|
55
|
+
"start",
|
|
56
|
+
"backend",
|
|
57
|
+
"config init",
|
|
58
|
+
"service install",
|
|
59
|
+
"service status",
|
|
60
|
+
"service start",
|
|
61
|
+
"service stop",
|
|
62
|
+
"service restart",
|
|
63
|
+
"service restart-when-idle",
|
|
64
|
+
].includes(command)
|
|
65
|
+
)
|
|
66
|
+
throw new Error(`未知命令:${command}。使用 claudex-web --help 查看用法。`);
|
|
67
|
+
if (command.startsWith("service ") && process.platform !== "linux")
|
|
68
|
+
throw new Error("后台服务管理需要 Linux 和 systemd 用户服务。");
|
|
69
|
+
|
|
70
|
+
await migrateProductConfig(directories);
|
|
71
|
+
await mkdir(configDir, { recursive: true, mode: 0o700 });
|
|
72
|
+
if (["config init", "service install"].includes(command)) {
|
|
73
|
+
try {
|
|
74
|
+
await copyFile(
|
|
75
|
+
join(root, ".env.example"),
|
|
76
|
+
join(configDir, ".env"),
|
|
77
|
+
constants.COPYFILE_EXCL,
|
|
78
|
+
);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error.code !== "EEXIST") throw error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
process.env.CLAUDEX_WEB_CONFIG_DIR = configDir;
|
|
84
|
+
process.chdir(configDir);
|
|
85
|
+
try {
|
|
86
|
+
loadEnvFile(join(configDir, ".env"));
|
|
87
|
+
} catch (error) {
|
|
88
|
+
if (error.code !== "ENOENT") throw error;
|
|
89
|
+
}
|
|
90
|
+
switch (command) {
|
|
91
|
+
case "config init":
|
|
92
|
+
console.log(`用户配置:${join(configDir, ".env")}`);
|
|
93
|
+
break;
|
|
94
|
+
case "start":
|
|
95
|
+
await import("../server/src/server.mjs");
|
|
96
|
+
break;
|
|
97
|
+
case "backend":
|
|
98
|
+
await import("../scripts/start-backend.mjs");
|
|
99
|
+
break;
|
|
100
|
+
case "service install": {
|
|
101
|
+
const { installServices } =
|
|
102
|
+
await import("../scripts/install-services.mjs");
|
|
103
|
+
await installServices({ configDir, cli: true });
|
|
104
|
+
console.log('开机运行用户服务:loginctl enable-linger "$USER"');
|
|
105
|
+
const config = readConfig();
|
|
106
|
+
console.log(
|
|
107
|
+
`HTTPS 健康检查:https://127.0.0.1:${config.port}/healthz;证书:${config.tlsCert || join(config.configDir, "tls", "certificate.pem")}`,
|
|
108
|
+
);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case "service restart-when-idle":
|
|
112
|
+
await import("../scripts/restart-when-idle.mjs");
|
|
113
|
+
break;
|
|
114
|
+
default: {
|
|
115
|
+
const action = args[1];
|
|
116
|
+
const units = ["claudex-web.service"];
|
|
117
|
+
if (action === "status")
|
|
118
|
+
units.push("codex-app-server.service", "--no-pager");
|
|
119
|
+
execFileSync("systemctl", ["--user", action, ...units], {
|
|
120
|
+
stdio: "inherit",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
main().catch((error) => {
|
|
127
|
+
console.error(error.message);
|
|
128
|
+
process.exitCode = typeof error.status === "number" ? error.status || 1 : 1;
|
|
129
|
+
});
|
package/build-info.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as U,a as l,d as P,e as O,b as S,c as E,f as F,g as $,h as K,o as q,j as G,k as D,r as H,U as b,l as R,m as W,n as w,p as J,q as x,s as Q,t as V,S as X}from"./isArrayLikeObject.js";var Y=/\s/;function Z(r){for(var n=r.length;n--&&Y.test(r.charAt(n)););return n}var z=/^\s+/;function j(r){return r&&r.slice(0,Z(r)+1).replace(z,"")}var I=NaN,k=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,nr=/^0o[0-7]+$/i,er=parseInt;function Sr(r){if(typeof r=="number")return r;if(U(r))return I;if(l(r)){var n=typeof r.valueOf=="function"?r.valueOf():r;r=l(n)?n+"":n}if(typeof r!="string")return r===0?r:+r;r=j(r);var e=rr.test(r);return e||nr.test(r)?er(r.slice(2),e?2:8):k.test(r)?I:+r}var A=Object.create,tr=(function(){function r(){}return function(n){if(!l(n))return{};if(A)return A(n);r.prototype=n;var e=new r;return r.prototype=void 0,e}})();function ir(r,n){var e=-1,t=r.length;for(n||(n=Array(t));++e<t;)n[e]=r[e];return n}function h(r,n,e){n=="__proto__"&&P?P(r,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[n]=e}var fr=Object.prototype,ar=fr.hasOwnProperty;function sr(r,n,e){var t=r[n];(!(ar.call(r,n)&&O(t,e))||e===void 0&&!(n in r))&&h(r,n,e)}function or(r,n,e,t){var s=!e;e||(e={});for(var a=-1,o=n.length;++a<o;){var i=n[a],f=void 0;f===void 0&&(f=r[i]),s?h(e,i,f):sr(e,i,f)}return e}function ur(r,n,e){if(!l(e))return!1;var t=typeof n;return(t=="number"?S(e)&&E(n,e.length):t=="string"&&n in e)?O(e[n],r):!1}function $r(r){return F(function(n,e){var t=-1,s=e.length,a=s>1?e[s-1]:void 0,o=s>2?e[2]:void 0;for(a=r.length>3&&typeof a=="function"?(s--,a):void 0,o&&ur(e[0],e[1],o)&&(a=s<3?void 0:a,s=1),n=Object(n);++t<s;){var i=e[t];i&&r(n,i,t,a)}return n})}function lr(r){var n=[];if(r!=null)for(var e in Object(r))n.push(e);return n}var cr=Object.prototype,pr=cr.hasOwnProperty;function dr(r){if(!l(r))return lr(r);var n=$(r),e=[];for(var t in r)t=="constructor"&&(n||!pr.call(r,t))||e.push(t);return e}function L(r){return S(r)?K(r,!0):dr(r)}var B=q(Object.getPrototypeOf,Object),gr="[object Object]",vr=Function.prototype,Or=Object.prototype,M=vr.toString,hr=Or.hasOwnProperty,mr=M.call(Object);function yr(r){if(!G(r)||D(r)!=gr)return!1;var n=B(r);if(n===null)return!0;var e=hr.call(n,"constructor")&&n.constructor;return typeof e=="function"&&e instanceof e&&M.call(e)==mr}var N=typeof exports=="object"&&exports&&!exports.nodeType&&exports,T=N&&typeof module=="object"&&module&&!module.nodeType&&module,Pr=T&&T.exports===N,_=Pr?H.Buffer:void 0,C=_?_.allocUnsafe:void 0;function br(r,n){if(n)return r.slice();var e=r.length,t=C?C(e):new r.constructor(e);return r.copy(t),t}function wr(r){var n=new r.constructor(r.byteLength);return new b(n).set(new b(r)),n}function xr(r,n){var e=n?wr(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}function Ir(r){return typeof r.constructor=="function"&&!$(r)?tr(B(r)):{}}function g(r,n,e){(e!==void 0&&!O(r[n],e)||e===void 0&&!(n in r))&&h(r,n,e)}function v(r,n){if(!(n==="constructor"&&typeof r[n]=="function")&&n!="__proto__")return r[n]}function Ar(r){return or(r,L(r))}function Tr(r,n,e,t,s,a,o){var i=v(r,e),f=v(n,e),m=o.get(f);if(m){g(r,e,m);return}var u=a?a(i,f,e+"",r,n,o):void 0,c=u===void 0;if(c){var p=w(f),d=!p&&R(f),y=!p&&!d&&W(f);u=f,p||d||y?w(i)?u=i:J(i)?u=ir(i):d?(c=!1,u=br(f,!0)):y?(c=!1,u=xr(f,!0)):u=[]:yr(f)||x(f)?(u=i,x(i)?u=Ar(i):(!l(i)||Q(i))&&(u=Ir(f))):c=!1}c&&(o.set(f,u),s(u,f,t,a,o),o.delete(f)),g(r,e,u)}function _r(r,n,e,t,s){r!==n&&V(n,function(a,o){if(s||(s=new X),l(a))Tr(r,n,o,e,_r,t,s);else{var i=t?t(v(r,o),a,o+"",r,n,s):void 0;i===void 0&&(i=a),g(r,o,i)}},L)}export{xr as a,br as b,wr as c,sr as d,ur as e,h as f,$r as g,_r as h,Ir as i,L as k,Sr as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-2E7WHVMD.js";import{p as f}from"./chunk-JWPE2WC7.js";import{_ as n,l as o}from"./mermaid.core.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ.js";import"./app.js";import"./purify.es.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},t=/[\.\/⌿⍀¨⍣]/,a=/⍬/,i=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,u=/←/,o=/[⍝#].*$/,s=function(r){var n;return n=!1,function(e){return n=e,e===r?n==="\\":!0}};const f={name:"apl",startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(r,n){var e;return r.eatSpace()?null:(e=r.next(),e==='"'||e==="'"?(r.eatWhile(s(e)),r.next(),n.prev=!0,"string"):/[\[{\(]/.test(e)?(n.prev=!1,null):/[\]}\)]/.test(e)?(n.prev=!0,null):a.test(e)?(n.prev=!1,"atom"):/[¯\d]/.test(e)?(n.func?(n.func=!1,n.prev=!1):n.prev=!0,r.eatWhile(/[\w\.]/),"number"):t.test(e)||u.test(e)?"operator":i.test(e)?(n.func=!0,n.prev=!1,l[e]?"variableName.function.standard":"variableName.function"):o.test(e)?(r.skipToEnd(),"comment"):e==="∘"&&r.peek()==="."?(r.next(),"variableName.function"):(r.eatWhile(/[\w\$_]/),n.prev=!0,"keyword"))}};export{f as apl};
|