@kernel.chat/kbot 2.27.0 → 3.0.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.d.ts +15 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +187 -48
- package/dist/agent.js.map +1 -1
- package/dist/checkpoint.d.ts +79 -0
- package/dist/checkpoint.d.ts.map +1 -0
- package/dist/checkpoint.js +220 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/cli.js +55 -4
- package/dist/cli.js.map +1 -1
- package/dist/ide/bridge.d.ts +2 -0
- package/dist/ide/bridge.d.ts.map +1 -1
- package/dist/ide/bridge.js +1 -0
- package/dist/ide/bridge.js.map +1 -1
- package/dist/ide/mcp-server.d.ts.map +1 -1
- package/dist/ide/mcp-server.js +27 -7
- package/dist/ide/mcp-server.js.map +1 -1
- package/dist/learned-router.d.ts +9 -7
- package/dist/learned-router.d.ts.map +1 -1
- package/dist/learned-router.js +36 -10
- package/dist/learned-router.js.map +1 -1
- package/dist/learning.d.ts +4 -0
- package/dist/learning.d.ts.map +1 -1
- package/dist/learning.js +17 -0
- package/dist/learning.js.map +1 -1
- package/dist/multimodal.d.ts +6 -0
- package/dist/multimodal.d.ts.map +1 -1
- package/dist/multimodal.js +45 -0
- package/dist/multimodal.js.map +1 -1
- package/dist/sdk.d.ts +165 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +230 -0
- package/dist/sdk.js.map +1 -0
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +38 -0
- package/dist/serve.js.map +1 -1
- package/dist/skill-rating.d.ts +92 -0
- package/dist/skill-rating.d.ts.map +1 -0
- package/dist/skill-rating.js +352 -0
- package/dist/skill-rating.js.map +1 -0
- package/dist/streaming.d.ts +75 -1
- package/dist/streaming.d.ts.map +1 -1
- package/dist/streaming.js +211 -3
- package/dist/streaming.js.map +1 -1
- package/dist/task-ledger.d.ts +10 -0
- package/dist/task-ledger.d.ts.map +1 -1
- package/dist/task-ledger.js +28 -0
- package/dist/task-ledger.js.map +1 -1
- package/dist/telemetry.d.ts +52 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +219 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/terminal-caps.d.ts +20 -0
- package/dist/terminal-caps.d.ts.map +1 -0
- package/dist/terminal-caps.js +80 -0
- package/dist/terminal-caps.js.map +1 -0
- package/dist/tool-pipeline.d.ts +86 -0
- package/dist/tool-pipeline.d.ts.map +1 -0
- package/dist/tool-pipeline.js +200 -0
- package/dist/tool-pipeline.js.map +1 -0
- package/dist/tools/index.d.ts +45 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +168 -108
- package/dist/tools/index.js.map +1 -1
- package/dist/tui.d.ts +1 -0
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +71 -11
- package/dist/tui.js.map +1 -1
- package/dist/ui-adapter.d.ts +73 -0
- package/dist/ui-adapter.d.ts.map +1 -0
- package/dist/ui-adapter.js +139 -0
- package/dist/ui-adapter.js.map +1 -0
- package/dist/ui.d.ts +3 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +21 -2
- package/dist/ui.js.map +1 -1
- package/package.json +22 -3
package/dist/sdk.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { UIAdapter } from './ui-adapter.js';
|
|
2
|
+
export interface KBotConfig {
|
|
3
|
+
/** AI provider: 'anthropic' | 'openai' | 'ollama' | etc */
|
|
4
|
+
provider?: string;
|
|
5
|
+
/** Model name (e.g. 'claude-sonnet-4-20250514', 'gpt-4o', 'llama3.1') */
|
|
6
|
+
model?: string;
|
|
7
|
+
/** API key (or uses env vars / ~/.kbot/config.json) */
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
/** Custom endpoint URL */
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
/** Custom UI adapter (default: SilentUIAdapter for SDK usage) */
|
|
12
|
+
ui?: UIAdapter;
|
|
13
|
+
/** Tool permission mode */
|
|
14
|
+
permissionMode?: 'permissive' | 'normal' | 'strict';
|
|
15
|
+
}
|
|
16
|
+
export interface RunOptions {
|
|
17
|
+
/** Specialist agent ID (e.g. 'coder', 'researcher', 'writer') */
|
|
18
|
+
agent?: string;
|
|
19
|
+
/** Enable streaming output */
|
|
20
|
+
stream?: boolean;
|
|
21
|
+
/** Max tool loop iterations */
|
|
22
|
+
maxIterations?: number;
|
|
23
|
+
/** Whitelist of tool names to make available */
|
|
24
|
+
tools?: string[];
|
|
25
|
+
/** Override system prompt */
|
|
26
|
+
systemPrompt?: string;
|
|
27
|
+
/** Previous messages for context */
|
|
28
|
+
context?: any[];
|
|
29
|
+
/** AbortSignal for cancellation */
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
/** Enable extended thinking */
|
|
32
|
+
thinking?: boolean;
|
|
33
|
+
/** Thinking budget in tokens */
|
|
34
|
+
thinkingBudget?: number;
|
|
35
|
+
/** Tier for tool gating */
|
|
36
|
+
tier?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface RunResult {
|
|
39
|
+
/** Final text content from the agent */
|
|
40
|
+
content: string;
|
|
41
|
+
/** Tool calls made during execution */
|
|
42
|
+
toolCalls: Array<{
|
|
43
|
+
name: string;
|
|
44
|
+
args: any;
|
|
45
|
+
result?: string;
|
|
46
|
+
error?: string;
|
|
47
|
+
durationMs?: number;
|
|
48
|
+
}>;
|
|
49
|
+
/** Agent that handled the request */
|
|
50
|
+
agent: string;
|
|
51
|
+
/** Model used */
|
|
52
|
+
model: string;
|
|
53
|
+
/** Token usage */
|
|
54
|
+
usage: {
|
|
55
|
+
inputTokens: number;
|
|
56
|
+
outputTokens: number;
|
|
57
|
+
};
|
|
58
|
+
/** Total execution time in ms */
|
|
59
|
+
durationMs: number;
|
|
60
|
+
}
|
|
61
|
+
export type StreamEvent = {
|
|
62
|
+
type: 'thinking_start';
|
|
63
|
+
} | {
|
|
64
|
+
type: 'thinking_delta';
|
|
65
|
+
text: string;
|
|
66
|
+
} | {
|
|
67
|
+
type: 'thinking_end';
|
|
68
|
+
} | {
|
|
69
|
+
type: 'content_delta';
|
|
70
|
+
text: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'content_end';
|
|
73
|
+
} | {
|
|
74
|
+
type: 'tool_call_start';
|
|
75
|
+
name: string;
|
|
76
|
+
args: any;
|
|
77
|
+
} | {
|
|
78
|
+
type: 'tool_call_end';
|
|
79
|
+
name: string;
|
|
80
|
+
result: string;
|
|
81
|
+
error?: string;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'agent_route';
|
|
84
|
+
agentId: string;
|
|
85
|
+
method: string;
|
|
86
|
+
confidence: number;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'usage';
|
|
89
|
+
inputTokens: number;
|
|
90
|
+
outputTokens: number;
|
|
91
|
+
} | {
|
|
92
|
+
type: 'done';
|
|
93
|
+
content: string;
|
|
94
|
+
};
|
|
95
|
+
export declare const agent: {
|
|
96
|
+
/**
|
|
97
|
+
* Run the agent with a message and get a structured result.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const result = await agent.run('fix the bug in login.ts')
|
|
101
|
+
* console.log(result.content)
|
|
102
|
+
*/
|
|
103
|
+
run(message: string, options?: RunOptions & KBotConfig): Promise<RunResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Stream agent events as an async generator.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* for await (const event of agent.stream('explain this code')) {
|
|
109
|
+
* if (event.type === 'content_delta') process.stdout.write(event.text)
|
|
110
|
+
* }
|
|
111
|
+
*/
|
|
112
|
+
stream(message: string, options?: RunOptions & KBotConfig): AsyncGenerator<StreamEvent>;
|
|
113
|
+
};
|
|
114
|
+
export declare const tools: {
|
|
115
|
+
/**
|
|
116
|
+
* List all registered tools with their descriptions and parameters.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* const allTools = tools.list()
|
|
120
|
+
* console.log(allTools.map(t => t.name))
|
|
121
|
+
*/
|
|
122
|
+
list(): Array<{
|
|
123
|
+
name: string;
|
|
124
|
+
description: string;
|
|
125
|
+
parameters: any;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Execute a single tool by name.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* const result = await tools.execute('read_file', { path: 'README.md' })
|
|
132
|
+
* console.log(result.result)
|
|
133
|
+
*/
|
|
134
|
+
execute(name: string, args: Record<string, any>): Promise<{
|
|
135
|
+
result: string;
|
|
136
|
+
error?: string;
|
|
137
|
+
durationMs: number;
|
|
138
|
+
}>;
|
|
139
|
+
/**
|
|
140
|
+
* Get a single tool definition by name.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* const readFile = tools.get('read_file')
|
|
144
|
+
* if (readFile) console.log(readFile.description)
|
|
145
|
+
*/
|
|
146
|
+
get(name: string): import("./tools/index.js").ToolDefinition | undefined;
|
|
147
|
+
};
|
|
148
|
+
export declare const providers: {
|
|
149
|
+
/**
|
|
150
|
+
* Auto-detect available providers based on environment variables and config.
|
|
151
|
+
*/
|
|
152
|
+
detect(): Promise<Array<{
|
|
153
|
+
name: string;
|
|
154
|
+
models: string[];
|
|
155
|
+
}>>;
|
|
156
|
+
/**
|
|
157
|
+
* List all supported provider names.
|
|
158
|
+
*/
|
|
159
|
+
list(): Promise<string[]>;
|
|
160
|
+
};
|
|
161
|
+
export type { UIAdapter };
|
|
162
|
+
export { SilentUIAdapter, CallbackUIAdapter, TerminalUIAdapter } from './ui-adapter.js';
|
|
163
|
+
export { ResponseStream } from './streaming.js';
|
|
164
|
+
export type { ResponseStreamEvent, ResponseStreamListener } from './streaming.js';
|
|
165
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAA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OAOG;oBAEQ,MAAM,YACL,UAAU,GAAG,UAAU,GAChC,cAAc,CAAC,WAAW,CAAC;CA0F/B,CAAA;AAID,eAAO,MAAM,KAAK;IAChB;;;;;;OAMG;YACK,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,GAAG,CAAA;KAAE,CAAC;IAQrE;;;;;;OAMG;kBAEK,MAAM,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAYlE;;;;;;OAMG;cACO,MAAM;CAGjB,CAAA;AAID,eAAO,MAAM,SAAS;IACpB;;OAEG;cACa,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAWlE;;OAEG;YACW,OAAO,CAAC,MAAM,EAAE,CAAC;CAIhC,CAAA;AAID,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/sdk.js
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// K:BOT Programmatic SDK
|
|
2
|
+
// Clean public API for using K:BOT as a library.
|
|
3
|
+
//
|
|
4
|
+
// Usage:
|
|
5
|
+
// import { agent, tools } from '@kernel.chat/kbot'
|
|
6
|
+
//
|
|
7
|
+
// const result = await agent.run('fix the bug in login.ts')
|
|
8
|
+
// console.log(result.content)
|
|
9
|
+
// console.log(result.toolCalls)
|
|
10
|
+
//
|
|
11
|
+
// const allTools = tools.list()
|
|
12
|
+
// const execResult = await tools.execute('read_file', { path: 'README.md' })
|
|
13
|
+
//
|
|
14
|
+
// for await (const event of agent.stream('explain this code')) {
|
|
15
|
+
// if (event.type === 'content_delta') process.stdout.write(event.text)
|
|
16
|
+
// }
|
|
17
|
+
import { runAgent } from './agent.js';
|
|
18
|
+
import { registerAllTools, getAllTools, executeTool, getTool, } from './tools/index.js';
|
|
19
|
+
import { SilentUIAdapter, CallbackUIAdapter } from './ui-adapter.js';
|
|
20
|
+
// ── Initialization guard ──
|
|
21
|
+
let initialized = false;
|
|
22
|
+
async function ensureInitialized() {
|
|
23
|
+
if (initialized)
|
|
24
|
+
return;
|
|
25
|
+
await registerAllTools();
|
|
26
|
+
initialized = true;
|
|
27
|
+
}
|
|
28
|
+
// ── Agent API ──
|
|
29
|
+
export const agent = {
|
|
30
|
+
/**
|
|
31
|
+
* Run the agent with a message and get a structured result.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const result = await agent.run('fix the bug in login.ts')
|
|
35
|
+
* console.log(result.content)
|
|
36
|
+
*/
|
|
37
|
+
async run(message, options) {
|
|
38
|
+
await ensureInitialized();
|
|
39
|
+
const ui = options?.ui ?? new SilentUIAdapter();
|
|
40
|
+
const start = Date.now();
|
|
41
|
+
const agentOpts = {
|
|
42
|
+
agent: options?.agent,
|
|
43
|
+
model: options?.model,
|
|
44
|
+
stream: options?.stream ?? false,
|
|
45
|
+
thinking: options?.thinking,
|
|
46
|
+
thinkingBudget: options?.thinkingBudget,
|
|
47
|
+
tier: options?.tier ?? 'free',
|
|
48
|
+
ui,
|
|
49
|
+
};
|
|
50
|
+
const result = await runAgent(message, agentOpts);
|
|
51
|
+
const durationMs = Date.now() - start;
|
|
52
|
+
return {
|
|
53
|
+
content: result.content ?? (ui instanceof SilentUIAdapter ? ui.content : ''),
|
|
54
|
+
toolCalls: ui instanceof SilentUIAdapter ? ui.toolCalls : [],
|
|
55
|
+
agent: result.agent ?? options?.agent ?? 'kernel',
|
|
56
|
+
model: result.model ?? options?.model ?? '',
|
|
57
|
+
usage: {
|
|
58
|
+
inputTokens: result.usage?.input_tokens ?? 0,
|
|
59
|
+
outputTokens: result.usage?.output_tokens ?? 0,
|
|
60
|
+
},
|
|
61
|
+
durationMs,
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Stream agent events as an async generator.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* for await (const event of agent.stream('explain this code')) {
|
|
69
|
+
* if (event.type === 'content_delta') process.stdout.write(event.text)
|
|
70
|
+
* }
|
|
71
|
+
*/
|
|
72
|
+
async *stream(message, options) {
|
|
73
|
+
await ensureInitialized();
|
|
74
|
+
// Channel for pushing events from the callback adapter
|
|
75
|
+
const queue = [];
|
|
76
|
+
let resolve = null;
|
|
77
|
+
let done = false;
|
|
78
|
+
function push(event) {
|
|
79
|
+
queue.push(event);
|
|
80
|
+
if (resolve) {
|
|
81
|
+
const r = resolve;
|
|
82
|
+
resolve = null;
|
|
83
|
+
r();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const ui = new CallbackUIAdapter({
|
|
87
|
+
onToolCallStart(name, args) {
|
|
88
|
+
push({ type: 'tool_call_start', name, args });
|
|
89
|
+
},
|
|
90
|
+
onToolCallEnd(name, result, error) {
|
|
91
|
+
push({ type: 'tool_call_end', name, result, error });
|
|
92
|
+
},
|
|
93
|
+
onThinking(text) {
|
|
94
|
+
push({ type: 'thinking_delta', text });
|
|
95
|
+
},
|
|
96
|
+
onContent(text) {
|
|
97
|
+
push({ type: 'content_delta', text });
|
|
98
|
+
},
|
|
99
|
+
onContentEnd() {
|
|
100
|
+
push({ type: 'content_end' });
|
|
101
|
+
},
|
|
102
|
+
onAgentRoute(agentId, method, confidence) {
|
|
103
|
+
push({ type: 'agent_route', agentId, method, confidence });
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
// Run the agent in the background, pushing events via callbacks
|
|
107
|
+
const agentOpts = {
|
|
108
|
+
agent: options?.agent,
|
|
109
|
+
model: options?.model,
|
|
110
|
+
stream: true,
|
|
111
|
+
thinking: options?.thinking,
|
|
112
|
+
thinkingBudget: options?.thinkingBudget,
|
|
113
|
+
tier: options?.tier ?? 'free',
|
|
114
|
+
ui,
|
|
115
|
+
};
|
|
116
|
+
const agentPromise = runAgent(message, agentOpts).then(result => {
|
|
117
|
+
push({
|
|
118
|
+
type: 'usage',
|
|
119
|
+
inputTokens: result.usage?.input_tokens ?? 0,
|
|
120
|
+
outputTokens: result.usage?.output_tokens ?? 0,
|
|
121
|
+
});
|
|
122
|
+
push({ type: 'done', content: result.content });
|
|
123
|
+
done = true;
|
|
124
|
+
queue.push(null); // sentinel
|
|
125
|
+
if (resolve) {
|
|
126
|
+
const r = resolve;
|
|
127
|
+
resolve = null;
|
|
128
|
+
r();
|
|
129
|
+
}
|
|
130
|
+
}).catch(err => {
|
|
131
|
+
done = true;
|
|
132
|
+
queue.push(null);
|
|
133
|
+
if (resolve) {
|
|
134
|
+
const r = resolve;
|
|
135
|
+
resolve = null;
|
|
136
|
+
r();
|
|
137
|
+
}
|
|
138
|
+
throw err;
|
|
139
|
+
});
|
|
140
|
+
// Yield events as they arrive
|
|
141
|
+
while (true) {
|
|
142
|
+
if (queue.length > 0) {
|
|
143
|
+
const event = queue.shift();
|
|
144
|
+
if (event === null)
|
|
145
|
+
break; // sentinel — agent finished
|
|
146
|
+
yield event;
|
|
147
|
+
}
|
|
148
|
+
else if (done) {
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
await new Promise(r => { resolve = r; });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Ensure the agent promise is settled (propagates errors)
|
|
156
|
+
await agentPromise;
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
// ── Tools API ──
|
|
160
|
+
export const tools = {
|
|
161
|
+
/**
|
|
162
|
+
* List all registered tools with their descriptions and parameters.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* const allTools = tools.list()
|
|
166
|
+
* console.log(allTools.map(t => t.name))
|
|
167
|
+
*/
|
|
168
|
+
list() {
|
|
169
|
+
return getAllTools().map(t => ({
|
|
170
|
+
name: t.name,
|
|
171
|
+
description: t.description,
|
|
172
|
+
parameters: t.parameters,
|
|
173
|
+
}));
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* Execute a single tool by name.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* const result = await tools.execute('read_file', { path: 'README.md' })
|
|
180
|
+
* console.log(result.result)
|
|
181
|
+
*/
|
|
182
|
+
async execute(name, args) {
|
|
183
|
+
await ensureInitialized();
|
|
184
|
+
const start = Date.now();
|
|
185
|
+
const call = { id: name, name, arguments: args };
|
|
186
|
+
const toolResult = await executeTool(call);
|
|
187
|
+
return {
|
|
188
|
+
result: toolResult.result,
|
|
189
|
+
error: toolResult.error ? toolResult.result : undefined,
|
|
190
|
+
durationMs: Date.now() - start,
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
/**
|
|
194
|
+
* Get a single tool definition by name.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* const readFile = tools.get('read_file')
|
|
198
|
+
* if (readFile) console.log(readFile.description)
|
|
199
|
+
*/
|
|
200
|
+
get(name) {
|
|
201
|
+
return getTool(name);
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
// ── Providers API ──
|
|
205
|
+
export const providers = {
|
|
206
|
+
/**
|
|
207
|
+
* Auto-detect available providers based on environment variables and config.
|
|
208
|
+
*/
|
|
209
|
+
async detect() {
|
|
210
|
+
const { getProvider, getByokProvider } = await import('./auth.js');
|
|
211
|
+
const current = getByokProvider();
|
|
212
|
+
if (!current)
|
|
213
|
+
return [];
|
|
214
|
+
const p = getProvider(current);
|
|
215
|
+
return [{
|
|
216
|
+
name: p.name,
|
|
217
|
+
models: p.models || [],
|
|
218
|
+
}];
|
|
219
|
+
},
|
|
220
|
+
/**
|
|
221
|
+
* List all supported provider names.
|
|
222
|
+
*/
|
|
223
|
+
async list() {
|
|
224
|
+
const { PROVIDERS } = await import('./auth.js');
|
|
225
|
+
return Object.keys(PROVIDERS);
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
export { SilentUIAdapter, CallbackUIAdapter, TerminalUIAdapter } from './ui-adapter.js';
|
|
229
|
+
export { ResponseStream } from './streaming.js';
|
|
230
|
+
//# sourceMappingURL=sdk.js.map
|
package/dist/sdk.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,iDAAiD;AACjD,EAAE;AACF,SAAS;AACT,qDAAqD;AACrD,EAAE;AACF,8DAA8D;AAC9D,gCAAgC;AAChC,kCAAkC;AAClC,EAAE;AACF,kCAAkC;AAClC,+EAA+E;AAC/E,EAAE;AACF,mEAAmE;AACnE,2EAA2E;AAC3E,MAAM;AAEN,OAAO,EAAE,QAAQ,EAAqB,MAAM,YAAY,CAAA;AACxD,OAAO,EACL,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,GAEpD,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AA8EpE,6BAA6B;AAE7B,IAAI,WAAW,GAAG,KAAK,CAAA;AAEvB,KAAK,UAAU,iBAAiB;IAC9B,IAAI,WAAW;QAAE,OAAM;IACvB,MAAM,gBAAgB,EAAE,CAAA;IACxB,WAAW,GAAG,IAAI,CAAA;AACpB,CAAC;AAED,kBAAkB;AAElB,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,CACP,OAAe,EACf,OAAiC;QAEjC,MAAM,iBAAiB,EAAE,CAAA;QACzB,MAAM,E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;;;OAMG;IACH,GAAG,CAAC,IAAY;QACd,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;CACF,CAAA;AAED,sBAAsB;AAEtB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAA;QAClE,MAAM,OAAO,GAAG,eAAe,EAAE,CAAA;QACjC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAA;QACvB,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;QAC9B,OAAO,CAAC;gBACN,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;aACvB,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAA;QAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAKD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/serve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAyBA,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAuBD,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmLrE"}
|
package/dist/serve.js
CHANGED
|
@@ -10,11 +10,14 @@
|
|
|
10
10
|
// GET /tools — List all registered tools (schemas only)
|
|
11
11
|
// POST /tools/:name — Execute a tool by name
|
|
12
12
|
// POST /execute — Execute a tool { name, args }
|
|
13
|
+
// POST /stream — SSE streaming agent execution
|
|
13
14
|
// GET /metrics — Tool execution metrics
|
|
14
15
|
import { createServer } from 'node:http';
|
|
15
16
|
import { createRequire } from 'node:module';
|
|
16
17
|
import { registerAllTools, getAllTools, executeTool, getToolDefinitionsForApi, getToolMetrics } from './tools/index.js';
|
|
17
18
|
import { printInfo, printSuccess } from './ui.js';
|
|
19
|
+
import { ResponseStream } from './streaming.js';
|
|
20
|
+
import { runAgent } from './agent.js';
|
|
18
21
|
const __require = createRequire(import.meta.url);
|
|
19
22
|
const VERSION = __require('../package.json').version;
|
|
20
23
|
function cors(res) {
|
|
@@ -84,6 +87,40 @@ export async function startServe(options) {
|
|
|
84
87
|
json(res, 200, { metrics: getToolMetrics() });
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
90
|
+
// POST /stream — SSE streaming agent execution
|
|
91
|
+
if (path === '/stream' && req.method === 'POST') {
|
|
92
|
+
const body = JSON.parse(await readBody(req));
|
|
93
|
+
const { message, agent, model, thinking } = body;
|
|
94
|
+
if (!message) {
|
|
95
|
+
json(res, 400, { error: 'Missing "message" field' });
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
cors(res);
|
|
99
|
+
res.writeHead(200, {
|
|
100
|
+
'Content-Type': 'text/event-stream',
|
|
101
|
+
'Cache-Control': 'no-cache',
|
|
102
|
+
'Connection': 'keep-alive',
|
|
103
|
+
});
|
|
104
|
+
const stream = new ResponseStream();
|
|
105
|
+
stream.on(ResponseStream.createSSEListener(res));
|
|
106
|
+
try {
|
|
107
|
+
await runAgent(message, {
|
|
108
|
+
responseStream: stream,
|
|
109
|
+
stream: true,
|
|
110
|
+
agent,
|
|
111
|
+
model,
|
|
112
|
+
thinking,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
stream.emit({
|
|
117
|
+
type: 'error',
|
|
118
|
+
message: err instanceof Error ? err.message : String(err),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
res.end();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
87
124
|
// POST /execute — execute a tool
|
|
88
125
|
if (path === '/execute' && req.method === 'POST') {
|
|
89
126
|
const body = JSON.parse(await readBody(req));
|
|
@@ -139,6 +176,7 @@ export async function startServe(options) {
|
|
|
139
176
|
printInfo(` GET /health — Health check`);
|
|
140
177
|
printInfo(` GET /tools — List ${tools.length} tools`);
|
|
141
178
|
printInfo(` POST /execute — Execute a tool`);
|
|
179
|
+
printInfo(` POST /stream — SSE streaming agent`);
|
|
142
180
|
printInfo(` POST /tools/:name — Execute by name`);
|
|
143
181
|
printInfo(` GET /metrics — Execution metrics`);
|
|
144
182
|
if (options.token) {
|
package/dist/serve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,SAAS;AACT,+DAA+D;AAC/D,gDAAgD;AAChD,uDAAuD;AACvD,EAAE;AACF,aAAa;AACb,yCAAyC;AACzC,qEAAqE;AACrE,mDAAmD;AACnD,0DAA0D;AAC1D,mDAAmD;AAEnD,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACvH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAc,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve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YAAY,CAAC,2CAA2C,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;QACvE,SAAS,CAAC,qCAAqC,CAAC,CAAA;QAChD,SAAS,CAAC,+BAA+B,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAA;QAC9D,SAAS,CAAC,uCAAuC,CAAC,CAAA;QAClD,SAAS,CAAC,4CAA4C,CAAC,CAAA;QACvD,SAAS,CAAC,wCAAwC,CAAC,CAAA;QACnD,SAAS,CAAC,0CAA0C,CAAC,CAAA;QACrD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,SAAS,CAAC,+BAA+B,CAAC,CAAA;QAC5C,CAAC;QACD,SAAS,CAAC,EAAE,CAAC,CAAA;QACb,SAAS,CAAC,2BAA2B,CAAC,CAAA;QACtC,SAAS,CAAC,mCAAmC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,oBAAoB;IACpB,MAAM,QAAQ,GAAG,GAAG,EAAE;QACpB,SAAS,CAAC,gCAAgC,CAAC,CAAA;QAC3C,MAAM,CAAC,KAAK,EAAE,CAAA;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAA;IACD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC9B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAE/B,qBAAqB;IACrB,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export interface Rating {
|
|
2
|
+
/** Mean skill estimate */
|
|
3
|
+
mu: number;
|
|
4
|
+
/** Uncertainty (standard deviation) */
|
|
5
|
+
sigma: number;
|
|
6
|
+
}
|
|
7
|
+
export interface AgentCategoryRatings {
|
|
8
|
+
[category: string]: Rating;
|
|
9
|
+
/** Overall rating across all categories */
|
|
10
|
+
_overall: Rating;
|
|
11
|
+
}
|
|
12
|
+
export interface AgentRatings {
|
|
13
|
+
[agentId: string]: AgentCategoryRatings;
|
|
14
|
+
}
|
|
15
|
+
export type TaskCategory = 'coding' | 'debugging' | 'refactoring' | 'research' | 'analysis' | 'writing' | 'devops' | 'security' | 'design' | 'general' | 'data' | 'communication';
|
|
16
|
+
export type Outcome = 'win' | 'loss' | 'draw';
|
|
17
|
+
export declare class SkillRatingSystem {
|
|
18
|
+
private ratings;
|
|
19
|
+
private dirty;
|
|
20
|
+
constructor();
|
|
21
|
+
private loadSync;
|
|
22
|
+
save(): Promise<void>;
|
|
23
|
+
load(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Classify a message into a task category using keyword matching.
|
|
26
|
+
* Fast, no LLM call needed.
|
|
27
|
+
*/
|
|
28
|
+
categorizeMessage(message: string): TaskCategory;
|
|
29
|
+
/**
|
|
30
|
+
* Get a rating for a specific agent and category.
|
|
31
|
+
* Returns the category-specific rating if it exists, otherwise the overall rating.
|
|
32
|
+
*/
|
|
33
|
+
private getRating;
|
|
34
|
+
/**
|
|
35
|
+
* Conservative rating estimate: mu - 2*sigma
|
|
36
|
+
* This is the lower bound of the ~95% confidence interval.
|
|
37
|
+
* Agents need to both be good AND have enough data to rank highly.
|
|
38
|
+
*/
|
|
39
|
+
private conservativeEstimate;
|
|
40
|
+
/**
|
|
41
|
+
* Get agents ranked by conservative estimate for a given category.
|
|
42
|
+
*/
|
|
43
|
+
getRankedAgents(category: TaskCategory): Array<{
|
|
44
|
+
agent: string;
|
|
45
|
+
rating: Rating;
|
|
46
|
+
confidence: number;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Update an agent's rating based on an outcome.
|
|
50
|
+
*
|
|
51
|
+
* Uses a simplified Bradley-Terry model:
|
|
52
|
+
* beta = sigma / 2 (dynamics factor)
|
|
53
|
+
* c = sqrt(2 * beta^2 + sigma^2) (normalization factor)
|
|
54
|
+
* K = sigma^2 / c (update magnitude — bigger when uncertain)
|
|
55
|
+
* mu_new = mu + K * outcome_factor
|
|
56
|
+
* sigma_new = sigma * sqrt(max(1 - sigma^2/c^2, epsilon))
|
|
57
|
+
*
|
|
58
|
+
* outcome_factor: win = +1, loss = -1, draw = 0
|
|
59
|
+
*/
|
|
60
|
+
recordOutcome(agent: string, category: TaskCategory, outcome: Outcome): void;
|
|
61
|
+
/**
|
|
62
|
+
* Core Bradley-Terry update step.
|
|
63
|
+
* @param rating The rating to mutate in place
|
|
64
|
+
* @param outcome The match outcome
|
|
65
|
+
* @param dampen Dampen the update (0-1), 1 = full update
|
|
66
|
+
*/
|
|
67
|
+
private updateRating;
|
|
68
|
+
/**
|
|
69
|
+
* Get the best agent for a task based on Bayesian skill ratings.
|
|
70
|
+
*
|
|
71
|
+
* Returns null if all agents still have high uncertainty (not enough data).
|
|
72
|
+
* The confidence threshold ensures we only route when we have meaningful signal.
|
|
73
|
+
*/
|
|
74
|
+
getAgentForTask(message: string): {
|
|
75
|
+
agent: string;
|
|
76
|
+
confidence: number;
|
|
77
|
+
category: TaskCategory;
|
|
78
|
+
} | null;
|
|
79
|
+
/**
|
|
80
|
+
* Get summary stats for each agent: their top category and confidence level.
|
|
81
|
+
*/
|
|
82
|
+
getStats(): Record<string, {
|
|
83
|
+
topCategory: string;
|
|
84
|
+
confidence: number;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Get raw ratings for an agent (for debugging/display).
|
|
88
|
+
*/
|
|
89
|
+
getAgentRatings(agent: string): AgentCategoryRatings | null;
|
|
90
|
+
}
|
|
91
|
+
export declare function getSkillRatingSystem(): SkillRatingSystem;
|
|
92
|
+
//# sourceMappingURL=skill-rating.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-rating.d.ts","sourceRoot":"","sources":["../src/skill-rating.ts"],"names":[],"mappings":"AAiCA,MAAM,WAAW,MAAM;IACrB,0BAA0B;IAC1B,EAAE,EAAE,MAAM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