@dexto/agent-management 1.4.0 → 1.5.1
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 +50 -1
- package/dist/config/config-enrichment.d.ts +2 -2
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +51 -3
- package/dist/config/discover-prompts.cjs +13 -0
- package/dist/config/discover-prompts.d.ts +13 -0
- package/dist/config/discover-prompts.d.ts.map +1 -1
- package/dist/config/discover-prompts.js +12 -0
- 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 +46 -2
- package/dist/models/custom-models.d.ts +54 -6
- package/dist/models/custom-models.d.ts.map +1 -1
- package/dist/models/custom-models.js +45 -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 +35 -6
- package/dist/preferences/loader.d.ts +25 -4
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +35 -6
- package/dist/preferences/schemas.cjs +24 -3
- package/dist/preferences/schemas.d.ts +64 -24
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +31 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-manager.d.ts","sourceRoot":"","sources":["../../src/models/state-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IAEX,sCAAs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
+
modelFileExists,
|
|
6
|
+
getModelFilePath
|
|
7
|
+
} from "./path-resolver.js";
|
|
8
|
+
const CURRENT_VERSION = "1.0";
|
|
9
|
+
function createDefaultState() {
|
|
10
|
+
return {
|
|
11
|
+
version: CURRENT_VERSION,
|
|
12
|
+
installed: {},
|
|
13
|
+
downloadQueue: []
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async function loadModelState() {
|
|
17
|
+
const statePath = getModelStatePath();
|
|
18
|
+
try {
|
|
19
|
+
const content = await fs.readFile(statePath, "utf-8");
|
|
20
|
+
const state = JSON.parse(content);
|
|
21
|
+
if (state.version !== CURRENT_VERSION) {
|
|
22
|
+
return migrateState(state);
|
|
23
|
+
}
|
|
24
|
+
return state;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (error.code === "ENOENT") {
|
|
27
|
+
return createDefaultState();
|
|
28
|
+
}
|
|
29
|
+
console.warn("Invalid model state file, resetting to default");
|
|
30
|
+
return createDefaultState();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function saveModelState(state) {
|
|
34
|
+
await ensureModelsDirectory();
|
|
35
|
+
const statePath = getModelStatePath();
|
|
36
|
+
await fs.writeFile(statePath, JSON.stringify(state, null, 2), "utf-8");
|
|
37
|
+
}
|
|
38
|
+
function migrateState(state) {
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
version: CURRENT_VERSION
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async function addInstalledModel(model) {
|
|
45
|
+
const state = await loadModelState();
|
|
46
|
+
state.installed[model.id] = model;
|
|
47
|
+
await saveModelState(state);
|
|
48
|
+
}
|
|
49
|
+
async function removeInstalledModel(modelId) {
|
|
50
|
+
const state = await loadModelState();
|
|
51
|
+
if (!state.installed[modelId]) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
delete state.installed[modelId];
|
|
55
|
+
if (state.activeModelId === modelId) {
|
|
56
|
+
delete state.activeModelId;
|
|
57
|
+
}
|
|
58
|
+
state.downloadQueue = state.downloadQueue.filter((id) => id !== modelId);
|
|
59
|
+
await saveModelState(state);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
async function getInstalledModel(modelId) {
|
|
63
|
+
const state = await loadModelState();
|
|
64
|
+
return state.installed[modelId] ?? null;
|
|
65
|
+
}
|
|
66
|
+
async function getAllInstalledModels() {
|
|
67
|
+
const state = await loadModelState();
|
|
68
|
+
return Object.values(state.installed);
|
|
69
|
+
}
|
|
70
|
+
async function isModelInstalled(modelId) {
|
|
71
|
+
const model = await getInstalledModel(modelId);
|
|
72
|
+
if (!model) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return modelFileExists(modelId, model.filename);
|
|
76
|
+
}
|
|
77
|
+
async function updateModelLastUsed(modelId) {
|
|
78
|
+
const state = await loadModelState();
|
|
79
|
+
const model = state.installed[modelId];
|
|
80
|
+
if (model) {
|
|
81
|
+
model.lastUsedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
82
|
+
await saveModelState(state);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function setActiveModel(modelId) {
|
|
86
|
+
const state = await loadModelState();
|
|
87
|
+
if (modelId === void 0) {
|
|
88
|
+
delete state.activeModelId;
|
|
89
|
+
} else {
|
|
90
|
+
state.activeModelId = modelId;
|
|
91
|
+
}
|
|
92
|
+
await saveModelState(state);
|
|
93
|
+
}
|
|
94
|
+
async function getActiveModelId() {
|
|
95
|
+
const state = await loadModelState();
|
|
96
|
+
return state.activeModelId;
|
|
97
|
+
}
|
|
98
|
+
async function getActiveModel() {
|
|
99
|
+
const activeId = await getActiveModelId();
|
|
100
|
+
if (!activeId) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
return getInstalledModel(activeId);
|
|
104
|
+
}
|
|
105
|
+
async function addToDownloadQueue(modelId) {
|
|
106
|
+
const state = await loadModelState();
|
|
107
|
+
if (!state.downloadQueue.includes(modelId)) {
|
|
108
|
+
state.downloadQueue.push(modelId);
|
|
109
|
+
await saveModelState(state);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function removeFromDownloadQueue(modelId) {
|
|
113
|
+
const state = await loadModelState();
|
|
114
|
+
state.downloadQueue = state.downloadQueue.filter((id) => id !== modelId);
|
|
115
|
+
await saveModelState(state);
|
|
116
|
+
}
|
|
117
|
+
async function getDownloadQueue() {
|
|
118
|
+
const state = await loadModelState();
|
|
119
|
+
return [...state.downloadQueue];
|
|
120
|
+
}
|
|
121
|
+
async function syncStateWithFilesystem() {
|
|
122
|
+
const state = await loadModelState();
|
|
123
|
+
const removed = [];
|
|
124
|
+
const kept = [];
|
|
125
|
+
for (const [modelId, model] of Object.entries(state.installed)) {
|
|
126
|
+
const exists = await modelFileExists(modelId, model.filename);
|
|
127
|
+
if (exists) {
|
|
128
|
+
kept.push(modelId);
|
|
129
|
+
} else {
|
|
130
|
+
removed.push(modelId);
|
|
131
|
+
delete state.installed[modelId];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (state.activeModelId && removed.includes(state.activeModelId)) {
|
|
135
|
+
delete state.activeModelId;
|
|
136
|
+
}
|
|
137
|
+
if (removed.length > 0) {
|
|
138
|
+
await saveModelState(state);
|
|
139
|
+
}
|
|
140
|
+
return { removed, kept };
|
|
141
|
+
}
|
|
142
|
+
async function getTotalInstalledSize() {
|
|
143
|
+
const state = await loadModelState();
|
|
144
|
+
return Object.values(state.installed).reduce((total, model) => total + model.sizeBytes, 0);
|
|
145
|
+
}
|
|
146
|
+
async function getInstalledModelCount() {
|
|
147
|
+
const state = await loadModelState();
|
|
148
|
+
return Object.keys(state.installed).length;
|
|
149
|
+
}
|
|
150
|
+
async function registerManualModel(modelId, filename, sizeBytes, sha256) {
|
|
151
|
+
const filePath = getModelFilePath(modelId, filename);
|
|
152
|
+
const model = {
|
|
153
|
+
id: modelId,
|
|
154
|
+
filePath,
|
|
155
|
+
sizeBytes,
|
|
156
|
+
downloadedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
157
|
+
source: "manual",
|
|
158
|
+
filename
|
|
159
|
+
};
|
|
160
|
+
if (sha256 !== void 0) {
|
|
161
|
+
model.sha256 = sha256;
|
|
162
|
+
}
|
|
163
|
+
await addInstalledModel(model);
|
|
164
|
+
}
|
|
165
|
+
export {
|
|
166
|
+
addInstalledModel,
|
|
167
|
+
addToDownloadQueue,
|
|
168
|
+
getActiveModel,
|
|
169
|
+
getActiveModelId,
|
|
170
|
+
getAllInstalledModels,
|
|
171
|
+
getDownloadQueue,
|
|
172
|
+
getInstalledModel,
|
|
173
|
+
getInstalledModelCount,
|
|
174
|
+
getTotalInstalledSize,
|
|
175
|
+
isModelInstalled,
|
|
176
|
+
loadModelState,
|
|
177
|
+
registerManualModel,
|
|
178
|
+
removeFromDownloadQueue,
|
|
179
|
+
removeInstalledModel,
|
|
180
|
+
saveModelState,
|
|
181
|
+
setActiveModel,
|
|
182
|
+
syncStateWithFilesystem,
|
|
183
|
+
updateModelLastUsed
|
|
184
|
+
};
|
|
@@ -27,6 +27,8 @@ var PreferenceErrorCode = /* @__PURE__ */ ((PreferenceErrorCode2) => {
|
|
|
27
27
|
PreferenceErrorCode2["FILE_WRITE_ERROR"] = "preference_file_write_error";
|
|
28
28
|
PreferenceErrorCode2["VALIDATION_ERROR"] = "preference_validation_error";
|
|
29
29
|
PreferenceErrorCode2["MODEL_INCOMPATIBLE"] = "preference_model_incompatible";
|
|
30
|
+
PreferenceErrorCode2["INVALID_PREFERENCE_VALUE"] = "preference_invalid_value";
|
|
31
|
+
PreferenceErrorCode2["MISSING_PREFERENCE"] = "preference_missing_required";
|
|
30
32
|
return PreferenceErrorCode2;
|
|
31
33
|
})(PreferenceErrorCode || {});
|
|
32
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -3,6 +3,8 @@ export declare enum PreferenceErrorCode {
|
|
|
3
3
|
FILE_READ_ERROR = "preference_file_read_error",
|
|
4
4
|
FILE_WRITE_ERROR = "preference_file_write_error",
|
|
5
5
|
VALIDATION_ERROR = "preference_validation_error",
|
|
6
|
-
MODEL_INCOMPATIBLE = "preference_model_incompatible"
|
|
6
|
+
MODEL_INCOMPATIBLE = "preference_model_incompatible",
|
|
7
|
+
INVALID_PREFERENCE_VALUE = "preference_invalid_value",
|
|
8
|
+
MISSING_PREFERENCE = "preference_missing_required"
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/preferences/error-codes.ts"],"names":[],"mappings":"AAEA,oBAAY,mBAAmB;IAC3B,cAAc,8BAA8B;IAC5C,eAAe,+BAA+B;IAC9C,gBAAgB,gCAAgC;IAChD,gBAAgB,gCAAgC;IAChD,kBAAkB,kCAAkC;
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/preferences/error-codes.ts"],"names":[],"mappings":"AAEA,oBAAY,mBAAmB;IAC3B,cAAc,8BAA8B;IAC5C,eAAe,+BAA+B;IAC9C,gBAAgB,gCAAgC;IAChD,gBAAgB,gCAAgC;IAChD,kBAAkB,kCAAkC;IACpD,wBAAwB,6BAA6B;IACrD,kBAAkB,gCAAgC;CACrD"}
|
|
@@ -4,6 +4,8 @@ var PreferenceErrorCode = /* @__PURE__ */ ((PreferenceErrorCode2) => {
|
|
|
4
4
|
PreferenceErrorCode2["FILE_WRITE_ERROR"] = "preference_file_write_error";
|
|
5
5
|
PreferenceErrorCode2["VALIDATION_ERROR"] = "preference_validation_error";
|
|
6
6
|
PreferenceErrorCode2["MODEL_INCOMPATIBLE"] = "preference_model_incompatible";
|
|
7
|
+
PreferenceErrorCode2["INVALID_PREFERENCE_VALUE"] = "preference_invalid_value";
|
|
8
|
+
PreferenceErrorCode2["MISSING_PREFERENCE"] = "preference_missing_required";
|
|
7
9
|
return PreferenceErrorCode2;
|
|
8
10
|
})(PreferenceErrorCode || {});
|
|
9
11
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { GlobalPreferences, PreferenceLLM, PreferenceDefaults, PreferenceSetup, } from './schemas.js';
|
|
2
2
|
export { GlobalPreferencesSchema, PreferenceLLMSchema, PreferenceDefaultsSchema, PreferenceSetupSchema, } from './schemas.js';
|
|
3
3
|
export { PREFERENCES_FILE } from './constants.js';
|
|
4
|
-
export { loadGlobalPreferences, saveGlobalPreferences, globalPreferencesExist, getGlobalPreferencesPath, createInitialPreferences, updateGlobalPreferences, } from './loader.js';
|
|
4
|
+
export { loadGlobalPreferences, saveGlobalPreferences, globalPreferencesExist, getGlobalPreferencesPath, createInitialPreferences, updateGlobalPreferences, type CreatePreferencesOptions, } from './loader.js';
|
|
5
5
|
export { PreferenceError, PreferenceErrorCode } from './errors.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preferences/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACR,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,eAAe,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preferences/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACR,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,eAAe,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,wBAAwB,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -66,7 +66,7 @@ async function saveGlobalPreferences(preferences) {
|
|
|
66
66
|
throw import_errors.PreferenceError.validationFailed(validation.error);
|
|
67
67
|
}
|
|
68
68
|
try {
|
|
69
|
-
import_core.logger.
|
|
69
|
+
import_core.logger.debug(`Saving global preferences to: ${preferencesPath}`);
|
|
70
70
|
const dextoDir = (0, import_path.getDextoGlobalPath)("");
|
|
71
71
|
await import_fs2.promises.mkdir(dextoDir, { recursive: true });
|
|
72
72
|
const yamlContent = (0, import_yaml.stringify)(preferences, {
|
|
@@ -75,7 +75,7 @@ async function saveGlobalPreferences(preferences) {
|
|
|
75
75
|
minContentWidth: 20
|
|
76
76
|
});
|
|
77
77
|
await import_fs2.promises.writeFile(preferencesPath, yamlContent, "utf-8");
|
|
78
|
-
import_core.logger.
|
|
78
|
+
import_core.logger.debug(
|
|
79
79
|
`\u2713 Saved global preferences ${JSON.stringify(preferences)} to: ${preferencesPath}`
|
|
80
80
|
);
|
|
81
81
|
} catch (error) {
|
|
@@ -92,20 +92,49 @@ function globalPreferencesExist() {
|
|
|
92
92
|
function getGlobalPreferencesPath() {
|
|
93
93
|
return (0, import_path.getDextoGlobalPath)(import_constants.PREFERENCES_FILE);
|
|
94
94
|
}
|
|
95
|
-
function createInitialPreferences(
|
|
95
|
+
function createInitialPreferences(providerOrOptions, model, apiKeyVar, defaultAgent = "coding-agent") {
|
|
96
|
+
if (typeof providerOrOptions === "object") {
|
|
97
|
+
const opts = providerOrOptions;
|
|
98
|
+
const llmConfig = {
|
|
99
|
+
provider: opts.provider,
|
|
100
|
+
model: opts.model
|
|
101
|
+
};
|
|
102
|
+
if (opts.apiKeyVar) {
|
|
103
|
+
llmConfig.apiKey = `$${opts.apiKeyVar}`;
|
|
104
|
+
}
|
|
105
|
+
if (opts.baseURL) {
|
|
106
|
+
llmConfig.baseURL = opts.baseURL;
|
|
107
|
+
}
|
|
108
|
+
if (opts.reasoningEffort) {
|
|
109
|
+
llmConfig.reasoningEffort = opts.reasoningEffort;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
llm: llmConfig,
|
|
113
|
+
defaults: {
|
|
114
|
+
defaultAgent: opts.defaultAgent || "coding-agent",
|
|
115
|
+
defaultMode: opts.defaultMode || "web"
|
|
116
|
+
},
|
|
117
|
+
setup: {
|
|
118
|
+
completed: opts.setupCompleted ?? true,
|
|
119
|
+
apiKeyPending: opts.apiKeyPending ?? false,
|
|
120
|
+
baseURLPending: opts.baseURLPending ?? false
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
96
124
|
return {
|
|
97
125
|
llm: {
|
|
98
|
-
provider,
|
|
126
|
+
provider: providerOrOptions,
|
|
99
127
|
model,
|
|
100
128
|
apiKey: `$${apiKeyVar}`
|
|
101
129
|
},
|
|
102
130
|
defaults: {
|
|
103
131
|
defaultAgent,
|
|
104
132
|
defaultMode: "web"
|
|
105
|
-
// Default to web mode
|
|
106
133
|
},
|
|
107
134
|
setup: {
|
|
108
|
-
completed: true
|
|
135
|
+
completed: true,
|
|
136
|
+
apiKeyPending: false,
|
|
137
|
+
baseURLPending: false
|
|
109
138
|
}
|
|
110
139
|
};
|
|
111
140
|
}
|
|
@@ -23,12 +23,33 @@ export declare function globalPreferencesExist(): boolean;
|
|
|
23
23
|
* @returns Absolute path to preferences.yml
|
|
24
24
|
*/
|
|
25
25
|
export declare function getGlobalPreferencesPath(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Options for creating initial preferences
|
|
28
|
+
*/
|
|
29
|
+
export interface CreatePreferencesOptions {
|
|
30
|
+
provider: LLMProvider;
|
|
31
|
+
model: string;
|
|
32
|
+
/** API key env var (optional for providers like Ollama that don't need auth) */
|
|
33
|
+
apiKeyVar?: string;
|
|
34
|
+
defaultAgent?: string;
|
|
35
|
+
defaultMode?: 'cli' | 'web' | 'server' | 'discord' | 'telegram' | 'mcp';
|
|
36
|
+
baseURL?: string;
|
|
37
|
+
/** Reasoning effort for OpenAI reasoning models (o1, o3, codex, gpt-5.x) */
|
|
38
|
+
reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
39
|
+
setupCompleted?: boolean;
|
|
40
|
+
/** Whether API key setup was skipped and needs to be configured later */
|
|
41
|
+
apiKeyPending?: boolean;
|
|
42
|
+
/** Whether baseURL setup was skipped and needs to be configured later */
|
|
43
|
+
baseURLPending?: boolean;
|
|
44
|
+
}
|
|
26
45
|
/**
|
|
27
46
|
* Create initial preferences from setup data
|
|
28
|
-
* @param
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
* @param options Configuration options for preferences
|
|
48
|
+
*/
|
|
49
|
+
export declare function createInitialPreferences(options: CreatePreferencesOptions): GlobalPreferences;
|
|
50
|
+
/**
|
|
51
|
+
* Create initial preferences from setup data (legacy signature)
|
|
52
|
+
* @deprecated Use options object instead
|
|
32
53
|
*/
|
|
33
54
|
export declare function createInitialPreferences(provider: LLMProvider, model: string, apiKeyVar: string, defaultAgent?: string): GlobalPreferences;
|
|
34
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAI/E;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CA+BxE;AAED;;;;GAIG;A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,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAAC;AAE/F;;;GAGG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACtB,iBAAiB,CAAC;AAgErB;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,iBAAiB,CAAC,CA2B5B"}
|
|
@@ -38,7 +38,7 @@ async function saveGlobalPreferences(preferences) {
|
|
|
38
38
|
throw PreferenceError.validationFailed(validation.error);
|
|
39
39
|
}
|
|
40
40
|
try {
|
|
41
|
-
logger.
|
|
41
|
+
logger.debug(`Saving global preferences to: ${preferencesPath}`);
|
|
42
42
|
const dextoDir = getDextoGlobalPath("");
|
|
43
43
|
await fs.mkdir(dextoDir, { recursive: true });
|
|
44
44
|
const yamlContent = stringifyYaml(preferences, {
|
|
@@ -47,7 +47,7 @@ async function saveGlobalPreferences(preferences) {
|
|
|
47
47
|
minContentWidth: 20
|
|
48
48
|
});
|
|
49
49
|
await fs.writeFile(preferencesPath, yamlContent, "utf-8");
|
|
50
|
-
logger.
|
|
50
|
+
logger.debug(
|
|
51
51
|
`\u2713 Saved global preferences ${JSON.stringify(preferences)} to: ${preferencesPath}`
|
|
52
52
|
);
|
|
53
53
|
} catch (error) {
|
|
@@ -64,20 +64,49 @@ function globalPreferencesExist() {
|
|
|
64
64
|
function getGlobalPreferencesPath() {
|
|
65
65
|
return getDextoGlobalPath(PREFERENCES_FILE);
|
|
66
66
|
}
|
|
67
|
-
function createInitialPreferences(
|
|
67
|
+
function createInitialPreferences(providerOrOptions, model, apiKeyVar, defaultAgent = "coding-agent") {
|
|
68
|
+
if (typeof providerOrOptions === "object") {
|
|
69
|
+
const opts = providerOrOptions;
|
|
70
|
+
const llmConfig = {
|
|
71
|
+
provider: opts.provider,
|
|
72
|
+
model: opts.model
|
|
73
|
+
};
|
|
74
|
+
if (opts.apiKeyVar) {
|
|
75
|
+
llmConfig.apiKey = `$${opts.apiKeyVar}`;
|
|
76
|
+
}
|
|
77
|
+
if (opts.baseURL) {
|
|
78
|
+
llmConfig.baseURL = opts.baseURL;
|
|
79
|
+
}
|
|
80
|
+
if (opts.reasoningEffort) {
|
|
81
|
+
llmConfig.reasoningEffort = opts.reasoningEffort;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
llm: llmConfig,
|
|
85
|
+
defaults: {
|
|
86
|
+
defaultAgent: opts.defaultAgent || "coding-agent",
|
|
87
|
+
defaultMode: opts.defaultMode || "web"
|
|
88
|
+
},
|
|
89
|
+
setup: {
|
|
90
|
+
completed: opts.setupCompleted ?? true,
|
|
91
|
+
apiKeyPending: opts.apiKeyPending ?? false,
|
|
92
|
+
baseURLPending: opts.baseURLPending ?? false
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
68
96
|
return {
|
|
69
97
|
llm: {
|
|
70
|
-
provider,
|
|
98
|
+
provider: providerOrOptions,
|
|
71
99
|
model,
|
|
72
100
|
apiKey: `$${apiKeyVar}`
|
|
73
101
|
},
|
|
74
102
|
defaults: {
|
|
75
103
|
defaultAgent,
|
|
76
104
|
defaultMode: "web"
|
|
77
|
-
// Default to web mode
|
|
78
105
|
},
|
|
79
106
|
setup: {
|
|
80
|
-
completed: true
|
|
107
|
+
completed: true,
|
|
108
|
+
apiKeyPending: false,
|
|
109
|
+
baseURLPending: false
|
|
81
110
|
}
|
|
82
111
|
};
|
|
83
112
|
}
|
|
@@ -36,9 +36,16 @@ const PreferenceLLMSchema = import_zod.z.object({
|
|
|
36
36
|
apiKey: import_zod.z.string().regex(
|
|
37
37
|
/^\$[A-Z_][A-Z0-9_]*$/,
|
|
38
38
|
"Must be environment variable reference (e.g., $OPENAI_API_KEY)"
|
|
39
|
-
).describe(
|
|
39
|
+
).optional().describe(
|
|
40
|
+
"Environment variable reference for API key (optional for local providers like Ollama)"
|
|
41
|
+
),
|
|
42
|
+
baseURL: import_zod.z.string().url("Must be a valid URL (e.g., http://localhost:11434/v1)").optional().describe("Custom base URL for providers that support it (openai-compatible, litellm)"),
|
|
43
|
+
reasoningEffort: import_zod.z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional().describe(
|
|
44
|
+
"Reasoning effort level for OpenAI reasoning models (o1, o3, codex, gpt-5.x). Auto-detected if not set."
|
|
45
|
+
)
|
|
40
46
|
}).strict().superRefine((data, ctx) => {
|
|
41
|
-
|
|
47
|
+
const skipModelValidation = (0, import_core.acceptsAnyModel)(data.provider) || (0, import_core.supportsCustomModels)(data.provider);
|
|
48
|
+
if (!skipModelValidation && !(0, import_core.isValidProviderModel)(data.provider, data.model)) {
|
|
42
49
|
const supportedModels = (0, import_core.getSupportedModels)(data.provider);
|
|
43
50
|
ctx.addIssue({
|
|
44
51
|
code: import_zod.z.ZodIssueCode.custom,
|
|
@@ -51,13 +58,27 @@ const PreferenceLLMSchema = import_zod.z.object({
|
|
|
51
58
|
}
|
|
52
59
|
});
|
|
53
60
|
}
|
|
61
|
+
if (data.baseURL && !(0, import_core.supportsBaseURL)(data.provider)) {
|
|
62
|
+
ctx.addIssue({
|
|
63
|
+
code: import_zod.z.ZodIssueCode.custom,
|
|
64
|
+
path: ["baseURL"],
|
|
65
|
+
message: `Provider '${data.provider}' does not support custom baseURL. Use 'openai-compatible' for custom endpoints.`,
|
|
66
|
+
params: {
|
|
67
|
+
code: import_error_codes.PreferenceErrorCode.INVALID_PREFERENCE_VALUE,
|
|
68
|
+
scope: "preference",
|
|
69
|
+
type: import_core4.ErrorType.USER
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
54
73
|
});
|
|
55
74
|
const PreferenceDefaultsSchema = import_zod.z.object({
|
|
56
75
|
defaultAgent: import_zod.z.string().min(1).describe("Default agent name for global CLI usage (required)"),
|
|
57
76
|
defaultMode: import_zod.z.enum(["cli", "web", "server", "discord", "telegram", "mcp"]).default("web").describe("Default run mode when --mode flag is not specified (default: web)")
|
|
58
77
|
}).strict();
|
|
59
78
|
const PreferenceSetupSchema = import_zod.z.object({
|
|
60
|
-
completed: import_zod.z.boolean().default(false).describe("Whether initial setup has been completed")
|
|
79
|
+
completed: import_zod.z.boolean().default(false).describe("Whether initial setup has been completed"),
|
|
80
|
+
apiKeyPending: import_zod.z.boolean().default(false).describe("Whether API key setup was skipped and needs to be configured later"),
|
|
81
|
+
baseURLPending: import_zod.z.boolean().default(false).describe("Whether baseURL setup was skipped and needs to be configured later")
|
|
61
82
|
}).strict();
|
|
62
83
|
const GlobalPreferencesSchema = import_zod.z.object({
|
|
63
84
|
llm: PreferenceLLMSchema.describe("LLM configuration preferences"),
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const PreferenceLLMSchema: z.ZodEffects<z.ZodObject<{
|
|
3
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>;
|
|
3
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
4
4
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
5
|
-
apiKey: z.ZodString
|
|
5
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
7
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
|
|
6
8
|
}, "strict", z.ZodTypeAny, {
|
|
7
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
9
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
8
10
|
model: string;
|
|
9
|
-
apiKey
|
|
11
|
+
apiKey?: string | undefined;
|
|
12
|
+
baseURL?: string | undefined;
|
|
13
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
10
14
|
}, {
|
|
11
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
15
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
12
16
|
model: string;
|
|
13
|
-
apiKey
|
|
17
|
+
apiKey?: string | undefined;
|
|
18
|
+
baseURL?: string | undefined;
|
|
19
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
14
20
|
}>, {
|
|
15
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
21
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
16
22
|
model: string;
|
|
17
|
-
apiKey
|
|
23
|
+
apiKey?: string | undefined;
|
|
24
|
+
baseURL?: string | undefined;
|
|
25
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
18
26
|
}, {
|
|
19
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
27
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
20
28
|
model: string;
|
|
21
|
-
apiKey
|
|
29
|
+
apiKey?: string | undefined;
|
|
30
|
+
baseURL?: string | undefined;
|
|
31
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
22
32
|
}>;
|
|
23
33
|
export declare const PreferenceDefaultsSchema: z.ZodObject<{
|
|
24
34
|
defaultAgent: z.ZodString;
|
|
@@ -32,32 +42,48 @@ export declare const PreferenceDefaultsSchema: z.ZodObject<{
|
|
|
32
42
|
}>;
|
|
33
43
|
export declare const PreferenceSetupSchema: z.ZodObject<{
|
|
34
44
|
completed: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
+
apiKeyPending: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
baseURLPending: z.ZodDefault<z.ZodBoolean>;
|
|
35
47
|
}, "strict", z.ZodTypeAny, {
|
|
36
48
|
completed: boolean;
|
|
49
|
+
apiKeyPending: boolean;
|
|
50
|
+
baseURLPending: boolean;
|
|
37
51
|
}, {
|
|
38
52
|
completed?: boolean | undefined;
|
|
53
|
+
apiKeyPending?: boolean | undefined;
|
|
54
|
+
baseURLPending?: boolean | undefined;
|
|
39
55
|
}>;
|
|
40
56
|
export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
41
57
|
llm: z.ZodEffects<z.ZodObject<{
|
|
42
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>;
|
|
58
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
43
59
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
44
|
-
apiKey: z.ZodString
|
|
60
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
61
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
62
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
|
|
45
63
|
}, "strict", z.ZodTypeAny, {
|
|
46
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
64
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
47
65
|
model: string;
|
|
48
|
-
apiKey
|
|
66
|
+
apiKey?: string | undefined;
|
|
67
|
+
baseURL?: string | undefined;
|
|
68
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
49
69
|
}, {
|
|
50
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
70
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
51
71
|
model: string;
|
|
52
|
-
apiKey
|
|
72
|
+
apiKey?: string | undefined;
|
|
73
|
+
baseURL?: string | undefined;
|
|
74
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
53
75
|
}>, {
|
|
54
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
76
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
55
77
|
model: string;
|
|
56
|
-
apiKey
|
|
78
|
+
apiKey?: string | undefined;
|
|
79
|
+
baseURL?: string | undefined;
|
|
80
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
57
81
|
}, {
|
|
58
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
82
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
59
83
|
model: string;
|
|
60
|
-
apiKey
|
|
84
|
+
apiKey?: string | undefined;
|
|
85
|
+
baseURL?: string | undefined;
|
|
86
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
61
87
|
}>;
|
|
62
88
|
defaults: z.ZodObject<{
|
|
63
89
|
defaultAgent: z.ZodString;
|
|
@@ -71,16 +97,24 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
71
97
|
}>;
|
|
72
98
|
setup: z.ZodDefault<z.ZodObject<{
|
|
73
99
|
completed: z.ZodDefault<z.ZodBoolean>;
|
|
100
|
+
apiKeyPending: z.ZodDefault<z.ZodBoolean>;
|
|
101
|
+
baseURLPending: z.ZodDefault<z.ZodBoolean>;
|
|
74
102
|
}, "strict", z.ZodTypeAny, {
|
|
75
103
|
completed: boolean;
|
|
104
|
+
apiKeyPending: boolean;
|
|
105
|
+
baseURLPending: boolean;
|
|
76
106
|
}, {
|
|
77
107
|
completed?: boolean | undefined;
|
|
108
|
+
apiKeyPending?: boolean | undefined;
|
|
109
|
+
baseURLPending?: boolean | undefined;
|
|
78
110
|
}>>;
|
|
79
111
|
}, "strict", z.ZodTypeAny, {
|
|
80
112
|
llm: {
|
|
81
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
113
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
82
114
|
model: string;
|
|
83
|
-
apiKey
|
|
115
|
+
apiKey?: string | undefined;
|
|
116
|
+
baseURL?: string | undefined;
|
|
117
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
84
118
|
};
|
|
85
119
|
defaults: {
|
|
86
120
|
defaultAgent: string;
|
|
@@ -88,12 +122,16 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
88
122
|
};
|
|
89
123
|
setup: {
|
|
90
124
|
completed: boolean;
|
|
125
|
+
apiKeyPending: boolean;
|
|
126
|
+
baseURLPending: boolean;
|
|
91
127
|
};
|
|
92
128
|
}, {
|
|
93
129
|
llm: {
|
|
94
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
130
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
95
131
|
model: string;
|
|
96
|
-
apiKey
|
|
132
|
+
apiKey?: string | undefined;
|
|
133
|
+
baseURL?: string | undefined;
|
|
134
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
97
135
|
};
|
|
98
136
|
defaults: {
|
|
99
137
|
defaultAgent: string;
|
|
@@ -101,6 +139,8 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
101
139
|
};
|
|
102
140
|
setup?: {
|
|
103
141
|
completed?: boolean | undefined;
|
|
142
|
+
apiKeyPending?: boolean | undefined;
|
|
143
|
+
baseURLPending?: boolean | undefined;
|
|
104
144
|
} | undefined;
|
|
105
145
|
}>;
|
|
106
146
|
export type PreferenceLLM = z.output<typeof PreferenceLLMSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/preferences/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/preferences/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsE1B,CAAC;AAEP,eAAO,MAAM,wBAAwB;;;;;;;;;EAYxB,CAAC;AAEd,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAYrB,CAAC;AAEd,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvB,CAAC;AAGd,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC3E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|