@ampcode/plugin 0.0.0-20261028101742-g93a0da1 → 0.0.0-20261030001330-g694fa8a
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 +39 -7
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// sitemap-lastmod: /docs/plugin-api 2026-10-
|
|
1
|
+
// sitemap-lastmod: /docs/plugin-api 2026-10-29
|
|
2
2
|
|
|
3
3
|
declare module '@ampcode/plugin' {
|
|
4
4
|
/**
|
|
@@ -116,15 +116,24 @@ declare module '@ampcode/plugin' {
|
|
|
116
116
|
registerTool(definition: PluginToolDefinition): Subscription
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* Register an Agent Skill from this plugin's directory.
|
|
119
|
+
* Register an Agent Skill from this plugin's directory or its cache directory.
|
|
120
120
|
*
|
|
121
|
-
* The path
|
|
122
|
-
*
|
|
123
|
-
*
|
|
121
|
+
* The path names a directory that contains `SKILL.md`: either relative to a directory
|
|
122
|
+
* plugin's root, or absolute and inside {@link PluginSystem.cacheDirectory}, for skills the
|
|
123
|
+
* plugin downloads or generates at runtime. Amp validates the package and makes it
|
|
124
|
+
* available under the qualified name `<plugin-name>:<skill-name>`; the agent loads it with
|
|
125
|
+
* the skill tool, which also starts any MCP servers the skill bundles. Unsubscribe to
|
|
126
|
+
* remove the skill. Pass `listed: false` for a skill a plugin tool hands to the agent by
|
|
127
|
+
* name, so it stays out of the skills list.
|
|
124
128
|
*
|
|
125
129
|
* @example
|
|
126
130
|
* ```ts
|
|
127
131
|
* await amp.registerSkill({ path: 'skills/simulator' })
|
|
132
|
+
*
|
|
133
|
+
* const dir = path.join(amp.system.cacheDirectory, 'skills', 'pdf')
|
|
134
|
+
* // ...write dir/SKILL.md and the skill's other files...
|
|
135
|
+
* await amp.registerSkill({ path: dir, listed: false })
|
|
136
|
+
* // ...then tell the agent to load "<plugin-name>:pdf" with the skill tool
|
|
128
137
|
* ```
|
|
129
138
|
*/
|
|
130
139
|
registerSkill(definition: PluginSkillDefinition): Promise<Subscription>
|
|
@@ -1191,6 +1200,14 @@ declare module '@ampcode/plugin' {
|
|
|
1191
1200
|
*/
|
|
1192
1201
|
readonly workspaceRoot: URI | null
|
|
1193
1202
|
|
|
1203
|
+
/**
|
|
1204
|
+
* Absolute path of a directory this plugin may write to, on the machine that runs the
|
|
1205
|
+
* plugin, such as `~/.cache/amp/plugin-cache/<plugin-name>`. It is kept across sessions
|
|
1206
|
+
* but may be cleared like any cache, and Amp does not create it. Skills stored here can be
|
|
1207
|
+
* registered with {@link PluginAPI.registerSkill}.
|
|
1208
|
+
*/
|
|
1209
|
+
readonly cacheDirectory: string
|
|
1210
|
+
|
|
1194
1211
|
/**
|
|
1195
1212
|
* Get the effective Amp base URL currently used by this Amp client.
|
|
1196
1213
|
* This reflects the active runtime configuration (for example, custom domains via `AMP_URL`).
|
|
@@ -1717,8 +1734,13 @@ declare module '@ampcode/plugin' {
|
|
|
1717
1734
|
* steps: for example "open the sign-in page", then "paste the URL it ends on". When the
|
|
1718
1735
|
* only field is one link, the user must open it before they can confirm: the primary
|
|
1719
1736
|
* button opens the link, then becomes the confirm button.
|
|
1737
|
+
*
|
|
1738
|
+
* Checkbox fields show a box the user can tick, with `label` as its text, such as "Always
|
|
1739
|
+
* allow replies in this thread". `value` is `'true'` to start ticked. The returned value is
|
|
1740
|
+
* always `'true'` or `'false'`; it is `'false'` when the client could not show the box, so
|
|
1741
|
+
* treat only `'true'` as the user's choice.
|
|
1720
1742
|
*/
|
|
1721
|
-
type?: 'text' | 'image' | 'link' | 'file' | 'attachment'
|
|
1743
|
+
type?: 'text' | 'image' | 'link' | 'file' | 'attachment' | 'checkbox'
|
|
1722
1744
|
|
|
1723
1745
|
/**
|
|
1724
1746
|
* File extensions a file field's picker offers, such as `['.p8']`. Advisory: the user can
|
|
@@ -2490,8 +2512,18 @@ declare module '@ampcode/plugin' {
|
|
|
2490
2512
|
* An Agent Skill directory contributed by a plugin.
|
|
2491
2513
|
*/
|
|
2492
2514
|
export interface PluginSkillDefinition {
|
|
2493
|
-
/**
|
|
2515
|
+
/**
|
|
2516
|
+
* Path to the skill directory: relative to the directory plugin's root, or absolute and
|
|
2517
|
+
* inside {@link PluginSystem.cacheDirectory}.
|
|
2518
|
+
*/
|
|
2494
2519
|
path: string
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* Set to `false` to leave the skill out of the skills list the model sees. The agent can
|
|
2523
|
+
* still load it with the skill tool by its qualified name, for example after a plugin tool
|
|
2524
|
+
* that found the skill returns that name. Defaults to `true`.
|
|
2525
|
+
*/
|
|
2526
|
+
listed?: boolean
|
|
2495
2527
|
}
|
|
2496
2528
|
|
|
2497
2529
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampcode/plugin",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20261030001330-g694fa8a",
|
|
4
4
|
"description": "Amp Plugin API",
|
|
5
5
|
"license": "Amp Commercial License",
|
|
6
6
|
"homepage": "https://ampcode.com/docs/plugin-api",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsgo -b",
|
|
33
|
-
"format:check": "
|
|
33
|
+
"format:check": "bun fmt --check index.d.ts",
|
|
34
34
|
"test": "echo 'No tests'",
|
|
35
35
|
"lint": "biome check --config-path=../.. index.d.ts",
|
|
36
36
|
"typecheck": "tsgo -b"
|