@kenkaiiii/ggcoder 5.72.0 → 5.74.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 (94) hide show
  1. package/assets/skills/refactoring/SKILL.md +3 -1
  2. package/dist/app-error.d.ts +21 -0
  3. package/dist/app-error.js +39 -0
  4. package/dist/app-error.js.map +1 -0
  5. package/dist/app-sidecar.js +39 -35
  6. package/dist/app-sidecar.js.map +1 -1
  7. package/dist/core/agent-session.d.ts +2 -2
  8. package/dist/core/agent-session.js +17 -7
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/checklist-detection.d.ts +11 -0
  11. package/dist/core/checklist-detection.js +238 -0
  12. package/dist/core/checklist-detection.js.map +1 -0
  13. package/dist/core/checklist-items.d.ts +180 -0
  14. package/dist/core/checklist-items.js +204 -0
  15. package/dist/core/checklist-items.js.map +1 -0
  16. package/dist/core/checklist-prompt.d.ts +3 -0
  17. package/dist/core/checklist-prompt.js +34 -0
  18. package/dist/core/checklist-prompt.js.map +1 -0
  19. package/dist/core/checklist-snapshot.d.ts +13 -0
  20. package/dist/core/checklist-snapshot.js +29 -0
  21. package/dist/core/checklist-snapshot.js.map +1 -0
  22. package/dist/core/checklist-store.d.ts +59 -0
  23. package/dist/core/checklist-store.js +242 -0
  24. package/dist/core/checklist-store.js.map +1 -0
  25. package/dist/core/compaction/compactor.js +6 -0
  26. package/dist/core/compaction/compactor.js.map +1 -1
  27. package/dist/core/ken-context.js +7 -3
  28. package/dist/core/ken-context.js.map +1 -1
  29. package/dist/core/lsp/client.d.ts +4 -0
  30. package/dist/core/lsp/client.js +71 -3
  31. package/dist/core/lsp/client.js.map +1 -1
  32. package/dist/core/lsp/manager.d.ts +1 -0
  33. package/dist/core/lsp/manager.js +9 -3
  34. package/dist/core/lsp/manager.js.map +1 -1
  35. package/dist/core/lsp/project-root.d.ts +9 -0
  36. package/dist/core/lsp/project-root.js +75 -0
  37. package/dist/core/lsp/project-root.js.map +1 -0
  38. package/dist/core/lsp/reference-project.d.ts +6 -0
  39. package/dist/core/lsp/reference-project.js +110 -0
  40. package/dist/core/lsp/reference-project.js.map +1 -0
  41. package/dist/core/lsp/servers.js +1 -0
  42. package/dist/core/lsp/servers.js.map +1 -1
  43. package/dist/core/subagent-receipt.js +3 -1
  44. package/dist/core/subagent-receipt.js.map +1 -1
  45. package/dist/modes/acp-mode.d.ts +2 -1
  46. package/dist/modes/acp-mode.js +4 -1
  47. package/dist/modes/acp-mode.js.map +1 -1
  48. package/dist/motion-agent/motion-review-session.js +7 -3
  49. package/dist/motion-agent/motion-review-session.js.map +1 -1
  50. package/dist/system-prompt.js +14 -13
  51. package/dist/system-prompt.js.map +1 -1
  52. package/dist/tools/bash.d.ts +4 -1
  53. package/dist/tools/bash.js +32 -7
  54. package/dist/tools/bash.js.map +1 -1
  55. package/dist/tools/checklist.d.ts +56 -0
  56. package/dist/tools/checklist.js +178 -0
  57. package/dist/tools/checklist.js.map +1 -0
  58. package/dist/tools/code-nav.d.ts +1 -1
  59. package/dist/tools/code-nav.js +3 -2
  60. package/dist/tools/code-nav.js.map +1 -1
  61. package/dist/tools/edit-targets.d.ts +10 -0
  62. package/dist/tools/edit-targets.js +31 -0
  63. package/dist/tools/edit-targets.js.map +1 -0
  64. package/dist/tools/edit.d.ts +11 -3
  65. package/dist/tools/edit.js +386 -312
  66. package/dist/tools/edit.js.map +1 -1
  67. package/dist/tools/exit-plan.d.ts +2 -2
  68. package/dist/tools/exit-plan.js +7 -1
  69. package/dist/tools/exit-plan.js.map +1 -1
  70. package/dist/tools/index.d.ts +3 -2
  71. package/dist/tools/index.js +3 -0
  72. package/dist/tools/index.js.map +1 -1
  73. package/dist/tools/prompt-hints.js +3 -1
  74. package/dist/tools/prompt-hints.js.map +1 -1
  75. package/dist/tools/skill.js +6 -3
  76. package/dist/tools/skill.js.map +1 -1
  77. package/dist/tools/subagent.js +2 -1
  78. package/dist/tools/subagent.js.map +1 -1
  79. package/dist/tools/tool-tiers.js +1 -0
  80. package/dist/tools/tool-tiers.js.map +1 -1
  81. package/dist/tools/verification-review.d.ts +2 -0
  82. package/dist/tools/verification-review.js +41 -0
  83. package/dist/tools/verification-review.js.map +1 -0
  84. package/dist/ui/components/ToolExecution.js +3 -2
  85. package/dist/ui/components/ToolExecution.js.map +1 -1
  86. package/dist/ui/terminal-history.js +3 -1
  87. package/dist/ui/terminal-history.js.map +1 -1
  88. package/dist/ui/tool-line-summary.js +14 -2
  89. package/dist/ui/tool-line-summary.js.map +1 -1
  90. package/dist/ui/transcript/tool-presentation.js +1 -1
  91. package/dist/ui/transcript/tool-presentation.js.map +1 -1
  92. package/dist/utils/format.js +5 -1
  93. package/dist/utils/format.js.map +1 -1
  94. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import { type AgentTool } from "@kenkaiiii/gg-agent";
