opencode-matrixx 2.6.3 → 2.6.5

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 (112) hide show
  1. package/dist/agents/dynamic-agent-prompt-builder.d.ts +5 -3
  2. package/dist/agents/mouse/agent.d.ts +1 -1
  3. package/dist/agents/oracle/behavioral-summary.d.ts +1 -1
  4. package/dist/agents/oracle/identity-constraints.d.ts +1 -1
  5. package/dist/agents/oracle/plan-generation.d.ts +1 -1
  6. package/dist/agents/oracle/plan-template.d.ts +1 -1
  7. package/dist/agents/oracle/system-prompt.d.ts +4 -3
  8. package/dist/agents/smith.d.ts +1 -1
  9. package/dist/agents/types.d.ts +1 -1
  10. package/dist/cli/setup/index.d.ts +1 -0
  11. package/dist/cli/setup/preset-wizard.d.ts +36 -0
  12. package/dist/cli/setup/types.d.ts +5 -0
  13. package/dist/cli.js +581 -49
  14. package/dist/config/index.d.ts +0 -1
  15. package/dist/config/migrations/index.d.ts +1 -0
  16. package/dist/config/migrations/model-migration.d.ts +17 -0
  17. package/dist/config/preset-applier.d.ts +17 -0
  18. package/dist/config/schema/agent-overrides.d.ts +0 -133
  19. package/dist/config/schema/categories.d.ts +0 -14
  20. package/dist/config/schema/commands.d.ts +1 -1
  21. package/dist/config/schema/failure-counter.d.ts +7 -0
  22. package/dist/config/schema/hooks.d.ts +1 -0
  23. package/dist/config/schema/matrixx-config.d.ts +61 -134
  24. package/dist/config/schema/model-config.d.ts +59 -0
  25. package/dist/config/schema/model-presets.d.ts +40 -0
  26. package/dist/config/schema/morpheus.d.ts +4 -0
  27. package/dist/config/schema/task.d.ts +6 -0
  28. package/dist/config/schema/tasks.d.ts +25 -0
  29. package/dist/config/schema.d.ts +5 -0
  30. package/dist/create-hooks.d.ts +1 -0
  31. package/dist/features/background-agent/manager.d.ts +8 -0
  32. package/dist/features/builtin-commands/templates/preset.d.ts +1 -0
  33. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  34. package/dist/features/builtin-commands/types.d.ts +1 -1
  35. package/dist/features/mission-state/plan-storage.d.ts +1 -0
  36. package/dist/features/mission-state/plan-storage.test.d.ts +1 -0
  37. package/dist/features/preset-state/index.d.ts +1 -0
  38. package/dist/features/preset-state/manager.d.ts +5 -0
  39. package/dist/features/session-state/state.d.ts +32 -0
  40. package/dist/features/session-state/state.test.d.ts +1 -0
  41. package/dist/features/task-storage/types.d.ts +3 -0
  42. package/dist/hooks/context-mode-enforcer/constants.d.ts +1 -1
  43. package/dist/hooks/failure-counter/counter.d.ts +7 -0
  44. package/dist/hooks/failure-counter/counter.test.d.ts +1 -0
  45. package/dist/hooks/failure-counter/hook.d.ts +18 -0
  46. package/dist/hooks/failure-counter/index.d.ts +3 -0
  47. package/dist/hooks/failure-counter/patterns.d.ts +6 -0
  48. package/dist/hooks/failure-counter/patterns.test.d.ts +1 -0
  49. package/dist/hooks/index.d.ts +1 -0
  50. package/dist/hooks/interactive-bash-session/hook.test.d.ts +1 -0
  51. package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
  52. package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
  53. package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
  54. package/dist/hooks/keyword-detector/ultrawork/deepseek.d.ts +1 -1
  55. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
  56. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
  57. package/dist/hooks/keyword-detector/ultrawork/glm.d.ts +1 -1
  58. package/dist/hooks/keyword-detector/ultrawork/mimo.d.ts +1 -1
  59. package/dist/hooks/stop-continuation-guard/hook.d.ts +3 -2
  60. package/dist/hooks/stop-continuation-guard/repro.test.d.ts +1 -0
  61. package/dist/hooks/task-continuation-enforcer/awaiting-user.test.d.ts +1 -0
  62. package/dist/hooks/task-continuation-enforcer/continuation-injection.d.ts +2 -0
  63. package/dist/hooks/task-continuation-enforcer/continuation-injection.test.d.ts +1 -0
  64. package/dist/hooks/task-continuation-enforcer/countdown.d.ts +2 -0
  65. package/dist/hooks/task-continuation-enforcer/handler.d.ts +2 -0
  66. package/dist/hooks/task-continuation-enforcer/idle-event.d.ts +2 -0
  67. package/dist/hooks/task-continuation-enforcer/staleness.d.ts +22 -0
  68. package/dist/hooks/task-continuation-enforcer/staleness.test.d.ts +1 -0
  69. package/dist/hooks/task-continuation-enforcer/todo.d.ts +23 -0
  70. package/dist/hooks/task-continuation-enforcer/todo.test.d.ts +1 -0
  71. package/dist/hooks/task-continuation-enforcer/types.d.ts +6 -0
  72. package/dist/hooks/task-edit-guard/constants.d.ts +2 -0
  73. package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +1 -1
  74. package/dist/hooks/todo-continuation-enforcer/awaiting-user.test.d.ts +1 -0
  75. package/dist/hooks/todo-continuation-enforcer/types.d.ts +3 -0
  76. package/dist/index.js +30326 -29061
  77. package/dist/matrixx.schema.json +286 -190
  78. package/dist/mcp/types.d.ts +1 -1
  79. package/dist/mcp/{grep-app.d.ts → white-rabbit.d.ts} +1 -1
  80. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  81. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
  82. package/dist/plugin-handlers/oracle-agent-config-builder.d.ts +2 -1
  83. package/dist/shared/awaiting-user.d.ts +12 -0
  84. package/dist/shared/config-errors.d.ts +3 -0
  85. package/dist/shared/merge-categories.d.ts +0 -4
  86. package/dist/shared/model-requirements.d.ts +9 -0
  87. package/dist/shared/task-system-gating.d.ts +10 -0
  88. package/dist/tools/delegate-task/categories.d.ts +4 -8
  89. package/dist/tools/delegate-task/complexity-constants.d.ts +10 -11
  90. package/dist/tools/delegate-task/executor-types.d.ts +9 -1
  91. package/dist/tools/delegate-task/index.d.ts +1 -1
  92. package/dist/tools/delegate-task/timing.d.ts +5 -0
  93. package/dist/tools/delegate-task/types.d.ts +7 -1
  94. package/dist/tools/index.d.ts +6 -0
  95. package/dist/tools/plan/constants.d.ts +10 -0
  96. package/dist/tools/plan/index.d.ts +6 -0
  97. package/dist/tools/plan/plan-create.d.ts +3 -0
  98. package/dist/tools/plan/plan-delete.d.ts +3 -0
  99. package/dist/tools/plan/plan-list.d.ts +3 -0
  100. package/dist/tools/plan/plan-read.d.ts +3 -0
  101. package/dist/tools/plan/plan-update.d.ts +3 -0
  102. package/dist/tools/plan/types.d.ts +28 -0
  103. package/dist/tools/preset/index.d.ts +1 -0
  104. package/dist/tools/preset/tools.d.ts +7 -0
  105. package/dist/tools/task/constants.d.ts +6 -0
  106. package/dist/tools/task/types.d.ts +2 -0
  107. package/package.json +1 -1
  108. package/dist/config/presets.d.ts +0 -4
  109. package/dist/config/resolve-tiers.d.ts +0 -32
  110. package/dist/features/builtin-commands/templates/profile.d.ts +0 -1
  111. package/dist/shared/model-tiers.d.ts +0 -31
  112. package/dist/shared/tier-resolver.d.ts +0 -26
