@prestyj/cli 5.30.2 → 5.31.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/app-sidecar/app-settings.d.ts +6 -2
- package/dist/app-sidecar/app-settings.js +39 -20
- package/dist/app-sidecar/app-settings.js.map +1 -1
- package/dist/app-sidecar/git-target.d.ts +17 -0
- package/dist/app-sidecar/git-target.js +31 -0
- package/dist/app-sidecar/git-target.js.map +1 -0
- package/dist/app-sidecar/goal-routes.d.ts +6 -0
- package/dist/app-sidecar/goal-routes.js +360 -0
- package/dist/app-sidecar/goal-routes.js.map +1 -0
- package/dist/app-sidecar/history-routes.d.ts +13 -0
- package/dist/app-sidecar/history-routes.js +37 -27
- package/dist/app-sidecar/history-routes.js.map +1 -1
- package/dist/app-sidecar/mcp-routes.js +1 -2
- package/dist/app-sidecar/mcp-routes.js.map +1 -1
- package/dist/app-sidecar/prompt-routes.js +1 -2
- package/dist/app-sidecar/prompt-routes.js.map +1 -1
- package/dist/app-sidecar/route-context.d.ts +12 -0
- package/dist/app-sidecar/run-control-routes.js +2 -1
- package/dist/app-sidecar/run-control-routes.js.map +1 -1
- package/dist/app-sidecar/session-routes.js +41 -0
- package/dist/app-sidecar/session-routes.js.map +1 -1
- package/dist/app-sidecar/session-types.d.ts +2 -0
- package/dist/app-sidecar/workspace-routes.js +13 -95
- package/dist/app-sidecar/workspace-routes.js.map +1 -1
- package/dist/app-sidecar.js +219 -67
- package/dist/app-sidecar.js.map +1 -1
- package/dist/cli/shared.js +1 -1
- package/dist/cli/shared.js.map +1 -1
- package/dist/core/acceptance-checks.js +17 -4
- package/dist/core/acceptance-checks.js.map +1 -1
- package/dist/core/agent-notifications.d.ts +1 -1
- package/dist/core/agent-session.d.ts +90 -5
- package/dist/core/agent-session.js +185 -63
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/ask-user.d.ts +11 -0
- package/dist/core/ask-user.js +6 -1
- package/dist/core/ask-user.js.map +1 -1
- package/dist/core/auth-providers.d.ts +2 -80
- package/dist/core/auth-providers.js +4 -183
- package/dist/core/auth-providers.js.map +1 -1
- package/dist/core/cache-diagnostics.d.ts +1 -1
- package/dist/core/cache-diagnostics.js +2 -1
- package/dist/core/cache-diagnostics.js.map +1 -1
- package/dist/core/compaction/tool-result-pruner.d.ts +10 -0
- package/dist/core/compaction/tool-result-pruner.js +12 -0
- package/dist/core/compaction/tool-result-pruner.js.map +1 -1
- package/dist/core/context-files.d.ts +8 -0
- package/dist/core/context-files.js +46 -0
- package/dist/core/context-files.js.map +1 -0
- package/dist/core/custom-commands.d.ts +6 -0
- package/dist/core/custom-commands.js +17 -0
- package/dist/core/custom-commands.js.map +1 -1
- package/dist/core/env-delta.d.ts +9 -1
- package/dist/core/env-delta.js +20 -0
- package/dist/core/env-delta.js.map +1 -1
- package/dist/core/goal-summary.d.ts +32 -0
- package/dist/core/goal-summary.js +104 -0
- package/dist/core/goal-summary.js.map +1 -0
- package/dist/core/goals-store.d.ts +208 -0
- package/dist/core/goals-store.js +521 -0
- package/dist/core/goals-store.js.map +1 -0
- package/dist/core/local-endpoint-store.js +15 -11
- package/dist/core/local-endpoint-store.js.map +1 -1
- package/dist/core/plan-handoff.d.ts +8 -0
- package/dist/core/plan-handoff.js +11 -0
- package/dist/core/plan-handoff.js.map +1 -1
- package/dist/core/project-discovery.d.ts +7 -0
- package/dist/core/project-discovery.js +9 -3
- package/dist/core/project-discovery.js.map +1 -1
- package/dist/core/radio.d.ts +2 -3
- package/dist/core/radio.js.map +1 -1
- package/dist/core/session-manager.d.ts +7 -1
- package/dist/core/session-manager.js +17 -7
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-storage.d.ts +3 -0
- package/dist/core/session-storage.js +8 -2
- package/dist/core/session-storage.js.map +1 -1
- package/dist/core/steroids.d.ts +8 -0
- package/dist/core/steroids.js +19 -3
- package/dist/core/steroids.js.map +1 -1
- package/dist/core/subagent-manager.d.ts +51 -0
- package/dist/core/subagent-manager.js +103 -16
- package/dist/core/subagent-manager.js.map +1 -1
- package/dist/core/subagent-store.js +2 -1
- package/dist/core/subagent-store.js.map +1 -1
- package/dist/goals-agent/goal-team.d.ts +2 -0
- package/dist/goals-agent/goal-team.js +83 -0
- package/dist/goals-agent/goal-team.js.map +1 -0
- package/dist/goals-agent/goals-agent.d.ts +90 -0
- package/dist/goals-agent/goals-agent.js +246 -0
- package/dist/goals-agent/goals-agent.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.js +4 -3
- package/dist/interactive.js.map +1 -1
- package/dist/modes/acp-autopilot.d.ts +27 -0
- package/dist/modes/acp-autopilot.js +54 -0
- package/dist/modes/acp-autopilot.js.map +1 -0
- package/dist/modes/acp-goals.d.ts +48 -0
- package/dist/modes/acp-goals.js +103 -0
- package/dist/modes/acp-goals.js.map +1 -0
- package/dist/modes/acp-mode.d.ts +128 -3
- package/dist/modes/acp-mode.js +1082 -52
- package/dist/modes/acp-mode.js.map +1 -1
- package/dist/modes/subagent-worker-mode.d.ts +14 -0
- package/dist/modes/subagent-worker-mode.js +32 -1
- package/dist/modes/subagent-worker-mode.js.map +1 -1
- package/dist/system-prompt.d.ts +8 -0
- package/dist/system-prompt.js +21 -9
- package/dist/system-prompt.js.map +1 -1
- package/dist/tools/bash-read-evidence.d.ts +13 -0
- package/dist/tools/bash-read-evidence.js +48 -1
- package/dist/tools/bash-read-evidence.js.map +1 -1
- package/dist/tools/grep-scan.d.ts +96 -0
- package/dist/tools/grep-scan.js +283 -0
- package/dist/tools/grep-scan.js.map +1 -0
- package/dist/tools/grep.d.ts +10 -0
- package/dist/tools/grep.js +418 -10
- package/dist/tools/grep.js.map +1 -1
- package/dist/tools/index.d.ts +7 -1
- package/dist/tools/index.js +10 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/read-tracker.d.ts +6 -12
- package/dist/tools/read-tracker.js +21 -36
- package/dist/tools/read-tracker.js.map +1 -1
- package/dist/tools/read.js +2 -2
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/subagent-control.js +22 -3
- package/dist/tools/subagent-control.js.map +1 -1
- package/dist/tools/write.js +110 -8
- package/dist/tools/write.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.d.ts +5 -5
- package/dist/ui/components/InputArea.d.ts +2 -2
- package/dist/ui/components/InputArea.js +3 -3
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/ToolExecution.d.ts +2 -2
- package/dist/ui/hooks/useContextCompaction.js +38 -31
- package/dist/ui/hooks/useContextCompaction.js.map +1 -1
- package/dist/utils/format.d.ts +0 -4
- package/dist/utils/format.js +0 -7
- package/dist/utils/format.js.map +1 -1
- package/package.json +4 -4
package/dist/modes/acp-mode.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { Message, Provider, ThinkingLevel } from "@prestyj/ai";
|
|
1
|
+
import type { Message, MessageProvenance, Provider, ThinkingLevel } from "@prestyj/ai";
|
|
2
2
|
import { type ToolExecuteResult } from "@prestyj/agent";
|
|
3
|
+
import { AgentSession, type SessionAttachment } from "../core/agent-session.js";
|
|
4
|
+
import type { ChildModelPick, SubAgentSnapshot } from "../core/subagent-manager.js";
|
|
5
|
+
import { createAskUserTool } from "../tools/ask-user.js";
|
|
6
|
+
import { type GoalBriefExtras, type GoalRecord } from "../core/goals-store.js";
|
|
3
7
|
import type { EventBus } from "../core/event-bus.js";
|
|
8
|
+
import type { AutopilotMarkerPayload } from "../core/session-manager.js";
|
|
9
|
+
import { type AcpNolanReviewer } from "./acp-autopilot.js";
|
|
4
10
|
/** The ACP major version this mode implements. Bumped only for breaking changes. */
|
|
5
11
|
export declare const ACP_PROTOCOL_VERSION = 1;
|
|
6
12
|
/**
|
|
@@ -13,7 +19,32 @@ export declare const ACP_PROTOCOL_VERSION = 1;
|
|
|
13
19
|
export interface AcpAgentSession {
|
|
14
20
|
readonly eventBus: Pick<EventBus, "on">;
|
|
15
21
|
initialize(): Promise<void>;
|
|
16
|
-
|
|
22
|
+
/** `provenance` marks EZ Goals' hidden kickoff/resume instructions. */
|
|
23
|
+
prompt(content: string, provenance?: MessageProvenance): Promise<void>;
|
|
24
|
+
/** Image prompts (`promptCapabilities.image`); without it images are ignored. */
|
|
25
|
+
promptWithAttachments?(text: string, attachments: SessionAttachment[]): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Mid-run steering (`_gg/queue`). Optional so a test double or alternative
|
|
28
|
+
* session need not support it; `_gg/queue` then answers -32602.
|
|
29
|
+
*/
|
|
30
|
+
queueMessage?(text: string): number;
|
|
31
|
+
listQueuedMessages?(): Array<{
|
|
32
|
+
id: string;
|
|
33
|
+
text: string;
|
|
34
|
+
}>;
|
|
35
|
+
cancelQueuedMessage?(id: string): boolean;
|
|
36
|
+
drainQueue?(): string;
|
|
37
|
+
/** EZ Goals' workers, for `_gg/goal_state`. */
|
|
38
|
+
listSubAgents?(): SubAgentSnapshot[];
|
|
39
|
+
/** Adds a goal's attached folder to the workspace. */
|
|
40
|
+
addDirectory?(dir: string): Promise<{
|
|
41
|
+
ok: true;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
error: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Tell the agent a fact at its next turn (goal settings changed). */
|
|
47
|
+
notify?(id: string, text: string): void;
|
|
17
48
|
getState(): {
|
|
18
49
|
sessionId: string;
|
|
19
50
|
provider: Provider;
|
|
@@ -34,6 +65,16 @@ export interface AcpAgentSession {
|
|
|
34
65
|
setSignal(signal: AbortSignal): void;
|
|
35
66
|
/** Replay a session file from disk into this session. */
|
|
36
67
|
loadSession(sessionPath: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Nolan's verdict markers (desktop `persistAutopilotMarker`). Optional so a
|
|
70
|
+
* test double need not persist; without them a reopened session has no
|
|
71
|
+
* Nolan bubbles.
|
|
72
|
+
*/
|
|
73
|
+
persistAutopilotMarker?(phase: AutopilotMarkerPayload["phase"], extra?: {
|
|
74
|
+
reason?: string;
|
|
75
|
+
body?: string;
|
|
76
|
+
}): Promise<void>;
|
|
77
|
+
getAutopilotMarkers?(): AutopilotMarkerPayload[];
|
|
37
78
|
/** The conversation as restored, used to replay history to the client. */
|
|
38
79
|
getMessages(): Message[];
|
|
39
80
|
switchModel(provider: string, model: string): Promise<void>;
|
|
@@ -44,6 +85,12 @@ export interface AcpAgentSession {
|
|
|
44
85
|
setPlanMode(active: boolean): Promise<void>;
|
|
45
86
|
/** Bake an approved plan into the prompt so [DONE:n] progress markers work. */
|
|
46
87
|
setApprovedPlan(planPath: string | undefined): Promise<void>;
|
|
88
|
+
/** Host verification evidence for Nolan's digest; optional for test doubles. */
|
|
89
|
+
getVerificationEvidence?(): AgentSession["getVerificationEvidence"] extends () => infer R ? R : never;
|
|
90
|
+
getVerificationProblem?(): string | null;
|
|
91
|
+
/** Fresh context for an accepted plan (desktop /plan/accept). Optional:
|
|
92
|
+
* without it an accept keeps the current context and sends no reset. */
|
|
93
|
+
newSession?(preserveConversation?: boolean): Promise<void>;
|
|
47
94
|
/**
|
|
48
95
|
* Registry commands (/model, /compact, …), including any an extension
|
|
49
96
|
* registered during `initialize`. Optional so a test double need not carry a
|
|
@@ -71,6 +118,52 @@ export interface AcpPlanHooks {
|
|
|
71
118
|
/** Returns the instruction handed back to the model after approval. */
|
|
72
119
|
onExitPlan: (planPath: string) => Promise<ToolExecuteResult>;
|
|
73
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* What a session is being built for, beyond the plan hooks.
|
|
123
|
+
*
|
|
124
|
+
* A third argument rather than a change to the first two so existing session
|
|
125
|
+
* factories (tests) keep working unchanged.
|
|
126
|
+
*/
|
|
127
|
+
export interface AcpSessionContext {
|
|
128
|
+
/** The session's working directory: the goal folder for a goal session. */
|
|
129
|
+
cwd: string;
|
|
130
|
+
/** Set when the cwd is a goal folder: build a EZ Goals coordinator. */
|
|
131
|
+
goal: {
|
|
132
|
+
dir: string;
|
|
133
|
+
record: GoalRecord;
|
|
134
|
+
} | null;
|
|
135
|
+
/** The goal's brief extras (memory, attached projects' rules), read once. */
|
|
136
|
+
goalExtras?: GoalBriefExtras;
|
|
137
|
+
/** Read live: true once the user has started the goal. */
|
|
138
|
+
isGoalActive: () => boolean;
|
|
139
|
+
/** Read live at each worker spawn. */
|
|
140
|
+
getChildModel: () => ChildModelPick | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* The `ask_user` tool, present only when the client opted in with
|
|
143
|
+
* `clientCapabilities._meta.gg.askUser`. Goes in `additionalTools` at
|
|
144
|
+
* construction (the tool array is append-only for the prompt cache).
|
|
145
|
+
*/
|
|
146
|
+
askUserTool?: ReturnType<typeof createAskUserTool>;
|
|
147
|
+
/**
|
|
148
|
+
* The client reviews plans itself (`clientCapabilities._meta.gg.planReview`):
|
|
149
|
+
* exit_plan parks the plan for a human decision instead of auto-approving,
|
|
150
|
+
* and the session gets the desktop's `planSubmissionGate`.
|
|
151
|
+
*/
|
|
152
|
+
planReview?: boolean;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* A plan submitted via exit_plan that awaits a decision (desktop parity:
|
|
156
|
+
* app-sidecar.ts pendingPlanPath/planGeneration/offeredPlanGeneration). One
|
|
157
|
+
* object so the autopilot cycle can read and settle it.
|
|
158
|
+
*/
|
|
159
|
+
export interface AcpPendingPlanState {
|
|
160
|
+
planPath: string | null;
|
|
161
|
+
content: string;
|
|
162
|
+
/** Bumped on every set/clear; a stale decision is refused. */
|
|
163
|
+
generation: number;
|
|
164
|
+
/** Generation last offered to the client; -1 when none. */
|
|
165
|
+
offeredGeneration: number;
|
|
166
|
+
}
|
|
74
167
|
export interface AcpModeOptions {
|
|
75
168
|
provider: Provider;
|
|
76
169
|
model: string;
|
|
@@ -86,7 +179,22 @@ export interface AcpModeOptions {
|
|
|
86
179
|
* Builds the session for `session/new`. Overridden by tests; production
|
|
87
180
|
* always gets a real {@link AgentSession}.
|
|
88
181
|
*/
|
|
89
|
-
createSession?: (signal: AbortSignal, hooks: AcpPlanHooks) => AcpAgentSession;
|
|
182
|
+
createSession?: (signal: AbortSignal, hooks: AcpPlanHooks, context: AcpSessionContext) => AcpAgentSession;
|
|
183
|
+
/** `~/.ezcoder` by default; where goals (`goals/`) and sessions live. */
|
|
184
|
+
agentDir?: string;
|
|
185
|
+
/**
|
|
186
|
+
* `ask_user` soft deadline (default: the desktop's interactive 10 min). Past
|
|
187
|
+
* it the model hears "no answer yet" and the client's question stays open.
|
|
188
|
+
*/
|
|
189
|
+
askUserDeadlineMs?: number;
|
|
190
|
+
/**
|
|
191
|
+
* Builds Autopilot Nolan's reviewer for a session's project. Overridden by
|
|
192
|
+
* tests; production gets {@link createAcpNolanReviewer}.
|
|
193
|
+
*/
|
|
194
|
+
createNolanReviewer?: (cwd: string, buildModel: () => {
|
|
195
|
+
provider: Provider;
|
|
196
|
+
model: string;
|
|
197
|
+
}) => AcpNolanReviewer;
|
|
90
198
|
}
|
|
91
199
|
/** The selectors this agent exposes. Ids are part of the wire contract. */
|
|
92
200
|
export declare const MODEL_CONFIG_ID = "model";
|
|
@@ -107,6 +215,23 @@ export declare const MODE_CONFIG_ID = "mode";
|
|
|
107
215
|
* the protocol needs of them.
|
|
108
216
|
*/
|
|
109
217
|
export declare function historyUpdates(messages: readonly Message[]): Record<string, unknown>[];
|
|
218
|
+
/** A replayed Nolan marker, as `_gg/autopilot_event` params (sans sessionId). */
|
|
219
|
+
export interface HistoryAutopilotEvent {
|
|
220
|
+
phase: string;
|
|
221
|
+
reason?: string;
|
|
222
|
+
body?: string;
|
|
223
|
+
history: true;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* {@link historyUpdates} with Nolan's verdict markers interleaved at their
|
|
227
|
+
* `afterMessageCount` (non-system messages, as the desktop history route
|
|
228
|
+
* counts them). Marker phase `plan_approved` replays as ACP `plan_accepted`.
|
|
229
|
+
*/
|
|
230
|
+
export declare function historyFrames(messages: readonly Message[], markers: readonly AutopilotMarkerPayload[]): Array<{
|
|
231
|
+
update: Record<string, unknown>;
|
|
232
|
+
} | {
|
|
233
|
+
autopilot: HistoryAutopilotEvent;
|
|
234
|
+
}>;
|
|
110
235
|
/**
|
|
111
236
|
* Serve ACP on stdio until the input stream ends.
|
|
112
237
|
*
|