@aragon-agent/core 0.2.60 → 0.2.61

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.
@@ -130,6 +130,8 @@ export declare class Agent {
130
130
  subscribe(listener: AgentEventListener): () => void;
131
131
  /** Queue high-priority text; an optional ID is echoed only after history acceptance. */
132
132
  steer(message: string, id?: string): void;
133
+ /** Withdraw a queued steering message by its receipt ID; false if the engine already took it. */
134
+ removeQueuedSteering(id: string): boolean;
133
135
  /** Queue a low-priority follow-up message (consumed after end_turn). */
134
136
  followUp(message: string): void;
135
137
  setModel(model: ModelRef): void;
@@ -160,6 +160,10 @@ export class Agent {
160
160
  steer(message, id) {
161
161
  this.messageQueueManager.pushSteering(message, id);
162
162
  }
163
+ /** Withdraw a queued steering message by its receipt ID; false if the engine already took it. */
164
+ removeQueuedSteering(id) {
165
+ return this.messageQueueManager.removeSteeringById(id);
166
+ }
163
167
  /** Queue a low-priority follow-up message (consumed after end_turn). */
164
168
  followUp(message) {
165
169
  this.messageQueueManager.pushFollowUp(message);
@@ -21,6 +21,13 @@ export declare class MessageQueueManager {
21
21
  drainSteering(): string[];
22
22
  /** Drain all pending envelopes in FIFO order (empties the same queue). */
23
23
  drainSteeringItems(): SteeringMessage[];
24
+ /**
25
+ * Remove the first pending steering envelope carrying `id`.
26
+ * Returns false when no such envelope is queued -- typically because the engine has
27
+ * already drained it. Synchronous on purpose: the caller treats the answer as the
28
+ * single authority on "was it withdrawn or delivered".
29
+ */
30
+ removeSteeringById(id: string): boolean;
24
31
  /** Whether there are pending steering messages. */
25
32
  hasSteering(): boolean;
26
33
  /** Enqueue a low-priority follow-up message. */
@@ -25,6 +25,19 @@ export class MessageQueueManager {
25
25
  drainSteeringItems() {
26
26
  return this.steeringQueue.splice(0);
27
27
  }
28
+ /**
29
+ * Remove the first pending steering envelope carrying `id`.
30
+ * Returns false when no such envelope is queued -- typically because the engine has
31
+ * already drained it. Synchronous on purpose: the caller treats the answer as the
32
+ * single authority on "was it withdrawn or delivered".
33
+ */
34
+ removeSteeringById(id) {
35
+ const index = this.steeringQueue.findIndex((item) => item.id === id);
36
+ if (index < 0)
37
+ return false;
38
+ this.steeringQueue.splice(index, 1);
39
+ return true;
40
+ }
28
41
  /** Whether there are pending steering messages. */
29
42
  hasSteering() {
30
43
  return this.steeringQueue.length > 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aragon-agent/core",
3
- "version": "0.2.60",
3
+ "version": "0.2.61",
4
4
  "description": "AragonAgent core engine — LLM provider adapters, streaming, tool registry/execution, steering, idle watchdog, and an optional isolated-vm sandbox.",
5
5
  "license": "MIT",
6
6
  "author": "AragonAgent contributors",