aiterm-steer-delivery 0.5.3 → 0.5.5
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/CHANGELOG.md +4 -0
- package/dist/channel.d.ts +1 -0
- package/dist/channel.js +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.5.5 (2026-11-28)
|
|
2
|
+
|
|
3
|
+
- Narrows 0.5.4, which stopped delivering answers to non-interactive Claude parents altogether. When `CLAUDE_CODE_ENTRYPOINT` is `sdk-cli`, `sdk-ts` or `sdk-py` (`claude -p`, Agent SDK, Aiterm/BellTeam stream-json seats), `runClaudeChannelWaiter` no longer waits: it claims the text already pending once, emits it and returns 2, or returns 0 when nothing is pending. The hook therefore never holds a turn or an interrupt, and answers arrive at the next PostToolUse / Stop / SessionStart hook. Interactive behaviour is unchanged. 0.5.4 is superseded; do not use it.
|
|
4
|
+
|
|
1
5
|
## 0.5.3 (2026-11-12)
|
|
2
6
|
|
|
3
7
|
- A Codex App Server request no longer times out while an answer is already waiting in the pipe. When the calling process's event loop was blocked past the deadline (15 s by default), the timer fired before the answer was read and the request failed with `CODEX_RECEIVER_TIMEOUT`. The timer now waits one turn of the loop and rejects only if the request is still pending. Reported by Kiro: a host Aiterm blocked for ~16 s by goal reads made Codex goal reads unavailable.
|
package/dist/channel.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare function runClaudeChannelWaiter(profile: ProductProfile, input: u
|
|
|
64
64
|
} | null;
|
|
65
65
|
owner_check_ms?: number;
|
|
66
66
|
identity_recheck_ms?: number;
|
|
67
|
+
env?: NodeJS.ProcessEnv;
|
|
67
68
|
runtime?: {
|
|
68
69
|
exists: (pid: number) => boolean;
|
|
69
70
|
identity: (pid: number) => string | undefined;
|
package/dist/channel.js
CHANGED
|
@@ -340,10 +340,23 @@ function currentHookOwner() {
|
|
|
340
340
|
// 待機は最長で1日続き、会話の数だけ同時に動く。5秒おきの確かめはpidの有無だけにして(processを起こさない)、
|
|
341
341
|
// 開始時刻は最初とこの間隔でだけ照合する。出す先が終わった直後に同じpidが使い回された時だけ、待機の終わりが最長でこの間隔だけ遅れる。
|
|
342
342
|
const WAITER_OWNER_IDENTITY_RECHECK_MS = 60_000;
|
|
343
|
+
/** claude -p とAgent SDK(Aiterm/BellTeamの席を含む)は、asyncRewakeのhookが戻るまで番(と中断)を止める。待たず、今ある本文だけ出す。 */
|
|
344
|
+
function nonInteractiveClaude(env) {
|
|
345
|
+
return ["sdk-cli", "sdk-ts", "sdk-py"].includes(env.CLAUDE_CODE_ENTRYPOINT ?? "");
|
|
346
|
+
}
|
|
343
347
|
export async function runClaudeChannelWaiter(profile, input, emit, options = {}) {
|
|
344
348
|
const event = z.object({ session_id: z.uuid() }).loose().parse(input);
|
|
345
349
|
if (!openClaudeChannels(profile, event.session_id).length)
|
|
346
350
|
return 0;
|
|
351
|
+
if (nonInteractiveClaude(options.env ?? process.env)) {
|
|
352
|
+
// 待たずに1回だけ取る。無ければ0。本文は次のPostToolUse/Stop/SessionStartのhookで届く。
|
|
353
|
+
const claimed = openClaudeChannels(profile, event.session_id).flatMap(channel => claimPending(profile, channel.channel_id, "claude_hook"))
|
|
354
|
+
.sort((left, right) => left.item.at < right.item.at ? -1 : left.item.at > right.item.at ? 1 : 0);
|
|
355
|
+
if (!claimed.length)
|
|
356
|
+
return 0;
|
|
357
|
+
await emitClaimed(claimed, "claude_hook", texts => emit(texts.join("\n\n")));
|
|
358
|
+
return 2;
|
|
359
|
+
}
|
|
347
360
|
const owner = options.owner === undefined ? currentHookOwner() : options.owner;
|
|
348
361
|
const index = sessionIndex(profile, event.session_id);
|
|
349
362
|
const identity = acquireWaiter(index);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-steer-delivery",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Aiterm's steer delivery as a library: deliver text to the parent AI session that called your MCP tool — steered into the running turn when it is busy, delivered normally when it is idle. Codex (official queue + sync hooks), Claude Code (asyncRewake hooks), Cursor (hooks + background receiver).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|