@ottocode/sdk 0.1.266 → 0.1.267

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ottocode/sdk",
3
- "version": "0.1.266",
3
+ "version": "0.1.267",
4
4
  "description": "AI agent SDK for building intelligent assistants - tree-shakable and comprehensive",
5
5
  "author": "nitishxyz",
6
6
  "license": "MIT",
@@ -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 = getConfigFilePath('global');
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
- prevSkills.items && typeof prevSkills.items === 'object'
162
- ? (prevSkills.items as Record<string, unknown>)
158
+ existing?.items && typeof existing.items === 'object'
159
+ ? (existing.items as Record<string, unknown>)
163
160
  : {};
164
161
  const next = {
165
162
  ...existing,
166
- skills: {
167
- ...prevSkills,
168
- ...updates,
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);
@@ -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
  }
package/src/index.ts CHANGED
@@ -218,6 +218,7 @@ export {
218
218
  getLocalDataDir,
219
219
  getGlobalConfigDir,
220
220
  getGlobalConfigPath,
221
+ getGlobalSkillsConfigPath,
221
222
  getGlobalAgentsJsonPath,
222
223
  getGlobalAgentsDir,
223
224
  getGlobalToolsDir,