@cortexkit/aft-opencode 0.63.5 → 0.64.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/config-live-reload.d.ts +4 -16
- package/dist/config-live-reload.d.ts.map +1 -1
- package/dist/config.d.ts +11 -28
- package/dist/config.d.ts.map +1 -1
- package/dist/entry/server.js +774 -410
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +774 -410
- package/dist/lsp-auto-install.d.ts.map +1 -1
- package/dist/shared/session-directory.d.ts +4 -2
- package/dist/shared/session-directory.d.ts.map +1 -1
- package/dist/shared/status.d.ts +0 -4
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/subc-tool-schemas.d.ts +4 -3
- package/dist/subc-tool-schemas.d.ts.map +1 -1
- package/dist/tools/_shared.d.ts +11 -17
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/bash_watch.d.ts +6 -3
- package/dist/tools/bash_watch.d.ts.map +1 -1
- package/dist/tools/definitions/v2.d.ts +25 -0
- package/dist/tools/definitions/v2.d.ts.map +1 -1
- package/dist/tools/inspect.d.ts +0 -15
- package/dist/tools/inspect.d.ts.map +1 -1
- package/dist/tui/preferences.d.ts +1 -1
- package/dist/tui/v2-status.d.ts +3 -2
- package/dist/tui/v2-status.d.ts.map +1 -1
- package/dist/v2-session-lifecycle.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/shared/session-directory.ts +10 -5
- package/src/shared/status.ts +2 -22
- package/src/tui/index.tsx +1 -25
- package/src/tui/preferences.ts +1 -1
- package/src/tui/sidebar-view.tsx +2 -39
- package/src/tui/v2-status.ts +5 -14
- package/src/tui-compiled/index.tsx +2 -41
- package/src/tui-compiled/preferences.ts +1 -1
- package/src/tui-compiled/sidebar-view.tsx +34 -72
- package/src/tui-compiled/v2-status.ts +5 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-auto-install.d.ts","sourceRoot":"","sources":["../src/lsp-auto-install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;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,iBAAiB,EACzB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,CAAC,CA6CvF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAYrD;AAmWD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAI/F;AAWD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,iBAAiB,EACzB,SAAS,GAAE,OAAO,KAAa,GAC9B,iBAAiB,CA+EnB;AAED,gFAAgF;AAChF,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,aAAa,CAAC,EACpE,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The session itself stores the correct directory in OpenCode's SQLite
|
|
14
14
|
* (`Session.directory` in the SDK). This helper looks it up once per
|
|
15
|
-
* session and caches the result
|
|
16
|
-
*
|
|
15
|
+
* session and caches the result. A session.moved event invalidates the
|
|
16
|
+
* cached root because OpenCode 2 sessions can change Location.
|
|
17
17
|
*
|
|
18
18
|
* The bug should also be fixed upstream in OpenCode's
|
|
19
19
|
* `packages/opencode/src/session/registry.ts`. Until then this
|
|
@@ -60,6 +60,8 @@ export declare function getSessionDirectoryCached(sessionId: string | undefined)
|
|
|
60
60
|
*/
|
|
61
61
|
export declare function warmSessionDirectory(client: unknown, sessionId: string | undefined, fallbackDirectory: string): void;
|
|
62
62
|
export declare function verifySessionDirectory(client: unknown, sessionId: string): Promise<string | null>;
|
|
63
|
+
/** Forget directory snapshots when the host moves or removes a session. */
|
|
64
|
+
export declare function clearSessionDirectory(sessionId: string): void;
|
|
63
65
|
/** Release transport routes on deletion without querying a session the host has already removed. */
|
|
64
66
|
export declare function closeDeletedSessionRoutes(pool: AftTransportPool, sessionId: string, fallbackDirectory: string): Promise<void>;
|
|
65
67
|
/** Test-only: clear the cache between unit tests. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-directory.d.ts","sourceRoot":"","sources":["../../src/shared/session-directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAiD9D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,OAAQ,CAAC;AACvC,eAAO,MAAM,4BAA4B,OAAoB,CAAC;AAC9D,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAwB7C;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqBxB;AAqID;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,IAAI,GAAG,SAAS,CAS3B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,iBAAiB,EAAE,MAAM,GACxB,IAAI,CAIN;AAqBD,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,OAAO,E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,IAAI,EAAE,gBAAgB,EACtB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,qDAAqD;AACrD,wBAAgB,kCAAkC,IAAI,IAAI,CAMzD"}
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -38,11 +38,7 @@ export interface StatusBar {
|
|
|
38
38
|
disabled_categories?: string[];
|
|
39
39
|
errors?: number;
|
|
40
40
|
warnings?: number;
|
|
41
|
-
dead_code?: number;
|
|
42
|
-
unused_exports?: number;
|
|
43
|
-
duplicates?: number;
|
|
44
41
|
todos?: number;
|
|
45
|
-
tier2_stale?: boolean;
|
|
46
42
|
/**
|
|
47
43
|
* `no_language_server` means no server is running. `producer_missing`
|
|
48
44
|
* masks both counts when an expected project producer has failed, even if
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/shared/status.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,KAAK,uBAAuB,EAC5B,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,EAAE,yBAAyB,EAAE,KAAK,uBAAuB,EAAE,uBAAuB,EAAE,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,IAAI,CACZ,iBAAiB,CAAC,gBAAgB,CAAC,EACnC,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAC3E,GACA,MAAM,CAMR;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,E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AC;IACvB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAqGD,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAajD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAoGpF;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA8F3E;AASD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG;IAChE,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,IAAI,EAAE,OAAO,CAAC;CACf,CAKA;AAeD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAiGtE"}
|
|
@@ -42,9 +42,10 @@ export declare function buildSubcToolSchemasJson(): string;
|
|
|
42
42
|
export declare const SUBC_BARE_TOOL_NAMES: readonly SubcBareToolName[];
|
|
43
43
|
/**
|
|
44
44
|
* Tool schemas the module catalog's `worker` preset serves in place of the
|
|
45
|
-
* base ones, plus the tools only that preset serves. The `
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* base ones, plus the tools only that preset serves. The `reader` preset only
|
|
46
|
+
* narrows the tool list, so it needs no entries here, and the `head` preset is
|
|
47
|
+
* the base artifact unchanged except for a runner head (a head whose catalog
|
|
48
|
+
* request names its model), which is also served `head.bash_watch`.
|
|
48
49
|
*
|
|
49
50
|
* A worker is a delegated session: once its turn ends it has delivered its
|
|
50
51
|
* result, and nothing (no completion reminder, no async notification) wakes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subc-tool-schemas.d.ts","sourceRoot":"","sources":["../src/subc-tool-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"subc-tool-schemas.d.ts","sourceRoot":"","sources":["../src/subc-tool-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoBhD,QAAA,MAAM,eAAe,kRAyBX,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,UAAQ,GAAG,aAAa,CAgB1E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AA2C1D;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,UAAQ,EAClB,aAAa,UAAQ,GACpB,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAoInD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAajG;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,gBAAgB,EAAoB,CAAC;AAEjF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,UAAQ,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAuCzD;AA+DD,2FAA2F;AAC3F,wBAAgB,wBAAwB,IAAI,MAAM,CASjD;AAED,qFAAqF;AACrF,wBAAgB,8BAA8B,IAAI,MAAM,CASvD;AAED,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,sCAAuC,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,CAKzD"}
|
package/dist/tools/_shared.d.ts
CHANGED
|
@@ -61,8 +61,8 @@ export interface ToolRuntime {
|
|
|
61
61
|
sessionID?: string;
|
|
62
62
|
/**
|
|
63
63
|
* True when `directory` is the directory the host placed this session in, so
|
|
64
|
-
* it, not `worktree
|
|
65
|
-
*
|
|
64
|
+
* it, not `worktree` or a cached session directory, is the root to use.
|
|
65
|
+
* OpenCode 2 sets this: its `directory` is the session's Location
|
|
66
66
|
* directory, while its `worktree` is the project's main checkout, which is
|
|
67
67
|
* the wrong root for a session in a linked git worktree (issue #387).
|
|
68
68
|
* OpenCode 1 leaves it unset because its `directory` can be the launch cwd
|
|
@@ -78,23 +78,17 @@ export interface ToolRuntime {
|
|
|
78
78
|
/**
|
|
79
79
|
* Resolve the canonical project root for a runtime.
|
|
80
80
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* CLI use, older hosts). Normalizes trailing slashes and resolves symlinks
|
|
84
|
-
* so `/repo` and `/repo/` and `/Users/.../repo -> /Volumes/...` collapse to
|
|
85
|
-
* the same key.
|
|
81
|
+
* Normalizes trailing slashes and resolves symlinks so `/repo` and `/repo/`
|
|
82
|
+
* and `/Users/.../repo -> /Volumes/...` collapse to the same key.
|
|
86
83
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* session's actual project directory.
|
|
84
|
+
* OpenCode 2's per-call `directory` is the session's current Location, so it
|
|
85
|
+
* wins over the cache after a session move. Only a call without a directory
|
|
86
|
+
* falls back to the cache. Its `worktree` is the main checkout, which is the
|
|
87
|
+
* wrong root for a session in a linked git worktree.
|
|
92
88
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* wrong answer (issue #387). `worktree` keeps that meaning for the permission
|
|
97
|
-
* checks that treat the main checkout as part of the project.
|
|
89
|
+
* OpenCode 1 still prefers the cached session directory: its `ctx.directory`
|
|
90
|
+
* can be the launch cwd rather than the resumed session's project. Without
|
|
91
|
+
* a cache entry it prefers `worktree`, then `directory`.
|
|
98
92
|
*/
|
|
99
93
|
export declare function projectRootFor(runtime: ToolRuntime): string;
|
|
100
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAa/B,OAAO,EAAE,KAAK,WAAW,EAAQ,MAAM,qBAAqB,CAAC;AAO7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,GACR,CAAC;AAOhD,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAIhD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAA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AAM,EAAE,OAAO,CAAM,EACrC,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC,CAgEzB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAUlC"}
|
|
@@ -29,10 +29,13 @@ type BashStatusWithWait = Record<string, unknown> & {
|
|
|
29
29
|
* `primary` wording, which covers both roles. The subc module catalog's
|
|
30
30
|
* `worker` preset uses the `worker` wording: a delegated worker is never woken
|
|
31
31
|
* by a completion reminder or an async notification once its turn ends, so it
|
|
32
|
-
* is told only how to wait.
|
|
33
|
-
*
|
|
32
|
+
* is told only how to wait. A runner head's catalog uses the `primary` wording
|
|
33
|
+
* without its async-watch sentences (`asyncWatches` false). The polling warning
|
|
34
|
+
* names bash_status only when the model can call it.
|
|
34
35
|
*/
|
|
35
|
-
export declare function bashWatchDescription(role: WatchCallerRole, statusRegistered: boolean): string;
|
|
36
|
+
export declare function bashWatchDescription(role: WatchCallerRole, statusRegistered: boolean, asyncWatches?: boolean): string;
|
|
37
|
+
/** The `pattern` argument's sentence about the sync and async watch modes. */
|
|
38
|
+
export declare const WATCH_PATTERN_MODES_SENTENCE = " Optional in sync mode; required with background:true.";
|
|
36
39
|
export declare function createBashWatchTool(ctx: PluginContext): ToolDefinition;
|
|
37
40
|
export declare function waitForBashStatus(ctx: PluginContext, runtime: ToolContext, taskId: string, outputMode: string | undefined, waitFor: BashWaitPattern | undefined, effectiveWaitMs: number | undefined, role: WatchCallerRole): Promise<BashStatusWithWait>;
|
|
38
41
|
export declare function parseWaitPattern(value: unknown): BashWaitPattern | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAkBL,KAAK,eAAe,EAOrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsBjD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,CAAC;IACtF,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACnC;qEACiE;IACjE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAUF,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAkBL,KAAK,eAAe,EAOrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAs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AgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAI5E;AAgMD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEvD"}
|
|
@@ -64,6 +64,31 @@ export interface V2ProviderTool {
|
|
|
64
64
|
};
|
|
65
65
|
execute(input: Record<string, unknown>, context: V2ExecutionContext): Effect.Effect<Record<string, unknown>, unknown>;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Report AFT's shell permission refusal as the host's own permission failure,
|
|
69
|
+
* so OpenCode 2 files it as `permission.rejected` rather than `tool.execution`.
|
|
70
|
+
*
|
|
71
|
+
* When a deny rule matches, or the person rejects the prompt with feedback,
|
|
72
|
+
* the host's `permission.assert` fails with a `Tool.Error` whose `error` is the
|
|
73
|
+
* host's `Permission.BlockedError` or `Permission.CorrectedError`. The host
|
|
74
|
+
* classifies a failed tool call by the error the tool fails with: a
|
|
75
|
+
* `Tool.Error` holding one of those permission errors becomes
|
|
76
|
+
* `permission.rejected`, and the model is shown the inner error's text (the
|
|
77
|
+
* blocked error's `message`, which is its `reason` when set, or the
|
|
78
|
+
* correction's `feedback`). Every other failure becomes `tool.execution`.
|
|
79
|
+
* See `toSessionError` in @opencode/core 2.0.29 and 2.1.0
|
|
80
|
+
* (`src/session/to-session-error.ts`) and the plugin `permission.assert`
|
|
81
|
+
* adapter (`src/plugin/host.ts`).
|
|
82
|
+
*
|
|
83
|
+
* The bash permission loop wraps the host's failure in a
|
|
84
|
+
* `BashPermissionLoopError` carrying AFT's refusal text, which loses that
|
|
85
|
+
* classification. The plugin API exports no permission error classes, so the
|
|
86
|
+
* replacement errors are built with the constructors of the errors the host
|
|
87
|
+
* failed with, and carry AFT's text in the field the host shows the model.
|
|
88
|
+
* If the host's errors do not have exactly that shape, the original error is
|
|
89
|
+
* returned: the model sees the same text, filed as a tool execution failure.
|
|
90
|
+
*/
|
|
91
|
+
export declare function hostPermissionRefusal(error: unknown): unknown;
|
|
67
92
|
/**
|
|
68
93
|
* Project one shared V1 definition into the V2 provider-tool contract.
|
|
69
94
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/v2.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/v2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAsBnC,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;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Q,CAAC;AAE3D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC1E,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;QAC3C,QAAQ,EAAE,KAAK,CAAC;KACjB,CAAC;IACF,OAAO,CACL,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;CACpD;AAsBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA+C7D;AAuOD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,UAAU,EACpB,SAAS,GAAE,eAAoB,GAC9B,cAAc,CAkGhB;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,GAAG,MAAM,CAwBhG"}
|
package/dist/tools/inspect.d.ts
CHANGED
|
@@ -46,20 +46,5 @@ export interface InspectToolConfig {
|
|
|
46
46
|
* registration predicate.
|
|
47
47
|
*/
|
|
48
48
|
export declare function shouldRegisterInspectTool(config: InspectToolConfig): boolean;
|
|
49
|
-
type TimerHandle = ReturnType<typeof setTimeout>;
|
|
50
|
-
export interface InspectTier2IdleSchedulerOptions {
|
|
51
|
-
isEnabled: () => boolean;
|
|
52
|
-
idleMinutes: () => number | undefined;
|
|
53
|
-
run: (sessionID: string) => Promise<void>;
|
|
54
|
-
warn?: (message: string) => void;
|
|
55
|
-
setTimer?: (callback: () => void, delayMs: number) => TimerHandle;
|
|
56
|
-
clearTimer?: (timer: TimerHandle) => void;
|
|
57
|
-
}
|
|
58
|
-
export declare function createInspectTier2IdleScheduler(options: InspectTier2IdleSchedulerOptions): {
|
|
59
|
-
schedule: (sessionID: string) => void;
|
|
60
|
-
clear: (sessionID: string) => void;
|
|
61
|
-
clearAll: () => void;
|
|
62
|
-
};
|
|
63
49
|
export declare function inspectTools(ctx: PluginContext): Record<string, ToolDefinition>;
|
|
64
|
-
export {};
|
|
65
50
|
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgBjD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC;AAEvF,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA2FD;;;GAGG;AACH,wBAAgB,wBAAwB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AM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA2FD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,EAAE,CAmB5E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CA8DlF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAyB3E;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CA0B5F;AAeD,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAE5E;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAmE/E"}
|
|
@@ -10,7 +10,7 @@ export interface AftTuiPrefs {
|
|
|
10
10
|
rememberCollapsed: boolean;
|
|
11
11
|
collapsed: boolean | null;
|
|
12
12
|
/**
|
|
13
|
-
* Whether OpenCode 2 shows AFT's health line (`AFT E0 W0 |
|
|
13
|
+
* Whether OpenCode 2 shows AFT's health line (`AFT E0 W0 | T0`)
|
|
14
14
|
* in the prompt footer. Off hides it entirely; the sidebar and the status
|
|
15
15
|
* dialog are unaffected.
|
|
16
16
|
*/
|
package/dist/tui/v2-status.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { type AftStatusSnapshot } from "../shared/status";
|
|
|
3
3
|
* The V2 footer segment. "AFT starting…" is only true before the bridge has
|
|
4
4
|
* delivered a real snapshot. After that the footer shows every health category
|
|
5
5
|
* that has a value and `?` for any that does not, because a producer that is
|
|
6
|
-
* unavailable (for example
|
|
7
|
-
*
|
|
6
|
+
* unavailable (for example no language server) can leave the complete
|
|
7
|
+
* `status_bar` missing for the whole session. Dead code, unused exports and
|
|
8
|
+
* duplicates are not shown: they are computed only by aft_inspect.
|
|
8
9
|
*/
|
|
9
10
|
export declare function formatAftStatusSegment(status: AftStatusSnapshot | null): string;
|
|
10
11
|
export type AftSidebarSummary = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-status.d.ts","sourceRoot":"","sources":["../../src/tui/v2-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwC,MAAM,kBAAkB,CAAC;AAyBhG
|
|
1
|
+
{"version":3,"file":"v2-status.d.ts","sourceRoot":"","sources":["../../src/tui/v2-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwC,MAAM,kBAAkB,CAAC;AAyBhG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAO/E;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAMF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,iBAAiB,CAsBvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-session-lifecycle.d.ts","sourceRoot":"","sources":["../src/v2-session-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAU,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"v2-session-lifecycle.d.ts","sourceRoot":"","sources":["../src/v2-session-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,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,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED,2EAA2E;AAC3E,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,aAAa,4DAkJ/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.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",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@clack/prompts": "^1.6.0",
|
|
42
|
-
"@cortexkit/aft-bridge": "0.
|
|
42
|
+
"@cortexkit/aft-bridge": "0.64.0",
|
|
43
43
|
"@opentui/core": "0.4.3",
|
|
44
44
|
"@opentui/solid": "0.4.3",
|
|
45
45
|
"comment-json": "^4.6.2",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"zod": "^4.4.3"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
53
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
54
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
55
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
56
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
57
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
52
|
+
"@cortexkit/aft-darwin-arm64": "0.64.0",
|
|
53
|
+
"@cortexkit/aft-darwin-x64": "0.64.0",
|
|
54
|
+
"@cortexkit/aft-linux-arm64": "0.64.0",
|
|
55
|
+
"@cortexkit/aft-linux-x64": "0.64.0",
|
|
56
|
+
"@cortexkit/aft-win32-arm64": "0.64.0",
|
|
57
|
+
"@cortexkit/aft-win32-x64": "0.64.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@opencode-ai/plugin": "^1.17.11",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The session itself stores the correct directory in OpenCode's SQLite
|
|
14
14
|
* (`Session.directory` in the SDK). This helper looks it up once per
|
|
15
|
-
* session and caches the result
|
|
16
|
-
*
|
|
15
|
+
* session and caches the result. A session.moved event invalidates the
|
|
16
|
+
* cached root because OpenCode 2 sessions can change Location.
|
|
17
17
|
*
|
|
18
18
|
* The bug should also be fixed upstream in OpenCode's
|
|
19
19
|
* `packages/opencode/src/session/registry.ts`. Until then this
|
|
@@ -385,6 +385,13 @@ async function boundedVerification(client: unknown, sessionId: string): Promise<
|
|
|
385
385
|
return dir;
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
/** Forget directory snapshots when the host moves or removes a session. */
|
|
389
|
+
export function clearSessionDirectory(sessionId: string): void {
|
|
390
|
+
cache.delete(sessionId);
|
|
391
|
+
lookupGenerations.delete(sessionId);
|
|
392
|
+
verifyCache.delete(sessionId);
|
|
393
|
+
}
|
|
394
|
+
|
|
388
395
|
/** Release transport routes on deletion without querying a session the host has already removed. */
|
|
389
396
|
export async function closeDeletedSessionRoutes(
|
|
390
397
|
pool: AftTransportPool,
|
|
@@ -395,9 +402,7 @@ export async function closeDeletedSessionRoutes(
|
|
|
395
402
|
const roots = new Set(pool.activeBridges().map((bridge) => bridge.getCwd()));
|
|
396
403
|
roots.add(getSessionDirectoryCached(sessionId) ?? fallbackDirectory);
|
|
397
404
|
await Promise.allSettled([...roots].map((root) => pool.closeSession(root, sessionId)));
|
|
398
|
-
|
|
399
|
-
lookupGenerations.delete(sessionId);
|
|
400
|
-
verifyCache.delete(sessionId);
|
|
405
|
+
clearSessionDirectory(sessionId);
|
|
401
406
|
}
|
|
402
407
|
|
|
403
408
|
/** Test-only: clear the cache between unit tests. */
|
package/src/shared/status.ts
CHANGED
|
@@ -59,11 +59,7 @@ export interface StatusBar {
|
|
|
59
59
|
disabled_categories?: string[];
|
|
60
60
|
errors?: number;
|
|
61
61
|
warnings?: number;
|
|
62
|
-
dead_code?: number;
|
|
63
|
-
unused_exports?: number;
|
|
64
|
-
duplicates?: number;
|
|
65
62
|
todos?: number;
|
|
66
|
-
tier2_stale?: boolean;
|
|
67
63
|
/**
|
|
68
64
|
* `no_language_server` means no server is running. `producer_missing`
|
|
69
65
|
* masks both counts when an expected project producer has failed, even if
|
|
@@ -233,9 +229,6 @@ function readStatusBar(value: unknown): StatusBar | undefined {
|
|
|
233
229
|
: [];
|
|
234
230
|
const errors = readOptionalNumber(bar.errors);
|
|
235
231
|
const warnings = readOptionalNumber(bar.warnings);
|
|
236
|
-
const deadCode = readOptionalNumber(bar.dead_code);
|
|
237
|
-
const unusedExports = readOptionalNumber(bar.unused_exports);
|
|
238
|
-
const duplicates = readOptionalNumber(bar.duplicates);
|
|
239
232
|
const todos = readOptionalNumber(bar.todos);
|
|
240
233
|
const noLanguageServer = bar.diagnostics === "no_language_server";
|
|
241
234
|
const producerMissing = bar.diagnostics === "producer_missing";
|
|
@@ -257,9 +250,6 @@ function readStatusBar(value: unknown): StatusBar | undefined {
|
|
|
257
250
|
if (
|
|
258
251
|
errors === null &&
|
|
259
252
|
warnings === null &&
|
|
260
|
-
deadCode === null &&
|
|
261
|
-
unusedExports === null &&
|
|
262
|
-
duplicates === null &&
|
|
263
253
|
todos === null &&
|
|
264
254
|
!noLanguageServer &&
|
|
265
255
|
!producerMissing &&
|
|
@@ -271,11 +261,7 @@ function readStatusBar(value: unknown): StatusBar | undefined {
|
|
|
271
261
|
...(disabled.length > 0 ? { disabled_categories: disabled } : {}),
|
|
272
262
|
...(errors !== null ? { errors } : {}),
|
|
273
263
|
...(warnings !== null ? { warnings } : {}),
|
|
274
|
-
...(deadCode !== null ? { dead_code: deadCode } : {}),
|
|
275
|
-
...(unusedExports !== null ? { unused_exports: unusedExports } : {}),
|
|
276
|
-
...(duplicates !== null ? { duplicates } : {}),
|
|
277
264
|
...(todos !== null ? { todos } : {}),
|
|
278
|
-
...(bar.tier2_stale === true ? { tier2_stale: true } : {}),
|
|
279
265
|
...(noLanguageServer ? { diagnostics: "no_language_server" as const } : {}),
|
|
280
266
|
...(producerMissing
|
|
281
267
|
? { diagnostics: "producer_missing" as const, diagnostics_gaps: diagnosticsGaps }
|
|
@@ -501,13 +487,10 @@ export function formatStatusDialogMessage(status: AftStatusSnapshot): string {
|
|
|
501
487
|
const rows = [
|
|
502
488
|
["errors", sb.errors],
|
|
503
489
|
["warnings", sb.warnings],
|
|
504
|
-
["dead code", sb.dead_code],
|
|
505
|
-
["unused exports", sb.unused_exports],
|
|
506
|
-
["duplicates", sb.duplicates],
|
|
507
490
|
["todos", sb.todos],
|
|
508
491
|
].filter((row): row is [string, number] => typeof row[1] === "number");
|
|
509
492
|
if (rows.length > 0) {
|
|
510
|
-
lines.push("",
|
|
493
|
+
lines.push("", "Code Health");
|
|
511
494
|
for (const [label, value] of rows) lines.push(`- ${label}: ${formatCount(value)}`);
|
|
512
495
|
}
|
|
513
496
|
}
|
|
@@ -660,13 +643,10 @@ export function formatStatusMarkdown(status: AftStatusSnapshot): string {
|
|
|
660
643
|
const rows = [
|
|
661
644
|
["Errors", sb.errors],
|
|
662
645
|
["Warnings", sb.warnings],
|
|
663
|
-
["Dead code", sb.dead_code],
|
|
664
|
-
["Unused exports", sb.unused_exports],
|
|
665
|
-
["Duplicates", sb.duplicates],
|
|
666
646
|
["TODOs", sb.todos],
|
|
667
647
|
].filter((row): row is [string, number] => typeof row[1] === "number");
|
|
668
648
|
if (rows.length > 0) {
|
|
669
|
-
lines.push("",
|
|
649
|
+
lines.push("", "### Code Health");
|
|
670
650
|
for (const [label, value] of rows) lines.push(`- **${label}:** ${formatCount(value)}`);
|
|
671
651
|
}
|
|
672
652
|
}
|
package/src/tui/index.tsx
CHANGED
|
@@ -496,7 +496,7 @@ const StatusDialog = (props: StatusDialogProps) => {
|
|
|
496
496
|
{statusBar() ? (
|
|
497
497
|
<box flexDirection="column" width="100%" marginTop={1}>
|
|
498
498
|
<text fg={t().text}>
|
|
499
|
-
<b>
|
|
499
|
+
<b>Code Health</b>
|
|
500
500
|
</text>
|
|
501
501
|
{(statusBar()!.disabled_categories ?? []).map((key) => (
|
|
502
502
|
<R theme={t()} label={key.replaceAll("_", " ")} value="○ off" tone="muted" />
|
|
@@ -517,30 +517,6 @@ const StatusDialog = (props: StatusDialogProps) => {
|
|
|
517
517
|
tone={statusBar()!.warnings! > 0 ? "warn" : "muted"}
|
|
518
518
|
/>
|
|
519
519
|
) : null}
|
|
520
|
-
{statusBar()!.dead_code !== undefined ? (
|
|
521
|
-
<R
|
|
522
|
-
theme={t()}
|
|
523
|
-
label="Dead Code"
|
|
524
|
-
value={formatCountShort(statusBar()!.dead_code)}
|
|
525
|
-
tone="muted"
|
|
526
|
-
/>
|
|
527
|
-
) : null}
|
|
528
|
-
{statusBar()!.unused_exports !== undefined ? (
|
|
529
|
-
<R
|
|
530
|
-
theme={t()}
|
|
531
|
-
label="Unused Exports"
|
|
532
|
-
value={formatCountShort(statusBar()!.unused_exports)}
|
|
533
|
-
tone="muted"
|
|
534
|
-
/>
|
|
535
|
-
) : null}
|
|
536
|
-
{statusBar()!.duplicates !== undefined ? (
|
|
537
|
-
<R
|
|
538
|
-
theme={t()}
|
|
539
|
-
label="Duplicates"
|
|
540
|
-
value={formatCountShort(statusBar()!.duplicates)}
|
|
541
|
-
tone="muted"
|
|
542
|
-
/>
|
|
543
|
-
) : null}
|
|
544
520
|
{statusBar()!.todos !== undefined ? (
|
|
545
521
|
<R
|
|
546
522
|
theme={t()}
|
package/src/tui/preferences.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface AftTuiPrefs {
|
|
|
40
40
|
rememberCollapsed: boolean;
|
|
41
41
|
collapsed: boolean | null;
|
|
42
42
|
/**
|
|
43
|
-
* Whether OpenCode 2 shows AFT's health line (`AFT E0 W0 |
|
|
43
|
+
* Whether OpenCode 2 shows AFT's health line (`AFT E0 W0 | T0`)
|
|
44
44
|
* in the prompt footer. Off hides it entirely; the sidebar and the status
|
|
45
45
|
* dialog are unaffected.
|
|
46
46
|
*/
|
package/src/tui/sidebar-view.tsx
CHANGED
|
@@ -301,7 +301,6 @@ export function degradedReasonLabel(reason: string): string {
|
|
|
301
301
|
|
|
302
302
|
export interface HealthLights {
|
|
303
303
|
diagnostics: HealthLightTone;
|
|
304
|
-
code: HealthLightTone;
|
|
305
304
|
todos: HealthLightTone;
|
|
306
305
|
}
|
|
307
306
|
|
|
@@ -317,15 +316,9 @@ export function collapsedHealthLights(statusBar: StatusBar | undefined): HealthL
|
|
|
317
316
|
: statusBar.errors === 0 && statusBar.warnings === 0
|
|
318
317
|
? "ok"
|
|
319
318
|
: "muted";
|
|
320
|
-
const codeValues = [statusBar.dead_code, statusBar.unused_exports, statusBar.duplicates];
|
|
321
|
-
const code: HealthLightTone = codeValues.some((value) => value !== undefined && value > 0)
|
|
322
|
-
? "warn"
|
|
323
|
-
: codeValues.every((value) => value === 0)
|
|
324
|
-
? "ok"
|
|
325
|
-
: "muted";
|
|
326
319
|
const todos: HealthLightTone =
|
|
327
320
|
statusBar.todos === undefined ? "muted" : statusBar.todos > 0 ? "warn" : "ok";
|
|
328
|
-
return { diagnostics,
|
|
321
|
+
return { diagnostics, todos };
|
|
329
322
|
}
|
|
330
323
|
|
|
331
324
|
export interface AftSidebarPanelProps {
|
|
@@ -553,9 +546,6 @@ export const AftSidebarPanel = (props: AftSidebarPanelProps) => {
|
|
|
553
546
|
>
|
|
554
547
|
●
|
|
555
548
|
</text>
|
|
556
|
-
<text fg={toneColor(props.palette, collapsedHealthLights(statusBar())!.code)}>
|
|
557
|
-
●
|
|
558
|
-
</text>
|
|
559
549
|
<text fg={toneColor(props.palette, collapsedHealthLights(statusBar())!.todos)}>
|
|
560
550
|
●
|
|
561
551
|
</text>
|
|
@@ -650,10 +640,7 @@ export const AftSidebarPanel = (props: AftSidebarPanelProps) => {
|
|
|
650
640
|
server proves it, rather than appearing as a clean zero. */}
|
|
651
641
|
{props.prefs.sections.codeHealth && statusBar() && (
|
|
652
642
|
<>
|
|
653
|
-
<SectionHeader
|
|
654
|
-
palette={props.palette}
|
|
655
|
-
title={statusBar()!.tier2_stale ? "Code Health ~" : "Code Health"}
|
|
656
|
-
/>
|
|
643
|
+
<SectionHeader palette={props.palette} title="Code Health" />
|
|
657
644
|
{(statusBar()!.disabled_categories ?? []).map((key) => (
|
|
658
645
|
<StatRow
|
|
659
646
|
palette={props.palette}
|
|
@@ -678,30 +665,6 @@ export const AftSidebarPanel = (props: AftSidebarPanelProps) => {
|
|
|
678
665
|
tone={statusBar()!.warnings! > 0 ? "warn" : "muted"}
|
|
679
666
|
/>
|
|
680
667
|
)}
|
|
681
|
-
{statusBar()!.dead_code !== undefined && (
|
|
682
|
-
<StatRow
|
|
683
|
-
palette={props.palette}
|
|
684
|
-
label="Dead Code"
|
|
685
|
-
value={formatCount(statusBar()!.dead_code)}
|
|
686
|
-
tone="muted"
|
|
687
|
-
/>
|
|
688
|
-
)}
|
|
689
|
-
{statusBar()!.unused_exports !== undefined && (
|
|
690
|
-
<StatRow
|
|
691
|
-
palette={props.palette}
|
|
692
|
-
label="Unused Exports"
|
|
693
|
-
value={formatCount(statusBar()!.unused_exports)}
|
|
694
|
-
tone="muted"
|
|
695
|
-
/>
|
|
696
|
-
)}
|
|
697
|
-
{statusBar()!.duplicates !== undefined && (
|
|
698
|
-
<StatRow
|
|
699
|
-
palette={props.palette}
|
|
700
|
-
label="Duplicates"
|
|
701
|
-
value={formatCount(statusBar()!.duplicates)}
|
|
702
|
-
tone="muted"
|
|
703
|
-
/>
|
|
704
|
-
)}
|
|
705
668
|
{statusBar()!.todos !== undefined && (
|
|
706
669
|
<StatRow
|
|
707
670
|
palette={props.palette}
|