@ampcode/plugin 0.0.0-20260901002124-g832081c → 0.0.0-20260903001817-g400a7f3

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 (2) hide show
  1. package/index.d.ts +55 -7
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // sitemap-lastmod: /docs/plugin-api 2026-08-28
1
+ // sitemap-lastmod: /docs/plugin-api 2026-09-01
2
2
 
3
3
  declare module '@ampcode/plugin' {
4
4
  /**
@@ -156,11 +156,11 @@ declare module '@ampcode/plugin' {
156
156
  onDispose(callback: () => void | Promise<void>): Subscription
157
157
 
158
158
  /**
159
- * Register a durable generic webhook for this plugin and the owning Orb thread.
159
+ * Register a durable generic webhook for this plugin in an Amp-managed Orb.
160
160
  *
161
- * The key is stable within the plugin and thread. Re-registering the same key,
162
- * including after a plugin reload, returns the same capability URL. Treat the
163
- * URL as a credential.
161
+ * Project threads owned by the same user share a registration for each plugin and key.
162
+ * Threads without a project keep a separate registration for each thread. Re-registering
163
+ * returns the same capability URL. Treat the URL as a credential.
164
164
  *
165
165
  * Handler side effects are delivered at least once. Use `event.id` as an
166
166
  * idempotency key because an executor can stop after the handler succeeds but
@@ -369,12 +369,31 @@ declare module '@ampcode/plugin' {
369
369
  * Tools available to this agent. Use 'all' for its provider-appropriate built-in tools
370
370
  * plus plugin, MCP, and remote tools available in its runtime.
371
371
  *
372
+ * Explicit tool lists (arrays and `include`/`exclude` entries) match tool names as
373
+ * glob patterns: `mcp__*` matches all MCP tools (named `mcp__<server>__<tool>`), and
374
+ * `plugin__*` matches all plugin tools (also matched as `plugin__<pluginName>__<toolName>`
375
+ * even though plugin tools are registered under their bare names). Include such an entry
376
+ * in explicit lists so the user's plugin and MCP tools stay available.
377
+ *
372
378
  * Run `amp plugins show-agent-options --json` for built-in tool names intended for
373
379
  * plugin agents.
374
380
  */
375
381
  tools?: AgentToolSelection
376
382
  /** Optional reasoning effort override for models that support it. */
377
383
  reasoningEffort?: AgentReasoningEffort
384
+ /**
385
+ * Model and reasoning effort for the Oracle consulted from threads running this
386
+ * agent. Omitted fields keep Amp's automatic routing and default effort. An
387
+ * unavailable model falls back to Amp's routing at run time.
388
+ */
389
+ oracle?: AgentSubagentPin
390
+ /**
391
+ * Model and reasoning effort for the other subagents spawned from threads running
392
+ * this agent (Task workers, finder, thread reader, librarian). Omitted fields keep
393
+ * Amp's automatic routing and default effort. An unavailable model falls back to
394
+ * Amp's routing at run time.
395
+ */
396
+ subagents?: AgentSubagentPin
378
397
  /**
379
398
  * Estimated input-token count at which Amp automatically compacts the thread.
380
399
  * Must be a positive safe integer. When omitted, Amp uses the configured
@@ -397,6 +416,20 @@ declare module '@ampcode/plugin' {
397
416
  display?: AgentDisplay
398
417
  }
399
418
 
419
+ /**
420
+ * A model pin for one subagent role of a custom agent: the Oracle or the other subagents.
421
+ * Each field overrides independently.
422
+ */
423
+ export interface AgentSubagentPin {
424
+ /**
425
+ * Model identifier in `provider/model` format, such as `anthropic/claude-sonnet-4-6`.
426
+ * Omit to keep Amp's automatic model routing for the role.
427
+ */
428
+ model?: PluginAgentModel
429
+ /** Reasoning effort for the role's model. Omit to keep the role's default effort. */
430
+ effort?: AgentReasoningEffort
431
+ }
432
+
400
433
  /** Display metadata for a plugin agent. */
401
434
  export interface AgentDisplay {
402
435
  /** Label shown in mode pickers and thread headers, 24 characters or less. */
@@ -1721,7 +1754,7 @@ declare module '@ampcode/plugin' {
1721
1754
 
1722
1755
  /** Options for registering a generic webhook handler. */
1723
1756
  export interface CreateWebhookOptions {
1724
- /** Stable, non-whitespace-padded key within this plugin and thread (1-128 characters). */
1757
+ /** Stable, non-whitespace-padded key within this plugin's scope (1-128 characters). */
1725
1758
  key: string
1726
1759
 
1727
1760
  /**
@@ -1832,7 +1865,9 @@ declare module '@ampcode/plugin' {
1832
1865
  * Built-in tools available to this agent: 'all' for all tools available in its runtime,
1833
1866
  * a list of tool names with `*` suffix wildcards, or an object that adjusts the default
1834
1867
  * list (`add` unions extra tools into it; `exclude` removes tools). Use `add` with
1835
- * `extends` to add tools on top of the built-in mode's tool list.
1868
+ * `extends` to add tools on top of the built-in mode's tool list. `mcp__*` matches all
1869
+ * MCP tools and `plugin__*` matches all plugin tools (also matched as
1870
+ * `plugin__<pluginName>__<toolName>`).
1836
1871
  */
1837
1872
  tools?:
1838
1873
  | 'all'
@@ -1844,6 +1879,19 @@ declare module '@ampcode/plugin' {
1844
1879
  }
1845
1880
  /** Optional reasoning effort override for models that support it. */
1846
1881
  reasoningEffort?: AgentReasoningEffort
1882
+ /**
1883
+ * Model and reasoning effort for the Oracle consulted from threads running this
1884
+ * agent. Omitted fields keep Amp's automatic routing and default effort. An
1885
+ * unavailable model falls back to Amp's routing at run time.
1886
+ */
1887
+ oracle?: AgentSubagentPin
1888
+ /**
1889
+ * Model and reasoning effort for the other subagents spawned from threads running
1890
+ * this agent (Task workers, finder, thread reader, librarian). Omitted fields keep
1891
+ * Amp's automatic routing and default effort. An unavailable model falls back to
1892
+ * Amp's routing at run time.
1893
+ */
1894
+ subagents?: AgentSubagentPin
1847
1895
  /** Features required on threads created from this agent. */
1848
1896
  features?: readonly AgentFeature[]
1849
1897
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20260901002124-g832081c",
3
+ "version": "0.0.0-20260903001817-g400a7f3",
4
4
  "description": "Amp Plugin API",
5
5
  "homepage": "https://ampcode.com/docs/plugin-api",
6
6
  "author": {