@michaelrwalker/stagehand 0.1.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.
@@ -0,0 +1,68 @@
1
+ import { bold, dim, fg, isColorEnabled } from "./ansi.js";
2
+ const unicodeCapable = (() => {
3
+ const env = process.env;
4
+ if (process.platform !== "win32") {
5
+ const locale = env.LC_ALL ?? env.LC_CTYPE ?? env.LANG ?? "";
6
+ return locale === "" || /UTF-?8$/i.test(locale) || Boolean(env.TERM_PROGRAM);
7
+ }
8
+ return Boolean(env.WT_SESSION) || env.TERM_PROGRAM === "vscode";
9
+ })();
10
+ export const symbols = unicodeCapable
11
+ ? {
12
+ success: "✔",
13
+ failure: "✖",
14
+ pending: "○",
15
+ skipped: "⊘",
16
+ rolledBack: "↺",
17
+ warning: "▲",
18
+ info: "•",
19
+ arrow: "›",
20
+ brand: "▌",
21
+ rule: "─",
22
+ barFull: "█",
23
+ barEmpty: "░",
24
+ barLeft: "▕",
25
+ barRight: "▏",
26
+ spinner: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
27
+ }
28
+ : {
29
+ success: "√",
30
+ failure: "x",
31
+ pending: "-",
32
+ skipped: "~",
33
+ rolledBack: "<",
34
+ warning: "!",
35
+ info: "*",
36
+ arrow: ">",
37
+ brand: "|",
38
+ rule: "-",
39
+ barFull: "#",
40
+ barEmpty: ".",
41
+ barLeft: "[",
42
+ barRight: "]",
43
+ spinner: ["|", "/", "-", "\\"],
44
+ };
45
+ export const palette = {
46
+ accent: fg(141),
47
+ success: fg(78),
48
+ warning: fg(221),
49
+ error: fg(203),
50
+ info: fg(117),
51
+ muted: fg(245),
52
+ faint: fg(240),
53
+ bold,
54
+ dim,
55
+ };
56
+ export function spinnerFrame(tick) {
57
+ const frames = symbols.spinner;
58
+ return frames[tick % frames.length] ?? frames[0] ?? "-";
59
+ }
60
+ /** Total render width, clamped so wide terminals stay readable. */
61
+ export function frameWidth() {
62
+ const columns = process.stdout.columns ?? 80;
63
+ return Math.max(40, Math.min(columns - 1, 92));
64
+ }
65
+ export function supportsAnimation() {
66
+ return Boolean(process.stdout.isTTY) && isColorEnabled();
67
+ }
68
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QAC5D,OAAO,MAAM,KAAK,EAAE,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,YAAY,KAAK,QAAQ,CAAC;AAClE,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc;IACnC,CAAC,CAAC;QACE,OAAO,EAAE,GAAG;QACZ,OAAO,EAAE,GAAG;QACZ,OAAO,EAAE,GAAG;QACZ,OAAO,EAAE,GAAG;QACZ,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,GAAG;QACZ,IAAI,EAAE,GAAG;QACT,KAAK,EAAE,GAAG;QACV,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE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AM,CAAC,OAAO,IAAI,EAAE,CAAC;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,cAAc,EAAE,CAAC;AAC3D,CAAC"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@michaelrwalker/stagehand",
3
+ "version": "0.1.0",
4
+ "description": "Fully typesafe saga-style script framework with modern terminal visuals",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "engines": {
16
+ "node": ">=20"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.build.json",
20
+ "typecheck": "tsc && npm run build && tsc -p examples && tsc -p test && tsc -p scripts",
21
+ "example": "npm run build && node --experimental-strip-types examples/deploy.ts",
22
+ "example:fail": "npm run build && node --experimental-strip-types examples/deploy.ts --fail",
23
+ "test": "npm run build && node --experimental-strip-types --test test/*.test.ts",
24
+ "release": "npm run build && node --experimental-strip-types scripts/release.ts"
25
+ },
26
+ "keywords": [
27
+ "saga",
28
+ "script",
29
+ "cli",
30
+ "typescript",
31
+ "rollback",
32
+ "compensation"
33
+ ],
34
+ "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/miaklwalker/stagehand"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^22.10.0",
41
+ "typescript": "^5.7.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "author": "Michael Walker"
47
+ }