@wrongstack/core 0.265.1 → 0.267.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-DrkBxszZ.d.ts → agent-bridge-STJ3JwwK.d.ts} +1 -1
- package/dist/{agent-subagent-runner-DM2pP-B6.d.ts → agent-subagent-runner-CzPGP3jA.d.ts} +25 -7
- package/dist/{brain-BXd_61kQ.d.ts → brain-Cdg77tVN.d.ts} +73 -1
- package/dist/{compactor-B8pOf45Y.d.ts → compactor-iMZ84CXq.d.ts} +19 -1
- package/dist/{config-BMCj_XDs.d.ts → config-Du3pYYln.d.ts} +54 -3
- package/dist/{context-MRk5PhNv.d.ts → context-dT5Ueund.d.ts} +65 -1
- package/dist/coordination/index.d.ts +17 -17
- package/dist/coordination/index.js +138 -114
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +25 -25
- package/dist/defaults/index.js +1729 -781
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +15 -15
- package/dist/execution/index.js +1119 -229
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{goal-preamble-DvHDSKSe.d.ts → goal-preamble-SulMTowG.d.ts} +28 -11
- package/dist/{goal-store-DtLMySNb.d.ts → goal-store-CABDwdFE.d.ts} +1 -1
- package/dist/{index-CEDeNodM.d.ts → index-Bms0m4oy.d.ts} +5 -5
- package/dist/{index-B-ch8K9C.d.ts → index-DtCVWel4.d.ts} +8 -8
- package/dist/index-IEuxQd-E.d.ts +82 -0
- package/dist/index.d.ts +118 -45
- package/dist/index.js +3083 -1602
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +72 -1
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-2x4w6Jn9.d.ts → mcp-servers-C2cBTxUR.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +30 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-DmJlKuNp.d.ts → models-registry-BqGZNJQ-.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-DyCkCZnU.d.ts → multi-agent-coordinator-B8R43uPz.d.ts} +1 -1
- package/dist/{null-fleet-bus-CG9QY2aP.d.ts → null-fleet-bus-CnXa5oTH.d.ts} +14 -9
- package/dist/observability/index.d.ts +2 -2
- package/dist/{parallel-eternal-engine-Jw9uhEoT.d.ts → parallel-eternal-engine-DdNnw9BQ.d.ts} +11 -9
- package/dist/{path-resolver-Dy2ej-gE.d.ts → path-resolver-COIMLCQL.d.ts} +3 -3
- package/dist/{permission-B9SB45lp.d.ts → permission-B75JAi3-.d.ts} +1 -1
- package/dist/{permission-policy-CkjSXabK.d.ts → permission-policy-DlR9eJAM.d.ts} +2 -2
- package/dist/{pipeline-DPDxH_7m.d.ts → pipeline-BfD2k1rT.d.ts} +2 -2
- package/dist/{plan-templates-CzD9GnAU.d.ts → plan-templates-DSIKCXZN.d.ts} +5 -5
- package/dist/{llm-selector-C0tfTCUe.d.ts → provider-model-resolve-BNRsNuJx.d.ts} +40 -3
- package/dist/{provider-runner-DMa70ODu.d.ts → provider-runner-CX7iIvox.d.ts} +3 -3
- package/dist/{retry-policy-CN0khdlj.d.ts → retry-policy-BilV1ujH.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +12 -12
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-B2yw84VT.d.ts → secret-vault-gkvEZZfE.d.ts} +2 -2
- package/dist/security/index.d.ts +5 -67
- package/dist/security/index.js +96 -76
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-CzHh_igB.d.ts → selector-Bc7eWtT3.d.ts} +1 -1
- package/dist/{session-event-bridge-BUI6Jf-4.d.ts → session-event-bridge-D-araDEz.d.ts} +1 -1
- package/dist/{session-reader-CMgdMSRP.d.ts → session-reader-D7Dapswh.d.ts} +1 -1
- package/dist/storage/index.d.ts +11 -11
- package/dist/storage/index.js +81 -84
- package/dist/storage/index.js.map +1 -1
- package/dist/tools/index.d.ts +4 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.js +1265 -400
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +454 -406
- package/dist/utils/index.js +2191 -1201
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
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-
|
|
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-
|
|
2
|
+
export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-COIMLCQL.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-C2cBTxUR.js';
|
|
4
4
|
import '../logger-B63L5bTg.js';
|
|
5
|
-
import '../brain-
|
|
6
|
-
import '../context-
|
|
7
|
-
import '../config-
|
|
5
|
+
import '../brain-Cdg77tVN.js';
|
|
6
|
+
import '../context-dT5Ueund.js';
|
|
7
|
+
import '../config-Du3pYYln.js';
|
|
8
8
|
import '../path-resolver-CPRj4bFY.js';
|
|
9
|
-
import '../compactor-
|
|
9
|
+
import '../compactor-iMZ84CXq.js';
|
|
@@ -631,6 +631,76 @@ function isEmptyMessage(msg) {
|
|
|
631
631
|
return msg.content.length === 0;
|
|
632
632
|
}
|
|
633
633
|
|
|
634
|
+
// src/utils/tool-wire-compact.ts
|
|
635
|
+
var TOOL_DESCRIPTION_MAX_CHARS = 640;
|
|
636
|
+
var SCHEMA_DESCRIPTION_MAX_CHARS = 180;
|
|
637
|
+
var compactCache = /* @__PURE__ */ new WeakMap();
|
|
638
|
+
function compactToolDefinitionForWire(tool, opts = {}) {
|
|
639
|
+
const useDefaultOptions = opts.descriptionMaxChars === void 0 && opts.schemaDescriptionMaxChars === void 0;
|
|
640
|
+
if (useDefaultOptions && typeof tool === "object" && tool !== null) {
|
|
641
|
+
const cached = compactCache.get(tool);
|
|
642
|
+
if (cached) return cached;
|
|
643
|
+
}
|
|
644
|
+
const compact = {
|
|
645
|
+
name: tool.name,
|
|
646
|
+
description: compactDescription(
|
|
647
|
+
tool.description ?? "",
|
|
648
|
+
opts.descriptionMaxChars ?? TOOL_DESCRIPTION_MAX_CHARS
|
|
649
|
+
),
|
|
650
|
+
inputSchema: compactSchemaDescriptions(
|
|
651
|
+
tool.inputSchema,
|
|
652
|
+
opts.schemaDescriptionMaxChars ?? SCHEMA_DESCRIPTION_MAX_CHARS
|
|
653
|
+
)
|
|
654
|
+
};
|
|
655
|
+
if (useDefaultOptions && typeof tool === "object" && tool !== null) {
|
|
656
|
+
compactCache.set(tool, compact);
|
|
657
|
+
}
|
|
658
|
+
return compact;
|
|
659
|
+
}
|
|
660
|
+
function compactSchemaDescriptions(schema, maxDescriptionChars = SCHEMA_DESCRIPTION_MAX_CHARS) {
|
|
661
|
+
const compact = compactSchemaNode(schema, maxDescriptionChars);
|
|
662
|
+
return isRecord(compact) ? compact : { type: "object", properties: {} };
|
|
663
|
+
}
|
|
664
|
+
function compactSchemaNode(node, maxDescriptionChars) {
|
|
665
|
+
if (Array.isArray(node)) {
|
|
666
|
+
return node.map((item) => compactSchemaNode(item, maxDescriptionChars));
|
|
667
|
+
}
|
|
668
|
+
if (!isRecord(node)) return node;
|
|
669
|
+
const out = {};
|
|
670
|
+
for (const [key, value] of Object.entries(node)) {
|
|
671
|
+
if (key === "description" && typeof value === "string") {
|
|
672
|
+
out[key] = compactDescription(value, maxDescriptionChars);
|
|
673
|
+
} else {
|
|
674
|
+
out[key] = compactSchemaNode(value, maxDescriptionChars);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return out;
|
|
678
|
+
}
|
|
679
|
+
function compactDescription(text, maxChars) {
|
|
680
|
+
const normalized = text.replace(/\s+/g, " ").trim();
|
|
681
|
+
if (normalized.length <= maxChars) return normalized;
|
|
682
|
+
if (maxChars <= 20) return normalized.slice(0, maxChars);
|
|
683
|
+
const hardLimit = maxChars - 12;
|
|
684
|
+
const boundary = findSemanticBoundary(normalized, hardLimit);
|
|
685
|
+
const head = normalized.slice(0, boundary > 0 ? boundary : hardLimit).trimEnd();
|
|
686
|
+
return `${head} ...`;
|
|
687
|
+
}
|
|
688
|
+
function findSemanticBoundary(text, limit) {
|
|
689
|
+
const punctuation = Math.max(
|
|
690
|
+
text.lastIndexOf(". ", limit),
|
|
691
|
+
text.lastIndexOf("; ", limit),
|
|
692
|
+
text.lastIndexOf(": ", limit)
|
|
693
|
+
);
|
|
694
|
+
if (punctuation >= Math.floor(limit * 0.45)) return punctuation + 1;
|
|
695
|
+
const comma = text.lastIndexOf(", ", limit);
|
|
696
|
+
if (comma >= Math.floor(limit * 0.6)) return comma + 1;
|
|
697
|
+
const space = text.lastIndexOf(" ", limit);
|
|
698
|
+
return space >= Math.floor(limit * 0.6) ? space : limit;
|
|
699
|
+
}
|
|
700
|
+
function isRecord(value) {
|
|
701
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
702
|
+
}
|
|
703
|
+
|
|
634
704
|
// src/utils/token-estimate.ts
|
|
635
705
|
var RoughTokenEstimate = (text, charsPerToken = 3.5) => Math.max(1, Math.ceil(text.length / charsPerToken));
|
|
636
706
|
var CALIBRATION_GLOBAL_KEY = "__global__";
|
|
@@ -697,7 +767,8 @@ function estimateMessageTokens(messages) {
|
|
|
697
767
|
function estimateToolDefTokens(tool) {
|
|
698
768
|
const cached = tool._estDefTokens;
|
|
699
769
|
if (typeof cached === "number" && cached > 0) return cached;
|
|
700
|
-
|
|
770
|
+
const compact = compactToolDefinitionForWire(tool);
|
|
771
|
+
return RoughTokenEstimate(tool.name) + RoughTokenEstimate(compact.description) + RoughTokenEstimate(JSON.stringify(compact.inputSchema));
|
|
701
772
|
}
|
|
702
773
|
function estimateRequestTokens(messages, systemPrompt, tools, calibrationKey = CALIBRATION_GLOBAL_KEY) {
|
|
703
774
|
let messagesTokens = 0;
|