@prestyj/cli 5.26.0 → 5.27.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.
Files changed (40) hide show
  1. package/README.md +2 -2
  2. package/dist/core/agent-session.d.ts +13 -0
  3. package/dist/core/agent-session.js +44 -5
  4. package/dist/core/agent-session.js.map +1 -1
  5. package/dist/core/agents.js +14 -42
  6. package/dist/core/agents.js.map +1 -1
  7. package/dist/core/auth-providers.js +1 -1
  8. package/dist/core/auth-providers.js.map +1 -1
  9. package/dist/core/bundled-agents.js +9 -7
  10. package/dist/core/bundled-agents.js.map +1 -1
  11. package/dist/core/fast-apply-benchmark.d.ts +1 -1
  12. package/dist/core/fast-apply-benchmark.js +2 -2
  13. package/dist/core/fast-apply-benchmark.js.map +1 -1
  14. package/dist/core/frontmatter.d.ts +22 -0
  15. package/dist/core/frontmatter.js +90 -0
  16. package/dist/core/frontmatter.js.map +1 -0
  17. package/dist/core/regrounding.d.ts +7 -0
  18. package/dist/core/regrounding.js +27 -0
  19. package/dist/core/regrounding.js.map +1 -1
  20. package/dist/core/semantic-search-benchmark.d.ts +1 -1
  21. package/dist/core/semantic-search-benchmark.js +2 -2
  22. package/dist/core/semantic-search-benchmark.js.map +1 -1
  23. package/dist/core/skills.d.ts +1 -1
  24. package/dist/core/skills.js +5 -24
  25. package/dist/core/skills.js.map +1 -1
  26. package/dist/core/subagent-policy.js +1 -4
  27. package/dist/core/subagent-policy.js.map +1 -1
  28. package/dist/tools/edit.js +8 -1
  29. package/dist/tools/edit.js.map +1 -1
  30. package/dist/tools/redaction-guard.d.ts +10 -0
  31. package/dist/tools/redaction-guard.js +55 -0
  32. package/dist/tools/redaction-guard.js.map +1 -0
  33. package/dist/tools/steroids.d.ts +1 -1
  34. package/dist/tools/steroids.js +20 -4
  35. package/dist/tools/steroids.js.map +1 -1
  36. package/dist/tools/write.js +12 -5
  37. package/dist/tools/write.js.map +1 -1
  38. package/dist/ui/components/Footer.js +0 -3
  39. package/dist/ui/components/Footer.js.map +1 -1
  40. package/package.json +4 -4
package/README.md CHANGED
@@ -70,7 +70,7 @@ Switch mid-conversation with `/model`. Not locked to anyone.
70
70
  | Provider | Models | Auth |
71
71
  | ----------------- | ---------------------------------------------------------------------------- | ---------------- |
72
72
  | **Anthropic** | Claude Fable 5.1, Opus 5.5, Opus 5, Sonnet 5, Haiku 4.5 | OAuth |
73
- | **OpenAI** | GPT-6 Astra, GPT-6 Sol, GPT-6 Luna, GPT-5.6 Sol, GPT-5.6 Terra, GPT-5.6 Luna | OAuth |
73
+ | **OpenAI** | GPT-6 Astra, GPT-6 Sol, GPT-6 Luna | OAuth |
74
74
  | **Moonshot** | Kimi K3, Kimi K2.7 Code | OAuth or API key |
75
75
  | **Z.AI (GLM)** | GLM-5.3, GLM-5.3-Flash (image) | API key |
76
76
  | **MiniMax** | MiniMax M3 (image + video) | API key |
