@mindstudio-ai/agent 0.1.149 → 0.1.151

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
@@ -395,6 +395,27 @@ Generate or enhance a video generation prompt using a language model. Optionally
395
395
  - Input: `{ initialPrompt: string, includeNegativePrompt: boolean, negativePromptDestinationVariableName?: string, systemPrompt: string, modelOverride?: unknown }`
396
396
  - Output: `{ prompt: string, negativePrompt?: string }`
397
397
 
398
+ #### evaluateDecision
399
+ Ask structured questions about text, JSON, or images and get calibrated answers from a decision model. The model returns a probability, a selected option, or a score. It does not write a reply. Each question is a noul (yes or no, as a probability from 0 to 1), a choice (one option from a set you define, with a probability for each), or a score (a rating against ordered levels). Put every question in the same call. The question id is yours: answers come back under the same ids. The model defaults to Jev (jev-latest).
400
+ - state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).
401
+ - questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.
402
+ - A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.
403
+ - A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.
404
+ - A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.
405
+ - An answer of type refusal means the model declined that question (GPT-6 Luna Decisions can).
406
+ - instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.
407
+ - Send every question you need in one call. The model reads the state once and answers them together.
408
+ - Probabilities from different models are not comparable: tune a threshold against the model, and the version, it will run on.
409
+ - decisionModelOverride.model picks the model:
410
+ - jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.
411
+ - clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.
412
+ - gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.
413
+ - images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.
414
+ - The response model field is the version that answered.
415
+ - Billed per input token. Output tokens are free. Each model has its own rate, and GPT-6 Luna Decisions bills a prompt over 272k tokens at twice its rate.
416
+ - Input: `{ state: string | object | unknown[], questions: object, images?: string[], decisionModelOverride?: { model: string, config?: object } }`
417
+ - Output: `{ model: string, answers: object, usage: { input_tokens: number, output_tokens: number } }`
418
+
398
419
  #### extractAudioFromVideo
399
420
  Extract audio MP3 from a video file
400
421
  - Input: `{ videoUrl: string }`
@@ -404,12 +425,19 @@ Extract audio MP3 from a video file
404
425
  Download a file from a URL and extract its text content. Supports PDFs (including scanned/image-based PDFs via OCR), plain text files, and other document formats.
405
426
  - Best suited for PDFs and raw text/document files. For web pages, use the scrapeUrl step instead.
406
427
  - Handles both text-layer PDFs and image-based/scanned PDFs (e.g. Figma/Canva exports, scanned documents). Image-based PDFs are processed with OCR automatically — there is no need to convert PDF pages to images first.
428
+ - Plain text, code, HTML, spreadsheets and Office documents (docx, pptx, odt, rtf, epub) are read without a model and cost nothing. PDFs and images go to the extraction model, billed per page.
407
429
  - Accepts a single URL, a comma-separated list of URLs, or a JSON array of URLs.
408
430
  - Nothing is published. One of the app's own files — including a private one, or a share link — is read where it sits; any other URL is downloaded and staged privately for the extraction model, then discarded when extraction finishes.
409
- - Optionally set `model` to a specific document-extraction model (`mistral-ocr-latest`, `llamaparse`, `google-document-ai`); omit to use the platform default.
431
+ - `text` is each document's text: a string for one URL, an array for several. `documents` has each document page by page, with its page numbers and the pages billed. Set `includeBlocks` to add each page's typed blocks (title, text, table, image, header, footer…) with their bounding boxes, and the page's size.
432
+ - A file that can't be read (unreachable, an unsupported type, past the model's limits, or refused by the model) fails the step with the reason.
433
+ - `extractionModelOverride.model` picks the model; omit it to use the workspace's default:
434
+ - `mistral-ocr-4.1` (the default): PDFs and images up to 50 MB and 1,000 pages, with typed blocks.
435
+ - `mistral-document-ai-2512`: Mistral Document AI on Microsoft Foundry, up to 30 MB and 30 pages, with typed blocks.
436
+ - `llamaparse`: LlamaParse's agentic mode, up to 100 MB and 1,000 pages, markdown without blocks.
437
+ - `google-document-ai`: Google Document AI OCR, up to 500 pages, where the deployment has set it up.
410
438
  - Maximum file size is 50MB per URL.
411
- - Input: `{ url: string | string[], model?: string }`
412
- - Output: `{ text: string | string[] }`
439
+ - Input: `{ url: string | string[], extractionModelOverride?: { model: string, config?: object }, model?: string, includeBlocks?: boolean }`
440
+ - Output: `{ text: string | string[], documents: { url: string, text: string, pages: { pageNumber: number, markdown: string, blocks?: unknown[], dimensions?: { width: number, height: number, dpi?: number } }[], pagesProcessed: number }[] }`
413
441
 
414
442
  #### fetchDataSourceDocument
415
443
  Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Fetch the full extracted text contents of a document in a data source.