@@ -2,13 +2,18 @@ import { z } from "zod";
2
2
  export declare const MatrixxConfigSchema: z.ZodObject<{
3
3
  $schema: z.ZodOptional<z.ZodString>;
4
4
  global_model: z.ZodOptional<z.ZodString>;
5
- default_tier: z.ZodOptional<z.ZodEnum<{
6
- free: "free";
7
- fast: "fast";
8
- standard: "standard";
9
- premium: "premium";
10
- frontier: "frontier";
11
- }>>;
5
+ model_presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
6
+ default_model: z.ZodOptional<z.ZodString>;
7
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
8
+ model: z.ZodString;
9
+ variant: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>>>;
11
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
12
+ model: z.ZodString;
13
+ variant: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>>>;
15
+ }, z.core.$strip>>>;
16
+ active_preset: z.ZodOptional<z.ZodString>;
12
17
  new_task_system_enabled: z.ZodOptional<z.ZodBoolean>;
13
18
  default_run_agent: z.ZodOptional<z.ZodString>;
14
19
  disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -128,6 +133,7 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
128
133
  "evolution-hitl": "evolution-hitl";
129
134
  "context-mode-enforcer": "context-mode-enforcer";
130
135
  "task-edit-guard": "task-edit-guard";
136
+ "failure-counter": "failure-counter";
131
137
  }>, z.ZodPipe<z.ZodLiteral<"anthropic-context-window-limit-recovery">, z.ZodTransform<"context-window-limit-recovery", "anthropic-context-window-limit-recovery">>]>>>;
132
138
  disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
133
139
  "bdd-contract": "bdd-contract";
@@ -141,7 +147,7 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
141
147
  refactor: "refactor";
142
148
  "start-work": "start-work";
143
149
  "stop-continuation": "stop-continuation";
144
- profile: "profile";
150
+ preset: "preset";
145
151
  "end-ultrawork": "end-ultrawork";
146
152
  handoff: "handoff";
147
153
  research: "research";
