@jhckevin/dsh-composer-prediction 0.0.0-stage → 0.8.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +21 -0
  3. package/MANIFEST.sha256 +100 -0
  4. package/PROTOCOL-COMPAT.zh-CN.md +63 -0
  5. package/README.md +103 -2
  6. package/README.zh-CN.md +116 -0
  7. package/SOURCE.json +86 -0
  8. package/THIRD_PARTY_NOTICES.md +11 -0
  9. package/assets/icon-source.png +0 -0
  10. package/assets/icon.png +0 -0
  11. package/assets/screenshots/blacklist-en.png +0 -0
  12. package/assets/screenshots/blacklist-zh.png +0 -0
  13. package/assets/screenshots/composer-en.png +0 -0
  14. package/assets/screenshots/composer-zh.png +0 -0
  15. package/assets/screenshots/costs-en.png +0 -0
  16. package/assets/screenshots/costs-zh.png +0 -0
  17. package/assets/screenshots/limits-en.png +0 -0
  18. package/assets/screenshots/limits-zh.png +0 -0
  19. package/assets/screenshots/responsive-costs-1000-en.png +0 -0
  20. package/assets/screenshots/responsive-costs-1000-zh.png +0 -0
  21. package/assets/screenshots/responsive-costs-420-en.png +0 -0
  22. package/assets/screenshots/responsive-costs-420-zh.png +0 -0
  23. package/assets/screenshots/responsive-settings-en.png +0 -0
  24. package/assets/screenshots/responsive-settings-zh.png +0 -0
  25. package/assets/screenshots/settings-en.png +0 -0
  26. package/assets/screenshots/settings-narrow-en.png +0 -0
  27. package/assets/screenshots/settings-narrow-zh.png +0 -0
  28. package/assets/screenshots/settings-zh.png +0 -0
  29. package/assets/screenshots/wrap-1160-bottom.png +0 -0
  30. package/assets/screenshots/wrap-1160-top.png +0 -0
  31. package/assets/screenshots/wrap-540-bottom.png +0 -0
  32. package/assets/screenshots/wrap-540-top.png +0 -0
  33. package/cordis.patch.yml +5 -0
  34. package/docs/README.en.md +104 -0
  35. package/docs/README.zh-CN.md +116 -0
  36. package/examples/profiles/deepseek-flash.json +81 -0
  37. package/examples/profiles/deepseek-v4-pro.json +81 -0
  38. package/examples/profiles/generic-anthropic-messages.json +21 -0
  39. package/examples/profiles/generic-chat-completions.json +21 -0
  40. package/examples/profiles/generic-responses.json +21 -0
  41. package/examples/profiles/responses-custom.json +20 -0
  42. package/instruction_prediction.md +9 -0
  43. package/lib/client.js +751 -0
  44. package/lib/client.js.map +1 -0
  45. package/lib/dsh-native.mjs +9774 -0
  46. package/lib/dsh-native.mjs.map +7 -0
  47. package/lib/schema.mjs +933 -0
  48. package/lib/schema.mjs.map +7 -0
  49. package/lib/tokenizer-runtime.mjs +7 -0
  50. package/licenses/DeepSeek-Harness-LICENSE +21 -0
  51. package/licenses/base64-js-LICENSE +21 -0
  52. package/licenses/cordis-LICENSE +21 -0
  53. package/licenses/cosmokit-LICENSE +21 -0
  54. package/licenses/deepseek-tokenizers-LICENSE +21 -0
  55. package/licenses/eventsource-parser-LICENSE +21 -0
  56. package/licenses/huggingface-tokenizers-LICENSE +201 -0
  57. package/licenses/js-tiktoken-LICENSE +19 -0
  58. package/licenses/schemastery-LICENSE +21 -0
  59. package/licenses/semver-LICENSE +15 -0
  60. package/licenses/zod-LICENSE +21 -0
  61. package/locale/en.json +7 -0
  62. package/locale/zh.json +7 -0
  63. package/package.json +86 -4
  64. package/pricing/deepseek-flash.json +67 -0
  65. package/pricing/deepseek-v4-pro.json +67 -0
  66. package/src/client/blacklist.cjs +18 -0
  67. package/src/client/brand.cjs +2 -0
  68. package/src/client/build.mjs +20 -0
  69. package/src/client/controller.cjs +191 -0
  70. package/src/client/controls.cjs +87 -0
  71. package/src/client/events.cjs +20 -0
  72. package/src/client/guards.cjs +29 -0
  73. package/src/client/host-rpc.mjs +81 -0
  74. package/src/client/index.cjs +149 -0
  75. package/src/client/locales.cjs +122 -0
  76. package/src/client/onboarding.cjs +19 -0
  77. package/src/client/placeholder.cjs +25 -0
  78. package/src/client/policy-fields.cjs +1 -0
  79. package/src/client/settings.cjs +48 -0
  80. package/src/core/balance-watchdog.mjs +33 -0
  81. package/src/core/billing.mjs +285 -0
  82. package/src/core/blacklist.mjs +8 -0
  83. package/src/core/budget.mjs +103 -0
  84. package/src/core/context-events.mjs +18 -0
  85. package/src/core/context-mapping.mjs +96 -0
  86. package/src/core/deepseek-balance.mjs +19 -0
  87. package/src/core/dsh-projection.mjs +23 -0
  88. package/src/core/engine.mjs +210 -0
  89. package/src/core/event-coordinator.mjs +49 -0
  90. package/src/core/lifecycle.mjs +140 -0
  91. package/src/core/loop-watchdog.mjs +18 -0
  92. package/src/core/ownership.mjs +17 -0
  93. package/src/core/policy.mjs +101 -0
  94. package/src/core/profiles.mjs +200 -0
  95. package/src/core/protocol-compat.mjs +36 -0
  96. package/src/core/recovery-selector.mjs +100 -0
  97. package/src/core/recovery.mjs +55 -0
  98. package/src/core/thread-accounting.mjs +79 -0
  99. package/src/core/token-counter.mjs +11 -0
  100. package/src/core/transports.mjs +467 -0
  101. package/src/index.mjs +350 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # 0.8.0-beta.1 — 2026-11-17
