@ampcode/plugin 0.0.0-20260803003115-g5ad8721 → 0.0.0-20260805002929-g5b1c43a
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 +5 -0
- package/index.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ Amp loads plugins from three locations:
|
|
|
29
29
|
```ts
|
|
30
30
|
import type { PluginAPI } from '@ampcode/plugin'
|
|
31
31
|
|
|
32
|
+
export const description = 'Shows a notification when a thread session starts'
|
|
33
|
+
|
|
32
34
|
export default function (amp: PluginAPI) {
|
|
33
35
|
amp.logger.log('Plugin initialized')
|
|
34
36
|
|
|
@@ -38,6 +40,9 @@ export default function (amp: PluginAPI) {
|
|
|
38
40
|
}
|
|
39
41
|
```
|
|
40
42
|
|
|
43
|
+
The optional `description` named export must be a static string literal of at most 300 characters.
|
|
44
|
+
Amp shows it in plugin settings and ignores missing, dynamic, or longer values.
|
|
45
|
+
|
|
41
46
|
Code in the exported function runs when the plugin loads. Use `session.start` only for work that should run when Amp starts a specific thread session.
|
|
42
47
|
|
|
43
48
|
After changing a plugin, open the command palette and run `plugins: reload`, or restart Amp.
|
package/index.d.ts
CHANGED
|
@@ -12,10 +12,15 @@ declare module '@ampcode/plugin' {
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* import type { PluginAPI } from '@ampcode/plugin'
|
|
14
14
|
*
|
|
15
|
+
* export const description = 'Explains what this plugin adds to Amp'
|
|
16
|
+
*
|
|
15
17
|
* export default function (amp: PluginAPI) {
|
|
16
18
|
* amp.logger.log('Plugin initialized')
|
|
17
19
|
* }
|
|
18
20
|
* ```
|
|
21
|
+
*
|
|
22
|
+
* The optional `description` named export must be a static string literal of at most 300
|
|
23
|
+
* characters. Amp shows it in plugin settings and ignores missing, dynamic, or longer values.
|
|
19
24
|
*/
|
|
20
25
|
|
|
21
26
|
/**
|