@wrongstack/core 0.1.10 → 0.3.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-6KPqsFx6.d.ts → agent-bridge-C3DUGjSb.d.ts} +1 -1
- package/dist/{compactor-B4mQZXf2.d.ts → compactor-BUU6Zm_3.d.ts} +1 -1
- package/dist/{config-BU9f_5yH.d.ts → config-CKLYPkCi.d.ts} +1 -1
- package/dist/{context-BmM2xGUZ.d.ts → context-IovtuTf8.d.ts} +10 -0
- package/dist/coordination/index.d.ts +211 -13
- package/dist/coordination/index.js +964 -67
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +33 -18
- package/dist/defaults/index.js +1273 -42
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-BMNaEFZl.d.ts → events-CNB9PALO.d.ts} +99 -1
- package/dist/execution/index.d.ts +12 -12
- package/dist/extension/index.d.ts +9 -0
- package/dist/extension/index.js +234 -0
- package/dist/extension/index.js.map +1 -0
- package/dist/index-BDb0cAMP.d.ts +806 -0
- package/dist/index.d.ts +112 -29
- package/dist/index.js +2036 -490
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/kernel/index.d.ts +12 -9
- package/dist/kernel/index.js +73 -7
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-Dzgg4x1w.d.ts → mcp-servers-DR35ojJZ.d.ts} +3 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +24 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-fmkRHtof.d.ts → multi-agent-B9a6sflH.d.ts} +71 -3
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-DBjaoXFq.d.ts → path-resolver-Cl_q0u-R.d.ts} +2 -2
- package/dist/provider-runner-BXuADQqQ.d.ts +36 -0
- package/dist/sdd/index.d.ts +3 -3
- package/dist/{secret-scrubber-CicHLN4G.d.ts → secret-scrubber-CgG2tV2B.d.ts} +1 -1
- package/dist/{secret-scrubber-DF88luOe.d.ts → secret-scrubber-Cuy5afaQ.d.ts} +1 -1
- package/dist/security/index.d.ts +20 -4
- package/dist/security/index.js +37 -2
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-BbJqiEP4.d.ts → selector-wT2fv9Fg.d.ts} +1 -1
- package/dist/{session-reader-Drq8RvJu.d.ts → session-reader-CcPi4BQ8.d.ts} +1 -1
- package/dist/{skill-DhfSizKv.d.ts → skill-C_7znCIC.d.ts} +2 -2
- package/dist/storage/index.d.ts +164 -6
- package/dist/storage/index.js +297 -2
- package/dist/storage/index.js.map +1 -1
- package/dist/{renderer-rk_1Swwc.d.ts → system-prompt-Dk1qm8ey.d.ts} +30 -2
- package/dist/{tool-executor-CpuJPYm9.d.ts → tool-executor-DKu4A6nB.d.ts} +5 -5
- package/dist/types/index.d.ts +16 -16
- package/dist/types/index.js +24 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +24 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +5 -1
- package/dist/plugin-DJk6LL8B.d.ts +0 -434
- package/dist/system-prompt-BC_8ypCG.d.ts +0 -23
package/dist/index.d.ts
CHANGED
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { C as Container } from './
|
|
2
|
-
export {
|
|
3
|
-
import { E as EventBus, a as EventName, L as Listener } from './events-
|
|
4
|
-
export { b as EventLogger, c as EventMap } from './events-
|
|
1
|
+
import { S as SystemPromptBuilder, M as ModelCapabilities, B as BuildContext, C as Container } from './system-prompt-Dk1qm8ey.js';
|
|
2
|
+
export { a as BindOptions, D as Decorator, F as Factory, b as Middleware, c as MiddlewareHandler, N as NextFn, P as Pipeline, d as PipelineOptions, R as Renderer, T as Token } from './system-prompt-Dk1qm8ey.js';
|
|
3
|
+
import { E as EventBus, a as EventName, L as Listener } from './events-CNB9PALO.js';
|
|
4
|
+
export { b as EventLogger, c as EventMap } from './events-CNB9PALO.js';
|
|
5
5
|
export { RunController, RunControllerOptions, TOKENS } from './kernel/index.js';
|
|
6
|
-
import { b as ContentBlock, T as TextBlock, a0 as Context } from './context-
|
|
7
|
-
export { A as AgentError, C as Capabilities, a as ConfigError, a3 as ContextInit, a4 as ConversationState, E as ErrorCode, c as ErrorSeverity, d as ErrorSubsystem, I as ImageBlock, J as JSONSchema, M as Message, e as MessageRole, P as Permission, f as PluginError, g as Provider, h as ProviderError, i as ProviderErrorBody, a5 as ReadonlyConversationState, R as Request, j as Response, k as ResumedSession, a6 as RunEnv, a7 as RunOptions, S as SessionData, l as SessionError, m as SessionEvent, n as SessionMetadata, o as SessionStore, p as SessionSummary, q as SessionWriter, a8 as StateChange, a9 as StateChangeHandler, r as StopReason, s as StreamEvent, t as ThinkingBlock, aa as TodoItem, a1 as TokenCounter, u as Tool, v as ToolCallContext, w as ToolError, x as ToolFinalEvent, y as ToolProgressEvent, z as ToolResultBlock, B as ToolStreamEvent, D as ToolUseBlock, U as Usage, W as WrongStackError, F as asBlocks, G as asText, ab as extractRunEnv, H as isAgentError, K as isConfigError, L as isImageBlock, N as isPluginError, O as isSessionError, Q as isTextBlock, V as isThinkingBlock, X as isToolError, Y as isToolResultBlock, Z as isToolUseBlock, _ as isWrongStackError, $ as toWrongStackError, ac as wrapAsState } from './context-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { P as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
6
|
+
import { b as ContentBlock, T as TextBlock, a0 as Context } from './context-IovtuTf8.js';
|
|
7
|
+
export { A as AgentError, C as Capabilities, a as ConfigError, a3 as ContextInit, a4 as ConversationState, E as ErrorCode, c as ErrorSeverity, d as ErrorSubsystem, I as ImageBlock, J as JSONSchema, M as Message, e as MessageRole, P as Permission, f as PluginError, g as Provider, h as ProviderError, i as ProviderErrorBody, a5 as ReadonlyConversationState, R as Request, j as Response, k as ResumedSession, a6 as RunEnv, a7 as RunOptions, S as SessionData, l as SessionError, m as SessionEvent, n as SessionMetadata, o as SessionStore, p as SessionSummary, q as SessionWriter, a8 as StateChange, a9 as StateChangeHandler, r as StopReason, s as StreamEvent, t as ThinkingBlock, aa as TodoItem, a1 as TokenCounter, u as Tool, v as ToolCallContext, w as ToolError, x as ToolFinalEvent, y as ToolProgressEvent, z as ToolResultBlock, B as ToolStreamEvent, D as ToolUseBlock, U as Usage, W as WrongStackError, F as asBlocks, G as asText, ab as extractRunEnv, H as isAgentError, K as isConfigError, L as isImageBlock, N as isPluginError, O as isSessionError, Q as isTextBlock, V as isThinkingBlock, X as isToolError, Y as isToolResultBlock, Z as isToolUseBlock, _ as isWrongStackError, $ as toWrongStackError, ac as wrapAsState } from './context-IovtuTf8.js';
|
|
8
|
+
export { P as ProviderRunner, R as RunProviderOptions } from './provider-runner-BXuADQqQ.js';
|
|
9
|
+
import { C as Config } from './config-CKLYPkCi.js';
|
|
10
|
+
export { a as ConfigLoader, b as ConfigStore, c as ContextConfig, F as FeaturesConfig, L as LogConfig, M as MCPServerConfig, P as PluginConfig, d as ProviderApiKey, e as ProviderConfig, T as ToolsConfig } from './config-CKLYPkCi.js';
|
|
11
|
+
export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from './secret-scrubber-CgG2tV2B.js';
|
|
12
|
+
import { e as AttachmentStore, d as AttachmentRef, A as AddAttachmentInput } from './session-reader-CcPi4BQ8.js';
|
|
13
|
+
export { a as Attachment, b as AttachmentKind, c as AttachmentMeta, D as DefaultSessionReader } from './session-reader-CcPi4BQ8.js';
|
|
14
|
+
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-Cuy5afaQ.js';
|
|
14
15
|
export { D as DefaultLogger, a as DefaultLoggerOptions } from './logger-BH6AE0W9.js';
|
|
15
|
-
export { D as DefaultPathResolver, a as DefaultTokenCounter } from './path-resolver-
|
|
16
|
+
export { D as DefaultPathResolver, a as DefaultTokenCounter } from './path-resolver-Cl_q0u-R.js';
|
|
16
17
|
import { b as MemoryStore } from './memory-CEXuo7sz.js';
|
|
17
18
|
export { M as MemoryEntry, a as MemoryScope } from './memory-CEXuo7sz.js';
|
|
18
|
-
export { C as CompactorOptions,
|
|
19
|
-
import { a as SkillLoader } from './skill-
|
|
20
|
-
export { S as SkillEntry, b as SkillManifest } from './skill-
|
|
21
|
-
import { S as SystemPromptBuilder, M as ModelCapabilities, B as BuildContext } from './system-prompt-BC_8ypCG.js';
|
|
19
|
+
export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from './tool-executor-DKu4A6nB.js';
|
|
20
|
+
import { a as SkillLoader } from './skill-C_7znCIC.js';
|
|
21
|
+
export { S as SkillEntry, b as SkillManifest } from './skill-C_7znCIC.js';
|
|
22
22
|
export { I as InputReader, P as PromptOption } from './input-reader-E-ffP2ee.js';
|
|
23
|
-
import {
|
|
24
|
-
export { A as Agent,
|
|
23
|
+
import { j as SystemPromptContributor, h as SlashCommand, b as PluginAPI, e as PluginPipelines, T as ToolRegistryView, g as ProviderRegistryView, M as MCPRegistryView, i as SlashCommandRegistryView, E as ExtensionRegistry, S as SessionWriterView, a as MetricsSinkView, n as ToolRegistry, o as ProviderRegistry, P as Plugin } from './index-BDb0cAMP.js';
|
|
24
|
+
export { A as AfterIterationHook, p as AfterRunHook, q as AfterToolExecutionHook, r as Agent, s as AgentExtension, t as AgentInit, u as AgentInput, v as AgentPipelines, B as BeforeIterationHook, w as BeforeRunHook, x as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, O as OnErrorHook, c as PluginCapabilities, d as PluginDependency, y as ProviderFactory, z as ProviderRunnerWrapper, R as RunResult, C as ToolWrapper, U as UserInputPayload, F as createDefaultPipelines } from './index-BDb0cAMP.js';
|
|
25
25
|
export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-DqzwpBQy.js';
|
|
26
26
|
import { c as ModeStore } from './mode-CV077NjV.js';
|
|
27
27
|
export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest } from './mode-CV077NjV.js';
|
|
28
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-
|
|
29
|
-
export {
|
|
28
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-C3DUGjSb.js';
|
|
29
|
+
export { n as BudgetExceededError, o as BudgetKind, p as BudgetLimits, q as BudgetUsage, C as CoordinatorEvents, a as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, b as MultiAgentCoordinator, S as SpawnResult, r as SubagentBudget, c as SubagentConfig, d as SubagentContext, e as SubagentError, f as SubagentErrorKind, g as SubagentRunContext, h as SubagentRunOutcome, i as SubagentRunner, T as TaskDelegation, j as TaskResult, k as TaskSpec } from './multi-agent-B9a6sflH.js';
|
|
30
30
|
export { C as CriticalPathResult, D as DEFAULT_SPEC_TEMPLATE, S as SpecAnalysis, a as SpecApiEndpoint, b as SpecRequirement, c as SpecSection, d as SpecSectionType, e as SpecStatus, f as SpecTemplate, g as SpecValidationResult, h as Specification, T as TaskAssignment, i as TaskDependency, j as TaskEdge, k as TaskFilter, l as TaskGraph, m as TaskNode, n as TaskPriority, o as TaskProgress, p as TaskSort, q as TaskStatus, r as TaskType, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from './task-graph-BITvWt4t.js';
|
|
31
31
|
export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from './observability-BhnVLBLS.js';
|
|
32
32
|
export { AtomicWriteOptions, BuildChildEnvOptions, NewlineStyle, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateTextTokens, estimateToolInputTokens, estimateToolResultTokens, formatTodosList, matchAny, matchGlob, normalizeToLf, safeParse, safeStringify, sanitizeJsonString, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema } from './utils/index.js';
|
|
33
33
|
export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-BGu2INTm.js';
|
|
34
|
-
export { AbandonedSession, AttachmentStoreOptions, ConfigLoaderOptions, ConfigMigration, ConfigMigrationError, ConfigSource, DEFAULT_CONFIG_MIGRATIONS, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultMemoryStore, DefaultSessionStore, MemoryStoreOptions, MigrationContext, MigrationResult, PersistedQueueItem, QueueStore, RecoveryLock, RecoveryLockOptions, SessionAnalyzer, SessionStoreOptions, runConfigMigrations } from './storage/index.js';
|
|
35
|
-
export { DefaultPermissionPolicy, PermissionPolicyOptions } from './security/index.js';
|
|
34
|
+
export { AbandonedSession, AttachmentStoreOptions, ConfigLoaderOptions, ConfigMigration, ConfigMigrationError, ConfigSource, DEFAULT_CONFIG_MIGRATIONS, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultMemoryStore, DefaultSessionStore, DirectorStateCheckpoint, DirectorStateSnapshot, DirectorSubagentState, DirectorTaskState, MemoryStoreOptions, MigrationContext, MigrationResult, PersistedQueueItem, PlanFile, PlanItem, QueueStore, RecoveryLock, RecoveryLockOptions, SessionAnalyzer, SessionStoreOptions, TodosCheckpointFile, addPlanItem, attachPlanCheckpoint, attachTodosCheckpoint, clearPlan, emptyPlan, formatPlan, loadDirectorState, loadPlan, loadTodosCheckpoint, removePlanItem, runConfigMigrations, savePlan, saveTodosCheckpoint, setPlanItemStatus } from './storage/index.js';
|
|
35
|
+
export { AutoApprovePermissionPolicy, DefaultPermissionPolicy, PermissionPolicyOptions } from './security/index.js';
|
|
36
36
|
export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, IntelligentCompactor, IntelligentCompactorOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions } from './execution/index.js';
|
|
37
|
-
export {
|
|
37
|
+
export { DefaultProviderRunner } from './defaults/index.js';
|
|
38
|
+
export { ALL_FLEET_AGENTS, AUDIT_LOG_AGENT, AgentFactory, AgentFactoryResult, AgentRunnerOptions, BUG_HUNTER_AGENT, CreateDelegateToolOptions, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_SUBAGENT_BASELINE, DefaultMultiAgentCoordinator, DelegateHost, Director, DirectorBudgetError, DirectorPromptParts, DirectorSessionFactory, DirectorSessionFactoryOptions, FLEET_ROSTER, FleetBus, FleetEvent, FleetHandler, FleetUsage, FleetUsageAggregator, MultiAgentCoordinatorOptions, REFACTOR_PLANNER_AGENT, SECURITY_SCANNER_AGENT, SubagentPromptParts, SubagentUsageSnapshot, composeDirectorPrompt, composeSubagentPrompt, createDelegateTool, makeAgentSubagentRunner, makeDirectorSessionFactory, rosterSummaryFromConfigs } from './coordination/index.js';
|
|
38
39
|
export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from './models/index.js';
|
|
39
40
|
export { DefaultTaskStore, GeneratedTask, SpecDrivenDev, SpecDrivenDevOptions, SpecParser, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskStore, TaskTracker, TaskTrackerOptions, TaskTransition } from './sdd/index.js';
|
|
40
41
|
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';
|
|
41
|
-
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, s as sentinelServer, o as slackServer } from './mcp-servers-
|
|
42
|
+
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, s as sentinelServer, o as slackServer } from './mcp-servers-DR35ojJZ.js';
|
|
42
43
|
import { L as Logger } from './logger-BMQgxvdy.js';
|
|
43
44
|
export { a as LogLevel } from './logger-BMQgxvdy.js';
|
|
44
45
|
export { a as ModelsDevPayload, c as ModelsDevProvider, M as ModelsRegistry, b as ResolvedModel, R as ResolvedProvider, W as WireFamily } from './models-registry-Y2xbog0E.js';
|
|
45
46
|
export { S as SecretVault } from './secret-vault-DoISxaKO.js';
|
|
46
|
-
import './compactor-
|
|
47
|
+
import './compactor-BUU6Zm_3.js';
|
|
47
48
|
import './path-resolver-CPRj4bFY.js';
|
|
48
|
-
import './selector-
|
|
49
|
+
import './selector-wT2fv9Fg.js';
|
|
49
50
|
import 'node:events';
|
|
50
51
|
|
|
51
52
|
interface InputBuilderOptions {
|
|
@@ -124,6 +125,27 @@ interface DefaultSystemPromptBuilderOptions {
|
|
|
124
125
|
/** Pre-resolved model capabilities — enables adaptive context thresholds. */
|
|
125
126
|
modelCapabilities?: ModelCapabilities;
|
|
126
127
|
todayIso?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Path to the session's plan JSON, or a getter that returns it. When
|
|
130
|
+
* set, the builder reads the file on every `build()` call and injects
|
|
131
|
+
* an "Active plan" block listing open items, so the LLM is anchored to
|
|
132
|
+
* the strategic roadmap every turn — not just at resume. The block is
|
|
133
|
+
* tagged `ephemeral` so a plan edit on turn N doesn't invalidate the
|
|
134
|
+
* provider's prefix cache for earlier turns.
|
|
135
|
+
*
|
|
136
|
+
* The function form lets callers bind the builder before the session
|
|
137
|
+
* id is known (e.g. DI containers that resolve the builder lazily) —
|
|
138
|
+
* the getter is called at build-time, after the session has been
|
|
139
|
+
* created.
|
|
140
|
+
*/
|
|
141
|
+
planPath?: string | (() => string | undefined);
|
|
142
|
+
/**
|
|
143
|
+
* System prompt contributors — called on every `build()` to inject
|
|
144
|
+
* additional TextBlocks. Use `ExtensionRegistry.listSystemPromptContributors()`
|
|
145
|
+
* or pass a plain array. Contributors are called in order; a throwing
|
|
146
|
+
* contributor is caught and logged without aborting the build.
|
|
147
|
+
*/
|
|
148
|
+
contributors?: readonly SystemPromptContributor[];
|
|
127
149
|
}
|
|
128
150
|
declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
|
|
129
151
|
private readonly opts;
|
|
@@ -138,6 +160,14 @@ declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
|
|
|
138
160
|
private skillCache?;
|
|
139
161
|
constructor(opts?: DefaultSystemPromptBuilderOptions);
|
|
140
162
|
build(ctx: BuildContext): Promise<TextBlock[]>;
|
|
163
|
+
/**
|
|
164
|
+
* Reads `<sessionId>.plan.json` (when configured) and produces a short
|
|
165
|
+
* "Active plan" block listing open items so the model is anchored to
|
|
166
|
+
* the strategic roadmap every turn. Reads on every `build()` so a
|
|
167
|
+
* plan edit (via `/plan` or the `plan` tool) reflects on the next
|
|
168
|
+
* turn without restarting the session.
|
|
169
|
+
*/
|
|
170
|
+
private buildActivePlan;
|
|
141
171
|
private buildToolUsage;
|
|
142
172
|
private buildEnvironment;
|
|
143
173
|
private buildMemoryAndSkills;
|
|
@@ -156,6 +186,10 @@ declare class SlashCommandRegistry {
|
|
|
156
186
|
*/
|
|
157
187
|
register(cmd: SlashCommand, owner?: string): void;
|
|
158
188
|
unregister(name: string): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Bulk-register multiple slash commands at once.
|
|
191
|
+
*/
|
|
192
|
+
registerAll(cmds: SlashCommand[], owner?: string): void;
|
|
159
193
|
get(name: string): SlashCommand | undefined;
|
|
160
194
|
ownerOf(name: string): string | undefined;
|
|
161
195
|
list(): SlashCommand[];
|
|
@@ -173,6 +207,7 @@ declare class SlashCommandRegistry {
|
|
|
173
207
|
dispatch(line: string, ctx: Context): Promise<{
|
|
174
208
|
exit?: boolean;
|
|
175
209
|
message?: string;
|
|
210
|
+
runText?: string;
|
|
176
211
|
} | null>;
|
|
177
212
|
}
|
|
178
213
|
|
|
@@ -190,7 +225,30 @@ interface PluginAPIInit {
|
|
|
190
225
|
providerRegistry: ProviderRegistry;
|
|
191
226
|
slashCommandRegistry?: SlashCommandRegistry;
|
|
192
227
|
mcpRegistry?: MCPRegistryView;
|
|
228
|
+
/**
|
|
229
|
+
* The agent's extension registry. Plugins register AgentExtension
|
|
230
|
+
* instances here to hook into agent lifecycle events.
|
|
231
|
+
*/
|
|
232
|
+
extensions?: ExtensionRegistry;
|
|
233
|
+
/**
|
|
234
|
+
* The active session writer. Plugins append custom events here.
|
|
235
|
+
* When not provided, a noop writer is used.
|
|
236
|
+
*/
|
|
237
|
+
sessionWriter?: SessionWriterView;
|
|
238
|
+
/**
|
|
239
|
+
* The host's metrics sink. When set, the plugin gets a scoped view
|
|
240
|
+
* that auto-prefixes metric names with `plugin.<pluginName>.`.
|
|
241
|
+
* When not provided, a noop sink is used.
|
|
242
|
+
*/
|
|
243
|
+
metricsSink?: MetricsSinkView;
|
|
193
244
|
config: Config;
|
|
245
|
+
/**
|
|
246
|
+
* The host's ConfigStore. Used to wire `api.onConfigChange()`.
|
|
247
|
+
* When not provided, `onConfigChange` is a noop.
|
|
248
|
+
*/
|
|
249
|
+
configStore?: {
|
|
250
|
+
watch(cb: (next: unknown, prev: unknown) => void): () => void;
|
|
251
|
+
};
|
|
194
252
|
log: Logger;
|
|
195
253
|
}
|
|
196
254
|
declare class DefaultPluginAPI implements PluginAPI {
|
|
@@ -201,13 +259,21 @@ declare class DefaultPluginAPI implements PluginAPI {
|
|
|
201
259
|
readonly providers: ProviderRegistryView;
|
|
202
260
|
readonly mcp: MCPRegistryView;
|
|
203
261
|
readonly slashCommands: SlashCommandRegistryView;
|
|
262
|
+
readonly extensions: ExtensionRegistry;
|
|
263
|
+
readonly session: SessionWriterView;
|
|
264
|
+
readonly metrics: MetricsSinkView;
|
|
204
265
|
readonly config: Config;
|
|
205
266
|
readonly log: Logger;
|
|
267
|
+
private readonly configStore;
|
|
206
268
|
private readonly pluginCleanupFns;
|
|
207
269
|
constructor(init: PluginAPIInit);
|
|
208
270
|
onEvent<K extends EventName>(event: K, handler: Listener<K>): () => void;
|
|
271
|
+
onPattern(pattern: string, handler: (event: string, payload: unknown) => void): () => void;
|
|
272
|
+
emitCustom(event: string, payload: unknown): void;
|
|
273
|
+
onConfigChange(handler: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
|
|
209
274
|
/** Called by the plugin loader when uninstalling the plugin. */
|
|
210
275
|
drainCleanup(): void;
|
|
276
|
+
registerSystemPromptContributor(c: SystemPromptContributor): () => void;
|
|
211
277
|
}
|
|
212
278
|
|
|
213
279
|
/**
|
|
@@ -219,7 +285,17 @@ declare class DefaultPluginAPI implements PluginAPI {
|
|
|
219
285
|
* 0.1.9: additive — `DirectorBudgetError` plus `FLEET_ROSTER` and the
|
|
220
286
|
* pre-built fleet agent configs (Audit Log, Bug Hunter, Refactor Planner,
|
|
221
287
|
* Security Scanner) now exported from `@wrongstack/core`.
|
|
222
|
-
*
|
|
288
|
+
* 0.1.10: additive — extended-thinking stream events, core subpath
|
|
289
|
+
* exports, tool output size chips on `tool.executed`. Plugin contract
|
|
290
|
+
* unchanged otherwise; 0.1.x range still loads cleanly.
|
|
291
|
+
*
|
|
292
|
+
* Note: the package shipped as 0.2.0, but the *plugin contract* didn't
|
|
293
|
+
* change in a breaking way — `SubagentError`, `subagent.tool_executed`,
|
|
294
|
+
* `transcriptPath`, `planTool`, `delegate`, `runText`, and Director
|
|
295
|
+
* sessionWriter are all additive to the surface. We deliberately keep
|
|
296
|
+
* the kernel API at 0.1.10 so plugins pinning `apiVersion: "^0.1"`
|
|
297
|
+
* keep loading. Bump to 1.0 when we stabilize and want the freedom to
|
|
298
|
+
* remove deprecated surfaces.
|
|
223
299
|
*/
|
|
224
300
|
declare const KERNEL_API_VERSION = "0.1.10";
|
|
225
301
|
interface LoadPluginsOptions {
|
|
@@ -233,6 +309,13 @@ interface LoadPluginsOptions {
|
|
|
233
309
|
* `{ [name]: { options } }` or any flat record.
|
|
234
310
|
*/
|
|
235
311
|
pluginOptions?: Record<string, unknown>;
|
|
312
|
+
/**
|
|
313
|
+
* When true, the loader throws a PluginError if a plugin calls an API
|
|
314
|
+
* method that contradicts its declared `capabilities` — instead of
|
|
315
|
+
* just logging a warning. Use in CI/strict deployments to enforce
|
|
316
|
+
* manifest honesty. Default: false (log-only, backward-compatible).
|
|
317
|
+
*/
|
|
318
|
+
enforceCapabilities?: boolean;
|
|
236
319
|
}
|
|
237
320
|
declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promise<{
|
|
238
321
|
loaded: Plugin[];
|
|
@@ -252,4 +335,4 @@ declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promi
|
|
|
252
335
|
*/
|
|
253
336
|
declare function unloadPlugins(loadedPlugins: Plugin[], opts: LoadPluginsOptions): Promise<void>;
|
|
254
337
|
|
|
255
|
-
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 };
|
|
338
|
+
export { AddAttachmentInput, AttachmentRef, AttachmentStore, BuildContext, Config, Container, ContentBlock, Context, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, EventBus, EventName, ExtensionRegistry, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MCPRegistryView, MemoryStore, MetricsSinkView, ModeStore, ModelCapabilities, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, ProviderRegistry, ProviderRegistryView, SessionWriterView, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, TextBlock, ToolRegistry, ToolRegistryView, loadPlugins, unloadPlugins };
|