@eddyskywalker/dsh-chatgpt-subscription 0.99.1 → 1.0.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 (179) hide show
  1. package/README.md +2 -1
  2. package/lib/client.js +1565 -581
  3. package/lib/client.js.map +1 -1
  4. package/lib/codemode.js +107 -3
  5. package/lib/index.js +3409 -932
  6. package/lib/{preset-sync-CF9xlG1l.js → preset-sync-DWOAwSyl.js} +5 -4
  7. package/lib/reverse-board.js +1726 -0
  8. package/lib/{tool-result-pruner-Ds--y6hJ.js → tool-result-pruner-ClgRVOph.js} +4 -3
  9. package/lib/tool-result-pruner.js +1 -1
  10. package/lib/types/client/common/ModelChecklist.d.ts +3 -3
  11. package/lib/types/client/common/ModelChecklist.d.ts.map +1 -1
  12. package/lib/types/client/common/format.d.ts +10 -0
  13. package/lib/types/client/common/format.d.ts.map +1 -1
  14. package/lib/types/client/features/progress-updates/locales.d.ts +11 -5
  15. package/lib/types/client/features/progress-updates/locales.d.ts.map +1 -1
  16. package/lib/types/client/features/progress-updates/settings-binding.d.ts +3 -1
  17. package/lib/types/client/features/progress-updates/settings-binding.d.ts.map +1 -1
  18. package/lib/types/client/features/progress-updates/settings-section.d.ts +2 -0
  19. package/lib/types/client/features/progress-updates/settings-section.d.ts.map +1 -1
  20. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  21. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  22. package/lib/types/client/hub/providers.d.ts.map +1 -1
  23. package/lib/types/client/index.d.ts +2 -0
  24. package/lib/types/client/index.d.ts.map +1 -1
  25. package/lib/types/client/locales-ru/claude-api.d.ts.map +1 -1
  26. package/lib/types/client/locales-ru/claude.d.ts.map +1 -1
  27. package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
  28. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  29. package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
  30. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  31. package/lib/types/client/locales-ru/sub2api.d.ts +3 -0
  32. package/lib/types/client/locales-ru/sub2api.d.ts.map +1 -0
  33. package/lib/types/client/providers/claude/ClaudeSection.d.ts.map +1 -1
  34. package/lib/types/client/providers/claude/locales.d.ts +8 -2
  35. package/lib/types/client/providers/claude/locales.d.ts.map +1 -1
  36. package/lib/types/client/providers/claude/useClaudeSection.d.ts +1 -0
  37. package/lib/types/client/providers/claude/useClaudeSection.d.ts.map +1 -1
  38. package/lib/types/client/providers/claude-api/ClaudeApiSection.d.ts.map +1 -1
  39. package/lib/types/client/providers/claude-api/locales.d.ts +5 -1
  40. package/lib/types/client/providers/claude-api/locales.d.ts.map +1 -1
  41. package/lib/types/client/providers/claude-api/useClaudeApiSection.d.ts +1 -0
  42. package/lib/types/client/providers/claude-api/useClaudeApiSection.d.ts.map +1 -1
  43. package/lib/types/client/providers/codex-chatgpt/CodexSubscriptionSection.d.ts.map +1 -1
  44. package/lib/types/client/providers/codex-chatgpt/locales.d.ts +5 -3
  45. package/lib/types/client/providers/codex-chatgpt/locales.d.ts.map +1 -1
  46. package/lib/types/client/providers/codex-chatgpt/styles.d.ts.map +1 -1
  47. package/lib/types/client/providers/command-code/CommandCodeSection.d.ts.map +1 -1
  48. package/lib/types/client/providers/command-code/locales.d.ts +2 -2
  49. package/lib/types/client/providers/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -1
  50. package/lib/types/client/providers/kimi-code/KimiCodeSection.d.ts.map +1 -1
  51. package/lib/types/client/providers/kimi-code/locales.d.ts +8 -2
  52. package/lib/types/client/providers/kimi-code/locales.d.ts.map +1 -1
  53. package/lib/types/client/providers/minimax-code/MinimaxCodeSection.d.ts.map +1 -1
  54. package/lib/types/client/providers/opencode-zen/useZenSection.d.ts +1 -0
  55. package/lib/types/client/providers/opencode-zen/useZenSection.d.ts.map +1 -1
  56. package/lib/types/client/providers/relayone/locales.d.ts +12 -12
  57. package/lib/types/client/providers/step-code/StepCodeSection.d.ts.map +1 -1
  58. package/lib/types/client/providers/sub2api/Sub2ApiSection.d.ts +7 -0
  59. package/lib/types/client/providers/sub2api/Sub2ApiSection.d.ts.map +1 -0
  60. package/lib/types/client/providers/sub2api/locales.d.ts +212 -0
  61. package/lib/types/client/providers/sub2api/locales.d.ts.map +1 -0
  62. package/lib/types/client/providers/sub2api/styles.d.ts +3 -0
  63. package/lib/types/client/providers/sub2api/styles.d.ts.map +1 -0
  64. package/lib/types/compat.d.ts +1 -1
  65. package/lib/types/compat.d.ts.map +1 -1
  66. package/lib/types/entries/reverse-board.d.ts +6 -0
  67. package/lib/types/entries/reverse-board.d.ts.map +1 -0
  68. package/lib/types/entries/tool-result-pruner.d.ts.map +1 -1
  69. package/lib/types/host/common/i18n/zh.d.ts +1 -1
  70. package/lib/types/host/common/model-request-control.d.ts +1 -1
  71. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  72. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
  73. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  74. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  75. package/lib/types/host/providers/claude/routes.d.ts.map +1 -1
  76. package/lib/types/host/providers/claude/token-store.d.ts +3 -0
  77. package/lib/types/host/providers/claude/token-store.d.ts.map +1 -1
  78. package/lib/types/host/providers/claude-api/routes.d.ts.map +1 -1
  79. package/lib/types/host/providers/claude-api/token-store.d.ts +3 -0
  80. package/lib/types/host/providers/claude-api/token-store.d.ts.map +1 -1
  81. package/lib/types/host/providers/kimi-code/cache-wait.d.ts +12 -0
  82. package/lib/types/host/providers/kimi-code/cache-wait.d.ts.map +1 -1
  83. package/lib/types/host/providers/kimi-code/routes.d.ts.map +1 -1
  84. package/lib/types/host/providers/kimi-code/token-store.d.ts +4 -0
  85. package/lib/types/host/providers/kimi-code/token-store.d.ts.map +1 -1
  86. package/lib/types/host/providers/relayone/types.d.ts +1 -1
  87. package/lib/types/host/providers/relayone/types.d.ts.map +1 -1
  88. package/lib/types/host/providers/sub2api/account-pool.d.ts +34 -0
  89. package/lib/types/host/providers/sub2api/account-pool.d.ts.map +1 -0
  90. package/lib/types/host/providers/sub2api/adapter.d.ts +59 -0
  91. package/lib/types/host/providers/sub2api/adapter.d.ts.map +1 -0
  92. package/lib/types/host/providers/sub2api/cache-stats.d.ts +19 -0
  93. package/lib/types/host/providers/sub2api/cache-stats.d.ts.map +1 -0
  94. package/lib/types/host/providers/sub2api/client.d.ts +6 -0
  95. package/lib/types/host/providers/sub2api/client.d.ts.map +1 -0
  96. package/lib/types/host/providers/sub2api/mapper-gemini.d.ts +10 -0
  97. package/lib/types/host/providers/sub2api/mapper-gemini.d.ts.map +1 -0
  98. package/lib/types/host/providers/sub2api/mapper-messages.d.ts +14 -0
  99. package/lib/types/host/providers/sub2api/mapper-messages.d.ts.map +1 -0
  100. package/lib/types/host/providers/sub2api/mapper-responses.d.ts +7 -0
  101. package/lib/types/host/providers/sub2api/mapper-responses.d.ts.map +1 -0
  102. package/lib/types/host/providers/sub2api/mapper.d.ts +34 -0
  103. package/lib/types/host/providers/sub2api/mapper.d.ts.map +1 -0
  104. package/lib/types/host/providers/sub2api/model-catalog.d.ts +72 -0
  105. package/lib/types/host/providers/sub2api/model-catalog.d.ts.map +1 -0
  106. package/lib/types/host/providers/sub2api/remote-compaction.d.ts +32 -0
  107. package/lib/types/host/providers/sub2api/remote-compaction.d.ts.map +1 -0
  108. package/lib/types/host/providers/sub2api/routes.d.ts +16 -0
  109. package/lib/types/host/providers/sub2api/routes.d.ts.map +1 -0
  110. package/lib/types/host/providers/sub2api/token-store.d.ts +43 -0
  111. package/lib/types/host/providers/sub2api/token-store.d.ts.map +1 -0
  112. package/lib/types/host/providers/sub2api/types.d.ts +14 -0
  113. package/lib/types/host/providers/sub2api/types.d.ts.map +1 -0
  114. package/lib/types/host/runtime/advisor/catalog-route.d.ts +20 -0
  115. package/lib/types/host/runtime/advisor/catalog-route.d.ts.map +1 -0
  116. package/lib/types/host/runtime/advisor/index.d.ts.map +1 -1
  117. package/lib/types/host/runtime/advisor/selection-store.d.ts +9 -1
  118. package/lib/types/host/runtime/advisor/selection-store.d.ts.map +1 -1
  119. package/lib/types/host/runtime/codemode/transport.d.ts +5 -0
  120. package/lib/types/host/runtime/codemode/transport.d.ts.map +1 -1
  121. package/lib/types/host/runtime/compact-after-turn/index.d.ts +15 -0
  122. package/lib/types/host/runtime/compact-after-turn/index.d.ts.map +1 -1
  123. package/lib/types/host/runtime/compaction-gate.d.ts +67 -0
  124. package/lib/types/host/runtime/compaction-gate.d.ts.map +1 -0
  125. package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts +8 -0
  126. package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts.map +1 -1
  127. package/lib/types/host/runtime/guards/compaction-policy-guard.d.ts +1 -0
  128. package/lib/types/host/runtime/guards/compaction-policy-guard.d.ts.map +1 -1
  129. package/lib/types/host/runtime/guards/ptc-sdk-cache-guard.d.ts.map +1 -1
  130. package/lib/types/host/runtime/guards/timeline-cache-guard.d.ts.map +1 -1
  131. package/lib/types/host/runtime/open-models/profiles.d.ts.map +1 -1
  132. package/lib/types/host/runtime/open-models/state-anchor.d.ts.map +1 -1
  133. package/lib/types/host/runtime/presets/agent-preset.d.ts +10 -25
  134. package/lib/types/host/runtime/presets/agent-preset.d.ts.map +1 -1
  135. package/lib/types/host/runtime/presets/preset-sync.d.ts +2 -0
  136. package/lib/types/host/runtime/presets/preset-sync.d.ts.map +1 -1
  137. package/lib/types/host/runtime/presets/reverse-persona.d.ts +3 -0
  138. package/lib/types/host/runtime/presets/reverse-persona.d.ts.map +1 -0
  139. package/lib/types/host/runtime/reverse/frontier.d.ts +10 -0
  140. package/lib/types/host/runtime/reverse/frontier.d.ts.map +1 -0
  141. package/lib/types/host/runtime/reverse/ids.d.ts +8 -0
  142. package/lib/types/host/runtime/reverse/ids.d.ts.map +1 -0
  143. package/lib/types/host/runtime/reverse/index.d.ts +20 -0
  144. package/lib/types/host/runtime/reverse/index.d.ts.map +1 -0
  145. package/lib/types/host/runtime/reverse/indexer.d.ts +9 -0
  146. package/lib/types/host/runtime/reverse/indexer.d.ts.map +1 -0
  147. package/lib/types/host/runtime/reverse/policy.d.ts +5 -0
  148. package/lib/types/host/runtime/reverse/policy.d.ts.map +1 -0
  149. package/lib/types/host/runtime/reverse/route-policy.d.ts +10 -0
  150. package/lib/types/host/runtime/reverse/route-policy.d.ts.map +1 -0
  151. package/lib/types/host/runtime/reverse/store.d.ts +91 -0
  152. package/lib/types/host/runtime/reverse/store.d.ts.map +1 -0
  153. package/lib/types/host/runtime/reverse/templates.d.ts +10 -0
  154. package/lib/types/host/runtime/reverse/templates.d.ts.map +1 -0
  155. package/lib/types/host/runtime/reverse/tool.d.ts +25 -0
  156. package/lib/types/host/runtime/reverse/tool.d.ts.map +1 -0
  157. package/lib/types/host/runtime/reverse/types.d.ts +182 -0
  158. package/lib/types/host/runtime/reverse/types.d.ts.map +1 -0
  159. package/lib/types/index.d.ts +13 -0
  160. package/lib/types/index.d.ts.map +1 -1
  161. package/lib/types/shared/claude-api-contracts.d.ts +2 -0
  162. package/lib/types/shared/claude-api-contracts.d.ts.map +1 -1
  163. package/lib/types/shared/claude-contracts.d.ts +3 -0
  164. package/lib/types/shared/claude-contracts.d.ts.map +1 -1
  165. package/lib/types/shared/contracts.d.ts +1 -1
  166. package/lib/types/shared/contracts.d.ts.map +1 -1
  167. package/lib/types/shared/kimi-code-contracts.d.ts +3 -0
  168. package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
  169. package/lib/types/shared/relayone-contracts.d.ts +2 -2
  170. package/lib/types/shared/relayone-contracts.d.ts.map +1 -1
  171. package/lib/types/shared/sub2api-contracts.d.ts +103 -0
  172. package/lib/types/shared/sub2api-contracts.d.ts.map +1 -0
  173. package/package.json +6 -2
  174. package/presets/reverse/README.md +30 -0
  175. package/presets/reverse/agent.cordis.yml +228 -0
  176. package/presets/reverse/preset.yml +3 -0
  177. package/presets/team/README.md +0 -72
  178. package/presets/team/agent.cordis.yml +0 -414
  179. package/presets/team/preset.yml +0 -3
