@ampcode/plugin 0.0.0-20260531003713-g5edca02 → 0.0.0-20260602004132-g778c3a1

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 +25 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -155,6 +155,9 @@ declare module '@ampcode/plugin' {
155
155
  activeThread: Observable<{ id: ThreadID } | null> & {
156
156
  readonly current: { id: ThreadID } | null
157
157
  }
158
+
159
+ /** Thread lookup APIs. */
160
+ threads: PluginThreads
158
161
  }
159
162
 
160
163
  export type AgentReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high'
@@ -543,6 +546,20 @@ declare module '@ampcode/plugin' {
543
546
  * Append a user message to the thread.
544
547
  */
545
548
  append(messages: UserMessage[]): Promise<void>
549
+
550
+ /**
551
+ * Append a single user message to the thread.
552
+ *
553
+ * When `steer` is true and the thread is busy, the message is queued as a
554
+ * steering message and is preferred when the thread next dequeues work.
555
+ */
556
+ appendUserMessage(message: UserMessage, options?: AppendUserMessageOptions): Promise<void>
557
+ }
558
+
559
+ /** APIs for accessing threads by ID. */
560
+ export interface PluginThreads {
561
+ /** Get a thread handle for the given thread ID. */
562
+ get(threadID: ThreadID): PluginThread
546
563
  }
547
564
 
548
565
  /**
@@ -554,6 +571,14 @@ declare module '@ampcode/plugin' {
554
571
  content: string
555
572
  }
556
573
 
574
+ /** Options for appending a single user message to a thread. */
575
+ export interface AppendUserMessageOptions {
576
+ /**
577
+ * Prefer this message when it is queued behind in-progress work.
578
+ */
579
+ steer?: boolean
580
+ }
581
+
557
582
  /**
558
583
  * Options for the input dialog.
559
584
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20260531003713-g5edca02",
3
+ "version": "0.0.0-20260602004132-g778c3a1",
4
4
  "description": "Amp Plugin API",
5
5
  "homepage": "https://ampcode.com/manual/plugin-api",
6
6
  "author": {