@wrongstack/core 0.7.4 → 0.7.6

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.
@@ -7,10 +7,11 @@ import { b as MiddlewareHandler } from '../system-prompt-CWA6ml-d.js';
7
7
  import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-Bi4Q0fnz.js';
8
8
  import { c as Agent, R as RunResult, w as SystemPromptContributor } from '../index-BUHs7xJ9.js';
9
9
  import { D as DoneCondition } from '../multi-agent-7OK4pEKW.js';
10
- import { J as JournalEntry } from '../goal-store-HHgaq5ue.js';
11
- import { c as AgentFactory, i as DispatchClassifier, g as DefaultMultiAgentCoordinator } from '../multi-agent-coordinator-D8PLzfz6.js';
10
+ import { J as JournalEntry } from '../goal-store-C7jcumEh.js';
11
+ import { A as AgentFactory } from '../agent-subagent-runner-BOBYkW_r.js';
12
+ import { f as DispatchClassifier, d as DefaultMultiAgentCoordinator } from '../multi-agent-coordinator-3Ypfg-hr.js';
12
13
  import { a as SkillLoader, b as SkillManifest, S as SkillEntry } from '../skill-CxuWrsKK.js';
13
- import { a as WstackPaths } from '../wstack-paths-BGu2INTm.js';
14
+ import { a as WstackPaths } from '../wstack-paths-gCrJ631C.js';
14
15
  import '../retry-policy-OwtKNxo8.js';
15
16
  import '../models-registry-BcYJDKLm.js';
16
17
  import '../logger-DDd5C--Z.js';
@@ -2,7 +2,8 @@ import { execFile } from 'child_process';
2
2
  import { promisify } from 'util';
3
3
  import * as fs from 'fs/promises';
4
4
  import * as path from 'path';
5
- import { randomUUID, randomBytes } from 'crypto';
5
+ import { randomUUID, createHash, randomBytes } from 'crypto';
6
+ import * as os from 'os';
6
7
  import { EventEmitter } from 'events';
7
8
 
8
9
  // src/utils/token-estimate.ts
@@ -1721,7 +1722,7 @@ async function renameWithRetry(from, to) {
1721
1722
  if (!code || !TRANSIENT_RENAME_CODES.has(code) || i === delays.length) {
1722
1723
  throw err;
1723
1724
  }
1724
- await new Promise((resolve) => setTimeout(resolve, delays[i]));
1725
+ await new Promise((resolve2) => setTimeout(resolve2, delays[i]));
1725
1726
  }
1726
1727
  }
1727
1728
  throw lastErr;
@@ -1730,7 +1731,8 @@ async function renameWithRetry(from, to) {
1730
1731
  // src/storage/goal-store.ts
1731
1732
  var MAX_JOURNAL_ENTRIES = 500;
1732
1733
  function goalFilePath(projectRoot) {
1733
- return path.join(projectRoot, ".wrongstack", "goal.json");
1734
+ const hash = createHash("sha256").update(path.resolve(projectRoot)).digest("hex").slice(0, 12);
1735
+ return path.join(os.homedir(), ".wrongstack", "projects", hash, "goal.json");
1734
1736
  }
1735
1737
  async function loadGoal(filePath) {
1736
1738
  let raw;
@@ -2345,7 +2347,7 @@ ${recentJournal}` : "No prior iterations.",
2345
2347
  }
2346
2348
  };
2347
2349
  function sleep(ms) {
2348
- return new Promise((resolve) => setTimeout(resolve, ms));
2350
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
2349
2351
  }
2350
2352
 
2351
2353
  // src/coordination/subagent-budget.ts
@@ -2482,12 +2484,12 @@ var SubagentBudget = class _SubagentBudget {
2482
2484
  if (!bus || !bus.hasListenerFor("budget.threshold_reached")) {
2483
2485
  return Promise.resolve("stop");
2484
2486
  }
2485
- return new Promise((resolve) => {
2487
+ return new Promise((resolve2) => {
2486
2488
  let resolved = false;
2487
2489
  const respond = (d) => {
2488
2490
  if (resolved) return;
2489
2491
  resolved = true;
2490
- resolve(d);
2492
+ resolve2(d);
2491
2493
  };
2492
2494
  const fallback = setTimeout(
2493
2495
  () => respond("stop"),
@@ -5342,7 +5344,7 @@ var DefaultMultiAgentCoordinator = class extends EventEmitter {
5342
5344
  taskIds.map((id) => {
5343
5345
  const cached = this.completedResults.find((r) => r.taskId === id);
5344
5346
  if (cached) return cached;
5345
- return new Promise((resolve, reject) => {
5347
+ return new Promise((resolve2, reject) => {
5346
5348
  const timeout = setTimeout(() => {
5347
5349
  this.off("task.completed", handler);
5348
5350
  reject(new Error(`awaitTasks timed out waiting for task "${id}"`));
@@ -5351,7 +5353,7 @@ var DefaultMultiAgentCoordinator = class extends EventEmitter {
5351
5353
  if (result.taskId === id) {
5352
5354
  clearTimeout(timeout);
5353
5355
  this.off("task.completed", handler);
5354
- resolve(result);
5356
+ resolve2(result);
5355
5357
  }
5356
5358
  };
5357
5359
  this.on("task.completed", handler);
@@ -5752,7 +5754,7 @@ function providerErrorToSubagentError(err, message, cause) {
5752
5754
 
5753
5755
  // src/execution/parallel-eternal-engine.ts
5754
5756
  function sleep2(ms) {
5755
- return new Promise((resolve) => setTimeout(resolve, ms));
5757
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
5756
5758
  }
5757
5759
  var GOAL_COMPLETE_MARKER2 = /^\s*\[goal[_\s-]?complete\]\s*$/im;
5758
5760
  var ParallelEternalEngine = class {