@townco/agent 0.1.85 → 0.1.88
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/dist/acp-server/adapter.d.ts +0 -8
- package/dist/runner/hooks/executor.d.ts +0 -6
- package/dist/runner/index.d.ts +51 -2
- package/dist/runner/langchain/index.js +25 -0
- package/dist/runner/langchain/tools/artifacts.d.ts +6 -6
- package/dist/runner/langchain/tools/artifacts.js +98 -93
- package/dist/runner/langchain/tools/browser.d.ts +9 -9
- package/dist/runner/langchain/tools/document_extract.d.ts +1 -1
- package/dist/runner/langchain/tools/filesystem.d.ts +3 -3
- package/dist/runner/langchain/tools/generate_image.d.ts +8 -8
- package/dist/runner/langchain/tools/todo.d.ts +10 -10
- package/dist/scaffold/project-scaffold.js +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -13
|
@@ -43,10 +43,6 @@ export declare class AgentAcpAdapter implements acp.Agent {
|
|
|
43
43
|
* This provides info about subagents configured via makeSubagentsTool.
|
|
44
44
|
*/
|
|
45
45
|
private getSubagentsMetadata;
|
|
46
|
-
/**
|
|
47
|
-
* Helper to save session to disk
|
|
48
|
-
* Call this after any modification to session.messages or session.context
|
|
49
|
-
*/
|
|
50
46
|
private saveSessionToDisk;
|
|
51
47
|
initialize(_params: acp.InitializeRequest): Promise<acp.InitializeResponse>;
|
|
52
48
|
newSession(params: acp.NewSessionRequest): Promise<acp.NewSessionResponse>;
|
|
@@ -60,10 +56,6 @@ export declare class AgentAcpAdapter implements acp.Agent {
|
|
|
60
56
|
setSessionMode(_params: acp.SetSessionModeRequest): Promise<acp.SetSessionModeResponse>;
|
|
61
57
|
prompt(params: acp.PromptRequest): Promise<acp.PromptResponse>;
|
|
62
58
|
private _promptImpl;
|
|
63
|
-
/**
|
|
64
|
-
* Execute hooks if configured for this agent
|
|
65
|
-
* Returns new context entries that should be appended to session.context
|
|
66
|
-
*/
|
|
67
59
|
private executeHooksIfConfigured;
|
|
68
60
|
private _executeHooksImpl;
|
|
69
61
|
cancel(params: acp.CancelNotification): Promise<void>;
|
|
@@ -27,9 +27,6 @@ export declare class HookExecutor {
|
|
|
27
27
|
newContextEntries: ContextEntry[];
|
|
28
28
|
notifications: HookNotification[];
|
|
29
29
|
}>;
|
|
30
|
-
/**
|
|
31
|
-
* Execute a context_size hook
|
|
32
|
-
*/
|
|
33
30
|
private executeContextSizeHook;
|
|
34
31
|
/**
|
|
35
32
|
* Execute tool_response hooks when a tool returns output
|
|
@@ -46,8 +43,5 @@ export declare class HookExecutor {
|
|
|
46
43
|
metadata?: Record<string, unknown>;
|
|
47
44
|
notifications: HookNotification[];
|
|
48
45
|
}>;
|
|
49
|
-
/**
|
|
50
|
-
* Execute a single tool_response hook
|
|
51
|
-
*/
|
|
52
46
|
private executeToolResponseHook;
|
|
53
47
|
}
|
package/dist/runner/index.d.ts
CHANGED
|
@@ -1,4 +1,53 @@
|
|
|
1
|
-
import type { AgentDefinition } from "../definition";
|
|
2
1
|
import { type AgentRunner } from "./agent-runner";
|
|
3
2
|
export type { AgentRunner };
|
|
4
|
-
export declare const makeRunnerFromDefinition: (definition:
|
|
3
|
+
export declare const makeRunnerFromDefinition: (definition: {
|
|
4
|
+
displayName?: string | undefined;
|
|
5
|
+
version?: string | undefined;
|
|
6
|
+
description?: string | undefined;
|
|
7
|
+
suggestedPrompts?: string[] | undefined;
|
|
8
|
+
systemPrompt: string | null;
|
|
9
|
+
model: string;
|
|
10
|
+
tools?: (string | {
|
|
11
|
+
type: "custom";
|
|
12
|
+
modulePath: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: "filesystem";
|
|
15
|
+
working_directory?: string | undefined;
|
|
16
|
+
} | {
|
|
17
|
+
type: "direct";
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
fn: import("zod/v4/core").$InferOuterFunctionType<import("zod/v4/core").$ZodFunctionArgs, import("zod/v4/core").$ZodFunctionOut>;
|
|
21
|
+
schema: any;
|
|
22
|
+
prettyName?: string | undefined;
|
|
23
|
+
icon?: string | undefined;
|
|
24
|
+
})[] | undefined;
|
|
25
|
+
mcps?: (string | {
|
|
26
|
+
name: string;
|
|
27
|
+
transport: "stdio";
|
|
28
|
+
command: string;
|
|
29
|
+
args?: string[] | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
transport: "http";
|
|
33
|
+
url: string;
|
|
34
|
+
headers?: Record<string, string> | undefined;
|
|
35
|
+
})[] | undefined;
|
|
36
|
+
harnessImplementation?: "langchain" | undefined;
|
|
37
|
+
hooks?: {
|
|
38
|
+
type: "context_size" | "tool_response";
|
|
39
|
+
setting?: {
|
|
40
|
+
threshold: number;
|
|
41
|
+
} | {
|
|
42
|
+
maxTokensSize?: number | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
callback: string;
|
|
45
|
+
}[] | undefined;
|
|
46
|
+
initialMessage?: {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
content: string;
|
|
49
|
+
} | undefined;
|
|
50
|
+
uiConfig?: {
|
|
51
|
+
hideTopBar?: boolean | undefined;
|
|
52
|
+
} | undefined;
|
|
53
|
+
}) => AgentRunner;
|
|
@@ -532,6 +532,14 @@ export class LangchainAgent {
|
|
|
532
532
|
if (hasTodoWrite) {
|
|
533
533
|
agentConfig.systemPrompt = `${agentConfig.systemPrompt ?? ""}\n\n${TODO_WRITE_INSTRUCTIONS}`;
|
|
534
534
|
}
|
|
535
|
+
// Process template variables in system prompt and inject current date/time
|
|
536
|
+
if (agentConfig.systemPrompt) {
|
|
537
|
+
const currentDateTime = getCurrentDateTimeString();
|
|
538
|
+
// Replace {{.CurrentDate}} template variable
|
|
539
|
+
agentConfig.systemPrompt = agentConfig.systemPrompt.replace(/\{\{\.CurrentDate\}\}/g, currentDateTime);
|
|
540
|
+
// Replace {{.CurrentDateTime}} template variable (alias)
|
|
541
|
+
agentConfig.systemPrompt = agentConfig.systemPrompt.replace(/\{\{\.CurrentDateTime\}\}/g, currentDateTime);
|
|
542
|
+
}
|
|
535
543
|
const agent = createAgent(agentConfig);
|
|
536
544
|
// Build messages from context history if available, otherwise use just the prompt
|
|
537
545
|
// Type includes tool messages for sending tool results
|
|
@@ -1272,6 +1280,23 @@ I've found some existing telemetry code. Let me mark the first todo as in_progre
|
|
|
1272
1280
|
[Assistant continues implementing the feature step by step, marking todos as in_progress and completed as they go]
|
|
1273
1281
|
</example>
|
|
1274
1282
|
`.trim();
|
|
1283
|
+
/**
|
|
1284
|
+
* Returns a human-readable string of the current date and time.
|
|
1285
|
+
* Example: "Monday, December 9, 2024 at 2:30 PM PST"
|
|
1286
|
+
*/
|
|
1287
|
+
const getCurrentDateTimeString = () => {
|
|
1288
|
+
const now = new Date();
|
|
1289
|
+
const options = {
|
|
1290
|
+
weekday: "long",
|
|
1291
|
+
year: "numeric",
|
|
1292
|
+
month: "long",
|
|
1293
|
+
day: "numeric",
|
|
1294
|
+
hour: "numeric",
|
|
1295
|
+
minute: "2-digit",
|
|
1296
|
+
timeZoneName: "short",
|
|
1297
|
+
};
|
|
1298
|
+
return now.toLocaleString("en-US", options);
|
|
1299
|
+
};
|
|
1275
1300
|
// Re-export subagent tool utility
|
|
1276
1301
|
export { makeSubagentsTool } from "./tools/subagent.js";
|
|
1277
1302
|
/**
|
|
@@ -19,19 +19,19 @@ export declare function makeArtifactsTools(): (import("langchain").DynamicStruct
|
|
|
19
19
|
source: z.ZodString;
|
|
20
20
|
destination: z.ZodString;
|
|
21
21
|
direction: z.ZodEnum<{
|
|
22
|
-
upload: "upload";
|
|
23
22
|
download: "download";
|
|
23
|
+
upload: "upload";
|
|
24
24
|
}>;
|
|
25
25
|
}, z.core.$strip>, {
|
|
26
26
|
session_id: string;
|
|
27
27
|
source: string;
|
|
28
28
|
destination: string;
|
|
29
|
-
direction: "
|
|
29
|
+
direction: "download" | "upload";
|
|
30
30
|
}, {
|
|
31
|
+
session_id?: string | undefined;
|
|
31
32
|
source: string;
|
|
32
33
|
destination: string;
|
|
33
|
-
direction: "
|
|
34
|
-
session_id?: string | undefined;
|
|
34
|
+
direction: "download" | "upload";
|
|
35
35
|
}, string> | import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
36
36
|
session_id: z.ZodOptional<z.ZodString>;
|
|
37
37
|
path: z.ZodString;
|
|
@@ -39,8 +39,8 @@ export declare function makeArtifactsTools(): (import("langchain").DynamicStruct
|
|
|
39
39
|
session_id: string;
|
|
40
40
|
path: string;
|
|
41
41
|
}, {
|
|
42
|
-
path: string;
|
|
43
42
|
session_id?: string | undefined;
|
|
43
|
+
path: string;
|
|
44
44
|
}, string> | import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
45
45
|
session_id: z.ZodOptional<z.ZodString>;
|
|
46
46
|
path: z.ZodOptional<z.ZodString>;
|
|
@@ -62,7 +62,7 @@ export declare function makeArtifactsTools(): (import("langchain").DynamicStruct
|
|
|
62
62
|
path: string;
|
|
63
63
|
expires_in?: number;
|
|
64
64
|
}, {
|
|
65
|
-
path: string;
|
|
66
65
|
session_id?: string | undefined;
|
|
66
|
+
path: string;
|
|
67
67
|
expires_in?: number | undefined;
|
|
68
68
|
}, string>)[];
|
|
@@ -11,19 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as fs from "node:fs/promises";
|
|
13
13
|
import * as path from "node:path";
|
|
14
|
-
import {
|
|
14
|
+
import { createClient } from "@townco/apiclient";
|
|
15
|
+
import { getShedAuth } from "@townco/core/auth";
|
|
15
16
|
import { tool } from "langchain";
|
|
16
17
|
import { z } from "zod";
|
|
17
18
|
// ============================================================================
|
|
18
|
-
// Supabase Client and Bucket Configuration
|
|
19
|
-
// ============================================================================
|
|
20
|
-
function getSupabaseClient() {
|
|
21
|
-
return createSecretKeyClient();
|
|
22
|
-
}
|
|
23
|
-
function getBucketName() {
|
|
24
|
-
return "town-builder-artifacts";
|
|
25
|
-
}
|
|
26
|
-
// ============================================================================
|
|
27
19
|
// Storage Key Prefix Logic
|
|
28
20
|
// ============================================================================
|
|
29
21
|
/**
|
|
@@ -99,21 +91,26 @@ function validateStoragePath(path) {
|
|
|
99
91
|
throw new Error("Storage path cannot be empty");
|
|
100
92
|
}
|
|
101
93
|
}
|
|
102
|
-
function validateExpiration(expiresIn) {
|
|
103
|
-
// Supabase supports up to 365 days (31536000 seconds)
|
|
104
|
-
if (expiresIn < 1 || expiresIn > 31536000) {
|
|
105
|
-
throw new Error(`URL expiration must be between 1 and 31536000 seconds (365 days). Got: ${expiresIn}`);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
94
|
// ============================================================================
|
|
109
95
|
// Supabase Storage Operation Helpers
|
|
110
96
|
// ============================================================================
|
|
111
97
|
/**
|
|
112
|
-
* Upload a file to Supabase Storage
|
|
98
|
+
* Upload a file to Supabase Storage using signed URL
|
|
113
99
|
*/
|
|
114
100
|
async function uploadToSupabase(storageKey, localPath) {
|
|
115
|
-
const
|
|
116
|
-
|
|
101
|
+
const auth = getShedAuth();
|
|
102
|
+
if (auth === null)
|
|
103
|
+
throw new Error(`agent/artifacts: could not fetch shed auth`);
|
|
104
|
+
const { shedUrl, accessToken } = auth;
|
|
105
|
+
// Get signed upload URL from server
|
|
106
|
+
const signedUrl = await createClient({
|
|
107
|
+
shedUrl,
|
|
108
|
+
accessToken,
|
|
109
|
+
}).getArtifactUrl.query({
|
|
110
|
+
kind: "user",
|
|
111
|
+
key: storageKey,
|
|
112
|
+
upload: true,
|
|
113
|
+
});
|
|
117
114
|
// Read file content
|
|
118
115
|
const fileContent = await fs.readFile(localPath);
|
|
119
116
|
// Determine content type based on file extension
|
|
@@ -133,91 +130,92 @@ async function uploadToSupabase(storageKey, localPath) {
|
|
|
133
130
|
".zip": "application/zip",
|
|
134
131
|
};
|
|
135
132
|
const contentType = contentTypeMap[ext] || "application/octet-stream";
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
// Upload using signed URL
|
|
134
|
+
const response = await fetch(signedUrl, {
|
|
135
|
+
method: "PUT",
|
|
136
|
+
body: fileContent,
|
|
137
|
+
headers: {
|
|
138
|
+
"Content-Type": contentType,
|
|
139
|
+
},
|
|
141
140
|
});
|
|
142
|
-
if (
|
|
143
|
-
throw new Error(`Failed to upload to Supabase Storage: ${
|
|
141
|
+
if (!response.ok) {
|
|
142
|
+
throw new Error(`Failed to upload to Supabase Storage: ${response.status} ${response.statusText}`);
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
/**
|
|
147
|
-
* Download a file from Supabase Storage
|
|
146
|
+
* Download a file from Supabase Storage using signed URL
|
|
148
147
|
*/
|
|
149
148
|
async function downloadFromSupabase(storageKey, localPath) {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
const auth = getShedAuth();
|
|
150
|
+
if (auth === null)
|
|
151
|
+
throw new Error(`agent/artifacts: could not fetch shed auth`);
|
|
152
|
+
const { shedUrl, accessToken } = auth;
|
|
153
|
+
// Get signed download URL from server
|
|
154
|
+
const signedUrl = await createClient({
|
|
155
|
+
shedUrl,
|
|
156
|
+
accessToken,
|
|
157
|
+
}).getArtifactUrl.query({
|
|
158
|
+
kind: "user",
|
|
159
|
+
key: storageKey,
|
|
160
|
+
upload: false,
|
|
161
|
+
});
|
|
162
|
+
// Download file using signed URL
|
|
163
|
+
const response = await fetch(signedUrl);
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
throw new Error(`Failed to download from Supabase Storage: ${response.status} ${response.statusText}`);
|
|
157
166
|
}
|
|
167
|
+
const data = await response.arrayBuffer();
|
|
158
168
|
if (!data) {
|
|
159
169
|
throw new Error("Supabase Storage response body is empty");
|
|
160
170
|
}
|
|
161
171
|
// Ensure parent directory exists
|
|
162
172
|
const dir = path.dirname(localPath);
|
|
163
173
|
await fs.mkdir(dir, { recursive: true });
|
|
164
|
-
// Convert
|
|
165
|
-
const
|
|
166
|
-
const buffer = Buffer.from(arrayBuffer);
|
|
174
|
+
// Convert ArrayBuffer to Buffer and write
|
|
175
|
+
const buffer = Buffer.from(data);
|
|
167
176
|
await fs.writeFile(localPath, buffer);
|
|
168
177
|
}
|
|
169
178
|
/**
|
|
170
179
|
* Delete a file from Supabase Storage
|
|
171
180
|
*/
|
|
172
181
|
async function deleteFromSupabase(storageKey) {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
182
|
+
const auth = getShedAuth();
|
|
183
|
+
if (auth === null)
|
|
184
|
+
throw new Error(`agent/artifacts: could not fetch shed auth`);
|
|
185
|
+
const { shedUrl, accessToken } = auth;
|
|
186
|
+
// Call the delete API endpoint
|
|
187
|
+
await createClient({ shedUrl, accessToken }).deleteArtifact.mutate({
|
|
188
|
+
kind: "user",
|
|
189
|
+
key: storageKey,
|
|
190
|
+
});
|
|
179
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* List files in Supabase Storage with optional prefix and recursion
|
|
194
|
+
*/
|
|
180
195
|
async function listFilesInSupabase(sessionId, relativePath, recursive = false) {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
? undefined
|
|
191
|
-
: {
|
|
192
|
-
limit: 100,
|
|
193
|
-
offset: 0,
|
|
194
|
-
sortBy: { column: "name", order: "asc" },
|
|
195
|
-
};
|
|
196
|
-
const { data, error } = await supabase.storage
|
|
197
|
-
.from(bucket)
|
|
198
|
-
.list(basePath, options);
|
|
199
|
-
if (error) {
|
|
200
|
-
throw new Error(`Failed to list files in Supabase Storage: ${error.message}`);
|
|
201
|
-
}
|
|
202
|
-
return data || [];
|
|
196
|
+
const auth = getShedAuth();
|
|
197
|
+
if (auth === null)
|
|
198
|
+
throw new Error(`agent/artifacts: could not fetch shed auth`);
|
|
199
|
+
const { shedUrl, accessToken } = auth;
|
|
200
|
+
return await createClient({ shedUrl, accessToken }).listArtifacts.query({
|
|
201
|
+
kind: "user",
|
|
202
|
+
key: buildStorageKey(sessionId, relativePath ?? ""),
|
|
203
|
+
recursive,
|
|
204
|
+
});
|
|
203
205
|
}
|
|
204
206
|
/**
|
|
205
207
|
* Generate a signed URL for a Supabase Storage object
|
|
206
208
|
*/
|
|
207
|
-
async
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
throw new Error("Signed URL not returned from Supabase Storage");
|
|
218
|
-
}
|
|
219
|
-
return data.signedUrl;
|
|
220
|
-
}
|
|
209
|
+
const generateSignedUrl = async (storageKey) => {
|
|
210
|
+
const shedAuth = getShedAuth();
|
|
211
|
+
if (shedAuth === null)
|
|
212
|
+
throw new Error("agent/artifacts: could not fetch shed auth");
|
|
213
|
+
const { accessToken, shedUrl } = shedAuth;
|
|
214
|
+
return await createClient({ shedUrl, accessToken }).getArtifactUrl.query({
|
|
215
|
+
kind: "user",
|
|
216
|
+
key: storageKey,
|
|
217
|
+
});
|
|
218
|
+
};
|
|
221
219
|
// ============================================================================
|
|
222
220
|
// Error Handling Helpers
|
|
223
221
|
// ============================================================================
|
|
@@ -391,17 +389,12 @@ const artifactsLs = tool(async ({ session_id, path, recursive = false, }) => {
|
|
|
391
389
|
/**
|
|
392
390
|
* Tool 4: artifacts_url - Generate signed URL
|
|
393
391
|
*/
|
|
394
|
-
const artifactsUrl = tool(async ({ session_id, path,
|
|
392
|
+
const artifactsUrl = tool(async ({ session_id, path, }) => {
|
|
395
393
|
try {
|
|
396
394
|
validateStoragePath(path);
|
|
397
|
-
validateExpiration(expires_in);
|
|
398
395
|
const storageKey = buildStorageKey(session_id, path);
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
const expiryStr = expiryHours >= 1
|
|
402
|
-
? `${expiryHours.toFixed(1)} hour(s)`
|
|
403
|
-
: `${expires_in} second(s)`;
|
|
404
|
-
return `Signed URL for ${path} (expires in ${expiryStr}):\n${url}`;
|
|
396
|
+
const _url = await generateSignedUrl(storageKey);
|
|
397
|
+
return `Signed URL for ${path}`;
|
|
405
398
|
}
|
|
406
399
|
catch (error) {
|
|
407
400
|
return handleStorageError(error, `Failed to generate URL for ${path}`);
|
|
@@ -423,32 +416,44 @@ const artifactsUrl = tool(async ({ session_id, path, expires_in = 3600, }) => {
|
|
|
423
416
|
.describe("Expiration time in seconds (1-31536000). Default: 3600 (1 hour)"),
|
|
424
417
|
}),
|
|
425
418
|
});
|
|
419
|
+
// ============================================================================
|
|
420
|
+
// Tool Metadata
|
|
421
|
+
// ============================================================================
|
|
426
422
|
// Add metadata for UI display
|
|
423
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
427
424
|
artifactsCp.prettyName = "Copy Artifact";
|
|
425
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
428
426
|
artifactsCp.icon = "Upload";
|
|
427
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
429
428
|
artifactsCp.verbiage = {
|
|
430
429
|
active: "Copying artifact to {destination}",
|
|
431
430
|
past: "Copied artifact to {destination}",
|
|
432
431
|
paramKey: "destination",
|
|
433
432
|
};
|
|
434
|
-
|
|
435
|
-
|
|
433
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
434
|
+
artifactsDel.prettyName = "Delete Artifact";
|
|
435
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
436
436
|
artifactsDel.icon = "Trash";
|
|
437
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
437
438
|
artifactsDel.verbiage = {
|
|
438
439
|
active: "Deleting artifact {path}",
|
|
439
440
|
past: "Deleted artifact {path}",
|
|
440
441
|
paramKey: "path",
|
|
441
442
|
};
|
|
442
|
-
|
|
443
|
-
|
|
443
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
444
|
+
artifactsLs.prettyName = "List Artifacts";
|
|
445
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
444
446
|
artifactsLs.icon = "List";
|
|
447
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
445
448
|
artifactsLs.verbiage = {
|
|
446
449
|
active: "Listing artifacts",
|
|
447
450
|
past: "Listed artifacts",
|
|
448
451
|
};
|
|
449
|
-
|
|
450
|
-
|
|
452
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
453
|
+
artifactsUrl.prettyName = "Generate Artifact URL";
|
|
454
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
451
455
|
artifactsUrl.icon = "Link";
|
|
456
|
+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic metadata assignment to tool objects
|
|
452
457
|
artifactsUrl.verbiage = {
|
|
453
458
|
active: "Generating URL for {path}",
|
|
454
459
|
past: "Generated URL for {path}",
|
|
@@ -40,16 +40,16 @@ interface BrowserCloseResult {
|
|
|
40
40
|
export declare function makeBrowserTools(): readonly [import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
41
41
|
url: z.ZodString;
|
|
42
42
|
waitUntil: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
43
|
-
load: "load";
|
|
44
43
|
domcontentloaded: "domcontentloaded";
|
|
44
|
+
load: "load";
|
|
45
45
|
networkidle: "networkidle";
|
|
46
46
|
}>>>;
|
|
47
47
|
}, z.core.$strip>, {
|
|
48
48
|
url: string;
|
|
49
|
-
waitUntil: "
|
|
49
|
+
waitUntil: "domcontentloaded" | "load" | "networkidle";
|
|
50
50
|
}, {
|
|
51
51
|
url: string;
|
|
52
|
-
waitUntil?: "
|
|
52
|
+
waitUntil?: "domcontentloaded" | "load" | "networkidle" | undefined;
|
|
53
53
|
}, BrowserNavigateResult>, import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
54
54
|
fullPage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
55
55
|
selector: z.ZodOptional<z.ZodString>;
|
|
@@ -62,28 +62,28 @@ export declare function makeBrowserTools(): readonly [import("langchain").Dynami
|
|
|
62
62
|
}, BrowserScreenshotResult>, import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
63
63
|
selector: z.ZodOptional<z.ZodString>;
|
|
64
64
|
extractType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
65
|
-
text: "text";
|
|
66
65
|
html: "html";
|
|
66
|
+
text: "text";
|
|
67
67
|
}>>>;
|
|
68
68
|
}, z.core.$strip>, {
|
|
69
|
-
extractType: "text" | "html";
|
|
70
69
|
selector?: string | undefined;
|
|
70
|
+
extractType: "html" | "text";
|
|
71
71
|
}, {
|
|
72
72
|
selector?: string | undefined;
|
|
73
|
-
extractType?: "
|
|
73
|
+
extractType?: "html" | "text" | undefined;
|
|
74
74
|
}, BrowserExtractResult>, import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
75
75
|
selector: z.ZodString;
|
|
76
76
|
button: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
77
77
|
left: "left";
|
|
78
|
-
right: "right";
|
|
79
78
|
middle: "middle";
|
|
79
|
+
right: "right";
|
|
80
80
|
}>>>;
|
|
81
81
|
}, z.core.$strip>, {
|
|
82
82
|
selector: string;
|
|
83
|
-
button: "left" | "
|
|
83
|
+
button: "left" | "middle" | "right";
|
|
84
84
|
}, {
|
|
85
85
|
selector: string;
|
|
86
|
-
button?: "left" | "
|
|
86
|
+
button?: "left" | "middle" | "right" | undefined;
|
|
87
87
|
}, BrowserClickResult>, import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
88
88
|
selector: z.ZodString;
|
|
89
89
|
text: z.ZodString;
|
|
@@ -19,8 +19,8 @@ export declare function makeDocumentExtractTool(): import("langchain").DynamicSt
|
|
|
19
19
|
query: string;
|
|
20
20
|
target_tokens?: number;
|
|
21
21
|
}, {
|
|
22
|
+
session_id?: string | undefined;
|
|
22
23
|
file_path: string;
|
|
23
24
|
query: string;
|
|
24
|
-
session_id?: string | undefined;
|
|
25
25
|
target_tokens?: number | undefined;
|
|
26
26
|
}, string>;
|
|
@@ -9,8 +9,8 @@ export declare function makeFilesystemTools(): readonly [import("langchain").Dyn
|
|
|
9
9
|
glob: z.ZodOptional<z.ZodString>;
|
|
10
10
|
output_mode: z.ZodOptional<z.ZodEnum<{
|
|
11
11
|
content: "content";
|
|
12
|
-
files_with_matches: "files_with_matches";
|
|
13
12
|
count: "count";
|
|
13
|
+
files_with_matches: "files_with_matches";
|
|
14
14
|
}>>;
|
|
15
15
|
"-B": z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
"-A": z.ZodOptional<z.ZodNumber>;
|
|
@@ -24,7 +24,7 @@ export declare function makeFilesystemTools(): readonly [import("langchain").Dyn
|
|
|
24
24
|
pattern: string;
|
|
25
25
|
path?: string | undefined;
|
|
26
26
|
glob?: string | undefined;
|
|
27
|
-
output_mode?: "content" | "
|
|
27
|
+
output_mode?: "content" | "count" | "files_with_matches" | undefined;
|
|
28
28
|
"-B"?: number | undefined;
|
|
29
29
|
"-A"?: number | undefined;
|
|
30
30
|
"-C"?: number | undefined;
|
|
@@ -37,7 +37,7 @@ export declare function makeFilesystemTools(): readonly [import("langchain").Dyn
|
|
|
37
37
|
pattern: string;
|
|
38
38
|
path?: string | undefined;
|
|
39
39
|
glob?: string | undefined;
|
|
40
|
-
output_mode?: "content" | "
|
|
40
|
+
output_mode?: "content" | "count" | "files_with_matches" | undefined;
|
|
41
41
|
"-B"?: number | undefined;
|
|
42
42
|
"-A"?: number | undefined;
|
|
43
43
|
"-C"?: number | undefined;
|
|
@@ -12,36 +12,36 @@ interface GenerateImageResult {
|
|
|
12
12
|
export declare function makeGenerateImageTool(): import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
13
13
|
prompt: z.ZodString;
|
|
14
14
|
aspectRatio: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
"16:9": "16:9";
|
|
15
16
|
"1:1": "1:1";
|
|
16
17
|
"3:4": "3:4";
|
|
17
18
|
"4:3": "4:3";
|
|
18
|
-
"9:16": "9:16";
|
|
19
|
-
"16:9": "16:9";
|
|
20
19
|
"5:4": "5:4";
|
|
20
|
+
"9:16": "9:16";
|
|
21
21
|
}>>>;
|
|
22
22
|
}, z.core.$strip>, {
|
|
23
23
|
prompt: string;
|
|
24
|
-
aspectRatio: "1:1" | "3:4" | "4:3" | "
|
|
24
|
+
aspectRatio: "16:9" | "1:1" | "3:4" | "4:3" | "5:4" | "9:16";
|
|
25
25
|
}, {
|
|
26
26
|
prompt: string;
|
|
27
|
-
aspectRatio?: "1:1" | "3:4" | "4:3" | "
|
|
27
|
+
aspectRatio?: "16:9" | "1:1" | "3:4" | "4:3" | "5:4" | "9:16" | undefined;
|
|
28
28
|
}, GenerateImageResult>;
|
|
29
29
|
/** Create generate image tool using Town proxy */
|
|
30
30
|
export declare function makeTownGenerateImageTool(): import("langchain").DynamicStructuredTool<z.ZodObject<{
|
|
31
31
|
prompt: z.ZodString;
|
|
32
32
|
aspectRatio: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
"16:9": "16:9";
|
|
33
34
|
"1:1": "1:1";
|
|
34
35
|
"3:4": "3:4";
|
|
35
36
|
"4:3": "4:3";
|
|
36
|
-
"9:16": "9:16";
|
|
37
|
-
"16:9": "16:9";
|
|
38
37
|
"5:4": "5:4";
|
|
38
|
+
"9:16": "9:16";
|
|
39
39
|
}>>>;
|
|
40
40
|
}, z.core.$strip>, {
|
|
41
41
|
prompt: string;
|
|
42
|
-
aspectRatio: "1:1" | "3:4" | "4:3" | "
|
|
42
|
+
aspectRatio: "16:9" | "1:1" | "3:4" | "4:3" | "5:4" | "9:16";
|
|
43
43
|
}, {
|
|
44
44
|
prompt: string;
|
|
45
|
-
aspectRatio?: "1:1" | "3:4" | "4:3" | "
|
|
45
|
+
aspectRatio?: "16:9" | "1:1" | "3:4" | "4:3" | "5:4" | "9:16" | undefined;
|
|
46
46
|
}, GenerateImageResult>;
|
|
47
47
|
export {};
|