@ampcode/plugin 0.0.0-20261030001330-g694fa8a → 0.0.0-20261031180326-g7510afb

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 +38 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -696,6 +696,7 @@ declare module '@ampcode/plugin' {
696
696
  | 'meta'
697
697
  | 'minimax'
698
698
  | 'moonshotai'
699
+ | 'nvidia'
699
700
  | 'ollama-cloud'
700
701
  | 'openai'
701
702
  | 'thinkingmachines'
@@ -1272,6 +1273,18 @@ declare module '@ampcode/plugin' {
1272
1273
  status: 'done' | 'error' | 'cancelled' | 'running' | 'pending'
1273
1274
  }
1274
1275
 
1276
+ /**
1277
+ * Token usage of the inference that produced an assistant message.
1278
+ */
1279
+ export interface ThreadMessageUsage {
1280
+ /** The model that produced the message, as the inference provider names it. */
1281
+ model?: string
1282
+ inputTokens: number
1283
+ outputTokens: number
1284
+ cacheCreationInputTokens: number | null
1285
+ cacheReadInputTokens: number | null
1286
+ }
1287
+
1275
1288
  /**
1276
1289
  * A user message in the thread.
1277
1290
  */
@@ -1281,6 +1294,9 @@ declare module '@ampcode/plugin' {
1281
1294
  /** The message ID, which is unique in the thread. */
1282
1295
  id: ThreadMessageID
1283
1296
 
1297
+ /** When the message was created, as an ISO 8601 timestamp. */
1298
+ createdAt?: string
1299
+
1284
1300
  content: (ThreadTextBlock | ThreadToolResultBlock)[]
1285
1301
  }
1286
1302
 
@@ -1293,6 +1309,18 @@ declare module '@ampcode/plugin' {
1293
1309
  /** The message ID, which is unique in the thread. */
1294
1310
  id: ThreadMessageID
1295
1311
 
1312
+ /** When the message was created, as an ISO 8601 timestamp. */
1313
+ createdAt?: string
1314
+
1315
+ /**
1316
+ * Why the message ended: `tool_use` when it calls tools, `end_turn` when the agent
1317
+ * finished, `cancelled` when the turn was cancelled.
1318
+ */
1319
+ stopReason?: 'end_turn' | 'tool_use' | 'cancelled'
1320
+
1321
+ /** Token usage of the inference that produced the message, when recorded. */
1322
+ usage?: ThreadMessageUsage
1323
+
1296
1324
  content: (ThreadTextBlock | ThreadThinkingBlock | ThreadToolUseBlock)[]
1297
1325
  }
1298
1326
 
@@ -1305,6 +1333,9 @@ declare module '@ampcode/plugin' {
1305
1333
  /** The message ID, which is unique in the thread. */
1306
1334
  id: ThreadMessageID
1307
1335
 
1336
+ /** When the message was created, as an ISO 8601 timestamp. */
1337
+ createdAt?: string
1338
+
1308
1339
  content: ThreadTextBlock[]
1309
1340
  }
1310
1341
 
@@ -2465,6 +2496,13 @@ declare module '@ampcode/plugin' {
2465
2496
  /** Tool name (must match ^[a-zA-Z0-9_-]+$) */
2466
2497
  name: string
2467
2498
 
2499
+ /**
2500
+ * Set to `false` to expose the tool directly to the model from the start instead of
2501
+ * through `tool_search` and `code_exec`, even when a skill lists the tool.
2502
+ * Defaults to `true`. Agent tool selections and exclusions still apply.
2503
+ */
2504
+ defer?: boolean
2505
+
2468
2506
  /**
2469
2507
  * Human-readable display title shown in Amp clients instead of the raw
2470
2508
  * tool name, e.g. `Tap screen` instead of `sim_tap`. Not sent to the LLM.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20261030001330-g694fa8a",
3
+ "version": "0.0.0-20261031180326-g7510afb",
4
4
  "description": "Amp Plugin API",
5
5
  "license": "Amp Commercial License",
6
6
  "homepage": "https://ampcode.com/docs/plugin-api",