@mindstudio-ai/agent 0.1.105 → 0.1.107
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/README.md +12 -3
- package/dist/cli.js +76 -13
- package/dist/index.d.ts +49 -3
- package/dist/index.js +67 -4
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +76 -13
- package/llms.txt +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -377,8 +377,8 @@ Run `mindstudio batch` with no arguments for full usage help.
|
|
|
377
377
|
## Task agents
|
|
378
378
|
|
|
379
379
|
`runTask()` runs a multi-step tool-use loop: the model receives your prompt and a set of tools
|
|
380
|
-
(SDK actions
|
|
381
|
-
output. Use it when the task needs judgment between steps — research, enrichment, content
|
|
380
|
+
(SDK actions, your own app's methods, and/or inline functions defined at the call site), calls
|
|
381
|
+
them as needed, and produces structured output. Use it when the task needs judgment between steps — research, enrichment, content
|
|
382
382
|
pipelines — rather than a fixed sequence of calls.
|
|
383
383
|
|
|
384
384
|
Define the output contract with `outputSchema` — plain JSON Schema in the same dialect as a
|
|
@@ -395,6 +395,12 @@ const result = await agent.runTask({
|
|
|
395
395
|
'searchGoogle',
|
|
396
396
|
'fetchUrl',
|
|
397
397
|
{ appMethod: 'saveRestaurant', description: 'Persist the researched restaurant.' },
|
|
398
|
+
{
|
|
399
|
+
name: 'checkExisting',
|
|
400
|
+
description: 'Look up whether we already track this restaurant.',
|
|
401
|
+
inputSchema: { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] },
|
|
402
|
+
execute: async (input) => Restaurants.findByName(String(input.name)),
|
|
403
|
+
},
|
|
398
404
|
],
|
|
399
405
|
outputSchema: {
|
|
400
406
|
type: 'object',
|
|
@@ -423,7 +429,10 @@ typed by your generic argument and unvalidated — always check `result.parsedSu
|
|
|
423
429
|
before using it.
|
|
424
430
|
|
|
425
431
|
App-method tools run as the user who invoked the method that started the task, with their
|
|
426
|
-
roles.
|
|
432
|
+
roles. Inline function tools execute in your own process — a thrown error is fed back to the
|
|
433
|
+
model as `{ error }` tool output to work around, and they take no `defaults` (close over what
|
|
434
|
+
you need instead). Pass `onEvent` to stream progress (text chunks, tool calls, the final
|
|
435
|
+
`done` event).
|
|
427
436
|
|
|
428
437
|
> `outputSchema` typing uses a `const` type parameter — consuming projects need
|
|
429
438
|
> TypeScript 5.0+.
|