@wrongstack/core 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-bridge-DmBiCipY.d.ts +33 -0
- package/dist/compactor-DSl2FK7a.d.ts +17 -0
- package/dist/config-DXrqb41m.d.ts +193 -0
- package/dist/{provider-txgB0Oq9.d.ts → context-u0bryklF.d.ts} +540 -472
- package/dist/coordination/index.d.ts +892 -0
- package/dist/coordination/index.js +2869 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/defaults/index.d.ts +34 -2309
- package/dist/defaults/index.js +5610 -4608
- package/dist/defaults/index.js.map +1 -1
- package/dist/events-B6Q03pTu.d.ts +290 -0
- package/dist/execution/index.d.ts +260 -0
- package/dist/execution/index.js +1625 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/index.d.ts +81 -11
- package/dist/index.js +7727 -6174
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +10 -0
- package/dist/infrastructure/index.js +575 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/input-reader-E-ffP2ee.d.ts +12 -0
- package/dist/kernel/index.d.ts +15 -4
- package/dist/kernel/index.js.map +1 -1
- package/dist/logger-BH6AE0W9.d.ts +24 -0
- package/dist/logger-BMQgxvdy.d.ts +12 -0
- package/dist/mcp-servers-BA1Ofmfj.d.ts +100 -0
- package/dist/memory-CEXuo7sz.d.ts +16 -0
- package/dist/mode-CV077NjV.d.ts +27 -0
- package/dist/models/index.d.ts +60 -0
- package/dist/models/index.js +621 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models-registry-DqzwpBQy.d.ts +46 -0
- package/dist/models-registry-Y2xbog0E.d.ts +95 -0
- package/dist/multi-agent-BDfkxL5C.d.ts +351 -0
- package/dist/observability/index.d.ts +353 -0
- package/dist/observability/index.js +691 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability-BhnVLBLS.d.ts +67 -0
- package/dist/path-resolver-CPRj4bFY.d.ts +10 -0
- package/dist/path-resolver-Crkt8wTQ.d.ts +54 -0
- package/dist/plugin-CoYYZKdn.d.ts +447 -0
- package/dist/renderer-0A2ZEtca.d.ts +158 -0
- package/dist/sdd/index.d.ts +206 -0
- package/dist/sdd/index.js +864 -0
- package/dist/sdd/index.js.map +1 -0
- package/dist/secret-scrubber-3TLUkiCV.d.ts +31 -0
- package/dist/secret-scrubber-CwYliRWd.d.ts +54 -0
- package/dist/secret-vault-DoISxaKO.d.ts +19 -0
- package/dist/security/index.d.ts +46 -0
- package/dist/security/index.js +536 -0
- package/dist/security/index.js.map +1 -0
- package/dist/selector-BRqzvugb.d.ts +51 -0
- package/dist/session-reader-C3x96CDR.d.ts +150 -0
- package/dist/skill-Bx8jxznf.d.ts +72 -0
- package/dist/storage/index.d.ts +540 -0
- package/dist/storage/index.js +1802 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/{system-prompt-vAB0F54-.d.ts → system-prompt-CG9jU5-5.d.ts} +9 -1
- package/dist/task-graph-BITvWt4t.d.ts +160 -0
- package/dist/tool-executor-CYdZdtno.d.ts +97 -0
- package/dist/types/index.d.ts +26 -4
- package/dist/types/index.js +1787 -4
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +49 -2
- package/dist/utils/index.js +100 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +34 -2
- package/dist/mode-Pjt5vMS6.d.ts +0 -815
- package/dist/session-reader-9sOTgmeC.d.ts +0 -1087
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { a0 as Context, h as ProviderError, u as Tool, D as ToolUseBlock, z as ToolResultBlock } from './context-u0bryklF.js';
|
|
2
|
+
import { C as Compactor, a as CompactReport } from './compactor-DSl2FK7a.js';
|
|
3
|
+
import { R as RecoveryDecision, E as ErrorHandler, c as RetryPolicy } from './skill-Bx8jxznf.js';
|
|
4
|
+
import { M as ModelsRegistry } from './models-registry-Y2xbog0E.js';
|
|
5
|
+
import { h as ToolExecutorOptions, i as ToolExecutorStrategy, j as ToolBatchResult } from './plugin-CoYYZKdn.js';
|
|
6
|
+
|
|
7
|
+
interface CompactorOptions {
|
|
8
|
+
preserveK?: number;
|
|
9
|
+
eliseThreshold?: number;
|
|
10
|
+
estimator?: (text: string) => number;
|
|
11
|
+
}
|
|
12
|
+
declare class HybridCompactor implements Compactor {
|
|
13
|
+
private readonly preserveK;
|
|
14
|
+
private readonly eliseThreshold;
|
|
15
|
+
private readonly estimator;
|
|
16
|
+
constructor(opts?: CompactorOptions);
|
|
17
|
+
compact(ctx: Context, opts?: {
|
|
18
|
+
aggressive?: boolean;
|
|
19
|
+
}): Promise<CompactReport>;
|
|
20
|
+
private eliseOldToolResults;
|
|
21
|
+
private collapseAncientTurns;
|
|
22
|
+
private estimateMessages;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Tiered error recovery strategies.
|
|
27
|
+
* Each strategy is attempted in order until one returns a decision.
|
|
28
|
+
*/
|
|
29
|
+
interface RecoveryStrategy {
|
|
30
|
+
/** Human-readable label for logs. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Optional compactor for context_overflow recovery. */
|
|
33
|
+
compactor?: Compactor;
|
|
34
|
+
/** Returns an explicit recovery decision, or null to fall through. */
|
|
35
|
+
attempt: (err: unknown, ctx: Context) => Promise<RecoveryDecision | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Builds the ordered list of recovery strategies used by DefaultErrorHandler.
|
|
39
|
+
* Exported so callers can customise or extend the strategy chain.
|
|
40
|
+
*/
|
|
41
|
+
declare function buildRecoveryStrategies(opts?: {
|
|
42
|
+
compactor?: Compactor;
|
|
43
|
+
modelsRegistry?: ModelsRegistry;
|
|
44
|
+
}): RecoveryStrategy[];
|
|
45
|
+
declare const DEFAULT_RECOVERY_STRATEGIES: RecoveryStrategy[];
|
|
46
|
+
declare class DefaultErrorHandler implements ErrorHandler {
|
|
47
|
+
private readonly strategies;
|
|
48
|
+
constructor(strategies?: RecoveryStrategy[]);
|
|
49
|
+
classify(err: unknown): {
|
|
50
|
+
kind: 'rate_limit' | 'overloaded' | 'server' | 'client' | 'network' | 'abort' | 'context_overflow' | 'unknown';
|
|
51
|
+
retryable: boolean;
|
|
52
|
+
};
|
|
53
|
+
recover(err: unknown, ctx: Context): Promise<RecoveryDecision | null>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class DefaultRetryPolicy implements RetryPolicy {
|
|
57
|
+
private static readonly NETWORK_ERR_RE;
|
|
58
|
+
shouldRetry(err: Error | ProviderError, attempt: number): boolean;
|
|
59
|
+
maxAttempts(err: Error | ProviderError): number;
|
|
60
|
+
delayMs(attempt: number): number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare class ToolExecutor {
|
|
64
|
+
private readonly registry;
|
|
65
|
+
private readonly opts;
|
|
66
|
+
private readonly serializer;
|
|
67
|
+
private readonly iterationTimeoutMs;
|
|
68
|
+
constructor(registry: {
|
|
69
|
+
get(name: string): Tool | undefined;
|
|
70
|
+
list(): Tool[];
|
|
71
|
+
}, opts: ToolExecutorOptions);
|
|
72
|
+
/**
|
|
73
|
+
* Execute a batch of tool uses using the configured strategy.
|
|
74
|
+
* Returns the execution results and the remaining output budget.
|
|
75
|
+
*/
|
|
76
|
+
executeBatch(toolUses: ToolUseBlock[], ctx: Context, strategy: ToolExecutorStrategy): Promise<ToolBatchResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Execute a single tool with timeout, permission check, and output capping.
|
|
79
|
+
* Emits `tool.started` via the injected EventBus (if any) right before
|
|
80
|
+
* invoking the tool — closes the observability gap between "model decided
|
|
81
|
+
* to call a tool" and "tool.executed".
|
|
82
|
+
*/
|
|
83
|
+
executeTool(tool: Tool, use: ToolUseBlock, ctx: Context, budget: number): Promise<ToolResultBlock>;
|
|
84
|
+
private runWithTimeout;
|
|
85
|
+
private runStreamedTool;
|
|
86
|
+
private unknownToolResult;
|
|
87
|
+
private deniedResult;
|
|
88
|
+
private decrementBudget;
|
|
89
|
+
/**
|
|
90
|
+
* Compute the suggestedPattern string for a tool+input pair.
|
|
91
|
+
* Matches the logic in DefaultPermissionPolicy so the TUI shows the
|
|
92
|
+
* same subject that the trust file would use.
|
|
93
|
+
*/
|
|
94
|
+
private subjectFor;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { type CompactorOptions as C, DefaultErrorHandler as D, HybridCompactor as H, type RecoveryStrategy as R, ToolExecutor as T, DefaultRetryPolicy as a, DEFAULT_RECOVERY_STRATEGIES as b, buildRecoveryStrategies as c };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
export { A as AgentError, C as
|
|
2
|
-
export { C as
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { A as AgentError, C as Capabilities, a as ConfigError, b as ContentBlock, 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, R as Request, j as Response, k as ResumedSession, S as SessionData, l as SessionError, m as SessionEvent, n as SessionMetadata, o as SessionStore, p as SessionSummary, q as SessionWriter, r as StopReason, s as StreamEvent, T as TextBlock, t as ThinkingBlock, 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, 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 } from '../context-u0bryklF.js';
|
|
2
|
+
export { C as Config, 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-DXrqb41m.js';
|
|
3
|
+
export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from '../secret-scrubber-3TLUkiCV.js';
|
|
4
|
+
export { A as AddAttachmentInput, a as Attachment, b as AttachmentKind, c as AttachmentMeta, d as AttachmentRef, e as AttachmentStore, D as DefaultSessionReader } from '../session-reader-C3x96CDR.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-CwYliRWd.js';
|
|
6
|
+
export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-BH6AE0W9.js';
|
|
7
|
+
export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-Crkt8wTQ.js';
|
|
8
|
+
export { M as MemoryEntry, a as MemoryScope, b as MemoryStore } from '../memory-CEXuo7sz.js';
|
|
9
|
+
export { C as CompactorOptions, b as DEFAULT_RECOVERY_STRATEGIES, D as DefaultErrorHandler, a as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from '../tool-executor-CYdZdtno.js';
|
|
10
|
+
export { S as SkillEntry, a as SkillLoader, b as SkillManifest } from '../skill-Bx8jxznf.js';
|
|
11
|
+
export { B as BuildContext, M as ModelCapabilities, S as SystemPromptBuilder } from '../system-prompt-CG9jU5-5.js';
|
|
12
|
+
export { R as Renderer } from '../renderer-0A2ZEtca.js';
|
|
13
|
+
export { I as InputReader, P as PromptOption } from '../input-reader-E-ffP2ee.js';
|
|
14
|
+
export { M as MCPRegistryView, P as Plugin, a as PluginAPI, b as PluginCapabilities, c as PluginDependency, d as PluginPipelines, e as ProviderFactory, f as ProviderRegistryView, S as SlashCommand, g as SlashCommandRegistryView, T as ToolRegistryView } from '../plugin-CoYYZKdn.js';
|
|
15
|
+
export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-DqzwpBQy.js';
|
|
16
|
+
export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest, c as ModeStore } from '../mode-CV077NjV.js';
|
|
17
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DmBiCipY.js';
|
|
18
|
+
export { C as CoordinatorEvents, d as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, e as MultiAgentCoordinator, f as SpawnResult, g as SubagentConfig, h as SubagentContext, i as SubagentError, j as SubagentErrorKind, k as SubagentRunContext, l as SubagentRunOutcome, m as SubagentRunner, T as TaskDelegation, n as TaskResult, o as TaskSpec } from '../multi-agent-BDfkxL5C.js';
|
|
19
|
+
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';
|
|
20
|
+
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';
|
|
21
|
+
import '../models-registry-Y2xbog0E.js';
|
|
22
|
+
import '../secret-vault-DoISxaKO.js';
|
|
23
|
+
import '../logger-BMQgxvdy.js';
|
|
24
|
+
import '../events-B6Q03pTu.js';
|
|
25
|
+
import '../path-resolver-CPRj4bFY.js';
|
|
26
|
+
import '../compactor-DSl2FK7a.js';
|