@@ -121,31 +121,16 @@ export type PresetInstall = 'registered' | 'legacy';
121
121
  * for text the Loader evaluates, and nothing evaluates this.
122
122
  */
123
123
  export declare const DISPATCH_PRESET: PresetDefinition;
124
- /** The team domain: the shared task board, from harness 0.2.1-rc.2. */
125
- export declare const TEAM_BOARD_PACKAGE = "@deepseek-ai/dsh-agent-team";
126
- /** The model-facing half of the team domain, same generation. */
127
- export declare const TEAM_BOARD_TOOL_PACKAGE = "@deepseek-ai/dsh-tool-agent-team";
128
- /** The `team` (班组模式) preset id, and the directory `presets/team/` ships. */
129
- export declare const TEAM_PRESET_ID = "team";
124
+ /** The reverse preset id, and the directory `presets/reverse/` ships. */
125
+ export declare const REVERSE_PRESET_ID = "reverse";
130
126
  /**
131
- * The Team persona: the dispatch persona plus the Team topology delta.
127
+ * The `reverse` (逆向模式) preset: a graph/frontier-driven reverse crew.
132
128
  *
133
- * Applied to whichever persona the caller passes, so the two copies of a persona
134
- * edit (this file's literal and the `presets/<id>/agent.cordis.yml` copies) stay one edit.
135
- * @param persona - the dispatch persona prefix.
136
- * @returns the team persona prefix.
129
+ * It deliberately does not inherit the dispatch persona or the team topology.
130
+ * The only reverse-specific row is `reverse-board`, which exists only while this
131
+ * preset is mounted; src/index.ts never registers that tool globally.
137
132
  */
