@wrongstack/core 0.4.1 → 0.5.2

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 (64) hide show
  1. package/dist/{agent-bridge-DaOnnHNW.d.ts → agent-bridge-EiUFe3if.d.ts} +1 -1
  2. package/dist/{compactor-CFky6JKM.d.ts → compactor-BP4xhKVi.d.ts} +1 -1
  3. package/dist/{config-RlhKLjme.d.ts → config-BOD_HQBw.d.ts} +1 -1
  4. package/dist/{context-B1kBj1lY.d.ts → context-PH4DvBZV.d.ts} +60 -1
  5. package/dist/coordination/index.d.ts +10 -891
  6. package/dist/coordination/index.js +500 -238
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +20 -19
  9. package/dist/defaults/index.js +2210 -264
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/director-state-CVzkjKRZ.d.ts +539 -0
  12. package/dist/{events-BBaKeMfb.d.ts → events-oxn-Wkub.d.ts} +58 -1
  13. package/dist/execution/index.d.ts +19 -13
  14. package/dist/execution/index.js +15 -6
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/extension/index.d.ts +6 -6
  17. package/dist/index-CcbWbcpy.d.ts +899 -0
  18. package/dist/{index-meJRuQtc.d.ts → index-a12jc7-r.d.ts} +8 -6
  19. package/dist/index.d.ts +33 -28
  20. package/dist/index.js +3798 -1237
  21. package/dist/index.js.map +1 -1
  22. package/dist/infrastructure/index.d.ts +6 -6
  23. package/dist/infrastructure/index.js +67 -2
  24. package/dist/infrastructure/index.js.map +1 -1
  25. package/dist/kernel/index.d.ts +10 -9
  26. package/dist/kernel/index.js.map +1 -1
  27. package/dist/{mcp-servers-Cf4-bJnd.d.ts → mcp-servers-uPmBxZ1B.d.ts} +18 -3
  28. package/dist/models/index.d.ts +2 -2
  29. package/dist/models/index.js +106 -0
  30. package/dist/models/index.js.map +1 -1
  31. package/dist/{multi-agent-D5m66hzB.d.ts → multi-agent-D6S4Z7H8.d.ts} +71 -16
  32. package/dist/observability/index.d.ts +2 -2
  33. package/dist/{path-resolver-Bg4OP5fi.d.ts → path-resolver-CprD5DhS.d.ts} +9 -2
  34. package/dist/{provider-runner-CU9gnU2E.d.ts → provider-runner-DGisz_lG.d.ts} +3 -3
  35. package/dist/{skill-DayhFUBb.d.ts → retry-policy-DUJ8-Qc_.d.ts} +2 -28
  36. package/dist/sdd/index.d.ts +419 -5
  37. package/dist/sdd/index.js +1580 -1
  38. package/dist/sdd/index.js.map +1 -1
  39. package/dist/{secret-scrubber-DyUAWS09.d.ts → secret-scrubber-CB11A2P7.d.ts} +1 -1
  40. package/dist/{secret-scrubber-Dyh5LVYL.d.ts → secret-scrubber-EqFa0SyI.d.ts} +1 -1
  41. package/dist/security/index.d.ts +8 -4
  42. package/dist/security/index.js +8 -0
  43. package/dist/security/index.js.map +1 -1
  44. package/dist/{selector-DBEiwXBk.d.ts → selector-yqyxt-Ii.d.ts} +1 -1
  45. package/dist/{session-reader-D-z0AgHs.d.ts → session-reader-1tOyoY1s.d.ts} +1 -1
  46. package/dist/session-rewinder-C9HnMkhP.d.ts +23 -0
  47. package/dist/skill-CxuWrsKK.d.ts +29 -0
  48. package/dist/skills/index.d.ts +136 -0
  49. package/dist/skills/index.js +478 -0
  50. package/dist/skills/index.js.map +1 -0
  51. package/dist/storage/index.d.ts +21 -534
  52. package/dist/storage/index.js +246 -3
  53. package/dist/storage/index.js.map +1 -1
  54. package/dist/{system-prompt-DNetCecu.d.ts → system-prompt-BJlzKGO6.d.ts} +1 -1
  55. package/dist/{tool-executor-B5bgmEgE.d.ts → tool-executor-B6kRcWeF.d.ts} +4 -4
  56. package/dist/types/index.d.ts +17 -15
  57. package/dist/types/index.js +116 -0
  58. package/dist/types/index.js.map +1 -1
  59. package/dist/utils/index.d.ts +35 -2
  60. package/dist/utils/index.js +49 -1
  61. package/dist/utils/index.js.map +1 -1
  62. package/package.json +5 -1
  63. package/skills/sdd/SKILL.md +93 -6
  64. package/skills/skill-creator/SKILL.md +98 -0
