@wrongstack/core 0.8.6 → 0.9.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-Bad3ZGQ7.d.ts → agent-bridge-DMVOX0cF.d.ts} +1 -1
- package/dist/{agent-subagent-runner-Cc8sRJOF.d.ts → agent-subagent-runner-R0I0Xusn.d.ts} +3 -3
- package/dist/{compactor-Mw7-rNyb.d.ts → compactor-DVTKL7XD.d.ts} +1 -1
- package/dist/{config-Bi4Q0fnz.d.ts → config-DoUAEvXH.d.ts} +8 -2
- package/dist/{context-z2x5gv_V.d.ts → context-BRNbHmRM.d.ts} +6 -0
- package/dist/coordination/index.d.ts +12 -12
- package/dist/coordination/index.js +58 -37
- package/dist/coordination/index.js.map +1 -1
- package/dist/{default-config-DvRSTELf.d.ts → default-config-Uzla85H-.d.ts} +5 -1
- package/dist/defaults/index.d.ts +22 -22
- package/dist/defaults/index.js +119 -76
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-yCpJD4wa.d.ts → events-CiG9qUM_.d.ts} +1 -1
- package/dist/execution/index.d.ts +13 -13
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{index-SxpnwRlJ.d.ts → index-bOl8lzFV.d.ts} +5 -5
- package/dist/{index-BvZld4Dr.d.ts → index-u2ROAV0F.d.ts} +17 -8
- package/dist/index.d.ts +31 -31
- package/dist/index.js +182 -95
- 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/{mcp-servers-n2L9ohMX.d.ts → mcp-servers-jEoMIBZv.d.ts} +3 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/{multi-agent-C8uY45AY.d.ts → multi-agent-3ZnTB1aT.d.ts} +2 -2
- package/dist/{multi-agent-coordinator-C7YbZUY8.d.ts → multi-agent-coordinator-COwCGIrU.d.ts} +2 -2
- package/dist/{null-fleet-bus-Bb2jVLKr.d.ts → null-fleet-bus-C1grTnOF.d.ts} +6 -6
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-DnC1nOjb.d.ts → path-resolver-TcJfc29Y.d.ts} +2 -2
- package/dist/{permission-policy-BBa1M1xc.d.ts → permission-policy-BpCGYBud.d.ts} +2 -2
- package/dist/{plan-templates-Cqdy6rtM.d.ts → plan-templates-ByT1HcRI.d.ts} +17 -7
- package/dist/{provider-runner-C4ouU7--.d.ts → provider-runner-BEpikbbN.d.ts} +3 -3
- package/dist/{retry-policy-OwtKNxo8.d.ts → retry-policy-BYkq0ugs.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/{secret-scrubber-CyE1-EMG.d.ts → secret-scrubber-DttNiGYA.d.ts} +1 -1
- package/dist/{secret-scrubber-C0n1EqrC.d.ts → secret-scrubber-QSeI0ADi.d.ts} +1 -1
- package/dist/security/index.d.ts +4 -4
- package/dist/security/index.js +5 -2
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-DkvgYVS4.d.ts → selector-pox8abg0.d.ts} +1 -1
- package/dist/{session-reader-DsadjyF9.d.ts → session-reader-CSWcb5Ga.d.ts} +1 -1
- package/dist/storage/index.d.ts +9 -6
- package/dist/storage/index.js +109 -63
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-CWA6ml-d.d.ts → system-prompt-Bs-Wliab.d.ts} +1 -1
- package/dist/{tool-executor-Ch25BDwa.d.ts → tool-executor-D7a00JVJ.d.ts} +4 -4
- package/dist/types/index.d.ts +16 -16
- package/dist/types/index.js +8 -2
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,5 +16,9 @@ declare const DEFAULT_CONTEXT_CONFIG: Readonly<{
|
|
|
16
16
|
preserveK: 10;
|
|
17
17
|
eliseThreshold: 2000;
|
|
18
18
|
}>;
|
|
19
|
+
/** Default autonomy config — auto-proceed delay etc. */
|
|
20
|
+
declare const DEFAULT_AUTONOMY_CONFIG: Readonly<{
|
|
21
|
+
autoProceedDelayMs: 45000;
|
|
22
|
+
}>;
|
|
19
23
|
|
|
20
|
-
export {
|
|
24
|
+
export { DEFAULT_AUTONOMY_CONFIG as D, DEFAULT_CONTEXT_CONFIG as a, DEFAULT_TOOLS_CONFIG as b };
|
package/dist/defaults/index.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-bOzkF5LL.js';
|
|
2
|
-
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-
|
|
3
|
-
export { D as DefaultSessionReader } from '../session-reader-
|
|
2
|
+
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-ByT1HcRI.js';
|
|
3
|
+
export { D as DefaultSessionReader } from '../session-reader-CSWcb5Ga.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
|
-
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-
|
|
6
|
-
export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from '../permission-policy-
|
|
7
|
-
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-
|
|
5
|
+
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-QSeI0ADi.js';
|
|
6
|
+
export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from '../permission-policy-BpCGYBud.js';
|
|
7
|
+
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-D7a00JVJ.js';
|
|
8
8
|
export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, AutonomyPromptContributorOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, EternalAutonomyEngine, EternalAutonomyOptions, EternalEngineState, IntelligentCompactor, IntelligentCompactorOptions, ParallelEngineState, ParallelEternalEngine, ParallelEternalOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions, buildGoalPreamble, makeAutonomyPromptContributor } from '../execution/index.js';
|
|
9
|
-
import { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-
|
|
10
|
-
import { q as Response } from '../context-
|
|
11
|
-
export { a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, h as DEFAULT_SUBAGENT_BASELINE, i as DelegateHost, j as Director, k as DirectorPromptParts, l as DirectorSessionFactory, m as DirectorSessionFactoryOptions, F as FLEET_ROSTER, n as FLEET_ROSTER_BUDGETS, s as FleetRosterBudget, t as FleetSpawnBudgetError, I as ICoordinator, u as IFleetManager, N as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, v as SubagentPromptParts, w as applyRosterBudget, x as attachAutoExtend, y as composeDirectorPrompt, z as composeSubagentPrompt, E as createDelegateTool, G as getAgentDefinition, H as makeDirectorSessionFactory, J as rosterSummaryFromConfigs } from '../null-fleet-bus-
|
|
12
|
-
export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-
|
|
13
|
-
export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, j as BudgetUsage, m as SubagentBudget } from '../multi-agent-
|
|
14
|
-
export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from '../agent-subagent-runner-
|
|
15
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-
|
|
9
|
+
import { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-BEpikbbN.js';
|
|
10
|
+
import { q as Response } from '../context-BRNbHmRM.js';
|
|
11
|
+
export { a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, h as DEFAULT_SUBAGENT_BASELINE, i as DelegateHost, j as Director, k as DirectorPromptParts, l as DirectorSessionFactory, m as DirectorSessionFactoryOptions, F as FLEET_ROSTER, n as FLEET_ROSTER_BUDGETS, s as FleetRosterBudget, t as FleetSpawnBudgetError, I as ICoordinator, u as IFleetManager, N as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, v as SubagentPromptParts, w as applyRosterBudget, x as attachAutoExtend, y as composeDirectorPrompt, z as composeSubagentPrompt, E as createDelegateTool, G as getAgentDefinition, H as makeDirectorSessionFactory, J as rosterSummaryFromConfigs } from '../null-fleet-bus-C1grTnOF.js';
|
|
12
|
+
export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-COwCGIrU.js';
|
|
13
|
+
export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, j as BudgetUsage, m as SubagentBudget } from '../multi-agent-3ZnTB1aT.js';
|
|
14
|
+
export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from '../agent-subagent-runner-R0I0Xusn.js';
|
|
15
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DMVOX0cF.js';
|
|
16
16
|
export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-OG_30xqZ.js';
|
|
17
17
|
export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from '../models/index.js';
|
|
18
18
|
export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, RunResult, SPEC_TEMPLATES, SddParallelRun, SddParallelRunOptions, SddProgress, SddTaskDecomposer, SddTaskDecomposerOptions, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskBatch, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskStore, TaskTracker, TaskTrackerOptions, TaskTransition, WaveResult, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from '../sdd/index.js';
|
|
19
19
|
export { DefaultHealthRegistry, InMemoryMetricsSink, MetricsServerHandle, MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, buildOtlpMetricsRequest, buildOtlpTracesRequest, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from '../observability/index.js';
|
|
20
|
-
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from '../mcp-servers-
|
|
21
|
-
export { D as
|
|
20
|
+
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from '../mcp-servers-jEoMIBZv.js';
|
|
21
|
+
export { D as DEFAULT_AUTONOMY_CONFIG, a as DEFAULT_CONTEXT_CONFIG, b as DEFAULT_TOOLS_CONFIG } from '../default-config-Uzla85H-.js';
|
|
22
22
|
import '../logger-DDd5C--Z.js';
|
|
23
|
-
import '../events-
|
|
23
|
+
import '../events-CiG9qUM_.js';
|
|
24
24
|
import '../memory-CEXuo7sz.js';
|
|
25
25
|
import '../wstack-paths-CJYrjQU8.js';
|
|
26
|
-
import '../config-
|
|
26
|
+
import '../config-DoUAEvXH.js';
|
|
27
27
|
import '../models-registry-BcYJDKLm.js';
|
|
28
28
|
import '../secret-vault-DoISxaKO.js';
|
|
29
|
-
import '../secret-scrubber-
|
|
29
|
+
import '../secret-scrubber-DttNiGYA.js';
|
|
30
30
|
import '../input-reader-E-ffP2ee.js';
|
|
31
|
-
import '../compactor-
|
|
32
|
-
import '../retry-policy-
|
|
33
|
-
import '../index-
|
|
34
|
-
import '../system-prompt-
|
|
31
|
+
import '../compactor-DVTKL7XD.js';
|
|
32
|
+
import '../retry-policy-BYkq0ugs.js';
|
|
33
|
+
import '../index-bOl8lzFV.js';
|
|
34
|
+
import '../system-prompt-Bs-Wliab.js';
|
|
35
35
|
import '../observability-BhnVLBLS.js';
|
|
36
|
-
import '../selector-
|
|
36
|
+
import '../selector-pox8abg0.js';
|
|
37
37
|
import '../goal-store-C7jcumEh.js';
|
|
38
38
|
import '../skill-CxuWrsKK.js';
|
|
39
39
|
import 'node:events';
|
package/dist/defaults/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as crypto2 from 'crypto';
|
|
2
2
|
import { randomBytes, randomUUID, createCipheriv, createDecipheriv, createHash } from 'crypto';
|
|
3
3
|
import * as fsp from 'fs/promises';
|
|
4
|
-
import * as
|
|
4
|
+
import * as path15 from 'path';
|
|
5
5
|
import * as fs5 from 'fs';
|
|
6
6
|
import * as os from 'os';
|
|
7
7
|
import { execFile } from 'child_process';
|
|
@@ -31,9 +31,9 @@ __export(atomic_write_exports, {
|
|
|
31
31
|
ensureDir: () => ensureDir
|
|
32
32
|
});
|
|
33
33
|
async function atomicWrite(targetPath, content, opts = {}) {
|
|
34
|
-
const dir =
|
|
34
|
+
const dir = path15.dirname(targetPath);
|
|
35
35
|
await fsp.mkdir(dir, { recursive: true });
|
|
36
|
-
const tmp =
|
|
36
|
+
const tmp = path15.join(dir, `.${path15.basename(targetPath)}.${randomBytes(6).toString("hex")}.tmp`);
|
|
37
37
|
try {
|
|
38
38
|
if (typeof content === "string") {
|
|
39
39
|
await fsp.writeFile(tmp, content, { flag: "wx", encoding: opts.encoding ?? "utf8" });
|
|
@@ -154,7 +154,7 @@ var DefaultLogger = class _DefaultLogger {
|
|
|
154
154
|
this.pretty = opts.pretty ?? true;
|
|
155
155
|
if (this.file) {
|
|
156
156
|
try {
|
|
157
|
-
fs5.mkdirSync(
|
|
157
|
+
fs5.mkdirSync(path15.dirname(this.file), { recursive: true });
|
|
158
158
|
} catch {
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -323,24 +323,30 @@ var DefaultSessionStore = class {
|
|
|
323
323
|
this.dir = opts.dir;
|
|
324
324
|
this.events = opts.events;
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
/** Join session ID to its absolute path within the store directory. */
|
|
327
|
+
sessionPath(id, ext) {
|
|
328
|
+
return path15.join(this.dir, `${id}${ext}`);
|
|
329
|
+
}
|
|
330
|
+
async ensureShardDir(_id) {
|
|
327
331
|
await ensureDir(this.dir);
|
|
332
|
+
return this.dir;
|
|
333
|
+
}
|
|
334
|
+
async create(meta) {
|
|
328
335
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
329
336
|
const id = meta.id ?? `${startedAt.replace(/[:.]/g, "-")}-${randomBytes(2).toString("hex")}`;
|
|
330
|
-
const
|
|
337
|
+
const shardDir = await this.ensureShardDir(id);
|
|
338
|
+
const file = path15.join(shardDir, `${id}.jsonl`);
|
|
331
339
|
let handle;
|
|
332
340
|
try {
|
|
333
341
|
handle = await fsp.open(file, "a", 384);
|
|
334
342
|
} catch (err) {
|
|
335
343
|
throw new Error(
|
|
336
344
|
`Failed to open session file: ${err instanceof Error ? err.message : String(err)}`,
|
|
337
|
-
{
|
|
338
|
-
cause: err
|
|
339
|
-
}
|
|
345
|
+
{ cause: err }
|
|
340
346
|
);
|
|
341
347
|
}
|
|
342
348
|
try {
|
|
343
|
-
return new FileSessionWriter(id, handle, startedAt, meta, this.events, { dir:
|
|
349
|
+
return new FileSessionWriter(id, handle, startedAt, meta, this.events, { dir: shardDir, filePath: file });
|
|
344
350
|
} catch (err) {
|
|
345
351
|
await handle.close().catch(() => {
|
|
346
352
|
});
|
|
@@ -348,15 +354,7 @@ var DefaultSessionStore = class {
|
|
|
348
354
|
}
|
|
349
355
|
}
|
|
350
356
|
async resume(id) {
|
|
351
|
-
const file =
|
|
352
|
-
try {
|
|
353
|
-
await fsp.access(file, fsp.constants.R_OK);
|
|
354
|
-
} catch {
|
|
355
|
-
throw new Error(
|
|
356
|
-
`Session "${id}" not found \u2014 the session file does not exist or was deleted.`,
|
|
357
|
-
{ cause: new Error("ENOENT") }
|
|
358
|
-
);
|
|
359
|
-
}
|
|
357
|
+
const file = this.sessionPath(id, ".jsonl");
|
|
360
358
|
const data = await this.load(id);
|
|
361
359
|
let handle;
|
|
362
360
|
try {
|
|
@@ -388,7 +386,7 @@ var DefaultSessionStore = class {
|
|
|
388
386
|
}
|
|
389
387
|
}
|
|
390
388
|
async load(id) {
|
|
391
|
-
const file =
|
|
389
|
+
const file = this.sessionPath(id, ".jsonl");
|
|
392
390
|
const raw = await fsp.readFile(file, "utf8");
|
|
393
391
|
const lines = raw.split("\n").filter((l) => l.trim());
|
|
394
392
|
const events = [];
|
|
@@ -408,8 +406,7 @@ var DefaultSessionStore = class {
|
|
|
408
406
|
async list(limit = 20) {
|
|
409
407
|
try {
|
|
410
408
|
await ensureDir(this.dir);
|
|
411
|
-
const
|
|
412
|
-
const ids = files.filter((f) => f.endsWith(".jsonl")).map((f) => f.replace(/\.jsonl$/, ""));
|
|
409
|
+
const ids = await this.collectSessionIds(this.dir);
|
|
413
410
|
const sessions = await Promise.all(ids.map((id) => this.summaryFor(id).catch(() => null)));
|
|
414
411
|
const out = sessions.filter((s) => s !== null);
|
|
415
412
|
out.sort((a, b) => {
|
|
@@ -422,13 +419,27 @@ var DefaultSessionStore = class {
|
|
|
422
419
|
return [];
|
|
423
420
|
}
|
|
424
421
|
}
|
|
422
|
+
/** Recursively collect all session IDs from shard subdirectories. */
|
|
423
|
+
async collectSessionIds(dir) {
|
|
424
|
+
const ids = [];
|
|
425
|
+
const entries = await fsp.readdir(dir, { withFileTypes: true });
|
|
426
|
+
for (const entry of entries) {
|
|
427
|
+
const full = path15.join(dir, entry.name);
|
|
428
|
+
if (entry.isDirectory()) {
|
|
429
|
+
ids.push(...await this.collectSessionIds(full));
|
|
430
|
+
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
431
|
+
ids.push(entry.name.replace(/\.jsonl$/, ""));
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return ids;
|
|
435
|
+
}
|
|
425
436
|
async summaryFor(id) {
|
|
426
|
-
const manifest =
|
|
437
|
+
const manifest = this.sessionPath(id, ".summary.json");
|
|
427
438
|
try {
|
|
428
439
|
const raw = await fsp.readFile(manifest, "utf8");
|
|
429
440
|
return JSON.parse(raw);
|
|
430
441
|
} catch {
|
|
431
|
-
const full =
|
|
442
|
+
const full = this.sessionPath(id, ".jsonl");
|
|
432
443
|
const stat4 = await fsp.stat(full);
|
|
433
444
|
const summary = await this.summarize(id, stat4.mtime.toISOString());
|
|
434
445
|
await atomicWrite(manifest, JSON.stringify(summary), { mode: 384 }).catch((err) => {
|
|
@@ -441,12 +452,13 @@ var DefaultSessionStore = class {
|
|
|
441
452
|
}
|
|
442
453
|
}
|
|
443
454
|
async delete(id) {
|
|
444
|
-
await fsp.unlink(
|
|
445
|
-
await fsp.unlink(
|
|
455
|
+
await fsp.unlink(this.sessionPath(id, ".jsonl"));
|
|
456
|
+
await fsp.unlink(this.sessionPath(id, ".summary.json")).catch(() => void 0);
|
|
446
457
|
}
|
|
447
458
|
async clearHistory(id) {
|
|
448
|
-
|
|
449
|
-
const
|
|
459
|
+
await this.ensureShardDir(id);
|
|
460
|
+
const file = this.sessionPath(id, ".jsonl");
|
|
461
|
+
const meta = this.sessionPath(id, ".summary.json");
|
|
450
462
|
const record = `${JSON.stringify({
|
|
451
463
|
type: "session_start",
|
|
452
464
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -490,7 +502,8 @@ var DefaultSessionStore = class {
|
|
|
490
502
|
startedAt: start?.ts ?? (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
491
503
|
endedAt: end?.ts,
|
|
492
504
|
model: start?.model,
|
|
493
|
-
provider: start?.provider
|
|
505
|
+
provider: start?.provider,
|
|
506
|
+
pendingToolUses: end?.pendingToolUses
|
|
494
507
|
};
|
|
495
508
|
}
|
|
496
509
|
replay(events, sessionId = "unknown") {
|
|
@@ -567,7 +580,7 @@ var FileSessionWriter = class {
|
|
|
567
580
|
this.meta = meta;
|
|
568
581
|
this.events = events;
|
|
569
582
|
this.resumed = opts.resumed ?? false;
|
|
570
|
-
this.manifestFile = opts.dir ?
|
|
583
|
+
this.manifestFile = opts.dir ? path15.join(opts.dir, `${id}.summary.json`) : "";
|
|
571
584
|
this.filePath = opts.filePath ?? "";
|
|
572
585
|
this.summary = {
|
|
573
586
|
id,
|
|
@@ -590,9 +603,6 @@ var FileSessionWriter = class {
|
|
|
590
603
|
tokenIn = 0;
|
|
591
604
|
tokenOut = 0;
|
|
592
605
|
filePath;
|
|
593
|
-
/** Public accessor for the JSONL path — required by SessionWriter so
|
|
594
|
-
* observability surfaces (`/fleet log`, FleetPanel) can locate the
|
|
595
|
-
* transcript without recomputing the path from session metadata. */
|
|
596
606
|
get transcriptPath() {
|
|
597
607
|
return this.filePath || void 0;
|
|
598
608
|
}
|
|
@@ -600,13 +610,16 @@ var FileSessionWriter = class {
|
|
|
600
610
|
resumed;
|
|
601
611
|
appendFailCount = 0;
|
|
602
612
|
lastAppendWarnAt = 0;
|
|
603
|
-
// Rewind support: track pending file changes and prompt index
|
|
604
613
|
promptIndex = 0;
|
|
605
614
|
pendingFileSnapshots = [];
|
|
606
|
-
|
|
615
|
+
/** Tracks open tool_use IDs during the current run to serialize on close for resume. */
|
|
616
|
+
openToolUses = /* @__PURE__ */ new Set();
|
|
607
617
|
recordFileChange(input) {
|
|
608
618
|
this.pendingFileSnapshots.push(input);
|
|
609
619
|
}
|
|
620
|
+
get pendingToolUses() {
|
|
621
|
+
return Array.from(this.openToolUses);
|
|
622
|
+
}
|
|
610
623
|
async writeSessionStartLazy() {
|
|
611
624
|
const record = `${JSON.stringify({
|
|
612
625
|
type: this.resumed ? "session_resumed" : "session_start",
|
|
@@ -649,13 +662,12 @@ var FileSessionWriter = class {
|
|
|
649
662
|
}
|
|
650
663
|
}
|
|
651
664
|
}
|
|
652
|
-
/**
|
|
653
|
-
* Watch events as they're appended and keep the summary state hot, so
|
|
654
|
-
* `close()` can flush a `<id>.summary.json` manifest without re-reading
|
|
655
|
-
* the JSONL. `list()` reads only manifests, turning a per-session full
|
|
656
|
-
* parse into a single stat+read.
|
|
657
|
-
*/
|
|
658
665
|
observeForSummary(event) {
|
|
666
|
+
if (event.type === "tool_use") {
|
|
667
|
+
this.openToolUses.add(event.id);
|
|
668
|
+
} else if (event.type === "tool_result") {
|
|
669
|
+
this.openToolUses.delete(event.id);
|
|
670
|
+
}
|
|
659
671
|
if (event.type === "user_input" && this.summary.title === "(empty session)") {
|
|
660
672
|
this.summary = { ...this.summary, title: userInputTitle(event.content) };
|
|
661
673
|
} else if (event.type === "llm_response") {
|
|
@@ -749,7 +761,16 @@ var FileSessionWriter = class {
|
|
|
749
761
|
}
|
|
750
762
|
}
|
|
751
763
|
const truncated = kept.join("\n");
|
|
752
|
-
|
|
764
|
+
const tmpPath = `${this.filePath}.rewind.tmp`;
|
|
765
|
+
await fsp.writeFile(tmpPath, truncated + "\n", "utf8");
|
|
766
|
+
try {
|
|
767
|
+
await this.handle.close();
|
|
768
|
+
await fsp.rename(tmpPath, this.filePath);
|
|
769
|
+
this.handle = await fsp.open(this.filePath, "a", 384);
|
|
770
|
+
} catch (err) {
|
|
771
|
+
await fsp.unlink(tmpPath).catch(() => void 0);
|
|
772
|
+
throw err;
|
|
773
|
+
}
|
|
753
774
|
await this.append({
|
|
754
775
|
type: "rewound",
|
|
755
776
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -786,7 +807,7 @@ init_atomic_write();
|
|
|
786
807
|
var QueueStore = class {
|
|
787
808
|
file;
|
|
788
809
|
constructor(opts) {
|
|
789
|
-
this.file =
|
|
810
|
+
this.file = path15.join(opts.dir, "queue.json");
|
|
790
811
|
}
|
|
791
812
|
async write(items) {
|
|
792
813
|
if (items.length === 0) {
|
|
@@ -856,7 +877,7 @@ var DefaultAttachmentStore = class {
|
|
|
856
877
|
let data = input.data;
|
|
857
878
|
if (this.spoolDir && bytes >= this.spoolThreshold) {
|
|
858
879
|
await fsp.mkdir(this.spoolDir, { recursive: true });
|
|
859
|
-
spooledPath =
|
|
880
|
+
spooledPath = path15.join(this.spoolDir, `${id}.bin`);
|
|
860
881
|
await atomicWrite(spooledPath, input.data, {
|
|
861
882
|
encoding: input.kind === "image" ? "base64" : "utf8"
|
|
862
883
|
});
|
|
@@ -1029,7 +1050,7 @@ ${body.trim()}`);
|
|
|
1029
1050
|
async remember(text, scope = "project-memory") {
|
|
1030
1051
|
return this.runSerialized(scope, async () => {
|
|
1031
1052
|
const file = this.files[scope];
|
|
1032
|
-
await ensureDir(
|
|
1053
|
+
await ensureDir(path15.dirname(file));
|
|
1033
1054
|
let existing = "";
|
|
1034
1055
|
try {
|
|
1035
1056
|
existing = await fsp.readFile(file, "utf8");
|
|
@@ -1324,6 +1345,9 @@ var DEFAULT_CONTEXT_CONFIG = Object.freeze({
|
|
|
1324
1345
|
preserveK: 10,
|
|
1325
1346
|
eliseThreshold: 2e3
|
|
1326
1347
|
});
|
|
1348
|
+
var DEFAULT_AUTONOMY_CONFIG = Object.freeze({
|
|
1349
|
+
autoProceedDelayMs: 45e3
|
|
1350
|
+
});
|
|
1327
1351
|
|
|
1328
1352
|
// src/storage/config-loader.ts
|
|
1329
1353
|
var BEHAVIOR_DEFAULTS = {
|
|
@@ -1522,7 +1546,10 @@ var DefaultConfigLoader = class {
|
|
|
1522
1546
|
}
|
|
1523
1547
|
if (c.mode !== void 0 && !isContextWindowModeId(c.mode)) {
|
|
1524
1548
|
const known = listContextWindowModes().map((m) => m.id).join(", ");
|
|
1525
|
-
|
|
1549
|
+
console.warn(
|
|
1550
|
+
`[config] Ignoring unknown context.mode "${c.mode}" (expected one of: ${known}); falling back to "${DEFAULT_CONTEXT_WINDOW_MODE_ID}".`
|
|
1551
|
+
);
|
|
1552
|
+
c.mode = DEFAULT_CONTEXT_WINDOW_MODE_ID;
|
|
1526
1553
|
}
|
|
1527
1554
|
}
|
|
1528
1555
|
validateIdentity(cfg) {
|
|
@@ -1601,7 +1628,7 @@ var RecoveryLock = class {
|
|
|
1601
1628
|
sessionStore;
|
|
1602
1629
|
probe;
|
|
1603
1630
|
constructor(opts) {
|
|
1604
|
-
this.file =
|
|
1631
|
+
this.file = path15.join(opts.dir, LOCK_FILE);
|
|
1605
1632
|
this.pid = opts.pid ?? process.pid;
|
|
1606
1633
|
this.hostname = opts.hostname ?? os.hostname();
|
|
1607
1634
|
this.maxAgeMs = opts.maxAgeMs ?? DEFAULT_MAX_AGE_MS;
|
|
@@ -1649,12 +1676,17 @@ var RecoveryLock = class {
|
|
|
1649
1676
|
};
|
|
1650
1677
|
}
|
|
1651
1678
|
/**
|
|
1652
|
-
* Claim the lock for the given session.
|
|
1653
|
-
*
|
|
1654
|
-
* `checkAbandoned`
|
|
1679
|
+
* Claim the lock for the given session. Uses exclusive-create (`O_EXCL`)
|
|
1680
|
+
* to detect whether another process acquired the lock between our
|
|
1681
|
+
* `checkAbandoned()` call and now. If the file already exists, it means
|
|
1682
|
+
* another process won the race and we throw instead of silently
|
|
1683
|
+
* overwriting their recovery record.
|
|
1684
|
+
*
|
|
1685
|
+
* The caller MUST have already called `checkAbandoned()` and handled its
|
|
1686
|
+
* null return before calling this.
|
|
1655
1687
|
*/
|
|
1656
1688
|
async write(sessionId) {
|
|
1657
|
-
await ensureDir(
|
|
1689
|
+
await ensureDir(path15.dirname(this.file));
|
|
1658
1690
|
const lock = {
|
|
1659
1691
|
v: 1,
|
|
1660
1692
|
sessionId,
|
|
@@ -1662,7 +1694,15 @@ var RecoveryLock = class {
|
|
|
1662
1694
|
hostname: this.hostname,
|
|
1663
1695
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1664
1696
|
};
|
|
1665
|
-
|
|
1697
|
+
try {
|
|
1698
|
+
await fsp.writeFile(this.file, JSON.stringify(lock), { flag: "wx", mode: 384 });
|
|
1699
|
+
} catch (err) {
|
|
1700
|
+
const code = err.code;
|
|
1701
|
+
if (code === "EEXIST") {
|
|
1702
|
+
throw new Error(`Recovery lock already held by another process`);
|
|
1703
|
+
}
|
|
1704
|
+
throw err;
|
|
1705
|
+
}
|
|
1666
1706
|
}
|
|
1667
1707
|
/**
|
|
1668
1708
|
* Release the lock. Idempotent — silently succeeds if the file is
|
|
@@ -2640,7 +2680,10 @@ var PATTERNS = [
|
|
|
2640
2680
|
type: "bearer_token",
|
|
2641
2681
|
// Anchored with alternation instead of negative lookahead — avoids V8
|
|
2642
2682
|
// backtracking risk on adversarial input. Bounded at 512 chars.
|
|
2643
|
-
|
|
2683
|
+
// Min 12 chars: some OAuth providers issue shorter-lived tokens (< 20
|
|
2684
|
+
// chars). A 12-char base64 string has ~71 bits of entropy — above the
|
|
2685
|
+
// threshold where random strings are unlikely to produce false matches.
|
|
2686
|
+
regex: /(?:^|[^A-Za-z0-9_.~+/-])Bearer\s+[A-Za-z0-9._~+/-]{12,512}=*(?:$|[^A-Za-z0-9_.~+/-])/g
|
|
2644
2687
|
},
|
|
2645
2688
|
{
|
|
2646
2689
|
type: "high_entropy_env",
|
|
@@ -2759,7 +2802,7 @@ var DefaultSecretVault = class {
|
|
|
2759
2802
|
} catch (err) {
|
|
2760
2803
|
if (err.code !== "ENOENT") throw err;
|
|
2761
2804
|
}
|
|
2762
|
-
fs5.mkdirSync(
|
|
2805
|
+
fs5.mkdirSync(path15.dirname(this.keyFile), { recursive: true });
|
|
2763
2806
|
const key = randomBytes(KEY_BYTES);
|
|
2764
2807
|
try {
|
|
2765
2808
|
fs5.writeFileSync(this.keyFile, key, { mode: 384, flag: "wx" });
|
|
@@ -2828,7 +2871,7 @@ async function rewriteConfigEncrypted(configPath, vault, patch) {
|
|
|
2828
2871
|
}
|
|
2829
2872
|
const merged = deepMerge2(current, patch ?? {});
|
|
2830
2873
|
const encrypted = encryptConfigSecrets(merged, vault);
|
|
2831
|
-
await fsp.mkdir(
|
|
2874
|
+
await fsp.mkdir(path15.dirname(configPath), { recursive: true });
|
|
2832
2875
|
await atomicWrite(configPath, JSON.stringify(encrypted, null, 2), { mode: 384 });
|
|
2833
2876
|
await restrictFilePermissions(configPath);
|
|
2834
2877
|
}
|
|
@@ -3120,7 +3163,7 @@ var DefaultPermissionPolicy = class {
|
|
|
3120
3163
|
return { permission: "auto", source: "context", reason: "file already read in this session" };
|
|
3121
3164
|
}
|
|
3122
3165
|
}
|
|
3123
|
-
if (tool.permission === "auto") {
|
|
3166
|
+
if (tool.permission === "auto" && !tool.mutating) {
|
|
3124
3167
|
return { permission: "auto", source: "default" };
|
|
3125
3168
|
}
|
|
3126
3169
|
if (this.promptDelegate) {
|
|
@@ -3543,7 +3586,7 @@ var DefaultSkillLoader = class {
|
|
|
3543
3586
|
const entries = await fsp.readdir(dir, { withFileTypes: true });
|
|
3544
3587
|
for (const e of entries) {
|
|
3545
3588
|
if (!e.isDirectory()) continue;
|
|
3546
|
-
const skillFile =
|
|
3589
|
+
const skillFile = path15.join(dir, e.name, "SKILL.md");
|
|
3547
3590
|
try {
|
|
3548
3591
|
const raw = await fsp.readFile(skillFile, "utf8");
|
|
3549
3592
|
const meta = parseFrontmatter(raw);
|
|
@@ -5517,8 +5560,8 @@ var AutonomousRunner = class {
|
|
|
5517
5560
|
init_atomic_write();
|
|
5518
5561
|
var MAX_JOURNAL_ENTRIES = 500;
|
|
5519
5562
|
function goalFilePath(projectRoot) {
|
|
5520
|
-
const hash = createHash("sha256").update(
|
|
5521
|
-
return
|
|
5563
|
+
const hash = createHash("sha256").update(path15.resolve(projectRoot)).digest("hex").slice(0, 12);
|
|
5564
|
+
return path15.join(os.homedir(), ".wrongstack", "projects", hash, "goal.json");
|
|
5522
5565
|
}
|
|
5523
5566
|
async function loadGoal(filePath) {
|
|
5524
5567
|
let raw;
|
|
@@ -11457,7 +11500,7 @@ var Director = class {
|
|
|
11457
11500
|
})),
|
|
11458
11501
|
usage: this.usage.snapshot()
|
|
11459
11502
|
};
|
|
11460
|
-
await fsp.mkdir(
|
|
11503
|
+
await fsp.mkdir(path15.dirname(this.manifestPath), { recursive: true });
|
|
11461
11504
|
await atomicWrite(this.manifestPath, JSON.stringify(manifest, null, 2), { mode: 384 });
|
|
11462
11505
|
return this.manifestPath;
|
|
11463
11506
|
}
|
|
@@ -11623,7 +11666,7 @@ var Director = class {
|
|
|
11623
11666
|
*/
|
|
11624
11667
|
async readSession(subagentId, tail) {
|
|
11625
11668
|
if (!this.sessionsRoot) return null;
|
|
11626
|
-
const filePath =
|
|
11669
|
+
const filePath = path15.join(this.sessionsRoot, this.directorRunId, `${subagentId}.jsonl`);
|
|
11627
11670
|
let raw;
|
|
11628
11671
|
try {
|
|
11629
11672
|
raw = await fsp.readFile(filePath, "utf8");
|
|
@@ -12026,13 +12069,13 @@ async function readSubagentPartial(opts, subagentId) {
|
|
|
12026
12069
|
if (!opts.sessionsRoot) return void 0;
|
|
12027
12070
|
const candidates = [];
|
|
12028
12071
|
if (opts.directorRunId) {
|
|
12029
|
-
candidates.push(
|
|
12072
|
+
candidates.push(path15.join(opts.sessionsRoot, opts.directorRunId, `${subagentId}.jsonl`));
|
|
12030
12073
|
} else {
|
|
12031
12074
|
try {
|
|
12032
12075
|
const entries = await fsp.readdir(opts.sessionsRoot, { withFileTypes: true });
|
|
12033
12076
|
for (const entry of entries) {
|
|
12034
12077
|
if (entry.isDirectory()) {
|
|
12035
|
-
candidates.push(
|
|
12078
|
+
candidates.push(path15.join(opts.sessionsRoot, entry.name, `${subagentId}.jsonl`));
|
|
12036
12079
|
}
|
|
12037
12080
|
}
|
|
12038
12081
|
} catch {
|
|
@@ -12079,9 +12122,9 @@ function makeDirectorSessionFactory(opts) {
|
|
|
12079
12122
|
let dir;
|
|
12080
12123
|
if (opts.store) {
|
|
12081
12124
|
store = opts.store;
|
|
12082
|
-
dir = opts.sessionsRoot ?
|
|
12125
|
+
dir = opts.sessionsRoot ? path15.join(opts.sessionsRoot, runId) : "(caller-managed)";
|
|
12083
12126
|
} else if (opts.sessionsRoot) {
|
|
12084
|
-
dir =
|
|
12127
|
+
dir = path15.join(opts.sessionsRoot, runId);
|
|
12085
12128
|
store = new DefaultSessionStore({ dir });
|
|
12086
12129
|
} else {
|
|
12087
12130
|
throw new Error("makeDirectorSessionFactory requires either `store` or `sessionsRoot`");
|
|
@@ -12327,7 +12370,7 @@ var DefaultModelsRegistry = class {
|
|
|
12327
12370
|
}
|
|
12328
12371
|
/** Used by `wstack models refresh` to expose where the cache lives. */
|
|
12329
12372
|
cacheLocation() {
|
|
12330
|
-
return
|
|
12373
|
+
return path15.resolve(this.cacheFile);
|
|
12331
12374
|
}
|
|
12332
12375
|
};
|
|
12333
12376
|
|
|
@@ -12611,7 +12654,7 @@ var DefaultModeStore = class {
|
|
|
12611
12654
|
}
|
|
12612
12655
|
async loadActiveMode() {
|
|
12613
12656
|
try {
|
|
12614
|
-
const configPath =
|
|
12657
|
+
const configPath = path15.join(this.configDir, "mode.json");
|
|
12615
12658
|
const content = await fsp.readFile(configPath, "utf8");
|
|
12616
12659
|
const data = JSON.parse(content);
|
|
12617
12660
|
this.activeModeId = data.activeMode ?? null;
|
|
@@ -12622,7 +12665,7 @@ var DefaultModeStore = class {
|
|
|
12622
12665
|
async saveActiveMode() {
|
|
12623
12666
|
try {
|
|
12624
12667
|
await fsp.mkdir(this.configDir, { recursive: true });
|
|
12625
|
-
const configPath =
|
|
12668
|
+
const configPath = path15.join(this.configDir, "mode.json");
|
|
12626
12669
|
await atomicWrite(
|
|
12627
12670
|
configPath,
|
|
12628
12671
|
JSON.stringify({ activeMode: this.activeModeId }, null, 2)
|
|
@@ -12637,11 +12680,11 @@ async function loadProjectModes(modesDir) {
|
|
|
12637
12680
|
const entries = await fsp.readdir(modesDir);
|
|
12638
12681
|
for (const entry of entries) {
|
|
12639
12682
|
if (!entry.endsWith(".md") && !entry.endsWith(".txt")) continue;
|
|
12640
|
-
const filePath =
|
|
12683
|
+
const filePath = path15.join(modesDir, entry);
|
|
12641
12684
|
const stat4 = await fsp.stat(filePath);
|
|
12642
12685
|
if (!stat4.isFile()) continue;
|
|
12643
12686
|
const content = await fsp.readFile(filePath, "utf8");
|
|
12644
|
-
const id =
|
|
12687
|
+
const id = path15.basename(entry, path15.extname(entry));
|
|
12645
12688
|
modes.push({
|
|
12646
12689
|
id,
|
|
12647
12690
|
name: id.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
@@ -12657,7 +12700,7 @@ async function loadProjectModes(modesDir) {
|
|
|
12657
12700
|
async function loadUserModes(modesDir) {
|
|
12658
12701
|
const modes = [];
|
|
12659
12702
|
try {
|
|
12660
|
-
const manifestPath =
|
|
12703
|
+
const manifestPath = path15.join(modesDir, "modes.json");
|
|
12661
12704
|
const content = await fsp.readFile(manifestPath, "utf8");
|
|
12662
12705
|
const manifest = JSON.parse(content);
|
|
12663
12706
|
for (const mode of manifest.modes) {
|
|
@@ -13574,7 +13617,7 @@ var SpecStore = class {
|
|
|
13574
13617
|
indexPath;
|
|
13575
13618
|
constructor(opts) {
|
|
13576
13619
|
this.baseDir = opts.baseDir;
|
|
13577
|
-
this.indexPath =
|
|
13620
|
+
this.indexPath = path15.join(this.baseDir, "_index.json");
|
|
13578
13621
|
}
|
|
13579
13622
|
async save(spec) {
|
|
13580
13623
|
await ensureDir(this.baseDir);
|
|
@@ -13643,7 +13686,7 @@ var SpecStore = class {
|
|
|
13643
13686
|
return updated;
|
|
13644
13687
|
}
|
|
13645
13688
|
filePath(id) {
|
|
13646
|
-
return
|
|
13689
|
+
return path15.join(this.baseDir, `${id}.json`);
|
|
13647
13690
|
}
|
|
13648
13691
|
async readIndex() {
|
|
13649
13692
|
try {
|
|
@@ -13700,7 +13743,7 @@ var TaskGraphStore = class {
|
|
|
13700
13743
|
indexPath;
|
|
13701
13744
|
constructor(opts) {
|
|
13702
13745
|
this.baseDir = opts.baseDir;
|
|
13703
|
-
this.indexPath =
|
|
13746
|
+
this.indexPath = path15.join(this.baseDir, "_index.json");
|
|
13704
13747
|
}
|
|
13705
13748
|
async save(graph) {
|
|
13706
13749
|
await ensureDir(this.baseDir);
|
|
@@ -13738,7 +13781,7 @@ var TaskGraphStore = class {
|
|
|
13738
13781
|
}
|
|
13739
13782
|
}
|
|
13740
13783
|
filePath(id) {
|
|
13741
|
-
return
|
|
13784
|
+
return path15.join(this.baseDir, `${id}.json`);
|
|
13742
13785
|
}
|
|
13743
13786
|
async readIndex() {
|
|
13744
13787
|
try {
|
|
@@ -16377,6 +16420,6 @@ var allServers = () => ({
|
|
|
16377
16420
|
"minimax-vision": { ...miniMaxVisionServer(), enabled: false }
|
|
16378
16421
|
});
|
|
16379
16422
|
|
|
16380
|
-
export { AGENTS_BY_PHASE, AGENT_CATALOG, AISpecBuilder, ALL_AGENT_DEFINITIONS, ALL_FLEET_AGENTS, AUDIT_LOG_AGENT, AutoApprovePermissionPolicy, AutoCompactionMiddleware, AutoExecutor, AutonomousRunner, BUG_HUNTER_AGENT, BudgetExceededError, ConfigMigrationError, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_CONTEXT_CONFIG, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_DISPATCH_ROLE, DEFAULT_SUBAGENT_BASELINE, DEFAULT_TOOLS_CONFIG, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultMultiAgentCoordinator, DefaultPermissionPolicy, DefaultProviderRunner, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionStore, DefaultSkillLoader, DefaultTaskStore, Director, DirectorStateCheckpoint, DoneConditionChecker, EternalAutonomyEngine, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FleetBus, FleetSpawnBudgetError, FleetUsageAggregator, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, IntelligentCompactor, LLMSelector, NULL_FLEET_BUS, NoopMetricsSink, NoopTracer, OTelTracer, PROMETHEUS_CONTENT_TYPE, ParallelEternalEngine, QueueStore, REFACTOR_PLANNER_AGENT, RecoveryLock, SECURITY_SCANNER_AGENT, SPEC_TEMPLATES, SddParallelRun, SddTaskDecomposer, SelectiveCompactor, SessionAnalyzer, SpecDrivenDev, SpecParser, SpecStore, SpecVersioning, SubagentBudget, TaskFlow, TaskGenerator, TaskGraphStore, TaskTracker, ToolExecutor, addPlanItem, allServers, analyzeCriticalPath, applyRosterBudget, attachAutoExtend, attachPlanCheckpoint, attachTodosCheckpoint, awsServer, blockServer, braveSearchServer, buildGoalPreamble, buildOtlpMetricsRequest, buildOtlpTracesRequest, classifyFamily, clearPlan, composeDirectorPrompt, composeSubagentPrompt, context7Server, contextManagerTool, createAutoExecutor, createContextManagerTool, createDelegateTool, createMessage, decryptConfigSecrets2 as decryptConfigSecrets, deriveTodosFromPlanItem, dispatchAgent, emptyPlan, encryptConfigSecrets, everArtServer, filesystemServer, formatPlan, formatPlanTemplates, getAgentDefinition, getPlanTemplate, getTemplate, githubServer, googleMapsServer, listPlanTemplates, listTemplates, loadDirectorState, loadPlan, loadProjectModes, loadTodosCheckpoint, loadUserModes, makeAgentSubagentRunner, makeAutonomyPromptContributor, makeDirectorSessionFactory, makeLLMClassifier, migratePlaintextSecrets, miniMaxVisionServer, removePlanItem, renderProgress, renderPrometheus, renderSpecAnalysis, renderTaskGraph, renderTaskList, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, savePlan, saveTodosCheckpoint, scoreAgents, sentinelServer, setPlanItemStatus, slackServer, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, templateToMarkdown, wireMetricsToEvents, zaiVisionServer };
|
|
16423
|
+
export { AGENTS_BY_PHASE, AGENT_CATALOG, AISpecBuilder, ALL_AGENT_DEFINITIONS, ALL_FLEET_AGENTS, AUDIT_LOG_AGENT, AutoApprovePermissionPolicy, AutoCompactionMiddleware, AutoExecutor, AutonomousRunner, BUG_HUNTER_AGENT, BudgetExceededError, ConfigMigrationError, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_CONTEXT_CONFIG, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_DISPATCH_ROLE, DEFAULT_SUBAGENT_BASELINE, DEFAULT_TOOLS_CONFIG, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultMultiAgentCoordinator, DefaultPermissionPolicy, DefaultProviderRunner, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionStore, DefaultSkillLoader, DefaultTaskStore, Director, DirectorStateCheckpoint, DoneConditionChecker, EternalAutonomyEngine, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FleetBus, FleetSpawnBudgetError, FleetUsageAggregator, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, IntelligentCompactor, LLMSelector, NULL_FLEET_BUS, NoopMetricsSink, NoopTracer, OTelTracer, PROMETHEUS_CONTENT_TYPE, ParallelEternalEngine, QueueStore, REFACTOR_PLANNER_AGENT, RecoveryLock, SECURITY_SCANNER_AGENT, SPEC_TEMPLATES, SddParallelRun, SddTaskDecomposer, SelectiveCompactor, SessionAnalyzer, SpecDrivenDev, SpecParser, SpecStore, SpecVersioning, SubagentBudget, TaskFlow, TaskGenerator, TaskGraphStore, TaskTracker, ToolExecutor, addPlanItem, allServers, analyzeCriticalPath, applyRosterBudget, attachAutoExtend, attachPlanCheckpoint, attachTodosCheckpoint, awsServer, blockServer, braveSearchServer, buildGoalPreamble, buildOtlpMetricsRequest, buildOtlpTracesRequest, classifyFamily, clearPlan, composeDirectorPrompt, composeSubagentPrompt, context7Server, contextManagerTool, createAutoExecutor, createContextManagerTool, createDelegateTool, createMessage, decryptConfigSecrets2 as decryptConfigSecrets, deriveTodosFromPlanItem, dispatchAgent, emptyPlan, encryptConfigSecrets, everArtServer, filesystemServer, formatPlan, formatPlanTemplates, getAgentDefinition, getPlanTemplate, getTemplate, githubServer, googleMapsServer, listPlanTemplates, listTemplates, loadDirectorState, loadPlan, loadProjectModes, loadTodosCheckpoint, loadUserModes, makeAgentSubagentRunner, makeAutonomyPromptContributor, makeDirectorSessionFactory, makeLLMClassifier, migratePlaintextSecrets, miniMaxVisionServer, removePlanItem, renderProgress, renderPrometheus, renderSpecAnalysis, renderTaskGraph, renderTaskList, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, savePlan, saveTodosCheckpoint, scoreAgents, sentinelServer, setPlanItemStatus, slackServer, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, templateToMarkdown, wireMetricsToEvents, zaiVisionServer };
|
|
16381
16424
|
//# sourceMappingURL=index.js.map
|
|
16382
16425
|
//# sourceMappingURL=index.js.map
|