@dexto/agent-management 1.4.0 → 1.5.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/dist/AgentFactory.cjs +1 -2
- package/dist/AgentFactory.d.ts +1 -1
- package/dist/AgentFactory.d.ts.map +1 -1
- package/dist/AgentFactory.js +1 -2
- package/dist/config/config-enrichment.cjs +1 -1
- package/dist/config/config-enrichment.d.ts +1 -1
- package/dist/config/config-enrichment.js +1 -1
- package/dist/config/errors.cjs +2 -2
- package/dist/config/errors.js +2 -2
- package/dist/index.cjs +69 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -2
- package/dist/installation.cjs +0 -13
- package/dist/installation.d.ts +0 -2
- package/dist/installation.d.ts.map +1 -1
- package/dist/installation.js +0 -13
- package/dist/models/custom-models.cjs +43 -2
- package/dist/models/custom-models.d.ts +49 -6
- package/dist/models/custom-models.d.ts.map +1 -1
- package/dist/models/custom-models.js +42 -2
- package/dist/models/index.cjs +89 -0
- package/dist/models/index.d.ts +11 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +68 -0
- package/dist/models/path-resolver.cjs +154 -0
- package/dist/models/path-resolver.d.ts +77 -0
- package/dist/models/path-resolver.d.ts.map +1 -0
- package/dist/models/path-resolver.js +108 -0
- package/dist/models/state-manager.cjs +220 -0
- package/dist/models/state-manager.d.ts +138 -0
- package/dist/models/state-manager.d.ts.map +1 -0
- package/dist/models/state-manager.js +184 -0
- package/dist/preferences/error-codes.cjs +2 -0
- package/dist/preferences/error-codes.d.ts +3 -1
- package/dist/preferences/error-codes.d.ts.map +1 -1
- package/dist/preferences/error-codes.js +2 -0
- package/dist/preferences/index.d.ts +1 -1
- package/dist/preferences/index.d.ts.map +1 -1
- package/dist/preferences/loader.cjs +32 -6
- package/dist/preferences/loader.d.ts +23 -4
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +32 -6
- package/dist/preferences/schemas.cjs +21 -3
- package/dist/preferences/schemas.d.ts +52 -24
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +28 -4
- package/dist/registry/registry.cjs +7 -43
- package/dist/registry/registry.d.ts +3 -6
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +7 -43
- package/dist/registry/types.d.ts +2 -4
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/resolver.cjs +20 -20
- package/dist/resolver.d.ts +1 -2
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +20 -20
- package/dist/utils/api-key-resolver.cjs +19 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +19 -1
- package/dist/utils/api-key-store.cjs +46 -0
- package/dist/utils/api-key-store.d.ts +27 -0
- package/dist/utils/api-key-store.d.ts.map +1 -1
- package/dist/utils/api-key-store.js +44 -0
- package/dist/utils/env-file.cjs +20 -68
- package/dist/utils/env-file.d.ts +2 -1
- package/dist/utils/env-file.d.ts.map +1 -1
- package/dist/utils/env-file.js +20 -68
- package/dist/writer.cjs +20 -2
- package/dist/writer.d.ts +1 -0
- package/dist/writer.d.ts.map +1 -1
- package/dist/writer.js +20 -2
- package/package.json +2 -2
package/dist/AgentFactory.cjs
CHANGED
|
@@ -72,8 +72,7 @@ const AgentFactory = {
|
|
|
72
72
|
/**
|
|
73
73
|
* Install a custom agent from local path
|
|
74
74
|
*/
|
|
75
|
-
async installCustomAgent(agentId, sourcePath, metadata,
|
|
76
|
-
const options = typeof injectPreferences === "boolean" ? { injectPreferences } : injectPreferences || {};
|
|
75
|
+
async installCustomAgent(agentId, sourcePath, metadata, options) {
|
|
77
76
|
return (0, import_installation.installCustomAgent)(agentId, sourcePath, metadata, options);
|
|
78
77
|
},
|
|
79
78
|
/**
|
package/dist/AgentFactory.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export declare const AgentFactory: {
|
|
|
78
78
|
/**
|
|
79
79
|
* Install a custom agent from local path
|
|
80
80
|
*/
|
|
81
|
-
installCustomAgent(agentId: string, sourcePath: string, metadata: Pick<AgentMetadata, "name" | "description" | "author" | "tags">,
|
|
81
|
+
installCustomAgent(agentId: string, sourcePath: string, metadata: Pick<AgentMetadata, "name" | "description" | "author" | "tags">, options?: InstallOptions): Promise<string>;
|
|
82
82
|
/**
|
|
83
83
|
* Uninstall an agent
|
|
84
84
|
* @param agentId - Agent ID to uninstall
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentFactory.d.ts","sourceRoot":"","sources":["../src/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAK3D,OAAO,EAIH,KAAK,cAAc,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,8BAA8B,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;IACrB;;;OAGG;yBACwB,iBAAiB;;;;;;;;;;;;;;;;;;IAyC5C;;OAEG;0BACyB,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9E;;OAEG;gCAEU,MAAM,cACH,MAAM,YACR,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"AgentFactory.d.ts","sourceRoot":"","sources":["../src/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAK3D,OAAO,EAIH,KAAK,cAAc,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,8BAA8B,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;IACrB;;;OAGG;yBACwB,iBAAiB;;;;;;;;;;;;;;;;;;IAyC5C;;OAEG;0BACyB,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9E;;OAEG;gCAEU,MAAM,cACH,MAAM,YACR,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,YAC/D,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;OAIG;4BAC2B,MAAM,WAAW,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;wBACuB,WAAW,YAAY,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;CAwB5F,CAAC"}
|
package/dist/AgentFactory.js
CHANGED
|
@@ -53,8 +53,7 @@ const AgentFactory = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Install a custom agent from local path
|
|
55
55
|
*/
|
|
56
|
-
async installCustomAgent(agentId, sourcePath, metadata,
|
|
57
|
-
const options = typeof injectPreferences === "boolean" ? { injectPreferences } : injectPreferences || {};
|
|
56
|
+
async installCustomAgent(agentId, sourcePath, metadata, options) {
|
|
58
57
|
return installCustomAgent(agentId, sourcePath, metadata, options);
|
|
59
58
|
},
|
|
60
59
|
/**
|
|
@@ -50,7 +50,7 @@ function deriveAgentId(config, configPath) {
|
|
|
50
50
|
return basename;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return "
|
|
53
|
+
return "coding-agent";
|
|
54
54
|
}
|
|
55
55
|
function enrichAgentConfig(config, configPath, options = {}) {
|
|
56
56
|
const opts = typeof options === "boolean" ? { isInteractiveCli: options } : options;
|
|
@@ -15,7 +15,7 @@ import type { AgentConfig } from '@dexto/core';
|
|
|
15
15
|
export { discoverCommandPrompts } from './discover-prompts.js';
|
|
16
16
|
/**
|
|
17
17
|
* Derives an agent ID from config or file path for per-agent isolation.
|
|
18
|
-
* Priority: agentCard.name > filename (without extension) > '
|
|
18
|
+
* Priority: agentCard.name > filename (without extension) > 'coding-agent'
|
|
19
19
|
*/
|
|
20
20
|
export declare function deriveAgentId(config: AgentConfig, configPath?: string): string;
|
|
21
21
|
/**
|
|
@@ -15,7 +15,7 @@ function deriveAgentId(config, configPath) {
|
|
|
15
15
|
return basename;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
return "
|
|
18
|
+
return "coding-agent";
|
|
19
19
|
}
|
|
20
20
|
function enrichAgentConfig(config, configPath, options = {}) {
|
|
21
21
|
const opts = typeof options === "boolean" ? { isInteractiveCli: options } : options;
|
package/dist/config/errors.cjs
CHANGED
|
@@ -72,8 +72,8 @@ class ConfigError {
|
|
|
72
72
|
import_error_codes.ConfigErrorCode.NO_PROJECT_DEFAULT,
|
|
73
73
|
import_core.ErrorScope.CONFIG,
|
|
74
74
|
import_core.ErrorType.USER,
|
|
75
|
-
`No project
|
|
76
|
-
Either create
|
|
75
|
+
`No project coding-agent.yml found and no global preferences configured.
|
|
76
|
+
Either create coding-agent.yml in your project root (${projectPath}) or run \`dexto setup\` to configure preferences.`,
|
|
77
77
|
{ projectPath },
|
|
78
78
|
"Run `dexto setup` or create a project-specific agent config"
|
|
79
79
|
);
|
package/dist/config/errors.js
CHANGED
|
@@ -49,8 +49,8 @@ class ConfigError {
|
|
|
49
49
|
ConfigErrorCode.NO_PROJECT_DEFAULT,
|
|
50
50
|
ErrorScope.CONFIG,
|
|
51
51
|
ErrorType.USER,
|
|
52
|
-
`No project
|
|
53
|
-
Either create
|
|
52
|
+
`No project coding-agent.yml found and no global preferences configured.
|
|
53
|
+
Either create coding-agent.yml in your project root (${projectPath}) or run \`dexto setup\` to configure preferences.`,
|
|
54
54
|
{ projectPath },
|
|
55
55
|
"Run `dexto setup` or create a project-specific agent config"
|
|
56
56
|
);
|
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var index_exports = {};
|
|
|
20
20
|
__export(index_exports, {
|
|
21
21
|
AgentFactory: () => import_AgentFactory.AgentFactory,
|
|
22
22
|
AgentManager: () => import_AgentManager.AgentManager,
|
|
23
|
+
CUSTOM_MODEL_PROVIDERS: () => import_custom_models.CUSTOM_MODEL_PROVIDERS,
|
|
23
24
|
ConfigError: () => import_config.ConfigError,
|
|
24
25
|
ConfigErrorCode: () => import_config.ConfigErrorCode,
|
|
25
26
|
CustomModelSchema: () => import_custom_models.CustomModelSchema,
|
|
@@ -28,39 +29,68 @@ __export(index_exports, {
|
|
|
28
29
|
PreferenceErrorCode: () => import_errors2.PreferenceErrorCode,
|
|
29
30
|
RegistryError: () => import_errors.RegistryError,
|
|
30
31
|
RegistryErrorCode: () => import_error_codes.RegistryErrorCode,
|
|
32
|
+
SHARED_API_KEY_PROVIDERS: () => import_api_key_store.SHARED_API_KEY_PROVIDERS,
|
|
33
|
+
addInstalledModel: () => import_models.addInstalledModel,
|
|
31
34
|
addPromptToAgentConfig: () => import_config.addPromptToAgentConfig,
|
|
35
|
+
addToDownloadQueue: () => import_models.addToDownloadQueue,
|
|
32
36
|
copyDirectory: () => import_path.copyDirectory,
|
|
33
37
|
createInitialPreferences: () => import_loader.createInitialPreferences,
|
|
34
38
|
deleteCustomModel: () => import_custom_models.deleteCustomModel,
|
|
39
|
+
deleteModelDirectory: () => import_models.deleteModelDirectory,
|
|
35
40
|
deletePromptByMetadata: () => import_config.deletePromptByMetadata,
|
|
36
41
|
deriveAgentId: () => import_config.deriveAgentId,
|
|
37
42
|
deriveDisplayName: () => import_types.deriveDisplayName,
|
|
43
|
+
determineApiKeyStorage: () => import_api_key_store.determineApiKeyStorage,
|
|
38
44
|
enrichAgentConfig: () => import_config.enrichAgentConfig,
|
|
39
45
|
ensureDextoGlobalDirectory: () => import_path.ensureDextoGlobalDirectory,
|
|
46
|
+
ensureModelDirectory: () => import_models.ensureModelDirectory,
|
|
47
|
+
ensureModelsDirectory: () => import_models.ensureModelsDirectory,
|
|
40
48
|
findDextoProjectRoot: () => import_execution_context.findDextoProjectRoot,
|
|
41
49
|
findDextoSourceRoot: () => import_execution_context.findDextoSourceRoot,
|
|
42
50
|
findPackageRoot: () => import_path.findPackageRoot,
|
|
51
|
+
formatSize: () => import_models.formatSize,
|
|
52
|
+
getActiveModel: () => import_models.getActiveModel,
|
|
53
|
+
getActiveModelId: () => import_models.getActiveModelId,
|
|
43
54
|
getAgentRegistry: () => import_registry.getAgentRegistry,
|
|
55
|
+
getAllInstalledModels: () => import_models.getAllInstalledModels,
|
|
44
56
|
getCustomModel: () => import_custom_models.getCustomModel,
|
|
45
57
|
getCustomModelsPath: () => import_custom_models.getCustomModelsPath,
|
|
46
58
|
getDextoEnvPath: () => import_path.getDextoEnvPath,
|
|
47
59
|
getDextoGlobalPath: () => import_path.getDextoGlobalPath,
|
|
48
60
|
getDextoPath: () => import_path.getDextoPath,
|
|
61
|
+
getDownloadQueue: () => import_models.getDownloadQueue,
|
|
49
62
|
getExecutionContext: () => import_execution_context.getExecutionContext,
|
|
50
63
|
getGlobalPreferencesPath: () => import_loader.getGlobalPreferencesPath,
|
|
64
|
+
getInstalledModel: () => import_models.getInstalledModel,
|
|
65
|
+
getInstalledModelCount: () => import_models.getInstalledModelCount,
|
|
66
|
+
getModelDirectory: () => import_models.getModelDirectory,
|
|
67
|
+
getModelFilePath: () => import_models.getModelFilePath,
|
|
68
|
+
getModelFileSize: () => import_models.getModelFileSize,
|
|
69
|
+
getModelStatePath: () => import_models.getModelStatePath,
|
|
70
|
+
getModelTempDirectory: () => import_models.getModelTempDirectory,
|
|
71
|
+
getModelsDirectory: () => import_models.getModelsDirectory,
|
|
72
|
+
getModelsDiskUsage: () => import_models.getModelsDiskUsage,
|
|
51
73
|
getPrimaryApiKeyEnvVar: () => import_api_key_resolver.getPrimaryApiKeyEnvVar,
|
|
52
74
|
getProviderKeyStatus: () => import_api_key_store.getProviderKeyStatus,
|
|
75
|
+
getTotalInstalledSize: () => import_models.getTotalInstalledSize,
|
|
53
76
|
globalPreferencesExist: () => import_loader.globalPreferencesExist,
|
|
54
77
|
installBundledAgent: () => import_installation.installBundledAgent,
|
|
55
78
|
installCustomAgent: () => import_installation.installCustomAgent,
|
|
79
|
+
isModelInstalled: () => import_models.isModelInstalled,
|
|
56
80
|
isPath: () => import_path.isPath,
|
|
57
81
|
listInstalledAgents: () => import_installation.listInstalledAgents,
|
|
82
|
+
listModelDirectories: () => import_models.listModelDirectories,
|
|
58
83
|
listProviderKeyStatus: () => import_api_key_store.listProviderKeyStatus,
|
|
59
84
|
loadAgentConfig: () => import_config.loadAgentConfig,
|
|
60
85
|
loadBundledRegistryAgents: () => import_registry.loadBundledRegistryAgents,
|
|
61
86
|
loadCustomModels: () => import_custom_models.loadCustomModels,
|
|
62
87
|
loadGlobalPreferences: () => import_loader.loadGlobalPreferences,
|
|
88
|
+
loadModelState: () => import_models.loadModelState,
|
|
89
|
+
modelFileExists: () => import_models.modelFileExists,
|
|
90
|
+
registerManualModel: () => import_models.registerManualModel,
|
|
63
91
|
reloadAgentConfigFromFile: () => import_config.reloadAgentConfigFromFile,
|
|
92
|
+
removeFromDownloadQueue: () => import_models.removeFromDownloadQueue,
|
|
93
|
+
removeInstalledModel: () => import_models.removeInstalledModel,
|
|
64
94
|
removeMcpServerFromConfig: () => import_config.removeMcpServerFromConfig,
|
|
65
95
|
removePromptFromAgentConfig: () => import_config.removePromptFromAgentConfig,
|
|
66
96
|
resolveAgentPath: () => import_resolver.resolveAgentPath,
|
|
@@ -68,13 +98,17 @@ __export(index_exports, {
|
|
|
68
98
|
resolveBundledScript: () => import_path.resolveBundledScript,
|
|
69
99
|
saveCustomModel: () => import_custom_models.saveCustomModel,
|
|
70
100
|
saveGlobalPreferences: () => import_loader.saveGlobalPreferences,
|
|
101
|
+
saveModelState: () => import_models.saveModelState,
|
|
71
102
|
saveProviderApiKey: () => import_api_key_store.saveProviderApiKey,
|
|
103
|
+
setActiveModel: () => import_models.setActiveModel,
|
|
104
|
+
syncStateWithFilesystem: () => import_models.syncStateWithFilesystem,
|
|
72
105
|
uninstallAgent: () => import_installation.uninstallAgent,
|
|
73
106
|
updateAgentConfigFile: () => import_config.updateAgentConfigFile,
|
|
74
107
|
updateDefaultAgentPreference: () => import_resolver.updateDefaultAgentPreference,
|
|
75
108
|
updateEnvFile: () => import_env_file.updateEnvFile,
|
|
76
109
|
updateGlobalPreferences: () => import_loader.updateGlobalPreferences,
|
|
77
110
|
updateMcpServerField: () => import_config.updateMcpServerField,
|
|
111
|
+
updateModelLastUsed: () => import_models.updateModelLastUsed,
|
|
78
112
|
walkUpDirectories: () => import_fs_walk.walkUpDirectories,
|
|
79
113
|
writeConfigFile: () => import_writer.writeConfigFile,
|
|
80
114
|
writeLLMPreferences: () => import_writer.writeLLMPreferences,
|
|
@@ -100,10 +134,12 @@ var import_config = require("./config/index.js");
|
|
|
100
134
|
var import_api_key_store = require("./utils/api-key-store.js");
|
|
101
135
|
var import_api_key_resolver = require("./utils/api-key-resolver.js");
|
|
102
136
|
var import_custom_models = require("./models/custom-models.js");
|
|
137
|
+
var import_models = require("./models/index.js");
|
|
103
138
|
// Annotate the CommonJS export names for ESM import in node:
|
|
104
139
|
0 && (module.exports = {
|
|
105
140
|
AgentFactory,
|
|
106
141
|
AgentManager,
|
|
142
|
+
CUSTOM_MODEL_PROVIDERS,
|
|
107
143
|
ConfigError,
|
|
108
144
|
ConfigErrorCode,
|
|
109
145
|
CustomModelSchema,
|
|
@@ -112,39 +148,68 @@ var import_custom_models = require("./models/custom-models.js");
|
|
|
112
148
|
PreferenceErrorCode,
|
|
113
149
|
RegistryError,
|
|
114
150
|
RegistryErrorCode,
|
|
151
|
+
SHARED_API_KEY_PROVIDERS,
|
|
152
|
+
addInstalledModel,
|
|
115
153
|
addPromptToAgentConfig,
|
|
154
|
+
addToDownloadQueue,
|
|
116
155
|
copyDirectory,
|
|
117
156
|
createInitialPreferences,
|
|
118
157
|
deleteCustomModel,
|
|
158
|
+
deleteModelDirectory,
|
|
119
159
|
deletePromptByMetadata,
|
|
120
160
|
deriveAgentId,
|
|
121
161
|
deriveDisplayName,
|
|
162
|
+
determineApiKeyStorage,
|
|
122
163
|
enrichAgentConfig,
|
|
123
164
|
ensureDextoGlobalDirectory,
|
|
165
|
+
ensureModelDirectory,
|
|
166
|
+
ensureModelsDirectory,
|
|
124
167
|
findDextoProjectRoot,
|
|
125
168
|
findDextoSourceRoot,
|
|
126
169
|
findPackageRoot,
|
|
170
|
+
formatSize,
|
|
171
|
+
getActiveModel,
|
|
172
|
+
getActiveModelId,
|
|
127
173
|
getAgentRegistry,
|
|
174
|
+
getAllInstalledModels,
|
|
128
175
|
getCustomModel,
|
|
129
176
|
getCustomModelsPath,
|
|
130
177
|
getDextoEnvPath,
|
|
131
178
|
getDextoGlobalPath,
|
|
132
179
|
getDextoPath,
|
|
180
|
+
getDownloadQueue,
|
|
133
181
|
getExecutionContext,
|
|
134
182
|
getGlobalPreferencesPath,
|
|
183
|
+
getInstalledModel,
|
|
184
|
+
getInstalledModelCount,
|
|
185
|
+
getModelDirectory,
|
|
186
|
+
getModelFilePath,
|
|
187
|
+
getModelFileSize,
|
|
188
|
+
getModelStatePath,
|
|
189
|
+
getModelTempDirectory,
|
|
190
|
+
getModelsDirectory,
|
|
191
|
+
getModelsDiskUsage,
|
|
135
192
|
getPrimaryApiKeyEnvVar,
|
|
136
193
|
getProviderKeyStatus,
|
|
194
|
+
getTotalInstalledSize,
|
|
137
195
|
globalPreferencesExist,
|
|
138
196
|
installBundledAgent,
|
|
139
197
|
installCustomAgent,
|
|
198
|
+
isModelInstalled,
|
|
140
199
|
isPath,
|
|
141
200
|
listInstalledAgents,
|
|
201
|
+
listModelDirectories,
|
|
142
202
|
listProviderKeyStatus,
|
|
143
203
|
loadAgentConfig,
|
|
144
204
|
loadBundledRegistryAgents,
|
|
145
205
|
loadCustomModels,
|
|
146
206
|
loadGlobalPreferences,
|
|
207
|
+
loadModelState,
|
|
208
|
+
modelFileExists,
|
|
209
|
+
registerManualModel,
|
|
147
210
|
reloadAgentConfigFromFile,
|
|
211
|
+
removeFromDownloadQueue,
|
|
212
|
+
removeInstalledModel,
|
|
148
213
|
removeMcpServerFromConfig,
|
|
149
214
|
removePromptFromAgentConfig,
|
|
150
215
|
resolveAgentPath,
|
|
@@ -152,13 +217,17 @@ var import_custom_models = require("./models/custom-models.js");
|
|
|
152
217
|
resolveBundledScript,
|
|
153
218
|
saveCustomModel,
|
|
154
219
|
saveGlobalPreferences,
|
|
220
|
+
saveModelState,
|
|
155
221
|
saveProviderApiKey,
|
|
222
|
+
setActiveModel,
|
|
223
|
+
syncStateWithFilesystem,
|
|
156
224
|
uninstallAgent,
|
|
157
225
|
updateAgentConfigFile,
|
|
158
226
|
updateDefaultAgentPreference,
|
|
159
227
|
updateEnvFile,
|
|
160
228
|
updateGlobalPreferences,
|
|
161
229
|
updateMcpServerField,
|
|
230
|
+
updateModelLastUsed,
|
|
162
231
|
walkUpDirectories,
|
|
163
232
|
writeConfigFile,
|
|
164
233
|
writeLLMPreferences,
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { AgentRegistry, AgentRegistryEntry, Registry } from './registry/typ
|
|
|
3
3
|
export { deriveDisplayName } from './registry/types.js';
|
|
4
4
|
export { RegistryError } from './registry/errors.js';
|
|
5
5
|
export { RegistryErrorCode } from './registry/error-codes.js';
|
|
6
|
-
export { loadGlobalPreferences, saveGlobalPreferences, globalPreferencesExist, getGlobalPreferencesPath, createInitialPreferences, updateGlobalPreferences, type GlobalPreferencesUpdates, } from './preferences/loader.js';
|
|
6
|
+
export { loadGlobalPreferences, saveGlobalPreferences, globalPreferencesExist, getGlobalPreferencesPath, createInitialPreferences, updateGlobalPreferences, type GlobalPreferencesUpdates, type CreatePreferencesOptions, } from './preferences/loader.js';
|
|
7
7
|
export type { GlobalPreferences } from './preferences/schemas.js';
|
|
8
8
|
export { PreferenceError, PreferenceErrorCode } from './preferences/errors.js';
|
|
9
9
|
export { resolveAgentPath, updateDefaultAgentPreference } from './resolver.js';
|
|
@@ -16,7 +16,8 @@ export { getExecutionContext, findDextoSourceRoot, findDextoProjectRoot, type Ex
|
|
|
16
16
|
export { walkUpDirectories } from './utils/fs-walk.js';
|
|
17
17
|
export { updateEnvFile } from './utils/env-file.js';
|
|
18
18
|
export { updateAgentConfigFile, reloadAgentConfigFromFile, loadAgentConfig, enrichAgentConfig, deriveAgentId, addPromptToAgentConfig, removePromptFromAgentConfig, deletePromptByMetadata, updateMcpServerField, removeMcpServerFromConfig, ConfigError, ConfigErrorCode, type FilePromptInput, type InlinePromptInput, type PromptInput, type PromptMetadataForDeletion, type PromptDeletionResult, } from './config/index.js';
|
|
19
|
-
export { saveProviderApiKey, getProviderKeyStatus, listProviderKeyStatus, } from './utils/api-key-store.js';
|
|
19
|
+
export { saveProviderApiKey, getProviderKeyStatus, listProviderKeyStatus, determineApiKeyStorage, SHARED_API_KEY_PROVIDERS, type ApiKeyStorageStrategy, } from './utils/api-key-store.js';
|
|
20
20
|
export { resolveApiKeyForProvider, getPrimaryApiKeyEnvVar, PROVIDER_API_KEY_MAP, } from './utils/api-key-resolver.js';
|
|
21
|
-
export { loadCustomModels, saveCustomModel, deleteCustomModel, getCustomModel, getCustomModelsPath, CustomModelSchema, type CustomModel, } from './models/custom-models.js';
|
|
21
|
+
export { loadCustomModels, saveCustomModel, deleteCustomModel, getCustomModel, getCustomModelsPath, CustomModelSchema, CUSTOM_MODEL_PROVIDERS, type CustomModel, type CustomModelProvider, } from './models/custom-models.js';
|
|
22
|
+
export { getModelsDirectory, getModelFilePath, getModelDirectory, getModelStatePath, getModelTempDirectory, ensureModelsDirectory, ensureModelDirectory, modelFileExists, getModelFileSize, deleteModelDirectory, listModelDirectories, getModelsDiskUsage, formatSize, type ModelSource, type InstalledModel, type ModelState, loadModelState, saveModelState, addInstalledModel, removeInstalledModel, getInstalledModel, getAllInstalledModels, isModelInstalled, updateModelLastUsed, setActiveModel, getActiveModelId, getActiveModel, addToDownloadQueue, removeFromDownloadQueue, getDownloadQueue, syncStateWithFilesystem, getTotalInstalledSize, getInstalledModelCount, registerManualModel, } from './models/index.js';
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACrF,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,wBAAwB,GACh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mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,GACtB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,9 @@ import {
|
|
|
59
59
|
import {
|
|
60
60
|
saveProviderApiKey,
|
|
61
61
|
getProviderKeyStatus,
|
|
62
|
-
listProviderKeyStatus
|
|
62
|
+
listProviderKeyStatus,
|
|
63
|
+
determineApiKeyStorage,
|
|
64
|
+
SHARED_API_KEY_PROVIDERS
|
|
63
65
|
} from "./utils/api-key-store.js";
|
|
64
66
|
import {
|
|
65
67
|
resolveApiKeyForProvider,
|
|
@@ -72,11 +74,46 @@ import {
|
|
|
72
74
|
deleteCustomModel,
|
|
73
75
|
getCustomModel,
|
|
74
76
|
getCustomModelsPath,
|
|
75
|
-
CustomModelSchema
|
|
77
|
+
CustomModelSchema,
|
|
78
|
+
CUSTOM_MODEL_PROVIDERS
|
|
76
79
|
} from "./models/custom-models.js";
|
|
80
|
+
import {
|
|
81
|
+
getModelsDirectory,
|
|
82
|
+
getModelFilePath,
|
|
83
|
+
getModelDirectory,
|
|
84
|
+
getModelStatePath,
|
|
85
|
+
getModelTempDirectory,
|
|
86
|
+
ensureModelsDirectory,
|
|
87
|
+
ensureModelDirectory,
|
|
88
|
+
modelFileExists,
|
|
89
|
+
getModelFileSize,
|
|
90
|
+
deleteModelDirectory,
|
|
91
|
+
listModelDirectories,
|
|
92
|
+
getModelsDiskUsage,
|
|
93
|
+
formatSize,
|
|
94
|
+
loadModelState,
|
|
95
|
+
saveModelState,
|
|
96
|
+
addInstalledModel,
|
|
97
|
+
removeInstalledModel,
|
|
98
|
+
getInstalledModel,
|
|
99
|
+
getAllInstalledModels,
|
|
100
|
+
isModelInstalled,
|
|
101
|
+
updateModelLastUsed,
|
|
102
|
+
setActiveModel,
|
|
103
|
+
getActiveModelId,
|
|
104
|
+
getActiveModel,
|
|
105
|
+
addToDownloadQueue,
|
|
106
|
+
removeFromDownloadQueue,
|
|
107
|
+
getDownloadQueue,
|
|
108
|
+
syncStateWithFilesystem,
|
|
109
|
+
getTotalInstalledSize,
|
|
110
|
+
getInstalledModelCount,
|
|
111
|
+
registerManualModel
|
|
112
|
+
} from "./models/index.js";
|
|
77
113
|
export {
|
|
78
114
|
AgentFactory,
|
|
79
115
|
AgentManager,
|
|
116
|
+
CUSTOM_MODEL_PROVIDERS,
|
|
80
117
|
ConfigError,
|
|
81
118
|
ConfigErrorCode,
|
|
82
119
|
CustomModelSchema,
|
|
@@ -85,39 +122,68 @@ export {
|
|
|
85
122
|
PreferenceErrorCode,
|
|
86
123
|
RegistryError,
|
|
87
124
|
RegistryErrorCode,
|
|
125
|
+
SHARED_API_KEY_PROVIDERS,
|
|
126
|
+
addInstalledModel,
|
|
88
127
|
addPromptToAgentConfig,
|
|
128
|
+
addToDownloadQueue,
|
|
89
129
|
copyDirectory,
|
|
90
130
|
createInitialPreferences,
|
|
91
131
|
deleteCustomModel,
|
|
132
|
+
deleteModelDirectory,
|
|
92
133
|
deletePromptByMetadata,
|
|
93
134
|
deriveAgentId,
|
|
94
135
|
deriveDisplayName,
|
|
136
|
+
determineApiKeyStorage,
|
|
95
137
|
enrichAgentConfig,
|
|
96
138
|
ensureDextoGlobalDirectory,
|
|
139
|
+
ensureModelDirectory,
|
|
140
|
+
ensureModelsDirectory,
|
|
97
141
|
findDextoProjectRoot,
|
|
98
142
|
findDextoSourceRoot,
|
|
99
143
|
findPackageRoot,
|
|
144
|
+
formatSize,
|
|
145
|
+
getActiveModel,
|
|
146
|
+
getActiveModelId,
|
|
100
147
|
getAgentRegistry,
|
|
148
|
+
getAllInstalledModels,
|
|
101
149
|
getCustomModel,
|
|
102
150
|
getCustomModelsPath,
|
|
103
151
|
getDextoEnvPath,
|
|
104
152
|
getDextoGlobalPath,
|
|
105
153
|
getDextoPath,
|
|
154
|
+
getDownloadQueue,
|
|
106
155
|
getExecutionContext,
|
|
107
156
|
getGlobalPreferencesPath,
|
|
157
|
+
getInstalledModel,
|
|
158
|
+
getInstalledModelCount,
|
|
159
|
+
getModelDirectory,
|
|
160
|
+
getModelFilePath,
|
|
161
|
+
getModelFileSize,
|
|
162
|
+
getModelStatePath,
|
|
163
|
+
getModelTempDirectory,
|
|
164
|
+
getModelsDirectory,
|
|
165
|
+
getModelsDiskUsage,
|
|
108
166
|
getPrimaryApiKeyEnvVar,
|
|
109
167
|
getProviderKeyStatus,
|
|
168
|
+
getTotalInstalledSize,
|
|
110
169
|
globalPreferencesExist,
|
|
111
170
|
installBundledAgent,
|
|
112
171
|
installCustomAgent,
|
|
172
|
+
isModelInstalled,
|
|
113
173
|
isPath,
|
|
114
174
|
listInstalledAgents,
|
|
175
|
+
listModelDirectories,
|
|
115
176
|
listProviderKeyStatus,
|
|
116
177
|
loadAgentConfig,
|
|
117
178
|
loadBundledRegistryAgents,
|
|
118
179
|
loadCustomModels,
|
|
119
180
|
loadGlobalPreferences,
|
|
181
|
+
loadModelState,
|
|
182
|
+
modelFileExists,
|
|
183
|
+
registerManualModel,
|
|
120
184
|
reloadAgentConfigFromFile,
|
|
185
|
+
removeFromDownloadQueue,
|
|
186
|
+
removeInstalledModel,
|
|
121
187
|
removeMcpServerFromConfig,
|
|
122
188
|
removePromptFromAgentConfig,
|
|
123
189
|
resolveAgentPath,
|
|
@@ -125,13 +191,17 @@ export {
|
|
|
125
191
|
resolveBundledScript,
|
|
126
192
|
saveCustomModel,
|
|
127
193
|
saveGlobalPreferences,
|
|
194
|
+
saveModelState,
|
|
128
195
|
saveProviderApiKey,
|
|
196
|
+
setActiveModel,
|
|
197
|
+
syncStateWithFilesystem,
|
|
129
198
|
uninstallAgent,
|
|
130
199
|
updateAgentConfigFile,
|
|
131
200
|
updateDefaultAgentPreference,
|
|
132
201
|
updateEnvFile,
|
|
133
202
|
updateGlobalPreferences,
|
|
134
203
|
updateMcpServerField,
|
|
204
|
+
updateModelLastUsed,
|
|
135
205
|
walkUpDirectories,
|
|
136
206
|
writeConfigFile,
|
|
137
207
|
writeLLMPreferences,
|
package/dist/installation.cjs
CHANGED
|
@@ -38,8 +38,6 @@ var import_fs = require("fs");
|
|
|
38
38
|
var import_path = __toESM(require("path"), 1);
|
|
39
39
|
var import_core = require("@dexto/core");
|
|
40
40
|
var import_path2 = require("./utils/path.js");
|
|
41
|
-
var import_loader = require("./preferences/loader.js");
|
|
42
|
-
var import_writer = require("./writer.js");
|
|
43
41
|
var import_errors = require("./registry/errors.js");
|
|
44
42
|
var import_errors2 = require("./config/errors.js");
|
|
45
43
|
function getAgentsDir(options) {
|
|
@@ -103,17 +101,6 @@ async function installBundledAgent(agentId, options) {
|
|
|
103
101
|
}
|
|
104
102
|
await import_fs.promises.rename(tempDir, targetDir);
|
|
105
103
|
import_core.logger.info(`\u2713 Installed agent '${agentId}' to ${targetDir}`);
|
|
106
|
-
if (options?.injectPreferences !== false) {
|
|
107
|
-
try {
|
|
108
|
-
const preferences = await (0, import_loader.loadGlobalPreferences)();
|
|
109
|
-
await (0, import_writer.writePreferencesToAgent)(targetDir, preferences);
|
|
110
|
-
import_core.logger.info(`\u2713 Applied global preferences to '${agentId}'`);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
import_core.logger.warn(
|
|
113
|
-
`Failed to inject preferences: ${error instanceof Error ? error.message : String(error)}`
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
104
|
const userRegistryPath = getUserRegistryPath(agentsDir);
|
|
118
105
|
const userRegistry = await loadUserRegistry(userRegistryPath);
|
|
119
106
|
if (!userRegistry.agents.some((a) => a.id === agentId)) {
|
package/dist/installation.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type { AgentMetadata } from './AgentManager.js';
|
|
|
2
2
|
export interface InstallOptions {
|
|
3
3
|
/** Directory where agents are stored (default: ~/.dexto/agents) */
|
|
4
4
|
agentsDir?: string;
|
|
5
|
-
/** Whether to inject global preferences into agent config (default: true) */
|
|
6
|
-
injectPreferences?: boolean;
|
|
7
5
|
}
|
|
8
6
|
/**
|
|
9
7
|
* Install agent from bundled registry to local directory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../src/installation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../src/installation.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,WAAW,cAAc;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAuCD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CA6FjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,kBAAkB,CACpC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,EACzE,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CA2FjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B7F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYrF"}
|
package/dist/installation.js
CHANGED
|
@@ -2,8 +2,6 @@ import { promises as fs } from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { logger } from "@dexto/core";
|
|
4
4
|
import { getDextoGlobalPath, resolveBundledScript, copyDirectory } from "./utils/path.js";
|
|
5
|
-
import { loadGlobalPreferences } from "./preferences/loader.js";
|
|
6
|
-
import { writePreferencesToAgent } from "./writer.js";
|
|
7
5
|
import { RegistryError } from "./registry/errors.js";
|
|
8
6
|
import { ConfigError } from "./config/errors.js";
|
|
9
7
|
function getAgentsDir(options) {
|
|
@@ -67,17 +65,6 @@ async function installBundledAgent(agentId, options) {
|
|
|
67
65
|
}
|
|
68
66
|
await fs.rename(tempDir, targetDir);
|
|
69
67
|
logger.info(`\u2713 Installed agent '${agentId}' to ${targetDir}`);
|
|
70
|
-
if (options?.injectPreferences !== false) {
|
|
71
|
-
try {
|
|
72
|
-
const preferences = await loadGlobalPreferences();
|
|
73
|
-
await writePreferencesToAgent(targetDir, preferences);
|
|
74
|
-
logger.info(`\u2713 Applied global preferences to '${agentId}'`);
|
|
75
|
-
} catch (error) {
|
|
76
|
-
logger.warn(
|
|
77
|
-
`Failed to inject preferences: ${error instanceof Error ? error.message : String(error)}`
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
68
|
const userRegistryPath = getUserRegistryPath(agentsDir);
|
|
82
69
|
const userRegistry = await loadUserRegistry(userRegistryPath);
|
|
83
70
|
if (!userRegistry.agents.some((a) => a.id === agentId)) {
|
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var custom_models_exports = {};
|
|
30
30
|
__export(custom_models_exports, {
|
|
31
|
+
CUSTOM_MODEL_PROVIDERS: () => CUSTOM_MODEL_PROVIDERS,
|
|
31
32
|
CustomModelSchema: () => CustomModelSchema,
|
|
32
33
|
deleteCustomModel: () => deleteCustomModel,
|
|
33
34
|
getCustomModel: () => getCustomModel,
|
|
@@ -40,12 +41,51 @@ var import_zod = require("zod");
|
|
|
40
41
|
var import_fs = require("fs");
|
|
41
42
|
var path = __toESM(require("path"), 1);
|
|
42
43
|
var import_path = require("../utils/path.js");
|
|
44
|
+
const CUSTOM_MODEL_PROVIDERS = [
|
|
45
|
+
"openai-compatible",
|
|
46
|
+
"openrouter",
|
|
47
|
+
"litellm",
|
|
48
|
+
"glama",
|
|
49
|
+
"bedrock",
|
|
50
|
+
"ollama",
|
|
51
|
+
"local",
|
|
52
|
+
"vertex"
|
|
53
|
+
];
|
|
43
54
|
const CustomModelSchema = import_zod.z.object({
|
|
44
55
|
name: import_zod.z.string().min(1),
|
|
45
|
-
|
|
56
|
+
provider: import_zod.z.enum(CUSTOM_MODEL_PROVIDERS).default("openai-compatible"),
|
|
57
|
+
baseURL: import_zod.z.string().url().optional(),
|
|
46
58
|
displayName: import_zod.z.string().optional(),
|
|
47
59
|
maxInputTokens: import_zod.z.number().int().positive().optional(),
|
|
48
|
-
maxOutputTokens: import_zod.z.number().int().positive().optional()
|
|
60
|
+
maxOutputTokens: import_zod.z.number().int().positive().optional(),
|
|
61
|
+
// Optional per-model API key. For openai-compatible this is the primary key source.
|
|
62
|
+
// For litellm/glama/openrouter this overrides the provider-level env var key.
|
|
63
|
+
apiKey: import_zod.z.string().optional(),
|
|
64
|
+
// File path for local GGUF models. Required when provider is 'local'.
|
|
65
|
+
// Stores the absolute path to the .gguf file on disk.
|
|
66
|
+
filePath: import_zod.z.string().optional()
|
|
67
|
+
}).superRefine((data, ctx) => {
|
|
68
|
+
if ((data.provider === "openai-compatible" || data.provider === "litellm") && !data.baseURL) {
|
|
69
|
+
ctx.addIssue({
|
|
70
|
+
code: import_zod.z.ZodIssueCode.custom,
|
|
71
|
+
path: ["baseURL"],
|
|
72
|
+
message: `Base URL is required for ${data.provider} provider`
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (data.provider === "local" && !data.filePath) {
|
|
76
|
+
ctx.addIssue({
|
|
77
|
+
code: import_zod.z.ZodIssueCode.custom,
|
|
78
|
+
path: ["filePath"],
|
|
79
|
+
message: "File path is required for local provider"
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (data.provider === "local" && data.filePath && !data.filePath.endsWith(".gguf")) {
|
|
83
|
+
ctx.addIssue({
|
|
84
|
+
code: import_zod.z.ZodIssueCode.custom,
|
|
85
|
+
path: ["filePath"],
|
|
86
|
+
message: "File path must be a .gguf file"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
49
89
|
});
|
|
50
90
|
const StorageSchema = import_zod.z.object({
|
|
51
91
|
version: import_zod.z.literal(1),
|
|
@@ -107,6 +147,7 @@ async function writeCustomModels(models) {
|
|
|
107
147
|
}
|
|
108
148
|
// Annotate the CommonJS export names for ESM import in node:
|
|
109
149
|
0 && (module.exports = {
|
|
150
|
+
CUSTOM_MODEL_PROVIDERS,
|
|
110
151
|
CustomModelSchema,
|
|
111
152
|
deleteCustomModel,
|
|
112
153
|
getCustomModel,
|