@polka-codes/core 0.9.88 → 0.9.89
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 +27 -1
- package/dist/_tsup-dts-rollup.d.ts +221 -12
- package/dist/index.d.ts +11 -0
- package/dist/index.js +435 -300
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,10 @@ Core AI services and agent implementations for Polka Codes framework.
|
|
|
10
10
|
|
|
11
11
|
- Multiple AI provider support (Anthropic, DeepSeek, GoogleVertex, Ollama, OpenAI, and OpenRouter)
|
|
12
12
|
- Extensible agent architecture
|
|
13
|
-
- Tool integration system
|
|
13
|
+
- Tool integration system with safety enhancements
|
|
14
14
|
- Type-safe API
|
|
15
15
|
- Logging and monitoring
|
|
16
|
+
- File operation safety (read-first enforcement, line numbers, partial reading)
|
|
16
17
|
|
|
17
18
|
## Installation
|
|
18
19
|
|
|
@@ -110,6 +111,31 @@ bun run build
|
|
|
110
111
|
bun test
|
|
111
112
|
```
|
|
112
113
|
|
|
114
|
+
### Line Numbers
|
|
115
|
+
|
|
116
|
+
All file reads include line numbers for easy reference:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
1→import React from 'react';
|
|
120
|
+
2→
|
|
121
|
+
3→function App() {
|
|
122
|
+
4→ return <div>Hello</div>;
|
|
123
|
+
5→}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Partial File Reading
|
|
127
|
+
|
|
128
|
+
You can read specific sections of a file using `offset` and `limit` parameters:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
// Read lines 100-150 of a large file
|
|
132
|
+
await readFile.handler(provider, {
|
|
133
|
+
path: 'large-file.ts',
|
|
134
|
+
offset: 100, // Skip first 100 lines
|
|
135
|
+
limit: 50 // Read 50 lines
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
113
139
|
---
|
|
114
140
|
|
|
115
141
|
*This README was generated by polka.codes*
|
|
@@ -265,6 +265,14 @@ declare const configSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
|
265
265
|
maxAutoApprovalCost: z.ZodOptional<z.ZodNumber>;
|
|
266
266
|
}, z.core.$strict>>;
|
|
267
267
|
}, z.core.$strict>>;
|
|
268
|
+
memory: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
270
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
271
|
+
sqlite: "sqlite";
|
|
272
|
+
memory: "memory";
|
|
273
|
+
}>>>;
|
|
274
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
268
276
|
}, z.core.$strict>>>;
|
|
269
277
|
export { configSchema }
|
|
270
278
|
export { configSchema as configSchema_alias_1 }
|
|
@@ -389,6 +397,18 @@ export { createValidationErrorResponse }
|
|
|
389
397
|
export { createValidationErrorResponse as createValidationErrorResponse_alias_1 }
|
|
390
398
|
export { createValidationErrorResponse as createValidationErrorResponse_alias_2 }
|
|
391
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Database statistics
|
|
402
|
+
*/
|
|
403
|
+
declare type DatabaseStats = {
|
|
404
|
+
totalEntries: number;
|
|
405
|
+
entriesByType: Record<string, number>;
|
|
406
|
+
databaseSize: number;
|
|
407
|
+
};
|
|
408
|
+
export { DatabaseStats }
|
|
409
|
+
export { DatabaseStats as DatabaseStats_alias_1 }
|
|
410
|
+
export { DatabaseStats as DatabaseStats_alias_2 }
|
|
411
|
+
|
|
392
412
|
declare const _default: {
|
|
393
413
|
handler: ToolHandler<{
|
|
394
414
|
readonly name: "askFollowupQuestion";
|
|
@@ -456,14 +476,14 @@ export { _default_11 as searchFiles_alias_1 }
|
|
|
456
476
|
declare const _default_12: {
|
|
457
477
|
handler: ToolHandler<{
|
|
458
478
|
readonly name: "writeToFile";
|
|
459
|
-
readonly description: "Request to write content to a file at the specified path
|
|
479
|
+
readonly description: "Request to write content to a file at the specified path.\n\nWhen to use:\n- Creating new files\n- Completely replacing file contents\n- When you have the complete intended content\n\nWhen NOT to use:\n- For modifying existing files: Use replaceInFile instead\n- For appending content: Use executeCommand with echo >> instead\n- For targeted edits: Use replaceInFile instead\n\nFeatures:\n- Automatically creates any directories needed\n- Overwrites existing files completely\n- Must provide complete file content (no truncation)\n\nIMPORTANT CONSTRAINT:\n- Always provide COMPLETE intended content (no omissions)\n- Ensure no incorrect escape sequences (<, >, &)\n- Ensure no unwanted CDATA tags in content";
|
|
460
480
|
readonly parameters: z.ZodObject<{
|
|
461
481
|
path: z.ZodString;
|
|
462
482
|
content: z.ZodString;
|
|
463
483
|
}, z.core.$strip>;
|
|
464
484
|
}, FilesystemProvider>;
|
|
465
485
|
name: "writeToFile";
|
|
466
|
-
description: "Request to write content to a file at the specified path
|
|
486
|
+
description: "Request to write content to a file at the specified path.\n\nWhen to use:\n- Creating new files\n- Completely replacing file contents\n- When you have the complete intended content\n\nWhen NOT to use:\n- For modifying existing files: Use replaceInFile instead\n- For appending content: Use executeCommand with echo >> instead\n- For targeted edits: Use replaceInFile instead\n\nFeatures:\n- Automatically creates any directories needed\n- Overwrites existing files completely\n- Must provide complete file content (no truncation)\n\nIMPORTANT CONSTRAINT:\n- Always provide COMPLETE intended content (no omissions)\n- Ensure no incorrect escape sequences (<, >, &)\n- Ensure no unwanted CDATA tags in content";
|
|
467
487
|
parameters: z.ZodObject<{
|
|
468
488
|
path: z.ZodString;
|
|
469
489
|
content: z.ZodString;
|
|
@@ -556,16 +576,20 @@ export { _default_5 as readBinaryFile_alias_1 }
|
|
|
556
576
|
declare const _default_6: {
|
|
557
577
|
handler: ToolHandler<{
|
|
558
578
|
readonly name: "readFile";
|
|
559
|
-
readonly description: "Request to read the contents of one or multiple files at the specified paths
|
|
579
|
+
readonly description: "Request to read the contents of one or multiple files at the specified paths.\n\nWhen to use:\n- Examining file contents you don't know\n- Analyzing code, reviewing text files, extracting configuration info\n- Reading multiple files at once (use comma-separated paths)\n- Understanding file structure before editing\n\nWhen NOT to use:\n- For file existence checks: Use listFiles instead\n- For searching within files: Use grep instead\n- For file name searches: Use searchFiles instead\n- Prefer this tool over executeCommand with cat/head/tail\n\nFeatures:\n- Supports comma-separated paths for multiple files\n- Line numbers included for easy reference\n- Optional offset/limit for partial file reading\n- Automatically handles different file types\n\nIMPORTANT:\n- Line numbers are included for easy reference\n- Use offset/limit for large files to read specific sections";
|
|
560
580
|
readonly parameters: z.ZodObject<{
|
|
561
|
-
path: z.ZodPipe<z.ZodTransform<
|
|
581
|
+
path: z.ZodPipe<z.ZodTransform<any[], unknown>, z.ZodArray<z.ZodString>>;
|
|
582
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
583
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
562
584
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>>;
|
|
563
585
|
}, z.core.$strip>;
|
|
564
586
|
}, FilesystemProvider>;
|
|
565
587
|
name: "readFile";
|
|
566
|
-
description: "Request to read the contents of one or multiple files at the specified paths
|
|
588
|
+
description: "Request to read the contents of one or multiple files at the specified paths.\n\nWhen to use:\n- Examining file contents you don't know\n- Analyzing code, reviewing text files, extracting configuration info\n- Reading multiple files at once (use comma-separated paths)\n- Understanding file structure before editing\n\nWhen NOT to use:\n- For file existence checks: Use listFiles instead\n- For searching within files: Use grep instead\n- For file name searches: Use searchFiles instead\n- Prefer this tool over executeCommand with cat/head/tail\n\nFeatures:\n- Supports comma-separated paths for multiple files\n- Line numbers included for easy reference\n- Optional offset/limit for partial file reading\n- Automatically handles different file types\n\nIMPORTANT:\n- Line numbers are included for easy reference\n- Use offset/limit for large files to read specific sections";
|
|
567
589
|
parameters: z.ZodObject<{
|
|
568
|
-
path: z.ZodPipe<z.ZodTransform<
|
|
590
|
+
path: z.ZodPipe<z.ZodTransform<any[], unknown>, z.ZodArray<z.ZodString>>;
|
|
591
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
592
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
569
593
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>>;
|
|
570
594
|
}, z.core.$strip>;
|
|
571
595
|
};
|
|
@@ -614,14 +638,14 @@ export { _default_8 as renameFile_alias_1 }
|
|
|
614
638
|
declare const _default_9: {
|
|
615
639
|
handler: ToolHandler<{
|
|
616
640
|
readonly name: "replaceInFile";
|
|
617
|
-
readonly description: "Request to replace sections of content in an existing file using
|
|
641
|
+
readonly description: "Request to replace sections of content in an existing file using\nSEARCH/REPLACE blocks.\n\nWhen to use:\n- Making targeted changes to specific parts of a file\n- Replacing variable names, function signatures, imports\n- Fixing bugs in existing code\n- When you know the exact content to replace\n\nWhen NOT to use:\n- For creating new files: Use writeToFile instead\n- For completely replacing file contents: Use writeToFile instead\n- When you don't know the exact content: Read file first\n\nSEARCH/REPLACE FORMAT:\n<<<<<<< SEARCH\n[exact content to find]\n=======\n[new content to replace with]\n>>>>>>> REPLACE\n\nCritical rules:\n1. SEARCH content must match EXACTLY (character-for-character including whitespace)\n2. Each block replaces only first occurrence\n3. Include just enough lines for uniqueness (not too many, not too few)\n4. Keep blocks concise (don't include long unchanged sections)\n5. List blocks in order they appear in file\n6. Use multiple blocks for multiple independent changes\n\nSpecial operations:\n- Move code: Two blocks (delete from original + insert at new location)\n- Delete code: Empty REPLACE section\n\nIMPORTANT CONSTRAINTS:\n- SEARCH text must match file content exactly\n- Each block is independent (doesn't affect other blocks)\n- Cannot use for appending or inserting without SEARCH context";
|
|
618
642
|
readonly parameters: z.ZodObject<{
|
|
619
643
|
path: z.ZodString;
|
|
620
644
|
diff: z.ZodString;
|
|
621
645
|
}, z.core.$strip>;
|
|
622
646
|
}, FilesystemProvider>;
|
|
623
647
|
name: "replaceInFile";
|
|
624
|
-
description: "Request to replace sections of content in an existing file using
|
|
648
|
+
description: "Request to replace sections of content in an existing file using\nSEARCH/REPLACE blocks.\n\nWhen to use:\n- Making targeted changes to specific parts of a file\n- Replacing variable names, function signatures, imports\n- Fixing bugs in existing code\n- When you know the exact content to replace\n\nWhen NOT to use:\n- For creating new files: Use writeToFile instead\n- For completely replacing file contents: Use writeToFile instead\n- When you don't know the exact content: Read file first\n\nSEARCH/REPLACE FORMAT:\n<<<<<<< SEARCH\n[exact content to find]\n=======\n[new content to replace with]\n>>>>>>> REPLACE\n\nCritical rules:\n1. SEARCH content must match EXACTLY (character-for-character including whitespace)\n2. Each block replaces only first occurrence\n3. Include just enough lines for uniqueness (not too many, not too few)\n4. Keep blocks concise (don't include long unchanged sections)\n5. List blocks in order they appear in file\n6. Use multiple blocks for multiple independent changes\n\nSpecial operations:\n- Move code: Two blocks (delete from original + insert at new location)\n- Delete code: Empty REPLACE section\n\nIMPORTANT CONSTRAINTS:\n- SEARCH text must match file content exactly\n- Each block is independent (doesn't affect other blocks)\n- Cannot use for appending or inserting without SEARCH context";
|
|
625
649
|
parameters: z.ZodObject<{
|
|
626
650
|
path: z.ZodString;
|
|
627
651
|
diff: z.ZodString;
|
|
@@ -631,6 +655,14 @@ export { _default_9 as default_alias_8 }
|
|
|
631
655
|
export { _default_9 as replaceInFile }
|
|
632
656
|
export { _default_9 as replaceInFile_alias_1 }
|
|
633
657
|
|
|
658
|
+
/**
|
|
659
|
+
* Default memory configuration
|
|
660
|
+
*/
|
|
661
|
+
declare const DEFAULT_MEMORY_CONFIG: MemoryConfig;
|
|
662
|
+
export { DEFAULT_MEMORY_CONFIG }
|
|
663
|
+
export { DEFAULT_MEMORY_CONFIG as DEFAULT_MEMORY_CONFIG_alias_1 }
|
|
664
|
+
export { DEFAULT_MEMORY_CONFIG as DEFAULT_MEMORY_CONFIG_alias_2 }
|
|
665
|
+
|
|
634
666
|
/**
|
|
635
667
|
* Represents a directory entry
|
|
636
668
|
*/
|
|
@@ -803,6 +835,7 @@ export { FileSystemProvider as FileSystemProvider_alias_2 }
|
|
|
803
835
|
declare type FilesystemProvider = {
|
|
804
836
|
readFile?: (path: string, includeIgnored: boolean) => Promise<string | undefined>;
|
|
805
837
|
writeFile?: (path: string, content: string) => Promise<void>;
|
|
838
|
+
fileExists?: (path: string) => Promise<boolean>;
|
|
806
839
|
removeFile?: (path: string) => Promise<void>;
|
|
807
840
|
renameFile?: (sourcePath: string, targetPath: string) => Promise<void>;
|
|
808
841
|
listFiles?: (path: string, recursive: boolean, maxCount: number, includeIgnored: boolean) => Promise<[string[], boolean]>;
|
|
@@ -915,6 +948,64 @@ export { IGNORED_DIRECTORIES }
|
|
|
915
948
|
export { IGNORED_DIRECTORIES as IGNORED_DIRECTORIES_alias_1 }
|
|
916
949
|
export { IGNORED_DIRECTORIES as IGNORED_DIRECTORIES_alias_2 }
|
|
917
950
|
|
|
951
|
+
/**
|
|
952
|
+
* Memory Store Interface
|
|
953
|
+
*
|
|
954
|
+
* This interface defines the contract for memory store implementations.
|
|
955
|
+
* Implementations can use different storage backends (SQLite, PostgreSQL, Redis, etc.)
|
|
956
|
+
* while maintaining the same API for the core memory logic.
|
|
957
|
+
*/
|
|
958
|
+
declare interface IMemoryStore {
|
|
959
|
+
/**
|
|
960
|
+
* Read memory by topic name
|
|
961
|
+
*
|
|
962
|
+
* @param topic - The topic name
|
|
963
|
+
* @returns The content, or undefined if not found
|
|
964
|
+
*/
|
|
965
|
+
readMemory(topic: string): Promise<string | undefined>;
|
|
966
|
+
/**
|
|
967
|
+
* Update memory with operation
|
|
968
|
+
*
|
|
969
|
+
* @param operation - The operation to perform ('append', 'replace', 'remove')
|
|
970
|
+
* @param topic - The topic name
|
|
971
|
+
* @param content - The content (required for append/replace)
|
|
972
|
+
* @param metadata - Optional metadata (entry_type, status, priority, tags)
|
|
973
|
+
*/
|
|
974
|
+
updateMemory(operation: 'append' | 'replace' | 'remove', topic: string, content: string | undefined, metadata?: {
|
|
975
|
+
entry_type?: string;
|
|
976
|
+
status?: string;
|
|
977
|
+
priority?: string;
|
|
978
|
+
tags?: string;
|
|
979
|
+
}): Promise<void>;
|
|
980
|
+
/**
|
|
981
|
+
* Query memory with filters
|
|
982
|
+
*
|
|
983
|
+
* @param query - The query filters
|
|
984
|
+
* @param options - Query options (operation, includeMetadata)
|
|
985
|
+
* @returns Array of entries or count
|
|
986
|
+
*/
|
|
987
|
+
queryMemory(query: MemoryQuery, options?: QueryOptions): Promise<MemoryEntry[] | number>;
|
|
988
|
+
/**
|
|
989
|
+
* Batch update memory
|
|
990
|
+
*
|
|
991
|
+
* @param operations - Array of memory operations
|
|
992
|
+
*/
|
|
993
|
+
batchUpdateMemory(operations: MemoryOperation[]): Promise<void>;
|
|
994
|
+
/**
|
|
995
|
+
* Get database statistics
|
|
996
|
+
*
|
|
997
|
+
* @returns Database statistics
|
|
998
|
+
*/
|
|
999
|
+
getStats(): Promise<DatabaseStats>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Close the memory store and release resources
|
|
1002
|
+
*/
|
|
1003
|
+
close(): void;
|
|
1004
|
+
}
|
|
1005
|
+
export { IMemoryStore }
|
|
1006
|
+
export { IMemoryStore as IMemoryStore_alias_1 }
|
|
1007
|
+
export { IMemoryStore as IMemoryStore_alias_2 }
|
|
1008
|
+
|
|
918
1009
|
declare type InteractionProvider = {
|
|
919
1010
|
askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
|
|
920
1011
|
};
|
|
@@ -1280,6 +1371,67 @@ declare const mcpServerConfigSchema: z.ZodObject<{
|
|
|
1280
1371
|
export { mcpServerConfigSchema }
|
|
1281
1372
|
export { mcpServerConfigSchema as mcpServerConfigSchema_alias_1 }
|
|
1282
1373
|
|
|
1374
|
+
declare type MemoryConfig = z.infer<typeof memoryConfigSchema> & MemoryStoreConfig;
|
|
1375
|
+
export { MemoryConfig }
|
|
1376
|
+
export { MemoryConfig as MemoryConfig_alias_1 }
|
|
1377
|
+
export { MemoryConfig as MemoryConfig_alias_2 }
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Memory configuration schema
|
|
1381
|
+
* Controls the persistent memory store feature
|
|
1382
|
+
*/
|
|
1383
|
+
declare const memoryConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
1384
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1385
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1386
|
+
sqlite: "sqlite";
|
|
1387
|
+
memory: "memory";
|
|
1388
|
+
}>>>;
|
|
1389
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1390
|
+
}, z.core.$strict>>;
|
|
1391
|
+
export { memoryConfigSchema }
|
|
1392
|
+
export { memoryConfigSchema as memoryConfigSchema_alias_1 }
|
|
1393
|
+
export { memoryConfigSchema as memoryConfigSchema_alias_2 }
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Memory entry types
|
|
1397
|
+
*/
|
|
1398
|
+
declare type MemoryEntry = {
|
|
1399
|
+
id: string;
|
|
1400
|
+
name: string;
|
|
1401
|
+
scope: string;
|
|
1402
|
+
content: string;
|
|
1403
|
+
entry_type: string;
|
|
1404
|
+
status?: string;
|
|
1405
|
+
priority?: 'low' | 'medium' | 'high' | 'critical';
|
|
1406
|
+
tags?: string;
|
|
1407
|
+
metadata?: string;
|
|
1408
|
+
created_at: number;
|
|
1409
|
+
updated_at: number;
|
|
1410
|
+
last_accessed: number;
|
|
1411
|
+
};
|
|
1412
|
+
export { MemoryEntry }
|
|
1413
|
+
export { MemoryEntry as MemoryEntry_alias_1 }
|
|
1414
|
+
export { MemoryEntry as MemoryEntry_alias_2 }
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Memory operation for batch updates
|
|
1418
|
+
*/
|
|
1419
|
+
declare type MemoryOperation = {
|
|
1420
|
+
operation: 'append' | 'replace' | 'remove';
|
|
1421
|
+
name: string;
|
|
1422
|
+
content?: string;
|
|
1423
|
+
metadata?: {
|
|
1424
|
+
entry_type?: string;
|
|
1425
|
+
status?: string;
|
|
1426
|
+
priority?: string;
|
|
1427
|
+
tags?: string;
|
|
1428
|
+
metadata?: string;
|
|
1429
|
+
};
|
|
1430
|
+
};
|
|
1431
|
+
export { MemoryOperation }
|
|
1432
|
+
export { MemoryOperation as MemoryOperation_alias_1 }
|
|
1433
|
+
export { MemoryOperation as MemoryOperation_alias_2 }
|
|
1434
|
+
|
|
1283
1435
|
declare interface MemoryProvider {
|
|
1284
1436
|
listMemoryTopics: () => Promise<string[]>;
|
|
1285
1437
|
readMemory: (topic?: string) => Promise<string | undefined>;
|
|
@@ -1289,6 +1441,42 @@ export { MemoryProvider }
|
|
|
1289
1441
|
export { MemoryProvider as MemoryProvider_alias_1 }
|
|
1290
1442
|
export { MemoryProvider as MemoryProvider_alias_2 }
|
|
1291
1443
|
|
|
1444
|
+
/**
|
|
1445
|
+
* Memory query filters
|
|
1446
|
+
*/
|
|
1447
|
+
declare type MemoryQuery = {
|
|
1448
|
+
scope?: 'global' | 'project' | 'auto';
|
|
1449
|
+
type?: string;
|
|
1450
|
+
status?: string;
|
|
1451
|
+
priority?: string;
|
|
1452
|
+
tags?: string | string[];
|
|
1453
|
+
search?: string;
|
|
1454
|
+
limit?: number;
|
|
1455
|
+
offset?: number;
|
|
1456
|
+
sortBy?: 'created' | 'updated' | 'accessed' | 'name';
|
|
1457
|
+
sortOrder?: 'asc' | 'desc';
|
|
1458
|
+
createdAfter?: number;
|
|
1459
|
+
createdBefore?: number;
|
|
1460
|
+
updatedAfter?: number;
|
|
1461
|
+
updatedBefore?: number;
|
|
1462
|
+
};
|
|
1463
|
+
export { MemoryQuery }
|
|
1464
|
+
export { MemoryQuery as MemoryQuery_alias_1 }
|
|
1465
|
+
export { MemoryQuery as MemoryQuery_alias_2 }
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Memory Store Configuration
|
|
1469
|
+
*/
|
|
1470
|
+
declare type MemoryStoreConfig = {
|
|
1471
|
+
enabled: boolean;
|
|
1472
|
+
type: 'sqlite' | 'memory' | string;
|
|
1473
|
+
path?: string;
|
|
1474
|
+
[key: string]: any;
|
|
1475
|
+
};
|
|
1476
|
+
export { MemoryStoreConfig }
|
|
1477
|
+
export { MemoryStoreConfig as MemoryStoreConfig_alias_1 }
|
|
1478
|
+
export { MemoryStoreConfig as MemoryStoreConfig_alias_2 }
|
|
1479
|
+
|
|
1292
1480
|
declare class MockProvider implements ToolProvider {
|
|
1293
1481
|
listTodoItems(id?: string | null, _status?: string | null): Promise<{
|
|
1294
1482
|
id: string;
|
|
@@ -1414,6 +1602,17 @@ declare const providerModelSchema: z.ZodObject<{
|
|
|
1414
1602
|
export { providerModelSchema }
|
|
1415
1603
|
export { providerModelSchema as providerModelSchema_alias_1 }
|
|
1416
1604
|
|
|
1605
|
+
/**
|
|
1606
|
+
* Query options
|
|
1607
|
+
*/
|
|
1608
|
+
declare type QueryOptions = {
|
|
1609
|
+
operation?: 'select' | 'delete' | 'count';
|
|
1610
|
+
includeMetadata?: boolean;
|
|
1611
|
+
};
|
|
1612
|
+
export { QueryOptions }
|
|
1613
|
+
export { QueryOptions as QueryOptions_alias_1 }
|
|
1614
|
+
export { QueryOptions as QueryOptions_alias_2 }
|
|
1615
|
+
|
|
1417
1616
|
/**
|
|
1418
1617
|
* Read a supporting file from a loaded skill
|
|
1419
1618
|
*
|
|
@@ -1493,6 +1692,14 @@ declare type ReplaceResult = {
|
|
|
1493
1692
|
export { ReplaceResult }
|
|
1494
1693
|
export { ReplaceResult as ReplaceResult_alias_1 }
|
|
1495
1694
|
|
|
1695
|
+
/**
|
|
1696
|
+
* Resolve home directory in path
|
|
1697
|
+
*/
|
|
1698
|
+
declare function resolveHomePath(path: string): string;
|
|
1699
|
+
export { resolveHomePath }
|
|
1700
|
+
export { resolveHomePath as resolveHomePath_alias_1 }
|
|
1701
|
+
export { resolveHomePath as resolveHomePath_alias_2 }
|
|
1702
|
+
|
|
1496
1703
|
declare const responsePrompts: {
|
|
1497
1704
|
readonly errorInvokeTool: (tool: string, error: unknown) => string;
|
|
1498
1705
|
readonly requireUseTool: "Error: No tool use detected. You MUST use a tool before proceeding.\ne.g. <tool_tool_name>tool_name</tool_tool_name>\n\nEnsure the opening and closing tags are correctly nested and closed, and that you are using the correct tool name.\nAvoid unnecessary text or symbols before or after the tool use.\nAvoid unnecessary escape characters or special characters.\n";
|
|
@@ -2024,7 +2231,7 @@ export declare const toolInfo_alias_10: {
|
|
|
2024
2231
|
|
|
2025
2232
|
export declare const toolInfo_alias_11: {
|
|
2026
2233
|
readonly name: "writeToFile";
|
|
2027
|
-
readonly description: "Request to write content to a file at the specified path
|
|
2234
|
+
readonly description: "Request to write content to a file at the specified path.\n\nWhen to use:\n- Creating new files\n- Completely replacing file contents\n- When you have the complete intended content\n\nWhen NOT to use:\n- For modifying existing files: Use replaceInFile instead\n- For appending content: Use executeCommand with echo >> instead\n- For targeted edits: Use replaceInFile instead\n\nFeatures:\n- Automatically creates any directories needed\n- Overwrites existing files completely\n- Must provide complete file content (no truncation)\n\nIMPORTANT CONSTRAINT:\n- Always provide COMPLETE intended content (no omissions)\n- Ensure no incorrect escape sequences (<, >, &)\n- Ensure no unwanted CDATA tags in content";
|
|
2028
2235
|
readonly parameters: z.ZodObject<{
|
|
2029
2236
|
path: z.ZodString;
|
|
2030
2237
|
content: z.ZodString;
|
|
@@ -2060,9 +2267,11 @@ export declare const toolInfo_alias_4: {
|
|
|
2060
2267
|
|
|
2061
2268
|
export declare const toolInfo_alias_5: {
|
|
2062
2269
|
readonly name: "readFile";
|
|
2063
|
-
readonly description: "Request to read the contents of one or multiple files at the specified paths
|
|
2270
|
+
readonly description: "Request to read the contents of one or multiple files at the specified paths.\n\nWhen to use:\n- Examining file contents you don't know\n- Analyzing code, reviewing text files, extracting configuration info\n- Reading multiple files at once (use comma-separated paths)\n- Understanding file structure before editing\n\nWhen NOT to use:\n- For file existence checks: Use listFiles instead\n- For searching within files: Use grep instead\n- For file name searches: Use searchFiles instead\n- Prefer this tool over executeCommand with cat/head/tail\n\nFeatures:\n- Supports comma-separated paths for multiple files\n- Line numbers included for easy reference\n- Optional offset/limit for partial file reading\n- Automatically handles different file types\n\nIMPORTANT:\n- Line numbers are included for easy reference\n- Use offset/limit for large files to read specific sections";
|
|
2064
2271
|
readonly parameters: z.ZodObject<{
|
|
2065
|
-
path: z.ZodPipe<z.ZodTransform<
|
|
2272
|
+
path: z.ZodPipe<z.ZodTransform<any[], unknown>, z.ZodArray<z.ZodString>>;
|
|
2273
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
2274
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2066
2275
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>>;
|
|
2067
2276
|
}, z.core.$strip>;
|
|
2068
2277
|
};
|
|
@@ -2086,7 +2295,7 @@ export declare const toolInfo_alias_7: {
|
|
|
2086
2295
|
|
|
2087
2296
|
export declare const toolInfo_alias_8: {
|
|
2088
2297
|
readonly name: "replaceInFile";
|
|
2089
|
-
readonly description: "Request to replace sections of content in an existing file using
|
|
2298
|
+
readonly description: "Request to replace sections of content in an existing file using\nSEARCH/REPLACE blocks.\n\nWhen to use:\n- Making targeted changes to specific parts of a file\n- Replacing variable names, function signatures, imports\n- Fixing bugs in existing code\n- When you know the exact content to replace\n\nWhen NOT to use:\n- For creating new files: Use writeToFile instead\n- For completely replacing file contents: Use writeToFile instead\n- When you don't know the exact content: Read file first\n\nSEARCH/REPLACE FORMAT:\n<<<<<<< SEARCH\n[exact content to find]\n=======\n[new content to replace with]\n>>>>>>> REPLACE\n\nCritical rules:\n1. SEARCH content must match EXACTLY (character-for-character including whitespace)\n2. Each block replaces only first occurrence\n3. Include just enough lines for uniqueness (not too many, not too few)\n4. Keep blocks concise (don't include long unchanged sections)\n5. List blocks in order they appear in file\n6. Use multiple blocks for multiple independent changes\n\nSpecial operations:\n- Move code: Two blocks (delete from original + insert at new location)\n- Delete code: Empty REPLACE section\n\nIMPORTANT CONSTRAINTS:\n- SEARCH text must match file content exactly\n- Each block is independent (doesn't affect other blocks)\n- Cannot use for appending or inserting without SEARCH context";
|
|
2090
2299
|
readonly parameters: z.ZodObject<{
|
|
2091
2300
|
path: z.ZodString;
|
|
2092
2301
|
diff: z.ZodString;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export { ParseOutputResult } from './_tsup-dts-rollup.js';
|
|
|
3
3
|
export { parseJsonFromMarkdown } from './_tsup-dts-rollup.js';
|
|
4
4
|
export { responsePrompts } from './_tsup-dts-rollup.js';
|
|
5
5
|
export { computeRateLimitBackoffSeconds } from './_tsup-dts-rollup.js';
|
|
6
|
+
export { memoryConfigSchema_alias_1 as memoryConfigSchema } from './_tsup-dts-rollup.js';
|
|
7
|
+
export { DEFAULT_MEMORY_CONFIG_alias_1 as DEFAULT_MEMORY_CONFIG } from './_tsup-dts-rollup.js';
|
|
8
|
+
export { MemoryConfig_alias_1 as MemoryConfig } from './_tsup-dts-rollup.js';
|
|
9
|
+
export { resolveHomePath_alias_1 as resolveHomePath } from './_tsup-dts-rollup.js';
|
|
6
10
|
export { ruleSchema_alias_1 as ruleSchema } from './_tsup-dts-rollup.js';
|
|
7
11
|
export { providerConfigSchema_alias_1 as providerConfigSchema } from './_tsup-dts-rollup.js';
|
|
8
12
|
export { providerModelSchema_alias_1 as providerModelSchema } from './_tsup-dts-rollup.js';
|
|
@@ -19,6 +23,13 @@ export { DirectoryEntry } from './_tsup-dts-rollup.js';
|
|
|
19
23
|
export { FileStats } from './_tsup-dts-rollup.js';
|
|
20
24
|
export { FileSystemProvider } from './_tsup-dts-rollup.js';
|
|
21
25
|
export { FileSystemProviderOptions } from './_tsup-dts-rollup.js';
|
|
26
|
+
export { MemoryEntry } from './_tsup-dts-rollup.js';
|
|
27
|
+
export { MemoryQuery } from './_tsup-dts-rollup.js';
|
|
28
|
+
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
29
|
+
export { MemoryOperation } from './_tsup-dts-rollup.js';
|
|
30
|
+
export { DatabaseStats } from './_tsup-dts-rollup.js';
|
|
31
|
+
export { IMemoryStore } from './_tsup-dts-rollup.js';
|
|
32
|
+
export { MemoryStoreConfig } from './_tsup-dts-rollup.js';
|
|
22
33
|
export { SKILL_LIMITS } from './_tsup-dts-rollup.js';
|
|
23
34
|
export { IGNORED_DIRECTORIES } from './_tsup-dts-rollup.js';
|
|
24
35
|
export { SUSPICIOUS_PATTERNS } from './_tsup-dts-rollup.js';
|