@eddyskywalker/dsh-chatgpt-subscription 0.46.0 → 0.47.0

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 (91) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +22 -1
  3. package/lib/client.js +2639 -571
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +11993 -3559
  6. package/lib/plan-mode-pipeline.js +419 -0
  7. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  8. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  9. package/lib/types/client/hub/brand-svg.d.ts +4 -0
  10. package/lib/types/client/hub/brand-svg.d.ts.map +1 -1
  11. package/lib/types/client/hub/providers.d.ts.map +1 -1
  12. package/lib/types/client/index.d.ts +2 -0
  13. package/lib/types/client/index.d.ts.map +1 -1
  14. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  15. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  16. package/lib/types/client/locales-ru/workbuddy.d.ts +10 -0
  17. package/lib/types/client/locales-ru/workbuddy.d.ts.map +1 -0
  18. package/lib/types/client/progress-updates/locales.d.ts +23 -5
  19. package/lib/types/client/progress-updates/locales.d.ts.map +1 -1
  20. package/lib/types/client/progress-updates/settings-binding.d.ts +13 -1
  21. package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
  22. package/lib/types/client/progress-updates/settings-section.d.ts +1 -1
  23. package/lib/types/client/progress-updates/settings-section.d.ts.map +1 -1
  24. package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts +34 -0
  25. package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts.map +1 -0
  26. package/lib/types/client/workbuddy/WorkBuddySection.d.ts +91 -0
  27. package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +1 -0
  28. package/lib/types/client/workbuddy/locales.d.ts +768 -0
  29. package/lib/types/client/workbuddy/locales.d.ts.map +1 -0
  30. package/lib/types/client/workbuddy/styles.d.ts +21 -0
  31. package/lib/types/client/workbuddy/styles.d.ts.map +1 -0
  32. package/lib/types/client/workbuddy/useWorkBuddySection.d.ts +149 -0
  33. package/lib/types/client/workbuddy/useWorkBuddySection.d.ts.map +1 -0
  34. package/lib/types/compat.d.ts +1 -1
  35. package/lib/types/entry-plan-mode-pipeline.d.ts +191 -0
  36. package/lib/types/entry-plan-mode-pipeline.d.ts.map +1 -0
  37. package/lib/types/host/agent-preset.d.ts.map +1 -1
  38. package/lib/types/host/cache-warmup/contracts.d.ts +5 -1
  39. package/lib/types/host/cache-warmup/contracts.d.ts.map +1 -1
  40. package/lib/types/host/cache-warmup/install.d.ts.map +1 -1
  41. package/lib/types/host/cache-warmup/projection.d.ts.map +1 -1
  42. package/lib/types/host/cache-warmup/retrieval-intent.d.ts +18 -0
  43. package/lib/types/host/cache-warmup/retrieval-intent.d.ts.map +1 -0
  44. package/lib/types/host/cache-warmup/settings.d.ts +9 -2
  45. package/lib/types/host/cache-warmup/settings.d.ts.map +1 -1
  46. package/lib/types/host/common/capabilities.d.ts.map +1 -1
  47. package/lib/types/host/common/model-request-control.d.ts +1 -1
  48. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  49. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  50. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  51. package/lib/types/host/compaction-prompt.d.ts +129 -0
  52. package/lib/types/host/compaction-prompt.d.ts.map +1 -0
  53. package/lib/types/host/preset-sync.d.ts.map +1 -1
  54. package/lib/types/host/responses-client.d.ts.map +1 -1
  55. package/lib/types/host/workbuddy/account-pool.d.ts +389 -0
  56. package/lib/types/host/workbuddy/account-pool.d.ts.map +1 -0
  57. package/lib/types/host/workbuddy/adapter.d.ts +249 -0
  58. package/lib/types/host/workbuddy/adapter.d.ts.map +1 -0
  59. package/lib/types/host/workbuddy/atrest.d.ts +98 -0
  60. package/lib/types/host/workbuddy/atrest.d.ts.map +1 -0
  61. package/lib/types/host/workbuddy/checkin.d.ts +150 -0
  62. package/lib/types/host/workbuddy/checkin.d.ts.map +1 -0
  63. package/lib/types/host/workbuddy/client.d.ts +214 -0
  64. package/lib/types/host/workbuddy/client.d.ts.map +1 -0
  65. package/lib/types/host/workbuddy/dsml.d.ts +55 -0
  66. package/lib/types/host/workbuddy/dsml.d.ts.map +1 -0
  67. package/lib/types/host/workbuddy/guardrails.d.ts +111 -0
  68. package/lib/types/host/workbuddy/guardrails.d.ts.map +1 -0
  69. package/lib/types/host/workbuddy/identity.d.ts +71 -0
  70. package/lib/types/host/workbuddy/identity.d.ts.map +1 -0
  71. package/lib/types/host/workbuddy/mapper.d.ts +238 -0
  72. package/lib/types/host/workbuddy/mapper.d.ts.map +1 -0
  73. package/lib/types/host/workbuddy/model-catalog.d.ts +217 -0
  74. package/lib/types/host/workbuddy/model-catalog.d.ts.map +1 -0
  75. package/lib/types/host/workbuddy/oauth.d.ts +47 -0
  76. package/lib/types/host/workbuddy/oauth.d.ts.map +1 -0
  77. package/lib/types/host/workbuddy/outbound-identity.d.ts +139 -0
  78. package/lib/types/host/workbuddy/outbound-identity.d.ts.map +1 -0
  79. package/lib/types/host/workbuddy/routes.d.ts +56 -0
  80. package/lib/types/host/workbuddy/routes.d.ts.map +1 -0
  81. package/lib/types/host/workbuddy/token-store.d.ts +370 -0
  82. package/lib/types/host/workbuddy/token-store.d.ts.map +1 -0
  83. package/lib/types/host/workbuddy/types.d.ts +179 -0
  84. package/lib/types/host/workbuddy/types.d.ts.map +1 -0
  85. package/lib/types/index.d.ts +35 -0
  86. package/lib/types/index.d.ts.map +1 -1
  87. package/lib/types/shared/workbuddy-contracts.d.ts +531 -0
  88. package/lib/types/shared/workbuddy-contracts.d.ts.map +1 -0
  89. package/package.json +6 -2
  90. package/presets/dispatch/README.md +57 -3
  91. package/presets/dispatch/agent.cordis.yml +42 -13
