@mindstudio-ai/agent 0.1.48 → 0.1.50
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 +34 -15
- package/dist/index.d.ts +9 -4
- package/dist/index.js +26 -6
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +34 -15
- package/llms.txt +24 -26
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1213,12 +1213,16 @@ interface RunTaskResult<T = unknown> {
|
|
|
1213
1213
|
/**
|
|
1214
1214
|
* Client for the MindStudio direct step execution API.
|
|
1215
1215
|
*
|
|
1216
|
-
*
|
|
1216
|
+
* Inside MindStudio apps, use the `mindstudio` singleton (auth is automatic):
|
|
1217
|
+
* ```ts
|
|
1218
|
+
* import { mindstudio } from '@mindstudio-ai/agent';
|
|
1219
|
+
* const { imageUrl } = await mindstudio.generateImage({ prompt: "a sunset" });
|
|
1220
|
+
* ```
|
|
1217
1221
|
*
|
|
1222
|
+
* For external usage with an API key:
|
|
1218
1223
|
* ```ts
|
|
1219
1224
|
* const agent = new MindStudioAgent({ apiKey: "your-key" });
|
|
1220
|
-
* const { imageUrl } = await agent.generateImage({ prompt: "a sunset"
|
|
1221
|
-
* console.log(imageUrl);
|
|
1225
|
+
* const { imageUrl } = await agent.generateImage({ prompt: "a sunset" });
|
|
1222
1226
|
* ```
|
|
1223
1227
|
*
|
|
1224
1228
|
* Authentication is resolved in order:
|
|
@@ -6035,10 +6039,11 @@ interface StepMethods {
|
|
|
6035
6039
|
*/
|
|
6036
6040
|
extractAudioFromVideo(step: ExtractAudioFromVideoStepInput, options?: StepExecutionOptions): Promise<StepExecutionResult<ExtractAudioFromVideoStepOutput>>;
|
|
6037
6041
|
/**
|
|
6038
|
-
* Download a file from a URL and extract its text content. Supports PDFs, plain text files, and other document formats.
|
|
6042
|
+
* 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.
|
|
6039
6043
|
*
|
|
6040
6044
|
* @remarks
|
|
6041
6045
|
* - Best suited for PDFs and raw text/document files. For web pages, use the scrapeUrl step instead.
|
|
6046
|
+
* - 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.
|
|
6042
6047
|
* - Accepts a single URL, a comma-separated list of URLs, or a JSON array of URLs.
|
|
6043
6048
|
* - Files are rehosted on the MindStudio CDN before extraction.
|
|
6044
6049
|
* - Maximum file size is 50MB per URL.
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/errors.ts
|
|
2
9
|
var MindStudioError = class extends Error {
|
|
3
10
|
constructor(message, code, status, details) {
|
|
@@ -81,13 +88,26 @@ function sleep(ms) {
|
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
// src/context.ts
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
var als;
|
|
92
|
+
function getAls() {
|
|
93
|
+
if (!als) {
|
|
94
|
+
try {
|
|
95
|
+
const { AsyncLocalStorage } = __require("async_hooks");
|
|
96
|
+
als = new AsyncLocalStorage();
|
|
97
|
+
} catch {
|
|
98
|
+
als = {
|
|
99
|
+
getStore: () => void 0,
|
|
100
|
+
run: (_store, fn) => fn()
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return als;
|
|
105
|
+
}
|
|
86
106
|
function getRequestContext() {
|
|
87
|
-
return
|
|
107
|
+
return getAls().getStore();
|
|
88
108
|
}
|
|
89
109
|
function runWithContext(ctx, fn) {
|
|
90
|
-
return
|
|
110
|
+
return getAls().run(ctx, fn);
|
|
91
111
|
}
|
|
92
112
|
|
|
93
113
|
// src/rate-limit.ts
|
|
@@ -1959,8 +1979,8 @@ var stepMetadata = {
|
|
|
1959
1979
|
},
|
|
1960
1980
|
"extractText": {
|
|
1961
1981
|
stepType: "extractText",
|
|
1962
|
-
description: "Download a file from a URL and extract its text content. Supports PDFs, plain text files, and other document formats.",
|
|
1963
|
-
usageNotes: "- Best suited for PDFs and raw text/document files. For web pages, use the scrapeUrl step instead.\n- Accepts a single URL, a comma-separated list of URLs, or a JSON array of URLs.\n- Files are rehosted on the MindStudio CDN before extraction.\n- Maximum file size is 50MB per URL.",
|
|
1982
|
+
description: "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.",
|
|
1983
|
+
usageNotes: "- Best suited for PDFs and raw text/document files. For web pages, use the scrapeUrl step instead.\n- 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 \u2014 there is no need to convert PDF pages to images first.\n- Accepts a single URL, a comma-separated list of URLs, or a JSON array of URLs.\n- Files are rehosted on the MindStudio CDN before extraction.\n- Maximum file size is 50MB per URL.",
|
|
1964
1984
|
inputSchema: { "type": "object", "properties": { "url": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] } }, "required": ["url"] },
|
|
1965
1985
|
outputSchema: { "type": "object", "properties": { "text": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] } }, "required": ["text"] }
|
|
1966
1986
|
},
|