codeep 3.3.3 → 3.4.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.
Files changed (79) hide show
  1. package/dist/acp/commands.d.ts +50 -1
  2. package/dist/acp/commands.js +545 -109
  3. package/dist/acp/protocol.d.ts +14 -5
  4. package/dist/acp/server.d.ts +36 -1
  5. package/dist/acp/server.js +581 -155
  6. package/dist/acp/serverHandlers.d.ts +2 -1
  7. package/dist/acp/serverHandlers.js +3 -0
  8. package/dist/acp/session.d.ts +28 -2
  9. package/dist/acp/session.js +25 -6
  10. package/dist/acp/transport.d.ts +40 -4
  11. package/dist/acp/transport.js +218 -25
  12. package/dist/acp/turns.d.ts +20 -0
  13. package/dist/acp/turns.js +30 -0
  14. package/dist/api/index.js +2 -0
  15. package/dist/api/ollamaNative.d.ts +3 -0
  16. package/dist/api/ollamaNative.js +35 -3
  17. package/dist/config/index.d.ts +21 -4
  18. package/dist/config/index.js +178 -123
  19. package/dist/renderer/agentExecution.d.ts +30 -2
  20. package/dist/renderer/agentExecution.js +248 -92
  21. package/dist/renderer/commands/helpers.d.ts +18 -2
  22. package/dist/renderer/commands/helpers.js +28 -5
  23. package/dist/renderer/commands.d.ts +2 -0
  24. package/dist/renderer/commands.js +180 -64
  25. package/dist/renderer/main.d.ts +41 -0
  26. package/dist/renderer/main.js +181 -80
  27. package/dist/utils/agent.d.ts +69 -4
  28. package/dist/utils/agent.js +416 -248
  29. package/dist/utils/agentChat.js +82 -10
  30. package/dist/utils/agents.d.ts +2 -1
  31. package/dist/utils/agents.js +100 -29
  32. package/dist/utils/auditLog.d.ts +4 -3
  33. package/dist/utils/auditLog.js +92 -9
  34. package/dist/utils/checkpoints.js +11 -6
  35. package/dist/utils/codeReview.js +28 -23
  36. package/dist/utils/codeepCloud.d.ts +14 -2
  37. package/dist/utils/codeepCloud.js +56 -20
  38. package/dist/utils/customCommands.js +7 -2
  39. package/dist/utils/git.d.ts +262 -4
  40. package/dist/utils/git.js +1928 -61
  41. package/dist/utils/gitHookInstaller.d.ts +32 -1
  42. package/dist/utils/gitHookInstaller.js +76 -8
  43. package/dist/utils/gitignore.d.ts +8 -0
  44. package/dist/utils/gitignore.js +41 -10
  45. package/dist/utils/headlessReview.d.ts +11 -0
  46. package/dist/utils/headlessReview.js +33 -5
  47. package/dist/utils/history.d.ts +22 -6
  48. package/dist/utils/history.js +140 -26
  49. package/dist/utils/logger.js +6 -7
  50. package/dist/utils/mcpConfig.d.ts +24 -0
  51. package/dist/utils/mcpConfig.js +36 -5
  52. package/dist/utils/mentions.d.ts +28 -5
  53. package/dist/utils/mentions.js +253 -45
  54. package/dist/utils/personalities.js +16 -6
  55. package/dist/utils/planMode.d.ts +13 -7
  56. package/dist/utils/planMode.js +32 -12
  57. package/dist/utils/projectIntelligence.d.ts +2 -0
  58. package/dist/utils/projectIntelligence.js +27 -8
  59. package/dist/utils/projectPaths.d.ts +53 -0
  60. package/dist/utils/projectPaths.js +146 -0
  61. package/dist/utils/shell.d.ts +119 -0
  62. package/dist/utils/shell.js +417 -45
  63. package/dist/utils/skillBundles.js +17 -7
  64. package/dist/utils/skillBundlesCloud.js +20 -3
  65. package/dist/utils/skills.d.ts +24 -2
  66. package/dist/utils/skills.js +235 -43
  67. package/dist/utils/smartContext.js +97 -23
  68. package/dist/utils/telegramApproval.d.ts +10 -2
  69. package/dist/utils/telegramApproval.js +22 -4
  70. package/dist/utils/toolExecution.d.ts +50 -2
  71. package/dist/utils/toolExecution.js +418 -16
  72. package/dist/utils/toolParsing.d.ts +7 -1
  73. package/dist/utils/toolParsing.js +12 -3
  74. package/dist/utils/userProfile.js +58 -16
  75. package/dist/utils/verify.d.ts +25 -4
  76. package/dist/utils/verify.js +259 -74
  77. package/dist/version.d.ts +1 -1
  78. package/dist/version.js +1 -1
  79. package/package.json +1 -1
