@ampcode/plugin 0.0.0-20260430003013-g03bdb0e → 0.0.0-20260502002909-g5fc25db

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 +18 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -46,6 +46,7 @@ declare module '@ampcode/plugin' {
46
46
  shellCommandFromToolCall: ShellCommandFromToolCall
47
47
  toolCallsInMessages: ToolCallsInMessages
48
48
  filesModifiedByToolCall: FilesModifiedByToolCall
49
+ filePathFromURI: FilePathFromURI
49
50
  }
50
51
 
51
52
  /**
@@ -257,6 +258,12 @@ declare module '@ampcode/plugin' {
257
258
 
258
259
  export type ThreadID = `T-${string}`
259
260
 
261
+ /**
262
+ * Message IDs are numeric in legacy TUI threads and stable string IDs in Neo
263
+ * thread-actor threads.
264
+ */
265
+ export type ThreadMessageID = number | string
266
+
260
267
  /**
261
268
  * A text content block in a message.
262
269
  */
@@ -300,7 +307,7 @@ declare module '@ampcode/plugin' {
300
307
  role: 'user'
301
308
 
302
309
  /** The message ID, which is unique in the thread. */
303
- id: number
310
+ id: ThreadMessageID
304
311
 
305
312
  content: (ThreadTextBlock | ThreadToolResultBlock)[]
306
313
  }
@@ -312,7 +319,7 @@ declare module '@ampcode/plugin' {
312
319
  role: 'assistant'
313
320
 
314
321
  /** The message ID, which is unique in the thread. */
315
- id: number
322
+ id: ThreadMessageID
316
323
 
317
324
  content: (ThreadTextBlock | ThreadThinkingBlock | ThreadToolUseBlock)[]
318
325
  }
@@ -324,7 +331,7 @@ declare module '@ampcode/plugin' {
324
331
  role: 'info'
325
332
 
326
333
  /** The message ID, which is unique in the thread. */
327
- id: number
334
+ id: ThreadMessageID
328
335
 
329
336
  content: ThreadTextBlock[]
330
337
  }
@@ -576,7 +583,7 @@ declare module '@ampcode/plugin' {
576
583
  message: string
577
584
 
578
585
  /** The message ID */
579
- id: number
586
+ id: ThreadMessageID
580
587
  }
581
588
 
582
589
  /**
@@ -603,10 +610,10 @@ declare module '@ampcode/plugin' {
603
610
  message: string
604
611
 
605
612
  /** The message ID that started this turn */
606
- id: number
613
+ id: ThreadMessageID
607
614
 
608
615
  /** The outcome of the agent's turn */
609
- status: 'done' | 'error' | 'interrupted'
616
+ status: 'done' | 'error' | 'cancelled'
610
617
 
611
618
  /** All messages since the agent.start event (including the user message that started this turn) */
612
619
  messages: ThreadMessage[]
@@ -715,6 +722,11 @@ declare module '@ampcode/plugin' {
715
722
  */
716
723
  export type FilesModifiedByToolCall = (event: ToolCall | ToolResult) => URI[] | null
717
724
 
725
+ /**
726
+ * Converts a file URI returned by helper APIs to a local filesystem path.
727
+ */
728
+ export type FilePathFromURI = (uri: URI) => string
729
+
718
730
  /**
719
731
  * Options for registering a command.
720
732
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20260430003013-g03bdb0e",
3
+ "version": "0.0.0-20260502002909-g5fc25db",
4
4
  "description": "Amp Plugin API",
5
5
  "homepage": "https://ampcode.com/manual/plugin-api",
6
6
  "author": {