138
- export declare function applyTeamDelta(persona: string): string;
139
- /**
140
- * The `team` (班组模式) preset: identity from `presets/team/preset.yml`, rows and
141
- * persona inherited from {@link DISPATCH_PRESET}.
142
- *
143
- * One row differs — the persona — and through {@link applyTeamDelta} only. The
144
- * baseline is harness 0.2.1: the topology relies on `send_message` and
145
- * `wait_agent` from the subagent-control row both presets already mount, and
146
- * adds no package this plugin has to keep compatible.
147
- */
148
- export declare const TEAM_PRESET: PresetDefinition;
133
+ export declare const REVERSE_PRESET: PresetDefinition;
149
134
  /**
150
135
  * Reconcile {@link DISPATCH_PRESET} with the running harness generation.
151
136
  *
@@ -177,11 +162,11 @@ export declare const TEAM_PRESET: PresetDefinition;
177
162
  */
178
163
  export declare function resolveDispatchPreset(resolves?: SpecifierResolver): PresetDefinition;
179
164
  /**
180
- * Reconcile {@link TEAM_PRESET} with the running harness generation.
165
+ * Reconcile {@link REVERSE_PRESET} with the running harness generation.
181
166
  * @param resolves - whether a bare specifier resolves in this installation.
182
167
  * @returns the preset definition for the running harness generation.
183
168
  */
