@prestyj/cli 5.32.1 → 5.32.2

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.
@@ -361,6 +361,8 @@ export declare class AgentSession {
361
361
  * delta; anything that changes WITHOUT one is caught by the hook below.
362
362
  */
363
363
  private renderedEnvironment;
364
+ /** Project files as of the first prompt build (undefined until then). */
365
+ private projectFiles;
364
366
  /** Wall-clock start of the current run; scopes the background-process gate. */
365
367
  private runStartedAt;
366
368
  /** Gate injections spent this run, capped by MAX_PROCESS_GATE_INJECTIONS. */
@@ -58,6 +58,7 @@ import { buildLoopBreakMessage } from "./loop-breaker.js";
58
58
  import { buildRegroundingMessage, requestTextForRegrounding } from "./regrounding.js";
59
59
  import { buildSemanticLoopJudgePrompt, buildSemanticLoopMessage, parseSemanticLoopVerdict, SEMANTIC_LOOP_JUDGE_TIMEOUT_MS, withJudgeTimeout, } from "./semantic-loop-check.js";
60
60
  import { buildEnvDeltaMessage, buildLanguageUpdateMessage } from "./env-delta.js";
61
+ import { listProjectFiles } from "./project-files.js";
61
62
  import { wrapSteeringText, buildNotificationSteeringText, buildIdleWakeNotificationText, STEERING_PREFIX, } from "./steering.js";
62
63
  import { AgentNotificationQueue } from "./agent-notifications.js";
63
64
  import { VerificationGate, VERIFICATION_STATE_KIND } from "./verification-gate.js";
@@ -218,6 +219,8 @@ export class AgentSession {
218
219
  * delta; anything that changes WITHOUT one is caught by the hook below.
219
220
  */
220
221
  renderedEnvironment = {};
222
+ /** Project files as of the first prompt build (undefined until then). */
223
+ projectFiles;
221
224
  /** Wall-clock start of the current run; scopes the background-process gate. */
222
225
  runStartedAt = 0;
223
226
  /** Gate injections spent this run, capped by MAX_PROCESS_GATE_INJECTIONS. */
@@ -3389,7 +3392,7 @@ export class AgentSession {
3389
3392
  const networkAllow = this.settingsManager.get("networkMode") === "allowlist"
3390
3393
  ? this.settingsManager.get("networkAllow")
3391
3394
  : [];
3392
- return { additionalRoots: this.additionalRoots, networkAllow };
3395
+ return { additionalRoots: this.additionalRoots, networkAllow, projectFiles: this.projectFiles };
3393
3396
  }
3394
3397
  /**
3395
3398
  * Build the stable system-prompt prefix for the current tool set and state.
@@ -3401,6 +3404,10 @@ export class AgentSession {
3401
3404
  async buildBasePrompt(planMode, approvedPlanPath) {
3402
3405
  if (this.customSystemPrompt)
3403
3406
  return this.customSystemPrompt;
3407
+ // Listed once: a rebuild (plan mode, /add-dir, compaction) must not churn the
3408
+ // prompt as the agent adds files.
3409
+ if (this.projectFiles === undefined)
3410
+ this.projectFiles = await listProjectFiles(this.cwd);
3404
3411
  const toolNames = this.tools.map((tool) => tool.name);
3405
3412
  const deferredToolNames = this.deferredToolNamesForPrompt(toolNames);
3406
3413
  // Whatever is rendered now is what the model has been told.