@wrongstack/core 0.264.0 → 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-D8sa1vtv.d.ts → agent-bridge-STJ3JwwK.d.ts} +1 -1
- package/dist/{agent-subagent-runner-c9DLkaas.d.ts → agent-subagent-runner-CzPGP3jA.d.ts} +131 -11
- package/dist/{brain-O1IdKPaK.d.ts → brain-Cdg77tVN.d.ts} +103 -2
- package/dist/{compactor-BBy0rCtB.d.ts → compactor-iMZ84CXq.d.ts} +19 -1
- package/dist/{config-Dz2F3H2K.d.ts → config-Du3pYYln.d.ts} +132 -13
- package/dist/{context-BGSpZNSE.d.ts → context-dT5Ueund.d.ts} +90 -12
- package/dist/coordination/index.d.ts +78 -22
- package/dist/coordination/index.js +695 -273
- package/dist/coordination/index.js.map +1 -1
- package/dist/{default-config-CXsDvOmP.d.ts → default-config-B0cj-Hry.d.ts} +11 -1
- package/dist/defaults/index.d.ts +28 -28
- package/dist/defaults/index.js +2327 -965
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +16 -16
- package/dist/execution/index.js +1500 -371
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +2 -2
- package/dist/execution/prompt-enhancer.js +1 -1
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{goal-preamble-DzjFuN3p.d.ts → goal-preamble-SulMTowG.d.ts} +33 -12
- package/dist/{goal-store-CxWmCGbH.d.ts → goal-store-CABDwdFE.d.ts} +1 -1
- package/dist/{index-CbLSI66_.d.ts → index-Bms0m4oy.d.ts} +5 -5
- package/dist/{index-CYIQrXVF.d.ts → index-DtCVWel4.d.ts} +8 -8
- package/dist/index-IEuxQd-E.d.ts +82 -0
- package/dist/index.d.ts +261 -57
- package/dist/index.js +4799 -2212
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +84 -9
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-DC4QRPUI.d.ts → mcp-servers-C2cBTxUR.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +104 -31
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-B_siPxqN.d.ts → models-registry-BqGZNJQ-.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-CK5Jdj9K.d.ts → multi-agent-coordinator-B8R43uPz.d.ts} +1 -1
- package/dist/{null-fleet-bus-DgvD4SCO.d.ts → null-fleet-bus-CnXa5oTH.d.ts} +14 -9
- package/dist/observability/index.d.ts +2 -2
- package/dist/{parallel-eternal-engine-bK0JQBR_.d.ts → parallel-eternal-engine-DdNnw9BQ.d.ts} +11 -9
- package/dist/{path-resolver-BPEDlN38.d.ts → path-resolver-COIMLCQL.d.ts} +3 -3
- package/dist/{permission-4yvGmMRB.d.ts → permission-B75JAi3-.d.ts} +1 -1
- package/dist/{permission-policy-C6XpsBOy.d.ts → permission-policy-DlR9eJAM.d.ts} +2 -2
- package/dist/{pipeline-CXCeMz8J.d.ts → pipeline-BfD2k1rT.d.ts} +3 -3
- package/dist/{plan-templates-BvzRBkJc.d.ts → plan-templates-DSIKCXZN.d.ts} +32 -8
- package/dist/provider-model-resolve-BNRsNuJx.d.ts +107 -0
- package/dist/{provider-runner-C5aQpDWE.d.ts → provider-runner-CX7iIvox.d.ts} +3 -3
- package/dist/{retry-policy-CFhdtRzz.d.ts → retry-policy-BilV1ujH.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +286 -105
- package/dist/sdd/index.js.map +1 -1
- package/dist/secret-vault-BAKpgFw_.d.ts +57 -0
- package/dist/{secret-vault-CxiVLbt1.d.ts → secret-vault-gkvEZZfE.d.ts} +43 -4
- package/dist/security/index.d.ts +6 -68
- package/dist/security/index.js +296 -95
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-gIuhRTkN.d.ts → selector-Bc7eWtT3.d.ts} +1 -1
- package/dist/{session-event-bridge-DkvvrpDt.d.ts → session-event-bridge-D-araDEz.d.ts} +1 -1
- package/dist/{session-reader-KdfVwkKP.d.ts → session-reader-D7Dapswh.d.ts} +1 -1
- package/dist/storage/index.d.ts +112 -15
- package/dist/storage/index.js +491 -156
- 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 +21 -21
- package/dist/types/index.js +1523 -450
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +455 -407
- package/dist/utils/index.js +2191 -1203
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-CJjEwPXn.d.ts → wstack-paths-hOpNLmvf.d.ts} +2 -0
- package/package.json +1 -1
- package/skills/api-design/SKILL.md +1 -1
- package/skills/audit-log/SKILL.md +6 -6
- package/skills/bug-hunter/SKILL.md +5 -5
- package/skills/chimera/SKILL.md +4 -4
- package/skills/docker-deploy/SKILL.md +1 -1
- package/skills/git-flow/SKILL.md +3 -3
- package/skills/multi-agent/SKILL.md +3 -3
- package/skills/node-modern/SKILL.md +1 -0
- package/skills/observability/SKILL.md +2 -2
- package/skills/output-standards/SKILL.md +51 -28
- package/skills/refactor-planner/SKILL.md +3 -3
- package/skills/security-scanner/SKILL.md +4 -3
- package/skills/tech-stack/SKILL.md +1 -2
- package/dist/llm-selector-DzxuZnNz.d.ts +0 -58
- package/dist/secret-vault-BJDY28ev.d.ts +0 -25
|
@@ -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__";
|
|
@@ -649,12 +719,9 @@ function getCachedEstimate(key, compute) {
|
|
|
649
719
|
const existing = ESTIMATE_CACHE.get(key);
|
|
650
720
|
if (existing !== void 0) return existing;
|
|
651
721
|
if (ESTIMATE_CACHE.size >= ESTIMATE_CACHE_MAX_SIZE) {
|
|
652
|
-
let evicted = 0;
|
|
653
|
-
const maxEvict = Math.floor(ESTIMATE_CACHE_MAX_SIZE / 4);
|
|
654
722
|
for (const k of ESTIMATE_CACHE.keys()) {
|
|
655
|
-
if (
|
|
723
|
+
if (ESTIMATE_CACHE.size <= Math.floor(ESTIMATE_CACHE_MAX_SIZE / 2)) break;
|
|
656
724
|
ESTIMATE_CACHE.delete(k);
|
|
657
|
-
evicted++;
|
|
658
725
|
}
|
|
659
726
|
}
|
|
660
727
|
const estimate = compute(key);
|
|
@@ -700,7 +767,8 @@ function estimateMessageTokens(messages) {
|
|
|
700
767
|
function estimateToolDefTokens(tool) {
|
|
701
768
|
const cached = tool._estDefTokens;
|
|
702
769
|
if (typeof cached === "number" && cached > 0) return cached;
|
|
703
|
-
|
|
770
|
+
const compact = compactToolDefinitionForWire(tool);
|
|
771
|
+
return RoughTokenEstimate(tool.name) + RoughTokenEstimate(compact.description) + RoughTokenEstimate(JSON.stringify(compact.inputSchema));
|
|
704
772
|
}
|
|
705
773
|
function estimateRequestTokens(messages, systemPrompt, tools, calibrationKey = CALIBRATION_GLOBAL_KEY) {
|
|
706
774
|
let messagesTokens = 0;
|
|
@@ -804,11 +872,12 @@ function createContextManagerTool(opts = {}) {
|
|
|
804
872
|
const applyMessages = (next) => {
|
|
805
873
|
const repaired = repairToolUseAdjacency(next);
|
|
806
874
|
const finalMessages = repaired.messages;
|
|
875
|
+
if (finalMessages === messages) return repaired.report;
|
|
807
876
|
if (ctx.state) {
|
|
808
877
|
ctx.state.replaceMessages(finalMessages);
|
|
809
878
|
} else {
|
|
810
879
|
messages.length = 0;
|
|
811
|
-
messages.
|
|
880
|
+
messages.push(...finalMessages);
|
|
812
881
|
}
|
|
813
882
|
return repaired.report;
|
|
814
883
|
};
|
|
@@ -883,9 +952,15 @@ function createContextManagerTool(opts = {}) {
|
|
|
883
952
|
}
|
|
884
953
|
const report = await opts.compactor.compact(ctx);
|
|
885
954
|
ctx.clearFileTracking();
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
955
|
+
let repaired = report.repaired;
|
|
956
|
+
let afterTokens;
|
|
957
|
+
if (!ctx.state) {
|
|
958
|
+
const repair = applyMessages([...ctx.messages]);
|
|
959
|
+
repaired = report.repaired ?? (repair.changed ? repair : void 0);
|
|
960
|
+
afterTokens = repair.changed ? roughEstimate(ctx.messages) : report.after;
|
|
961
|
+
} else {
|
|
962
|
+
afterTokens = report.after;
|
|
963
|
+
}
|
|
889
964
|
const reduced = report.fullRequestTokensBefore > report.fullRequestTokensAfter;
|
|
890
965
|
const repairedSomething = !!report.repaired;
|
|
891
966
|
if (reduced || repairedSomething) {
|