@cortexkit/aft-opencode 0.42.0 → 0.43.1
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 +35 -0
- package/dist/bg-notifications.d.ts.map +1 -1
- package/dist/config.d.ts +7 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/configure-warnings.d.ts +3 -3
- package/dist/configure-warnings.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6092 -9528
- package/dist/notifications.d.ts +2 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/shared/rpc-client.d.ts +6 -0
- package/dist/shared/rpc-client.d.ts.map +1 -1
- package/dist/shared/rpc-notifications.d.ts +29 -15
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts +10 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/subc-tool-schemas.d.ts +1 -1
- package/dist/subc-tool-schemas.d.ts.map +1 -1
- package/dist/tools/_shared.d.ts +12 -2
- 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/bash_watch.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 +0 -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 +23 -13
- package/dist/tools/permissions.d.ts.map +1 -1
- package/dist/tools/reading.d.ts +0 -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/semantic.d.ts.map +1 -1
- package/dist/tui/notification-socket.d.ts +41 -0
- package/dist/tui/notification-socket.d.ts.map +1 -0
- package/dist/tui.js +2460 -187
- package/dist/types.d.ts +4 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -9
- package/src/shared/rpc-client.ts +9 -0
- package/src/shared/rpc-notifications.ts +97 -41
- package/src/shared/rpc-server.ts +286 -67
- package/src/tui/index.tsx +77 -125
- package/src/tui/notification-socket.ts +421 -0
- package/src/tui/sidebar.tsx +38 -54
- package/dist/patch-parser.d.ts +0 -33
- package/dist/patch-parser.d.ts.map +0 -1
- package/dist/shared/opencode-config-dir.d.ts +0 -16
- package/dist/shared/opencode-config-dir.d.ts.map +0 -1
- package/dist/shared/pty-cache.d.ts +0 -18
- package/dist/shared/pty-cache.d.ts.map +0 -1
- package/dist/shared/tui-config.d.ts +0 -2
- package/dist/shared/tui-config.d.ts.map +0 -1
- package/src/shared/opencode-config-dir.ts +0 -46
- package/src/shared/pty-cache.ts +0 -113
- package/src/shared/tui-config.ts +0 -58
package/dist/notifications.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Messages are identified by markers and cleaned up on subsequent startups
|
|
14
14
|
* when no longer relevant (Desktop only — TUI toasts are inherently transient).
|
|
15
15
|
*/
|
|
16
|
-
import { type
|
|
16
|
+
import { type AftProjectTransport } from "@cortexkit/aft-bridge";
|
|
17
17
|
import type { ConfigureWarningsDelivery } from "./config.js";
|
|
18
18
|
export declare function __resetNotificationStateForTests(): void;
|
|
19
19
|
type SdkMessage = {
|
|
@@ -55,7 +55,7 @@ export interface ConfigureWarning {
|
|
|
55
55
|
export interface ConfigureWarningOptions {
|
|
56
56
|
client: unknown;
|
|
57
57
|
sessionId: string;
|
|
58
|
-
bridge: Pick<
|
|
58
|
+
bridge: Pick<AftProjectTransport, "send">;
|
|
59
59
|
storageDir: string;
|
|
60
60
|
pluginVersion: string;
|
|
61
61
|
projectRoot?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;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?: AbortSignal;
|
|
3
7
|
/**
|
|
@@ -30,6 +34,8 @@ export declare class AftRpcClient {
|
|
|
30
34
|
private looksLikePlaceholder;
|
|
31
35
|
/** Check if any RPC server is reachable. */
|
|
32
36
|
isAvailable(): Promise<boolean>;
|
|
37
|
+
/** Resolve the freshest live endpoint for the persistent TUI WebSocket. */
|
|
38
|
+
resolveEndpoint(signal?: AbortSignal): Promise<AftRpcEndpoint | null>;
|
|
33
39
|
/**
|
|
34
40
|
* Discover all live RPC port files for this project. Tries the per-instance
|
|
35
41
|
* directory first (v0.28.2+), then the single legacy `port` file (older
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-client.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;CACvC;AA4BD,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,iBAAiB,CAA6B;gBAE1C,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAKjD,iFAAiF;IAC3E,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,CAAC,CAAC;YA8CC,OAAO;IAsBrB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAM5B,4CAA4C;IACtC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IASrC;;;;OAIG;YACW,gBAAgB;IAwB9B,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,GAAG,IAAI,CAAC;IAM3E;;;;OAIG;YACW,gBAAgB;IAwB9B,OAAO,CAAC,gBAAgB;IAwDxB,8EAA8E;IAC9E,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,iBAAiB;YA6BX,WAAW;YAkCX,gBAAgB;IAmB9B,KAAK,IAAI,IAAI;CAKd"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* In-memory notification queue for server → TUI push.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The queue is the durable at-least-once buffer; live WebSocket sinks are only
|
|
5
|
+
* a low-latency delivery path. A notification is pruned only after the TUI acks
|
|
6
|
+
* it with the highest id it handled.
|
|
7
7
|
*/
|
|
8
8
|
export interface RpcNotification {
|
|
9
9
|
id: number;
|
|
@@ -11,10 +11,30 @@ export interface RpcNotification {
|
|
|
11
11
|
payload: Record<string, unknown>;
|
|
12
12
|
sessionId?: string;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
export interface NotificationSink {
|
|
15
|
+
/** The TUI session that the sink's socket authenticated for. */
|
|
16
|
+
sessionId?: string;
|
|
17
|
+
/** Deliver one queued notification over the live socket. */
|
|
18
|
+
send: (notification: RpcNotification) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface StatusChangeSink {
|
|
21
|
+
/** The TUI session that the sink's socket authenticated for. */
|
|
22
|
+
sessionId?: string;
|
|
23
|
+
/** Deliver a lightweight status invalidation over the live socket. */
|
|
24
|
+
send: (event: RpcStatusChange) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface RpcStatusChange {
|
|
27
|
+
sessionId?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Register a live TUI notification sink. Returns an unregister function. */
|
|
30
|
+
export declare function registerNotificationSink(sink: NotificationSink): () => void;
|
|
31
|
+
/** Register a live TUI status-invalidation sink. Returns an unregister function. */
|
|
32
|
+
export declare function registerStatusChangeSink(sink: StatusChangeSink): () => void;
|
|
33
|
+
/** Push a notification for the TUI. Fans out to live sinks and keeps the queue. */
|
|
15
34
|
export declare function pushNotification(type: string, payload: Record<string, unknown>, sessionId?: string): void;
|
|
35
|
+
/** Push a lightweight status invalidation to matching live TUI sockets. */
|
|
36
|
+
export declare function pushStatusChange(sessionId?: string): void;
|
|
16
37
|
/** Return pending notifications after acking the client's last received id.
|
|
17
|
-
* Updates lastDrainAt so isTuiConnected() reflects recent activity.
|
|
18
38
|
*
|
|
19
39
|
* Session scoping: when `sessionId` is provided, only notifications tagged for
|
|
20
40
|
* that session (or session-less/global ones) are returned and pruned — a
|
|
@@ -30,16 +50,10 @@ export declare function pushNotification(type: string, payload: Record<string, u
|
|
|
30
50
|
*
|
|
31
51
|
* Delivery is at-least-once (non-destructive return + prune-on-ack): a returned
|
|
32
52
|
* notification stays queued until a later call acks it via a higher
|
|
33
|
-
* `lastReceivedId`, so a
|
|
53
|
+
* `lastReceivedId`, so a dropped WS socket re-delivers the backlog on reconnect
|
|
54
|
+
* (the client sends its `lastReceivedId` in the hello). */
|
|
34
55
|
export declare function drainNotifications(lastReceivedId?: number, sessionId?: string): RpcNotification[];
|
|
35
|
-
/** Whether a TUI client is
|
|
36
|
-
* Returns true only if a TUI has drained within the last 3 seconds.
|
|
37
|
-
*
|
|
38
|
-
* Pass `sessionId` (preferred) to ask whether a TUI is polling FOR THAT
|
|
39
|
-
* SESSION — this is what producers (`/aft-status`, configure warnings, etc.)
|
|
40
|
-
* must use to decide dialog-vs-message, so a TUI on a different session in the
|
|
41
|
-
* same process does not misroute their delivery. Omit it only for legacy/global
|
|
42
|
-
* callers that genuinely have no session context; they fall back to "any
|
|
43
|
-
* session recently drained" (the pre-per-session behavior). */
|
|
56
|
+
/** Whether a TUI client is connected via a live notification socket. */
|
|
44
57
|
export declare function isTuiConnected(sessionId?: string): boolean;
|
|
58
|
+
export declare function __resetRpcNotificationsForTest(): void;
|
|
45
59
|
//# sourceMappingURL=rpc-notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-notifications.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"rpc-notifications.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,IAAI,EAAE,CAAC,YAAY,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,6EAA6E;AAC7E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAK3E;AAED,oFAAoF;AACpF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAK3E;AAqBD,mFAAmF;AACnF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAiCN;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAUzD;AAED;;;;;;;;;;;;;;;;;4DAiB4D;AAC5D,wBAAgB,kBAAkB,CAAC,cAAc,SAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAe5F;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAO1D;AAED,wBAAgB,8BAA8B,IAAI,IAAI,CAKrD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type RpcHandler = (params: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
2
2
|
export declare class AftRpcServer {
|
|
3
|
-
private
|
|
3
|
+
private nodeServer;
|
|
4
|
+
private bunServer;
|
|
4
5
|
private port;
|
|
5
6
|
private token;
|
|
6
7
|
private handlers;
|
|
@@ -9,11 +10,16 @@ export declare class AftRpcServer {
|
|
|
9
10
|
private heartbeatTimer;
|
|
10
11
|
/** Unique per-instance ID — distinguishes our entry from duplicate plugin loads. */
|
|
11
12
|
private instanceId;
|
|
13
|
+
private sockets;
|
|
12
14
|
constructor(storageDir: string, directory: string);
|
|
13
15
|
/** Register an RPC method handler. */
|
|
14
16
|
handle(method: string, handler: RpcHandler): void;
|
|
15
17
|
/** Start the server on a random port, write port to disk. */
|
|
16
18
|
start(): Promise<number>;
|
|
19
|
+
private startBun;
|
|
20
|
+
private startNode;
|
|
21
|
+
private afterServerStarted;
|
|
22
|
+
private writePortFile;
|
|
17
23
|
/**
|
|
18
24
|
* Remove sibling port files whose owning process is provably dead.
|
|
19
25
|
* Only files with a recorded pid that no longer maps to a live process are
|
|
@@ -25,6 +31,9 @@ export declare class AftRpcServer {
|
|
|
25
31
|
private ensurePortFile;
|
|
26
32
|
/** Stop the server and clean up port file. */
|
|
27
33
|
stop(): void;
|
|
34
|
+
private handleFetch;
|
|
35
|
+
private handleWsMessage;
|
|
36
|
+
private closeWs;
|
|
28
37
|
private dispatch;
|
|
29
38
|
}
|
|
30
39
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-server.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rpc-server.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-server.ts"],"names":[],"mappings":"AAsBA,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAiExF,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAmC;IAChD,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,cAAc,CAA+C;IACrE,oFAAoF;IACpF,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAyC;gBAE5C,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAMjD,sCAAsC;IACtC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAIjD,6DAA6D;IACvD,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;YAQhB,QAAQ;YAsBR,SAAS;IA0BvB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,aAAa;IAiBrB;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IA6B1B,4EAA4E;IAC5E,OAAO,CAAC,cAAc;IAWtB,8CAA8C;IAC9C,IAAI,IAAI,IAAI;YA6BE,WAAW;IAoDzB,OAAO,CAAC,eAAe;IA8DvB,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,QAAQ;CAkEjB"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Shared by scripts/build-tool-schemas.ts and subc-tool-schemas-fresh.test.ts.
|
|
4
4
|
*/
|
|
5
5
|
import type { PluginContext } from "./types.js";
|
|
6
|
-
declare const BARE_TOOL_ORDER: readonly ["edit", "grep", "
|
|
6
|
+
declare const BARE_TOOL_ORDER: readonly ["status", "bash", "read", "write", "edit", "apply_patch", "grep", "glob", "search", "outline", "zoom", "inspect", "callgraph", "conflicts", "ast_search", "ast_replace", "delete", "move", "import", "refactor", "safety"];
|
|
7
7
|
export type SubcBareToolName = (typeof BARE_TOOL_ORDER)[number];
|
|
8
8
|
export declare function makeSubcSchemaStubCtx(): PluginContext;
|
|
9
9
|
/**
|
|
@@ -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;AAkBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAUhD,QAAA,MAAM,eAAe,sOAsBX,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,wBAAgB,qBAAqB,IAAI,aAAa,CAYrD;AAQD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqFxF;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"}
|
package/dist/tools/_shared.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* `bridge.send()` multiple times with shared state) should use `bridgeFor()`
|
|
16
16
|
* and still pass `session_id` explicitly.
|
|
17
17
|
*/
|
|
18
|
-
import type {
|
|
18
|
+
import type { AftProjectTransport, BridgeRequestOptions, ToolCallOptions, ToolCallResult } from "@cortexkit/aft-bridge";
|
|
19
19
|
import type { PluginContext } from "../types.js";
|
|
20
20
|
/**
|
|
21
21
|
* Optional integer with bounds.
|
|
@@ -103,7 +103,7 @@ export declare function resolvePathArg(ctx: PluginContext, runtime: ToolRuntime,
|
|
|
103
103
|
* eagerly warms the cache before calling this so the cache is hot for
|
|
104
104
|
* subsequent calls in the same session.
|
|
105
105
|
*/
|
|
106
|
-
export declare function bridgeFor(ctx: PluginContext, runtime: ToolRuntime):
|
|
106
|
+
export declare function bridgeFor(ctx: PluginContext, runtime: ToolRuntime): AftProjectTransport;
|
|
107
107
|
/**
|
|
108
108
|
* Send a single command to the Rust binary with `session_id` injected.
|
|
109
109
|
*
|
|
@@ -120,6 +120,16 @@ export declare function bridgeFor(ctx: PluginContext, runtime: ToolRuntime): Bin
|
|
|
120
120
|
* session identifier still work — they just share undo/checkpoint state.
|
|
121
121
|
*/
|
|
122
122
|
export declare function callBridge(ctx: PluginContext, runtime: ToolRuntime, command: string, params?: Record<string, unknown>, options?: BridgeRequestOptions): Promise<Record<string, unknown>>;
|
|
123
|
+
/**
|
|
124
|
+
* Dispatch one hoisted agent tool through the server-side `tool_call` command.
|
|
125
|
+
*
|
|
126
|
+
* The helper mirrors `callBridge()`: it warms the session-directory cache,
|
|
127
|
+
* routes to the project-keyed bridge, applies the bare tool's timeout budget,
|
|
128
|
+
* records the same perf marks, and ingests background-completion sidecars from
|
|
129
|
+
* the raw response exactly once. The returned object is the full Rust response
|
|
130
|
+
* plus the server-rendered `text` field.
|
|
131
|
+
*/
|
|
132
|
+
export declare function callToolCall(ctx: PluginContext, runtime: ToolRuntime, name: string, rawArgs?: Record<string, unknown>, options?: ToolCallOptions): Promise<ToolCallResult>;
|
|
123
133
|
/**
|
|
124
134
|
* Send a bash-family command without restarting the shared bridge on transport
|
|
125
135
|
* timeout. Bash has its own child-process timeout/watchdog handling; a late
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;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,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6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G,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,CAMlC;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;AAOH,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;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiDjD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0H3E"}
|
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":"
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuCjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,GACpB,MAAM,CAaR;AA6ED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CAwMhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2BvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,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,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAUF,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAGlF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA0GtE;AAgHD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,eAAe,GAAG,SAAS,EACpC,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAyG7B;AA8CD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAI5E;AAkGD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsCjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AAwQtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAuHjE;AAwkBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0B/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAqGnF"}
|
|
@@ -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;AAWjD;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,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,CAgH9E"}
|
package/dist/tools/inspect.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { PluginContext } from "../types.js";
|
|
3
|
-
export declare function renderInspectDiagnostics(response: Record<string, unknown>): string;
|
|
4
3
|
export interface InspectToolConfig {
|
|
5
4
|
tool_surface?: "minimal" | "recommended" | "all";
|
|
6
5
|
disabled_tools?: string[];
|
|
@@ -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,aA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,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0D/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/tools/navigation.ts"],"names":[],"mappings":"AACA,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":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAqBjD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAmHlF"}
|
|
@@ -24,6 +24,7 @@ export declare function askEditPermission(context: ToolContext, patterns: string
|
|
|
24
24
|
* opencode core (uses `path.relative` and ensures it doesn't start with `..`).
|
|
25
25
|
*/
|
|
26
26
|
declare function containsPath(parent: string, child: string): boolean;
|
|
27
|
+
declare function isSystemTempPath(target: string): boolean;
|
|
27
28
|
/**
|
|
28
29
|
* Normalize a path pattern (which may end in `*`) for the same reasons
|
|
29
30
|
* normalizePath() exists, but without trying to realpath a pattern that
|
|
@@ -35,11 +36,12 @@ declare function containsPath(parent: string, child: string): boolean;
|
|
|
35
36
|
* `~/projects/*` → `~/projects/*` (`~` is expanded by opencode's matcher)
|
|
36
37
|
* `C:\some\dir\*` → `C:\some\dir\*` (drive case canonicalized via realpath of the dir part)
|
|
37
38
|
*
|
|
38
|
-
*
|
|
39
|
+
* Non-Windows callers build patterns from an already-canonical parent path.
|
|
39
40
|
*/
|
|
40
41
|
declare function normalizePathPattern(p: string): string;
|
|
41
42
|
export declare const _permissionsInternalsForTest: {
|
|
42
43
|
containsPath: typeof containsPath;
|
|
44
|
+
isSystemTempPath: typeof isSystemTempPath;
|
|
43
45
|
normalizePathPattern: typeof normalizePathPattern;
|
|
44
46
|
};
|
|
45
47
|
/**
|
|
@@ -49,34 +51,42 @@ export declare const _permissionsInternalsForTest: {
|
|
|
49
51
|
*
|
|
50
52
|
* Why this exists: AFT hoisted tools previously only called `permission: "edit"`,
|
|
51
53
|
* which bypassed OpenCode's separate `external_directory` rule (default `ask`).
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* This helper keeps that rule active for ordinary out-of-root paths while
|
|
55
|
+
* suppressing asks for system temp directories, which are unstable world-writable
|
|
56
|
+
* scratch space.
|
|
55
57
|
*
|
|
56
58
|
* Returns `undefined` on allow (or when target is inside project), or a
|
|
57
59
|
* denial message string on deny so callers can wrap with
|
|
58
60
|
* `permissionDeniedResponse(...)`.
|
|
59
61
|
*
|
|
60
|
-
* Always call this BEFORE the regular `askEditPermission` so
|
|
61
|
-
* external-directory prompt
|
|
62
|
-
* external-directory rule is `allow` (e.g. for `${os.tmpdir()}/opencode/*`), the
|
|
63
|
-
* call short-circuits and the regular permission flow continues normally.
|
|
62
|
+
* Always call this BEFORE the regular `askEditPermission` so any required
|
|
63
|
+
* external-directory prompt appears before the edit/read prompt.
|
|
64
64
|
*/
|
|
65
65
|
export declare function assertExternalDirectoryPermission(ctx: PluginContext, context: ToolContext, target: string, options?: {
|
|
66
66
|
kind?: "file" | "directory";
|
|
67
67
|
}): Promise<string | undefined>;
|
|
68
68
|
/**
|
|
69
|
-
* Trigger
|
|
69
|
+
* Trigger the host OpenCode permission check for grep.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
* `"permission": { "grep": { "*": "ask" } }` (or "deny")
|
|
73
|
-
*
|
|
74
|
-
* OpenCode's built-in.
|
|
71
|
+
* Uses the same request shape as OpenCode's built-in grep tool so a user's
|
|
72
|
+
* `"permission": { "grep": { "*": "ask" } }` (or "deny") setting behaves
|
|
73
|
+
* the same for the plugin-provided grep tool and OpenCode's native grep tool.
|
|
75
74
|
*/
|
|
76
75
|
export declare function askGrepPermission(context: ToolContext, pattern: string, metadata?: {
|
|
77
76
|
path?: string;
|
|
78
77
|
include?: string;
|
|
79
78
|
}): Promise<string | undefined>;
|
|
79
|
+
/**
|
|
80
|
+
* Trigger the host OpenCode permission check for aft_search.
|
|
81
|
+
*
|
|
82
|
+
* Passes the same pattern value and metadata as askGrepPermission but registers
|
|
83
|
+
* under the `aft_search` permission id so rules targeting only `grep` do not
|
|
84
|
+
* apply.
|
|
85
|
+
*/
|
|
86
|
+
export declare function askSearchPermission(context: ToolContext, pattern: string, metadata?: {
|
|
87
|
+
path?: string;
|
|
88
|
+
include?: string;
|
|
89
|
+
}): Promise<string | undefined>;
|
|
80
90
|
/**
|
|
81
91
|
* Trigger OpenCode's host-side `glob` permission check.
|
|
82
92
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsDjD;;;;;;;;;;;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,CAGhF;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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AQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;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"}
|
package/dist/tools/reading.d.ts
CHANGED
|
@@ -23,6 +23,5 @@ export declare function readingTools(ctx: PluginContext): Record<string, ToolDef
|
|
|
23
23
|
* Exported for regression tests.
|
|
24
24
|
*/
|
|
25
25
|
export declare function formatZoomBatchResult(targetLabel: string, symbols: string[], responses: Record<string, unknown>[]): ZoomBatchResult;
|
|
26
|
-
export declare function formatOutlineFilesText(response: Record<string, unknown>): string;
|
|
27
26
|
export {};
|
|
28
27
|
//# sourceMappingURL=reading.d.ts.map
|
|
@@ -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,EAAc,MAAM,qBAAqB,CAAC;AAEnF,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,CA+Q/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"}
|
|
@@ -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;AAmBjD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,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;AAmBjD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyJnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AAEA,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,
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AAEA,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,CAuI9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwGjD;;;;;;;;;;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,CAkJ9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.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":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA+EhF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AftRpcClient } from "../shared/rpc-client";
|
|
2
|
+
export interface SocketNotification {
|
|
3
|
+
id: number;
|
|
4
|
+
type: string;
|
|
5
|
+
payload: Record<string, unknown>;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface StatusInvalidation {
|
|
9
|
+
sessionId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TuiSocketOptions {
|
|
12
|
+
getDirectory: () => string | null | undefined;
|
|
13
|
+
getSessionId: () => string | null;
|
|
14
|
+
onNotification: (notification: SocketNotification) => boolean | Promise<boolean>;
|
|
15
|
+
}
|
|
16
|
+
interface WebSocketLike {
|
|
17
|
+
readyState: number;
|
|
18
|
+
addEventListener(type: "open" | "message" | "close" | "error", listener: (event: unknown) => void): void;
|
|
19
|
+
send(data: string): void;
|
|
20
|
+
close(): void;
|
|
21
|
+
}
|
|
22
|
+
type WebSocketFactory = new (url: string) => WebSocketLike;
|
|
23
|
+
type RpcClientLike = Pick<AftRpcClient, "resolveEndpoint" | "reset">;
|
|
24
|
+
interface SocketDeps {
|
|
25
|
+
createClient: (directory: string) => RpcClientLike;
|
|
26
|
+
WebSocketCtor: WebSocketFactory | null;
|
|
27
|
+
setTimeout: typeof setTimeout;
|
|
28
|
+
clearTimeout: typeof clearTimeout;
|
|
29
|
+
}
|
|
30
|
+
export declare function startAftTuiSocket(options: TuiSocketOptions): void;
|
|
31
|
+
export declare function stopAftTuiSocket(): void;
|
|
32
|
+
export declare function refreshAftTuiSocketScope(): void;
|
|
33
|
+
export declare function subscribeStatusInvalidations(listener: (event: StatusInvalidation) => void): () => void;
|
|
34
|
+
export declare function createDebouncedStatusRefresh(refresh: () => void | Promise<void>, delayMs: number): {
|
|
35
|
+
schedule: () => void;
|
|
36
|
+
dispose: () => void;
|
|
37
|
+
};
|
|
38
|
+
export declare function __setAftTuiSocketDepsForTest(overrides: Partial<SocketDeps>): () => void;
|
|
39
|
+
export declare function __resetAftTuiSocketForTest(): void;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=notification-socket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-socket.d.ts","sourceRoot":"","sources":["../../src/tui/notification-socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAC;AAGzE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAClF;AAED,UAAU,aAAa;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CACd,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,EAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACjC,IAAI,CAAC;IACR,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB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