dominds 1.25.1 → 1.25.3
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/README.md +4 -3
- package/README.zh.md +4 -3
- package/dist/cli/tui.js +2 -0
- package/dist/cli/webui.js +2 -0
- package/dist/cli.js +2 -0
- package/dist/process-title.d.ts +2 -0
- package/dist/process-title.js +13 -0
- package/dist/server/api-routes.js +14 -0
- package/dist/server/dominds-self-update.d.ts +1 -0
- package/dist/server/dominds-self-update.js +17 -0
- package/dist/team.js +4 -1
- package/dist/tools/builtins.js +30 -0
- package/dist/tools/fs.d.ts +2 -0
- package/dist/tools/fs.js +281 -2
- package/dist/tools/os.d.ts +11 -0
- package/dist/tools/os.js +20 -9
- package/dist/tools/picture.d.ts +1 -0
- package/dist/tools/picture.js +64 -1
- package/dist/tools/prompts/codex_inspect_and_patch_tools/en/tools.md +5 -0
- package/dist/tools/prompts/codex_inspect_and_patch_tools/zh/tools.md +5 -0
- package/dist/tools/prompts/fs_read/en/errors.md +6 -0
- package/dist/tools/prompts/fs_read/en/index.md +17 -0
- package/dist/tools/prompts/fs_read/en/principles.md +5 -0
- package/dist/tools/prompts/fs_read/en/scenarios.md +3 -0
- package/dist/tools/prompts/fs_read/en/tools.md +11 -0
- package/dist/tools/prompts/fs_read/zh/errors.md +6 -0
- package/dist/tools/prompts/fs_read/zh/index.md +17 -0
- package/dist/tools/prompts/fs_read/zh/principles.md +5 -0
- package/dist/tools/prompts/fs_read/zh/scenarios.md +3 -0
- package/dist/tools/prompts/fs_read/zh/tools.md +11 -0
- package/dist/tools/prompts/os/en/index.md +1 -1
- package/dist/tools/prompts/os/en/principles.md +1 -1
- package/dist/tools/prompts/os/en/scenarios.md +21 -0
- package/dist/tools/prompts/os/en/tools.md +6 -0
- package/dist/tools/prompts/os/zh/index.md +1 -1
- package/dist/tools/prompts/os/zh/principles.md +1 -1
- package/dist/tools/prompts/os/zh/scenarios.md +21 -0
- package/dist/tools/prompts/os/zh/tools.md +6 -0
- package/dist/tools/registry.d.ts +6 -0
- package/dist/tools/ripgrep.d.ts +5 -0
- package/dist/tools/ripgrep.js +482 -1
- package/dist/tools/txt.d.ts +34 -0
- package/dist/tools/txt.js +221 -1
- package/package.json +3 -3
- package/webapp/dist/assets/{_basePickBy-CG55qWp2.js → _basePickBy-CePmq6WU.js} +3 -3
- package/webapp/dist/assets/_basePickBy-CePmq6WU.js.map +1 -0
- package/webapp/dist/assets/{_baseUniq-Dd4UGB2O.js → _baseUniq-DAB2FR9P.js} +2 -2
- package/webapp/dist/assets/_baseUniq-DAB2FR9P.js.map +1 -0
- package/webapp/dist/assets/{arc-C2qiF4r3.js → arc-BmAGUHtw.js} +2 -2
- package/webapp/dist/assets/arc-BmAGUHtw.js.map +1 -0
- package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-DQ4Z8fy_.js → architectureDiagram-VXUJARFQ-BBsOS4fu.js} +8 -26
- package/webapp/dist/assets/architectureDiagram-VXUJARFQ-BBsOS4fu.js.map +1 -0
- package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-CPvOuMZA.js → blockDiagram-VD42YOAC-Cuxh8em4.js} +170 -187
- package/webapp/dist/assets/blockDiagram-VD42YOAC-Cuxh8em4.js.map +1 -0
- package/webapp/dist/assets/{c4Diagram-IC4MRINW-DElaFpnJ.js → c4Diagram-YG6GDRKO-L56ctb3A.js} +4 -4
- package/webapp/dist/assets/c4Diagram-YG6GDRKO-L56ctb3A.js.map +1 -0
- package/webapp/dist/assets/{channel-BR7mZa90.js → channel-Ic6QamsR.js} +2 -2
- package/webapp/dist/assets/channel-Ic6QamsR.js.map +1 -0
- package/webapp/dist/assets/{chunk-4BX2VUAB-DTmXCBYX.js → chunk-4BX2VUAB-B8UiHrZa.js} +2 -2
- package/webapp/dist/assets/chunk-4BX2VUAB-B8UiHrZa.js.map +1 -0
- package/webapp/dist/assets/{chunk-55IACEB6-DeBB4aJ4.js → chunk-55IACEB6-9QqsT66L.js} +2 -2
- package/webapp/dist/assets/chunk-55IACEB6-9QqsT66L.js.map +1 -0
- package/webapp/dist/assets/{chunk-WL4C6EOR-V3Fq1ULq.js → chunk-B4BG7PRW-Cs-W2Q5y.js} +121 -171
- package/webapp/dist/assets/chunk-B4BG7PRW-Cs-W2Q5y.js.map +1 -0
- package/webapp/dist/assets/{chunk-NQ4KR5QH-DRcsqoac.js → chunk-DI55MBZ5-uGc9dcaR.js} +7 -9
- package/webapp/dist/assets/chunk-DI55MBZ5-uGc9dcaR.js.map +1 -0
- package/webapp/dist/assets/{chunk-FMBD7UC4-CXpgeev4.js → chunk-FMBD7UC4-DimBaUep.js} +2 -2
- package/webapp/dist/assets/chunk-FMBD7UC4-DimBaUep.js.map +1 -0
- package/webapp/dist/assets/{chunk-KX2RTZJC-DWG_wpHB.js → chunk-QN33PNHL-HUOaMARz.js} +2 -2
- package/webapp/dist/assets/chunk-QN33PNHL-HUOaMARz.js.map +1 -0
- package/webapp/dist/assets/{chunk-QZHKN3VN-B9GPAJ2s.js → chunk-QZHKN3VN-pR62PJlL.js} +2 -2
- package/webapp/dist/assets/chunk-QZHKN3VN-pR62PJlL.js.map +1 -0
- package/webapp/dist/assets/{chunk-JSJVCQXG-DWfckfhO.js → chunk-TZMSLE5B-DtHl61is.js} +6 -14
- package/webapp/dist/assets/chunk-TZMSLE5B-DtHl61is.js.map +1 -0
- package/webapp/dist/assets/{classDiagram-VBA2DB6C-DspG486Z.js → classDiagram-2ON5EDUG-DoZGDGgs.js} +6 -7
- package/webapp/dist/assets/classDiagram-2ON5EDUG-DoZGDGgs.js.map +1 -0
- package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-DspG486Z.js → classDiagram-v2-WZHVMYZB-DoZGDGgs.js} +6 -7
- package/webapp/dist/assets/classDiagram-v2-WZHVMYZB-DoZGDGgs.js.map +1 -0
- package/webapp/dist/assets/{clone-M8ztABN5.js → clone-WTiKKPxQ.js} +2 -2
- package/webapp/dist/assets/clone-WTiKKPxQ.js.map +1 -0
- package/webapp/dist/assets/{cose-bilkent-S5V4N54A-DZihobe3.js → cose-bilkent-S5V4N54A-CQdrsAwh.js} +2 -2
- package/webapp/dist/assets/cose-bilkent-S5V4N54A-CQdrsAwh.js.map +1 -0
- package/webapp/dist/assets/cytoscape.esm-Bm8DJGmZ.js.map +1 -1
- package/webapp/dist/assets/{dagre-KLK3FWXG-DBLWy3vi.js → dagre-6UL2VRFP-CUMu8kzn.js} +7 -7
- package/webapp/dist/assets/dagre-6UL2VRFP-CUMu8kzn.js.map +1 -0
- package/webapp/dist/assets/defaultLocale-B2RvLBDe.js.map +1 -1
- package/webapp/dist/assets/{diagram-E7M64L7V-D7IrPWaY.js → diagram-PSM6KHXK-DB6XicOz.js} +10 -10
- package/webapp/dist/assets/diagram-PSM6KHXK-DB6XicOz.js.map +1 -0
- package/webapp/dist/assets/{diagram-IFDJBPK2-DbF-vN3U.js → diagram-QEK2KX5R-BaeG3mbJ.js} +8 -9
- package/webapp/dist/assets/diagram-QEK2KX5R-BaeG3mbJ.js.map +1 -0
- package/webapp/dist/assets/{diagram-P4PSJMXO-BxBVRVaM.js → diagram-S2PKOQOG-DF7TLMvc.js} +8 -8
- package/webapp/dist/assets/diagram-S2PKOQOG-DF7TLMvc.js.map +1 -0
- package/webapp/dist/assets/{erDiagram-INFDFZHY-ny9JoOhV.js → erDiagram-Q2GNP2WA-BQr1dJmi.js} +75 -96
- package/webapp/dist/assets/erDiagram-Q2GNP2WA-BQr1dJmi.js.map +1 -0
- package/webapp/dist/assets/{flowDiagram-PKNHOUZH-BMgWUlvY.js → flowDiagram-NV44I4VS-BPOTtmjM.js} +81 -98
- package/webapp/dist/assets/flowDiagram-NV44I4VS-BPOTtmjM.js.map +1 -0
- package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-CCYpj3PM.js → ganttDiagram-JELNMOA3-DsUkIvyS.js} +3 -28
- package/webapp/dist/assets/ganttDiagram-JELNMOA3-DsUkIvyS.js.map +1 -0
- package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-BFJGaDtk.js → gitGraphDiagram-V2S2FVAM-CnXo7Mx_.js} +46 -38
- package/webapp/dist/assets/gitGraphDiagram-V2S2FVAM-CnXo7Mx_.js.map +1 -0
- package/webapp/dist/assets/graph-C2Cpmq_d.js +425 -0
- package/webapp/dist/assets/graph-C2Cpmq_d.js.map +1 -0
- package/webapp/dist/assets/{index-EvfDN91D.js → index-Dpmu_hYq.js} +1193 -1037
- package/webapp/dist/assets/{index-EvfDN91D.js.map → index-Dpmu_hYq.js.map} +1 -1
- package/webapp/dist/assets/{index-BQoNJEGT.css → index-yycTJNYb.css} +1 -1
- package/webapp/dist/assets/{infoDiagram-LFFYTUFH-Dnve0aOc.js → infoDiagram-HS3SLOUP-OgTfggdn.js} +7 -7
- package/webapp/dist/assets/infoDiagram-HS3SLOUP-OgTfggdn.js.map +1 -0
- package/webapp/dist/assets/init-ZxktEp_H.js.map +1 -1
- package/webapp/dist/assets/{journeyDiagram-4ABVD52K-D8_2EbDV.js → journeyDiagram-XKPGCS4Q-5a_zmNY7.js} +5 -5
- package/webapp/dist/assets/journeyDiagram-XKPGCS4Q-5a_zmNY7.js.map +1 -0
- package/webapp/dist/assets/{kanban-definition-K7BYSVSG-BdmMXQQk.js → kanban-definition-3W4ZIXB7-DJTdbtlF.js} +3 -5
- package/webapp/dist/assets/kanban-definition-3W4ZIXB7-DJTdbtlF.js.map +1 -0
- package/webapp/dist/assets/{layout-3tA84hoP.js → layout-BrRMWeju.js} +5 -5
- package/webapp/dist/assets/layout-BrRMWeju.js.map +1 -0
- package/webapp/dist/assets/{linear-CpN6Japh.js → linear-Dc9z6NyJ.js} +2 -2
- package/webapp/dist/assets/linear-Dc9z6NyJ.js.map +1 -0
- package/webapp/dist/assets/{mindmap-definition-YRQLILUH-HiYNz7qL.js → mindmap-definition-VGOIOE7T-Dhltq6n6.js} +5 -7
- package/webapp/dist/assets/mindmap-definition-VGOIOE7T-Dhltq6n6.js.map +1 -0
- package/webapp/dist/assets/ordinal-CxptdPJm.js.map +1 -1
- package/webapp/dist/assets/{pieDiagram-SKSYHLDU-DCVp50CX.js → pieDiagram-ADFJNKIX-C-YmzhGj.js} +8 -8
- package/webapp/dist/assets/pieDiagram-ADFJNKIX-C-YmzhGj.js.map +1 -0
- package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-CCX7dwY0.js → quadrantDiagram-AYHSOK5B-BxqMSMrz.js} +3 -3
- package/webapp/dist/assets/quadrantDiagram-AYHSOK5B-BxqMSMrz.js.map +1 -0
- package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-Cba7jjkf.js → requirementDiagram-UZGBJVZJ-DzAytLM4.js} +6 -16
- package/webapp/dist/assets/requirementDiagram-UZGBJVZJ-DzAytLM4.js.map +1 -0
- package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-Bz4iUubD.js → sankeyDiagram-TZEHDZUN-C1YODWlP.js} +2 -2
- package/webapp/dist/assets/sankeyDiagram-TZEHDZUN-C1YODWlP.js.map +1 -0
- package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DsFI9bic.js → sequenceDiagram-WL72ISMW-CuqvCm6T.js} +201 -601
- package/webapp/dist/assets/sequenceDiagram-WL72ISMW-CuqvCm6T.js.map +1 -0
- package/webapp/dist/assets/{stateDiagram-RAJIS63D-DLv9OSg4.js → stateDiagram-FKZM4ZOC-Bdl_IDuo.js} +9 -9
- package/webapp/dist/assets/stateDiagram-FKZM4ZOC-Bdl_IDuo.js.map +1 -0
- package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-DVlwzCvy.js → stateDiagram-v2-4FDKWEC3-CApGpGJP.js} +5 -5
- package/webapp/dist/assets/stateDiagram-v2-4FDKWEC3-CApGpGJP.js.map +1 -0
- package/webapp/dist/assets/{timeline-definition-YZTLITO2-DnKbq6n0.js → timeline-definition-IT6M3QCI-D58v81nI.js} +3 -3
- package/webapp/dist/assets/timeline-definition-IT6M3QCI-D58v81nI.js.map +1 -0
- package/webapp/dist/assets/{treemap-KZPCXAKY-D9fYHZ__.js → treemap-GDKQZRPO-DAFtS5Nq.js} +24 -37
- package/webapp/dist/assets/treemap-GDKQZRPO-DAFtS5Nq.js.map +1 -0
- package/webapp/dist/assets/{xychartDiagram-JWTSCODW-Bt-gKvam.js → xychartDiagram-PRI3JC2R-Dfairu24.js} +4 -4
- package/webapp/dist/assets/xychartDiagram-PRI3JC2R-Dfairu24.js.map +1 -0
- package/webapp/dist/index.html +2 -2
- package/webapp/dist/assets/_basePickBy-CG55qWp2.js.map +0 -1
- package/webapp/dist/assets/_baseUniq-Dd4UGB2O.js.map +0 -1
- package/webapp/dist/assets/arc-C2qiF4r3.js.map +0 -1
- package/webapp/dist/assets/architectureDiagram-2XIMDMQ5-DQ4Z8fy_.js.map +0 -1
- package/webapp/dist/assets/blockDiagram-WCTKOSBZ-CPvOuMZA.js.map +0 -1
- package/webapp/dist/assets/c4Diagram-IC4MRINW-DElaFpnJ.js.map +0 -1
- package/webapp/dist/assets/channel-BR7mZa90.js.map +0 -1
- package/webapp/dist/assets/chunk-4BX2VUAB-DTmXCBYX.js.map +0 -1
- package/webapp/dist/assets/chunk-55IACEB6-DeBB4aJ4.js.map +0 -1
- package/webapp/dist/assets/chunk-FMBD7UC4-CXpgeev4.js.map +0 -1
- package/webapp/dist/assets/chunk-JSJVCQXG-DWfckfhO.js.map +0 -1
- package/webapp/dist/assets/chunk-KX2RTZJC-DWG_wpHB.js.map +0 -1
- package/webapp/dist/assets/chunk-NQ4KR5QH-DRcsqoac.js.map +0 -1
- package/webapp/dist/assets/chunk-QZHKN3VN-B9GPAJ2s.js.map +0 -1
- package/webapp/dist/assets/chunk-WL4C6EOR-V3Fq1ULq.js.map +0 -1
- package/webapp/dist/assets/classDiagram-VBA2DB6C-DspG486Z.js.map +0 -1
- package/webapp/dist/assets/classDiagram-v2-RAHNMMFH-DspG486Z.js.map +0 -1
- package/webapp/dist/assets/clone-M8ztABN5.js.map +0 -1
- package/webapp/dist/assets/cose-bilkent-S5V4N54A-DZihobe3.js.map +0 -1
- package/webapp/dist/assets/dagre-KLK3FWXG-DBLWy3vi.js.map +0 -1
- package/webapp/dist/assets/diagram-E7M64L7V-D7IrPWaY.js.map +0 -1
- package/webapp/dist/assets/diagram-IFDJBPK2-DbF-vN3U.js.map +0 -1
- package/webapp/dist/assets/diagram-P4PSJMXO-BxBVRVaM.js.map +0 -1
- package/webapp/dist/assets/erDiagram-INFDFZHY-ny9JoOhV.js.map +0 -1
- package/webapp/dist/assets/flowDiagram-PKNHOUZH-BMgWUlvY.js.map +0 -1
- package/webapp/dist/assets/ganttDiagram-A5KZAMGK-CCYpj3PM.js.map +0 -1
- package/webapp/dist/assets/gitGraphDiagram-K3NZZRJ6-BFJGaDtk.js.map +0 -1
- package/webapp/dist/assets/graph-Cp0m7fHH.js +0 -782
- package/webapp/dist/assets/graph-Cp0m7fHH.js.map +0 -1
- package/webapp/dist/assets/infoDiagram-LFFYTUFH-Dnve0aOc.js.map +0 -1
- package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-DkSZM5sz.js +0 -966
- package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-DkSZM5sz.js.map +0 -1
- package/webapp/dist/assets/journeyDiagram-4ABVD52K-D8_2EbDV.js.map +0 -1
- package/webapp/dist/assets/kanban-definition-K7BYSVSG-BdmMXQQk.js.map +0 -1
- package/webapp/dist/assets/layout-3tA84hoP.js.map +0 -1
- package/webapp/dist/assets/linear-CpN6Japh.js.map +0 -1
- package/webapp/dist/assets/mindmap-definition-YRQLILUH-HiYNz7qL.js.map +0 -1
- package/webapp/dist/assets/pieDiagram-SKSYHLDU-DCVp50CX.js.map +0 -1
- package/webapp/dist/assets/quadrantDiagram-337W2JSQ-CCX7dwY0.js.map +0 -1
- package/webapp/dist/assets/requirementDiagram-Z7DCOOCP-Cba7jjkf.js.map +0 -1
- package/webapp/dist/assets/sankeyDiagram-WA2Y5GQK-Bz4iUubD.js.map +0 -1
- package/webapp/dist/assets/sequenceDiagram-2WXFIKYE-DsFI9bic.js.map +0 -1
- package/webapp/dist/assets/stateDiagram-RAJIS63D-DLv9OSg4.js.map +0 -1
- package/webapp/dist/assets/stateDiagram-v2-FVOUBMTO-DVlwzCvy.js.map +0 -1
- package/webapp/dist/assets/timeline-definition-YZTLITO2-DnKbq6n0.js.map +0 -1
- package/webapp/dist/assets/treemap-KZPCXAKY-D9fYHZ__.js.map +0 -1
- package/webapp/dist/assets/vennDiagram-LZ73GAT5-CzKI47Ba.js +0 -2487
- package/webapp/dist/assets/vennDiagram-LZ73GAT5-CzKI47Ba.js.map +0 -1
- package/webapp/dist/assets/xychartDiagram-JWTSCODW-Bt-gKvam.js.map +0 -1
package/README.md
CHANGED
|
@@ -103,7 +103,8 @@ Supported proxy variables:
|
|
|
103
103
|
Practical guidance:
|
|
104
104
|
|
|
105
105
|
- Set both `HTTP_PROXY` and `HTTPS_PROXY` when your network uses the same proxy for both schemes. Lowercase forms also work.
|
|
106
|
-
- Use `NO_PROXY` for
|
|
106
|
+
- Use `NO_PROXY` for hosts that should bypass the proxy. Node's built-in support includes exact hosts, suffix matches like `.company.com`, wildcard hosts like `*.company.com`, exact IPs, IP ranges like `192.168.1.1-192.168.1.100`, and `host:port` entries.
|
|
107
|
+
- `NO_PROXY` syntax is not standardized across languages and clients. Do not assume CIDR notation such as `192.168.0.0/16` is supported unless the specific runtime documents it.
|
|
107
108
|
- Values should be standard proxy URLs, for example `http://proxy.company.com:8080`.
|
|
108
109
|
- If your shell already exports proxy variables, Dominds will read them too; clear unrelated proxy vars if you want a clean test environment.
|
|
109
110
|
|
|
@@ -113,13 +114,13 @@ Examples:
|
|
|
113
114
|
# Windows PowerShell
|
|
114
115
|
$env:HTTP_PROXY = "http://proxy.company.com:8080"
|
|
115
116
|
$env:HTTPS_PROXY = "http://proxy.company.com:8080"
|
|
116
|
-
$env:NO_PROXY = "localhost,127.0.0.1,.corp.local"
|
|
117
|
+
$env:NO_PROXY = "localhost,127.0.0.1,.corp.local,192.168.1.1-192.168.1.100"
|
|
117
118
|
dominds
|
|
118
119
|
|
|
119
120
|
# macOS / Linux shell
|
|
120
121
|
export HTTP_PROXY="http://proxy.company.com:8080"
|
|
121
122
|
export HTTPS_PROXY="http://proxy.company.com:8080"
|
|
122
|
-
export NO_PROXY="localhost,127.0.0.1,.corp.local"
|
|
123
|
+
export NO_PROXY="localhost,127.0.0.1,.corp.local,192.168.1.1-192.168.1.100"
|
|
123
124
|
dominds
|
|
124
125
|
|
|
125
126
|
# Disable Dominds env-proxy handling
|
package/README.zh.md
CHANGED
|
@@ -57,7 +57,8 @@ Dominds 在 Windows、macOS、Linux 上都可以使用 Node 内建的环境变
|
|
|
57
57
|
实践建议:
|
|
58
58
|
|
|
59
59
|
- 若同一网络对 HTTP/HTTPS 都走同一代理,建议 `HTTP_PROXY` 和 `HTTPS_PROXY` 一起设置。小写变量名同样有效。
|
|
60
|
-
- `NO_PROXY`
|
|
60
|
+
- `NO_PROXY` 用于排除不经过代理的主机。Node 内置支持包括精确主机名、后缀匹配(如 `.company.com`)、通配主机(如 `*.company.com`)、精确 IP、IP 范围(如 `192.168.1.1-192.168.1.100`)以及带端口的主机名。
|
|
61
|
+
- `NO_PROXY` 的语法在不同语言和客户端里并没有统一标准。除非目标运行时明确支持,不要把 CIDR 写法如 `192.168.0.0/16` 当成默认可用。
|
|
61
62
|
- 代理值应使用标准 URL 形式,例如 `http://proxy.company.com:8080`。
|
|
62
63
|
- 如果你的 shell 已经导出了代理变量,Dominds 也会读取它们;想要干净的测试环境时,请清掉无关的代理变量。
|
|
63
64
|
|
|
@@ -67,13 +68,13 @@ Dominds 在 Windows、macOS、Linux 上都可以使用 Node 内建的环境变
|
|
|
67
68
|
# Windows PowerShell
|
|
68
69
|
$env:HTTP_PROXY = "http://proxy.company.com:8080"
|
|
69
70
|
$env:HTTPS_PROXY = "http://proxy.company.com:8080"
|
|
70
|
-
$env:NO_PROXY = "localhost,127.0.0.1,.corp.local"
|
|
71
|
+
$env:NO_PROXY = "localhost,127.0.0.1,.corp.local,192.168.1.1-192.168.1.100"
|
|
71
72
|
dominds
|
|
72
73
|
|
|
73
74
|
# macOS / Linux shell
|
|
74
75
|
export HTTP_PROXY="http://proxy.company.com:8080"
|
|
75
76
|
export HTTPS_PROXY="http://proxy.company.com:8080"
|
|
76
|
-
export NO_PROXY="localhost,127.0.0.1,.corp.local"
|
|
77
|
+
export NO_PROXY="localhost,127.0.0.1,.corp.local,192.168.1.1-192.168.1.100"
|
|
77
78
|
dominds
|
|
78
79
|
|
|
79
80
|
# 关闭 Dominds 的环境代理支持
|
package/dist/cli/tui.js
CHANGED
|
@@ -53,6 +53,7 @@ exports.main = main;
|
|
|
53
53
|
const fs = __importStar(require("fs"));
|
|
54
54
|
const path = __importStar(require("path"));
|
|
55
55
|
const log_1 = require("../log");
|
|
56
|
+
const process_title_1 = require("../process-title");
|
|
56
57
|
// Helper function to get package version
|
|
57
58
|
function getPackageVersion() {
|
|
58
59
|
try {
|
|
@@ -167,6 +168,7 @@ function parseArgs(argv) {
|
|
|
167
168
|
}
|
|
168
169
|
async function main() {
|
|
169
170
|
try {
|
|
171
|
+
(0, process_title_1.setRtwsProcessTitle)();
|
|
170
172
|
const args = parseArgs(process.argv.slice(2));
|
|
171
173
|
// Handle version flag
|
|
172
174
|
if (args.version) {
|
package/dist/cli/webui.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.main = main;
|
|
17
17
|
const child_process_1 = require("child_process");
|
|
18
18
|
const log_1 = require("../log");
|
|
19
|
+
const process_title_1 = require("../process-title");
|
|
19
20
|
const work_language_1 = require("../runtime/work-language");
|
|
20
21
|
const server_1 = require("../server");
|
|
21
22
|
const auth_1 = require("../server/auth");
|
|
@@ -63,6 +64,7 @@ function openInBrowser(url) {
|
|
|
63
64
|
(0, child_process_1.spawn)('xdg-open', [url], { stdio: 'ignore', detached: true }).unref();
|
|
64
65
|
}
|
|
65
66
|
async function main() {
|
|
67
|
+
(0, process_title_1.setRtwsProcessTitle)();
|
|
66
68
|
const args = process.argv.slice(2);
|
|
67
69
|
let port;
|
|
68
70
|
let host = 'localhost';
|
package/dist/cli.js
CHANGED
|
@@ -82,6 +82,7 @@ const uninstall_1 = require("./cli/uninstall");
|
|
|
82
82
|
const update_1 = require("./cli/update");
|
|
83
83
|
const validate_team_def_1 = require("./cli/validate-team-def");
|
|
84
84
|
const webui_1 = require("./cli/webui");
|
|
85
|
+
const process_title_1 = require("./process-title");
|
|
85
86
|
require("./tools/builtins");
|
|
86
87
|
function configureEnvProxySupport() {
|
|
87
88
|
const domindsUseEnvProxy = process.env.DOMINDS_USE_ENV_PROXY?.trim();
|
|
@@ -315,6 +316,7 @@ async function main() {
|
|
|
315
316
|
}
|
|
316
317
|
async function runSubcommand(subcommand, args) {
|
|
317
318
|
try {
|
|
319
|
+
(0, process_title_1.setRtwsProcessTitle)();
|
|
318
320
|
// Save original argv
|
|
319
321
|
const originalArgv = process.argv;
|
|
320
322
|
// Set argv to simulate direct execution of the subcommand
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setProcessTitle = setProcessTitle;
|
|
4
|
+
exports.setRtwsProcessTitle = setRtwsProcessTitle;
|
|
5
|
+
function setProcessTitle(title) {
|
|
6
|
+
const normalizedTitle = title.trim();
|
|
7
|
+
if (normalizedTitle === '')
|
|
8
|
+
return;
|
|
9
|
+
process.title = normalizedTitle;
|
|
10
|
+
}
|
|
11
|
+
function setRtwsProcessTitle(rtwsRootAbs = process.cwd()) {
|
|
12
|
+
setProcessTitle(`Dominds: ${rtwsRootAbs}`);
|
|
13
|
+
}
|
|
@@ -1099,6 +1099,20 @@ async function handleApiRoute(req, res, pathname, context) {
|
|
|
1099
1099
|
return true;
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
|
+
if (pathname === '/api/dominds/self-update/check' && req.method === 'POST') {
|
|
1103
|
+
try {
|
|
1104
|
+
const status = await (0, dominds_self_update_1.checkLatestDomindsVersionNow)();
|
|
1105
|
+
respondJson(res, 200, { success: true, update: status });
|
|
1106
|
+
return true;
|
|
1107
|
+
}
|
|
1108
|
+
catch (error) {
|
|
1109
|
+
respondJson(res, 409, {
|
|
1110
|
+
success: false,
|
|
1111
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1112
|
+
});
|
|
1113
|
+
return true;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1102
1116
|
// Team configuration endpoint (renamed)
|
|
1103
1117
|
if (pathname === '/api/team/config' && req.method === 'GET') {
|
|
1104
1118
|
return await handleGetTeamConfig(res);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DomindsSelfUpdateStatus } from '@longrun-ai/kernel/types';
|
|
2
2
|
type ServerMode = 'development' | 'production';
|
|
3
|
+
export declare function checkLatestDomindsVersionNow(): Promise<DomindsSelfUpdateStatus>;
|
|
3
4
|
export declare function configureDomindsSelfUpdate(params: {
|
|
4
5
|
host: string;
|
|
5
6
|
port: number;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.checkLatestDomindsVersionNow = checkLatestDomindsVersionNow;
|
|
6
7
|
exports.configureDomindsSelfUpdate = configureDomindsSelfUpdate;
|
|
7
8
|
exports.setDomindsSelfUpdateBroadcaster = setDomindsSelfUpdateBroadcaster;
|
|
8
9
|
exports.getDomindsSelfUpdateStatus = getDomindsSelfUpdateStatus;
|
|
@@ -179,6 +180,22 @@ async function runBackgroundCheck() {
|
|
|
179
180
|
scheduleBackgroundCheck(BACKGROUND_CHECK_INTERVAL_MS);
|
|
180
181
|
}
|
|
181
182
|
}
|
|
183
|
+
async function checkLatestDomindsVersionNow() {
|
|
184
|
+
const cfg = assertRuntimeConfig();
|
|
185
|
+
if (cfg.mode !== 'production') {
|
|
186
|
+
return await getDomindsSelfUpdateStatus();
|
|
187
|
+
}
|
|
188
|
+
if (installPromise !== null || restartPromise !== null) {
|
|
189
|
+
return await getDomindsSelfUpdateStatus();
|
|
190
|
+
}
|
|
191
|
+
if (restartState.kind === 'restart_required' || restartState.kind === 'restarting') {
|
|
192
|
+
return await getDomindsSelfUpdateStatus();
|
|
193
|
+
}
|
|
194
|
+
latestObservation = await queryLatestVersion();
|
|
195
|
+
publishStatusUpdateSoon();
|
|
196
|
+
scheduleBackgroundCheck(BACKGROUND_CHECK_INTERVAL_MS);
|
|
197
|
+
return await getDomindsSelfUpdateStatus();
|
|
198
|
+
}
|
|
182
199
|
function assertRuntimeConfig() {
|
|
183
200
|
if (runtimeConfig === null) {
|
|
184
201
|
throw new Error('Dominds self-update runtime is not configured');
|
package/dist/team.js
CHANGED
|
@@ -586,11 +586,14 @@ exports.Team = Team;
|
|
|
586
586
|
const resolved = [];
|
|
587
587
|
const seen = new Set();
|
|
588
588
|
const isAssignableToolset = (name) => (0, registry_1.getToolsetMeta)(name)?.assignable !== false;
|
|
589
|
+
const isWildcardAssignableToolset = (name) => (0, registry_1.getToolsetMeta)(name)?.wildcardAssignable !== false;
|
|
589
590
|
for (const toolsetName of [...staticToolsets, ...dynamicToolsetNames]) {
|
|
590
591
|
if (toolsetName.startsWith('!'))
|
|
591
592
|
continue;
|
|
592
593
|
const toolsetNames = toolsetName === '*'
|
|
593
|
-
? Object.keys((0, registry_1.listToolsets)()).filter((n) => !excludedToolsets.has(n) &&
|
|
594
|
+
? Object.keys((0, registry_1.listToolsets)()).filter((n) => !excludedToolsets.has(n) &&
|
|
595
|
+
isAssignableToolset(n) &&
|
|
596
|
+
isWildcardAssignableToolset(n))
|
|
594
597
|
: excludedToolsets.has(toolsetName)
|
|
595
598
|
? []
|
|
596
599
|
: [toolsetName];
|
package/dist/tools/builtins.js
CHANGED
|
@@ -54,8 +54,12 @@ function manualSpecFor(toolsetId) {
|
|
|
54
54
|
(0, registry_1.registerTool)(fs_1.moveDirTool);
|
|
55
55
|
(0, registry_1.registerTool)(fs_1.readSymlinkTool);
|
|
56
56
|
(0, registry_1.registerTool)(fs_1.createSymlinkTool);
|
|
57
|
+
(0, registry_1.registerTool)(fs_1.fsListDirTool);
|
|
58
|
+
(0, registry_1.registerTool)(fs_1.fsReadSymlinkTool);
|
|
57
59
|
(0, registry_1.registerTool)(txt_1.readFileTool);
|
|
60
|
+
(0, registry_1.registerTool)(txt_1.fsReadFileTool);
|
|
58
61
|
(0, registry_1.registerTool)(picture_1.readPictureTool);
|
|
62
|
+
(0, registry_1.registerTool)(picture_1.fsReadPictureTool);
|
|
59
63
|
(0, registry_1.registerTool)(picture_1.writePictureTool);
|
|
60
64
|
(0, registry_1.registerTool)(txt_1.createNewFileTool);
|
|
61
65
|
(0, registry_1.registerTool)(txt_1.overwriteEntireFileTool);
|
|
@@ -71,6 +75,11 @@ function manualSpecFor(toolsetId) {
|
|
|
71
75
|
(0, registry_1.registerTool)(ripgrep_1.ripgrepCountTool);
|
|
72
76
|
(0, registry_1.registerTool)(ripgrep_1.ripgrepFixedTool);
|
|
73
77
|
(0, registry_1.registerTool)(ripgrep_1.ripgrepSearchTool);
|
|
78
|
+
(0, registry_1.registerTool)(ripgrep_1.fsRipgrepFilesTool);
|
|
79
|
+
(0, registry_1.registerTool)(ripgrep_1.fsRipgrepSnippetsTool);
|
|
80
|
+
(0, registry_1.registerTool)(ripgrep_1.fsRipgrepCountTool);
|
|
81
|
+
(0, registry_1.registerTool)(ripgrep_1.fsRipgrepFixedTool);
|
|
82
|
+
(0, registry_1.registerTool)(ripgrep_1.fsRipgrepSearchTool);
|
|
74
83
|
// OS tools
|
|
75
84
|
(0, registry_1.registerTool)(os_1.shellCmdTool);
|
|
76
85
|
(0, registry_1.registerTool)(os_1.readonlyShellTool);
|
|
@@ -252,6 +261,27 @@ for (const tool of team_mgmt_1.teamMgmtTools) {
|
|
|
252
261
|
promptFilesI18n: promptFilesFor('ws_read'),
|
|
253
262
|
manualSpec: manualSpecFor('ws_read'),
|
|
254
263
|
});
|
|
264
|
+
(0, registry_1.registerToolset)('fs_read', [
|
|
265
|
+
fs_1.fsListDirTool,
|
|
266
|
+
fs_1.fsReadSymlinkTool,
|
|
267
|
+
txt_1.fsReadFileTool,
|
|
268
|
+
picture_1.fsReadPictureTool,
|
|
269
|
+
ripgrep_1.fsRipgrepFilesTool,
|
|
270
|
+
ripgrep_1.fsRipgrepSnippetsTool,
|
|
271
|
+
ripgrep_1.fsRipgrepCountTool,
|
|
272
|
+
ripgrep_1.fsRipgrepFixedTool,
|
|
273
|
+
ripgrep_1.fsRipgrepSearchTool,
|
|
274
|
+
]);
|
|
275
|
+
(0, registry_1.setToolsetMeta)('fs_read', {
|
|
276
|
+
source: 'dominds',
|
|
277
|
+
wildcardAssignable: false,
|
|
278
|
+
descriptionI18n: {
|
|
279
|
+
en: 'Local filesystem read-only access without rtws path restriction: list directories, read text/images, and search files.',
|
|
280
|
+
zh: '本机文件系统只读访问,不限制路径必须位于 rtws 内:列目录、读文本/图片、检索文件。',
|
|
281
|
+
},
|
|
282
|
+
promptFilesI18n: promptFilesFor('fs_read'),
|
|
283
|
+
manualSpec: manualSpecFor('fs_read'),
|
|
284
|
+
});
|
|
255
285
|
(0, registry_1.registerToolset)('ws_mod', [
|
|
256
286
|
fs_1.listDirTool,
|
|
257
287
|
fs_1.rmDirTool,
|
package/dist/tools/fs.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { FuncTool } from '../tool';
|
|
2
2
|
export declare const listDirTool: FuncTool;
|
|
3
|
+
export declare const fsListDirTool: FuncTool;
|
|
3
4
|
export declare const rmDirTool: FuncTool;
|
|
4
5
|
export declare const rmFileTool: FuncTool;
|
|
5
6
|
export declare const mkDirTool: FuncTool;
|
|
6
7
|
export declare const moveFileTool: FuncTool;
|
|
7
8
|
export declare const moveDirTool: FuncTool;
|
|
8
9
|
export declare const readSymlinkTool: FuncTool;
|
|
10
|
+
export declare const fsReadSymlinkTool: FuncTool;
|
|
9
11
|
export declare const createSymlinkTool: FuncTool;
|
|
10
12
|
export declare const rmSymlinkTool: FuncTool;
|
package/dist/tools/fs.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.rmSymlinkTool = exports.createSymlinkTool = exports.readSymlinkTool = exports.moveDirTool = exports.moveFileTool = exports.mkDirTool = exports.rmFileTool = exports.rmDirTool = exports.listDirTool = void 0;
|
|
6
|
+
exports.rmSymlinkTool = exports.createSymlinkTool = exports.fsReadSymlinkTool = exports.readSymlinkTool = exports.moveDirTool = exports.moveFileTool = exports.mkDirTool = exports.rmFileTool = exports.rmDirTool = exports.fsListDirTool = exports.listDirTool = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Module: tools/fs
|
|
9
9
|
*
|
|
@@ -337,7 +337,7 @@ exports.listDirTool = {
|
|
|
337
337
|
: entry.type === 'symlink'
|
|
338
338
|
? '🔗'
|
|
339
339
|
: '❓';
|
|
340
|
-
const sizeStr = entry.size ? formatSize(entry.size)
|
|
340
|
+
const sizeStr = entry.size === undefined ? '-' : formatSize(entry.size);
|
|
341
341
|
const linesStr = entry.lines ? entry.lines.toString() : '-';
|
|
342
342
|
const targetTypeStr = entry.type === 'symlink' && entry.symlinkResolvedType
|
|
343
343
|
? ` (${entry.symlinkResolvedType})`
|
|
@@ -369,6 +369,220 @@ exports.listDirTool = {
|
|
|
369
369
|
}
|
|
370
370
|
},
|
|
371
371
|
};
|
|
372
|
+
exports.fsListDirTool = {
|
|
373
|
+
type: 'func',
|
|
374
|
+
name: 'fs_list_dir',
|
|
375
|
+
description: 'List local filesystem directory contents without restricting paths to rtws (runtime workspace).',
|
|
376
|
+
descriptionI18n: {
|
|
377
|
+
en: 'List local filesystem directory contents without restricting paths to rtws (runtime workspace).',
|
|
378
|
+
zh: '列出本机文件系统目录内容,不限制路径必须位于 rtws(运行时工作区)内。',
|
|
379
|
+
},
|
|
380
|
+
parameters: {
|
|
381
|
+
type: 'object',
|
|
382
|
+
additionalProperties: false,
|
|
383
|
+
properties: {
|
|
384
|
+
path: {
|
|
385
|
+
type: 'string',
|
|
386
|
+
description: "Directory path to read. Absolute paths are accepted; relative paths resolve from the current process cwd. Defaults to '.'.",
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
argsValidation: 'dominds',
|
|
391
|
+
call: async (_dlg, _caller, args) => {
|
|
392
|
+
const workLanguage = (0, work_language_1.getWorkLanguage)();
|
|
393
|
+
const labels = workLanguage === 'zh'
|
|
394
|
+
? {
|
|
395
|
+
notFound: (p) => `❌ **未找到**\n\n目录 \`${p}\` 不存在。`,
|
|
396
|
+
notDir: (p) => `❌ **错误**\n\n路径 \`${p}\` 不是目录。`,
|
|
397
|
+
readDirFailed: (msg) => `❌ **错误**\n\n读取目录失败:${msg}`,
|
|
398
|
+
dirHeader: '📁 **目录:**',
|
|
399
|
+
symlinkPathNotice: (p, target) => target
|
|
400
|
+
? `🔗 **说明:** \`${p}\` 是符号链接(→ \`${target}\`),已按目录跟随读取。`
|
|
401
|
+
: `🔗 **说明:** \`${p}\` 是符号链接,已按目录跟随读取。`,
|
|
402
|
+
emptyDir: '_此目录为空。_',
|
|
403
|
+
table: {
|
|
404
|
+
name: '名称',
|
|
405
|
+
type: '类型',
|
|
406
|
+
size: '大小',
|
|
407
|
+
lines: '行数',
|
|
408
|
+
target: '目标',
|
|
409
|
+
},
|
|
410
|
+
}
|
|
411
|
+
: {
|
|
412
|
+
notFound: (p) => `❌ **Not Found**\n\nDirectory \`${p}\` does not exist.`,
|
|
413
|
+
notDir: (p) => `❌ **Error**\n\nPath \`${p}\` is not a directory.`,
|
|
414
|
+
readDirFailed: (msg) => `❌ **Error**\n\nFailed to read directory: ${msg}`,
|
|
415
|
+
dirHeader: '📁 **Directory:**',
|
|
416
|
+
symlinkPathNotice: (p, target) => target
|
|
417
|
+
? `🔗 **Note:** \`${p}\` is a symlink (→ \`${target}\`), and was followed as a directory.`
|
|
418
|
+
: `🔗 **Note:** \`${p}\` is a symlink and was followed as a directory.`,
|
|
419
|
+
emptyDir: '_This directory is empty._',
|
|
420
|
+
table: {
|
|
421
|
+
name: 'Name',
|
|
422
|
+
type: 'Type',
|
|
423
|
+
size: 'Size',
|
|
424
|
+
lines: 'Lines',
|
|
425
|
+
target: 'Target',
|
|
426
|
+
},
|
|
427
|
+
};
|
|
428
|
+
let requestedPath = '.';
|
|
429
|
+
const pathValue = args['path'];
|
|
430
|
+
if (typeof pathValue === 'string' && pathValue.trim() !== '') {
|
|
431
|
+
requestedPath = pathValue.trim();
|
|
432
|
+
}
|
|
433
|
+
const dir = path_1.default.resolve(process.cwd(), requestedPath);
|
|
434
|
+
const displayPath = path_1.default.isAbsolute(requestedPath) ? dir : requestedPath;
|
|
435
|
+
try {
|
|
436
|
+
let inputPathIsSymlink = false;
|
|
437
|
+
let inputPathSymlinkTarget;
|
|
438
|
+
try {
|
|
439
|
+
const statsInfo = await statWithSymlinkInfo(dir);
|
|
440
|
+
inputPathIsSymlink = statsInfo.isSymlink;
|
|
441
|
+
inputPathSymlinkTarget = statsInfo.symlinkTarget;
|
|
442
|
+
if (!statsInfo.followStat.isDirectory()) {
|
|
443
|
+
return fail(labels.notDir(displayPath));
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
catch (error) {
|
|
447
|
+
if (typeof error === 'object' &&
|
|
448
|
+
error !== null &&
|
|
449
|
+
'code' in error &&
|
|
450
|
+
error.code === 'ENOENT') {
|
|
451
|
+
return fail(labels.notFound(displayPath));
|
|
452
|
+
}
|
|
453
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
454
|
+
return fail(labels.readDirFailed(msg));
|
|
455
|
+
}
|
|
456
|
+
const entries = await promises_1.default.readdir(dir, { withFileTypes: true });
|
|
457
|
+
const data = [];
|
|
458
|
+
for (const entry of entries) {
|
|
459
|
+
const entryPath = path_1.default.join(dir, entry.name);
|
|
460
|
+
const dirEntry = {
|
|
461
|
+
name: entry.name,
|
|
462
|
+
type: 'other',
|
|
463
|
+
};
|
|
464
|
+
try {
|
|
465
|
+
const stats = await promises_1.default.lstat(entryPath);
|
|
466
|
+
if (entry.isDirectory()) {
|
|
467
|
+
dirEntry.type = 'dir';
|
|
468
|
+
dirEntry.size = stats.size;
|
|
469
|
+
}
|
|
470
|
+
else if (entry.isFile()) {
|
|
471
|
+
dirEntry.type = 'file';
|
|
472
|
+
dirEntry.size = stats.size;
|
|
473
|
+
if (isTextFile(entry.name)) {
|
|
474
|
+
dirEntry.lines = await countLines(entryPath);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
else if (entry.isSymbolicLink()) {
|
|
478
|
+
dirEntry.type = 'symlink';
|
|
479
|
+
dirEntry.size = stats.size;
|
|
480
|
+
try {
|
|
481
|
+
const target = await promises_1.default.readlink(entryPath);
|
|
482
|
+
dirEntry.target = target;
|
|
483
|
+
try {
|
|
484
|
+
const targetStats = await promises_1.default.stat(entryPath);
|
|
485
|
+
if (targetStats.isDirectory()) {
|
|
486
|
+
dirEntry.symlinkResolvedType = 'dir';
|
|
487
|
+
}
|
|
488
|
+
else if (targetStats.isFile()) {
|
|
489
|
+
dirEntry.symlinkResolvedType = 'file';
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
dirEntry.symlinkResolvedType = 'other';
|
|
493
|
+
}
|
|
494
|
+
if (targetStats.isFile() && (isTextFile(entry.name) || isTextFile(target))) {
|
|
495
|
+
dirEntry.lines = await countLines(entryPath);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
catch (err) {
|
|
499
|
+
log_1.log.warn(`Failed to stat symlink target ${entryPath}:`, err);
|
|
500
|
+
dirEntry.symlinkResolvedType = 'broken';
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
catch (err) {
|
|
504
|
+
log_1.log.warn(`Failed to read symlink ${entryPath}:`, err);
|
|
505
|
+
dirEntry.target = '<unreadable>';
|
|
506
|
+
dirEntry.symlinkResolvedType = 'other';
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
dirEntry.type = 'other';
|
|
511
|
+
dirEntry.size = stats.size;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
catch (_error) {
|
|
515
|
+
if (entry.isDirectory()) {
|
|
516
|
+
dirEntry.type = 'dir';
|
|
517
|
+
}
|
|
518
|
+
else if (entry.isFile()) {
|
|
519
|
+
dirEntry.type = 'file';
|
|
520
|
+
}
|
|
521
|
+
else if (entry.isSymbolicLink()) {
|
|
522
|
+
dirEntry.type = 'symlink';
|
|
523
|
+
dirEntry.target = '<error>';
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
data.push(dirEntry);
|
|
527
|
+
}
|
|
528
|
+
let markdown = `${labels.dirHeader} \`${displayPath}\`\n\n`;
|
|
529
|
+
if (inputPathIsSymlink) {
|
|
530
|
+
markdown += `${labels.symlinkPathNotice(displayPath, inputPathSymlinkTarget)}\n\n`;
|
|
531
|
+
}
|
|
532
|
+
if (data.length === 0) {
|
|
533
|
+
markdown += labels.emptyDir;
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
const shownEntries = data.slice(0, LIST_DIR_MAX_RENDERED_ENTRIES);
|
|
537
|
+
const omittedEntries = Math.max(0, data.length - shownEntries.length);
|
|
538
|
+
if (omittedEntries > 0) {
|
|
539
|
+
markdown +=
|
|
540
|
+
workLanguage === 'zh'
|
|
541
|
+
? `⚠️ **说明:** 目录项过多;为避免输出过长,仅展示前 ${shownEntries.length} 项,省略 ${omittedEntries} 项。\n\n`
|
|
542
|
+
: `⚠️ **Note:** Directory contains many entries; to keep the output bounded, showing the first ${shownEntries.length} entries and omitting ${omittedEntries}.\n\n`;
|
|
543
|
+
}
|
|
544
|
+
markdown += `| ${labels.table.name} | ${labels.table.type} | ${labels.table.size} | ${labels.table.lines} | ${labels.table.target} |\n`;
|
|
545
|
+
markdown += '|------|------|------|-------|--------|\n';
|
|
546
|
+
for (const entry of shownEntries) {
|
|
547
|
+
const typeIcon = entry.type === 'dir'
|
|
548
|
+
? '📁'
|
|
549
|
+
: entry.type === 'file'
|
|
550
|
+
? '📄'
|
|
551
|
+
: entry.type === 'symlink'
|
|
552
|
+
? '🔗'
|
|
553
|
+
: '❓';
|
|
554
|
+
const sizeStr = entry.size === undefined ? '-' : formatSize(entry.size);
|
|
555
|
+
const linesStr = entry.lines ? entry.lines.toString() : '-';
|
|
556
|
+
const targetTypeStr = entry.type === 'symlink' && entry.symlinkResolvedType
|
|
557
|
+
? ` (${entry.symlinkResolvedType})`
|
|
558
|
+
: '';
|
|
559
|
+
const renderedName = (0, output_limit_1.truncateInlineText)(entry.name, LIST_DIR_NAME_CHAR_LIMIT);
|
|
560
|
+
const targetStr = entry.target
|
|
561
|
+
? (0, output_limit_1.truncateInlineText)(`→ ${entry.target}${targetTypeStr}`, LIST_DIR_TARGET_CHAR_LIMIT)
|
|
562
|
+
: '-';
|
|
563
|
+
markdown += `| ${typeIcon} \`${renderedName}\` | ${entry.type} | ${sizeStr} | ${linesStr} | ${targetStr} |\n`;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return ok(markdown);
|
|
567
|
+
}
|
|
568
|
+
catch (error) {
|
|
569
|
+
if (typeof error === 'object' &&
|
|
570
|
+
error !== null &&
|
|
571
|
+
'code' in error &&
|
|
572
|
+
error.code === 'ENOENT') {
|
|
573
|
+
return fail(labels.notFound(displayPath));
|
|
574
|
+
}
|
|
575
|
+
if (typeof error === 'object' &&
|
|
576
|
+
error !== null &&
|
|
577
|
+
'code' in error &&
|
|
578
|
+
error.code === 'ENOTDIR') {
|
|
579
|
+
return fail(labels.notDir(displayPath));
|
|
580
|
+
}
|
|
581
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
582
|
+
return fail(labels.readDirFailed(msg));
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
};
|
|
372
586
|
exports.rmDirTool = {
|
|
373
587
|
type: 'func',
|
|
374
588
|
name: 'rm_dir',
|
|
@@ -1045,6 +1259,71 @@ exports.readSymlinkTool = {
|
|
|
1045
1259
|
}
|
|
1046
1260
|
},
|
|
1047
1261
|
};
|
|
1262
|
+
exports.fsReadSymlinkTool = {
|
|
1263
|
+
type: 'func',
|
|
1264
|
+
name: 'fs_read_symlink',
|
|
1265
|
+
description: 'Read a local filesystem symlink target without following it, without restricting paths to rtws.',
|
|
1266
|
+
descriptionI18n: {
|
|
1267
|
+
en: 'Read a local filesystem symlink target without following it, without restricting paths to rtws.',
|
|
1268
|
+
zh: '读取本机文件系统符号链接目标(不跟随链接),不限制路径必须位于 rtws 内。',
|
|
1269
|
+
},
|
|
1270
|
+
parameters: {
|
|
1271
|
+
type: 'object',
|
|
1272
|
+
additionalProperties: false,
|
|
1273
|
+
required: ['path'],
|
|
1274
|
+
properties: {
|
|
1275
|
+
path: {
|
|
1276
|
+
type: 'string',
|
|
1277
|
+
description: 'Symlink path. Absolute paths are accepted; relative paths resolve from the current process cwd.',
|
|
1278
|
+
},
|
|
1279
|
+
},
|
|
1280
|
+
},
|
|
1281
|
+
argsValidation: 'dominds',
|
|
1282
|
+
call: async (_dlg, _caller, args) => {
|
|
1283
|
+
const pathValue = args['path'];
|
|
1284
|
+
const requestedPath = typeof pathValue === 'string' ? pathValue.trim() : '';
|
|
1285
|
+
if (!requestedPath) {
|
|
1286
|
+
return failYaml([
|
|
1287
|
+
`status: error`,
|
|
1288
|
+
`mode: fs_read_symlink`,
|
|
1289
|
+
`error: PATH_REQUIRED`,
|
|
1290
|
+
`summary: ${yamlQuote('Fs-read-symlink failed: path required.')}`,
|
|
1291
|
+
].join('\n'));
|
|
1292
|
+
}
|
|
1293
|
+
const absPath = path_1.default.resolve(process.cwd(), requestedPath);
|
|
1294
|
+
const displayPath = path_1.default.isAbsolute(requestedPath) ? absPath : requestedPath;
|
|
1295
|
+
try {
|
|
1296
|
+
const pathStat = await promises_1.default.lstat(absPath);
|
|
1297
|
+
if (!pathStat.isSymbolicLink()) {
|
|
1298
|
+
return failYaml([
|
|
1299
|
+
`status: error`,
|
|
1300
|
+
`mode: fs_read_symlink`,
|
|
1301
|
+
`path: ${yamlQuote(displayPath)}`,
|
|
1302
|
+
`error: NOT_SYMLINK`,
|
|
1303
|
+
`summary: ${yamlQuote('Fs-read-symlink failed: path is not a symlink.')}`,
|
|
1304
|
+
].join('\n'));
|
|
1305
|
+
}
|
|
1306
|
+
const target = await promises_1.default.readlink(absPath);
|
|
1307
|
+
return okYaml([
|
|
1308
|
+
`status: ok`,
|
|
1309
|
+
`mode: fs_read_symlink`,
|
|
1310
|
+
`path: ${yamlQuote(displayPath)}`,
|
|
1311
|
+
`target: ${yamlQuote(target)}`,
|
|
1312
|
+
`summary: ${yamlQuote(`Fs-read-symlink: ${displayPath} -> ${target}.`)}`,
|
|
1313
|
+
].join('\n'));
|
|
1314
|
+
}
|
|
1315
|
+
catch (error) {
|
|
1316
|
+
const yaml = [
|
|
1317
|
+
`status: error`,
|
|
1318
|
+
`mode: fs_read_symlink`,
|
|
1319
|
+
`path: ${yamlQuote(displayPath)}`,
|
|
1320
|
+
`error: FAILED`,
|
|
1321
|
+
`summary: ${yamlQuote(error instanceof Error ? error.message : String(error))}`,
|
|
1322
|
+
].join('\n');
|
|
1323
|
+
return failYaml(yaml);
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
};
|
|
1048
1327
|
exports.createSymlinkTool = {
|
|
1049
1328
|
type: 'func',
|
|
1050
1329
|
name: 'create_symlink',
|
package/dist/tools/os.d.ts
CHANGED
|
@@ -6,8 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { FuncTool, ReminderOwner } from '../tool';
|
|
8
8
|
export declare function resetTrackedDaemonsForTests(): void;
|
|
9
|
+
type ShellSpawnSpec = Readonly<{
|
|
10
|
+
command: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
shellLabel: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function resolveShellCmdSpawnSpecForTests(command: string, shell: string | undefined, platform: NodeJS.Platform): ShellSpawnSpec;
|
|
15
|
+
export declare function resolveReadonlyShellSpawnSpecForTests(command: string, platform: NodeJS.Platform): Readonly<{
|
|
16
|
+
command: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
}>;
|
|
9
19
|
export declare const shellCmdReminderOwner: ReminderOwner;
|
|
10
20
|
export declare const shellCmdTool: FuncTool;
|
|
11
21
|
export declare const readonlyShellTool: FuncTool;
|
|
12
22
|
export declare const stopDaemonTool: FuncTool;
|
|
13
23
|
export declare const getDaemonOutputTool: FuncTool;
|
|
24
|
+
export {};
|