@datename/fastcode-termux 0.1.6 → 0.1.8-beta.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/LICENSE +4 -0
- package/README.md +67 -16
- package/dist/agent/approval-json.d.ts +43 -0
- package/dist/agent/approval-json.js +69 -0
- package/dist/agent/approval-native.d.ts +3 -0
- package/dist/agent/approval-native.js +165 -0
- package/dist/agent/approval-store.d.ts +16 -0
- package/dist/agent/approval-store.js +21 -0
- package/dist/agent/approval.d.ts +83 -0
- package/dist/agent/approval.js +42 -0
- package/dist/agent/compaction.d.ts +41 -0
- package/dist/agent/compaction.js +270 -0
- package/dist/agent/context.d.ts +29 -0
- package/dist/agent/context.js +62 -0
- package/dist/agent/guards.d.ts +24 -16
- package/dist/agent/guards.js +1167 -18
- package/dist/agent/ignore.d.ts +11 -0
- package/dist/agent/ignore.js +129 -0
- package/dist/agent/policy/defaults.d.ts +16 -0
- package/dist/agent/policy/defaults.js +17 -0
- package/dist/agent/policy/egress.d.ts +32 -0
- package/dist/agent/policy/egress.js +280 -0
- package/dist/agent/process-tree.d.ts +22 -0
- package/dist/agent/process-tree.js +102 -0
- package/dist/agent/protocol-mode.d.ts +6 -0
- package/dist/agent/protocol-mode.js +51 -0
- package/dist/agent/protocol.d.ts +20 -1
- package/dist/agent/protocol.js +169 -39
- package/dist/agent/registry.d.ts +19 -0
- package/dist/agent/registry.js +247 -0
- package/dist/agent/runner.d.ts +127 -0
- package/dist/agent/runner.js +391 -0
- package/dist/agent/shell-ast.d.ts +11 -0
- package/dist/agent/shell-ast.js +204 -0
- package/dist/agent/shell-session.d.ts +51 -0
- package/dist/agent/shell-session.js +611 -0
- package/dist/agent/stream.d.ts +29 -0
- package/dist/agent/stream.js +103 -0
- package/dist/agent/tool-schemas.d.ts +2 -0
- package/dist/agent/tool-schemas.js +82 -0
- package/dist/agent/tools/append_file.d.ts +2 -0
- package/dist/agent/tools/append_file.js +28 -0
- package/dist/agent/tools/apply_patch.d.ts +10 -0
- package/dist/agent/tools/apply_patch.js +92 -0
- package/dist/agent/tools/copy_file.d.ts +2 -0
- package/dist/agent/tools/copy_file.js +53 -0
- package/dist/agent/tools/delete_file.d.ts +2 -0
- package/dist/agent/tools/delete_file.js +43 -0
- package/dist/agent/tools/grep.d.ts +2 -0
- package/dist/agent/tools/grep.js +54 -0
- package/dist/agent/tools/index.d.ts +2 -0
- package/dist/agent/tools/index.js +32 -0
- package/dist/agent/tools/list_files.d.ts +2 -0
- package/dist/agent/tools/list_files.js +17 -0
- package/dist/agent/tools/make_dir.d.ts +2 -0
- package/dist/agent/tools/make_dir.js +26 -0
- package/dist/agent/tools/move_path.d.ts +9 -0
- package/dist/agent/tools/move_path.js +73 -0
- package/dist/agent/tools/paths.d.ts +7 -0
- package/dist/agent/tools/paths.js +84 -0
- package/dist/agent/tools/pwd.d.ts +2 -0
- package/dist/agent/tools/pwd.js +10 -0
- package/dist/agent/tools/read_file.d.ts +2 -0
- package/dist/agent/tools/read_file.js +81 -0
- package/dist/agent/tools/read_many.d.ts +2 -0
- package/dist/agent/tools/read_many.js +43 -0
- package/dist/agent/tools/readers.d.ts +58 -0
- package/dist/agent/tools/readers.js +426 -0
- package/dist/agent/tools/replace_in_file.d.ts +2 -0
- package/dist/agent/tools/replace_in_file.js +63 -0
- package/dist/agent/tools/shell.d.ts +2 -0
- package/dist/agent/tools/shell.js +48 -0
- package/dist/agent/tools/stat_path.d.ts +2 -0
- package/dist/agent/tools/stat_path.js +31 -0
- package/dist/agent/tools/types.d.ts +65 -0
- package/dist/agent/tools/types.js +1 -0
- package/dist/agent/tools/validate.d.ts +19 -0
- package/dist/agent/tools/validate.js +92 -0
- package/dist/agent/tools/write_file.d.ts +2 -0
- package/dist/agent/tools/write_file.js +28 -0
- package/dist/agent/tools.d.ts +3 -1
- package/dist/agent/tools.js +2 -377
- package/dist/app.d.ts +2 -1
- package/dist/app.js +846 -173
- package/dist/cli-main.js +363 -0
- package/dist/cli.js +444 -333
- package/dist/commands/about.js +1 -1
- package/dist/commands/attach.d.ts +9 -0
- package/dist/commands/attach.js +15 -0
- package/dist/commands/bg.d.ts +7 -0
- package/dist/commands/bg.js +9 -0
- package/dist/commands/cancel.d.ts +10 -0
- package/dist/commands/cancel.js +10 -0
- package/dist/commands/clear.d.ts +1 -0
- package/dist/commands/clear.js +1 -1
- package/dist/commands/compact.d.ts +22 -0
- package/dist/commands/compact.js +34 -0
- package/dist/commands/context.d.ts +7 -0
- package/dist/commands/context.js +25 -0
- package/dist/commands/edit.d.ts +10 -0
- package/dist/commands/edit.js +36 -0
- package/dist/commands/effort.d.ts +25 -0
- package/dist/commands/effort.js +48 -0
- package/dist/commands/expand.d.ts +10 -0
- package/dist/commands/expand.js +8 -0
- package/dist/commands/index.js +24 -0
- package/dist/commands/jobs.d.ts +7 -0
- package/dist/commands/jobs.js +17 -0
- package/dist/commands/kill.d.ts +7 -0
- package/dist/commands/kill.js +13 -0
- package/dist/commands/login.d.ts +6 -4
- package/dist/commands/login.js +24 -22
- package/dist/commands/logout.js +8 -16
- package/dist/commands/model.d.ts +1 -0
- package/dist/commands/model.js +10 -22
- package/dist/commands/provider.d.ts +1 -2
- package/dist/commands/provider.js +4 -11
- package/dist/commands/skills.js +34 -4
- package/dist/commands/steer.d.ts +11 -0
- package/dist/commands/steer.js +13 -0
- package/dist/commands/threads.d.ts +9 -0
- package/dist/commands/threads.js +26 -0
- package/dist/commands/whoami.js +6 -5
- package/dist/config/store.d.ts +53 -12
- package/dist/config/store.js +163 -73
- package/dist/config/trust.d.ts +30 -8
- package/dist/config/trust.js +139 -14
- package/dist/headless.d.ts +7 -0
- package/dist/headless.js +213 -0
- package/dist/index.js +19 -3
- package/dist/lib/debug.d.ts +2 -0
- package/dist/lib/debug.js +22 -0
- package/dist/lib/diagnostics.d.ts +48 -4
- package/dist/lib/diagnostics.js +90 -8
- package/dist/lib/highlight-subset.d.ts +21 -0
- package/dist/lib/highlight-subset.js +88 -0
- package/dist/lib/http.d.ts +11 -1
- package/dist/lib/http.js +62 -4
- package/dist/lib/lifecycle.d.ts +5 -0
- package/dist/lib/lifecycle.js +62 -0
- package/dist/lib/markdown.js +22 -4
- package/dist/lib/model-meta.d.ts +19 -0
- package/dist/lib/model-meta.js +113 -0
- package/dist/lib/native-tools.d.ts +12 -0
- package/dist/lib/native-tools.js +21 -0
- package/dist/lib/net.d.ts +33 -0
- package/dist/lib/net.js +168 -0
- package/dist/patch/apply.d.ts +15 -0
- package/dist/patch/apply.js +172 -0
- package/dist/patch/parse.d.ts +29 -0
- package/dist/patch/parse.js +112 -0
- package/dist/patch/plan.d.ts +49 -0
- package/dist/patch/plan.js +273 -0
- package/dist/providers/anthropic.d.ts +1 -0
- package/dist/providers/anthropic.js +12 -0
- package/dist/providers/custom.d.ts +9 -0
- package/dist/providers/deepseek.d.ts +10 -0
- package/dist/providers/deepseek.js +3 -2
- package/dist/providers/google.d.ts +9 -0
- package/dist/providers/groq.d.ts +10 -0
- package/dist/providers/groq.js +2 -1
- package/dist/providers/index.d.ts +10 -201
- package/dist/providers/index.js +30 -0
- package/dist/providers/mistral.d.ts +10 -0
- package/dist/providers/mistral.js +2 -1
- package/dist/providers/moonshot.d.ts +10 -0
- package/dist/providers/moonshot.js +2 -1
- package/dist/providers/ollama.d.ts +9 -0
- package/dist/providers/openai.d.ts +10 -0
- package/dist/providers/openai.js +2 -1
- package/dist/providers/openaiCompatible.d.ts +33 -2
- package/dist/providers/openaiCompatible.js +78 -16
- package/dist/providers/openrouter.d.ts +10 -0
- package/dist/providers/openrouter.js +2 -1
- package/dist/providers/qwen.d.ts +10 -0
- package/dist/providers/qwen.js +2 -1
- package/dist/providers/spec.d.ts +12 -0
- package/dist/providers/spec.js +29 -0
- package/dist/providers/xai.d.ts +10 -0
- package/dist/providers/xai.js +2 -1
- package/dist/providers/zhipu.d.ts +10 -0
- package/dist/providers/zhipu.js +2 -1
- package/dist/session/log.d.ts +49 -14
- package/dist/session/log.js +236 -11
- package/dist/session/projection.d.ts +76 -0
- package/dist/session/projection.js +526 -0
- package/dist/skills/manager.d.ts +15 -0
- package/dist/skills/manager.js +135 -18
- package/dist/types.d.ts +75 -1
- package/dist/ui/Message.d.ts +1 -7
- package/dist/ui/Message.js +13 -2
- package/dist/ui/Picker.d.ts +8 -0
- package/dist/ui/Picker.js +24 -0
- package/dist/ui/Prompt.d.ts +1 -2
- package/dist/ui/Prompt.js +2 -2
- package/dist/ui/Spinner.js +11 -5
- package/dist/ui/StatusBar.d.ts +2 -1
- package/dist/ui/StatusBar.js +6 -5
- package/package.json +3 -2
- package/src/agent/approval-json.ts +103 -0
- package/src/agent/approval-native.ts +168 -0
- package/src/agent/approval-store.ts +38 -0
- package/src/agent/approval.ts +94 -0
- package/src/agent/compaction.ts +321 -0
- package/src/agent/context.ts +97 -0
- package/src/agent/guards.ts +1239 -19
- package/src/agent/ignore.ts +147 -0
- package/src/agent/policy/defaults.ts +34 -0
- package/src/agent/policy/egress.ts +335 -0
- package/src/agent/process-tree.ts +114 -0
- package/src/agent/protocol-mode.ts +59 -0
- package/src/agent/protocol.ts +191 -40
- package/src/agent/registry.ts +270 -0
- package/src/agent/runner.ts +486 -0
- package/src/agent/shell-ast.ts +227 -0
- package/src/agent/shell-session.ts +673 -0
- package/src/agent/stream.ts +143 -0
- package/src/agent/tool-schemas.ts +86 -0
- package/src/agent/tools/append_file.ts +30 -0
- package/src/agent/tools/apply_patch.ts +95 -0
- package/src/agent/tools/copy_file.ts +56 -0
- package/src/agent/tools/delete_file.ts +45 -0
- package/src/agent/tools/grep.ts +57 -0
- package/src/agent/tools/index.ts +34 -0
- package/src/agent/tools/list_files.ts +19 -0
- package/src/agent/tools/make_dir.ts +28 -0
- package/src/agent/tools/move_path.ts +83 -0
- package/src/agent/tools/paths.ts +92 -0
- package/src/agent/tools/pwd.ts +12 -0
- package/src/agent/tools/read_file.ts +84 -0
- package/src/agent/tools/read_many.ts +45 -0
- package/src/agent/tools/readers.ts +491 -0
- package/src/agent/tools/replace_in_file.ts +66 -0
- package/src/agent/tools/shell.ts +53 -0
- package/src/agent/tools/stat_path.ts +33 -0
- package/src/agent/tools/types.ts +84 -0
- package/src/agent/tools/validate.ts +104 -0
- package/src/agent/tools/write_file.ts +30 -0
- package/src/agent/tools.ts +3 -377
- package/src/app.ts +853 -170
- package/src/{cli.ts → cli-main.ts} +64 -9
- package/src/commands/about.ts +1 -1
- package/src/commands/attach.ts +16 -0
- package/src/commands/bg.ts +9 -0
- package/src/commands/cancel.ts +10 -0
- package/src/commands/clear.ts +1 -1
- package/src/commands/compact.ts +35 -0
- package/src/commands/context.ts +26 -0
- package/src/commands/edit.ts +37 -0
- package/src/commands/effort.ts +49 -0
- package/src/commands/expand.ts +8 -0
- package/src/commands/index.ts +24 -0
- package/src/commands/jobs.ts +18 -0
- package/src/commands/kill.ts +14 -0
- package/src/commands/login.ts +24 -22
- package/src/commands/logout.ts +8 -16
- package/src/commands/model.ts +10 -22
- package/src/commands/provider.ts +4 -11
- package/src/commands/skills.ts +34 -4
- package/src/commands/steer.ts +13 -0
- package/src/commands/threads.ts +28 -0
- package/src/commands/whoami.ts +6 -5
- package/src/config/store.ts +168 -77
- package/src/config/trust.ts +181 -22
- package/src/headless.ts +225 -0
- package/src/index.ts +19 -3
- package/src/lib/debug.ts +24 -0
- package/src/lib/diagnostics.ts +90 -8
- package/src/lib/highlight-subset.ts +93 -0
- package/src/lib/http.ts +66 -4
- package/src/lib/lifecycle.ts +69 -0
- package/src/lib/markdown.ts +22 -4
- package/src/lib/model-meta.ts +138 -0
- package/src/lib/native-tools.ts +32 -0
- package/src/lib/net.ts +204 -0
- package/src/patch/apply.ts +194 -0
- package/src/patch/parse.ts +131 -0
- package/src/patch/plan.ts +317 -0
- package/src/providers/anthropic.ts +13 -1
- package/src/providers/deepseek.ts +3 -2
- package/src/providers/groq.ts +2 -1
- package/src/providers/index.ts +32 -1
- package/src/providers/mistral.ts +2 -1
- package/src/providers/moonshot.ts +2 -1
- package/src/providers/openai.ts +2 -1
- package/src/providers/openaiCompatible.ts +104 -19
- package/src/providers/openrouter.ts +2 -1
- package/src/providers/qwen.ts +2 -1
- package/src/providers/spec.ts +42 -0
- package/src/providers/xai.ts +2 -1
- package/src/providers/zhipu.ts +2 -1
- package/src/session/log.ts +311 -29
- package/src/session/projection.ts +621 -0
- package/src/skills/manager.ts +140 -18
- package/src/types/highlight-shims.d.ts +14 -0
- package/src/types.ts +79 -2
- package/src/ui/Message.ts +13 -2
- package/src/ui/Picker.ts +24 -0
- package/src/ui/Prompt.ts +2 -2
- package/src/ui/Spinner.ts +11 -5
- package/src/ui/StatusBar.ts +6 -5
- package/tsconfig.json +1 -0
- /package/dist/{cli.d.ts → cli-main.d.ts} +0 -0
|
@@ -10,15 +10,25 @@ export declare const mistralProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: () => boolean;
|
|
24
34
|
};
|
|
@@ -15,5 +15,6 @@ export const mistralProvider = {
|
|
|
15
15
|
baseUrl: BASE,
|
|
16
16
|
defaultModel: "mistral-small-latest",
|
|
17
17
|
listModels: (apiKey) => listModelsHttp({ baseUrl: BASE, apiKey, staticModels: STATIC }),
|
|
18
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC }),
|
|
18
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC, reasoning: "openai" }),
|
|
19
|
+
supportsReasoning: () => true,
|
|
19
20
|
};
|
|
@@ -10,15 +10,25 @@ export declare const moonshotProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: () => boolean;
|
|
24
34
|
};
|
|
@@ -18,5 +18,6 @@ export const moonshotProvider = {
|
|
|
18
18
|
},
|
|
19
19
|
defaultModel: "kimi-k3",
|
|
20
20
|
listModels: (apiKey) => listModelsHttp({ baseUrl: baseUrl(), apiKey, staticModels: STATIC }),
|
|
21
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: baseUrl(), apiKey, staticModels: STATIC }),
|
|
21
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: baseUrl(), apiKey, staticModels: STATIC, reasoning: "openai" }),
|
|
22
|
+
supportsReasoning: () => true,
|
|
22
23
|
};
|
|
@@ -10,15 +10,24 @@ export declare const ollamaProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
24
33
|
};
|
|
@@ -10,15 +10,25 @@ export declare const openaiProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: (model: any) => boolean;
|
|
24
34
|
};
|
package/dist/providers/openai.js
CHANGED
|
@@ -21,5 +21,6 @@ export const openaiProvider = {
|
|
|
21
21
|
baseUrl: BASE,
|
|
22
22
|
defaultModel: "gpt-6-luna",
|
|
23
23
|
listModels: (apiKey) => listModelsHttp({ baseUrl: BASE, apiKey, staticModels: STATIC }),
|
|
24
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC }),
|
|
24
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC, reasoning: "openai" }),
|
|
25
|
+
supportsReasoning: (model) => /^(o\d|gpt-5|gpt-6)/i.test(model),
|
|
25
26
|
};
|
|
@@ -1,17 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
import { type RequestSpec } from "./spec.js";
|
|
2
|
+
export interface ModelInfo {
|
|
3
|
+
id: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface StreamOptions {
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
chatPath?: string;
|
|
11
|
+
modelsPath?: string | null;
|
|
12
|
+
query?: Record<string, string>;
|
|
13
|
+
pathParams?: Record<string, string>;
|
|
14
|
+
authHeaderName?: string;
|
|
15
|
+
authPrefix?: string;
|
|
16
|
+
staticModels?: ModelInfo[];
|
|
17
|
+
extraHeaders?: Record<string, string>;
|
|
18
|
+
/** Legacy auth prefix, e.g. "Bearer". Prefer authPrefix for new callers. */
|
|
19
|
+
authHeader?: string;
|
|
20
|
+
reasoning?: "openai" | "openrouter" | "none" | string;
|
|
21
|
+
}
|
|
22
|
+
export declare function toRequestSpec(opts: StreamOptions): RequestSpec;
|
|
23
|
+
export declare function streamChatCompletion(req: any, opts: StreamOptions): AsyncGenerator<{
|
|
2
24
|
delta: string;
|
|
3
25
|
done: boolean;
|
|
4
26
|
reasoning?: undefined;
|
|
5
27
|
usage?: undefined;
|
|
28
|
+
toolCalls?: undefined;
|
|
6
29
|
} | {
|
|
7
30
|
delta: string;
|
|
8
31
|
done: boolean;
|
|
9
32
|
reasoning: string;
|
|
10
33
|
usage?: undefined;
|
|
34
|
+
toolCalls?: undefined;
|
|
11
35
|
} | {
|
|
12
36
|
delta: string;
|
|
13
37
|
done: boolean;
|
|
14
38
|
usage: any;
|
|
39
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
15
40
|
reasoning?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
delta: string;
|
|
43
|
+
done: boolean;
|
|
44
|
+
usage: any;
|
|
45
|
+
reasoning?: undefined;
|
|
46
|
+
toolCalls?: undefined;
|
|
16
47
|
}, void, unknown>;
|
|
17
|
-
export declare function listModelsHttp(opts:
|
|
48
|
+
export declare function listModelsHttp(opts: StreamOptions): Promise<any>;
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
import { fetchJson, streamSSE } from "../lib/http.js";
|
|
2
|
+
import { finalizeToolCalls, mergeToolCallDelta } from "../lib/native-tools.js";
|
|
3
|
+
import { buildHeaders, buildRequestUrl } from "./spec.js";
|
|
4
|
+
export function toRequestSpec(opts) {
|
|
5
|
+
return {
|
|
6
|
+
baseUrl: trim(opts.baseUrl),
|
|
7
|
+
chatPath: opts.chatPath,
|
|
8
|
+
modelsPath: opts.modelsPath,
|
|
9
|
+
query: opts.query,
|
|
10
|
+
pathParams: opts.pathParams,
|
|
11
|
+
authHeaderName: opts.authHeaderName,
|
|
12
|
+
authPrefix: opts.authPrefix ?? (opts.authHeader !== undefined ? `${opts.authHeader} ` : undefined),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
2
15
|
/** Build a chat-completions body in the classic or the newer (compat) dialect. */
|
|
3
|
-
function buildBody(req, compat) {
|
|
16
|
+
function buildBody(req, compat, opts, includeReasoning = true) {
|
|
4
17
|
const messages = [];
|
|
5
18
|
if (req.system)
|
|
6
19
|
messages.push({ role: "system", content: req.system });
|
|
7
|
-
for (const m of req.messages)
|
|
20
|
+
for (const m of req.messages) {
|
|
21
|
+
if (m.role === "tool") {
|
|
22
|
+
messages.push({ role: "tool", tool_call_id: m.toolCallId, content: m.content });
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (m.role === "assistant" && m.toolCalls && m.toolCalls.length > 0) {
|
|
26
|
+
messages.push({
|
|
27
|
+
role: "assistant",
|
|
28
|
+
content: m.content || null,
|
|
29
|
+
tool_calls: m.toolCalls.map((call) => ({
|
|
30
|
+
id: call.id,
|
|
31
|
+
type: "function",
|
|
32
|
+
function: { name: call.name, arguments: call.arguments },
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
8
37
|
messages.push({ role: m.role, content: m.content });
|
|
38
|
+
}
|
|
9
39
|
const body = { model: req.model, messages, stream: true };
|
|
40
|
+
if (req.tools && req.tools.length > 0) {
|
|
41
|
+
body.tools = req.tools;
|
|
42
|
+
body.tool_choice = "auto";
|
|
43
|
+
}
|
|
10
44
|
if (req.maxOutputTokens !== undefined) {
|
|
11
45
|
if (compat)
|
|
12
46
|
body.max_completion_tokens = req.maxOutputTokens;
|
|
@@ -15,38 +49,56 @@ function buildBody(req, compat) {
|
|
|
15
49
|
}
|
|
16
50
|
if (req.temperature !== undefined && !compat)
|
|
17
51
|
body.temperature = req.temperature;
|
|
52
|
+
if (includeReasoning && req.reasoningEffort && req.reasoningEffort !== "auto") {
|
|
53
|
+
const effort = req.reasoningEffort === "max" ? "high" : req.reasoningEffort;
|
|
54
|
+
if (opts.reasoning === "openai")
|
|
55
|
+
body.reasoning_effort = effort;
|
|
56
|
+
else if (opts.reasoning === "openrouter")
|
|
57
|
+
body.reasoning = { effort };
|
|
58
|
+
}
|
|
18
59
|
return body;
|
|
19
60
|
}
|
|
20
61
|
export async function* streamChatCompletion(req, opts) {
|
|
21
|
-
const
|
|
62
|
+
const hasReasoning = Boolean(req.reasoningEffort && req.reasoningEffort !== "auto" && opts.reasoning && opts.reasoning !== "none");
|
|
63
|
+
const spec = toRequestSpec(opts);
|
|
64
|
+
const send = async (compat, includeReasoning = hasReasoning) => {
|
|
22
65
|
const headers = {
|
|
23
66
|
"content-type": "application/json",
|
|
24
67
|
accept: "text/event-stream",
|
|
25
68
|
...(opts.extraHeaders ?? {}),
|
|
26
69
|
};
|
|
27
70
|
if (opts.apiKey)
|
|
28
|
-
headers
|
|
29
|
-
|
|
71
|
+
Object.assign(headers, buildHeaders(spec, opts.apiKey));
|
|
72
|
+
if (req.clientRequestId)
|
|
73
|
+
headers["idempotency-key"] = req.clientRequestId;
|
|
74
|
+
return await fetch(buildRequestUrl(spec, opts.chatPath ?? "/chat/completions"), {
|
|
30
75
|
method: "POST",
|
|
31
76
|
headers,
|
|
32
|
-
body: JSON.stringify(buildBody(req, compat)),
|
|
77
|
+
body: JSON.stringify(buildBody(req, compat, opts, includeReasoning)),
|
|
33
78
|
signal: req.signal,
|
|
34
79
|
});
|
|
35
80
|
};
|
|
36
81
|
let res = await send(false);
|
|
37
82
|
if (!res.ok) {
|
|
38
|
-
|
|
83
|
+
let detail = await res.text().catch(() => "");
|
|
84
|
+
// Some models reject the thinking parameter even though the provider
|
|
85
|
+
// as a whole accepts it. Drop it once, then keep the request alive.
|
|
86
|
+
if (res.status === 400 && hasReasoning && /reasoning|thinking|effort|unsupported|unrecognized|unknown parameter/i.test(detail)) {
|
|
87
|
+
res = await send(false, false);
|
|
88
|
+
detail = res.ok ? detail : await res.text().catch(() => "");
|
|
89
|
+
}
|
|
39
90
|
// Newer OpenAI-style models reject max_tokens and temperature. Retry once
|
|
40
91
|
// in the compatibility dialect before surfacing the real error.
|
|
41
|
-
if (res.status === 400 && /max_tokens|max_completion_tokens|temperature|unsupported|unrecognized|unknown parameter/i.test(detail)) {
|
|
42
|
-
res = await send(true);
|
|
92
|
+
if (!res.ok && res.status === 400 && /max_tokens|max_completion_tokens|temperature|unsupported|unrecognized|unknown parameter/i.test(detail)) {
|
|
93
|
+
res = await send(true, false);
|
|
94
|
+
detail = res.ok ? detail : await res.text().catch(() => "");
|
|
43
95
|
}
|
|
44
96
|
if (!res.ok) {
|
|
45
|
-
|
|
46
|
-
throw new Error(res.status + " " + res.statusText + ": " + body.slice(0, 500));
|
|
97
|
+
throw new Error(res.status + " " + res.statusText + ": " + detail.slice(0, 500));
|
|
47
98
|
}
|
|
48
99
|
}
|
|
49
100
|
let usage;
|
|
101
|
+
const toolCalls = new Map();
|
|
50
102
|
for await (const ev of streamSSE(res)) {
|
|
51
103
|
if (ev.data === "[DONE]")
|
|
52
104
|
break;
|
|
@@ -61,6 +113,14 @@ export async function* streamChatCompletion(req, opts) {
|
|
|
61
113
|
const choice = obj.choices?.[0];
|
|
62
114
|
const raw = choice?.delta?.content ?? choice?.text;
|
|
63
115
|
const reasoning = choice?.delta?.reasoning_content ?? choice?.delta?.reasoning;
|
|
116
|
+
if (Array.isArray(choice?.delta?.tool_calls)) {
|
|
117
|
+
for (const delta of choice.delta.tool_calls)
|
|
118
|
+
mergeToolCallDelta(toolCalls, delta);
|
|
119
|
+
}
|
|
120
|
+
if (Array.isArray(choice?.message?.tool_calls)) {
|
|
121
|
+
for (const delta of choice.message.tool_calls)
|
|
122
|
+
mergeToolCallDelta(toolCalls, delta);
|
|
123
|
+
}
|
|
64
124
|
if (obj.usage) {
|
|
65
125
|
usage = {
|
|
66
126
|
inputTokens: obj.usage.prompt_tokens,
|
|
@@ -78,17 +138,19 @@ export async function* streamChatCompletion(req, opts) {
|
|
|
78
138
|
else if (typeof reasoning === "string" && reasoning)
|
|
79
139
|
yield { delta: "", done: false, reasoning };
|
|
80
140
|
}
|
|
81
|
-
|
|
141
|
+
const calls = finalizeToolCalls(toolCalls);
|
|
142
|
+
yield calls.length > 0 ? { delta: "", done: true, usage, toolCalls: calls } : { delta: "", done: true, usage };
|
|
82
143
|
}
|
|
83
144
|
export async function listModelsHttp(opts) {
|
|
84
145
|
const staticModels = opts.staticModels ?? [];
|
|
146
|
+
if (opts.modelsPath === null)
|
|
147
|
+
return staticModels;
|
|
85
148
|
if (!opts.apiKey && staticModels.length)
|
|
86
149
|
return staticModels;
|
|
87
150
|
try {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const json = await fetchJson(trim(opts.baseUrl) + "/models", { headers });
|
|
151
|
+
const spec = toRequestSpec(opts);
|
|
152
|
+
const headers = opts.apiKey ? buildHeaders(spec, opts.apiKey) : {};
|
|
153
|
+
const json = await fetchJson(buildRequestUrl(spec, opts.modelsPath ?? "/models"), { headers });
|
|
92
154
|
const ids = (json.data ?? [])
|
|
93
155
|
.map((m) => m.id)
|
|
94
156
|
.filter((id) => typeof id === "string" && id.length > 0);
|
|
@@ -10,15 +10,25 @@ export declare const openrouterProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: () => boolean;
|
|
24
34
|
};
|
|
@@ -22,5 +22,6 @@ export const openrouterProvider = {
|
|
|
22
22
|
baseUrl: BASE,
|
|
23
23
|
defaultModel: "anthropic/claude-sonnet-5.5",
|
|
24
24
|
listModels: (apiKey) => listModelsHttp({ baseUrl: BASE, apiKey, staticModels: STATIC, extraHeaders: EXTRA_HEADERS }),
|
|
25
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC, extraHeaders: EXTRA_HEADERS }),
|
|
25
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC, extraHeaders: EXTRA_HEADERS, reasoning: "openrouter" }),
|
|
26
|
+
supportsReasoning: () => true,
|
|
26
27
|
};
|
package/dist/providers/qwen.d.ts
CHANGED
|
@@ -10,15 +10,25 @@ export declare const qwenProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: () => boolean;
|
|
24
34
|
};
|
package/dist/providers/qwen.js
CHANGED
|
@@ -19,5 +19,6 @@ export const qwenProvider = {
|
|
|
19
19
|
},
|
|
20
20
|
defaultModel: "qwen3.8-max",
|
|
21
21
|
listModels: (apiKey) => listModelsHttp({ baseUrl: baseUrl(), apiKey, staticModels: STATIC }),
|
|
22
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: baseUrl(), apiKey, staticModels: STATIC }),
|
|
22
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: baseUrl(), apiKey, staticModels: STATIC, reasoning: "openai" }),
|
|
23
|
+
supportsReasoning: () => true,
|
|
23
24
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RequestSpec {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
chatPath?: string;
|
|
4
|
+
modelsPath?: string | null;
|
|
5
|
+
query?: Record<string, string>;
|
|
6
|
+
pathParams?: Record<string, string>;
|
|
7
|
+
authHeaderName?: string;
|
|
8
|
+
authPrefix?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveBaseUrl(spec: RequestSpec): string;
|
|
11
|
+
export declare function buildRequestUrl(spec: RequestSpec, path: string, params?: Record<string, string>): string;
|
|
12
|
+
export declare function buildHeaders(spec: RequestSpec, apiKey: string, extra?: Record<string, string>): Record<string, string>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const ENV_MAP = {
|
|
2
|
+
region: "AWS_REGION",
|
|
3
|
+
account_id: "CLOUDFLARE_ACCOUNT_ID",
|
|
4
|
+
project_id: "GOOGLE_CLOUD_PROJECT",
|
|
5
|
+
deployment: "AZURE_OPENAI_DEPLOYMENT",
|
|
6
|
+
};
|
|
7
|
+
export function resolveBaseUrl(spec) {
|
|
8
|
+
return spec.baseUrl.replace(/\{(\w+)\}/g, (_, key) => {
|
|
9
|
+
const envName = ENV_MAP[key];
|
|
10
|
+
const value = envName ? process.env[envName] : undefined;
|
|
11
|
+
if (!value)
|
|
12
|
+
throw new Error(`Missing ${envName ?? key} for placeholder {${key}}`);
|
|
13
|
+
return value;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function buildRequestUrl(spec, path, params) {
|
|
17
|
+
const base = resolveBaseUrl(spec);
|
|
18
|
+
const merged = { ...spec.pathParams, ...params };
|
|
19
|
+
const resolvedPath = path.replace(/\{(\w+)\}/g, (_, key) => merged[key] ?? `{${key}}`);
|
|
20
|
+
const query = spec.query ? "?" + new URLSearchParams(spec.query).toString() : "";
|
|
21
|
+
return base + resolvedPath + query;
|
|
22
|
+
}
|
|
23
|
+
export function buildHeaders(spec, apiKey, extra) {
|
|
24
|
+
const headers = {
|
|
25
|
+
[spec.authHeaderName ?? "authorization"]: (spec.authPrefix ?? "Bearer ") + apiKey,
|
|
26
|
+
...extra,
|
|
27
|
+
};
|
|
28
|
+
return headers;
|
|
29
|
+
}
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -10,15 +10,25 @@ export declare const xaiProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: () => boolean;
|
|
24
34
|
};
|
package/dist/providers/xai.js
CHANGED
|
@@ -14,5 +14,6 @@ export const xaiProvider = {
|
|
|
14
14
|
baseUrl: BASE,
|
|
15
15
|
defaultModel: "grok-4.7",
|
|
16
16
|
listModels: (apiKey) => listModelsHttp({ baseUrl: BASE, apiKey, staticModels: STATIC }),
|
|
17
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC }),
|
|
17
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: BASE, apiKey, staticModels: STATIC, reasoning: "openai" }),
|
|
18
|
+
supportsReasoning: () => true,
|
|
18
19
|
};
|
|
@@ -10,15 +10,25 @@ export declare const zhipuProvider: {
|
|
|
10
10
|
done: boolean;
|
|
11
11
|
reasoning?: undefined;
|
|
12
12
|
usage?: undefined;
|
|
13
|
+
toolCalls?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
delta: string;
|
|
15
16
|
done: boolean;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
usage?: undefined;
|
|
19
|
+
toolCalls?: undefined;
|
|
18
20
|
} | {
|
|
19
21
|
delta: string;
|
|
20
22
|
done: boolean;
|
|
21
23
|
usage: any;
|
|
24
|
+
toolCalls: import("../types.js").NativeToolCall[];
|
|
22
25
|
reasoning?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
delta: string;
|
|
28
|
+
done: boolean;
|
|
29
|
+
usage: any;
|
|
30
|
+
reasoning?: undefined;
|
|
31
|
+
toolCalls?: undefined;
|
|
23
32
|
}, void, unknown>;
|
|
33
|
+
supportsReasoning: () => boolean;
|
|
24
34
|
};
|
package/dist/providers/zhipu.js
CHANGED
|
@@ -19,5 +19,6 @@ export const zhipuProvider = {
|
|
|
19
19
|
},
|
|
20
20
|
defaultModel: "glm-5.3",
|
|
21
21
|
listModels: (apiKey) => listModelsHttp({ baseUrl: baseUrl(), apiKey, staticModels: STATIC }),
|
|
22
|
-
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: baseUrl(), apiKey, staticModels: STATIC }),
|
|
22
|
+
stream: (req, apiKey) => streamChatCompletion(req, { baseUrl: baseUrl(), apiKey, staticModels: STATIC, reasoning: "openai" }),
|
|
23
|
+
supportsReasoning: () => true,
|
|
23
24
|
};
|
package/dist/session/log.d.ts
CHANGED
|
@@ -1,16 +1,49 @@
|
|
|
1
|
+
export interface ActiveFile {
|
|
2
|
+
path: string;
|
|
3
|
+
sha1_8: string;
|
|
4
|
+
mtime: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SessionSummary {
|
|
7
|
+
id: string;
|
|
8
|
+
file: string;
|
|
9
|
+
cwd: string;
|
|
10
|
+
providerId: string;
|
|
11
|
+
model: string;
|
|
12
|
+
turns: number;
|
|
13
|
+
activeFiles: ActiveFile[];
|
|
14
|
+
messages: number;
|
|
15
|
+
lastTs: number;
|
|
16
|
+
}
|
|
17
|
+
/** Reserved slot for conversation compaction at the exit save point. */
|
|
18
|
+
export interface SessionCompactionSlot {
|
|
19
|
+
source?: "local" | "server" | "none";
|
|
20
|
+
summaryRef?: string | null;
|
|
21
|
+
pending?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface SessionCloseInfo {
|
|
24
|
+
reason?: "exit" | "signal" | "fatal" | "close";
|
|
25
|
+
compaction?: SessionCompactionSlot;
|
|
26
|
+
}
|
|
1
27
|
export declare function sessionCacheLimitBytes(): number;
|
|
2
28
|
export declare function loggingEnabled(): boolean;
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
29
|
+
export declare function projectionPath(file: string): string;
|
|
30
|
+
export declare function fsyncMode(): "on" | "off" | "auto";
|
|
31
|
+
export declare function fsyncEnabled(type?: string): boolean;
|
|
32
|
+
/** Summary files referenced by older compacted facts in this session. */
|
|
33
|
+
export declare function staleSummaryRefs(file: string): string[];
|
|
34
|
+
export declare function createSessionLog(meta?: Record<string, any>): {
|
|
35
|
+
id: string;
|
|
36
|
+
file: string;
|
|
37
|
+
append: (entry: Record<string, any>) => number;
|
|
38
|
+
count(): number;
|
|
39
|
+
close(info?: SessionCloseInfo): void;
|
|
8
40
|
};
|
|
9
|
-
export declare function openSessionLog(file: any): {
|
|
10
|
-
id:
|
|
11
|
-
file:
|
|
12
|
-
append: (entry: any) =>
|
|
13
|
-
|
|
41
|
+
export declare function openSessionLog(file: string, meta?: Record<string, any>): {
|
|
42
|
+
id: string;
|
|
43
|
+
file: string;
|
|
44
|
+
append: (entry: Record<string, any>) => number;
|
|
45
|
+
count(): number;
|
|
46
|
+
close(info?: SessionCloseInfo): void;
|
|
14
47
|
};
|
|
15
48
|
export declare function listSessions(): {
|
|
16
49
|
id: string;
|
|
@@ -19,11 +52,13 @@ export declare function listSessions(): {
|
|
|
19
52
|
modified: string;
|
|
20
53
|
messages: number;
|
|
21
54
|
}[];
|
|
22
|
-
export declare function resolveSessionFile(idOrFile:
|
|
23
|
-
export declare function readSession(idOrFile:
|
|
24
|
-
export declare function loadSessionMessages(idOrFile:
|
|
55
|
+
export declare function resolveSessionFile(idOrFile: string): string;
|
|
56
|
+
export declare function readSession(idOrFile: string): any[];
|
|
57
|
+
export declare function loadSessionMessages(idOrFile: string): {
|
|
25
58
|
role: any;
|
|
26
59
|
content: any;
|
|
27
60
|
}[];
|
|
28
|
-
export declare function latestSessionFile(): string;
|
|
61
|
+
export declare function latestSessionFile(): string | undefined;
|
|
62
|
+
export declare function findUnclosedSessions(): SessionSummary[];
|
|
63
|
+
export declare function latestUnclosedSession(): SessionSummary | undefined;
|
|
29
64
|
export declare function pruneSessions(limit?: number): number;
|