@ampcode/plugin 0.0.0-20260812002050-g3d0e2fc → 0.0.0-20260814002157-gcdc06ea
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 +1 -0
- package/index.d.ts +29 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Plugins can:
|
|
|
8
8
|
|
|
9
9
|
- **Handle events** — `amp.on(...)` for tool calls, tool results, and agent lifecycle events
|
|
10
10
|
- **Add tools** — `amp.registerTool(...)` for custom tools the agent can call
|
|
11
|
+
- **Bundle skills** — `await amp.registerSkill(...)` to register skill directories
|
|
11
12
|
- **Add commands** — `amp.registerCommand(...)` for command palette actions
|
|
12
13
|
- **Show UI** — `ctx.ui.notify(...)`, `ctx.ui.confirm(...)`, `ctx.ui.input(...)`, and `ctx.ui.select(...)`
|
|
13
14
|
- **Use AI** — `amp.ai.ask(...)` for thread-scoped yes/no classification that defaults to no
|
package/index.d.ts
CHANGED
|
@@ -113,6 +113,20 @@ declare module '@ampcode/plugin' {
|
|
|
113
113
|
*/
|
|
114
114
|
registerTool(definition: PluginToolDefinition): Subscription
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Register an Agent Skill from this plugin's directory.
|
|
118
|
+
*
|
|
119
|
+
* The path must be relative to a directory plugin's root and name a directory that contains
|
|
120
|
+
* `SKILL.md`. Amp validates the package and makes it available under the qualified name
|
|
121
|
+
* `<plugin-name>:<skill-name>`.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* await amp.registerSkill({ path: 'skills/simulator' })
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
registerSkill(definition: PluginSkillDefinition): Promise<Subscription>
|
|
129
|
+
|
|
116
130
|
/**
|
|
117
131
|
* Register a callback that runs before this plugin instance is stopped.
|
|
118
132
|
*
|
|
@@ -529,14 +543,19 @@ declare module '@ampcode/plugin' {
|
|
|
529
543
|
reason: string
|
|
530
544
|
}
|
|
531
545
|
|
|
546
|
+
/**
|
|
547
|
+
* A model provider namespace. New definitions use models.dev provider IDs or Amp's private
|
|
548
|
+
* namespace.
|
|
549
|
+
*/
|
|
532
550
|
export type PluginAIModelProvider =
|
|
533
551
|
| 'amp'
|
|
534
552
|
| 'anthropic'
|
|
535
553
|
| 'baseten'
|
|
536
|
-
| 'fireworks'
|
|
554
|
+
| 'fireworks-ai'
|
|
555
|
+
| 'google-vertex'
|
|
537
556
|
| 'openai'
|
|
538
|
-
| 'vertexai'
|
|
539
557
|
| 'xai'
|
|
558
|
+
| 'zhipuai'
|
|
540
559
|
|
|
541
560
|
/** Model identifier in `provider/model` format, such as `openai/gpt-5.6-sol`. */
|
|
542
561
|
export type PluginAIModel = `${PluginAIModelProvider}/${string}`
|
|
@@ -1659,4 +1678,12 @@ declare module '@ampcode/plugin' {
|
|
|
1659
1678
|
ctx: PluginToolContext,
|
|
1660
1679
|
) => Promise<PluginToolResult | void>
|
|
1661
1680
|
}
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* An Agent Skill directory contributed by a plugin.
|
|
1684
|
+
*/
|
|
1685
|
+
export interface PluginSkillDefinition {
|
|
1686
|
+
/** Path to the skill directory, relative to the directory plugin's root. */
|
|
1687
|
+
path: string
|
|
1688
|
+
}
|
|
1662
1689
|
}
|