@ampcode/plugin 0.0.0-20260825001040-g9dff10c → 0.0.0-20260827012238-gff6d7bb

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 +3 -3
  2. package/index.d.ts +63 -8
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- This file is the npm package README. The full guide lives at https://ampcode.com/manual#plugins -->
1
+ <!-- This file is the npm package README. The full guide lives at https://ampcode.com/docs/customize/plugins -->
2
2
 
3
3
  # Amp Plugin API
4
4
 
@@ -50,8 +50,8 @@ After changing a plugin, open the command palette and run `plugins: reload`, or
50
50
 
51
51
  ## Documentation
52
52
 
53
- - Plugin guide and worked examples: <https://ampcode.com/manual#plugins>
54
- - Full `@ampcode/plugin` type reference and a complete kitchen-sink example: <https://ampcode.com/manual/plugin-api>
53
+ - Plugin guide and worked examples: <https://ampcode.com/docs/customize/plugins>
54
+ - Full `@ampcode/plugin` type reference and a complete kitchen-sink example: <https://ampcode.com/docs/plugin-api>
55
55
 
56
56
  Plugins execute code, so only use plugins from people and workspaces you trust.
57
57
 
package/index.d.ts CHANGED
@@ -324,6 +324,11 @@ declare module '@ampcode/plugin' {
324
324
  | {
325
325
  /** Tool names to include. Defaults to the agent's standard and external tools. */
326
326
  include?: readonly string[] | 'all'
327
+ /**
328
+ * Tool names added on top of the resolved include list. Use with `extends`
329
+ * to add tools to the built-in mode's tool list.
330
+ */
331
+ add?: readonly string[]
327
332
  /** Tool names to exclude after applying include. */
328
333
  exclude?: readonly string[]
329
334
  }
@@ -333,17 +338,31 @@ declare module '@ampcode/plugin' {
333
338
  * Optional agent identity. Amp includes this name in the base system prompt as
334
339
  * `You are <name>, a custom agent running in Amp.` It is also used for logs, UI,
335
340
  * and persisted run metadata. Omit it to avoid adding a named identity to the prompt.
341
+ * Ignored when `extends` is set: the built-in mode's prompt carries no custom identity.
336
342
  */
337
343
  name?: string
344
+ /**
345
+ * Built-in agent mode this agent extends. Threads render that mode's system
346
+ * prompt with `instructions` appended as agent instructions, and `tools`
347
+ * defaults to the mode's tool list. When `model` is omitted, the agent uses
348
+ * the mode's preferred model and reasoning effort. Deprecated modes
349
+ * (`smart`, `deep`, `rush`) resolve to their replacement mode.
350
+ */
351
+ extends?: BuiltinAgentMode
338
352
  /**
339
353
  * Model identifier in `provider/model` format, such as `anthropic/claude-sonnet-4-6`.
354
+ * Required unless `extends` is set, in which case it defaults to the extended
355
+ * mode's preferred model.
340
356
  *
341
357
  * Run `amp plugins show-agent-options --json` for the public model IDs intended for
342
358
  * plugin agents.
343
359
  */
344
- model: PluginAgentModel
345
- /** Instructions appended to Amp's base agent prompt. */
346
- instructions: string
360
+ model?: PluginAgentModel
361
+ /**
362
+ * Instructions appended to Amp's base agent prompt, or to the extended mode's
363
+ * prompt when `extends` is set. Required unless `extends` is set.
364
+ */
365
+ instructions?: string
347
366
  /**
348
367
  * Tools available to this agent. Use 'all' for its provider-appropriate built-in tools
349
368
  * plus plugin, MCP, and remote tools available in its runtime.
@@ -386,6 +405,10 @@ declare module '@ampcode/plugin' {
386
405
 
387
406
  export interface CustomAgentDefinition extends CreateAgentConfig {
388
407
  readonly kind: 'agent-definition'
408
+ /** Resolved model. Filled from the extended mode when `model` was omitted. */
409
+ model: PluginAgentModel
410
+ /** Resolved instructions. Empty when omitted on an extending agent. */
411
+ instructions: string
389
412
  }
390
413
 
391
414
  /** Reference to one of Amp's built-in agent modes. */
@@ -510,7 +533,10 @@ declare module '@ampcode/plugin' {
510
533
 
511
534
  /** A plugin-defined agent mode shown by supported Amp clients. */
512
535
  export interface PluginAgentModeDefinition {
513
- /** Stable identifier within the plugin. */
536
+ /**
537
+ * Stable identifier within the plugin. Keys are case-insensitive: registering
538
+ * a key that differs from an existing mode's key only by case is an error.
539
+ */
514
540
  key: string
515
541
  /**
516
542
  * Label shown in compact mode pickers, for example "review" or "architect".
@@ -1727,6 +1753,19 @@ declare module '@ampcode/plugin' {
1727
1753
  */
1728
1754
  title?: string
1729
1755
 
1756
+ /**
1757
+ * Labels used to group adjacent tool calls into one action-oriented transcript row.
1758
+ * Calls with matching labels are shown together. `active` is shown while any call is
1759
+ * running, then `complete` is shown. Not sent to the LLM.
1760
+ *
1761
+ * @example
1762
+ * transcriptGroup: { active: 'Inspecting simulator', complete: 'Inspected simulator' }
1763
+ */
1764
+ transcriptGroup?: {
1765
+ active: string
1766
+ complete: string
1767
+ }
1768
+
1730
1769
  /** Description shown to the LLM explaining what the tool does */
1731
1770
  description: string
1732
1771
 
@@ -1770,18 +1809,34 @@ declare module '@ampcode/plugin' {
1770
1809
  description?: string
1771
1810
  /** Label color as a hex RGB string, for example "#d97706". */
1772
1811
  color?: string
1812
+ /**
1813
+ * Built-in agent mode this agent extends. Threads render that mode's system prompt with
1814
+ * the agent's `instructions.md` appended as agent instructions, and `tools` defaults to
1815
+ * the mode's tool list. When `model` is omitted, the agent uses the mode's preferred
1816
+ * model and reasoning effort.
1817
+ */
1818
+ extends?: 'low' | 'medium' | 'high' | 'ultra'
1773
1819
  /**
1774
1820
  * Model identifier in `provider/model` format, such as `anthropic/claude-sonnet-4-6`.
1775
- * Omit to use the default model.
1821
+ * Omit to use the default model, or the extended mode's model when `extends` is set.
1776
1822
  */
1777
1823
  model?: PluginAIModel
1778
1824
  /** Run entirely on Amp's thread actor without creating or attaching an executor. */
1779
1825
  serverOnly?: boolean
1780
1826
  /**
1781
1827
  * Built-in tools available to this agent: 'all' for all tools available in its runtime,
1782
- * or a list of tool names with `*` suffix wildcards.
1783
- */
1784
- tools?: 'all' | readonly string[]
1828
+ * a list of tool names with `*` suffix wildcards, or an object that adjusts the default
1829
+ * list (`add` unions extra tools into it; `exclude` removes tools). Use `add` with
1830
+ * `extends` to add tools on top of the built-in mode's tool list.
1831
+ */
1832
+ tools?:
1833
+ | 'all'
1834
+ | readonly string[]
1835
+ | {
1836
+ include?: 'all' | readonly string[]
1837
+ add?: readonly string[]
1838
+ exclude?: readonly string[]
1839
+ }
1785
1840
  /** Optional reasoning effort override for models that support it. */
1786
1841
  reasoningEffort?: AgentReasoningEffort
1787
1842
  /** Features required on threads created from this agent. */
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20260825001040-g9dff10c",
3
+ "version": "0.0.0-20260827012238-gff6d7bb",
4
4
  "description": "Amp Plugin API",
5
- "homepage": "https://ampcode.com/manual/plugin-api",
5
+ "homepage": "https://ampcode.com/docs/plugin-api",
6
6
  "author": {
7
7
  "name": "The Amp Team",
8
8
  "email": "amp-devs@ampcode.com"