@andreprado/agentkit 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (142) hide show
  1. package/README.md +68 -6
  2. package/docs/guides/add-channel.md +189 -7
  3. package/docs/guides/add-knowledge.md +144 -0
  4. package/docs/guides/add-managed-composio.md +163 -0
  5. package/docs/guides/add-tool.md +1 -1
  6. package/docs/guides/channel-security.md +128 -32
  7. package/docs/guides/connect-discord.md +178 -0
  8. package/docs/guides/connect-slack.md +126 -0
  9. package/docs/guides/connect-telegram.md +78 -1
  10. package/docs/guides/connect-whatsapp-evolution.md +121 -0
  11. package/docs/guides/connect-whatsapp-uazapi.md +126 -0
  12. package/docs/guides/connect-whatsapp-zapster.md +112 -8
  13. package/docs/guides/create-agent.md +45 -4
  14. package/docs/guides/debug-channel.md +147 -0
  15. package/docs/guides/improve-from-production.md +151 -0
  16. package/docs/guides/prepare-deploy.md +47 -17
  17. package/docs/guides/replay-production-traces.md +72 -0
  18. package/docs/guides/run-evals.md +147 -20
  19. package/docs/guides/security-rules.md +7 -6
  20. package/docs/guides/send-feedback.md +135 -0
  21. package/docs/guides/use-provider.md +27 -3
  22. package/docs/llms-full.txt +348 -55
  23. package/docs/llms.txt +62 -7
  24. package/package.json +2 -5
  25. package/src/cli/args.ts +57 -0
  26. package/src/cli/cloud-client.ts +377 -0
  27. package/src/cli/commands/channels.ts +1586 -0
  28. package/src/cli/commands/feedback.ts +438 -0
  29. package/src/cli/commands/knowledge.ts +136 -0
  30. package/src/cli/commands/transcribe.ts +171 -0
  31. package/src/cli/constants.ts +4 -0
  32. package/src/cli/deploy-chat-ui.ts +535 -0
  33. package/src/cli/deploy-readiness.ts +481 -0
  34. package/src/cli/flags.ts +162 -0
  35. package/src/cli/help.ts +236 -0
  36. package/src/cli/index.ts +1167 -1005
  37. package/src/cli/process.ts +31 -0
  38. package/src/cloud/artifact.ts +139 -0
  39. package/src/cloud/client.ts +80 -0
  40. package/src/cloud/contracts.ts +63 -0
  41. package/src/cloud/index.ts +3 -0
  42. package/src/create-project.ts +21 -6
  43. package/src/index.ts +517 -8
  44. package/src/providers/pi.ts +70 -16
  45. package/src/providers/test.ts +88 -1
  46. package/src/providers/types.ts +7 -0
  47. package/src/runtime/channel-buffer.ts +30 -0
  48. package/src/runtime/channel-test-harness.ts +21 -1
  49. package/src/runtime/channels/discord.ts +896 -0
  50. package/src/runtime/channels/generic-webhook.ts +225 -0
  51. package/src/runtime/channels/slack.ts +646 -0
  52. package/src/runtime/channels/telegram.ts +466 -23
  53. package/src/runtime/channels/whatsapp-evolution.ts +1357 -0
  54. package/src/runtime/channels/whatsapp-meta.ts +9 -0
  55. package/src/runtime/channels/whatsapp-uazapi.ts +1327 -0
  56. package/src/runtime/channels/whatsapp-zapster.ts +677 -40
  57. package/src/runtime/channels.ts +87 -4
  58. package/src/runtime/chat.ts +130 -38
  59. package/src/runtime/config.ts +519 -19
  60. package/src/runtime/core/manifest.ts +103 -5
  61. package/src/runtime/core/targets.ts +5 -5
  62. package/src/runtime/database.ts +93 -2
  63. package/src/runtime/db-commands.ts +9 -0
  64. package/src/runtime/deploy-readiness.ts +46 -4
  65. package/src/runtime/deploy.ts +1 -1
  66. package/src/runtime/dev-server.ts +779 -45
  67. package/src/runtime/env.ts +8 -3
  68. package/src/runtime/evals.ts +589 -43
  69. package/src/runtime/improve.ts +868 -0
  70. package/src/runtime/inspect.ts +194 -4
  71. package/src/runtime/integrations/composio.ts +423 -0
  72. package/src/runtime/knowledge/chunk.ts +333 -0
  73. package/src/runtime/knowledge/config.ts +135 -0
  74. package/src/runtime/knowledge/embeddings.ts +133 -0
  75. package/src/runtime/knowledge/ingest.ts +521 -0
  76. package/src/runtime/knowledge/prompt-policy.ts +30 -0
  77. package/src/runtime/knowledge/retrieve.ts +303 -0
  78. package/src/runtime/knowledge/schema.ts +100 -0
  79. package/src/runtime/knowledge/tool.ts +64 -0
  80. package/src/runtime/knowledge/vector.ts +258 -0
  81. package/src/runtime/prompt-context.ts +141 -0
  82. package/src/runtime/runtime-contract.ts +86 -8
  83. package/src/runtime/skills.ts +95 -0
  84. package/src/runtime/spec.ts +152 -0
  85. package/src/runtime/sync.ts +144 -0
  86. package/src/runtime/targets/cloudflare/build.ts +1468 -203
  87. package/src/runtime/targets/container/server.ts +1 -1
  88. package/src/runtime/targets/vps/deploy.ts +26 -9
  89. package/src/runtime/tool-runner.ts +9 -1
  90. package/src/runtime/tools.ts +128 -2
  91. package/src/runtime/traces.ts +41 -0
  92. package/src/runtime/transcription.ts +483 -0
  93. package/src/storage/sqlite.ts +149 -3
  94. package/src/templates/blank.ts +76 -17
  95. package/src/templates/dentista.ts +1011 -0
  96. package/src/templates/index.ts +2 -0
  97. package/src/templates/skills/agentkit-build-agent/SKILL.md +52 -0
  98. package/src/templates/skills/agentkit-build-agent/templates/appointment-intake.instructions.md +21 -0
  99. package/src/templates/skills/agentkit-build-agent/templates/sales-qualifier.instructions.md +17 -0
  100. package/src/templates/skills/agentkit-build-agent/templates/support-agent.instructions.md +16 -0
  101. package/src/templates/skills/agentkit-capsule/SKILL.md +70 -0
  102. package/src/templates/skills/agentkit-capsule/references/docs-router.md +15 -0
  103. package/src/templates/skills/agentkit-channels/SKILL.md +127 -0
  104. package/src/templates/skills/agentkit-channels/references/channel-buffering.md +65 -0
  105. package/src/templates/skills/agentkit-channels/references/channel-debugging.md +66 -0
  106. package/src/templates/skills/agentkit-channels/references/discord.md +93 -0
  107. package/src/templates/skills/agentkit-channels/references/slack.md +56 -0
  108. package/src/templates/skills/agentkit-channels/references/telegram.md +72 -0
  109. package/src/templates/skills/agentkit-channels/references/whatsapp-evolution.md +57 -0
  110. package/src/templates/skills/agentkit-channels/references/whatsapp-uazapi.md +61 -0
  111. package/src/templates/skills/agentkit-channels/references/whatsapp-zapster.md +77 -0
  112. package/src/templates/skills/agentkit-database/SKILL.md +45 -0
  113. package/src/templates/skills/agentkit-database/templates/appointments.schema.sql +15 -0
  114. package/src/templates/skills/agentkit-database/templates/leads.schema.sql +17 -0
  115. package/src/templates/skills/agentkit-deploy/SKILL.md +50 -0
  116. package/src/templates/skills/agentkit-evals/SKILL.md +109 -0
  117. package/src/templates/skills/agentkit-evals/templates/multi-turn.eval.md +29 -0
  118. package/src/templates/skills/agentkit-evals/templates/no-leak.eval.md +18 -0
  119. package/src/templates/skills/agentkit-evals/templates/smoke.eval.md +18 -0
  120. package/src/templates/skills/agentkit-evals/templates/tool-call.eval.md +27 -0
  121. package/src/templates/skills/agentkit-improve/SKILL.md +86 -0
  122. package/src/templates/skills/agentkit-improve/references/replay-side-effects.md +18 -0
  123. package/src/templates/skills/agentkit-improve/references/trace-packets.md +22 -0
  124. package/src/templates/skills/agentkit-improve/templates/regression.eval.md +18 -0
  125. package/src/templates/skills/agentkit-integrations/SKILL.md +76 -0
  126. package/src/templates/skills/agentkit-knowledge/SKILL.md +43 -0
  127. package/src/templates/skills/agentkit-knowledge/templates/faq.md +14 -0
  128. package/src/templates/skills/agentkit-knowledge/templates/policies.md +14 -0
  129. package/src/templates/skills/agentkit-knowledge/templates/prices.csv +3 -0
  130. package/src/templates/skills/agentkit-prompts/SKILL.md +47 -0
  131. package/src/templates/skills/agentkit-prompts/templates/knowledge-grounded-faq.instructions.md +11 -0
  132. package/src/templates/skills/agentkit-provider/SKILL.md +60 -0
  133. package/src/templates/skills/agentkit-security/SKILL.md +56 -0
  134. package/src/templates/skills/agentkit-tools/SKILL.md +37 -0
  135. package/src/templates/skills/agentkit-tools/examples/database-write.tool.md +35 -0
  136. package/src/templates/skills/agentkit-tools/examples/eval-safe-external-action.tool.md +37 -0
  137. package/src/templates/skills/agentkit-tools/examples/lookup-order.tool.md +46 -0
  138. package/src/templates/skills/agentkit-troubleshooting/SKILL.md +76 -0
  139. package/src/templates/support.ts +77 -18
  140. package/docs/guides/channels-production-handoff.md +0 -99
  141. package/docs/portable-deploy-release-checklist.md +0 -41
  142. package/src/runtime/targets/cloudflare/deploy.ts +0 -5475
