digital-tools 2.1.3 → 2.4.0

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 (294) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +2 -0
  4. package/dist/client.d.ts +109 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +69 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/define.d.ts +2 -2
  9. package/dist/define.d.ts.map +1 -1
  10. package/dist/define.js +21 -11
  11. package/dist/define.js.map +1 -1
  12. package/dist/function-ref.d.ts +229 -0
  13. package/dist/function-ref.d.ts.map +1 -0
  14. package/dist/function-ref.js +28 -0
  15. package/dist/function-ref.js.map +1 -0
  16. package/dist/function-sugar.d.ts +57 -0
  17. package/dist/function-sugar.d.ts.map +1 -0
  18. package/dist/function-sugar.js +79 -0
  19. package/dist/function-sugar.js.map +1 -0
  20. package/dist/index.d.ts +10 -3
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +24 -4
  23. package/dist/index.js.map +1 -1
  24. package/dist/providers/analytics/mixpanel.d.ts.map +1 -1
  25. package/dist/providers/analytics/mixpanel.js +21 -18
  26. package/dist/providers/analytics/mixpanel.js.map +1 -1
  27. package/dist/providers/calendar/cal-com.d.ts.map +1 -1
  28. package/dist/providers/calendar/cal-com.js +10 -10
  29. package/dist/providers/calendar/cal-com.js.map +1 -1
  30. package/dist/providers/calendar/google-calendar.d.ts.map +1 -1
  31. package/dist/providers/calendar/google-calendar.js +4 -4
  32. package/dist/providers/calendar/google-calendar.js.map +1 -1
  33. package/dist/providers/crm/hubspot.d.ts.map +1 -1
  34. package/dist/providers/crm/hubspot.js +107 -85
  35. package/dist/providers/crm/hubspot.js.map +1 -1
  36. package/dist/providers/development/github.d.ts.map +1 -1
  37. package/dist/providers/development/github.js +40 -43
  38. package/dist/providers/development/github.js.map +1 -1
  39. package/dist/providers/ecommerce/shopify.d.ts.map +1 -1
  40. package/dist/providers/ecommerce/shopify.js +79 -62
  41. package/dist/providers/ecommerce/shopify.js.map +1 -1
  42. package/dist/providers/email/resend.d.ts.map +1 -1
  43. package/dist/providers/email/resend.js +20 -16
  44. package/dist/providers/email/resend.js.map +1 -1
  45. package/dist/providers/email/sendgrid.d.ts.map +1 -1
  46. package/dist/providers/email/sendgrid.js +12 -9
  47. package/dist/providers/email/sendgrid.js.map +1 -1
  48. package/dist/providers/finance/stripe.d.ts.map +1 -1
  49. package/dist/providers/finance/stripe.js +44 -42
  50. package/dist/providers/finance/stripe.js.map +1 -1
  51. package/dist/providers/forms/typeform.d.ts.map +1 -1
  52. package/dist/providers/forms/typeform.js +68 -58
  53. package/dist/providers/forms/typeform.js.map +1 -1
  54. package/dist/providers/knowledge/notion.d.ts.map +1 -1
  55. package/dist/providers/knowledge/notion.js +75 -41
  56. package/dist/providers/knowledge/notion.js.map +1 -1
  57. package/dist/providers/marketing/mailchimp.d.ts.map +1 -1
  58. package/dist/providers/marketing/mailchimp.js +74 -61
  59. package/dist/providers/marketing/mailchimp.js.map +1 -1
  60. package/dist/providers/media/cloudinary.d.ts.map +1 -1
  61. package/dist/providers/media/cloudinary.js +30 -28
  62. package/dist/providers/media/cloudinary.js.map +1 -1
  63. package/dist/providers/messaging/slack.d.ts.map +1 -1
  64. package/dist/providers/messaging/slack.js +75 -58
  65. package/dist/providers/messaging/slack.js.map +1 -1
  66. package/dist/providers/messaging/twilio-sms.d.ts.map +1 -1
  67. package/dist/providers/messaging/twilio-sms.js +33 -15
  68. package/dist/providers/messaging/twilio-sms.js.map +1 -1
  69. package/dist/providers/project-management/linear.d.ts.map +1 -1
  70. package/dist/providers/project-management/linear.js +31 -27
  71. package/dist/providers/project-management/linear.js.map +1 -1
  72. package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -1
  73. package/dist/providers/spreadsheet/google-sheets.js +21 -18
  74. package/dist/providers/spreadsheet/google-sheets.js.map +1 -1
  75. package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -1
  76. package/dist/providers/spreadsheet/xlsx.js +4 -4
  77. package/dist/providers/spreadsheet/xlsx.js.map +1 -1
  78. package/dist/providers/storage/index.js +1 -0
  79. package/dist/providers/storage/index.js.map +1 -1
  80. package/dist/providers/storage/s3.d.ts.map +1 -1
  81. package/dist/providers/storage/s3.js +36 -27
  82. package/dist/providers/storage/s3.js.map +1 -1
  83. package/dist/providers/support/zendesk.d.ts.map +1 -1
  84. package/dist/providers/support/zendesk.js +24 -25
  85. package/dist/providers/support/zendesk.js.map +1 -1
  86. package/dist/providers/tasks/todoist.d.ts.map +1 -1
  87. package/dist/providers/tasks/todoist.js +18 -18
  88. package/dist/providers/tasks/todoist.js.map +1 -1
  89. package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -1
  90. package/dist/providers/video-conferencing/google-meet.js +11 -11
  91. package/dist/providers/video-conferencing/google-meet.js.map +1 -1
  92. package/dist/providers/video-conferencing/jitsi.js +14 -14
  93. package/dist/providers/video-conferencing/jitsi.js.map +1 -1
  94. package/dist/providers/video-conferencing/teams.d.ts.map +1 -1
  95. package/dist/providers/video-conferencing/teams.js +9 -7
  96. package/dist/providers/video-conferencing/teams.js.map +1 -1
  97. package/dist/providers/video-conferencing/zoom.d.ts.map +1 -1
  98. package/dist/providers/video-conferencing/zoom.js +26 -24
  99. package/dist/providers/video-conferencing/zoom.js.map +1 -1
  100. package/dist/tools/data.d.ts.map +1 -1
  101. package/dist/tools/data.js +5 -12
  102. package/dist/tools/data.js.map +1 -1
  103. package/dist/tools/index.d.ts +1 -0
  104. package/dist/tools/index.d.ts.map +1 -1
  105. package/dist/tools/index.js +1 -0
  106. package/dist/tools/index.js.map +1 -1
  107. package/dist/tools/system.d.ts +289 -0
  108. package/dist/tools/system.d.ts.map +1 -0
  109. package/dist/tools/system.js +752 -0
  110. package/dist/tools/system.js.map +1 -0
  111. package/dist/tools/web.d.ts.map +1 -1
  112. package/dist/tools/web.js +22 -10
  113. package/dist/tools/web.js.map +1 -1
  114. package/dist/track-record.d.ts +101 -0
  115. package/dist/track-record.d.ts.map +1 -0
  116. package/dist/track-record.js +17 -0
  117. package/dist/track-record.js.map +1 -0
  118. package/dist/types.d.ts +210 -9
  119. package/dist/types.d.ts.map +1 -1
  120. package/dist/verb-registration.d.ts +122 -0
  121. package/dist/verb-registration.d.ts.map +1 -0
  122. package/dist/verb-registration.js +176 -0
  123. package/dist/verb-registration.js.map +1 -0
  124. package/dist/worker.d.ts +93 -0
  125. package/dist/worker.d.ts.map +1 -0
  126. package/dist/worker.js +315 -0
  127. package/dist/worker.js.map +1 -0
  128. package/dist/wrap.d.ts +89 -0
  129. package/dist/wrap.d.ts.map +1 -0
  130. package/dist/wrap.js +225 -0
  131. package/dist/wrap.js.map +1 -0
  132. package/package.json +31 -14
  133. package/src/client.ts +136 -0
  134. package/src/define.ts +30 -24
  135. package/src/function-ref.ts +264 -0
  136. package/src/function-sugar.ts +134 -0
  137. package/src/index.ts +132 -10
  138. package/src/providers/analytics/mixpanel.ts +19 -18
  139. package/src/providers/calendar/cal-com.ts +29 -18
  140. package/src/providers/calendar/google-calendar.ts +20 -14
  141. package/src/providers/crm/hubspot.ts +225 -99
  142. package/src/providers/development/github.ts +206 -135
  143. package/src/providers/ecommerce/shopify.ts +250 -89
  144. package/src/providers/email/resend.ts +101 -28
  145. package/src/providers/email/sendgrid.ts +12 -9
  146. package/src/providers/finance/stripe.ts +128 -49
  147. package/src/providers/forms/typeform.ts +74 -58
  148. package/src/providers/knowledge/notion.ts +340 -88
  149. package/src/providers/marketing/mailchimp.ts +86 -70
  150. package/src/providers/media/cloudinary.ts +99 -41
  151. package/src/providers/messaging/slack.ts +283 -85
  152. package/src/providers/messaging/twilio-sms.ts +35 -15
  153. package/src/providers/project-management/linear.ts +143 -55
  154. package/src/providers/spreadsheet/google-sheets.ts +222 -56
  155. package/src/providers/spreadsheet/xlsx.ts +47 -16
  156. package/src/providers/storage/s3.ts +119 -47
  157. package/src/providers/support/zendesk.ts +196 -46
  158. package/src/providers/tasks/todoist.ts +20 -26
  159. package/src/providers/video-conferencing/google-meet.ts +17 -20
  160. package/src/providers/video-conferencing/jitsi.ts +14 -14
  161. package/src/providers/video-conferencing/teams.ts +14 -13
  162. package/src/providers/video-conferencing/zoom.ts +54 -49
  163. package/src/tools/data.ts +6 -16
  164. package/src/tools/index.ts +1 -0
  165. package/src/tools/system.ts +887 -0
  166. package/src/tools/web.ts +22 -10
  167. package/src/track-record.ts +106 -0
  168. package/src/types.ts +241 -13
  169. package/src/verb-registration.ts +197 -0
  170. package/src/worker.ts +370 -0
  171. package/src/wrap.ts +260 -0
  172. package/test/client.test.ts +146 -0
  173. package/test/communication-tools-extended.test.ts +734 -0
  174. package/test/data-tools-extended.test.ts +743 -0
  175. package/test/define-extended.test.ts +819 -0
  176. package/test/define.test.ts +150 -41
  177. package/test/entities.test.ts +623 -0
  178. package/test/extended-entities.test.ts +1228 -0
  179. package/test/provider-implementations.test.ts +725 -0
  180. package/test/provider-registry-extended.test.ts +583 -0
  181. package/test/providers/google-sheets.test.ts +851 -0
  182. package/test/providers/helpers.ts +554 -0
  183. package/test/providers/hubspot.test.ts +576 -0
  184. package/test/providers/slack.test.ts +932 -0
  185. package/test/providers/stripe.test.ts +701 -0
  186. package/test/providers.test.ts +578 -0
  187. package/test/system-tools-extended.test.ts +632 -0
  188. package/test/system.test.ts +673 -0
  189. package/test/tools.test.ts +15 -11
  190. package/test/types.test.ts +402 -0
  191. package/test/verb-registration.test.ts +395 -0
  192. package/test/web-tools.test.ts +553 -0
  193. package/test/worker-extended.test.ts +699 -0
  194. package/test/worker.test.ts +576 -0
  195. package/test/wrap.test.ts +366 -0
  196. package/tsconfig.json +3 -13
  197. package/vitest.config.ts +37 -0
  198. package/wrangler.jsonc +9 -0
  199. package/LICENSE +0 -21
  200. package/dist/providers/voice/vapi.d.ts +0 -27
  201. package/dist/providers/voice/vapi.d.ts.map +0 -1
  202. package/dist/providers/voice/vapi.js +0 -440
  203. package/dist/providers/voice/vapi.js.map +0 -1
  204. package/src/define.js +0 -259
  205. package/src/entities/advertising.js +0 -999
  206. package/src/entities/ai.js +0 -756
  207. package/src/entities/analytics.js +0 -1588
  208. package/src/entities/automation.js +0 -601
  209. package/src/entities/communication.js +0 -1150
  210. package/src/entities/crm.js +0 -1386
  211. package/src/entities/design.js +0 -546
  212. package/src/entities/development.js +0 -2212
  213. package/src/entities/document.js +0 -874
  214. package/src/entities/ecommerce.js +0 -1429
  215. package/src/entities/experiment.js +0 -1039
  216. package/src/entities/finance.js +0 -3478
  217. package/src/entities/forms.js +0 -1892
  218. package/src/entities/hr.js +0 -661
  219. package/src/entities/identity.js +0 -997
  220. package/src/entities/index.js +0 -282
  221. package/src/entities/infrastructure.js +0 -1153
  222. package/src/entities/knowledge.js +0 -1438
  223. package/src/entities/marketing.js +0 -1610
  224. package/src/entities/media.js +0 -1634
  225. package/src/entities/notification.js +0 -1199
  226. package/src/entities/presentation.js +0 -1274
  227. package/src/entities/productivity.js +0 -1317
  228. package/src/entities/project-management.js +0 -1136
  229. package/src/entities/recruiting.js +0 -736
  230. package/src/entities/shipping.js +0 -509
  231. package/src/entities/signature.js +0 -1102
  232. package/src/entities/site.js +0 -222
  233. package/src/entities/spreadsheet.js +0 -1341
  234. package/src/entities/storage.js +0 -1198
  235. package/src/entities/support.js +0 -1166
  236. package/src/entities/video-conferencing.js +0 -1750
  237. package/src/entities/video.js +0 -950
  238. package/src/entities.js +0 -1663
  239. package/src/index.js +0 -74
  240. package/src/providers/analytics/index.js +0 -17
  241. package/src/providers/analytics/mixpanel.js +0 -255
  242. package/src/providers/calendar/cal-com.js +0 -303
  243. package/src/providers/calendar/google-calendar.js +0 -335
  244. package/src/providers/calendar/index.js +0 -20
  245. package/src/providers/crm/hubspot.js +0 -566
  246. package/src/providers/crm/index.js +0 -17
  247. package/src/providers/development/github.js +0 -472
  248. package/src/providers/development/index.js +0 -17
  249. package/src/providers/ecommerce/index.js +0 -17
  250. package/src/providers/ecommerce/shopify.js +0 -378
  251. package/src/providers/email/index.js +0 -20
  252. package/src/providers/email/resend.js +0 -258
  253. package/src/providers/email/sendgrid.js +0 -161
  254. package/src/providers/finance/index.js +0 -17
  255. package/src/providers/finance/stripe.js +0 -549
  256. package/src/providers/forms/index.js +0 -17
  257. package/src/providers/forms/typeform.js +0 -500
  258. package/src/providers/index.js +0 -123
  259. package/src/providers/knowledge/index.js +0 -17
  260. package/src/providers/knowledge/notion.js +0 -389
  261. package/src/providers/marketing/index.js +0 -17
  262. package/src/providers/marketing/mailchimp.js +0 -443
  263. package/src/providers/media/cloudinary.js +0 -318
  264. package/src/providers/media/index.js +0 -17
  265. package/src/providers/messaging/index.js +0 -20
  266. package/src/providers/messaging/slack.js +0 -393
  267. package/src/providers/messaging/twilio-sms.js +0 -249
  268. package/src/providers/project-management/index.js +0 -17
  269. package/src/providers/project-management/linear.js +0 -575
  270. package/src/providers/registry.js +0 -86
  271. package/src/providers/spreadsheet/google-sheets.js +0 -375
  272. package/src/providers/spreadsheet/index.js +0 -20
  273. package/src/providers/spreadsheet/xlsx.js +0 -423
  274. package/src/providers/storage/index.js +0 -24
  275. package/src/providers/storage/s3.js +0 -419
  276. package/src/providers/support/index.js +0 -17
  277. package/src/providers/support/zendesk.js +0 -373
  278. package/src/providers/tasks/index.js +0 -17
  279. package/src/providers/tasks/todoist.js +0 -286
  280. package/src/providers/types.js +0 -9
  281. package/src/providers/video-conferencing/google-meet.js +0 -286
  282. package/src/providers/video-conferencing/index.js +0 -31
  283. package/src/providers/video-conferencing/jitsi.js +0 -254
  284. package/src/providers/video-conferencing/teams.js +0 -270
  285. package/src/providers/video-conferencing/zoom.js +0 -332
  286. package/src/registry.js +0 -128
  287. package/src/tools/communication.js +0 -184
  288. package/src/tools/data.js +0 -205
  289. package/src/tools/index.js +0 -11
  290. package/src/tools/web.js +0 -137
  291. package/src/types.js +0 -10
  292. package/test/define.test.js +0 -306
  293. package/test/registry.test.js +0 -357
  294. package/test/tools.test.js +0 -363
