borderless-agent 0.0.1-alpha.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.
Files changed (90) hide show
  1. package/README.md +274 -0
  2. package/dist/agentBuilder.d.ts +51 -0
  3. package/dist/agentBuilder.d.ts.map +1 -0
  4. package/dist/agentBuilder.js +130 -0
  5. package/dist/agentBuilder.js.map +1 -0
  6. package/dist/agentInstance.d.ts +45 -0
  7. package/dist/agentInstance.d.ts.map +1 -0
  8. package/dist/agentInstance.js +501 -0
  9. package/dist/agentInstance.js.map +1 -0
  10. package/dist/agentsCore.d.ts +16 -0
  11. package/dist/agentsCore.d.ts.map +1 -0
  12. package/dist/agentsCore.js +50 -0
  13. package/dist/agentsCore.js.map +1 -0
  14. package/dist/cli/index.d.ts +5 -0
  15. package/dist/cli/index.d.ts.map +1 -0
  16. package/dist/cli/index.js +11 -0
  17. package/dist/cli/index.js.map +1 -0
  18. package/dist/cli/main.d.ts +36 -0
  19. package/dist/cli/main.d.ts.map +1 -0
  20. package/dist/cli/main.js +306 -0
  21. package/dist/cli/main.js.map +1 -0
  22. package/dist/config.d.ts +26 -0
  23. package/dist/config.d.ts.map +1 -0
  24. package/dist/config.js +98 -0
  25. package/dist/config.js.map +1 -0
  26. package/dist/contextCore.d.ts +97 -0
  27. package/dist/contextCore.d.ts.map +1 -0
  28. package/dist/contextCore.js +533 -0
  29. package/dist/contextCore.js.map +1 -0
  30. package/dist/index.d.ts +28 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +46 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/llmProtocol.d.ts +60 -0
  35. package/dist/llmProtocol.d.ts.map +1 -0
  36. package/dist/llmProtocol.js +202 -0
  37. package/dist/llmProtocol.js.map +1 -0
  38. package/dist/loopCore.d.ts +22 -0
  39. package/dist/loopCore.d.ts.map +1 -0
  40. package/dist/loopCore.js +288 -0
  41. package/dist/loopCore.js.map +1 -0
  42. package/dist/main.d.ts +9 -0
  43. package/dist/main.d.ts.map +1 -0
  44. package/dist/main.js +15 -0
  45. package/dist/main.js.map +1 -0
  46. package/dist/memoryCore.d.ts +37 -0
  47. package/dist/memoryCore.d.ts.map +1 -0
  48. package/dist/memoryCore.js +346 -0
  49. package/dist/memoryCore.js.map +1 -0
  50. package/dist/server/app.d.ts +13 -0
  51. package/dist/server/app.d.ts.map +1 -0
  52. package/dist/server/app.js +200 -0
  53. package/dist/server/app.js.map +1 -0
  54. package/dist/sessionCore.d.ts +54 -0
  55. package/dist/sessionCore.d.ts.map +1 -0
  56. package/dist/sessionCore.js +312 -0
  57. package/dist/sessionCore.js.map +1 -0
  58. package/dist/skillsCore.d.ts +23 -0
  59. package/dist/skillsCore.d.ts.map +1 -0
  60. package/dist/skillsCore.js +202 -0
  61. package/dist/skillsCore.js.map +1 -0
  62. package/dist/storage/cloudBackend.d.ts +48 -0
  63. package/dist/storage/cloudBackend.d.ts.map +1 -0
  64. package/dist/storage/cloudBackend.js +301 -0
  65. package/dist/storage/cloudBackend.js.map +1 -0
  66. package/dist/storage/fileBackend.d.ts +41 -0
  67. package/dist/storage/fileBackend.d.ts.map +1 -0
  68. package/dist/storage/fileBackend.js +240 -0
  69. package/dist/storage/fileBackend.js.map +1 -0
  70. package/dist/storage/index.d.ts +21 -0
  71. package/dist/storage/index.d.ts.map +1 -0
  72. package/dist/storage/index.js +58 -0
  73. package/dist/storage/index.js.map +1 -0
  74. package/dist/storage/protocols.d.ts +29 -0
  75. package/dist/storage/protocols.d.ts.map +1 -0
  76. package/dist/storage/protocols.js +20 -0
  77. package/dist/storage/protocols.js.map +1 -0
  78. package/dist/todoCore.d.ts +15 -0
  79. package/dist/todoCore.d.ts.map +1 -0
  80. package/dist/todoCore.js +52 -0
  81. package/dist/todoCore.js.map +1 -0
  82. package/dist/toolsCore.d.ts +31 -0
  83. package/dist/toolsCore.d.ts.map +1 -0
  84. package/dist/toolsCore.js +609 -0
  85. package/dist/toolsCore.js.map +1 -0
  86. package/dist/types.d.ts +144 -0
  87. package/dist/types.d.ts.map +1 -0
  88. package/dist/types.js +8 -0
  89. package/dist/types.js.map +1 -0
  90. package/package.json +48 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * storage/index.ts - Storage abstraction: file and cloud backends.
