@wrongstack/core 0.155.0 → 0.250.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.
- package/dist/{agent-bridge-BbZU5TPN.d.ts → agent-bridge-4gc0vfW2.d.ts} +1 -1
- package/dist/{agent-subagent-runner-Bsueu0J2.d.ts → agent-subagent-runner-Dz-9kiE6.d.ts} +9 -8
- package/dist/{brain-CS_B0vIE.d.ts → brain-sCZ3lCjq.d.ts} +26 -2
- package/dist/{compactor-BueGt7LG.d.ts → compactor-BRfg3QPd.d.ts} +1 -1
- package/dist/{config-BaVThgnT.d.ts → config-eSsrto5d.d.ts} +8 -2
- package/dist/{context-C7G_MtLV.d.ts → context-CLz3z_E8.d.ts} +126 -2
- package/dist/coordination/index.d.ts +70 -13
- package/dist/coordination/index.js +1986 -146
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +26 -26
- package/dist/defaults/index.js +1110 -296
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +45 -16
- package/dist/execution/index.js +229 -56
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +86 -0
- package/dist/execution/prompt-enhancer.js +125 -0
- package/dist/execution/prompt-enhancer.js.map +1 -0
- package/dist/extension/index.d.ts +6 -6
- package/dist/extension/index.js +3 -1
- package/dist/extension/index.js.map +1 -1
- package/dist/{goal-preamble-CbV8pXLD.d.ts → goal-preamble-BjJpnLW4.d.ts} +19 -10
- package/dist/{index-CI1hRfPt.d.ts → index-Dy8OwfBD.d.ts} +8 -8
- package/dist/{index-B5wz-GXm.d.ts → index-IehiNryU.d.ts} +7 -5
- package/dist/index.d.ts +438 -128
- package/dist/index.js +4989 -849
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +7 -7
- package/dist/infrastructure/index.js +61 -13
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js +7 -1
- package/dist/kernel/index.js.map +1 -1
- package/dist/{llm-selector-CP72f1lC.d.ts → llm-selector-D22R4AFz.d.ts} +2 -2
- package/dist/logger-DmmQhf4P.d.ts +65 -0
- package/dist/{mcp-servers-CPERR2De.d.ts → mcp-servers-DfXxCASH.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +89 -9
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-D90K9UnM.d.ts → models-registry-DpanBg8D.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-BSKSFNhv.d.ts → multi-agent-coordinator-CnbEqpv0.d.ts} +8 -8
- package/dist/{null-fleet-bus-CGOez8Le.d.ts → null-fleet-bus-Do1OLYpj.d.ts} +7 -7
- package/dist/observability/index.d.ts +2 -2
- package/dist/package-outdated-watcher-CA5GGB4C.d.ts +560 -0
- package/dist/{parallel-eternal-engine-CYoTKjsz.d.ts → parallel-eternal-engine-UZg1xOzE.d.ts} +13 -9
- package/dist/{path-resolver-DuhlmPil.d.ts → path-resolver-BaP06Owy.d.ts} +3 -3
- package/dist/{permission-B7nKnEvQ.d.ts → permission-DbWPbuoA.d.ts} +1 -1
- package/dist/{permission-policy-8-6zBmfA.d.ts → permission-policy-AOk0LVsV.d.ts} +2 -2
- package/dist/pipeline-D1n-gQI-.d.ts +493 -0
- package/dist/{plan-templates-DbH7lg-t.d.ts → plan-templates-BUVRY0pU.d.ts} +18 -7
- package/dist/{provider-runner-Cocq0O9E.d.ts → provider-runner-D0HgUqwV.d.ts} +3 -3
- package/dist/{retry-policy-rutAfVeR.d.ts → retry-policy-BVnkbMET.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +221 -87
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-w8MbUe2Q.d.ts → secret-vault-CeVNiy_f.d.ts} +3 -2
- package/dist/security/index.d.ts +5 -4
- package/dist/security/index.js +155 -13
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-4vDFZKt3.d.ts → selector-Cb4_9-hf.d.ts} +1 -1
- package/dist/{session-event-bridge-DWlvglC2.d.ts → session-event-bridge-BhtkkFFy.d.ts} +4 -2
- package/dist/{session-reader-BAtCxdaw.d.ts → session-reader-CCOssnBS.d.ts} +1 -1
- package/dist/skills/index.js +171 -21
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +150 -12
- package/dist/storage/index.js +1041 -214
- package/dist/storage/index.js.map +1 -1
- package/dist/types/index.d.ts +67 -20
- package/dist/types/index.js +562 -55
- package/dist/types/index.js.map +1 -1
- package/dist/utils/expect-defined.js +3 -1
- package/dist/utils/expect-defined.js.map +1 -1
- package/dist/utils/index.d.ts +25 -4
- package/dist/utils/index.js +45 -14
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-DD50Omgn.d.ts → wstack-paths-CJjEwPXn.d.ts} +14 -1
- package/package.json +7 -3
- package/skills/chimera/SKILL.md +105 -0
- package/skills/research-web/SKILL.md +342 -0
- package/dist/logger-B9J5puGM.d.ts +0 -32
- package/dist/pipeline-BG7UgbDc.d.ts +0 -239
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-
|
|
2
|
-
export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-
|
|
3
|
-
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, p as playwrightServer, s as sentinelServer, q as slackServer, z as zaiVisionServer } from '../mcp-servers-
|
|
1
|
+
export { D as DefaultLogger, a as DefaultLoggerOptions, L as LogFormat } from '../logger-DmmQhf4P.js';
|
|
2
|
+
export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-BaP06Owy.js';
|
|
3
|
+
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, p as playwrightServer, s as sentinelServer, q as slackServer, z as zaiVisionServer } from '../mcp-servers-DfXxCASH.js';
|
|
4
4
|
import '../logger-B63L5bTg.js';
|
|
5
|
-
import '../brain-
|
|
6
|
-
import '../context-
|
|
7
|
-
import '../config-
|
|
5
|
+
import '../brain-sCZ3lCjq.js';
|
|
6
|
+
import '../context-CLz3z_E8.js';
|
|
7
|
+
import '../config-eSsrto5d.js';
|
|
8
8
|
import '../path-resolver-CPRj4bFY.js';
|
|
9
|
-
import '../compactor-
|
|
9
|
+
import '../compactor-BRfg3QPd.js';
|
|
@@ -68,18 +68,24 @@ var COLORS = {
|
|
|
68
68
|
trace: color.dim
|
|
69
69
|
};
|
|
70
70
|
var LOG_LEVELS = /* @__PURE__ */ new Set(["error", "warn", "info", "debug", "trace"]);
|
|
71
|
+
var LOG_FORMATS = /* @__PURE__ */ new Set(["pretty", "json"]);
|
|
71
72
|
var DefaultLogger = class _DefaultLogger {
|
|
73
|
+
/** How many file writes between rotation size checks (statSync is not free). */
|
|
74
|
+
static ROTATE_CHECK_EVERY = 100;
|
|
72
75
|
level;
|
|
73
76
|
file;
|
|
74
77
|
bindings;
|
|
75
|
-
|
|
78
|
+
format;
|
|
76
79
|
stderr;
|
|
80
|
+
maxFileBytes;
|
|
81
|
+
writesSinceRotateCheck = 0;
|
|
77
82
|
constructor(opts = {}) {
|
|
78
83
|
this.level = opts.level ?? parseLogLevel(process.env.WRONGSTACK_LOG_LEVEL);
|
|
79
84
|
this.file = opts.file;
|
|
80
85
|
this.bindings = opts.bindings ?? {};
|
|
81
|
-
this.
|
|
86
|
+
this.format = opts.format ?? parseLogFormat(process.env.WRONGSTACK_LOG_FORMAT);
|
|
82
87
|
this.stderr = opts.stderr !== false;
|
|
88
|
+
this.maxFileBytes = opts.maxFileBytes ?? 10 * 1024 * 1024;
|
|
83
89
|
if (this.file) {
|
|
84
90
|
try {
|
|
85
91
|
fs.mkdirSync(path2.dirname(this.file), { recursive: true });
|
|
@@ -106,11 +112,30 @@ var DefaultLogger = class _DefaultLogger {
|
|
|
106
112
|
return new _DefaultLogger({
|
|
107
113
|
level: this.level,
|
|
108
114
|
file: this.file,
|
|
109
|
-
|
|
115
|
+
format: this.format,
|
|
110
116
|
stderr: this.stderr,
|
|
117
|
+
maxFileBytes: this.maxFileBytes,
|
|
111
118
|
bindings: { ...this.bindings, ...bindings }
|
|
112
119
|
});
|
|
113
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Size-based rotation: when the file outgrows `maxFileBytes`, rename it to
|
|
123
|
+
* `<file>.1` (dropping the previous `.1`) so the live file restarts empty.
|
|
124
|
+
* Checked on the first write and every ROTATE_CHECK_EVERY writes after.
|
|
125
|
+
* Best-effort: a rename can fail on Windows while another process holds
|
|
126
|
+
* the file — the next check retries. Multiple processes appending to the
|
|
127
|
+
* same log all run this check; whoever crosses the threshold first wins.
|
|
128
|
+
*/
|
|
129
|
+
maybeRotate(file) {
|
|
130
|
+
if (this.writesSinceRotateCheck++ % _DefaultLogger.ROTATE_CHECK_EVERY !== 0) return;
|
|
131
|
+
try {
|
|
132
|
+
const st = fs.statSync(file);
|
|
133
|
+
if (st.size < this.maxFileBytes) return;
|
|
134
|
+
fs.rmSync(`${file}.1`, { force: true });
|
|
135
|
+
fs.renameSync(file, `${file}.1`);
|
|
136
|
+
} catch {
|
|
137
|
+
}
|
|
138
|
+
}
|
|
114
139
|
log(level, msg, ctx) {
|
|
115
140
|
const r = LEVEL_RANK[level];
|
|
116
141
|
const allowed = LEVEL_RANK[this.level];
|
|
@@ -122,13 +147,17 @@ var DefaultLogger = class _DefaultLogger {
|
|
|
122
147
|
}
|
|
123
148
|
if (this.file) {
|
|
124
149
|
try {
|
|
150
|
+
this.maybeRotate(this.file);
|
|
125
151
|
fs.appendFileSync(this.file, `${JSON.stringify(entry)}
|
|
126
152
|
`);
|
|
127
153
|
} catch {
|
|
128
154
|
}
|
|
129
155
|
}
|
|
130
156
|
if (!this.stderr) return;
|
|
131
|
-
if (
|
|
157
|
+
if (this.format === "json") {
|
|
158
|
+
writeErr(`${JSON.stringify(entry)}
|
|
159
|
+
`);
|
|
160
|
+
} else {
|
|
132
161
|
const head = `${color.dim(ts)} ${COLORS[level](level.toUpperCase().padEnd(5))} ${msg}`;
|
|
133
162
|
if (ctx !== void 0) {
|
|
134
163
|
writeErr(`${head} ${formatCtx(ctx)}
|
|
@@ -143,6 +172,9 @@ var DefaultLogger = class _DefaultLogger {
|
|
|
143
172
|
function parseLogLevel(raw) {
|
|
144
173
|
return raw && LOG_LEVELS.has(raw) ? raw : "info";
|
|
145
174
|
}
|
|
175
|
+
function parseLogFormat(raw) {
|
|
176
|
+
return raw && LOG_FORMATS.has(raw) ? raw : "pretty";
|
|
177
|
+
}
|
|
146
178
|
function formatCtx(ctx) {
|
|
147
179
|
if (ctx instanceof Error) return color.dim(ctx.message);
|
|
148
180
|
if (typeof ctx === "string") return color.dim(ctx);
|
|
@@ -488,7 +520,9 @@ var allServers = () => ({
|
|
|
488
520
|
// src/utils/expect-defined.ts
|
|
489
521
|
function expectDefined(value, label) {
|
|
490
522
|
if (value === null || value === void 0) {
|
|
491
|
-
|
|
523
|
+
const err = new Error("Expected value to be defined");
|
|
524
|
+
err.name = "ExpectDefinedError";
|
|
525
|
+
throw err;
|
|
492
526
|
}
|
|
493
527
|
return value;
|
|
494
528
|
}
|
|
@@ -628,22 +662,31 @@ function estimateToolResultTokens(content) {
|
|
|
628
662
|
function estimateTextTokens(text) {
|
|
629
663
|
return RoughTokenEstimate(text);
|
|
630
664
|
}
|
|
665
|
+
function computeMessageTokens(msg) {
|
|
666
|
+
if (typeof msg.content === "string") return estimateTextTokens(msg.content);
|
|
667
|
+
let total = 0;
|
|
668
|
+
for (const b of msg.content) {
|
|
669
|
+
if (b.type === "text") total += estimateTextTokens(b.text);
|
|
670
|
+
else if (b.type === "tool_use") total += estimateToolInputTokens(b.input);
|
|
671
|
+
else if (b.type === "tool_result") total += estimateToolResultTokens(b.content);
|
|
672
|
+
else total += RoughTokenEstimate(JSON.stringify(b));
|
|
673
|
+
}
|
|
674
|
+
return total;
|
|
675
|
+
}
|
|
631
676
|
function estimateMessageTokens(messages) {
|
|
632
677
|
let total = 0;
|
|
633
678
|
for (const m of messages) {
|
|
634
|
-
if (typeof m.
|
|
635
|
-
total +=
|
|
636
|
-
|
|
637
|
-
for (const b of m.content) {
|
|
638
|
-
if (b.type === "text") total += estimateTextTokens(b.text);
|
|
639
|
-
else if (b.type === "tool_use") total += estimateToolInputTokens(b.input);
|
|
640
|
-
else if (b.type === "tool_result") total += estimateToolResultTokens(b.content);
|
|
641
|
-
}
|
|
679
|
+
if (typeof m._estTokens === "number" && m._estTokens > 0) {
|
|
680
|
+
total += m._estTokens;
|
|
681
|
+
continue;
|
|
642
682
|
}
|
|
683
|
+
total += computeMessageTokens(m);
|
|
643
684
|
}
|
|
644
685
|
return total;
|
|
645
686
|
}
|
|
646
687
|
function estimateToolDefTokens(tool) {
|
|
688
|
+
const cached = tool._estDefTokens;
|
|
689
|
+
if (typeof cached === "number" && cached > 0) return cached;
|
|
647
690
|
return RoughTokenEstimate(tool.name) + RoughTokenEstimate(tool.description ?? "") + RoughTokenEstimate(JSON.stringify(tool.inputSchema));
|
|
648
691
|
}
|
|
649
692
|
function estimateRequestTokens(messages, systemPrompt, tools, calibrationKey = CALIBRATION_GLOBAL_KEY) {
|
|
@@ -653,6 +696,11 @@ function estimateRequestTokens(messages, systemPrompt, tools, calibrationKey = C
|
|
|
653
696
|
} else if (Array.isArray(messages)) {
|
|
654
697
|
for (const m of messages) {
|
|
655
698
|
if (typeof m === "object" && m !== null && "content" in m) {
|
|
699
|
+
const cached = m._estTokens;
|
|
700
|
+
if (typeof cached === "number" && cached > 0) {
|
|
701
|
+
messagesTokens += cached;
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
656
704
|
const content = m.content;
|
|
657
705
|
if (typeof content === "string") {
|
|
658
706
|
messagesTokens += RoughTokenEstimate(content);
|