@@ -0,0 +1,31 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ export function runInheritedCommand(command: string, args: string[], cwd: string): Promise<number> {
4
+ return new Promise((resolvePromise, reject) => {
5
+ const child = spawn(command, args, {
6
+ cwd,
7
+ stdio: "inherit",
8
+ });
9
+
10
+ child.once("error", reject);
11
+ child.once("close", (code) => resolvePromise(code ?? 1));
12
+ });
13
+ }
14
+
15
+ export async function waitForShutdown(stop: () => Promise<void>): Promise<void> {
16
+ await new Promise<void>((resolve) => {
17
+ let stopped = false;
18
+
19
+ const shutdown = () => {
20
+ if (stopped) {
21
+ return;
22
+ }
23
+
24
+ stopped = true;
25
+ void stop().finally(resolve);
26
+ };
27
+
28
+ process.once("SIGINT", shutdown);
29
+ process.once("SIGTERM", shutdown);
30
+ });
31
+ }
@@ -0,0 +1,139 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFile, stat } from "node:fs/promises";
3
+ import { extname, isAbsolute, relative, resolve } from "node:path";
4
+
5
+ import type { AgentBuildResult, AgentManifestWithBundle } from "../runtime/targets/cloudflare/build";
6
+ import { AgentKitError } from "../runtime/errors";
7
+ import type { HostedDeployArtifact } from "./contracts";
8
+
9
+ const HOSTED_KNOWLEDGE_MAX_SOURCE_BYTES = 5 * 1024 * 1024;
10
+ const HOSTED_KNOWLEDGE_MAX_TOTAL_BYTES = 9 * 1024 * 1024;
11
+ const HOSTED_KNOWLEDGE_SUPPORTED_EXTENSIONS = new Set([".md", ".markdown", ".txt", ".csv"]);
12
+
13
+ export async function createHostedDeployArtifact(build: AgentBuildResult): Promise<HostedDeployArtifact> {
14
+ const [manifestSource, workerSource, wranglerSource] = await Promise.all([
15
+ readFile(build.manifestPath, "utf8"),
16
+ readFile(build.workerPath, "utf8"),
17
+ readFile(build.wranglerPath, "utf8"),
18
+ ]);
19
+ const manifest = JSON.parse(manifestSource) as AgentManifestWithBundle;
20
+ const workerSha256 = sha256(workerSource);
21
+
22
+ if (workerSha256 !== build.bundleSha256 || workerSha256 !== manifest.bundle.sha256) {
23
+ throw new AgentKitError("artifact_integrity_error", "Worker SHA-256 does not match the build manifest.");
24
+ }
25
+
26
+ const artifact: HostedDeployArtifact = {
27
+ manifest,
28
+ worker: {
29
+ content_type: "application/javascript",
30
+ source: workerSource,
31
+ sha256: workerSha256,
32
+ },
33
+ wrangler: {
34
+ content_type: "application/json",
35
+ source: wranglerSource,
36
+ },
37
+ };
38
+
39
+ if (build.tursoSchemaPath) {
40
+ const source = await readFile(build.tursoSchemaPath, "utf8");
41
+ artifact.turso_schema = {
42
+ content_type: "text/sql",
43
+ source,
44
+ sha256: sha256(source),
45
+ };
46
+ }
47
+
48
+ if (manifest.knowledge.enabled) {
49
+ artifact.knowledge_sources = await createHostedKnowledgeSources(build.root, manifest);
50
+ }
51
+
52
+ return artifact;
53
+ }
54
+
55
+ async function createHostedKnowledgeSources(
56
+ root: string,
57
+ manifest: AgentManifestWithBundle,
58
+ ): Promise<NonNullable<HostedDeployArtifact["knowledge_sources"]>> {
59
+ const sources: NonNullable<HostedDeployArtifact["knowledge_sources"]>["sources"] = [];
60
+ let totalBytes = 0;
61
+
62
+ for (const source of manifest.knowledge.sources) {
63
+ if (source.kind === "url") {
64
+ throw new AgentKitError(
65
+ "artifact_knowledge_source_unsupported",
66
+ "Hosted deploy can automatically sync local Knowledge files only. URL Knowledge sources require a hosted ingestion connector.",
67
+ );
68
+ }
69
+
70
+ const absolutePath = resolve(root, source.value);
71
+ const sourceKey = capsuleRelativePath(root, absolutePath);
72
+ const extension = extname(sourceKey).toLowerCase();
73
+
74
+ if (!HOSTED_KNOWLEDGE_SUPPORTED_EXTENSIONS.has(extension)) {
75
+ throw new AgentKitError(
76
+ "artifact_knowledge_source_unsupported",
77
+ `Knowledge source "${sourceKey}" is not supported for hosted deploy. Use .md, .txt, or .csv.`,
78
+ );
79
+ }
80
+
81
+ const stats = await stat(absolutePath).catch((error) => {
82
+ throw new AgentKitError("artifact_knowledge_source_missing", `Knowledge source "${sourceKey}" was not found.`, {
83
+ cause: error,
84
+ });
85
+ });
86
+
87
+ if (!stats.isFile()) {
88
+ throw new AgentKitError("artifact_knowledge_source_invalid", `Knowledge source "${sourceKey}" must be a file.`);
89
+ }
90
+
91
+ if (stats.size > HOSTED_KNOWLEDGE_MAX_SOURCE_BYTES) {
92
+ throw new AgentKitError(
93
+ "artifact_knowledge_source_too_large",
94
+ `Knowledge source "${sourceKey}" is too large for automatic deploy sync. Keep each source under 5MB.`,
95
+ );
96
+ }
97
+
98
+ totalBytes += stats.size;
99
+
100
+ if (totalBytes > HOSTED_KNOWLEDGE_MAX_TOTAL_BYTES) {
101
+ throw new AgentKitError(
102
+ "artifact_knowledge_sources_too_large",
103
+ "Knowledge sources are too large for automatic deploy sync. Keep total packaged Knowledge under 9MB.",
104
+ );
105
+ }
106
+
107
+ const content = await readFile(absolutePath, "utf8");
108
+ sources.push({
109
+ kind: "file",
110
+ source_key: sourceKey,
111
+ title: source.title,
112
+ content,
113
+ sha256: sha256(content),
114
+ });
115
+ }
116
+
117
+ return {
118
+ content_type: "application/json",
119
+ sources,
120
+ sha256: sha256(JSON.stringify(sources)),
121
+ };
122
+ }
123
+
124
+ function capsuleRelativePath(root: string, absolutePath: string): string {
125
+ const relativePath = relative(root, absolutePath);
126
+
127
+ if (!relativePath || relativePath.startsWith("..") || isAbsolute(relativePath)) {
128
+ throw new AgentKitError(
129
+ "artifact_knowledge_source_outside_capsule",
130
+ "Knowledge source paths must stay inside the Agent Capsule.",
131
+ );
132
+ }
133
+
134
+ return relativePath.split("\\").join("/");
135
+ }
136
+
137
+ function sha256(source: string): string {
138
+ return createHash("sha256").update(source).digest("hex");
139
+ }
@@ -0,0 +1,80 @@
1
+ import { chmod, mkdir, writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+
4
+ import type { AgentBuildResult } from "../runtime/targets/cloudflare/build";
5
+ import type { LocalDeployState } from "../runtime/core/deploy-state";
6
+ import { AgentKitError } from "../runtime/errors";
7
+ import { createHostedDeployArtifact } from "./artifact";
8
+ import type { AgentKitCloudDeployOptions, CreateDeployRequest, CreateDeployResponse } from "./contracts";
9
+
10
+ export async function deployBuildToAgentKitCloud(
11
+ build: AgentBuildResult,
12
+ options: AgentKitCloudDeployOptions,
13
+ ): Promise<CreateDeployResponse> {
14
+ const artifact = await createHostedDeployArtifact(build);
15
+ const headers = new Headers({
16
+ "Content-Type": "application/json",
17
+ });
18
+ const apiToken = options.anonymous ? undefined : options.apiToken ?? process.env.AGENTKIT_CLOUD_API_TOKEN;
19
+
20
+ if (apiToken) {
21
+ headers.set("Authorization", `Bearer ${apiToken}`);
22
+ }
23
+
24
+ const response = await fetch(new URL("/v1/deploys", normalizeApiUrl(options.apiUrl)), {
25
+ method: "POST",
26
+ headers,
27
+ body: JSON.stringify({
28
+ project_name: artifact.manifest.name,
29
+ anonymous: options.anonymous ?? !apiToken,
30
+ artifact,
31
+ } satisfies CreateDeployRequest),
32
+ });
33
+ const payload = await response.json().catch(() => null);
34
+
35
+ if (!response.ok) {
36
+ const code =
37
+ payload && typeof payload === "object" && "error" in payload
38
+ ? String((payload as { error?: { code?: unknown } }).error?.code ?? "cloud_deploy_failed")
39
+ : "cloud_deploy_failed";
40
+ const message =
41
+ payload && typeof payload === "object" && "error" in payload
42
+ ? String((payload as { error?: { message?: unknown } }).error?.message ?? "AgentKit Cloud deploy failed.")
43
+ : `AgentKit Cloud deploy failed with HTTP ${response.status}.`;
44
+ throw new AgentKitError(code, message);
45
+ }
46
+
47
+ return payload as CreateDeployResponse;
48
+ }
49
+
50
+ export async function writeLocalDeployState(root: string, deploy: CreateDeployResponse): Promise<string> {
51
+ const statePath = join(root, ".agentkit/deploy.json");
52
+ const state: LocalDeployState = {
53
+ project_id: deploy.project.id,
54
+ deploy_id: deploy.deploy.id,
55
+ url: deploy.deploy.url,
56
+ target: "cloudflare",
57
+ runtime: "edge",
58
+ resources: {
59
+ cloudflare: {
60
+ worker_url: deploy.deploy.url,
61
+ durable_object_class: "AgentKitConversationStore",
62
+ },
63
+ },
64
+ owner_state: deploy.project.owner_state,
65
+ access: {
66
+ mode: deploy.deploy.access.mode,
67
+ private_token: deploy.deploy.access.private_token ?? undefined,
68
+ },
69
+ created_at: new Date().toISOString(),
70
+ };
71
+
72
+ await mkdir(join(root, ".agentkit"), { recursive: true });
73
+ await writeFile(statePath, `${JSON.stringify(state, null, 2)}\n`, { mode: 0o600 });
74
+ await chmod(statePath, 0o600);
75
+ return statePath;
76
+ }
77
+
78
+ function normalizeApiUrl(value: string): string {
79
+ return value.endsWith("/") ? value : `${value}/`;
80
+ }
@@ -0,0 +1,63 @@
1
+ import type { AgentManifestWithBundle } from "../runtime/targets/cloudflare/build";
2
+
3
+ export type HostedDeployArtifact = {
4
+ manifest: AgentManifestWithBundle;
5
+ worker: {
6
+ content_type: "application/javascript";
7
+ source: string;
8
+ sha256: string;
9
+ };
10
+ wrangler: {
11
+ content_type: "application/json";
12
+ source: string;
13
+ };
14
+ turso_schema?: {
15
+ content_type: "text/sql";
16
+ source: string;
17
+ sha256: string;
18
+ };
19
+ knowledge_sources?: {
20
+ content_type: "application/json";
21
+ sources: Array<{
22
+ kind: "file";
23
+ source_key: string;
24
+ title: string | null;
25
+ content: string;
26
+ sha256: string;
27
+ }>;
28
+ sha256: string;
29
+ };
30
+ };
31
+
32
+ export type CreateDeployRequest = {
33
+ project_name: string;
34
+ anonymous: boolean;
35
+ artifact: HostedDeployArtifact;
36
+ };
37
+
38
+ export type CreateDeployResponse = {
39
+ project: {
40
+ id: string;
41
+ owner_state: "anonymous" | "claimed";
42
+ };
43
+ deploy: {
44
+ id: string;
45
+ status: "ready" | "failed";
46
+ url: string;
47
+ access: {
48
+ mode: string;
49
+ private_token?: string;
50
+ };
51
+ knowledge?: {
52
+ enabled: boolean;
53
+ sources: number;
54
+ chunks: number;
55
+ };
56
+ };
57
+ };
58
+
59
+ export type AgentKitCloudDeployOptions = {
60
+ apiUrl: string;
61
+ apiToken?: string | null;
62
+ anonymous?: boolean;
63
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./artifact";
2
+ export * from "./client";
3
+ export * from "./contracts";
@@ -4,6 +4,7 @@ import { basename, dirname, join, resolve } from "node:path";
4
4
  import { promisify } from "node:util";
5
5
  import { fileURLToPath } from "node:url";
6
6
 
7
+ import { loadDefaultSkillFiles } from "./runtime/skills";
7
8
  import { getTemplate } from "./templates";
8
9
 
9
10
  const execFileAsync = promisify(execFile);
@@ -27,9 +28,12 @@ export async function createProject(options: CreateProjectOptions): Promise<Crea
27
28
 
28
29
  const template = getTemplate(options.template);
29
30
  const projectPath = target.path;
30
- const files = template.files(target.name, {
31
- agentkitDependency: await resolveAgentKitDependency(),
32
- });
31
+ const files = [
32
+ ...template.files(target.name, {
33
+ agentkitDependency: await resolveAgentKitDependency(),
34
+ }),
35
+ ...(await loadDefaultSkillFiles()),
36
+ ];
33
37
 
34
38
  if (target.currentDirectory) {
35
39
  await ensureNoFileCollisions(projectPath, files.map((file) => file.path));
@@ -38,8 +42,7 @@ export async function createProject(options: CreateProjectOptions): Promise<Crea
38
42
  }
39
43
 
40
44
  for (const file of files) {
41
- const absolutePath = join(projectPath, file.path);
42
- const directory = absolutePath.slice(0, absolutePath.lastIndexOf("/"));
45
+ const { absolutePath, directory } = resolveProjectFilePath(projectPath, file.path);
43
46
 
44
47
  await mkdir(directory, { recursive: true });
45
48
  await writeFile(absolutePath, file.contents);
@@ -54,6 +57,18 @@ export async function createProject(options: CreateProjectOptions): Promise<Crea
54
57
  };
55
58
  }
56
59
 
60
+ export function resolveProjectFilePath(
61
+ projectPath: string,
62
+ filePath: string,
63
+ pathApi: Pick<typeof import("node:path"), "dirname" | "join"> = { dirname, join },
64
+ ): { absolutePath: string; directory: string } {
65
+ const absolutePath = pathApi.join(projectPath, filePath);
66
+ return {
67
+ absolutePath,
68
+ directory: pathApi.dirname(absolutePath),
69
+ };
70
+ }
71
+
57
72
  function resolveProjectTarget(options: CreateProjectOptions): { name: string; path: string; currentDirectory: boolean } {
58
73
  if (options.name === ".") {
59
74
  const path = resolve(options.cwd);
@@ -111,7 +126,7 @@ async function resolveAgentKitDependency(): Promise<string> {
111
126
 
112
127
  const packageRoot = resolve(moduleDir, "..");
113
128
 
114
- if (await directoryExists(resolve(packageRoot, "../..", ".git"))) {
129
+ if (await pathExists(resolve(packageRoot, "../..", ".git"))) {
115
130
  return `file:${packageRoot}`;
116
131
  }
117
132