@cortexkit/aft-opencode 0.56.2 → 0.57.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 +1 -0
- package/dist/bg-notifications.d.ts.map +1 -1
- package/dist/entry/server.js +2650 -267
- package/dist/index.js +420 -228
- package/dist/lsp-github-install.d.ts.map +1 -1
- package/dist/permissions/v2-service.d.ts +30 -0
- package/dist/permissions/v2-service.d.ts.map +1 -0
- package/dist/permissions/v2.d.ts +121 -9
- package/dist/permissions/v2.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/status.d.ts +8 -1
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/subc-tool-schemas.d.ts +11 -0
- package/dist/subc-tool-schemas.d.ts.map +1 -1
- package/dist/tool-registration.d.ts.map +1 -1
- package/dist/tools/definitions/v2.d.ts +6 -0
- package/dist/tools/definitions/v2.d.ts.map +1 -1
- package/dist/tools/hoisted/v2.d.ts +12 -2
- package/dist/tools/hoisted/v2.d.ts.map +1 -1
- package/dist/tools/hoisted.d.ts.map +1 -1
- package/dist/tools/semantic.d.ts.map +1 -1
- package/dist/tui/v2-status.d.ts +8 -0
- package/dist/tui/v2-status.d.ts.map +1 -1
- package/index.js +14 -0
- package/package.json +14 -10
- package/server.js +8 -0
- package/src/shared/rpc-server.ts +5 -0
- package/src/shared/status.ts +16 -9
- package/src/tui/index.tsx +1 -0
- package/src/tui/sidebar-view.tsx +722 -0
- package/src/tui/sidebar.tsx +42 -560
- package/src/tui/v2-status.ts +8 -1
- package/src/tui/v2.tsx +173 -30
- package/src/tui-compiled/index.tsx +1 -1
- package/src/tui-compiled/sidebar-view.tsx +815 -0
- package/src/tui-compiled/sidebar.tsx +45 -693
- package/src/tui-compiled/v2-status.ts +8 -1
- package/src/tui-compiled/v2.tsx +163 -54
- package/tui.js +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;
|
|
1
|
+
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AA2CH,OAAO,EACL,KAAK,IAAI,EACT,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAyG/B,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAG/E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CASrF;AAsDD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAoVD,iBAAS,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAgBrD;AAED,iBAAe,YAAY,CACzB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,KAAK,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAuDf;AA6BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CA0E5D;AAED;;;;;;;;GAQG;AACH,KAAK,cAAc,GAAG,UAAU,GAAG,KAAK,CAAC;AAuCzC,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,cAA2B,GAC1C,IAAI,CAgBN;AA6WD,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,MAAM,EAAE,CAAC;CAClC;AAsBD,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,GAAE,OAAO,KAAa,GAC9B,uBAAuB,CAkGzB;AAID;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAyC9E;AAID;;;;;;;GAOG;AACH,OAAO,EACL,KAAK,IAAI,EACT,wBAAwB,IAAI,mCAAmC,EAC/D,kBAAkB,EAClB,YAAY,IAAI,uBAAuB,EACvC,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,uBAAuB,IAAI,8BAA8B,GAC1D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { V2PermissionClient } from "./v2.js";
|
|
2
|
+
/**
|
|
3
|
+
* The outcome of looking for the OpenCode service that can show a prompt.
|
|
4
|
+
*
|
|
5
|
+
* The failure branch carries what was actually observed rather than a verdict,
|
|
6
|
+
* because it ends up in the sentence the user reads when a prompt could not be
|
|
7
|
+
* raised.
|
|
8
|
+
*/
|
|
9
|
+
export type V2PromptChannelResult = {
|
|
10
|
+
readonly client: V2PermissionClient;
|
|
11
|
+
readonly unavailable?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
readonly client?: undefined;
|
|
14
|
+
readonly unavailable: string;
|
|
15
|
+
};
|
|
16
|
+
export interface V2PromptChannel {
|
|
17
|
+
/** The client for the local OpenCode service, or why none could be reached. */
|
|
18
|
+
client(): Promise<V2PromptChannelResult>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One prompt channel for one OpenCode Location.
|
|
22
|
+
*
|
|
23
|
+
* The discovered client is kept so a session that answers many prompts pays for
|
|
24
|
+
* discovery once, and it is held in this closure rather than in module state so
|
|
25
|
+
* it is dropped with the Location's consumers when that scope is torn down.
|
|
26
|
+
* Only a successful discovery is remembered: a host whose service was not up
|
|
27
|
+
* yet must be able to raise the next prompt.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createV2PromptChannel(discovery?: () => Promise<V2PromptChannelResult>): V2PromptChannel;
|
|
30
|
+
//# sourceMappingURL=v2-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-service.d.ts","sourceRoot":"","sources":["../../src/permissions/v2-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAA2B,MAAM,SAAS,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;CAAE,GACzE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,MAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC1C;AAoDD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,MAAM,OAAO,CAAC,qBAAqB,CAAwB,GACrE,eAAe,CAUjB"}
|
package/dist/permissions/v2.d.ts
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
1
2
|
import type { V2ExecutionContext, V2PermissionRequest } from "../tools/definitions/v2.js";
|
|
3
|
+
import type { V2PromptChannel } from "./v2-service.js";
|
|
4
|
+
export type V2PermissionEffect = "allow" | "deny" | "ask";
|
|
5
|
+
/** One ordered `{action, resource, effect}` entry of an OpenCode permission ruleset. */
|
|
6
|
+
export interface V2PermissionRule {
|
|
7
|
+
readonly action: string;
|
|
8
|
+
readonly resource: string;
|
|
9
|
+
readonly effect: V2PermissionEffect;
|
|
10
|
+
}
|
|
11
|
+
export interface V2AgentRecord {
|
|
12
|
+
readonly permissions?: readonly V2PermissionRule[];
|
|
13
|
+
}
|
|
14
|
+
export interface V2SessionRecord {
|
|
15
|
+
readonly agent?: string;
|
|
16
|
+
readonly permissions?: readonly V2PermissionRule[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The two plugin domains AFT reads to learn the host's configured answer.
|
|
20
|
+
*
|
|
21
|
+
* OpenCode 2 hands a plugin `agent` and `session` domains whose records carry
|
|
22
|
+
* the same ordered permission rulesets the host itself evaluates, so a tool can
|
|
23
|
+
* resolve "allow", "deny", or "ask" without a round trip to the user.
|
|
24
|
+
*/
|
|
25
|
+
export interface V2PermissionHostContext {
|
|
26
|
+
readonly agent: {
|
|
27
|
+
get(input: {
|
|
28
|
+
agentID: string;
|
|
29
|
+
}): Effect.Effect<{
|
|
30
|
+
data: V2AgentRecord;
|
|
31
|
+
}, unknown>;
|
|
32
|
+
};
|
|
33
|
+
readonly session: {
|
|
34
|
+
get(input: {
|
|
35
|
+
sessionID: string;
|
|
36
|
+
}): Effect.Effect<V2SessionRecord | undefined, unknown>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
2
39
|
export type V2PermissionReply = "once" | "always" | "reject";
|
|
3
40
|
export interface V2PermissionCreateInput {
|
|
4
41
|
sessionID: string;
|
|
@@ -14,11 +51,12 @@ export interface V2PermissionCreateInput {
|
|
|
14
51
|
}
|
|
15
52
|
interface V2PermissionCreateResult {
|
|
16
53
|
id: string;
|
|
17
|
-
effect:
|
|
54
|
+
effect: V2PermissionEffect;
|
|
18
55
|
}
|
|
19
56
|
interface V2EventSubscription {
|
|
20
57
|
stream: AsyncIterable<unknown>;
|
|
21
58
|
}
|
|
59
|
+
/** The two service calls a permission prompt needs, in the shape AFT sends them. */
|
|
22
60
|
export interface V2PermissionClient {
|
|
23
61
|
permission: {
|
|
24
62
|
create(input: V2PermissionCreateInput): Promise<V2PermissionCreateResult | {
|
|
@@ -30,9 +68,6 @@ export interface V2PermissionClient {
|
|
|
30
68
|
subscribe(): Promise<V2EventSubscription>;
|
|
31
69
|
};
|
|
32
70
|
}
|
|
33
|
-
export interface V2PermissionHostContext {
|
|
34
|
-
client: V2PermissionClient;
|
|
35
|
-
}
|
|
36
71
|
export declare class PermissionDeniedError extends Error {
|
|
37
72
|
readonly name = "PermissionDeniedError";
|
|
38
73
|
}
|
|
@@ -40,12 +75,89 @@ export declare class PermissionRejectedError extends Error {
|
|
|
40
75
|
readonly name = "PermissionRejectedError";
|
|
41
76
|
}
|
|
42
77
|
/**
|
|
43
|
-
*
|
|
78
|
+
* Raised when the rules resolve to "ask" and the service that shows the prompt
|
|
79
|
+
* could not be reached.
|
|
80
|
+
*
|
|
81
|
+
* Deliberately not named like a rule denial: the caller-side classifier rewrites
|
|
82
|
+
* recognised denial classes into a generic "denied by rule" sentence, and this
|
|
83
|
+
* refusal has to keep its own text because that text names the way out.
|
|
84
|
+
*/
|
|
85
|
+
export declare class PermissionPromptUnavailableError extends Error {
|
|
86
|
+
readonly name = "PermissionPromptUnavailableError";
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Raised when the prompt was shown and no answer ever came back.
|
|
90
|
+
*
|
|
91
|
+
* Like the unavailable-prompt refusal this keeps its own text, because that
|
|
92
|
+
* text is the only place the user learns that a prompt was raised on their
|
|
93
|
+
* behalf and went unanswered. Never an allow: an answer nobody gave is not
|
|
94
|
+
* permission.
|
|
95
|
+
*/
|
|
96
|
+
export declare class PermissionPromptUnansweredError extends Error {
|
|
97
|
+
readonly name = "PermissionPromptUnansweredError";
|
|
98
|
+
}
|
|
99
|
+
/** Raised when the host's rules for this call could not be read at all. */
|
|
100
|
+
export declare class PermissionRulesUnavailableError extends Error {
|
|
101
|
+
readonly name = "PermissionRulesUnavailableError";
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* How long a raised prompt may stay unanswered before the call is refused.
|
|
105
|
+
*
|
|
106
|
+
* A prompt is a question for a person, and a person may be away from the
|
|
107
|
+
* machine: ten minutes is well beyond the minutes a real answer takes, so an
|
|
108
|
+
* answer that is coming still arrives in time. The bound exists for the answer
|
|
109
|
+
* that is not coming, which used to hold the tool call open for the life of the
|
|
110
|
+
* session.
|
|
111
|
+
*/
|
|
112
|
+
export declare const V2_PROMPT_REPLY_TIMEOUT_MS: number;
|
|
113
|
+
/**
|
|
114
|
+
* How long AFT waits for its event subscription to start delivering before it
|
|
115
|
+
* raises the request anyway.
|
|
116
|
+
*
|
|
117
|
+
* OpenCode greets a new subscriber immediately, so this is normally over in a
|
|
118
|
+
* millisecond or two on a loopback connection. It is a bound rather than an
|
|
119
|
+
* unconditional wait so a host that greets nobody cannot stop prompts from
|
|
120
|
+
* being raised at all; a request raised without a confirmed subscription is
|
|
121
|
+
* still bounded by the reply timeout, and refuses rather than allows.
|
|
122
|
+
*/
|
|
123
|
+
export declare const V2_PROMPT_LISTEN_TIMEOUT_MS = 5000;
|
|
124
|
+
export interface V2PermissionDecision {
|
|
125
|
+
readonly effect: V2PermissionEffect;
|
|
126
|
+
/** The resource that decided the outcome, absent when every resource allowed. */
|
|
127
|
+
readonly resource?: string;
|
|
128
|
+
/** The rule that decided the outcome, absent when every resource allowed. */
|
|
129
|
+
readonly rule?: V2PermissionRule;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Resolve one AFT permission request against a host ruleset.
|
|
133
|
+
*
|
|
134
|
+
* Mirrors OpenCode's own evaluation: any denied resource denies the whole
|
|
135
|
+
* request, otherwise any resource that still wants a prompt makes the request
|
|
136
|
+
* an "ask", and only a request whose resources are all allowed is allowed.
|
|
137
|
+
*
|
|
138
|
+
* One deliberate difference: OpenCode also folds in the user's saved "always"
|
|
139
|
+
* grants before the allow/ask split, and those are not readable from a plugin.
|
|
140
|
+
* A saved grant therefore reads as "ask" here, which costs one round trip to
|
|
141
|
+
* the service: the host applies the grant when the request reaches it and
|
|
142
|
+
* answers "allow" without showing anything.
|
|
143
|
+
*/
|
|
144
|
+
export declare function decidePermission(request: V2PermissionRequest, rules: readonly V2PermissionRule[]): V2PermissionDecision;
|
|
145
|
+
/** The wait bounds and cancellation one prompt runs under. */
|
|
146
|
+
export interface V2PromptLimits {
|
|
147
|
+
readonly replyTimeoutMs?: number;
|
|
148
|
+
readonly listenTimeoutMs?: number;
|
|
149
|
+
/** Ends the wait when the tool call it belongs to is cancelled. */
|
|
150
|
+
readonly signal?: AbortSignal;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Answer a V2 tool's permission request.
|
|
44
154
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
155
|
+
* The host's configured rules are evaluated first, so anything the user has
|
|
156
|
+
* already permitted — reading a file inside the project under OpenCode's
|
|
157
|
+
* default allow-everything ruleset, for instance — runs with no round trip,
|
|
158
|
+
* and a denial fails naming the rule that produced it. Only a rule that asks
|
|
159
|
+
* costs a call to the service, which raises the real prompt.
|
|
48
160
|
*/
|
|
49
|
-
export declare function requestPermission(host: V2PermissionHostContext, request: V2PermissionRequest, context: V2ExecutionContext): Promise<void>;
|
|
161
|
+
export declare function requestPermission(host: V2PermissionHostContext, request: V2PermissionRequest, context: V2ExecutionContext, prompt: V2PromptChannel, limits?: V2PromptLimits): Promise<void>;
|
|
50
162
|
export {};
|
|
51
163
|
//# sourceMappingURL=v2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/permissions/v2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/permissions/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1D,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACpD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACpD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE;QACd,GAAG,CAAC,KAAK,EAAE;YAAE,OAAO,EAA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AC,IAAI,CAAC,CAwBf"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;YA2BR,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"}
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { formatSemanticIndexStatus, type SemanticIndexStatusKind, semanticIndexStatusKind } from "@cortexkit/aft-bridge";
|
|
2
|
+
/**
|
|
3
|
+
* The semantic-index status formatter lives in @cortexkit/aft-bridge because
|
|
4
|
+
* both plugin hosts render it and two copies is how the same defect once
|
|
5
|
+
* shipped twice. Re-exported here so this module stays the one status import
|
|
6
|
+
* for the rest of the plugin.
|
|
7
|
+
*/
|
|
8
|
+
export { formatSemanticIndexStatus, type SemanticIndexStatusKind, semanticIndexStatusKind };
|
|
1
9
|
export interface StatusCompressionAggregate {
|
|
2
10
|
events: number;
|
|
3
11
|
original_tokens: number;
|
|
@@ -105,7 +113,6 @@ export interface AftStatusSnapshot {
|
|
|
105
113
|
export declare function formatCacheRoleLabel(role: string): string;
|
|
106
114
|
/** One-liner for the sidebar. Worktree mode only; other roles stay silent. */
|
|
107
115
|
export declare function worktreeCacheRoleNote(role: string | undefined): string | null;
|
|
108
|
-
export declare function formatSemanticIndexStatus(status: string, stage?: string | null): string;
|
|
109
116
|
export declare function formatSemanticRefreshing(refreshingCount: number): string | null;
|
|
110
117
|
export declare function formatBytes(bytes: number): string;
|
|
111
118
|
export declare function coerceAftStatus(response: Record<string, unknown>): AftStatusSnapshot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/shared/status.ts"],"names":[],"mappings":"AAAA,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,EAAE,0BAA0B,CAAC;IACpC,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE;QACR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BAAiB,CA4EpF;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA+F3E;AAcD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAkGtE"}
|
|
@@ -5,6 +5,17 @@
|
|
|
5
5
|
import type { PluginContext } from "./types.js";
|
|
6
6
|
declare const BARE_TOOL_ORDER: readonly ["status", "bash", "powershell", "read", "write", "edit", "apply_patch", "grep", "glob", "search", "outline", "zoom", "inspect", "callgraph", "conflicts", "ast_search", "ast_replace", "delete", "move", "import", "safety"];
|
|
7
7
|
export type SubcBareToolName = (typeof BARE_TOOL_ORDER)[number];
|
|
8
|
+
/**
|
|
9
|
+
* Context used to render the subc tool manifest.
|
|
10
|
+
*
|
|
11
|
+
* This manifest is generated once and compiled into the binary, so unlike the
|
|
12
|
+
* per-directory plugin surface it is ONE contract for every project a subc
|
|
13
|
+
* consumer may bind. Config-gated arguments therefore have to be declared here
|
|
14
|
+
* whenever the runtime honours them in any project, or a consumer working in a
|
|
15
|
+
* project that does enable the feature could never see it. `sandbox.enabled` is
|
|
16
|
+
* exactly that case: it is project-settable one-way hardening, and the subc
|
|
17
|
+
* bash path reads a passed `sandbox` argument regardless of this manifest.
|
|
18
|
+
*/
|
|
8
19
|
export declare function makeSubcSchemaStubCtx(): PluginContext;
|
|
9
20
|
/**
|
|
10
21
|
* Build the bare-name → JSON Schema map for subc build_manifest.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subc-tool-schemas.d.ts","sourceRoot":"","sources":["../src/subc-tool-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD,QAAA,MAAM,eAAe,wOAsBX,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,wBAAgB,qBAAqB,IAAI,aAAa,
|
|
1
|
+
{"version":3,"file":"subc-tool-schemas.d.ts","sourceRoot":"","sources":["../src/subc-tool-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD,QAAA,MAAM,eAAe,wOAsBX,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,IAAI,aAAa,CAerD;AAWD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA6FxF;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../src/tool-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AASnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../src/tool-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,O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C,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,GACvE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAgChC;AAED,uEAAuE;AACvE,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,SAAS,EACjB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,GACvE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAEhC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,yBAAyB,EAClC,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EACrD,SAAS,GAAE,eAAoB,GAC9B,OAAO,CAWT"}
|
|
@@ -12,6 +12,12 @@ export interface V2ExecutionContext {
|
|
|
12
12
|
sessionID?: string;
|
|
13
13
|
messageID?: string;
|
|
14
14
|
agent?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The host's identifier for this tool call. OpenCode 2 always sends it and a
|
|
17
|
+
* permission request has to quote it back as its source, but it is optional
|
|
18
|
+
* here because AFT's own fixtures build contexts without one.
|
|
19
|
+
*/
|
|
20
|
+
id?: string;
|
|
15
21
|
progress(update: Record<string, unknown>): Effect.Effect<void>;
|
|
16
22
|
}
|
|
17
23
|
export interface V2PermissionRequest {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/v2.ts"],"names":[],"mappings":"AAAA,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;AAOhC,MAAM,WAAW,UAAU;IAC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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,CAAC;IAC7C,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;AAwND,2EAA2E;AAC3E,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,UAAU,EACpB,SAAS,GAAE,eAAoB,GAC9B,cAAc,CAqChB;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,GAAG,MAAM,CAwBhG"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { type V2PermissionHostContext } from "../../permissions/v2.js";
|
|
2
|
+
import { type V2PromptChannel } from "../../permissions/v2-service.js";
|
|
2
3
|
import type { V2ToolConsumers } from "../definitions/v2.js";
|
|
3
4
|
export declare const V2_BUILTIN_REPLACEMENTS: readonly ["read", "edit", "write", "apply_patch"];
|
|
4
5
|
export declare const V2_AFT_FILESYSTEM_TOOLS: readonly ["aft_delete", "aft_move"];
|
|
5
6
|
export declare const V2_PERMISSION_ASK_INVENTORY: readonly ["read", "edit", "write", "apply_patch", "aft_delete", "aft_move", "bash:withPermissionLoop", "bash:host-fallback"];
|
|
6
|
-
/**
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Bind shared projected definitions to OpenCode 2's permission service.
|
|
9
|
+
*
|
|
10
|
+
* The probe looks for the two domains that carry the host's configured rules,
|
|
11
|
+
* because those decide every call that needs no prompt; a context missing
|
|
12
|
+
* either one is left without an evaluator so every ask-site refuses rather than
|
|
13
|
+
* acting unchecked. The prompt channel is created here, once per Location, so
|
|
14
|
+
* the client it discovers is shared by that Location's tool calls and is
|
|
15
|
+
* dropped with these consumers when the Location scope ends.
|
|
16
|
+
*/
|
|
17
|
+
export declare function hoistedV2ToolConsumers(host: V2PermissionHostContext | object, prompt?: V2PromptChannel): V2ToolConsumers;
|
|
8
18
|
//# sourceMappingURL=v2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/hoisted/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,mDAAoD,CAAC;AACzF,eAAO,MAAM,uBAAuB,qCAAsC,CAAC;AAE3E,eAAO,MAAM,2BAA2B,8HAS9B,CAAC;
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/hoisted/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,mDAAoD,CAAC;AACzF,eAAO,MAAM,uBAAuB,qCAAsC,CAAC;AAE3E,eAAO,MAAM,2BAA2B,8HAS9B,CAAC;AAQX;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EACtC,MAAM,GAAE,eAAyC,GAChD,eAAe,CAMjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAKnF,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,EAAc,MAAM,qBAAqB,CAAC;AAKnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA4CjD,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/E;AA8ED,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AAqPtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAiJjE;AAywBD;;;;;;;;;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,CA4BnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoGjD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoGjD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyIhF"}
|
package/dist/tui/v2-status.d.ts
CHANGED
|
@@ -7,5 +7,13 @@ export type AftSidebarSummary = {
|
|
|
7
7
|
semantic: string;
|
|
8
8
|
health: string;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* A one-line-per-field digest of the status snapshot.
|
|
12
|
+
*
|
|
13
|
+
* This is no longer what the sidebar draws: the sidebar now renders the shared
|
|
14
|
+
* panel in ./sidebar-view, which labels each section and reuses the status
|
|
15
|
+
* wording ./sidebar.tsx established. The digest is still pinned by
|
|
16
|
+
* test/tui/v2-status.test.ts.
|
|
17
|
+
*/
|
|
10
18
|
export declare function summarizeAftSidebar(status: AftStatusSnapshot | null): AftSidebarSummary;
|
|
11
19
|
//# sourceMappingURL=v2-status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-status.d.ts","sourceRoot":"","sources":["../../src/tui/v2-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,kBAAkB,CAAC;AAMrE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAS/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;
|
|
1
|
+
{"version":3,"file":"v2-status.d.ts","sourceRoot":"","sources":["../../src/tui/v2-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,kBAAkB,CAAC;AAMrE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAS/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;AAWF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,iBAAiB,CAoBvF"}
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Root entrypoint for directory-path plugin loading.
|
|
2
|
+
//
|
|
3
|
+
// A host given a package NAME resolves through the exports map in
|
|
4
|
+
// package.json. A host given a DIRECTORY path does not: OpenCode 2 resolves
|
|
5
|
+
// `<dir>/server` then `<dir>/index` literally (see `resolve()` in
|
|
6
|
+
// @opencode/plugin dist/host.js), and swallows every resolution error, so a
|
|
7
|
+
// package without these files is skipped silently — no load attempt, no
|
|
8
|
+
// warning, nothing in the log to explain it.
|
|
9
|
+
//
|
|
10
|
+
// Local development points at a checkout rather than an installed package, so
|
|
11
|
+
// these shims are what make `"plugin": ["/path/to/packages/opencode-plugin"]`
|
|
12
|
+
// work. They are one line each and change nothing for installed consumers,
|
|
13
|
+
// whose resolution goes through the exports map either way.
|
|
14
|
+
export { default } from "./dist/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.1",
|
|
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",
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
+
"index.js",
|
|
16
|
+
"server.js",
|
|
17
|
+
"tui.js",
|
|
15
18
|
"src/entry",
|
|
16
19
|
"src/tui",
|
|
17
20
|
"src/tui-compiled",
|
|
@@ -36,7 +39,8 @@
|
|
|
36
39
|
},
|
|
37
40
|
"dependencies": {
|
|
38
41
|
"@clack/prompts": "^1.6.0",
|
|
39
|
-
"@cortexkit/aft-bridge": "0.
|
|
42
|
+
"@cortexkit/aft-bridge": "0.57.1",
|
|
43
|
+
"@opencode/client": "2.0.11",
|
|
40
44
|
"@opentui/core": "0.4.3",
|
|
41
45
|
"@opentui/solid": "0.4.3",
|
|
42
46
|
"comment-json": "^4.6.2",
|
|
@@ -46,17 +50,17 @@
|
|
|
46
50
|
"zod": "^4.4.3"
|
|
47
51
|
},
|
|
48
52
|
"optionalDependencies": {
|
|
49
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
50
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
51
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
52
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
53
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
54
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
53
|
+
"@cortexkit/aft-darwin-arm64": "0.57.1",
|
|
54
|
+
"@cortexkit/aft-darwin-x64": "0.57.1",
|
|
55
|
+
"@cortexkit/aft-linux-arm64": "0.57.1",
|
|
56
|
+
"@cortexkit/aft-linux-x64": "0.57.1",
|
|
57
|
+
"@cortexkit/aft-win32-arm64": "0.57.1",
|
|
58
|
+
"@cortexkit/aft-win32-x64": "0.57.1"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
61
|
"@opencode-ai/plugin": "^1.17.11",
|
|
58
62
|
"@opencode-ai/sdk": "^1.17.11",
|
|
59
|
-
"@opencode/plugin": "2.0.
|
|
63
|
+
"@opencode/plugin": "2.0.11",
|
|
60
64
|
"@types/node": "^22.0.0",
|
|
61
65
|
"typescript": "^5.8.0"
|
|
62
66
|
},
|
|
@@ -76,6 +80,6 @@
|
|
|
76
80
|
},
|
|
77
81
|
"peerDependencies": {
|
|
78
82
|
"@opencode-ai/plugin": ">=0.0.0-beta-0",
|
|
79
|
-
"@opencode/plugin": "2.0.
|
|
83
|
+
"@opencode/plugin": "2.0.11"
|
|
80
84
|
}
|
|
81
85
|
}
|
package/server.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Root V2 server entrypoint for directory-path plugin loading.
|
|
2
|
+
//
|
|
3
|
+
// OpenCode 2 tries `<dir>/server` before `<dir>/index` when the plugin target
|
|
4
|
+
// is a directory, so this is the file that makes a checkout load as a V2
|
|
5
|
+
// plugin rather than falling back to the V1 default export. See the note in
|
|
6
|
+
// index.js for why the exports map does not cover this case.
|
|
7
|
+
export * from "./dist/entry/server.js";
|
|
8
|
+
export { default } from "./dist/entry/server.js";
|
package/src/shared/rpc-server.ts
CHANGED
|
@@ -136,6 +136,11 @@ export class AftRpcServer {
|
|
|
136
136
|
|
|
137
137
|
this.bunServer = server;
|
|
138
138
|
this.port = server.port ?? 0;
|
|
139
|
+
// Match startNode's unref: the RPC server is a side channel and must not be
|
|
140
|
+
// the reason a one-shot run refuses to end. Bun added unref() on its server
|
|
141
|
+
// after this code was written, so guard for older runtimes rather than
|
|
142
|
+
// assume it; a runtime without it keeps the previous behaviour.
|
|
143
|
+
(server as { unref?: () => void }).unref?.();
|
|
139
144
|
this.afterServerStarted();
|
|
140
145
|
return this.port;
|
|
141
146
|
}
|
package/src/shared/status.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatSemanticIndexStatus,
|
|
3
|
+
type SemanticIndexStatusKind,
|
|
4
|
+
semanticIndexStatusKind,
|
|
5
|
+
} from "@cortexkit/aft-bridge";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The semantic-index status formatter lives in @cortexkit/aft-bridge because
|
|
9
|
+
* both plugin hosts render it and two copies is how the same defect once
|
|
10
|
+
* shipped twice. Re-exported here so this module stays the one status import
|
|
11
|
+
* for the rest of the plugin.
|
|
12
|
+
*/
|
|
13
|
+
export { formatSemanticIndexStatus, type SemanticIndexStatusKind, semanticIndexStatusKind };
|
|
14
|
+
|
|
1
15
|
export interface StatusCompressionAggregate {
|
|
2
16
|
events: number;
|
|
3
17
|
original_tokens: number;
|
|
@@ -205,13 +219,6 @@ export function worktreeCacheRoleNote(role: string | undefined): string | null {
|
|
|
205
219
|
return null;
|
|
206
220
|
}
|
|
207
221
|
|
|
208
|
-
export function formatSemanticIndexStatus(status: string, stage?: string | null): string {
|
|
209
|
-
if ((status === "loading" || status === "building") && stage === "fingerprint_change") {
|
|
210
|
-
return "Rebuilding (model changed)";
|
|
211
|
-
}
|
|
212
|
-
return status;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
222
|
export function formatSemanticRefreshing(refreshingCount: number): string | null {
|
|
216
223
|
if (!Number.isFinite(refreshingCount) || refreshingCount <= 0) return null;
|
|
217
224
|
if (refreshingCount > 20) return "Ready (many files refreshing)";
|
|
@@ -340,7 +347,7 @@ export function formatStatusDialogMessage(status: AftStatusSnapshot): string {
|
|
|
340
347
|
`- trigrams: ${formatCount(status.search_index.trigrams)}`,
|
|
341
348
|
"",
|
|
342
349
|
"Semantic index",
|
|
343
|
-
`- status: ${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}`,
|
|
350
|
+
`- status: ${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage, status.semantic_index.error)}`,
|
|
344
351
|
);
|
|
345
352
|
const refreshing = formatSemanticRefreshing(status.semantic_index.refreshing_count);
|
|
346
353
|
if (refreshing) {
|
|
@@ -451,7 +458,7 @@ export function formatStatusMarkdown(status: AftStatusSnapshot): string {
|
|
|
451
458
|
`- **Trigrams:** ${formatCount(status.search_index.trigrams)}`,
|
|
452
459
|
"",
|
|
453
460
|
"### Semantic index",
|
|
454
|
-
`- **Status:** \`${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}\``,
|
|
461
|
+
`- **Status:** \`${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage, status.semantic_index.error)}\``,
|
|
455
462
|
);
|
|
456
463
|
const refreshing = formatSemanticRefreshing(status.semantic_index.refreshing_count);
|
|
457
464
|
if (refreshing) {
|
package/src/tui/index.tsx
CHANGED
|
@@ -383,6 +383,7 @@ const StatusDialog = (props: StatusDialogProps) => {
|
|
|
383
383
|
value={formatSemanticIndexStatus(
|
|
384
384
|
status()!.semantic_index.status,
|
|
385
385
|
status()!.semantic_index.stage,
|
|
386
|
+
status()!.semantic_index.error,
|
|
386
387
|
)}
|
|
387
388
|
tone={statusTone(status()!.semantic_index.status)}
|
|
388
389
|
/>
|