@ampcode/plugin 0.0.0-20260813002147-g5c34dee → 0.0.0-20260815001113-g5bf5f5d

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/index.d.ts +26 -2
  3. 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
  *
@@ -308,7 +322,7 @@ declare module '@ampcode/plugin' {
308
322
  | readonly string[]
309
323
  | 'all'
310
324
  | {
311
- /** Tool names to include. Defaults to all tools. */
325
+ /** Tool names to include. Defaults to the agent's standard and external tools. */
312
326
  include?: readonly string[] | 'all'
313
327
  /** Tool names to exclude after applying include. */
314
328
  exclude?: readonly string[]
@@ -331,7 +345,8 @@ declare module '@ampcode/plugin' {
331
345
  /** Instructions appended to Amp's base agent prompt. */
332
346
  instructions: string
333
347
  /**
334
- * Tools available to this agent. Use 'all' for all tools available in its runtime.
348
+ * Tools available to this agent. Use 'all' for its provider-appropriate built-in tools
349
+ * plus plugin, MCP, and remote tools available in its runtime.
335
350
  *
336
351
  * Run `amp plugins show-agent-options --json` for built-in tool names intended for
337
352
  * plugin agents.
@@ -541,6 +556,7 @@ declare module '@ampcode/plugin' {
541
556
  | 'google-vertex'
542
557
  | 'openai'
543
558
  | 'xai'
559
+ | 'zhipuai'
544
560
 
545
561
  /** Model identifier in `provider/model` format, such as `openai/gpt-5.6-sol`. */
546
562
  export type PluginAIModel = `${PluginAIModelProvider}/${string}`
@@ -1663,4 +1679,12 @@ declare module '@ampcode/plugin' {
1663
1679
  ctx: PluginToolContext,
1664
1680
  ) => Promise<PluginToolResult | void>
1665
1681
  }
1682
+
1683
+ /**
1684
+ * An Agent Skill directory contributed by a plugin.
1685
+ */
1686
+ export interface PluginSkillDefinition {
1687
+ /** Path to the skill directory, relative to the directory plugin's root. */
1688
+ path: string
1689
+ }
1666
1690
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20260813002147-g5c34dee",
3
+ "version": "0.0.0-20260815001113-g5bf5f5d",
4
4
  "description": "Amp Plugin API",
5
5
  "homepage": "https://ampcode.com/manual/plugin-api",
6
6
  "author": {