@tickernelz/wardmote-adapter-utils 2026.1108.2 → 2026.1109.0
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/acpx-engine/ephemeral-session-environment.test.js +5 -5
- package/dist/acpx-engine/ephemeral-session-environment.test.js.map +1 -1
- package/dist/acpx-engine/execute-identity.test.js +11 -11
- package/dist/acpx-engine/execute-identity.test.js.map +1 -1
- package/dist/acpx-engine/execute.d.ts.map +1 -1
- package/dist/acpx-engine/execute.js +39 -40
- package/dist/acpx-engine/execute.js.map +1 -1
- package/dist/acpx-engine/execute.test.js +78 -78
- package/dist/acpx-engine/execute.test.js.map +1 -1
- package/dist/acpx-engine/filesystem-protocol.test.js +1 -1
- package/dist/acpx-engine/filesystem-protocol.test.js.map +1 -1
- package/dist/acpx-engine/operator-stop.test.js +2 -2
- package/dist/acpx-engine/operator-stop.test.js.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.test.js +3 -3
- package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -1
- package/dist/acpx-engine/spawn-smoke.test.js +6 -6
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -1
- package/dist/acpx-engine/startup-characterization.test.js +13 -13
- package/dist/acpx-engine/startup-characterization.test.js.map +1 -1
- package/dist/acpx-engine/startup-timing.test.js +2 -2
- package/dist/acpx-engine/startup-timing.test.js.map +1 -1
- package/dist/acpx-engine/terminal-session-failure.js +1 -1
- package/dist/acpx-engine/terminal-session-failure.js.map +1 -1
- package/dist/command-managed-runtime.test.js +2 -2
- package/dist/command-managed-runtime.test.js.map +1 -1
- package/dist/directory-merge-lock.test.js +2 -2
- package/dist/directory-merge-lock.test.js.map +1 -1
- package/dist/execution-target-sandbox.test.js +102 -102
- package/dist/execution-target-sandbox.test.js.map +1 -1
- package/dist/execution-target-stdin-race.test.js +25 -25
- package/dist/execution-target-stdin-race.test.js.map +1 -1
- package/dist/execution-target.d.ts.map +1 -1
- package/dist/execution-target.js +59 -60
- package/dist/execution-target.js.map +1 -1
- package/dist/execution-target.test.js +2 -2
- package/dist/execution-target.test.js.map +1 -1
- package/dist/forbidden-config-env.test.d.ts +2 -0
- package/dist/forbidden-config-env.test.d.ts.map +1 -0
- package/dist/forbidden-config-env.test.js +35 -0
- package/dist/forbidden-config-env.test.js.map +1 -0
- package/dist/git-workspace-sync.js +1 -1
- package/dist/git-workspace-sync.js.map +1 -1
- package/dist/github-launcher-environment.test.js +31 -31
- package/dist/github-launcher-environment.test.js.map +1 -1
- package/dist/github-launcher.js +9 -9
- package/dist/github-launcher.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/local-process-sandbox.test.js +8 -8
- package/dist/local-process-sandbox.test.js.map +1 -1
- package/dist/provider-models/codex.d.ts.map +1 -1
- package/dist/provider-models/codex.js +2 -2
- package/dist/provider-models/codex.js.map +1 -1
- package/dist/run-oom-score.d.ts +1 -1
- package/dist/run-oom-score.d.ts.map +1 -1
- package/dist/run-oom-score.js +1 -1
- package/dist/run-oom-score.js.map +1 -1
- package/dist/runner-connectivity.d.ts +2 -2
- package/dist/runner-connectivity.d.ts.map +1 -1
- package/dist/runner-connectivity.js +5 -5
- package/dist/runner-connectivity.js.map +1 -1
- package/dist/sandbox-callback-bridge.js +27 -27
- package/dist/sandbox-callback-bridge.js.map +1 -1
- package/dist/sandbox-callback-bridge.test.js +27 -27
- package/dist/sandbox-callback-bridge.test.js.map +1 -1
- package/dist/sandbox-install-command.js +4 -4
- package/dist/sandbox-install-command.js.map +1 -1
- package/dist/sandbox-managed-runtime.test.js +4 -4
- package/dist/sandbox-managed-runtime.test.js.map +1 -1
- package/dist/sandbox-run-log-stream.js +4 -4
- package/dist/sandbox-run-log-stream.js.map +1 -1
- package/dist/server-utils-env.test.js +2 -2
- package/dist/server-utils-env.test.js.map +1 -1
- package/dist/server-utils.d.ts +5 -5
- package/dist/server-utils.d.ts.map +1 -1
- package/dist/server-utils.js +87 -87
- package/dist/server-utils.js.map +1 -1
- package/dist/server-utils.test.js +75 -75
- package/dist/server-utils.test.js.map +1 -1
- package/dist/skill-library-manifest.test.js +4 -4
- package/dist/skill-library-manifest.test.js.map +1 -1
- package/dist/ssh.js +2 -2
- package/dist/ssh.js.map +1 -1
- package/dist/test-support/mcp-isolation-harness.js +1 -1
- package/dist/test-support/mcp-isolation-harness.js.map +1 -1
- package/dist/{paperclip-mcp-mount.d.ts → wardmote-mcp-mount.d.ts} +1 -1
- package/dist/wardmote-mcp-mount.d.ts.map +1 -0
- package/dist/{paperclip-mcp-mount.js → wardmote-mcp-mount.js} +10 -10
- package/dist/wardmote-mcp-mount.js.map +1 -0
- package/dist/{paperclip-mcp.d.ts → wardmote-mcp.d.ts} +9 -9
- package/dist/wardmote-mcp.d.ts.map +1 -0
- package/dist/{paperclip-mcp.js → wardmote-mcp.js} +36 -36
- package/dist/wardmote-mcp.js.map +1 -0
- package/dist/wardmote-mcp.test.d.ts +2 -0
- package/dist/wardmote-mcp.test.d.ts.map +1 -0
- package/dist/{paperclip-mcp.test.js → wardmote-mcp.test.js} +14 -14
- package/dist/wardmote-mcp.test.js.map +1 -0
- package/dist/{paperclip-runner-permissions.d.ts → wardmote-runner-permissions.d.ts} +18 -18
- package/dist/wardmote-runner-permissions.d.ts.map +1 -0
- package/dist/{paperclip-runner-permissions.js → wardmote-runner-permissions.js} +22 -22
- package/dist/wardmote-runner-permissions.js.map +1 -0
- package/dist/wardmote-runner-permissions.test.d.ts +2 -0
- package/dist/wardmote-runner-permissions.test.d.ts.map +1 -0
- package/dist/{paperclip-runner-permissions.test.js → wardmote-runner-permissions.test.js} +7 -7
- package/dist/wardmote-runner-permissions.test.js.map +1 -0
- package/dist/workspace-manifest.js +1 -1
- package/dist/workspace-manifest.js.map +1 -1
- package/dist/workspace-manifest.test.js +2 -2
- package/dist/workspace-manifest.test.js.map +1 -1
- package/dist/workspace-restore-merge.js +5 -5
- package/dist/workspace-restore-merge.js.map +1 -1
- package/dist/workspace-restore-merge.test.js +27 -27
- package/dist/workspace-restore-merge.test.js.map +1 -1
- package/node_modules/@clack/core/dist/index.d.mts +5 -3
- package/node_modules/@clack/core/dist/index.mjs +70 -67
- package/node_modules/@clack/core/package.json +3 -2
- package/node_modules/@clack/prompts/dist/index.d.mts +5 -4
- package/node_modules/@clack/prompts/dist/index.mjs +212 -187
- package/node_modules/@clack/prompts/package.json +3 -3
- package/node_modules/sisteransi/dist/index.d.ts +33 -0
- package/node_modules/sisteransi/dist/index.js +57 -0
- package/node_modules/sisteransi/package.json +18 -7
- package/node_modules/sisteransi/readme.md +19 -6
- package/package.json +2 -2
- package/dist/env-aliases-run.test.d.ts +0 -2
- package/dist/env-aliases-run.test.d.ts.map +0 -1
- package/dist/env-aliases-run.test.js +0 -49
- package/dist/env-aliases-run.test.js.map +0 -1
- package/dist/paperclip-mcp-mount.d.ts.map +0 -1
- package/dist/paperclip-mcp-mount.js.map +0 -1
- package/dist/paperclip-mcp.d.ts.map +0 -1
- package/dist/paperclip-mcp.js.map +0 -1
- package/dist/paperclip-mcp.test.d.ts +0 -2
- package/dist/paperclip-mcp.test.d.ts.map +0 -1
- package/dist/paperclip-mcp.test.js.map +0 -1
- package/dist/paperclip-runner-permissions.d.ts.map +0 -1
- package/dist/paperclip-runner-permissions.js.map +0 -1
- package/dist/paperclip-runner-permissions.test.d.ts +0 -2
- package/dist/paperclip-runner-permissions.test.d.ts.map +0 -1
- package/dist/paperclip-runner-permissions.test.js.map +0 -1
- package/node_modules/sisteransi/src/index.js +0 -58
- package/node_modules/sisteransi/src/sisteransi.d.ts +0 -35
|
@@ -429,13 +429,13 @@ interface OptionLike {
|
|
|
429
429
|
disabled?: boolean;
|
|
430
430
|
}
|
|
431
431
|
interface MultiSelectOptions<T extends OptionLike> extends PromptOptions<T['value'][], MultiSelectPrompt<T>> {
|
|
432
|
-
options: T[];
|
|
433
|
-
initialValues?: T['value'][];
|
|
432
|
+
options: readonly T[];
|
|
433
|
+
initialValues?: readonly T['value'][];
|
|
434
434
|
required?: boolean;
|
|
435
435
|
cursorAt?: T['value'];
|
|
436
436
|
}
|
|
437
437
|
declare class MultiSelectPrompt<T extends OptionLike> extends Prompt<T['value'][]> {
|
|
438
|
-
options: T[];
|
|
438
|
+
options: readonly T[];
|
|
439
439
|
cursor: number;
|
|
440
440
|
private get _value();
|
|
441
441
|
private get _enabledOptions();
|
|
@@ -477,12 +477,14 @@ declare class SelectPrompt<T extends {
|
|
|
477
477
|
|
|
478
478
|
interface SelectKeyOptions<T extends {
|
|
479
479
|
value: string;
|
|
480
|
+
disabled?: boolean;
|
|
480
481
|
}> extends PromptOptions<T['value'], SelectKeyPrompt<T>> {
|
|
481
482
|
options: T[];
|
|
482
483
|
caseSensitive?: boolean;
|
|
483
484
|
}
|
|
484
485
|
declare class SelectKeyPrompt<T extends {
|
|
485
486
|
value: string;
|
|
487
|
+
disabled?: boolean;
|
|
486
488
|
}> extends Prompt<T['value']> {
|
|
487
489
|
options: T[];
|
|
488
490
|
cursor: number;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { styleText } from 'node:util';
|
|
2
2
|
import { stdout, stdin } from 'node:process';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as f$1 from 'node:readline';
|
|
4
|
+
import f__default from 'node:readline';
|
|
5
5
|
import { wrapAnsi } from 'fast-wrap-ansi';
|
|
6
6
|
import { cursor, erase } from 'sisteransi';
|
|
7
7
|
import { ReadStream } from 'node:tty';
|
|
8
|
+
import x from 'fast-string-width';
|
|
8
9
|
|
|
9
|
-
function findCursor(
|
|
10
|
+
function findCursor(o, s, l) {
|
|
10
11
|
if (!l.some((r) => !r.disabled))
|
|
11
|
-
return
|
|
12
|
-
const t =
|
|
13
|
-
return l[e]?.disabled ? findCursor(e,
|
|
12
|
+
return o;
|
|
13
|
+
const t = o + s, n = Math.max(l.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;
|
|
14
|
+
return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
|
|
14
15
|
}
|
|
15
|
-
function findTextCursor(
|
|
16
|
+
function findTextCursor(o, s, l, i) {
|
|
16
17
|
const t = i.split(`
|
|
17
18
|
`);
|
|
18
|
-
let n = 0, e =
|
|
19
|
+
let n = 0, e = o;
|
|
19
20
|
for (const r of t) {
|
|
20
21
|
if (e <= r.length)
|
|
21
22
|
break;
|
|
22
23
|
e -= r.length + 1, n++;
|
|
23
24
|
}
|
|
24
|
-
for (n = Math.max(0, Math.min(t.length - 1, n + l)), e = Math.min(e, t[n].length) +
|
|
25
|
+
for (n = Math.max(0, Math.min(t.length - 1, n + l)), e = Math.min(e, t[n].length) + s; e < 0 && n > 0; )
|
|
25
26
|
n--, e += t[n].length + 1;
|
|
26
27
|
for (; e > t[n].length && n < t.length - 1; )
|
|
27
28
|
e -= t[n].length + 1, n++;
|
|
@@ -138,23 +139,23 @@ function block({
|
|
|
138
139
|
overwrite: o = true,
|
|
139
140
|
hideCursor: n = true
|
|
140
141
|
} = {}) {
|
|
141
|
-
const s =
|
|
142
|
+
const s = f$1.createInterface({
|
|
142
143
|
input: e,
|
|
143
144
|
output: r,
|
|
144
145
|
prompt: "",
|
|
145
146
|
tabSize: 1
|
|
146
147
|
});
|
|
147
|
-
|
|
148
|
-
const t = (
|
|
149
|
-
const
|
|
150
|
-
if (isActionKey([
|
|
148
|
+
f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
149
|
+
const t = (l, { name: i, sequence: p }) => {
|
|
150
|
+
const w = String(l);
|
|
151
|
+
if (isActionKey([w, i, p], "cancel")) {
|
|
151
152
|
n && r.write(cursor.show), process.exit(0);
|
|
152
153
|
return;
|
|
153
154
|
}
|
|
154
155
|
if (!o) return;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
const c = i === "return" ? 0 : -1, a = i === "return" ? -1 : 0;
|
|
157
|
+
f$1.moveCursor(r, c, a, () => {
|
|
158
|
+
f$1.clearLine(r, 1, () => {
|
|
158
159
|
e.once("keypress", t);
|
|
159
160
|
});
|
|
160
161
|
});
|
|
@@ -165,14 +166,14 @@ function block({
|
|
|
165
166
|
}
|
|
166
167
|
const getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80, getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
167
168
|
function wrapTextWithPrefix(e, r, o, n = o, s = o, t) {
|
|
168
|
-
const
|
|
169
|
-
return wrapAnsi(r,
|
|
169
|
+
const l = getColumns(e ?? stdout), i = x(o);
|
|
170
|
+
return wrapAnsi(r, l - i, {
|
|
170
171
|
hard: true,
|
|
171
172
|
trim: false
|
|
172
173
|
}).split(`
|
|
173
|
-
`).map((c,
|
|
174
|
-
const
|
|
175
|
-
return
|
|
174
|
+
`).map((c, a, g) => {
|
|
175
|
+
const m = t ? t(c, a) : c;
|
|
176
|
+
return a === 0 ? `${n}${m}` : a === g.length - 1 ? `${s}${m}` : `${o}${m}`;
|
|
176
177
|
}).join(`
|
|
177
178
|
`);
|
|
178
179
|
}
|
|
@@ -185,7 +186,7 @@ function runValidation(e, a) {
|
|
|
185
186
|
return e(a);
|
|
186
187
|
}
|
|
187
188
|
|
|
188
|
-
class
|
|
189
|
+
let C$1 = class C {
|
|
189
190
|
input;
|
|
190
191
|
output;
|
|
191
192
|
_abortSignal;
|
|
@@ -267,7 +268,7 @@ class y {
|
|
|
267
268
|
{ once: true }
|
|
268
269
|
);
|
|
269
270
|
}
|
|
270
|
-
this.rl =
|
|
271
|
+
this.rl = f__default.createInterface({
|
|
271
272
|
input: this.input,
|
|
272
273
|
tabSize: 2,
|
|
273
274
|
prompt: "",
|
|
@@ -313,12 +314,12 @@ class y {
|
|
|
313
314
|
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
314
315
|
}
|
|
315
316
|
restoreCursor() {
|
|
316
|
-
const t = wrapAnsi(this._prevFrame,
|
|
317
|
+
const t = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
|
|
317
318
|
`).length - 1;
|
|
318
319
|
this.output.write(cursor.move(-999, t * -1));
|
|
319
320
|
}
|
|
320
321
|
render() {
|
|
321
|
-
const t = wrapAnsi(this._render(this) ?? "",
|
|
322
|
+
const t = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
|
|
322
323
|
hard: true,
|
|
323
324
|
trim: false
|
|
324
325
|
});
|
|
@@ -348,9 +349,9 @@ class y {
|
|
|
348
349
|
h > 0 && this.output.write(cursor.move(0, h));
|
|
349
350
|
}
|
|
350
351
|
this.output.write(erase.down());
|
|
351
|
-
const
|
|
352
|
+
const m = t.split(`
|
|
352
353
|
`).slice(n);
|
|
353
|
-
this.output.write(
|
|
354
|
+
this.output.write(m.join(`
|
|
354
355
|
`)), this._prevFrame = t;
|
|
355
356
|
return;
|
|
356
357
|
}
|
|
@@ -360,7 +361,7 @@ class y {
|
|
|
360
361
|
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
|
-
}
|
|
364
|
+
};
|
|
364
365
|
|
|
365
366
|
function p$1(l, e) {
|
|
366
367
|
if (l === void 0 || e.length === 0)
|
|
@@ -375,7 +376,7 @@ function g(l, e) {
|
|
|
375
376
|
if (e)
|
|
376
377
|
return l ? e : e[0];
|
|
377
378
|
}
|
|
378
|
-
let T$1 = class T extends
|
|
379
|
+
let T$1 = class T extends C$1 {
|
|
379
380
|
filteredOptions;
|
|
380
381
|
multiple;
|
|
381
382
|
isNavigating = false;
|
|
@@ -450,7 +451,7 @@ let T$1 = class T extends y {
|
|
|
450
451
|
}
|
|
451
452
|
};
|
|
452
453
|
|
|
453
|
-
class r extends
|
|
454
|
+
class r extends C$1 {
|
|
454
455
|
get cursor() {
|
|
455
456
|
return this.value ? 0 : 1;
|
|
456
457
|
}
|
|
@@ -497,7 +498,7 @@ function f(r) {
|
|
|
497
498
|
day: p(r.day)
|
|
498
499
|
};
|
|
499
500
|
}
|
|
500
|
-
function c(r, t) {
|
|
501
|
+
function c$1(r, t) {
|
|
501
502
|
return new Date(r || 2001, t || 1, 0).getDate();
|
|
502
503
|
}
|
|
503
504
|
function b(r) {
|
|
@@ -526,10 +527,10 @@ function T(r, t, i, s) {
|
|
|
526
527
|
max: e && t.year === e.year ? e.month : 12
|
|
527
528
|
} : {
|
|
528
529
|
min: n && t.year === n.year && t.month === n.month ? n.day : 1,
|
|
529
|
-
max: e && t.year === e.year && t.month === e.month ? e.day : c(t.year, t.month)
|
|
530
|
+
max: e && t.year === e.year && t.month === e.month ? e.day : c$1(t.year, t.month)
|
|
530
531
|
};
|
|
531
532
|
}
|
|
532
|
-
class U extends
|
|
533
|
+
class U extends C$1 {
|
|
533
534
|
#i;
|
|
534
535
|
#o;
|
|
535
536
|
#t;
|
|
@@ -663,7 +664,7 @@ class U extends y {
|
|
|
663
664
|
this.inlineError = "", this.#t[e.type] = l;
|
|
664
665
|
const y = l.includes("_") ? void 0 : b(this.#t);
|
|
665
666
|
if (y) {
|
|
666
|
-
const { year: h, month: d } = y, g = c(h, d);
|
|
667
|
+
const { year: h, month: d } = y, g = c$1(h, d);
|
|
667
668
|
this.#t = {
|
|
668
669
|
year: String(Math.max(0, Math.min(9999, h))).padStart(4, "0"),
|
|
669
670
|
month: String(Math.max(1, Math.min(12, d))).padStart(2, "0"),
|
|
@@ -685,7 +686,7 @@ class U extends y {
|
|
|
685
686
|
#p(t) {
|
|
686
687
|
const { year: i, month: s, day: n } = f(this.#t);
|
|
687
688
|
if (i && s && n) {
|
|
688
|
-
const e = c(i, s);
|
|
689
|
+
const e = c$1(i, s);
|
|
689
690
|
this.#t = {
|
|
690
691
|
...this.#t,
|
|
691
692
|
day: String(Math.min(n, e)).padStart(2, "0")
|
|
@@ -695,53 +696,55 @@ class U extends y {
|
|
|
695
696
|
}
|
|
696
697
|
}
|
|
697
698
|
|
|
698
|
-
let u$
|
|
699
|
+
let u$1 = class u extends C$1 {
|
|
699
700
|
options;
|
|
700
701
|
cursor = 0;
|
|
701
|
-
#
|
|
702
|
+
#e;
|
|
702
703
|
getGroupItems(t) {
|
|
703
|
-
return this.options.filter((
|
|
704
|
+
return this.options.filter((i) => i.group === t);
|
|
704
705
|
}
|
|
705
706
|
isGroupSelected(t) {
|
|
706
|
-
const
|
|
707
|
-
return e === void 0 ? false :
|
|
707
|
+
const i = this.getGroupItems(t), e = this.value;
|
|
708
|
+
return e === void 0 ? false : i.every((s) => e.includes(s.value));
|
|
708
709
|
}
|
|
709
710
|
toggleValue() {
|
|
710
711
|
const t = this.options[this.cursor];
|
|
711
712
|
if (t !== void 0)
|
|
712
713
|
if (this.value === void 0 && (this.value = []), t.group === true) {
|
|
713
|
-
const
|
|
714
|
-
this.isGroupSelected(
|
|
715
|
-
(s) => e.findIndex((
|
|
714
|
+
const i = t.value, e = this.getGroupItems(i);
|
|
715
|
+
this.isGroupSelected(i) ? this.value = this.value.filter(
|
|
716
|
+
(s) => e.findIndex((r) => r.value === s) === -1
|
|
716
717
|
) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
717
718
|
} else {
|
|
718
|
-
const
|
|
719
|
-
this.value =
|
|
719
|
+
const i = this.value.includes(t.value);
|
|
720
|
+
this.value = i ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
|
|
720
721
|
}
|
|
721
722
|
}
|
|
722
723
|
constructor(t) {
|
|
723
724
|
super(t, false);
|
|
724
|
-
const { options:
|
|
725
|
-
this.#
|
|
725
|
+
const { options: i } = t;
|
|
726
|
+
this.#e = t.selectableGroups !== false, this.options = Object.entries(i).flatMap(([e, s]) => [
|
|
726
727
|
{ value: e, group: true, label: e },
|
|
727
|
-
...s.map((
|
|
728
|
+
...s.map((r) => ({ ...r, group: e }))
|
|
728
729
|
]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(
|
|
729
730
|
this.options.findIndex(({ value: e }) => e === t.cursorAt),
|
|
730
|
-
this.#
|
|
731
|
-
), this.on("
|
|
731
|
+
this.#e ? 0 : 1
|
|
732
|
+
), this.on("key", (e, s) => {
|
|
733
|
+
s.name === void 0 && e === "\u3000" && this.toggleValue();
|
|
734
|
+
}), this.on("cursor", (e) => {
|
|
732
735
|
switch (e) {
|
|
733
736
|
case "left":
|
|
734
737
|
case "up": {
|
|
735
738
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
736
739
|
const s = this.options[this.cursor]?.group === true;
|
|
737
|
-
!this.#
|
|
740
|
+
!this.#e && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
738
741
|
break;
|
|
739
742
|
}
|
|
740
743
|
case "down":
|
|
741
744
|
case "right": {
|
|
742
745
|
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
743
746
|
const s = this.options[this.cursor]?.group === true;
|
|
744
|
-
!this.#
|
|
747
|
+
!this.#e && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
745
748
|
break;
|
|
746
749
|
}
|
|
747
750
|
case "space":
|
|
@@ -753,7 +756,7 @@ let u$2 = class u extends y {
|
|
|
753
756
|
};
|
|
754
757
|
|
|
755
758
|
const o = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
|
|
756
|
-
class h extends
|
|
759
|
+
class h extends C$1 {
|
|
757
760
|
#t = false;
|
|
758
761
|
#s;
|
|
759
762
|
focused = "editor";
|
|
@@ -848,7 +851,7 @@ ${i}` : `${s}${styleText("inverse", r)}${i}`;
|
|
|
848
851
|
}
|
|
849
852
|
}
|
|
850
853
|
|
|
851
|
-
class a extends
|
|
854
|
+
class a extends C$1 {
|
|
852
855
|
options;
|
|
853
856
|
cursor = 0;
|
|
854
857
|
get _value() {
|
|
@@ -879,8 +882,8 @@ class a extends y {
|
|
|
879
882
|
this.options.findIndex(({ value: t }) => t === e.cursorAt),
|
|
880
883
|
0
|
|
881
884
|
);
|
|
882
|
-
this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t,
|
|
883
|
-
|
|
885
|
+
this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t, s) => {
|
|
886
|
+
s.name === "a" && this.toggleAll(), s.name === "i" && this.toggleInvert(), s.name === void 0 && t === "\u3000" && this.toggleValue();
|
|
884
887
|
}), this.on("cursor", (t) => {
|
|
885
888
|
switch (t) {
|
|
886
889
|
case "left":
|
|
@@ -899,7 +902,7 @@ class a extends y {
|
|
|
899
902
|
}
|
|
900
903
|
}
|
|
901
904
|
|
|
902
|
-
|
|
905
|
+
class u extends C$1 {
|
|
903
906
|
_mask = "\u2022";
|
|
904
907
|
get cursor() {
|
|
905
908
|
return this._cursor;
|
|
@@ -926,9 +929,9 @@ let u$1 = class u extends y {
|
|
|
926
929
|
this.value === void 0 && (this.value = "");
|
|
927
930
|
});
|
|
928
931
|
}
|
|
929
|
-
}
|
|
932
|
+
}
|
|
930
933
|
|
|
931
|
-
let n$1 = class n extends
|
|
934
|
+
let n$1 = class n extends C$1 {
|
|
932
935
|
options;
|
|
933
936
|
cursor = 0;
|
|
934
937
|
get _selectedValue() {
|
|
@@ -957,25 +960,25 @@ let n$1 = class n extends y {
|
|
|
957
960
|
}
|
|
958
961
|
};
|
|
959
962
|
|
|
960
|
-
class
|
|
963
|
+
class c extends C$1 {
|
|
961
964
|
options;
|
|
962
965
|
cursor = 0;
|
|
963
966
|
constructor(t) {
|
|
964
967
|
super(t, false), this.options = t.options;
|
|
965
|
-
const s = t.caseSensitive === true, i = this.options.map(({ value: [e] }) => s ? e : e?.toLowerCase());
|
|
966
|
-
this.cursor =
|
|
968
|
+
const s = t.caseSensitive === true, i = this.options.map(({ value: [e] }) => s ? e : e?.toLowerCase()), n = Math.max(i.indexOf(t.initialValue), 0);
|
|
969
|
+
this.cursor = this.options[n]?.disabled ? 0 : n, this.on("key", (e) => {
|
|
967
970
|
if (!e)
|
|
968
971
|
return;
|
|
969
972
|
const o = s ? e : e.toLowerCase();
|
|
970
973
|
if (!i.includes(o))
|
|
971
974
|
return;
|
|
972
|
-
const
|
|
973
|
-
|
|
975
|
+
const r = this.options.find(({ value: [a], disabled: u }) => u ? false : s ? a === o : a?.toLowerCase() === o);
|
|
976
|
+
r && (this.value = r.value, this.state = "submit", this.emit("submit"));
|
|
974
977
|
});
|
|
975
978
|
}
|
|
976
979
|
}
|
|
977
980
|
|
|
978
|
-
class n extends
|
|
981
|
+
class n extends C$1 {
|
|
979
982
|
get userInputWithCursor() {
|
|
980
983
|
if (this.state === "submit")
|
|
981
984
|
return this.userInput;
|
|
@@ -1000,4 +1003,4 @@ class n extends y {
|
|
|
1000
1003
|
}
|
|
1001
1004
|
}
|
|
1002
1005
|
|
|
1003
|
-
export { T$1 as AutocompletePrompt, CANCEL_SYMBOL, r as ConfirmPrompt, U as DatePrompt, u$
|
|
1006
|
+
export { T$1 as AutocompletePrompt, CANCEL_SYMBOL, r as ConfirmPrompt, U as DatePrompt, u$1 as GroupMultiSelectPrompt, h as MultiLinePrompt, a as MultiSelectPrompt, u as PasswordPrompt, C$1 as Prompt, c as SelectKeyPrompt, n$1 as SelectPrompt, n as TextPrompt, block, getColumns, getRows, isAccessible, isCancel, runValidation, settings, updateSettings, wrapTextWithPrefix };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clack/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -49,8 +49,9 @@
|
|
|
49
49
|
"node": ">= 20.12.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
+
"fast-string-width": "^3.0.2",
|
|
52
53
|
"fast-wrap-ansi": "^0.2.0",
|
|
53
|
-
"sisteransi": "^
|
|
54
|
+
"sisteransi": "^2.0.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"arktype": "^2.2.0",
|
|
@@ -39,8 +39,9 @@ interface CommonOptions {
|
|
|
39
39
|
output?: Writable;
|
|
40
40
|
signal?: AbortSignal;
|
|
41
41
|
withGuide?: boolean;
|
|
42
|
+
accessible?: boolean;
|
|
42
43
|
}
|
|
43
|
-
declare function formatInstructionFooter(instructions: string[], hasGuide: boolean): string[];
|
|
44
|
+
declare function formatInstructionFooter(output: Writable | undefined, instructions: string[], hasGuide: boolean): string[];
|
|
44
45
|
|
|
45
46
|
declare const SELECT_INSTRUCTIONS: string[];
|
|
46
47
|
type Primitive = Readonly<string | boolean | number>;
|
|
@@ -537,7 +538,7 @@ interface LimitOptionsParams<TOption> extends CommonOptions {
|
|
|
537
538
|
/**
|
|
538
539
|
* The list of options to display.
|
|
539
540
|
*/
|
|
540
|
-
options: TOption[];
|
|
541
|
+
options: readonly TOption[];
|
|
541
542
|
/**
|
|
542
543
|
* The index of the currently active/selected option.
|
|
543
544
|
*/
|
|
@@ -741,8 +742,8 @@ declare const multiline: (opts: MultiLineOptions) => Promise<string | typeof CAN
|
|
|
741
742
|
declare const MULTISELECT_INSTRUCTIONS: string[];
|
|
742
743
|
interface MultiSelectOptions<Value> extends CommonOptions {
|
|
743
744
|
message: string;
|
|
744
|
-
options: Option<Value>[];
|
|
745
|
-
initialValues?: Value[];
|
|
745
|
+
options: readonly Option<Value>[];
|
|
746
|
+
initialValues?: readonly Value[];
|
|
746
747
|
maxItems?: number;
|
|
747
748
|
required?: boolean;
|
|
748
749
|
cursorAt?: Value;
|