@orderful/droid 0.34.0 → 0.34.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/CHANGELOG.md +6 -0
- package/dist/bin/droid.js +25 -10
- package/dist/index.js +16 -9
- package/dist/lib/config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/commands/tui/views/SkillConfigScreen.tsx +2 -2
- package/src/lib/config.ts +25 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @orderful/droid
|
|
2
2
|
|
|
3
|
+
## 0.34.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#207](https://github.com/Orderful/droid/pull/207) [`1bb9dab`](https://github.com/Orderful/droid/commit/1bb9dab3079c32ecfa6069c074cbc6b076273f68) Thanks [@frytyler](https://github.com/frytyler)! - Fix config migration and TUI config persistence. Migration now properly re-runs if incomplete, and TUI tool config updates now persist to the consolidated config location instead of old override files.
|
|
8
|
+
|
|
3
9
|
## 0.34.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/bin/droid.js
CHANGED
|
@@ -75,11 +75,15 @@ function migrateConfig(config) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
function migrateToolConfigs(config) {
|
|
78
|
-
if (config.migrations?.tools_consolidated) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
78
|
const skillsDir = join(CONFIG_DIR, "skills");
|
|
82
79
|
if (!existsSync(skillsDir)) {
|
|
80
|
+
if (!config.migrations) {
|
|
81
|
+
config.migrations = {};
|
|
82
|
+
}
|
|
83
|
+
if (!config.migrations.tools_consolidated) {
|
|
84
|
+
config.migrations.tools_consolidated = true;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
83
87
|
return false;
|
|
84
88
|
}
|
|
85
89
|
let migrated = false;
|
|
@@ -97,18 +101,21 @@ function migrateToolConfigs(config) {
|
|
|
97
101
|
if (!config.tools) {
|
|
98
102
|
config.tools = {};
|
|
99
103
|
}
|
|
100
|
-
config.tools[skillName]
|
|
101
|
-
|
|
104
|
+
if (!config.tools[skillName]) {
|
|
105
|
+
config.tools[skillName] = overrides;
|
|
106
|
+
migrated = true;
|
|
107
|
+
}
|
|
102
108
|
}
|
|
103
109
|
} catch {
|
|
104
110
|
continue;
|
|
105
111
|
}
|
|
106
112
|
}
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
if (!config.migrations) {
|
|
114
|
+
config.migrations = {};
|
|
115
|
+
}
|
|
116
|
+
if (!config.migrations.tools_consolidated) {
|
|
111
117
|
config.migrations.tools_consolidated = true;
|
|
118
|
+
migrated = true;
|
|
112
119
|
}
|
|
113
120
|
return migrated;
|
|
114
121
|
} catch {
|
|
@@ -218,6 +225,14 @@ function getToolSettings(name) {
|
|
|
218
225
|
const config = loadConfig();
|
|
219
226
|
return config.tools?.[name] ?? {};
|
|
220
227
|
}
|
|
228
|
+
function setToolSettings(name, settings) {
|
|
229
|
+
const config = loadConfig();
|
|
230
|
+
if (!config.tools) {
|
|
231
|
+
config.tools = {};
|
|
232
|
+
}
|
|
233
|
+
config.tools[name] = settings;
|
|
234
|
+
saveConfig(config);
|
|
235
|
+
}
|
|
221
236
|
function getAutoUpdateConfig() {
|
|
222
237
|
const config = loadConfig();
|
|
223
238
|
return {
|
|
@@ -3219,7 +3234,7 @@ function SkillConfigScreen({ skill, onComplete, onCancel }) {
|
|
|
3219
3234
|
const [selectOptionIndex, setSelectOptionIndex] = useState6(0);
|
|
3220
3235
|
const totalItems = configKeys.length + 1;
|
|
3221
3236
|
const handleSave = () => {
|
|
3222
|
-
|
|
3237
|
+
setToolSettings(skill.name, values);
|
|
3223
3238
|
onComplete();
|
|
3224
3239
|
};
|
|
3225
3240
|
const handleSubmitEdit = () => {
|
package/dist/index.js
CHANGED
|
@@ -87,11 +87,15 @@ function migrateConfig(config) {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
function migrateToolConfigs(config) {
|
|
90
|
-
if (config.migrations?.tools_consolidated) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
90
|
const skillsDir = join(CONFIG_DIR, "skills");
|
|
94
91
|
if (!existsSync(skillsDir)) {
|
|
92
|
+
if (!config.migrations) {
|
|
93
|
+
config.migrations = {};
|
|
94
|
+
}
|
|
95
|
+
if (!config.migrations.tools_consolidated) {
|
|
96
|
+
config.migrations.tools_consolidated = true;
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
95
99
|
return false;
|
|
96
100
|
}
|
|
97
101
|
let migrated = false;
|
|
@@ -109,18 +113,21 @@ function migrateToolConfigs(config) {
|
|
|
109
113
|
if (!config.tools) {
|
|
110
114
|
config.tools = {};
|
|
111
115
|
}
|
|
112
|
-
config.tools[skillName]
|
|
113
|
-
|
|
116
|
+
if (!config.tools[skillName]) {
|
|
117
|
+
config.tools[skillName] = overrides;
|
|
118
|
+
migrated = true;
|
|
119
|
+
}
|
|
114
120
|
}
|
|
115
121
|
} catch {
|
|
116
122
|
continue;
|
|
117
123
|
}
|
|
118
124
|
}
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
if (!config.migrations) {
|
|
126
|
+
config.migrations = {};
|
|
127
|
+
}
|
|
128
|
+
if (!config.migrations.tools_consolidated) {
|
|
123
129
|
config.migrations.tools_consolidated = true;
|
|
130
|
+
migrated = true;
|
|
124
131
|
}
|
|
125
132
|
return migrated;
|
|
126
133
|
} catch {
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;
|
|
1
|
+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O,GAAG,IAAI,CAI9E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAMtD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAQ5E;AAYD;;GAEG;AACH,wBAAgB,QAAQ,IAAI,UAAU,EAAE,CAGvC;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAG5D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM5D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAiB9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAchD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Box, Text, useInput } from 'ink';
|
|
2
2
|
import TextInput from 'ink-text-input';
|
|
3
3
|
import { useState, useMemo } from 'react';
|
|
4
|
-
import { loadSkillOverrides,
|
|
4
|
+
import { loadSkillOverrides, setToolSettings } from '../../../lib/config';
|
|
5
5
|
import { ConfigOptionType, type SkillManifest, type SkillOverrides } from '../../../lib/types';
|
|
6
6
|
import { colors, MAX_VISIBLE_CONFIG_ITEMS } from '../constants';
|
|
7
7
|
|
|
@@ -38,7 +38,7 @@ export function SkillConfigScreen({ skill, onComplete, onCancel }: SkillConfigSc
|
|
|
38
38
|
const totalItems = configKeys.length + 1;
|
|
39
39
|
|
|
40
40
|
const handleSave = () => {
|
|
41
|
-
|
|
41
|
+
setToolSettings(skill.name, values);
|
|
42
42
|
onComplete();
|
|
43
43
|
};
|
|
44
44
|
|
package/src/lib/config.ts
CHANGED
|
@@ -71,15 +71,22 @@ function migrateConfig(
|
|
|
71
71
|
/**
|
|
72
72
|
* Migrate tool configs from old override files to config.tools.*
|
|
73
73
|
* Keeps old files as backup (will be removed in follow-up PR)
|
|
74
|
+
*
|
|
75
|
+
* Always checks for unmigrated override files, even if migration flag is set.
|
|
76
|
+
* This ensures migration runs if it was previously incomplete.
|
|
74
77
|
*/
|
|
75
78
|
function migrateToolConfigs(config: DroidConfig): boolean {
|
|
76
|
-
// Skip if already migrated
|
|
77
|
-
if (config.migrations?.tools_consolidated) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
79
|
const skillsDir = join(CONFIG_DIR, 'skills');
|
|
82
80
|
if (!existsSync(skillsDir)) {
|
|
81
|
+
// No skills directory means nothing to migrate
|
|
82
|
+
// Mark as complete to avoid future checks
|
|
83
|
+
if (!config.migrations) {
|
|
84
|
+
config.migrations = {};
|
|
85
|
+
}
|
|
86
|
+
if (!config.migrations.tools_consolidated) {
|
|
87
|
+
config.migrations.tools_consolidated = true;
|
|
88
|
+
return true; // Config changed (flag added)
|
|
89
|
+
}
|
|
83
90
|
return false;
|
|
84
91
|
}
|
|
85
92
|
|
|
@@ -101,12 +108,16 @@ function migrateToolConfigs(config: DroidConfig): boolean {
|
|
|
101
108
|
const overrides = YAML.parse(content) as SkillOverrides;
|
|
102
109
|
|
|
103
110
|
if (overrides && Object.keys(overrides).length > 0) {
|
|
104
|
-
//
|
|
111
|
+
// Check if already migrated to new location
|
|
105
112
|
if (!config.tools) {
|
|
106
113
|
config.tools = {};
|
|
107
114
|
}
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
|
|
116
|
+
// Only migrate if not already in new location
|
|
117
|
+
if (!config.tools[skillName]) {
|
|
118
|
+
config.tools[skillName] = overrides;
|
|
119
|
+
migrated = true;
|
|
120
|
+
}
|
|
110
121
|
}
|
|
111
122
|
} catch {
|
|
112
123
|
// Skip files that can't be parsed
|
|
@@ -114,12 +125,13 @@ function migrateToolConfigs(config: DroidConfig): boolean {
|
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
127
|
|
|
117
|
-
if
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
// Mark migration as complete if not already marked
|
|
129
|
+
if (!config.migrations) {
|
|
130
|
+
config.migrations = {};
|
|
131
|
+
}
|
|
132
|
+
if (!config.migrations.tools_consolidated) {
|
|
122
133
|
config.migrations.tools_consolidated = true;
|
|
134
|
+
migrated = true;
|
|
123
135
|
}
|
|
124
136
|
|
|
125
137
|
return migrated;
|