@wrongstack/core 0.107.2 → 0.119.1
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-mOxbpFcg.d.ts → agent-bridge-PRAbEX-9.d.ts} +1 -1
- package/dist/{agent-subagent-runner-DukQLUcS.d.ts → agent-subagent-runner-DXWImnNV.d.ts} +7 -8
- package/dist/{brain-Dfv4Y82E.d.ts → brain-NZZqL8sn.d.ts} +1 -1
- package/dist/{compactor-DXLxLcmU.d.ts → compactor-C3stu664.d.ts} +1 -1
- package/dist/{config-BSU-6vah.d.ts → config-DZV9VK9n.d.ts} +104 -3
- package/dist/{context-CNRYfhUv.d.ts → context-hvXINa6a.d.ts} +31 -1
- package/dist/coordination/index.d.ts +12 -13
- package/dist/coordination/index.js +198 -0
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +27 -28
- package/dist/defaults/index.js +346 -86
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +16 -17
- package/dist/execution/index.js +266 -12
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -7
- package/dist/{goal-preamble-CI8lxeY1.d.ts → goal-preamble-COpt55W8.d.ts} +10 -10
- package/dist/{goal-store-ht0VmR1A.d.ts → goal-store-CV9Yz2X_.d.ts} +11 -0
- package/dist/{index-DIKEcfgC.d.ts → index-4VVHuTZF.d.ts} +7 -6
- package/dist/{index-BWRN6wOb.d.ts → index-Cj3le7TI.d.ts} +9 -10
- package/dist/index.d.ts +41 -42
- package/dist/index.js +372 -118
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -7
- package/dist/kernel/index.d.ts +10 -11
- package/dist/llm-selector-Bmx4PsVM.d.ts +58 -0
- package/dist/{mcp-servers-CXCsANdY.d.ts → mcp-servers-CofNHOqn.d.ts} +3 -3
- package/dist/{mode-ARA3HrkY.d.ts → mode-CZlO9iU1.d.ts} +1 -1
- package/dist/models/index.d.ts +157 -53
- package/dist/models/index.js +423 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-DU64QxQa.d.ts → models-registry-BzlsjKcy.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-51LvnXkD.d.ts → multi-agent-coordinator-CmDmUgq2.d.ts} +1 -1
- package/dist/{null-fleet-bus-D09hMzFQ.d.ts → null-fleet-bus-CyH2YqP4.d.ts} +6 -6
- package/dist/observability/index.d.ts +2 -2
- package/dist/{parallel-eternal-engine-CUtmM_0V.d.ts → parallel-eternal-engine-uxVm4y4V.d.ts} +11 -10
- package/dist/{path-resolver-DDJiMAtX.d.ts → path-resolver-gfoGxpdd.d.ts} +3 -3
- package/dist/{permission-BDv7z0mk.d.ts → permission-DhLrgA30.d.ts} +1 -1
- package/dist/{permission-policy-dF74EpDp.d.ts → permission-policy-DGOvne7i.d.ts} +2 -2
- package/dist/{pipeline-BqiA_UMr.d.ts → pipeline-CqF7uju2.d.ts} +2 -2
- package/dist/{plan-templates-BdDxl9cI.d.ts → plan-templates-DoKhzenv.d.ts} +6 -6
- package/dist/{provider-runner-BUunikwY.d.ts → provider-runner-BPlI5sPZ.d.ts} +3 -3
- package/dist/{retry-policy-BcmuT_V0.d.ts → retry-policy-B4Q-FZgE.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -9
- package/dist/sdd/index.js +198 -0
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-DrOhc2i5.d.ts → secret-vault-B7GnL6o9.d.ts} +1 -1
- package/dist/security/index.d.ts +4 -4
- package/dist/{selector-C7wcdqMA.d.ts → selector-BakeMnWR.d.ts} +1 -1
- package/dist/{session-event-bridge-BpJ5trO9.d.ts → session-event-bridge-DE5Oekwx.d.ts} +1 -1
- package/dist/{session-reader-DDz1Ek4V.d.ts → session-reader-DFC81-4p.d.ts} +1 -1
- package/dist/storage/index.d.ts +12 -13
- package/dist/storage/index.js +147 -88
- package/dist/storage/index.js.map +1 -1
- package/dist/types/index.d.ts +20 -21
- package/dist/types/index.js +35 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-_lqjzErq.d.ts → wstack-paths-DD50Omgn.d.ts} +3 -0
- package/package.json +1 -1
- package/dist/models-registry-B6_KfS65.d.ts +0 -95
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { readFile, readdir, stat, mkdir } from 'fs/promises';
|
|
|
5
5
|
import * as path6 from 'path';
|
|
6
6
|
import { join, extname, relative, isAbsolute, resolve, sep } from 'path';
|
|
7
7
|
import * as fs2 from 'fs';
|
|
8
|
-
import * as
|
|
8
|
+
import * as os6 from 'os';
|
|
9
9
|
import { hostname } from 'os';
|
|
10
10
|
import { execFile, spawn } from 'child_process';
|
|
11
11
|
import { promisify } from 'util';
|
|
@@ -99,7 +99,7 @@ async function withFileLock(targetPath, fn, opts = {}) {
|
|
|
99
99
|
if (Date.now() - started >= timeoutMs) {
|
|
100
100
|
throw new Error(`Timed out waiting for file lock: ${targetPath}`);
|
|
101
101
|
}
|
|
102
|
-
await new Promise((
|
|
102
|
+
await new Promise((resolve12) => setTimeout(resolve12, 25));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
try {
|
|
@@ -132,7 +132,7 @@ async function renameWithRetry(from, to) {
|
|
|
132
132
|
if (!code || !TRANSIENT_RENAME_CODES.has(code) || i === delays.length) {
|
|
133
133
|
throw err;
|
|
134
134
|
}
|
|
135
|
-
await new Promise((
|
|
135
|
+
await new Promise((resolve12) => setTimeout(resolve12, delays[i]));
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
throw lastErr;
|
|
@@ -1114,6 +1114,39 @@ function describeStatus(status, type) {
|
|
|
1114
1114
|
function truncate(s, n) {
|
|
1115
1115
|
return s.length <= n ? s : `${s.slice(0, n - 1)}\u2026`;
|
|
1116
1116
|
}
|
|
1117
|
+
var StreamHangError = class extends ProviderError {
|
|
1118
|
+
/** Name of the provider that hung, e.g. "zai", "anthropic". */
|
|
1119
|
+
hungProviderId;
|
|
1120
|
+
/** Model that was being called when the hang occurred. */
|
|
1121
|
+
hungModel;
|
|
1122
|
+
/** How long (ms) we waited for the next chunk before declaring a hang. */
|
|
1123
|
+
hangTimeoutMs;
|
|
1124
|
+
/** How many bytes were received before the hang. */
|
|
1125
|
+
bytesReceived;
|
|
1126
|
+
/** Elapsed time (ms) from the start of the stream until the hang. */
|
|
1127
|
+
elapsedMs;
|
|
1128
|
+
constructor(opts) {
|
|
1129
|
+
super(
|
|
1130
|
+
`Stream hang: ${opts.providerId}/${opts.model} \u2014 no data for ${opts.hangTimeoutMs}ms after ${opts.bytesReceived} bytes (${opts.elapsedMs}ms elapsed)`,
|
|
1131
|
+
599,
|
|
1132
|
+
true,
|
|
1133
|
+
// always retryable
|
|
1134
|
+
opts.providerId,
|
|
1135
|
+
{
|
|
1136
|
+
body: {
|
|
1137
|
+
message: `Stream stalled after ${opts.elapsedMs}ms, ${opts.bytesReceived} bytes received`
|
|
1138
|
+
},
|
|
1139
|
+
cause: opts.cause
|
|
1140
|
+
}
|
|
1141
|
+
);
|
|
1142
|
+
this.name = "StreamHangError";
|
|
1143
|
+
this.hungProviderId = opts.providerId;
|
|
1144
|
+
this.hungModel = opts.model;
|
|
1145
|
+
this.hangTimeoutMs = opts.hangTimeoutMs;
|
|
1146
|
+
this.bytesReceived = opts.bytesReceived;
|
|
1147
|
+
this.elapsedMs = opts.elapsedMs;
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1117
1150
|
function providerStatusToCode(status, type) {
|
|
1118
1151
|
if (status === 0) return ERROR_CODES.PROVIDER_NETWORK_ERROR;
|
|
1119
1152
|
if (type === "rate_limit_error" || status === 429) return ERROR_CODES.PROVIDER_RATE_LIMITED;
|
|
@@ -2139,7 +2172,7 @@ var DefaultPathResolver = class {
|
|
|
2139
2172
|
detectProjectRoot(start) {
|
|
2140
2173
|
let dir = path6.resolve(start);
|
|
2141
2174
|
const root = path6.parse(dir).root;
|
|
2142
|
-
const home = path6.resolve(
|
|
2175
|
+
const home = path6.resolve(os6.homedir());
|
|
2143
2176
|
const startPath = path6.resolve(start);
|
|
2144
2177
|
while (dir !== root) {
|
|
2145
2178
|
if (dir === home && dir !== startPath) {
|
|
@@ -2322,6 +2355,7 @@ var DefaultRetryPolicy = class {
|
|
|
2322
2355
|
if (err instanceof ProviderError) {
|
|
2323
2356
|
if (err.status === 429) return 5;
|
|
2324
2357
|
if (err.status === 529) return 3;
|
|
2358
|
+
if (err.status === 599) return 5;
|
|
2325
2359
|
if (err.status >= 500) return 3;
|
|
2326
2360
|
return 0;
|
|
2327
2361
|
}
|
|
@@ -3200,7 +3234,7 @@ var InMemoryAgentBridge = class {
|
|
|
3200
3234
|
);
|
|
3201
3235
|
}
|
|
3202
3236
|
this.inflightGuards.add(correlationId);
|
|
3203
|
-
return new Promise((
|
|
3237
|
+
return new Promise((resolve12, reject) => {
|
|
3204
3238
|
const timer = setTimeout(() => {
|
|
3205
3239
|
this.inflightGuards.delete(correlationId);
|
|
3206
3240
|
this.pendingRequests.delete(correlationId);
|
|
@@ -3212,7 +3246,7 @@ var InMemoryAgentBridge = class {
|
|
|
3212
3246
|
return;
|
|
3213
3247
|
}
|
|
3214
3248
|
this.pendingRequests.set(correlationId, {
|
|
3215
|
-
resolve:
|
|
3249
|
+
resolve: resolve12,
|
|
3216
3250
|
reject,
|
|
3217
3251
|
timer
|
|
3218
3252
|
});
|
|
@@ -3405,11 +3439,11 @@ function validateAgainstSchema(value, schema) {
|
|
|
3405
3439
|
walk2(value, schema, "", errors);
|
|
3406
3440
|
return { ok: errors.length === 0, errors };
|
|
3407
3441
|
}
|
|
3408
|
-
function walk2(value, schema,
|
|
3442
|
+
function walk2(value, schema, path36, errors) {
|
|
3409
3443
|
if (schema.enum !== void 0) {
|
|
3410
3444
|
if (!schema.enum.some((e) => deepEqual(e, value))) {
|
|
3411
3445
|
errors.push({
|
|
3412
|
-
path:
|
|
3446
|
+
path: path36 || "<root>",
|
|
3413
3447
|
message: `expected one of ${JSON.stringify(schema.enum)}, got ${JSON.stringify(value)}`
|
|
3414
3448
|
});
|
|
3415
3449
|
return;
|
|
@@ -3418,7 +3452,7 @@ function walk2(value, schema, path37, errors) {
|
|
|
3418
3452
|
if (typeof schema.type === "string") {
|
|
3419
3453
|
if (!checkType(value, schema.type)) {
|
|
3420
3454
|
errors.push({
|
|
3421
|
-
path:
|
|
3455
|
+
path: path36 || "<root>",
|
|
3422
3456
|
message: `expected ${schema.type}, got ${describeType(value)}`
|
|
3423
3457
|
});
|
|
3424
3458
|
return;
|
|
@@ -3428,19 +3462,19 @@ function walk2(value, schema, path37, errors) {
|
|
|
3428
3462
|
const obj = value;
|
|
3429
3463
|
for (const req of schema.required ?? []) {
|
|
3430
3464
|
if (!(req in obj)) {
|
|
3431
|
-
errors.push({ path: joinPath(
|
|
3465
|
+
errors.push({ path: joinPath(path36, req), message: "required property missing" });
|
|
3432
3466
|
}
|
|
3433
3467
|
}
|
|
3434
3468
|
if (schema.properties) {
|
|
3435
3469
|
for (const [key, subSchema] of Object.entries(schema.properties)) {
|
|
3436
3470
|
if (key in obj) {
|
|
3437
|
-
walk2(obj[key], subSchema, joinPath(
|
|
3471
|
+
walk2(obj[key], subSchema, joinPath(path36, key), errors);
|
|
3438
3472
|
}
|
|
3439
3473
|
}
|
|
3440
3474
|
}
|
|
3441
3475
|
}
|
|
3442
3476
|
if (schema.type === "array" && Array.isArray(value) && schema.items) {
|
|
3443
|
-
value.forEach((item, i) => walk2(item, schema.items, `${
|
|
3477
|
+
value.forEach((item, i) => walk2(item, schema.items, `${path36}[${i}]`, errors));
|
|
3444
3478
|
}
|
|
3445
3479
|
}
|
|
3446
3480
|
function checkType(value, type) {
|
|
@@ -4451,7 +4485,7 @@ function computeTaskItemProgress(tasks) {
|
|
|
4451
4485
|
let failed = 0;
|
|
4452
4486
|
let review = 0;
|
|
4453
4487
|
let estimatedHours = 0;
|
|
4454
|
-
|
|
4488
|
+
const actualHours = 0;
|
|
4455
4489
|
for (const t2 of tasks) {
|
|
4456
4490
|
switch (t2.status) {
|
|
4457
4491
|
case "completed":
|
|
@@ -4790,7 +4824,7 @@ function slugify(name) {
|
|
|
4790
4824
|
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) || "project";
|
|
4791
4825
|
}
|
|
4792
4826
|
function resolveWstackPaths(opts) {
|
|
4793
|
-
const home = opts.userHome ??
|
|
4827
|
+
const home = opts.userHome ?? os6.homedir();
|
|
4794
4828
|
const globalRoot = opts.globalRoot ?? path6.join(home, ".wrongstack");
|
|
4795
4829
|
const hash = projectHash(opts.projectRoot);
|
|
4796
4830
|
const slug = projectSlug(opts.projectRoot);
|
|
@@ -4815,6 +4849,7 @@ function resolveWstackPaths(opts) {
|
|
|
4815
4849
|
projectTrust: path6.join(projectDir, "trust.json"),
|
|
4816
4850
|
projectMeta: path6.join(projectDir, "meta.json"),
|
|
4817
4851
|
projectLocalConfig: path6.join(projectDir, "config.local.json"),
|
|
4852
|
+
inProjectConfig: path6.join(opts.projectRoot, ".wrongstack", "config.json"),
|
|
4818
4853
|
inProjectAgentsFile: path6.join(opts.projectRoot, ".wrongstack", "AGENTS.md"),
|
|
4819
4854
|
inProjectSkills: path6.join(opts.projectRoot, ".wrongstack", "skills"),
|
|
4820
4855
|
inProjectWorktrees: path6.join(opts.projectRoot, ".wrongstack", "worktrees"),
|
|
@@ -4921,7 +4956,7 @@ function buildChildEnv(optsOrSessionId) {
|
|
|
4921
4956
|
|
|
4922
4957
|
// src/utils/sleep.ts
|
|
4923
4958
|
function sleep(ms) {
|
|
4924
|
-
return new Promise((
|
|
4959
|
+
return new Promise((resolve12) => setTimeout(resolve12, ms));
|
|
4925
4960
|
}
|
|
4926
4961
|
var GLOB_CHARS = /* @__PURE__ */ new Set(["*", "?", "["]);
|
|
4927
4962
|
var IS_WINDOWS = process.platform === "win32";
|
|
@@ -6252,39 +6287,41 @@ ${line}`;
|
|
|
6252
6287
|
}
|
|
6253
6288
|
async forget(scope, query, filePath) {
|
|
6254
6289
|
const file = this.resolveFile(filePath, scope);
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
const
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6290
|
+
return withFileLock(file, async () => {
|
|
6291
|
+
let existing;
|
|
6292
|
+
try {
|
|
6293
|
+
existing = await fsp3.readFile(file, "utf8");
|
|
6294
|
+
} catch {
|
|
6295
|
+
return 0;
|
|
6296
|
+
}
|
|
6297
|
+
const needle = query.toLowerCase();
|
|
6298
|
+
const idMatcher = /mem_\d+_\w+/;
|
|
6299
|
+
let removed = 0;
|
|
6300
|
+
const lines = existing.split("\n").filter((line) => {
|
|
6301
|
+
const trimmed = line.trim();
|
|
6302
|
+
if (!trimmed.startsWith("- ")) return true;
|
|
6303
|
+
if (idMatcher.test(query)) {
|
|
6304
|
+
const entryIdMatch = /mem_\d+_\w+/.exec(trimmed);
|
|
6305
|
+
if (entryIdMatch && entryIdMatch[0] === query) {
|
|
6306
|
+
removed++;
|
|
6307
|
+
return false;
|
|
6308
|
+
}
|
|
6309
|
+
}
|
|
6310
|
+
if (trimmed.toLowerCase().includes(needle)) {
|
|
6270
6311
|
removed++;
|
|
6271
6312
|
return false;
|
|
6272
6313
|
}
|
|
6314
|
+
return true;
|
|
6315
|
+
});
|
|
6316
|
+
if (removed > 0) {
|
|
6317
|
+
if (lines.length === 0 || lines.length === 1 && !lines[0]?.trim()) {
|
|
6318
|
+
await atomicWrite(file, "");
|
|
6319
|
+
} else {
|
|
6320
|
+
await atomicWrite(file, lines.join("\n"));
|
|
6321
|
+
}
|
|
6273
6322
|
}
|
|
6274
|
-
|
|
6275
|
-
removed++;
|
|
6276
|
-
return false;
|
|
6277
|
-
}
|
|
6278
|
-
return true;
|
|
6323
|
+
return removed;
|
|
6279
6324
|
});
|
|
6280
|
-
if (removed > 0) {
|
|
6281
|
-
if (lines.length === 0 || lines.length === 1 && !lines[0]?.trim()) {
|
|
6282
|
-
await atomicWrite(file, "");
|
|
6283
|
-
} else {
|
|
6284
|
-
await atomicWrite(file, lines.join("\n"));
|
|
6285
|
-
}
|
|
6286
|
-
}
|
|
6287
|
-
return removed;
|
|
6288
6325
|
}
|
|
6289
6326
|
async readAll(scope, filePath) {
|
|
6290
6327
|
const file = this.resolveFile(filePath, scope);
|
|
@@ -6904,12 +6941,14 @@ var DefaultConfigLoader = class {
|
|
|
6904
6941
|
}
|
|
6905
6942
|
async load(opts = {}) {
|
|
6906
6943
|
let cfg = { ...BEHAVIOR_DEFAULTS };
|
|
6907
|
-
const [global, local] = await Promise.all([
|
|
6944
|
+
const [global, local, inProject] = await Promise.all([
|
|
6908
6945
|
this.readJson(this.paths.globalConfig),
|
|
6909
|
-
this.readJson(this.paths.projectLocalConfig)
|
|
6946
|
+
this.readJson(this.paths.projectLocalConfig),
|
|
6947
|
+
this.readJson(this.paths.inProjectConfig)
|
|
6910
6948
|
]);
|
|
6911
6949
|
cfg = deepMerge2(cfg, global);
|
|
6912
6950
|
cfg = deepMerge2(cfg, local);
|
|
6951
|
+
cfg = deepMerge2(cfg, inProject);
|
|
6913
6952
|
for (const [key, fn] of Object.entries(ENV_MAP)) {
|
|
6914
6953
|
const v = process.env[key];
|
|
6915
6954
|
if (v) fn(cfg, v);
|
|
@@ -7113,7 +7152,7 @@ var RecoveryLock = class {
|
|
|
7113
7152
|
constructor(opts) {
|
|
7114
7153
|
this.file = path6.join(opts.dir, LOCK_FILE);
|
|
7115
7154
|
this.pid = opts.pid ?? process.pid;
|
|
7116
|
-
this.hostname = opts.hostname ??
|
|
7155
|
+
this.hostname = opts.hostname ?? os6.hostname();
|
|
7117
7156
|
this.maxAgeMs = opts.maxAgeMs ?? DEFAULT_MAX_AGE_MS;
|
|
7118
7157
|
this.sessionStore = opts.sessionStore;
|
|
7119
7158
|
this.probe = opts.isPidAlive ?? defaultIsPidAlive;
|
|
@@ -8660,8 +8699,8 @@ async function streamProviderToResponse(provider, req, signal, ctx, events) {
|
|
|
8660
8699
|
try {
|
|
8661
8700
|
await Promise.race([
|
|
8662
8701
|
Promise.resolve(iter.return?.()),
|
|
8663
|
-
new Promise((
|
|
8664
|
-
drainTimer = setTimeout(
|
|
8702
|
+
new Promise((resolve12) => {
|
|
8703
|
+
drainTimer = setTimeout(resolve12, STREAM_DRAIN_TIMEOUT_MS);
|
|
8665
8704
|
})
|
|
8666
8705
|
]);
|
|
8667
8706
|
} finally {
|
|
@@ -8722,7 +8761,7 @@ async function runProviderWithRetry(opts) {
|
|
|
8722
8761
|
description
|
|
8723
8762
|
});
|
|
8724
8763
|
}
|
|
8725
|
-
await new Promise((
|
|
8764
|
+
await new Promise((resolve12, reject) => {
|
|
8726
8765
|
let settled = false;
|
|
8727
8766
|
const onAbort = () => {
|
|
8728
8767
|
if (settled) return;
|
|
@@ -8735,7 +8774,7 @@ async function runProviderWithRetry(opts) {
|
|
|
8735
8774
|
settled = true;
|
|
8736
8775
|
clearTimeout(t2);
|
|
8737
8776
|
signal.removeEventListener("abort", onAbort);
|
|
8738
|
-
|
|
8777
|
+
resolve12();
|
|
8739
8778
|
}, delay);
|
|
8740
8779
|
if (signal.aborted) {
|
|
8741
8780
|
onAbort();
|
|
@@ -9742,23 +9781,26 @@ var AutonomousRunner = class {
|
|
|
9742
9781
|
init_atomic_write();
|
|
9743
9782
|
var MAX_JOURNAL_ENTRIES = 500;
|
|
9744
9783
|
function goalFilePath(projectRoot) {
|
|
9745
|
-
|
|
9746
|
-
return path6.join(os7.homedir(), ".wrongstack", "projects", hash, "goal.json");
|
|
9784
|
+
return resolveWstackPaths({ projectRoot }).projectGoal;
|
|
9747
9785
|
}
|
|
9748
9786
|
async function loadGoal(filePath) {
|
|
9749
9787
|
let raw;
|
|
9750
9788
|
try {
|
|
9751
9789
|
raw = await fsp3.readFile(filePath, "utf8");
|
|
9752
|
-
} catch {
|
|
9753
|
-
|
|
9790
|
+
} catch (err) {
|
|
9791
|
+
const code = err.code;
|
|
9792
|
+
if (code === "ENOENT") return null;
|
|
9793
|
+
throw err;
|
|
9754
9794
|
}
|
|
9755
9795
|
try {
|
|
9756
9796
|
const parsed = JSON.parse(raw);
|
|
9757
9797
|
if (parsed?.version !== 1 || typeof parsed.goal !== "string" || !Array.isArray(parsed.journal)) {
|
|
9798
|
+
console.warn(`[goal-store] Corrupt goal.json at ${filePath} \u2014 invalid schema. Consider deleting it and re-creating.`);
|
|
9758
9799
|
return null;
|
|
9759
9800
|
}
|
|
9760
9801
|
return parsed;
|
|
9761
9802
|
} catch {
|
|
9803
|
+
console.warn(`[goal-store] Corrupt goal.json at ${filePath} \u2014 JSON parse failed. Consider deleting it and re-creating.`);
|
|
9762
9804
|
return null;
|
|
9763
9805
|
}
|
|
9764
9806
|
}
|
|
@@ -9907,7 +9949,7 @@ function computeTrend(history) {
|
|
|
9907
9949
|
const recent = history.slice(-5);
|
|
9908
9950
|
const deltas = [];
|
|
9909
9951
|
for (let i = 1; i < recent.length; i++) {
|
|
9910
|
-
deltas.push(recent[i]
|
|
9952
|
+
deltas.push((recent[i]?.progress ?? 0) - (recent[i - 1]?.progress ?? 0));
|
|
9911
9953
|
}
|
|
9912
9954
|
if (deltas.length < 2) return void 0;
|
|
9913
9955
|
const avgDelta = deltas.reduce((a, b) => a + b, 0) / deltas.length;
|
|
@@ -10494,8 +10536,8 @@ ${recentJournal}` : "No prior iterations.",
|
|
|
10494
10536
|
await saveGoal(this.goalPath, abandoned);
|
|
10495
10537
|
}
|
|
10496
10538
|
try {
|
|
10497
|
-
const { unlink:
|
|
10498
|
-
await
|
|
10539
|
+
const { unlink: unlink15 } = await import('fs/promises');
|
|
10540
|
+
await unlink15(this.goalPath);
|
|
10499
10541
|
} catch {
|
|
10500
10542
|
}
|
|
10501
10543
|
this.opts.onEternalStop?.();
|
|
@@ -10798,12 +10840,12 @@ var SubagentBudget = class _SubagentBudget {
|
|
|
10798
10840
|
if (!bus || !bus.hasListenerFor("budget.threshold_reached")) {
|
|
10799
10841
|
return Promise.resolve("stop");
|
|
10800
10842
|
}
|
|
10801
|
-
return new Promise((
|
|
10843
|
+
return new Promise((resolve12) => {
|
|
10802
10844
|
let resolved = false;
|
|
10803
10845
|
const respond = (d) => {
|
|
10804
10846
|
if (resolved) return;
|
|
10805
10847
|
resolved = true;
|
|
10806
|
-
|
|
10848
|
+
resolve12(d);
|
|
10807
10849
|
};
|
|
10808
10850
|
const fallback = setTimeout(
|
|
10809
10851
|
() => respond("stop"),
|
|
@@ -11496,6 +11538,53 @@ Working rules:
|
|
|
11496
11538
|
"flaws"
|
|
11497
11539
|
]
|
|
11498
11540
|
}
|
|
11541
|
+
},
|
|
11542
|
+
{
|
|
11543
|
+
config: {
|
|
11544
|
+
id: "refactor-planner",
|
|
11545
|
+
name: "Refactor Planner",
|
|
11546
|
+
role: "refactor-planner",
|
|
11547
|
+
tools: [...PLAN_TOOLS, "diff"],
|
|
11548
|
+
prompt: `You are the Refactor Planner agent. Your job is to analyze code
|
|
11549
|
+
structure and produce a concrete, phased refactoring plan with risk
|
|
11550
|
+
assessment, dependency ordering, and rollback strategy.
|
|
11551
|
+
|
|
11552
|
+
Scope:
|
|
11553
|
+
- Map module-level dependencies (import graph)
|
|
11554
|
+
- Identify coupling hotspots (high fan-in/out modules)
|
|
11555
|
+
- Assess refactoring risk by complexity and test coverage
|
|
11556
|
+
- Generate phased plans with checkpoint milestones
|
|
11557
|
+
- Produce diff-friendly task lists (one task = one concern)
|
|
11558
|
+
|
|
11559
|
+
Input format you accept:
|
|
11560
|
+
{ "task": "plan | assess | roadmap", "target": "src/core", "constraint": "no-breaking-changes | minimal-downtime | full-rewrite", "focus": "architecture | performance | maintainability" }
|
|
11561
|
+
|
|
11562
|
+
Output: Markdown refactor plan with phases (Low Risk / Medium Risk / High Risk),
|
|
11563
|
+
dependency graph, rollback strategy, and exit criteria.
|
|
11564
|
+
|
|
11565
|
+
Working rules:
|
|
11566
|
+
- Always include rollback strategy \u2014 every refactor can fail
|
|
11567
|
+
- Merge tasks that take <1h into a single phase
|
|
11568
|
+
- Respect team constraints (reviewer availability, parallelization)
|
|
11569
|
+
- Never plan without analyzing the actual code first`
|
|
11570
|
+
},
|
|
11571
|
+
budget: HEAVY_BUDGET,
|
|
11572
|
+
capability: {
|
|
11573
|
+
phase: "planning",
|
|
11574
|
+
summary: "Refactoring planner: analyzes code structure, maps dependencies, produces risk-scored phased plans with rollback strategy.",
|
|
11575
|
+
keywords: [
|
|
11576
|
+
"refactor",
|
|
11577
|
+
"refactoring",
|
|
11578
|
+
"restructure",
|
|
11579
|
+
"debt",
|
|
11580
|
+
"technical debt",
|
|
11581
|
+
"clean up",
|
|
11582
|
+
"modularize",
|
|
11583
|
+
"decouple",
|
|
11584
|
+
"dependency graph",
|
|
11585
|
+
"code structure"
|
|
11586
|
+
]
|
|
11587
|
+
}
|
|
11499
11588
|
}
|
|
11500
11589
|
];
|
|
11501
11590
|
|
|
@@ -12035,6 +12124,157 @@ Working rules:
|
|
|
12035
12124
|
"robustness"
|
|
12036
12125
|
]
|
|
12037
12126
|
}
|
|
12127
|
+
},
|
|
12128
|
+
{
|
|
12129
|
+
config: {
|
|
12130
|
+
id: "security-scanner",
|
|
12131
|
+
name: "Security Scanner",
|
|
12132
|
+
role: "security-scanner",
|
|
12133
|
+
tools: [...TOOLS.inspect],
|
|
12134
|
+
prompt: `You are the Security Scanner agent. Your job is to scan code,
|
|
12135
|
+
configs, and dependencies for security issues from hardcoded secrets to
|
|
12136
|
+
supply chain risks.
|
|
12137
|
+
|
|
12138
|
+
Scope:
|
|
12139
|
+
- Detect hardcoded secrets: API keys, tokens, passwords, private keys
|
|
12140
|
+
- Find injection vectors: eval, innerHTML, SQL concat, shell injection
|
|
12141
|
+
- Identify insecure patterns: weak crypto, hardcoded IVs, disabled TLS
|
|
12142
|
+
- Scan dependencies for known CVEs (via npm/pnpm audit)
|
|
12143
|
+
- Flag supply chain risks: postinstall hooks, unverified scripts
|
|
12144
|
+
|
|
12145
|
+
Input format you accept:
|
|
12146
|
+
{ "task": "scan | audit | secrets | dependencies", "paths": ["src", "config"], "depth": "quick | normal | deep" }
|
|
12147
|
+
|
|
12148
|
+
Output: Markdown security report with severity-ranked findings, injection
|
|
12149
|
+
vectors, dependency issues, and a remediation checklist.
|
|
12150
|
+
|
|
12151
|
+
Working rules:
|
|
12152
|
+
- Never scan node_modules \u2014 use npm audit instead
|
|
12153
|
+
- Always provide remediation steps, not just findings
|
|
12154
|
+
- Verify regex-based secrets before flagging (false positive risk)
|
|
12155
|
+
- When in doubt, flag as medium rather than ignoring potential issues`
|
|
12156
|
+
},
|
|
12157
|
+
budget: HEAVY_BUDGET,
|
|
12158
|
+
capability: {
|
|
12159
|
+
phase: "verify",
|
|
12160
|
+
summary: "Security scanner: detects hardcoded secrets, injection vectors, insecure patterns, and supply-chain risks with remediation.",
|
|
12161
|
+
keywords: [
|
|
12162
|
+
"security",
|
|
12163
|
+
"scan",
|
|
12164
|
+
"vulnerability",
|
|
12165
|
+
"secret",
|
|
12166
|
+
"api key",
|
|
12167
|
+
"hardcoded",
|
|
12168
|
+
"injection",
|
|
12169
|
+
"cve",
|
|
12170
|
+
"audit dependencies",
|
|
12171
|
+
"supply chain",
|
|
12172
|
+
"xss",
|
|
12173
|
+
"sqli",
|
|
12174
|
+
"shell injection",
|
|
12175
|
+
"sensitive data",
|
|
12176
|
+
"credential"
|
|
12177
|
+
]
|
|
12178
|
+
}
|
|
12179
|
+
},
|
|
12180
|
+
{
|
|
12181
|
+
config: {
|
|
12182
|
+
id: "bug-hunter",
|
|
12183
|
+
name: "Bug Hunter",
|
|
12184
|
+
role: "bug-hunter",
|
|
12185
|
+
tools: [...TOOLS.inspect],
|
|
12186
|
+
prompt: `You are the Bug Hunter agent. Your job is to systematically scan
|
|
12187
|
+
source code for bugs, anti-patterns, and code smells using pattern matching
|
|
12188
|
+
and heuristics. Output a prioritized hit list with file:line references.
|
|
12189
|
+
|
|
12190
|
+
Scope:
|
|
12191
|
+
- Detect common bug patterns (uncaught errors, resource leaks, race conditions)
|
|
12192
|
+
- Identify anti-patterns (callback hell, God objects, circular deps)
|
|
12193
|
+
- Find TypeScript-specific issues (unsafe any, missing null checks, branded types)
|
|
12194
|
+
- Flag security-sensitive constructs (eval, innerHTML, hardcoded secrets)
|
|
12195
|
+
- Rank findings: critical > high > medium > low
|
|
12196
|
+
|
|
12197
|
+
Input format you accept:
|
|
12198
|
+
{ "task": "scan | hunt | check", "paths": ["src/**/*.ts"], "focus": "bugs | patterns | security | all", "severityThreshold": "medium" }
|
|
12199
|
+
|
|
12200
|
+
Output: Markdown bug hunt report with critically/high/medium/low sections.
|
|
12201
|
+
Each entry: **[TYPE]** \`file:line\` \u2014 description + suggested fix
|
|
12202
|
+
|
|
12203
|
+
Working rules:
|
|
12204
|
+
- Never scan node_modules \u2014 it's noise
|
|
12205
|
+
- Always include file:line for every finding
|
|
12206
|
+
- If >30% of findings are false positives, note the confidence level
|
|
12207
|
+
- Ask director for clarification if paths are ambiguous`
|
|
12208
|
+
},
|
|
12209
|
+
budget: HEAVY_BUDGET,
|
|
12210
|
+
capability: {
|
|
12211
|
+
phase: "verify",
|
|
12212
|
+
summary: "Bug hunter: scans source code for bugs, anti-patterns, and code smells, producing a file:line-ranked hit list with fixes.",
|
|
12213
|
+
keywords: [
|
|
12214
|
+
"bug",
|
|
12215
|
+
"hunt",
|
|
12216
|
+
"scan",
|
|
12217
|
+
"code smell",
|
|
12218
|
+
"anti-pattern",
|
|
12219
|
+
"race condition",
|
|
12220
|
+
"memory leak",
|
|
12221
|
+
"null deref",
|
|
12222
|
+
"type safety",
|
|
12223
|
+
"unhandled error",
|
|
12224
|
+
"find bugs",
|
|
12225
|
+
"audit code",
|
|
12226
|
+
"code quality"
|
|
12227
|
+
]
|
|
12228
|
+
}
|
|
12229
|
+
},
|
|
12230
|
+
{
|
|
12231
|
+
config: {
|
|
12232
|
+
id: "audit-log",
|
|
12233
|
+
name: "Audit Log",
|
|
12234
|
+
role: "audit-log",
|
|
12235
|
+
tools: [...TOOLS.inspect],
|
|
12236
|
+
prompt: `You are the Audit Log agent. Your job is to analyze structured JSONL
|
|
12237
|
+
session logs and produce actionable markdown reports.
|
|
12238
|
+
|
|
12239
|
+
Scope:
|
|
12240
|
+
- Parse session logs (iteration counts, tool calls, errors, usage)
|
|
12241
|
+
- Detect repeated failure patterns across multiple runs
|
|
12242
|
+
- Identify tool usage anomalies (over-use, failures, unexpected chains)
|
|
12243
|
+
- Track token consumption trends
|
|
12244
|
+
- Generate structured audit reports with severity ratings
|
|
12245
|
+
|
|
12246
|
+
Input format you accept:
|
|
12247
|
+
{ "task": "analyze | report | trends", "sessionPath": "<path>", "focus": "errors | tools | usage | all" }
|
|
12248
|
+
|
|
12249
|
+
Output: Markdown audit report with Summary, Top Errors, Tool Usage table,
|
|
12250
|
+
Anomalies, and Cost Trend sections.
|
|
12251
|
+
|
|
12252
|
+
Working rules:
|
|
12253
|
+
- Never fabricate numbers \u2014 read the actual logs first
|
|
12254
|
+
- Always include file:line references for errors
|
|
12255
|
+
- If sessionPath is missing, ask the director to provide it
|
|
12256
|
+
- Report confidence level: high (>90% accuracy), medium, low`
|
|
12257
|
+
},
|
|
12258
|
+
budget: MEDIUM_BUDGET,
|
|
12259
|
+
capability: {
|
|
12260
|
+
phase: "verify",
|
|
12261
|
+
summary: "Audit log analyzer: parses session JSONL, detects failure patterns, tool anomalies, and cost trends with structured reports.",
|
|
12262
|
+
keywords: [
|
|
12263
|
+
"audit",
|
|
12264
|
+
"log",
|
|
12265
|
+
"logs",
|
|
12266
|
+
"session",
|
|
12267
|
+
"trace",
|
|
12268
|
+
"analyze logs",
|
|
12269
|
+
"error patterns",
|
|
12270
|
+
"cost analysis",
|
|
12271
|
+
"tool usage",
|
|
12272
|
+
"token usage",
|
|
12273
|
+
"post-mortem",
|
|
12274
|
+
"trend",
|
|
12275
|
+
"anomaly"
|
|
12276
|
+
]
|
|
12277
|
+
}
|
|
12038
12278
|
}
|
|
12039
12279
|
];
|
|
12040
12280
|
|
|
@@ -14219,7 +14459,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
14219
14459
|
taskIds.map((id) => {
|
|
14220
14460
|
const cached = this.completedResults.find((r) => r.taskId === id);
|
|
14221
14461
|
if (cached) return cached;
|
|
14222
|
-
return new Promise((
|
|
14462
|
+
return new Promise((resolve12, reject) => {
|
|
14223
14463
|
const timeout = setTimeout(() => {
|
|
14224
14464
|
this.off("task.completed", handler);
|
|
14225
14465
|
reject(new Error(`awaitTasks timed out waiting for task "${id}"`));
|
|
@@ -14228,7 +14468,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
14228
14468
|
if (result.taskId === id) {
|
|
14229
14469
|
clearTimeout(timeout);
|
|
14230
14470
|
this.off("task.completed", handler);
|
|
14231
|
-
|
|
14471
|
+
resolve12(result);
|
|
14232
14472
|
}
|
|
14233
14473
|
};
|
|
14234
14474
|
this.on("task.completed", handler);
|
|
@@ -17559,11 +17799,11 @@ var Director = class _Director {
|
|
|
17559
17799
|
if (cached) return cached;
|
|
17560
17800
|
const existing = this.taskWaiters.get(id);
|
|
17561
17801
|
if (existing) return existing.promise;
|
|
17562
|
-
let
|
|
17802
|
+
let resolve12;
|
|
17563
17803
|
const promise = new Promise((res) => {
|
|
17564
|
-
|
|
17804
|
+
resolve12 = res;
|
|
17565
17805
|
});
|
|
17566
|
-
this.taskWaiters.set(id, { promise, resolve:
|
|
17806
|
+
this.taskWaiters.set(id, { promise, resolve: resolve12 });
|
|
17567
17807
|
return promise;
|
|
17568
17808
|
})
|
|
17569
17809
|
);
|
|
@@ -17953,7 +18193,7 @@ function createDelegateTool(opts) {
|
|
|
17953
18193
|
subagentId
|
|
17954
18194
|
});
|
|
17955
18195
|
const dir = director;
|
|
17956
|
-
const result = await new Promise((
|
|
18196
|
+
const result = await new Promise((resolve12) => {
|
|
17957
18197
|
let settled = false;
|
|
17958
18198
|
let timer;
|
|
17959
18199
|
const finish = (value) => {
|
|
@@ -17963,7 +18203,7 @@ function createDelegateTool(opts) {
|
|
|
17963
18203
|
offTool();
|
|
17964
18204
|
offIter();
|
|
17965
18205
|
offProgress();
|
|
17966
|
-
|
|
18206
|
+
resolve12(value);
|
|
17967
18207
|
};
|
|
17968
18208
|
const arm = () => {
|
|
17969
18209
|
if (timer) clearTimeout(timer);
|
|
@@ -19661,9 +19901,9 @@ var AISpecBuilder = class {
|
|
|
19661
19901
|
if (!this.sessionPath) return;
|
|
19662
19902
|
try {
|
|
19663
19903
|
const fsp21 = await import('fs/promises');
|
|
19664
|
-
const
|
|
19904
|
+
const path36 = await import('path');
|
|
19665
19905
|
const { atomicWrite: atomicWrite2 } = await Promise.resolve().then(() => (init_atomic_write(), atomic_write_exports));
|
|
19666
|
-
await fsp21.mkdir(
|
|
19906
|
+
await fsp21.mkdir(path36.dirname(this.sessionPath), { recursive: true });
|
|
19667
19907
|
await atomicWrite2(this.sessionPath, JSON.stringify(this.session, null, 2));
|
|
19668
19908
|
} catch {
|
|
19669
19909
|
}
|
|
@@ -20373,15 +20613,15 @@ function computeCriticalPath(graph, _topoOrder, blockedByMap) {
|
|
|
20373
20613
|
maxId = id;
|
|
20374
20614
|
}
|
|
20375
20615
|
}
|
|
20376
|
-
const
|
|
20616
|
+
const path36 = [];
|
|
20377
20617
|
let current = maxId;
|
|
20378
20618
|
const visited = /* @__PURE__ */ new Set();
|
|
20379
20619
|
while (current && !visited.has(current)) {
|
|
20380
20620
|
visited.add(current);
|
|
20381
|
-
|
|
20621
|
+
path36.unshift(current);
|
|
20382
20622
|
current = prev.get(current) ?? null;
|
|
20383
20623
|
}
|
|
20384
|
-
return
|
|
20624
|
+
return path36;
|
|
20385
20625
|
}
|
|
20386
20626
|
function computeParallelGroups(graph, blockedByMap) {
|
|
20387
20627
|
const groups = [];
|
|
@@ -21192,9 +21432,9 @@ var DefaultHealthRegistry = class {
|
|
|
21192
21432
|
}
|
|
21193
21433
|
async runOne(check) {
|
|
21194
21434
|
let timer = null;
|
|
21195
|
-
const timeout = new Promise((
|
|
21435
|
+
const timeout = new Promise((resolve12) => {
|
|
21196
21436
|
timer = setTimeout(
|
|
21197
|
-
() =>
|
|
21437
|
+
() => resolve12({ status: "unhealthy", detail: `timeout after ${this.timeoutMs}ms` }),
|
|
21198
21438
|
this.timeoutMs
|
|
21199
21439
|
);
|
|
21200
21440
|
});
|
|
@@ -21377,7 +21617,7 @@ async function startMetricsServer(opts) {
|
|
|
21377
21617
|
const tls = opts.tls;
|
|
21378
21618
|
const useHttps = !!(tls?.cert && tls?.key);
|
|
21379
21619
|
const host = opts.host ?? "127.0.0.1";
|
|
21380
|
-
const
|
|
21620
|
+
const path36 = opts.path ?? "/metrics";
|
|
21381
21621
|
const healthPath = opts.healthPath ?? "/healthz";
|
|
21382
21622
|
const healthRegistry = opts.healthRegistry;
|
|
21383
21623
|
const listener = (req, res) => {
|
|
@@ -21387,7 +21627,7 @@ async function startMetricsServer(opts) {
|
|
|
21387
21627
|
return;
|
|
21388
21628
|
}
|
|
21389
21629
|
const url = req.url.split("?")[0];
|
|
21390
|
-
if (url ===
|
|
21630
|
+
if (url === path36) {
|
|
21391
21631
|
let body;
|
|
21392
21632
|
try {
|
|
21393
21633
|
body = renderPrometheus(opts.sink.snapshot());
|
|
@@ -21433,14 +21673,14 @@ async function startMetricsServer(opts) {
|
|
|
21433
21673
|
const { createServer } = await import('http');
|
|
21434
21674
|
server = createServer(listener);
|
|
21435
21675
|
}
|
|
21436
|
-
await new Promise((
|
|
21676
|
+
await new Promise((resolve12, reject) => {
|
|
21437
21677
|
const onError = (err) => {
|
|
21438
21678
|
server.off("listening", onListening);
|
|
21439
21679
|
reject(err);
|
|
21440
21680
|
};
|
|
21441
21681
|
const onListening = () => {
|
|
21442
21682
|
server.off("error", onError);
|
|
21443
|
-
|
|
21683
|
+
resolve12();
|
|
21444
21684
|
};
|
|
21445
21685
|
server.once("error", onError);
|
|
21446
21686
|
server.once("listening", onListening);
|
|
@@ -21451,9 +21691,9 @@ async function startMetricsServer(opts) {
|
|
|
21451
21691
|
const protocol = useHttps ? "https" : "http";
|
|
21452
21692
|
return {
|
|
21453
21693
|
port: boundPort,
|
|
21454
|
-
url: `${protocol}://${host}:${boundPort}${
|
|
21455
|
-
close: () => new Promise((
|
|
21456
|
-
server.close((err) => err ? reject(err) :
|
|
21694
|
+
url: `${protocol}://${host}:${boundPort}${path36}`,
|
|
21695
|
+
close: () => new Promise((resolve12, reject) => {
|
|
21696
|
+
server.close((err) => err ? reject(err) : resolve12());
|
|
21457
21697
|
})
|
|
21458
21698
|
};
|
|
21459
21699
|
}
|
|
@@ -22154,7 +22394,7 @@ async function downloadGitHubTarball(parsed) {
|
|
|
22154
22394
|
`Tarball too large (${(Number.parseInt(contentLength, 10) / 1024 / 1024).toFixed(1)}MB). Max: ${MAX_TARBALL_SIZE / 1024 / 1024}MB`
|
|
22155
22395
|
);
|
|
22156
22396
|
}
|
|
22157
|
-
const tempDir = await fsp3.mkdtemp(path6.join(
|
|
22397
|
+
const tempDir = await fsp3.mkdtemp(path6.join(os6.tmpdir(), "wskill-"));
|
|
22158
22398
|
try {
|
|
22159
22399
|
if (!response.body) {
|
|
22160
22400
|
throw new Error("Empty response body from GitHub API");
|
|
@@ -22917,7 +23157,7 @@ var SessionMemoryConsolidator = class {
|
|
|
22917
23157
|
for (const op of parsed.operations) {
|
|
22918
23158
|
switch (op.action) {
|
|
22919
23159
|
case "add": {
|
|
22920
|
-
if (op.text
|
|
23160
|
+
if (op.text?.trim()) {
|
|
22921
23161
|
await this.memoryStore.remember(op.text.trim(), void 0, {
|
|
22922
23162
|
type: op.type,
|
|
22923
23163
|
tags: op.tags,
|
|
@@ -25383,7 +25623,7 @@ var SecurityScannerOrchestrator = class {
|
|
|
25383
25623
|
const delay = Math.round(policy.delayMs(attempt));
|
|
25384
25624
|
const status = isProviderErr ? err.status : 0;
|
|
25385
25625
|
console.warn(`[SecurityScanner] retry ${attempt + 1} after ${delay}ms (status=${status}) \u2014 ${errAsErr.message}`);
|
|
25386
|
-
await new Promise((
|
|
25626
|
+
await new Promise((resolve12) => setTimeout(resolve12, delay));
|
|
25387
25627
|
return this.completeWithRetry(provider, request, abortController, attempt + 1);
|
|
25388
25628
|
}
|
|
25389
25629
|
}
|
|
@@ -26905,13 +27145,13 @@ function createAgentToolHandler(a) {
|
|
|
26905
27145
|
}
|
|
26906
27146
|
}
|
|
26907
27147
|
function waitForConfirm(info) {
|
|
26908
|
-
return new Promise((
|
|
27148
|
+
return new Promise((resolve12) => {
|
|
26909
27149
|
a.events.emit("tool.confirm_needed", {
|
|
26910
27150
|
tool: info.tool,
|
|
26911
27151
|
input: info.input,
|
|
26912
27152
|
toolUseId: info.toolUseId,
|
|
26913
27153
|
suggestedPattern: info.suggestedPattern,
|
|
26914
|
-
resolve:
|
|
27154
|
+
resolve: resolve12
|
|
26915
27155
|
});
|
|
26916
27156
|
});
|
|
26917
27157
|
}
|
|
@@ -27167,12 +27407,12 @@ function buildBtwBlock(notes) {
|
|
|
27167
27407
|
// src/core/iteration-limit.ts
|
|
27168
27408
|
function requestLimitExtension(opts) {
|
|
27169
27409
|
const { events, currentIterations, currentLimit, autoExtend, timeoutMs = 3e4 } = opts;
|
|
27170
|
-
return new Promise((
|
|
27410
|
+
return new Promise((resolve12) => {
|
|
27171
27411
|
let resolved = false;
|
|
27172
27412
|
const timerFired = () => {
|
|
27173
27413
|
if (!resolved) {
|
|
27174
27414
|
resolved = true;
|
|
27175
|
-
|
|
27415
|
+
resolve12(0);
|
|
27176
27416
|
}
|
|
27177
27417
|
};
|
|
27178
27418
|
const timer = setTimeout(timerFired, timeoutMs);
|
|
@@ -27181,14 +27421,14 @@ function requestLimitExtension(opts) {
|
|
|
27181
27421
|
if (!resolved) {
|
|
27182
27422
|
resolved = true;
|
|
27183
27423
|
clearTimeout(timer);
|
|
27184
|
-
|
|
27424
|
+
resolve12(0);
|
|
27185
27425
|
}
|
|
27186
27426
|
};
|
|
27187
27427
|
const grant = (extra) => {
|
|
27188
27428
|
if (!resolved) {
|
|
27189
27429
|
resolved = true;
|
|
27190
27430
|
clearTimeout(timer);
|
|
27191
|
-
|
|
27431
|
+
resolve12(Math.max(0, extra));
|
|
27192
27432
|
}
|
|
27193
27433
|
};
|
|
27194
27434
|
events.emit("iteration.limit_reached", {
|
|
@@ -27202,7 +27442,7 @@ function requestLimitExtension(opts) {
|
|
|
27202
27442
|
if (!resolved) {
|
|
27203
27443
|
resolved = true;
|
|
27204
27444
|
clearTimeout(timer);
|
|
27205
|
-
|
|
27445
|
+
resolve12(100);
|
|
27206
27446
|
}
|
|
27207
27447
|
});
|
|
27208
27448
|
}
|
|
@@ -27213,6 +27453,12 @@ function requestLimitExtension(opts) {
|
|
|
27213
27453
|
function toError(err) {
|
|
27214
27454
|
return err instanceof Error ? err : new Error(String(err));
|
|
27215
27455
|
}
|
|
27456
|
+
function signalAbortReason(signal) {
|
|
27457
|
+
const r = signal.reason;
|
|
27458
|
+
if (r instanceof Error) return r.message || r.name;
|
|
27459
|
+
if (typeof r === "string" && r.length > 0) return r;
|
|
27460
|
+
return "aborted";
|
|
27461
|
+
}
|
|
27216
27462
|
function createAgentLoopHandler(a, handlers) {
|
|
27217
27463
|
async function compactContextIfNeeded() {
|
|
27218
27464
|
await a.pipelines.contextWindow.run(a.ctx);
|
|
@@ -27298,7 +27544,7 @@ function createAgentLoopHandler(a, handlers) {
|
|
|
27298
27544
|
for (let i = 0; ; i++) {
|
|
27299
27545
|
iterations = i + 1;
|
|
27300
27546
|
if (controller.signal.aborted) {
|
|
27301
|
-
return { status: "aborted", iterations };
|
|
27547
|
+
return { status: "aborted", iterations, abortReason: signalAbortReason(controller.signal) };
|
|
27302
27548
|
}
|
|
27303
27549
|
await a.ctx.session.writeInFlightMarker(`iteration ${i} / max ${a.maxIterations}`).catch((err) => {
|
|
27304
27550
|
(a.logger.debug ?? a.logger.warn)?.(
|
|
@@ -27341,7 +27587,7 @@ function createAgentLoopHandler(a, handlers) {
|
|
|
27341
27587
|
} catch (err) {
|
|
27342
27588
|
if (controller.signal.aborted) {
|
|
27343
27589
|
a.events.emit("error", { err: toError(err), phase: "provider" });
|
|
27344
|
-
return { status: "aborted", iterations, error: toWrongStackError(err, "AGENT_ABORTED") };
|
|
27590
|
+
return { status: "aborted", iterations, error: toWrongStackError(err, "AGENT_ABORTED"), abortReason: signalAbortReason(controller.signal) };
|
|
27345
27591
|
}
|
|
27346
27592
|
const extDecision = await a.extensions.runOnError(a.ctx, err, "provider", i);
|
|
27347
27593
|
if (extDecision) {
|
|
@@ -27389,7 +27635,7 @@ function createAgentLoopHandler(a, handlers) {
|
|
|
27389
27635
|
}
|
|
27390
27636
|
const responseResult = await handlers.response.processResponse(res, req);
|
|
27391
27637
|
if (responseResult.aborted) {
|
|
27392
|
-
return { status: "aborted", iterations, finalText: responseResult.finalText, delegateSummaries };
|
|
27638
|
+
return { status: "aborted", iterations, finalText: responseResult.finalText, delegateSummaries, abortReason: signalAbortReason(controller.signal) };
|
|
27393
27639
|
}
|
|
27394
27640
|
if (responseResult.done) {
|
|
27395
27641
|
return { status: "done", iterations, finalText: responseResult.finalText, delegateSummaries };
|
|
@@ -27409,7 +27655,14 @@ function createAgentLoopHandler(a, handlers) {
|
|
|
27409
27655
|
}
|
|
27410
27656
|
return { status: "done", iterations, finalText, delegateSummaries };
|
|
27411
27657
|
}
|
|
27412
|
-
|
|
27658
|
+
try {
|
|
27659
|
+
await handlers.tools.executeTools(toolUses);
|
|
27660
|
+
} catch (toolErr) {
|
|
27661
|
+
if (controller.signal.aborted) {
|
|
27662
|
+
return { status: "aborted", iterations, finalText, delegateSummaries, abortReason: signalAbortReason(controller.signal) };
|
|
27663
|
+
}
|
|
27664
|
+
throw toolErr;
|
|
27665
|
+
}
|
|
27413
27666
|
if (autonomousContinue && consumeAutonomousContinue(a.ctx)) {
|
|
27414
27667
|
emitContextPct();
|
|
27415
27668
|
a.events.emit("iteration.completed", { ctx: a.ctx, index: i });
|
|
@@ -27576,7 +27829,8 @@ var Agent = class {
|
|
|
27576
27829
|
const result = {
|
|
27577
27830
|
status: signal.aborted ? "aborted" : "failed",
|
|
27578
27831
|
iterations: 0,
|
|
27579
|
-
error: wse
|
|
27832
|
+
error: wse,
|
|
27833
|
+
abortReason: signal.aborted ? signalAbortReason(signal) : void 0
|
|
27580
27834
|
};
|
|
27581
27835
|
await this.extensions.runAfterRun(this.ctx, result);
|
|
27582
27836
|
return result;
|
|
@@ -27651,13 +27905,13 @@ var DEFAULT_TIMEOUT_MS3 = 5e3;
|
|
|
27651
27905
|
var MAX_OUTPUT_BYTES = 64 * 1024;
|
|
27652
27906
|
async function runShellHook(spec, input, logger) {
|
|
27653
27907
|
const timeoutMs = spec.timeoutMs ?? DEFAULT_TIMEOUT_MS3;
|
|
27654
|
-
return await new Promise((
|
|
27908
|
+
return await new Promise((resolve12) => {
|
|
27655
27909
|
let settled = false;
|
|
27656
27910
|
const done = (v) => {
|
|
27657
27911
|
if (settled) return;
|
|
27658
27912
|
settled = true;
|
|
27659
27913
|
clearTimeout(timer);
|
|
27660
|
-
|
|
27914
|
+
resolve12(v);
|
|
27661
27915
|
};
|
|
27662
27916
|
let child;
|
|
27663
27917
|
try {
|
|
@@ -27669,7 +27923,7 @@ async function runShellHook(spec, input, logger) {
|
|
|
27669
27923
|
});
|
|
27670
27924
|
} catch (err2) {
|
|
27671
27925
|
logger?.warn?.(`hook spawn failed: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
27672
|
-
return
|
|
27926
|
+
return resolve12(null);
|
|
27673
27927
|
}
|
|
27674
27928
|
const timer = setTimeout(() => {
|
|
27675
27929
|
logger?.warn?.(`hook command timed out after ${timeoutMs}ms: ${spec.command}`);
|
|
@@ -27846,7 +28100,7 @@ async function bootConfig(options = {}) {
|
|
|
27846
28100
|
const cwd = typeof flags["cwd"] === "string" ? path6.resolve(flags["cwd"]) : process.cwd();
|
|
27847
28101
|
const pathResolver = new DefaultPathResolver(cwd);
|
|
27848
28102
|
const projectRoot = pathResolver.projectRoot;
|
|
27849
|
-
const userHome =
|
|
28103
|
+
const userHome = os6.homedir();
|
|
27850
28104
|
const wpaths = resolveWstackPaths({ projectRoot, userHome });
|
|
27851
28105
|
await fsp3.mkdir(wpaths.globalRoot, { recursive: true });
|
|
27852
28106
|
await fsp3.mkdir(wpaths.projectDir, { recursive: true });
|
|
@@ -28270,8 +28524,8 @@ var InputBuilder = class {
|
|
|
28270
28524
|
async registerFile(input) {
|
|
28271
28525
|
const ref = await this.store.add({ ...input, kind: "file" });
|
|
28272
28526
|
this.refs.push(ref);
|
|
28273
|
-
const
|
|
28274
|
-
return `[file:${
|
|
28527
|
+
const path36 = ref.meta.filename ?? ref.meta.label ?? String(ref.seq);
|
|
28528
|
+
return `[file:${path36}]`;
|
|
28275
28529
|
}
|
|
28276
28530
|
/**
|
|
28277
28531
|
* Whether `appendPaste(text)` would collapse the text to a placeholder
|
|
@@ -28638,7 +28892,7 @@ summarize it, and let the tool result hold only the summary.`);
|
|
|
28638
28892
|
const cached = this.envCacheByRoot.get(ctx.projectRoot);
|
|
28639
28893
|
if (cached) return cached;
|
|
28640
28894
|
const today = this.opts.todayIso ?? (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
28641
|
-
const platform2 = `${
|
|
28895
|
+
const platform2 = `${os6.platform()} ${os6.release()}`;
|
|
28642
28896
|
const shell = process.env.SHELL ?? process.env.ComSpec ?? "unknown";
|
|
28643
28897
|
const node = process.version;
|
|
28644
28898
|
const isGit = await this.dirExists(path6.join(ctx.projectRoot, ".git"));
|
|
@@ -28768,12 +29022,12 @@ ${this.skillBodyCache}`);
|
|
|
28768
29022
|
}
|
|
28769
29023
|
}
|
|
28770
29024
|
async gitStatus(root) {
|
|
28771
|
-
return new Promise((
|
|
29025
|
+
return new Promise((resolve12) => {
|
|
28772
29026
|
let settled = false;
|
|
28773
29027
|
const finish = (s) => {
|
|
28774
29028
|
if (settled) return;
|
|
28775
29029
|
settled = true;
|
|
28776
|
-
|
|
29030
|
+
resolve12(s);
|
|
28777
29031
|
};
|
|
28778
29032
|
let proc;
|
|
28779
29033
|
const timer = setTimeout(() => {
|
|
@@ -30132,7 +30386,7 @@ var PhaseOrchestrator = class {
|
|
|
30132
30386
|
async mergeOne(phase, handle) {
|
|
30133
30387
|
if (!this.worktrees) return;
|
|
30134
30388
|
try {
|
|
30135
|
-
const
|
|
30389
|
+
const resolve12 = this.ctx.resolveConflict ? async (info) => {
|
|
30136
30390
|
const shouldResolve = await this.shouldAttemptConflictResolution(phase, info);
|
|
30137
30391
|
if (!shouldResolve) return false;
|
|
30138
30392
|
this.emit("phase.conflictResolving", {
|
|
@@ -30146,7 +30400,7 @@ var PhaseOrchestrator = class {
|
|
|
30146
30400
|
const mergeOpts = {
|
|
30147
30401
|
squash: true
|
|
30148
30402
|
};
|
|
30149
|
-
if (
|
|
30403
|
+
if (resolve12 !== void 0) mergeOpts.resolve = resolve12;
|
|
30150
30404
|
const result = await this.worktrees.merge(handle, mergeOpts);
|
|
30151
30405
|
if (result.resolved) {
|
|
30152
30406
|
this.emit("phase.conflictResolved", { phaseId: phase.id, name: phase.name });
|
|
@@ -30497,7 +30751,7 @@ var PhaseOrchestrator = class {
|
|
|
30497
30751
|
}
|
|
30498
30752
|
}
|
|
30499
30753
|
delay(ms) {
|
|
30500
|
-
return new Promise((
|
|
30754
|
+
return new Promise((resolve12) => setTimeout(resolve12, ms));
|
|
30501
30755
|
}
|
|
30502
30756
|
};
|
|
30503
30757
|
|
|
@@ -31569,12 +31823,12 @@ var BrainDecisionQueue = class {
|
|
|
31569
31823
|
options: request.options,
|
|
31570
31824
|
rationale: "Decision escalated to human authority."
|
|
31571
31825
|
};
|
|
31572
|
-
const pending = new Promise((
|
|
31573
|
-
const entry = { request, resolve:
|
|
31826
|
+
const pending = new Promise((resolve12) => {
|
|
31827
|
+
const entry = { request, resolve: resolve12 };
|
|
31574
31828
|
if (this.opts.timeoutMs && this.opts.timeoutMs > 0) {
|
|
31575
31829
|
entry.timer = setTimeout(() => {
|
|
31576
31830
|
this.pending.delete(request.id);
|
|
31577
|
-
|
|
31831
|
+
resolve12({ type: "deny", reason: "Brain human decision timed out." });
|
|
31578
31832
|
}, this.opts.timeoutMs);
|
|
31579
31833
|
}
|
|
31580
31834
|
this.pending.set(request.id, entry);
|
|
@@ -31689,8 +31943,8 @@ var CollaborationBus = class {
|
|
|
31689
31943
|
if (this.isPaused()) return false;
|
|
31690
31944
|
this.pausedAtMs = Date.now();
|
|
31691
31945
|
this.pausedBy = byParticipant;
|
|
31692
|
-
this.pausePromise = new Promise((
|
|
31693
|
-
this.pauseResolve =
|
|
31946
|
+
this.pausePromise = new Promise((resolve12) => {
|
|
31947
|
+
this.pauseResolve = resolve12;
|
|
31694
31948
|
});
|
|
31695
31949
|
return true;
|
|
31696
31950
|
}
|
|
@@ -31726,8 +31980,8 @@ var CollaborationBus = class {
|
|
|
31726
31980
|
return true;
|
|
31727
31981
|
}
|
|
31728
31982
|
let timer;
|
|
31729
|
-
const timeoutPromise = new Promise((
|
|
31730
|
-
timer = setTimeout(() =>
|
|
31983
|
+
const timeoutPromise = new Promise((resolve12) => {
|
|
31984
|
+
timer = setTimeout(() => resolve12("timeout"), timeoutMs);
|
|
31731
31985
|
});
|
|
31732
31986
|
const resumedPromise = this.pausePromise.then(() => "resumed");
|
|
31733
31987
|
const winner = await Promise.race([resumedPromise, timeoutPromise]);
|
|
@@ -32218,7 +32472,7 @@ function createGitPlugin() {
|
|
|
32218
32472
|
}
|
|
32219
32473
|
async function runGit(args, cwd) {
|
|
32220
32474
|
try {
|
|
32221
|
-
return await new Promise((
|
|
32475
|
+
return await new Promise((resolve12, reject) => {
|
|
32222
32476
|
const child = spawn("git", args, { cwd, stdio: ["ignore", "pipe", "pipe"], signal: AbortSignal.timeout(3e4) });
|
|
32223
32477
|
let stdout = "";
|
|
32224
32478
|
let stderr = "";
|
|
@@ -32239,7 +32493,7 @@ async function runGit(args, cwd) {
|
|
|
32239
32493
|
})
|
|
32240
32494
|
);
|
|
32241
32495
|
});
|
|
32242
|
-
child.on("close", (code) =>
|
|
32496
|
+
child.on("close", (code) => resolve12({ stdout, stderr, code: code ?? 0 }));
|
|
32243
32497
|
});
|
|
32244
32498
|
} catch (err) {
|
|
32245
32499
|
if (err instanceof WrongStackError) throw err;
|
|
@@ -32593,7 +32847,7 @@ function createSkillsPlugin(opts) {
|
|
|
32593
32847
|
};
|
|
32594
32848
|
}
|
|
32595
32849
|
function makeInstaller(skillLoader, projectRoot) {
|
|
32596
|
-
const globalRoot = path6.join(
|
|
32850
|
+
const globalRoot = path6.join(os6.homedir(), ".wrongstack");
|
|
32597
32851
|
return new SkillInstaller({
|
|
32598
32852
|
manifestPath: path6.join(globalRoot, "installed-skills.json"),
|
|
32599
32853
|
projectSkillsDir: path6.join(projectRoot, ".wrongstack", "skills"),
|
|
@@ -32944,6 +33198,6 @@ ${formatPlan(updated)}`
|
|
|
32944
33198
|
};
|
|
32945
33199
|
}
|
|
32946
33200
|
|
|
32947
|
-
export { ACP_AGENTS, AGENTS_BY_PHASE, AGENT_CATALOG, AISpecBuilder, ALL_AGENT_DEFINITIONS, ALL_FLEET_AGENTS, ALL_SYNC_CATEGORIES, AUDIT_LOG_AGENT, Agent, AgentError, AnnotationsStore, AutoApprovePermissionPolicy, AutoCompactionMiddleware, AutoExecutor, AutoPhasePlanner, AutoPhaseRunner, AutonomousRunner, BUG_HUNTER_AGENT, BrainDecisionQueue, BudgetExceededError, CONTEXT_WINDOW_MODES, CORE_RECONSTRUCT_EVENTS, CheckpointManager, CloudSync, CollaborationBus, ConfigError, ConfigMigrationError, Container, Context, ConversationState, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_CONTEXT_CONFIG, DEFAULT_CONTEXT_WINDOW_MODE_ID, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_DISPATCH_ROLE, DEFAULT_MAX_ITERATIONS, DEFAULT_MODES, DEFAULT_RECOVERY_STRATEGIES, DEFAULT_SESSION_LOGGING_CONFIG, DEFAULT_SESSION_PRUNE_DAYS, DEFAULT_SPEC_TEMPLATE, DEFAULT_SUBAGENT_BASELINE, DEFAULT_TOOLS_CONFIG, DefaultAttachmentStore, DefaultBrainArbiter, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultPluginAPI, DefaultPromptStore, DefaultProviderRunner, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionRewinder, DefaultSessionStore, DefaultSkillLoader, DefaultSystemPromptBuilder, DefaultTaskStore, DefaultTokenCounter, Director, DirectorStateCheckpoint, DoneConditionChecker, ENHANCER_SYSTEM_PROMPT, ERROR_CODES, EternalAutonomyEngine, EventBus, ExtensionRegistry, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FLEET_ROSTER_WITHACP, FileMemoryBackend, FleetBus, FleetCostCapError, FleetManager, FleetSpawnBudgetError, FleetUsageAggregator, FsError, GitignoreUpdater, GraphMemoryBackend, HookRegistry, HookRunner, HumanEscalatingBrainArbiter, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, InputBuilder, IntelligentCompactor, KERNEL_API_VERSION, LAYER_1_IDENTITY, LLMSelector, MATRIX_PHASE_KEYS, MAX_JOURNAL_ENTRIES, MAX_PROGRESS_HISTORY, MEMORY_TYPE_LABELS, NULL_FLEET_BUS, NoopMetricsSink, NoopTracer, OTelTracer, ObservableBrainArbiter, PROMETHEUS_CONTENT_TYPE, ParallelEternalEngine, PhaseGraphBuilder, PhaseOrchestrator, PhaseStore, Pipeline, PluginError, ProviderError, ProviderRegistry, QueueStore, REFACTOR_PLANNER_AGENT, RecoveryLock, ReplayLogStore, ReplayProviderRunner, ReportGenerator, RunController, SECURITY_SCANNER_AGENT, SPEC_TEMPLATES, STANDARD_AUDIT_EVENTS, ScopedEventBus, SddParallelRun, SddTaskDecomposer, SecurityScanner, SecurityScannerOrchestrator, SelectiveCompactor, SessionAnalyzer, SessionError, SessionMemoryConsolidator, SessionRecovery, SkillGenerator, SkillInstaller, SkillManifestStore, SlashCommandRegistry, SpecDrivenDev, SpecParser, SpecStore, SpecVersioning, SubagentBudget, TOKENS, TaskFlow, TaskGenerator, TaskGraphStore, TaskTracker, TechStackDetector, ToolAuditLog, ToolError, ToolExecutor, ToolRegistry, WorktreeManager, WrongStackError, addPlanItem, allServers, analyzeCriticalPath, appendJournal, applyRosterBudget, asBlocks, asText, assertSafePath, atomicWrite, attachAutoExtend, attachPlanCheckpoint, attachTodosCheckpoint, awsServer, blockServer, bootConfig, braveSearchServer, buildBtwBlock, buildChildEnv, buildGoalPreamble, buildOtlpMetricsRequest, buildOtlpTracesRequest, buildRecoveryStrategies, classifyFamily, clearPlan, collabInjectMiddleware, collabPauseMiddleware, color, compileGlob, compileUserRegex, completePartialObject, composeDirectorPrompt, composeSubagentPrompt, computeTaskItemProgress, computeTaskProgress, consumeBtwNotes, context7Server, contextManagerTool, createAutoExecutor, createAutoPhaseFromTaskGraph, createContextManagerTool, createDefaultPipelines, createDelegateTool, createGitPlugin, createMcpControlTool, createMessage, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSessionEventBridge, createSkillsPlugin, createSyncPlugin, createToolOutputSerializer, decryptConfigSecrets, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, deriveTodosFromPlanItem, detectNewlineStyle, dispatchAgent, downloadGitHubTarball, emptyGoal, emptyPlan, emptyTaskFile, encryptConfigSecrets, enhanceUserPrompt, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, everArtServer, expandGlob, expectDefined, extractRunEnv, filesystemServer, findCriticalPath, flagsToConfigPatch, formatContextWindowModeList, formatGoal, formatHumanPrompt, formatPlan, formatPlanTemplates, formatTaskList, formatTaskProgress, formatTodosList, getAgentDefinition, getCalibrationState, getContextWindowMode, getPlanTemplate, getTemplate, getTermSize, githubServer, goalFilePath, googleMapsServer, hashRequest, hookMatcherMatches, isAgentError, isConfigError, isContextWindowModeId, isFsError, isImageBlock, isInteractive, isPluginError, isSessionError, isStdinTTY, isStdoutTTY, isTextBlock, isThinkingBlock, isToolError, isToolResultBlock, isToolUseBlock, isValidMatrixKey, isWrongStackError, listContextWindowModes, listPlanTemplates, listTemplates, loadDirectorState, loadGoal, loadPlan, loadPlugins, loadProjectModes, loadTasks, loadTodosCheckpoint, loadUserModes, makeAgentSubagentRunner, makeAskTool, makeAssignTool, makeAutonomyPromptContributor, makeAwaitTasksTool, makeCollabDebugTool, makeContinueToNextIterationTool, makeDirectorSessionFactory, makeFleetEmitTool, makeFleetHealthTool, makeFleetSessionTool, makeFleetStatusTool, makeFleetUsageTool, makeLLMClassifier, makeRollUpTool, makeSpawnTool, makeTerminateTool, matchAny, matchGlob, matrixKeyKind, mergeCustomModelDefs, mergeModelsPayload, migratePlaintextSecrets, miniMaxVisionServer, normalizeToLf, normalizedEqual, onResize, parseContinueDirective, parseEntries, parseProgressFromText, parseSkillRef, pendingBtwCount, phaseForRole, projectHash, projectSlug, recentTextTurns, recordActualUsage, recordProgress, removePlanItem, renderProgress, renderPrometheus, renderSpecAnalysis, renderTaskGraph, renderTaskList, repairToolUseAdjacency, resetCalibration, resolveAuditLevel, resolveContextWindowPolicy, resolveModelMatrix, resolveSessionLoggingConfig, resolveWstackPaths, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, runProviderWithRetry, runShellHook, safeParse, safeStringify, sanitizeJsonString, saveGoal, savePlan, saveTasks, saveTodosCheckpoint, scoreAgents, securitySlashCommand, sentinelServer, setBtwNote, setOutputLineGuard, setPlanItemStatus, setProgress, setRawMode, shouldEnhance, slackServer, sleep, stableStringify, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, stripAnsi, summarizeUsage, templateToMarkdown, toStyle, toWrongStackError, topologicalSort, unifiedDiff, unloadPlugins, validateAgainstSchema, wireMetricsToEvents, withFileLock, wrapAsState, writeErr, writeOut, zaiVisionServer };
|
|
33201
|
+
export { ACP_AGENTS, AGENTS_BY_PHASE, AGENT_CATALOG, AISpecBuilder, ALL_AGENT_DEFINITIONS, ALL_FLEET_AGENTS, ALL_SYNC_CATEGORIES, AUDIT_LOG_AGENT, Agent, AgentError, AnnotationsStore, AutoApprovePermissionPolicy, AutoCompactionMiddleware, AutoExecutor, AutoPhasePlanner, AutoPhaseRunner, AutonomousRunner, BUG_HUNTER_AGENT, BrainDecisionQueue, BudgetExceededError, CONTEXT_WINDOW_MODES, CORE_RECONSTRUCT_EVENTS, CheckpointManager, CloudSync, CollaborationBus, ConfigError, ConfigMigrationError, Container, Context, ConversationState, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_CONTEXT_CONFIG, DEFAULT_CONTEXT_WINDOW_MODE_ID, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_DISPATCH_ROLE, DEFAULT_MAX_ITERATIONS, DEFAULT_MODES, DEFAULT_RECOVERY_STRATEGIES, DEFAULT_SESSION_LOGGING_CONFIG, DEFAULT_SESSION_PRUNE_DAYS, DEFAULT_SPEC_TEMPLATE, DEFAULT_SUBAGENT_BASELINE, DEFAULT_TOOLS_CONFIG, DefaultAttachmentStore, DefaultBrainArbiter, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultPluginAPI, DefaultPromptStore, DefaultProviderRunner, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionRewinder, DefaultSessionStore, DefaultSkillLoader, DefaultSystemPromptBuilder, DefaultTaskStore, DefaultTokenCounter, Director, DirectorStateCheckpoint, DoneConditionChecker, ENHANCER_SYSTEM_PROMPT, ERROR_CODES, EternalAutonomyEngine, EventBus, ExtensionRegistry, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FLEET_ROSTER_WITHACP, FileMemoryBackend, FleetBus, FleetCostCapError, FleetManager, FleetSpawnBudgetError, FleetUsageAggregator, FsError, GitignoreUpdater, GraphMemoryBackend, HookRegistry, HookRunner, HumanEscalatingBrainArbiter, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, InputBuilder, IntelligentCompactor, KERNEL_API_VERSION, LAYER_1_IDENTITY, LLMSelector, MATRIX_PHASE_KEYS, MAX_JOURNAL_ENTRIES, MAX_PROGRESS_HISTORY, MEMORY_TYPE_LABELS, NULL_FLEET_BUS, NoopMetricsSink, NoopTracer, OTelTracer, ObservableBrainArbiter, PROMETHEUS_CONTENT_TYPE, ParallelEternalEngine, PhaseGraphBuilder, PhaseOrchestrator, PhaseStore, Pipeline, PluginError, ProviderError, ProviderRegistry, QueueStore, REFACTOR_PLANNER_AGENT, RecoveryLock, ReplayLogStore, ReplayProviderRunner, ReportGenerator, RunController, SECURITY_SCANNER_AGENT, SPEC_TEMPLATES, STANDARD_AUDIT_EVENTS, ScopedEventBus, SddParallelRun, SddTaskDecomposer, SecurityScanner, SecurityScannerOrchestrator, SelectiveCompactor, SessionAnalyzer, SessionError, SessionMemoryConsolidator, SessionRecovery, SkillGenerator, SkillInstaller, SkillManifestStore, SlashCommandRegistry, SpecDrivenDev, SpecParser, SpecStore, SpecVersioning, StreamHangError, SubagentBudget, TOKENS, TaskFlow, TaskGenerator, TaskGraphStore, TaskTracker, TechStackDetector, ToolAuditLog, ToolError, ToolExecutor, ToolRegistry, WorktreeManager, WrongStackError, addPlanItem, allServers, analyzeCriticalPath, appendJournal, applyRosterBudget, asBlocks, asText, assertSafePath, atomicWrite, attachAutoExtend, attachPlanCheckpoint, attachTodosCheckpoint, awsServer, blockServer, bootConfig, braveSearchServer, buildBtwBlock, buildChildEnv, buildGoalPreamble, buildOtlpMetricsRequest, buildOtlpTracesRequest, buildRecoveryStrategies, classifyFamily, clearPlan, collabInjectMiddleware, collabPauseMiddleware, color, compileGlob, compileUserRegex, completePartialObject, composeDirectorPrompt, composeSubagentPrompt, computeTaskItemProgress, computeTaskProgress, consumeBtwNotes, context7Server, contextManagerTool, createAutoExecutor, createAutoPhaseFromTaskGraph, createContextManagerTool, createDefaultPipelines, createDelegateTool, createGitPlugin, createMcpControlTool, createMessage, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSessionEventBridge, createSkillsPlugin, createSyncPlugin, createToolOutputSerializer, decryptConfigSecrets, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, deriveTodosFromPlanItem, detectNewlineStyle, dispatchAgent, downloadGitHubTarball, emptyGoal, emptyPlan, emptyTaskFile, encryptConfigSecrets, enhanceUserPrompt, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, everArtServer, expandGlob, expectDefined, extractRunEnv, filesystemServer, findCriticalPath, flagsToConfigPatch, formatContextWindowModeList, formatGoal, formatHumanPrompt, formatPlan, formatPlanTemplates, formatTaskList, formatTaskProgress, formatTodosList, getAgentDefinition, getCalibrationState, getContextWindowMode, getPlanTemplate, getTemplate, getTermSize, githubServer, goalFilePath, googleMapsServer, hashRequest, hookMatcherMatches, isAgentError, isConfigError, isContextWindowModeId, isFsError, isImageBlock, isInteractive, isPluginError, isSessionError, isStdinTTY, isStdoutTTY, isTextBlock, isThinkingBlock, isToolError, isToolResultBlock, isToolUseBlock, isValidMatrixKey, isWrongStackError, listContextWindowModes, listPlanTemplates, listTemplates, loadDirectorState, loadGoal, loadPlan, loadPlugins, loadProjectModes, loadTasks, loadTodosCheckpoint, loadUserModes, makeAgentSubagentRunner, makeAskTool, makeAssignTool, makeAutonomyPromptContributor, makeAwaitTasksTool, makeCollabDebugTool, makeContinueToNextIterationTool, makeDirectorSessionFactory, makeFleetEmitTool, makeFleetHealthTool, makeFleetSessionTool, makeFleetStatusTool, makeFleetUsageTool, makeLLMClassifier, makeRollUpTool, makeSpawnTool, makeTerminateTool, matchAny, matchGlob, matrixKeyKind, mergeCustomModelDefs, mergeModelsPayload, migratePlaintextSecrets, miniMaxVisionServer, normalizeToLf, normalizedEqual, onResize, parseContinueDirective, parseEntries, parseProgressFromText, parseSkillRef, pendingBtwCount, phaseForRole, projectHash, projectSlug, recentTextTurns, recordActualUsage, recordProgress, removePlanItem, renderProgress, renderPrometheus, renderSpecAnalysis, renderTaskGraph, renderTaskList, repairToolUseAdjacency, resetCalibration, resolveAuditLevel, resolveContextWindowPolicy, resolveModelMatrix, resolveSessionLoggingConfig, resolveWstackPaths, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, runProviderWithRetry, runShellHook, safeParse, safeStringify, sanitizeJsonString, saveGoal, savePlan, saveTasks, saveTodosCheckpoint, scoreAgents, securitySlashCommand, sentinelServer, setBtwNote, setOutputLineGuard, setPlanItemStatus, setProgress, setRawMode, shouldEnhance, slackServer, sleep, stableStringify, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, stripAnsi, summarizeUsage, templateToMarkdown, toStyle, toWrongStackError, topologicalSort, unifiedDiff, unloadPlugins, validateAgainstSchema, wireMetricsToEvents, withFileLock, wrapAsState, writeErr, writeOut, zaiVisionServer };
|
|
32948
33202
|
//# sourceMappingURL=index.js.map
|
|
32949
33203
|
//# sourceMappingURL=index.js.map
|