@ampcode/plugin 0.0.0-20260813002147-g5c34dee → 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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/index.d.ts +23 -0
  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
  *
@@ -541,6 +555,7 @@ declare module '@ampcode/plugin' {
541
555
  | 'google-vertex'
542
556
  | 'openai'
543
557
  | 'xai'
558
+ | 'zhipuai'
544
559
 
545
560
  /** Model identifier in `provider/model` format, such as `openai/gpt-5.6-sol`. */
546
561
  export type PluginAIModel = `${PluginAIModelProvider}/${string}`
@@ -1663,4 +1678,12 @@ declare module '@ampcode/plugin' {
1663
1678
  ctx: PluginToolContext,
1664
1679
  ) => Promise<PluginToolResult | void>
1665
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
+ }
1666
1689
  }
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-20260814002157-gcdc06ea",
4
4
  "description": "Amp Plugin API",
5
5
  "homepage": "https://ampcode.com/manual/plugin-api",
6
6
  "author": {