@@ -1,4 +1,6 @@
1
1
  import { Message } from '../config/index.js';
2
+ import type { McpServer } from './protocol.js';
3
+ import type { AgentSessionOptions } from './session.js';
2
4
  export interface AcpSession {
3
5
  sessionId: string;
4
6
  workspaceRoot: string;
@@ -11,7 +13,37 @@ export interface AcpSession {
11
13
  relativePath: string;
12
14
  content: string;
13
15
  }>;
16
+ /** MCP servers the client passed on session/new, load or resume. */
17
+ clientMcpServers?: McpServer[];
18
+ /** Bumped whenever the thread moves to another conversation (/session
19
+ * new, /session load, /rewind), so a turn still running can tell. */
20
+ conversation?: number;
14
21
  }
22
+ /**
23
+ * How the agent runs for the current prompt: the session mode's permission
24
+ * prompts and the client's fs and terminal. The server builds it once per
25
+ * prompt so a slash command that runs the agent gets what a plain prompt
26
+ * gets.
27
+ */
28
+ export type AcpAgentRunOptions = Pick<AgentSessionOptions, 'onRequestPermission' | 'extraDangerousTools' | 'onExecuteCommand' | 'fs'> & {
29
+ /** Ask the user a yes/no question. Unset: the mode runs without asking. */
30
+ confirm?: (message: string) => Promise<boolean>;
31
+ /**
32
+ * Auto mode's answer to the agent's permission gate: yes to everything
33
+ * except a write to a file that decides what runs later, which is asked
34
+ * about in every mode. A command that runs the agent passes it in place of
35
+ * the missing `onRequestPermission`, because the agent refuses those writes
36
+ * outright when it has nobody to ask — so without this, /go and a skill's
37
+ * agent step could not touch `.git/config` at all in auto mode, while a
38
+ * plain prompt could after a confirmation.
39
+ *
40
+ * Kept under its own key rather than set on `onRequestPermission`, which
41
+ * this file reads as "this session asks the user" when it decides whether
42
+ * to gate a skill's shell lines. Auto mode runs those without asking, as
43
+ * that mode promises.
44
+ */
45
+ onAutoModePermission?: AgentSessionOptions['onRequestPermission'];
46
+ };
15
47
  export interface CommandResult {
16
48
  /** true if the input was a slash command (even if it failed) */
17
49
  handled: boolean;
@@ -48,5 +80,22 @@ export declare function loadWorkspace(workspaceRoot: string, acpSessionId: strin
48
80
  *
49
81
  * onChunk is called for streaming output (skills). For simple commands
50
82
  * the full response is returned in CommandResult.response.
83
+ *
84
+ * agentRun carries the options commands that run the agent (/go, custom
85
+ * commands, skill agent steps) must run it with.
86
+ */
87
+ export declare function handleCommand(input: string, session: AcpSession, onChunk: (text: string) => void, abortSignal?: AbortSignal, agentRun?: AcpAgentRunOptions): Promise<CommandResult>;
88
+ /**
89
+ * Split a skill's shell line into the simple commands it runs, each as
90
+ * argv, so every one of them can go through the execute_command policy.
91
+ * `&&`, `||`, `;`, `|` and newlines separate commands. Redirections stay
92
+ * with their command as arguments (`2>&1`, `>`, `out.txt`), so the policy
93
+ * sees where output goes. Returns null for a line it cannot read with
94
+ * certainty — unbalanced quotes, subshells, background jobs, heredocs, and
95
+ * anything the shell would expand first (`$`, backticks, globs, braces, a
96
+ * leading `~`) — which the caller must refuse. So a `$` or backtick in the
97
+ * result is always plain text.
98
+ *
99
+ * Exported for unit testing (see commands.slash.test.ts).
51
100
  */
52
- export declare function handleCommand(input: string, session: AcpSession, onChunk: (text: string) => void, abortSignal?: AbortSignal): Promise<CommandResult>;
101
+ export declare function splitShellCommands(line: string, windows?: boolean): string[][] | null;