digital-tools 2.1.3 → 2.3.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/CHANGELOG.md +9 -0
  2. package/README.md +2 -0
  3. package/dist/client.d.ts +109 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +69 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/define.d.ts +2 -2
  8. package/dist/define.d.ts.map +1 -1
  9. package/dist/define.js +21 -11
  10. package/dist/define.js.map +1 -1
  11. package/dist/function-ref.d.ts +229 -0
  12. package/dist/function-ref.d.ts.map +1 -0
  13. package/dist/function-ref.js +28 -0
  14. package/dist/function-ref.js.map +1 -0
  15. package/dist/function-sugar.d.ts +57 -0
  16. package/dist/function-sugar.d.ts.map +1 -0
  17. package/dist/function-sugar.js +79 -0
  18. package/dist/function-sugar.js.map +1 -0
  19. package/dist/index.d.ts +10 -3
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +24 -4
  22. package/dist/index.js.map +1 -1
  23. package/dist/providers/analytics/mixpanel.d.ts.map +1 -1
  24. package/dist/providers/analytics/mixpanel.js +21 -18
  25. package/dist/providers/analytics/mixpanel.js.map +1 -1
  26. package/dist/providers/calendar/cal-com.d.ts.map +1 -1
  27. package/dist/providers/calendar/cal-com.js +10 -10
  28. package/dist/providers/calendar/cal-com.js.map +1 -1
  29. package/dist/providers/calendar/google-calendar.d.ts.map +1 -1
  30. package/dist/providers/calendar/google-calendar.js +4 -4
  31. package/dist/providers/calendar/google-calendar.js.map +1 -1
  32. package/dist/providers/crm/hubspot.d.ts.map +1 -1
  33. package/dist/providers/crm/hubspot.js +107 -85
  34. package/dist/providers/crm/hubspot.js.map +1 -1
  35. package/dist/providers/development/github.d.ts.map +1 -1
  36. package/dist/providers/development/github.js +40 -43
  37. package/dist/providers/development/github.js.map +1 -1
  38. package/dist/providers/ecommerce/shopify.d.ts.map +1 -1
  39. package/dist/providers/ecommerce/shopify.js +79 -62
  40. package/dist/providers/ecommerce/shopify.js.map +1 -1
  41. package/dist/providers/email/resend.d.ts.map +1 -1
  42. package/dist/providers/email/resend.js +20 -16
  43. package/dist/providers/email/resend.js.map +1 -1
  44. package/dist/providers/email/sendgrid.d.ts.map +1 -1
  45. package/dist/providers/email/sendgrid.js +12 -9
  46. package/dist/providers/email/sendgrid.js.map +1 -1
  47. package/dist/providers/finance/stripe.d.ts.map +1 -1
  48. package/dist/providers/finance/stripe.js +44 -42
  49. package/dist/providers/finance/stripe.js.map +1 -1
  50. package/dist/providers/forms/typeform.d.ts.map +1 -1
  51. package/dist/providers/forms/typeform.js +68 -58
  52. package/dist/providers/forms/typeform.js.map +1 -1
  53. package/dist/providers/knowledge/notion.d.ts.map +1 -1
  54. package/dist/providers/knowledge/notion.js +75 -41
  55. package/dist/providers/knowledge/notion.js.map +1 -1
  56. package/dist/providers/marketing/mailchimp.d.ts.map +1 -1
  57. package/dist/providers/marketing/mailchimp.js +74 -61
  58. package/dist/providers/marketing/mailchimp.js.map +1 -1
  59. package/dist/providers/media/cloudinary.d.ts.map +1 -1
  60. package/dist/providers/media/cloudinary.js +30 -28
  61. package/dist/providers/media/cloudinary.js.map +1 -1
  62. package/dist/providers/messaging/slack.d.ts.map +1 -1
  63. package/dist/providers/messaging/slack.js +75 -58
  64. package/dist/providers/messaging/slack.js.map +1 -1
  65. package/dist/providers/messaging/twilio-sms.d.ts.map +1 -1
  66. package/dist/providers/messaging/twilio-sms.js +33 -15
  67. package/dist/providers/messaging/twilio-sms.js.map +1 -1
  68. package/dist/providers/project-management/linear.d.ts.map +1 -1
  69. package/dist/providers/project-management/linear.js +31 -27
  70. package/dist/providers/project-management/linear.js.map +1 -1
  71. package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -1
  72. package/dist/providers/spreadsheet/google-sheets.js +21 -18
  73. package/dist/providers/spreadsheet/google-sheets.js.map +1 -1
  74. package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -1
  75. package/dist/providers/spreadsheet/xlsx.js +4 -4
  76. package/dist/providers/spreadsheet/xlsx.js.map +1 -1
  77. package/dist/providers/storage/index.js +1 -0
  78. package/dist/providers/storage/index.js.map +1 -1
  79. package/dist/providers/storage/s3.d.ts.map +1 -1
  80. package/dist/providers/storage/s3.js +36 -27
  81. package/dist/providers/storage/s3.js.map +1 -1
  82. package/dist/providers/support/zendesk.d.ts.map +1 -1
  83. package/dist/providers/support/zendesk.js +24 -25
  84. package/dist/providers/support/zendesk.js.map +1 -1
  85. package/dist/providers/tasks/todoist.d.ts.map +1 -1
  86. package/dist/providers/tasks/todoist.js +18 -18
  87. package/dist/providers/tasks/todoist.js.map +1 -1
  88. package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -1
  89. package/dist/providers/video-conferencing/google-meet.js +11 -11
  90. package/dist/providers/video-conferencing/google-meet.js.map +1 -1
  91. package/dist/providers/video-conferencing/jitsi.js +14 -14
  92. package/dist/providers/video-conferencing/jitsi.js.map +1 -1
  93. package/dist/providers/video-conferencing/teams.d.ts.map +1 -1
  94. package/dist/providers/video-conferencing/teams.js +9 -7
  95. package/dist/providers/video-conferencing/teams.js.map +1 -1
  96. package/dist/providers/video-conferencing/zoom.d.ts.map +1 -1
  97. package/dist/providers/video-conferencing/zoom.js +26 -24
  98. package/dist/providers/video-conferencing/zoom.js.map +1 -1
  99. package/dist/tools/data.d.ts.map +1 -1
  100. package/dist/tools/data.js +5 -12
  101. package/dist/tools/data.js.map +1 -1
  102. package/dist/tools/index.d.ts +1 -0
  103. package/dist/tools/index.d.ts.map +1 -1
  104. package/dist/tools/index.js +1 -0
  105. package/dist/tools/index.js.map +1 -1
  106. package/dist/tools/system.d.ts +289 -0
  107. package/dist/tools/system.d.ts.map +1 -0
  108. package/dist/tools/system.js +752 -0
  109. package/dist/tools/system.js.map +1 -0
  110. package/dist/tools/web.d.ts.map +1 -1
  111. package/dist/tools/web.js +22 -10
  112. package/dist/tools/web.js.map +1 -1
  113. package/dist/track-record.d.ts +101 -0
  114. package/dist/track-record.d.ts.map +1 -0
  115. package/dist/track-record.js +17 -0
  116. package/dist/track-record.js.map +1 -0
  117. package/dist/types.d.ts +210 -9
  118. package/dist/types.d.ts.map +1 -1
  119. package/dist/verb-registration.d.ts +122 -0
  120. package/dist/verb-registration.d.ts.map +1 -0
  121. package/dist/verb-registration.js +176 -0
  122. package/dist/verb-registration.js.map +1 -0
  123. package/dist/worker.d.ts +93 -0
  124. package/dist/worker.d.ts.map +1 -0
  125. package/dist/worker.js +315 -0
  126. package/dist/worker.js.map +1 -0
  127. package/dist/wrap.d.ts +89 -0
  128. package/dist/wrap.d.ts.map +1 -0
  129. package/dist/wrap.js +225 -0
  130. package/dist/wrap.js.map +1 -0
  131. package/package.json +31 -14
  132. package/src/client.ts +136 -0
  133. package/src/define.ts +30 -24
  134. package/src/function-ref.ts +264 -0
  135. package/src/function-sugar.ts +134 -0
  136. package/src/index.ts +132 -10
  137. package/src/providers/analytics/mixpanel.ts +19 -18
  138. package/src/providers/calendar/cal-com.ts +29 -18
  139. package/src/providers/calendar/google-calendar.ts +20 -14
  140. package/src/providers/crm/hubspot.ts +225 -99
  141. package/src/providers/development/github.ts +206 -135
  142. package/src/providers/ecommerce/shopify.ts +250 -89
  143. package/src/providers/email/resend.ts +101 -28
  144. package/src/providers/email/sendgrid.ts +12 -9
  145. package/src/providers/finance/stripe.ts +128 -49
  146. package/src/providers/forms/typeform.ts +74 -58
  147. package/src/providers/knowledge/notion.ts +340 -88
  148. package/src/providers/marketing/mailchimp.ts +86 -70
  149. package/src/providers/media/cloudinary.ts +99 -41
  150. package/src/providers/messaging/slack.ts +283 -85
  151. package/src/providers/messaging/twilio-sms.ts +35 -15
  152. package/src/providers/project-management/linear.ts +143 -55
  153. package/src/providers/spreadsheet/google-sheets.ts +222 -56
  154. package/src/providers/spreadsheet/xlsx.ts +47 -16
  155. package/src/providers/storage/s3.ts +119 -47
  156. package/src/providers/support/zendesk.ts +196 -46
  157. package/src/providers/tasks/todoist.ts +20 -26
  158. package/src/providers/video-conferencing/google-meet.ts +17 -20
  159. package/src/providers/video-conferencing/jitsi.ts +14 -14
  160. package/src/providers/video-conferencing/teams.ts +14 -13
  161. package/src/providers/video-conferencing/zoom.ts +54 -49
  162. package/src/tools/data.ts +6 -16
  163. package/src/tools/index.ts +1 -0
  164. package/src/tools/system.ts +887 -0
  165. package/src/tools/web.ts +22 -10
  166. package/src/track-record.ts +106 -0
  167. package/src/types.ts +241 -13
  168. package/src/verb-registration.ts +197 -0
  169. package/src/worker.ts +370 -0
  170. package/src/wrap.ts +260 -0
  171. package/test/client.test.ts +146 -0
  172. package/test/communication-tools-extended.test.ts +734 -0
  173. package/test/data-tools-extended.test.ts +743 -0
  174. package/test/define-extended.test.ts +819 -0
  175. package/test/define.test.ts +150 -41
  176. package/test/entities.test.ts +623 -0
  177. package/test/extended-entities.test.ts +1228 -0
  178. package/test/provider-implementations.test.ts +725 -0
  179. package/test/provider-registry-extended.test.ts +583 -0
  180. package/test/providers/google-sheets.test.ts +851 -0
  181. package/test/providers/helpers.ts +554 -0
  182. package/test/providers/hubspot.test.ts +576 -0
  183. package/test/providers/slack.test.ts +932 -0
  184. package/test/providers/stripe.test.ts +701 -0
  185. package/test/providers.test.ts +578 -0
  186. package/test/system-tools-extended.test.ts +632 -0
  187. package/test/system.test.ts +673 -0
  188. package/test/tools.test.ts +15 -11
  189. package/test/types.test.ts +402 -0
  190. package/test/verb-registration.test.ts +395 -0
  191. package/test/web-tools.test.ts +553 -0
  192. package/test/worker-extended.test.ts +699 -0
  193. package/test/worker.test.ts +576 -0
  194. package/test/wrap.test.ts +366 -0
  195. package/tsconfig.json +3 -13
  196. package/vitest.config.ts +37 -0
  197. package/wrangler.jsonc +9 -0
  198. package/.turbo/turbo-build.log +0 -4
  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
