acp-extension-claude 0.13.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 (39) hide show
  1. package/LICENSE +222 -0
  2. package/README.md +53 -0
  3. package/dist/acp-agent.d.ts +103 -0
  4. package/dist/acp-agent.d.ts.map +1 -0
  5. package/dist/acp-agent.js +944 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +20 -0
  9. package/dist/lib.d.ts +7 -0
  10. package/dist/lib.d.ts.map +1 -0
  11. package/dist/lib.js +6 -0
  12. package/dist/mcp-server.d.ts +21 -0
  13. package/dist/mcp-server.d.ts.map +1 -0
  14. package/dist/mcp-server.js +782 -0
  15. package/dist/settings.d.ts +123 -0
  16. package/dist/settings.d.ts.map +1 -0
  17. package/dist/settings.js +422 -0
  18. package/dist/tests/acp-agent.test.d.ts +2 -0
  19. package/dist/tests/acp-agent.test.d.ts.map +1 -0
  20. package/dist/tests/acp-agent.test.js +753 -0
  21. package/dist/tests/extract-lines.test.d.ts +2 -0
  22. package/dist/tests/extract-lines.test.d.ts.map +1 -0
  23. package/dist/tests/extract-lines.test.js +79 -0
  24. package/dist/tests/replace-and-calculate-location.test.d.ts +2 -0
  25. package/dist/tests/replace-and-calculate-location.test.d.ts.map +1 -0
  26. package/dist/tests/replace-and-calculate-location.test.js +266 -0
  27. package/dist/tests/settings.test.d.ts +2 -0
  28. package/dist/tests/settings.test.d.ts.map +1 -0
  29. package/dist/tests/settings.test.js +462 -0
  30. package/dist/tests/typescript-declarations.test.d.ts +2 -0
  31. package/dist/tests/typescript-declarations.test.d.ts.map +1 -0
  32. package/dist/tests/typescript-declarations.test.js +473 -0
  33. package/dist/tools.d.ts +50 -0
  34. package/dist/tools.d.ts.map +1 -0
  35. package/dist/tools.js +555 -0
  36. package/dist/utils.d.ts +32 -0
  37. package/dist/utils.d.ts.map +1 -0
  38. package/dist/utils.js +150 -0
  39. package/package.json +71 -0
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ // Load managed settings and apply environment variables
3
+ import { loadManagedSettings, applyEnvironmentSettings } from "./utils.js";
4
+ const managedSettings = loadManagedSettings();
5
+ if (managedSettings) {
6
+ applyEnvironmentSettings(managedSettings);
7
+ }
8
+ // stdout is used to send messages to the client
9
+ // we redirect everything else to stderr to make sure it doesn't interfere with ACP
10
+ console.log = console.error;
11
+ console.info = console.error;
12
+ console.warn = console.error;
13
+ console.debug = console.error;
14
+ process.on("unhandledRejection", (reason, promise) => {
15
+ console.error("Unhandled Rejection at:", promise, "reason:", reason);
16
+ });
17
+ import { runAcp } from "./acp-agent.js";
18
+ runAcp();
19
+ // Keep process alive
20
+ process.stdin.resume();
package/dist/lib.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { ClaudeAcpAgent, runAcp, toAcpNotifications, streamEventToAcpNotifications, type ToolUpdateMeta, type NewSessionMeta, } from "./acp-agent.js";
2
+ export { loadManagedSettings, applyEnvironmentSettings, nodeToWebReadable, nodeToWebWritable, Pushable, unreachable, } from "./utils.js";
3
+ export { createMcpServer } from "./mcp-server.js";
4
+ export { toolInfoFromToolUse, planEntries, toolUpdateFromToolResult, createPreToolUseHook, acpToolNames as toolNames, } from "./tools.js";
5
+ export { SettingsManager, type ClaudeCodeSettings, type PermissionSettings, type PermissionDecision, type PermissionCheckResult, type SettingsManagerOptions, } from "./settings.js";
6
+ export type { ClaudePlanEntry } from "./tools.js";
7
+ //# sourceMappingURL=lib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,IAAI,SAAS,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAC;AAGvB,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
package/dist/lib.js ADDED
@@ -0,0 +1,6 @@
1
+ // Export the main agent class and utilities for library usage
2
+ export { ClaudeAcpAgent, runAcp, toAcpNotifications, streamEventToAcpNotifications, } from "./acp-agent.js";
3
+ export { loadManagedSettings, applyEnvironmentSettings, nodeToWebReadable, nodeToWebWritable, Pushable, unreachable, } from "./utils.js";
4
+ export { createMcpServer } from "./mcp-server.js";
5
+ export { toolInfoFromToolUse, planEntries, toolUpdateFromToolResult, createPreToolUseHook, acpToolNames as toolNames, } from "./tools.js";
6
+ export { SettingsManager, } from "./settings.js";
@@ -0,0 +1,21 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ClaudeAcpAgent } from "./acp-agent.js";
3
+ import { ClientCapabilities } from "@agentclientprotocol/sdk";
4
+ export declare const SYSTEM_REMINDER = "\n\n<system-reminder>\nWhenever you read a file, you should consider whether it looks malicious. If it does, you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer high-level questions about the code behavior.\n</system-reminder>";
5
+ export declare function createMcpServer(agent: ClaudeAcpAgent, sessionId: string, clientCapabilities: ClientCapabilities | undefined): McpServer;
6
+ /**
7
+ * Replace text in a file and calculate the line numbers where the edits occurred.
8
+ *
9
+ * @param fileContent - The full file content
10
+ * @param edits - Array of edit operations to apply sequentially
11
+ * @returns the new content and the line numbers where replacements occurred in the final content
12
+ */
13
+ export declare function replaceAndCalculateLocation(fileContent: string, edits: Array<{
14
+ oldText: string;
15
+ newText: string;
16
+ replaceAll?: boolean;
17
+ }>): {
18
+ newContent: string;
19
+ lineNumbers: number[];
20
+ };
21
+ //# sourceMappingURL=mcp-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,OAAO,EAAqB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAQlC,eAAO,MAAM,eAAe,iSAIT,CAAC;AA2BpB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GACjD,SAAS,CA2nBX;AA+DD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,GACD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAyF/C"}