@code-yeongyu/senpi-agent-core 2026.10.13 → 2026.10.16-2
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.
- package/dist/agent.d.ts +4 -0
- package/dist/agent.js +24 -0
- package/package.json +3 -3
package/dist/agent.d.ts
CHANGED
|
@@ -120,6 +120,10 @@ export declare class Agent {
|
|
|
120
120
|
steer(message: AgentMessage): void;
|
|
121
121
|
/** Queue a message to run only after the agent would otherwise stop. */
|
|
122
122
|
followUp(message: AgentMessage): void;
|
|
123
|
+
/** Remove one queued steering or follow-up message by identity; false once it was drained into a turn. */
|
|
124
|
+
removeQueuedMessage(message: AgentMessage): boolean;
|
|
125
|
+
/** Replace one queued message by identity, keeping its place; false once it was drained into a turn. */
|
|
126
|
+
replaceQueuedMessage(message: AgentMessage, next: AgentMessage): boolean;
|
|
123
127
|
/** Remove all queued steering messages. */
|
|
124
128
|
clearSteeringQueue(): void;
|
|
125
129
|
/** Remove all queued follow-up messages. */
|
package/dist/agent.js
CHANGED
|
@@ -102,6 +102,22 @@ class PendingMessageQueue {
|
|
|
102
102
|
prepend(messages) {
|
|
103
103
|
this.messages = [...messages, ...this.messages];
|
|
104
104
|
}
|
|
105
|
+
/** Remove this exact message object; false when it is no longer queued (already drained). */
|
|
106
|
+
remove(message) {
|
|
107
|
+
const index = this.messages.indexOf(message);
|
|
108
|
+
if (index === -1)
|
|
109
|
+
return false;
|
|
110
|
+
this.messages.splice(index, 1);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
/** Swap this exact message object for another in place; false when it is no longer queued. */
|
|
114
|
+
replace(message, next) {
|
|
115
|
+
const index = this.messages.indexOf(message);
|
|
116
|
+
if (index === -1)
|
|
117
|
+
return false;
|
|
118
|
+
this.messages[index] = next;
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
105
121
|
clear() {
|
|
106
122
|
this.messages = [];
|
|
107
123
|
this.clearGeneration++;
|
|
@@ -193,6 +209,14 @@ export class Agent {
|
|
|
193
209
|
followUp(message) {
|
|
194
210
|
this.followUpQueue.enqueue(message);
|
|
195
211
|
}
|
|
212
|
+
/** Remove one queued steering or follow-up message by identity; false once it was drained into a turn. */
|
|
213
|
+
removeQueuedMessage(message) {
|
|
214
|
+
return this.steeringQueue.remove(message) || this.followUpQueue.remove(message);
|
|
215
|
+
}
|
|
216
|
+
/** Replace one queued message by identity, keeping its place; false once it was drained into a turn. */
|
|
217
|
+
replaceQueuedMessage(message, next) {
|
|
218
|
+
return this.steeringQueue.replace(message, next) || this.followUpQueue.replace(message, next);
|
|
219
|
+
}
|
|
196
220
|
/** Remove all queued steering messages. */
|
|
197
221
|
clearSteeringQueue() {
|
|
198
222
|
this.steeringQueue.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-agent-core",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.16-2",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@earendil-works/chord": "0.99.1",
|
|
65
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.
|
|
66
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.10.
|
|
65
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.16-2",
|
|
66
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.10.16-2",
|
|
67
67
|
"diff": "9.0.0",
|
|
68
68
|
"ignore": "7.0.9",
|
|
69
69
|
"typebox": "1.3.34",
|