184
- export declare function resolveTeamPreset(resolves?: SpecifierResolver): PresetDefinition;
169
+ export declare function resolveReversePreset(resolves?: SpecifierResolver): PresetDefinition;
185
170
  /**
186
171
  * Declare `dispatch` to the running harness, when the harness has the mechanism.
187
172
  *
@@ -206,5 +191,5 @@ export declare function installDispatchPreset(host: PresetHost, resolves?: Speci
206
191
  * @param resolves - whether a bare specifier resolves in this installation.
207
192
  * @returns `'registered'` when this call took the preset, `'legacy'` otherwise.
208
193
  */
209
- export declare function installTeamPreset(host: PresetHost, resolves?: SpecifierResolver): PresetInstall;
194
+ export declare function installReversePreset(host: PresetHost, resolves?: SpecifierResolver): PresetInstall;
210
195
  //# sourceMappingURL=agent-preset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-preset.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/agent-preset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,kCAAkC,CAAA;AAEtE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,uCAAuC,CAAA;AAE7E,wGAAwG;AACxG,eAAO,MAAM,oBAAoB,uCAAuC,CAAA;AAExE,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,uCAAuC,CAAA;AAExE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,0CAA0C,CAAA;AAE9E,6GAA6G;AAC7G,eAAO,MAAM,uBAAuB,0CAA0C,CAAA;AAE9E,kGAAkG;AAClG,eAAO,M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,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,GAAE,iBAAoC,GAAG,aAAa,CAEpH"}
@@ -6,6 +6,8 @@
6
6
  import type { PresetHost, PresetInstall } from './agent-preset.ts';
7
7
  /** The preset directory this package ships. */
8
8
  export declare const BUNDLED_PRESET_IDS: readonly string[];
