@ottocode/sdk 0.1.266 → 0.1.268
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 +2 -2
- package/src/config/src/index.ts +4 -0
- package/src/config/src/manager.ts +8 -14
- package/src/config/src/paths.ts +4 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ottocode/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.268",
|
|
4
4
|
"description": "AI agent SDK for building intelligent assistants - tree-shakable and comprehensive",
|
|
5
5
|
"author": "nitishxyz",
|
|
6
6
|
"license": "MIT",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@modelcontextprotocol/sdk": "^1.12",
|
|
103
103
|
"@openauthjs/openauth": "^0.4.3",
|
|
104
104
|
"@openrouter/ai-sdk-provider": "^1.2.0",
|
|
105
|
-
"@ottorouter/ai-sdk": "0.2.
|
|
105
|
+
"@ottorouter/ai-sdk": "0.2.4",
|
|
106
106
|
"@solana/web3.js": "^1.98.0",
|
|
107
107
|
"ai": "^6.0.170",
|
|
108
108
|
"ai-sdk-ollama": "^3.8.3",
|
package/src/config/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getGlobalConfigPath,
|
|
3
|
+
getGlobalSkillsConfigPath,
|
|
3
4
|
getLocalDataDir,
|
|
4
5
|
ensureDir,
|
|
5
6
|
fileExists,
|
|
@@ -54,13 +55,16 @@ export async function loadConfig(
|
|
|
54
55
|
const dbPath = joinPath(dataDir, 'otto.sqlite');
|
|
55
56
|
const projectConfigPath = joinPath(dataDir, 'config.json');
|
|
56
57
|
const globalConfigPath = getGlobalConfigPath();
|
|
58
|
+
const globalSkillsConfigPath = getGlobalSkillsConfigPath();
|
|
57
59
|
|
|
58
60
|
const projectCfg = await readJsonOptional(projectConfigPath);
|
|
59
61
|
const globalCfg = await readJsonOptional(globalConfigPath);
|
|
62
|
+
const globalSkillsCfg = await readJsonOptional(globalSkillsConfigPath);
|
|
60
63
|
|
|
61
64
|
const merged = deepMerge(
|
|
62
65
|
DEFAULTS,
|
|
63
66
|
globalCfg,
|
|
67
|
+
globalSkillsCfg ? { skills: globalSkillsCfg } : undefined,
|
|
64
68
|
omitGlobalOnlySettings(projectCfg),
|
|
65
69
|
);
|
|
66
70
|
|
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
import {
|
|
14
14
|
getGlobalConfigDir,
|
|
15
15
|
getGlobalConfigPath,
|
|
16
|
+
getGlobalSkillsConfigPath,
|
|
16
17
|
getGlobalDebugDir,
|
|
17
18
|
getGlobalDebugLogPath,
|
|
18
19
|
getGlobalDebugSessionsDir,
|
|
@@ -151,25 +152,18 @@ export async function writeSkillSettings(
|
|
|
151
152
|
updates: SkillSettings,
|
|
152
153
|
_projectRoot?: string,
|
|
153
154
|
) {
|
|
154
|
-
const filePath =
|
|
155
|
+
const filePath = getGlobalSkillsConfigPath();
|
|
155
156
|
const existing = await readJsonFile(filePath);
|
|
156
|
-
const prevSkills =
|
|
157
|
-
existing && typeof existing.skills === 'object'
|
|
158
|
-
? (existing.skills as Record<string, unknown>)
|
|
159
|
-
: {};
|
|
160
157
|
const prevItems =
|
|
161
|
-
|
|
162
|
-
? (
|
|
158
|
+
existing?.items && typeof existing.items === 'object'
|
|
159
|
+
? (existing.items as Record<string, unknown>)
|
|
163
160
|
: {};
|
|
164
161
|
const next = {
|
|
165
162
|
...existing,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
...
|
|
169
|
-
items
|
|
170
|
-
...prevItems,
|
|
171
|
-
...(updates.items ?? {}),
|
|
172
|
-
},
|
|
163
|
+
...updates,
|
|
164
|
+
items: {
|
|
165
|
+
...prevItems,
|
|
166
|
+
...(updates.items ?? {}),
|
|
173
167
|
},
|
|
174
168
|
};
|
|
175
169
|
await writeConfigFile(filePath, next);
|
package/src/config/src/paths.ts
CHANGED
|
@@ -31,6 +31,10 @@ export function getGlobalConfigPath(): string {
|
|
|
31
31
|
return joinPath(getGlobalConfigDir(), 'config.json');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
export function getGlobalSkillsConfigPath(): string {
|
|
35
|
+
return joinPath(getGlobalConfigDir(), 'skills.json');
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
export function getGlobalAuthPath(): string {
|
|
35
39
|
return joinPath(getGlobalConfigDir(), 'auth.json');
|
|
36
40
|
}
|