@@ -1,756 +0,0 @@
1
- /**
2
- * AI Entity Types (Nouns)
3
- *
4
- * AI and machine learning entities for models, prompts,
5
- * completions, agents, and embeddings.
6
- *
7
- * @packageDocumentation
8
- */
9
- // =============================================================================
10
- // Model
11
- // =============================================================================
12
- /**
13
- * Model entity
14
- *
15
- * Represents an AI/ML model.
16
- */
17
- export const Model = {
18
- singular: 'model',
19
- plural: 'models',
20
- description: 'An AI/ML model',
21
- properties: {
22
- // Identity
23
- name: {
24
- type: 'string',
25
- description: 'Model name',
26
- },
27
- provider: {
28
- type: 'string',
29
- description: 'Model provider',
30
- examples: ['openai', 'anthropic', 'google', 'meta', 'mistral', 'cohere', 'custom'],
31
- },
32
- modelId: {
33
- type: 'string',
34
- description: 'Provider model ID',
35
- },
36
- // Type
37
- type: {
38
- type: 'string',
39
- description: 'Model type',
40
- examples: ['chat', 'completion', 'embedding', 'image', 'audio', 'video', 'multimodal'],
41
- },
42
- // Capabilities
43
- contextWindow: {
44
- type: 'number',
45
- optional: true,
46
- description: 'Context window size in tokens',
47
- },
48
- maxOutputTokens: {
49
- type: 'number',
50
- optional: true,
51
- description: 'Max output tokens',
52
- },
53
- supportsStreaming: {
54
- type: 'boolean',
55
- optional: true,
56
- description: 'Supports streaming',
57
- },
58
- supportsTools: {
59
- type: 'boolean',
60
- optional: true,
61
- description: 'Supports tool/function calling',
62
- },
63
- supportsVision: {
64
- type: 'boolean',
65
- optional: true,
66
- description: 'Supports image input',
67
- },
68
- // Pricing
69
- inputCostPer1k: {
70
- type: 'number',
71
- optional: true,
72
- description: 'Cost per 1k input tokens',
73
- },
74
- outputCostPer1k: {
75
- type: 'number',
76
- optional: true,
77
- description: 'Cost per 1k output tokens',
78
- },
79
- currency: {
80
- type: 'string',
81
- optional: true,
82
- description: 'Currency',
83
- },
84
- // Status
85
- status: {
86
- type: 'string',
87
- optional: true,
88
- description: 'Model status',
89
- examples: ['available', 'deprecated', 'beta', 'preview'],
90
- },
91
- isActive: {
92
- type: 'boolean',
93
- description: 'Whether model is active',
94
- },
95
- },
96
- relationships: {
97
- completions: {
98
- type: 'Completion[]',
99
- description: 'Completions using this model',
100
- },
101
- },
102
- actions: [
103
- 'create',
104
- 'update',
105
- 'activate',
106
- 'deactivate',
107
- 'test',
108
- ],
109
- events: [
110
- 'created',
111
- 'updated',
112
- 'activated',
113
- 'deactivated',
114
- 'deprecated',
115
- ],
116
- };
117
- // =============================================================================
118
- // Prompt
119
- // =============================================================================
120
- /**
121
- * Prompt entity
122
- *
123
- * Represents a reusable prompt template.
124
- */
125
- export const Prompt = {
126
- singular: 'prompt',
127
- plural: 'prompts',
128
- description: 'A reusable prompt template',
129
- properties: {
130
- // Identity
131
- name: {
132
- type: 'string',
133
- description: 'Prompt name',
134
- },
135
- slug: {
136
- type: 'string',
137
- optional: true,
138
- description: 'URL-friendly identifier',
139
- },
140
- description: {
141
- type: 'string',
142
- optional: true,
143
- description: 'Prompt description',
144
- },
145
- // Content
146
- template: {
147
- type: 'string',
148
- description: 'Prompt template with variables',
149
- },
150
- systemPrompt: {
151
- type: 'string',
152
- optional: true,
153
- description: 'System prompt',
154
- },
155
- variables: {
156
- type: 'json',
157
- optional: true,
158
- description: 'Template variables definition',
159
- },
160
- // Configuration
161
- defaultModel: {
162
- type: 'string',
163
- optional: true,
164
- description: 'Default model to use',
165
- },
166
- temperature: {
167
- type: 'number',
168
- optional: true,
169
- description: 'Temperature setting',
170
- },
171
- maxTokens: {
172
- type: 'number',
173
- optional: true,
174
- description: 'Max output tokens',
175
- },
176
- topP: {
177
- type: 'number',
178
- optional: true,
179
- description: 'Top-p sampling',
180
- },
181
- stopSequences: {
182
- type: 'string',
183
- array: true,
184
- optional: true,
185
- description: 'Stop sequences',
186
- },
187
- // Organization
188
- category: {
189
- type: 'string',
190
- optional: true,
191
- description: 'Prompt category',
192
- },
193
- tags: {
194
- type: 'string',
195
- array: true,
196
- optional: true,
197
- description: 'Tags',
198
- },
199
- // Versioning
200
- version: {
201
- type: 'string',
202
- optional: true,
203
- description: 'Version',
204
- },
205
- isPublished: {
206
- type: 'boolean',
207
- optional: true,
208
- description: 'Whether published',
209
- },
210
- },
211
- relationships: {
212
- owner: {
213
- type: 'User',
214
- description: 'Prompt owner',
215
- },
216
- completions: {
217
- type: 'Completion[]',
218
- description: 'Completions using this prompt',
219
- },
220
- },
221
- actions: [
222
- 'create',
223
- 'update',
224
- 'publish',
225
- 'unpublish',
226
- 'duplicate',
227
- 'version',
228
- 'test',
229
- ],
230
- events: [
231
- 'created',
232
- 'updated',
233
- 'published',
234
- 'unpublished',
235
- 'versioned',
236
- ],
237
- };
238
- // =============================================================================
239
- // Completion
240
- // =============================================================================
241
- /**
242
- * Completion entity
243
- *
244
- * Represents an AI completion/response.
245
- */
246
- export const Completion = {
247
- singular: 'completion',
248
- plural: 'completions',
249
- description: 'An AI completion or response',
250
- properties: {
251
- // Request
252
- input: {
253
- type: 'string',
254
- description: 'Input prompt/messages',
255
- },
256
- systemPrompt: {
257
- type: 'string',
258
- optional: true,
259
- description: 'System prompt used',
260
- },
261
- // Response
262
- output: {
263
- type: 'string',
264
- description: 'Model output',
265
- },
266
- finishReason: {
267
- type: 'string',
268
- optional: true,
269
- description: 'Finish reason',
270
- examples: ['stop', 'length', 'tool_calls', 'content_filter'],
271
- },
272
- // Usage
273
- inputTokens: {
274
- type: 'number',
275
- optional: true,
276
- description: 'Input tokens used',
277
- },
278
- outputTokens: {
279
- type: 'number',
280
- optional: true,
281
- description: 'Output tokens generated',
282
- },
283
- totalTokens: {
284
- type: 'number',
285
- optional: true,
286
- description: 'Total tokens',
287
- },
288
- // Cost
289
- cost: {
290
- type: 'number',
291
- optional: true,
292
- description: 'Cost in USD',
293
- },
294
- // Timing
295
- latency: {
296
- type: 'number',
297
- optional: true,
298
- description: 'Latency in milliseconds',
299
- },
300
- timeToFirstToken: {
301
- type: 'number',
302
- optional: true,
303
- description: 'Time to first token in ms',
304
- },
305
- // Configuration used
306
- modelId: {
307
- type: 'string',
308
- description: 'Model used',
309
- },
310
- temperature: {
311
- type: 'number',
312
- optional: true,
313
- description: 'Temperature used',
314
- },
315
- maxTokens: {
316
- type: 'number',
317
- optional: true,
318
- description: 'Max tokens setting',
319
- },
320
- // Metadata
321
- requestId: {
322
- type: 'string',
323
- optional: true,
324
- description: 'Provider request ID',
325
- },
326
- status: {
327
- type: 'string',
328
- description: 'Completion status',
329
- examples: ['completed', 'failed', 'cancelled'],
330
- },
331
- error: {
332
- type: 'string',
333
- optional: true,
334
- description: 'Error message if failed',
335
- },
336
- },
337
- relationships: {
338
- model: {
339
- type: 'Model',
340
- description: 'Model used',
341
- },
342
- prompt: {
343
- type: 'Prompt',
344
- required: false,
345
- description: 'Prompt template used',
346
- },
347
- conversation: {
348
- type: 'Conversation',
349
- required: false,
350
- description: 'Parent conversation',
351
- },
352
- },
353
- actions: [
354
- 'create',
355
- 'cancel',
356
- 'retry',
357
- ],
358
- events: [
359
- 'started',
360
- 'streamed',
361
- 'completed',
362
- 'failed',
363
- 'cancelled',
364
- ],
365
- };
366
- // =============================================================================
367
- // AIConversation
368
- // =============================================================================
369
- /**
370
- * AIConversation entity
371
- *
372
- * Represents a conversation/chat session.
373
- */
374
- export const AIConversation = {
375
- singular: 'ai-conversation',
376
- plural: 'ai-conversations',
377
- description: 'An AI conversation or chat session',
378
- properties: {
379
- // Identity
380
- title: {
381
- type: 'string',
382
- optional: true,
383
- description: 'Conversation title',
384
- },
385
- // Configuration
386
- systemPrompt: {
387
- type: 'string',
388
- optional: true,
389
- description: 'System prompt',
390
- },
391
- modelId: {
392
- type: 'string',
393
- optional: true,
394
- description: 'Default model',
395
- },
396
- // Stats
397
- messageCount: {
398
- type: 'number',
399
- optional: true,
400
- description: 'Number of messages',
401
- },
402
- totalTokens: {
403
- type: 'number',
404
- optional: true,
405
- description: 'Total tokens used',
406
- },
407
- totalCost: {
408
- type: 'number',
409
- optional: true,
410
- description: 'Total cost',
411
- },
412
- // Dates
413
- lastMessageAt: {
414
- type: 'datetime',
415
- optional: true,
416
- description: 'Last message time',
417
- },
418
- // Status
419
- status: {
420
- type: 'string',
421
- optional: true,
422
- description: 'Conversation status',
423
- examples: ['active', 'archived'],
424
- },
425
- },
426
- relationships: {
427
- user: {
428
- type: 'User',
429
- description: 'Conversation owner',
430
- },
431
- messages: {
432
- type: 'Completion[]',
433
- description: 'Conversation messages',
434
- },
435
- agent: {
436
- type: 'Agent',
437
- required: false,
438
- description: 'Agent if using one',
439
- },
440
- },
441
- actions: [
442
- 'create',
443
- 'update',
444
- 'archive',
445
- 'delete',
446
- 'fork',
447
- ],
448
- events: [
449
- 'created',
450
- 'updated',
451
- 'messageAdded',
452
- 'archived',
453
- 'deleted',
454
- ],
455
- };
456
- // =============================================================================
457
- // Agent
458
- // =============================================================================
459
- /**
460
- * Agent entity
461
- *
462
- * Represents an AI agent with tools and capabilities.
463
- */
464
- export const Agent = {
465
- singular: 'agent',
466
- plural: 'agents',
467
- description: 'An AI agent with tools and capabilities',
468
- properties: {
469
- // Identity
470
- name: {
471
- type: 'string',
472
- description: 'Agent name',
473
- },
474
- description: {
475
- type: 'string',
476
- optional: true,
477
- description: 'Agent description',
478
- },
479
- avatarUrl: {
480
- type: 'url',
481
- optional: true,
482
- description: 'Agent avatar URL',
483
- },
484
- // Configuration
485
- systemPrompt: {
486
- type: 'string',
487
- optional: true,
488
- description: 'System prompt',
489
- },
490
- modelId: {
491
- type: 'string',
492
- description: 'Default model',
493
- },
494
- temperature: {
495
- type: 'number',
496
- optional: true,
497
- description: 'Temperature',
498
- },
499
- // Tools
500
- tools: {
501
- type: 'json',
502
- optional: true,
503
- description: 'Available tools/functions',
504
- },
505
- allowedTools: {
506
- type: 'string',
507
- array: true,
508
- optional: true,
509
- description: 'Allowed tool names',
510
- },
511
- // Behavior
512
- maxIterations: {
513
- type: 'number',
514
- optional: true,
515
- description: 'Max tool call iterations',
516
- },
517
- returnIntermediateSteps: {
518
- type: 'boolean',
519
- optional: true,
520
- description: 'Return intermediate steps',
521
- },
522
- // Status
523
- status: {
524
- type: 'string',
525
- description: 'Agent status',
526
- examples: ['draft', 'active', 'paused', 'archived'],
527
- },
528
- isPublic: {
529
- type: 'boolean',
530
- optional: true,
531
- description: 'Whether agent is public',
532
- },
533
- },
534
- relationships: {
535
- owner: {
536
- type: 'User',
537
- description: 'Agent owner',
538
- },
539
- conversations: {
540
- type: 'AIConversation[]',
541
- description: 'Conversations with agent',
542
- },
543
- },
544
- actions: [
545
- 'create',
546
- 'update',
547
- 'activate',
548
- 'pause',
549
- 'archive',
550
- 'duplicate',
551
- 'invoke',
552
- ],
553
- events: [
554
- 'created',
555
- 'updated',
556
- 'activated',
557
- 'paused',
558
- 'archived',
559
- 'invoked',
560
- ],
561
- };
562
- // =============================================================================
563
- // Embedding
564
- // =============================================================================
565
- /**
566
- * Embedding entity
567
- *
568
- * Represents a vector embedding.
569
- */
570
- export const Embedding = {
571
- singular: 'embedding',
572
- plural: 'embeddings',
573
- description: 'A vector embedding',
574
- properties: {
575
- // Content
576
- text: {
577
- type: 'string',
578
- description: 'Source text',
579
- },
580
- vector: {
581
- type: 'json',
582
- description: 'Embedding vector',
583
- },
584
- dimensions: {
585
- type: 'number',
586
- description: 'Vector dimensions',
587
- },
588
- // Source
589
- sourceType: {
590
- type: 'string',
591
- optional: true,
592
- description: 'Source type',
593
- examples: ['document', 'chunk', 'query', 'image'],
594
- },
595
- sourceId: {
596
- type: 'string',
597
- optional: true,
598
- description: 'Source document/item ID',
599
- },
600
- // Metadata
601
- modelId: {
602
- type: 'string',
603
- description: 'Model used',
604
- },
605
- namespace: {
606
- type: 'string',
607
- optional: true,
608
- description: 'Vector namespace',
609
- },
610
- metadata: {
611
- type: 'json',
612
- optional: true,
613
- description: 'Additional metadata',
614
- },
615
- // Tokens
616
- tokenCount: {
617
- type: 'number',
618
- optional: true,
619
- description: 'Token count',
620
- },
621
- },
622
- relationships: {},
623
- actions: [
624
- 'create',
625
- 'delete',
626
- 'search',
627
- ],
628
- events: [
629
- 'created',
630
- 'deleted',
631
- ],
632
- };
633
- // =============================================================================
634
- // FineTune
635
- // =============================================================================
636
- /**
637
- * FineTune entity
638
- *
639
- * Represents a fine-tuning job.
640
- */
641
- export const FineTune = {
642
- singular: 'fine-tune',
643
- plural: 'fine-tunes',
644
- description: 'A model fine-tuning job',
645
- properties: {
646
- // Identity
647
- name: {
648
- type: 'string',
649
- optional: true,
650
- description: 'Fine-tune name',
651
- },
652
- // Base model
653
- baseModel: {
654
- type: 'string',
655
- description: 'Base model ID',
656
- },
657
- fineTunedModel: {
658
- type: 'string',
659
- optional: true,
660
- description: 'Resulting fine-tuned model ID',
661
- },
662
- // Status
663
- status: {
664
- type: 'string',
665
- description: 'Job status',
666
- examples: ['pending', 'running', 'succeeded', 'failed', 'cancelled'],
667
- },
668
- // Training
669
- trainingFile: {
670
- type: 'string',
671
- description: 'Training data file ID',
672
- },
673
- validationFile: {
674
- type: 'string',
675
- optional: true,
676
- description: 'Validation data file ID',
677
- },
678
- // Hyperparameters
679
- epochs: {
680
- type: 'number',
681
- optional: true,
682
- description: 'Training epochs',
683
- },
684
- batchSize: {
685
- type: 'number',
686
- optional: true,
687
- description: 'Batch size',
688
- },
689
- learningRate: {
690
- type: 'number',
691
- optional: true,
692
- description: 'Learning rate',
693
- },
694
- // Progress
695
- trainedTokens: {
696
- type: 'number',
697
- optional: true,
698
- description: 'Tokens trained',
699
- },
700
- // Timing
701
- startedAt: {
702
- type: 'datetime',
703
- optional: true,
704
- description: 'Start time',
705
- },
706
- completedAt: {
707
- type: 'datetime',
708
- optional: true,
709
- description: 'Completion time',
710
- },
711
- // Error
712
- error: {
713
- type: 'string',
714
- optional: true,
715
- description: 'Error message',
716
- },
717
- },
718
- relationships: {
719
- owner: {
720
- type: 'User',
721
- description: 'Job owner',
722
- },
723
- },
724
- actions: [
725
- 'create',
726
- 'cancel',
727
- ],
728
- events: [
729
- 'created',
730
- 'started',
731
- 'progressed',
732
- 'succeeded',
733
- 'failed',
734
- 'cancelled',
735
- ],
736
- };
737
- // =============================================================================
738
- // Exports
739
- // =============================================================================
740
- export const AIEntities = {
741
- Model,
742
- Prompt,
743
- Completion,
744
- AIConversation,
745
- Agent,
746
- Embedding,
747
- FineTune,
748
- };
749
- export const AICategories = {
750
- models: ['Model', 'FineTune'],
751
- prompts: ['Prompt'],
752
- completions: ['Completion'],
753
- conversations: ['AIConversation'],
754
- agents: ['Agent'],
755
- embeddings: ['Embedding'],
756
- };