3
+ *
4
+ * Usage:
5
+ * Backend selection: set AGENT_STORAGE_BACKEND=file (default) or cloud.
6
+ * getStorageBackend() returns the backend for the current config.
7
+ */
8
+ import { StorageBackend, SessionStore, MemoryStore, SkillStore, ContextStore } from './protocols';
9
+ export declare function getStorageBackend(options?: {
10
+ backend?: string;
11
+ sessionDir?: string;
12
+ memoryFile?: string;
13
+ skillsDir?: string;
14
+ contextDir?: string;
15
+ }): StorageBackend;
16
+ export declare function getDefaultSessionStore(): SessionStore;
17
+ export declare function getDefaultMemoryStore(): MemoryStore;
18
+ export declare function getDefaultSkillStore(): SkillStore;
19
+ export declare function getDefaultContextStore(): ContextStore;
20
+ export { StorageBackend, SessionStore, MemoryStore, SkillStore, ContextStore, } from './protocols';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACH,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,EACf,MAAM,aAAa,CAAC;AAKrB,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,cAAc,CAsBjB;AAOD,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD;AAED,wBAAgB,oBAAoB,IAAI,UAAU,CAEjD;AAED,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED,OAAO,EACH,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,GACf,MAAM,aAAa,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * storage/index.ts - Storage abstraction: file and cloud backends.
4
+ *
5
+ * Usage:
6
+ * Backend selection: set AGENT_STORAGE_BACKEND=file (default) or cloud.
7
+ * getStorageBackend() returns the backend for the current config.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.StorageBackend = void 0;
11
+ exports.getStorageBackend = getStorageBackend;
12
+ exports.getDefaultSessionStore = getDefaultSessionStore;
13
+ exports.getDefaultMemoryStore = getDefaultMemoryStore;
14
+ exports.getDefaultSkillStore = getDefaultSkillStore;
15
+ exports.getDefaultContextStore = getDefaultContextStore;
16
+ const fileBackend_1 = require("./fileBackend");
17
+ let _defaultBackend = null;
18
+ function getStorageBackend(options) {
19
+ const choice = (options?.backend ??
20
+ process.env.AGENT_STORAGE_BACKEND ??
21
+ 'file')
22
+ .trim()
23
+ .toLowerCase();
24
+ if (choice === 'cloud') {
25
+ // Dynamic import to avoid requiring @aws-sdk when using file backend
26
+ const { createCloudBackend } = require('./cloudBackend');
27
+ _defaultBackend = createCloudBackend();
28
+ }
29
+ else {
30
+ _defaultBackend = (0, fileBackend_1.createFileBackend)({
31
+ sessionDir: options?.sessionDir,
32
+ memoryFile: options?.memoryFile,
33
+ skillsDir: options?.skillsDir,
34
+ contextDir: options?.contextDir,
35
+ });
36
+ }
37
+ return _defaultBackend;
38
+ }
39
+ function ensureBackend() {
40
+ if (!_defaultBackend)
41
+ getStorageBackend();
42
+ return _defaultBackend;
43
+ }
44
+ function getDefaultSessionStore() {
45
+ return ensureBackend().sessionStore;
46
+ }
47
+ function getDefaultMemoryStore() {
48
+ return ensureBackend().memoryStore;
49
+ }
50
+ function getDefaultSkillStore() {
51
+ return ensureBackend().skillStore;
52
+ }
53
+ function getDefaultContextStore() {
54
+ return ensureBackend().contextStore;
55
+ }
56
+ var protocols_1 = require("./protocols");
57
+ Object.defineProperty(exports, "StorageBackend", { enumerable: true, get: function () { return protocols_1.StorageBackend; } });
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAaH,8CA4BC;AAOD,wDAEC;AAED,sDAEC;AAED,oDAEC;AAED,wDAEC;AArDD,+CAAkD;AAElD,IAAI,eAAe,GAA0B,IAAI,CAAC;AAElD,SAAgB,iBAAiB,CAAC,OAMjC;IACG,MAAM,MAAM,GAAG,CACX,OAAO,EAAE,OAAO;QAChB,OAAO,CAAC,GAAG,CAAC,qBAAqB;QACjC,MAAM,CACT;SACI,IAAI,EAAE;SACN,WAAW,EAAE,CAAC;IAEnB,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACrB,qEAAqE;QACrE,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACzD,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC3C,CAAC;SAAM,CAAC;QACJ,eAAe,GAAG,IAAA,+BAAiB,EAAC;YAChC,UAAU,EAAE,OAAO,EAAE,UAAU;YAC/B,UAAU,EAAE,OAAO,EAAE,UAAU;YAC/B,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,UAAU,EAAE,OAAO,EAAE,UAAU;SAClC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,eAAgB,CAAC;AAC5B,CAAC;AAED,SAAS,aAAa;IAClB,IAAI,CAAC,eAAe;QAAE,iBAAiB,EAAE,CAAC;IAC1C,OAAO,eAAgB,CAAC;AAC5B,CAAC;AAED,SAAgB,sBAAsB;IAClC,OAAO,aAAa,EAAE,CAAC,YAAY,CAAC;AACxC,CAAC;AAED,SAAgB,qBAAqB;IACjC,OAAO,aAAa,EAAE,CAAC,WAAW,CAAC;AACvC,CAAC;AAED,SAAgB,oBAAoB;IAChC,OAAO,aAAa,EAAE,CAAC,UAAU,CAAC;AACtC,CAAC;AAED,SAAgB,sBAAsB;IAClC,OAAO,aAAa,EAAE,CAAC,YAAY,CAAC;AACxC,CAAC;AAED,yCAMqB;AALjB,2GAAA,cAAc,OAAA"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * storage/protocols.ts - Storage interfaces for Session, Memory, Skill, and Context stores.
3
+ */
4
+ export interface SessionStore {
5
+ get(sessionId: string): Record<string, any> | null;
6
+ put(sessionId: string, data: Record<string, any>): void;
7
+ listSummaries(limit?: number): Record<string, any>[];
8
+ listIds(): string[];
9
+ }
10
+ export interface MemoryStore {
11
+ load(): Record<string, any>[];
12
+ save(items: Record<string, any>[]): void;
13
+ }
14
+ export interface SkillStore {
15
+ listSkills(): string[];
16
+ getSkill(name: string): Record<string, any> | null;
17
+ }
18
+ export interface ContextStore {
19
+ get(sessionId: string): Record<string, any> | null;
20
+ set(sessionId: string, data: Record<string, any>): void;
21
+ }
22
+ export declare class StorageBackend {
23
+ sessionStore: SessionStore;
24
+ memoryStore: MemoryStore;
25
+ skillStore: SkillStore;
26
+ contextStore: ContextStore;
27
+ constructor(sessionStore: SessionStore, memoryStore: MemoryStore, skillStore: SkillStore, contextStore: ContextStore);
28
+ }
29
+ //# sourceMappingURL=protocols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocols.d.ts","sourceRoot":"","sources":["../../src/storage/protocols.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IACzB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnD,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACxD,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACrD,OAAO,IAAI,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,UAAU;IACvB,UAAU,IAAI,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,YAAY;IACzB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnD,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CAC3D;AAED,qBAAa,cAAc;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;gBAGvB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY;CAOjC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /**
3
+ * storage/protocols.ts - Storage interfaces for Session, Memory, Skill, and Context stores.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StorageBackend = void 0;
7
+ class StorageBackend {
8
+ sessionStore;
9
+ memoryStore;
10
+ skillStore;
11
+ contextStore;
12
+ constructor(sessionStore, memoryStore, skillStore, contextStore) {
13
+ this.sessionStore = sessionStore;
14
+ this.memoryStore = memoryStore;
15
+ this.skillStore = skillStore;
16
+ this.contextStore = contextStore;
17
+ }
18
+ }
19
+ exports.StorageBackend = StorageBackend;
20
+ //# sourceMappingURL=protocols.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocols.js","sourceRoot":"","sources":["../../src/storage/protocols.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAwBH,MAAa,cAAc;IACvB,YAAY,CAAe;IAC3B,WAAW,CAAc;IACzB,UAAU,CAAa;IACvB,YAAY,CAAe;IAE3B,YACI,YAA0B,EAC1B,WAAwB,EACxB,UAAsB,EACtB,YAA0B;QAE1B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;CACJ;AAjBD,wCAiBC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * todoCore.ts - Todo list manager.
3
+ */
4
+ export interface TodoItem {
5
+ content: string;
6
+ status: 'pending' | 'in_progress' | 'completed';
7
+ activeForm: string;
8
+ }
9
+ export declare class TodoManager {
10
+ items: TodoItem[];
11
+ update(items: any[]): string;
12
+ render(): string;
13
+ }
14
+ export declare const TODO: TodoManager;
15
+ //# sourceMappingURL=todoCore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todoCore.d.ts","sourceRoot":"","sources":["../src/todoCore.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,WAAW;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAM;IAEvB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IA+B5B,MAAM,IAAI,MAAM;CAgBnB;AAED,eAAO,MAAM,IAAI,aAAoB,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * todoCore.ts - Todo list manager.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TODO = exports.TodoManager = void 0;
7
+ class TodoManager {
8
+ items = [];
9
+ update(items) {
10
+ const validated = [];
11
+ let inProgress = 0;
12
+ for (let i = 0; i < items.length; i++) {
13
+ const item = items[i];
14
+ const content = String(item.content ?? '').trim();
15
+ const status = String(item.status ?? 'pending').toLowerCase();
16
+ const activeForm = String(item.activeForm ?? '').trim();
17
+ if (!content || !activeForm) {
18
+ throw new Error(`Item ${i}: content and activeForm required`);
19
+ }
20
+ if (!['pending', 'in_progress', 'completed'].includes(status)) {
21
+ throw new Error(`Item ${i}: invalid status`);
22
+ }
23
+ if (status === 'in_progress') {
24
+ inProgress++;
25
+ }
26
+ validated.push({ content, status, activeForm });
27
+ }
28
+ if (inProgress > 1) {
29
+ throw new Error('Only one task can be in_progress');
30
+ }
31
+ this.items = validated.slice(0, 20);
32
+ return this.render();
33
+ }
34
+ render() {
35
+ if (this.items.length === 0)
36
+ return 'No todos.';
37
+ const lines = [];
38
+ for (const t of this.items) {
39
+ const mark = t.status === 'completed'
40
+ ? '[x]'
41
+ : t.status === 'in_progress'
42
+ ? '[>]'
43
+ : '[ ]';
44
+ lines.push(`${mark} ${t.content}`);
45
+ }
46
+ const done = this.items.filter((t) => t.status === 'completed').length;
47
+ return lines.join('\n') + `\n(${done}/${this.items.length} done)`;
48
+ }
49
+ }
50
+ exports.TodoManager = TodoManager;
51
+ exports.TODO = new TodoManager();
52
+ //# sourceMappingURL=todoCore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todoCore.js","sourceRoot":"","sources":["../src/todoCore.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAQH,MAAa,WAAW;IACpB,KAAK,GAAe,EAAE,CAAC;IAEvB,MAAM,CAAC,KAA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AAC;IACzB,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,WAAW,CAAC;QAEhD,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,GACN,CAAC,CAAC,MAAM,KAAK,WAAW;gBACpB,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,aAAa;oBACxB,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,KAAK,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,CAAC;QACvE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC;IACtE,CAAC;CACJ;AAlDD,kCAkDC;AAEY,QAAA,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * toolsCore.ts - Tool definitions and implementations (bash, file ops, skills, tasks).
3
+ *
4
+ * Read: pagination (offset/limit) and chunked read for large files.
5
+ * Grep: context lines (before/after) around matches.
6
+ * Write: atomic write + backup before overwrite.
7
+ */
8
+ import { LLMProvider } from './llmProtocol';
9
+ export declare function setFileAccessCallback(cb: ((path: string) => void) | null): void;
10
+ export declare const BASE_TOOLS: Record<string, any>[];
11
+ export declare const TASK_TOOL: Record<string, any>;
12
+ export declare const SKILL_TOOL: Record<string, any>;
13
+ export declare const ALL_TOOLS: Record<string, any>[];
14
+ export declare const MAX_TOOL_ROUNDS = 20;
15
+ export declare const LOADED_SKILLS: Set<string>;
16
+ export declare function setExecutorApprovalCallback(callback: ((toolName: string, toolArgs: Record<string, any>) => boolean) | null): void;
17
+ export declare function getToolsForAgent(agentType: string): Record<string, any>[];
18
+ export declare function safePath(p: string): string;
19
+ export declare function runBash(cmd: string): string;
20
+ export declare function runRead(filePath: string, offset?: number, limit?: number): string;
21
+ export declare function runGrep(filePath: string, pattern: string, contextBefore?: number, contextAfter?: number): string;
22
+ export declare function runWrite(filePath: string, content: string): string;
23
+ export declare function runEdit(filePath: string, oldText: string, newText: string): string;
24
+ export declare function runTodo(items: any[]): string;
25
+ export declare function runSearchKnowledgeBase(query: string): string;
26
+ export declare function runReadEmail(folder?: string, limit?: number): string;
27
+ export declare function runSkill(skillName: string): string;
28
+ export declare function runTask(description: string, prompt: string, agentType: string, llm?: LLMProvider): Promise<string>;
29
+ export declare function executeTool(name: string, args: Record<string, any>): string;
30
+ export declare function executeToolAsync(name: string, args: Record<string, any>): Promise<string>;
31
+ //# sourceMappingURL=toolsCore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolsCore.d.ts","sourceRoot":"","sources":["../src/toolsCore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,WAAW,EAAsC,MAAM,eAAe,CAAC;AAQhF,wBAAgB,qBAAqB,CACjC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GACpC,IAAI,CAEN;AAqBD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EA6H3C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAyBzC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAuB1C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EA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