@@ -154,13 +160,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
154
160
  agents: z.ZodOptional<z.ZodObject<{
155
161
  build: z.ZodOptional<z.ZodObject<{
156
162
  model: z.ZodOptional<z.ZodString>;
157
- tier: z.ZodOptional<z.ZodEnum<{
158
- free: "free";
159
- fast: "fast";
160
- standard: "standard";
161
- premium: "premium";
162
- frontier: "frontier";
163
- }>>;
164
163
  variant: z.ZodOptional<z.ZodString>;
165
164
  category: z.ZodOptional<z.ZodString>;
166
165
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -241,13 +240,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
241
240
  }, z.core.$strip>>;
242
241
  plan: z.ZodOptional<z.ZodObject<{
243
242
  model: z.ZodOptional<z.ZodString>;
244
- tier: z.ZodOptional<z.ZodEnum<{
245
- free: "free";
246
- fast: "fast";
247
- standard: "standard";
248
- premium: "premium";
249
- frontier: "frontier";
250
- }>>;
251
243
  variant: z.ZodOptional<z.ZodString>;
252
244
  category: z.ZodOptional<z.ZodString>;
253
245
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -328,13 +320,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
328
320
  }, z.core.$strip>>;
329
321
  morpheus: z.ZodOptional<z.ZodObject<{
330
322
  model: z.ZodOptional<z.ZodString>;
331
- tier: z.ZodOptional<z.ZodEnum<{
332
- free: "free";
333
- fast: "fast";
334
- standard: "standard";
335
- premium: "premium";
336
- frontier: "frontier";
337
- }>>;
338
323
  variant: z.ZodOptional<z.ZodString>;
339
324
  category: z.ZodOptional<z.ZodString>;
340
325
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -415,13 +400,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
415
400
  }, z.core.$strip>>;
416
401
  keymaker: z.ZodOptional<z.ZodObject<{
417
402
  model: z.ZodOptional<z.ZodString>;
418
- tier: z.ZodOptional<z.ZodEnum<{
419
- free: "free";
420
- fast: "fast";
421
- standard: "standard";
422
- premium: "premium";
423
- frontier: "frontier";
424
- }>>;
425
403
  variant: z.ZodOptional<z.ZodString>;
426
404
  category: z.ZodOptional<z.ZodString>;
427
405
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -502,13 +480,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
502
480
  }, z.core.$strip>>;
503
481
  mouse: z.ZodOptional<z.ZodObject<{
504
482
  model: z.ZodOptional<z.ZodString>;
505
- tier: z.ZodOptional<z.ZodEnum<{
506
- free: "free";
507
- fast: "fast";
508
- standard: "standard";
509
- premium: "premium";
510
- frontier: "frontier";
511
- }>>;
512
483
  variant: z.ZodOptional<z.ZodString>;
513
484
  category: z.ZodOptional<z.ZodString>;
514
485
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -589,13 +560,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
589
560
  }, z.core.$strip>>;
590
561
  "OpenCode-Builder": z.ZodOptional<z.ZodObject<{
591
562
  model: z.ZodOptional<z.ZodString>;
592
- tier: z.ZodOptional<z.ZodEnum<{
593
- free: "free";
594
- fast: "fast";
595
- standard: "standard";
596
- premium: "premium";
597
- frontier: "frontier";
598
- }>>;
599
563
  variant: z.ZodOptional<z.ZodString>;
600
564
  category: z.ZodOptional<z.ZodString>;
601
565
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -676,13 +640,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
676
640
  }, z.core.$strip>>;
677
641
  oracle: z.ZodOptional<z.ZodObject<{
678
642
  model: z.ZodOptional<z.ZodString>;
679
- tier: z.ZodOptional<z.ZodEnum<{
680
- free: "free";
681
- fast: "fast";
682
- standard: "standard";
683
- premium: "premium";
684
- frontier: "frontier";
685
- }>>;
686
643
  variant: z.ZodOptional<z.ZodString>;
687
644
  category: z.ZodOptional<z.ZodString>;
688
645
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -763,13 +720,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
763
720
  }, z.core.$strip>>;
764
721
  seraph: z.ZodOptional<z.ZodObject<{
765
722
  model: z.ZodOptional<z.ZodString>;
766
- tier: z.ZodOptional<z.ZodEnum<{
767
- free: "free";
768
- fast: "fast";
769
- standard: "standard";
770
- premium: "premium";
771
- frontier: "frontier";
772
- }>>;
773
723
  variant: z.ZodOptional<z.ZodString>;
774
724
  category: z.ZodOptional<z.ZodString>;
775
725
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -850,13 +800,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
850
800
  }, z.core.$strip>>;
851
801
  smith: z.ZodOptional<z.ZodObject<{
852
802
  model: z.ZodOptional<z.ZodString>;
853
- tier: z.ZodOptional<z.ZodEnum<{
854
- free: "free";
855
- fast: "fast";
856
- standard: "standard";
857
- premium: "premium";
858
- frontier: "frontier";
859
- }>>;
860
803
  variant: z.ZodOptional<z.ZodString>;
861
804
  category: z.ZodOptional<z.ZodString>;
862
805
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -937,13 +880,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
937
880
  }, z.core.$strip>>;
938
881
  merovingian: z.ZodOptional<z.ZodObject<{
939
882
  model: z.ZodOptional<z.ZodString>;
940
- tier: z.ZodOptional<z.ZodEnum<{
941
- free: "free";
942
- fast: "fast";
943
- standard: "standard";
944
- premium: "premium";
945
- frontier: "frontier";
946
- }>>;
947
883
  variant: z.ZodOptional<z.ZodString>;
948
884
  category: z.ZodOptional<z.ZodString>;
949
885
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1024,13 +960,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1024
960
  }, z.core.$strip>>;
1025
961
  operator: z.ZodOptional<z.ZodObject<{
1026
962
  model: z.ZodOptional<z.ZodString>;
1027
- tier: z.ZodOptional<z.ZodEnum<{
1028
- free: "free";
1029
- fast: "fast";
1030
- standard: "standard";
1031
- premium: "premium";
1032
- frontier: "frontier";
1033
- }>>;
1034
963
  variant: z.ZodOptional<z.ZodString>;
1035
964
  category: z.ZodOptional<z.ZodString>;
1036
965
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1111,13 +1040,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1111
1040
  }, z.core.$strip>>;
1112
1041
  trinity: z.ZodOptional<z.ZodObject<{
1113
1042
  model: z.ZodOptional<z.ZodString>;
1114
- tier: z.ZodOptional<z.ZodEnum<{
1115
- free: "free";
1116
- fast: "fast";
1117
- standard: "standard";
1118
- premium: "premium";
1119
- frontier: "frontier";
1120
- }>>;
1121
1043
  variant: z.ZodOptional<z.ZodString>;
1122
1044
  category: z.ZodOptional<z.ZodString>;
1123
1045
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1198,13 +1120,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1198
1120
  }, z.core.$strip>>;
1199
1121
  construct: z.ZodOptional<z.ZodObject<{
1200
1122
  model: z.ZodOptional<z.ZodString>;
1201
- tier: z.ZodOptional<z.ZodEnum<{
1202
- free: "free";
1203
- fast: "fast";
1204
- standard: "standard";
1205
- premium: "premium";
1206
- frontier: "frontier";
1207
- }>>;
1208
1123
  variant: z.ZodOptional<z.ZodString>;
1209
1124
  category: z.ZodOptional<z.ZodString>;
1210
1125
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1285,13 +1200,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1285
1200
  }, z.core.$strip>>;
1286
1201
  architect: z.ZodOptional<z.ZodObject<{
1287
1202
  model: z.ZodOptional<z.ZodString>;
1288
- tier: z.ZodOptional<z.ZodEnum<{
1289
- free: "free";
1290
- fast: "fast";
1291
- standard: "standard";
1292
- premium: "premium";
1293
- frontier: "frontier";
1294
- }>>;
1295
1203
  variant: z.ZodOptional<z.ZodString>;
1296
1204
  category: z.ZodOptional<z.ZodString>;
1297
1205
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1372,13 +1280,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1372
1280
  }, z.core.$strip>>;
1373
1281
  cipher: z.ZodOptional<z.ZodObject<{
1374
1282
  model: z.ZodOptional<z.ZodString>;
1375
- tier: z.ZodOptional<z.ZodEnum<{
1376
- free: "free";
1377
- fast: "fast";
1378
- standard: "standard";
1379
- premium: "premium";
1380
- frontier: "frontier";
1381
- }>>;
1382
1283
  variant: z.ZodOptional<z.ZodString>;
1383
1284
  category: z.ZodOptional<z.ZodString>;
1384
1285
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1459,13 +1360,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1459
1360
  }, z.core.$strip>>;
1460
1361
  sentinel: z.ZodOptional<z.ZodObject<{
1461
1362
  model: z.ZodOptional<z.ZodString>;
1462
- tier: z.ZodOptional<z.ZodEnum<{
1463
- free: "free";
1464
- fast: "fast";
1465
- standard: "standard";
1466
- premium: "premium";
1467
- frontier: "frontier";
1468
- }>>;
1469
1363
  variant: z.ZodOptional<z.ZodString>;
1470
1364
  category: z.ZodOptional<z.ZodString>;
1471
1365
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1546,13 +1440,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1546
1440
  }, z.core.$strip>>;
1547
1441
  sati: z.ZodOptional<z.ZodObject<{
1548
1442
  model: z.ZodOptional<z.ZodString>;
1549
- tier: z.ZodOptional<z.ZodEnum<{
1550
- free: "free";
1551
- fast: "fast";
1552
- standard: "standard";
1553
- premium: "premium";
1554
- frontier: "frontier";
1555
- }>>;
1556
1443
  variant: z.ZodOptional<z.ZodString>;
1557
1444
  category: z.ZodOptional<z.ZodString>;
1558
1445
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1635,13 +1522,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1635
1522
  categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1636
1523
  description: z.ZodOptional<z.ZodString>;
1637
1524
  model: z.ZodOptional<z.ZodString>;
1638
- tier: z.ZodOptional<z.ZodEnum<{
1639
- free: "free";
1640
- fast: "fast";
1641
- standard: "standard";
1642
- premium: "premium";
1643
- frontier: "frontier";
1644
- }>>;
1645
1525
  variant: z.ZodOptional<z.ZodString>;
1646
1526
  temperature: z.ZodOptional<z.ZodNumber>;
1647
1527
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1803,6 +1683,11 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1803
1683
  default_max_iterations: z.ZodDefault<z.ZodNumber>;
1804
1684
  state_dir: z.ZodOptional<z.ZodString>;
1805
1685
  }, z.core.$strip>>;
1686
+ failure_counter: z.ZodOptional<z.ZodObject<{
1687
+ enabled: z.ZodDefault<z.ZodBoolean>;
1688
+ threshold: z.ZodDefault<z.ZodNumber>;
1689
+ resetOnSuccess: z.ZodDefault<z.ZodBoolean>;
1690
+ }, z.core.$strip>>;
1806
1691
  background_task: z.ZodOptional<z.ZodObject<{
1807
1692
  defaultConcurrency: z.ZodOptional<z.ZodNumber>;
1808
1693
  providerConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
@@ -1822,6 +1707,21 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1822
1707
  babysitting: z.ZodOptional<z.ZodObject<{
1823
1708
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1824
1709
  }, z.core.$strip>>;
1710
+ tasks: z.ZodOptional<z.ZodObject<{
1711
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1712
+ scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1713
+ project: "project";
1714
+ global: "global";
1715
+ }>>>;
1716
+ storage_path: z.ZodOptional<z.ZodString>;
1717
+ task_list_id: z.ZodOptional<z.ZodString>;
1718
+ stale_after_hours: z.ZodOptional<z.ZodNumber>;
1719
+ session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1720
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
1721
+ }, z.core.$strip>>;
1722
+ task: z.ZodOptional<z.ZodObject<{
1723
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
1724
+ }, z.core.$strip>>;
1825
1725
  tdd_enforcer: z.ZodOptional<z.ZodObject<{
1826
1726
  enabled: z.ZodDefault<z.ZodBoolean>;
1827
1727
  }, z.core.$strip>>;
@@ -1860,6 +1760,8 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1860
1760
  project: "project";
1861
1761
  global: "global";
1862
1762
  }>>>;
