codex-configurator 0.2.4 → 0.2.5
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/README.md +33 -17
- package/index.js +1398 -839
- package/package.json +4 -2
- package/src/appState.js +69 -0
- package/src/components/ConfigNavigator.js +633 -430
- package/src/components/Header.js +31 -50
- package/src/configFeatures.js +30 -165
- package/src/configHelp.js +20 -236
- package/src/configParser.js +117 -32
- package/src/configReference.js +942 -22
- package/src/constants.js +10 -3
- package/src/fileContext.js +118 -0
- package/src/interaction.js +69 -25
- package/src/layout.js +80 -15
- package/src/reference/config-schema.json +2120 -0
- package/src/ui/commands.js +699 -0
- package/src/ui/panes/CommandBar.js +90 -0
- package/src/ui/panes/HelpBubble.js +26 -0
- package/src/ui/panes/LayoutShell.js +17 -0
- package/src/ui/panes/StatusLine.js +80 -0
- package/src/variantPresets.js +268 -0
- package/src/reference/config-reference.json +0 -3494
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-configurator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "TOML-aware Ink TUI for Codex Configurator",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"start": "node index.js",
|
|
32
|
-
"dev": "node
|
|
32
|
+
"dev": "node scripts/dev-scratch.js",
|
|
33
|
+
"dev:reset": "node scripts/dev-scratch.js --reset",
|
|
34
|
+
"sync:reference": "node scripts/sync-config-reference.js",
|
|
33
35
|
"lint": "eslint index.js src test --max-warnings=0",
|
|
34
36
|
"build": "npm pack --dry-run --ignore-scripts --cache .npm-cache",
|
|
35
37
|
"test": "node --test",
|
package/src/appState.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const APP_STATE_ACTION = 'APP_STATE_ACTION';
|
|
2
|
+
|
|
3
|
+
export const APP_MODES = {
|
|
4
|
+
BROWSE: 'browse',
|
|
5
|
+
FILTER: 'filter',
|
|
6
|
+
FILE_SWITCH: 'file-switch',
|
|
7
|
+
EDIT: 'edit',
|
|
8
|
+
COMMAND: 'command',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const appStateReducer = (state, action) => {
|
|
12
|
+
if (action.type !== APP_STATE_ACTION) {
|
|
13
|
+
return state;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { key, valueOrUpdater, updates } = action.payload || {};
|
|
17
|
+
|
|
18
|
+
if (!action.payload) {
|
|
19
|
+
return state;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (typeof updates === 'object' && updates !== null) {
|
|
23
|
+
return {
|
|
24
|
+
...state,
|
|
25
|
+
...updates,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (typeof key === 'undefined') {
|
|
30
|
+
return state;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (typeof valueOrUpdater === 'function') {
|
|
34
|
+
return {
|
|
35
|
+
...state,
|
|
36
|
+
[key]: valueOrUpdater(state[key]),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
...state,
|
|
42
|
+
[key]: valueOrUpdater,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const buildInitialAppState = (initialMainSnapshot, initialCatalog, initialActiveFileId) => ({
|
|
47
|
+
snapshot: initialMainSnapshot,
|
|
48
|
+
snapshotByFileId: {
|
|
49
|
+
[initialActiveFileId]: initialMainSnapshot,
|
|
50
|
+
},
|
|
51
|
+
configFileCatalog: initialCatalog,
|
|
52
|
+
activeConfigFileId: initialActiveFileId,
|
|
53
|
+
pathSegments: [],
|
|
54
|
+
selectedIndex: 0,
|
|
55
|
+
selectionByPath: {},
|
|
56
|
+
scrollOffset: 0,
|
|
57
|
+
editMode: null,
|
|
58
|
+
isFileSwitchMode: false,
|
|
59
|
+
fileSwitchIndex: 0,
|
|
60
|
+
editError: '',
|
|
61
|
+
filterQuery: '',
|
|
62
|
+
isFilterEditing: false,
|
|
63
|
+
isCommandMode: false,
|
|
64
|
+
commandInput: '',
|
|
65
|
+
commandMessage: '',
|
|
66
|
+
showHelp: false,
|
|
67
|
+
codexVersion: 'version loading...',
|
|
68
|
+
codexVersionStatus: '',
|
|
69
|
+
});
|