@scotthuang/agent-knock-knock 0.12.18 → 0.12.20
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 +35 -0
- package/README.md +11 -11
- package/dist/src/claude-local-transcript-provider.d.ts +32 -0
- package/dist/src/claude-local-transcript-provider.js +106 -20
- package/dist/src/claude-local-transcript-provider.js.map +1 -1
- package/dist/src/cli-core.js +3 -0
- package/dist/src/cli-core.js.map +1 -1
- package/dist/src/openclaw-plugin-command-adapter.js +18 -8
- package/dist/src/openclaw-plugin-command-adapter.js.map +1 -1
- package/dist/src/openclaw-plugin-helpers.js +23 -4
- package/dist/src/openclaw-plugin-helpers.js.map +1 -1
- package/dist/src/openclaw-plugin-schemas.js +3 -3
- package/dist/src/openclaw-plugin-schemas.js.map +1 -1
- package/dist/src/store.d.ts +1 -1
- package/dist/src/store.js +3 -3
- package/dist/src/store.js.map +1 -1
- package/dist/src/terminal-action-projection.d.ts +0 -18
- package/dist/src/terminal-action-projection.js +0 -23
- package/dist/src/terminal-action-projection.js.map +1 -1
- package/dist/src/terminal-command-cli-adapter.d.ts +16 -0
- package/dist/src/terminal-command-cli-adapter.js +67 -6
- package/dist/src/terminal-command-cli-adapter.js.map +1 -1
- package/dist/src/terminal-list-cli-adapter.js +8 -36
- package/dist/src/terminal-list-cli-adapter.js.map +1 -1
- package/dist/src/terminal-list-renderer.js +21 -22
- package/dist/src/terminal-list-renderer.js.map +1 -1
- package/dist/src/terminal-submission-acceptance.js +48 -12
- package/dist/src/terminal-submission-acceptance.js.map +1 -1
- package/dist/src/terminal-watch-callback-cli-adapter.d.ts +2 -1
- package/dist/src/terminal-watch-callback-cli-adapter.js.map +1 -1
- package/dist/src/terminal-watch-cli-adapter.d.ts +45 -2
- package/dist/src/terminal-watch-cli-adapter.js +980 -116
- package/dist/src/terminal-watch-cli-adapter.js.map +1 -1
- package/dist/src/terminal-watch-service.d.ts +1 -5
- package/dist/src/terminal-watch-service.js +12 -21
- package/dist/src/terminal-watch-service.js.map +1 -1
- package/dist/src/terminal-watch-store.d.ts +104 -4
- package/dist/src/terminal-watch-store.js +465 -15
- package/dist/src/terminal-watch-store.js.map +1 -1
- package/docs/quickstart-herdr.md +4 -4
- package/docs/quickstart-tmux.md +7 -7
- package/package.json +1 -1
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +19 -15
|
@@ -33,6 +33,7 @@ import { cleanupDeferredForegroundUserClose } from "./deferred-foreground-user-c
|
|
|
33
33
|
import { deferredForegroundBoundaryProjection } from "./deferred-foreground-preparation-cli-adapter.js";
|
|
34
34
|
import { terminalSubmissionPayload } from "./terminal-dispatch-execution.js";
|
|
35
35
|
import { createTerminalUserSendIntentRepository, TerminalUserSendIntentBoundaryConflictError, TerminalUserSendIntentUncertainError } from "./terminal-user-send-intent.js";
|
|
36
|
+
import { terminalUserExplicitFallbackWatchId } from "./terminal-watch-store.js";
|
|
36
37
|
import { presentTerminalCompleted, presentTerminalDispatchReplay, presentTerminalIdentityFailure, presentTerminalUncertain, presentTerminalZeroInputAbort as renderTerminalZeroInputAbort } from "./terminal-dispatch-presenter.js";
|
|
37
38
|
import * as dispatchReceipt from "./terminal-dispatch-receipt.js";
|
|
38
39
|
import { expandHome, positiveMilliseconds, writeCliJson as printJson } from "./cli-command-runtime.js";
|
|
@@ -96,8 +97,10 @@ const observeCurrentNativeAgentSessionIdentity = rawPort("observeCurrentNativeAg
|
|
|
96
97
|
const parseJsonOption = rawPort("parseJsonOption");
|
|
97
98
|
const persistManagedSessionNativeIdentity = rawPort("persistManagedSessionNativeIdentity");
|
|
98
99
|
const positiveMinutes = rawPort("positiveMinutes");
|
|
100
|
+
const prepareUserExplicitFallbackWatch = rawPort("prepareUserExplicitFallbackWatch");
|
|
99
101
|
const processIncarnationForPid = rawPort("processIncarnationForPid");
|
|
100
102
|
const prepareDeferredCodexForegroundBinding = rawPort("prepareDeferredCodexForegroundBinding");
|
|
103
|
+
const attachUserExplicitFallbackWatch = rawPort("attachUserExplicitFallbackWatch");
|
|
101
104
|
const quarantineManagedSessionBinding = rawPort("quarantineManagedSessionBinding");
|
|
102
105
|
const reattachManagedSessionForNativeIdentity = rawPort("reattachManagedSessionForNativeIdentity");
|
|
103
106
|
const reconcilePreparedTerminalDispatchLedger = rawPort("reconcilePreparedTerminalDispatchLedger");
|
|
@@ -128,6 +131,7 @@ const textSummary = rawPort("textSummary");
|
|
|
128
131
|
const verifyCodexPendingManagedSendStatus = rawPort("verifyCodexPendingManagedSendStatus");
|
|
129
132
|
const withTerminalBridgeSubmission = rawPort("withTerminalBridgeSubmission");
|
|
130
133
|
const withTerminalDispatchStateScope = rawPort("withTerminalDispatchStateScope");
|
|
134
|
+
const userExplicitFallbackWatchReceipt = rawPort("userExplicitFallbackWatchReceipt");
|
|
131
135
|
const mutationDispatchLedger = new Proxy({}, {
|
|
132
136
|
get: (_target, property) => terminalCommandRuntime().ports.mutationDispatchLedger[property]
|
|
133
137
|
});
|
|
@@ -3420,7 +3424,7 @@ function acquireUserExplicitTerminalSendLock(options, terminal, warnings) {
|
|
|
3420
3424
|
}
|
|
3421
3425
|
};
|
|
3422
3426
|
}
|
|
3423
|
-
function printReplayedUserExplicitSend(terminal, intent, deliveryMode) {
|
|
3427
|
+
function printReplayedUserExplicitSend(options, terminal, intent, deliveryMode) {
|
|
3424
3428
|
if (deliveryMode === "managed") {
|
|
3425
3429
|
printJson({
|
|
3426
3430
|
delivered: false,
|
|
@@ -3436,10 +3440,19 @@ function printReplayedUserExplicitSend(terminal, intent, deliveryMode) {
|
|
|
3436
3440
|
});
|
|
3437
3441
|
return;
|
|
3438
3442
|
}
|
|
3443
|
+
const watchId = terminalUserExplicitFallbackWatchId({
|
|
3444
|
+
messageId: intent.messageId,
|
|
3445
|
+
physicalToken: intent.boundary.physicalToken,
|
|
3446
|
+
requestHash: intent.boundary.requestHash
|
|
3447
|
+
});
|
|
3448
|
+
const callbackReceipt = userExplicitFallbackWatchReceipt({
|
|
3449
|
+
options,
|
|
3450
|
+
watchId
|
|
3451
|
+
});
|
|
3439
3452
|
printJson({
|
|
3440
3453
|
delivered: true,
|
|
3441
3454
|
delivered_unmanaged: true,
|
|
3442
|
-
callback_expected: false,
|
|
3455
|
+
...(callbackReceipt ?? { callback_expected: false }),
|
|
3443
3456
|
management_mode: "unmanaged_fallback",
|
|
3444
3457
|
replayed: true,
|
|
3445
3458
|
terminal_id: terminal.conversationId,
|
|
@@ -3472,7 +3485,7 @@ function reserveUserExplicitSendIntent(options, messageBody, terminal) {
|
|
|
3472
3485
|
// remains a replay even when stdout fails (for example EPIPE); it must never
|
|
3473
3486
|
// degrade into a fresh physical Send.
|
|
3474
3487
|
if (reservation.outcome === "replay") {
|
|
3475
|
-
printReplayedUserExplicitSend(terminal, intent, required(reservation.intent.delivery_mode, "completed explicit Send delivery mode is unavailable"));
|
|
3488
|
+
printReplayedUserExplicitSend(options, terminal, intent, required(reservation.intent.delivery_mode, "completed explicit Send delivery mode is unavailable"));
|
|
3476
3489
|
return { outcome: "replayed" };
|
|
3477
3490
|
}
|
|
3478
3491
|
if (reservation.outcome === "uncertain") {
|
|
@@ -3606,6 +3619,26 @@ async function runUserExplicitTerminalFallback(options, terminal, managedFailure
|
|
|
3606
3619
|
});
|
|
3607
3620
|
throw error;
|
|
3608
3621
|
}
|
|
3622
|
+
let preparedCallbackWatch;
|
|
3623
|
+
const callbackWarnings = [];
|
|
3624
|
+
try {
|
|
3625
|
+
preparedCallbackWatch = await prepareUserExplicitFallbackWatch({
|
|
3626
|
+
options,
|
|
3627
|
+
terminal: fresh,
|
|
3628
|
+
requestHash: intentLease.intent.boundary.requestHash,
|
|
3629
|
+
messageId,
|
|
3630
|
+
physicalToken: intentLease.intent.boundary.physicalToken
|
|
3631
|
+
});
|
|
3632
|
+
}
|
|
3633
|
+
catch (error) {
|
|
3634
|
+
const warning = `automatic callback Watch preparation failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
3635
|
+
callbackWarnings.push(warning);
|
|
3636
|
+
runtimeLog("warn", "terminal_user_explicit_fallback_watch_prepare_failed", {
|
|
3637
|
+
terminal_id: fresh.conversationId,
|
|
3638
|
+
message_id: messageId,
|
|
3639
|
+
warning
|
|
3640
|
+
});
|
|
3641
|
+
}
|
|
3609
3642
|
let composerDisposition = "replaced_current_composer";
|
|
3610
3643
|
try {
|
|
3611
3644
|
const revalidatePhysicalMutation = async (terminalControl) => {
|
|
@@ -3667,6 +3700,26 @@ async function runUserExplicitTerminalFallback(options, terminal, managedFailure
|
|
|
3667
3700
|
});
|
|
3668
3701
|
throw error;
|
|
3669
3702
|
}
|
|
3703
|
+
let callbackReceipt;
|
|
3704
|
+
if (preparedCallbackWatch) {
|
|
3705
|
+
try {
|
|
3706
|
+
callbackReceipt = await attachUserExplicitFallbackWatch({
|
|
3707
|
+
options,
|
|
3708
|
+
prepared: preparedCallbackWatch
|
|
3709
|
+
});
|
|
3710
|
+
}
|
|
3711
|
+
catch (error) {
|
|
3712
|
+
const warning = `automatic callback Watch attachment failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
3713
|
+
callbackWarnings.push(warning);
|
|
3714
|
+
runtimeLog("warn", "terminal_user_explicit_fallback_watch_attach_failed", {
|
|
3715
|
+
terminal_id: fresh.conversationId,
|
|
3716
|
+
message_id: messageId,
|
|
3717
|
+
watch_id: preparedCallbackWatch.watchId,
|
|
3718
|
+
warning,
|
|
3719
|
+
delivered: true
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3670
3723
|
let cleanupWarnings;
|
|
3671
3724
|
try {
|
|
3672
3725
|
cleanupWarnings = await bestEffortReleaseTerminalManagementForExplicitSend({
|
|
@@ -3695,7 +3748,8 @@ async function runUserExplicitTerminalFallback(options, terminal, managedFailure
|
|
|
3695
3748
|
delivered_unmanaged: true,
|
|
3696
3749
|
cleanup_warnings: cleanupWarnings,
|
|
3697
3750
|
intent_warnings: intentWarnings,
|
|
3698
|
-
|
|
3751
|
+
callback_warnings: callbackWarnings,
|
|
3752
|
+
...(callbackReceipt ?? { callback_expected: false }),
|
|
3699
3753
|
terminal_id: fresh.conversationId,
|
|
3700
3754
|
message_id: messageId,
|
|
3701
3755
|
scope: "terminal_user_explicit",
|
|
@@ -3708,8 +3762,15 @@ async function runUserExplicitTerminalFallback(options, terminal, managedFailure
|
|
|
3708
3762
|
replaced_existing_draft: true,
|
|
3709
3763
|
previous_management_release_attempted: true,
|
|
3710
3764
|
warning: textSummary(`AKK delivered the user's message after managed-state preparation ` +
|
|
3711
|
-
`failed (${fallbackReason}).
|
|
3712
|
-
|
|
3765
|
+
`failed (${fallbackReason}). ` +
|
|
3766
|
+
(callbackReceipt
|
|
3767
|
+
? `Terminal Watch ${callbackReceipt.watch_id} now provides the ` +
|
|
3768
|
+
`completion callback; no managed Turn was claimed.`
|
|
3769
|
+
: "No callback Watch could be attached.")),
|
|
3770
|
+
next_action: callbackReceipt
|
|
3771
|
+
? `wait for Terminal Watch ${callbackReceipt.watch_id} callback; ` +
|
|
3772
|
+
"watch-status remains available for recovery"
|
|
3773
|
+
: "refresh AKK list; the live coding agent continues independently of AKK callback state"
|
|
3713
3774
|
});
|
|
3714
3775
|
}
|
|
3715
3776
|
finally {
|