@trawlme/cli 3.4.0 → 3.4.2
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/lib/pinch.d.ts +4 -10
- package/dist/lib/pinch.js +21 -26
- package/dist/lib/pinchAnimation.d.ts +6 -3
- package/dist/lib/pinchAnimation.js +17 -7
- package/package.json +1 -1
package/dist/lib/pinch.d.ts
CHANGED
|
@@ -42,20 +42,14 @@ export declare function renderPinch(state: PinchState, frame?: number): string;
|
|
|
42
42
|
/**
|
|
43
43
|
* #131 — the ART lines only (no caption), optionally COMPACT: trailing and
|
|
44
44
|
* leading fully-transparent grid rows are dropped so Pinch takes fewer
|
|
45
|
-
* terminal lines (some grids carry an all-'.' padding row).
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* terminal lines (some grids carry an all-'.' padding row). `frame` is passed
|
|
46
|
+
* through to `gridForState` — only `working` reacts to it (the cyan antenna
|
|
47
|
+
* blip toggles), so the loop can pulse the tips while the body stays still.
|
|
48
48
|
*/
|
|
49
49
|
export declare function renderPinchArt(state: PinchState, opts?: {
|
|
50
50
|
compact?: boolean;
|
|
51
|
+
frame?: number;
|
|
51
52
|
}): string;
|
|
52
|
-
/**
|
|
53
|
-
* #131 — frame sequence for the "working" animation shown during long waits
|
|
54
|
-
* (the `create` wizard, `--watch`). The claws pump up (working → wave →
|
|
55
|
-
* celebrating) and back down, reading as Pinch busily working. No new art —
|
|
56
|
-
* an order over the canonical state grids.
|
|
57
|
-
*/
|
|
58
|
-
export declare const WORKING_FRAMES: readonly PinchState[];
|
|
59
53
|
/**
|
|
60
54
|
* True when it's safe to print Pinch art: a real color-capable interactive
|
|
61
55
|
* terminal. False under NO_COLOR (https://no-color.org — presence, not
|
package/dist/lib/pinch.js
CHANGED
|
@@ -60,10 +60,12 @@ export const PINCH_STATES = [
|
|
|
60
60
|
* row 1 head top (+ claw at col 0/8 when RAISED)
|
|
61
61
|
* row 2 eyes (+ claw at col 0/8 when RAISED)
|
|
62
62
|
* row 3 head mid
|
|
63
|
-
* row 4 mouth + blush (+ claw at col 0/8 when RESTING)
|
|
64
|
-
* row 5 head bottom
|
|
63
|
+
* row 4 mouth corners + blush (+ claw at col 0/8 when RESTING)
|
|
64
|
+
* row 5 head bottom + mouth center (+ claw at col 0/8 when RESTING)
|
|
65
65
|
* Claws are the 1-wide 2-tall O blocks at cols 0/8. Eyes: left = W+K at
|
|
66
|
-
* cols 2-3, right = K+W at cols 5-6 (pupils inward).
|
|
66
|
+
* cols 2-3, right = K+W at cols 5-6 (pupils inward). The smile is a U (like
|
|
67
|
+
* the source 3D / AVGRID): the mouth CORNERS sit on row 4 and the CENTER
|
|
68
|
+
* dips to row 5 — never a flat single-row bar (#137).
|
|
67
69
|
*/
|
|
68
70
|
const GRIDS = {
|
|
69
71
|
// calm resting face, both claws down, normal smile.
|
|
@@ -72,8 +74,8 @@ const GRIDS = {
|
|
|
72
74
|
'.BBBBBBB.',
|
|
73
75
|
'.BWKBKWB.',
|
|
74
76
|
'.BBBBBBB.',
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
+
'OBPKBKPBO',
|
|
78
|
+
'OBBBKBBBO',
|
|
77
79
|
],
|
|
78
80
|
// idle pose + the cyan thinking-blip on the antenna tips (frame-toggled in
|
|
79
81
|
// `gridForState`) — the only animated static state.
|
|
@@ -82,8 +84,8 @@ const GRIDS = {
|
|
|
82
84
|
'.BBBBBBB.',
|
|
83
85
|
'.BWKBKWB.',
|
|
84
86
|
'.BBBBBBB.',
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
+
'OBPKBKPBO',
|
|
88
|
+
'OBBBKBBBO',
|
|
87
89
|
],
|
|
88
90
|
// both claws raised (rows 1-2) + a big open mouth.
|
|
89
91
|
celebrating: [
|
|
@@ -91,8 +93,8 @@ const GRIDS = {
|
|
|
91
93
|
'OBBBBBBBO',
|
|
92
94
|
'OBWKBKWBO',
|
|
93
95
|
'.BBBBBBB.',
|
|
94
|
-
'.
|
|
95
|
-
'.
|
|
96
|
+
'.BKBBBKB.',
|
|
97
|
+
'.BBKKKBB.',
|
|
96
98
|
],
|
|
97
99
|
// right claw raised (rows 1-2) + a thumb pixel poking up above it (row 0,
|
|
98
100
|
// col 8); left claw resting.
|
|
@@ -101,8 +103,8 @@ const GRIDS = {
|
|
|
101
103
|
'.BBBBBBBO',
|
|
102
104
|
'.BWKBKWBO',
|
|
103
105
|
'.BBBBBBB.',
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
+
'OBPKBKPB.',
|
|
107
|
+
'OBBBKBBB.',
|
|
106
108
|
],
|
|
107
109
|
// antennae drooped + spread, flat mouth (no K), claws resting. A '?' is
|
|
108
110
|
// appended beside the eye line by `renderPinch`.
|
|
@@ -120,8 +122,8 @@ const GRIDS = {
|
|
|
120
122
|
'.BBBBBBBO',
|
|
121
123
|
'.BWKBKWBO',
|
|
122
124
|
'.BBBBBBB.',
|
|
123
|
-
'
|
|
124
|
-
'
|
|
125
|
+
'OBPKBKPB.',
|
|
126
|
+
'OBBBKBBB.',
|
|
125
127
|
],
|
|
126
128
|
// pink heart-eyes (P replaces the W+K pupils), claws resting, normal smile.
|
|
127
129
|
heart: [
|
|
@@ -129,8 +131,8 @@ const GRIDS = {
|
|
|
129
131
|
'.BBBBBBB.',
|
|
130
132
|
'.BPPBPPB.',
|
|
131
133
|
'.BBBBBBB.',
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
+
'OBPKBKPBO',
|
|
135
|
+
'OBBBKBBBO',
|
|
134
136
|
],
|
|
135
137
|
// closed eyes (flat K line, no white), antennae drooped + spread, flat
|
|
136
138
|
// mouth, claws resting — like confused but eyes shut and no '?'.
|
|
@@ -245,12 +247,12 @@ export function renderPinch(state, frame = 0) {
|
|
|
245
247
|
/**
|
|
246
248
|
* #131 — the ART lines only (no caption), optionally COMPACT: trailing and
|
|
247
249
|
* leading fully-transparent grid rows are dropped so Pinch takes fewer
|
|
248
|
-
* terminal lines (some grids carry an all-'.' padding row).
|
|
249
|
-
*
|
|
250
|
-
*
|
|
250
|
+
* terminal lines (some grids carry an all-'.' padding row). `frame` is passed
|
|
251
|
+
* through to `gridForState` — only `working` reacts to it (the cyan antenna
|
|
252
|
+
* blip toggles), so the loop can pulse the tips while the body stays still.
|
|
251
253
|
*/
|
|
252
254
|
export function renderPinchArt(state, opts = {}) {
|
|
253
|
-
let grid = gridForState(state, 0);
|
|
255
|
+
let grid = gridForState(state, opts.frame ?? 0);
|
|
254
256
|
if (opts.compact) {
|
|
255
257
|
const blank = (row) => [...row].every((c) => c === TRANSPARENT);
|
|
256
258
|
let start = 0;
|
|
@@ -266,13 +268,6 @@ export function renderPinchArt(state, opts = {}) {
|
|
|
266
268
|
lines[1] = `${lines[1]} \x1b[1m?${RESET}`;
|
|
267
269
|
return lines.join('\n');
|
|
268
270
|
}
|
|
269
|
-
/**
|
|
270
|
-
* #131 — frame sequence for the "working" animation shown during long waits
|
|
271
|
-
* (the `create` wizard, `--watch`). The claws pump up (working → wave →
|
|
272
|
-
* celebrating) and back down, reading as Pinch busily working. No new art —
|
|
273
|
-
* an order over the canonical state grids.
|
|
274
|
-
*/
|
|
275
|
-
export const WORKING_FRAMES = ['working', 'wave', 'celebrating', 'wave'];
|
|
276
271
|
/**
|
|
277
272
|
* True when it's safe to print Pinch art: a real color-capable interactive
|
|
278
273
|
* terminal. False under NO_COLOR (https://no-color.org — presence, not
|
|
@@ -4,9 +4,12 @@ export interface PinchAnimation {
|
|
|
4
4
|
stop(): void;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* #131 —
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* #131 / #139 — show Pinch IN PLACE on STDERR while a long operation runs (the
|
|
8
|
+
* `create` wizard, `--watch`). Pinch stays a STILL `working` sprite; the ONLY
|
|
9
|
+
* animation is the cyan antenna-tip blip pulsing on/off every {@link FRAME_MS}
|
|
10
|
+
* (frame 0 = cyan, frame 1 = orange). The body — mouth, claws, eyes — never
|
|
11
|
+
* moves (the old loop cycled whole poses, which flickered "in every
|
|
12
|
+
* direction"). Redrawn via ANSI cursor moves; `stop()` clears the block.
|
|
10
13
|
*
|
|
11
14
|
* Contract: the CALLER must have already checked `pinchEnabled()` (TTY /
|
|
12
15
|
* !NO_COLOR) and that the command is NOT `--json` — this writes only to
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { renderPinchArt
|
|
3
|
-
/** Frame cadence —
|
|
4
|
-
|
|
2
|
+
import { renderPinchArt } from './pinch.js';
|
|
3
|
+
/** Frame cadence — a calm, ~2/second pulse. The only thing that moves is the
|
|
4
|
+
* cyan antenna blip, so this is intentionally slow: a fast rate on a 2-pixel
|
|
5
|
+
* color change reads as a nervous flicker. */
|
|
6
|
+
const FRAME_MS = 600;
|
|
5
7
|
/**
|
|
6
|
-
* #131 —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* #131 / #139 — show Pinch IN PLACE on STDERR while a long operation runs (the
|
|
9
|
+
* `create` wizard, `--watch`). Pinch stays a STILL `working` sprite; the ONLY
|
|
10
|
+
* animation is the cyan antenna-tip blip pulsing on/off every {@link FRAME_MS}
|
|
11
|
+
* (frame 0 = cyan, frame 1 = orange). The body — mouth, claws, eyes — never
|
|
12
|
+
* moves (the old loop cycled whole poses, which flickered "in every
|
|
13
|
+
* direction"). Redrawn via ANSI cursor moves; `stop()` clears the block.
|
|
9
14
|
*
|
|
10
15
|
* Contract: the CALLER must have already checked `pinchEnabled()` (TTY /
|
|
11
16
|
* !NO_COLOR) and that the command is NOT `--json` — this writes only to
|
|
@@ -14,7 +19,12 @@ const FRAME_MS = 380;
|
|
|
14
19
|
* own.
|
|
15
20
|
*/
|
|
16
21
|
export function startPinchAnimation(statusText) {
|
|
17
|
-
|
|
22
|
+
// Two frames of the SAME `working` sprite — identical geometry, the antenna
|
|
23
|
+
// tips just toggle cyan↔orange. Nothing else changes between frames.
|
|
24
|
+
const frames = [
|
|
25
|
+
renderPinchArt('working', { compact: true, frame: 0 }), // cyan tips
|
|
26
|
+
renderPinchArt('working', { compact: true, frame: 1 }), // orange tips
|
|
27
|
+
];
|
|
18
28
|
const artHeight = frames[0].split('\n').length;
|
|
19
29
|
const totalHeight = artHeight + 1; // + the status line below the art
|
|
20
30
|
const out = process.stderr;
|