@@ -10,6 +10,9 @@
10
10
  # 2. plan-mode — adds the grilling interview loop (design tree, frontier,
11
11
  # rounds) in front of planning, so a plan is never presented over unmet
12
12
  # requirements.
13
+ # 3. plan-mode-pipeline — enters Plan Mode the moment an L2 interview
14
+ # converges, so the plan is written inside Plan Mode and approved through
15
+ # exit_plan_mode instead of being pasted into a normal reply.
13
16
  #
14
17
  # Deliberately NOT configured here:
15
18
  # * `tool-subagent.config.agentOptions` — binding provider/model would defeat
@@ -161,6 +164,16 @@
161
164
  Fix the trigger condition on hard rejections instead of treating them as fallback grounds: on active child limit -> wait for existing children to settle and re-dispatch; on subagent model selection -> specify an explicit provider/model from the authorized routes listed in the error; on route-inheritance rejection -> switch to an explicit-route subagent tool or switch this session to an allowed model. Unless the condition is fixed, the same rejection will recur.
162
165
  Reset: fallback applies only to the current task. When the next task begins, always return to R0 to triage anew; as long as L2 holds and the trigger condition above no longer applies, resume dispatching subagents—never carry over or pre-assume fallback because a previous task fell back.
163
166
 
167
+ ## R9 · Plan Pipeline (Converged Interview -> Plan Mode -> Plan -> Approval)
168
+ The order is fixed: converge the interview, enter Plan Mode, write the plan there, and submit it for approval. A stage is never skipped and never reordered.
169
+ - Trigger: only when the task is L2 and the R-G interview has converged—the frontier is empty and the user has explicitly confirmed shared understanding. Call enter_plan_mode immediately once that holds, before any read-only exploration or planning for the task itself. Never call it for an L0/L1 task, and never call it while any frontier question is still open.
170
+ - Entry is the whole step: that step does nothing else. Read-only exploration and the decision-complete plan belong to the next turn, inside Plan Mode, and exit_plan_mode must be the sole and final tool call of the turn that submits the plan—the same wording the plan-mode section carries, so the two never disagree.
171
+ - Rejection: on "Keep planning", fold the feedback into the plan and submit it again via exit_plan_mode. A rejection is not an exit, so stay in Plan Mode.
172
+ - Abandon: call leave_plan_mode with a reason only when the user explicitly says no plan is wanted. It is not an approval exit—never use leave_plan_mode to bypass exit_plan_mode approval.
173
+ - Absent tool: when enter_plan_mode is missing from the tool list (an older harness generation, or the plugin row switched off), the degraded path is one ask_user_question asking the user to enter /plan, then continue under the configured plan-mode section. Never substitute a plan pasted into a normal reply.
174
+ - Relationship to R-G G5: convergence enters Plan Mode; a plan is never presented from ordinary mode instead of passing through enter_plan_mode and exit_plan_mode.
175
+ - Subagent: a child spawned from this session inherits this preset, so enter_plan_mode and leave_plan_mode are visible in its tool list—visibility is not permission, and it must treat both as unavailable. What the bridge can enforce depends on the harness generation: where the host exposes the live root set (agents.roots()), a call made by a live child is rejected with DELEGATED_CALLER, while an older generation cannot determine roots at all and the bridge lets the call through. Never rely on that rejection—a subagent neither enters Plan Mode on its own nor submits a plan, and it carries the open decision, including any request to enter Plan Mode, back to its dispatcher in every generation.
176
+
164
177
  ## Anti-Patterns (Any Occurrence Is a Violation)