@@ -0,0 +1,752 @@
1
+ /**
2
+ * System Tools - Filesystem, Git, and Shell operations
3
+ *
4
+ * Integrates fsx.do, gitx.do, and bashx.do primitives for the dotdo ecosystem.
5
+ * These tools provide edge-compatible filesystem, git, and bash operations
6
+ * that work in Cloudflare Workers and Durable Objects.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ import { defineTool } from '../define.js';
11
+ // ============================================================================
12
+ // Filesystem Tools (fsx.do integration)
13
+ // ============================================================================
14
+ /**
15
+ * Read file contents from the virtual filesystem
16
+ */
17
+ export const fsRead = defineTool({
18
+ id: 'system.fs.read',
19
+ name: 'Read File',
20
+ description: 'Read contents of a file from the virtual filesystem (fsx.do)',
21
+ category: 'system',
22
+ subcategory: 'filesystem',
23
+ input: {
24
+ type: 'object',
25
+ properties: {
26
+ path: { type: 'string', description: 'Path to the file to read' },
27
+ encoding: {
28
+ type: 'string',
29
+ description: 'Encoding for the file content',
30
+ enum: ['utf-8', 'binary', 'base64'],
31
+ default: 'utf-8',
32
+ },
33
+ },
34
+ required: ['path'],
35
+ },
36
+ handler: async (input) => {
37
+ // Placeholder - actual implementation will use @dotdo/fsx
38
+ // In production, this connects to the fsx.do Durable Object
39
+ const encoding = input.encoding || 'utf-8';
40
+ return {
41
+ content: `[fsx.do] Content of ${input.path}`,
42
+ size: 0,
43
+ encoding,
44
+ };
45
+ },
46
+ options: {
47
+ audience: 'both',
48
+ tags: ['fs', 'read', 'file', 'fsx'],
49
+ idempotent: true,
50
+ },
51
+ });
52
+ /**
53
+ * Write content to a file in the virtual filesystem
54
+ */
55
+ export const fsWrite = defineTool({
56
+ id: 'system.fs.write',
57
+ name: 'Write File',
58
+ description: 'Write content to a file in the virtual filesystem (fsx.do)',
59
+ category: 'system',
60
+ subcategory: 'filesystem',
61
+ input: {
62
+ type: 'object',
63
+ properties: {
64
+ path: { type: 'string', description: 'Path to write the file' },
65
+ content: { type: 'string', description: 'Content to write' },
66
+ encoding: {
67
+ type: 'string',
68
+ description: 'Encoding for the content',
69
+ enum: ['utf-8', 'binary', 'base64'],
70
+ default: 'utf-8',
71
+ },
72
+ createDirs: {
73
+ type: 'boolean',
74
+ description: 'Create parent directories if they do not exist',
75
+ default: true,
76
+ },
77
+ },
78
+ required: ['path', 'content'],
79
+ },
80
+ handler: async (input) => {
81
+ // Placeholder - actual implementation will use @dotdo/fsx
82
+ return {
83
+ success: true,
84
+ path: input.path,
85
+ size: input.content.length,
86
+ };
87
+ },
88
+ options: {
89
+ audience: 'both',
90
+ tags: ['fs', 'write', 'file', 'fsx'],
91
+ permissions: [{ type: 'write', resource: 'filesystem' }],
92
+ },
93
+ });
94
+ /**
95
+ * List directory contents
96
+ */
97
+ export const fsList = defineTool({
98
+ id: 'system.fs.list',
99
+ name: 'List Directory',
100
+ description: 'List contents of a directory in the virtual filesystem (fsx.do)',
101
+ category: 'system',
102
+ subcategory: 'filesystem',
103
+ input: {
104
+ type: 'object',
105
+ properties: {
106
+ path: { type: 'string', description: 'Directory path to list' },
107
+ recursive: { type: 'boolean', description: 'List recursively', default: false },
108
+ pattern: { type: 'string', description: 'Glob pattern to filter results' },
109
+ },
110
+ required: ['path'],
111
+ },
112
+ handler: async (input) => {
113
+ // Placeholder - actual implementation will use @dotdo/fsx
114
+ return {
115
+ entries: [],
116
+ count: 0,
117
+ };
118
+ },
119
+ options: {
120
+ audience: 'both',
121
+ tags: ['fs', 'list', 'directory', 'fsx'],
122
+ idempotent: true,
123
+ },
124
+ });
125
+ /**
126
+ * Delete a file or directory
127
+ */
128
+ export const fsDelete = defineTool({
129
+ id: 'system.fs.delete',
130
+ name: 'Delete File/Directory',
131
+ description: 'Delete a file or directory from the virtual filesystem (fsx.do)',
132
+ category: 'system',
133
+ subcategory: 'filesystem',
134
+ input: {
135
+ type: 'object',
136
+ properties: {
137
+ path: { type: 'string', description: 'Path to delete' },
138
+ recursive: { type: 'boolean', description: 'Delete directories recursively', default: false },
139
+ },
140
+ required: ['path'],
141
+ },
142
+ handler: async (input) => {
143
+ // Placeholder - actual implementation will use @dotdo/fsx
144
+ return {
145
+ success: true,
146
+ path: input.path,
147
+ deleted: 1,
148
+ };
149
+ },
150
+ options: {
151
+ audience: 'both',
152
+ tags: ['fs', 'delete', 'remove', 'fsx'],
153
+ permissions: [{ type: 'write', resource: 'filesystem' }],
154
+ requiresConfirmation: true,
155
+ },
156
+ });
157
+ /**
158
+ * Search files using glob patterns
159
+ */
160
+ export const fsGlob = defineTool({
161
+ id: 'system.fs.glob',
162
+ name: 'Glob Search',
163
+ description: 'Search for files using glob patterns (fsx.do)',
164
+ category: 'system',
165
+ subcategory: 'filesystem',
166
+ input: {
167
+ type: 'object',
168
+ properties: {
169
+ pattern: { type: 'string', description: 'Glob pattern (e.g., "**/*.ts")' },
170
+ cwd: { type: 'string', description: 'Working directory for the search' },
171
+ },
172
+ required: ['pattern'],
173
+ },
174
+ handler: async (input) => {
175
+ // Placeholder - actual implementation will use @dotdo/fsx
176
+ return {
177
+ matches: [],
178
+ count: 0,
179
+ };
180
+ },
181
+ options: {
182
+ audience: 'both',
183
+ tags: ['fs', 'glob', 'search', 'fsx'],
184
+ idempotent: true,
185
+ },
186
+ });
187
+ /**
188
+ * Search file contents using grep
189
+ */
190
+ export const fsGrep = defineTool({
191
+ id: 'system.fs.grep',
192
+ name: 'Grep Search',
193
+ description: 'Search file contents using regular expressions (fsx.do)',
194
+ category: 'system',
195
+ subcategory: 'filesystem',
196
+ input: {
197
+ type: 'object',
198
+ properties: {
199
+ pattern: { type: 'string', description: 'Search pattern (regex)' },
200
+ path: { type: 'string', description: 'Path to search in' },
201
+ recursive: { type: 'boolean', description: 'Search recursively', default: true },
202
+ ignoreCase: { type: 'boolean', description: 'Case-insensitive search', default: false },
203
+ },
204
+ required: ['pattern'],
205
+ },
206
+ handler: async (input) => {
207
+ // Placeholder - actual implementation will use @dotdo/fsx
208
+ return {
209
+ matches: [],
210
+ count: 0,
211
+ };
212
+ },
213
+ options: {
214
+ audience: 'both',
215
+ tags: ['fs', 'grep', 'search', 'regex', 'fsx'],
216
+ idempotent: true,
217
+ },
218
+ });
219
+ // ============================================================================
220
+ // Git Tools (gitx.do integration)
221
+ // ============================================================================
222
+ /**
223
+ * Initialize a git repository
224
+ */
225
+ export const gitInit = defineTool({
226
+ id: 'system.git.init',
227
+ name: 'Git Init',
228
+ description: 'Initialize a new git repository (gitx.do)',
229
+ category: 'development',
230
+ subcategory: 'git',
231
+ input: {
232
+ type: 'object',
233
+ properties: {
234
+ path: { type: 'string', description: 'Path for the repository' },
235
+ bare: { type: 'boolean', description: 'Create a bare repository', default: false },
236
+ },
237
+ },
238
+ handler: async (input) => {
239
+ // Placeholder - actual implementation will use @dotdo/gitx
240
+ return {
241
+ success: true,
242
+ path: input.path || '.',
243
+ };
244
+ },
245
+ options: {
246
+ audience: 'both',
247
+ tags: ['git', 'init', 'repository', 'gitx'],
248
+ permissions: [{ type: 'write', resource: 'git' }],
249
+ },
250
+ });
251
+ /**
252
+ * Clone a git repository
253
+ */
254
+ export const gitClone = defineTool({
255
+ id: 'system.git.clone',
256
+ name: 'Git Clone',
257
+ description: 'Clone a git repository (gitx.do)',
258
+ category: 'development',
259
+ subcategory: 'git',
260
+ input: {
261
+ type: 'object',
262
+ properties: {
263
+ url: { type: 'string', description: 'Repository URL to clone' },
264
+ path: { type: 'string', description: 'Local path for the clone' },
265
+ branch: { type: 'string', description: 'Branch to checkout' },
266
+ depth: { type: 'number', description: 'Shallow clone depth' },
267
+ },
268
+ required: ['url'],
269
+ },
270
+ handler: async (input) => {
271
+ // Placeholder - actual implementation will use @dotdo/gitx
272
+ return {
273
+ success: true,
274
+ path: input.path || '.',
275
+ branch: input.branch || 'main',
276
+ };
277
+ },
278
+ options: {
279
+ audience: 'both',
280
+ tags: ['git', 'clone', 'repository', 'gitx'],
281
+ permissions: [{ type: 'write', resource: 'git' }],
282
+ },
283
+ });
284
+ /**
285
+ * Get git repository status
286
+ */
287
+ export const gitStatus = defineTool({
288
+ id: 'system.git.status',
289
+ name: 'Git Status',
290
+ description: 'Get the status of a git repository (gitx.do)',
291
+ category: 'development',
292
+ subcategory: 'git',
293
+ input: {
294
+ type: 'object',
295
+ properties: {
296
+ path: { type: 'string', description: 'Repository path' },
297
+ },
298
+ },
299
+ handler: async (input) => {
300
+ // Placeholder - actual implementation will use @dotdo/gitx
301
+ return {
302
+ branch: 'main',
303
+ clean: true,
304
+ staged: [],
305
+ modified: [],
306
+ untracked: [],
307
+ ahead: 0,
308
+ behind: 0,
309
+ };
310
+ },
311
+ options: {
312
+ audience: 'both',
313
+ tags: ['git', 'status', 'gitx'],
314
+ idempotent: true,
315
+ },
316
+ });
317
+ /**
318
+ * Stage files for commit
319
+ */
320
+ export const gitAdd = defineTool({
321
+ id: 'system.git.add',
322
+ name: 'Git Add',
323
+ description: 'Stage files for commit (gitx.do)',
324
+ category: 'development',
325
+ subcategory: 'git',
326
+ input: {
327
+ type: 'object',
328
+ properties: {
329
+ files: {
330
+ type: 'array',
331
+ items: { type: 'string' },
332
+ description: 'Files to stage (use "." for all)',
333
+ },
334
+ path: { type: 'string', description: 'Repository path' },
335
+ },
336
+ required: ['files'],
337
+ },
338
+ handler: async (input) => {
339
+ // Placeholder - actual implementation will use @dotdo/gitx
340
+ return {
341
+ success: true,
342
+ staged: input.files,
343
+ };
344
+ },
345
+ options: {
346
+ audience: 'both',
347
+ tags: ['git', 'add', 'stage', 'gitx'],
348
+ permissions: [{ type: 'write', resource: 'git' }],
349
+ },
350
+ });
351
+ /**
352
+ * Create a commit
353
+ */
354
+ export const gitCommit = defineTool({
355
+ id: 'system.git.commit',
356
+ name: 'Git Commit',
357
+ description: 'Create a new commit (gitx.do)',
358
+ category: 'development',
359
+ subcategory: 'git',
360
+ input: {
361
+ type: 'object',
362
+ properties: {
363
+ message: { type: 'string', description: 'Commit message' },
364
+ path: { type: 'string', description: 'Repository path' },
365
+ author: {
366
+ type: 'object',
367
+ properties: {
368
+ name: { type: 'string' },
369
+ email: { type: 'string' },
370
+ },
371
+ description: 'Commit author',
372
+ },
373
+ },
374
+ required: ['message'],
375
+ },
376
+ handler: async (input) => {
377
+ // Placeholder - actual implementation will use @dotdo/gitx
378
+ return {
379
+ success: true,
380
+ sha: 'abc1234',
381
+ message: input.message,
382
+ };
383
+ },
384
+ options: {
385
+ audience: 'both',
386
+ tags: ['git', 'commit', 'gitx'],
387
+ permissions: [{ type: 'write', resource: 'git' }],
388
+ },
389
+ });
390
+ /**
391
+ * Get commit log
392
+ */
393
+ export const gitLog = defineTool({
394
+ id: 'system.git.log',
395
+ name: 'Git Log',
396
+ description: 'Get commit history (gitx.do)',
397
+ category: 'development',
398
+ subcategory: 'git',
399
+ input: {
400
+ type: 'object',
401
+ properties: {
402
+ path: { type: 'string', description: 'Repository path' },
403
+ limit: { type: 'number', description: 'Maximum number of commits', default: 10 },
404
+ branch: { type: 'string', description: 'Branch to get log from' },
405
+ },
406
+ },
407
+ handler: async (input) => {
408
+ // Placeholder - actual implementation will use @dotdo/gitx
409
+ return {
410
+ commits: [],
411
+ };
412
+ },
413
+ options: {
414
+ audience: 'both',
415
+ tags: ['git', 'log', 'history', 'gitx'],
416
+ idempotent: true,
417
+ },
418
+ });
419
+ /**
420
+ * Show diff between commits or working tree
421
+ */
422
+ export const gitDiff = defineTool({
423
+ id: 'system.git.diff',
424
+ name: 'Git Diff',
425
+ description: 'Show differences between commits or working tree (gitx.do)',
426
+ category: 'development',
427
+ subcategory: 'git',
428
+ input: {
429
+ type: 'object',
430
+ properties: {
431
+ path: { type: 'string', description: 'Repository path' },
432
+ from: { type: 'string', description: 'From commit/ref' },
433
+ to: { type: 'string', description: 'To commit/ref' },
434
+ file: { type: 'string', description: 'Specific file to diff' },
435
+ },
436
+ },
437
+ handler: async (input) => {
438
+ // Placeholder - actual implementation will use @dotdo/gitx
439
+ return {
440
+ diff: '',
441
+ additions: 0,
442
+ deletions: 0,
443
+ files: [],
444
+ };
445
+ },
446
+ options: {
447
+ audience: 'both',
448
+ tags: ['git', 'diff', 'gitx'],
449
+ idempotent: true,
450
+ },
451
+ });
452
+ /**
453
+ * Checkout a branch or commit
454
+ */
455
+ export const gitCheckout = defineTool({
456
+ id: 'system.git.checkout',
457
+ name: 'Git Checkout',
458
+ description: 'Checkout a branch or commit (gitx.do)',
459
+ category: 'development',
460
+ subcategory: 'git',
461
+ input: {
462
+ type: 'object',
463
+ properties: {
464
+ ref: { type: 'string', description: 'Branch, tag, or commit to checkout' },
465
+ path: { type: 'string', description: 'Repository path' },
466
+ create: { type: 'boolean', description: 'Create new branch (-b flag)', default: false },
467
+ },
468
+ required: ['ref'],
469
+ },
470
+ handler: async (input) => {
471
+ // Placeholder - actual implementation will use @dotdo/gitx
472
+ return {
473
+ success: true,
474
+ ref: input.ref,
475
+ };
476
+ },
477
+ options: {
478
+ audience: 'both',
479
+ tags: ['git', 'checkout', 'branch', 'gitx'],
480
+ permissions: [{ type: 'write', resource: 'git' }],
481
+ },
482
+ });
483
+ /**
484
+ * Push commits to remote
485
+ */
486
+ export const gitPush = defineTool({
487
+ id: 'system.git.push',
488
+ name: 'Git Push',
489
+ description: 'Push commits to a remote repository (gitx.do)',
490
+ category: 'development',
491
+ subcategory: 'git',
492
+ input: {
493
+ type: 'object',
494
+ properties: {
495
+ path: { type: 'string', description: 'Repository path' },
496
+ remote: { type: 'string', description: 'Remote name', default: 'origin' },
497
+ branch: { type: 'string', description: 'Branch to push' },
498
+ force: { type: 'boolean', description: 'Force push', default: false },
499
+ },
500
+ },
501
+ handler: async (input) => {
502
+ // Placeholder - actual implementation will use @dotdo/gitx
503
+ return {
504
+ success: true,
505
+ remote: input.remote || 'origin',
506
+ branch: input.branch || 'main',
507
+ commits: 0,
508
+ };
509
+ },
510
+ options: {
511
+ audience: 'both',
512
+ tags: ['git', 'push', 'remote', 'gitx'],
513
+ permissions: [{ type: 'write', resource: 'git' }],
514
+ requiresConfirmation: true,
515
+ },
516
+ });
517
+ /**
518
+ * Pull commits from remote
519
+ */
520
+ export const gitPull = defineTool({
521
+ id: 'system.git.pull',
522
+ name: 'Git Pull',
523
+ description: 'Pull commits from a remote repository (gitx.do)',
524
+ category: 'development',
525
+ subcategory: 'git',
526
+ input: {
527
+ type: 'object',
528
+ properties: {
529
+ path: { type: 'string', description: 'Repository path' },
530
+ remote: { type: 'string', description: 'Remote name', default: 'origin' },
531
+ branch: { type: 'string', description: 'Branch to pull' },
532
+ rebase: { type: 'boolean', description: 'Rebase instead of merge', default: false },
533
+ },
534
+ },
535
+ handler: async (input) => {
536
+ // Placeholder - actual implementation will use @dotdo/gitx
537
+ return {
538
+ success: true,
539
+ remote: input.remote || 'origin',
540
+ branch: input.branch || 'main',
541
+ commits: 0,
542
+ conflicts: [],
543
+ };
544
+ },
545
+ options: {
546
+ audience: 'both',
547
+ tags: ['git', 'pull', 'remote', 'gitx'],
548
+ permissions: [{ type: 'write', resource: 'git' }],
549
+ },
550
+ });
551
+ // ============================================================================
552
+ // Shell/Bash Tools (bashx.do integration)
553
+ // ============================================================================
554
+ /**
555
+ * Execute a bash command with AI-enhanced safety
556
+ */
557
+ export const bashExec = defineTool({
558
+ id: 'system.bash.exec',
559
+ name: 'Execute Bash Command',
560
+ description: 'Execute a bash command with AI-enhanced safety and intent understanding (bashx.do)',
561
+ category: 'system',
562
+ subcategory: 'shell',
563
+ input: {
564
+ type: 'object',
565
+ properties: {
566
+ command: { type: 'string', description: 'Command to execute' },
567
+ cwd: { type: 'string', description: 'Working directory' },
568
+ env: {
569
+ type: 'object',
570
+ additionalProperties: { type: 'string' },
571
+ description: 'Environment variables',
572
+ },
573
+ timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 },
574
+ stdin: { type: 'string', description: 'Standard input to provide' },
575
+ },
576
+ required: ['command'],
577
+ },
578
+ handler: async (input) => {
579
+ // Placeholder - actual implementation will use bashx.do
580
+ // bashx.do provides:
581
+ // - AI safety analysis (warns about destructive commands)
582
+ // - Intent understanding (suggests corrections)
583
+ // - Intelligent error recovery
584
+ return {
585
+ stdout: `[bashx.do] Would execute: ${input.command}`,
586
+ stderr: '',
587
+ exitCode: 0,
588
+ duration: 0,
589
+ };
590
+ },
591
+ options: {
592
+ audience: 'both',
593
+ tags: ['bash', 'shell', 'exec', 'command', 'bashx'],
594
+ permissions: [{ type: 'execute', resource: 'shell' }],
595
+ requiresConfirmation: true,
596
+ securityLevel: 'restricted',
597
+ },
598
+ });
599
+ /**
600
+ * Analyze command safety before execution
601
+ */
602
+ export const bashAnalyze = defineTool({
603
+ id: 'system.bash.analyze',
604
+ name: 'Analyze Bash Command',
605
+ description: 'Analyze a bash command for safety using AI (bashx.do)',
606
+ category: 'system',
607
+ subcategory: 'shell',
608
+ input: {
609
+ type: 'object',
610
+ properties: {
611
+ command: { type: 'string', description: 'Command to analyze' },
612
+ },
613
+ required: ['command'],
614
+ },
615
+ handler: async (input) => {
616
+ // Placeholder - actual implementation will use bashx.do AI analysis
617
+ // Detect patterns like:
618
+ // - rm -rf / (destructive)
619
+ // - chmod 777 (security risk)
620
+ // - curl | bash (execution risk)
621
+ const warnings = [];
622
+ let riskLevel = 'low';
623
+ if (input.command.includes('rm -rf')) {
624
+ warnings.push('Recursive force delete detected');
625
+ riskLevel = 'high';
626
+ }
627
+ if (input.command.includes('chmod 777')) {
628
+ warnings.push('Overly permissive file permissions');
629
+ riskLevel = 'medium';
630
+ }
631
+ if (input.command.includes('| bash') || input.command.includes('| sh')) {
632
+ warnings.push('Pipe to shell execution detected');
633
+ riskLevel = 'high';
634
+ }
635
+ return {
636
+ safe: warnings.length === 0,
637
+ riskLevel,
638
+ warnings,
639
+ suggestions: [],
640
+ intent: `Execute: ${input.command}`,
641
+ };
642
+ },
643
+ options: {
644
+ audience: 'both',
645
+ tags: ['bash', 'safety', 'analyze', 'bashx'],
646
+ idempotent: true,
647
+ },
648
+ });
649
+ /**
650
+ * Execute a script file
651
+ */
652
+ export const bashScript = defineTool({
653
+ id: 'system.bash.script',
654
+ name: 'Execute Bash Script',
655
+ description: 'Execute a bash script with arguments (bashx.do)',
656
+ category: 'system',
657
+ subcategory: 'shell',
658
+ input: {
659
+ type: 'object',
660
+ properties: {
661
+ script: { type: 'string', description: 'Script content or path' },
662
+ args: {
663
+ type: 'array',
664
+ items: { type: 'string' },
665
+ description: 'Script arguments',
666
+ },
667
+ cwd: { type: 'string', description: 'Working directory' },
668
+ env: {
669
+ type: 'object',
670
+ additionalProperties: { type: 'string' },
671
+ description: 'Environment variables',
672
+ },
673
+ },
674
+ required: ['script'],
675
+ },
676
+ handler: async (input) => {
677
+ // Placeholder - actual implementation will use bashx.do
678
+ return {
679
+ stdout: `[bashx.do] Would execute script with args: ${input.args?.join(' ') || '(none)'}`,
680
+ stderr: '',
681
+ exitCode: 0,
682
+ };
683
+ },
684
+ options: {
685
+ audience: 'both',
686
+ tags: ['bash', 'script', 'execute', 'bashx'],
687
+ permissions: [{ type: 'execute', resource: 'shell' }],
688
+ requiresConfirmation: true,
689
+ securityLevel: 'restricted',
690
+ },
691
+ });
692
+ /**
693
+ * Get environment information
694
+ */
695
+ export const bashEnv = defineTool({
696
+ id: 'system.bash.env',
697
+ name: 'Get Environment',
698
+ description: 'Get shell environment information (bashx.do)',
699
+ category: 'system',
700
+ subcategory: 'shell',
701
+ input: {
702
+ type: 'object',
703
+ properties: {
704
+ filter: { type: 'string', description: 'Filter variables by prefix' },
705
+ },
706
+ },
707
+ handler: async (input) => {
708
+ // Placeholder - actual implementation will use bashx.do
709
+ return {
710
+ variables: {},
711
+ shell: '/bin/bash',
712
+ cwd: '/',
713
+ user: 'unknown',
714
+ };
715
+ },
716
+ options: {
717
+ audience: 'both',
718
+ tags: ['bash', 'environment', 'env', 'bashx'],
719
+ idempotent: true,
720
+ },
721
+ });
722
+ // ============================================================================
723
+ // Tool Collections
724
+ // ============================================================================
725
+ /**
726
+ * All filesystem tools (fsx.do)
727
+ */
728
+ export const fsxTools = [fsRead, fsWrite, fsList, fsDelete, fsGlob, fsGrep];
729
+ /**
730
+ * All git tools (gitx.do)
731
+ */
732
+ export const gitxTools = [
733
+ gitInit,
734
+ gitClone,
735
+ gitStatus,
736
+ gitAdd,
737
+ gitCommit,
738
+ gitLog,
739
+ gitDiff,
740
+ gitCheckout,
741
+ gitPush,
742
+ gitPull,
743
+ ];
744
+ /**
745
+ * All bash tools (bashx.do)
746
+ */
747
+ export const bashxTools = [bashExec, bashAnalyze, bashScript, bashEnv];
748
+ /**
749
+ * All system tools (fsx + gitx + bashx)
750
+ */
751
+ export const systemTools = [...fsxTools, ...gitxTools, ...bashxTools];
752
+ //# sourceMappingURL=system.js.map