@wrongstack/core 0.89.1 → 0.89.3
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-B8F2ORwg.d.ts → agent-bridge-DbVe1dHT.d.ts} +1 -1
- package/dist/{agent-subagent-runner-CQaLFNnA.d.ts → agent-subagent-runner-C6eqID1t.d.ts} +433 -433
- package/dist/{events-DzyLtja6.d.ts → brain-s9DyD_Vf.d.ts} +179 -92
- package/dist/{compactor-CJq7LQev.d.ts → compactor-DXLxLcmU.d.ts} +2 -2
- package/dist/{config-_DZ7dN-T.d.ts → config-84VaZpH6.d.ts} +45 -38
- package/dist/{context-ToHAp4-U.d.ts → context-CNRYfhUv.d.ts} +1 -1
- package/dist/coordination/index.d.ts +16 -17
- package/dist/coordination/index.js +25 -37
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +31 -33
- package/dist/defaults/index.js +476 -206
- package/dist/defaults/index.js.map +1 -1
- package/dist/{director-state-CgIc30qi.d.ts → director-state-BfeCUbmk.d.ts} +1 -1
- package/dist/execution/index.d.ts +18 -19
- package/dist/execution/index.js +23 -45
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +9 -10
- package/dist/extension/index.js +8 -6
- package/dist/extension/index.js.map +1 -1
- package/dist/{index-Ca_lOmKl.d.ts → index-CqrroYcU.d.ts} +13 -15
- package/dist/{index-Dx-CnrDN.d.ts → index-D3Nax3YU.d.ts} +9 -10
- package/dist/index.d.ts +184 -174
- package/dist/index.js +973 -349
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +9 -9
- package/dist/infrastructure/index.js +4 -2
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +14 -16
- package/dist/kernel/index.js.map +1 -1
- package/dist/{logger-B72yyPc6.d.ts → logger-B63L5bTg.d.ts} +1 -1
- package/dist/{logger-C_27pj9i.d.ts → logger-B9J5puGM.d.ts} +1 -1
- package/dist/{mcp-servers-Dck3T85_.d.ts → mcp-servers-D3E5ixAR.d.ts} +3 -3
- package/dist/{mode-CHo2XtHs.d.ts → mode-ARA3HrkY.d.ts} +1 -1
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +8 -6
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-Be3osGt5.d.ts → models-registry-B6_KfS65.d.ts} +1 -1
- package/dist/{models-registry-Boz639EI.d.ts → models-registry-DU64QxQa.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-Da9nd8Ic.d.ts → multi-agent-coordinator-DHNrjPaA.d.ts} +2 -2
- package/dist/{null-fleet-bus-CHJOXv3t.d.ts → null-fleet-bus-BzzciAc4.d.ts} +32 -31
- package/dist/observability/index.d.ts +3 -3
- package/dist/{observability-CoSNZdhX.d.ts → observability-D-HZN_mF.d.ts} +1 -1
- package/dist/{parallel-eternal-engine-DyMCj2Pw.d.ts → parallel-eternal-engine-CTpcrb9O.d.ts} +33 -33
- package/dist/{path-resolver-TjBlRKyH.d.ts → path-resolver-B7hgMAVe.d.ts} +3 -3
- package/dist/{permission-14CChMmO.d.ts → permission-BDv7z0mk.d.ts} +7 -2
- package/dist/{permission-policy-gW5htOo1.d.ts → permission-policy-dF74EpDp.d.ts} +2 -2
- package/dist/{system-prompt-C0rLCeyn.d.ts → pipeline-C1Ad9OjI.d.ts} +73 -73
- package/dist/{plan-templates-D9UhwoGh.d.ts → plan-templates-CNphsz0n.d.ts} +79 -11
- package/dist/{provider-runner-BEPWwkxH.d.ts → provider-runner-cqvlB_oS.d.ts} +5 -5
- package/dist/{retry-policy-DSu6O6rD.d.ts → retry-policy-BcmuT_V0.d.ts} +2 -2
- package/dist/sdd/index.d.ts +12 -33
- package/dist/sdd/index.js +21 -31
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-scrubber-yGBFQYju.d.ts → secret-vault-DrOhc2i5.d.ts} +7 -7
- package/dist/security/index.d.ts +4 -5
- package/dist/security/index.js +4 -2
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-11-fm95U.d.ts → selector-C7wcdqMA.d.ts} +1 -1
- package/dist/{session-event-bridge-D0u-x576.d.ts → session-event-bridge-IVzs2GpE.d.ts} +1 -1
- package/dist/{session-reader-BQU-toaN.d.ts → session-reader-DDz1Ek4V.d.ts} +2 -2
- package/dist/{skill-BJeF2DwY.d.ts → skill-BJxzIyyN.d.ts} +1 -1
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +3 -9
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +132 -12
- package/dist/storage/index.js +834 -159
- package/dist/storage/index.js.map +1 -1
- package/dist/{task-graph-CikNdRTG.d.ts → task-graph-DJBqO0EY.d.ts} +1 -1
- package/dist/types/index.d.ts +25 -27
- package/dist/types/index.js +19 -31
- package/dist/types/index.js.map +1 -1
- package/dist/utils/expect-defined.d.ts +7 -0
- package/dist/utils/expect-defined.js +11 -0
- package/dist/utils/expect-defined.js.map +1 -0
- package/dist/utils/index.d.ts +6 -20
- package/dist/utils/index.js +11 -41
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-BQMvEllz.d.ts → wstack-paths-_lqjzErq.d.ts} +1 -1
- package/package.json +5 -1
- package/dist/memory-CEXuo7sz.d.ts +0 -16
- package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Assert a value is neither null nor undefined. Throws if it is.
|
|
2
|
+
* Useful after optional chaining and indexed access when the
|
|
3
|
+
* control flow guarantees the value exists but TypeScript can't
|
|
4
|
+
* prove it (e.g. after a check on a related field). */
|
|
5
|
+
declare function expectDefined<T>(value: T | null | undefined, label?: string): T;
|
|
6
|
+
|
|
7
|
+
export { expectDefined };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/utils/expect-defined.ts
|
|
2
|
+
function expectDefined(value, label) {
|
|
3
|
+
if (value === null || value === void 0) {
|
|
4
|
+
throw new Error(label ? `Expected ${label} to be defined` : "Expected value to be defined");
|
|
5
|
+
}
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { expectDefined };
|
|
10
|
+
//# sourceMappingURL=expect-defined.js.map
|
|
11
|
+
//# sourceMappingURL=expect-defined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/expect-defined.ts"],"names":[],"mappings":";AAIO,SAAS,aAAA,CAAiB,OAA6B,KAAA,EAAmB;AAC/E,EAAA,IAAI,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA,EAAW;AACzC,IAAA,MAAM,IAAI,KAAA,CAAM,KAAA,GAAQ,CAAA,SAAA,EAAY,KAAK,mBAAmB,8BAA8B,CAAA;AAAA,EAC5F;AACA,EAAA,OAAO,KAAA;AACT","file":"expect-defined.js","sourcesContent":["/** Assert a value is neither null nor undefined. Throws if it is.\n * Useful after optional chaining and indexed access when the\n * control flow guarantees the value exists but TypeScript can't\n * prove it (e.g. after a check on a related field). */\nexport function expectDefined<T>(value: T | null | undefined, label?: string): T {\n if (value === null || value === undefined) {\n throw new Error(label ? `Expected ${label} to be defined` : 'Expected value to be defined');\n }\n return value;\n}\n"]}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
import { s as TodoItem, M as Message, J as JSONSchema } from '../context-CNRYfhUv.js';
|
|
2
|
+
export { a as WstackPathOptions, W as WstackPaths, p as projectHash, b as projectSlug, r as resolveWstackPaths } from '../wstack-paths-_lqjzErq.js';
|
|
3
|
+
export { expectDefined } from './expect-defined.js';
|
|
4
|
+
import { a as ModelsDevPayload } from '../models-registry-B6_KfS65.js';
|
|
5
|
+
import { q as CustomModelDefinition } from '../config-84VaZpH6.js';
|
|
5
6
|
|
|
6
7
|
interface AtomicWriteOptions {
|
|
7
8
|
mode?: number | undefined;
|
|
@@ -259,12 +260,6 @@ declare function buildChildEnv(optsOrSessionId?: BuildChildEnvOptions | string):
|
|
|
259
260
|
* and an abortable variant can be introduced without a codebase-wide hunt. */
|
|
260
261
|
declare function sleep(ms: number): Promise<void>;
|
|
261
262
|
|
|
262
|
-
/** Assert a value is neither null nor undefined. Throws if it is.
|
|
263
|
-
* Useful after optional chaining and indexed access when the
|
|
264
|
-
* control flow guarantees the value exists but TypeScript can't
|
|
265
|
-
* prove it (e.g. after a check on a related field). */
|
|
266
|
-
declare function expectDefined<T>(value: T | null | undefined): T;
|
|
267
|
-
|
|
268
263
|
/**
|
|
269
264
|
* Tool output serialization utilities.
|
|
270
265
|
* Extracted from Agent.executeTools to allow reuse and consistent output handling.
|
|
@@ -434,15 +429,6 @@ interface CompileFail {
|
|
|
434
429
|
}
|
|
435
430
|
declare function compileUserRegex(pattern: string, flags: string): CompileResult | CompileFail;
|
|
436
431
|
|
|
437
|
-
/**
|
|
438
|
-
* Glob pattern → concrete file path expansion.
|
|
439
|
-
*
|
|
440
|
-
* Supports: *, **, ?, [...]
|
|
441
|
-
* Does NOT support brace expansion {a,b}.
|
|
442
|
-
*
|
|
443
|
-
* Returns the input as-is if it contains no glob metacharacters.
|
|
444
|
-
* On Windows, both / and \ are accepted as path separators.
|
|
445
|
-
*/
|
|
446
432
|
/**
|
|
447
433
|
* Resolve `pattern` to the set of concrete file paths it matches.
|
|
448
434
|
* Literal paths (no glob chars) are returned as-is.
|
|
@@ -506,4 +492,4 @@ declare function mergeModelsPayload(base: ModelsDevPayload, overlay: ModelsDevPa
|
|
|
506
492
|
*/
|
|
507
493
|
declare function mergeCustomModelDefs(providerCustomModels: Record<string, CustomModelDefinition> | undefined, configModels: Record<string, CustomModelDefinition> | undefined): Record<string, CustomModelDefinition> | undefined;
|
|
508
494
|
|
|
509
|
-
export { type AtomicWriteOptions, type BuildChildEnvOptions, type CompileFail, type CompileResult, type FileLockOptions, type MessageRepairReport, type MessageRepairResult, type NewlineStyle, type OutputLineGuard, type RequestTokenBreakdown, type SafeParseResult, type ToolOutputSerializerOptions, type UnifiedDiffOptions, type ValidationError, type ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob,
|
|
495
|
+
export { type AtomicWriteOptions, type BuildChildEnvOptions, type CompileFail, type CompileResult, type FileLockOptions, type MessageRepairReport, type MessageRepairResult, type NewlineStyle, type OutputLineGuard, type RequestTokenBreakdown, type SafeParseResult, type ToolOutputSerializerOptions, type UnifiedDiffOptions, type ValidationError, type ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, formatTodosList, getCalibrationState, getTermSize, isInteractive, isStdinTTY, isStdoutTTY, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizeToLf, onResize, recordActualUsage, repairToolUseAdjacency, resetCalibration, safeParse, safeStringify, sanitizeJsonString, setOutputLineGuard, setRawMode, sleep, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema, withFileLock, writeErr, writeOut };
|
package/dist/utils/index.js
CHANGED
|
@@ -364,13 +364,15 @@ function formatTodosList(todos) {
|
|
|
364
364
|
return lines.join("\n");
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
// src/utils/
|
|
368
|
-
function expectDefined(value) {
|
|
367
|
+
// src/utils/expect-defined.ts
|
|
368
|
+
function expectDefined(value, label) {
|
|
369
369
|
if (value === null || value === void 0) {
|
|
370
|
-
throw new Error("Expected value to be defined");
|
|
370
|
+
throw new Error(label ? `Expected ${label} to be defined` : "Expected value to be defined");
|
|
371
371
|
}
|
|
372
372
|
return value;
|
|
373
373
|
}
|
|
374
|
+
|
|
375
|
+
// src/utils/glob-match.ts
|
|
374
376
|
function escapeRegex(s) {
|
|
375
377
|
return s.replace(/[.+^${}()|\\]/g, "\\$&");
|
|
376
378
|
}
|
|
@@ -743,14 +745,6 @@ function sleep(ms) {
|
|
|
743
745
|
return new Promise((resolve3) => setTimeout(resolve3, ms));
|
|
744
746
|
}
|
|
745
747
|
|
|
746
|
-
// src/utils/expect-defined.ts
|
|
747
|
-
function expectDefined2(value) {
|
|
748
|
-
if (value === null || value === void 0) {
|
|
749
|
-
throw new Error("Expected value to be defined");
|
|
750
|
-
}
|
|
751
|
-
return value;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
748
|
// src/utils/tool-output-serializer.ts
|
|
755
749
|
function createToolOutputSerializer(opts = {}) {
|
|
756
750
|
const capBytes = opts.perIterationOutputCapBytes ?? 1e5;
|
|
@@ -796,12 +790,6 @@ function createToolOutputSerializer(opts = {}) {
|
|
|
796
790
|
}
|
|
797
791
|
|
|
798
792
|
// src/utils/token-estimate.ts
|
|
799
|
-
function expectDefined3(value) {
|
|
800
|
-
if (value === null || value === void 0) {
|
|
801
|
-
throw new Error("Expected value to be defined");
|
|
802
|
-
}
|
|
803
|
-
return value;
|
|
804
|
-
}
|
|
805
793
|
var RoughTokenEstimate = (text, charsPerToken = 3.5) => Math.max(1, Math.ceil(text.length / charsPerToken));
|
|
806
794
|
var _cal = {
|
|
807
795
|
ratio: 1,
|
|
@@ -822,7 +810,7 @@ function getCachedEstimate(key, compute) {
|
|
|
822
810
|
if (ESTIMATE_CACHE.size >= ESTIMATE_CACHE_MAX_SIZE) {
|
|
823
811
|
const keys = [...ESTIMATE_CACHE.keys()];
|
|
824
812
|
for (let i = 0; i < Math.floor(ESTIMATE_CACHE_MAX_SIZE / 4); i++) {
|
|
825
|
-
ESTIMATE_CACHE.delete(
|
|
813
|
+
ESTIMATE_CACHE.delete(expectDefined(keys[i]));
|
|
826
814
|
}
|
|
827
815
|
}
|
|
828
816
|
const estimate = compute();
|
|
@@ -935,12 +923,6 @@ function resetCalibration() {
|
|
|
935
923
|
}
|
|
936
924
|
|
|
937
925
|
// src/utils/message-invariants.ts
|
|
938
|
-
function expectDefined4(value) {
|
|
939
|
-
if (value === null || value === void 0) {
|
|
940
|
-
throw new Error("Expected value to be defined");
|
|
941
|
-
}
|
|
942
|
-
return value;
|
|
943
|
-
}
|
|
944
926
|
function repairToolUseAdjacency(messages) {
|
|
945
927
|
const removedToolUses = [];
|
|
946
928
|
const removedToolResults = [];
|
|
@@ -948,7 +930,7 @@ function repairToolUseAdjacency(messages) {
|
|
|
948
930
|
let changed = false;
|
|
949
931
|
const out = [];
|
|
950
932
|
for (let i = 0; i < messages.length; i++) {
|
|
951
|
-
const original =
|
|
933
|
+
const original = expectDefined(messages[i]);
|
|
952
934
|
let msg = original;
|
|
953
935
|
if (hasToolUse(msg)) {
|
|
954
936
|
const nextIds = toolResultIds(messages[i + 1]);
|
|
@@ -1161,12 +1143,6 @@ function compileUserRegex(pattern, flags) {
|
|
|
1161
1143
|
};
|
|
1162
1144
|
}
|
|
1163
1145
|
}
|
|
1164
|
-
function expectDefined5(value) {
|
|
1165
|
-
if (value === null || value === void 0) {
|
|
1166
|
-
throw new Error("Expected value to be defined");
|
|
1167
|
-
}
|
|
1168
|
-
return value;
|
|
1169
|
-
}
|
|
1170
1146
|
var GLOB_CHARS = /* @__PURE__ */ new Set(["*", "?", "["]);
|
|
1171
1147
|
var IS_WINDOWS = process.platform === "win32";
|
|
1172
1148
|
var SEP = IS_WINDOWS ? "\\" : "/";
|
|
@@ -1180,7 +1156,7 @@ function globToRegex(pat) {
|
|
|
1180
1156
|
let i = 0;
|
|
1181
1157
|
let re = "^";
|
|
1182
1158
|
while (i < pat.length) {
|
|
1183
|
-
const c =
|
|
1159
|
+
const c = expectDefined(pat[i]);
|
|
1184
1160
|
if (c === "*") {
|
|
1185
1161
|
if (pat[i + 1] === "*") {
|
|
1186
1162
|
re += ".*";
|
|
@@ -1219,7 +1195,7 @@ function globToRegex(pat) {
|
|
|
1219
1195
|
}
|
|
1220
1196
|
function baseDir(pat) {
|
|
1221
1197
|
let i = pat.length - 1;
|
|
1222
|
-
while (i >= 0 && !GLOB_CHARS.has(
|
|
1198
|
+
while (i >= 0 && !GLOB_CHARS.has(expectDefined(pat[i])) && pat[i] !== SEP && pat[i] !== "/") i--;
|
|
1223
1199
|
const cut = i >= 0 ? pat.lastIndexOf(SEP, i) : pat.lastIndexOf("/", i);
|
|
1224
1200
|
return cut < 0 ? "." : pat.slice(0, cut);
|
|
1225
1201
|
}
|
|
@@ -1284,12 +1260,6 @@ async function expandGlob(pattern) {
|
|
|
1284
1260
|
}
|
|
1285
1261
|
|
|
1286
1262
|
// src/utils/json-repair.ts
|
|
1287
|
-
function expectDefined6(value) {
|
|
1288
|
-
if (value === null || value === void 0) {
|
|
1289
|
-
throw new Error("Expected value to be defined");
|
|
1290
|
-
}
|
|
1291
|
-
return value;
|
|
1292
|
-
}
|
|
1293
1263
|
function completePartialObject(s) {
|
|
1294
1264
|
if (!s.trim().startsWith("{")) return s;
|
|
1295
1265
|
if (tryParse(s).ok) return s;
|
|
@@ -1301,7 +1271,7 @@ function completePartialObject(s) {
|
|
|
1301
1271
|
let contentEnd = 0;
|
|
1302
1272
|
let stringBraceDepth = 0;
|
|
1303
1273
|
for (let i = 0; i < s.length; i++) {
|
|
1304
|
-
const ch =
|
|
1274
|
+
const ch = expectDefined(s[i]);
|
|
1305
1275
|
if (inString) {
|
|
1306
1276
|
contentEnd = i + 1;
|
|
1307
1277
|
if (escaped) {
|
|
@@ -1458,6 +1428,6 @@ function mergeCustomModelDefs(providerCustomModels, configModels) {
|
|
|
1458
1428
|
return out;
|
|
1459
1429
|
}
|
|
1460
1430
|
|
|
1461
|
-
export { atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob,
|
|
1431
|
+
export { atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expectDefined, formatTodosList, getCalibrationState, getTermSize, isInteractive, isStdinTTY, isStdoutTTY, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizeToLf, onResize, projectHash, projectSlug, recordActualUsage, repairToolUseAdjacency, resetCalibration, resolveWstackPaths, safeParse, safeStringify, sanitizeJsonString, setOutputLineGuard, setRawMode, sleep, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema, withFileLock, writeErr, writeOut };
|
|
1462
1432
|
//# sourceMappingURL=index.js.map
|
|
1463
1433
|
//# sourceMappingURL=index.js.map
|