@ottocode/sdk 0.1.313 → 0.1.315
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/package.json +1 -1
- package/src/config/src/index.ts +38 -8
- package/src/config/src/manager.ts +2 -0
- package/src/config/src/paths.ts +221 -3
- package/src/core/src/providers/resolver.ts +1 -2
- package/src/core/src/tools/builtin/fs/copy-attachment.ts +28 -13
- package/src/core/src/tools/builtin/fs/edit.txt +1 -1
- package/src/core/src/tools/builtin/fs/index.ts +2 -0
- package/src/core/src/tools/builtin/fs/multiedit.txt +1 -1
- package/src/core/src/tools/builtin/git-identity.ts +37 -3
- package/src/core/src/tools/builtin/git.ts +8 -2
- package/src/core/src/tools/builtin/glob.txt +4 -0
- package/src/core/src/tools/builtin/patch/indentation.ts +8 -1
- package/src/core/src/tools/builtin/patch/normalize.ts +4 -0
- package/src/core/src/tools/builtin/patch/repair.ts +42 -0
- package/src/core/src/tools/builtin/patch.txt +2 -0
- package/src/core/src/tools/builtin/search.txt +4 -0
- package/src/core/src/tools/builtin/shell.ts +54 -12
- package/src/core/src/tools/builtin/shell.txt +5 -0
- package/src/core/src/tools/builtin/terminal.ts +11 -3
- package/src/core/src/tools/loader.ts +8 -4
- package/src/index.ts +17 -5
- package/src/prompts/src/agents/build.txt +2 -2
- package/src/prompts/src/providers/{moonshot.txt → kimi.txt} +1 -1
- package/src/prompts/src/providers.ts +5 -5
- package/src/providers/src/catalog-manual.ts +53 -8
- package/src/providers/src/catalog.ts +74 -34
- package/src/providers/src/env.ts +4 -7
- package/src/providers/src/index.ts +3 -9
- package/src/providers/src/{moonshot-client.ts → kimi-client.ts} +131 -15
- package/src/providers/src/model-merge.ts +7 -1
- package/src/providers/src/pricing.ts +1 -1
- package/src/providers/src/registry.ts +8 -19
- package/src/providers/src/utils.ts +11 -8
- package/src/types/src/config.ts +12 -1
- package/src/types/src/provider.ts +4 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { catalog } from './catalog-merged.ts';
|
|
2
|
+
import { filterAvailableKimiModels } from './catalog-manual.ts';
|
|
2
3
|
import { getCachedProviderCatalogEntry } from './model-catalog-cache.ts';
|
|
3
4
|
import { mergeModelLists } from './model-merge.ts';
|
|
4
5
|
import type {
|
|
@@ -45,13 +46,13 @@ const PREFERRED_FAST_MODELS: Partial<Record<ProviderId, string[]>> = {
|
|
|
45
46
|
xai: ['grok-code-fast-1', 'grok-4-fast'],
|
|
46
47
|
zai: ['glm-4.5-flash'],
|
|
47
48
|
copilot: ['gpt-4.1-mini'],
|
|
48
|
-
|
|
49
|
+
kimi: ['kimi-k2.7-code'],
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
const PREFERRED_FAST_MODELS_OAUTH: Partial<Record<ProviderId, string[]>> = {
|
|
52
53
|
openai: ['gpt-5.4-mini'],
|
|
53
54
|
anthropic: ['claude-haiku-4-5'],
|
|
54
|
-
|
|
55
|
+
kimi: ['kimi-k2.7-code'],
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
function preferredFastModelKey(provider: ProviderId): ProviderId {
|
|
@@ -147,7 +148,7 @@ const OWNER_TO_FAMILY: Record<ModelOwner, UnderlyingProviderKey> = {
|
|
|
147
148
|
google: 'google',
|
|
148
149
|
openrouter: 'openai-compatible',
|
|
149
150
|
xai: 'openai',
|
|
150
|
-
|
|
151
|
+
kimi: 'kimi',
|
|
151
152
|
qwen: 'openai-compatible',
|
|
152
153
|
zai: 'glm',
|
|
153
154
|
minimax: 'minimax',
|
|
@@ -160,7 +161,7 @@ const DIRECT_PROVIDER_FAMILY: Partial<
|
|
|
160
161
|
anthropic: 'anthropic',
|
|
161
162
|
google: 'google',
|
|
162
163
|
'ollama-cloud': 'openai-compatible',
|
|
163
|
-
|
|
164
|
+
kimi: 'kimi',
|
|
164
165
|
minimax: 'minimax',
|
|
165
166
|
copilot: 'openai',
|
|
166
167
|
xai: 'openai',
|
|
@@ -172,7 +173,7 @@ export type UnderlyingProviderKey =
|
|
|
172
173
|
| 'anthropic'
|
|
173
174
|
| 'openai'
|
|
174
175
|
| 'google'
|
|
175
|
-
| '
|
|
176
|
+
| 'kimi'
|
|
176
177
|
| 'minimax'
|
|
177
178
|
| 'glm'
|
|
178
179
|
| 'openai-compatible'
|
|
@@ -192,8 +193,7 @@ function inferFromModelId(model: string): UnderlyingProviderKey {
|
|
|
192
193
|
if (lower.includes('grok') || lower.startsWith('xai/')) return 'openai';
|
|
193
194
|
if (lower.includes('qwen') || lower.startsWith('qwen/'))
|
|
194
195
|
return 'openai-compatible';
|
|
195
|
-
if (lower.includes('kimi') || lower.startsWith('moonshotai/'))
|
|
196
|
-
return 'moonshot';
|
|
196
|
+
if (lower.includes('kimi') || lower.startsWith('moonshotai/')) return 'kimi';
|
|
197
197
|
if (
|
|
198
198
|
lower.includes('glm') ||
|
|
199
199
|
lower.startsWith('z-ai/') ||
|
|
@@ -263,7 +263,10 @@ function getProviderModels(provider: ProviderId): ModelInfo[] {
|
|
|
263
263
|
const cachedModels = getCachedProviderCatalogEntry(
|
|
264
264
|
catalogProvider ?? provider,
|
|
265
265
|
)?.models;
|
|
266
|
-
|
|
266
|
+
const models = mergeModelLists(catalogModels, cachedModels);
|
|
267
|
+
return catalogProvider === 'kimi'
|
|
268
|
+
? filterAvailableKimiModels(models)
|
|
269
|
+
: models;
|
|
267
270
|
}
|
|
268
271
|
|
|
269
272
|
export function modelSupportsReasoning(
|
package/src/types/src/config.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type DefaultConfig = {
|
|
|
31
31
|
reasoningText?: boolean;
|
|
32
32
|
reasoningLevel?: ReasoningLevel;
|
|
33
33
|
theme?: string;
|
|
34
|
+
tuiTheme?: string;
|
|
34
35
|
vimMode?: boolean;
|
|
35
36
|
compactThread?: boolean;
|
|
36
37
|
fontFamily?: string;
|
|
@@ -38,6 +39,8 @@ export type DefaultConfig = {
|
|
|
38
39
|
releaseToSend?: boolean;
|
|
39
40
|
fullWidthContent?: boolean;
|
|
40
41
|
autoCompactThresholdTokens?: number | null;
|
|
42
|
+
/** Adds the ottocode bot as a co-author on commits made through Otto. */
|
|
43
|
+
coAuthorCommits?: boolean;
|
|
41
44
|
/** Enables the otto supervisor agent and persistent goals (disabled together). */
|
|
42
45
|
ottoEnabled?: boolean;
|
|
43
46
|
};
|
|
@@ -74,9 +77,17 @@ export type SkillSettings = {
|
|
|
74
77
|
* Path configuration
|
|
75
78
|
*/
|
|
76
79
|
export type PathConfig = {
|
|
80
|
+
projectConfigDir: string;
|
|
81
|
+
projectConfigPath: string | null;
|
|
82
|
+
projectStateDir: string;
|
|
77
83
|
dataDir: string;
|
|
78
84
|
dbPath: string;
|
|
79
|
-
|
|
85
|
+
attachmentsDir: string;
|
|
86
|
+
debugDir: string;
|
|
87
|
+
debugDumpsDir: string;
|
|
88
|
+
logsDir: string;
|
|
89
|
+
tmpDir: string;
|
|
90
|
+
cacheDir: string;
|
|
80
91
|
globalConfigPath: string | null;
|
|
81
92
|
};
|
|
82
93
|
|
|
@@ -13,7 +13,7 @@ export type BuiltInProviderId =
|
|
|
13
13
|
| 'xai'
|
|
14
14
|
| 'zai'
|
|
15
15
|
| 'zai-coding'
|
|
16
|
-
| '
|
|
16
|
+
| 'kimi'
|
|
17
17
|
| 'minimax';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -40,7 +40,7 @@ export type ProviderPromptFamily =
|
|
|
40
40
|
| 'anthropic'
|
|
41
41
|
| 'openai'
|
|
42
42
|
| 'google'
|
|
43
|
-
| '
|
|
43
|
+
| 'kimi'
|
|
44
44
|
| 'minimax'
|
|
45
45
|
| 'glm'
|
|
46
46
|
| 'openai-compatible';
|
|
@@ -52,7 +52,7 @@ export type ProviderFamily =
|
|
|
52
52
|
| 'openai'
|
|
53
53
|
| 'anthropic'
|
|
54
54
|
| 'google'
|
|
55
|
-
| '
|
|
55
|
+
| 'kimi'
|
|
56
56
|
| 'minimax'
|
|
57
57
|
| 'openai-compatible';
|
|
58
58
|
|
|
@@ -66,7 +66,7 @@ export type ModelOwner =
|
|
|
66
66
|
| 'google'
|
|
67
67
|
| 'openrouter'
|
|
68
68
|
| 'xai'
|
|
69
|
-
| '
|
|
69
|
+
| 'kimi'
|
|
70
70
|
| 'qwen'
|
|
71
71
|
| 'zai'
|
|
72
72
|
| 'minimax';
|