@andreprado/agentkit 0.1.0-alpha.9 → 0.1.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/README.md +18 -1
- package/docs/guides/add-channel.md +251 -7
- package/docs/guides/add-knowledge.md +10 -0
- package/docs/guides/add-managed-composio.md +165 -0
- package/docs/guides/add-tool.md +10 -3
- package/docs/guides/channel-security.md +162 -32
- package/docs/guides/connect-discord.md +178 -0
- package/docs/guides/connect-slack.md +126 -0
- package/docs/guides/connect-telegram.md +61 -1
- package/docs/guides/connect-whatsapp-evolution.md +121 -0
- package/docs/guides/connect-whatsapp-uazapi.md +139 -0
- package/docs/guides/connect-whatsapp-zapster.md +119 -16
- package/docs/guides/create-agent.md +31 -4
- package/docs/guides/debug-channel.md +159 -0
- package/docs/guides/improve-from-production.md +151 -0
- package/docs/guides/prepare-deploy.md +32 -14
- package/docs/guides/replay-production-traces.md +72 -0
- package/docs/guides/run-evals.md +95 -25
- package/docs/guides/security-rules.md +9 -5
- package/docs/guides/send-feedback.md +135 -0
- package/docs/guides/use-jev.md +67 -0
- package/docs/guides/use-provider.md +70 -3
- package/docs/llms-full.txt +295 -25
- package/docs/llms.txt +54 -7
- package/package.json +3 -7
- package/src/cli/args.ts +23 -2
- package/src/cli/cloud-client.ts +121 -9
- package/src/cli/commands/channels.ts +856 -36
- package/src/cli/commands/feedback.ts +438 -0
- package/src/cli/commands/provider.ts +47 -0
- package/src/cli/commands/transcribe.ts +171 -0
- package/src/cli/deploy-chat-ui.ts +232 -18
- package/src/cli/deploy-readiness.ts +227 -14
- package/src/cli/help.ts +67 -9
- package/src/cli/index.ts +740 -35
- package/src/cli/new-command.ts +41 -0
- package/src/cloud/client.ts +4 -3
- package/src/cloud/contracts.ts +1 -1
- package/src/create-project.ts +18 -35
- package/src/index.ts +565 -11
- package/src/providers/codex-auth.ts +111 -0
- package/src/providers/pi.ts +88 -19
- package/src/providers/test.ts +36 -0
- package/src/providers/types.ts +8 -0
- package/src/runtime/channel-test-harness.ts +21 -1
- package/src/runtime/channels/discord.ts +904 -0
- package/src/runtime/channels/generic-webhook.ts +682 -0
- package/src/runtime/channels/net-guard.ts +480 -0
- package/src/runtime/channels/provider-fetch.ts +54 -0
- package/src/runtime/channels/slack.ts +652 -0
- package/src/runtime/channels/telegram.ts +379 -15
- package/src/runtime/channels/whatsapp-evolution.ts +1330 -0
- package/src/runtime/channels/whatsapp-meta.ts +9 -0
- package/src/runtime/channels/whatsapp-uazapi.ts +1192 -0
- package/src/runtime/channels/whatsapp-zapster.ts +702 -40
- package/src/runtime/channels.ts +83 -3
- package/src/runtime/chat.ts +70 -44
- package/src/runtime/config.ts +512 -20
- package/src/runtime/core/manifest.ts +75 -5
- package/src/runtime/core/targets.ts +5 -5
- package/src/runtime/deploy-readiness.ts +34 -4
- package/src/runtime/dev-server.ts +639 -39
- package/src/runtime/env.ts +8 -3
- package/src/runtime/evals.ts +445 -74
- package/src/runtime/improve.ts +868 -0
- package/src/runtime/inspect.ts +173 -4
- package/src/runtime/integrations/composio.ts +425 -0
- package/src/runtime/knowledge/embeddings.ts +45 -7
- package/src/runtime/knowledge/ingest.ts +69 -6
- package/src/runtime/knowledge/retrieve.ts +25 -5
- package/src/runtime/knowledge/schema.ts +45 -1
- package/src/runtime/knowledge/vector.ts +30 -30
- package/src/runtime/prompt-context.ts +141 -0
- package/src/runtime/runtime-contract.ts +71 -7
- package/src/runtime/skills.ts +95 -0
- package/src/runtime/targets/cloudflare/build.ts +1010 -208
- package/src/runtime/targets/container/server.ts +1 -1
- package/src/runtime/targets/vps/deploy.ts +26 -9
- package/src/runtime/tool-runner.ts +9 -1
- package/src/runtime/tools.ts +26 -2
- package/src/runtime/transcription.ts +483 -0
- package/src/storage/sqlite.ts +7 -2
- package/src/templates/blank.ts +37 -9
- package/src/templates/dentista.ts +40 -14
- package/src/templates/skills/agentkit-build-agent/SKILL.md +34 -5
- package/src/templates/skills/agentkit-build-agent/templates/appointment-intake.instructions.md +2 -1
- package/src/templates/skills/agentkit-capsule/SKILL.md +32 -3
- package/src/templates/skills/agentkit-capsule/references/docs-router.md +2 -2
- package/src/templates/skills/agentkit-channels/SKILL.md +66 -1
- package/src/templates/skills/agentkit-channels/references/channel-buffering.md +8 -1
- package/src/templates/skills/agentkit-channels/references/channel-debugging.md +28 -3
- package/src/templates/skills/agentkit-channels/references/discord.md +93 -0
- package/src/templates/skills/agentkit-channels/references/slack.md +56 -0
- package/src/templates/skills/agentkit-channels/references/telegram.md +34 -0
- package/src/templates/skills/agentkit-channels/references/whatsapp-evolution.md +57 -0
- package/src/templates/skills/agentkit-channels/references/whatsapp-uazapi.md +54 -0
- package/src/templates/skills/agentkit-channels/references/whatsapp-zapster.md +42 -8
- package/src/templates/skills/agentkit-database/SKILL.md +11 -0
- package/src/templates/skills/agentkit-deploy/SKILL.md +9 -1
- package/src/templates/skills/agentkit-evals/SKILL.md +77 -13
- package/src/templates/skills/agentkit-evals/templates/multi-turn.eval.md +13 -6
- package/src/templates/skills/agentkit-evals/templates/no-leak.eval.md +8 -4
- package/src/templates/skills/agentkit-evals/templates/smoke.eval.md +8 -4
- package/src/templates/skills/agentkit-evals/templates/tool-call.eval.md +16 -7
- package/src/templates/skills/agentkit-improve/SKILL.md +96 -0
- package/src/templates/skills/agentkit-improve/references/replay-side-effects.md +18 -0
- package/src/templates/skills/agentkit-improve/references/trace-packets.md +22 -0
- package/src/templates/skills/agentkit-improve/templates/regression.eval.md +18 -0
- package/src/templates/skills/agentkit-integrations/SKILL.md +98 -0
- package/src/templates/skills/agentkit-knowledge/SKILL.md +4 -1
- package/src/templates/skills/agentkit-prompts/SKILL.md +3 -1
- package/src/templates/skills/agentkit-provider/SKILL.md +29 -4
- package/src/templates/skills/agentkit-security/SKILL.md +5 -2
- package/src/templates/skills/agentkit-tools/SKILL.md +8 -1
- package/src/templates/skills/agentkit-tools/examples/eval-safe-external-action.tool.md +8 -8
- package/src/templates/skills/agentkit-tools/examples/jev-service-fit.tool.md +110 -0
- package/src/templates/skills/agentkit-troubleshooting/SKILL.md +25 -1
- package/src/templates/support.ts +42 -12
- package/docs/guides/agentkit-skills-architecture.md +0 -471
- package/docs/guides/channels-implementation-map.md +0 -243
- package/docs/guides/channels-production-handoff.md +0 -101
- package/docs/portable-deploy-release-checklist.md +0 -41
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { findAgentCapsuleRoot, loadAgentCapsule } from "../runtime/config";
|
|
2
|
-
import {
|
|
3
|
-
import { loadDeployReadinessContext, stableCloudProjectId, type DeployReadinessContext } from "../runtime/deploy-readiness";
|
|
2
|
+
import { loadDeployReadinessContext, type DeployReadinessContext } from "../runtime/deploy-readiness";
|
|
4
3
|
import { loadCapsuleEnv } from "../runtime/env";
|
|
5
4
|
import { isAgentKitError } from "../runtime/errors";
|
|
5
|
+
import { MANAGED_COMPOSIO_API_KEY_SECRET, MANAGED_COMPOSIO_ENTITLEMENT } from "../runtime/integrations/composio";
|
|
6
6
|
import {
|
|
7
7
|
cloudApiRequest,
|
|
8
8
|
formatCloudAuthSource,
|
|
9
|
-
|
|
9
|
+
readCloudAuthForApiUrl,
|
|
10
10
|
type CloudCapabilitiesResponse,
|
|
11
11
|
type CloudLimitsResponse,
|
|
12
|
+
type CloudManagedComposioResponse,
|
|
12
13
|
type CloudMeResponse,
|
|
14
|
+
type CloudProjectResolveResponse,
|
|
13
15
|
type CloudSecretsResponse,
|
|
14
16
|
} from "./cloud-client";
|
|
15
17
|
|
|
@@ -27,6 +29,16 @@ type DeployReadinessReport = {
|
|
|
27
29
|
apiUrl: string;
|
|
28
30
|
context: DeployReadinessContext;
|
|
29
31
|
checks: DeployReadinessCheck[];
|
|
32
|
+
cloudAuth: {
|
|
33
|
+
source?: string;
|
|
34
|
+
accountEmail?: string;
|
|
35
|
+
};
|
|
36
|
+
onlineCapacity: {
|
|
37
|
+
accountUsed?: number;
|
|
38
|
+
accountLimit?: number;
|
|
39
|
+
globalUsed?: number;
|
|
40
|
+
globalLimit?: number;
|
|
41
|
+
};
|
|
30
42
|
};
|
|
31
43
|
|
|
32
44
|
export async function checkDeployReadiness(options: {
|
|
@@ -34,9 +46,15 @@ export async function checkDeployReadiness(options: {
|
|
|
34
46
|
requireLogin: boolean;
|
|
35
47
|
}): Promise<DeployReadinessReport> {
|
|
36
48
|
const context = await loadDeployReadinessContext(process.cwd(), process.env);
|
|
37
|
-
const auth = await
|
|
49
|
+
const auth = options.requireLogin ? await readCloudAuthForApiUrl(options.apiUrl) : null;
|
|
38
50
|
const checks: DeployReadinessCheck[] = [];
|
|
39
51
|
let cloudAuthUsable = false;
|
|
52
|
+
const cloudAuth: DeployReadinessReport["cloudAuth"] = {};
|
|
53
|
+
const onlineCapacity: DeployReadinessReport["onlineCapacity"] = {};
|
|
54
|
+
|
|
55
|
+
if (auth?.token) {
|
|
56
|
+
cloudAuth.source = formatCloudAuthSource(auth);
|
|
57
|
+
}
|
|
40
58
|
|
|
41
59
|
if (context.runtime !== "edge") {
|
|
42
60
|
checks.push({
|
|
@@ -53,6 +71,22 @@ export async function checkDeployReadiness(options: {
|
|
|
53
71
|
});
|
|
54
72
|
}
|
|
55
73
|
|
|
74
|
+
const nodeMajor = majorNodeVersion(process.versions.node);
|
|
75
|
+
if (nodeMajor !== null && nodeMajor < 24) {
|
|
76
|
+
checks.push({
|
|
77
|
+
status: "warn",
|
|
78
|
+
title: "Node version",
|
|
79
|
+
message: `@andreprado/agentkit requires Node >=24; current Node is ${process.versions.node}.`,
|
|
80
|
+
action: "use Node 24+ before running direct node imports or production container commands",
|
|
81
|
+
});
|
|
82
|
+
} else {
|
|
83
|
+
checks.push({
|
|
84
|
+
status: "pass",
|
|
85
|
+
title: "Node version",
|
|
86
|
+
message: `Node ${process.versions.node} satisfies @andreprado/agentkit engines.node >=24.`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
56
90
|
if (!auth?.token) {
|
|
57
91
|
checks.push({
|
|
58
92
|
status: options.requireLogin ? "fail" : "warn",
|
|
@@ -66,6 +100,9 @@ export async function checkDeployReadiness(options: {
|
|
|
66
100
|
try {
|
|
67
101
|
const me = (await cloudApiRequest(options.apiUrl, "/v1/me", { method: "GET" })) as CloudMeResponse;
|
|
68
102
|
const email = me.account?.email;
|
|
103
|
+
if (email) {
|
|
104
|
+
cloudAuth.accountEmail = email;
|
|
105
|
+
}
|
|
69
106
|
checks.push({
|
|
70
107
|
status: "pass",
|
|
71
108
|
title: "Login",
|
|
@@ -82,6 +119,19 @@ export async function checkDeployReadiness(options: {
|
|
|
82
119
|
}
|
|
83
120
|
}
|
|
84
121
|
|
|
122
|
+
if (cloudAuthUsable) {
|
|
123
|
+
try {
|
|
124
|
+
context.projectId = await resolveCloudProjectId(options.apiUrl, context.projectName);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
checks.push({
|
|
127
|
+
status: "fail",
|
|
128
|
+
title: "Project identity",
|
|
129
|
+
message: `Could not resolve the account-scoped AgentKit Cloud project. ${formatReadinessError(error)}`,
|
|
130
|
+
});
|
|
131
|
+
cloudAuthUsable = false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
85
135
|
if (cloudAuthUsable) {
|
|
86
136
|
try {
|
|
87
137
|
const payload = (await cloudApiRequest(options.apiUrl, "/v1/me/capabilities", {
|
|
@@ -91,6 +141,9 @@ export async function checkDeployReadiness(options: {
|
|
|
91
141
|
const hasCloudflareAlpha = capabilities.some(
|
|
92
142
|
(capability) => capability.name === "cloudflare_deploy_alpha" && capability.status === "active",
|
|
93
143
|
);
|
|
144
|
+
const hasManagedComposio = capabilities.some(
|
|
145
|
+
(capability) => capability.name === MANAGED_COMPOSIO_ENTITLEMENT && capability.status === "active",
|
|
146
|
+
);
|
|
94
147
|
|
|
95
148
|
checks.push({
|
|
96
149
|
status: hasCloudflareAlpha ? "pass" : "fail",
|
|
@@ -100,6 +153,17 @@ export async function checkDeployReadiness(options: {
|
|
|
100
153
|
: "This account is missing the cloudflare_deploy_alpha entitlement.",
|
|
101
154
|
...(hasCloudflareAlpha ? {} : { action: "log in with an invited AgentKit Cloud alpha token" }),
|
|
102
155
|
});
|
|
156
|
+
|
|
157
|
+
if (context.integrations.managedComposio.enabled) {
|
|
158
|
+
checks.push({
|
|
159
|
+
status: hasManagedComposio ? "pass" : "fail",
|
|
160
|
+
title: "Managed Composio entitlement",
|
|
161
|
+
message: hasManagedComposio
|
|
162
|
+
? `${MANAGED_COMPOSIO_ENTITLEMENT} is active.`
|
|
163
|
+
: `This capsule uses AgentKit-managed Composio, but this account is missing ${MANAGED_COMPOSIO_ENTITLEMENT}.`,
|
|
164
|
+
...(hasManagedComposio ? {} : { action: "upgrade the AgentKit Cloud account or ask an operator to grant managed_composio" }),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
103
167
|
} catch (error) {
|
|
104
168
|
checks.push({
|
|
105
169
|
status: "fail",
|
|
@@ -119,6 +183,22 @@ export async function checkDeployReadiness(options: {
|
|
|
119
183
|
const globalLimit = normalizeOptionalNumber(global?.limit);
|
|
120
184
|
const globalUsed = normalizeOptionalNumber(global?.used);
|
|
121
185
|
|
|
186
|
+
if (accountLimit !== undefined) {
|
|
187
|
+
onlineCapacity.accountLimit = accountLimit;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (accountUsed !== undefined) {
|
|
191
|
+
onlineCapacity.accountUsed = accountUsed;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (globalLimit !== undefined) {
|
|
195
|
+
onlineCapacity.globalLimit = globalLimit;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (globalUsed !== undefined) {
|
|
199
|
+
onlineCapacity.globalUsed = globalUsed;
|
|
200
|
+
}
|
|
201
|
+
|
|
122
202
|
if (accountLimit !== undefined && accountUsed !== undefined && accountUsed >= accountLimit) {
|
|
123
203
|
checks.push({
|
|
124
204
|
status: "fail",
|
|
@@ -159,6 +239,61 @@ export async function checkDeployReadiness(options: {
|
|
|
159
239
|
message: `Could not verify online deploy capacity. ${formatReadinessError(error)}`,
|
|
160
240
|
});
|
|
161
241
|
}
|
|
242
|
+
|
|
243
|
+
if (context.integrations.managedComposio.enabled) {
|
|
244
|
+
try {
|
|
245
|
+
const payload = (await cloudApiRequest(
|
|
246
|
+
options.apiUrl,
|
|
247
|
+
`/v1/me/managed-composio?toolkits=${encodeURIComponent(context.integrations.managedComposio.toolkits.join(","))}`,
|
|
248
|
+
{
|
|
249
|
+
method: "GET",
|
|
250
|
+
},
|
|
251
|
+
)) as CloudManagedComposioResponse;
|
|
252
|
+
const managed = payload.managed_composio;
|
|
253
|
+
const missingToolkits = (managed?.toolkits ?? []).filter((toolkit) => toolkit.auth_config !== "set");
|
|
254
|
+
|
|
255
|
+
if (managed?.api_key !== "set") {
|
|
256
|
+
checks.push({
|
|
257
|
+
status: "fail",
|
|
258
|
+
title: "Managed Composio API key",
|
|
259
|
+
message: `AgentKit Cloud is missing AGENTKIT_SECRET_${MANAGED_COMPOSIO_API_KEY_SECRET}.`,
|
|
260
|
+
action: "ask the AgentKit Cloud operator to configure managed Composio",
|
|
261
|
+
});
|
|
262
|
+
} else {
|
|
263
|
+
checks.push({
|
|
264
|
+
status: "pass",
|
|
265
|
+
title: "Managed Composio API key",
|
|
266
|
+
message: "AgentKit Cloud has the managed COMPOSIO_API_KEY.",
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (missingToolkits.length > 0) {
|
|
271
|
+
checks.push({
|
|
272
|
+
status: "fail",
|
|
273
|
+
title: "Managed Composio auth configs",
|
|
274
|
+
message: `Missing ${missingToolkits
|
|
275
|
+
.map((toolkit) => `${toolkit.auth_config_env ?? "auth config"} for ${toolkit.toolkit ?? "unknown"}`)
|
|
276
|
+
.join(", ")}.`,
|
|
277
|
+
action: "ask the AgentKit Cloud operator to configure the Composio auth config registry or fallback env",
|
|
278
|
+
});
|
|
279
|
+
} else {
|
|
280
|
+
const toolkitSources = (managed?.toolkits ?? []).map((toolkit) =>
|
|
281
|
+
`${toolkit.toolkit ?? "unknown"}${toolkit.auth_config_source ? ` via ${toolkit.auth_config_source}` : ""}`,
|
|
282
|
+
);
|
|
283
|
+
checks.push({
|
|
284
|
+
status: "pass",
|
|
285
|
+
title: "Managed Composio auth configs",
|
|
286
|
+
message: `Auth configs are available for ${toolkitSources.join(", ")}.`,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
} catch (error) {
|
|
290
|
+
checks.push({
|
|
291
|
+
status: "warn",
|
|
292
|
+
title: "Managed Composio auth configs",
|
|
293
|
+
message: `Could not verify managed Composio auth configs. ${formatReadinessError(error)}`,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
162
297
|
}
|
|
163
298
|
|
|
164
299
|
if (context.agentKitManagedSecrets.length > 0) {
|
|
@@ -171,6 +306,25 @@ export async function checkDeployReadiness(options: {
|
|
|
171
306
|
});
|
|
172
307
|
}
|
|
173
308
|
|
|
309
|
+
if (context.integrations.managedComposio.enabled) {
|
|
310
|
+
if (!options.requireLogin) {
|
|
311
|
+
checks.push({
|
|
312
|
+
status: "fail",
|
|
313
|
+
title: "Managed Composio access",
|
|
314
|
+
message: "AgentKit-managed Composio is paid hosted infrastructure and cannot be used by anonymous deploys.",
|
|
315
|
+
action: "run agentkit deploy without --anonymous after logging in with a paid AgentKit Cloud account",
|
|
316
|
+
});
|
|
317
|
+
} else {
|
|
318
|
+
checks.push({
|
|
319
|
+
status: "info",
|
|
320
|
+
title: "Managed Composio",
|
|
321
|
+
message: `Configured for ${context.integrations.managedComposio.toolkits.join(", ")} with ${
|
|
322
|
+
context.integrations.managedComposio.toolCount
|
|
323
|
+
} allowed action${context.integrations.managedComposio.toolCount === 1 ? "" : "s"}. AgentKit Cloud injects COMPOSIO_API_KEY.`,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
174
328
|
if (context.accessMode === "private") {
|
|
175
329
|
checks.push({
|
|
176
330
|
status: "info",
|
|
@@ -255,6 +409,8 @@ export async function checkDeployReadiness(options: {
|
|
|
255
409
|
apiUrl: options.apiUrl,
|
|
256
410
|
context,
|
|
257
411
|
checks,
|
|
412
|
+
cloudAuth,
|
|
413
|
+
onlineCapacity,
|
|
258
414
|
};
|
|
259
415
|
}
|
|
260
416
|
|
|
@@ -264,6 +420,19 @@ export function printDeployReadinessReport(report: DeployReadinessReport): void
|
|
|
264
420
|
console.log(`Project ID: ${report.context.projectId}`);
|
|
265
421
|
console.log(`Target: ${report.context.target}`);
|
|
266
422
|
console.log(`API: ${report.apiUrl}`);
|
|
423
|
+
const authSummary = formatDeployCloudAuthSummary(report);
|
|
424
|
+
|
|
425
|
+
if (authSummary) {
|
|
426
|
+
console.log(`Account: ${authSummary.account}`);
|
|
427
|
+
console.log(`Auth source: ${authSummary.source}`);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const capacitySummary = formatDeployOnlineCapacity(report, "current");
|
|
431
|
+
|
|
432
|
+
if (capacitySummary) {
|
|
433
|
+
console.log(`Capacity: ${capacitySummary}`);
|
|
434
|
+
}
|
|
435
|
+
|
|
267
436
|
console.log("");
|
|
268
437
|
|
|
269
438
|
for (const check of report.checks) {
|
|
@@ -275,6 +444,36 @@ export function printDeployReadinessReport(report: DeployReadinessReport): void
|
|
|
275
444
|
}
|
|
276
445
|
}
|
|
277
446
|
|
|
447
|
+
export function formatDeployCloudAuthSummary(
|
|
448
|
+
report: DeployReadinessReport,
|
|
449
|
+
): { account: string; source: string } | null {
|
|
450
|
+
if (!report.cloudAuth.accountEmail || !report.cloudAuth.source) {
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return {
|
|
455
|
+
account: report.cloudAuth.accountEmail,
|
|
456
|
+
source: report.cloudAuth.source,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export function formatDeployOnlineCapacity(
|
|
461
|
+
report: DeployReadinessReport,
|
|
462
|
+
timing: "current" | "before deploy",
|
|
463
|
+
): string | null {
|
|
464
|
+
const suffix = timing === "before deploy" ? " before deploy" : "";
|
|
465
|
+
|
|
466
|
+
if (report.onlineCapacity.accountUsed !== undefined && report.onlineCapacity.accountLimit !== undefined) {
|
|
467
|
+
return `${report.onlineCapacity.accountUsed}/${report.onlineCapacity.accountLimit} account online deploy slots in use${suffix}`;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (report.onlineCapacity.globalUsed !== undefined && report.onlineCapacity.globalLimit !== undefined) {
|
|
471
|
+
return `${report.onlineCapacity.globalUsed}/${report.onlineCapacity.globalLimit} global online deploy slots in use${suffix}`;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
|
|
278
477
|
export async function syncHostedSecretsFromLocal(options: { apiUrl: string; projectId: string }): Promise<void> {
|
|
279
478
|
const context = await loadDeployReadinessContext(process.cwd(), process.env);
|
|
280
479
|
const localEnv = await loadCapsuleEnv(context.root, {});
|
|
@@ -315,34 +514,48 @@ export function formatReadinessError(error: unknown): string {
|
|
|
315
514
|
return error instanceof Error ? error.message : String(error);
|
|
316
515
|
}
|
|
317
516
|
|
|
318
|
-
export async function resolveProjectIdForSecretCommand(cwd: string): Promise<string> {
|
|
319
|
-
const
|
|
517
|
+
export async function resolveProjectIdForSecretCommand(cwd: string, apiUrl: string): Promise<string> {
|
|
518
|
+
const root = await findAgentCapsuleRoot(cwd);
|
|
519
|
+
const capsule = await loadAgentCapsule(root);
|
|
520
|
+
return resolveCloudProjectId(apiUrl, capsule.config.name);
|
|
521
|
+
}
|
|
320
522
|
|
|
321
|
-
|
|
322
|
-
|
|
523
|
+
async function resolveCloudProjectId(apiUrl: string, projectName: string): Promise<string> {
|
|
524
|
+
const payload = (await cloudApiRequest(apiUrl, "/v1/projects/resolve", {
|
|
525
|
+
method: "POST",
|
|
526
|
+
body: JSON.stringify({ project_name: projectName }),
|
|
527
|
+
})) as CloudProjectResolveResponse;
|
|
528
|
+
const projectId = payload.project?.id;
|
|
529
|
+
|
|
530
|
+
if (!projectId) {
|
|
531
|
+
throw new Error("AgentKit Cloud did not return a project id.");
|
|
323
532
|
}
|
|
324
533
|
|
|
325
|
-
|
|
326
|
-
const capsule = await loadAgentCapsule(root);
|
|
327
|
-
return stableCloudProjectId(capsule.config.name);
|
|
534
|
+
return projectId;
|
|
328
535
|
}
|
|
329
536
|
|
|
330
537
|
function secretSetCommand(secret: string, source: DeployReadinessContext["localSecrets"][string] | undefined): string {
|
|
331
538
|
if (source?.dotenv) {
|
|
332
|
-
return `agentkit secret set ${secret} --from-local-env`;
|
|
539
|
+
return `npm run agentkit -- secret set ${secret} --from-local-env`;
|
|
333
540
|
}
|
|
334
541
|
|
|
335
542
|
if (source?.environment) {
|
|
336
|
-
return `agentkit secret set ${secret} --from-env`;
|
|
543
|
+
return `npm run agentkit -- secret set ${secret} --from-env`;
|
|
337
544
|
}
|
|
338
545
|
|
|
339
|
-
return `agentkit secret set ${secret} --stdin`;
|
|
546
|
+
return `npm run agentkit -- secret set ${secret} --stdin`;
|
|
340
547
|
}
|
|
341
548
|
|
|
342
549
|
function normalizeOptionalNumber(value: number | null | undefined): number | undefined {
|
|
343
550
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
344
551
|
}
|
|
345
552
|
|
|
553
|
+
function majorNodeVersion(version: string): number | null {
|
|
554
|
+
const [major] = version.split(".");
|
|
555
|
+
const parsed = Number(major);
|
|
556
|
+
return Number.isInteger(parsed) ? parsed : null;
|
|
557
|
+
}
|
|
558
|
+
|
|
346
559
|
function isString(value: unknown): value is string {
|
|
347
560
|
return typeof value === "string";
|
|
348
561
|
}
|
package/src/cli/help.ts
CHANGED
|
@@ -13,7 +13,7 @@ Usage:
|
|
|
13
13
|
agentkit <command> [options]
|
|
14
14
|
|
|
15
15
|
Start:
|
|
16
|
-
agentkit new
|
|
16
|
+
agentkit new [name] [--template blank|support|dentista] [--no-install]
|
|
17
17
|
agentkit dev
|
|
18
18
|
agentkit open
|
|
19
19
|
agentkit chat-ui --deploy
|
|
@@ -29,6 +29,9 @@ Build:
|
|
|
29
29
|
agentkit db migrate
|
|
30
30
|
agentkit eval run
|
|
31
31
|
agentkit eval from-conversation <id>
|
|
32
|
+
agentkit improve collect --deploy --since 24h
|
|
33
|
+
agentkit feedback create --about last-run --kind bug --summary <text>
|
|
34
|
+
agentkit replay <bundle-dir> --against local
|
|
32
35
|
agentkit conversations list
|
|
33
36
|
|
|
34
37
|
Deploy:
|
|
@@ -41,8 +44,13 @@ Deploy:
|
|
|
41
44
|
|
|
42
45
|
More:
|
|
43
46
|
agentkit channels ...
|
|
47
|
+
agentkit integrations status
|
|
48
|
+
agentkit billing checkout --slots <count>
|
|
49
|
+
agentkit account token ...
|
|
44
50
|
agentkit access token ...
|
|
51
|
+
agentkit provider login openai-codex
|
|
45
52
|
agentkit env ...
|
|
53
|
+
agentkit feedback create --summary <text>
|
|
46
54
|
agentkit docs full
|
|
47
55
|
agentkit help commands
|
|
48
56
|
`;
|
|
@@ -52,7 +60,7 @@ export function renderCommandReference(): string {
|
|
|
52
60
|
return `AgentKit Command Reference
|
|
53
61
|
|
|
54
62
|
Usage:
|
|
55
|
-
agentkit new
|
|
63
|
+
agentkit new [name] [--template blank|support|dentista] [--no-install]
|
|
56
64
|
agentkit dev [--port <number>]
|
|
57
65
|
agentkit open
|
|
58
66
|
agentkit chat-ui --deploy [--port <number>] [--token-file <path>]
|
|
@@ -72,28 +80,53 @@ Usage:
|
|
|
72
80
|
agentkit db seed [--file <path>]
|
|
73
81
|
agentkit eval run
|
|
74
82
|
agentkit eval from-conversation <conversation-id> [--out <path>] [--force]
|
|
75
|
-
agentkit
|
|
76
|
-
agentkit
|
|
77
|
-
agentkit
|
|
83
|
+
agentkit improve collect [--deploy] [--since <duration|iso>] [--conversation-id <id>] [--out <directory>]
|
|
84
|
+
agentkit improve evals <bundle-dir-or-json> [--force]
|
|
85
|
+
agentkit feedback create [--about last-run|deploy|manual] [--kind bug|confusion|missing_docs|feature_request|deploy_issue|runtime_issue|other] --summary <text> [--message <text>] [--out <path>]
|
|
86
|
+
agentkit feedback preview [draft.json]
|
|
87
|
+
agentkit feedback send [draft.json] [--about last-run|deploy|manual] [--kind <kind>] --summary <text> [--message <text>] [--api <url>] [--save]
|
|
88
|
+
agentkit replay <bundle-dir-or-json> --against local
|
|
89
|
+
agentkit conversations list [--deploy]
|
|
90
|
+
agentkit conversations show <conversation-id> [--deploy]
|
|
91
|
+
agentkit conversations trace <conversation-id> [--deploy]
|
|
78
92
|
agentkit channels list
|
|
79
|
-
agentkit channels add <website|telegram|whatsapp> <name> [--provider zapster|meta] [--api <url>]
|
|
80
|
-
agentkit channels connect <website|telegram|whatsapp> <name> [--provider zapster|meta] [--api <url>]
|
|
93
|
+
agentkit channels add <website|telegram|whatsapp|discord|slack|webhook> <name> [--provider zapster|meta|uazapi|evolution] [--mode interactions|bot] [--api <url>]
|
|
94
|
+
agentkit channels connect <website|telegram|whatsapp|discord|slack|webhook> <name> [--provider zapster|meta|uazapi|evolution] [--mode interactions|bot] [--api <url>]
|
|
81
95
|
agentkit channels setup <name> [--apply] [--api <url>]
|
|
82
96
|
agentkit channels status <name> [--api <url>]
|
|
83
97
|
agentkit channels doctor <name> [--api <url>]
|
|
84
98
|
agentkit channels test <name> [--message <text>] [--fixture <path>] [--api <url>]
|
|
99
|
+
agentkit channels test-audio <name> [--fixture voice-note|audio-file|<path>] [--api <url>]
|
|
85
100
|
agentkit channels deliveries list <name> [--api <url>]
|
|
86
101
|
agentkit channels deliveries show <delivery-id> [--api <url>]
|
|
102
|
+
agentkit channels buffers list <name> [--api <url>]
|
|
103
|
+
agentkit channels buffers show [<name>] <conversation-id> [--api <url>]
|
|
104
|
+
agentkit channels buffers flush [<name>] <conversation-id> [--api <url>]
|
|
105
|
+
agentkit channels buffers clear [<name>] <conversation-id> [--api <url>]
|
|
106
|
+
agentkit channels buffers retry [<name>] <conversation-id> [--api <url>]
|
|
107
|
+
agentkit integrations status [--toolkit <slug>] [--api <url>]
|
|
108
|
+
agentkit integrations connect composio [--toolkit <slug>] [--callback-url <url>] [--api <url>]
|
|
109
|
+
agentkit skills status
|
|
110
|
+
agentkit skills sync
|
|
87
111
|
agentkit inspect
|
|
88
112
|
agentkit build [--target cloudflare|container]
|
|
113
|
+
agentkit provider login|status|logout openai-codex
|
|
89
114
|
agentkit login --token <token> [--api <url>]
|
|
90
115
|
agentkit logout
|
|
116
|
+
agentkit billing checkout --slots <count> [--email <email>] [--api <url>]
|
|
117
|
+
agentkit billing status <billing-intent-id> --secret <secret> [--api <url>]
|
|
118
|
+
agentkit billing claim <billing-intent-id> --secret <secret> [--token-name <name>] [--api <url>]
|
|
119
|
+
agentkit billing portal [--api <url>]
|
|
120
|
+
agentkit account token create <name> [--api <url>] [--use] [--out <path>]
|
|
121
|
+
agentkit account token list [--api <url>]
|
|
122
|
+
agentkit account token revoke <token-id> [--api <url>]
|
|
91
123
|
agentkit deploy [--target cloudflare|vps] [--host <host>] [--api <url>] [--dry-run] [--anonymous] [--local-wrangler] [--smoke <message>]
|
|
92
124
|
agentkit deploy doctor [--api <url>] [--anonymous]
|
|
93
125
|
agentkit deploy smoke [--message <text>] [--api <url>]
|
|
94
126
|
agentkit deploy status [--api <url>]
|
|
95
127
|
agentkit deploy pause [--api <url>]
|
|
96
128
|
agentkit deploy resume [--api <url>]
|
|
129
|
+
agentkit transcribe smoke [--provider test|openai|groq] [--model <model>] [--fixture <audio-file>]
|
|
97
130
|
agentkit secret set <NAME> <VALUE> [--api <url>]
|
|
98
131
|
agentkit secret set <NAME> --stdin [--api <url>]
|
|
99
132
|
agentkit secret set <NAME> --from-env [ENV_NAME] [--api <url>]
|
|
@@ -128,12 +161,21 @@ Commands:
|
|
|
128
161
|
sync Run or scaffold catalog/data synchronization
|
|
129
162
|
db Manage the local SQLite database
|
|
130
163
|
eval Run local eval files or create one from a conversation
|
|
164
|
+
improve Collect production or local traces and generate regression evals
|
|
165
|
+
feedback Create local redacted feedback drafts and send them to AgentKit Cloud
|
|
166
|
+
replay Replay an improve bundle against the local Agent Capsule
|
|
131
167
|
conversations List, inspect, and trace stored local conversations
|
|
132
168
|
channels Manage hosted channel resources
|
|
169
|
+
integrations Manage hosted AgentKit-managed integrations
|
|
170
|
+
skills Check or refresh local AgentKit skill files
|
|
171
|
+
transcribe Smoke-test audio transcription providers
|
|
133
172
|
inspect Print machine-readable Agent Capsule state
|
|
134
173
|
build Build a hosted deploy artifact
|
|
174
|
+
provider Manage local model-provider login
|
|
135
175
|
login Store an AgentKit Cloud alpha token outside the capsule
|
|
136
176
|
logout Remove the stored AgentKit Cloud alpha token
|
|
177
|
+
billing Buy deploy slots, claim checkout tokens, and open the billing portal
|
|
178
|
+
account Manage AgentKit Cloud account tokens
|
|
137
179
|
deploy Build and send a hosted artifact to AgentKit Cloud
|
|
138
180
|
secret Manage hosted AgentKit Cloud secrets without readback
|
|
139
181
|
access Manage hosted deploy access tokens
|
|
@@ -150,13 +192,15 @@ Examples:
|
|
|
150
192
|
agentkit tool lookup_order --input '{"orderId":"A100"}'
|
|
151
193
|
agentkit eval run
|
|
152
194
|
|
|
195
|
+
agentkit new
|
|
196
|
+
agentkit new .
|
|
153
197
|
agentkit new clara-dentista --template dentista
|
|
154
198
|
`;
|
|
155
199
|
}
|
|
156
200
|
|
|
157
201
|
export function renderCommandHelp(command: string): string {
|
|
158
202
|
const usage: Record<string, string> = {
|
|
159
|
-
new: "agentkit new
|
|
203
|
+
new: "agentkit new [name] [--template blank|support|dentista] [--no-install]",
|
|
160
204
|
dev: "agentkit dev [--port <number>]",
|
|
161
205
|
open: "agentkit open",
|
|
162
206
|
"chat-ui": "agentkit chat-ui --deploy [--port <number>] [--token-file <path>]",
|
|
@@ -166,13 +210,27 @@ export function renderCommandHelp(command: string): string {
|
|
|
166
210
|
spec: 'agentkit spec init --brief "owner request" | agentkit spec check',
|
|
167
211
|
sync: "agentkit sync init [--force] | agentkit sync run [--file <path>]",
|
|
168
212
|
eval: "agentkit eval run | agentkit eval from-conversation <conversation-id> [--out <path>] [--force]",
|
|
213
|
+
improve:
|
|
214
|
+
"agentkit improve collect [--deploy] [--since <duration|iso>] [--conversation-id <id>] [--out <directory>] | agentkit improve evals <bundle-dir-or-json> [--force]",
|
|
215
|
+
feedback:
|
|
216
|
+
"agentkit feedback create|preview|send [draft.json] [--about last-run|deploy|manual] [--kind <kind>] [--summary <text>] [--message <text>]",
|
|
217
|
+
replay: "agentkit replay <bundle-dir-or-json> --against local",
|
|
169
218
|
conversations:
|
|
170
|
-
"agentkit conversations list | agentkit conversations show <conversation-id> | agentkit conversations trace <conversation-id>",
|
|
219
|
+
"agentkit conversations list [--deploy] | agentkit conversations show <conversation-id> [--deploy] | agentkit conversations trace <conversation-id> [--deploy]",
|
|
220
|
+
channels:
|
|
221
|
+
"agentkit channels list | add | connect | setup | status | doctor | test | test-audio | deliveries | buffers",
|
|
222
|
+
skills: "agentkit skills status | agentkit skills sync",
|
|
223
|
+
transcribe: "agentkit transcribe smoke [--provider test|openai|groq] [--model <model>] [--fixture <audio-file>]",
|
|
171
224
|
deploy:
|
|
172
225
|
'agentkit deploy [--smoke "hello"] | agentkit deploy smoke [--message "hello"] | agentkit deploy doctor | status | pause | resume',
|
|
173
226
|
secret:
|
|
174
227
|
"agentkit secret set <NAME> --stdin | --from-env [ENV_NAME] | --from-local-env | agentkit secret sync --from-local | list | unset <NAME>",
|
|
175
228
|
access: "agentkit access token create <name> [--out <path>] | list | revoke <token-id>",
|
|
229
|
+
account: "agentkit account token create <name> [--use] [--out <path>] | list | revoke <token-id>",
|
|
230
|
+
billing:
|
|
231
|
+
"agentkit billing checkout --slots <count> [--email <email>] | status <intent-id> --secret <secret> | claim <intent-id> --secret <secret> | portal",
|
|
232
|
+
integrations: "agentkit integrations status [--toolkit <slug>] | agentkit integrations connect composio [--toolkit <slug>]",
|
|
233
|
+
provider: "agentkit provider login|status|logout openai-codex",
|
|
176
234
|
env: "agentkit env set <NAME> --stdin | --from-env [ENV_NAME] | list | unset <NAME>",
|
|
177
235
|
docs: "agentkit docs path | llms | full",
|
|
178
236
|
handoff: "agentkit handoff codex [goal] | agentkit handoff claude [goal]",
|