@wrongstack/core 0.1.4 → 0.1.8
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/README.md +155 -0
- package/dist/defaults/index.d.ts +557 -33
- package/dist/defaults/index.js +1421 -244
- package/dist/defaults/index.js.map +1 -1
- package/dist/index.d.ts +31 -13
- package/dist/index.js +1614 -334
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +5 -4
- package/dist/kernel/index.js +2 -1
- package/dist/kernel/index.js.map +1 -1
- package/dist/{secret-scrubber-qU3AwEiI.d.ts → mode-Pjt5vMS6.d.ts} +94 -3
- package/dist/{provider-DovtyuM8.d.ts → provider-txgB0Oq9.d.ts} +27 -30
- package/dist/{session-reader-DR4u3bu9.d.ts → session-reader-9sOTgmeC.d.ts} +44 -32
- package/dist/system-prompt-vAB0F54-.d.ts +23 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +34 -15
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +16 -11
- package/dist/utils/index.js +40 -13
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-D24ynAz1.d.ts → wstack-paths-BGu2INTm.d.ts} +7 -0
- package/package.json +7 -4
- package/dist/system-prompt--mzZnenv.d.ts +0 -16
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { j as MemoryStore,
|
|
2
|
-
export {
|
|
1
|
+
import { j as MemoryStore, H as SkillLoader, n as ModeStore, N as Container, O as EventBus, b as Config, g as Logger, Q as EventName, U as Listener } from './mode-Pjt5vMS6.js';
|
|
2
|
+
export { V as BindOptions, C as CompactReport, a as Compactor, c as ConfigLoader, d as ConfigStore, e as ContextConfig, D as DEFAULT_MODES, X as Decorator, E as ErrorHandler, Y as EventLogger, Z as EventMap, _ as Factory, F as FeaturesConfig, I as InputReader, L as LogConfig, f as LogLevel, M as MCPServerConfig, h as MemoryEntry, i as MemoryScope, $ as Middleware, a0 as MiddlewareHandler, k as Mode, l as ModeConfig, m as ModeManifest, o as ModelsDevModel, p as ModelsDevPayload, q as ModelsDevProvider, r as ModelsRegistry, a1 as NextFn, P as PathResolver, s as PermissionDecision, t as PermissionPolicy, a2 as Pipeline, a3 as PipelineOptions, u as PluginConfig, v as PromptOption, w as ProviderApiKey, x as ProviderConfig, R as RecoveryDecision, y as Renderer, z as ResolvedModel, A as ResolvedProvider, B as RetryPolicy, S as SecretScrubber, G as SkillEntry, J as SkillManifest, a4 as Token, T as ToolsConfig, K as TrustPolicy, W as WireFamily } from './mode-Pjt5vMS6.js';
|
|
3
3
|
export { RunController, RunControllerOptions, TOKENS } from './kernel/index.js';
|
|
4
|
-
import { c as ContentBlock, T as TextBlock, a0 as Context } from './provider-
|
|
5
|
-
export { A as AgentError, C as CacheStats, a as Capabilities, b as ConfigError, a1 as ContextInit, a2 as ConversationState, E as ErrorCode, d as ErrorSeverity, e as ErrorSubsystem, I as ImageBlock, J as JSONSchema, M as Message, f as MessageRole, P as Permission, g as PluginError, h as Provider, i as ProviderError, j as ProviderErrorBody, a3 as ReadonlyConversationState, R as Request, k as Response, l as ResumedSession, a4 as RunEnv, a5 as RunOptions, S as SessionData, m as SessionError, n as SessionEvent, o as SessionMetadata, p as SessionStore, q as SessionSummary, r as SessionWriter, a6 as StateChange, a7 as StateChangeHandler, s as StopReason, t as StreamEvent, a8 as TodoItem, u as TokenCounter, v as Tool, w as ToolCallContext, x as ToolError, y as ToolFinalEvent, z as ToolProgressEvent, B as ToolResultBlock, D as ToolStreamEvent, F as ToolUseBlock, U as Usage, W as WrongStackError, G as asBlocks, H as asText, a9 as extractRunEnv, K as isAgentError, L as isConfigError, N as isImageBlock, O as isPluginError, Q as isSessionError, V as isTextBlock, X as isToolError, Y as isToolResultBlock, Z as isToolUseBlock, _ as isWrongStackError, $ as toWrongStackError, aa as wrapAsState } from './provider-
|
|
6
|
-
import { h as AttachmentStore, g as AttachmentRef, A as AddAttachmentInput,
|
|
7
|
-
export {
|
|
8
|
-
import { S as SystemPromptBuilder, B as BuildContext } from './system-prompt
|
|
4
|
+
import { c as ContentBlock, T as TextBlock, a0 as Context } from './provider-txgB0Oq9.js';
|
|
5
|
+
export { A as AgentError, C as CacheStats, a as Capabilities, b as ConfigError, a1 as ContextInit, a2 as ConversationState, E as ErrorCode, d as ErrorSeverity, e as ErrorSubsystem, I as ImageBlock, J as JSONSchema, M as Message, f as MessageRole, P as Permission, g as PluginError, h as Provider, i as ProviderError, j as ProviderErrorBody, a3 as ReadonlyConversationState, R as Request, k as Response, l as ResumedSession, a4 as RunEnv, a5 as RunOptions, S as SessionData, m as SessionError, n as SessionEvent, o as SessionMetadata, p as SessionStore, q as SessionSummary, r as SessionWriter, a6 as StateChange, a7 as StateChangeHandler, s as StopReason, t as StreamEvent, a8 as TodoItem, u as TokenCounter, v as Tool, w as ToolCallContext, x as ToolError, y as ToolFinalEvent, z as ToolProgressEvent, B as ToolResultBlock, D as ToolStreamEvent, F as ToolUseBlock, U as Usage, W as WrongStackError, G as asBlocks, H as asText, a9 as extractRunEnv, K as isAgentError, L as isConfigError, N as isImageBlock, O as isPluginError, Q as isSessionError, V as isTextBlock, X as isToolError, Y as isToolResultBlock, Z as isToolUseBlock, _ as isWrongStackError, $ as toWrongStackError, aa as wrapAsState } from './provider-txgB0Oq9.js';
|
|
6
|
+
import { h as AttachmentStore, g as AttachmentRef, A as AddAttachmentInput, U as SlashCommand, y as PluginAPI, G as PluginPipelines, av as ToolRegistryView, J as ProviderRegistryView, M as MCPRegistryView, V as SlashCommandRegistryView, aA as ToolRegistry, aB as ProviderRegistry, P as Plugin } from './session-reader-9sOTgmeC.js';
|
|
7
|
+
export { aC as Agent, a as AgentBridge, b as AgentBridgeConfig, aD as AgentInit, aE as AgentInput, aF as AgentPipelines, c as AggregateHealth, d as Attachment, e as AttachmentKind, f as AttachmentMeta, B as BridgeMessage, i as BridgeMessageType, j as BridgeTransport, aG as BudgetExceededError, aH as BudgetKind, aI as BudgetLimits, aJ as BudgetUsage, C as ConfirmAwaiter, k as CoordinatorEvents, l as CoordinatorStatus, m as CriticalPathResult, aK as DEFAULT_MAX_ITERATIONS, D as DEFAULT_SPEC_TEMPLATE, n as DefaultSessionReaderOptions, o as DoneCondition, E as ENCRYPTED_PREFIX, H as HealthCheck, p as HealthCheckResult, q as HealthRegistry, r as HealthStatus, s as MetricLabels, t as MetricSeries, u as MetricsSink, v as MetricsSnapshot, w as MultiAgentConfig, x as MultiAgentCoordinator, z as PluginCapabilities, F as PluginDependency, aL as ProviderFactory, aM as RunResult, S as SecretVault, K as SessionEventType, L as SessionExportOptions, N as SessionQuery, O as SessionReader, Q as SessionSearchHit, R as SessionSearchQuery, T as SessionSummaryLite, W as Span, X as SpawnResult, Y as SpecAnalysis, Z as SpecApiEndpoint, _ as SpecRequirement, $ as SpecSection, a0 as SpecSectionType, a1 as SpecStatus, a2 as SpecTemplate, a3 as SpecValidationResult, a4 as Specification, aN as SubagentBudget, a5 as SubagentConfig, a6 as SubagentContext, a7 as SubagentRunContext, a8 as SubagentRunOutcome, a9 as SubagentRunner, aa as TaskAssignment, ab as TaskDelegation, ac as TaskDependency, ad as TaskEdge, ae as TaskFilter, af as TaskGraph, ag as TaskNode, ah as TaskPriority, ai as TaskProgress, aj as TaskResult, ak as TaskSort, al as TaskSpec, am as TaskStatus, an as TaskType, ao as ToolBatchResult, ap as ToolConfirmPendingResult, aq as ToolExecution, ar as ToolExecutionOutput, as as ToolExecutorInit, at as ToolExecutorOptions, au as ToolExecutorStrategy, aw as Tracer, aO as UserInputPayload, ax as computeTaskProgress, aP as createDefaultPipelines, ay as findCriticalPath, az as topologicalSort } from './session-reader-9sOTgmeC.js';
|
|
8
|
+
import { S as SystemPromptBuilder, M as ModelCapabilities, B as BuildContext } from './system-prompt-vAB0F54-.js';
|
|
9
9
|
export { AtomicWriteOptions, NewlineStyle, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, atomicWrite, color, compileGlob, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateTextTokens, estimateToolInputTokens, estimateToolResultTokens, matchAny, matchGlob, normalizeToLf, safeParse, safeStringify, sanitizeJsonString, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema } from './utils/index.js';
|
|
10
|
-
export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-
|
|
11
|
-
export { AbandonedSession, AgentFactory, AgentFactoryResult, AgentRunnerOptions, AttachmentStoreOptions, AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, CompactorOptions, ConfigLoaderOptions, ConfigMigration, ConfigMigrationError, ConfigSource, ContextManagerAction, ContextManagerInput, ContextManagerResult, ContextManagerToolOptions, DEFAULT_CONFIG_MIGRATIONS, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultLoggerOptions, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultModelsRegistryOptions, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionStore, DefaultSkillLoader, DefaultTaskStore, DefaultTokenCounter, DoneCheckResult, DoneConditionChecker, GeneratedTask, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, IntelligentCompactor, IntelligentCompactorOptions, LLMSelector, LLMSelectorOptions, MemoryStoreOptions, MetricsServerHandle, MetricsServerOptions, MigrationContext, MigrationResult, ModeLoaderOptions, MultiAgentCoordinatorOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, PermissionPolicyOptions, PersistedQueueItem, QueueStore, RecoveryLock, RecoveryLockOptions, SecretVaultOptions, SelectiveCompactor, SelectiveCompactorOptions, SessionStoreOptions, SkillLoaderOptions, SpecDrivenDev, SpecDrivenDevOptions, SpecParser,
|
|
10
|
+
export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-BGu2INTm.js';
|
|
11
|
+
export { AbandonedSession, AgentFactory, AgentFactoryResult, AgentRunnerOptions, AttachmentStoreOptions, AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, CompactorOptions, ConfigLoaderOptions, ConfigMigration, ConfigMigrationError, ConfigSource, ContextManagerAction, ContextManagerInput, ContextManagerResult, ContextManagerToolOptions, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_SUBAGENT_BASELINE, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultLoggerOptions, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultModelsRegistryOptions, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionStore, DefaultSkillLoader, DefaultTaskStore, DefaultTokenCounter, Director, DirectorPromptParts, DirectorSessionFactory, DirectorSessionFactoryOptions, DoneCheckResult, DoneConditionChecker, FleetBus, FleetEvent, FleetHandler, FleetUsage, FleetUsageAggregator, GeneratedTask, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, IntelligentCompactor, IntelligentCompactorOptions, LLMSelector, LLMSelectorOptions, MemoryStoreOptions, MetricsServerHandle, MetricsServerOptions, MigrationContext, MigrationResult, ModeLoaderOptions, MultiAgentCoordinatorOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, PermissionPolicyOptions, PersistedQueueItem, QueueStore, RecoveryLock, RecoveryLockOptions, SecretVaultOptions, SelectiveCompactor, SelectiveCompactorOptions, SessionStoreOptions, SkillLoaderOptions, SpecDrivenDev, SpecDrivenDevOptions, SpecParser, SubagentPromptParts, SubagentUsageSnapshot, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskStore, TaskTracker, TaskTrackerOptions, TaskTransition, ToolExecutor, allServers, awsServer, blockServer, braveSearchServer, buildOtlpMetricsRequest, buildOtlpTracesRequest, classifyFamily, composeDirectorPrompt, composeSubagentPrompt, context7Server, contextManagerTool, createContextManagerTool, createMessage, decryptConfigSecrets, encryptConfigSecrets, everArtServer, filesystemServer, githubServer, googleMapsServer, loadProjectModes, loadUserModes, makeAgentSubagentRunner, makeDirectorSessionFactory, migratePlaintextSecrets, renderPrometheus, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, sentinelServer, slackServer, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from './defaults/index.js';
|
|
12
12
|
import 'node:events';
|
|
13
13
|
|
|
14
14
|
interface InputBuilderOptions {
|
|
@@ -75,16 +75,30 @@ declare class InputBuilder {
|
|
|
75
75
|
private shouldCollapse;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
declare const LAYER_1_IDENTITY = "You are WrongStack, a command-line AI coding agent.\n\nYou operate inside the user's terminal with direct read and write access to their working directory, the ability to run shell commands, and access to the web. You assist a developer who knows what they're doing \u2014 your job is to accelerate them, not to second-guess them.\n\n## Core principles\n\n1. Read before you write
|
|
78
|
+
declare const LAYER_1_IDENTITY = "You are WrongStack, a command-line AI coding agent.\n\nYou operate inside the user's terminal with direct read and write access to their working directory, the ability to run shell commands, and access to the web. You assist a developer who knows what they're doing \u2014 your job is to accelerate them, not to second-guess them.\n\n## Core principles\n\n1. **Read before you write.** Always inspect the relevant files before proposing changes. Assumptions about code you haven't read are bugs in waiting.\n2. **Prefer surgical edits over rewrites.** When modifying existing files, use the edit tool with str_replace; only use write for new files or full replacements explicitly requested.\n3. **Show your work.** Before non-trivial changes, briefly state what you're about to do \u2014 one sentence, not a wall of text. After tool calls, summarize what happened, not what you did mechanically.\n4. **Be honest about limits.** If you don't know, say so. If something failed, say what failed and what you'll try next. Never fabricate file contents, API responses, or test results.\n5. **Be concise.** The user is a developer in a terminal. No marketing language, no \"great question!\", no bullet-point lists when prose works. If a one-liner answers, a one-liner is the answer.\n6. **Ask when blocked, proceed when not.** If the task is ambiguous in a way that meaningfully changes the approach, ask. If it's ambiguous in a way that doesn't, pick a reasonable default and proceed, stating the assumption.\n7. **Trust the tools.** If a permission prompt is shown, the user will answer. Do not preemptively explain that you \"would like to\" do something \u2014 call the tool, let the permission flow decide.\n8. **Format for scanability.** Use code blocks for code, backticks for file paths, bold for key terms. One-liners stay one line. Paragraphs max 3 sentences.\n9. **Recover explicitly.** When a tool fails, state: (1) what failed, (2) what you tried, (3) what you'll attempt next. Never silently skip.\n\n## Decision heuristics\n\n- **Task is ambiguous** (unclear which file, conflicting requirements) \u2192 ask before proceeding\n- **Task is clear, approach is unknown** \u2192 try one approach, report what happened\n- **Tool fails** \u2192 retry once with adjusted params, then report failure\n- **Permission prompt shown** \u2192 wait for user, do not act unilaterally\n- **Context window filling up** \u2192 use context_manager proactively; don't wait to be told\n\n## How you work\n\n- **Stay focused.** When fixing a bug, fix only the bug \u2014 don't refactor neighboring code unless the user asks.\n- **Comment with purpose.** Add comments only when they explain why, not what. The code already says what.\n- **Own your output.** Never call work \"production-ready\" or \"fully tested\" \u2014 the user makes that call.\n- **Move on from mistakes.** When something fails, report what happened and what you'll do next. No apologies, no hand-wringing.\n- **Stay in your lane.** Don't lecture about software engineering principles unless explicitly asked \u2014 the user is the expert on their codebase.";
|
|
79
79
|
interface DefaultSystemPromptBuilderOptions {
|
|
80
80
|
memoryStore?: MemoryStore;
|
|
81
81
|
skillLoader?: SkillLoader;
|
|
82
82
|
modeStore?: ModeStore;
|
|
83
|
+
/** Pre-resolved active mode id — shown in environment block. */
|
|
84
|
+
modeId?: string;
|
|
85
|
+
/** Pre-resolved mode prompt — avoids redundant modeStore.getActiveMode() call. */
|
|
86
|
+
modePrompt?: string;
|
|
87
|
+
/** Pre-resolved model capabilities — enables adaptive context thresholds. */
|
|
88
|
+
modelCapabilities?: ModelCapabilities;
|
|
83
89
|
todayIso?: string;
|
|
84
90
|
}
|
|
85
91
|
declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
|
|
86
92
|
private readonly opts;
|
|
87
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Cached environment block, keyed by projectRoot. A single builder
|
|
95
|
+
* instance is normally reused across turns of the same agent run, but
|
|
96
|
+
* tests and library consumers may reuse it across runs with different
|
|
97
|
+
* roots; keying the cache prevents leaking the first call's project
|
|
98
|
+
* state into a later call against an unrelated project.
|
|
99
|
+
*/
|
|
100
|
+
private envCacheByRoot;
|
|
101
|
+
private skillCache?;
|
|
88
102
|
constructor(opts?: DefaultSystemPromptBuilderOptions);
|
|
89
103
|
build(ctx: BuildContext): Promise<TextBlock[]>;
|
|
90
104
|
private buildToolUsage;
|
|
@@ -164,8 +178,12 @@ declare class DefaultPluginAPI implements PluginAPI {
|
|
|
164
178
|
* the package version: bump only when the surface visible to plugins
|
|
165
179
|
* (PluginAPI, types/plugin) changes in a way that breaks existing setup
|
|
166
180
|
* functions. Plugins declare `apiVersion: "^1.0"` to opt into this contract.
|
|
181
|
+
*
|
|
182
|
+
* 0.1.8: additive — Director, FleetBus, FleetUsageAggregator, and the
|
|
183
|
+
* director-prompts composers are now exported from `@wrongstack/core`.
|
|
184
|
+
* Plugins pinning `apiVersion: "^0.1"` continue to load unchanged.
|
|
167
185
|
*/
|
|
168
|
-
declare const KERNEL_API_VERSION = "0.1.
|
|
186
|
+
declare const KERNEL_API_VERSION = "0.1.8";
|
|
169
187
|
interface LoadPluginsOptions {
|
|
170
188
|
apiFactory: (plugin: Plugin) => PluginAPI;
|
|
171
189
|
log: Logger;
|
|
@@ -196,4 +214,4 @@ declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promi
|
|
|
196
214
|
*/
|
|
197
215
|
declare function unloadPlugins(loadedPlugins: Plugin[], opts: LoadPluginsOptions): Promise<void>;
|
|
198
216
|
|
|
199
|
-
export { AddAttachmentInput, AttachmentRef, AttachmentStore, BuildContext, Config, Container, ContentBlock, Context, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, EventBus, EventName, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MCPRegistryView, MemoryStore, ModeStore, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, ProviderRegistry, ProviderRegistryView, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, TextBlock, ToolRegistry, ToolRegistryView, loadPlugins, unloadPlugins };
|
|
217
|
+
export { AddAttachmentInput, AttachmentRef, AttachmentStore, BuildContext, Config, Container, ContentBlock, Context, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, EventBus, EventName, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MCPRegistryView, MemoryStore, ModeStore, ModelCapabilities, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, ProviderRegistry, ProviderRegistryView, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, TextBlock, ToolRegistry, ToolRegistryView, loadPlugins, unloadPlugins };
|