@ampcode/plugin 0.0.0-20260930001919-g9299b2d → 0.0.0-20261001002205-g9c84ae8
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/index.d.ts +18 -8
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -407,6 +407,11 @@ declare module '@ampcode/plugin' {
|
|
|
407
407
|
* even though plugin tools are registered under their bare names). Include such an entry
|
|
408
408
|
* in explicit lists so the user's plugin and MCP tools stay available.
|
|
409
409
|
*
|
|
410
|
+
* MCP tools are not sent to the model as individual tools. Every agent gets `tool_search`
|
|
411
|
+
* and `code_exec` (unless `exclude` names them) and reaches all MCP servers through them as
|
|
412
|
+
* deferred code-mode modules, so a large MCP catalog does not fill the context window.
|
|
413
|
+
* Exclude both to send the MCP tools the list selects directly instead.
|
|
414
|
+
*
|
|
410
415
|
* Run `amp plugins show-agent-options --json` for built-in tool names intended for
|
|
411
416
|
* plugin agents.
|
|
412
417
|
*/
|
|
@@ -1344,17 +1349,20 @@ declare module '@ampcode/plugin' {
|
|
|
1344
1349
|
export interface PluginConfirmField {
|
|
1345
1350
|
/**
|
|
1346
1351
|
* How to show the field. Text fields are editable. Image fields show a read-only preview
|
|
1347
|
-
* of an HTTP(S) image URL
|
|
1352
|
+
* of an HTTP(S) image URL. Link fields show a button that opens an HTTP(S) URL in the
|
|
1353
|
+
* browser, for example an approval page in another app; the dialog stays open so the user
|
|
1354
|
+
* can still confirm or cancel afterwards. Image and link fields are omitted from the
|
|
1355
|
+
* returned values. Defaults to `text`.
|
|
1348
1356
|
*/
|
|
1349
|
-
type?: 'text' | 'image'
|
|
1357
|
+
type?: 'text' | 'image' | 'link'
|
|
1350
1358
|
|
|
1351
1359
|
/** Stable key used in the returned record */
|
|
1352
1360
|
name: string
|
|
1353
1361
|
|
|
1354
|
-
/** Label shown above the field */
|
|
1362
|
+
/** Label shown above a text or image field, or the button text of a link field */
|
|
1355
1363
|
label: string
|
|
1356
1364
|
|
|
1357
|
-
/** Initial text value or, for an image field, an HTTP(S)
|
|
1365
|
+
/** Initial text value or, for an image or link field, an HTTP(S) URL */
|
|
1358
1366
|
value: string
|
|
1359
1367
|
|
|
1360
1368
|
/** Allow a text field to span multiple lines */
|
|
@@ -1405,9 +1413,10 @@ declare module '@ampcode/plugin' {
|
|
|
1405
1413
|
input(options: PluginInputOptions): Promise<string | undefined>
|
|
1406
1414
|
|
|
1407
1415
|
/**
|
|
1408
|
-
* Show editable text fields
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1416
|
+
* Show editable text fields, read-only image previews, and link buttons in a confirmation
|
|
1417
|
+
* dialog.
|
|
1418
|
+
* @returns The edited text values by field name, or undefined if cancelled. Image and link
|
|
1419
|
+
* fields are omitted.
|
|
1411
1420
|
*/
|
|
1412
1421
|
confirm(options: PluginEditableConfirmOptions): Promise<Record<string, string> | undefined>
|
|
1413
1422
|
/**
|
|
@@ -2055,7 +2064,8 @@ declare module '@ampcode/plugin' {
|
|
|
2055
2064
|
* list (`add` unions extra tools into it; `exclude` removes tools). Use `add` with
|
|
2056
2065
|
* `extends` to add tools on top of the built-in mode's tool list. `mcp__*` matches all
|
|
2057
2066
|
* MCP tools and `plugin__*` matches all plugin tools (also matched as
|
|
2058
|
-
* `plugin__<pluginName>__<toolName>`).
|
|
2067
|
+
* `plugin__<pluginName>__<toolName>`). MCP servers are reached through `tool_search` and
|
|
2068
|
+
* `code_exec`, which every agent gets unless `exclude` names them.
|
|
2059
2069
|
*/
|
|
2060
2070
|
tools?:
|
|
2061
2071
|
| 'all'
|