@scotthuang/agent-knock-knock 0.12.32 → 0.12.34
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 +25 -0
- package/dist/src/callback-cli-adapter.d.ts +2 -1
- package/dist/src/callback-cli-adapter.js +1 -0
- package/dist/src/callback-cli-adapter.js.map +1 -1
- package/dist/src/callback-outbox-policy.d.ts +12 -1
- package/dist/src/callback-outbox-policy.js +51 -0
- package/dist/src/callback-outbox-policy.js.map +1 -1
- package/dist/src/callback-outbox-service.d.ts +19 -0
- package/dist/src/callback-outbox-service.js +63 -0
- package/dist/src/callback-outbox-service.js.map +1 -1
- package/dist/src/openclaw-managed-callback-cli-adapter.d.ts +2 -0
- package/dist/src/openclaw-managed-callback-cli-adapter.js +9 -1
- package/dist/src/openclaw-managed-callback-cli-adapter.js.map +1 -1
- package/dist/src/openclaw-plugin-callback-adapter.js +45 -20
- package/dist/src/openclaw-plugin-callback-adapter.js.map +1 -1
- package/dist/src/openclaw-plugin-command-adapter.js +1 -1
- package/dist/src/openclaw-plugin-command-adapter.js.map +1 -1
- package/dist/src/openclaw-plugin-schemas.d.ts +34 -62
- package/dist/src/openclaw-plugin-schemas.js +28 -64
- package/dist/src/openclaw-plugin-schemas.js.map +1 -1
- package/dist/src/terminal-agent-bridge.d.ts +19 -0
- package/dist/src/terminal-agent-bridge.js +61 -11
- package/dist/src/terminal-agent-bridge.js.map +1 -1
- package/dist/src/terminal-interaction-cli-adapter.js +138 -15
- package/dist/src/terminal-interaction-cli-adapter.js.map +1 -1
- package/dist/src/terminal-monitor-application-service.d.ts +22 -0
- package/dist/src/terminal-monitor-application-service.js +161 -1
- package/dist/src/terminal-monitor-application-service.js.map +1 -1
- package/dist/src/terminal-monitor-cli-adapter.d.ts +37 -1
- package/dist/src/terminal-monitor-cli-adapter.js +88 -0
- package/dist/src/terminal-monitor-cli-adapter.js.map +1 -1
- package/dist/src/terminal-monitor-state-cli-adapter.d.ts +1 -1
- package/dist/src/terminal-monitor-state-cli-adapter.js +235 -1
- package/dist/src/terminal-monitor-state-cli-adapter.js.map +1 -1
- package/dist/src/terminal-questionnaire-adapter.js +66 -15
- package/dist/src/terminal-questionnaire-adapter.js.map +1 -1
- package/package.json +1 -1
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +1 -1
|
@@ -23,76 +23,48 @@ export declare const respondInteractionParameters: {
|
|
|
23
23
|
maxItems: 1;
|
|
24
24
|
description: string;
|
|
25
25
|
items: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
response_kind: {
|
|
39
|
-
const: string;
|
|
40
|
-
};
|
|
41
|
-
selected_option_ids: {
|
|
42
|
-
type: string;
|
|
43
|
-
minItems: number;
|
|
44
|
-
maxItems: number;
|
|
45
|
-
uniqueItems: boolean;
|
|
46
|
-
items: {
|
|
47
|
-
type: string;
|
|
48
|
-
minLength: number;
|
|
49
|
-
maxLength: 128;
|
|
50
|
-
pattern: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
26
|
+
type: string;
|
|
27
|
+
additionalProperties: boolean;
|
|
28
|
+
required: string[];
|
|
29
|
+
description: string;
|
|
30
|
+
properties: {
|
|
31
|
+
question_id: {
|
|
32
|
+
type: string;
|
|
33
|
+
minLength: number;
|
|
34
|
+
maxLength: 128;
|
|
35
|
+
pattern: string;
|
|
36
|
+
description: string;
|
|
53
37
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
properties: {
|
|
59
|
-
question_id: {
|
|
60
|
-
type: string;
|
|
61
|
-
minLength: number;
|
|
62
|
-
maxLength: 128;
|
|
63
|
-
pattern: string;
|
|
64
|
-
description: string;
|
|
65
|
-
};
|
|
66
|
-
response_kind: {
|
|
67
|
-
const: string;
|
|
68
|
-
};
|
|
69
|
-
text: {
|
|
70
|
-
type: string;
|
|
71
|
-
minLength: number;
|
|
72
|
-
maxLength: 4096;
|
|
73
|
-
pattern: string;
|
|
74
|
-
};
|
|
38
|
+
response_kind: {
|
|
39
|
+
type: string;
|
|
40
|
+
enum: string[];
|
|
41
|
+
description: string;
|
|
75
42
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
43
|
+
selected_option_ids: {
|
|
44
|
+
type: string;
|
|
45
|
+
minItems: number;
|
|
46
|
+
maxItems: number;
|
|
47
|
+
uniqueItems: boolean;
|
|
48
|
+
items: {
|
|
82
49
|
type: string;
|
|
83
50
|
minLength: number;
|
|
84
51
|
maxLength: 128;
|
|
85
52
|
pattern: string;
|
|
86
|
-
description: string;
|
|
87
|
-
};
|
|
88
|
-
response_kind: {
|
|
89
|
-
const: string;
|
|
90
|
-
};
|
|
91
|
-
confirm: {
|
|
92
|
-
type: string;
|
|
93
53
|
};
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
text: {
|
|
57
|
+
type: string;
|
|
58
|
+
minLength: number;
|
|
59
|
+
maxLength: 4096;
|
|
60
|
+
pattern: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
confirm: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
94
66
|
};
|
|
95
|
-
}
|
|
67
|
+
};
|
|
96
68
|
};
|
|
97
69
|
};
|
|
98
70
|
};
|
|
@@ -29,75 +29,39 @@ export const respondInteractionParameters = {
|
|
|
29
29
|
type: "array",
|
|
30
30
|
minItems: 1,
|
|
31
31
|
maxItems: TERMINAL_INTERACTION_LIMITS.maxQuestions,
|
|
32
|
-
description: "One typed current-step answer using only advertised opaque semantic ids. Raw keys, indexes, rendered labels, fingerprints, versions, and terminal commands are not accepted.",
|
|
32
|
+
description: "One typed current-step answer using only advertised opaque semantic ids. For single_select supply selected_option_ids; for free_text supply text; for confirm supply confirm. Supply no other answer field. Raw keys, indexes, rendered labels, fingerprints, versions, and terminal commands are not accepted.",
|
|
33
33
|
items: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
],
|
|
43
|
-
|
|
44
|
-
...terminalInteractionAnswerBase,
|
|
45
|
-
response_kind: { const: "single_select" },
|
|
46
|
-
selected_option_ids: {
|
|
47
|
-
type: "array",
|
|
48
|
-
minItems: 1,
|
|
49
|
-
maxItems: 1,
|
|
50
|
-
uniqueItems: true,
|
|
51
|
-
items: terminalInteractionIdentifierSchema
|
|
52
|
-
}
|
|
53
|
-
}
|
|
34
|
+
type: "object",
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
required: ["question_id", "response_kind"],
|
|
37
|
+
description: "Provider-portable answer envelope. AKK revalidates the exact discriminator-specific shape against the current authoritative interaction before sending terminal input.",
|
|
38
|
+
properties: {
|
|
39
|
+
...terminalInteractionAnswerBase,
|
|
40
|
+
response_kind: {
|
|
41
|
+
type: "string",
|
|
42
|
+
enum: ["single_select", "free_text", "confirm"],
|
|
43
|
+
description: "Exact response_kind advertised for the current question. multi_select remains manual-only and is not accepted here."
|
|
54
44
|
},
|
|
55
|
-
{
|
|
56
|
-
type: "
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
],
|
|
63
|
-
properties: {
|
|
64
|
-
...terminalInteractionAnswerBase,
|
|
65
|
-
response_kind: { const: "multi_select" },
|
|
66
|
-
selected_option_ids: {
|
|
67
|
-
type: "array",
|
|
68
|
-
minItems: 1,
|
|
69
|
-
maxItems: TERMINAL_INTERACTION_LIMITS.maxOptionsPerQuestion,
|
|
70
|
-
uniqueItems: true,
|
|
71
|
-
items: terminalInteractionIdentifierSchema
|
|
72
|
-
}
|
|
73
|
-
}
|
|
45
|
+
selected_option_ids: {
|
|
46
|
+
type: "array",
|
|
47
|
+
minItems: 1,
|
|
48
|
+
maxItems: 1,
|
|
49
|
+
uniqueItems: true,
|
|
50
|
+
items: terminalInteractionIdentifierSchema,
|
|
51
|
+
description: "Required only for single_select; exactly one advertised opaque option_id."
|
|
74
52
|
},
|
|
75
|
-
{
|
|
76
|
-
type: "
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
response_kind: { const: "free_text" },
|
|
82
|
-
text: {
|
|
83
|
-
type: "string",
|
|
84
|
-
minLength: 1,
|
|
85
|
-
maxLength: TERMINAL_INTERACTION_LIMITS.maxTextAnswerLength,
|
|
86
|
-
pattern: "^[^\\u0000-\\u001f\\u007f-\\u009f]+$"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
53
|
+
text: {
|
|
54
|
+
type: "string",
|
|
55
|
+
minLength: 1,
|
|
56
|
+
maxLength: TERMINAL_INTERACTION_LIMITS.maxTextAnswerLength,
|
|
57
|
+
pattern: "^[^\\u0000-\\u001f\\u007f-\\u009f]+$",
|
|
58
|
+
description: "Required only for free_text; one non-empty line with no terminal control characters."
|
|
89
59
|
},
|
|
90
|
-
{
|
|
91
|
-
type: "
|
|
92
|
-
|
|
93
|
-
required: ["question_id", "response_kind", "confirm"],
|
|
94
|
-
properties: {
|
|
95
|
-
...terminalInteractionAnswerBase,
|
|
96
|
-
response_kind: { const: "confirm" },
|
|
97
|
-
confirm: { type: "boolean" }
|
|
98
|
-
}
|
|
60
|
+
confirm: {
|
|
61
|
+
type: "boolean",
|
|
62
|
+
description: "Required only for confirm."
|
|
99
63
|
}
|
|
100
|
-
|
|
64
|
+
}
|
|
101
65
|
}
|
|
102
66
|
}
|
|
103
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw-plugin-schemas.js","sourceRoot":"","sources":["../../src/openclaw-plugin-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD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,CAAC;YACZ,OAAO,EAAE,yBAAyB;YAClC,WAAW,EACT,sMAAsM;SACzM;KACF;CACF,CAAC"}
|
|
@@ -77,6 +77,20 @@ export declare class TerminalInteractionDispatchReservedError extends Error {
|
|
|
77
77
|
cause?: unknown;
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A durable response reservation exists, but the bridge proved that no
|
|
82
|
+
* terminal text or key delivery was attempted. The caller must discard the
|
|
83
|
+
* one-shot offer and obtain a fresh status projection before trying again.
|
|
84
|
+
*/
|
|
85
|
+
export declare class TerminalInteractionInputNotStartedError extends Error {
|
|
86
|
+
readonly code = "AKK_TERMINAL_INTERACTION_INPUT_NOT_STARTED";
|
|
87
|
+
readonly stage = "input_not_started";
|
|
88
|
+
readonly doNotRetry = true;
|
|
89
|
+
readonly requiresFreshOffer = true;
|
|
90
|
+
constructor(message: string, options?: {
|
|
91
|
+
cause?: unknown;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
80
94
|
export interface TerminalBridgeStatus {
|
|
81
95
|
provider: string;
|
|
82
96
|
target: string;
|
|
@@ -548,6 +562,11 @@ export declare class TerminalAgentBridge {
|
|
|
548
562
|
scrollbackLines?: number;
|
|
549
563
|
runtime?: TerminalRuntimeIdentity;
|
|
550
564
|
authorize?: (context: TerminalInteractionAuthorizationContext) => TerminalInteractionAuthorizationDecision | Promise<TerminalInteractionAuthorizationDecision>;
|
|
565
|
+
/**
|
|
566
|
+
* Resolve only after the caller has durably persisted its one-shot
|
|
567
|
+
* dispatch receipt. A successful return is the offer lease acceptance
|
|
568
|
+
* boundary for the final read-only recapture.
|
|
569
|
+
*/
|
|
551
570
|
beforeDispatch?: (context: TerminalInteractionBeforeDispatchContext) => void | Promise<void>;
|
|
552
571
|
}): Promise<TerminalInteractionResponseExecution>;
|
|
553
572
|
monitorPoll(options: {
|
|
@@ -248,6 +248,21 @@ export class TerminalInteractionDispatchReservedError extends Error {
|
|
|
248
248
|
this.name = "TerminalInteractionDispatchReservedError";
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* A durable response reservation exists, but the bridge proved that no
|
|
253
|
+
* terminal text or key delivery was attempted. The caller must discard the
|
|
254
|
+
* one-shot offer and obtain a fresh status projection before trying again.
|
|
255
|
+
*/
|
|
256
|
+
export class TerminalInteractionInputNotStartedError extends Error {
|
|
257
|
+
code = "AKK_TERMINAL_INTERACTION_INPUT_NOT_STARTED";
|
|
258
|
+
stage = "input_not_started";
|
|
259
|
+
doNotRetry = true;
|
|
260
|
+
requiresFreshOffer = true;
|
|
261
|
+
constructor(message, options = {}) {
|
|
262
|
+
super(message, options);
|
|
263
|
+
this.name = "TerminalInteractionInputNotStartedError";
|
|
264
|
+
}
|
|
265
|
+
}
|
|
251
266
|
function terminalSendComposerRequirements(agent, multiline, options) {
|
|
252
267
|
const exactEmptyRetryAuthority = options.requireExactEmptyComposerAfterBeforeText;
|
|
253
268
|
const requireExactEmptyComposerBeforeText = options.requireExactEmptyComposerBeforeText === true;
|
|
@@ -2260,30 +2275,45 @@ export class TerminalAgentBridge {
|
|
|
2260
2275
|
if (afterAuthorization instanceof Error) {
|
|
2261
2276
|
return blockedTerminalInteractionResponse(validatedResponse, afterAuthorization.message, first.offer);
|
|
2262
2277
|
}
|
|
2278
|
+
const afterAuthorizationReason = terminalInteractionOfferPreflightReason(afterAuthorization.offer, options);
|
|
2279
|
+
if (afterAuthorizationReason) {
|
|
2280
|
+
return blockedTerminalInteractionResponse(validatedResponse, afterAuthorizationReason, first.offer);
|
|
2281
|
+
}
|
|
2263
2282
|
if (!sameTerminalInteractionOffer(first, afterAuthorization)) {
|
|
2264
2283
|
return blockedTerminalInteractionResponse(validatedResponse, "native questionnaire changed after authorization", first.offer);
|
|
2265
2284
|
}
|
|
2266
2285
|
await reserveTerminalInteractionDispatch(options.beforeDispatch, interactionHookContext(agent, afterAuthorization.terminalControl, afterAuthorization.offer, validatedResponse, runtime));
|
|
2267
2286
|
const finalCapture = await this.captureTerminalInteractionOffer(agent, afterAuthorization.terminalControl, runtime, options.scrollbackLines).catch((error) => {
|
|
2268
2287
|
if (options.beforeDispatch) {
|
|
2269
|
-
throw
|
|
2288
|
+
throw terminalInteractionInputNotStartedError(error, "cannot recapture native questionnaire after dispatch reservation");
|
|
2270
2289
|
}
|
|
2271
2290
|
return error;
|
|
2272
2291
|
});
|
|
2273
2292
|
if (finalCapture instanceof Error) {
|
|
2274
2293
|
return blockedTerminalInteractionResponse(validatedResponse, finalCapture.message, first.offer);
|
|
2275
2294
|
}
|
|
2276
|
-
if (!sameTerminalInteractionOffer(afterAuthorization, finalCapture
|
|
2295
|
+
if (!sameTerminalInteractionOffer(afterAuthorization, finalCapture, {
|
|
2296
|
+
// A successfully returned beforeDispatch hook is the lease acceptance
|
|
2297
|
+
// boundary. The projection expiry is bucketed and may roll over during
|
|
2298
|
+
// this final, bounded recapture even though the questionnaire is exact.
|
|
2299
|
+
ignoreExpiresAt: options.beforeDispatch !== undefined
|
|
2300
|
+
})) {
|
|
2277
2301
|
if (options.beforeDispatch) {
|
|
2278
|
-
throw new
|
|
2302
|
+
throw new TerminalInteractionInputNotStartedError("native questionnaire changed after dispatch reservation");
|
|
2279
2303
|
}
|
|
2280
2304
|
return blockedTerminalInteractionResponse(validatedResponse, "native questionnaire changed before dispatch", first.offer);
|
|
2281
2305
|
}
|
|
2282
2306
|
const verified = await this.verifyTerminalIdentity(agent, finalCapture.terminalControl, runtime).catch((error) => {
|
|
2283
|
-
|
|
2307
|
+
if (options.beforeDispatch) {
|
|
2308
|
+
throw terminalInteractionInputNotStartedError(error, "terminal identity could not be verified immediately before interaction dispatch");
|
|
2309
|
+
}
|
|
2310
|
+
throw terminalInteractionReservedError("key_uncertain", error, "terminal identity could not be verified immediately before interaction dispatch");
|
|
2284
2311
|
});
|
|
2285
2312
|
if (!sameTerminalControlIdentity(finalCapture.terminalControl, verified)) {
|
|
2286
|
-
|
|
2313
|
+
if (options.beforeDispatch) {
|
|
2314
|
+
throw new TerminalInteractionInputNotStartedError("terminal identity changed after the final questionnaire capture");
|
|
2315
|
+
}
|
|
2316
|
+
throw new TerminalInteractionDispatchReservedError("key_uncertain", "terminal identity changed after the final questionnaire capture");
|
|
2287
2317
|
}
|
|
2288
2318
|
const answer = validatedResponse.answers[0];
|
|
2289
2319
|
const outcome = await dispatchTerminalInteractionAnswer({
|
|
@@ -3482,17 +3512,37 @@ async function reserveTerminalInteractionDispatch(beforeDispatch, context) {
|
|
|
3482
3512
|
await beforeDispatch(context);
|
|
3483
3513
|
}
|
|
3484
3514
|
catch (error) {
|
|
3515
|
+
if (error instanceof TerminalInteractionInputNotStartedError) {
|
|
3516
|
+
throw error;
|
|
3517
|
+
}
|
|
3485
3518
|
throw terminalInteractionReservedError("reservation_uncertain", error, "terminal interaction dispatch reservation failed");
|
|
3486
3519
|
}
|
|
3487
3520
|
}
|
|
3488
|
-
function sameTerminalInteractionOffer(left, right) {
|
|
3521
|
+
function sameTerminalInteractionOffer(left, right, options = {}) {
|
|
3522
|
+
const leftProjection = options.ignoreExpiresAt && left.offer
|
|
3523
|
+
? terminalInteractionProjectionWithoutExpiry(left.offer.projection)
|
|
3524
|
+
: left.offer?.projection;
|
|
3525
|
+
const rightProjection = options.ignoreExpiresAt && right.offer
|
|
3526
|
+
? terminalInteractionProjectionWithoutExpiry(right.offer.projection)
|
|
3527
|
+
: right.offer?.projection;
|
|
3489
3528
|
return Boolean(left.offer &&
|
|
3490
3529
|
right.offer &&
|
|
3491
3530
|
sameTerminalControlIdentity(left.terminalControl, right.terminalControl) &&
|
|
3492
3531
|
left.offer.promptFingerprint === right.offer.promptFingerprint &&
|
|
3493
|
-
JSON.stringify(
|
|
3532
|
+
JSON.stringify(leftProjection) === JSON.stringify(rightProjection) &&
|
|
3494
3533
|
JSON.stringify(left.offer.actionPlan) === JSON.stringify(right.offer.actionPlan));
|
|
3495
3534
|
}
|
|
3535
|
+
function terminalInteractionProjectionWithoutExpiry(projection) {
|
|
3536
|
+
const { expires_at: _expiresAt, ...semanticProjection } = projection;
|
|
3537
|
+
return semanticProjection;
|
|
3538
|
+
}
|
|
3539
|
+
function terminalInteractionInputNotStartedError(error, message) {
|
|
3540
|
+
if (error instanceof TerminalInteractionInputNotStartedError) {
|
|
3541
|
+
return error;
|
|
3542
|
+
}
|
|
3543
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
3544
|
+
return new TerminalInteractionInputNotStartedError(`${message}: ${detail}`, { cause: error });
|
|
3545
|
+
}
|
|
3496
3546
|
function terminalInteractionReservedError(stage, error, message) {
|
|
3497
3547
|
if (error instanceof TerminalInteractionDispatchReservedError) {
|
|
3498
3548
|
return error;
|
|
@@ -3507,7 +3557,7 @@ function terminalInteractionChoiceAction(plan, answer) {
|
|
|
3507
3557
|
choice.stages.length !== 1 ||
|
|
3508
3558
|
stage?.kind !== "key" ||
|
|
3509
3559
|
!/^[1-5]$/u.test(stage.key)) {
|
|
3510
|
-
throw new
|
|
3560
|
+
throw new TerminalInteractionInputNotStartedError("single-select interaction has no closed adapter action");
|
|
3511
3561
|
}
|
|
3512
3562
|
return {
|
|
3513
3563
|
key: stage.key,
|
|
@@ -3523,7 +3573,7 @@ function terminalInteractionConfirmKey(plan, answer) {
|
|
|
3523
3573
|
stage?.kind !== "key" ||
|
|
3524
3574
|
!["C-m", "Escape", "1", "2"].includes(stage.key) ||
|
|
3525
3575
|
JSON.stringify(plan.confirm_stages) === JSON.stringify(plan.cancel_stages)) {
|
|
3526
|
-
throw new
|
|
3576
|
+
throw new TerminalInteractionInputNotStartedError("confirmation interaction has no closed adapter action");
|
|
3527
3577
|
}
|
|
3528
3578
|
return stage.key;
|
|
3529
3579
|
}
|
|
@@ -3543,7 +3593,7 @@ async function dispatchTerminalInteractionFreeText(input) {
|
|
|
3543
3593
|
textStage.max_characters < input.answer.text.length ||
|
|
3544
3594
|
enterStage?.kind !== "key" ||
|
|
3545
3595
|
enterStage.key !== "C-m") {
|
|
3546
|
-
throw new
|
|
3596
|
+
throw new TerminalInteractionInputNotStartedError("free-text interaction has no closed adapter action");
|
|
3547
3597
|
}
|
|
3548
3598
|
try {
|
|
3549
3599
|
await input.provider.sendText(input.provider.endpoint(input.terminalControl), input.answer.text);
|
|
@@ -3597,7 +3647,7 @@ async function dispatchTerminalInteractionAnswer(input) {
|
|
|
3597
3647
|
sleep: input.sleep
|
|
3598
3648
|
});
|
|
3599
3649
|
}
|
|
3600
|
-
throw new
|
|
3650
|
+
throw new TerminalInteractionInputNotStartedError("terminal interaction answer does not have a closed adapter action");
|
|
3601
3651
|
}
|
|
3602
3652
|
function statusFromInspection(adapter, terminalControl, inspection, options = {}) {
|
|
3603
3653
|
const approval = dispatchableApprovalInspection(adapter, inspection.approval);
|