9
+ /** Previously bundled preset ids retired from the discovery root. */
10
+ export declare const RETIRED_PRESET_IDS: readonly string[];
9
11
  /**
10
12
  * Candidate directories where the running harness or profile packages reside.
11
13
  * @param entryScript - harness CLI entry script, defaults to this process's.
@@ -1 +1 @@
1
- {"version":3,"file":"preset-sync.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/preset-sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAElE,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAyB,CAAA;AAwFzE;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,GAAE,MAAM,GAAG,SAA2B,GAAG,MAAM,EAAE,CAyBjG;AAOD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,SAAS,MAAM,EAA4B,GACjD,OAAO,CAsBT;AAkDD,kFAAkF;AAClF,KAAK,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,iBAAiB,EAAE,cAAc,GAAG,SAAS,GAC5C,OAAO,CAqBT;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAA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 +1,3 @@
1
+ /** Generated from presets/reverse/agent.cordis.yml; YAML is the source of truth. */
2
+ export declare const REVERSE_PERSONA: string;
3
+ //# sourceMappingURL=reverse-persona.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reverse-persona.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/reverse-persona.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,eAAe,QA+ChB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { ReverseAction, ReverseState } from './types.ts';
2
+ export interface FrontierOptions {
3
+ readonly cell?: string;
4
+ readonly posture?: string;
5
+ readonly island?: string;
6
+ readonly limit?: number;
7
+ readonly eliteCap?: number;
8
+ }
9
+ export declare function computeFrontier(state: ReverseState, options?: FrontierOptions): ReverseAction[];
10
+ //# sourceMappingURL=frontier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontier.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/frontier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAkC,YAAY,EAAE,MAAM,YAAY,CAAA;AAE7F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAiDD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB,GAAG,aAAa,EAAE,CAoCnG"}
@@ -0,0 +1,8 @@
1
+ export declare function sha256Hex(value: string | Buffer): string;
2
+ export declare function shortHash(value: string): string;
3
+ export declare function cellId(value: string): string;
4
+ export declare function artifactIdFromSha(sha: string): string;
5
+ export declare function functionId(cell: string, address: string): string;
6
+ export declare function findingId(cell: string, key: string): string;
7
+ export declare function actionId(type: string, targetId: string, params: unknown): string;
8
+ //# sourceMappingURL=ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/ids.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAEhF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Host installer for the reverse preset row.
3
+ *
4
+ * This module is imported only by src/entries/reverse-board.ts, which is mounted
5
+ * only by presets/reverse. It is not imported by src/index.ts, so reverse_board
6
+ * never appears in another preset's tool catalog.
7
+ *
8
+ * @module dsh-chatgpt-subscription/host/runtime/reverse/index
9
+ */
10
+ import { REVERSE_BOARD_TOOL } from './tool.ts';
11
+ export interface ReverseHost {
12
+ get(name: string): unknown;
13
+ logger?: {
14
+ info?(message: string): void;
15
+ warn?(message: string): void;
16
+ };
17
+ }
18
+ export declare function installReverseBoard(host: ReverseHost): () => void;
19
+ export { REVERSE_BOARD_TOOL };
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAqB,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEjE,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;QAC5B,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAC7B,CAAA;CACF;AAUD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI,CAYjE;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { type ReverseNode } from './types.ts';
2
+ export interface ArtifactIndexInput {
3
+ readonly id?: string;
4
+ readonly key?: string;
5
+ readonly label?: string;
6
+ readonly attrs?: Readonly<Record<string, unknown>>;
7
+ }
8
+ export declare function indexArtifact(input: ArtifactIndexInput, cell: string): Promise<ReverseNode>;
9
+ //# sourceMappingURL=indexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/indexer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACnD;AAmBD,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAyBjG"}
@@ -0,0 +1,5 @@
1
+ import { type ReverseScope } from './types.ts';
2
+ export declare function assertPathScope(scope: ReverseScope | undefined, candidate: string): void;
3
+ export declare function assertResourceScope(scope: ReverseScope | undefined, resource: string): void;
4
+ export declare function assertSameCell(expected: string, actual: string): void;
5
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAO5D,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CASxF;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAM3F;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAIrE"}
@@ -0,0 +1,10 @@
1
+ /** Deterministic value/UCB route scoring; no hidden model dependency. @module */
2
+ import type { ReverseNode, ReverseRouteStat } from './types.ts';
3
+ export interface RouteScore {
4
+ readonly island: string;
5
+ readonly score: number;
6
+ readonly exploration: number;
7
+ }
8
+ export declare function routeIsland(node: ReverseNode): string;
9
+ export declare function scoreRoute(node: ReverseNode, stat: ReverseRouteStat | undefined, totalAttempts: number): RouteScore;
10
+ //# sourceMappingURL=route-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-policy.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/route-policy.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE/D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAOD,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAarD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,gBAAgB,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,UAAU,CAanH"}
@@ -0,0 +1,91 @@
1
+ import { type FrontierOptions } from './frontier.ts';
2
+ import { type ArtifactIndexInput } from './indexer.ts';
3
+ import { type ReverseAction, type ReverseBudget, type ReverseClaim, type ReverseEdge, type ReverseEvent, type ReverseEvidence, type ReverseFinish, type ReverseHandoff, type ReverseLease, type ReverseMember, type ReverseNode, type ReverseNodeKind, type ReversePlane, type ReverseReport, type ReverseState, type ReverseWatchdog } from './types.ts';
4
+ export type ReverseArtifactInput = ArtifactIndexInput;
5
+ export interface ReverseInitInput {
6
+ readonly goal: string;
7
+ readonly acceptance?: string;
8
+ readonly engagement?: 'reverse' | 'jeopardy';
9
+ readonly flagFormat?: string;
10
+ readonly authorization: string;
11
+ readonly roots?: readonly string[];
12
+ readonly resources?: readonly string[];
13
+ readonly deny?: readonly string[];
14
+ readonly artifacts?: readonly ReverseArtifactInput[];
15
+ readonly budget?: ReverseBudget;
16
+ }
17
+ export interface ReverseRecordInput {
18
+ readonly node?: Partial<ReverseNode> & {
19
+ readonly id?: string;
20
+ readonly kind: ReverseNodeKind;
21
+ };
22
+ readonly edge?: Partial<ReverseEdge> & {
23
+ readonly from: string;
24
+ readonly to: string;
25
+ readonly kind: string;
26
+ };
27
+ }
28
+ export interface ReverseEvidenceInput {
29
+ readonly findingId: string;
30
+ readonly tool: string;
31
+ readonly command: string;
32
+ readonly toolVersion?: string;
33
+ readonly inputHash: string;
34
+ readonly outputHash?: string;
35
+ readonly offset?: string;
36
+ readonly artifactPath?: string;
37
+ readonly content?: string;
38
+ readonly reproduction?: readonly string[];
39
+ }
40
+ export interface ReverseHandoffInput {
41
+ readonly note?: string;
42
+ readonly factsWritten?: readonly string[];
43
+ readonly leases?: readonly string[];
44
+ readonly nextStep?: string;
45
+ readonly safeToStop: boolean;
46
+ }
47
+ export type ClaimOperation = 'acquire' | 'renew' | 'release';
48
+ export type LeaseOperation = 'acquire' | 'renew' | 'release';
49
+ /** Fold one event into state; this pure function is the rebuild contract. */
50
+ export declare function foldReverseEvent(state: ReverseState, event: ReverseEvent): ReverseState;
51
+ export declare class ReverseStore {
52
+ readonly runId: string;
53
+ private readonly root;
54
+ private readonly eventsPath;
55
+ private stateValue;
56
+ private readonly eventsValue;
57
+ private chain;
58
+ private constructor();
59
+ static open(runId: string, baseDir?: string): Promise<ReverseStore>;
60
+ get state(): ReverseState;
61
+ get events(): readonly ReverseEvent[];
62
+ private withLock;
63
+ private append;
64
+ private appendUnlocked;
65
+ init(input: ReverseInitInput, actor: string): Promise<ReverseState>;
66
+ bindMember(actor: string, plane: ReversePlane, parentActor?: string, requestedCell?: string): Promise<ReverseMember>;
67
+ private cellFor;
68
+ frontier(options?: FrontierOptions): ReverseAction[];
69
+ claim(actionId: string, actor: string, ttlSeconds?: number, operation?: ClaimOperation, token?: string): Promise<ReverseClaim>;
70
+ private ttl;
71
+ private activeClaim;
72
+ private findingTransition;
73
+ record(token: string, actor: string, input: ReverseRecordInput): Promise<ReverseState>;
74
+ evidence(token: string, actor: string, input: ReverseEvidenceInput): Promise<ReverseEvidence>;
75
+ cell(operation: 'open' | 'close' | 'merge', cell: string, actor: string, targetCell?: string, brief?: string): Promise<ReverseState>;
76
+ lease(operation: LeaseOperation, resource: string, actor: string, ttlSeconds?: number, token?: string): Promise<ReverseLease>;
77
+ finish(operation: 'propose' | 'settle', actor: string, findingIds?: readonly string[], note?: string): Promise<ReverseFinish>;
78
+ requestHandoff(actionId: string, actor: string, note?: string): Promise<ReverseHandoff>;
79
+ completeHandoff(token: string, actor: string, input: ReverseHandoffInput): Promise<ReverseHandoff>;
80
+ watchdog(actor: string): Promise<{
81
+ watchdog: ReverseWatchdog;
82
+ requests: ReverseHandoff[];
83
+ }>;
84
+ denied(actor: string, action: string, code: string, message: string): Promise<void>;
85
+ reportData(): ReverseReport;
86
+ report(format?: 'markdown' | 'json'): string | ReverseReport;
87
+ audit(limit?: number): ReverseEvent[];
88
+ }
89
+ export declare function openReverseStore(runId: string, baseDir?: string): Promise<ReverseStore>;
90
+ export declare function clearReverseStoreRegistry(): void;
91
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/store.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EAEL,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EACvE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EACpF,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EACrD,KAAK,YAAY,EAAE,KAAK,aAAa,EAC7D,KAAK,YAAY,EAAE,KAAK,eAAe,EACxC,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAA;AAErD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CA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,SAAK,GAAG,OAAO,CAAC,cAAc,CAAC;IAcnF,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAgBlG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,eAAe,CAAC;QAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IAgC3F,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzF,UAAU,IAAI,aAAa;IAmB3B,MAAM,CAAC,MAAM,GAAE,UAAU,GAAG,MAAmB,GAAG,MAAM,GAAG,aAAa;IAgBxE,KAAK,CAAC,KAAK,SAAK,GAAG,YAAY,EAAE;CAGlC;AAID,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAOvF;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAAqB"}
@@ -0,0 +1,10 @@
1
+ /** Goal templates for supported engagements. @module */
2
+ import type { ReverseGoal } from './types.ts';
3
+ export interface GoalTemplateInput {
4
+ readonly goal: string;
5
+ readonly acceptance?: string;
6
+ readonly engagement?: 'reverse' | 'jeopardy';
7
+ readonly flagFormat?: string;
8
+ }
9
+ export declare function goalFromTemplate(input: GoalTemplateInput): ReverseGoal;
10
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAYtE"}
@@ -0,0 +1,25 @@
1
+ import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
2
+ import { type ReverseStore } from './store.ts';
3
+ import { type ReversePlane } from './types.ts';
4
+ export declare const REVERSE_BOARD_TOOL = "reverse_board";
5
+ export declare const REVERSE_BOARD_DESCRIPTION = "Operate a scoped reverse graph: init, frontier, claim/renew/release, record, evidence, cells, leases, handoff, watchdog, finish, Markdown/JSON report and audit. Mounted only by the reverse preset.";
6
+ interface SessionLike {
7
+ readonly id?: unknown;
8
+ readonly header?: {
9
+ readonly parentSession?: unknown;
10
+ readonly delegationDepth?: unknown;
11
+ };
12
+ }
13
+ interface SessionsLike {
14
+ get(id: string): SessionLike | undefined;
15
+ }
16
+ export interface ReverseToolDeps {
17
+ readonly sessions?: () => SessionsLike | undefined;
18
+ readonly storeFor?: (runId: string) => Promise<ReverseStore>;
19
+ }
20
+ export declare function sessionDepth(session: SessionLike, sessions?: SessionsLike): number;
21
+ export declare function rootSessionId(session: SessionLike, sessions?: SessionsLike): string;
22
+ export declare function planeOfDepth(depth: number): ReversePlane;
23
+ export declare function createReverseTool(deps?: ReverseToolDeps): ToolDefinition;
24
+ export {};
25
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAE5D,eAAO,MAAM,kBAAkB,kBAAkB,CAAA;AACjD,eAAO,MAAM,yBAAyB,yMAAyM,CAAA;AAE/O,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC3F;AAED,UAAU,YAAY;IAAG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;CAAE;AAEnE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,YAAY,GAAG,SAAS,CAAA;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;CAC7D;AAuBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,CAclF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,CAYnF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAKxD;AAgBD,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,eAAoB,GAAG,cAAc,CA8M5E"}
@@ -0,0 +1,182 @@
1
+ /** Side-effect-free contracts for the reverse graph. @module */
2
+ export declare const REVERSE_EVENT_VERSION = 1;
3
+ export type ReversePlane = 'steward' | 'cell' | 'worker' | 'subworker';
4
+ export type ReverseNodeKind = 'Goal' | 'Cell' | 'Step' | 'Fact' | 'Artifact' | 'Segment' | 'Function' | 'Symbol' | 'Hypothesis' | 'Experiment' | 'Finding' | 'Evidence' | 'DeadEnd' | 'Question' | 'Patch' | 'Script' | 'Submission';
5
+ export type ReverseNodeStatus = 'proposed' | 'queued' | 'claimed' | 'running' | 'observed' | 'reproduced' | 'verified' | 'refuted' | 'exhausted' | 'superseded' | 'cancelled' | 'open' | 'closed' | 'merged';
6
+ export interface ReverseNode {
7
+ readonly id: string;
8
+ readonly kind: ReverseNodeKind;
9
+ readonly key: string;
10
+ readonly label: string;
11
+ readonly status: ReverseNodeStatus;
12
+ readonly attrs: Readonly<Record<string, unknown>>;
13
+ readonly evidenceIds: readonly string[];
14
+ readonly revision: number;
15
+ }
16
+ export interface ReverseEdge {
17
+ readonly id: string;
18
+ readonly from: string;
19
+ readonly to: string;
20
+ readonly kind: string;
21
+ readonly confidence: number;
22
+ readonly evidenceIds: readonly string[];
23
+ }
24
+ export interface ReverseClaim {
25
+ readonly actionId: string;
26
+ readonly actor: string;
27
+ readonly cell: string;
28
+ readonly fencing: number;
29
+ readonly expiresAt: number;
30
+ readonly createdAt: number;
31
+ readonly status: 'active' | 'released' | 'expired';
32
+ readonly token: string;
33
+ }
34
+ export interface ReverseLease {
35
+ readonly resource: string;
36
+ readonly actor: string;
37
+ readonly cell: string;
38
+ readonly fencing: number;
39
+ readonly expiresAt: number;
40
+ readonly createdAt: number;
41
+ readonly status: 'active' | 'released' | 'expired';
42
+ readonly token: string;
43
+ }
44
+ export interface ReverseMember {
45
+ readonly actor: string;
46
+ readonly parentActor?: string;
47
+ readonly plane: ReversePlane;
48
+ readonly cell: string;
49
+ readonly boundAt: string;
50
+ }
51
+ export interface ReverseHandoff {
52
+ readonly id: string;
53
+ readonly actionId: string;
54
+ readonly actor: string;
55
+ readonly cell: string;
56
+ readonly status: 'requested' | 'completed' | 'cancelled';
57
+ readonly note: string;
58
+ readonly factsWritten: readonly string[];
59
+ readonly leases: readonly string[];
60
+ readonly nextStep: string;
61
+ readonly safeToStop: boolean;
62
+ readonly requestedAt: string;
63
+ readonly completedAt?: string;
64
+ }
65
+ export interface ReverseWatchdog {
66
+ readonly lastProgressSeq: number;
67
+ readonly rotationsWithoutProgress: number;
68
+ readonly recoveryAttempts: number;
69
+ readonly needsHuman: boolean;
70
+ }
71
+ export interface ReverseFinish {
72
+ readonly status: 'proposed' | 'settled' | 'invalidated';
73
+ readonly findingIds: readonly string[];
74
+ readonly note: string;
75
+ readonly proposedSeq: number;
76
+ readonly proposedBy: string;
77
+ readonly settledSeq?: number;
78
+ }
79
+ export interface ReverseGoal {
80
+ readonly text: string;
81
+ readonly acceptance: string;
82
+ readonly engagement: 'reverse' | 'jeopardy';
83
+ readonly flagFormat?: string;
84
+ }
85
+ export interface ReverseScope {
86
+ readonly authorization: string;
87
+ readonly roots: readonly string[];
88
+ readonly resources: readonly string[];
89
+ readonly deny: readonly string[];
90
+ }
91
+ export interface ReverseBudget {
92
+ readonly deadline?: string;
93
+ readonly maxActions?: number;
94
+ readonly maxAgents?: number;
95
+ }
96
+ export interface ReverseEvidence {
97
+ readonly id: string;
98
+ readonly findingId: string;
99
+ readonly tool: string;
100
+ readonly command: string;
101
+ readonly toolVersion: string;
102
+ readonly inputHash: string;
103
+ readonly outputHash: string;
104
+ readonly offset?: string;
105
+ readonly artifactPath?: string;
106
+ readonly contentPath?: string;
107
+ readonly sizeBytes: number;
108
+ readonly reproduction: readonly string[];
109
+ readonly producer: string;
110
+ readonly verifier?: string;
111
+ readonly createdAt: string;
112
+ }
113
+ export interface ReverseRouteStat {
114
+ readonly attempts: number;
115
+ readonly successes: number;
116
+ }
117
+ export interface ReverseState {
118
+ readonly runId: string;
119
+ readonly seq: number;
120
+ readonly lastHash: string;
121
+ readonly lastFactSeq: number;
122
+ readonly goal?: ReverseGoal;
123
+ readonly scope?: ReverseScope;
124
+ readonly budget?: ReverseBudget;
125
+ readonly nodes: Readonly<Record<string, ReverseNode>>;
126
+ readonly edges: Readonly<Record<string, ReverseEdge>>;
127
+ readonly claims: Readonly<Record<string, ReverseClaim>>;
128
+ readonly leases: Readonly<Record<string, ReverseLease>>;
129
+ readonly members: Readonly<Record<string, ReverseMember>>;
130
+ readonly handoffs: Readonly<Record<string, ReverseHandoff>>;
131
+ readonly evidence: Readonly<Record<string, ReverseEvidence>>;
132
+ readonly routes: Readonly<Record<string, ReverseRouteStat>>;
133
+ readonly watchdog: ReverseWatchdog;
134
+ readonly finish?: ReverseFinish;
135
+ }
136
+ export interface ReverseAction {
137
+ readonly actionId: string;
138
+ readonly actionType: string;
139
+ readonly cell: string;
140
+ readonly targetId: string;
141
+ readonly posture: string;
142
+ readonly island: string;
143
+ readonly priority: number;
144
+ readonly score: number;
145
+ readonly exploration: number;
146
+ readonly why: readonly string[];
147
+ readonly expectedEvidence: string;
148
+ readonly params: Readonly<Record<string, unknown>>;
149
+ }
150
+ export type ReverseEventKind = 'goal' | 'scope' | 'budget' | 'node' | 'edge' | 'claim' | 'release' | 'lease' | 'evidence' | 'finish' | 'cell' | 'merge' | 'member' | 'handoff' | 'watchdog' | 'denied';
151
+ export interface ReverseEvent {
152
+ readonly v: 1;
153
+ readonly seq: number;
154
+ readonly time: string;
155
+ readonly runId: string;
156
+ readonly cell?: string;
157
+ readonly actor: string;
158
+ readonly kind: ReverseEventKind;
159
+ readonly payload: Readonly<Record<string, unknown>>;
160
+ readonly prev: string;
161
+ readonly hash: string;
162
+ }
163
+ export interface ReverseReport {
164
+ readonly runId: string;
165
+ readonly goal?: ReverseGoal;
166
+ readonly status: string;
167
+ readonly cells: readonly ReverseNode[];
168
+ readonly findings: readonly ReverseNode[];
169
+ readonly deadEnds: readonly ReverseNode[];
170
+ readonly openQuestions: readonly ReverseNode[];
171
+ readonly evidence: readonly ReverseEvidence[];
172
+ readonly pendingHandoffs: readonly ReverseHandoff[];
173
+ readonly watchdog: ReverseWatchdog;
174
+ readonly residualRisk: readonly string[];
175
+ }
176
+ export declare const REVERSE_ERROR_PREFIX = "REVERSE_DENIED";
177
+ export declare class ReverseError extends Error {
178
+ readonly code: string;
179
+ constructor(code: string, message: string);
180
+ }
181
+ export declare function emptyReverseState(runId: string): ReverseState;
182
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/types.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,eAAO,MAAM,qBAAqB,IAAI,CAAA;AAEtC,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;AAEtE,MAAM,MAAM,eAAe,GACvB,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAClF,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAC7E,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAA;AAErC,MAAM,MAAM,iBAAiB,GACzB,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GACtF,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEvF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACjD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAA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6 +164,13 @@ export interface Config {
164
164
  * 的账号,前提是该账号剩余额度不低于 20%。默认开启;关闭后完全按原轮换策略。
165
165
  */
166
166
  cacheAffinity?: Volatile<boolean>;
167
+ /**
168
+ * 会话「全部任务完成后压缩」的阈值:上下文不足这个 token 数就不压缩。
169
+ *
170
+ * 0 表示不限制。三条线路各自的开关决定是否启用,这个值只决定够不够格;
171
+ * 同一份阈值也门控子代理完成后的自动压缩。
172
+ */
173
+ compactAfterTasksThreshold?: Volatile<number>;
167
174
  /** 部署级缓存语义覆盖;非 volatile,修改后重载插件。 */
168
175
  promptCacheOverrides?: Record<string, PromptCacheOverride>;
169
176
  /** Independent web fetch selection; auto preserves proxy/search-driven selection.
@@ -466,6 +473,12 @@ export { OpenCodeGoCatalogManager } from './host/providers/opencode-go/model-cat
466
473
  export { OpenCodeGoSettingsStore } from './host/providers/opencode-go/token-store.ts';
467
474
  export { registerOpenCodeGoRoutes, getOpenCodeGoWebStatus } from './host/providers/opencode-go/routes.ts';
468
475
  export * from './shared/opencode-go-contracts.ts';
476
+ export { Sub2ApiAdapter, classifySub2ApiResponse } from './host/providers/sub2api/adapter.ts';
477
+ export { Sub2ApiAccountPool, parseSub2ApiPoolData, sub2ApiPoolPath } from './host/providers/sub2api/account-pool.ts';
478
+ export { Sub2ApiCatalogManager, parseSub2ApiModelListing, parsePersistedSub2ApiModelEntries } from './host/providers/sub2api/model-catalog.ts';
479
+ export { Sub2ApiSettingsStore, parseSub2ApiSettings } from './host/providers/sub2api/token-store.ts';
480
+ export { registerSub2ApiRoutes, getSub2ApiWebStatus, warmSub2ApiCatalogOnStartup } from './host/providers/sub2api/routes.ts';
481
+ export * from './shared/sub2api-contracts.ts';
469
482
  export { CopilotAdapter } from './host/providers/copilot/adapter.ts';
470
483
  export { CopilotAccountPool, copilotPoolPath } from './host/providers/copilot/account-pool.ts';
471
484
  export { CopilotCatalogManager } from './host/providers/copilot/catalog-manager.ts';