@kodax-ai/kodax 0.7.42 → 0.7.44
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/CHANGELOG.md +65 -6
- package/README.md +87 -56
- package/README_CN.md +46 -25
- package/dist/chunks/chunk-35BDEEC5.js +2 -0
- package/dist/chunks/chunk-4YPL2UVZ.js +848 -0
- package/dist/chunks/chunk-DI2G3YWL.js +31 -0
- package/dist/chunks/chunk-HHQ7YTGM.js +425 -0
- package/dist/chunks/chunk-QHILHQBB.js +519 -0
- package/dist/chunks/{chunk-IYJ5EPRV.js → chunk-RUDYNAK7.js} +1 -1
- package/dist/chunks/compaction-config-NAPRF7XR.js +2 -0
- package/dist/chunks/{construction-bootstrap-J2WOCYEK.js → construction-bootstrap-PHTGBRNU.js} +4 -4
- package/dist/chunks/dist-CCYBJJZY.js +2 -0
- package/dist/chunks/dist-RHIHZAYX.js +2 -0
- package/dist/chunks/utils-TV3UYCHQ.js +2 -0
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +1159 -1102
- package/dist/provider-capabilities.json +167 -0
- package/dist/sdk-agent.d.ts +905 -48
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +995 -755
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +5 -3
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +10 -9
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +23 -11
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{cost-tracker.d-B6vMoLLF.d.ts → base.d-FUJahC0i.d.ts} +2 -110
- package/dist/types-chunks/{bash-prefix-extractor.d-CkhaqKkg.d.ts → bash-prefix-extractor.d-DdoSeghD.d.ts} +442 -131
- package/dist/types-chunks/cost-tracker.d-wRtyEW9d.d.ts +110 -0
- package/dist/types-chunks/file-tracker.d-DOfaoCbJ.d.ts +633 -0
- package/dist/types-chunks/manager.d-87belpiS.d.ts +370 -0
- package/dist/types-chunks/{resolver.d-DX9au4NJ.d.ts → resolver.d-B7ZnVuuf.d.ts} +157 -10
- package/dist/types-chunks/{session-storage.d-Cci897iM.d.ts → storage.d-DFD9ln5c.d.ts} +49 -2
- package/dist/types-chunks/{history-cleanup.d-DznrzEiU.d.ts → types.d-DM8zEJgF.d.ts} +1084 -282
- package/dist/types-chunks/{types.d-mM8vqvhT.d.ts → types.d-HBbWT-iA.d.ts} +41 -3
- package/dist/types-chunks/{storage.d-Bc5DoAwp.d.ts → utils.d-C5fzCE9W.d.ts} +25 -47
- package/package.json +7 -6
- package/dist/chunks/chunk-3RKBXWZS.js +0 -2
- package/dist/chunks/chunk-7JLYVWAF.js +0 -1033
- package/dist/chunks/chunk-CD3R5YBH.js +0 -16
- package/dist/chunks/chunk-DKXUY5F2.js +0 -209
- package/dist/chunks/chunk-HMYEQJGT.js +0 -31
- package/dist/chunks/chunk-KUX5LRPP.js +0 -2
- package/dist/chunks/chunk-OWSKU55I.js +0 -13
- package/dist/chunks/chunk-ZZ4KRK2B.js +0 -465
- package/dist/chunks/compaction-config-FIFFP4FT.js +0 -2
- package/dist/chunks/dist-2ZHWDXMQ.js +0 -2
- package/dist/chunks/dist-W4CJWLIH.js +0 -2
- package/dist/chunks/utils-A5MWDTWZ.js +0 -2
- package/dist/types-chunks/instance-discovery.d-BsKnIwpg.d.ts +0 -990
- package/dist/types-chunks/transport.d-DuyjG30t.d.ts +0 -180
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { a as McpServerConfig, b as McpServersConfig } from './config.d-BfJUXxC0.js';
|
|
2
|
-
import { a as CapabilityProvider, C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
|
|
3
|
-
|
|
4
|
-
type McpCapabilityKind = 'tool' | 'resource' | 'prompt';
|
|
5
|
-
type McpCapabilityRisk = 'read' | 'write' | 'network' | 'exec';
|
|
6
|
-
interface McpCatalogItem {
|
|
7
|
-
id: string;
|
|
8
|
-
serverId: string;
|
|
9
|
-
kind: McpCapabilityKind;
|
|
10
|
-
name: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
summary: string;
|
|
13
|
-
tags?: string[];
|
|
14
|
-
risk?: McpCapabilityRisk;
|
|
15
|
-
annotations?: Record<string, unknown>;
|
|
16
|
-
cachedAt: string;
|
|
17
|
-
}
|
|
18
|
-
interface McpCapabilityDescriptor extends McpCatalogItem {
|
|
19
|
-
inputSchema?: unknown;
|
|
20
|
-
outputSchema?: unknown;
|
|
21
|
-
promptArgsSchema?: unknown;
|
|
22
|
-
uri?: string;
|
|
23
|
-
mimeType?: string;
|
|
24
|
-
}
|
|
25
|
-
interface McpServerCatalogSnapshot {
|
|
26
|
-
serverId: string;
|
|
27
|
-
items: McpCatalogItem[];
|
|
28
|
-
descriptors: McpCapabilityDescriptor[];
|
|
29
|
-
updatedAt: string;
|
|
30
|
-
}
|
|
31
|
-
interface McpCatalogSearchOptions {
|
|
32
|
-
kind?: McpCapabilityKind;
|
|
33
|
-
limit?: number;
|
|
34
|
-
}
|
|
35
|
-
declare function defaultMcpCacheDir(): string;
|
|
36
|
-
declare function createMcpCapabilityId(serverId: string, kind: McpCapabilityKind, name: string): string;
|
|
37
|
-
declare function parseMcpCapabilityId(id: string): {
|
|
38
|
-
serverId: string;
|
|
39
|
-
kind: McpCapabilityKind;
|
|
40
|
-
name: string;
|
|
41
|
-
};
|
|
42
|
-
declare function searchMcpCatalog(items: readonly McpCatalogItem[], query: string, options?: McpCatalogSearchOptions): McpCatalogItem[];
|
|
43
|
-
declare function getMcpCachePaths(cacheDir: string, serverId: string): {
|
|
44
|
-
catalogDir: string;
|
|
45
|
-
indexPath: string;
|
|
46
|
-
itemsPath: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
interface McpServerRuntimeDiagnostics {
|
|
50
|
-
serverId: string;
|
|
51
|
-
connect: 'lazy' | 'prewarm' | 'disabled';
|
|
52
|
-
status: 'idle' | 'connecting' | 'ready' | 'error' | 'disabled';
|
|
53
|
-
dirty: boolean;
|
|
54
|
-
lastError?: string;
|
|
55
|
-
cachedAt?: string;
|
|
56
|
-
tools: number;
|
|
57
|
-
resources: number;
|
|
58
|
-
prompts: number;
|
|
59
|
-
}
|
|
60
|
-
declare class McpServerRuntime {
|
|
61
|
-
private readonly serverId;
|
|
62
|
-
private readonly config;
|
|
63
|
-
private readonly cacheDir;
|
|
64
|
-
private transport?;
|
|
65
|
-
private readonly pending;
|
|
66
|
-
private nextRequestId;
|
|
67
|
-
private initialized;
|
|
68
|
-
private connectPromise?;
|
|
69
|
-
private catalog?;
|
|
70
|
-
private diagnostics;
|
|
71
|
-
constructor(serverId: string, config: McpServerConfig, cacheDir: string);
|
|
72
|
-
getDiagnostics(): McpServerRuntimeDiagnostics;
|
|
73
|
-
prewarmIfNeeded(): Promise<void>;
|
|
74
|
-
/** Load catalog from memory or disk only — never triggers a lazy connection. */
|
|
75
|
-
getCachedCatalog(): Promise<McpServerCatalogSnapshot | undefined>;
|
|
76
|
-
getCatalog(forceRefresh?: boolean): Promise<McpServerCatalogSnapshot>;
|
|
77
|
-
describeCapability(capabilityId: string): Promise<McpCapabilityDescriptor | undefined>;
|
|
78
|
-
callTool(name: string, args: Record<string, unknown>): Promise<{
|
|
79
|
-
content?: string;
|
|
80
|
-
structuredContent?: unknown;
|
|
81
|
-
metadata?: Record<string, unknown>;
|
|
82
|
-
}>;
|
|
83
|
-
readResource(name: string, options: Record<string, unknown>): Promise<{
|
|
84
|
-
content?: string;
|
|
85
|
-
structuredContent?: unknown;
|
|
86
|
-
metadata?: Record<string, unknown>;
|
|
87
|
-
}>;
|
|
88
|
-
getPrompt(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
89
|
-
refreshCatalog(forceReconnect?: boolean): Promise<void>;
|
|
90
|
-
/** Public teardown — clears everything including the connect lock. */
|
|
91
|
-
dispose(): Promise<void>;
|
|
92
|
-
/** Internal transport teardown — does NOT clear connectPromise so the
|
|
93
|
-
* retry loop inside doConnect() can safely call it between attempts. */
|
|
94
|
-
private resetTransport;
|
|
95
|
-
private connect;
|
|
96
|
-
private doConnect;
|
|
97
|
-
private listDescriptors;
|
|
98
|
-
private request;
|
|
99
|
-
private notify;
|
|
100
|
-
private handleMessage;
|
|
101
|
-
private failPending;
|
|
102
|
-
private applyCatalogSnapshot;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* `McpCapabilityProvider` — implements the Layer A `CapabilityProvider`
|
|
107
|
-
* contract for an MCP server fleet.
|
|
108
|
-
*
|
|
109
|
-
* FEATURE_082 (v0.7.24): moved from
|
|
110
|
-
* `@kodax-ai/coding/src/capabilities/providers/mcp/provider.ts` to this package.
|
|
111
|
-
* The coding-specific `registerConfiguredMcpCapabilityProvider` adapter (which
|
|
112
|
-
* pulls in `KodaXExtensionRuntime`) lives in
|
|
113
|
-
* `@kodax-ai/coding/src/capabilities/providers/mcp-adapter.ts`.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
interface McpProviderOptions {
|
|
117
|
-
cacheDir?: string;
|
|
118
|
-
}
|
|
119
|
-
declare class McpCapabilityProvider implements CapabilityProvider {
|
|
120
|
-
readonly id = "mcp";
|
|
121
|
-
readonly kinds: CapabilityProvider['kinds'];
|
|
122
|
-
private readonly runtimes;
|
|
123
|
-
private readonly cacheDir;
|
|
124
|
-
/**
|
|
125
|
-
* Construct an MCP capability provider.
|
|
126
|
-
*
|
|
127
|
-
* **Cache-dir capture warning (v0.7.35.1 FEATURE_145)** — when
|
|
128
|
-
* `options.cacheDir` is omitted, this constructor resolves
|
|
129
|
-
* `defaultMcpCacheDir()` ONCE at instantiation time and threads the
|
|
130
|
-
* result into every `McpServerRuntime` it spawns. If a substrate
|
|
131
|
-
* consumer plans to redirect the agent config home via
|
|
132
|
-
* `setAgentConfigHome()` from `@kodax-ai/agent`, that call MUST happen
|
|
133
|
-
* BEFORE constructing this provider. Late calls have no effect on
|
|
134
|
-
* already-constructed runtimes.
|
|
135
|
-
*
|
|
136
|
-
* To bypass the agent-home resolver entirely, pass
|
|
137
|
-
* `options.cacheDir` explicitly — that path wins unconditionally.
|
|
138
|
-
*/
|
|
139
|
-
constructor(servers: McpServersConfig | undefined, options?: McpProviderOptions);
|
|
140
|
-
hasActiveServers(): boolean;
|
|
141
|
-
prewarm(): Promise<void>;
|
|
142
|
-
search(query: string, options?: {
|
|
143
|
-
kind?: CapabilityKind;
|
|
144
|
-
limit?: number;
|
|
145
|
-
server?: string;
|
|
146
|
-
}): Promise<unknown[]>;
|
|
147
|
-
describe(id: string): Promise<unknown>;
|
|
148
|
-
execute(id: string, input: Record<string, unknown>): Promise<CapabilityResult>;
|
|
149
|
-
read(id: string, options?: Record<string, unknown>): Promise<CapabilityResult>;
|
|
150
|
-
getPrompt(id: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
151
|
-
getPromptContext(): Promise<string | undefined>;
|
|
152
|
-
getDiagnostics(): Record<string, unknown> | undefined;
|
|
153
|
-
refresh(): Promise<void>;
|
|
154
|
-
dispose(): Promise<void>;
|
|
155
|
-
private collectCatalogItems;
|
|
156
|
-
private listServerDiagnostics;
|
|
157
|
-
private requireRuntime;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
interface McpTransportEvents {
|
|
161
|
-
/** Called with a complete JSON-RPC message (raw JSON string). */
|
|
162
|
-
onMessage(raw: string): void;
|
|
163
|
-
onError(error: Error): void;
|
|
164
|
-
onClose(reason: string): void;
|
|
165
|
-
}
|
|
166
|
-
interface McpTransport {
|
|
167
|
-
open(events: McpTransportEvents): Promise<void>;
|
|
168
|
-
/** Send a JSON string. The transport handles framing. */
|
|
169
|
-
send(json: string): Promise<void>;
|
|
170
|
-
close(): Promise<void>;
|
|
171
|
-
readonly connected: boolean;
|
|
172
|
-
}
|
|
173
|
-
type StdioFraming = 'content-length' | 'ndjson';
|
|
174
|
-
interface McpTransportOptions {
|
|
175
|
-
stdioFraming?: StdioFraming;
|
|
176
|
-
}
|
|
177
|
-
declare function createMcpTransport(config: McpServerConfig, options?: McpTransportOptions): McpTransport;
|
|
178
|
-
|
|
179
|
-
export { McpCapabilityProvider as b, McpServerRuntime as g, createMcpCapabilityId as k, createMcpTransport as l, defaultMcpCacheDir as m, getMcpCachePaths as n, parseMcpCapabilityId as p, searchMcpCatalog as s };
|
|
180
|
-
export type { McpCapabilityDescriptor as M, McpCapabilityKind as a, McpCapabilityRisk as c, McpCatalogItem as d, McpProviderOptions as e, McpServerCatalogSnapshot as f, McpServerRuntimeDiagnostics as h, McpTransport as i, McpTransportEvents as j };
|