2
+
3
+ First public npm preview under @jhckevin/dsh-composer-prediction. Declare a native DSH registry bundle, retain composer-prediction runtime/data identity, refresh bilingual details and installation/update guidance. Native Versions checks, compatibility, progress and rollback remain host-owned. Existing 0.7.5 prediction/cache/accounting behavior is retained.
4
+
5
+ ## 0.7.5-experimental.1\n\nAdd generic Anthropic Messages and Chat Completions, JSON Responses, explicit optional capabilities, honest cache-unknown cost bounds and main-route price binding. Arm balance monitoring only after a real quota rejection; stop after recovery or model success. No paid compatibility probes or silent protocol fallbacks.\n\n# 0.7.4-experimental.1 — 2026-11-14
6
+
7
+ - Event-driven account balance watchdog using the official DeepSeek balance endpoint; no model generation to test funds and no timed polling.
8
+ - Insufficient balance pauses passive prediction only; manual retries bypass that pause. Positive balance revalidates each waiting source before restoring one automatic generation.
9
+ - Deduplicate account queries and logical checkpoints; reject stale responses after newer account outcomes.
10
+ - Separate live account state from historical rejected-attempt accounting.
11
+ - Add a native settings switch and owner-only balance-check action. Keys stay on the host and are never sent to guessed third-party balance endpoints.
12
+ - npm remains paused.
13
+
14
+ # 0.7.3-experimental.1 — 2026-11-14
15
+
16
+ - Batch native model-free tool pruning at logical request/turn boundaries; distinguish parent summary workflows. Native pruning alone does not grant another paid prediction.
17
+ - Require applicable exact prices before prediction dispatch even without a budget limit. Missing provider usage stops retries and further calls in that conversation.
18
+ - Show since-install complete accounting independently from historical price gaps; explain missing-price and missing-usage causes separately.
19
+ - Reconcile proven pre-generation 402 rejections with an immutable original receipt and separate evidence record.
20
+ - Group legacy notifications for display without rewriting original events; cache historical imports until explicitly invalidated.
21
+ - npm remains paused; local preview only.
22
+
23
+ # 0.7.2-experimental.1 — 2026-11-13
24
+
25
+ - Container-based responsive cost cards preserve all amounts and share in narrow conversation panes.
26
+ - Settings adapt to their actual available width, including split-pane desktop layouts.
27
+ - Layout changes do not initiate model requests. npm publication remains paused.
28
+
29
+ # 0.7.1-experimental.1 — 2026-11-13
30
+
31
+ - Native-flow wrapping and native scrollport, preserving full text on acceptance.
32
+ - Respect host command hints and restore owned CSS leases on hide/unmount.
33
+ - Distinguish routine context progress from true prediction invalidation.
34
+ - Queue events only on admission; current phase is read from the coordinator and jobs.
35
+ - Wake idle-state observers without fake activity or timer polling.
36
+ - No new automatic generation for background notices. npm publication remains paused.
37
+
38
+ # Changelog
39
+
40
+ ## 0.7.0-experimental.1 — 2026-11-13
41
+
42
+ - Dedicated settings page, official DSH controls, Chinese and English metadata and documentation.
43
+ - Persistent workspace and conversation blacklists, cancellation and late-result protection.
44
+ - Native placeholder alignment; first-use Tab notice instead of an inline key hint.
45
+ - Chronological events. Existing validation, cache and accounting retained.
46
+ - Local preview only: npm publication paused by the user.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,100 @@
1
+ aea53f66e85a7b6a9a964bfce14175571546ba2832be94d9d20348ec663a0b79 CHANGELOG.md
2
+ ebb4f09972aee8608be255debaf78451a68e95c290f55c240dec2ecfa16ea6be LICENSE
3
+ 9da4d2582e53d09952bb153a8041c020b7460cf8af33c2eced05f57aeaeab90e PROTOCOL-COMPAT.zh-CN.md
4
+ ca61bce893c75b154ffd8fc667945039f035ed04234624d23f3febbaad2ab1f5 README.md
5
+ 24cf6f08fae5357b74dd4053752244cc64ca79c01ec8f501016ba07ea569b6a3 README.zh-CN.md
6
+ 5318b0854b7e32afa1c63ed4e7db5594ec70924ed93f8e17ac7f7db022bb2011 SOURCE.json
7
+ 539c9ce04d26f03170ddad0d797b1149149eb7935934b6f01f8dcfbfb7e87ea4 THIRD_PARTY_NOTICES.md
8
+ 8a118cf6453b9678b4dc20df66931d923008747fdac46ef12bdb7a29b2d1163b assets/icon-source.png
9
+ d4bf21a13ffe3aa7d5740a36212505ad05238c1bc6fdfab88b24888457c392e9 assets/icon.png
10
+ b01938d0ce149cffa2cd69b7b3b141e0af3dc238f118c30a96680f0bf663c878 assets/screenshots/blacklist-en.png
11
+ 82e00aca1d2c58b57b7c18ea8901fc8be2147f448cd7fa4c90f87adda173953c assets/screenshots/blacklist-zh.png
12
+ 795213533c9510cd4d8893d75d1e725fa6462301d7841d99e3ada16ffb9da19b assets/screenshots/composer-en.png
13
+ 2dd8b3bda3d78cf98f6d932e6575fa8b6cb03dbddc496a9f483bad17b11f031a assets/screenshots/composer-zh.png
14
+ 815fd90fbf7e26012a6dfc4af1e451672d041ada61c5fcabd39b4a7c4ab8d0c8 assets/screenshots/costs-en.png
15
+ d0def8c291336f04d3bc35785bfca482631acb5df633479ca8ca2fc23fd32e59 assets/screenshots/costs-zh.png
16
+ 872fce73768dc8dc5260bef835b8b79d72caff25d2cae74d0ea8ed245a59549e assets/screenshots/limits-en.png
17
+ 68ba615bf13d025799e5df59721245c251d9b7f7dfef87c592453dd1d282c98e assets/screenshots/limits-zh.png
18
+ b32fc5a1f8dc40a4e30419f40b8e57361db066e908144dedd6faa99cc978b6da assets/screenshots/responsive-costs-1000-en.png
19
+ a3e7d76d90d879dc5eafcd6103d9942ea15f8cf8014b514e23e7a5aa5252575c assets/screenshots/responsive-costs-1000-zh.png
20
+ b5fbc70b2fcc93ef8716d17e1d518e644de11439f7f524c32f34072f7ad85c46 assets/screenshots/responsive-costs-420-en.png
21
+ b25b33d947731153406f4134c440a78a6053191e9e1542a7f131cda347ad333a assets/screenshots/responsive-costs-420-zh.png
22
+ 945812361ac47173b643e6cef1b24a1fb3246369c3181e226aaf522d01b0c5c2 assets/screenshots/responsive-settings-en.png
23
+ dca2a7f970390108a855c5b05aeb92a8e50987a7fcd5dbb66bd0fdfa852a8c45 assets/screenshots/responsive-settings-zh.png
24
+ 1e926df7d883be60e3430fe01aecebd7a3cf01e476da921e5d605ede20d375a2 assets/screenshots/settings-en.png
25
+ 8dac7330c582495aacc440a4a7ccbe1369568a9e324a32c4080bbf635af7fc74 assets/screenshots/settings-narrow-en.png
26
+ baab48c764bd0e1c93db00c1a10a66c7665a75009bdc366f30e57f8df4427f66 assets/screenshots/settings-narrow-zh.png
27
+ 29a33738adfb53f97976d66794bf23b0c57b3273238e08d78c012ead9ab3a74f assets/screenshots/settings-zh.png
28
+ 52125ddd372f76626565c439a232da5fa816012d84690e710c4ad19d5bb6eac2 assets/screenshots/wrap-1160-bottom.png
29
+ 90d42b57e69552e3342ffda0600d2ac6f955f9f38675e3309bca24881b2e00c4 assets/screenshots/wrap-1160-top.png
30
+ 6f24c57b686d7f884f89f0be79c71dd4c7c6f8bc7e26fa5c22b5bc34edfec61a assets/screenshots/wrap-540-bottom.png
31
+ 65f0f2aec4e8c3baff80ef5325cf0aa493e37434a889c8c24b827dbf9442b86c assets/screenshots/wrap-540-top.png
32
+ d0b27a7a9e861db505e1a7b03d2612cd58c4f3af32b8e66c6dc4bd14418e419d cordis.patch.yml
33
+ ceabec8b8038498ec52583e2c736c69a1c47f3df755225ab773d90b4c7d71d52 docs/README.en.md
34
+ 3030921fc7ee379d065752ad31ad95a3fd718df57ba686f8b8cf11e02b738780 docs/README.zh-CN.md
35
+ 7952c7f60762a06438f4e923a09706e41bb3b3e4a84f55dbe26197a6188f8596 examples/profiles/deepseek-flash.json
36
+ 1ec94fe79a348c5eabe187c4054a5c506639d7fdf26177f1f29531575c07c8bd examples/profiles/deepseek-v4-pro.json
37
+ 03b3344ff72632fd5d894cb7c9d60a29c66dd83b05d44be8a5f657048e0c2d29 examples/profiles/generic-anthropic-messages.json
38
+ 797f84a30869f7646ae51d41225e3dcd517d109f9125c9a258d94b6fa421c7e0 examples/profiles/generic-chat-completions.json
39
+ d0383b36002d035577d4ccb6d8617507268ced3e32e338995595bb57dc626d8f examples/profiles/generic-responses.json
40
+ 6c46ebd45fb215fbba851e55770628593f7d95566dd56d838b23c783b335f8dd examples/profiles/responses-custom.json
41
+ 15d1323eb515dd5f10240e62083fc7333523b74799f6452d708880f2e26f5c07 instruction_prediction.md
42
+ ea9844299ed6d7f12769997e32788e552e1cf4f453c4cfcd6a1f72c2eefd5a76 lib/client.js
43
+ d84b9255410a67df4a430031add39a7433baa2c3137f7848c35b01deec265d6c lib/client.js.map
44
+ c43240a988bb12e7dbf749fa9a53ec37a3060bdbdcc65ebebff248f672db6d07 lib/dsh-native.mjs
45
+ 1ee244c7672499bc3913bf6e9d1c92fe69af895eb52c8ca188b73c13da57da17 lib/dsh-native.mjs.map
46
+ d884840a5871239ce3e105de464c35014de7dcbb8f5793aa213b8588cb74de0d lib/schema.mjs
47
+ 27f2ae8243eae4e473cebb83f00718b3b934851c290f8418331841078b18de19 lib/schema.mjs.map
48
+ 6f3181637842da225049f78d0f9534c2aae98f71a22ef4d924fc604a899c620a lib/tokenizer-runtime.mjs
49
+ ebb4f09972aee8608be255debaf78451a68e95c290f55c240dec2ecfa16ea6be licenses/DeepSeek-Harness-LICENSE
50
+ 5b37224c080cdcc97c871ada971c224e9926370fe74f11b539aa1cf9f3b1aca1 licenses/base64-js-LICENSE
51
+ 034fb52b1d57360ecbae6cb1632a88f86fd7c3d3f5631a5f082710203dda0be7 licenses/cordis-LICENSE
52
+ 034fb52b1d57360ecbae6cb1632a88f86fd7c3d3f5631a5f082710203dda0be7 licenses/cosmokit-LICENSE
53
+ f2c6c602815669d292889e5be8c802f2ed950653b77999b1584e8e6aed25d040 licenses/deepseek-tokenizers-LICENSE
54
+ 835eb611a23301b27115ca1be9f754c876e643ceb7fe63049c6b50609a1cafeb licenses/eventsource-parser-LICENSE
55
+ c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 licenses/huggingface-tokenizers-LICENSE
56
+ 1432b164b5be63a7fe11b89a5b5ca87a26153d0db1d6855cd89ef27c728f433b licenses/js-tiktoken-LICENSE
57
+ 034fb52b1d57360ecbae6cb1632a88f86fd7c3d3f5631a5f082710203dda0be7 licenses/schemastery-LICENSE
58
+ 4ec3d4c66cd87f5c8d8ad911b10f99bf27cb00cdfcff82621956e379186b016b licenses/semver-LICENSE
59
+ 3f1189b28e3866e0d979968d466b78f813f76827cfdca1fbb124cc0a5c8841f8 licenses/zod-LICENSE
60
+ 3ff5c092b06f081efe1afe65e96d052ea7f1d6aa515aafb83fd832bbdac4a0c2 locale/en.json
61
+ e86336a34ea404863d745ec512db7dc3b3540f57e377612b9cf3c239d86a8d74 locale/zh.json
62
+ 2b5c903d50c0a88b7c911f8a214df0059142770e37c6d130210237733f0bdb54 package.json
63
+ a332b0fcfdf49318d8f279d889bc38563ce1101d218de6443e3117f2dcd4b97a pricing/deepseek-flash.json
64
+ 5360068efc903eca97f8c391a0004f10f317d24de59cd48c40f2a86525aabe60 pricing/deepseek-v4-pro.json
65
+ 9552ee74970a65513d706a478a17d7949f0470364640ab94fa574e5b412eba1d src/client/blacklist.cjs
66
+ ea17daf59fb1806f7e12271d3b38b1609b526665fcba2af206a9aa7b9e6af0a7 src/client/brand.cjs
67
+ bc0e77bbe36895ce752913ed0ad39682d92d17d109ff1f502f62dd538d08a66b src/client/build.mjs
68
+ 4f95894b07526f5c6e5169ea67e20548286d3ad41d0374b4f18d9b012517f40e src/client/controller.cjs
69
+ 15c2e515b563d3243df07e7c175ab5f2ab22bbe1217506935b433e5f2629878d src/client/controls.cjs
70
+ 5769feecc5766dbd990c86ac2ccbae9c4075fd355a5021f876f8be265db5f247 src/client/events.cjs
71
+ 9e2e570e0d1c0448d80abbb4a2c4bccedca5a7e058625f279751eac270e3f1bc src/client/guards.cjs
72
+ bf62a0934dea387498cad3c808c352d7a4654f51e15ff30ad56f257cadc845a5 src/client/host-rpc.mjs
73
+ 51b7527a8de5c83a6ca7bab81c9f6428dbcb96f3b28931abd29fd30e59e97a21 src/client/index.cjs
74
+ a0ac17677fc7a5934d17818fd0b62977781bbff32c32a31ed3f169f67488587c src/client/locales.cjs
75
+ 0f9c7c18effbc90741978cc7fe84d941d169bc24cf413ea1e484146866957a60 src/client/onboarding.cjs
76
+ eb3567078dc210283410dbde0a2ddff05c29fb5f44d2aeedf9fc3226c6c93f70 src/client/placeholder.cjs
77
+ 49014821f2d4afb8b7767e0361e46360b885276312bd1820eaa20cf421baf613 src/client/policy-fields.cjs
78
+ 6c00daf080bc73f013f22bdd8838bb79aafcf37528928e7291c87b8e9b5f9809 src/client/settings.cjs
79
+ 84c66848a1d9d908a959105be656230f87e74dd95bde964c0caeb0ea5d0a8e68 src/core/balance-watchdog.mjs
80
+ d838d2846d89b6041b05205d80f7593cb562be28744f20e19b8c8cd8249f7158 src/core/billing.mjs
81
+ e75c4bfb8ebb5d29fc2a8cf5705f323e54e4d20be31b9e7d0cd0a9ed75ab76f5 src/core/blacklist.mjs
82
+ 8505236445caecab736cc4bce85b96f4d212cbf8e75d09073a9d379f9ecd2d7f src/core/budget.mjs
83
+ b781129d86972e218085ee3acdeb9b905272fc13569769d29abc2aed9ec3bc2e src/core/context-events.mjs
84
+ 08fa74d953b514bb725d08e1b83567169de31de1d50ebda27da2e74018467169 src/core/context-mapping.mjs
85
+ cf8201530df87d6d8c30c9196a02b2d8c2439d009087862dc760a4fc1227a0d5 src/core/deepseek-balance.mjs
86
+ 0ac89e51101510ae01420b49fa63956af590b1cf80f29d06fb91faf273526483 src/core/dsh-projection.mjs
87
+ 7b6b25af39d7eb64167aa917e9f6b87a1d0539f5e535eeb123a2ccd0e0e469ee src/core/engine.mjs
88
+ 99a0d72e3736858ada41a71cdb5e56c2fdc1eeb990b67bdbae1eac3f1c1248db src/core/event-coordinator.mjs
89
+ b304803697cc1ff49334c2bd3776fdef1fc42607de3449e84f6637a0980cc272 src/core/lifecycle.mjs
90
+ 1b2210d68df4acefbe118ae9623416e3edc6bf4291b775942f0236fb57d99e10 src/core/loop-watchdog.mjs
91
+ e4fd34fe898aaa85131c8f50f5ece445710133b7bcd8329c2c0751857cef58d8 src/core/ownership.mjs
92
+ c38d16113b55f586165d440cfb0f83c68572dc842f88f747e6d712dad3fe4e70 src/core/policy.mjs
93
+ d21f96331c2764c0117364feba7a67c327c8a26e31514137c68f8040f0c8d99f src/core/profiles.mjs
94
+ 64744e70e85d0a21908dfb76ea8eecbd0237820210fdc372450877ccd7a86e1b src/core/protocol-compat.mjs
95
+ 4b3445a6b6c588246d85571aadfc2e3d043f63c5c964d72b6c78cfcb24ee7672 src/core/recovery-selector.mjs
96
+ 0be849e70e27ae8778b8e86c43520b78824ff7aff2b2c9a4ea166cc75a7b9cf8 src/core/recovery.mjs
97
+ 764edb77856496eae3362af7e888bf364c007e119e3dd1c7b1bbe82b173d7b94 src/core/thread-accounting.mjs
98
+ cf99dbee81740da7af9b3d882df560ca270a8b1510fa6eff875f8e9a5687544e src/core/token-counter.mjs
99
+ 679abf05263bddb82a4bb2296627afc4769a4d105deaa0bed5231dae15780c54 src/core/transports.mjs
100
+ fb349e7ab6072a54d1faa735b2170c9d2c1b1eec4568fa78a3bd5db93fa31974 src/index.mjs
@@ -0,0 +1,63 @@
1
+ # 第三方协议兼容与计费说明(0.7.5)
2
+ 本版不需要先填写服务商名单。接入按协议及显式能力配置,模型名称不是服务商身份,也不是价格凭据。
3
+
4
+ ## 接入
5
+ 将 examples/profiles 中对应 JSON 模板复制到插件数据目录的 profiles,替换 Base URL、model、accountId 和 credential 引用,再在设置选择配置文件。所有价格必须填写服务商自己的价表;模板不包含价格,选择后不会自动发出未定价预测。复制 templates 不执行登录、不创建 API 密钥。
6
+
7
+ - chat-completions:POST {baseURL}/chat/completions,Bearer 默认鉴权,JSON 非流式最终 usage。
8
+ - anthropic-messages:POST {baseURL}/messages,x-api-key 默认鉴权,anthropic-version 默认 2023-06-01,可用 request.anthropicVersion 覆盖。Base URL 应含实际 API 前缀(例如 /v1)。
9
+ - responses:POST {baseURL}/responses,Bearer 默认鉴权,支持 responseMode=json 或 sse。新模板用 JSON;既有配置默认 SSE。完整 endpoint 也可以作为 Base URL,不重复追加后缀。
10
+ - deepseek-messages:保留原 DSH 官方适配器、投影、精确父请求前缀路径,不改成通用翻译。
11
+ - codex-native:仍需真实原生 bridge;通用 Responses 不冒充 Codex 的内部实现。
12
+
13
+ 每次 transport 只发一个物理请求,不暗中探测、删字段重发、换协议、换账户或调用收费模型测余额。网络重试仍受插件设置、费用核对和上限控制;每次物理请求独立入账。应用状态切换不改变既有复用规则。
14
+
15
+ ## 可选能力
16
+ capabilities 允许:
17
+ - responseMode: json / sse(Chat、Messages 当前仅 JSON;预测不需要逐 token 展示,最终回复便于获取 usage)
18
+ - auth: bearer / x-api-key
19
+ - reasoning、temperature、tools: 布尔
20
+ - cacheKey、cacheRetention、storage、background: 布尔(Responses 的可选字段)
21
+ - usage: native / totals-only
22
+
23
+ 通用路由默认不继承父模型的推理配置,不添加服务端会话 ID、上次 response_id、厂商缓存提示。OpenAI 官方 origin 会启用它自己的缓存 key/retention 及 store=false、background=false 字段;第三方需要声明能力。原生 Responses wire 快照已有的缓存字段原样保留,store/background 被强制关闭;持久 conversation 写入始终禁止。声明 storage=false 表示不发送该字段,不能保证第三方服务端不留存数据。
24
+
25
+ Chat 的 request.maxTokenField 可选 max_tokens(默认)或 max_completion_tokens;统一用 request.maxTokens 设值。Messages 的 thinking 必须显式启用 reasoning 并配置 request.thinking。未知能力字段、非法鉴权、密钥内嵌均在读取配置时拒绝。鉴权只解析当前配置的 credential.env / secretRef,不复用其他端点凭证;不跟随 HTTP 重定向。设置“重新加载配置”会刷新价格绑定与配置作用域。
26
+
27
+ ## 上下文与缓存
28
+ - 保留父快照的当前上下文;翻译后的历史、工具定义和顺序确定,预测指令只追加尾部。
29
+ - strict 默认:不支持的 opaque replay、推理内容、图片/附件引用、动态工具更新等本地拒绝,不假装已经无损迁移。
30
+ - portable-text 是显式跨后端迁移:剔除不可迁移的推理/重放元数据与动态更新块,保留可见文本及完整工具调用/结果配对,并记录 removed 元数据。不会静默丢弃图片附件;仍需可投影的原生路径。Messages 不能原生表达的中途 developer/system 指令,会明确编码为历史文本,记录语义降级;不宣称原生同等优先级。
31
+ - 不完整工具配对、强制工具执行、不支持的关键字段在本地停止。不会为通过请求而随意删除上下文。
32
+ - Responses cacheKey 开启时沿用父 affinity,否则使用稳定父 sessionId,长 ID 确定性 hash;不创建随机子 key。自定义 sessionHeader 可显式绑定路由。
33
+ - Messages 可配置 cache.control={type:"ephemeral",ttl:"5m"}(或1h):标记稳定 system 尾部及原始历史尾部,不标记变化的预测指令。启用前须配置 cacheWrite 单价;单一写入费率须与实际 TTL 一致,不支持混用 TTL 的分档精算。
34
+ - Chat 依赖提供商自身前缀缓存;不把 OpenAI/DeepSeek 专属提示强行发给所有第三方。
35
+ - 能否跨主请求命中,只能由同账号/端点、真实 wire 前缀及服务端 usage 证明;跨协议翻译不保证缓存相同。已有的 50% 缓存保留门仍生效,无法证明命中不等于制造命中。
36
+
37
+ ## 计费与主请求绑定
38
+ pricing.versions 填真实生效日期、币种和每百万 token 单价 input / cacheRead / output,Messages 写缓存另填 cacheWrite。峰谷可以使用已有 weekly schedule 与明确时区;DeepSeek 官方峰谷规则不套给第三方。每个请求保存开始时的报价版本。
39
+
40
+ 1. 有完整 cache 明细:按实际分项计费,推理 token 属于输出,不重复叠加。
41
+ 2. 只有完整输入/输出总量:缓存字段保留 null,显示保守费用上界(输入总量乘适用输入类最高单价,再加输出),以及可计算的范围;不是精确账单。预测可显示和复用,不为补明细重发。缓存命中率显示未知。
42
+ 3. Messages 原生 input_tokens 只表示未读写缓存的输入;不能把它无条件当总量。若服务商明确把该字段定义为完整输入,可以显式选 usage=totals-only;否则缺少缓存分项时不伪造完整计费。
43
+ 4. 连总 usage 都缺失/不一致,或网络断开导致结果不明:留待核对记录,停止自动重复调用。无法保证这种故障下取得服务端账单,不能把它记成免费。
44
+ 5. HTTP 明确4xx前置拒绝(不含408),无生成及 usage 证据时单独记录为拒绝且未计费;若错误响应包含 usage,照样保留计费,不能覆盖为0。2xx后流式失败不算前置免费拒绝。
45
+ 6. 第三方主请求使用配置的 mainRoute={provider:"DSH中的实际provider标识",model:"主模型名"} 显式绑定同一配置的 pricing。可增加 baseURL 作为精确匹配条件。匹配多个价表时拒绝选价,不猜其中之一。通过官方适配器接到第三方时必须附明确第三方 baseURL,不能覆盖官方 origin 价表。缺乏可确认路由身份或历史价表的请求继续标为未知。
46
+ 7. 占比=prediction/(main+prediction),相同线程/币种/覆盖区间。金额有上界时使用≤及占比范围,不显示虚假精确百分比。旧历史缺价与安装后完整统计继续区分;不改写旧原始收据。
47
+
48
+ ## 余额 watchdog
49
+ 仅真实主线程或 Prediction 的 QUOTA/insufficient_quota/明确余额不足响应才挂起自动预测并启动监测。普通429限流、401鉴权、400上下文错误不会误启动。
50
+ - 监测按逻辑事件、返回应用触发,同账户合并在途查询;不按秒轮询。
51
+ - 手动“检查余额”只是一次读;查到零不能自行启动监测。
52
+ - 查到可用余额,或同路由一次真实正常模型请求成功,立即停止监测;再次明确额度拒绝才重新启动。
53
+ - 只有官方 DeepSeek origin 调用已知 /user/balance。第三方无标准余额 API,不猜 endpoint,不向未知域名送密钥,不调用收费模型探余额。处于挂起状态时允许用户主动重试,真实请求成功后恢复。
54
+ - 手动请求绕过的是余额暂停;价格缺失、旧请求费用待核对、上下文过期等独立校验仍保留。
55
+ - 自动恢复前重新核对线程、配置、轮次、用户发送 epoch、输入框草稿和源映射,只补一次有效预测,不能把旧气泡恢复到新一轮。
56
+
57
+ ## 验证范围
58
+ 本版在远程 Linux 上使用受控 HTTP 响应验证三个协议、错误分类、最终 usage、缓存作用域、费用范围及恢复逻辑。不是对所有第三方服务商实测。没有提供第三方端点和凭据,不伪称真实供应商兼容认证;未为兼容性主动发送收费探测。
59
+ 官方参数资料:
60
+ - https://developers.openai.com/api/reference/resources/chat
61
+ - https://developers.openai.com/api/reference/resources/responses/methods/create
62
+ - https://platform.claude.com/docs/en/api/messages
63
+ - https://platform.claude.com/docs/en/build-with-claude/prompt-caching
package/README.md CHANGED
@@ -1,3 +1,104 @@
1
- # Temporary Holding Version
1
+ # Composer Prediction
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Leave the next step in the composer. Keep the decision with you.**
4
+
5
+ An unofficial DeepSeek Harness plugin that suggests the user's next message after a normal assistant completion. Press **Tab** to accept an editable draft, then decide whether to send it.
6
+
7
+ **Version: 0.8.0-beta.1 · public npm preview**
8
+ **Package: @jhckevin/dsh-composer-prediction**
9
+
10
+ ![Composer preview](https://unpkg.com/@jhckevin/dsh-composer-prediction@0.8.0-beta.1/assets/screenshots/composer-en.png)
11
+
12
+ *Feature images show actual plugin components with demonstration data, not private conversations or live bills.*
13
+
14
+ ## Install and native updates
15
+
16
+ Install this package from the DSH plugin page:
17
+
18
+ ~~~text
19
+ @jhckevin/dsh-composer-prediction
20
+ ~~~
21
+
22
+ Or use the official CLI:
23
+
24
+ ~~~sh
25
+ dsh plugin --profile desktop add @jhckevin/dsh-composer-prediction@latest
26
+ ~~~
27
+
28
+ Use the npm registry package under its own name. A local link:, directory path or npm: alias cannot participate in the same native registry update workflow.
29
+
30
+ The plugin details page uses **DSH's own Versions section**:
31
+
32
+ - Recheck queries the registry and displays the real result.
33
+ - New releases show the candidate version, publication date, count and expandable version list.
34
+ - Entries identify dist-tags, prereleases, deprecations and DSH compatibility.
35
+ - Updating uses the host's progress and recovery workflow. The host attempts to restore the prior installation after a failed replacement.
36
+ - Reload or restart when the host requests it. No silent overwrite of running code or custom background update poller.
37
+ - A first release or current installation honestly shows “Up to date”; no fabricated update count.
38
+ - Registry and mirror failures remain visible. Retry or choose the official npm registry when appropriate.
39
+
40
+ This is native automatic discovery/notification with user-controlled installation, **not unattended automatic installation**. Detail-entry checks, cache and reload timing are owned by DSH.
41
+
42
+ The preview is available through latest while retaining its prerelease version label. Future releases must use this same package name and maintain the release dist-tag.
43
+
44
+ ## Migrate a local preview
45
+
46
+ The old @local/dsh-composer-prediction package is a local placeholder. Remove its installation reference and install the npm package above; do not load both together.
47
+
48
+ The runtime component ID stays composer-prediction and its default data directory remains:
49
+
50
+ ~~~text
51
+ ~/.dsh/plugins-data/composer-prediction
52
+ ~~~
53
+
54
+ Back up the DSH profile and plugin data first. Preserve settings, workspace/thread exclusions, profiles, instruction_prediction.md, SQLite accounting, stored predictions and diagnostics. Do not delete or upload this private directory.
55
+
56
+ ## Lifecycle and controls
57
+
58
+ One eligible prediction follows a normally completed user/assistant loop. Errors, interruptions, cancellation and incomplete replies do not qualify. Typing, IME, attachments and other incompatible composer states hide the suggestion. Source, thread and draft revision are checked again before acceptance.
59
+
60
+ Predictions never send themselves, execute tools or become conversation history. Insufficient evidence can return false. Results are stored per thread; view changes must not buy the same source again. Stored results have no age-based TTL, but source validity still governs display and acceptance.
61
+
62
+ New chats are enabled by default. Optional catch-up uses the last **user send**, a default 24-hour window and at most the latest three chats; both are adjustable. Workspace/thread exclusions take precedence.
63
+
64
+ ## Cache reuse and accounting
65
+
66
+ The official DeepSeek parent path preserves effective context, tools, conditioning and affinity, appending prediction instructions at the tail. Existing parent compaction is inherited. Context windows and repair alternatives compare costs using available evidence; no fixed cache-hit or savings guarantee is made.
67
+
68
+ Mapping checks follow sends, normal completion, turn/token growth and structural events, not second-based polling. Estimated retained prefix below 50% after an external edit pauses that chat.
69
+
70
+ **Prediction share = Prediction / (main + Prediction).**
71
+
72
+ ![Responsive accounting preview](https://unpkg.com/@jhckevin/dsh-composer-prediction@0.8.0-beta.1/assets/screenshots/responsive-costs-420-en.png)
73
+
74
+ Open the horizontal Prediction costs tab. Amounts use the same thread, currency and coverage interval, including every retry and repair attempt. Quotes are captured at request start; configured time-zone-aware peak/off-peak schedules apply. Third-party endpoints require their own prices.
75
+
76
+ Complete usage is priced by its components without charging reasoning twice. Missing cache details remain unknown and can produce conservative cost bounds and share ranges when total usage is known. Missing final usage/prices stays unresolved, never zero, and stops automatic repeated charges. Historical gaps are distinguished from complete since-install coverage. Estimates are not provider invoices.
77
+
78
+ ## Settings
79
+
80
+ Open **Settings → Composer Prediction** for behavior, backend profiles, context budget, prefix threshold, length preference, default 999-token visible-text limit, language checks, truncation, retries, catch-up, exclusions, user instructions and accounting.
81
+
82
+ ![Settings preview](https://unpkg.com/@jhckevin/dsh-composer-prediction@0.8.0-beta.1/assets/screenshots/settings-en.png)
83
+
84
+ Controls reuse native DSH primitives. UI text and details follow the active English/Chinese host locale. Prediction language is configured independently.
85
+
86
+ ## Protocols and balance recovery
87
+
88
+ Supports the parent adapter, native DeepSeek Messages, generic Anthropic Messages, OpenAI Chat Completions and Responses. JSON profiles declare credentials by reference and optional capabilities.
89
+
90
+ Third parties may omit cache details, reasoning, server sessions, tools or balance APIs. No hidden protocol switching or paid compatibility probes. Strict history conversion refuses unsupported content; explicit portable-text migration records degradation.
91
+
92
+ Balance monitoring arms only after a real main/prediction request explicitly reports insufficient quota. Rate limits/authentication failures do not arm it. A positive balance query or a normal successful model request on that route stops monitoring. Only verified official DeepSeek endpoints use its known balance API. Unsupported third parties recover through active successful requests, without paid model probes. A manual zero-balance lookup does not arm monitoring. Manual retries bypass the balance pause, but not independent billing/source guards.
93
+
94
+ Templates are in examples/profiles/generic-*.json; add a real pricebook before automatic dispatch. See PROTOCOL-COMPAT.zh-CN.md for precise usage semantics, capabilities and main-route price binding.
95
+
96
+ ## Privacy, attribution and verification
97
+
98
+ The chosen provider receives effective context and prediction instructions. Results, usage, costs and diagnostic contexts are saved locally. Public package contents exclude private chats, account settings, credentials and temporary control scripts.
99
+
100
+ This is not an official DeepSeek/OpenAI product. Generic Responses is not Codex's private prediction service and cannot promise identical server prompts, ephemeral-thread behavior or internal caching.
101
+
102
+ Built and tested remotely. Synthetic HTTP tests and browser component images do not certify all vendors or replace native desktop acceptance. Release records distinguish static checks, controlled tests, public registry checks and native UI verification.
103
+
104
+ See SOURCE.json, THIRD_PARTY_NOTICES.md, licenses and LICENSE. Maintainer: npm account jhckevin. Release history: CHANGELOG.md.
@@ -0,0 +1,116 @@
1
+ # 下一条消息预测
2
+
3
+ **把下一步留在输入框,把决定权留给你。**
4
+
5
+ Composer Prediction 是 DeepSeek Harness 的非官方插件。助手正常完成回复后,它预测用户可能发送的下一条消息,显示在空输入框内;按 **Tab** 接受为可编辑草稿,由你决定是否发送。
6
+
7
+ **版本:0.8.0-beta.1 · npm 公开预览版**
8
+ **包名:@jhckevin/dsh-composer-prediction**
9
+
10
+ ![输入框预测示意](./assets/screenshots/composer-zh.png)
11
+
12
+ *以上及下方功能展示图使用真实插件组件与演示数据,不是用户真实聊天或账单。*
13
+
14
+ ## 安装与原生更新
15
+
16
+ 在 DSH 的“插件 → 安装插件”中输入:
17
+
18
+ ~~~text
19
+ @jhckevin/dsh-composer-prediction
20
+ ~~~
21
+
22
+ 或使用官方 CLI:
23
+
24
+ ~~~sh
25
+ dsh plugin --profile desktop add @jhckevin/dsh-composer-prediction@latest
26
+ ~~~
27
+
28
+ 请从 npm 安装,不要继续使用 link: 本地目录、文件路径或 npm: 别名;DSH 只有识别到同名 registry 安装来源,才会启用本插件详情页的原生版本体系。
29
+
30
+ 详情页的 **版本** 区域由 DSH 自带组件显示:
31
+
32
+ - “重新检查”查询 registry,显示真实的检查结果。
33
+ - 有新版本时,显示“可更新到…”,附发布日期、新版本数量及可展开列表。
34
+ - 列表标记 latest、预发布、弃用和 DSH 版本要求;不兼容的版本不会作为正常可安装更新。
35
+ - 点击更新使用 DSH 的原生更新流程及进度;失败时由宿主尝试恢复先前安装。
36
+ - 成功后按宿主提示重新加载或重启。插件不会静默覆盖正在运行的代码,也不自建后台轮询更新器。
37
+ - 首次公开发布或已经最新时显示“已是最新版本”,不会虚构更新数量。
38
+ - 网络或镜像同步失败会显示原因;稍后重新检查,必要时选择 npm 官方源。
39
+
40
+ 这是“自动检查/提示 + 用户决定安装”的原生更新体验。**不是无提示自动安装。** 初次打开详情页是否触发查询、查询缓存和重载时机由 DSH 宿主管理。
41
+
42
+ 当前预览版本使用 npm 的 latest 安装入口;预发布标识仍保留。未来版本仍发布到同一包名,维护者更新 latest 标签,DSH 才能沿用现有安装来源检查升级。
43
+
44
+ ## 从本地预览版迁移
45
+
46
+ 旧包 @local/dsh-composer-prediction 不是线上包名。迁移需要卸载旧包的安装引用,再安装上面的 npm 包;不要同时加载两个版本。
47
+
48
+ 插件运行组件 ID 仍是 composer-prediction,默认数据目录不变:
49
+
50
+ ~~~text
51
+ ~/.dsh/plugins-data/composer-prediction
52
+ ~~~
53
+
54
+ 迁移前备份 DSH profile 配置和该数据目录。保留 settings.json、黑名单与线程状态、profiles、instruction_prediction.md、费用 SQLite、既有预测和诊断记录。不要删除数据目录,不要把它上传到 npm。工作区/线程屏蔽、已有价格覆盖范围及计费口径沿用原记录。
55
+
56
+ ## 日常行为与生命周期
57
+
58
+ 助手正常结束后,每个有效用户轮次生成一次;报错、中断、取消和未正常完成的回复不触发。输入、IME、附件及菜单等不适合显示时隐藏;接受前再次检查线程、来源和草稿版本。
59
+
60
+ 预测不会自动发送、执行工具或进入真实历史。依据不足时返回 false,不显示建议。结果按线程保存;切换视图不应重新购买同一来源的预测。已保存结果没有按天过期的 TTL,但显示和接受仍需校验当前来源。
61
+
62
+ 新线程默认开启。为已有线程补齐时,默认只选最后一次用户发送在 24 小时内、最新最多 3 个线程;可调整或关闭。工作区与线程可加入黑名单,黑名单优先于默认开关。
63
+
64
+ ## 缓存、上下文与费用
65
+
66
+ 缓存复用和总费用是优先目标。官方 DeepSeek 父请求路径保留有效模型上下文、工具、配置和会话亲和;预测指令追加在尾部。父线程已有压缩时沿用其有效快照。局部窗口选择、冻结摘要和草稿修复按可用证据比较成本,不能保证固定命中率或节省比例。
67
+
68
+ 映射校验由用户发送、正常结束、轮次/token 增量及结构事件驱动,不按秒轮询。外部修改导致保留旧前缀估计低于 50% 时暂停该线程预测。原始旧记录不被摘要或展示分组合并覆盖。
69
+
70
+ **Prediction 占比 = Prediction /(主会话 + Prediction)**
71
+
72
+ ![线程费用示意](./assets/screenshots/responsive-costs-420-zh.png)
73
+
74
+ 费用在会话上方的“预测费用”横向页签查看,按线程、币种与覆盖区间计算,包含自动、主动重试和修复的全部物理尝试。请求开始时冻结价表,支持有明确时区与规则的峰谷计划;第三方使用自己的报价,不能套用 DeepSeek 官方单价。
75
+
76
+ - 完整 usage:分项估算,推理 token 不重复计费。
77
+ - 缓存明细缺失、总量已知:缓存保持未知,可显示保守费用上界和占比范围。
78
+ - 最终总用量或价格缺失:保留待核对记录,不记成零,不自动连续重发。
79
+ - 历史资料不完整:不显示虚假完整百分比,另列安装后完整覆盖区间。
80
+ - 本地估算不是服务商最终账单。
81
+
82
+ ## 设置与本地限制
83
+
84
+ 打开 **设置 → 下一条消息预测**,可配置:
85
+
86
+ - 总开关、新线程默认开启、事件驱动检查。
87
+ - 父请求后端或独立后端配置文件、上下文预算、缓存前缀门槛。
88
+ - 建议长短、默认 999 tokens 可见文本硬上限、语言一致性、本地截断。
89
+ - 自动重试和修复策略;关闭后使用手动重试。
90
+ - 已有线程补齐窗口与数量、工作区及线程黑名单。
91
+ - instruction_prediction.md 个人约束;优先级低于内置强制规则。
92
+ - 用量、费用和诊断状态。
93
+
94
+ ![设置页示意](./assets/screenshots/settings-zh.png)
95
+
96
+ 控件复用 DSH 原生样式;标题、设置和详情随宿主 UI 语言提供中文/英文。预测语言另行按对话或显式设置决定。
97
+
98
+ ## 第三方接入与余额恢复
99
+
100
+ 支持父请求、DeepSeek 原生 Messages、通用 Anthropic Messages、OpenAI Chat Completions 和 Responses。后端由 profiles 中的 JSON 文件切换;密钥只保存引用,不写入公开包或前端。
101
+
102
+ 第三方未必支持缓存字段、推理参数、服务端会话、工具及余额接口。可选字段按声明能力处理,不隐式换协议、删上下文后重发。严格模式拒绝不能无损表达的历史;显式 portable-text 模式记录迁移降级。未知缓存与余额不能伪造为零。
103
+
104
+ 只有真实主请求/Prediction 明确报额度不足才启动余额 watchdog。普通限流和鉴权失败不算。查询确认恢复或同路由真实模型请求正常成功即停止。官方余额接口只向已确认的 DeepSeek 官方端点发送;第三方没有接口时,不用收费模型探测,主动请求成功可以恢复。手动查零不启动监测,手动重试绕过余额暂停,但不绕过价格、费用待核对和过期上下文校验。
105
+
106
+ 配置模板见 examples/profiles/generic-*.json;无价格模板不会自动发出未定价预测。详见包内 PROTOCOL-COMPAT.zh-CN.md。
107
+
108
+ ## 隐私、来源和验证边界
109
+
110
+ 选用的后端会收到有效上下文和预测指令。本地保存预测、usage、费用及诊断上下文;请按对话隐私选择服务商。本 npm 包不包含用户聊天、账户设置、凭据或临时远程控制脚本。
111
+
112
+ 这是非官方扩展,不代表 DeepSeek 或 OpenAI。通用 Responses 不等于 Codex 私有预测服务,不能承诺其服务器提示词、内部子线程和缓存架构完全相同。
113
+
114
+ 本版在远程服务器构建并通过自动回归和包内容检查;测试中的合成 HTTP 响应及浏览器组件图不能冒充所有服务商实测或完整原生桌面验收。发布验证记录区分静态、受控测试、registry 实测与本机 UI。
115
+
116
+ 源码与版权归属见 SOURCE.json、THIRD_PARTY_NOTICES.md、licenses 和 LICENSE。维护者:npm 账号 jhckevin。版本记录见 CHANGELOG.md。
package/SOURCE.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "dshCommit": "e8f7b93a344964de3dca1ace9e72b6e4d6de87cb",
3
+ "runtimeDependencies": "node>=24.9; DSH browser module table",
4
+ "publicSourceArchiveSHA256": "96bbd0ac8201c9a74a1641efe53fcb20c69d11e9ef8525ef01e1fede662d0c20",
5
+ "tokenizers": {
6
+ "deepseek-v4.json": "97d2f31b020d18b5aee5c9b3d5b4efb10ea210f3fe3f7dffe3f1cd90542d6b19",
7
+ "deepseek-v41.json": "81f64d1248a68ce3663e07ab3ee48b851e5df0e32d27cb98e4c9a268151e8d99"
8
+ },
9
+ "tokenizerSource": "deepseek-ai/deepseek-recipe/static/tokenizers/{v4,v41}; SHA matches source README provenance",
10
+ "tokenizerRuntime": "pure JS/TS, bundled, no runtime network/download/native build",
11
+ "tokenizerPlainPipelinesEqual": true,
12
+ "licenseSources": {
13
+ "js-tiktoken": "https://raw.githubusercontent.com/dqbd/tiktoken/main/LICENSE"
14
+ },
15
+ "version": "0.8.0-beta.1",
16
+ "codexReferenceCommit": "d2f76324729d7c4a2b3225cfe42c7dbf162d98b7",
17
+ "codexRemotePromptIncluded": false,
18
+ "builtOn": "remote desktop-research-wsl2; no local development or compilation",
19
+ "remoteNodeVersion": "24.22.2",
20
+ "artifacts": {
21
+ "lib/dsh-native.mjs.map": "1ee244c7672499bc3913bf6e9d1c92fe69af895eb52c8ca188b73c13da57da17",
22
+ "lib/client.js": "ea9844299ed6d7f12769997e32788e552e1cf4f453c4cfcd6a1f72c2eefd5a76",
23
+ "lib/tokenizer-runtime.mjs": "6f3181637842da225049f78d0f9534c2aae98f71a22ef4d924fc604a899c620a",
24
+ "lib/dsh-native.mjs": "c43240a988bb12e7dbf749fa9a53ec37a3060bdbdcc65ebebff248f672db6d07",
25
+ "lib/schema.mjs.map": "27f2ae8243eae4e473cebb83f00718b3b934851c290f8418331841078b18de19",
26
+ "lib/client.js.map": "d84b9255410a67df4a430031add39a7433baa2c3137f7848c35b01deec265d6c",
27
+ "lib/schema.mjs": "d884840a5871239ce3e105de464c35014de7dcbb8f5793aa213b8588cb74de0d"
28
+ },
29
+ "verification": {
30
+ "remoteTests": 274,
31
+ "passed": 274,
32
+ "failed": 0,
33
+ "desktopTarget": "0.2.2-rc.1",
34
+ "browserComponents": "actual React and pinned official DSH primitives; demo data",
35
+ "screenshots": 16,
36
+ "browserGeometryVerified": true,
37
+ "fullNativeDesktopAcceptance": "not claimed; fixed 64-item acceptance denominator unchanged",
38
+ "npmPublication": "prepared public npm preview; registry verification recorded separately",
39
+ "modelNetworkInRegressionTests": "mocked",
40
+ "nativeFlowBrowserWidths": [
41
+ 1160,
42
+ 540
43
+ ],
44
+ "versionAlgorithms": 5,
45
+ "browserResponsiveChecks": 20
46
+ },
47
+ "lifecycle": {
48
+ "generation": "user-submit then normal assistant completion",
49
+ "watchdog": "logical send, turn, token and structural event budgets; no timer polling",
50
+ "retroactiveHours": 24,
51
+ "retroactiveLimit": 3,
52
+ "persistedResultAgeLimit": null,
53
+ "persistedResultGlobalEntryLimit": null,
54
+ "minRetainedPrefixRatio": 0.5,
55
+ "foregroundAffects": "display only"
56
+ },
57
+ "parity": {
58
+ "parentEffectiveCompaction": "inherited",
59
+ "portableWindowStrategies": "local enhancement, not native Codex behavior",
60
+ "proprietaryServerControls": "not available in portable APIs"
61
+ },
62
+ "ui": {
63
+ "settingsSlot": "settings.section",
64
+ "localeService": "locale.bind + locale.subscribe",
65
+ "locales": [
66
+ "zh",
67
+ "en"
68
+ ],
69
+ "nativeControls": [
70
+ "Switch",
71
+ "Button",
72
+ "Input",
73
+ "Checkbox"
74
+ ],
75
+ "predictionRendering": "native editor text flow via leased ghost-hint CSS property; no preview text in draft DOM"
76
+ },
77
+ "release": {
78
+ "package": "@jhckevin/dsh-composer-prediction",
79
+ "channel": "latest",
80
+ "prerelease": true,
81
+ "updateOwner": "DSH native plugin manager",
82
+ "runtimeComponent": "composer-prediction",
83
+ "previousLocalPackage": "@local/dsh-composer-prediction",
84
+ "dataDirectoryUnchanged": true
85
+ }
86
+ }
@@ -0,0 +1,11 @@
1
+ # Third-party code
2
+ The self-contained native request adapter, input projections, and schema library are compiled from DeepSeek Harness, MIT license, commit e8f7b93a344964de3dca1ace9e72b6e4d6de87cb.
3
+ Source: https://github.com/deepseek-ai/deepseek-harness
4
+ The copied original project license is LICENSE. Bundles retain source maps and applicable license notices.
5
+ Includes @deepseek-ai/cordis, cosmokit, schemastery and Zod through the referenced original source dependency graph.
6
+ Zod is MIT, Copyright (c) 2020 Colin McDonnell. See retained bundle legal comments.
7
+ React is supplied by the DSH browser module table; not included in the distributed client bundle.
8
+ No proprietary Codex client bytes or authenticated remote prompt were included.
9
+
10
+ 0.2 adds Tokenizers.js (Apache-2.0), js-tiktoken and base64-js (MIT), and DeepSeek tokenizer data (MIT, Copyright 2023 DeepSeek). License texts are in licenses/.
11
+ The matching V4/V4.1 plain-text tokenizer pipelines were compared equal after removing AddedTokens and post-processing; production uses one shared plain pipeline.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file