@cortexkit/aft-opencode 0.33.0 → 0.35.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.d.ts +31 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/configure-warnings.d.ts +20 -0
- package/dist/configure-warnings.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3269 -2845
- package/dist/notifications.d.ts +3 -0
- package/dist/notifications.d.ts.map +1 -1
- package/dist/shared/bash-hints.d.ts +1 -23
- package/dist/shared/bash-hints.d.ts.map +1 -1
- package/dist/status-bar-inject.d.ts +11 -0
- package/dist/status-bar-inject.d.ts.map +1 -0
- package/dist/tools/_shared.d.ts +11 -0
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/ast.d.ts.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/conflicts.d.ts.map +1 -1
- package/dist/tools/hoisted.d.ts.map +1 -1
- package/dist/tools/imports.d.ts.map +1 -1
- package/dist/tools/inspect.d.ts.map +1 -1
- package/dist/tools/navigation.d.ts.map +1 -1
- package/dist/tools/permissions.d.ts +1 -0
- package/dist/tools/permissions.d.ts.map +1 -1
- package/dist/tools/reading.d.ts.map +1 -1
- package/dist/tools/refactoring.d.ts.map +1 -1
- package/dist/tools/safety.d.ts.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/structure.d.ts.map +1 -1
- package/dist/tui.js +88 -5
- package/dist/workflow-hints.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/shared/bash-hints.ts +4 -45
- package/src/tui/index.tsx +15 -1
- package/src/tui/sidebar.tsx +106 -4
package/dist/notifications.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* when no longer relevant (Desktop only — TUI toasts are inherently transient).
|
|
15
15
|
*/
|
|
16
16
|
import { type BinaryBridge } from "@cortexkit/aft-bridge";
|
|
17
|
+
import type { ConfigureWarningsDelivery } from "./config.js";
|
|
17
18
|
export declare function __resetNotificationStateForTests(): void;
|
|
18
19
|
type SdkMessage = {
|
|
19
20
|
info?: {
|
|
@@ -58,6 +59,8 @@ export interface ConfigureWarningOptions {
|
|
|
58
59
|
storageDir: string;
|
|
59
60
|
pluginVersion: string;
|
|
60
61
|
projectRoot?: string;
|
|
62
|
+
serverUrl?: string;
|
|
63
|
+
delivery?: ConfigureWarningsDelivery;
|
|
61
64
|
}
|
|
62
65
|
/**
|
|
63
66
|
* Send a persistent warning notification.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AA2K7D,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAID,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpE,CAAC;AAyBF,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,EA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,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CA2Cf;AA+KD,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,uBAAuB,EAC7B,QAAQ,EAAE,gBAAgB,EAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C9E"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Append the `aft_conflicts` hint when the output indicates a real git merge
|
|
3
|
-
* or rebase produced conflicts.
|
|
4
|
-
*
|
|
5
|
-
* Gated on BOTH:
|
|
6
|
-
* - the "Automatic merge failed; fix conflicts" marker, AND
|
|
7
|
-
* - a git-conflict signal (`CONFLICT (...)` line or `error: could not apply`)
|
|
8
|
-
*
|
|
9
|
-
* Both conditions are required because `aft_conflicts` calls `git ls-files -u`,
|
|
10
|
-
* which fails with "not a git repository" outside a git working tree. The
|
|
11
|
-
* marker string can legitimately appear in docs, READMEs, test fixtures, and
|
|
12
|
-
* grep output, so we cannot key off it alone — a false-positive hint sends
|
|
13
|
-
* agents into a confusing error.
|
|
14
|
-
*/
|
|
15
|
-
export declare function maybeAppendConflictsHint(output: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* Append the grep-tool hint when the bash command was a grep/rg invocation.
|
|
18
|
-
*
|
|
19
|
-
* Detected by examining the FIRST LINE of output (which is the echoed command
|
|
20
|
-
* line on most shells in foreground mode). We cap the slice at 300 chars so
|
|
21
|
-
* a single huge first line doesn't slow this hook.
|
|
22
|
-
*/
|
|
23
|
-
export declare function maybeAppendGrepHint(output: string): string;
|
|
1
|
+
export { maybeAppendConflictsHint, maybeAppendGrepHint } from "@cortexkit/aft-bridge";
|
|
24
2
|
//# sourceMappingURL=bash-hints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-hints.d.ts","sourceRoot":"","sources":["../../src/shared/bash-hints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bash-hints.d.ts","sourceRoot":"","sources":["../../src/shared/bash-hints.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type StatusBarCounts } from "@cortexkit/aft-bridge";
|
|
2
|
+
/**
|
|
3
|
+
* Decide whether to surface the bar for this session+counts and, if so, return
|
|
4
|
+
* the line to append to the tool output. Returns `""` when suppressed
|
|
5
|
+
* (unchanged since last emit and heartbeat not elapsed) or when counts are
|
|
6
|
+
* absent (no inspect scan has populated Tier-2 yet).
|
|
7
|
+
*/
|
|
8
|
+
export declare function statusBarSuffixForSession(sessionID: string, counts: StatusBarCounts | undefined): string;
|
|
9
|
+
/** Drop a session's emit state (on session delete/shutdown). */
|
|
10
|
+
export declare function clearStatusBarSession(sessionID: string): void;
|
|
11
|
+
//# sourceMappingURL=status-bar-inject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-bar-inject.d.ts","sourceRoot":"","sources":["../src/status-bar-inject.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;AAI/B;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,MAAM,CAQR;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE7D"}
|
package/dist/tools/_shared.d.ts
CHANGED
|
@@ -113,6 +113,17 @@ export interface ToolRuntime {
|
|
|
113
113
|
* session's actual project directory.
|
|
114
114
|
*/
|
|
115
115
|
export declare function projectRootFor(runtime: ToolRuntime): string;
|
|
116
|
+
/**
|
|
117
|
+
* Warm the session-directory cache, then return the same project root that
|
|
118
|
+
* callBridge()/bridgeFor() will use for this tool call. Permission checks must
|
|
119
|
+
* resolve paths through this helper before dispatch so the path the user
|
|
120
|
+
* approves is byte-for-byte the path the Rust bridge acts on.
|
|
121
|
+
*/
|
|
122
|
+
export declare function resolveProjectRoot(ctx: PluginContext, runtime: ToolRuntime): Promise<string>;
|
|
123
|
+
/** Resolve a user path exactly as a bridge request will: absolute paths are
|
|
124
|
+
* preserved; relative paths are rooted at the session/project root. */
|
|
125
|
+
export declare function resolvePathFromProjectRoot(projectRoot: string, target: string): string;
|
|
126
|
+
export declare function resolvePathArg(ctx: PluginContext, runtime: ToolRuntime, target: string): Promise<string>;
|
|
116
127
|
/**
|
|
117
128
|
* Get the BinaryBridge for the runtime's project root.
|
|
118
129
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAQhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,GACR,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,OAAO,EACV,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAWpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMpD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASlE,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,iB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CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtF;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,YAAY,CAEhF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,CAC9B,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,CA0BlC;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAE9F"}
|
package/dist/tools/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/tools/ast.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/tools/ast.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA6DjD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwS3E"}
|
package/dist/tools/bash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA2EjD,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA4QjE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAyBvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAuBrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conflicts.d.ts","sourceRoot":"","sources":["../../src/tools/conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"conflicts.d.ts","sourceRoot":"","sources":["../../src/tools/conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA8EjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AA0RtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAmKjE;AAmnCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0B/E;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA+FnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/tools/imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/tools/imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiH9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/tools/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiGjD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAWlF;AAuCD,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IACjD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAE5E;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAI5E;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjD,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,WAAW,CAAC;IAClE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,gCAAgC;0BAmB1D,MAAM,KAAG,IAAI;uBAdhB,MAAM,KAAG,IAAI;oBAOlB,IAAI;EAwB1B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA6D/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/tools/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/tools/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwFlF"}
|
|
@@ -14,6 +14,7 @@ import type { ToolContext } from "@opencode-ai/plugin";
|
|
|
14
14
|
export declare function runAsk(maybe: Promise<void>): Promise<void>;
|
|
15
15
|
export declare function resolveAbsolutePath(context: ToolContext, target: string): string;
|
|
16
16
|
export declare function resolveRelativePattern(context: ToolContext, target: string): string;
|
|
17
|
+
export declare function resolveRelativePatternFromAbsolute(context: ToolContext, absolutePath: string): string;
|
|
17
18
|
export declare function resolveRelativePatterns(context: ToolContext, targets: string[]): string[];
|
|
18
19
|
export declare function workspacePattern(_context: ToolContext): string;
|
|
19
20
|
export declare function askEditPermission(context: ToolContext, patterns: string[], metadata?: Record<string, unknown>): Promise<string | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAMvD;;;;;;;;;;;GAWG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAazF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAE9D;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB7B;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAI5D;AA6CD;;;;;;;;;;;;GAYG;AACH,iBAAS,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,eAAO,MAAM,4BAA4B;;;CAAyC,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsD7B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB7B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB7B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reading.d.ts","sourceRoot":"","sources":["../../src/tools/reading.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reading.d.ts","sourceRoot":"","sources":["../../src/tools/reading.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0CjD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiX/E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GACnC,eAAe,CAyBjB;AA+CD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CA2ChF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refactoring.d.ts","sourceRoot":"","sources":["../../src/tools/refactoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"refactoring.d.ts","sourceRoot":"","sources":["../../src/tools/refactoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA8InF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwCjD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA+I9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsIjD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BrD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA4I9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../src/tools/structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../src/tools/structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyJjF"}
|
package/dist/tui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/tui/index.tsx
|
|
2
2
|
import { createMemo as createMemo2, createSignal as createSignal2, onCleanup as onCleanup2 } from "solid-js";
|
|
3
3
|
// package.json
|
|
4
|
-
var version = "0.
|
|
4
|
+
var version = "0.35.0";
|
|
5
5
|
|
|
6
6
|
// src/shared/rpc-client.ts
|
|
7
7
|
import { existsSync, readdirSync, readFileSync, unlinkSync } from "node:fs";
|
|
@@ -560,6 +560,37 @@ var SectionHeader = (props) => /* @__PURE__ */ jsxDEV("box", {
|
|
|
560
560
|
}, undefined, false, undefined, this)
|
|
561
561
|
}, undefined, false, undefined, this)
|
|
562
562
|
}, undefined, false, undefined, this);
|
|
563
|
+
function toneColor(theme, tone) {
|
|
564
|
+
switch (tone) {
|
|
565
|
+
case "ok":
|
|
566
|
+
return theme.success ?? theme.accent;
|
|
567
|
+
case "warn":
|
|
568
|
+
return theme.warning;
|
|
569
|
+
case "err":
|
|
570
|
+
return theme.error;
|
|
571
|
+
default:
|
|
572
|
+
return theme.textMuted;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
var CollapsedRow = (props) => /* @__PURE__ */ jsxDEV("box", {
|
|
576
|
+
width: "100%",
|
|
577
|
+
flexDirection: "row",
|
|
578
|
+
justifyContent: "space-between",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ jsxDEV("text", {
|
|
581
|
+
fg: props.theme.textMuted,
|
|
582
|
+
children: props.label
|
|
583
|
+
}, undefined, false, undefined, this),
|
|
584
|
+
props.children
|
|
585
|
+
]
|
|
586
|
+
}, undefined, true, undefined, this);
|
|
587
|
+
function collapsedCompressionValue(compression) {
|
|
588
|
+
if (!compression || compression.project.events <= 0)
|
|
589
|
+
return null;
|
|
590
|
+
const { savings_tokens, original_tokens } = compression.project;
|
|
591
|
+
const pct = original_tokens > 0 ? Math.round(savings_tokens / original_tokens * 100) : 0;
|
|
592
|
+
return `${formatCount(savings_tokens)} / ${pct}%`;
|
|
593
|
+
}
|
|
563
594
|
function resolveTuiStorageDir() {
|
|
564
595
|
return resolveCortexKitStorageRoot();
|
|
565
596
|
}
|
|
@@ -579,8 +610,12 @@ function scopedSidebarSnapshot(scoped, directory, sessionID) {
|
|
|
579
610
|
return null;
|
|
580
611
|
return scoped.snapshot;
|
|
581
612
|
}
|
|
613
|
+
function shouldSuppressUninitializedDowngrade(incomingCacheRole, haveInitializedForContext) {
|
|
614
|
+
return incomingCacheRole === "not_initialized" && haveInitializedForContext;
|
|
615
|
+
}
|
|
582
616
|
var SidebarContent = (props) => {
|
|
583
617
|
const [status, setStatus] = createSignal(null);
|
|
618
|
+
const [collapsed, setCollapsed] = createSignal(false);
|
|
584
619
|
let inflight = null;
|
|
585
620
|
let generation = 0;
|
|
586
621
|
let debounceTimer;
|
|
@@ -637,6 +672,10 @@ var SidebarContent = (props) => {
|
|
|
637
672
|
return;
|
|
638
673
|
if (response && response.success !== false) {
|
|
639
674
|
const snapshot = coerceAftStatus(response);
|
|
675
|
+
const current = status();
|
|
676
|
+
const haveGoodForContext = current !== null && current.directory === directory && current.sessionID === sid && current.snapshot.cache_role !== "not_initialized";
|
|
677
|
+
if (shouldSuppressUninitializedDowngrade(snapshot.cache_role, haveGoodForContext))
|
|
678
|
+
return;
|
|
640
679
|
setStatus({ directory, sessionID: sid, snapshot });
|
|
641
680
|
requestRender();
|
|
642
681
|
}
|
|
@@ -749,6 +788,10 @@ var SidebarContent = (props) => {
|
|
|
749
788
|
flexDirection: "row",
|
|
750
789
|
justifyContent: "space-between",
|
|
751
790
|
alignItems: "center",
|
|
791
|
+
onMouseDown: () => {
|
|
792
|
+
if (!notInitialized())
|
|
793
|
+
setCollapsed((x) => !x);
|
|
794
|
+
},
|
|
752
795
|
children: [
|
|
753
796
|
/* @__PURE__ */ jsxDEV("box", {
|
|
754
797
|
flexDirection: "row",
|
|
@@ -761,8 +804,11 @@ var SidebarContent = (props) => {
|
|
|
761
804
|
children: /* @__PURE__ */ jsxDEV("text", {
|
|
762
805
|
fg: props.theme.background,
|
|
763
806
|
children: /* @__PURE__ */ jsxDEV("b", {
|
|
764
|
-
children:
|
|
765
|
-
|
|
807
|
+
children: [
|
|
808
|
+
notInitialized() ? "" : collapsed() ? "▶ " : "▼ ",
|
|
809
|
+
"AFT"
|
|
810
|
+
]
|
|
811
|
+
}, undefined, true, undefined, this)
|
|
766
812
|
}, undefined, false, undefined, this)
|
|
767
813
|
}, undefined, false, undefined, this),
|
|
768
814
|
s()?.degraded && /* @__PURE__ */ jsxDEV("box", {
|
|
@@ -807,7 +853,39 @@ var SidebarContent = (props) => {
|
|
|
807
853
|
children: s().message || "AFT bridge is now spawned lazily, information here will be populated after first tool call."
|
|
808
854
|
}, undefined, false, undefined, this)
|
|
809
855
|
}, undefined, false, undefined, this),
|
|
810
|
-
!notInitialized() && /* @__PURE__ */ jsxDEV(
|
|
856
|
+
!notInitialized() && collapsed() && /* @__PURE__ */ jsxDEV("box", {
|
|
857
|
+
width: "100%",
|
|
858
|
+
flexDirection: "column",
|
|
859
|
+
children: [
|
|
860
|
+
/* @__PURE__ */ jsxDEV(CollapsedRow, {
|
|
861
|
+
theme: props.theme,
|
|
862
|
+
label: "Search Index",
|
|
863
|
+
children: /* @__PURE__ */ jsxDEV("text", {
|
|
864
|
+
fg: toneColor(props.theme, searchStatus().tone),
|
|
865
|
+
children: "●"
|
|
866
|
+
}, undefined, false, undefined, this)
|
|
867
|
+
}, undefined, false, undefined, this),
|
|
868
|
+
/* @__PURE__ */ jsxDEV(CollapsedRow, {
|
|
869
|
+
theme: props.theme,
|
|
870
|
+
label: "Semantic Index",
|
|
871
|
+
children: /* @__PURE__ */ jsxDEV("text", {
|
|
872
|
+
fg: toneColor(props.theme, semanticStatus().tone),
|
|
873
|
+
children: "●"
|
|
874
|
+
}, undefined, false, undefined, this)
|
|
875
|
+
}, undefined, false, undefined, this),
|
|
876
|
+
collapsedCompressionValue(s()?.compression) && /* @__PURE__ */ jsxDEV(CollapsedRow, {
|
|
877
|
+
theme: props.theme,
|
|
878
|
+
label: "Compression",
|
|
879
|
+
children: /* @__PURE__ */ jsxDEV("text", {
|
|
880
|
+
fg: props.theme.textMuted,
|
|
881
|
+
children: /* @__PURE__ */ jsxDEV("b", {
|
|
882
|
+
children: collapsedCompressionValue(s()?.compression)
|
|
883
|
+
}, undefined, false, undefined, this)
|
|
884
|
+
}, undefined, false, undefined, this)
|
|
885
|
+
}, undefined, false, undefined, this)
|
|
886
|
+
]
|
|
887
|
+
}, undefined, true, undefined, this),
|
|
888
|
+
!notInitialized() && !collapsed() && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
811
889
|
children: [
|
|
812
890
|
/* @__PURE__ */ jsxDEV(SectionHeader, {
|
|
813
891
|
theme: props.theme,
|
|
@@ -1018,7 +1096,12 @@ var StatusDialog = (props) => {
|
|
|
1018
1096
|
if (controller.signal.aborted || requestGeneration !== pollGeneration)
|
|
1019
1097
|
return;
|
|
1020
1098
|
if (response.success !== false) {
|
|
1021
|
-
|
|
1099
|
+
const snapshot = coerceAftStatus(response);
|
|
1100
|
+
const current = status();
|
|
1101
|
+
if (shouldSuppressUninitializedDowngrade(snapshot.cache_role, current !== null && current.cache_role !== "not_initialized")) {
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
setStatus(snapshot);
|
|
1022
1105
|
setError(null);
|
|
1023
1106
|
}
|
|
1024
1107
|
} catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,wEAAwE;IACxE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,wEAAwE;IACxE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA+FzE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAQjG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.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",
|
|
@@ -25,23 +25,24 @@
|
|
|
25
25
|
"test:e2e": "bun test src/__tests__/e2e/",
|
|
26
26
|
"lint": "biome check src",
|
|
27
27
|
"schema": "bun scripts/build-schema.ts",
|
|
28
|
-
"prepublishOnly": "bun run build"
|
|
28
|
+
"prepublishOnly": "bun run build",
|
|
29
|
+
"test:unit": "bun test src/__tests__ --path-ignore-patterns 'src/__tests__/e2e/**'"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
32
|
"@clack/prompts": "^1.2.0",
|
|
32
|
-
"@cortexkit/aft-bridge": "0.
|
|
33
|
+
"@cortexkit/aft-bridge": "0.35.0",
|
|
33
34
|
"@xterm/headless": "^5.5.0",
|
|
34
35
|
"comment-json": "^4.6.2",
|
|
35
36
|
"undici": "^7.25.0",
|
|
36
37
|
"zod": "^4.1.8"
|
|
37
38
|
},
|
|
38
39
|
"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-arm64": "0.
|
|
44
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
40
|
+
"@cortexkit/aft-darwin-arm64": "0.35.0",
|
|
41
|
+
"@cortexkit/aft-darwin-x64": "0.35.0",
|
|
42
|
+
"@cortexkit/aft-linux-arm64": "0.35.0",
|
|
43
|
+
"@cortexkit/aft-linux-x64": "0.35.0",
|
|
44
|
+
"@cortexkit/aft-win32-arm64": "0.35.0",
|
|
45
|
+
"@cortexkit/aft-win32-x64": "0.35.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@opencode-ai/plugin": "^1.15.11",
|
package/src/shared/bash-hints.ts
CHANGED
|
@@ -1,45 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// (or the original string when no hint should fire) so the hook can compose
|
|
6
|
-
// them without managing state.
|
|
7
|
-
|
|
8
|
-
const CONFLICT_HINT =
|
|
9
|
-
"\n\n[Hint] Use aft_conflicts to see all conflict regions across files in a single call.";
|
|
10
|
-
const GREP_HINT = "\n\n[Hint] Use the grep tool instead of bash for faster indexed search.";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Append the `aft_conflicts` hint when the output indicates a real git merge
|
|
14
|
-
* or rebase produced conflicts.
|
|
15
|
-
*
|
|
16
|
-
* Gated on BOTH:
|
|
17
|
-
* - the "Automatic merge failed; fix conflicts" marker, AND
|
|
18
|
-
* - a git-conflict signal (`CONFLICT (...)` line or `error: could not apply`)
|
|
19
|
-
*
|
|
20
|
-
* Both conditions are required because `aft_conflicts` calls `git ls-files -u`,
|
|
21
|
-
* which fails with "not a git repository" outside a git working tree. The
|
|
22
|
-
* marker string can legitimately appear in docs, READMEs, test fixtures, and
|
|
23
|
-
* grep output, so we cannot key off it alone — a false-positive hint sends
|
|
24
|
-
* agents into a confusing error.
|
|
25
|
-
*/
|
|
26
|
-
export function maybeAppendConflictsHint(output: string): string {
|
|
27
|
-
if (!output.includes("Automatic merge failed; fix conflicts")) return output;
|
|
28
|
-
// git merge prints "CONFLICT (content|file|...): ..." per file.
|
|
29
|
-
// git rebase / git am print "error: could not apply <sha>" per failed pick.
|
|
30
|
-
if (!/^CONFLICT \(|^error: could not apply /m.test(output)) return output;
|
|
31
|
-
return output + CONFLICT_HINT;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Append the grep-tool hint when the bash command was a grep/rg invocation.
|
|
36
|
-
*
|
|
37
|
-
* Detected by examining the FIRST LINE of output (which is the echoed command
|
|
38
|
-
* line on most shells in foreground mode). We cap the slice at 300 chars so
|
|
39
|
-
* a single huge first line doesn't slow this hook.
|
|
40
|
-
*/
|
|
41
|
-
export function maybeAppendGrepHint(output: string): string {
|
|
42
|
-
const firstLine = output.slice(0, 300).split("\n")[0] ?? "";
|
|
43
|
-
if (!/\b(rg|grep)\s/.test(firstLine)) return output;
|
|
44
|
-
return output + GREP_HINT;
|
|
45
|
-
}
|
|
1
|
+
// Bash-output hint nudges now live in the shared bridge package so both plugin
|
|
2
|
+
// hosts use one implementation. Re-exported here to keep the existing OpenCode
|
|
3
|
+
// import path stable.
|
|
4
|
+
export { maybeAppendConflictsHint, maybeAppendGrepHint } from "@cortexkit/aft-bridge";
|
package/src/tui/index.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
createAftSidebarSlot,
|
|
18
18
|
formatCompressionSidebarRows,
|
|
19
19
|
resolveTuiStorageDir,
|
|
20
|
+
shouldSuppressUninitializedDowngrade,
|
|
20
21
|
} from "./sidebar";
|
|
21
22
|
|
|
22
23
|
// The TUI talks to the server plugin via AftRpcClient. The client reads the
|
|
@@ -160,7 +161,20 @@ const StatusDialog = (props: StatusDialogProps) => {
|
|
|
160
161
|
);
|
|
161
162
|
if (controller.signal.aborted || requestGeneration !== pollGeneration) return;
|
|
162
163
|
if ((response as Record<string, unknown>).success !== false) {
|
|
163
|
-
|
|
164
|
+
const snapshot = coerceAftStatus(response as Record<string, unknown>);
|
|
165
|
+
// Stale-while-revalidate: don't downgrade a good snapshot to a transient
|
|
166
|
+
// `not_initialized` (bridge mid-respawn / session-dir key miss) — it
|
|
167
|
+
// arrives as success:true and would blank the dialog until the next poll.
|
|
168
|
+
const current = status();
|
|
169
|
+
if (
|
|
170
|
+
shouldSuppressUninitializedDowngrade(
|
|
171
|
+
snapshot.cache_role,
|
|
172
|
+
current !== null && current.cache_role !== "not_initialized",
|
|
173
|
+
)
|
|
174
|
+
) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
setStatus(snapshot);
|
|
164
178
|
setError(null);
|
|
165
179
|
}
|
|
166
180
|
} catch {
|