@kenkaiiii/ggcoder 5.67.1 → 5.68.1
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 +121 -3
- package/dist/app-sidecar.js.map +1 -1
- package/dist/core/agent-session.d.ts +50 -3
- package/dist/core/agent-session.js +344 -21
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/ask-user.d.ts +90 -8
- package/dist/core/ask-user.js +124 -13
- package/dist/core/ask-user.js.map +1 -1
- package/dist/core/cache-diagnostics.d.ts +62 -0
- package/dist/core/cache-diagnostics.js +165 -0
- package/dist/core/cache-diagnostics.js.map +1 -0
- package/dist/core/compaction/plan-step-policy.d.ts +46 -0
- package/dist/core/compaction/plan-step-policy.js +57 -0
- package/dist/core/compaction/plan-step-policy.js.map +1 -0
- package/dist/core/destructive-git-guard.d.ts +63 -0
- package/dist/core/destructive-git-guard.js +831 -0
- package/dist/core/destructive-git-guard.js.map +1 -0
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.js +5 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/keep-awake.d.ts +88 -0
- package/dist/core/keep-awake.js +251 -0
- package/dist/core/keep-awake.js.map +1 -0
- package/dist/core/package-threats.d.ts +18 -0
- package/dist/core/package-threats.js +168 -0
- package/dist/core/package-threats.js.map +1 -0
- package/dist/core/session-manager.d.ts +13 -1
- package/dist/core/session-manager.js +38 -18
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-summary-index.d.ts +37 -0
- package/dist/core/session-summary-index.js +172 -0
- package/dist/core/session-summary-index.js.map +1 -0
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.js +8 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/shell-threats-popular-packages.d.ts +11 -0
- package/dist/core/shell-threats-popular-packages.js +675 -0
- package/dist/core/shell-threats-popular-packages.js.map +1 -0
- package/dist/core/shell-threats.d.ts +8 -0
- package/dist/core/shell-threats.js +186 -0
- package/dist/core/shell-threats.js.map +1 -0
- package/dist/core/stream-rules.d.ts +30 -0
- package/dist/core/stream-rules.js +151 -0
- package/dist/core/stream-rules.js.map +1 -0
- package/dist/motion-agent/motion-check-tool.d.ts +7 -0
- package/dist/motion-agent/motion-check-tool.js +80 -30
- package/dist/motion-agent/motion-check-tool.js.map +1 -1
- package/dist/motion-agent/motion-review.d.ts +5 -2
- package/dist/motion-agent/motion-review.js +7 -4
- package/dist/motion-agent/motion-review.js.map +1 -1
- package/dist/tools/ask-user.js +3 -3
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/bash.js +37 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/task-send.d.ts +1 -1
- package/dist/tools/task-send.js +15 -1
- package/dist/tools/task-send.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +1 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +1 -1
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Destructive-git guard: refuses model-issued shell commands that would throw
|
|
3
|
+
* away the user's uncommitted work.
|
|
4
|
+
*
|
|
5
|
+
* Checkpoints only capture edits made through write/edit, so one
|
|
6
|
+
* `git reset --hard` from the shell would otherwise lose work with no undo.
|
|
7
|
+
*
|
|
8
|
+
* Two phases:
|
|
9
|
+
* 1. {@link findDestructiveGitCommands} — pure parse. A small quote-aware shell
|
|
10
|
+
* scanner splits the command into simple commands (through `&&`/`;`/`||`/
|
|
11
|
+
* pipes, subshells, `$(…)`/backticks, `if`/`for`/`while` bodies), unwraps
|
|
12
|
+
* `bash -c`/`sh -c`/`eval` scripts and exec wrappers (`sudo`, `env`,
|
|
13
|
+
* `timeout`, `nohup`, `xargs`, …), follows `cd` and `git -C`, and classifies
|
|
14
|
+
* each git invocation.
|
|
15
|
+
* 2. {@link checkDestructiveGit} — context. Discarding commands are blocked
|
|
16
|
+
* only when `git status` in the target directory shows something they would
|
|
17
|
+
* destroy; a clean tree passes. Plain force-push is always blocked.
|
|
18
|
+
*
|
|
19
|
+
* Fails OPEN on guard errors (git missing, timeout): the guard is a seatbelt
|
|
20
|
+
* against an agent mistake, not a sandbox, and must never wedge the bash tool.
|
|
21
|
+
*/
|
|
22
|
+
type DestructiveGitKind = "reset-hard" | "checkout-paths" | "restore-worktree" | "clean" | "stash-drop" | "stash-clear" | "branch-force-delete" | "force-push";
|
|
23
|
+
export interface DestructiveGitMatch {
|
|
24
|
+
kind: DestructiveGitKind;
|
|
25
|
+
/** The git invocation as parsed, for the block message. */
|
|
26
|
+
display: string;
|
|
27
|
+
/** Directory git would run in (after `cd` and `git -C`). */
|
|
28
|
+
dir: string;
|
|
29
|
+
/** `--git-dir=`/`--work-tree=` globals to forward to inspection commands. */
|
|
30
|
+
gitArgs: string[];
|
|
31
|
+
/** Pathspecs limiting what is discarded; empty means the whole tree. */
|
|
32
|
+
pathspecs: string[];
|
|
33
|
+
/** checkout with one operand that may be a branch rather than a path. */
|
|
34
|
+
maybeRef?: string;
|
|
35
|
+
/** clean: also/only removes ignored files (`-x` / `-X`). */
|
|
36
|
+
ignored?: "also" | "only";
|
|
37
|
+
/** clean: `-d` also removes untracked directories. */
|
|
38
|
+
directories?: boolean;
|
|
39
|
+
/** branch -D targets; stash drop target. */
|
|
40
|
+
refs: string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parse `command` and return every git invocation in it that can destroy
|
|
44
|
+
* work, with the directory each would run in. Pure apart from `existsSync`
|
|
45
|
+
* for ambiguous `git checkout <name>`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function findDestructiveGitCommands(command: string, cwd: string): DestructiveGitMatch[];
|
|
48
|
+
export interface DestructiveGitCheckOptions {
|
|
49
|
+
/** The tool's working directory. */
|
|
50
|
+
cwd: string;
|
|
51
|
+
/**
|
|
52
|
+
* The shell's real current directory when it can differ from `cwd`
|
|
53
|
+
* (persistent session shell after a `cd`). Only called when the command
|
|
54
|
+
* contains a destructive git invocation.
|
|
55
|
+
*/
|
|
56
|
+
resolveCwd?: () => Promise<string | null>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns a block message for the model when `command` would destroy
|
|
60
|
+
* uncommitted work (or force-push), or null to let it run.
|
|
61
|
+
*/
|
|
62
|
+
export declare function checkDestructiveGit(command: string, options: DestructiveGitCheckOptions): Promise<string | null>;
|
|
63
|
+
export {};
|