@cjhyy/code-shell 0.1.0-alpha.3 → 0.1.5
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 +77 -0
- package/dist/anthropic-IBTI4WL2.cjs +10 -0
- package/dist/anthropic-PRZZKHEZ.js +10 -0
- package/dist/arena/index.cjs +7 -6
- package/dist/arena/index.js +6 -5
- package/dist/arena/model-presets.d.ts +10 -1
- package/dist/{arena-HHDYYVHJ.cjs → arena-KBQOPLFV.cjs} +25 -23
- package/dist/{arena-ENHBHB2W.js → arena-O2L4TN6A.js} +9 -7
- package/dist/{chunk-SW3L7HIM.js → chunk-2EP3CLEN.js} +2 -2
- package/dist/{chunk-EL2RL5DG.cjs → chunk-2YW4FPFG.cjs} +2 -2
- package/dist/chunk-3OA5G4TM.js +47 -0
- package/dist/chunk-52LGZKT3.cjs +47 -0
- package/dist/{chunk-KOGV6PDQ.cjs → chunk-55XGPMAP.cjs} +44 -9
- package/dist/chunk-5ECBT4YA.js +450 -0
- package/dist/{chunk-YD7XTI7T.cjs → chunk-6QVAYW7C.cjs} +116 -28
- package/dist/{chunk-SCDKLTN3.js → chunk-6S4BJ65N.js} +5 -4
- package/dist/{chunk-ZLPJJZUW.js → chunk-76HYEPDM.js} +2 -2
- package/dist/{chunk-TDXBHD24.js → chunk-76W334S4.js} +2 -2
- package/dist/{chunk-GZBD6QRS.cjs → chunk-7EG3V4JY.cjs} +13 -12
- package/dist/{chunk-LMEKCQX4.js → chunk-7JVTYEEC.js} +6 -6
- package/dist/{chunk-ID6EJUHP.js → chunk-7K6SDRRF.js} +1262 -212
- package/dist/{chunk-5C5HIOML.js → chunk-7Y6S3OCX.js} +109 -21
- package/dist/{chunk-VIPLU4RY.cjs → chunk-A5LCRPDP.cjs} +4 -4
- package/dist/{chunk-F5BS3GUC.js → chunk-BSW22MPA.js} +39 -4
- package/dist/{chunk-VWFET3MG.cjs → chunk-BUU5PZK2.cjs} +1474 -423
- package/dist/{chunk-HOXQLX5R.cjs → chunk-BWTOS5BH.cjs} +444 -103
- package/dist/{chunk-ZRVPCXI7.js → chunk-BXCY2FSE.js} +2 -1
- package/dist/{chunk-Y7TSCDF6.js → chunk-C5YQBIRK.js} +347 -6
- package/dist/{chunk-C7C7ZZY4.cjs → chunk-HEKQCI7B.cjs} +10 -10
- package/dist/{chunk-JHXNOB5G.cjs → chunk-HS2MFNUC.cjs} +6 -6
- package/dist/{chunk-JHNCK7JP.cjs → chunk-IK4EWJBP.cjs} +4 -3
- package/dist/{chunk-M2QI5X3X.cjs → chunk-JMR33QVF.cjs} +2 -2
- package/dist/{chunk-YAFCN7ZW.cjs → chunk-KOVYSDHZ.cjs} +15 -15
- package/dist/{chunk-IJSHQGMP.cjs → chunk-KS3RYAYL.cjs} +4 -4
- package/dist/{chunk-DI7RDLOS.js → chunk-MD32R22I.js} +7 -4
- package/dist/chunk-MY5XHADU.cjs +216 -0
- package/dist/{chunk-OP57WUWQ.cjs → chunk-NUNC3VFB.cjs} +6 -6
- package/dist/{chunk-BF4LXLQV.cjs → chunk-QRM7IF2S.cjs} +133 -175
- package/dist/chunk-R47ROHGL.cjs +298 -0
- package/dist/{chunk-OUC2DFA7.js → chunk-RMYKO74M.js} +3 -3
- package/dist/{chunk-FUOKLKR2.js → chunk-SFXHZSRF.js} +1 -1
- package/dist/{chunk-2EUAE7AY.js → chunk-SIHHIQLO.js} +2 -2
- package/dist/{chunk-3CAZIWUA.cjs → chunk-SNT563K3.cjs} +9 -9
- package/dist/{chunk-SK62UVS6.js → chunk-T6VYG46N.js} +1 -1
- package/dist/{chunk-3QR52LL5.cjs → chunk-TUY2T5KP.cjs} +2 -2
- package/dist/{chunk-I57ZD5IQ.js → chunk-VIAGTYYW.js} +1 -1
- package/dist/{chunk-X2DNIMPC.cjs → chunk-VYL4EFRC.cjs} +32 -32
- package/dist/chunk-W22P377T.js +299 -0
- package/dist/chunk-WASS5YWB.js +215 -0
- package/dist/{chunk-FPFTIKEJ.js → chunk-XDIQWQJ4.js} +132 -174
- package/dist/{chunk-BUJ5KYCI.cjs → chunk-YIQBXAYU.cjs} +13 -13
- package/dist/{chunk-REFCCVDM.js → chunk-YJ77GQK5.js} +2 -2
- package/dist/chunk-YUI524OE.cjs +450 -0
- package/dist/{chunk-M2SVOKC6.js → chunk-ZBPSQCPU.js} +6 -6
- package/dist/cli/commands/builtin/export-md.d.ts +19 -0
- package/dist/cli/commands/builtin/init/detect.d.ts +25 -0
- package/dist/cli/commands/builtin/init/index.d.ts +19 -0
- package/dist/cli/main.cjs +2343 -1447
- package/dist/cli/main.js +2476 -1580
- package/dist/cli/migrate-models.d.ts +45 -0
- package/dist/cli/onboarding.d.ts +110 -5
- package/dist/cli/updater.d.ts +51 -4
- package/dist/client-base-HTF236ZD.cjs +9 -0
- package/dist/client-base-QKRKCOWB.js +9 -0
- package/dist/{compaction-YNWCEF7B.js → compaction-6VU2T643.js} +4 -2
- package/dist/compaction-OKUNTCA7.cjs +33 -0
- package/dist/context/compaction.d.ts +35 -3
- package/dist/context/manager.d.ts +40 -3
- package/dist/context/tool-result-storage.d.ts +96 -0
- package/dist/devtools-T2NIZBJK.cjs +6 -0
- package/dist/{devtools-IRQQPIRY.js → devtools-YXWHOVKR.js} +1 -1
- package/dist/engine/engine.d.ts +40 -0
- package/dist/engine/turn-loop.d.ts +6 -0
- package/dist/export-md-RXDW6F5W.cjs +135 -0
- package/dist/export-md-XXKZANW5.js +135 -0
- package/dist/file-history-KYPE3ECT.cjs +7 -0
- package/dist/file-history-LF4F7X26.js +7 -0
- package/dist/index.cjs +42 -22
- package/dist/index.d.ts +5 -2
- package/dist/index.js +40 -20
- package/dist/llm/client-base.d.ts +1 -1
- package/dist/llm/model-cache.d.ts +21 -0
- package/dist/llm/model-fetcher.d.ts +29 -0
- package/dist/llm/model-pool.d.ts +13 -0
- package/dist/llm/provider-catalog.d.ts +30 -0
- package/dist/llm/provider-kinds.d.ts +21 -0
- package/dist/llm/types.d.ts +8 -0
- package/dist/logging/session-recorder.d.ts +77 -0
- package/dist/manager-C2IUXKRC.js +7 -0
- package/dist/manager-YYKWYTRM.cjs +7 -0
- package/dist/mcp-manager-QMKWPBZ4.js +8 -0
- package/dist/mcp-manager-Z3OKI74O.cjs +8 -0
- package/dist/memory-5LWZ6FI2.cjs +9 -0
- package/dist/{memory-EPFDBPII.js → memory-VIJLBAMQ.js} +2 -2
- package/dist/model-cache-5KIYL5SL.js +13 -0
- package/dist/model-cache-OED3IM4R.cjs +13 -0
- package/dist/model-fetcher-HKGICACL.js +8 -0
- package/dist/model-fetcher-UR6WJOQP.cjs +8 -0
- package/dist/openai-JR2WEKOF.js +10 -0
- package/dist/openai-YBTOET4O.cjs +10 -0
- package/dist/openrouter-models-OU4GRZQY.cjs +15 -0
- package/dist/{openrouter-models-2FM3H4SQ.js → openrouter-models-TGKDKY52.js} +2 -2
- package/dist/openrouter-sync-BBHUM3R6.cjs +11 -0
- package/dist/{openrouter-sync-SO3AWEAM.js → openrouter-sync-UXUSJCIR.js} +3 -3
- package/dist/product/index.cjs +17 -15
- package/dist/product/index.js +16 -14
- package/dist/protocol/server.d.ts +3 -1
- package/dist/protocol/types.d.ts +36 -2
- package/dist/run/index.cjs +17 -15
- package/dist/run/index.js +16 -14
- package/dist/services/index.d.ts +0 -1
- package/dist/session-manager-Q22BBMD3.js +8 -0
- package/dist/session-manager-XODQVL3C.cjs +8 -0
- package/dist/settings/schema.d.ts +267 -42
- package/dist/{tool-summary-RYNR4DDB.cjs → tool-summary-63DPIS7G.cjs} +4 -4
- package/dist/{tool-summary-2RUFL5QK.js → tool-summary-NP5CDBKG.js} +2 -2
- package/dist/tool-system/builtin/ask-user.d.ts +9 -1
- package/dist/tool-system/context.d.ts +31 -2
- package/dist/tool-system/executor.d.ts +4 -0
- package/dist/tool-system/investigation-guard.d.ts +37 -0
- package/dist/types.d.ts +13 -2
- package/dist/ui/components/AskUserPrompt.d.ts +8 -1
- package/dist/ui/components/DiffLine.d.ts +33 -0
- package/dist/ui/components/ModelManager.d.ts +34 -1
- package/dist/ui/components/OnboardingPrompt.d.ts +10 -1
- package/dist/ui/components/ProviderModelFlow.d.ts +58 -0
- package/dist/ui/components/UpdateBanner.d.ts +1 -0
- package/dist/updater-QW473OF4.cjs +17 -0
- package/dist/updater-VFUAHCVY.js +17 -0
- package/dist/utils/semver.d.ts +1 -0
- package/dist/utils/task-sanitizer.d.ts +6 -0
- package/package.json +1 -1
- package/dist/anthropic-P5VETAFI.cjs +0 -10
- package/dist/anthropic-W2GU3D76.js +0 -10
- package/dist/chunk-75E4BBFC.js +0 -224
- package/dist/chunk-FV2ARONZ.cjs +0 -224
- package/dist/client-base-TOVE25FA.js +0 -9
- package/dist/client-base-VDDIADAC.cjs +0 -9
- package/dist/compaction-D3KV2NWY.cjs +0 -31
- package/dist/devtools-WTC3NFNE.cjs +0 -6
- package/dist/file-history-HZWO2WQ5.js +0 -7
- package/dist/file-history-UQQILIY7.cjs +0 -7
- package/dist/manager-FWLOVEEK.cjs +0 -7
- package/dist/manager-GEXJLOIS.js +0 -7
- package/dist/mcp-manager-37GQLFGX.js +0 -8
- package/dist/mcp-manager-U77NEXBY.cjs +0 -8
- package/dist/memory-ADGOWADP.cjs +0 -9
- package/dist/openai-RXU5URYI.js +0 -10
- package/dist/openai-SQW4H2K4.cjs +0 -10
- package/dist/openrouter-models-PLCWZZYE.cjs +0 -15
- package/dist/openrouter-sync-K2WK3A2A.cjs +0 -11
- package/dist/services/compact.d.ts +0 -56
- package/dist/session-manager-HRSKENKB.cjs +0 -8
- package/dist/session-manager-NEKFEHF3.js +0 -8
- package/dist/updater-J7L7R6BY.cjs +0 -185
- package/dist/updater-LDBNYCAO.js +0 -185
|
@@ -23,7 +23,7 @@ export declare abstract class LLMClientBase {
|
|
|
23
23
|
constructor(config: LLMConfig);
|
|
24
24
|
protected abstract initClient(): void;
|
|
25
25
|
abstract createMessage(options: CreateMessageOptions): Promise<LLMResponse>;
|
|
26
|
-
protected recordUsage(usage: TokenUsage): void;
|
|
26
|
+
protected recordUsage(usage: TokenUsage, options?: CreateMessageOptions): void;
|
|
27
27
|
getUsage(): LLMUsageTracker;
|
|
28
28
|
protected withRetry<T>(fn: () => Promise<T>, maxAttempts?: number): Promise<T>;
|
|
29
29
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache file IO for per-provider model lists.
|
|
3
|
+
*
|
|
4
|
+
* One file per provider key under <cacheDir>/<providerKey>.json. TTL is
|
|
5
|
+
* 7 days. Callers decide whether to honor staleness — readCache just
|
|
6
|
+
* reads, isStale just checks. Malformed/missing files yield undefined.
|
|
7
|
+
*/
|
|
8
|
+
export interface CachedModel {
|
|
9
|
+
id: string;
|
|
10
|
+
contextLength: number;
|
|
11
|
+
maxOutputTokens: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ModelCacheFile {
|
|
14
|
+
fetchedAt: string;
|
|
15
|
+
providerKey: string;
|
|
16
|
+
models: CachedModel[];
|
|
17
|
+
}
|
|
18
|
+
export declare function readCache(cacheDir: string, providerKey: string): ModelCacheFile | undefined;
|
|
19
|
+
export declare function writeCache(cacheDir: string, providerKey: string, models: CachedModel[]): ModelCacheFile;
|
|
20
|
+
export declare function isStale(file: ModelCacheFile, now?: number): boolean;
|
|
21
|
+
export declare function defaultCacheDir(): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch a provider's model list from its official /v1/models endpoint
|
|
3
|
+
* (or the local OpenRouter snapshot). Normalizes wildly different
|
|
4
|
+
* response shapes into a uniform `CachedModel[]`, applies the kind's
|
|
5
|
+
* chat-only filter, and writes to disk cache.
|
|
6
|
+
*
|
|
7
|
+
* Network failures don't throw — they return `{ models: [], error }`
|
|
8
|
+
* so the UI can prompt the user to refresh later or fall back to
|
|
9
|
+
* manual entry.
|
|
10
|
+
*/
|
|
11
|
+
import { type ProviderKindName } from "./provider-kinds.js";
|
|
12
|
+
import { type ModelCacheFile } from "./model-cache.js";
|
|
13
|
+
export interface FetcherProvider {
|
|
14
|
+
key: string;
|
|
15
|
+
kind: ProviderKindName;
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
apiKey: string | undefined;
|
|
18
|
+
modelsPath?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FetchOptions {
|
|
21
|
+
cacheDir: string;
|
|
22
|
+
refresh?: boolean;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface FetchResult extends ModelCacheFile {
|
|
26
|
+
error?: string;
|
|
27
|
+
fromCache?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function fetchModelList(provider: FetcherProvider, opts: FetchOptions): Promise<FetchResult>;
|
package/dist/llm/model-pool.d.ts
CHANGED
|
@@ -26,10 +26,23 @@ export interface ModelEntry {
|
|
|
26
26
|
maxOutputTokens?: number;
|
|
27
27
|
/** Per-model context window size. Falls back to config.maxContextTokens → 200_000. */
|
|
28
28
|
maxContextTokens?: number;
|
|
29
|
+
/** Optional reference into ProviderCatalog. When set, baseUrl/apiKey
|
|
30
|
+
* come from the catalog unless the entry overrides them. */
|
|
31
|
+
providerKey?: string;
|
|
29
32
|
}
|
|
30
33
|
export declare class ModelPool {
|
|
31
34
|
private models;
|
|
32
35
|
private activeKey;
|
|
36
|
+
private providerCatalog;
|
|
37
|
+
private cacheDir;
|
|
38
|
+
setProviderCatalog(cat: import("./provider-catalog.js").ProviderCatalog): void;
|
|
39
|
+
setCacheDir(dir: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* For each entry in the pool that lacks an explicit maxContextTokens
|
|
42
|
+
* but has a providerKey, look up the contextLength from the cached
|
|
43
|
+
* model list and patch it in.
|
|
44
|
+
*/
|
|
45
|
+
reloadCachedContextWindows(): void;
|
|
33
46
|
/**
|
|
34
47
|
* Build a pool from an array of model entries.
|
|
35
48
|
* The first entry (or the one matching `defaultKey`) becomes active.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory catalog of provider credentials. Mirrors settings.providers[]
|
|
3
|
+
* but offers a small API for add/update/remove that validates uniqueness
|
|
4
|
+
* and (for remove) refuses to delete a provider still referenced by a
|
|
5
|
+
* model entry. The caller persists changes back to settings.
|
|
6
|
+
*/
|
|
7
|
+
import type { ProviderKindName } from "./provider-kinds.js";
|
|
8
|
+
export interface ProviderConfig {
|
|
9
|
+
key: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
kind: ProviderKindName;
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
protocol?: "openai-compat" | "anthropic-style";
|
|
15
|
+
modelsPath?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class ProviderCatalog {
|
|
18
|
+
private byKey;
|
|
19
|
+
constructor(entries?: ProviderConfig[]);
|
|
20
|
+
list(): ProviderConfig[];
|
|
21
|
+
get(key: string): ProviderConfig | undefined;
|
|
22
|
+
has(key: string): boolean;
|
|
23
|
+
add(entry: ProviderConfig): void;
|
|
24
|
+
update(key: string, patch: Partial<ProviderConfig>): void;
|
|
25
|
+
remove(key: string, opts: {
|
|
26
|
+
referencedBy: string[];
|
|
27
|
+
}): void;
|
|
28
|
+
/** Compute an unused key for a new provider, given a desired base. */
|
|
29
|
+
deriveKey(base: string): string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in provider kind metadata.
|
|
3
|
+
*
|
|
4
|
+
* Each kind defines how to talk to that provider family: where its
|
|
5
|
+
* model list lives, what auth header to send, which model IDs to keep
|
|
6
|
+
* (chat-completion only — embeddings / TTS / image generation are
|
|
7
|
+
* filtered out so they don't show up in the model picker).
|
|
8
|
+
*/
|
|
9
|
+
export type ProviderKindName = "openai" | "anthropic" | "deepseek" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
10
|
+
export type ProviderProtocol = "openai-compat" | "anthropic-style" | "gemini" | "ollama";
|
|
11
|
+
export interface ProviderKindMeta {
|
|
12
|
+
label: string;
|
|
13
|
+
defaultBaseUrl: string;
|
|
14
|
+
modelsPath: string;
|
|
15
|
+
protocol: ProviderProtocol;
|
|
16
|
+
authHeader: (apiKey: string) => Record<string, string>;
|
|
17
|
+
chatFilter: (id: string) => boolean;
|
|
18
|
+
authQuery?: (apiKey: string) => Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
export declare const PROVIDER_KINDS: Record<ProviderKindName, ProviderKindMeta>;
|
|
21
|
+
export declare function getKindMeta(kind: string): ProviderKindMeta;
|
package/dist/llm/types.d.ts
CHANGED
|
@@ -11,6 +11,14 @@ export interface CreateMessageOptions {
|
|
|
11
11
|
stream?: boolean;
|
|
12
12
|
onChunk?: (chunk: LLMStreamChunk) => void;
|
|
13
13
|
signal?: AbortSignal;
|
|
14
|
+
/**
|
|
15
|
+
* If false, this call's usage is excluded from the client's usage tracker
|
|
16
|
+
* and from the process-wide onUsage hook. Used for auxiliary sub-calls
|
|
17
|
+
* (tool-summary, future helper prompts) that should not appear in
|
|
18
|
+
* session_end.cost or skew turn/requestCount semantics.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
recordUsage?: boolean;
|
|
14
22
|
}
|
|
15
23
|
export interface LLMUsageTracker {
|
|
16
24
|
records: TokenUsage[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-session verbose recorder for local-dev runs.
|
|
3
|
+
*
|
|
4
|
+
* Writes a JSON-lines trace to <repo>/log/<YYYY-MM-DD>/session-<sid>.jsonl
|
|
5
|
+
* containing every step: user input, system prompt, each LLM request+response
|
|
6
|
+
* (full bodies), each tool call's args and result, and engine decision events.
|
|
7
|
+
*
|
|
8
|
+
* Why a separate sink from logger.ts?
|
|
9
|
+
* - logger.ts is the terse process-wide log (~/.code-shell/logs/) and stays
|
|
10
|
+
* small for production observability.
|
|
11
|
+
* - This sink keeps full prompt/response bodies for post-mortem debugging
|
|
12
|
+
* and is gated to local-dev only (bun run dev / CODE_SHELL_DEV=1).
|
|
13
|
+
*
|
|
14
|
+
* Why JSONL not markdown?
|
|
15
|
+
* - `jq` can slice on any field in one command: tool histograms, slowest
|
|
16
|
+
* LLM calls, largest prompts, anything. Markdown would need ad-hoc parsing.
|
|
17
|
+
* - Field bodies are inlined; JSON.stringify handles arbitrarily long
|
|
18
|
+
* strings and jq streams, so no sidecar files are needed.
|
|
19
|
+
*
|
|
20
|
+
* Daily rotation: on first write each process, prune date folders older than
|
|
21
|
+
* RETENTION_DAYS.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isVerboseRecorderEnabled(): boolean;
|
|
24
|
+
export declare function getVerboseLogDir(): string;
|
|
25
|
+
export declare function recordSessionStart(sid: string, info: {
|
|
26
|
+
task?: string;
|
|
27
|
+
cwd?: string;
|
|
28
|
+
model?: string;
|
|
29
|
+
provider?: string;
|
|
30
|
+
permissionMode?: string;
|
|
31
|
+
resumed?: boolean;
|
|
32
|
+
}): void;
|
|
33
|
+
export type RecordLLMRequest = {
|
|
34
|
+
provider: string;
|
|
35
|
+
model: string;
|
|
36
|
+
stream: boolean;
|
|
37
|
+
temperature?: number;
|
|
38
|
+
maxTokens?: number;
|
|
39
|
+
messages: unknown;
|
|
40
|
+
tools?: unknown;
|
|
41
|
+
systemPrompt?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare function recordLLMRequest(sid: string, req: RecordLLMRequest, reqId: string): void;
|
|
44
|
+
export type RecordLLMResponse = {
|
|
45
|
+
text?: string;
|
|
46
|
+
toolCalls?: Array<{
|
|
47
|
+
id: string;
|
|
48
|
+
toolName: string;
|
|
49
|
+
args: unknown;
|
|
50
|
+
}>;
|
|
51
|
+
stopReason?: string;
|
|
52
|
+
usage?: import("../types.js").TokenUsage;
|
|
53
|
+
durationMs?: number;
|
|
54
|
+
ttftMs?: number;
|
|
55
|
+
};
|
|
56
|
+
export declare function recordLLMResponse(sid: string, resp: RecordLLMResponse, reqId: string): void;
|
|
57
|
+
export declare function recordLLMError(sid: string, reqId: string, err: unknown, durationMs: number): void;
|
|
58
|
+
export declare function recordToolCall(sid: string, call: {
|
|
59
|
+
id: string;
|
|
60
|
+
toolName: string;
|
|
61
|
+
args: unknown;
|
|
62
|
+
}): void;
|
|
63
|
+
export declare function recordToolResult(sid: string, result: {
|
|
64
|
+
id: string;
|
|
65
|
+
toolName: string;
|
|
66
|
+
ok: boolean;
|
|
67
|
+
durationMs: number;
|
|
68
|
+
output?: string;
|
|
69
|
+
error?: string;
|
|
70
|
+
}): void;
|
|
71
|
+
export declare function recordEvent(sid: string, name: string, data?: Record<string, unknown>): void;
|
|
72
|
+
export declare function recordSessionEnd(sid: string, info: {
|
|
73
|
+
reason?: string;
|
|
74
|
+
turns?: number;
|
|
75
|
+
cost?: unknown;
|
|
76
|
+
durationMs?: number;
|
|
77
|
+
}): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkJMR33QVFcjs = require('./chunk-JMR33QVF.cjs');
|
|
5
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.MemoryManager = _chunkJMR33QVFcjs.MemoryManager; exports.resolveMemoryBaseDir = _chunkJMR33QVFcjs.resolveMemoryBaseDir;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk52LGZKT3cjs = require('./chunk-52LGZKT3.cjs');
|
|
7
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.defaultCacheDir = _chunk52LGZKT3cjs.defaultCacheDir; exports.isStale = _chunk52LGZKT3cjs.isStale; exports.readCache = _chunk52LGZKT3cjs.readCache; exports.writeCache = _chunk52LGZKT3cjs.writeCache;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkMY5XHADUcjs = require('./chunk-MY5XHADU.cjs');
|
|
4
|
+
require('./chunk-52LGZKT3.cjs');
|
|
5
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.fetchModelList = _chunkMY5XHADUcjs.fetchModelList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkKOVYSDHZcjs = require('./chunk-KOVYSDHZ.cjs');
|
|
4
|
+
require('./chunk-7EG3V4JY.cjs');
|
|
5
|
+
require('./chunk-2YW4FPFG.cjs');
|
|
6
|
+
require('./chunk-IK4EWJBP.cjs');
|
|
7
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.OpenAIClient = _chunkKOVYSDHZcjs.OpenAIClient;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkQRM7IF2Scjs = require('./chunk-QRM7IF2S.cjs');
|
|
8
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.findOpenRouterModel = _chunkQRM7IF2Scjs.findOpenRouterModel; exports.getOpenRouterModels = _chunkQRM7IF2Scjs.getOpenRouterModels; exports.getOpenRouterSnapshot = _chunkQRM7IF2Scjs.getOpenRouterSnapshot; exports.listOpenRouterModelsByVendor = _chunkQRM7IF2Scjs.listOpenRouterModelsByVendor; exports.setOpenRouterSnapshot = _chunkQRM7IF2Scjs.setOpenRouterSnapshot;
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
getOpenRouterSnapshot,
|
|
5
5
|
listOpenRouterModelsByVendor,
|
|
6
6
|
setOpenRouterSnapshot
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-XDIQWQJ4.js";
|
|
8
|
+
import "./chunk-MD32R22I.js";
|
|
9
9
|
export {
|
|
10
10
|
findOpenRouterModel,
|
|
11
11
|
getOpenRouterModels,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkA5LCRPDPcjs = require('./chunk-A5LCRPDP.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkQRM7IF2Scjs = require('./chunk-QRM7IF2S.cjs');
|
|
7
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.getOpenRouterSnapshot = _chunkQRM7IF2Scjs.getOpenRouterSnapshot; exports.syncOpenRouterCatalog = _chunkA5LCRPDPcjs.syncOpenRouterCatalog;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
syncOpenRouterCatalog
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-76W334S4.js";
|
|
4
4
|
import {
|
|
5
5
|
getOpenRouterSnapshot
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XDIQWQJ4.js";
|
|
7
|
+
import "./chunk-MD32R22I.js";
|
|
8
8
|
export {
|
|
9
9
|
getOpenRouterSnapshot,
|
|
10
10
|
syncOpenRouterCatalog
|
package/dist/product/index.cjs
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
3
|
+
var _chunkSNT563K3cjs = require('../chunk-SNT563K3.cjs');
|
|
4
|
+
require('../chunk-BUU5PZK2.cjs');
|
|
5
|
+
require('../chunk-55XGPMAP.cjs');
|
|
6
|
+
require('../chunk-52LGZKT3.cjs');
|
|
7
|
+
require('../chunk-HEKQCI7B.cjs');
|
|
8
|
+
require('../chunk-6QVAYW7C.cjs');
|
|
9
|
+
require('../chunk-JMR33QVF.cjs');
|
|
10
|
+
require('../chunk-NUNC3VFB.cjs');
|
|
11
|
+
require('../chunk-YUI524OE.cjs');
|
|
12
|
+
require('../chunk-TUY2T5KP.cjs');
|
|
13
|
+
require('../chunk-VYL4EFRC.cjs');
|
|
14
|
+
require('../chunk-BWTOS5BH.cjs');
|
|
15
|
+
require('../chunk-QRM7IF2S.cjs');
|
|
16
|
+
require('../chunk-2YW4FPFG.cjs');
|
|
17
|
+
require('../chunk-IK4EWJBP.cjs');
|
|
18
|
+
require('../chunk-KS3RYAYL.cjs');
|
|
17
19
|
|
|
18
20
|
|
|
19
|
-
exports.defineProduct =
|
|
21
|
+
exports.defineProduct = _chunkSNT563K3cjs.defineProduct;
|
package/dist/product/index.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineProduct
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-YJ77GQK5.js";
|
|
4
|
+
import "../chunk-7K6SDRRF.js";
|
|
5
|
+
import "../chunk-BSW22MPA.js";
|
|
6
|
+
import "../chunk-3OA5G4TM.js";
|
|
7
|
+
import "../chunk-SIHHIQLO.js";
|
|
8
|
+
import "../chunk-7Y6S3OCX.js";
|
|
9
|
+
import "../chunk-VIAGTYYW.js";
|
|
10
|
+
import "../chunk-76HYEPDM.js";
|
|
11
|
+
import "../chunk-5ECBT4YA.js";
|
|
12
|
+
import "../chunk-T6VYG46N.js";
|
|
13
|
+
import "../chunk-RMYKO74M.js";
|
|
14
|
+
import "../chunk-C5YQBIRK.js";
|
|
15
|
+
import "../chunk-XDIQWQJ4.js";
|
|
16
|
+
import "../chunk-SFXHZSRF.js";
|
|
17
|
+
import "../chunk-BXCY2FSE.js";
|
|
18
|
+
import "../chunk-MD32R22I.js";
|
|
17
19
|
export {
|
|
18
20
|
defineProduct
|
|
19
21
|
};
|
|
@@ -39,7 +39,9 @@ export declare class AgentServer {
|
|
|
39
39
|
private requestApprovalFromClient;
|
|
40
40
|
/**
|
|
41
41
|
* Ask the client to answer a question from the agent.
|
|
42
|
-
* Reuses the approval flow with a synthetic request.
|
|
42
|
+
* Reuses the approval flow with a synthetic request. Optional `opts`
|
|
43
|
+
* carry multiple-choice options / header / multiSelect hints that the
|
|
44
|
+
* client UI may use to render a picker instead of a text input.
|
|
43
45
|
*/
|
|
44
46
|
private requestAskUserFromClient;
|
|
45
47
|
private notify;
|
package/dist/protocol/types.d.ts
CHANGED
|
@@ -76,15 +76,25 @@ export interface ConfigureParams {
|
|
|
76
76
|
effort?: string;
|
|
77
77
|
/** Switch active model by pool key (e.g. "sonnet", "haiku", "gpt"). */
|
|
78
78
|
model?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Re-read settings (providers[]/models[]) into the engine's ModelPool before
|
|
81
|
+
* any model switch. Set after onboarding/login persists new entries so the
|
|
82
|
+
* running engine picks them up without a process restart.
|
|
83
|
+
*/
|
|
84
|
+
reloadModels?: boolean;
|
|
79
85
|
}
|
|
80
86
|
/** Query server state. */
|
|
81
87
|
export interface QueryParams {
|
|
82
|
-
type: "sessions" | "tools" | "config" | "session_detail" | "compact" | "config_set" | "config_get" | "permission_set" | "models" | "arena_status";
|
|
88
|
+
type: "sessions" | "tools" | "config" | "session_detail" | "compact" | "config_set" | "config_get" | "permission_set" | "models" | "providers" | "arena_status" | "provider_add" | "provider_refresh" | "provider_delete" | "model_add" | "model_delete";
|
|
83
89
|
sessionId?: string;
|
|
84
90
|
/** Used by config_set / permission_set: dotted key path or mode field */
|
|
85
91
|
key?: string;
|
|
86
92
|
/** Used by config_set / permission_set: new value */
|
|
87
93
|
value?: unknown;
|
|
94
|
+
/** Used by provider_add: full ProviderConfig payload */
|
|
95
|
+
provider?: unknown;
|
|
96
|
+
/** Used by model_add: the new model entry */
|
|
97
|
+
model?: unknown;
|
|
88
98
|
}
|
|
89
99
|
export interface QueryResult {
|
|
90
100
|
type: string;
|
|
@@ -112,8 +122,32 @@ export interface ProtocolModelEntry {
|
|
|
112
122
|
key: string;
|
|
113
123
|
label: string;
|
|
114
124
|
model: string;
|
|
115
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Protocol the LLM client speaks ("openai" or "anthropic"). DeepSeek,
|
|
127
|
+
* Mistral, etc. all use "openai" since they're OpenAI-compatible.
|
|
128
|
+
* NOT the brand/vendor — that's providerKey below.
|
|
129
|
+
*/
|
|
130
|
+
protocol: string;
|
|
131
|
+
/**
|
|
132
|
+
* Pool entry's reference into settings.providers[]. Used by ModelManager
|
|
133
|
+
* to derive each provider's modelCount client-side ("how many models
|
|
134
|
+
* point at me"). Optional because auto-populated entries (autoPopulatePool)
|
|
135
|
+
* don't go through the wizard and have no providers[] row.
|
|
136
|
+
*/
|
|
137
|
+
providerKey?: string;
|
|
116
138
|
active: boolean;
|
|
139
|
+
/** Max output tokens (0 or undefined = unknown). */
|
|
140
|
+
maxOutputTokens?: number;
|
|
141
|
+
/** Max context window size (0 or undefined = unknown). */
|
|
142
|
+
maxContextTokens?: number;
|
|
143
|
+
}
|
|
144
|
+
export interface ProtocolProviderEntry {
|
|
145
|
+
key: string;
|
|
146
|
+
label: string;
|
|
147
|
+
kind: string;
|
|
148
|
+
modelCount: number;
|
|
149
|
+
cachedModels?: number;
|
|
150
|
+
cachedAt?: string;
|
|
117
151
|
}
|
|
118
152
|
export interface ConfigResult {
|
|
119
153
|
permissionMode: PermissionMode;
|
package/dist/run/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkHS2MFNUCcjs = require('../chunk-HS2MFNUC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -15,19 +15,21 @@ var _chunkJHXNOB5Gcjs = require('../chunk-JHXNOB5G.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
require('../chunk-
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
22
|
-
require('../chunk-
|
|
23
|
-
require('../chunk-
|
|
24
|
-
require('../chunk-
|
|
25
|
-
require('../chunk-
|
|
26
|
-
require('../chunk-
|
|
27
|
-
require('../chunk-
|
|
28
|
-
require('../chunk-
|
|
29
|
-
require('../chunk-
|
|
30
|
-
require('../chunk-
|
|
18
|
+
var _chunkBUU5PZK2cjs = require('../chunk-BUU5PZK2.cjs');
|
|
19
|
+
require('../chunk-55XGPMAP.cjs');
|
|
20
|
+
require('../chunk-52LGZKT3.cjs');
|
|
21
|
+
require('../chunk-HEKQCI7B.cjs');
|
|
22
|
+
require('../chunk-6QVAYW7C.cjs');
|
|
23
|
+
require('../chunk-JMR33QVF.cjs');
|
|
24
|
+
require('../chunk-NUNC3VFB.cjs');
|
|
25
|
+
require('../chunk-YUI524OE.cjs');
|
|
26
|
+
require('../chunk-TUY2T5KP.cjs');
|
|
27
|
+
require('../chunk-VYL4EFRC.cjs');
|
|
28
|
+
require('../chunk-BWTOS5BH.cjs');
|
|
29
|
+
require('../chunk-QRM7IF2S.cjs');
|
|
30
|
+
require('../chunk-2YW4FPFG.cjs');
|
|
31
|
+
require('../chunk-IK4EWJBP.cjs');
|
|
32
|
+
require('../chunk-KS3RYAYL.cjs');
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
|
|
@@ -43,4 +45,4 @@ require('../chunk-IJSHQGMP.cjs');
|
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
|
|
46
|
-
exports.ArtifactTracker =
|
|
48
|
+
exports.ArtifactTracker = _chunkBUU5PZK2cjs.ArtifactTracker; exports.CheckpointWriter = _chunkBUU5PZK2cjs.CheckpointWriter; exports.CompositeEvaluator = _chunkBUU5PZK2cjs.CompositeEvaluator; exports.EngineRunner = _chunkBUU5PZK2cjs.EngineRunner; exports.FileRunStore = _chunkBUU5PZK2cjs.FileRunStore; exports.Heartbeat = _chunkBUU5PZK2cjs.Heartbeat; exports.NoopEvaluator = _chunkBUU5PZK2cjs.NoopEvaluator; exports.RunApprovalBackend = _chunkBUU5PZK2cjs.RunApprovalBackend; exports.RunLock = _chunkBUU5PZK2cjs.RunLock; exports.RunManager = _chunkBUU5PZK2cjs.RunManager; exports.RunQueue = _chunkBUU5PZK2cjs.RunQueue; exports.VALID_TRANSITIONS = _chunkBUU5PZK2cjs.VALID_TRANSITIONS; exports.createRunAskUserFn = _chunkBUU5PZK2cjs.createRunAskUserFn; exports.createRunManager = _chunkHS2MFNUCcjs.createRunManager;
|