@ampcode/plugin 0.0.0-20260225013638-g011c7ef → 0.0.0-20260225031228-gcc4d1d6
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 +23 -4
- package/index.d.ts +707 -0
- package/package.json +5 -5
- package/src/ai.ts +0 -25
- package/src/configuration.ts +0 -58
- package/src/events.ts +0 -240
- package/src/index.ts +0 -211
- package/src/system.ts +0 -43
- package/src/thread.ts +0 -97
- package/src/ui.ts +0 -48
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@ Amp plugins are TypeScript files that extend and customize [Amp](https://ampcode
|
|
|
6
6
|
|
|
7
7
|
> The Amp plugin API is experimental. Expect many breaking changes if you choose to use it right now. Do not use it for anything critical.
|
|
8
8
|
|
|
9
|
-
<br/>
|
|
10
|
-
|
|
11
9
|
The plugin API supports:
|
|
12
10
|
|
|
13
11
|
- **Event handlers** — `amp.on(...)` for hooking into tool calls, messages, and other events
|
|
@@ -27,7 +25,28 @@ You can use plugins to:
|
|
|
27
25
|
|
|
28
26
|
See [Amp Plugin API documentation](https://ampcode.com/manual/plugin-api).
|
|
29
27
|
|
|
30
|
-
##
|
|
28
|
+
## Using Plugins
|
|
29
|
+
|
|
30
|
+
Run the Amp CLI with `PLUGINS=all amp` to use plugins. If the `PLUGINS` env var is not set, plugins are disabled. Plugins can execute arbitrary code, so only enable plugins when running Amp in trusted workspaces.
|
|
31
|
+
|
|
32
|
+
**Limitations:**
|
|
33
|
+
|
|
34
|
+
- The Amp plugin API only works in the Amp CLI, not the Amp editor extension.
|
|
35
|
+
- The Amp plugin API only works when the Amp CLI is installed via the binary install method, not via `npm install`.
|
|
36
|
+
|
|
37
|
+
## Authoring Plugins
|
|
38
|
+
|
|
39
|
+
Use this prompt:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Make an Amp plugin to __________. See https://ampcode.com/manual/plugin-api for docs.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Ensure you're running with `PLUGINS=all amp`
|
|
46
|
+
- Use `Ctrl-o` `plugins: reload` to reload all plugins after they're changed.
|
|
47
|
+
- All plugin files must start with `// @i-know-the-amp-plugin-api-is-wip-and-very-experimental-right-now`.
|
|
48
|
+
|
|
49
|
+
## Example Plugin
|
|
31
50
|
|
|
32
51
|
`.amp/plugins/permissions.ts`:
|
|
33
52
|
|
|
@@ -57,4 +76,4 @@ export default function (amp: PluginAPI) {
|
|
|
57
76
|
|
|
58
77
|
## Acknowledgment
|
|
59
78
|
|
|
60
|
-
Amp's plugin API is inspired by [pi's extension API](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/extensions.md).
|
|
79
|
+
Amp's plugin API is inspired by [pi's extension API](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/extensions.md), created by the awesome genius Mario Zechner.
|