1763
+ stale_after_hours: z.ZodOptional<z.ZodNumber>;
1764
+ session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1863
1765
  }, z.core.$strip>>;
1864
1766
  }, z.core.$strip>>;
1865
1767
  assembly: z.ZodOptional<z.ZodObject<{
@@ -1984,5 +1886,30 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1984
1886
  }, z.core.$strip>>;
1985
1887
  }, z.core.$strip>>;
1986
1888
  _migrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
1889
+ modelRequirements: z.ZodOptional<z.ZodObject<{
1890
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1891
+ fallbackChain: z.ZodArray<z.ZodObject<{
1892
+ providers: z.ZodArray<z.ZodString>;
1893
+ model: z.ZodString;
1894
+ variant: z.ZodOptional<z.ZodString>;
1895
+ }, z.core.$strip>>;
1896
+ requiresModel: z.ZodOptional<z.ZodString>;
1897
+ requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
1898
+ requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
1899
+ variant: z.ZodOptional<z.ZodString>;
1900
+ }, z.core.$strip>>>;
1901
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1902
+ fallbackChain: z.ZodArray<z.ZodObject<{
1903
+ providers: z.ZodArray<z.ZodString>;
1904
+ model: z.ZodString;
1905
+ variant: z.ZodOptional<z.ZodString>;
1906
+ }, z.core.$strip>>;
1907
+ requiresModel: z.ZodOptional<z.ZodString>;
1908
+ requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
1909
+ requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
1910
+ variant: z.ZodOptional<z.ZodString>;
1911
+ }, z.core.$strip>>>;
1912
+ }, z.core.$strip>>;
1913
+ complexityDowngrades: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
1987
1914
  }, z.core.$strip>;
