@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,33 @@
|
|
|
1
|
+
import { p as BridgeTransport, q as BridgeMessage, A as AgentBridge, r as AgentBridgeConfig } from './multi-agent-BDfkxL5C.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* In-memory pub/sub transport for agent-to-agent messaging.
|
|
5
|
+
* Subscribers register by agentId and receive messages via callback.
|
|
6
|
+
*/
|
|
7
|
+
declare class InMemoryBridgeTransport implements BridgeTransport {
|
|
8
|
+
private readonly subs;
|
|
9
|
+
send(msg: BridgeMessage, to: string): Promise<void>;
|
|
10
|
+
subscribe(agentId: string, handler: (msg: BridgeMessage) => void): () => void;
|
|
11
|
+
close(agentId: string): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class InMemoryAgentBridge implements AgentBridge {
|
|
15
|
+
readonly agentId: string;
|
|
16
|
+
readonly coordinatorId: string;
|
|
17
|
+
private readonly transport;
|
|
18
|
+
private readonly subscriptions;
|
|
19
|
+
private readonly pendingRequests;
|
|
20
|
+
private stopped;
|
|
21
|
+
private timeoutMs;
|
|
22
|
+
/** Guards request() so concurrent calls on the same id can't silently overwrite. */
|
|
23
|
+
private readonly inflightGuards;
|
|
24
|
+
constructor(config: AgentBridgeConfig, transport: BridgeTransport);
|
|
25
|
+
send(msg: BridgeMessage): Promise<void>;
|
|
26
|
+
broadcast(msg: BridgeMessage): Promise<void>;
|
|
27
|
+
subscribe(handler: (msg: BridgeMessage) => void | Promise<void>): () => void;
|
|
28
|
+
request<T>(msg: BridgeMessage, timeoutMs?: number): Promise<BridgeMessage<T>>;
|
|
29
|
+
stop(): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
declare function createMessage<T = unknown>(type: BridgeMessage['type'], from: string, payload: T, to?: string): BridgeMessage<T>;
|
|
32
|
+
|
|
33
|
+
export { InMemoryAgentBridge as I, InMemoryBridgeTransport as a, createMessage as c };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a0 as Context } from './context-u0bryklF.js';
|
|
2
|
+
|
|
3
|
+
interface CompactReport {
|
|
4
|
+
before: number;
|
|
5
|
+
after: number;
|
|
6
|
+
reductions: {
|
|
7
|
+
phase: 'elision' | 'summary' | 'selective';
|
|
8
|
+
saved: number;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
interface Compactor {
|
|
12
|
+
compact(ctx: Context, opts?: {
|
|
13
|
+
aggressive?: boolean;
|
|
14
|
+
}): Promise<CompactReport>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type { Compactor as C, CompactReport as a };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { W as WireFamily } from './models-registry-Y2xbog0E.js';
|
|
2
|
+
import { P as Permission } from './context-u0bryklF.js';
|
|
3
|
+
|
|
4
|
+
interface ContextConfig {
|
|
5
|
+
warnThreshold: number;
|
|
6
|
+
softThreshold: number;
|
|
7
|
+
hardThreshold: number;
|
|
8
|
+
/** Enable automatic compaction when thresholds are crossed (default: true). */
|
|
9
|
+
autoCompact?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Model used for LLM-assisted summarization in IntelligentCompactor.
|
|
12
|
+
* Falls back to the main model when omitted.
|
|
13
|
+
*/
|
|
14
|
+
summarizerModel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Override the effective context window size (in tokens). Use this when
|
|
17
|
+
* you want the compactor to trigger earlier than the provider's actual
|
|
18
|
+
* maxContext. Defaults to the provider's reported maxContext.
|
|
19
|
+
*/
|
|
20
|
+
effectiveMaxContext?: number;
|
|
21
|
+
maxSessionTokens?: number;
|
|
22
|
+
maxDailyTokens?: number;
|
|
23
|
+
preserveK: number;
|
|
24
|
+
eliseThreshold: number;
|
|
25
|
+
/** Compactor strategy: 'hybrid' (default, fast rules), 'intelligent' (LLM summarization), 'selective' (LLM-driven selection). */
|
|
26
|
+
strategy?: 'hybrid' | 'intelligent' | 'selective';
|
|
27
|
+
/** Enable LLM-driven selective compaction (default: false for backward compat). */
|
|
28
|
+
llmSelector?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface ToolsConfig {
|
|
31
|
+
defaultExecutionStrategy: 'parallel' | 'sequential' | 'smart';
|
|
32
|
+
maxIterations: number;
|
|
33
|
+
iterationTimeoutMs: number;
|
|
34
|
+
sessionTimeoutMs: number;
|
|
35
|
+
perIterationOutputCapBytes: number;
|
|
36
|
+
/**
|
|
37
|
+
* When true (default), the agent automatically extends its iteration
|
|
38
|
+
* limit by 100 when hit. Set to false to require user confirmation.
|
|
39
|
+
*/
|
|
40
|
+
autoExtendLimit?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface ProviderApiKey {
|
|
43
|
+
/** Short human-readable label (e.g. "personal", "work", "rate-limit-backup"). */
|
|
44
|
+
label: string;
|
|
45
|
+
/**
|
|
46
|
+
* The key itself. The field name contains `apiKey` so the secret-vault
|
|
47
|
+
* walker will encrypt it on write and decrypt it on read.
|
|
48
|
+
*/
|
|
49
|
+
apiKey: string;
|
|
50
|
+
/** ISO-8601 timestamp the key was added. */
|
|
51
|
+
createdAt: string;
|
|
52
|
+
}
|
|
53
|
+
interface ProviderConfig {
|
|
54
|
+
type: string;
|
|
55
|
+
/**
|
|
56
|
+
* Legacy single-key field. Still honored as a fallback when `apiKeys`
|
|
57
|
+
* is empty. When `apiKeys`/`activeKey` are present, the config loader
|
|
58
|
+
* mirrors the active entry into this field so downstream consumers
|
|
59
|
+
* (provider construction, wire adapters) need no changes.
|
|
60
|
+
*/
|
|
61
|
+
apiKey?: string;
|
|
62
|
+
/** Multiple keys for the same provider — pick one with `activeKey`. */
|
|
63
|
+
apiKeys?: ProviderApiKey[];
|
|
64
|
+
/** Label of the entry in `apiKeys` to use. Defaults to the first one. */
|
|
65
|
+
activeKey?: string;
|
|
66
|
+
baseUrl?: string;
|
|
67
|
+
headers?: Record<string, string>;
|
|
68
|
+
model?: string;
|
|
69
|
+
quirks?: Record<string, unknown>;
|
|
70
|
+
capabilities?: Record<string, unknown>;
|
|
71
|
+
/**
|
|
72
|
+
* Optional wire-family override. When present, the provider can be
|
|
73
|
+
* constructed without consulting the models.dev catalog — useful for
|
|
74
|
+
* self-hosted endpoints, internal proxies, or for working offline.
|
|
75
|
+
*/
|
|
76
|
+
family?: WireFamily;
|
|
77
|
+
/** Custom env var names to probe when `apiKey` is missing. */
|
|
78
|
+
envVars?: string[];
|
|
79
|
+
/** Optional list of models the user wants visible for this provider. */
|
|
80
|
+
models?: string[];
|
|
81
|
+
}
|
|
82
|
+
interface MCPServerConfig {
|
|
83
|
+
/** Human-readable description shown in `wstack mcp list`. */
|
|
84
|
+
description?: string;
|
|
85
|
+
name: string;
|
|
86
|
+
transport: 'stdio' | 'sse' | 'streamable-http';
|
|
87
|
+
command?: string;
|
|
88
|
+
args?: string[];
|
|
89
|
+
env?: Record<string, string>;
|
|
90
|
+
url?: string;
|
|
91
|
+
headers?: Record<string, string>;
|
|
92
|
+
enabled?: boolean;
|
|
93
|
+
allowedTools?: string[];
|
|
94
|
+
permission?: Permission;
|
|
95
|
+
startupTimeoutMs?: number;
|
|
96
|
+
}
|
|
97
|
+
interface LogConfig {
|
|
98
|
+
level: 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
99
|
+
file?: string;
|
|
100
|
+
}
|
|
101
|
+
interface PluginConfig {
|
|
102
|
+
name: string;
|
|
103
|
+
enabled?: boolean;
|
|
104
|
+
options?: Record<string, unknown>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Optional subsystems that the CLI can boot without. The core flow
|
|
108
|
+
* (provider + agent loop + bundled tools + session) always works; these
|
|
109
|
+
* just add capabilities. `--no-features` flips all of these off, which
|
|
110
|
+
* is the minimum viable WrongStack: a single provider, a fixed config,
|
|
111
|
+
* no network calls at startup.
|
|
112
|
+
*/
|
|
113
|
+
interface FeaturesConfig {
|
|
114
|
+
/** Load MCP servers declared in `mcpServers`. */
|
|
115
|
+
mcp: boolean;
|
|
116
|
+
/** Load + initialise npm plugins declared in `plugins`. */
|
|
117
|
+
plugins: boolean;
|
|
118
|
+
/** Register `remember` / `forget` tools backed by memory store. */
|
|
119
|
+
memory: boolean;
|
|
120
|
+
/** Fetch the models.dev catalog at startup. When false, the provider
|
|
121
|
+
* must declare its `family` explicitly in `providers[<id>]`. */
|
|
122
|
+
modelsRegistry: boolean;
|
|
123
|
+
/** Discover + load skills from disk. */
|
|
124
|
+
skills: boolean;
|
|
125
|
+
}
|
|
126
|
+
interface Config {
|
|
127
|
+
version: 1;
|
|
128
|
+
provider: string;
|
|
129
|
+
model: string;
|
|
130
|
+
apiKey?: string;
|
|
131
|
+
baseUrl?: string;
|
|
132
|
+
providers?: Record<string, ProviderConfig>;
|
|
133
|
+
context: ContextConfig;
|
|
134
|
+
tools: ToolsConfig;
|
|
135
|
+
mcpServers?: Record<string, MCPServerConfig>;
|
|
136
|
+
plugins?: (string | PluginConfig)[];
|
|
137
|
+
log: LogConfig;
|
|
138
|
+
features: FeaturesConfig;
|
|
139
|
+
yolo?: boolean;
|
|
140
|
+
cwd?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Per-plugin namespaced config sections. Each plugin reads its own
|
|
143
|
+
* subtree via `ConfigStore.getExtension(pluginName)`. Plugins should
|
|
144
|
+
* declare a `configSchema` so the loader validates this section
|
|
145
|
+
* automatically before `setup()` runs.
|
|
146
|
+
*
|
|
147
|
+
* Example:
|
|
148
|
+
* extensions: {
|
|
149
|
+
* 'wstack-auth': { tokenUrl: 'https://...', refreshBefore: 300 },
|
|
150
|
+
* 'wstack-metrics': { sink: 'prometheus', port: 9090 },
|
|
151
|
+
* }
|
|
152
|
+
*/
|
|
153
|
+
extensions?: Record<string, Record<string, unknown>>;
|
|
154
|
+
}
|
|
155
|
+
interface ConfigLoader {
|
|
156
|
+
load(opts?: {
|
|
157
|
+
cliFlags?: Partial<Config>;
|
|
158
|
+
cwd?: string;
|
|
159
|
+
}): Promise<Config>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Subscribable view over Config. Plugins and CLI subsystems use this instead
|
|
163
|
+
* of holding a frozen Config reference, so they can react to runtime updates
|
|
164
|
+
* (e.g. `/model` switching the active provider, secrets rotation, dynamic
|
|
165
|
+
* extension reload).
|
|
166
|
+
*
|
|
167
|
+
* The store enforces immutability — `get()` always returns a frozen object.
|
|
168
|
+
* Updates happen through `update(partial)`, which produces a new Config
|
|
169
|
+
* (structurally cloned, then frozen) and notifies watchers.
|
|
170
|
+
*/
|
|
171
|
+
interface ConfigStore {
|
|
172
|
+
get(): Readonly<Config>;
|
|
173
|
+
/**
|
|
174
|
+
* Get a typed top-level section. Convenience for consumers that only
|
|
175
|
+
* care about one slice (e.g. `tools` or `context`).
|
|
176
|
+
*/
|
|
177
|
+
getSection<K extends keyof Config>(key: K): Readonly<Config[K]>;
|
|
178
|
+
/**
|
|
179
|
+
* Return the extension namespace for `pluginName`, or an empty record
|
|
180
|
+
* when none is configured. The returned object is frozen.
|
|
181
|
+
*/
|
|
182
|
+
getExtension(pluginName: string): Readonly<Record<string, unknown>>;
|
|
183
|
+
/**
|
|
184
|
+
* Apply a partial update. Returns the new Config. Watchers are notified
|
|
185
|
+
* synchronously after the update completes. Throws if the result fails
|
|
186
|
+
* any registered invariants (currently: version must stay 1).
|
|
187
|
+
*/
|
|
188
|
+
update(partial: Partial<Config>): Readonly<Config>;
|
|
189
|
+
/** Subscribe to changes. Returns an unsubscribe function. */
|
|
190
|
+
watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export type { Config as C, FeaturesConfig as F, LogConfig as L, MCPServerConfig as M, PluginConfig as P, ToolsConfig as T, ConfigLoader as a, ConfigStore as b, ContextConfig as c, ProviderApiKey as d, ProviderConfig as e };
|