@kenkaiiii/ggcoder 5.19.0 → 5.19.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.
- package/dist/app-sidecar.js +15 -1
- package/dist/app-sidecar.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-compaction.test.js +437 -9
- package/dist/core/agent-session-compaction.test.js.map +1 -1
- package/dist/core/agent-session-review-coverage.test.js +26 -0
- package/dist/core/agent-session-review-coverage.test.js.map +1 -1
- package/dist/core/agent-session-tool-result-policy.test.js +14 -1
- package/dist/core/agent-session-tool-result-policy.test.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +175 -33
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/active-context.d.ts +17 -0
- package/dist/core/compaction/active-context.d.ts.map +1 -0
- package/dist/core/compaction/active-context.js +20 -0
- package/dist/core/compaction/active-context.js.map +1 -0
- package/dist/core/compaction/active-context.test.d.ts +2 -0
- package/dist/core/compaction/active-context.test.d.ts.map +1 -0
- package/dist/core/compaction/active-context.test.js +36 -0
- package/dist/core/compaction/active-context.test.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +10 -17
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +21 -33
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +74 -66
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/compaction/token-estimator.d.ts +25 -1
- package/dist/core/compaction/token-estimator.d.ts.map +1 -1
- package/dist/core/compaction/token-estimator.js +86 -1
- package/dist/core/compaction/token-estimator.js.map +1 -1
- package/dist/core/compaction/token-estimator.test.js +147 -1
- package/dist/core/compaction/token-estimator.test.js.map +1 -1
- package/dist/core/compaction/tool-result-pruner.d.ts +37 -0
- package/dist/core/compaction/tool-result-pruner.d.ts.map +1 -0
- package/dist/core/compaction/tool-result-pruner.js +103 -0
- package/dist/core/compaction/tool-result-pruner.js.map +1 -0
- package/dist/core/compaction/tool-result-pruner.test.d.ts +2 -0
- package/dist/core/compaction/tool-result-pruner.test.d.ts.map +1 -0
- package/dist/core/compaction/tool-result-pruner.test.js +148 -0
- package/dist/core/compaction/tool-result-pruner.test.js.map +1 -0
- package/dist/core/ideal-review.d.ts +6 -0
- package/dist/core/ideal-review.d.ts.map +1 -1
- package/dist/core/ideal-review.js +14 -0
- package/dist/core/ideal-review.js.map +1 -1
- package/dist/core/ideal-review.test.js +10 -1
- package/dist/core/ideal-review.test.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/settings-manager.js +2 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/tools/bash.d.ts +9 -0
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +28 -18
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/bash.test.d.ts +2 -0
- package/dist/tools/bash.test.d.ts.map +1 -0
- package/dist/tools/bash.test.js +56 -0
- package/dist/tools/bash.test.js.map +1 -0
- package/dist/tools/overflow.d.ts +12 -2
- package/dist/tools/overflow.d.ts.map +1 -1
- package/dist/tools/overflow.js +49 -4
- package/dist/tools/overflow.js.map +1 -1
- package/dist/tools/overflow.test.d.ts +2 -0
- package/dist/tools/overflow.test.d.ts.map +1 -0
- package/dist/tools/overflow.test.js +62 -0
- package/dist/tools/overflow.test.js.map +1 -0
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +3 -16
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +2 -4
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +6 -2
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.test.js +31 -0
- package/dist/ui/hooks/useAgentLoop.test.js.map +1 -1
- package/dist/ui/hooks/useContextCompaction.d.ts +5 -8
- package/dist/ui/hooks/useContextCompaction.d.ts.map +1 -1
- package/dist/ui/hooks/useContextCompaction.js +77 -16
- package/dist/ui/hooks/useContextCompaction.js.map +1 -1
- package/dist/ui/hooks/useContextCompaction.test.d.ts +2 -0
- package/dist/ui/hooks/useContextCompaction.test.d.ts.map +1 -0
- package/dist/ui/hooks/useContextCompaction.test.js +135 -0
- package/dist/ui/hooks/useContextCompaction.test.js.map +1 -0
- package/package.json +4 -4
package/dist/app-sidecar.js
CHANGED
|
@@ -34,6 +34,7 @@ import { driveAutopilotCycle, frameAutopilotInjection } from "./core/autopilot-c
|
|
|
34
34
|
import { validateKenModelPref, effectiveKenModel } from "./core/ken-model.js";
|
|
35
35
|
import { normalizeAutopilotMarkersForHistory, normalizeAppMarkersForHistory, normalizeKenTurnsForHistory, restoreUserRow, restoreAssistantTexts, autopilotMarkerCopySeed, } from "./core/session-history.js";
|
|
36
36
|
import { AuthStorage } from "./core/auth-storage.js";
|
|
37
|
+
import { cleanupToolOutputs } from "./tools/overflow.js";
|
|
37
38
|
import { fetchSubscriptionUsage, MOONSHOT_OAUTH_KEY, SubscriptionUsageError, XIAOMI_CREDITS_KEY, } from "@kenkaiiii/gg-core";
|
|
38
39
|
import { loginAnthropic } from "./core/oauth/anthropic.js";
|
|
39
40
|
import { loginOpenAI } from "./core/oauth/openai.js";
|
|
@@ -510,6 +511,9 @@ async function main() {
|
|
|
510
511
|
// before anything spawns (bash tool, background tasks, LSP, git helpers all
|
|
511
512
|
// inherit it). Best-effort — never blocks startup beyond its internal cap.
|
|
512
513
|
await enrichProcessPath();
|
|
514
|
+
// Sweep recoverable full tool outputs (~/.gg/tool-output/) older than 48h.
|
|
515
|
+
// Fire-and-forget: cleanup must never delay or break startup.
|
|
516
|
+
void cleanupToolOutputs().catch(() => { });
|
|
513
517
|
const auth = new AuthStorage(paths.authFile);
|
|
514
518
|
await auth.load();
|
|
515
519
|
// Every window's session lives here as an in-process object, keyed by the id
|
|
@@ -1268,8 +1272,10 @@ async function createSession(deps, opts) {
|
|
|
1268
1272
|
// Autopilot (auto-review) toggle for THIS window's project. Loaded from
|
|
1269
1273
|
// gg-app.json on boot; flipped via POST /autopilot. When on, POST /prompt runs
|
|
1270
1274
|
// runAutopilotCycle after the user's turn settles — Ken auto-reviews the work
|
|
1271
|
-
// and drives the review→prompt→review loop.
|
|
1275
|
+
// and drives the review→prompt→review loop. Ken is the sole verification
|
|
1276
|
+
// owner in this mode, so suppress the build session's redundant Ideal hook.
|
|
1272
1277
|
let autopilot = mode === "code" && (await loadAutopilot(cwd));
|
|
1278
|
+
session.setIdealReviewSuppressed(autopilot);
|
|
1273
1279
|
// True while an autopilot review is in flight (used to defer kenAuto model
|
|
1274
1280
|
// switches, like kenRunning does for chat Ken, and to drive the spinner).
|
|
1275
1281
|
let autopilotReviewing = false;
|
|
@@ -1466,6 +1472,9 @@ async function createSession(deps, opts) {
|
|
|
1466
1472
|
// (often >5 min) regardless of the user's global speedProfile pick.
|
|
1467
1473
|
forceLongCacheRetention: true,
|
|
1468
1474
|
});
|
|
1475
|
+
// Ken is already the independent autopilot reviewer; recursively running
|
|
1476
|
+
// his own Ideal self-review adds latency and can corrupt the verdict shape.
|
|
1477
|
+
ken.setIdealReviewSuppressed(true);
|
|
1469
1478
|
await ken.initialize();
|
|
1470
1479
|
// Deliberately no bus bridge: the review is silent. Errors surface via the
|
|
1471
1480
|
// runAutopilotReview try/catch as autopilot_error frames.
|
|
@@ -1688,6 +1697,7 @@ async function createSession(deps, opts) {
|
|
|
1688
1697
|
const generation = runLifecycle.begin(abortOwnedWork).generation;
|
|
1689
1698
|
pendingCancelDrain = null;
|
|
1690
1699
|
autopilotActive = true;
|
|
1700
|
+
session.setIdealReviewSuppressed(true);
|
|
1691
1701
|
// Generation captured by the last plan review; acceptPlan re-checks it so
|
|
1692
1702
|
// a user Accept/Reject landing mid-review always wins.
|
|
1693
1703
|
let planGenAtReview = -1;
|
|
@@ -1801,6 +1811,7 @@ async function createSession(deps, opts) {
|
|
|
1801
1811
|
}
|
|
1802
1812
|
finally {
|
|
1803
1813
|
autopilotActive = false;
|
|
1814
|
+
session.setIdealReviewSuppressed(autopilot);
|
|
1804
1815
|
finishOwnedGeneration(generation, true);
|
|
1805
1816
|
queueMicrotask(() => void runStrandedQueue());
|
|
1806
1817
|
}
|
|
@@ -2781,6 +2792,9 @@ async function createSession(deps, opts) {
|
|
|
2781
2792
|
return;
|
|
2782
2793
|
}
|
|
2783
2794
|
autopilot = enabled;
|
|
2795
|
+
// A toggle-off during an active cycle takes effect after Ken finishes;
|
|
2796
|
+
// until then, injected build runs must not re-enable Ideal self-review.
|
|
2797
|
+
session.setIdealReviewSuppressed(enabled || autopilotActive);
|
|
2784
2798
|
await saveAutopilot(cwd, enabled);
|
|
2785
2799
|
log("INFO", "app-sidecar", "autopilot toggled", { enabled: String(enabled) });
|
|
2786
2800
|
broadcast("autopilot", { autopilot: enabled });
|