1988
1915
  export type MatrixxConfig = z.infer<typeof MatrixxConfigSchema>;
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ export declare const ModelFallbackEntrySchema: z.ZodObject<{
3
+ providers: z.ZodArray<z.ZodString>;
4
+ model: z.ZodString;
5
+ variant: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export type ModelFallbackEntry = z.infer<typeof ModelFallbackEntrySchema>;
8
+ export declare const ComplexityDowngradesSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
9
+ export type ComplexityDowngrades = z.infer<typeof ComplexityDowngradesSchema>;
10
+ export declare const AgentModelRequirementsSchema: z.ZodObject<{
11
+ fallbackChain: z.ZodArray<z.ZodObject<{
12
+ providers: z.ZodArray<z.ZodString>;
13
+ model: z.ZodString;
14
+ variant: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>>;
16
+ requiresModel: z.ZodOptional<z.ZodString>;
17
+ requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
18
+ requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ variant: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type AgentModelRequirements = z.infer<typeof AgentModelRequirementsSchema>;
22
+ export declare const CategoryModelRequirementsSchema: z.ZodObject<{
23
+ fallbackChain: z.ZodArray<z.ZodObject<{
24
+ providers: z.ZodArray<z.ZodString>;
25
+ model: z.ZodString;
26
+ variant: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>>;
28
+ requiresModel: z.ZodOptional<z.ZodString>;
29
+ requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
30
+ requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
+ variant: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>;
33
+ export type CategoryModelRequirements = z.infer<typeof CategoryModelRequirementsSchema>;
34
+ export declare const ModelRequirementsSchema: z.ZodObject<{
35
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
36
+ fallbackChain: z.ZodArray<z.ZodObject<{
37
+ providers: z.ZodArray<z.ZodString>;
38
+ model: z.ZodString;
39
+ variant: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>>;
41
+ requiresModel: z.ZodOptional<z.ZodString>;
42
+ requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
43
+ requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
+ variant: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
46
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
47
+ fallbackChain: z.ZodArray<z.ZodObject<{
48
+ providers: z.ZodArray<z.ZodString>;
49
+ model: z.ZodString;
50
+ variant: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>>;
52
+ requiresModel: z.ZodOptional<z.ZodString>;
53
+ requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
54
+ requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ variant: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>>;
57
+ }, z.core.$strip>;
58
+ export type ModelRequirements = z.infer<typeof ModelRequirementsSchema>;
59
+ export declare const DEFAULT_MODEL_CONFIG: {};
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ /** A single model assignment inside a preset (agent or category). */
3
+ export declare const ModelPresetEntrySchema: z.ZodObject<{
4
+ model: z.ZodString;
5
+ variant: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export type ModelPresetEntry = z.infer<typeof ModelPresetEntrySchema>;
8
+ /**
9
+ * A named static model preset — explicit provider/model bundles per
10
+ * agent/category. Applied with fill-in semantics (never overwrites an
11
+ * explicit `model` on the target config entry).
12
+ */
13
+ export declare const ModelPresetSchema: z.ZodObject<{
14
+ default_model: z.ZodOptional<z.ZodString>;
15
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
16
+ model: z.ZodString;
17
+ variant: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>>;
19
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
20
+ model: z.ZodString;
21
+ variant: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>>>;
23
+ }, z.core.$strip>;
24
+ export type ModelPreset = z.infer<typeof ModelPresetSchema>;
25
+ /** Registry of named presets keyed by preset name. */
26
+ export declare const ModelPresetsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
27
+ default_model: z.ZodOptional<z.ZodString>;
28
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
29
+ model: z.ZodString;
30
+ variant: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>>;
32
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
33
+ model: z.ZodString;
34
+ variant: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>>>;
36
+ }, z.core.$strip>>;
37
+ export type ModelPresets = z.infer<typeof ModelPresetsSchema>;
38
+ /** Name of the active preset in `model_presets`. */
39
+ export declare const ActivePresetSchema: z.ZodString;
40
+ export type ActivePreset = z.infer<typeof ActivePresetSchema>;
@@ -6,6 +6,8 @@ declare const MorpheusTasksConfigSchema: z.ZodObject<{
6
6
  project: "project";
7
7
  global: "global";
8
8
  }>>>;
9
+ stale_after_hours: z.ZodOptional<z.ZodNumber>;
10
+ session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
9
11
  }, z.core.$strip>;
10
12
  export declare const MorpheusConfigSchema: z.ZodObject<{
11
13
  tasks: z.ZodOptional<z.ZodObject<{
@@ -15,6 +17,8 @@ export declare const MorpheusConfigSchema: z.ZodObject<{
15
17
  project: "project";
16
18
  global: "global";
17
19
  }>>>;
20
+ stale_after_hours: z.ZodOptional<z.ZodNumber>;
21
+ session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
18
22
  }, z.core.$strip>>;
19
23
  }, z.core.$strip>;
20
24
  export type MorpheusTasksConfig = z.infer<typeof MorpheusTasksConfigSchema>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ /** Task system configuration schema */
3
+ export declare const TaskConfigSchema: z.ZodObject<{
4
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
5
+ }, z.core.$strip>;
6
+ export type TaskConfig = z.infer<typeof TaskConfigSchema>;
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Canonical task-system configuration. Single home for everything
4
+ * task-related: master switch, storage, enforcer behavior, poll timeout.
5
+ *
6
+ * Legacy locations still parse (backward compat) and act as fallback
7
+ * with LOWER precedence — explicit `tasks.*` always wins:
8
+ * - `experimental.task_system` / `new_task_system_enabled` → `tasks.enabled`
9
+ * - `morpheus.tasks.*` → `tasks.*` (same key names)
10
+ * - `task.pollTimeoutMs` → `tasks.pollTimeoutMs`
11
+ * See `resolveTasksConfig()` in `src/shared/task-system-gating.ts`.
12
+ */
13
+ export declare const TasksConfigSchema: z.ZodObject<{
14
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
15
+ scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
16
+ project: "project";
17
+ global: "global";
18
+ }>>>;
19
+ storage_path: z.ZodOptional<z.ZodString>;
20
+ task_list_id: z.ZodOptional<z.ZodString>;
21
+ stale_after_hours: z.ZodOptional<z.ZodNumber>;
22
+ session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
23
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
24
+ }, z.core.$strip>;
25
+ export type TasksConfig = z.infer<typeof TasksConfigSchema>;
@@ -13,11 +13,14 @@ export * from "./schema/context-mode";
13
13
  export * from "./schema/dcp";
14
14
  export * from "./schema/evolution";
15
15
  export * from "./schema/experimental";
16
+ export * from "./schema/failure-counter";
16
17
  export * from "./schema/headroom";
17
18
  export * from "./schema/hooks";
18
19
  export * from "./schema/matrix-loop";
19
20
  export * from "./schema/matrixx-config";
20
21
  export * from "./schema/matrixx-self-config";
22
+ export * from "./schema/model-config";
23
+ export * from "./schema/model-presets";
21
24
  export * from "./schema/morpheus";
22
25
  export * from "./schema/morpheus-agent";
23
26
  export * from "./schema/notification";
@@ -25,6 +28,8 @@ export * from "./schema/rtk";
25
28
  export * from "./schema/runtime-fallback";
26
29
  export * from "./schema/security";
27
30
  export * from "./schema/skills";
31
+ export * from "./schema/task";
32
+ export * from "./schema/tasks";
28
33
  export * from "./schema/tdd-enforcer";
29
34
  export * from "./schema/tmux";
30
35
  export * from "./schema/websearch";
@@ -66,6 +66,7 @@ export declare function createHooks(args: {
66
66
  matrixLoop: ReturnType<typeof import("./hooks").createMatrixLoopHook> | null;
67
67
  editErrorRecovery: ReturnType<typeof import("./hooks").createEditErrorRecoveryHook> | null;
68
68
  delegateTaskRetry: ReturnType<typeof import("./hooks").createDelegateTaskRetryHook> | null;
69
+ failureCounter: ReturnType<typeof import("./hooks").createFailureCounterHook> | null;
69
70
  startWork: ReturnType<typeof import("./hooks").createStartWorkHook> | null;
70
71
  oracleMdOnly: ReturnType<typeof import("./hooks").createOracleMdOnlyHook> | null;
71
72
  mouseNotepad: ReturnType<typeof import("./hooks").createMouseNotepadHook> | null;
@@ -137,6 +137,14 @@ export declare class BackgroundManager {
137
137
  private notifyParentSession;
138
138
  private hasRunningTasks;
139
139
  private pruneStaleTasksAndNotifications;
140
+ /**
141
+ * True when the subagent session is awaiting user input (unanswered question).
142
+ * The reaper must not kill a task that is legitimately waiting for an answer:
143
+ * its session reports idle and it stops posting progress, but it is not stuck.
144
+ * Ground truth comes from the session message history (hasPendingQuestionMessage);
145
+ * on fetch failure we fail open (return false) so reaping behavior is unchanged.
146
+ */
147
+ private isSessionAwaitingUser;
140
148
  private checkAndInterruptStaleTasks;
141
149
  private pollRunningTasks;
142
150
  /**
@@ -0,0 +1 @@
1
+ export declare const PRESET_TEMPLATE = "You are managing the active model preset.\n\nThis command is provided by the Matrixx plugin. It uses the built-in `preset` tool to list, show, or switch model presets \u2014 no external scripts or direct config edits needed.\n\n## Usage\n\n```\n/preset \u2192 List available presets and mark the active one\n/preset list \u2192 List available presets\n/preset show [<name>] \u2192 Show a preset's agent/category model assignments (defaults to active)\n/preset set <name> \u2192 Switch the active preset for the current session (live)\n/preset set <name> --save [--global|--project] \u2192 Also persist active_preset to config\n```\n\n## Step 1: Determine the action\n\nParse the arguments passed to this command:\n\n- No arguments or `list` \u2192 call `preset` with `action: \"list\"`.\n- `show` \u2192 call `preset` with `action: \"show\"` (optionally `name`).\n- `set <name>` \u2192 call `preset` with `action: \"set\"`, `name: \"<name>\"`.\n- `set <name> --save` \u2192 also pass `save: true`; `--global` \u2192 `scope: \"global\"`, `--project` (default) \u2192 `scope: \"project\"`.\n\n## Step 2: Call the built-in `preset` tool\n\nUse the `preset` tool with the resolved arguments. The tool validates the preset name, applies the session overlay (delegate-task categories switch immediately), and \u2014 with `--save` \u2014 persists `active_preset` to the project (`.opencode/matrixx.jsonc`) or global (`~/.config/opencode/matrixx.jsonc`) config.\n\nThe tool handles all validation and file operations \u2014 do NOT edit config files directly.\n\n## Step 3: Confirm and instruct\n\nAfter a successful switch:\n\n1. Report the tool's output to the user.\n2. Note that delegate-task categories use the new preset immediately (session-scoped live switch).\n3. If `--save` was used, tell the user the persisted `active_preset` takes effect for builtin agents on the next session.\n\n## Important constraints\n\n- Use the built-in `preset` tool. Do NOT bypass it by editing config files directly.\n- Do not invent preset names \u2014 if the requested name is unknown, report the available presets and stop.\n- `--save` without a scope defaults to project scope.";
@@ -1 +1 @@
1
- export declare const START_WORK_TEMPLATE = "You are starting a Morpheus work session.\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Oracle-generated plan files at `.matrixx/plans/`\n\n2. **Check for active mission state**: Read `.matrixx/mission.json` if it exists\n\n3. **Decision logic**:\n - If `.matrixx/mission.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Create/Update mission.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\"\n }\n ```\n\n5. **Read the plan file** and start executing tasks according to architect workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update mission.json BEFORE starting work\n- Read the FULL plan file before delegating any tasks\n- Follow architect delegation protocols (7-section format)";
1
+ export declare const START_WORK_TEMPLATE = "You are starting a Morpheus work session.\n\n## WHAT TO DO\n\n1. **Find available plans**: List Oracle-generated plan files via plan_list at `.matrixx/plans/`\n\n2. **Check for active mission state**: Read `.matrixx/mission.json` if it exists\n\n3. **Decision logic**:\n - If `.matrixx/mission.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files via plan_list\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Create/Update mission.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\"\n }\n ```\n\n5. **Read the plan file via plan_read** and start executing tasks according to architect workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update mission.json BEFORE starting work\n- Read the FULL plan file via plan_read before delegating any tasks\n- Follow architect delegation protocols (7-section format)";
@@ -1,3 +1,3 @@
1
1
  import type { CommandDefinition } from "../command-loader";
2
- export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile" | "evolution" | "cleanup-tasks" | "task-list";
2
+ export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "preset" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile" | "evolution" | "cleanup-tasks" | "task-list";
3
3
  export type BuiltinCommands = Record<string, CommandDefinition>;
@@ -30,6 +30,7 @@ export declare function writePlanFile(directory: string, planPath: string, conte
30
30
  * For each `- [ ]` or `- [x]` line, finds the matching todo by content
31
31
  * and marks it completed if the todo status is completed/cancelled.
32
32
  * Lines without a matching todo keep their current state.
33
+ * Checked boxes are never unchecked — sync only transitions [ ] → [x].
33
34
  */
34
35
  export declare function syncCheckboxes(content: string, todos: Array<{
35
36
  content: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { _resetPresetStateForTesting, clearSessionPreset, getSessionPreset, setSessionPreset, } from "./manager";
@@ -0,0 +1,5 @@
1
+ export declare function setSessionPreset(sessionID: string, presetName: string): void;
2
+ export declare function getSessionPreset(sessionID: string): string | undefined;
3
+ export declare function clearSessionPreset(sessionID: string): void;
4
+ /** @internal */
5
+ export declare function _resetPresetStateForTesting(): void;
@@ -1,9 +1,41 @@
1
1
  export declare const subagentSessions: Set<string>;
2
+ export declare function registerSubagentSession(sessionID: string, parentSessionID: string): void;
3
+ export declare function unregisterSubagentSession(sessionID: string): void;
4
+ export declare function getParentSessionID(subagentSessionID: string): string | undefined;
5
+ /**
6
+ * Live subagent session IDs registered under the given parent session.
7
+ * Only sessions still present in `subagentSessions` (i.e. not yet
8
+ * unregistered on task end) are returned.
9
+ */
10
+ export declare function getSubagentSessionIDs(parentSessionID: string): string[];
2
11
  export declare function setMainSession(id: string | undefined): void;
3
12
  export declare function getMainSessionID(): string | undefined;
13
+ /**
14
+ * Whether a session.created payload should be tracked as the plugin's main
15
+ * session. Top-level sessions (no parentID) qualify UNLESS they are internal
16
+ * sessions of another plugin (e.g. opencode-mem structured-output capture
17
+ * sessions are top-level with metadata["opencode-mem"].internal === true).
18
+ * Foreign top-level sessions must not hijack main-session tracking.
19
+ */
20
+ export declare function isMainSessionCandidate(sessionInfo: {
21
+ id?: string;
22
+ parentID?: string;
23
+ metadata?: Record<string, unknown>;
24
+ } | undefined): boolean;
4
25
  /** @internal For testing only */
5
26
  export declare function _resetForTesting(): void;
6
27
  export declare function setSessionAgent(sessionID: string, agent: string): void;
7
28
  export declare function updateSessionAgent(sessionID: string, agent: string): void;
8
29
  export declare function getSessionAgent(sessionID: string): string | undefined;
9
30
  export declare function clearSessionAgent(sessionID: string): void;
31
+ export declare function incFailureCounter(sessionID: string): number;
32
+ export declare function resetFailureCounter(sessionID: string): void;
33
+ export declare function getFailureCount(sessionID: string): number;
34
+ export declare function getFailureState(sessionID: string): {
35
+ count: number;
36
+ lastFailedAt: number;
37
+ } | undefined;
38
+ export declare function clearFailureCounter(sessionID: string): void;
39
+ /** @internal For testing only */
40
+ export declare function _resetFailureCountersForTesting(): void;
41
+ export declare function isThresholdReached(sessionID: string, threshold: number): boolean;