@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
package/src/runtime/channels.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import type { AgentChannel, ChannelProvider, ChannelType } from "../index";
|
|
2
2
|
|
|
3
3
|
export type ChannelMessageRole = "user" | "assistant";
|
|
4
|
-
export type ChannelMessageContentType = "text";
|
|
4
|
+
export type ChannelMessageContentType = "text" | "audio";
|
|
5
5
|
export type ChannelEventKind = "message" | "delivery_status" | "unsupported";
|
|
6
6
|
export type ChannelDeliveryDirection = "inbound" | "outbound";
|
|
7
7
|
export type ChannelDeliveryState =
|
|
8
8
|
| "webhook_received"
|
|
9
9
|
| "received"
|
|
10
10
|
| "validated"
|
|
11
|
+
| "audio_received"
|
|
12
|
+
| "audio_downloaded"
|
|
13
|
+
| "transcribing"
|
|
14
|
+
| "transcribed"
|
|
11
15
|
| "duplicate"
|
|
12
16
|
| "buffered"
|
|
13
17
|
| "queued"
|
|
14
18
|
| "running"
|
|
15
19
|
| "agent_completed"
|
|
20
|
+
| "adapter_stubbed"
|
|
21
|
+
| "provider_request_built"
|
|
22
|
+
| "provider_sent"
|
|
16
23
|
| "outbound_sent"
|
|
17
24
|
| "provider_failed"
|
|
18
25
|
| "synthetic_expected_failure"
|
|
@@ -42,11 +49,41 @@ export type ChannelExternalIdentity = {
|
|
|
42
49
|
redactedDisplay?: string;
|
|
43
50
|
};
|
|
44
51
|
|
|
52
|
+
export type ChannelReplyTarget =
|
|
53
|
+
| {
|
|
54
|
+
type: "discord_interaction";
|
|
55
|
+
applicationId: string;
|
|
56
|
+
interactionId: string;
|
|
57
|
+
interactionToken: string;
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
type: "discord_message";
|
|
61
|
+
channelId: string;
|
|
62
|
+
messageId: string;
|
|
63
|
+
}
|
|
64
|
+
| {
|
|
65
|
+
type: "slack_message";
|
|
66
|
+
channelId: string;
|
|
67
|
+
messageTs: string;
|
|
68
|
+
threadTs?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type ChannelAudioAttachment = {
|
|
72
|
+
providerMediaId: string;
|
|
73
|
+
kind: "voice" | "audio";
|
|
74
|
+
mimeType?: string;
|
|
75
|
+
filename?: string;
|
|
76
|
+
durationSeconds?: number;
|
|
77
|
+
sizeBytes?: number;
|
|
78
|
+
downloadUrl?: string;
|
|
79
|
+
};
|
|
80
|
+
|
|
45
81
|
export type NormalizedChannelMessage = {
|
|
46
82
|
role: ChannelMessageRole;
|
|
47
83
|
contentType: ChannelMessageContentType;
|
|
48
84
|
content: string;
|
|
49
85
|
providerMessageId?: string;
|
|
86
|
+
audio?: ChannelAudioAttachment;
|
|
50
87
|
};
|
|
51
88
|
|
|
52
89
|
export type NormalizedChannelEvent = ChannelAdapterId & {
|
|
@@ -59,6 +96,7 @@ export type NormalizedChannelEvent = ChannelAdapterId & {
|
|
|
59
96
|
receivedAt: string;
|
|
60
97
|
unsupportedReason?: string;
|
|
61
98
|
providerMetadata?: Record<string, unknown>;
|
|
99
|
+
replyTarget?: ChannelReplyTarget;
|
|
62
100
|
};
|
|
63
101
|
|
|
64
102
|
export type WebhookVerificationInput = RawWebhookEvent & {
|
|
@@ -76,20 +114,60 @@ export type WebhookVerificationResult =
|
|
|
76
114
|
message: string;
|
|
77
115
|
};
|
|
78
116
|
|
|
117
|
+
export type ChannelWebhookResponse = {
|
|
118
|
+
status?: number;
|
|
119
|
+
headers?: Record<string, string>;
|
|
120
|
+
body: string | Record<string, unknown>;
|
|
121
|
+
};
|
|
122
|
+
|
|
79
123
|
export type ChannelSendInput = ChannelAdapterId & {
|
|
80
124
|
channelId: string;
|
|
125
|
+
channel?: AgentChannel;
|
|
126
|
+
jobId?: string;
|
|
127
|
+
deliveryId?: string;
|
|
81
128
|
conversationId: string;
|
|
82
129
|
externalIdentity: ChannelExternalIdentity;
|
|
130
|
+
replyTarget?: ChannelReplyTarget;
|
|
83
131
|
message: NormalizedChannelMessage;
|
|
84
132
|
secrets: Record<string, string>;
|
|
85
133
|
};
|
|
86
134
|
|
|
135
|
+
export type ChannelMediaDownloadInput = ChannelAdapterId & {
|
|
136
|
+
channelId: string;
|
|
137
|
+
message: NormalizedChannelMessage;
|
|
138
|
+
secrets: Record<string, string>;
|
|
139
|
+
maxBytes?: number;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type ChannelMediaDownloadResult =
|
|
143
|
+
| {
|
|
144
|
+
ok: true;
|
|
145
|
+
audio: Uint8Array;
|
|
146
|
+
filename: string;
|
|
147
|
+
mimeType?: string;
|
|
148
|
+
durationSeconds?: number;
|
|
149
|
+
sizeBytes?: number;
|
|
150
|
+
providerMetadata?: Record<string, unknown>;
|
|
151
|
+
}
|
|
152
|
+
| {
|
|
153
|
+
ok: false;
|
|
154
|
+
retryable: boolean;
|
|
155
|
+
code:
|
|
156
|
+
| "channel_secret_missing"
|
|
157
|
+
| "channel_audio_download_unavailable"
|
|
158
|
+
| "channel_audio_too_large"
|
|
159
|
+
| "channel_provider_unavailable"
|
|
160
|
+
| "channel_media_download_failed";
|
|
161
|
+
message: string;
|
|
162
|
+
providerMetadata?: Record<string, unknown>;
|
|
163
|
+
};
|
|
164
|
+
|
|
87
165
|
export type ChannelSendResult =
|
|
88
166
|
| {
|
|
89
167
|
ok: true;
|
|
90
168
|
providerRequestId?: string;
|
|
91
169
|
providerMessageId?: string;
|
|
92
|
-
status: "sent" | "delivered";
|
|
170
|
+
status: "stubbed" | "sent" | "delivered";
|
|
93
171
|
providerMetadata?: Record<string, unknown>;
|
|
94
172
|
}
|
|
95
173
|
| {
|
|
@@ -117,13 +195,15 @@ export type ChannelStatusResult = {
|
|
|
117
195
|
export type ChannelAdapter = ChannelAdapterId & {
|
|
118
196
|
requiredSecrets: string[];
|
|
119
197
|
normalizeInbound(input: RawWebhookEvent): Promise<NormalizedChannelEvent[]> | NormalizedChannelEvent[];
|
|
198
|
+
downloadMedia?(input: ChannelMediaDownloadInput): Promise<ChannelMediaDownloadResult>;
|
|
120
199
|
sendMessage(input: ChannelSendInput): Promise<ChannelSendResult>;
|
|
121
200
|
verifyWebhook?(input: WebhookVerificationInput): Promise<WebhookVerificationResult> | WebhookVerificationResult;
|
|
201
|
+
getWebhookResponse?(input: WebhookVerificationInput): Promise<ChannelWebhookResponse | null> | ChannelWebhookResponse | null;
|
|
122
202
|
getStatus?(input: ChannelStatusInput): Promise<ChannelStatusResult> | ChannelStatusResult;
|
|
123
203
|
};
|
|
124
204
|
|
|
125
205
|
export type PortableChannelRouteContract = {
|
|
126
|
-
route: "/channels/:name/:type/:provider/webhook";
|
|
206
|
+
route: "/channels/:name/:type/:provider/webhook" | "/channels/:name/webhook";
|
|
127
207
|
verification: WebhookVerificationResult;
|
|
128
208
|
dedupe: {
|
|
129
209
|
key: string;
|
package/src/runtime/chat.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getCodexApiKey } from "../providers/codex-auth";
|
|
1
2
|
import { getProviderAdapter } from "../providers";
|
|
2
3
|
import type { AgentMessage, ProviderRunResult } from "../providers";
|
|
3
4
|
import type { ToolRuntimeContext } from "../index";
|
|
@@ -7,9 +8,11 @@ import { loadAgentCapsule } from "./config";
|
|
|
7
8
|
import { openPreparedCapsuleStore } from "./database";
|
|
8
9
|
import { loadCapsuleEnv } from "./env";
|
|
9
10
|
import { AgentKitError, isAgentKitError } from "./errors";
|
|
11
|
+
import { createManagedComposioTools } from "./integrations/composio";
|
|
10
12
|
import { syncConfiguredKnowledgeSources } from "./knowledge/ingest";
|
|
11
13
|
import { appendKnowledgePromptPolicy } from "./knowledge/prompt-policy";
|
|
12
14
|
import { createKnowledgeSearchTool } from "./knowledge/tool";
|
|
15
|
+
import { appendRuntimePromptContext, buildRuntimeClockContext } from "./prompt-context";
|
|
13
16
|
import { createToolRuntime } from "./tools";
|
|
14
17
|
|
|
15
18
|
export type RunAgentMessageOptions = {
|
|
@@ -17,6 +20,8 @@ export type RunAgentMessageOptions = {
|
|
|
17
20
|
conversationId?: string;
|
|
18
21
|
signal?: AbortSignal;
|
|
19
22
|
runtime?: Partial<ToolRuntimeContext>;
|
|
23
|
+
now?: Date;
|
|
24
|
+
localStoragePath?: string;
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
export type AgentRunResult = ProviderRunResult & PersistedChatRun;
|
|
@@ -25,7 +30,8 @@ export async function runAgentMessageFromCwd(
|
|
|
25
30
|
cwd: string,
|
|
26
31
|
options: RunAgentMessageOptions,
|
|
27
32
|
): Promise<AgentRunResult> {
|
|
28
|
-
|
|
33
|
+
const capsule = await loadAgentCapsule(cwd);
|
|
34
|
+
return runAgentMessage(withLocalStoragePath(capsule, options.localStoragePath), options);
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
export async function runAgentMessage(
|
|
@@ -41,56 +47,70 @@ export async function runAgentMessage(
|
|
|
41
47
|
const adapter = getProviderAdapter(capsule.config.provider);
|
|
42
48
|
const env = await loadCapsuleEnv(capsule.root);
|
|
43
49
|
await syncConfiguredKnowledgeSources(capsule);
|
|
44
|
-
const { store } = await openPreparedCapsuleStore(capsule);
|
|
45
50
|
const conversationId = normalizeConversationId(options.conversationId);
|
|
46
|
-
const {
|
|
47
|
-
|
|
48
|
-
conversationId,
|
|
49
|
-
firstMessage: content,
|
|
50
|
-
});
|
|
51
|
-
const messages: AgentMessage[] = [...previousMessages, { role: "user", content }];
|
|
52
|
-
const userMessage = store.appendMessage({
|
|
53
|
-
conversationId: conversation.id,
|
|
54
|
-
role: "user",
|
|
55
|
-
content,
|
|
56
|
-
});
|
|
57
|
-
const run = store.createRun({
|
|
58
|
-
conversationId: conversation.id,
|
|
59
|
-
provider: capsule.config.provider.name,
|
|
60
|
-
model: capsule.config.provider.model,
|
|
61
|
-
});
|
|
62
|
-
const runtimeTools = withKnowledgeTools(capsule);
|
|
63
|
-
const toolRuntime = createToolRuntime({
|
|
64
|
-
tools: runtimeTools,
|
|
65
|
-
store,
|
|
66
|
-
runId: run.id,
|
|
67
|
-
conversationId: conversation.id,
|
|
68
|
-
env,
|
|
69
|
-
signal: options.signal,
|
|
70
|
-
runtime: {
|
|
71
|
-
environment: "local",
|
|
72
|
-
invocation: "chat",
|
|
73
|
-
target: "bun",
|
|
74
|
-
database: "sqlite",
|
|
75
|
-
...options.runtime,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
51
|
+
const { store } = await openPreparedCapsuleStore(capsule);
|
|
52
|
+
let runId: string | null = null;
|
|
78
53
|
|
|
79
54
|
try {
|
|
55
|
+
const { conversation, previousMessages } = resolveConversation(store, {
|
|
56
|
+
agentName: capsule.config.name,
|
|
57
|
+
conversationId,
|
|
58
|
+
firstMessage: content,
|
|
59
|
+
});
|
|
60
|
+
const messages: AgentMessage[] = [...previousMessages, { role: "user", content }];
|
|
61
|
+
const userMessage = store.appendMessage({
|
|
62
|
+
conversationId: conversation.id,
|
|
63
|
+
role: "user",
|
|
64
|
+
content,
|
|
65
|
+
});
|
|
66
|
+
const run = store.createRun({
|
|
67
|
+
conversationId: conversation.id,
|
|
68
|
+
provider: capsule.config.provider.name,
|
|
69
|
+
model: capsule.config.provider.model,
|
|
70
|
+
});
|
|
71
|
+
runId = run.id;
|
|
72
|
+
const runtimeTools = withKnowledgeTools(capsule);
|
|
73
|
+
const clock = buildRuntimeClockContext({
|
|
74
|
+
timeZone: capsule.config.timeZone,
|
|
75
|
+
env,
|
|
76
|
+
now: options.now,
|
|
77
|
+
});
|
|
78
|
+
const toolRuntime = createToolRuntime({
|
|
79
|
+
tools: runtimeTools,
|
|
80
|
+
store,
|
|
81
|
+
runId: run.id,
|
|
82
|
+
conversationId: conversation.id,
|
|
83
|
+
env,
|
|
84
|
+
signal: options.signal,
|
|
85
|
+
clock,
|
|
86
|
+
runtime: {
|
|
87
|
+
environment: "local",
|
|
88
|
+
invocation: "chat",
|
|
89
|
+
target: "bun",
|
|
90
|
+
database: "sqlite",
|
|
91
|
+
...options.runtime,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
80
94
|
const result = await adapter.run({
|
|
81
95
|
agent: {
|
|
82
96
|
name: capsule.config.name,
|
|
83
97
|
runtime: capsule.config.runtime,
|
|
84
98
|
provider: capsule.config.provider,
|
|
85
99
|
},
|
|
86
|
-
instructions:
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
instructions: appendRuntimePromptContext(
|
|
101
|
+
withToolVisibilityInstructions(
|
|
102
|
+
appendKnowledgePromptPolicy(capsule.instructions, capsule.config),
|
|
103
|
+
runtimeTools,
|
|
104
|
+
),
|
|
105
|
+
{
|
|
106
|
+
clock,
|
|
107
|
+
},
|
|
89
108
|
),
|
|
90
109
|
messages,
|
|
91
110
|
tools: toolRuntime.definitions,
|
|
92
111
|
toolRuntime,
|
|
93
112
|
env,
|
|
113
|
+
apiKey: capsule.config.provider.name === "openai-codex" ? await getCodexApiKey() : undefined,
|
|
94
114
|
signal: options.signal,
|
|
95
115
|
});
|
|
96
116
|
|
|
@@ -114,12 +134,14 @@ export async function runAgentMessage(
|
|
|
114
134
|
assistantMessageId: assistantMessage.id,
|
|
115
135
|
};
|
|
116
136
|
} catch (error) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
137
|
+
if (runId) {
|
|
138
|
+
store.completeRun({
|
|
139
|
+
runId,
|
|
140
|
+
status: "failed",
|
|
141
|
+
errorCode: isAgentKitError(error) ? error.code : "runtime_error",
|
|
142
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
123
145
|
|
|
124
146
|
throw error;
|
|
125
147
|
} finally {
|
|
@@ -128,7 +150,7 @@ export async function runAgentMessage(
|
|
|
128
150
|
}
|
|
129
151
|
|
|
130
152
|
function withKnowledgeTools(capsule: LoadedAgentCapsule): NonNullable<LoadedAgentCapsule["config"]["tools"]> {
|
|
131
|
-
const tools = [...(capsule.config.tools ?? [])];
|
|
153
|
+
const tools = [...createManagedComposioTools(capsule.config), ...(capsule.config.tools ?? [])];
|
|
132
154
|
const knowledgeTool = createKnowledgeSearchTool(capsule);
|
|
133
155
|
|
|
134
156
|
if (knowledgeTool) {
|
|
@@ -190,6 +212,10 @@ function normalizeConversationId(value: string | undefined): string | undefined
|
|
|
190
212
|
return conversationId;
|
|
191
213
|
}
|
|
192
214
|
|
|
215
|
+
function withLocalStoragePath(capsule: LoadedAgentCapsule, storagePath?: string): LoadedAgentCapsule {
|
|
216
|
+
return storagePath ? { ...capsule, storagePath } : capsule;
|
|
217
|
+
}
|
|
218
|
+
|
|
193
219
|
function withToolVisibilityInstructions(instructions: string, tools: LoadedAgentCapsule["config"]["tools"] = []): string {
|
|
194
220
|
const internalTools = tools.filter((tool) => tool.visibility === "internal").map((tool) => tool.name).sort();
|
|
195
221
|
|