bugx-cli 0.1.2 → 0.1.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 +26 -29
- package/core/agent/agent_orchestrator.py +3 -0
- package/core/agent/agent_workspace.py +14 -2
- package/core/assets/twitter_promo_art.jpg +0 -0
- package/core/assets/twitter_promo_card.svg +166 -0
- package/core/assets/twitter_promo_clean.jpg +0 -0
- package/core/assets/twitter_terminal_real.png +0 -0
- package/core/bugx.md +2 -2
- package/core/bugx_paths.py +2 -2
- package/core/cli-help.txt +1 -1
- package/core/contracts/bugx-opencode.md +1 -1
- package/core/contracts/bugx-runtime-contract.md +1 -1
- package/core/contracts/bugx-worker.md +1 -1
- package/core/engine-integrity.json +82 -42
- package/core/host_acp/kimi.py +175 -0
- package/core/host_acp/minimax.py +28 -0
- package/core/host_runtime/host_registry.py +23 -3
- package/core/hosts/dsh.py +1 -1
- package/core/hosts/kimi.py +293 -0
- package/core/hosts/minimax.py +248 -0
- package/core/hosts/zcode.py +5 -0
- package/core/infra/build_info.py +30 -5
- package/core/launch_phases/startup_version_gate.py +2 -2
- package/core/launch_phases/supervisor_bridge.py +14 -23
- package/core/metadata.txt +2 -2
- package/core/runtime/scenario_eval.py +1 -1
- package/core/runtime/setup_ui_env.py +4 -7
- package/core/supervisor/cli.py +2 -2
- package/core/webui/mcp_inspector.py +6 -0
- package/core/webui/static/index.html +51 -3
- package/core/webui/static/manifest.webmanifest +1 -1
- package/core/webui/static/project-settings.js +18 -3
- package/core/webui/static/robots.txt +36 -0
- package/core/webui/static/sitemap.xml +15 -0
- package/docs/07_distribution/01_README_NPM.md +26 -29
- package/ecosystem/integrations/cline/skills/bugx/SKILL.md +1 -1
- package/ecosystem/integrations/dsh/agents/bugx.md +1 -1
- package/ecosystem/integrations/dsh/dsh-patch.yml +2 -2
- package/ecosystem/integrations/dsh/mcp/package.json +1 -1
- package/ecosystem/integrations/dsh/skills/bugx/SKILL.md +1 -1
- package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/integrations/dsh/ui/package.json +1 -1
- package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +1 -1
- package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
- package/ecosystem/integrations/pi/skills/bugx/SKILL.md +1 -1
- package/ecosystem/integrations/qoder/connector-meta.json +9 -9
- package/ecosystem/integrations/workbuddy/connector-meta.json +9 -9
- package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +2 -2
- package/ecosystem/plugins/bugx/.claude-plugin/marketplace.json +2 -2
- package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +2 -2
- package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +4 -4
- package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +2 -2
- package/ecosystem/plugins/bugx/agents/bugx-worker.md +1 -1
- package/ecosystem/plugins/bugx/agents/bugx.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +3 -3
- package/ecosystem/plugins/bugx/skills/bugx-claude/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +1 -1
- package/interfaces/bin/bugx.js +2 -0
- package/interfaces/cli/bugx_cli/__init__.py +2 -2
- package/interfaces/cli/bugx_cli/cli.py +15 -0
- package/interfaces/cli/bugx_cli/commands/agent.py +192 -67
- package/interfaces/cli/bugx_cli/commands/doctor.py +18 -0
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +54 -47
- package/interfaces/cli/bugx_cli/commands/plugin.py +6 -6
- package/interfaces/cli/bugx_cli/commands/plugin_claude.py +27 -13
- package/interfaces/cli/bugx_cli/commands/plugin_kimi.py +348 -0
- package/interfaces/cli/bugx_cli/commands/plugin_minimax.py +322 -0
- package/interfaces/cli/bugx_cli/commands/plugin_qoder.py +3 -4
- package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +4 -5
- package/interfaces/cli/bugx_cli/commands/system.py +64 -4
- package/interfaces/cli/bugx_cli/common.py +96 -7
- package/interfaces/cli/bugx_cli/host_adapters.py +150 -4
- package/interfaces/cli/bugx_cli/hosts/registry.py +4 -2
- package/interfaces/cli/bugx_cli/hosts/template_engine.py +10 -9
- package/interfaces/cli/bugx_cli/infra/engine_installer.py +4 -4
- package/interfaces/cli/bugx_cli/infra/host_sync.py +1 -1
- package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +2 -2
- package/package.json +37 -13
- package/pyproject.toml +36 -12
- package/scripts/sync-version.mjs +1 -1
- package/skills/README.md +25 -0
- package/skills/platform/bugx-user/SKILL.md +92 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bugx_version": "0.1.
|
|
3
|
-
"bundle_sha256": "
|
|
4
|
-
"file_count":
|
|
2
|
+
"bugx_version": "0.1.3",
|
|
3
|
+
"bundle_sha256": "17b577bc54c0129c3b90878ff37128337901f4300e5f143859052f034708c5ea",
|
|
4
|
+
"file_count": 721,
|
|
5
5
|
"files": {
|
|
6
6
|
"CATALOG.json": {
|
|
7
7
|
"sha256": "8d382c292a40f774cab0878a05ad3458be44674385fb9972293a7cd015d69547",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"size": 29907
|
|
61
61
|
},
|
|
62
62
|
"agent/agent_orchestrator.py": {
|
|
63
|
-
"sha256": "
|
|
64
|
-
"size":
|
|
63
|
+
"sha256": "10489001329c8ef5c5eb1189ff64b61d252b5bcfcece48750a29b7a8c5758e0b",
|
|
64
|
+
"size": 62898
|
|
65
65
|
},
|
|
66
66
|
"agent/agent_targets.py": {
|
|
67
67
|
"sha256": "457593cda0e2e567e6e464826a4d8c371cef10c3f8f5f93a3238c8025e7b76f9",
|
|
68
68
|
"size": 37374
|
|
69
69
|
},
|
|
70
70
|
"agent/agent_workspace.py": {
|
|
71
|
-
"sha256": "
|
|
72
|
-
"size":
|
|
71
|
+
"sha256": "e6fa7cbeb5b7a995c575c41d36912e81c26b46d33977f40f47468505e5863135",
|
|
72
|
+
"size": 34324
|
|
73
73
|
},
|
|
74
74
|
"agent/feature_baseline.py": {
|
|
75
75
|
"sha256": "dd6ca081ab268dbf3922ba914c0acda5c1dbabf59d735e81364af837b5fb7636",
|
|
@@ -139,6 +139,22 @@
|
|
|
139
139
|
"sha256": "411df87146edf1d8466495d5aa4c33efae1b71601f7869b803976aab896532aa",
|
|
140
140
|
"size": 3079
|
|
141
141
|
},
|
|
142
|
+
"assets/twitter_promo_art.jpg": {
|
|
143
|
+
"sha256": "dcd50100d9008e6f106bffa7e7b11c0dec66eb6e65eab2ae89aadb539affbb61",
|
|
144
|
+
"size": 488138
|
|
145
|
+
},
|
|
146
|
+
"assets/twitter_promo_card.svg": {
|
|
147
|
+
"sha256": "c03050d7a69518be49f6f8f2fb5547c5481d4313b6e42d6581e3aee2ebaa852a",
|
|
148
|
+
"size": 8151
|
|
149
|
+
},
|
|
150
|
+
"assets/twitter_promo_clean.jpg": {
|
|
151
|
+
"sha256": "e88294cec946ed2edacb951becd2bcb6bc8a1de41420feeca02069c50c98b9ac",
|
|
152
|
+
"size": 356070
|
|
153
|
+
},
|
|
154
|
+
"assets/twitter_terminal_real.png": {
|
|
155
|
+
"sha256": "76a0be89ad7a77659e68535e23c55740df0f0202090fdd7aea01e68545aad0a2",
|
|
156
|
+
"size": 598343
|
|
157
|
+
},
|
|
142
158
|
"assets/webui-chatgpt.jpg": {
|
|
143
159
|
"sha256": "dfcfada99064427e7aeffbc30f793bd9d74dd0760c916c2f0348d34431d699e9",
|
|
144
160
|
"size": 100578
|
|
@@ -440,16 +456,16 @@
|
|
|
440
456
|
"size": 3972
|
|
441
457
|
},
|
|
442
458
|
"bugx.md": {
|
|
443
|
-
"sha256": "
|
|
444
|
-
"size":
|
|
459
|
+
"sha256": "115484d6023d3cde2df7567bb7af54f9c2152a4d20d698d59b2a11c9ffe54f3f",
|
|
460
|
+
"size": 111662
|
|
445
461
|
},
|
|
446
462
|
"bugx_paths.py": {
|
|
447
|
-
"sha256": "
|
|
463
|
+
"sha256": "e1df499ccd2dc11bd89fffd6012807f851ed38a6f23178a4ba1f7c1f4225a8ce",
|
|
448
464
|
"size": 84762
|
|
449
465
|
},
|
|
450
466
|
"cli-help.txt": {
|
|
451
|
-
"sha256": "
|
|
452
|
-
"size":
|
|
467
|
+
"sha256": "00b1ea20d99e0d5791a0862d7087c2c45a356a6a1cc8a1d83c34e745c7557a01",
|
|
468
|
+
"size": 5376
|
|
453
469
|
},
|
|
454
470
|
"cloud_sync/INTERFACE.md": {
|
|
455
471
|
"sha256": "3bf7d24276ea13cb8808ea73529ad1bdb2f1a731cf10e56333b12b39ed9d6845",
|
|
@@ -532,19 +548,19 @@
|
|
|
532
548
|
"size": 43799
|
|
533
549
|
},
|
|
534
550
|
"contracts/bugx-opencode.md": {
|
|
535
|
-
"sha256": "
|
|
536
|
-
"size":
|
|
551
|
+
"sha256": "e733637c428cc2969c1c1e94b82fcd503b955aef40c739baca2ed6827463b246",
|
|
552
|
+
"size": 20790
|
|
537
553
|
},
|
|
538
554
|
"contracts/bugx-quick.md": {
|
|
539
555
|
"sha256": "56245a609a611fb5e9741352364f11daaa5e6dccb01f5fd54dd039d87d6efecb",
|
|
540
556
|
"size": 2857
|
|
541
557
|
},
|
|
542
558
|
"contracts/bugx-runtime-contract.md": {
|
|
543
|
-
"sha256": "
|
|
559
|
+
"sha256": "8014acd5c79dd28183f0af64b389f584d20b88d46681c85f5bfd70039316a795",
|
|
544
560
|
"size": 30857
|
|
545
561
|
},
|
|
546
562
|
"contracts/bugx-worker.md": {
|
|
547
|
-
"sha256": "
|
|
563
|
+
"sha256": "5386df7990f1ff440c9cbf6f628ef3d096d5400c00ffdc45be95c688a83685c2",
|
|
548
564
|
"size": 19474
|
|
549
565
|
},
|
|
550
566
|
"contracts/engine_gap_contracts.py": {
|
|
@@ -739,6 +755,14 @@
|
|
|
739
755
|
"sha256": "631f8434305ff3474ff339265fdb07e67deb63fc98d4b22dac7a9b445375af6a",
|
|
740
756
|
"size": 4399
|
|
741
757
|
},
|
|
758
|
+
"host_acp/kimi.py": {
|
|
759
|
+
"sha256": "359618395940d2e1312cc41a605611782b981054bab152b1b9b3e4d5a50dfa4e",
|
|
760
|
+
"size": 6594
|
|
761
|
+
},
|
|
762
|
+
"host_acp/minimax.py": {
|
|
763
|
+
"sha256": "a8a1e58ea4bf084992e9a881ac8da928e06fbe17b63c4de1be3689ef2016f3df",
|
|
764
|
+
"size": 814
|
|
765
|
+
},
|
|
742
766
|
"host_acp/opencode.py": {
|
|
743
767
|
"sha256": "09267a40ec484523fe58993f84daa1248d5224876eebf4a84879ed1908d9a04a",
|
|
744
768
|
"size": 8905
|
|
@@ -804,8 +828,8 @@
|
|
|
804
828
|
"size": 33896
|
|
805
829
|
},
|
|
806
830
|
"host_runtime/host_registry.py": {
|
|
807
|
-
"sha256": "
|
|
808
|
-
"size":
|
|
831
|
+
"sha256": "34280771cb873525918aa7abcfd094d778a438be776a285bbf896fb8ebe08c39",
|
|
832
|
+
"size": 28432
|
|
809
833
|
},
|
|
810
834
|
"host_runtime/host_usage.py": {
|
|
811
835
|
"sha256": "187671167c13b2eb393e218a0501b26d0734059b0245e469b43a5c178cd66df6",
|
|
@@ -880,8 +904,16 @@
|
|
|
880
904
|
"size": 47030
|
|
881
905
|
},
|
|
882
906
|
"hosts/dsh.py": {
|
|
883
|
-
"sha256": "
|
|
884
|
-
"size":
|
|
907
|
+
"sha256": "7d694c2b00b179b7db3b92553500d10ec314dc81111d7441cb72863c15180f7d",
|
|
908
|
+
"size": 25711
|
|
909
|
+
},
|
|
910
|
+
"hosts/kimi.py": {
|
|
911
|
+
"sha256": "9746d94391a8f68949f8d92ea39eea79b90cdd4b771325cf7c36ddfbbf72c791",
|
|
912
|
+
"size": 10123
|
|
913
|
+
},
|
|
914
|
+
"hosts/minimax.py": {
|
|
915
|
+
"sha256": "f42bc823671141c4d4eccaedd22e1b6887ed718be920d2b03f3246266945d225",
|
|
916
|
+
"size": 8296
|
|
885
917
|
},
|
|
886
918
|
"hosts/opencode.py": {
|
|
887
919
|
"sha256": "cd5c2962efa3c7107af4a431fd3582e6a6ff3a70ce08ef1fef8a35739ae31964",
|
|
@@ -892,8 +924,8 @@
|
|
|
892
924
|
"size": 12226
|
|
893
925
|
},
|
|
894
926
|
"hosts/zcode.py": {
|
|
895
|
-
"sha256": "
|
|
896
|
-
"size":
|
|
927
|
+
"sha256": "71a7547dcec3402cada02e487fcd16a0619a726866b5928d94dd21a8a27b3bd9",
|
|
928
|
+
"size": 7931
|
|
897
929
|
},
|
|
898
930
|
"i18n.py": {
|
|
899
931
|
"sha256": "41992ab29e1b0cfc68c1795161c549085cf70339875b8af44cb53749cb157810",
|
|
@@ -908,8 +940,8 @@
|
|
|
908
940
|
"size": 383
|
|
909
941
|
},
|
|
910
942
|
"infra/build_info.py": {
|
|
911
|
-
"sha256": "
|
|
912
|
-
"size":
|
|
943
|
+
"sha256": "99eb53c9ee3d41e98f1e1bea251367c1cb0f15304a48aadd2e2135fbda0f55d7",
|
|
944
|
+
"size": 4373
|
|
913
945
|
},
|
|
914
946
|
"infra/client_metadata.py": {
|
|
915
947
|
"sha256": "fa434f931216a025eeab1e2a3f39ab9c397a06dca3e20369c80514c97b5139ba",
|
|
@@ -1052,12 +1084,12 @@
|
|
|
1052
1084
|
"size": 44069
|
|
1053
1085
|
},
|
|
1054
1086
|
"launch_phases/startup_version_gate.py": {
|
|
1055
|
-
"sha256": "
|
|
1087
|
+
"sha256": "108069aeda193296becaac93cc710a11028c2c17017215c25ec7e8ec80081ad2",
|
|
1056
1088
|
"size": 38821
|
|
1057
1089
|
},
|
|
1058
1090
|
"launch_phases/supervisor_bridge.py": {
|
|
1059
|
-
"sha256": "
|
|
1060
|
-
"size":
|
|
1091
|
+
"sha256": "f16bc18a10e3ef7f4e33c1c4118307af8e70d765f27363b2d735e7a348f4d045",
|
|
1092
|
+
"size": 55285
|
|
1061
1093
|
},
|
|
1062
1094
|
"launch_phases/supervisor_coverage.py": {
|
|
1063
1095
|
"sha256": "05e87f5cca461ef1a7126705b7be21eb499df984ba08494719dacc439039a57d",
|
|
@@ -1288,8 +1320,8 @@
|
|
|
1288
1320
|
"size": 33290
|
|
1289
1321
|
},
|
|
1290
1322
|
"metadata.txt": {
|
|
1291
|
-
"sha256": "
|
|
1292
|
-
"size":
|
|
1323
|
+
"sha256": "1d2c0741622fcd450be08c03ce3f2b088c6e48653b2cd3f180c7392e6d092fe4",
|
|
1324
|
+
"size": 78
|
|
1293
1325
|
},
|
|
1294
1326
|
"planning/README.md": {
|
|
1295
1327
|
"sha256": "90c701abc389ab272b680eee8c04b1730e682a76a837a1acb337906b199fb529",
|
|
@@ -2240,7 +2272,7 @@
|
|
|
2240
2272
|
"size": 3912
|
|
2241
2273
|
},
|
|
2242
2274
|
"runtime/scenario_eval.py": {
|
|
2243
|
-
"sha256": "
|
|
2275
|
+
"sha256": "d0cff60957541b6907a0737e9a10171b4521a700dcd324694d120203c8956884",
|
|
2244
2276
|
"size": 36585
|
|
2245
2277
|
},
|
|
2246
2278
|
"runtime/seed_drill.py": {
|
|
@@ -2256,8 +2288,8 @@
|
|
|
2256
2288
|
"size": 8344
|
|
2257
2289
|
},
|
|
2258
2290
|
"runtime/setup_ui_env.py": {
|
|
2259
|
-
"sha256": "
|
|
2260
|
-
"size":
|
|
2291
|
+
"sha256": "f34933b6c3569baa096125f2c9bed80510d7b6591c951c93b3b2ed82be49dfc2",
|
|
2292
|
+
"size": 7912
|
|
2261
2293
|
},
|
|
2262
2294
|
"runtime/startup_environment.py": {
|
|
2263
2295
|
"sha256": "c3c4fc6abe1ed2e894c5bbadd032e8410a314b65ed95c32497ac03b37d40e607",
|
|
@@ -2432,8 +2464,8 @@
|
|
|
2432
2464
|
"size": 26873
|
|
2433
2465
|
},
|
|
2434
2466
|
"supervisor/cli.py": {
|
|
2435
|
-
"sha256": "
|
|
2436
|
-
"size":
|
|
2467
|
+
"sha256": "e3b34ff1682e1d06164333ece8b987acff0f0a04b121bde3016c30d32b0dc7de",
|
|
2468
|
+
"size": 35113
|
|
2437
2469
|
},
|
|
2438
2470
|
"supervisor/context_sync.py": {
|
|
2439
2471
|
"sha256": "3e42207d4bb749b3f63f34a8dc7c500da5bb5129fbe70a6dd2c8ef13379ca3fd",
|
|
@@ -2656,8 +2688,8 @@
|
|
|
2656
2688
|
"size": 19264
|
|
2657
2689
|
},
|
|
2658
2690
|
"webui/mcp_inspector.py": {
|
|
2659
|
-
"sha256": "
|
|
2660
|
-
"size":
|
|
2691
|
+
"sha256": "227441cbf1716bbf4c8348d23fef1fe7a1d74c8af6001f3862e7c79e088fa6d9",
|
|
2692
|
+
"size": 82411
|
|
2661
2693
|
},
|
|
2662
2694
|
"webui/static/00-base.css": {
|
|
2663
2695
|
"sha256": "a24939b4a9a4b9e9ee0dd32773c28177f74fd267aaad91071749d6fd6628dfba",
|
|
@@ -2828,16 +2860,24 @@
|
|
|
2828
2860
|
"size": 42769
|
|
2829
2861
|
},
|
|
2830
2862
|
"webui/static/index.html": {
|
|
2831
|
-
"sha256": "
|
|
2832
|
-
"size":
|
|
2863
|
+
"sha256": "879e69fb63d5aa90835a9a8012baa9f8966f005be62e252be30b0b85869767af",
|
|
2864
|
+
"size": 6928
|
|
2833
2865
|
},
|
|
2834
2866
|
"webui/static/manifest.webmanifest": {
|
|
2835
|
-
"sha256": "
|
|
2836
|
-
"size":
|
|
2867
|
+
"sha256": "b99dd886a3a309fbbe2e1081b820513edd45bb2f2e60dc05d03f7058ffedfbe2",
|
|
2868
|
+
"size": 514
|
|
2837
2869
|
},
|
|
2838
2870
|
"webui/static/project-settings.js": {
|
|
2839
|
-
"sha256": "
|
|
2840
|
-
"size":
|
|
2871
|
+
"sha256": "f69bd27fa0a97d6f78cea8f114bc8600d95559a33093457fc69821da16bd4722",
|
|
2872
|
+
"size": 515739
|
|
2873
|
+
},
|
|
2874
|
+
"webui/static/robots.txt": {
|
|
2875
|
+
"sha256": "01fb9fedbba13b75c8bfc3a62d5191ea2505764ace9fc9367264fd3e4afa0716",
|
|
2876
|
+
"size": 536
|
|
2877
|
+
},
|
|
2878
|
+
"webui/static/sitemap.xml": {
|
|
2879
|
+
"sha256": "e72b92d274988a62741b0bdb3d0261c7086d0230e67f0cd89ee161a7021b18ac",
|
|
2880
|
+
"size": 411
|
|
2841
2881
|
},
|
|
2842
2882
|
"webui/static/sw.js": {
|
|
2843
2883
|
"sha256": "41a700162981f09843819d739bba1830d2a3ef212715796e6196c0618b0b81ec",
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""core/host_acp/kimi.py - Kimi Code CLI 的 ACP 适配插件。
|
|
3
|
+
|
|
4
|
+
实机口径(``kimi 2.1.1``,2026-11-23 实测):
|
|
5
|
+
|
|
6
|
+
* ACP 入口为 ``kimi acp``,通过 stdio 运行标准 JSON-RPC 2.0 Agent Client Protocol
|
|
7
|
+
(``initialize`` 返回 ``protocolVersion: 1``、``agentInfo.name: "Kimi Code CLI"``)。
|
|
8
|
+
* ``kimi acp --help`` 仅接受 ``--login`` 与 ``--region``,无 ``--dir`` / ``--model`` /
|
|
9
|
+
``--data-dir`` flag;工作区绑定由探针子进程 ``cwd=<probe_root>`` 与 ``session/new``
|
|
10
|
+
参数提供。
|
|
11
|
+
* 项目级 MCP 配置位于 ``.kimi-code/mcp.json``,容器键为标准 ``mcpServers``
|
|
12
|
+
(``{"command": "...", "args": [...]}``),优先级高于用户级
|
|
13
|
+
``<KIMI_CODE_HOME>/mcp.json``(默认 ``~/.kimi-code/mcp.json``)。
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import json
|
|
19
|
+
import os
|
|
20
|
+
import shutil
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
from typing import Any
|
|
23
|
+
|
|
24
|
+
from .base import AcpPlugin
|
|
25
|
+
|
|
26
|
+
__all__ = ["KimiAcpPlugin", "PLUGIN", "is_available", "run_static_degraded"]
|
|
27
|
+
|
|
28
|
+
_HOST_NAME = __name__.rsplit(".", 1)[-1]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _kimi_code_home() -> Path:
|
|
32
|
+
configured = os.environ.get("KIMI_CODE_HOME")
|
|
33
|
+
if configured and configured.strip():
|
|
34
|
+
return Path(configured).expanduser()
|
|
35
|
+
return Path.home() / ".kimi-code"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _resolve_kimi_executable() -> str | None:
|
|
39
|
+
found = shutil.which("kimi")
|
|
40
|
+
if found:
|
|
41
|
+
return found
|
|
42
|
+
bin_dir = _kimi_code_home() / "bin"
|
|
43
|
+
names = ("kimi.exe", "kimi.cmd", "kimi.bat", "kimi") if os.name == "nt" else ("kimi",)
|
|
44
|
+
for name in names:
|
|
45
|
+
fallback = bin_dir / name
|
|
46
|
+
if fallback.is_file():
|
|
47
|
+
return str(fallback)
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class KimiAcpPlugin(AcpPlugin):
|
|
52
|
+
"""Kimi Code CLI ACP 插件。"""
|
|
53
|
+
|
|
54
|
+
name = _HOST_NAME
|
|
55
|
+
executable = "kimi"
|
|
56
|
+
status = "ready"
|
|
57
|
+
supports_project_permissions = False
|
|
58
|
+
|
|
59
|
+
def acp_argv(
|
|
60
|
+
self,
|
|
61
|
+
*,
|
|
62
|
+
model: str | None = None,
|
|
63
|
+
data_dir: Path | str | None = None,
|
|
64
|
+
) -> list[str]:
|
|
65
|
+
del model, data_dir
|
|
66
|
+
return [_resolve_kimi_executable() or self.executable, "acp"]
|
|
67
|
+
|
|
68
|
+
def launch_policy(self) -> dict[str, Any]:
|
|
69
|
+
"""返回 Kimi Code CLI 的 ACP 启动策略。"""
|
|
70
|
+
return {
|
|
71
|
+
"auto_approve": False,
|
|
72
|
+
"auto_approve_flag": None,
|
|
73
|
+
"model_flag": None,
|
|
74
|
+
"reason": "kimi acp 无 --model/--dir flag;工作区由 cwd 绑定,通过 ACP 协议交互",
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
def ensure_probe_servers(
|
|
78
|
+
self,
|
|
79
|
+
project_root: Path,
|
|
80
|
+
config_paths: tuple[Path, ...],
|
|
81
|
+
servers: dict[str, dict[str, Any]],
|
|
82
|
+
) -> list[str]:
|
|
83
|
+
"""将 BugX 通道写入探活项目内部的 ``.kimi-code/mcp.json``(标准 ``mcpServers`` 形状)。"""
|
|
84
|
+
updated: list[str] = []
|
|
85
|
+
root_resolved = project_root.resolve()
|
|
86
|
+
targets = list(config_paths) or [root_resolved / ".kimi-code" / "mcp.json"]
|
|
87
|
+
for path in targets:
|
|
88
|
+
try:
|
|
89
|
+
resolved = path.resolve()
|
|
90
|
+
except OSError:
|
|
91
|
+
continue
|
|
92
|
+
if root_resolved not in resolved.parents and resolved.parent != root_resolved:
|
|
93
|
+
continue # 严格限定只写探活项目内部
|
|
94
|
+
payload: dict[str, Any] = {}
|
|
95
|
+
if resolved.is_file() and not resolved.is_symlink():
|
|
96
|
+
try:
|
|
97
|
+
loaded = json.loads(resolved.read_text(encoding="utf-8"))
|
|
98
|
+
if isinstance(loaded, dict):
|
|
99
|
+
payload = loaded
|
|
100
|
+
except (OSError, UnicodeError, ValueError):
|
|
101
|
+
payload = {}
|
|
102
|
+
mcp_servers = payload.get("mcpServers")
|
|
103
|
+
if not isinstance(mcp_servers, dict):
|
|
104
|
+
mcp_servers = {}
|
|
105
|
+
payload["mcpServers"] = mcp_servers
|
|
106
|
+
changed = False
|
|
107
|
+
for name, spec in servers.items():
|
|
108
|
+
command = spec.get("command")
|
|
109
|
+
args = spec.get("args") or []
|
|
110
|
+
if not isinstance(command, str) or not command:
|
|
111
|
+
raise ValueError(f"无效的探活 MCP 命令: {name}")
|
|
112
|
+
if not isinstance(args, (list, tuple)):
|
|
113
|
+
raise ValueError(f"无效的探活 MCP 参数: {name}")
|
|
114
|
+
expected: dict[str, Any] = {
|
|
115
|
+
"command": command,
|
|
116
|
+
"args": [str(item) for item in args],
|
|
117
|
+
}
|
|
118
|
+
env = spec.get("env")
|
|
119
|
+
if isinstance(env, dict) and env:
|
|
120
|
+
expected["env"] = {str(k): str(v) for k, v in env.items()}
|
|
121
|
+
if mcp_servers.get(name) != expected:
|
|
122
|
+
mcp_servers[name] = expected
|
|
123
|
+
changed = True
|
|
124
|
+
if changed or not resolved.exists():
|
|
125
|
+
resolved.parent.mkdir(parents=True, exist_ok=True)
|
|
126
|
+
resolved.write_text(
|
|
127
|
+
json.dumps(payload, indent=2, ensure_ascii=False) + "\n",
|
|
128
|
+
encoding="utf-8",
|
|
129
|
+
)
|
|
130
|
+
updated.append(str(resolved))
|
|
131
|
+
return updated
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
PLUGIN = KimiAcpPlugin
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def is_available() -> tuple[bool, str]:
|
|
138
|
+
"""降级契约:机械探活 Kimi Code CLI 是否安装(零子进程)。"""
|
|
139
|
+
path = _resolve_kimi_executable()
|
|
140
|
+
if path is None:
|
|
141
|
+
return False, "kimi 可执行文件未安装;ACP 适配器无法拉起真实会话"
|
|
142
|
+
return True, path
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def run_static_degraded(root: Path | None = None) -> dict:
|
|
146
|
+
"""宿主 CLI 缺失/降级时的静态输出:只声明适配器事实,绝不伪装 ACP 会话。"""
|
|
147
|
+
available, availability_detail = is_available()
|
|
148
|
+
plugin = PLUGIN()
|
|
149
|
+
return {
|
|
150
|
+
"adapter": f"core/host_acp/{plugin.name}.py",
|
|
151
|
+
"plugin": plugin.name,
|
|
152
|
+
"schema_version": 1,
|
|
153
|
+
"success": available,
|
|
154
|
+
"status": "degraded",
|
|
155
|
+
"degraded": True,
|
|
156
|
+
"degraded_reason": (
|
|
157
|
+
"static_facts_only" if available else f"{plugin.name}_cli_not_installed"
|
|
158
|
+
),
|
|
159
|
+
"probe_mode": "static_degraded",
|
|
160
|
+
"acp_status": plugin.status,
|
|
161
|
+
"acp_supported": plugin.supports_acp(),
|
|
162
|
+
"acp_reason": plugin.reason or None,
|
|
163
|
+
"executable": plugin.executable,
|
|
164
|
+
"mcp_health": "unknown",
|
|
165
|
+
"findings": [],
|
|
166
|
+
"evidence": {
|
|
167
|
+
"availability_detail": availability_detail,
|
|
168
|
+
"project_root": str(root) if root else None,
|
|
169
|
+
},
|
|
170
|
+
"metadata": {
|
|
171
|
+
"degraded_mode": "static_adapter_facts_only",
|
|
172
|
+
"mcp_probing": "deferred_to_host_probe_chain",
|
|
173
|
+
"fallback": "宿主 CLI 缺失时由外层宿主/用户决策接管;BugX 不代装宿主 CLI",
|
|
174
|
+
},
|
|
175
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""core/host_acp/minimax.py - MiniMax Code ACP capability declaration.
|
|
3
|
+
|
|
4
|
+
MiniMax Code's installed desktop package exposes Plugin V1, MCP and Agent
|
|
5
|
+
manifests. A standard ACP entry point was not found in the inspected package,
|
|
6
|
+
so this is an explicit upstream-capability declaration, not an unfinished local
|
|
7
|
+
adapter.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from .base import AcpPlugin
|
|
13
|
+
|
|
14
|
+
__all__ = ["MiniMaxAcpPlugin", "PLUGIN"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class MiniMaxAcpPlugin(AcpPlugin):
|
|
18
|
+
name = "minimax"
|
|
19
|
+
executable = "mcode"
|
|
20
|
+
status = "unavailable"
|
|
21
|
+
reason = (
|
|
22
|
+
"MiniMax Code 3.1.0 桌面包已取证 Plugin V1、MCP 与 Agent 能力,"
|
|
23
|
+
"但未取证到标准 ACP 入口;ACP 探活不伪造命令行参数。"
|
|
24
|
+
)
|
|
25
|
+
supports_project_permissions = False
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
PLUGIN = MiniMaxAcpPlugin
|
|
@@ -38,6 +38,8 @@ SUPPORTED_HOSTS: tuple[str, ...] = (
|
|
|
38
38
|
"cline",
|
|
39
39
|
"zcode",
|
|
40
40
|
"dsh",
|
|
41
|
+
"kimi",
|
|
42
|
+
"minimax",
|
|
41
43
|
"chatgpt",
|
|
42
44
|
"workbuddy",
|
|
43
45
|
"qoder",
|
|
@@ -87,15 +89,33 @@ _apply_plugin_markers(HOST_MARKERS)
|
|
|
87
89
|
#: 已迁移插件(只读视图):宿主事实的唯一来源。
|
|
88
90
|
_HOST_PLUGINS = MappingProxyType(dict(host_plugins.PLUGINS))
|
|
89
91
|
|
|
90
|
-
#
|
|
91
|
-
|
|
92
|
-
NATIVE_QUESTION_HOSTS: frozenset[str] = frozenset(
|
|
92
|
+
# 未迁移宿主的交互事实仍由旧基线维护;已迁移宿主直接读取插件身份面。
|
|
93
|
+
_LEGACY_NON_NATIVE_QUESTION_HOSTS: frozenset[str] = frozenset({"funide"})
|
|
94
|
+
NATIVE_QUESTION_HOSTS: frozenset[str] = frozenset(
|
|
95
|
+
name for name in SUPPORTED_HOSTS
|
|
96
|
+
if (
|
|
97
|
+
(
|
|
98
|
+
name in _HOST_PLUGINS
|
|
99
|
+
and _HOST_PLUGINS[name].identity.native_question
|
|
100
|
+
)
|
|
101
|
+
or (
|
|
102
|
+
name not in _HOST_PLUGINS
|
|
103
|
+
and name not in _LEGACY_NON_NATIVE_QUESTION_HOSTS
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
)
|
|
93
107
|
|
|
94
108
|
# 宿主可执行名别名 → 规范宿主名。进程树识别必须经此归一化,避免
|
|
95
109
|
# 「同一宿主多个可执行名」散落在各调用点。
|
|
96
110
|
HOST_EXECUTABLE_ALIASES: dict[str, str] = {
|
|
97
111
|
"claude-code": "claude",
|
|
98
112
|
"deepseek": "dsh",
|
|
113
|
+
"kimi-code": "kimi",
|
|
114
|
+
"kimicode": "kimi",
|
|
115
|
+
"minimax-code": "minimax",
|
|
116
|
+
"minimaxcode": "minimax",
|
|
117
|
+
"minimax code": "minimax",
|
|
118
|
+
"mcode": "minimax",
|
|
99
119
|
"codebuddy": "workbuddy",
|
|
100
120
|
"codebuddy-lite-wb": "workbuddy",
|
|
101
121
|
"qoder-cli": "qoder",
|
package/core/hosts/dsh.py
CHANGED
|
@@ -96,7 +96,7 @@ def _dsh_home() -> Path:
|
|
|
96
96
|
import os
|
|
97
97
|
|
|
98
98
|
configured = os.environ.get("DSH_HOME", "").strip()
|
|
99
|
-
return Path(configured) if configured else Path.home() / ".dsh"
|
|
99
|
+
return Path(configured).expanduser() if configured else Path.home() / ".dsh"
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
def _profile_patch_path() -> Path:
|