@turns/dev 0.0.17 → 0.0.18
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-anchor.js +22 -0
- package/package.json +1 -1
package/dist/agent-anchor.js
CHANGED
|
@@ -330,6 +330,28 @@ class ClaudeTransport extends LineTransport {
|
|
|
330
330
|
timer.unref?.();
|
|
331
331
|
return waiter.promise.finally(() => clearTimeout(timer));
|
|
332
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Claude Code folds a stdin `user` frame that arrives during a turn into that
|
|
335
|
+
* turn: the model reads it after the tool calls in flight finish, within the
|
|
336
|
+
* same `result`, and the transcript records it as a `queued_command`
|
|
337
|
+
* attachment rather than a new user row (verified on 2.1.280). `priority`
|
|
338
|
+
* selects what happens to the running work. `next` is the fold described
|
|
339
|
+
* above and matches what the interactive TUI does when the user types while
|
|
340
|
+
* Claude works. `now` would end the running turn with `aborted_tools` and
|
|
341
|
+
* answer the message as a fresh turn, which is the interrupt fallback the
|
|
342
|
+
* queue already offers, so it is not used here.
|
|
343
|
+
*/
|
|
344
|
+
steer(text, _messageId = '') {
|
|
345
|
+
if (!this.turnWaiter)
|
|
346
|
+
throw new Error('Claude has no active turn to steer.');
|
|
347
|
+
this.emit({
|
|
348
|
+
type: 'user',
|
|
349
|
+
session_id: this.sessionId,
|
|
350
|
+
message: { role: 'user', content: [{ type: 'text', text }] },
|
|
351
|
+
parent_tool_use_id: null,
|
|
352
|
+
priority: 'next',
|
|
353
|
+
});
|
|
354
|
+
}
|
|
333
355
|
async interrupt() {
|
|
334
356
|
try {
|
|
335
357
|
await this.controlRequest('interrupt');
|