@ampcode/plugin 0.0.0-20261029001459-g185813a → 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 +33 -6
- package/package.json +1 -1
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`).
|
|
@@ -2495,8 +2512,18 @@ declare module '@ampcode/plugin' {
|
|
|
2495
2512
|
* An Agent Skill directory contributed by a plugin.
|
|
2496
2513
|
*/
|
|
2497
2514
|
export interface PluginSkillDefinition {
|
|
2498
|
-
/**
|
|
2515
|
+
/**
|
|
2516
|
+
* Path to the skill directory: relative to the directory plugin's root, or absolute and
|
|
2517
|
+
* inside {@link PluginSystem.cacheDirectory}.
|
|
2518
|
+
*/
|
|
2499
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
|
|
2500
2527
|
}
|
|
2501
2528
|
|
|
2502
2529
|
/**
|
package/package.json
CHANGED