@@ -175,7 +175,7 @@ Plus the [Grep MCP](https://grep.dev) for searching across 1M+ public GitHub rep
175
175
 
176
176
  `subagent` remains blocking. The async suite launches persistent NDJSON worker processes, so a parent can start up to four active child turns, keep working, steer them, and wait for any or all results. Up to eight idle workers remain available for follow-up; bounded snapshots retain the latest 20 agents.
177
177
 
178
- Only GPT-5.6 Sol/Terra at **Ultra** delegates proactively. Lower Sol/Terra levels use async agents only when the user or project/skill instructions request delegation; other models receive no proactive policy.
178
+ Only GPT-6 Astra/Sol at **Ultra** delegates proactively. Lower Astra/Sol levels use async agents only when the user or project/skill instructions request delegation; other models receive no proactive policy.
179
179
 
180
180
  Children share the parent working directory by default, so parallel writes must target disjoint files or subsystems. Pass `isolate: true` to `subagent` to give a child its own copy of the repo on a new branch instead — the right choice when several children edit at once, or when a child's changes should land on a branch of their own. The copy is reclaimed automatically when the child finishes without committing; a child that did commit keeps its branch, because that branch is the deliverable. `/integrate` then merges those branches one at a time, running the suite between each. Async fan-out is one level deep, child output is bounded, idle workers reap after 10 minutes, and workers are not resumable after a CLI/app restart.
181
181
 
@@ -321,6 +321,13 @@ export declare class AgentSession {
321
321
  private agentPrompt?;
322
322
  /** Stable prompt prefix retained separately from the volatile uncached tail. */
323
323
  private baseSystemPrompt;
324
+ /**
325
+ * Project languages whose style packs and verify commands are in the
326
+ * standard prompt. Only ever grows within a session (same policy as the
327
+ * terminal UI): a pack disappearing mid-task would rewrite the cached prefix
328
+ * for no benefit.
329
+ */
330
+ private activeLanguages;
324
331
  /** Shared with the tool layer so plan-mode restrictions read live state. */
325
332
  private planModeRef;
326
333
  /** Path of the approved plan currently being implemented, or undefined. When
@@ -747,6 +754,12 @@ export declare class AgentSession {
747
754
  * context, return contract and Environment), or the standard prompt.
748
755
  */
749
756
  private buildBasePrompt;
757
+ /**
758
+ * Add newly detected project languages. Returns true when the set grew and
759
+ * the standard prompt therefore needs a rebuild. Custom and sub-agent
760
+ * prompts never render packs, so detection is skipped for them.
761
+ */
762
+ private refreshActiveLanguages;
750
763
  /** Rebuild messages[0] from current plan-mode + approved-plan state. */
751
764
  private rebuildSystemPromptInPlace;
752
765
  /**
@@ -42,10 +42,10 @@ import { clampThinkingForPlanMode } from "./thinking-level.js";
42
42
  import { pruneStaleToolResults } from "./compaction/tool-result-pruner.js";
43
43
  import { discoverAgents } from "./agents.js";
44
44
  import { enhancePrompt } from "../utils/prompt-enhancer.js";
45
- import { detectProjectStack } from "./language-detector.js";
45
+ import { detectLanguages, detectProjectStack } from "./language-detector.js";
46
46
  import { evaluateIdealReview, buildIdealReviewMessage, buildReviewCoverageEscalationMessage, buildReviewCoverageMessage, MAX_REVIEW_COVERAGE_INJECTIONS, withReviewCoverageRequirements, detectTestDrift, ReviewCoverageTracker, } from "./ideal-review.js";
47
47
  import { evaluateLoopBreak, buildLoopBreakMessage, CycleDetector, ToolCallProgressTracker, detectTextRepetition, } from "./loop-breaker.js";
48
- import { buildRegroundingMessage } from "./regrounding.js";
48
+ import { buildRegroundingMessage, requestTextForRegrounding } from "./regrounding.js";
49
49
  import { buildSemanticLoopJudgePrompt, buildSemanticLoopMessage, MAX_SEMANTIC_LOOP_CALLS, parseSemanticLoopVerdict, shouldRunSemanticLoopCheck, SEMANTIC_LOOP_JUDGE_TIMEOUT_MS, withJudgeTimeout, } from "./semantic-loop-check.js";
50
50
  import { buildIndependentReviewMessage, buildReviewerTask, INDEPENDENT_REVIEW_SCORE_THRESHOLD, parseReviewerFindings, REVIEWER_TOOLS, REVIEWER_WAIT_MS, } from "./ideal-review-subagent.js";
51
51
  import { buildEnvDeltaMessage } from "./env-delta.js";
@@ -273,6 +273,13 @@ export class AgentSession {
273
273
  agentPrompt;
274
274
  /** Stable prompt prefix retained separately from the volatile uncached tail. */
275
275
  baseSystemPrompt = "";
276
+ /**
277
+ * Project languages whose style packs and verify commands are in the
278
+ * standard prompt. Only ever grows within a session (same policy as the
279
+ * terminal UI): a pack disappearing mid-task would rewrite the cached prefix
280
+ * for no benefit.
281
+ */
282
+ activeLanguages = new Set();
276
283
  /** Shared with the tool layer so plan-mode restrictions read live state. */
277
284
  planModeRef = { current: false };
278
285
  /** Path of the approved plan currently being implemented, or undefined. When
@@ -1913,6 +1920,11 @@ export class AgentSession {
1913
1920
  }
1914
1921
  /** Auto-compact if needed, run agent loop with auth retry, and persist messages. */
1915
1922
  async runLoop(options = {}) {
1923
+ // Languages are re-detected at each task boundary so a project scaffolded
1924
+ // during the previous turn gets its packs; the prompt is rebuilt only when
1925
+ // the set grows, keeping the cached prefix stable otherwise.
1926
+ if (this.refreshActiveLanguages())
1927
+ await this.rebuildSystemPromptInPlace();
1916
1928
  this.refreshSystemPromptTail();
1917
1929
  // One-shot cache-key marker per session so turn_end cacheRead numbers
1918
1930
  // in the log can be traced back to a specific routing namespace —
@@ -1929,8 +1941,7 @@ export class AgentSession {
1929
1941
  // Reset self-correction hook state for this run; pin the latest user message
1930
1942
  // as the verbatim original request for post-compaction re-grounding.
1931
1943
  const lastUser = [...this.messages].reverse().find((m) => m.role === "user");
1932
- const originalRequest = typeof lastUser?.content === "string" ? lastUser.content : "";
1933
- this.resetHookState(originalRequest);
1944
+ this.resetHookState(requestTextForRegrounding(lastUser));
1934
1945
  // Resolve OAuth credentials and run agent loop.
1935
1946
  // On 401, force-refresh the token and retry once — the provider may have
1936
1947
  // revoked the token server-side before the stored expiry (e.g. after a restart).
@@ -3119,7 +3130,35 @@ export class AgentSession {
3119
3130
  contextLimits: this.contextLimits,
3120
3131
  });
3121
3132
  }
3122
- return buildSystemPrompt(this.cwd, this.skills, planMode, approvedPlanPath, toolNames, undefined, this.provider, this.recordRenderedEnvironment(), deferredToolNames, this.contextLimits);
3133
+ return buildSystemPrompt(this.cwd, this.skills, planMode, approvedPlanPath, toolNames, this.activeLanguages, this.provider, this.recordRenderedEnvironment(), deferredToolNames, this.contextLimits);
3134
+ }
3135
+ /**
3136
+ * Add newly detected project languages. Returns true when the set grew and
3137
+ * the standard prompt therefore needs a rebuild. Custom and sub-agent
3138
+ * prompts never render packs, so detection is skipped for them.
3139
+ */
3140
+ refreshActiveLanguages() {
3141
+ if (this.customSystemPrompt || this.agentPrompt !== undefined)
3142
+ return false;
3143
+ let grew = false;
3144
+ try {
3145
+ for (const id of detectLanguages(this.cwd)) {
3146
+ if (this.activeLanguages.has(id))
3147
+ continue;
3148
+ this.activeLanguages.add(id);
3149
+ grew = true;
3150
+ }
3151
+ }
3152
+ catch (err) {
3153
+ log("WARN", "language", `Language detection failed: ${err.message}`);
3154
+ return false;
3155
+ }
3156
+ if (grew) {
3157
+ log("INFO", "language", "Style packs active", {
3158
+ active: [...this.activeLanguages].join(","),
3159
+ });
3160
+ }
3161
+ return grew;
3123
3162
  }
3124
3163
  /** Rebuild messages[0] from current plan-mode + approved-plan state. */
3125
3164
  async rebuildSystemPromptInPlace() {