165
178
  1. Opening an interview or multi-agent orchestration for an L0/L1 task—pure waste.
166
179
  2. Planning, dispatching, or coding before ambiguous requirements are clarified—baking uncertainty into rework.
@@ -182,6 +195,8 @@
182
195
  18. Writing a task brief with a range where a cap belongs ("2–5 files", "1–2 questions", "a few attempts")—the strictest reading wins and the budget shrinks to its lower bound (R0, R5).
183
196
  19. Asking a subagent to restate its rules as a correctness check instead of verifying the ambiguous ones with one tool call—restatement reproduces the misreading (R5).
184
197
  20. Reporting a route as "authorized", or claiming per-task routing is in force, when the session recorded no allowlist (R2 [State: Unlisted]).
198
+ 21. Entering Plan Mode for an L0/L1 task, or before the R-G interview has converged—Plan Mode is the L2 planning stage, not a place to finish the interview (R9, R-G G5).
199
+ 22. Using leave_plan_mode to bypass exit_plan_mode approval—leaving Plan Mode abandons the plan, it does not approve it (R9).
185
200
 
186
201
  - id: agent-instructions
187
202
  name: '@deepseek-ai/dsh-agent-instructions'
@@ -266,14 +281,26 @@
266
281
  - id: plan-mode
267
282
  name: '@deepseek-ai/dsh-plan-mode'
268
283
  config:
284
+ # Compressed to ONE sentence on purpose: this section is re-rendered on
285
+ # EVERY step of Plan Mode, so its bytes are a resident cost (README.md).
286
+ # It is still the ONLY guardrail on the manual /plan path — the degraded
287
+ # entry R9 keeps for an older harness or a switched-off plugin row — where
288
+ # no enter_plan_mode tool result ever arrives. So five rules stay here in
289
+ # compressed form: stay in Plan Mode until exit_plan_mode submits, treat
290
+ # "implement" as "plan it", chat approval is not plan approval, explore
291
+ # read-only, and implement nothing before approval. The rest (plan
292
+ # completeness, exit_plan_mode as the sole and final call, the rejection
293
+ # loop) moved to the enter_plan_mode tool result, which is appended AFTER
294
+ # the cached prefix and therefore invalidates nothing.
269
295
  section: |
