@mindstudio-ai/agent 0.0.19 → 0.0.20

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/llms.txt CHANGED
@@ -243,6 +243,16 @@ Delete a single document from a data source.
243
243
  - Input: `{ dataSourceId: string, documentId: string }`
244
244
  - Output: `unknown`
245
245
 
246
+ #### detectChanges
247
+ Detect changes between runs by comparing current input against previously stored state. Routes execution based on whether a change occurred.
248
+ - Persists state across runs using a global variable keyed to the step ID.
249
+ - Two modes: "comparison" (default) uses strict string inequality; "ai" uses an LLM to determine if a meaningful change occurred.
250
+ - First run always treats the value as "changed" since there is no previous state.
251
+ - Each mode supports transitions to different steps/workflows for the "changed" and "unchanged" paths.
252
+ - AI mode bills normally for the LLM call.
253
+ - Input: `{ mode: "ai" | "comparison", input: string, prompt?: string, modelOverride?: { model: string, temperature: number, maxResponseTokens: number, ignorePreamble?: boolean, userMessagePreprocessor?: { dataSource?: string, messageTemplate?: string, maxResults?: number, enabled?: boolean, shouldInherit?: boolean }, preamble?: string, multiModelEnabled?: boolean, editResponseEnabled?: boolean, config?: object }, previousValueVariable?: string, changedStepId?: string, changedWorkflowId?: string, unchangedStepId?: string, unchangedWorkflowId?: string }`
254
+ - Output: `{ hasChanged: boolean, currentValue: string, previousValue: string, isFirstRun: boolean }`
255
+
246
256
  #### detectPII
247
257
  Scan text for personally identifiable information using Microsoft Presidio.
248
258
  - In workflow mode, transitions to detectedStepId if PII is found, notDetectedStepId otherwise.
@@ -251,6 +261,37 @@ Scan text for personally identifiable information using Microsoft Presidio.
251
261
  - Input: `{ input: string, language: string, entities: string[], detectedStepId?: string, notDetectedStepId?: string, outputLogVariable?: string | null }`
252
262
  - Output: `{ detected: boolean, detections: { entity_type: string, start: number, end: number, score: number }[] }`
253
263
 
264
+ #### discordEditMessage
265
+ Edit a previously sent Discord channel message. Use with the message ID returned by Send Discord Message.
266
+ - Only messages sent by the bot can be edited.
267
+ - The messageId is returned by the Send Discord Message step.
268
+ - Optionally attach a file by providing a URL to attachmentUrl. The file is downloaded and uploaded to Discord.
269
+ - When editing with an attachment, the new attachment replaces any previous attachments on the message.
270
+ - URLs in the text are automatically embedded by Discord (link previews for images, videos, etc.).
271
+ - Input: `{ botToken: string, channelId: string, messageId: string, text: string, attachmentUrl?: string }`
272
+ - Output: `unknown`
273
+
274
+ #### discordSendFollowUp
275
+ Send a follow-up message to a Discord slash command interaction.
276
+ - Requires the applicationId and interactionToken from the Discord trigger variables.
277
+ - Follow-up messages appear as new messages in the channel after the initial response.
278
+ - Returns the sent message ID.
279
+ - Interaction tokens expire after 15 minutes.
280
+ - Optionally attach a file by providing a URL to attachmentUrl. The file is downloaded and uploaded to Discord.
281
+ - URLs in the text are automatically embedded by Discord (link previews for images, videos, etc.).
282
+ - Input: `{ applicationId: string, interactionToken: string, text: string, attachmentUrl?: string }`
283
+ - Output: `{ messageId: string }`
284
+
285
+ #### discordSendMessage
286
+ Send a message to Discord — either edit the loading message or send a new channel message.
287
+ - mode "edit" replaces the loading message (interaction response) with the final result. Uses applicationId and interactionToken from trigger variables. No bot permissions required.
288
+ - mode "send" sends a new message to a channel. Uses botToken and channelId from trigger variables. Returns a messageId that can be used with Edit Discord Message.
289
+ - Optionally attach a file by providing a URL to attachmentUrl. The file is downloaded and uploaded to Discord.
290
+ - URLs in the text are automatically embedded by Discord (link previews for images, videos, etc.).
291
+ - Interaction tokens expire after 15 minutes.
292
+ - Input: `{ mode: "edit" | "send", text: string, applicationId?: string, interactionToken?: string, botToken?: string, channelId?: string, attachmentUrl?: string }`
293
+ - Output: `{ messageId?: string }`
294
+
254
295
  #### downloadVideo
255
296
  Download a video file
256
297
  - Works with YouTube, TikTok, etc., by using ytdlp behind the scenes
@@ -405,12 +446,13 @@ List all data sources for the current app.
405
446
  - Output: `unknown`
406
447
 
407
448
  #### logic
408
- Use an AI model to evaluate which condition from a list is most true, given a context prompt.
409
- - This is "fuzzy" logic evaluated by an AI model, not computational logic. The model picks the most accurate statement.
410
- - All possible cases must be specified there is no default/fallback case.
449
+ Route execution to different branches based on AI evaluation, comparison operators, or workflow jumps.
450
+ - Supports two modes: "ai" (default) uses an AI model to pick the most accurate statement; "comparison" uses operator-based checks.
451
+ - In AI mode, the model picks the most accurate statement from the list. All possible cases must be specified.
452
+ - In comparison mode, the context is the left operand and each case's condition is the right operand. First matching case wins. Use operator "default" as a fallback.
411
453
  - Requires at least two cases.
412
- - In workflow mode, transitions to the destinationStepId of the winning case. In direct execution, returns the winning case ID and condition.
413
- - Input: `{ context: string, cases: ({ id: string, condition: string, destinationStepId?: string } | string)[] }`
454
+ - Each case can transition to a step in the current workflow (destinationStepId) or jump to another workflow (destinationWorkflowId).
455
+ - Input: `{ mode?: "ai" | "comparison", context: string, cases: ({ id: string, condition: string, operator?: "eq" | "neq" | "gt" | "lt" | "gte" | "lte" | "exists" | "not_exists" | "contains" | "not_contains" | "default", destinationStepId?: string, destinationWorkflowId?: string } | string)[], modelOverride?: { model: string, temperature: number, maxResponseTokens: number, ignorePreamble?: boolean, userMessagePreprocessor?: { dataSource?: string, messageTemplate?: string, maxResults?: number, enabled?: boolean, shouldInherit?: boolean }, preamble?: string, multiModelEnabled?: boolean, editResponseEnabled?: boolean, config?: object } }`
414
456
  - Output: `{ selectedCase: number }`
415
457
 
416
458
  #### makeDotComRunScenario
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",