@encoredigitalgroup/opencode 0.2.13 → 0.2.14
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 +6 -4
- package/dist/config/ConfigTypes.d.ts +2 -0
- package/dist/lib/PlanningConfigRpc.d.ts +1 -0
- package/dist/server/index.js +10 -0
- package/dist/tui/index.js +23 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`@encoredigitalgroup/opencode` adds file pickers for OpenCode planning commands, a todo tracker, and quota reporting for Anthropic, OpenAI, and xAI (Grok).
|
|
4
4
|
|
|
5
5
|
The TUI provides `/plan-review`, `/plan-resync`, `/plan-split`, and `/plan-execute` commands. Each command opens a picker for plans in `docs/_planning` and
|
|
6
|
-
|
|
6
|
+
submits the selection with the matching installed skill. By default, the selection starts an OpenCode goal.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -32,8 +32,9 @@ The plugin resolves the mapped skills through OpenCode, so those skills can live
|
|
|
32
32
|
## Configuration
|
|
33
33
|
|
|
34
34
|
Set `planDirectory` and `skillMappings` in the object's `options` field. `planDirectory` is a non-empty path relative to the workspace. `skillMappings` can override
|
|
35
|
-
any supported command's installed skill name. `
|
|
36
|
-
use `docs/_planning` and the command's
|
|
35
|
+
any supported command's installed skill name. `goals` defaults to `true`; set it to `false` to submit picker selections as ordinary prompts instead of goals.
|
|
36
|
+
`enforceTodoTracker` defaults to `true`; set it to `false` to disable tracker-refresh enforcement. Unspecified values use `docs/_planning` and the command's
|
|
37
|
+
existing skill name.
|
|
37
38
|
|
|
38
39
|
```json
|
|
39
40
|
{
|
|
@@ -43,6 +44,7 @@ use `docs/_planning` and the command's existing skill name.
|
|
|
43
44
|
"package": "@encoredigitalgroup/opencode",
|
|
44
45
|
"options": {
|
|
45
46
|
"planDirectory": "plans",
|
|
47
|
+
"goals": false,
|
|
46
48
|
"enforceTodoTracker": false,
|
|
47
49
|
"skillMappings": {
|
|
48
50
|
"plan-review": "custom-plan-review",
|
|
@@ -55,7 +57,7 @@ use `docs/_planning` and the command's existing skill name.
|
|
|
55
57
|
```
|
|
56
58
|
|
|
57
59
|
Launching a picker from an existing session submits to that session. Launching one from the home screen creates and displays a new session before submitting the
|
|
58
|
-
selected plan.
|
|
60
|
+
selected plan. Starting a goal replaces any existing goal in that session. For `/plan-execute`, the goal points to the selected sub-plan directory.
|
|
59
61
|
|
|
60
62
|
## Todo tracker
|
|
61
63
|
|
|
@@ -3,6 +3,7 @@ export type SkillCommand = (typeof skillCommands)[number];
|
|
|
3
3
|
export type SkillMappings = Record<SkillCommand, string>;
|
|
4
4
|
export type PluginConfig = {
|
|
5
5
|
enforceTodoTracker: boolean;
|
|
6
|
+
goals: boolean;
|
|
6
7
|
planDirectory: string;
|
|
7
8
|
/** @deprecated Tool classifications no longer affect todo tracker enforcement. */
|
|
8
9
|
readOnlyTools: string[];
|
|
@@ -12,6 +13,7 @@ export type PluginConfig = {
|
|
|
12
13
|
};
|
|
13
14
|
export type UserPluginConfig = {
|
|
14
15
|
enforceTodoTracker?: boolean;
|
|
16
|
+
goals?: boolean;
|
|
15
17
|
planDirectory?: string;
|
|
16
18
|
/** @deprecated Tool classifications no longer affect todo tracker enforcement. */
|
|
17
19
|
readOnlyTools?: string[];
|
|
@@ -2,6 +2,7 @@ import type { Rpc } from "@opencode/plugin";
|
|
|
2
2
|
import type { SkillMappings } from "../config";
|
|
3
3
|
export declare const planningConfigRpcID = "encoredigitalgroup.opencode-planning";
|
|
4
4
|
export type PlanningConfigRpcOutput = {
|
|
5
|
+
goals: boolean;
|
|
5
6
|
planDirectory: string;
|
|
6
7
|
skillMappings: SkillMappings;
|
|
7
8
|
};
|
package/dist/server/index.js
CHANGED
|
@@ -16,6 +16,7 @@ class ConfigDefaults {
|
|
|
16
16
|
static getDefaultConfig() {
|
|
17
17
|
return {
|
|
18
18
|
enforceTodoTracker: true,
|
|
19
|
+
goals: true,
|
|
19
20
|
planDirectory: "docs/_planning",
|
|
20
21
|
readOnlyTools: [],
|
|
21
22
|
skillMappings: this.getDefaultSkillMappings(),
|
|
@@ -45,6 +46,9 @@ class ConfigMerger {
|
|
|
45
46
|
if (userConfig.enforceTodoTracker !== undefined) {
|
|
46
47
|
config.enforceTodoTracker = userConfig.enforceTodoTracker;
|
|
47
48
|
}
|
|
49
|
+
if (userConfig.goals !== undefined) {
|
|
50
|
+
config.goals = userConfig.goals;
|
|
51
|
+
}
|
|
48
52
|
if (userConfig.planDirectory !== undefined) {
|
|
49
53
|
config.planDirectory = userConfig.planDirectory;
|
|
50
54
|
}
|
|
@@ -134,12 +138,14 @@ class ConfigLoader {
|
|
|
134
138
|
}
|
|
135
139
|
static getUserConfig(options) {
|
|
136
140
|
const enforceTodoTracker = this.booleanOption(options?.enforceTodoTracker);
|
|
141
|
+
const goals = this.booleanOption(options?.goals);
|
|
137
142
|
const planDirectory = this.planDirectoryOption(options?.planDirectory);
|
|
138
143
|
const readOnlyTools = this.toolNamesOption(options?.readOnlyTools);
|
|
139
144
|
const skillMappings = this.skillMappingsOption(options?.skillMappings);
|
|
140
145
|
const writeCapableTools = this.toolNamesOption(options?.writeCapableTools);
|
|
141
146
|
return {
|
|
142
147
|
...enforceTodoTracker === undefined ? {} : { enforceTodoTracker },
|
|
148
|
+
...goals === undefined ? {} : { goals },
|
|
143
149
|
...planDirectory === undefined ? {} : { planDirectory },
|
|
144
150
|
...readOnlyTools === undefined ? {} : { readOnlyTools },
|
|
145
151
|
...skillMappings === undefined ? {} : { skillMappings },
|
|
@@ -178,6 +184,9 @@ function checkConfigOutput(value) {
|
|
|
178
184
|
return "output must be an object";
|
|
179
185
|
}
|
|
180
186
|
const config = value;
|
|
187
|
+
if (typeof config.goals !== "boolean") {
|
|
188
|
+
return "output goals must be a boolean";
|
|
189
|
+
}
|
|
181
190
|
if (typeof config.planDirectory !== "string") {
|
|
182
191
|
return "output planDirectory must be a string";
|
|
183
192
|
}
|
|
@@ -9614,6 +9623,7 @@ var server_default = Plugin2.define({
|
|
|
9614
9623
|
try {
|
|
9615
9624
|
const configRegistration = await ctx.rpc.register(PlanningConfigRpc, {
|
|
9616
9625
|
get: async () => ({
|
|
9626
|
+
goals: pluginConfig.goals,
|
|
9617
9627
|
planDirectory: pluginConfig.planDirectory,
|
|
9618
9628
|
skillMappings: pluginConfig.skillMappings
|
|
9619
9629
|
})
|
package/dist/tui/index.js
CHANGED
|
@@ -644,6 +644,7 @@ class ConfigDefaults {
|
|
|
644
644
|
static getDefaultConfig() {
|
|
645
645
|
return {
|
|
646
646
|
enforceTodoTracker: true,
|
|
647
|
+
goals: true,
|
|
647
648
|
planDirectory: "docs/_planning",
|
|
648
649
|
readOnlyTools: [],
|
|
649
650
|
skillMappings: this.getDefaultSkillMappings(),
|
|
@@ -673,6 +674,9 @@ class ConfigMerger {
|
|
|
673
674
|
if (userConfig.enforceTodoTracker !== undefined) {
|
|
674
675
|
config.enforceTodoTracker = userConfig.enforceTodoTracker;
|
|
675
676
|
}
|
|
677
|
+
if (userConfig.goals !== undefined) {
|
|
678
|
+
config.goals = userConfig.goals;
|
|
679
|
+
}
|
|
676
680
|
if (userConfig.planDirectory !== undefined) {
|
|
677
681
|
config.planDirectory = userConfig.planDirectory;
|
|
678
682
|
}
|
|
@@ -762,12 +766,14 @@ class ConfigLoader {
|
|
|
762
766
|
}
|
|
763
767
|
static getUserConfig(options) {
|
|
764
768
|
const enforceTodoTracker = this.booleanOption(options?.enforceTodoTracker);
|
|
769
|
+
const goals = this.booleanOption(options?.goals);
|
|
765
770
|
const planDirectory = this.planDirectoryOption(options?.planDirectory);
|
|
766
771
|
const readOnlyTools = this.toolNamesOption(options?.readOnlyTools);
|
|
767
772
|
const skillMappings = this.skillMappingsOption(options?.skillMappings);
|
|
768
773
|
const writeCapableTools = this.toolNamesOption(options?.writeCapableTools);
|
|
769
774
|
return {
|
|
770
775
|
...enforceTodoTracker === undefined ? {} : { enforceTodoTracker },
|
|
776
|
+
...goals === undefined ? {} : { goals },
|
|
771
777
|
...planDirectory === undefined ? {} : { planDirectory },
|
|
772
778
|
...readOnlyTools === undefined ? {} : { readOnlyTools },
|
|
773
779
|
...skillMappings === undefined ? {} : { skillMappings },
|
|
@@ -894,7 +900,7 @@ class FilePickerCommands {
|
|
|
894
900
|
static toast(context, message) {
|
|
895
901
|
context.ui.toast.show({ message, variant: "error" });
|
|
896
902
|
}
|
|
897
|
-
static async submit(context, location, command, option) {
|
|
903
|
+
static async submit(context, location, command, option, goals) {
|
|
898
904
|
let skills;
|
|
899
905
|
try {
|
|
900
906
|
skills = context.data.location.skill.list(location);
|
|
@@ -946,12 +952,20 @@ class FilePickerCommands {
|
|
|
946
952
|
skills: [{ id: skill.id }]
|
|
947
953
|
};
|
|
948
954
|
try {
|
|
949
|
-
|
|
955
|
+
if (goals) {
|
|
956
|
+
await context.client.session.command({
|
|
957
|
+
...prompt,
|
|
958
|
+
name: "goal",
|
|
959
|
+
text: `@${skill.name} @${option.argument}`
|
|
960
|
+
});
|
|
961
|
+
} else {
|
|
962
|
+
await context.client.session.prompt(prompt);
|
|
963
|
+
}
|
|
950
964
|
} catch {
|
|
951
965
|
FilePickerCommands.toast(context, "Unable to submit the plan request.");
|
|
952
966
|
}
|
|
953
967
|
}
|
|
954
|
-
static async run(context, command) {
|
|
968
|
+
static async run(context, command, goals) {
|
|
955
969
|
const location = context.location ?? context.data.location.default();
|
|
956
970
|
const options = command.options(location.directory, command.excludesPlanningDirectory);
|
|
957
971
|
if (options.length === 0) {
|
|
@@ -965,7 +979,7 @@ class FilePickerCommands {
|
|
|
965
979
|
if (option === undefined) {
|
|
966
980
|
return;
|
|
967
981
|
}
|
|
968
|
-
await FilePickerCommands.submit(context, location, command, option);
|
|
982
|
+
await FilePickerCommands.submit(context, location, command, option, goals);
|
|
969
983
|
}
|
|
970
984
|
static register(context, config) {
|
|
971
985
|
for (const command of FilePickerCommands.getCommands(config)) {
|
|
@@ -980,7 +994,7 @@ class FilePickerCommands {
|
|
|
980
994
|
slash: {
|
|
981
995
|
name: command.command
|
|
982
996
|
},
|
|
983
|
-
run: () => FilePickerCommands.run(context, command)
|
|
997
|
+
run: () => FilePickerCommands.run(context, command, config.goals)
|
|
984
998
|
}]
|
|
985
999
|
}));
|
|
986
1000
|
}
|
|
@@ -1009,6 +1023,9 @@ function checkConfigOutput(value) {
|
|
|
1009
1023
|
return "output must be an object";
|
|
1010
1024
|
}
|
|
1011
1025
|
const config = value;
|
|
1026
|
+
if (typeof config.goals !== "boolean") {
|
|
1027
|
+
return "output goals must be a boolean";
|
|
1028
|
+
}
|
|
1012
1029
|
if (typeof config.planDirectory !== "string") {
|
|
1013
1030
|
return "output planDirectory must be a string";
|
|
1014
1031
|
}
|
|
@@ -7051,6 +7068,7 @@ async function loadPickerConfig(context) {
|
|
|
7051
7068
|
});
|
|
7052
7069
|
return {
|
|
7053
7070
|
...fallback,
|
|
7071
|
+
goals: config.goals,
|
|
7054
7072
|
planDirectory: config.planDirectory,
|
|
7055
7073
|
skillMappings: config.skillMappings
|
|
7056
7074
|
};
|