@ampcode/plugin 0.0.0-20260825001040-g9dff10c → 0.0.0-20260826001054-g2427cf3

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 +59 -7
  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. */
@@ -1727,6 +1750,19 @@ declare module '@ampcode/plugin' {
1727
1750
  */
1728
1751
  title?: string
1729
1752
 
1753
+ /**
1754
+ * Labels used to group adjacent tool calls into one action-oriented transcript row.
1755
+ * Calls with matching labels are shown together. `active` is shown while any call is
1756
+ * running, then `complete` is shown. Not sent to the LLM.
1757
+ *
1758
+ * @example
1759
+ * transcriptGroup: { active: 'Inspecting simulator', complete: 'Inspected simulator' }
1760
+ */
1761
+ transcriptGroup?: {
1762
+ active: string
1763
+ complete: string
1764
+ }
1765
+
1730
1766
  /** Description shown to the LLM explaining what the tool does */
1731
1767
  description: string
1732
1768
 
@@ -1770,18 +1806,34 @@ declare module '@ampcode/plugin' {
1770
1806
  description?: string
1771
1807
  /** Label color as a hex RGB string, for example "#d97706". */
1772
1808
  color?: string
1809
+ /**
1810
+ * Built-in agent mode this agent extends. Threads render that mode's system prompt with
1811
+ * the agent's `instructions.md` appended as agent instructions, and `tools` defaults to
1812
+ * the mode's tool list. When `model` is omitted, the agent uses the mode's preferred
1813
+ * model and reasoning effort.
1814
+ */
1815
+ extends?: 'low' | 'medium' | 'high' | 'ultra'
1773
1816
  /**
1774
1817
  * Model identifier in `provider/model` format, such as `anthropic/claude-sonnet-4-6`.
1775
- * Omit to use the default model.
1818
+ * Omit to use the default model, or the extended mode's model when `extends` is set.
1776
1819
  */
1777
1820
  model?: PluginAIModel
1778
1821
  /** Run entirely on Amp's thread actor without creating or attaching an executor. */
1779
1822
  serverOnly?: boolean
1780
1823
  /**
1781
1824
  * 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[]
1825
+ * a list of tool names with `*` suffix wildcards, or an object that adjusts the default
1826
+ * list (`add` unions extra tools into it; `exclude` removes tools). Use `add` with
1827
+ * `extends` to add tools on top of the built-in mode's tool list.
1828
+ */
1829
+ tools?:
1830
+ | 'all'
1831
+ | readonly string[]
1832
+ | {
1833
+ include?: 'all' | readonly string[]
1834
+ add?: readonly string[]
1835
+ exclude?: readonly string[]
1836
+ }
1785
1837
  /** Optional reasoning effort override for models that support it. */
1786
1838
  reasoningEffort?: AgentReasoningEffort
1787
1839
  /** 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-20260826001054-g2427cf3",
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"