@wrongstack/core 0.9.19 → 0.9.20
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-DMVOX0cF.d.ts → agent-bridge-Dti3KXGk.d.ts} +1 -1
- package/dist/{agent-subagent-runner-C4qt9e5Y.d.ts → agent-subagent-runner-U-rs7kk7.d.ts} +3 -4
- package/dist/compactor-D7X96RLZ.d.ts +41 -0
- package/dist/{config-CWva0qoL.d.ts → config-CLXMDOSs.d.ts} +1 -1
- package/dist/{context-BRNbHmRM.d.ts → context-zkZeILpr.d.ts} +46 -0
- package/dist/coordination/index.d.ts +13 -13
- package/dist/coordination/index.js +660 -146
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +20 -20
- package/dist/defaults/index.js +918 -350
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-CiG9qUM_.d.ts → events-DH-9r-_C.d.ts} +42 -1
- package/dist/execution/index.d.ts +41 -30
- package/dist/execution/index.js +358 -112
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/extension/index.js.map +1 -1
- package/dist/{index-aizK8olO.d.ts → index-BIHJ4uII.d.ts} +11 -8
- package/dist/{index-p95HQ22A.d.ts → index-CFO9QmJo.d.ts} +8 -8
- package/dist/index.d.ts +311 -35
- package/dist/index.js +1933 -512
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +36 -0
- 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-BkVEqkRe.d.ts → mcp-servers-DkESgh0G.d.ts} +25 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-3ZnTB1aT.d.ts → multi-agent-DNp6lAzg.d.ts} +35 -23
- package/dist/{multi-agent-coordinator-bRaI_aD1.d.ts → multi-agent-coordinator-CAhsegPz.d.ts} +20 -2
- package/dist/{null-fleet-bus-DKM3Iy9d.d.ts → null-fleet-bus-Dnl19vmf.d.ts} +411 -110
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-TcJfc29Y.d.ts → path-resolver-CHiBL0DD.d.ts} +2 -2
- package/dist/{permission-bPuzAy4x.d.ts → permission-H35s9Evv.d.ts} +1 -1
- package/dist/{permission-policy-BUQSutpl.d.ts → permission-policy-CT-nRmTn.d.ts} +2 -2
- package/dist/{plan-templates-fkQTyz3U.d.ts → plan-templates-Bs8iRwi6.d.ts} +4 -4
- package/dist/{provider-runner-BEpikbbN.d.ts → provider-runner-BZdDrWrS.d.ts} +3 -3
- package/dist/{retry-policy-BYkq0ugs.d.ts → retry-policy-J9N_PM40.d.ts} +1 -1
- package/dist/sdd/index.d.ts +9 -10
- package/dist/sdd/index.js +224 -68
- package/dist/sdd/index.js.map +1 -1
- package/dist/security/index.d.ts +3 -3
- package/dist/{selector-pox8abg0.d.ts → selector-CFTh3Z6p.d.ts} +1 -1
- package/dist/{session-reader-CSWcb5Ga.d.ts → session-reader-C7JJlxOw.d.ts} +2 -2
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +390 -6
- package/dist/storage/index.js +672 -35
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-Bs-Wliab.d.ts → system-prompt-CneIxVip.d.ts} +1 -1
- package/dist/{tool-executor-Boo3dekH.d.ts → tool-executor-flTuxsqO.d.ts} +9 -4
- package/dist/types/index.d.ts +14 -14
- package/dist/types/index.js +60 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +18 -6
- package/dist/utils/index.js +61 -56
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/compactor-DVTKL7XD.d.ts +0 -23
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as TodoItem, M as Message, J as JSONSchema } from '../context-
|
|
1
|
+
import { N as TodoItem, M as Message, J as JSONSchema } from '../context-zkZeILpr.js';
|
|
2
2
|
export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from '../wstack-paths-BCgmTNlG.js';
|
|
3
3
|
|
|
4
4
|
interface AtomicWriteOptions {
|
|
@@ -255,12 +255,24 @@ declare function compileUserRegex(pattern: string, flags: string): CompileResult
|
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
257
|
* Attempt to close an incomplete JSON object string by auto-closing braces
|
|
258
|
-
* and completing any unclosed double-quoted string values.
|
|
259
|
-
* common streaming truncation case where the JSON stream ends mid-object
|
|
260
|
-
* (e.g. `{"old_string": "line1\nline2` without the closing `"}` and `}`).
|
|
258
|
+
* and completing any unclosed double-quoted string values.
|
|
261
259
|
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
260
|
+
* Strategy:
|
|
261
|
+
* 1. Compute origOpen from the ORIGINAL input (how many braces are unclosed).
|
|
262
|
+
* 2. Add that many closing braces. If result is now valid JSON → return it.
|
|
263
|
+
* 3. If still invalid: trim trailing whitespace, strip trailing backslash.
|
|
264
|
+
* 4. Walk backwards to detect an unclosed string value.
|
|
265
|
+
* - Quote followed by `:` → key-name, skip
|
|
266
|
+
* - Quote followed by `,` `}` or end-of-string → toggle in/out of string
|
|
267
|
+
* 5. If we end INSIDE a string (unclosed opening `"`), append `"` + origOpen `}`.
|
|
268
|
+
*
|
|
269
|
+
* Known limitations:
|
|
270
|
+
* - Strings whose content ends with a `"` character cannot be repaired
|
|
271
|
+
* (algorithm can't distinguish content-`"` from string-terminator `"`).
|
|
272
|
+
* - Input ending in bare `:` (incomplete value expression) can't be meaningfully repaired.
|
|
273
|
+
* - Bare `{` returns unchanged.
|
|
274
|
+
* - If origOpen=0 (braces balanced) but string is unclosed, repair is skipped
|
|
275
|
+
* (the input would be valid JSON per JSON.parse, so it's returned as-is).
|
|
264
276
|
*/
|
|
265
277
|
declare function completePartialObject(s: string): string;
|
|
266
278
|
|
package/dist/utils/index.js
CHANGED
|
@@ -959,80 +959,85 @@ function compileUserRegex(pattern, flags) {
|
|
|
959
959
|
|
|
960
960
|
// src/utils/json-repair.ts
|
|
961
961
|
function completePartialObject(s) {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
962
|
+
if (!s.trim().startsWith("{")) return s;
|
|
963
|
+
if (tryParse(s).ok) return s;
|
|
964
|
+
const stack = [];
|
|
965
|
+
let inString = false;
|
|
966
|
+
let escaped = false;
|
|
967
|
+
let sawKey = false;
|
|
968
|
+
let prevSig = "";
|
|
969
|
+
let contentEnd = 0;
|
|
970
|
+
let stringBraceDepth = 0;
|
|
971
|
+
for (let i = 0; i < s.length; i++) {
|
|
972
|
+
const ch = s[i];
|
|
973
|
+
if (inString) {
|
|
974
|
+
contentEnd = i + 1;
|
|
975
|
+
if (escaped) {
|
|
976
|
+
escaped = false;
|
|
973
977
|
continue;
|
|
974
978
|
}
|
|
975
979
|
if (ch === "\\") {
|
|
976
|
-
|
|
980
|
+
escaped = true;
|
|
977
981
|
continue;
|
|
978
982
|
}
|
|
979
983
|
if (ch === '"') {
|
|
980
|
-
|
|
984
|
+
inString = false;
|
|
985
|
+
prevSig = '"';
|
|
986
|
+
stringBraceDepth = 0;
|
|
981
987
|
continue;
|
|
982
988
|
}
|
|
983
|
-
if (
|
|
984
|
-
if (ch === "
|
|
985
|
-
braceDepth++;
|
|
986
|
-
foundClose = false;
|
|
987
|
-
} else if (ch === "}") {
|
|
988
|
-
braceDepth--;
|
|
989
|
-
if (braceDepth === 0) foundClose = true;
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
if (foundClose || braceDepth <= 0) break;
|
|
993
|
-
result += "}".repeat(braceDepth);
|
|
994
|
-
}
|
|
995
|
-
if (tryParse(result).ok) return result;
|
|
996
|
-
let inString = false;
|
|
997
|
-
let escaped = false;
|
|
998
|
-
for (let i = result.length - 1; i >= 0; i--) {
|
|
999
|
-
const ch = result[i];
|
|
1000
|
-
if (escaped) {
|
|
1001
|
-
escaped = false;
|
|
1002
|
-
continue;
|
|
1003
|
-
}
|
|
1004
|
-
if (ch === "\\") {
|
|
1005
|
-
escaped = true;
|
|
989
|
+
if (ch === "{") stringBraceDepth++;
|
|
990
|
+
else if (ch === "}" && stringBraceDepth > 0) stringBraceDepth--;
|
|
1006
991
|
continue;
|
|
1007
992
|
}
|
|
993
|
+
if (ch === " " || ch === " " || ch === "\n" || ch === "\r") continue;
|
|
994
|
+
contentEnd = i + 1;
|
|
1008
995
|
if (ch === '"') {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
}
|
|
996
|
+
inString = true;
|
|
997
|
+
sawKey = true;
|
|
998
|
+
stringBraceDepth = 0;
|
|
999
|
+
prevSig = '"';
|
|
1000
|
+
} else if (ch === "{" || ch === "[") {
|
|
1001
|
+
stack.push(ch);
|
|
1002
|
+
prevSig = ch;
|
|
1003
|
+
} else if (ch === "}" || ch === "]") {
|
|
1004
|
+
stack.pop();
|
|
1005
|
+
prevSig = ch;
|
|
1006
|
+
} else {
|
|
1007
|
+
prevSig = ch;
|
|
1022
1008
|
}
|
|
1023
1009
|
}
|
|
1010
|
+
if (!sawKey && !inString) return s;
|
|
1011
|
+
let result = s.slice(0, contentEnd);
|
|
1024
1012
|
if (inString) {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
if (ch === "{") depth++;
|
|
1030
|
-
else if (ch === "}") depth = Math.max(0, depth - 1);
|
|
1013
|
+
if (escaped) {
|
|
1014
|
+
result = result.slice(0, -1);
|
|
1015
|
+
} else if (endsWithInvalidEscape(result)) {
|
|
1016
|
+
result = result.slice(0, -2);
|
|
1031
1017
|
}
|
|
1032
|
-
result +=
|
|
1018
|
+
if (stringBraceDepth > 0) result += "}".repeat(stringBraceDepth);
|
|
1019
|
+
result += '"';
|
|
1020
|
+
} else if (prevSig === ":") {
|
|
1021
|
+
result += "null";
|
|
1022
|
+
}
|
|
1023
|
+
for (let k = stack.length - 1; k >= 0; k--) {
|
|
1024
|
+
result += stack[k] === "{" ? "}" : "]";
|
|
1025
|
+
}
|
|
1026
|
+
if (!tryParse(result).ok) {
|
|
1027
|
+
const patched = result.replace(/:(\s*)([}\]])/g, ":null$2");
|
|
1028
|
+
if (tryParse(patched).ok) result = patched;
|
|
1033
1029
|
}
|
|
1034
1030
|
return result;
|
|
1035
1031
|
}
|
|
1032
|
+
var VALID_ESCAPE = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t", "u"]);
|
|
1033
|
+
function endsWithInvalidEscape(str) {
|
|
1034
|
+
const last = str[str.length - 1];
|
|
1035
|
+
if (str[str.length - 2] !== "\\" || last === void 0) return false;
|
|
1036
|
+
if (VALID_ESCAPE.has(last)) return false;
|
|
1037
|
+
let backslashes = 0;
|
|
1038
|
+
for (let k = str.length - 2; k >= 0 && str[k] === "\\"; k--) backslashes++;
|
|
1039
|
+
return backslashes % 2 === 1;
|
|
1040
|
+
}
|
|
1036
1041
|
function tryParse(s) {
|
|
1037
1042
|
try {
|
|
1038
1043
|
return { ok: true, value: JSON.parse(s) };
|