@prestyj/cli 5.30.2 → 5.30.3
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 +26 -0
- package/dist/app-sidecar/goal-routes.js +445 -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 +36 -25
- 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/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 +213 -60
- 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 +83 -5
- package/dist/core/agent-session.js +174 -59
- 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/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/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/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/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/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
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { AskQuestion, AskUserResult } from "./ask-user.js";
|
|
3
|
+
/**
|
|
4
|
+
* Goals: a long-running objective the user hands to EZ Coder ("Bring p95
|
|
5
|
+
* latency under 200 ms across the whole API"). Each goal is its own folder under
|
|
6
|
+
* `~/.ezcoder/goals/<id>/` holding `goal.json`; that folder is also the goal's
|
|
7
|
+
* workspace (the coordinator session's cwd) and, later, its shared library.
|
|
8
|
+
* Context folders and files the user attaches live elsewhere on disk and are
|
|
9
|
+
* referenced by absolute path.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GOAL_FILE = "goal.json";
|
|
12
|
+
/** New names stay short enough to read at a glance in the goal list. */
|
|
13
|
+
export declare const GOAL_NAME_MAX = 15;
|
|
14
|
+
export declare const GOAL_TEXT_MAX = 2000;
|
|
15
|
+
export declare const GOAL_CONTEXT_MAX = 20;
|
|
16
|
+
/** Standing instructions the user gives a goal (rules that hold throughout). */
|
|
17
|
+
export declare const GOAL_INSTRUCTIONS_MAX = 4000;
|
|
18
|
+
/** The goal's memory file in its folder: decisions and preferences learned along the way. */
|
|
19
|
+
export declare const GOAL_MEMORY_FILE = "MEMORY.md";
|
|
20
|
+
/** How much of the memory file is loaded into EZ Goals' brief. */
|
|
21
|
+
export declare const GOAL_MEMORY_MAX = 16000;
|
|
22
|
+
declare const contextItemSchema: z.ZodObject<{
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
kind: z.ZodEnum<{
|
|
25
|
+
file: "file";
|
|
26
|
+
folder: "folder";
|
|
27
|
+
}>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
declare const goalRecordSchema: z.ZodObject<{
|
|
30
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
goal: z.ZodString;
|
|
34
|
+
context: z.ZodArray<z.ZodObject<{
|
|
35
|
+
path: z.ZodString;
|
|
36
|
+
kind: z.ZodEnum<{
|
|
37
|
+
file: "file";
|
|
38
|
+
folder: "folder";
|
|
39
|
+
}>;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
createdAt: z.ZodString;
|
|
42
|
+
kickoffAt: z.ZodOptional<z.ZodString>;
|
|
43
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
44
|
+
critterModel: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
provider: z.ZodString;
|
|
46
|
+
model: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
49
|
+
pausedAt: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
/** What the app sends to create a goal. Context kinds are re-derived on disk. */
|
|
52
|
+
export declare const createGoalInputSchema: z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
goal: z.ZodString;
|
|
55
|
+
context: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
56
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
/** What the app sends to change a goal's context or instructions after it's created. */
|
|
59
|
+
export declare const updateGoalInputSchema: z.ZodObject<{
|
|
60
|
+
context: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type UpdateGoalInput = z.input<typeof updateGoalInputSchema>;
|
|
64
|
+
export type GoalContextItem = z.infer<typeof contextItemSchema>;
|
|
65
|
+
export type GoalRecord = z.infer<typeof goalRecordSchema>;
|
|
66
|
+
export type CreateGoalInput = z.input<typeof createGoalInputSchema>;
|
|
67
|
+
export type GoalResult<T> = {
|
|
68
|
+
ok: true;
|
|
69
|
+
value: T;
|
|
70
|
+
} | {
|
|
71
|
+
ok: false;
|
|
72
|
+
error: string;
|
|
73
|
+
};
|
|
74
|
+
/** Folder that holds every goal. */
|
|
75
|
+
export declare function goalsRoot(agentDir: string): string;
|
|
76
|
+
/** Lowercase dashed folder name; empty when the name has no usable characters. */
|
|
77
|
+
export declare function goalSlug(name: string): string;
|
|
78
|
+
/** True when `dir` is exactly one goal folder directly inside `root`. */
|
|
79
|
+
export declare function isGoalDir(root: string, dir: string): boolean;
|
|
80
|
+
/** True when `target` is `root` or anything beneath it. */
|
|
81
|
+
export declare function isInsideGoalsRoot(root: string, target: string): boolean;
|
|
82
|
+
/** Read and validate one goal folder's record; null when absent or invalid. */
|
|
83
|
+
export declare function readGoal(dir: string): Promise<GoalRecord | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Create a goal folder and its record. The folder name is the slug, suffixed
|
|
86
|
+
* `-2`, `-3`… when taken; `mkdir` without `recursive` makes the claim atomic.
|
|
87
|
+
*/
|
|
88
|
+
export declare function createGoal(root: string, input: CreateGoalInput, now: Date): Promise<GoalResult<{
|
|
89
|
+
dir: string;
|
|
90
|
+
record: GoalRecord;
|
|
91
|
+
}>>;
|
|
92
|
+
/** Every valid goal under `root` with its folder. Unreadable folders are skipped. */
|
|
93
|
+
export declare function listGoals(root: string): Promise<Array<{
|
|
94
|
+
dir: string;
|
|
95
|
+
record: GoalRecord;
|
|
96
|
+
}>>;
|
|
97
|
+
/**
|
|
98
|
+
* True while a goal still needs EZ Goals' automatic first reply: the kickoff
|
|
99
|
+
* was never started and the conversation has no user or assistant message yet.
|
|
100
|
+
* The system prompt is not conversation, so it does not count.
|
|
101
|
+
*/
|
|
102
|
+
export declare function goalNeedsKickoff(record: GoalRecord, messages: ReadonlyArray<{
|
|
103
|
+
role: string;
|
|
104
|
+
}>): boolean;
|
|
105
|
+
/** Briefing until the user starts the goal; active from then on. */
|
|
106
|
+
export type GoalPhase = "briefing" | "active";
|
|
107
|
+
export declare function goalPhase(record: GoalRecord): GoalPhase;
|
|
108
|
+
/**
|
|
109
|
+
* True when an ask_user result is the user choosing to start the goal. An
|
|
110
|
+
* answer comes back as the option's `value` when it has one, so pass the
|
|
111
|
+
* questions asked: an option labelled GOAL_START_OPTION counts by its value
|
|
112
|
+
* too (live bug: EZ Goals gave it the value "start", the answer came back as
|
|
113
|
+
* "start", and the goal never started).
|
|
114
|
+
*/
|
|
115
|
+
export declare function isGoalStartAnswer(result: AskUserResult, questions?: ReadonlyArray<AskQuestion>): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Start the goal if `result` is the user choosing to, whether it came back
|
|
118
|
+
* while EZ Goals was still waiting on its question or after the question's
|
|
119
|
+
* deadline passed (a late answer). Returns the started record, or null when
|
|
120
|
+
* the answer isn't the start option or the goal had already started.
|
|
121
|
+
*/
|
|
122
|
+
export declare function startGoalOnAnswer(dir: string, record: GoalRecord, result: AskUserResult, now: Date, questions?: ReadonlyArray<AskQuestion>): Promise<GoalRecord | null>;
|
|
123
|
+
/**
|
|
124
|
+
* Pin the model the goal's workers run on, or clear it (null) so they follow
|
|
125
|
+
* EZ Goals' model. Returns the updated record; null when the goal is gone.
|
|
126
|
+
*/
|
|
127
|
+
export declare function setGoalCritterModel(dir: string, pick: {
|
|
128
|
+
provider: string;
|
|
129
|
+
model: string;
|
|
130
|
+
} | null): Promise<GoalRecord | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Record that the user started the goal. Returns the updated record, or null
|
|
133
|
+
* when it had already started (or the goal is gone), so it is set only once.
|
|
134
|
+
*/
|
|
135
|
+
export declare function markGoalStarted(dir: string, now: Date): Promise<GoalRecord | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Change a goal's attached context or standing instructions. Paths are
|
|
138
|
+
* re-resolved on disk like at creation; an empty instructions string clears
|
|
139
|
+
* them. Takes effect for the goal's next session (EZ Goals' brief is fixed
|
|
140
|
+
* for a session, so its prompt cache holds).
|
|
141
|
+
*/
|
|
142
|
+
export declare function updateGoal(dir: string, input: UpdateGoalInput): Promise<GoalResult<GoalRecord>>;
|
|
143
|
+
/** Pause a goal (true) or let it carry on (false). Returns the updated record, or null if missing. */
|
|
144
|
+
export declare function setGoalPaused(dir: string, paused: boolean, now: Date): Promise<GoalRecord | null>;
|
|
145
|
+
/**
|
|
146
|
+
* The goal's memory: what EZ Goals has written down in its folder's
|
|
147
|
+
* MEMORY.md (decisions, the user's preferences and corrections, what's done
|
|
148
|
+
* and what's left). Empty when there's none yet. Long files are cut to
|
|
149
|
+
* GOAL_MEMORY_MAX, with a note, so the brief stays bounded.
|
|
150
|
+
*/
|
|
151
|
+
export declare function readGoalMemory(dir: string): Promise<string>;
|
|
152
|
+
/**
|
|
153
|
+
* Delete one goal: its folder (record, notes, artifacts) and the coordinator
|
|
154
|
+
* sessions stored for it. Attached context lives elsewhere and is untouched.
|
|
155
|
+
* `id` must name a direct child of `root`; anything else is refused.
|
|
156
|
+
*/
|
|
157
|
+
export declare function deleteGoal(root: string, sessionsDir: string, id: string): Promise<GoalResult<{
|
|
158
|
+
dir: string;
|
|
159
|
+
}>>;
|
|
160
|
+
/**
|
|
161
|
+
* Record that the coordinator's first reply has started. Returns null when it
|
|
162
|
+
* already had (or the goal is gone), so a second caller never kicks off twice.
|
|
163
|
+
*/
|
|
164
|
+
export declare function markGoalKickoff(dir: string, now: Date): Promise<GoalRecord | null>;
|
|
165
|
+
/** The two answers to the coordinator's "ready to start?" question. */
|
|
166
|
+
export declare const GOAL_START_OPTION = "Start the goal now";
|
|
167
|
+
export declare const GOAL_HOLD_OPTION = "Hang on, I want to discuss it more";
|
|
168
|
+
/**
|
|
169
|
+
* The coordinator's standing brief, appended to the system prompt of a session
|
|
170
|
+
* whose cwd is a goal folder. Static for the goal's lifetime.
|
|
171
|
+
*/
|
|
172
|
+
/** What EZ Goals' brief carries besides the goal itself, read once per session. */
|
|
173
|
+
export interface GoalBriefExtras {
|
|
174
|
+
/** The goal folder's MEMORY.md (see readGoalMemory); empty when there's none. */
|
|
175
|
+
memory?: string;
|
|
176
|
+
/** Each attached folder's instruction files (AGENTS.md, CLAUDE.md…), by folder. */
|
|
177
|
+
projectRules?: ReadonlyArray<{
|
|
178
|
+
readonly folder: string;
|
|
179
|
+
readonly rules: readonly string[];
|
|
180
|
+
}>;
|
|
181
|
+
}
|
|
182
|
+
export declare function renderGoalPrompt(dir: string, record: GoalRecord, extras?: GoalBriefExtras): string;
|
|
183
|
+
/** What EZ Goals is told when the user changes the goal's settings mid-session. */
|
|
184
|
+
export declare function goalSettingsNote(record: GoalRecord): string;
|
|
185
|
+
/**
|
|
186
|
+
* Whether a started goal was cut off mid-work and should pick itself back up
|
|
187
|
+
* when its session opens again: it isn't paused, and either a worker was
|
|
188
|
+
* interrupted by the restart or EZ Goals' own last turn never finished (its
|
|
189
|
+
* last message is a tool call, or a tool result or message with no reply
|
|
190
|
+
* after it).
|
|
191
|
+
*/
|
|
192
|
+
export declare function goalWasInterrupted(record: GoalRecord, messages: ReadonlyArray<{
|
|
193
|
+
role: string;
|
|
194
|
+
content?: unknown;
|
|
195
|
+
}>, workers: ReadonlyArray<{
|
|
196
|
+
state: string;
|
|
197
|
+
recovered?: boolean;
|
|
198
|
+
}>): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* The note behind EZ Goals' first run after the goal was interrupted (the
|
|
201
|
+
* app closed or crashed mid-work): workers don't survive a restart, so it
|
|
202
|
+
* checks what got done and carries on with the rest. Cut off mid-briefing,
|
|
203
|
+
* it asks its question again instead.
|
|
204
|
+
*/
|
|
205
|
+
export declare function goalResumePrompt(record: GoalRecord): string;
|
|
206
|
+
/** The hidden instruction behind the coordinator's first, automatic reply. */
|
|
207
|
+
export declare function goalKickoffPrompt(record: GoalRecord): string;
|
|
208
|
+
export {};
|