@agentknight/sdk 0.9.69 → 0.9.72

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 (28) hide show
  1. package/dist/chunks/{acp-adapter-VJ2OUSBS.js → acp-adapter-PCNN2NAJ.js} +7 -7
  2. package/dist/chunks/{chunk-LA6A4TUM.js → chunk-23BKGY5J.js} +4 -4
  3. package/dist/chunks/{chunk-J63A5OLO.js → chunk-2UHBY25U.js} +1 -1
  4. package/dist/chunks/{chunk-IRYEOV62.js → chunk-36KL4FSH.js} +2 -2
  5. package/dist/chunks/{chunk-2D34UDII.js → chunk-5BDFZ3AS.js} +4 -4
  6. package/dist/chunks/{chunk-F5YCEWE4.js → chunk-5FJJZCP6.js} +680 -629
  7. package/dist/chunks/{chunk-ES2N66EH.js → chunk-DXHAKWGO.js} +2 -2
  8. package/dist/chunks/{chunk-35OF2ZNS.js → chunk-E5VHBC55.js} +14 -0
  9. package/dist/chunks/{chunk-Q5NNNSU2.js → chunk-FQ26TSDG.js} +2 -2
  10. package/dist/chunks/{chunk-MH7FDSTY.js → chunk-GRUDMHEJ.js} +1 -1
  11. package/dist/chunks/{chunk-5QYL6NKJ.js → chunk-I42IONUU.js} +1 -1
  12. package/dist/chunks/{chunk-WAPJZKUK.js → chunk-KPHWVNKP.js} +1 -1
  13. package/dist/chunks/{chunk-LU73CEHE.js → chunk-PAJZL5ST.js} +7 -2
  14. package/dist/chunks/{chunk-ZAU2MYQI.js → chunk-TFUSRA2B.js} +2 -2
  15. package/dist/chunks/chunk-VEJLENEQ.js +174 -0
  16. package/dist/chunks/{chunk-MB34W52S.js → chunk-VOR4AECB.js} +3 -3
  17. package/dist/chunks/{claude-adapter-FZNLF5XN.js → claude-adapter-A4LPYQ2Z.js} +71 -211
  18. package/dist/chunks/{codex-adapter-5ZVOAT6O.js → codex-adapter-AFGS7MPX.js} +7 -7
  19. package/dist/chunks/{copilot-adapter-V6RAQ4WK.js → copilot-adapter-NXJTI2HY.js} +24 -68
  20. package/dist/chunks/{managed-agent-adapter-THUSTKRW.js → managed-agent-adapter-4C2PWD4V.js} +6 -6
  21. package/dist/chunks/{pi-adapter-EHCSR5I2.js → pi-adapter-EZOIK5RA.js} +6 -6
  22. package/dist/configuration.js +4 -4
  23. package/dist/index.d.ts +138 -0
  24. package/dist/index.js +163 -50
  25. package/dist/runtime.js +2 -2
  26. package/dist/session-analytics-worker.js +6 -6
  27. package/package.json +4 -5
  28. package/dist/chunks/chunk-T6226JFS.js +0 -55
@@ -1,55 +0,0 @@
1
- // src/local-agent-discovery.ts
2
- import { constants } from "node:fs";
3
- import { access, stat } from "node:fs/promises";
4
- import { homedir } from "node:os";
5
- import { delimiter, isAbsolute, join } from "node:path";
6
- import { fileURLToPath } from "node:url";
7
- async function accessible(path, executable = false) {
8
- try {
9
- await access(path, executable && process.platform !== "win32" ? constants.X_OK : constants.F_OK);
10
- return (await stat(path)).isFile();
11
- } catch (error) {
12
- if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR")) return false;
13
- throw error;
14
- }
15
- }
16
- async function hasLocalExecutable(command, environment = process.env) {
17
- const extensions = process.platform === "win32" ? ["", ...(environment.PATHEXT ?? ".EXE;.CMD;.BAT").split(";")] : [""];
18
- const paths = isAbsolute(command) || command.includes("/") || command.includes("\\") ? [command] : (environment.PATH ?? "").split(delimiter).filter(Boolean).map((directory) => join(directory, command));
19
- for (const path of paths) {
20
- for (const extension of extensions) {
21
- if (await accessible(`${path}${extension}`, true)) return true;
22
- }
23
- }
24
- return false;
25
- }
26
- async function hasPackage(name) {
27
- try {
28
- return await accessible(fileURLToPath(import.meta.resolve(name)));
29
- } catch (error) {
30
- if (error instanceof Error && "code" in error && error.code === "ERR_MODULE_NOT_FOUND") return false;
31
- throw error;
32
- }
33
- }
34
- async function detectCopilot() {
35
- return process.env.COPILOT_CLI_PATH ? accessible(process.env.COPILOT_CLI_PATH) : await hasPackage("@github/copilot/npm-loader.js") || hasLocalExecutable("copilot");
36
- }
37
- async function detectPi(agentDirectory) {
38
- if (!await hasPackage("@earendil-works/pi-coding-agent")) return false;
39
- const directory = agentDirectory ?? (process.env.PI_CODING_AGENT_DIR || join(homedir(), ".pi", "agent"));
40
- return agentDirectory !== void 0 || await accessible(join(directory, "auth.json")) || await hasLocalExecutable("pi");
41
- }
42
- function hasClaudeProviderConfiguration(environment = process.env) {
43
- return Boolean(environment.ANTHROPIC_API_KEY?.trim()) || ["CLAUDE_CODE_USE_BEDROCK", "CLAUDE_CODE_USE_VERTEX", "CLAUDE_CODE_USE_FOUNDRY"].some((key) => environment[key] === "1");
44
- }
45
- async function detectClaude() {
46
- return hasPackage("@anthropic-ai/claude-agent-sdk");
47
- }
48
-
49
- export {
50
- hasLocalExecutable,
51
- detectCopilot,
52
- detectPi,
53
- hasClaudeProviderConfiguration,
54
- detectClaude
55
- };