@wrongstack/core 0.6.7 → 0.7.0
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-BCVxmrOn.d.ts → agent-bridge-CrQpYjM7.d.ts} +1 -1
- package/dist/{compactor-BUJ8550X.d.ts → compactor-CWV1u-IU.d.ts} +1 -1
- package/dist/{config-BHkYGzUT.d.ts → config-C34JRwl4.d.ts} +1 -1
- package/dist/{context-C8mBUzBv.d.ts → context-bmR0YgBm.d.ts} +71 -3
- package/dist/coordination/index.d.ts +11 -11
- package/dist/coordination/index.js +53 -9
- package/dist/coordination/index.js.map +1 -1
- package/dist/default-config-DvRSTELf.d.ts +20 -0
- package/dist/defaults/index.d.ts +20 -19
- package/dist/defaults/index.js +130 -32
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-DounT6pP.d.ts → events-CEKFTmIY.d.ts} +1 -1
- package/dist/execution/index.d.ts +19 -13
- package/dist/execution/index.js +94 -22
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/extension/index.js +3 -1
- package/dist/extension/index.js.map +1 -1
- package/dist/{index-DiIGZh5I.d.ts → index-BJIFLGII.d.ts} +5 -5
- package/dist/{index-BlVITqm-.d.ts → index-CZR0HjxM.d.ts} +12 -105
- package/dist/index.d.ts +27 -26
- package/dist/index.js +184 -53
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js +8 -4
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-CXFfDN_d.d.ts → mcp-servers-BRJicm5o.d.ts} +3 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/{multi-agent-Iy8YUe3v.d.ts → multi-agent-Cm1wYSrw.d.ts} +7 -2
- package/dist/{agent-subagent-runner-BTloSwjE.d.ts → multi-agent-coordinator-CCupVFqv.d.ts} +117 -4
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-DwJO5XBn.d.ts → path-resolver-CfT7e_HT.d.ts} +2 -2
- package/dist/{plan-templates-CG_pInJV.d.ts → plan-templates-Q78an-GJ.d.ts} +4 -4
- package/dist/{provider-runner-DoohzfyD.d.ts → provider-runner-WDj28o7J.d.ts} +3 -3
- package/dist/{retry-policy-DOnwHAyz.d.ts → retry-policy-Dpxp4SET.d.ts} +1 -1
- package/dist/sdd/index.d.ts +3 -3
- package/dist/{secret-scrubber-C9UJxFCJ.d.ts → secret-scrubber-C2YCYtkn.d.ts} +1 -1
- package/dist/{secret-scrubber-DcTK9JHC.d.ts → secret-scrubber-CowtdEF8.d.ts} +1 -1
- package/dist/security/index.d.ts +3 -3
- package/dist/{selector-DVo3eT-P.d.ts → selector-CP39HhCe.d.ts} +1 -1
- package/dist/{session-reader-BXWxFAhS.d.ts → session-reader-Dwjn4WZR.d.ts} +1 -1
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.js +93 -10
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-BBGles-N.d.ts → system-prompt-CfgXqyv2.d.ts} +1 -1
- package/dist/{tool-executor-CwpjhwHC.d.ts → tool-executor-D5NFi_LV.d.ts} +5 -5
- package/dist/types/index.d.ts +16 -15
- package/dist/types/index.js +101 -20
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
1
|
+
import { E as EventBus } from './events-CEKFTmIY.js';
|
|
2
2
|
import { M as ModelsRegistry, b as ResolvedModel } from './models-registry-Y2xbog0E.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a6 as TokenCounter, U as Usage, a7 as CacheStats } from './context-bmR0YgBm.js';
|
|
4
4
|
import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
2
|
-
import {
|
|
3
|
-
import { e as AttachmentStore, A as AddAttachmentInput, d as AttachmentRef, a as Attachment } from './session-reader-
|
|
1
|
+
import { E as EventBus } from './events-CEKFTmIY.js';
|
|
2
|
+
import { r as SessionStore, q as SessionMetadata, t as SessionWriter, m as ResumedSession, S as SessionData, s as SessionSummary, b as ContentBlock, p as SessionEvent, a8 as TodoItem, a9 as ConversationState } from './context-bmR0YgBm.js';
|
|
3
|
+
import { e as AttachmentStore, A as AddAttachmentInput, d as AttachmentRef, a as Attachment } from './session-reader-Dwjn4WZR.js';
|
|
4
4
|
import { b as MemoryStore, a as MemoryScope } from './memory-CEXuo7sz.js';
|
|
5
5
|
import { W as WstackPaths } from './wstack-paths-86YPFktR.js';
|
|
6
|
-
import { c as ConfigStore, a as Config, b as ConfigLoader } from './config-
|
|
6
|
+
import { c as ConfigStore, a as Config, b as ConfigLoader } from './config-C34JRwl4.js';
|
|
7
7
|
import { S as SecretVault } from './secret-vault-DoISxaKO.js';
|
|
8
8
|
|
|
9
9
|
interface SessionStoreOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
1
|
+
import { E as EventBus } from './events-CEKFTmIY.js';
|
|
2
2
|
import { L as Logger } from './logger-BMQgxvdy.js';
|
|
3
3
|
import { T as Tracer } from './observability-BhnVLBLS.js';
|
|
4
|
-
import {
|
|
5
|
-
import { R as RetryPolicy } from './retry-policy-
|
|
4
|
+
import { i as Provider, R as Request, a5 as Context, l as Response } from './context-bmR0YgBm.js';
|
|
5
|
+
import { R as RetryPolicy } from './retry-policy-Dpxp4SET.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Options passed to a ProviderRunner when calling the provider.
|
package/dist/sdd/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../task-graph-D1YQbpxF.js';
|
|
2
|
-
import { E as EventBus } from '../events-
|
|
3
|
-
import { D as DoneCondition } from '../multi-agent-
|
|
4
|
-
import '../context-
|
|
2
|
+
import { E as EventBus } from '../events-CEKFTmIY.js';
|
|
3
|
+
import { D as DoneCondition } from '../multi-agent-Cm1wYSrw.js';
|
|
4
|
+
import '../context-bmR0YgBm.js';
|
|
5
5
|
|
|
6
6
|
declare class SpecParser {
|
|
7
7
|
parse(content: string): Specification;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SecretVault } from './secret-vault-DoISxaKO.js';
|
|
2
|
-
import { S as SecretScrubber } from './secret-scrubber-
|
|
2
|
+
import { S as SecretScrubber } from './secret-scrubber-C2YCYtkn.js';
|
|
3
3
|
|
|
4
4
|
interface SecretVaultOptions {
|
|
5
5
|
/** Absolute path to the key file. Created with mode 0o600 if missing. */
|
package/dist/security/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-
|
|
2
|
-
import {
|
|
1
|
+
export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-CowtdEF8.js';
|
|
2
|
+
import { x as Tool, a5 as Context } from '../context-bmR0YgBm.js';
|
|
3
3
|
import { I as InputReader } from '../input-reader-E-ffP2ee.js';
|
|
4
|
-
import { a as PermissionPolicy, P as PermissionDecision } from '../secret-scrubber-
|
|
4
|
+
import { a as PermissionPolicy, P as PermissionDecision } from '../secret-scrubber-C2YCYtkn.js';
|
|
5
5
|
import '../secret-vault-DoISxaKO.js';
|
|
6
6
|
|
|
7
7
|
interface PermissionPolicyOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ContentBlock,
|
|
1
|
+
import { b as ContentBlock, p as SessionEvent, q as SessionMetadata, r as SessionStore } from './context-bmR0YgBm.js';
|
|
2
2
|
|
|
3
3
|
type AttachmentKind = 'text' | 'image' | 'file';
|
|
4
4
|
interface AttachmentMeta {
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from '../plan-templates-
|
|
2
|
-
export { D as DefaultSessionReader } from '../session-reader-
|
|
1
|
+
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from '../plan-templates-Q78an-GJ.js';
|
|
2
|
+
export { D as DefaultSessionReader } from '../session-reader-Dwjn4WZR.js';
|
|
3
3
|
import { S as SessionRewinder, C as CheckpointInfo, a as RewindResultExtended } from '../session-rewinder-C9HnMkhP.js';
|
|
4
4
|
export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from '../director-state-BmYi3DGA.js';
|
|
5
5
|
export { G as GoalFile, J as JournalEntry, M as MAX_JOURNAL_ENTRIES, a as appendJournal, e as emptyGoal, f as formatGoal, g as goalFilePath, l as loadGoal, s as saveGoal, b as summarizeUsage } from '../goal-store-HHgaq5ue.js';
|
|
6
|
-
import '../events-
|
|
7
|
-
import '../context-
|
|
6
|
+
import '../events-CEKFTmIY.js';
|
|
7
|
+
import '../context-bmR0YgBm.js';
|
|
8
8
|
import '../memory-CEXuo7sz.js';
|
|
9
9
|
import '../wstack-paths-86YPFktR.js';
|
|
10
|
-
import '../config-
|
|
10
|
+
import '../config-C34JRwl4.js';
|
|
11
11
|
import '../models-registry-Y2xbog0E.js';
|
|
12
12
|
import '../secret-vault-DoISxaKO.js';
|
|
13
13
|
|
package/dist/storage/index.js
CHANGED
|
@@ -199,8 +199,16 @@ var DefaultSessionStore = class {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
async resume(id) {
|
|
202
|
-
const data = await this.load(id);
|
|
203
202
|
const file = path2.join(this.dir, `${id}.jsonl`);
|
|
203
|
+
try {
|
|
204
|
+
await fsp.access(file, fsp.constants.R_OK);
|
|
205
|
+
} catch {
|
|
206
|
+
throw new Error(
|
|
207
|
+
`Session "${id}" not found \u2014 the session file does not exist or was deleted.`,
|
|
208
|
+
{ cause: new Error("ENOENT") }
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
const data = await this.load(id);
|
|
204
212
|
let handle;
|
|
205
213
|
try {
|
|
206
214
|
handle = await fsp.open(file, "a", 384);
|
|
@@ -1145,6 +1153,20 @@ function safeParse(input, maxBytes = 5e6) {
|
|
|
1145
1153
|
}
|
|
1146
1154
|
}
|
|
1147
1155
|
|
|
1156
|
+
// src/types/default-config.ts
|
|
1157
|
+
var DEFAULT_TOOLS_CONFIG = Object.freeze({
|
|
1158
|
+
defaultExecutionStrategy: "smart",
|
|
1159
|
+
maxIterations: 100,
|
|
1160
|
+
iterationTimeoutMs: 3e5,
|
|
1161
|
+
sessionTimeoutMs: 18e5,
|
|
1162
|
+
perIterationOutputCapBytes: 1e5,
|
|
1163
|
+
autoExtendLimit: true
|
|
1164
|
+
});
|
|
1165
|
+
var DEFAULT_CONTEXT_CONFIG = Object.freeze({
|
|
1166
|
+
preserveK: 10,
|
|
1167
|
+
eliseThreshold: 2e3
|
|
1168
|
+
});
|
|
1169
|
+
|
|
1148
1170
|
// src/storage/config-loader.ts
|
|
1149
1171
|
var BEHAVIOR_DEFAULTS = {
|
|
1150
1172
|
version: 1,
|
|
@@ -1154,16 +1176,16 @@ var BEHAVIOR_DEFAULTS = {
|
|
|
1154
1176
|
softThreshold: 0.75,
|
|
1155
1177
|
hardThreshold: 0.9,
|
|
1156
1178
|
autoCompact: true,
|
|
1157
|
-
preserveK:
|
|
1158
|
-
eliseThreshold:
|
|
1179
|
+
preserveK: DEFAULT_CONTEXT_CONFIG.preserveK,
|
|
1180
|
+
eliseThreshold: DEFAULT_CONTEXT_CONFIG.eliseThreshold
|
|
1159
1181
|
},
|
|
1160
1182
|
tools: {
|
|
1161
|
-
defaultExecutionStrategy:
|
|
1162
|
-
maxIterations:
|
|
1163
|
-
iterationTimeoutMs:
|
|
1164
|
-
sessionTimeoutMs:
|
|
1165
|
-
perIterationOutputCapBytes:
|
|
1166
|
-
autoExtendLimit:
|
|
1183
|
+
defaultExecutionStrategy: DEFAULT_TOOLS_CONFIG.defaultExecutionStrategy,
|
|
1184
|
+
maxIterations: DEFAULT_TOOLS_CONFIG.maxIterations,
|
|
1185
|
+
iterationTimeoutMs: DEFAULT_TOOLS_CONFIG.iterationTimeoutMs,
|
|
1186
|
+
sessionTimeoutMs: DEFAULT_TOOLS_CONFIG.sessionTimeoutMs,
|
|
1187
|
+
perIterationOutputCapBytes: DEFAULT_TOOLS_CONFIG.perIterationOutputCapBytes,
|
|
1188
|
+
autoExtendLimit: DEFAULT_TOOLS_CONFIG.autoExtendLimit
|
|
1167
1189
|
},
|
|
1168
1190
|
log: { level: "info" },
|
|
1169
1191
|
features: {
|
|
@@ -2552,6 +2574,58 @@ var DirectorStateCheckpoint = class {
|
|
|
2552
2574
|
}
|
|
2553
2575
|
}
|
|
2554
2576
|
};
|
|
2577
|
+
|
|
2578
|
+
// src/types/errors.ts
|
|
2579
|
+
var ERROR_CODES = {
|
|
2580
|
+
// File system
|
|
2581
|
+
FS_READ_FAILED: "FS_READ_FAILED",
|
|
2582
|
+
FS_ATOMIC_WRITE_FAILED: "FS_ATOMIC_WRITE_FAILED"};
|
|
2583
|
+
var WrongStackError = class extends Error {
|
|
2584
|
+
code;
|
|
2585
|
+
subsystem;
|
|
2586
|
+
severity;
|
|
2587
|
+
recoverable;
|
|
2588
|
+
context;
|
|
2589
|
+
constructor(opts) {
|
|
2590
|
+
super(opts.message, { cause: opts.cause });
|
|
2591
|
+
this.name = "WrongStackError";
|
|
2592
|
+
this.code = opts.code;
|
|
2593
|
+
this.subsystem = opts.subsystem;
|
|
2594
|
+
this.severity = opts.severity ?? "error";
|
|
2595
|
+
this.recoverable = opts.recoverable ?? false;
|
|
2596
|
+
this.context = opts.context;
|
|
2597
|
+
}
|
|
2598
|
+
/**
|
|
2599
|
+
* Render a one-line user-facing description.
|
|
2600
|
+
* Subclasses should override for domain-specific formatting.
|
|
2601
|
+
*/
|
|
2602
|
+
describe() {
|
|
2603
|
+
const ctx = this.context ? ` ${formatContext(this.context)}` : "";
|
|
2604
|
+
return `${this.code}: ${this.message}${ctx}`;
|
|
2605
|
+
}
|
|
2606
|
+
};
|
|
2607
|
+
function formatContext(ctx) {
|
|
2608
|
+
const parts = Object.entries(ctx).filter(([, v]) => v !== void 0).slice(0, 3).map(([k, v]) => `${k}=${String(v)}`);
|
|
2609
|
+
return parts.length > 0 ? `[${parts.join(" ")}]` : "";
|
|
2610
|
+
}
|
|
2611
|
+
var FsError = class extends WrongStackError {
|
|
2612
|
+
path;
|
|
2613
|
+
constructor(opts) {
|
|
2614
|
+
super({
|
|
2615
|
+
message: opts.message,
|
|
2616
|
+
code: opts.code,
|
|
2617
|
+
subsystem: "fs",
|
|
2618
|
+
severity: "error",
|
|
2619
|
+
recoverable: opts.code !== ERROR_CODES.FS_READ_FAILED,
|
|
2620
|
+
context: { path: opts.path, ...opts.context },
|
|
2621
|
+
cause: opts.cause
|
|
2622
|
+
});
|
|
2623
|
+
this.name = "FsError";
|
|
2624
|
+
this.path = opts.path;
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
|
|
2628
|
+
// src/storage/goal-store.ts
|
|
2555
2629
|
var MAX_JOURNAL_ENTRIES = 500;
|
|
2556
2630
|
function goalFilePath(projectRoot) {
|
|
2557
2631
|
return path2.join(projectRoot, ".wrongstack", "goal.json");
|
|
@@ -2574,7 +2648,16 @@ async function loadGoal(filePath) {
|
|
|
2574
2648
|
}
|
|
2575
2649
|
}
|
|
2576
2650
|
async function saveGoal(filePath, goal) {
|
|
2577
|
-
|
|
2651
|
+
try {
|
|
2652
|
+
await atomicWrite(filePath, JSON.stringify(goal, null, 2), { mode: 384 });
|
|
2653
|
+
} catch (err) {
|
|
2654
|
+
throw new FsError({
|
|
2655
|
+
message: err instanceof Error ? err.message : String(err),
|
|
2656
|
+
code: ERROR_CODES.FS_ATOMIC_WRITE_FAILED,
|
|
2657
|
+
path: filePath,
|
|
2658
|
+
cause: err
|
|
2659
|
+
});
|
|
2660
|
+
}
|
|
2578
2661
|
}
|
|
2579
2662
|
function emptyGoal(goal) {
|
|
2580
2663
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|