@@ -926,11 +926,12 @@ function toWrongStackError(err, code = "AGENT_RUN_FAILED") {
926
926
  var AutoCompactionMiddleware = class {
927
927
  name = "AutoCompaction";
928
928
  compactor;
929
+ estimator;
929
930
  warnThreshold;
930
931
  softThreshold;
931
932
  hardThreshold;
932
- maxContext;
933
- estimator;
933
+ /** Writable so model-switch can update the denominator without re-registering the middleware. */
934
+ _maxContext;
934
935
  aggressiveOn;
935
936
  events;
936
937
  failureMode;
@@ -949,7 +950,7 @@ var AutoCompactionMiddleware = class {
949
950
  constructor(compactor, maxContext, estimator, thresholds, optsOrAggressiveOn = {}, events) {
950
951
  const opts = typeof optsOrAggressiveOn === "string" ? { aggressiveOn: optsOrAggressiveOn, events } : optsOrAggressiveOn;
951
952
  this.compactor = compactor;
952
- this.maxContext = maxContext;
953
+ this._maxContext = maxContext;
953
954
  this.estimator = estimator;
954
955
  this.warnThreshold = thresholds.warn;
955
956
  this.softThreshold = thresholds.soft;
@@ -959,10 +960,15 @@ var AutoCompactionMiddleware = class {
959
960
  this.failureMode = opts.failureMode ?? "throw_on_hard";
960
961
  this.policyProvider = opts.policyProvider;
961
962
  }
963
+ /** Allow callers (e.g. model-switch in WebUI) to update the context window
964
+ * denominator when the active model changes. */
965
+ setMaxContext(maxContext) {
966
+ this._maxContext = maxContext;
967
+ }
962
968
  handler() {
963
969
  return async (ctx, next) => {
964
970
  const tokens = this.estimator(ctx);
965
- const load = tokens / this.maxContext;
971
+ const load = tokens / this._maxContext;
966
972
  const policy = this.policyProvider?.(ctx);
967
973
  const thresholds = policy?.thresholds ?? {
968
974
  warn: this.warnThreshold,
@@ -991,7 +997,7 @@ var AutoCompactionMiddleware = class {
991
997
  aggressive,
992
998
  level: pressure.level,
993
999
  tokens: pressure.tokens,
994
- maxContext: this.maxContext,
1000
+ maxContext: this._maxContext,
995
1001
  load: pressure.load,
996
1002
  fatal
997
1003
  });
@@ -1003,7 +1009,7 @@ var AutoCompactionMiddleware = class {
1003
1009
  context: {
1004
1010
  level: pressure.level,
1005
1011
  tokens: pressure.tokens,
1006
- maxContext: this.maxContext
1012
+ maxContext: this._maxContext
1007
1013
  },
1008
1014
  cause: err
1009
1015
  });
@@ -1765,6 +1771,9 @@ var DefaultSkillLoader = class {
1765
1771
  }
1766
1772
  return entries;
1767
1773
  }
1774
+ invalidateCache() {
1775
+ this.cache = void 0;
1776
+ }
1768
1777
  async readBody(name) {
1769
1778
  const m = await this.find(name);
1770
1779
  if (!m) throw new Error(`Skill "${name}" not found`);