@cortexkit/aft-opencode 0.20.1 → 0.21.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/bg-notifications.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/tui.js +43 -18
- package/package.json +7 -7
- package/src/tui/index.tsx +72 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bg-notifications.d.ts","sourceRoot":"","sources":["../src/bg-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,cAAc,GAAG;IACpB,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,kBAAkB,EAAE,YAAY,EAAE,CAAC;IACnC,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,eAAe,EAAE,MAAM,GAAG,IAAI,C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,CAQ7F;AAWD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcnE;AAED,wBAAgB,kCAAkC,IAAI,IAAI,CAKzD"}
|
package/dist/index.js
CHANGED
|
@@ -9932,6 +9932,13 @@ async function appendInTurnBgCompletions(drainContext, output) {
|
|
|
9932
9932
|
output.output = appendReminder(output.output ?? "", reminder);
|
|
9933
9933
|
state.pendingCompletions = [];
|
|
9934
9934
|
state.pendingLongRunning = [];
|
|
9935
|
+
if (state.debounceTimer) {
|
|
9936
|
+
clearTimeout(state.debounceTimer);
|
|
9937
|
+
state.debounceTimer = null;
|
|
9938
|
+
state.firstCompletionAt = null;
|
|
9939
|
+
state.scheduledFireAt = null;
|
|
9940
|
+
state.scheduledCompletionCount = 0;
|
|
9941
|
+
}
|
|
9935
9942
|
}
|
|
9936
9943
|
async function handleIdleBgCompletions(drainContext) {
|
|
9937
9944
|
await triggerWakeIfPending(drainContext, false);
|
|
@@ -10056,13 +10063,15 @@ function scheduleWake(state, sendWake, onSendFailure) {
|
|
|
10056
10063
|
state.debounceTimer = setTimeout(() => {
|
|
10057
10064
|
const pending = state.pendingCompletions;
|
|
10058
10065
|
const pendingLongRunning = state.pendingLongRunning;
|
|
10059
|
-
const reminder = formatCombinedSystemReminder(pending, pendingLongRunning);
|
|
10060
|
-
state.pendingCompletions = [];
|
|
10061
|
-
state.pendingLongRunning = [];
|
|
10062
10066
|
state.debounceTimer = null;
|
|
10063
10067
|
state.firstCompletionAt = null;
|
|
10064
10068
|
state.scheduledFireAt = null;
|
|
10065
10069
|
state.scheduledCompletionCount = 0;
|
|
10070
|
+
if (pending.length === 0 && pendingLongRunning.length === 0)
|
|
10071
|
+
return;
|
|
10072
|
+
const reminder = formatCombinedSystemReminder(pending, pendingLongRunning);
|
|
10073
|
+
state.pendingCompletions = [];
|
|
10074
|
+
state.pendingLongRunning = [];
|
|
10066
10075
|
sendWake(reminder).then(() => {
|
|
10067
10076
|
state.retryDelayMs = null;
|
|
10068
10077
|
state.wakeFiredThisIdle = true;
|
package/dist/tui.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// package.json
|
|
3
3
|
var package_default = {
|
|
4
4
|
name: "@cortexkit/aft-opencode",
|
|
5
|
-
version: "0.
|
|
5
|
+
version: "0.21.0",
|
|
6
6
|
type: "module",
|
|
7
7
|
description: "OpenCode plugin for Agent File Tools (AFT) \u2014 tree-sitter and lsp powered code analysis",
|
|
8
8
|
main: "dist/index.js",
|
|
@@ -30,7 +30,7 @@ var package_default = {
|
|
|
30
30
|
},
|
|
31
31
|
dependencies: {
|
|
32
32
|
"@clack/prompts": "^1.2.0",
|
|
33
|
-
"@cortexkit/aft-bridge": "0.
|
|
33
|
+
"@cortexkit/aft-bridge": "0.21.0",
|
|
34
34
|
"@opencode-ai/plugin": "^1.14.39",
|
|
35
35
|
"@opencode-ai/sdk": "^1.14.39",
|
|
36
36
|
"comment-json": "^4.6.2",
|
|
@@ -38,11 +38,11 @@ var package_default = {
|
|
|
38
38
|
zod: "^4.1.8"
|
|
39
39
|
},
|
|
40
40
|
optionalDependencies: {
|
|
41
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
42
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
43
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
44
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
45
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
41
|
+
"@cortexkit/aft-darwin-arm64": "0.21.0",
|
|
42
|
+
"@cortexkit/aft-darwin-x64": "0.21.0",
|
|
43
|
+
"@cortexkit/aft-linux-arm64": "0.21.0",
|
|
44
|
+
"@cortexkit/aft-linux-x64": "0.21.0",
|
|
45
|
+
"@cortexkit/aft-win32-x64": "0.21.0"
|
|
46
46
|
},
|
|
47
47
|
devDependencies: {
|
|
48
48
|
"@types/node": "^22.0.0",
|
|
@@ -827,6 +827,41 @@ async function showStatusDialog(api) {
|
|
|
827
827
|
api.ui.dialog.setSize("medium");
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
|
+
function registerStatusCommand(api) {
|
|
831
|
+
const apiAny = api;
|
|
832
|
+
if (typeof apiAny.keymap?.registerLayer === "function") {
|
|
833
|
+
apiAny.keymap.registerLayer({
|
|
834
|
+
commands: [
|
|
835
|
+
{
|
|
836
|
+
namespace: "palette",
|
|
837
|
+
name: "aft.status",
|
|
838
|
+
title: "AFT: Status",
|
|
839
|
+
category: "AFT",
|
|
840
|
+
slashName: STATUS_COMMAND,
|
|
841
|
+
run() {
|
|
842
|
+
showStatusDialog(api);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
bindings: []
|
|
847
|
+
});
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (typeof apiAny.command?.register === "function") {
|
|
851
|
+
apiAny.command.register(() => [
|
|
852
|
+
{
|
|
853
|
+
title: "AFT: Status",
|
|
854
|
+
value: "aft.status",
|
|
855
|
+
category: "AFT",
|
|
856
|
+
slash: { name: STATUS_COMMAND },
|
|
857
|
+
onSelect() {
|
|
858
|
+
showStatusDialog(api);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
]);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
830
865
|
async function showStartupNotifications(api) {
|
|
831
866
|
const directory = api.state.path.directory ?? "";
|
|
832
867
|
if (!directory)
|
|
@@ -869,17 +904,7 @@ var tui = async (api) => {
|
|
|
869
904
|
try {
|
|
870
905
|
api.slots.register(createAftSidebarSlot(api, package_default.version));
|
|
871
906
|
} catch {}
|
|
872
|
-
api
|
|
873
|
-
{
|
|
874
|
-
title: "AFT: Status",
|
|
875
|
-
value: "aft.status",
|
|
876
|
-
category: "AFT",
|
|
877
|
-
slash: { name: STATUS_COMMAND },
|
|
878
|
-
onSelect() {
|
|
879
|
-
showStatusDialog(api);
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
]);
|
|
907
|
+
registerStatusCommand(api);
|
|
883
908
|
showStartupNotifications(api);
|
|
884
909
|
};
|
|
885
910
|
var id = "aft-opencode";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.2.0",
|
|
31
|
-
"@cortexkit/aft-bridge": "0.
|
|
31
|
+
"@cortexkit/aft-bridge": "0.21.0",
|
|
32
32
|
"@opencode-ai/plugin": "^1.14.39",
|
|
33
33
|
"@opencode-ai/sdk": "^1.14.39",
|
|
34
34
|
"comment-json": "^4.6.2",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"zod": "^4.1.8"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
40
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
41
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
42
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
43
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
39
|
+
"@cortexkit/aft-darwin-arm64": "0.21.0",
|
|
40
|
+
"@cortexkit/aft-darwin-x64": "0.21.0",
|
|
41
|
+
"@cortexkit/aft-linux-arm64": "0.21.0",
|
|
42
|
+
"@cortexkit/aft-linux-x64": "0.21.0",
|
|
43
|
+
"@cortexkit/aft-win32-x64": "0.21.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.0.0",
|
package/src/tui/index.tsx
CHANGED
|
@@ -138,6 +138,69 @@ async function showStatusDialog(api: TuiPluginApi): Promise<void> {
|
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Register the `/aft-status` slash command, preferring the v1.14.42+ keymap
|
|
143
|
+
* API and falling back to the legacy `api.command.register` for older hosts.
|
|
144
|
+
*
|
|
145
|
+
* The `keymap.registerLayer` shape uses `name`/`title`/`run`/`namespace`/
|
|
146
|
+
* `slashName` (see `@opencode-ai/plugin/tui` types) and is what the host's
|
|
147
|
+
* own legacy command-shim translates into. Calling it directly skips the
|
|
148
|
+
* deprecation warning and works without depending on the (now-deprecated)
|
|
149
|
+
* `api.command` namespace existing at all.
|
|
150
|
+
*/
|
|
151
|
+
function registerStatusCommand(api: TuiPluginApi): void {
|
|
152
|
+
type ApiAny = {
|
|
153
|
+
keymap?: {
|
|
154
|
+
registerLayer?: (layer: {
|
|
155
|
+
commands: Array<Record<string, unknown>>;
|
|
156
|
+
bindings: Array<Record<string, unknown>>;
|
|
157
|
+
}) => unknown;
|
|
158
|
+
};
|
|
159
|
+
command?: {
|
|
160
|
+
register?: (cb: () => Array<Record<string, unknown>>) => unknown;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const apiAny = api as unknown as ApiAny;
|
|
164
|
+
|
|
165
|
+
if (typeof apiAny.keymap?.registerLayer === "function") {
|
|
166
|
+
apiAny.keymap.registerLayer({
|
|
167
|
+
commands: [
|
|
168
|
+
{
|
|
169
|
+
namespace: "palette",
|
|
170
|
+
name: "aft.status",
|
|
171
|
+
title: "AFT: Status",
|
|
172
|
+
category: "AFT",
|
|
173
|
+
slashName: STATUS_COMMAND,
|
|
174
|
+
run() {
|
|
175
|
+
void showStatusDialog(api);
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
bindings: [],
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (typeof apiAny.command?.register === "function") {
|
|
185
|
+
apiAny.command.register(() => [
|
|
186
|
+
{
|
|
187
|
+
title: "AFT: Status",
|
|
188
|
+
value: "aft.status",
|
|
189
|
+
category: "AFT",
|
|
190
|
+
slash: { name: STATUS_COMMAND },
|
|
191
|
+
onSelect() {
|
|
192
|
+
void showStatusDialog(api);
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
]);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Neither API surface is present. The TUI host can still load — we only
|
|
200
|
+
// lose the slash-command entry point. The sidebar (registered above)
|
|
201
|
+
// remains available so users can still see AFT status visually.
|
|
202
|
+
}
|
|
203
|
+
|
|
141
204
|
async function showStartupNotifications(api: TuiPluginApi): Promise<void> {
|
|
142
205
|
const directory = api.state.path.directory ?? "";
|
|
143
206
|
if (!directory) return;
|
|
@@ -203,17 +266,15 @@ const tui: TuiPlugin = async (api) => {
|
|
|
203
266
|
// and keep the slash command working.
|
|
204
267
|
}
|
|
205
268
|
|
|
206
|
-
api.command.register
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
]);
|
|
269
|
+
// OpenCode 1.14.42 removed `api.command.register` entirely
|
|
270
|
+
// (anomalyco/opencode PR #26053). Later patches reinstated it as a
|
|
271
|
+
// deprecated shim that translates to `api.keymap.registerLayer`. To work
|
|
272
|
+
// across the whole 1.14.x line — including the brief 1.14.42 / 1.14.43
|
|
273
|
+
// window where neither the legacy API nor a shim was present — we prefer
|
|
274
|
+
// `api.keymap.registerLayer` and fall back to `api.command.register` only
|
|
275
|
+
// when the keymap surface is missing (older hosts that predate keymap).
|
|
276
|
+
// See https://github.com/cortexkit/aft/issues/33.
|
|
277
|
+
registerStatusCommand(api);
|
|
217
278
|
|
|
218
279
|
// Show startup notifications — RPC server is already running by the time TUI loads
|
|
219
280
|
void showStartupNotifications(api);
|