@mindstudio-ai/agent 0.1.86 → 0.1.88
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/dist/cli.js +64 -21
- package/dist/index.d.ts +168 -7
- package/dist/index.js +53 -10
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +64 -21
- package/llms.txt +18 -10
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -8,7 +8,7 @@ This file is the complete API reference. No other documentation is needed to use
|
|
|
8
8
|
|
|
9
9
|
There are 150+ actions available. Do NOT try to read or load them all at once. Follow this discovery flow:
|
|
10
10
|
|
|
11
|
-
1. **Identify yourself** — Call `changeName` to set your display name (use your name or whatever your user calls you). If you have a profile picture
|
|
11
|
+
1. **Identify yourself** — Call `changeName` to set your display name (use your name or whatever your user calls you). If you have a profile picture, pass its public image URL to `changeProfilePicture`. This helps users identify your requests in their logs.
|
|
12
12
|
2. **Ask** — Use `mindstudio ask "your question"` (CLI) or the `ask` MCP tool for SDK guidance. It knows every action, model, and connector and returns working TypeScript code with real model IDs and config options. Examples: `mindstudio ask "generate an image with FLUX"`, `mindstudio ask "what models support vision?"`, `mindstudio ask "how do I send a Slack message?"`.
|
|
13
13
|
3. **Browse** — For manual discovery, call `listActions` (MCP tool) or `mindstudio list-actions --summary` (CLI) to get a compact `{ action: description }` map of everything available (~3k tokens). Call `mindstudio info <action>` (CLI) for parameter details.
|
|
14
14
|
4. **Call it** — Invoke the action with the required parameters. All actions share the same calling convention (see below).
|
|
@@ -303,7 +303,7 @@ Convert each page of a PDF document into a PNG image.
|
|
|
303
303
|
- Output: `{ imageUrls: string[] }`
|
|
304
304
|
|
|
305
305
|
#### createDataSource
|
|
306
|
-
Create a new empty vector data source for the current app.
|
|
306
|
+
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Create a new empty vector data source for the current app.
|
|
307
307
|
- Creates a new data source (vector database) associated with the current app version.
|
|
308
308
|
- The data source is created empty — use the "Upload Data Source Document" block to add documents.
|
|
309
309
|
- Returns the new data source ID which can be used in subsequent blocks.
|
|
@@ -319,7 +319,7 @@ Create a draft email in the connected Gmail account.
|
|
|
319
319
|
- Output: `{ draftId: string }`
|
|
320
320
|
|
|
321
321
|
#### deleteDataSource
|
|
322
|
-
Delete a vector data source from the current app.
|
|
322
|
+
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Delete a vector data source from the current app.
|
|
323
323
|
- Soft-deletes a data source (vector database) by marking it as deleted.
|
|
324
324
|
- The Milvus partition is cleaned up asynchronously by a background cron job.
|
|
325
325
|
- The data source must belong to the current app version.
|
|
@@ -327,7 +327,7 @@ Delete a vector data source from the current app.
|
|
|
327
327
|
- Output: `unknown`
|
|
328
328
|
|
|
329
329
|
#### deleteDataSourceDocument
|
|
330
|
-
Delete a single document from a data source.
|
|
330
|
+
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Delete a single document from a data source.
|
|
331
331
|
- Soft-deletes a document by marking it as deleted.
|
|
332
332
|
- Requires both the data source ID and document ID.
|
|
333
333
|
- After deletion, reloads vectors into Milvus so the data source reflects the change immediately.
|
|
@@ -422,7 +422,7 @@ Download a file from a URL and extract its text content. Supports PDFs (includin
|
|
|
422
422
|
- Output: `{ text: string | string[] }`
|
|
423
423
|
|
|
424
424
|
#### fetchDataSourceDocument
|
|
425
|
-
Fetch the full extracted text contents of a document in a data source.
|
|
425
|
+
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.
|
|
426
426
|
- Loads a document by ID and returns its full extracted text content.
|
|
427
427
|
- The document must have been successfully processed (status "done").
|
|
428
428
|
- Also returns document metadata (name, summary, word count).
|
|
@@ -557,7 +557,7 @@ Insert b-roll clips into a base video at a timecode, optionally with an xfade tr
|
|
|
557
557
|
- Output: `{ videoUrl: string }`
|
|
558
558
|
|
|
559
559
|
#### listDataSources
|
|
560
|
-
List all data sources for the current app.
|
|
560
|
+
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. List all data sources for the current app.
|
|
561
561
|
- Returns metadata for every data source associated with the current app version.
|
|
562
562
|
- Each entry includes the data source ID, name, description, status, and document list.
|
|
563
563
|
- Input: `object`
|
|
@@ -659,7 +659,7 @@ when parameterize is false.
|
|
|
659
659
|
- Output: `{ rows: unknown[], changes: number }`
|
|
660
660
|
|
|
661
661
|
#### queryDataSource
|
|
662
|
-
Search a vector data source (RAG) and return relevant document chunks.
|
|
662
|
+
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Search a vector data source (RAG) and return relevant document chunks.
|
|
663
663
|
- Queries a vectorized data source and returns the most relevant chunks.
|
|
664
664
|
- Useful for retrieval-augmented generation (RAG) workflows.
|
|
665
665
|
- Input: `{ dataSourceId: string, query: string, maxResults: number }`
|
|
@@ -958,7 +958,7 @@ Add or remove labels on Gmail messages, identified by message IDs or a search qu
|
|
|
958
958
|
- Output: `{ updatedMessageIds: string[] }`
|
|
959
959
|
|
|
960
960
|
#### uploadDataSourceDocument
|
|
961
|
-
Upload a file into an existing data source from a URL or raw text content.
|
|
961
|
+
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Upload a file into an existing data source from a URL or raw text content.
|
|
962
962
|
- If "file" is a single URL, the file is downloaded from that URL and uploaded.
|
|
963
963
|
- If "file" is any other string, a .txt document is created from that content and uploaded.
|
|
964
964
|
- The block waits (polls) for processing to complete before transitioning, up to 5 minutes.
|
|
@@ -1791,7 +1791,7 @@ await mindstudio.changeProfilePicture('https://example.com/avatar.png');
|
|
|
1791
1791
|
```
|
|
1792
1792
|
|
|
1793
1793
|
#### `uploadFile(content, options)`
|
|
1794
|
-
|
|
1794
|
+
**Deprecated for app file storage** — use the `files` store below (`files.defineStore(...).put(...)`): private by default, app-scoped, and served on the app's own domain. `uploadFile` uploads to the shared account media CDN and remains only for account-level assets (e.g. an agent avatar for `changeProfilePicture`). Gets a signed upload URL, PUTs the file content, and returns the permanent public URL.
|
|
1795
1795
|
|
|
1796
1796
|
```typescript
|
|
1797
1797
|
import { readFileSync } from 'fs';
|
|
@@ -1856,9 +1856,17 @@ const context = results.map((r) => r.text).join(String.fromCharCode(10, 10));
|
|
|
1856
1856
|
// add a document (background — poll documents() for status)
|
|
1857
1857
|
await Policies.add(buffer, { filename: 'policy.pdf', contentType: 'application/pdf' });
|
|
1858
1858
|
const docs = await Policies.documents();
|
|
1859
|
+
|
|
1860
|
+
// introspection — what is in the corpus, and how one document was split
|
|
1861
|
+
const { chunkCount, pipeline } = await Policies.stats(); // counts + the config actually in effect
|
|
1862
|
+
const chunks = await Policies.chunks(docs[0].id); // why a document does or doesn't match
|
|
1859
1863
|
```
|
|
1860
1864
|
|
|
1861
|
-
`SearchHit`: `{ score, text, citation: { documentId, filename, pageNumber, headingPath, boundingBox?, url } }`. `citation.url` is a stable on-domain link to the source document — drop it in an `<a href>`.
|
|
1865
|
+
`SearchHit`: `{ score, text, citation: { documentId, filename, pageNumber, chunkIndex, headingPath, boundingBox?, url } }`. `citation.url` is a stable on-domain link to the source document — drop it in an `<a href>`. `(documentId, chunkIndex)` is a chunk's stable identity — key an eval set on that, not on `text`.
|
|
1866
|
+
|
|
1867
|
+
Also on each hit: `retrievalRank`/`retrievalScore` (position before reranking — compare with the final position to see what reranking did). Two opt-in search options for debugging: `explain: true` adds `explain.{dense,lexical,matchedVia}` so you can see which half of hybrid found a hit, and `expand: 1` adds `neighbors.{before,after}` for surrounding context. Neither changes the results or their order.
|
|
1868
|
+
|
|
1869
|
+
Search is deterministic for a fixed corpus and configuration — same query, same order — so regression checks are meaningful. `search()` also returns `latencyMs`.
|
|
1862
1870
|
|
|
1863
1871
|
Supported: pdf, docx, pptx, xlsx, odt, rtf, epub, images, txt, md, json, csv, html.
|
|
1864
1872
|
|