1
+ import { type AgentTool, type ToolExecuteResult } from "@kenkaiiii/gg-agent";
2
2
  import { type Message, type MessageProvenance, type Provider, type Usage, type ThinkingLevel } from "@kenkaiiii/gg-ai";
3
3
  import { EventBus } from "./event-bus.js";
4
4
  import { type CompletionReview } from "./completion-review.js";
@@ -122,7 +122,7 @@ export interface AgentSessionOptions {
122
122
  * UI. Omitted by callers that don't want plan mode (CLI wires its own).
123
123
  */
124
124
  onEnterPlan?: (reason?: string) => void | Promise<void>;
125
- onExitPlan?: (planPath: string) => Promise<string>;
125
+ onExitPlan?: (planPath: string) => Promise<ToolExecuteResult>;
126
126
  /**
127
127
  * If provided, the session's tool set is filtered to ONLY these tool names
128
128
  * after `createTools()` runs, and the system prompt's Tools section lists only
@@ -24,7 +24,7 @@ import { ensureAppDirs } from "../config.js";
24
24
  import { buildSubAgentSystemPrompt, buildSystemPrompt, } from "../system-prompt.js";
25
25
  import { createTools, createWebSearchTool, } from "../tools/index.js";
26
26
  import { partitionToolsByTier } from "../tools/tool-tiers.js";
27
- import { autoBackgroundedId } from "../tools/bash.js";
27
+ import { autoBackgroundedId, REVIEW_REJECTED_BEFORE_START } from "../tools/bash.js";
28
28
  import { buildProcessCompletionFollowUp } from "./process-gate.js";
29
29
  import { buildSubAgentCompletionFollowUp } from "./subagent-manager.js";
30
30
  import { applyAsyncSubagentPolicy } from "./subagent-policy.js";
@@ -69,6 +69,7 @@ import crypto from "node:crypto";
69
69
  import fs from "node:fs/promises";
70
70
  import os from "node:os";
71
71
  import path from "node:path";
72
+ import { editTargetPaths } from "../tools/edit-targets.js";
72
73
  /**
73
74
  * A run whose tool calls fail more often than this is thrashing, not
74
75
  * progressing — refuse to extend its turn budget.
@@ -1212,20 +1213,29 @@ export class AgentSession {
1212
1213
  let verificationChanged = false;
1213
1214
  if (!event.isError && args) {
1214
1215
  if (name === "edit" || name === "write") {
1215
- const filePath = String(args.file_path ?? "");
1216
1216
  // Check-owning files (tsconfig.json, pytest.ini, vitest.config.ts …)
1217
1217
  // are tracked even when they are not source code: editing one
1218
- // invalidates earlier check results.
1219
- if (filePath && (isCodeFilePath(filePath) || isCheckOwnFile(filePath))) {
1220
- this.verificationGate.recordMutation(filePath);
1221
- verificationChanged = true;
1218
+ // invalidates earlier check results. A multi-file edit records every file.
1219
+ for (const filePath of editTargetPaths(args)) {
1220
+ if (isCodeFilePath(filePath) || isCheckOwnFile(filePath)) {
1221
+ this.verificationGate.recordMutation(filePath);
1222
+ verificationChanged = true;
1223
+ }
1222
1224
  }
1223
1225
  }
1224
1226
  }
1225
1227
  if (args && call && name === "bash") {
1226
1228
  const command = typeof args.command === "string" ? args.command : "";
1227
1229
  const classification = classifyVerificationCommand(command);
1228
- if (classification.accepted || classification.snapshotEligible) {
1230
+ if (args.review === true && event.result === REVIEW_REJECTED_BEFORE_START) {
1231
+ // The core tool rejected its arguments BEFORE spawning. Never mint
1232
+ // a pass, or poison the failed-check ledger with an unexecuted check.
1233
+ // A child's output cannot match: bash always prefixes it with Exit code.
1234
+ this.verificationGate.recordRejectedCheck(command, REVIEW_REJECTED_BEFORE_START);
1235
+ delete call.sourceSnapshot;
1236
+ verificationChanged = true;
1237
+ }
1238
+ else if (classification.accepted || classification.snapshotEligible) {
1229
1239
  // A foreground check that outlived the default budget was moved to
1230
1240
  // the background, not failed: track it to its real exit the same way.
1231
1241
  const autoBackgroundId = event.isError ? undefined : autoBackgroundedId(event.result);