@@ -890,21 +918,33 @@ Explicitly set a variable to a given value.
890
918
  #### textToSpeech
891
919
  Generate an audio file from provided text using a speech model.
892
920
  - The text field contains the exact words to be spoken (not instructions).
921
+ - Voice, delivery and format are set through `speechModelOverride.config`, whose keys are the model's own (look a model up with its id). Delivery direction, where a model takes one, is never spoken: `styleInstruction` on gemini-3.8-flash-tts and gemini-3.8-flash-lite-tts, `instructions` on gpt-realtime-2.1-mini-tts, `voice_instruction` on seed-speech-tts-2.0, `emotion` on cartesia-sonic-3.6 and the MiniMax models.
922
+ - Tags in the text act at that point, in each vendor's own syntax: `[laughs]` or `[whispers]` on elevenlabs-tts with Eleven v4 or v3; `<laugh>`, `<sigh>` or `<whispers>` on the Gemini 3.8 models; `[laugh]`, `[pause]` or `<whisper>…</whisper>` on grok-voice-tts; `[laughter]` or `<emotion value="excited"/>` on cartesia-sonic-3.6; `[be happy and upbeat]` on inworld-tts-2.
923
+ - A dialogue between voices: set `$mode: 'dialogue'` and name each speaker (`speaker1_name`, `speaker1_voice`, `speaker2_name`, …), then write the text as a script, one `Name: line` per turn. Supported by elevenlabs-tts (Eleven v4 or v3, up to 4 speakers) and the Gemini 3.8 models (exactly 2).
924
+ - A text longer than a model takes in one request is spoken in pieces and joined, and then comes back as MP3 whatever format was asked for.
893
925
  - In foreground mode, the audio is displayed to the user. In background mode, the URL is saved to a variable.
894
926
  - Input: `{ text: string, intermediateAsset?: boolean, speechModelOverride?: { model: string, config?: object } }`
895
927
  - Output: `{ audioUrl: string }`
896
928
 
897
929
  #### transcribeAudio
898
930
  Convert an audio file to text using a transcription model.
899
- - The prompt field provides optional context to improve transcription accuracy (e.g. language, speaker names, domain).
900
- - Detail beyond the plain transcript is requested through `transcriptionModelOverride.config`, and support varies by model:
901
- - `includeSpeakers: 'yes'` — label each passage with a speaker. Supported by elevenlabs-scribe-v1, elevenlabs-scribe-v2, deepgram-nova-3 and grok-stt. Also switches `text` to a timestamped, speaker-labelled block format.
902
- - `includeWordTimings: 'yes'` — add per-word timings and confidence inside each segment. Supported by elevenlabs-scribe-v1, elevenlabs-scribe-v2, deepgram-nova-3 and whisper-1. Off by default because an hour of speech is roughly ten thousand words.
903
- - `detectLanguage: 'yes'` — detect the spoken language instead of assuming English (deepgram-nova-3 only; Scribe and the whisper models always report it).
904
- - The `segments` output carries timings, confidence and speakers as structured data, so there is no need to slice the audio up to recover them. It is populated for elevenlabs-scribe-v1/v2, deepgram-nova-3, whisper-1 and the DeepInfra-served whisper/voxtral/qwen models, and absent for models that return nothing but text (gpt-transcribe, gpt-4o-transcribe, grok-stt).
931
+ - The default model is elevenlabs-scribe-v2: speakers, word timings, key terms and redaction, at any length.
932
+ - The prompt field gives context (speaker names, domain) to OpenAI's and DeepInfra's models. Other models ignore it; give them `keyterms` instead.
933
+ - Options go in `transcriptionModelOverride.config`, and support varies by model:
934
+ - `language` — the spoken language as a code such as `en` or `es`; left out, the model detects it. Every model takes it. deepgram-nova-3 assumes `en` unless told, and also takes `multi` for speech that switches language (billed at its multilingual rate).
935
+ - `detectLanguage: 'yes'` — detect the language instead of assuming English (deepgram-nova-3 only).
936
+ - `includeSpeakers: 'yes'` — label each passage with a speaker. Supported by elevenlabs-scribe-v2, elevenlabs-scribe-v2-medical, deepgram-nova-3, grok-stt, voxtral-mini-transcribe-2 and gemini-3.5-transcribe; gpt-4o-transcribe-diarize always does. Scribe and Voxtral also switch `text` to a timestamped, speaker-labelled block format; Deepgram, Gemini and gpt-4o-transcribe-diarize to `Speaker N:` lines.
937
+ - `numSpeakers` — the most people talking, to help tell them apart (Scribe).
938
+ - `keyterms` — a list of names, products and terms the audio contains, so they're spelled right. Supported by gpt-transcribe, Scribe, deepgram-nova-3, grok-stt, voxtral-mini-transcribe-2 and gemini-3.5-transcribe. Billed as an add-on on Scribe and Deepgram.
939
+ - `redactPii: 'yes'` — replace names, phone numbers, addresses and other personal information with a label of what was there (Scribe, deepgram-nova-3). Billed as an add-on.
940
+ - `includeWordTimings: 'yes'` — add per-word timings and confidence inside each segment. Supported by Scribe, deepgram-nova-3, whisper-1, grok-stt, voxtral-mini-transcribe-2 and gemini-3.5-transcribe. Off by default because an hour of speech is roughly ten thousand words.
941
+ - `subtitles: 'srt' | 'vtt'` — also return the transcript as a subtitle file, in the `subtitles` output, timed by the segments. Any model that returns segments.
942
+ - gemini-3.5-transcribe can't take `keyterms` together with speakers, word timings or subtitles, and voxtral-mini-transcribe-2 can't take `language` together with word timings or subtitles; either asked for both is refused.
943
+ - The `segments` output carries timings, confidence and speakers as structured data, so there is no need to slice the audio up to recover them. It is populated by Scribe, deepgram-nova-3, grok-stt, whisper-1, gpt-4o-transcribe-diarize, voxtral-mini-transcribe-2 (unless given a language), gemini-3.5-transcribe (with word timings or subtitles) and the DeepInfra-served whisper and qwen models, and absent for models that return nothing but text (gpt-transcribe, gpt-4o-transcribe, gpt-4o-mini-transcribe, the DeepInfra-served voxtral models).
944
+ - A recording of any length can be transcribed. One longer than a model takes at once (OpenAI's and DeepInfra's models, Gemini) is transcribed in pieces and joined, its timings running from the start of the recording. Speakers can't be followed from one piece to the next, so with speakers on, such a recording is refused; Scribe and Deepgram label speakers at any length.
905
945
  - `confidence` is always 0..1 with higher meaning more confident, whichever model produced it.
