@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.
- package/dist/{agent-bridge-DaOnnHNW.d.ts → agent-bridge-EiUFe3if.d.ts} +1 -1
- package/dist/{compactor-CFky6JKM.d.ts → compactor-BP4xhKVi.d.ts} +1 -1
- package/dist/{config-RlhKLjme.d.ts → config-BOD_HQBw.d.ts} +1 -1
- package/dist/{context-B1kBj1lY.d.ts → context-PH4DvBZV.d.ts} +60 -1
- package/dist/coordination/index.d.ts +10 -891
- package/dist/coordination/index.js +500 -238
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +20 -19
- package/dist/defaults/index.js +2210 -264
- package/dist/defaults/index.js.map +1 -1
- package/dist/director-state-CVzkjKRZ.d.ts +539 -0
- package/dist/{events-BBaKeMfb.d.ts → events-oxn-Wkub.d.ts} +58 -1
- package/dist/execution/index.d.ts +19 -13
- package/dist/execution/index.js +15 -6
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/index-CcbWbcpy.d.ts +899 -0
- package/dist/{index-meJRuQtc.d.ts → index-a12jc7-r.d.ts} +8 -6
- package/dist/index.d.ts +33 -28
- package/dist/index.js +3798 -1237
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +67 -2
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +10 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-Cf4-bJnd.d.ts → mcp-servers-uPmBxZ1B.d.ts} +18 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +106 -0
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-D5m66hzB.d.ts → multi-agent-D6S4Z7H8.d.ts} +71 -16
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-Bg4OP5fi.d.ts → path-resolver-CprD5DhS.d.ts} +9 -2
- package/dist/{provider-runner-CU9gnU2E.d.ts → provider-runner-DGisz_lG.d.ts} +3 -3
- package/dist/{skill-DayhFUBb.d.ts → retry-policy-DUJ8-Qc_.d.ts} +2 -28
- package/dist/sdd/index.d.ts +419 -5
- package/dist/sdd/index.js +1580 -1
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-scrubber-DyUAWS09.d.ts → secret-scrubber-CB11A2P7.d.ts} +1 -1
- package/dist/{secret-scrubber-Dyh5LVYL.d.ts → secret-scrubber-EqFa0SyI.d.ts} +1 -1
- package/dist/security/index.d.ts +8 -4
- package/dist/security/index.js +8 -0
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-DBEiwXBk.d.ts → selector-yqyxt-Ii.d.ts} +1 -1
- package/dist/{session-reader-D-z0AgHs.d.ts → session-reader-1tOyoY1s.d.ts} +1 -1
- package/dist/session-rewinder-C9HnMkhP.d.ts +23 -0
- package/dist/skill-CxuWrsKK.d.ts +29 -0
- package/dist/skills/index.d.ts +136 -0
- package/dist/skills/index.js +478 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/storage/index.d.ts +21 -534
- package/dist/storage/index.js +246 -3
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-DNetCecu.d.ts → system-prompt-BJlzKGO6.d.ts} +1 -1
- package/dist/{tool-executor-B5bgmEgE.d.ts → tool-executor-B6kRcWeF.d.ts} +4 -4
- package/dist/types/index.d.ts +17 -15
- package/dist/types/index.js +116 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +35 -2
- package/dist/utils/index.js +49 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +5 -1
- package/skills/sdd/SKILL.md +93 -6
- package/skills/skill-creator/SKILL.md +98 -0
package/dist/execution/index.js
CHANGED
|
@@ -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
|
-
|
|
933
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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`);
|