@whyshu/argent-engine 0.8.0-rc.11 → 0.8.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MANIFEST.json +34 -7
- package/bin/runtime-install.mjs +92 -0
- package/engine/VERSION +1 -1
- package/engine/configs/billing-actions.json +30 -0
- package/engine/configs/mcp-tools.snapshot.json +40 -0
- package/engine/core/lib/account-token.mjs +37 -0
- package/engine/core/lib/redact.mjs +34 -0
- package/engine/core/mcp/billing-upload.mjs +77 -0
- package/engine/core/mcp/erp-server.mjs +296 -0
- package/engine/core/mcp/gateway.mjs +333 -0
- package/engine/core/mcp/meter.mjs +101 -0
- package/engine/core/mcp/vault.mjs +78 -0
- package/engine/scripts/appointment_grab.py +45 -20
- package/engine/scripts/argent-web-preflight.mjs +123 -0
- package/engine/scripts/argent-web-verify.mjs +105 -0
- package/engine/scripts/billing-upload.mjs +26 -0
- package/engine/scripts/build-engine-package.mjs +7 -1
- package/engine/scripts/dsh-web-doctor.mjs +84 -0
- package/engine/scripts/engine-runtime-install.mjs +92 -0
- package/engine/scripts/erp-ui-install.mjs +127 -0
- package/engine/scripts/erp-ui-preflight.mjs +104 -0
- package/engine/scripts/erp-ui-verify.mjs +135 -0
- package/engine/scripts/lib/plugin-packages.mjs +13 -0
- package/engine/scripts/mcp-gateway-switch.mjs +100 -0
- package/engine/scripts/migrate-providers.mjs +3 -3
- package/engine/scripts/v0.9-acceptance.mjs +107 -0
- package/engine/scripts/web-switch.mjs +121 -0
- package/engine/skills/README.md +3 -3
- package/engine/skills/bilibili-upload/SKILL.md +109 -0
- package/engine/skills/douyin-upload/SKILL.md +74 -0
- package/engine/skills/internal.json +28 -0
- package/engine/skills/kuaishou-upload/SKILL.md +109 -0
- package/engine/skills/tencent-upload/SKILL.md +60 -0
- package/engine/skills/weibo-upload/SKILL.md +106 -0
- package/engine/skills/whyshu-social-ops/SKILL.md +136 -0
- package/engine/skills/xiaohongshu-upload/SKILL.md +122 -0
- package/engine/version.mjs +1 -1
- package/package.json +5 -1
package/MANIFEST.json
CHANGED
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"package": "@whyshu/argent-engine",
|
|
4
4
|
"files": {
|
|
5
|
-
"VERSION": "
|
|
5
|
+
"VERSION": "4b86fbb380ef1b5419b8003e9926a337fbeb070e06da3979389ec5ed39e5b619",
|
|
6
6
|
"agents/catalog.json": "5356a812f2554dfd3115370363d4c3f787a82c9e5928a85d05b2a07c9e4b324d",
|
|
7
7
|
"configs/_aliases.proposed.json": "3a59edf80563bcc20d410d488decad6fd787bd3de9489321367b0783904cd3e5",
|
|
8
8
|
"configs/_migration-plan.proposed.json": "dd9f90b0b9b2f217dd23367a618402e57997d44f7fddcfa88a7cadf52e056c0d",
|
|
9
9
|
"configs/account.json": "3e80bf3bedec835ee29c46477958515ce6312ca30922fed4f0a670e8cb4eaa32",
|
|
10
10
|
"configs/advanced.json": "4d87abc94a6b6e5615fccece9e37af9c428ff98dc199dab6c8990c86fc4082c0",
|
|
11
|
+
"configs/billing-actions.json": "c60075969aaa3a84226da5e4ce3b2a18dcc8a8b088b97edcb4412cbd4ab1be5f",
|
|
11
12
|
"configs/host.json": "1fcae03c7059ae69c940200128c254e266ccf2e5f3cfa41ad6b78ebdf795887f",
|
|
12
13
|
"configs/hr.json": "59c0ea732139e7f54f04dce7595825b778b36f450e5ae5049d1326562388f7b8",
|
|
14
|
+
"configs/mcp-tools.snapshot.json": "505293eb74cb065231903e21cb16fd7f173e17c35f60315fc3289645a5124a35",
|
|
13
15
|
"configs/notify.json": "cb9ef11c1c498fcf99af99ec50271b8a2598061b77ed73a6099032e837474ef0",
|
|
14
16
|
"core/cli/argent.mjs": "9a8977324c238ca4e20435f9817eb7ec76157da32b1d510977dc03e0feb416a9",
|
|
15
17
|
"core/contracts/argent.contracts.json": "8dba5b21612f2cf1d8fe56b34cb4e5b08ea7daae5e2f3308afb4912b6a618ff4",
|
|
16
18
|
"core/contracts/verbs.schema.json": "54d726181c11536eb30bd25090584a7af103e4c0462f8ef078053c8177e19dcb",
|
|
19
|
+
"core/lib/account-token.mjs": "35faad2c34e67755c1867f74a74885f0f268d5daabe01d339cf30dc747f86501",
|
|
17
20
|
"core/lib/argent-datadir.mjs": "1fdd799c933382c4f9e36bd4af33d51b8ac4a466a9d67a8f2296bb267b5251ac",
|
|
18
21
|
"core/lib/audit.mjs": "b57c233b1926e4ce4686604bbd2fdda33fdd432083828e589c5652606c63ba75",
|
|
19
22
|
"core/lib/claim.mjs": "0ab5cfa554446c2c870931e58a2eb51930eb9a136afde01a9de962ac1b2d4287",
|
|
@@ -38,17 +41,23 @@
|
|
|
38
41
|
"core/lib/notify/webhook.mjs": "33708fec34641c8dd20b740040ed86990243a7a9ba31bc95d0cd4dd78c6f697e",
|
|
39
42
|
"core/lib/notify/wecom.mjs": "789be0b3e28a151da312096cbc43eebb6865b94cff0467d5596e6bf132bafe10",
|
|
40
43
|
"core/lib/python.mjs": "c056844af4a44a65d5bb86abfcb319da6ed46fe674e7a15f9ef81da43c207df1",
|
|
44
|
+
"core/lib/redact.mjs": "8e3c7e7b6e510f91a5c349c96473d11fa3c4cdb6ffc1eb48831f60d8494f11c7",
|
|
41
45
|
"core/lib/sop.mjs": "57a6abfeeae2c21695efe29e10440a93eac1b1d52fd132622173c3843221ba06",
|
|
42
46
|
"core/lib/versions.mjs": "9e9fda66d9ad63913604d50407565311081453830fe181be096f106d0f3903a7",
|
|
47
|
+
"core/mcp/billing-upload.mjs": "f4ece1f2c4395c089c3dd2180ebd52df0481b4c668efac8c573505f18471eadb",
|
|
43
48
|
"core/mcp/client.mjs": "291b891b51f512de808f512d245a02ca0370afc643bf1acac7a3e20cf217d5a1",
|
|
49
|
+
"core/mcp/erp-server.mjs": "d48ca2f938e110eb1f232436d7f8a751724098e8bc46558fbfe0a7681d5dd484",
|
|
50
|
+
"core/mcp/gateway.mjs": "b734a1e68c2e72460ba86a5029c16c70fb24a1e207e74143543ad6ca4506e559",
|
|
44
51
|
"core/mcp/http.mjs": "4388cdb18128844a45313ed4721cbb6ecfcfa683b59ca91b45c9a84ccaeec437",
|
|
52
|
+
"core/mcp/meter.mjs": "4b2cb27d4e27192189667b969e85160ff1a4bd18d2a1013a0d6fb83a03f83b9c",
|
|
45
53
|
"core/mcp/server.mjs": "c4a6e1dbfecd5a476ddd9b0266546d89e0011d8d6518a5dc9a3889d748c01ff5",
|
|
54
|
+
"core/mcp/vault.mjs": "b5abaeb626e02e1fbf4f839346eb2da6c54d3372fffc61bf7a8f7189878e32cc",
|
|
46
55
|
"scripts/_engine_rules_probe.py": "ad8f45dc0f37852259461a25fb648b11df818089ba40f980dfa72b7e201a03d9",
|
|
47
56
|
"scripts/analyze-full-day.py": "2ee87f3f27929cd9407109121e670b56c296f39b0a3e18b075524b54a7d4471c",
|
|
48
57
|
"scripts/appointment-create.mjs": "3448966cebc767160cb151a27ccf2b6f6439c80f970f769621058871f95433cc",
|
|
49
58
|
"scripts/appointment-stop.mjs": "2e0a965346d33ef8683da5473c48df7f4e66ee8a3167526ee6b568e1adf5c91d",
|
|
50
59
|
"scripts/appointment-worker.mjs": "e79486eab2b902d351a75885258f2a74b871b29c0e83fccedd9eccc6029b2bdd",
|
|
51
|
-
"scripts/appointment_grab.py": "
|
|
60
|
+
"scripts/appointment_grab.py": "c965625802585a9e20661f4b4442942bdeeed28c69ca72b0c557945bda0b87d7",
|
|
52
61
|
"scripts/archive/feishu-bridge.js": "e6714c72022892d0c527d1fc9ae0f8ff99f9ab3bd0363329979b423246684885",
|
|
53
62
|
"scripts/argent-agents.mjs": "73f4a058df2cd6d62b285ea48a5e32881db678b63007d1ac2f218005cb28c18d",
|
|
54
63
|
"scripts/argent-capabilities.mjs": "7186d7c19f733d987a7afe2355dd7d788333a15c0f80811c4cde4e7a32584c4e",
|
|
@@ -61,11 +70,14 @@
|
|
|
61
70
|
"scripts/argent-schedule.mjs": "4d2485f454094ae7d9978334e0ee995aef22fdc7058f3694c1f7d363e8a51f09",
|
|
62
71
|
"scripts/argent-setup-check.mjs": "44d3558ae6eebd5cc2dd25752019d3386190e63006b544e1ceee3f4f1c526aff",
|
|
63
72
|
"scripts/argent-upgrade.mjs": "ba75148cb3c27b4aab2b184d1320d4b57a203adf8b90214fa3d62880685a0d81",
|
|
73
|
+
"scripts/argent-web-preflight.mjs": "7aa67912098b23cab2dec68d78830f7e5dc1d6c9cb915f4e00628fcd47bb694d",
|
|
74
|
+
"scripts/argent-web-verify.mjs": "9690885f7b379da87d879018e254e563ad6631b56381ee293ee06796ce605694",
|
|
64
75
|
"scripts/audit-all.mjs": "54c21512dc7c192fba21e45aab19502e070fecc4d0686fabb1fbdba0d7140794",
|
|
65
76
|
"scripts/base-bootstrap.sh": "d44361618f808533fc11e8acdbccf5dfa53822a745e7c7a84bbd09885f6d6c2e",
|
|
66
77
|
"scripts/billing-mode-daily.sh": "830e2dca9f362d1098239111479794a68d4a34071242daaeb04c36cf858cd175",
|
|
78
|
+
"scripts/billing-upload.mjs": "976b1eb10509f3b22084179b70a1aeb6c391be62a7d5b80c2699e191f29a0b64",
|
|
67
79
|
"scripts/build-doc-index.mjs": "cc8fc3b4defff20df345c377229101ffd6efef028e4b6a27232de6d3246789ec",
|
|
68
|
-
"scripts/build-engine-package.mjs": "
|
|
80
|
+
"scripts/build-engine-package.mjs": "e2ed49aae606ac05b30cddcc1a7e71a9d38c6237fa47c0a113c187e24e01c034",
|
|
69
81
|
"scripts/capability-packs.lock.json": "dc7325bf351394d86cc9432567d510b94a8b76001f62df040ffa5fda1ee3ddce",
|
|
70
82
|
"scripts/capability_pack.py": "d21bca70deadab6bb818a3f2e12721c7eeb1c690bb382daae752620db8db5cb3",
|
|
71
83
|
"scripts/check-1.0-criteria.mjs": "8fe145a83c4060c51a678eb2586b87a78b66d1456cebc95c52f7789aeb181c66",
|
|
@@ -130,10 +142,15 @@
|
|
|
130
142
|
"scripts/dsh-upgrade-readiness.mjs": "9e3640e0bcda0fb818d8df1bad9d3a37be364775601859b0668f99b81243d602",
|
|
131
143
|
"scripts/dsh-upgrade.mjs": "62eda97de6fb29243fc22c63f02ce2c7f06786254cb70ba542c0daabe5979019",
|
|
132
144
|
"scripts/dsh-url.sh": "f45619b9029836e7fb224ed04d0e849e1af32f457434fb49732b39b0e825f040",
|
|
145
|
+
"scripts/dsh-web-doctor.mjs": "dffefd5188f18c353ddb93db3231382dbea80fb251b89652e186b6708ba14751",
|
|
133
146
|
"scripts/dsh-web-launch.mjs": "c0bc990b41e2bf3e07514a3672f99a49031a838ce153a8ce8eae3713112e1e6c",
|
|
147
|
+
"scripts/engine-runtime-install.mjs": "dbab1972c955c4a458f30fc631560fde4e49b7686b7e953db9e1496fd0326606",
|
|
134
148
|
"scripts/ensure-store-windows.py": "8080b5afb7cf95a2203cfe46e34773ea4bcb945718f26cb837248860701c08f4",
|
|
135
149
|
"scripts/entitlements.py": "827bc3dd842faef7b4e7711f517633158cc5fbc2c9738faa41f80095c10b84c6",
|
|
136
150
|
"scripts/env_probe.py": "976171519efe2a699844940687f179cb07b277f979ca5465d409a4e6cee4b3a7",
|
|
151
|
+
"scripts/erp-ui-install.mjs": "011c24fa9d92647cb4ab9f5e58d3cdd913c29614a60cbb81c738f478d900e504",
|
|
152
|
+
"scripts/erp-ui-preflight.mjs": "bf3610a03d766becddde892f06b2afed84c9d071f07200e6190a8011c76fdaab",
|
|
153
|
+
"scripts/erp-ui-verify.mjs": "56d23bd20a2aa15ddf55e34db71cc39f49e1153a01ea4d17d1ce0ff924f60292",
|
|
137
154
|
"scripts/erp_invoice_shadow.py": "cde33ae1250eaa14c901f13a2cbac9acbc30cd646187ebb55374d07ad4de6a69",
|
|
138
155
|
"scripts/erp_invoice_writeback.py": "6ab4abb58b2c6b944636722bc0bf15769d53d57a898da59d335af51dfb129418",
|
|
139
156
|
"scripts/feishu-card.mjs": "1041cc0d32ad49a5d2ef5c5dc5f954f4e6b5d628395768847e9d5ed246706e8f",
|
|
@@ -214,7 +231,7 @@
|
|
|
214
231
|
"scripts/lib/patch-compose.mjs": "1e2064062799c214c8fea1bf3403c7dea7854d0c29e7bbe2ab82ad994dfc636e",
|
|
215
232
|
"scripts/lib/patch-target.mjs": "9c2970180b25c757f959ff9aa34d9cafdee8747351893ab59826b407940a272e",
|
|
216
233
|
"scripts/lib/plugin-lifecycle.mjs": "a69bbc1f60400128b4999ac4d81b466bd7e68d8fd4076d2ac963908635901c08",
|
|
217
|
-
"scripts/lib/plugin-packages.mjs": "
|
|
234
|
+
"scripts/lib/plugin-packages.mjs": "f9e34f544b19fa05d5b7bba35bddb03c5fa3829681ecbf100000519e6d6f1094",
|
|
218
235
|
"scripts/lib/preset-compat.mjs": "c31d803922894231f24ce7baba1468ef590a4dae011fcb33de6e4083750c1918",
|
|
219
236
|
"scripts/lib/preset-install.mjs": "cf939e22ae82be40c9823e102d5c453fd4a5d5c5b4e0ae1acd0ca36eb2414c45",
|
|
220
237
|
"scripts/lib/preset-mechanism.mjs": "b5ad412bacd8db85c334fddda858069336100395632b6c076735e800a9b1f358",
|
|
@@ -237,7 +254,8 @@
|
|
|
237
254
|
"scripts/lip_table.py": "5d84ecbd170e4dbb5614132ea17999318754bfb9d1d17e9ae73353787436fe30",
|
|
238
255
|
"scripts/local-usage.mjs": "a5148d43b303d7fba960a5448c9537cc80db96da0323708c27f99217510ff74f",
|
|
239
256
|
"scripts/login-readiness.py": "5e920dddc669bb2d93540283c0ead7e8d7f9a260c765600f656d108d1e934875",
|
|
240
|
-
"scripts/
|
|
257
|
+
"scripts/mcp-gateway-switch.mjs": "9e31582c9a5aacc6ae9fe01e7bfb0dd644f8f42901237ee3c4f01919425c3e00",
|
|
258
|
+
"scripts/migrate-providers.mjs": "3d96843ca1ddf7546e26e234206a660207f6e6799deeaa002fa752a5ccd9d0ed",
|
|
241
259
|
"scripts/migrate-skills.sh": "2ff1f12b80135d27d275d9809e8f1721b6f0f725b1a951c62f3d8a03b3bec5fa",
|
|
242
260
|
"scripts/ml-ads.mjs": "3ab5204f70b72cfe1f3e0dee18016d1e6db082d998af46d3f7a9772344eacaed",
|
|
243
261
|
"scripts/ml-oauth-setup.mjs": "bbeed80575f075e292953970831e25d634e662ab374cf00e0a8c88ee65acfc13",
|
|
@@ -297,9 +315,11 @@
|
|
|
297
315
|
"scripts/ui-copy-count.mjs": "d2bfc81fdc8852429f8e64ff4e608724ee82d47485e155ad091d79746fded3a8",
|
|
298
316
|
"scripts/usage-anchor.sh": "20b9b4eb6815ed057bcdde06d1284780b7d5a383c62de9eb48ac7182dfbd4536",
|
|
299
317
|
"scripts/usage_report.py": "ad1ee4e92c3e33a040a84a15818570eab3a0e94d627b9be78df5615b58257e59",
|
|
318
|
+
"scripts/v0.9-acceptance.mjs": "a77dbb9cf7b72bf3ce90dac181b74272494ef76ca06ab40e54cc663495c7020c",
|
|
300
319
|
"scripts/validate-preset-schema.mjs": "2bb5fda6eab5bef7780fed77c3c914b52bc22e640e902507a96397ff03e9ace9",
|
|
301
320
|
"scripts/vertical-init.mjs": "b4f63d71152a84b095cf011d680abbe50a7bf8d6a9f925cd38d2874a71995e09",
|
|
302
321
|
"scripts/vertical-lint.mjs": "c171a5cf7862c00e7db650094a2e33a5174b5b237c17a1ca7792f76b09cf2550",
|
|
322
|
+
"scripts/web-switch.mjs": "fe8e4d9a4afa56c8c5be8dcfdcec54a88a179d55e703f26ff3a88672326ddd00",
|
|
303
323
|
"scripts/wenyao-browser.sh": "89d079ee636a234cafc06ead9cc83833216197b73b85138f6c51ec9b1c13a715",
|
|
304
324
|
"scripts/wenyao-fixture-export.py": "c4f6ffaaa0af2cd06c598755cc4e7a1261c743ccc8e4d7547bbe41203825bfaf",
|
|
305
325
|
"scripts/wenyao-invoice-writeback.mjs": "5fd8295ef47480a15418134552ff5e12cc3713d6f9ff902157c9452a41cc1f5a",
|
|
@@ -322,10 +342,13 @@
|
|
|
322
342
|
"scripts/ziniao-keepalive.sh": "2e22f07972e3e2eab4dc65aaacbf570c0975dbd2f90cd2c9a886575221a24c49",
|
|
323
343
|
"scripts/ziniao-post-upgrade-check.sh": "d61c4fae39ab2e1bf4ffc3c7732305a1a600652a79df6b204864601feb5d3a31",
|
|
324
344
|
"scripts/ziniao-windows.sh": "6bbc218e216ec23b7ecc90f318f09535a76bb4c330475168da5d2512da8bd5ad",
|
|
325
|
-
"skills/README.md": "
|
|
345
|
+
"skills/README.md": "dc8ec4ff0f03926ffacf2315a2de03c1d89957127f19e8441ae252b73a47f7dc",
|
|
326
346
|
"skills/argent-dev/SKILL.md": "0d1a7757d87299909b0a9dc8ff6ccd91a535b2db6b14faf18683df7b880d2e2c",
|
|
327
347
|
"skills/argent-machine-onboarding/SKILL.md": "6c82fc4b1dd3608115feecd75181a8e8cb36a1180b48e440823a9f50102c94dd",
|
|
328
|
-
"skills/
|
|
348
|
+
"skills/bilibili-upload/SKILL.md": "c8b056db08732bd300854e979fb4f3f8cb8cbb78baf404f5521fc199dd60c612",
|
|
349
|
+
"skills/douyin-upload/SKILL.md": "5b760668769a436a13fc8d8a71dc38a8277ced5a110dd5655fae2004851516a6",
|
|
350
|
+
"skills/internal.json": "b91f42d9cb0ca103f39d073a8e55a84667d5f0b323c62b910bf08faea5212434",
|
|
351
|
+
"skills/kuaishou-upload/SKILL.md": "0c0be1c031dd265051bcc3d34d4755999126e78f7520ee3d41176b56ece42515",
|
|
329
352
|
"skills/lktop-pm/SKILL.md": "4f9e2315359ec5d7bca27fea500522ef4513b7c2d540cc405b202b7e49bc68d3",
|
|
330
353
|
"skills/lktopapp-dev/SKILL.md": "48c07d7cacfbda2887fe05b95ca4ecf68b14c5433bfee74de3fa0a2932b06ed3",
|
|
331
354
|
"skills/ml-config-guide/SKILL.md": "25fe4acf8fe0b54ed142579c51f28fd1509e8174a0896a281e4008325c18dfd0",
|
|
@@ -352,8 +375,12 @@
|
|
|
352
375
|
"skills/ml-store-daily-report/scripts/extract.js": "2fb180395d11c3f3192e891ee7f6e2029b34aab132b1785855bc6dc998c610e8",
|
|
353
376
|
"skills/ml-store-daily-report/scripts/generate.js": "68a6abcea8d1109c4d7bf8e3fd4eb2c1c50012c6c7e71c50b4dd7696276683bc",
|
|
354
377
|
"skills/pet-dev/SKILL.md": "0699f0aeb3598f39f28438285419b303e44f9cff155f56fcfa1ac6270978a975",
|
|
378
|
+
"skills/tencent-upload/SKILL.md": "84d8725501d71770aab78fd11addb897a0e597163434859f0f1ef0e88d3e02c8",
|
|
379
|
+
"skills/weibo-upload/SKILL.md": "de4eb8b7212c053b788bddd9496af19991f687e5cac26196bc7ebe443d1aeb45",
|
|
355
380
|
"skills/whyshu-pm/SKILL.md": "04294e57508e32bd5f8dcad8b4c0da3052c1ad567434273c5d975d882096c50b",
|
|
381
|
+
"skills/whyshu-social-ops/SKILL.md": "fbd7b805396f74e63773dd8198299ea88fc04e81323e8a73b20ea3b8ee3313d9",
|
|
356
382
|
"skills/whyshu-web-dev/SKILL.md": "f07d4365be9c723ccf08373860c5d66b2e30acdcffbe725ae569e9a208e9bb1e",
|
|
383
|
+
"skills/xiaohongshu-upload/SKILL.md": "b40bdaadd0b84f520e773cc9d2645cae24710d3c7a5e6173207fda559c30e17f",
|
|
357
384
|
"tools/agentic/README.md": "6fa0af915442bfe97d730ce41eb66bf8dec9d1165b393d687a5e35072e69270c",
|
|
358
385
|
"tools/agentic/mcp_server.py": "4c3e66e6a8f8a4571339045dc4ccc255288557115a06ff42bd60a4c79b696feb",
|
|
359
386
|
"tools/agentic/ml_agent_tools.py": "b080d439ababf0ea375ae498a534f6c9761f8fce799b79d44991e830e6ca8dbc",
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @whyshu/argent-engine 自带 runtime 安装器(2026-11-07,替代已退役启动器)。
|
|
4
|
+
*
|
|
5
|
+
* 用法(客户机出站,不推文件):
|
|
6
|
+
* npx -y @whyshu/argent-engine@<version> argent-engine-runtime --target ~/.argent-dsh
|
|
7
|
+
*
|
|
8
|
+
* 行为:
|
|
9
|
+
* · 只写引擎文件(scripts/core/verticals/configs/agents/skills/tools/agentic + VERSION),
|
|
10
|
+
* **不动** venv、数据、台账、agent-report、license;
|
|
11
|
+
* · 覆盖前把旧文件备份到 <target>/.runtime-backup/<timestamp>/;
|
|
12
|
+
* · 安装前按 MANIFEST.json 校验包内文件 sha256(fail-closed),安装后写 VERSION;
|
|
13
|
+
* · `.sh` 安装为 0755,其余 0644(客户机执行位事故的既有口径)。
|
|
14
|
+
*/
|
|
15
|
+
import { readFileSync, writeFileSync, mkdirSync, rmSync, existsSync, readdirSync, statSync, chmodSync, copyFileSync } from 'node:fs'
|
|
16
|
+
import { createHash } from 'node:crypto'
|
|
17
|
+
import { join, dirname, relative, sep } from 'node:path'
|
|
18
|
+
import { homedir } from 'node:os'
|
|
19
|
+
import { fileURLToPath } from 'node:url'
|
|
20
|
+
|
|
21
|
+
const HERE = dirname(fileURLToPath(import.meta.url))
|
|
22
|
+
const PKG_ROOT = dirname(HERE) // published layout: <pkg>/bin/runtime-install.mjs
|
|
23
|
+
const SRC = join(PKG_ROOT, 'engine')
|
|
24
|
+
|
|
25
|
+
function parseArgs(argv) {
|
|
26
|
+
const out = { target: join(homedir(), '.argent-dsh'), dryRun: false }
|
|
27
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
28
|
+
if (argv[i] === '--target') out.target = argv[++i]
|
|
29
|
+
else if (argv[i] === '--dry-run') out.dryRun = true
|
|
30
|
+
else if (argv[i] === '--help') { console.log('用法:argent-engine-runtime --target <dir> [--dry-run]'); process.exit(0) }
|
|
31
|
+
}
|
|
32
|
+
return out
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const sha = (buf) => createHash('sha256').update(buf).digest('hex')
|
|
36
|
+
|
|
37
|
+
function listFiles(dir, base = SRC) {
|
|
38
|
+
const out = []
|
|
39
|
+
for (const e of readdirSync(dir)) {
|
|
40
|
+
const p = join(dir, e)
|
|
41
|
+
const st = statSync(p)
|
|
42
|
+
if (st.isDirectory()) out.push(...listFiles(p))
|
|
43
|
+
else out.push(relative(base, p).split(sep).join('/'))
|
|
44
|
+
}
|
|
45
|
+
return out
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function main() {
|
|
49
|
+
const opts = parseArgs(process.argv.slice(2))
|
|
50
|
+
if (!existsSync(SRC)) { console.error(`✗ 包内缺少 engine/(${SRC})`); process.exit(2) }
|
|
51
|
+
const manifest = JSON.parse(readFileSync(join(PKG_ROOT, 'MANIFEST.json'), 'utf8'))
|
|
52
|
+
const version = readFileSync(join(SRC, 'VERSION'), 'utf8').trim()
|
|
53
|
+
const files = listFiles(SRC)
|
|
54
|
+
// ① 包内自检:字节与 MANIFEST 一致(fail-closed)
|
|
55
|
+
for (const rel of files) {
|
|
56
|
+
const buf = readFileSync(join(SRC, rel))
|
|
57
|
+
if (manifest.files[rel] && sha(buf) !== manifest.files[rel]) {
|
|
58
|
+
console.error(`✗ 包内文件摘要不符:${rel}`)
|
|
59
|
+
process.exit(2)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (opts.dryRun) {
|
|
63
|
+
console.log(JSON.stringify({ ok: true, dryRun: true, version, target: opts.target, files: files.length }))
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
const target = opts.target
|
|
67
|
+
const ts = new Date().toISOString().replace(/[:.]/g, '-')
|
|
68
|
+
const backup = join(target, '.runtime-backup', ts)
|
|
69
|
+
mkdirSync(backup, { recursive: true })
|
|
70
|
+
let copied = 0
|
|
71
|
+
for (const rel of files) {
|
|
72
|
+
const src = join(SRC, rel)
|
|
73
|
+
const dst = join(target, rel)
|
|
74
|
+
if (existsSync(dst)) {
|
|
75
|
+
const oldBuf = readFileSync(dst)
|
|
76
|
+
const newBuf = readFileSync(src)
|
|
77
|
+
if (sha(oldBuf) !== sha(newBuf)) {
|
|
78
|
+
const b = join(backup, rel)
|
|
79
|
+
mkdirSync(dirname(b), { recursive: true })
|
|
80
|
+
copyFileSync(dst, b)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
mkdirSync(dirname(dst), { recursive: true })
|
|
84
|
+
copyFileSync(src, dst)
|
|
85
|
+
chmodSync(dst, rel.endsWith('.sh') ? 0o755 : 0o644)
|
|
86
|
+
copied += 1
|
|
87
|
+
}
|
|
88
|
+
writeFileSync(join(target, 'VERSION'), `${version}\n`)
|
|
89
|
+
console.log(JSON.stringify({ ok: true, version, target, files: copied, backupDir: backup }))
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
main()
|
package/engine/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.8.0-rc.
|
|
1
|
+
0.8.0-rc.12
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "可计费动作清单(v0.9.0 草案)。网关只在『动作成功』时记 1 条事件;读与提议不计费。字段语义见 docs/Argent-0.9-ERP入口与MCP网关-规划.md §计费。",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"updatedAt": "2026-11-03",
|
|
5
|
+
"currency": "points",
|
|
6
|
+
"rules": {
|
|
7
|
+
"billWhen": "tool result ok === true",
|
|
8
|
+
"idempotencyKey": "调用方传入 idempotencyKey(业务主键);同键重试只记 1 条",
|
|
9
|
+
"freeWhen": ["readOnlyTool", "proposalOnly", "failed", "cancelled"],
|
|
10
|
+
"defaultPoints": 1
|
|
11
|
+
},
|
|
12
|
+
"actions": [
|
|
13
|
+
{ "id": "shipment.dispatch", "label": "派发货件", "tools": ["erp.erp_prepare_action", "office/actions:execute"], "points": 2, "idempotencyKey": "proposalId", "enabled": false, "note": "等 ERP 提供 prepare_action 路由" },
|
|
14
|
+
{ "id": "shipment.update", "label": "改货件状态/字段", "tools": ["erp.erp_prepare_action", "office/actions:execute"], "points": 1, "idempotencyKey": "proposalId", "enabled": false },
|
|
15
|
+
{ "id": "invoice.generate", "label": "生成发票", "tools": ["engine.argent_skuflow_run"], "points": 5, "idempotencyKey": "recordId", "enabled": true },
|
|
16
|
+
{ "id": "invoice.upload", "label": "上传发票/标签", "tools": ["engine.argent_skuflow_run"], "points": 5, "idempotencyKey": "recordId", "enabled": true },
|
|
17
|
+
{ "id": "full.run_step", "label": "FULL 单步执行", "tools": ["ml.ml_run_full_step"], "points": 3, "idempotencyKey": "runId", "enabled": true },
|
|
18
|
+
{ "id": "full.finalize", "label": "FULL 收尾", "tools": ["ml.ml_finalize_ticket"], "points": 3, "idempotencyKey": "ticketId", "enabled": true },
|
|
19
|
+
{ "id": "claim.run", "label": "认领工单", "tools": ["engine.argent_claim"], "points": 1, "idempotencyKey": "flow+ticket", "enabled": true },
|
|
20
|
+
{ "id": "writeback.record", "label": "回写飞书记录", "tools": ["engine.argent_writeback"], "points": 1, "idempotencyKey": "recordId", "enabled": true },
|
|
21
|
+
{ "id": "orchestrator.run", "label": "FULL 全流程编排", "tools": ["engine.argent_orchestrator_run"], "points": 8, "idempotencyKey": "recordId", "enabled": true },
|
|
22
|
+
{ "id": "meta.read", "label": "读类查询(货件/发票/任务/台账/成员/办公室)", "tools": ["erp.erp_* 只读", "engine.argent_ledger"], "points": 0, "idempotencyKey": "", "enabled": true, "note": "免费,仅限流" }
|
|
23
|
+
],
|
|
24
|
+
"freeTools": [
|
|
25
|
+
"engine.argent_version", "engine.argent_license", "engine.argent_ledger", "engine.argent_sop",
|
|
26
|
+
"engine.argent_doctor", "engine.argent_report", "engine.argent_failures", "engine.argent_preflight",
|
|
27
|
+
"engine.argent_writeback_audit", "engine.argent_job_status", "ml.ml_probe_hub",
|
|
28
|
+
"ml.ml_probe_appointment", "ml.ml_open_appointment_slots", "ml.ml_watch_appointment"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"updatedAt": "2026-11-03",
|
|
3
|
+
"tools": [
|
|
4
|
+
"engine.argent_claim",
|
|
5
|
+
"engine.argent_claim_shadow",
|
|
6
|
+
"engine.argent_doctor",
|
|
7
|
+
"engine.argent_failures",
|
|
8
|
+
"engine.argent_job_cancel",
|
|
9
|
+
"engine.argent_job_start",
|
|
10
|
+
"engine.argent_job_status",
|
|
11
|
+
"engine.argent_ledger",
|
|
12
|
+
"engine.argent_license",
|
|
13
|
+
"engine.argent_orchestrator_run",
|
|
14
|
+
"engine.argent_preflight",
|
|
15
|
+
"engine.argent_report",
|
|
16
|
+
"engine.argent_shadow_compare",
|
|
17
|
+
"engine.argent_skuflow_run",
|
|
18
|
+
"engine.argent_sop",
|
|
19
|
+
"engine.argent_version",
|
|
20
|
+
"engine.argent_writeback",
|
|
21
|
+
"engine.argent_writeback_audit",
|
|
22
|
+
"engine.argent_writeback_shadow",
|
|
23
|
+
"erp.erp_activity_list",
|
|
24
|
+
"erp.erp_dashboard",
|
|
25
|
+
"erp.erp_execute_action",
|
|
26
|
+
"erp.erp_invoice_detail",
|
|
27
|
+
"erp.erp_invoice_list",
|
|
28
|
+
"erp.erp_ledger_list",
|
|
29
|
+
"erp.erp_member_list",
|
|
30
|
+
"erp.erp_office_snapshot",
|
|
31
|
+
"erp.erp_prepare_action",
|
|
32
|
+
"erp.erp_run_list",
|
|
33
|
+
"erp.erp_shipment_detail",
|
|
34
|
+
"erp.erp_shipment_search",
|
|
35
|
+
"erp.erp_shipment_stats",
|
|
36
|
+
"erp.erp_shipment_timeline",
|
|
37
|
+
"erp.erp_task_list",
|
|
38
|
+
"erp.erp_tenant_info"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 账号 token 的唯一解析点(2026-11-03)
|
|
3
|
+
*
|
|
4
|
+
* 为什么要单独成文件:ERP MCP 适配层(core/mcp/erp-server.mjs)与 dsh 宿主插件
|
|
5
|
+
* (plugins/argent-erp-ui)都要用**同一把**问述账号 JWT,⛔ 不许各写一套"先读哪个文件"。
|
|
6
|
+
*
|
|
7
|
+
* 顺序(实测依据见 docs/Argent-0.9-ERP入口与MCP网关-规划.md):
|
|
8
|
+
* ① `ARGENT_ACCOUNT_TOKEN`(显式注入,测试/排障)
|
|
9
|
+
* ② `WHYSHU_API_KEY` 环境变量(宿主 profile 注入)
|
|
10
|
+
* ③ `~/.dsh/.credentials.yaml` 的 `refs.WHYSHU_API_KEY`(现役;只读,⛔ 绝不写)
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ `~/.dsh/argent/whyshu.env` 里的 JWT **已过期**(2026-11-03 实测 401),故意不读它。
|
|
13
|
+
*/
|
|
14
|
+
import { readFileSync } from 'node:fs'
|
|
15
|
+
import { homedir } from 'node:os'
|
|
16
|
+
import { join } from 'node:path'
|
|
17
|
+
|
|
18
|
+
/** 只读:从 credentials 文件里取 `WHYSHU_API_KEY: <token>`(窄正则,避免解析整份 YAML) */
|
|
19
|
+
export function readTokenFromCredentials(dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')) {
|
|
20
|
+
try {
|
|
21
|
+
const raw = readFileSync(join(dshHome, '.credentials.yaml'), 'utf8')
|
|
22
|
+
const m = raw.match(/WHYSHU_API_KEY\s*:\s*"?([A-Za-z0-9._-]{20,})/)
|
|
23
|
+
return m ? m[1] : ''
|
|
24
|
+
} catch {
|
|
25
|
+
return ''
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** @returns {{token:string, source:'env-explicit'|'env-whyshu'|'credentials'|'none'}} */
|
|
30
|
+
export function resolveAccountToken({ env = process.env, dshHome } = {}) {
|
|
31
|
+
const explicit = String(env.ARGENT_ACCOUNT_TOKEN || '').trim()
|
|
32
|
+
if (explicit) return { token: explicit, source: 'env-explicit' }
|
|
33
|
+
const whyshu = String(env.WHYSHU_API_KEY || '').trim()
|
|
34
|
+
if (whyshu) return { token: whyshu, source: 'env-whyshu' }
|
|
35
|
+
const fromFile = readTokenFromCredentials(dshHome)
|
|
36
|
+
return fromFile ? { token: fromFile, source: 'credentials' } : { token: '', source: 'none' }
|
|
37
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 脱敏原语(2026-11-03,v0.9.0)
|
|
3
|
+
*
|
|
4
|
+
* 唯一实现点:ERP MCP 适配层(core/mcp/erp-server.mjs)与 dsh 宿主插件(plugins/argent-erp-ui)
|
|
5
|
+
* 都从这里取,⛔ 不许各写一套正则(两份必然漂移)。
|
|
6
|
+
*
|
|
7
|
+
* 当前规则(最小集,可扩):
|
|
8
|
+
* · 手机号 → 保留前3后4,中间 ****
|
|
9
|
+
* · 键名命中 token / downloadUrl / signedUrl ⇒ **丢弃**(只留文件名类字段)
|
|
10
|
+
* · 超长字符串(>400)截断,避免把整页 HTML 塞进模型上下文
|
|
11
|
+
* · `tenantId`(内部 Mongo id)不返回:对用户无意义,且能关联到别处
|
|
12
|
+
*/
|
|
13
|
+
export function maskPhone(value) {
|
|
14
|
+
return String(value || '').replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const DROP_KEYS = /(token|downloadUrl|download_url|signedUrl|signed_url|tenantId)/i
|
|
18
|
+
const PHONE_KEYS = /(phone|mobile)/i
|
|
19
|
+
|
|
20
|
+
export function redactDeep(value, depth = 0) {
|
|
21
|
+
if (depth > 6) return value
|
|
22
|
+
if (Array.isArray(value)) return value.map((v) => redactDeep(v, depth + 1))
|
|
23
|
+
if (value && typeof value === 'object') {
|
|
24
|
+
const out = {}
|
|
25
|
+
for (const [k, v] of Object.entries(value)) {
|
|
26
|
+
if (DROP_KEYS.test(k)) continue
|
|
27
|
+
if (PHONE_KEYS.test(k) && typeof v === 'string') { out[k] = maskPhone(v); continue }
|
|
28
|
+
out[k] = redactDeep(v, depth + 1)
|
|
29
|
+
}
|
|
30
|
+
return out
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === 'string' && value.length > 400) return `${value.slice(0, 400)}…`
|
|
33
|
+
return value
|
|
34
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* billing-upload.mjs —— 计费事件的**上报骨架**(v0.9.0,默认关闭)
|
|
3
|
+
*
|
|
4
|
+
* 为什么要上报:本地台账只在客户机上,服务端要能对账就必须收到**签名批次**;
|
|
5
|
+
* 但上报必须先做到"可断网、可重试、不重复计费",否则宁可不上报(本地台账永远是权威副本)。
|
|
6
|
+
*
|
|
7
|
+
* 规则:
|
|
8
|
+
* · 只有 `signPending()` 签过名的批次才上报(未签名 = 未定稿,不传);
|
|
9
|
+
* · 每个批次附带它覆盖的事件(**只含 action/points/tenant/user/at/seq**,⛔ 无参数/无结果/无真名);
|
|
10
|
+
* · `batchId` 幂等:收到 2xx 才写入 `billing-upload.json`,重复调用不会重传;
|
|
11
|
+
* · 失败(网络/5xx)保留在待传队列,下次继续;4xx 视为**永久失败**,跳过并记入 `failed[]`。
|
|
12
|
+
*
|
|
13
|
+
* 默认关闭:`url` 未配置 ⇒ 只返回 `{ok:false, reason:'not_configured'}`,绝不偷偷发。
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, openSync, closeSync, writeSync, chmodSync } from 'node:fs'
|
|
16
|
+
import { join } from 'node:path'
|
|
17
|
+
|
|
18
|
+
const MAX_BATCHES = 20
|
|
19
|
+
|
|
20
|
+
function dirOf(dataDir) {
|
|
21
|
+
const d = join(dataDir, 'gateway')
|
|
22
|
+
mkdirSync(d, { recursive: true })
|
|
23
|
+
return d
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function readJson(file, fallback) {
|
|
27
|
+
try { return JSON.parse(readFileSync(file, 'utf8')) } catch { return fallback }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function writeJson600(file, obj) {
|
|
31
|
+
const fd = openSync(file, 'w', 0o600)
|
|
32
|
+
writeSync(fd, JSON.stringify(obj, null, 2) + '\n')
|
|
33
|
+
closeSync(fd)
|
|
34
|
+
try { chmodSync(file, 0o600) } catch { /* noop */ }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function readLines(file) {
|
|
38
|
+
if (!existsSync(file)) return []
|
|
39
|
+
return readFileSync(file, 'utf8').split('\n').filter(Boolean).map((l) => { try { return JSON.parse(l) } catch { return null } }).filter(Boolean)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @returns {{ok:boolean, reason?:string, sent:number, skipped:number, failed:number}}
|
|
44
|
+
*/
|
|
45
|
+
export async function uploadPending({ dataDir, url, token = '', fetchImpl = fetch, maxBatches = MAX_BATCHES } = {}) {
|
|
46
|
+
if (!url) return { ok: false, reason: 'not_configured', sent: 0, skipped: 0, failed: 0 }
|
|
47
|
+
const dir = dirOf(dataDir)
|
|
48
|
+
const stateFile = join(dir, 'billing-upload.json')
|
|
49
|
+
const state = readJson(stateFile, { uploadedBatches: [], failed: [] })
|
|
50
|
+
const uploaded = new Set(state.uploadedBatches || [])
|
|
51
|
+
const failedSet = new Set(state.failed || [])
|
|
52
|
+
|
|
53
|
+
const batches = readLines(join(dir, 'events.signed.jsonl'))
|
|
54
|
+
const events = readLines(join(dir, 'events.jsonl'))
|
|
55
|
+
let sent = 0, skipped = 0, failed = 0
|
|
56
|
+
|
|
57
|
+
for (const batch of batches.slice(0, maxBatches)) {
|
|
58
|
+
if (uploaded.has(batch.batchId) || failedSet.has(batch.batchId)) { skipped++; continue }
|
|
59
|
+
const slice = events.filter((e) => e.seq >= batch.fromSeq && e.seq <= batch.toSeq)
|
|
60
|
+
let r
|
|
61
|
+
try {
|
|
62
|
+
r = await fetchImpl(url, {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: { 'content-type': 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}) },
|
|
65
|
+
body: JSON.stringify({ batch, events: slice }),
|
|
66
|
+
})
|
|
67
|
+
} catch {
|
|
68
|
+
failed++; continue // 网络问题:留在队列,下次重试
|
|
69
|
+
}
|
|
70
|
+
if (r.ok) { uploaded.add(batch.batchId); sent++ }
|
|
71
|
+
else if (r.status >= 400 && r.status < 500) { failedSet.add(batch.batchId); failed++ } // 永久失败
|
|
72
|
+
else failed++ // 5xx:下次重试
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
writeJson600(stateFile, { uploadedBatches: [...uploaded], failed: [...failedSet], updatedAt: new Date().toISOString() })
|
|
76
|
+
return { ok: true, sent, skipped, failed, pending: batches.length - uploaded.size - failedSet.size }
|
|
77
|
+
}
|