906
946
  - Input: `{ audioUrl: string, prompt: string, transcriptionModelOverride?: { model: string, config?: object } }`
907
- - Output: `{ text: string, segments?: { start: number, end: number, text: string, confidence?: number, speaker?: string, language?: string, words?: { text: string, start?: number, end?: number, confidence?: number, speaker?: string }[] }[], language?: string, durationSeconds?: number }`
947
+ - Output: `{ text: string, segments?: { start: number, end: number, text: string, confidence?: number, speaker?: string, language?: string, words?: { text: string, start?: number, end?: number, confidence?: number, speaker?: string }[] }[], language?: string, durationSeconds?: number, subtitles?: string }`
908
948
 
909
949
  #### trimMedia
910
950
  Trim an audio or video clip
@@ -1420,17 +1460,8 @@ Call any QuickBooks Online Accounting API route using a connected company.
1420
1460
  ### TypeSafe
1421
1461
 
1422
1462
  #### typesafeEvaluate
1423
- Ask structured questions about text, JSON, or images and get calibrated answers. The model returns a probability, a selected option, or a score. It does not write a reply. Each question is a noul (yes or no, as a probability from 0 to 1), a choice (one option from a set you define, with a probability for each), or a score (a rating against ordered levels). Put every question in the same call. The question id is yours: answers come back under the same ids. The model defaults to Jev (jev-latest). Pass clef or clef-flash to run Cloudflare Clef with the same questions and answers. Clef and Clef Flash can also read up to 4 images.
1424
- - state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).
1425
- - images is for Clef and Clef Flash. Pass up to 4 PNG, JPEG, or WebP images as URLs. Each file is at most 4 MiB, and 8 MiB together. A call on Jev that includes images is rejected.
1426
- - questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.
1427
- - A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.
1428
- - A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.
1429
- - A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.
1430
- - instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.
1431
- - Send every question you need in one call. The model reads the state once and answers them together.
1432
- - model defaults to jev-latest, the current stable TypeSafe release. jev-preview tracks the newest TypeSafe release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version. clef and clef-flash run Cloudflare Clef on the same questions and answers. clef is the larger model. clef-flash is the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two. Clef accepts at most 64 questions, and a question id may use only letters, digits, underscore, dot, and hyphen, up to 100 characters. The response model field is the version that answered.
1433
- - Billed per input token. Output tokens are free. Clef and Clef-flash have their own rates.
1463
+ Use evaluateDecision: the same questions, answers and models, with decisionModelOverride in place of model. evaluateDecision's earlier name, which still runs: ask structured questions about text, JSON, or images and get calibrated answers from a decision model.
1464
+ - Runs exactly as evaluateDecision does, with the same questions, answers, models and limits (see its notes), and model in place of decisionModelOverride.model.
1434
1465
  - Input: `{ state: string | object | unknown[], questions: object, model?: string, images?: string[] }`
1435
1466
  - Output: `{ model: string, answers: object, usage: { input_tokens: number, output_tokens: number } }`
1436
1467
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.149",
3
+ "version": "0.1.151",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",