270
- [Plan Mode] Plan Mode is active. Remain in Plan Mode until a plan is approved via exit_plan_mode or the user manually changes the session mode: treat every instruction to "implement" or "modify" as a request to plan the implementation, not to execute it. Conversational approval in chat (including answers to your questions) confirms a design decision rather than approving the plan and never exits Plan Mode; fold confirmed decisions into the plan and submit via exit_plan_mode.
271
-
272
- [Read-Only Exploration & Clarification Interview] Inspect the repository first using non-mutating reads, searches, and static checks, preferring existing functions, utilities, and patterns; never edit or write files, mutate config, run formatters/codegen that rewrite tracked files, commit, or otherwise enact the plan. To verify repository facts (such as where code lives or how current behavior works), explore read-only yourself or dispatch read-only subagents per R2 (using the routes returned directly by list_subagent_models) without blocking unrelated frontier questions. Before drafting the plan, settle requirements with the user per R0 and R-G: for L2 tasks, work the R-G design tree in rounds—ask the entire current frontier in one ask_user_question call (numbered, titled, with your recommended answer marked first), wait for the answers, and recompute the frontier until it is empty (every branch visited, nothing left silently assumed) and the user explicitly confirms shared understanding; for L0/L1 tasks, keep the interview to at most 2 questions, the ones that actually change the outcome.
296
+ [Plan Mode] Stay in Plan Mode until a plan is submitted via exit_plan_mode: settle requirements per R0/R-G, treat "implement" as "plan it", and treat chat approval as a design decision, not plan approval. Explore read-only (no edits, no commands that rewrite tracked files); implement nothing before approval.
273
297
 
274
- [Plan Completeness] Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; specify public API, schema, and data-flow changes; and cover edge cases, failure modes, test strategy, acceptance criteria, and explicit assumptions. Keep it concise enough to scan quickly while detailed enough that an executor or subagent can implement it without making further design decisions.
275
-
276
- [Plan Approval] When ready, call exit_plan_mode with the complete plan Markdown starting with a # Title heading, making exit_plan_mode the sole and final tool call of that turn: implementation or dispatch happens only in subsequent turns after approval. Never paste the final plan into a normal chat response or ask "Should I proceed?" in prose or via ask_user_question. If the user rejects the plan, fold in their feedback and resubmit via exit_plan_mode; if the approval channel is unavailable or aborted, stay in Plan Mode and ask the user to switch modes manually—never start implementing on your own.
298
+ # Enters Plan Mode as soon as the R-G interview converges (R9). The row is
299
+ # this plugin's own subpath export, so it needs no harness package on any
300
+ # generation the plugin supports; the row's planModePipeline switch
301
+ # defaults to true, which is why no config block appears here.
302
+ - id: plan-mode-pipeline
303
+ name: '@eddyskywalker/dsh-chatgpt-subscription/plan-mode-pipeline'
277
304
 
278
305
  # ── compaction ──────────────────────────────────────────────────────────────
279
306
 
@@ -291,7 +318,6 @@
291
318
  group: true
292
319
  isolate:
293
320
  compaction: true
294
- toolResultPruner: true
295
321
  config:
296
322
  - id: compaction-basic
297
323
  name: '@deepseek-ai/dsh-compaction-basic'
@@ -299,12 +325,15 @@
299
325
  - id: command-compact
300
326
  name: '@deepseek-ai/dsh-command-compact'
301
327
 
302
- - id: tool-result-pruner
303
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
304
- config:
305
- thresholdChars: 8192
306
- headChars: 4096
307
- tailChars: 1024
328
+ # The tool-result pruner is deliberately absent. Pruning rewrites a
329
+ # historical tool result, which invalidates the provider's content-prefix
330
+ # cache from that point to the end of the conversation: measured on a real
331
+ # 838k-token session, one pass removed ~418k tokens of context but charged
332
+ # ~414k full-price input tokens to rebuild the prefix. Summary compaction
333
+ # reaches the same reduction for ~20-28k tokens of rebuild, so on a
334
+ # cache-prefix provider the pruner costs more than it saves.
335
+ # `compaction-basic` treats a missing pruner as "skip the model-free pass"
336
+ # at both of its call sites, so this row is the supported way to opt out.
308
337
 
309
338
  # ── delegation and workflows ────────────────────────────────────────────────
310
339