@wrongstack/core 0.3.3 → 0.3.4
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/{config-D2qvAxVd.d.ts → config-DgE3JslD.d.ts} +1 -0
- package/dist/coordination/index.d.ts +4 -2
- package/dist/coordination/index.js +38 -8
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +4 -4
- package/dist/defaults/index.js +94 -11
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +3 -3
- package/dist/execution/index.js +45 -1
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +2 -2
- package/dist/{index-hWNybrNZ.d.ts → index-DedY4Euf.d.ts} +7 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +95 -12
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +2 -2
- package/dist/kernel/index.d.ts +1 -1
- package/dist/{mcp-servers-C2OopXOn.d.ts → mcp-servers-zGiC1lQc.d.ts} +1 -1
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/dist/security/index.js +5 -1
- package/dist/security/index.js.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +41 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/{tool-executor-HsBLGRaA.d.ts → tool-executor-DY0iSXYf.d.ts} +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +43 -2
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +22 -1
- package/dist/utils/index.js +41 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-
|
|
1
|
+
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-DY0iSXYf.js';
|
|
2
2
|
import { g as Provider, a0 as Context } from '../context-IovtuTf8.js';
|
|
3
3
|
import { a as Compactor, C as CompactReport } from '../compactor-DpJBI1YH.js';
|
|
4
4
|
import { M as MessageSelector } from '../selector-wT2fv9Fg.js';
|
|
5
5
|
import { E as EventBus } from '../events-BHIQs4o1.js';
|
|
6
6
|
import { c as MiddlewareHandler } from '../system-prompt-Dk1qm8ey.js';
|
|
7
|
-
import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-
|
|
8
|
-
import { r as Agent, R as RunResult } from '../index-
|
|
7
|
+
import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-DgE3JslD.js';
|
|
8
|
+
import { r as Agent, R as RunResult } from '../index-DedY4Euf.js';
|
|
9
9
|
import { D as DoneCondition } from '../multi-agent-B9a6sflH.js';
|
|
10
10
|
import { a as SkillLoader, b as SkillManifest, S as SkillEntry } from '../skill-C_7znCIC.js';
|
|
11
11
|
import { a as WstackPaths } from '../wstack-paths-BGu2INTm.js';
|
package/dist/execution/index.js
CHANGED
|
@@ -1318,11 +1318,55 @@ var ToolExecutor = class {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
};
|
|
1320
1320
|
|
|
1321
|
+
// src/utils/regex-guard.ts
|
|
1322
|
+
var MAX_PATTERN_LEN = 512;
|
|
1323
|
+
var DANGEROUS_PATTERNS = [
|
|
1324
|
+
/(\([^)]*[+*][^)]*\))[+*]/,
|
|
1325
|
+
// (a+)+, (.*)+, etc
|
|
1326
|
+
/(\(\?:[^)]*[+*][^)]*\))[+*]/
|
|
1327
|
+
// same, with non-capturing group
|
|
1328
|
+
];
|
|
1329
|
+
function compileUserRegex(pattern, flags) {
|
|
1330
|
+
if (typeof pattern !== "string") {
|
|
1331
|
+
return { ok: false, reason: "pattern must be a string" };
|
|
1332
|
+
}
|
|
1333
|
+
if (pattern.length === 0) {
|
|
1334
|
+
return { ok: false, reason: "pattern is empty" };
|
|
1335
|
+
}
|
|
1336
|
+
if (pattern.length > MAX_PATTERN_LEN) {
|
|
1337
|
+
return { ok: false, reason: `pattern exceeds ${MAX_PATTERN_LEN} characters` };
|
|
1338
|
+
}
|
|
1339
|
+
for (const rx of DANGEROUS_PATTERNS) {
|
|
1340
|
+
if (rx.test(pattern)) {
|
|
1341
|
+
return {
|
|
1342
|
+
ok: false,
|
|
1343
|
+
reason: "pattern looks vulnerable to catastrophic backtracking \u2014 rewrite without nested quantifiers"
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
try {
|
|
1348
|
+
return { ok: true, regex: new RegExp(pattern, flags) };
|
|
1349
|
+
} catch (err) {
|
|
1350
|
+
return {
|
|
1351
|
+
ok: false,
|
|
1352
|
+
reason: err instanceof Error ? err.message : "invalid regex"
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1321
1357
|
// src/execution/autonomous-runner.ts
|
|
1322
1358
|
var DoneConditionChecker = class {
|
|
1323
1359
|
constructor(condition) {
|
|
1324
1360
|
this.condition = condition;
|
|
1325
|
-
|
|
1361
|
+
if (condition.type === "output_match" && condition.pattern) {
|
|
1362
|
+
const result = compileUserRegex(condition.pattern, "");
|
|
1363
|
+
this.compiledRegex = result.ok ? result.regex : null;
|
|
1364
|
+
if (!result.ok) {
|
|
1365
|
+
console.warn(`[DoneConditionChecker] Invalid regex pattern "${condition.pattern}": ${result.reason}`);
|
|
1366
|
+
}
|
|
1367
|
+
} else {
|
|
1368
|
+
this.compiledRegex = null;
|
|
1369
|
+
}
|
|
1326
1370
|
}
|
|
1327
1371
|
condition;
|
|
1328
1372
|
compiledRegex;
|