@bubblegum-ai/node 0.0.6-alpha.15 → 0.0.6-alpha.16

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,52 @@
1
+ /**
2
+ * Modern, dependency-free console output for Bubblegum runs.
3
+ *
4
+ * The engine returns a {@link StepResult} for every act/verify; this module
5
+ * turns that into a clean, colorized one-line status you can print from your
6
+ * test helper, plus a {@link RunConsole} that tracks a run and prints an
7
+ * enterprise-style header/summary. No external libraries — ANSI only, and it
8
+ * auto-disables color for non-TTY / `NO_COLOR` so CI logs stay clean.
9
+ *
10
+ * ```ts
11
+ * import { RunConsole } from "@bubblegum-ai/node";
12
+ * const out = new RunConsole("Workout Creation");
13
+ * out.step(await bg.act("Click Save"));
14
+ * out.step(await bg.verify('status is "In Draft"'));
15
+ * out.summary();
16
+ * ```
17
+ */
18
+ import { StepResult } from "./types.js";
19
+ export interface ConsoleOptions {
20
+ /** Force color on/off. Default: auto (TTY and not NO_COLOR). */
21
+ color?: boolean;
22
+ /** Width the action text is padded to. Default 48. */
23
+ width?: number;
24
+ /** Include the resolver name + confidence. Default true. */
25
+ detail?: boolean;
26
+ }
27
+ /** Render a single step as a formatted, optionally-colorized line. */
28
+ export declare function formatStepLine(result: StepResult, opts?: ConsoleOptions): string;
29
+ /** Print a single step line (convenience over {@link formatStepLine}). */
30
+ export declare function logStep(result: StepResult, opts?: ConsoleOptions): void;
31
+ /**
32
+ * A small run tracker: prints a header, one line per step, and an
33
+ * enterprise-style summary with counts, pass rate and elapsed time.
34
+ */
35
+ export declare class RunConsole {
36
+ private title;
37
+ private opts;
38
+ private counts;
39
+ private fallbacks;
40
+ private started;
41
+ private on;
42
+ constructor(title?: string, opts?: ConsoleOptions);
43
+ private write;
44
+ private banner;
45
+ /** A labelled section divider between logical groups of steps. */
46
+ section(name: string): void;
47
+ /** Record and print one step. Returns the same result for chaining. */
48
+ step(result: StepResult): StepResult;
49
+ /** Print the run summary footer. */
50
+ summary(): void;
51
+ }
52
+ //# sourceMappingURL=console.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/console.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAyBpD,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,CA0BpF;AAED,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,IAAI,CAG3E;AAED;;;GAGG;AACH,qBAAa,UAAU;IAQT,OAAO,CAAC,KAAK;IAAoB,OAAO,CAAC,IAAI;IAPzD,OAAO,CAAC,MAAM,CAEZ;IACF,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,EAAE,CAAU;gBAEA,KAAK,SAAkB,EAAU,IAAI,GAAE,cAAmB;IAK9E,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,MAAM;IAQd,kEAAkE;IAClE,OAAO,CAAC,IAAI,EAAE,MAAM;IAKpB,uEAAuE;IACvE,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;IAOpC,oCAAoC;IACpC,OAAO;CA2BR"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RunConsole = void 0;
4
+ exports.formatStepLine = formatStepLine;
5
+ exports.logStep = logStep;
6
+ const ANSI = {
7
+ reset: "\x1b[0m", bold: "\x1b[1m", dim: "\x1b[2m",
8
+ green: "\x1b[32m", red: "\x1b[31m", amber: "\x1b[33m",
9
+ gray: "\x1b[90m", blue: "\x1b[34m", magenta: "\x1b[35m", cyan: "\x1b[36m",
10
+ };
11
+ function colorEnabled(opt) {
12
+ if (typeof opt === "boolean")
13
+ return opt;
14
+ const env = typeof process !== "undefined" ? process.env : {};
15
+ if (env.NO_COLOR)
16
+ return false;
17
+ if (env.FORCE_COLOR)
18
+ return true;
19
+ return !!(typeof process !== "undefined" && process.stdout && process.stdout.isTTY);
20
+ }
21
+ /** Per-status glyph + label + color. */
22
+ const STATUS_STYLE = {
23
+ passed: { icon: "✔", label: "PASS", color: "green" },
24
+ recovered: { icon: "✚", label: "HEAL", color: "amber" },
25
+ failed: { icon: "✖", label: "FAIL", color: "red" },
26
+ skipped: { icon: "○", label: "SKIP", color: "gray" },
27
+ dry_run: { icon: "◇", label: "PLAN", color: "blue" },
28
+ };
29
+ function paint(s, color, on) {
30
+ return on ? `${ANSI[color]}${s}${ANSI.reset}` : s;
31
+ }
32
+ function fallbackUsed(r) {
33
+ const m = (r.target && r.target.metadata) || {};
34
+ return r.target?.resolver_name === "fallback_selector" || m.fallback_selector_used === true;
35
+ }
36
+ /** Render a single step as a formatted, optionally-colorized line. */
37
+ function formatStepLine(result, opts = {}) {
38
+ const on = colorEnabled(opts.color);
39
+ const width = opts.width ?? 48;
40
+ const detail = opts.detail ?? true;
41
+ const st = STATUS_STYLE[result.status] ?? STATUS_STYLE.skipped;
42
+ const badge = paint(`${st.icon} ${st.label}`, st.color, on);
43
+ const action = (result.action || "").replace(/\s+/g, " ").trim();
44
+ const actionCol = action.length > width ? action.slice(0, width - 1) + "…" : action.padEnd(width);
45
+ const parts = [badge, " ", actionCol];
46
+ if (detail) {
47
+ const resolver = result.target?.resolver_name ?? "—";
48
+ const conf = typeof result.confidence === "number" ? result.confidence.toFixed(2) : "—";
49
+ const ms = `${Math.round(result.duration_ms || 0)}ms`;
50
+ parts.push(paint(` ${resolver} · ${conf} · ${ms}`, "gray", on));
51
+ }
52
+ if (result.status === "recovered")
53
+ parts.push(paint(" (self-healed)", "amber", on));
54
+ if (fallbackUsed(result))
55
+ parts.push(paint(" ⚠ fallback selector", "magenta", on));
56
+ let line = parts.join("");
57
+ if (result.status === "failed" && result.error) {
58
+ const err = `${result.error.error_type}: ${result.error.message}`;
59
+ line += "\n" + paint(` ↳ ${err}`, "red", on);
60
+ }
61
+ return line;
62
+ }
63
+ /** Print a single step line (convenience over {@link formatStepLine}). */
64
+ function logStep(result, opts = {}) {
65
+ // eslint-disable-next-line no-console
66
+ console.log(formatStepLine(result, opts));
67
+ }
68
+ /**
69
+ * A small run tracker: prints a header, one line per step, and an
70
+ * enterprise-style summary with counts, pass rate and elapsed time.
71
+ */
72
+ class RunConsole {
73
+ title;
74
+ opts;
75
+ counts = {
76
+ passed: 0, failed: 0, recovered: 0, skipped: 0, dry_run: 0,
77
+ };
78
+ fallbacks = 0;
79
+ started = Date.now();
80
+ on;
81
+ constructor(title = "Bubblegum Run", opts = {}) {
82
+ this.title = title;
83
+ this.opts = opts;
84
+ this.on = colorEnabled(opts.color);
85
+ this.banner();
86
+ }
87
+ write(s) {
88
+ // eslint-disable-next-line no-console
89
+ console.log(s);
90
+ }
91
+ banner() {
92
+ const bar = "─".repeat(Math.max(8, this.title.length + 4));
93
+ this.write("");
94
+ this.write(paint(`┌${bar}┐`, "cyan", this.on));
95
+ this.write(paint(`│ ${this.title} │`, "cyan", this.on) + paint(" bubblegum", "gray", this.on));
96
+ this.write(paint(`└${bar}┘`, "cyan", this.on));
97
+ }
98
+ /** A labelled section divider between logical groups of steps. */
99
+ section(name) {
100
+ this.write("");
101
+ this.write(paint(`▸ ${name}`, "bold", this.on));
102
+ }
103
+ /** Record and print one step. Returns the same result for chaining. */
104
+ step(result) {
105
+ this.counts[result.status] = (this.counts[result.status] ?? 0) + 1;
106
+ if (fallbackUsed(result))
107
+ this.fallbacks += 1;
108
+ this.write(" " + formatStepLine(result, this.opts));
109
+ return result;
110
+ }
111
+ /** Print the run summary footer. */
112
+ summary() {
113
+ const total = Object.values(this.counts).reduce((a, b) => a + b, 0);
114
+ const done = total - this.counts.skipped;
115
+ const rate = done ? Math.round((this.counts.passed + this.counts.recovered) / done * 100) : 0;
116
+ const secs = ((Date.now() - this.started) / 1000).toFixed(1);
117
+ const ok = this.counts.failed === 0;
118
+ const chip = (label, n, color) => n > 0 ? paint(`${label} ${n}`, color, this.on) : paint(`${label} ${n}`, "gray", this.on);
119
+ this.write("");
120
+ this.write(paint("─".repeat(56), "gray", this.on));
121
+ this.write([
122
+ chip("✔", this.counts.passed, "green"),
123
+ chip("✚", this.counts.recovered, "amber"),
124
+ this.fallbacks ? paint(`⚠ ${this.fallbacks}`, "magenta", this.on) : "",
125
+ chip("✖", this.counts.failed, "red"),
126
+ chip("○", this.counts.skipped, "gray"),
127
+ paint(`· ${rate}% pass · ${secs}s`, "gray", this.on),
128
+ ].filter(Boolean).join(" "));
129
+ this.write(ok
130
+ ? paint(` ${this.title}: ALL PASSED`, "green", this.on)
131
+ : paint(` ${this.title}: ${this.counts.failed} FAILED`, "red", this.on));
132
+ this.write("");
133
+ }
134
+ }
135
+ exports.RunConsole = RunConsole;
136
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/console.ts"],"names":[],"mappings":";;;AA6DA,wCA0BC;AAGD,0BAGC;AA1ED,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS;IACjD,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU;IACrD,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU;CAC1E,CAAC;AAEF,SAAS,YAAY,CAAC,GAAa;IACjC,IAAI,OAAO,GAAG,K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A,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YACxD,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAC3E,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;CACF;AApED,gCAoEC"}
@@ -11,6 +11,8 @@ export type { Channel, LaunchOptions, AttachOptions, MobileAttachOptions, Recove
11
11
  export { BridgeClient, spawnBridgeTransport, resolveBridgeCommand } from "./client.js";
12
12
  export type { Transport, SpawnOptions, BridgeClientOptions } from "./client.js";
13
13
  export { BridgeError } from "./errors.js";
14
+ export { formatStepLine, logStep, RunConsole } from "./console.js";
15
+ export type { ConsoleOptions } from "./console.js";
14
16
  export { PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, ErrorCodes, } from "./protocol.js";
15
17
  export type { Handshake, JsonRpcResponse } from "./protocol.js";
16
18
  export type { StepResult, StepStatus, ResolvedTarget, ErrorInfo, SessionSummary, StepOptions, ReportOptions, ReportResult, } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5G,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhE,YAAY,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5G,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhE,YAAY,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * a thin, typed proxy. See ../../docs/distribution-npm-and-pypi.md.
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ErrorCodes = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.PROTOCOL_VERSION = exports.BridgeError = exports.resolveBridgeCommand = exports.spawnBridgeTransport = exports.BridgeClient = exports.Bubblegum = void 0;
11
+ exports.ErrorCodes = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.PROTOCOL_VERSION = exports.RunConsole = exports.logStep = exports.formatStepLine = exports.BridgeError = exports.resolveBridgeCommand = exports.spawnBridgeTransport = exports.BridgeClient = exports.Bubblegum = void 0;
12
12
  var session_js_1 = require("./session.js");
13
13
  Object.defineProperty(exports, "Bubblegum", { enumerable: true, get: function () { return session_js_1.Bubblegum; } });
14
14
  var client_js_1 = require("./client.js");
@@ -17,6 +17,10 @@ Object.defineProperty(exports, "spawnBridgeTransport", { enumerable: true, get:
17
17
  Object.defineProperty(exports, "resolveBridgeCommand", { enumerable: true, get: function () { return client_js_1.resolveBridgeCommand; } });
18
18
  var errors_js_1 = require("./errors.js");
19
19
  Object.defineProperty(exports, "BridgeError", { enumerable: true, get: function () { return errors_js_1.BridgeError; } });
20
+ var console_js_1 = require("./console.js");
21
+ Object.defineProperty(exports, "formatStepLine", { enumerable: true, get: function () { return console_js_1.formatStepLine; } });
22
+ Object.defineProperty(exports, "logStep", { enumerable: true, get: function () { return console_js_1.logStep; } });
23
+ Object.defineProperty(exports, "RunConsole", { enumerable: true, get: function () { return console_js_1.RunConsole; } });
20
24
  var protocol_js_1 = require("./protocol.js");
21
25
  Object.defineProperty(exports, "PROTOCOL_VERSION", { enumerable: true, get: function () { return protocol_js_1.PROTOCOL_VERSION; } });
22
26
  Object.defineProperty(exports, "SUPPORTED_PROTOCOL_VERSIONS", { enumerable: true, get: function () { return protocol_js_1.SUPPORTED_PROTOCOL_VERSIONS; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAGlB,yCAAuF;AAA9E,yGAAA,YAAY,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAGjE,yCAA0C;AAAjC,wGAAA,WAAW,OAAA;AAEpB,6CAIuB;AAHrB,+GAAA,gBAAgB,OAAA;AAChB,0HAAA,2BAA2B,OAAA;AAC3B,yGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAGlB,yCAAuF;AAA9E,yGAAA,YAAY,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAGjE,yCAA0C;AAAjC,wGAAA,WAAW,OAAA;AAEpB,2CAAmE;AAA1D,4GAAA,cAAc,OAAA;AAAE,qGAAA,OAAO,OAAA;AAAE,wGAAA,UAAU,OAAA;AAG5C,6CAIuB;AAHrB,+GAAA,gBAAgB,OAAA;AAChB,0HAAA,2BAA2B,OAAA;AAC3B,yGAAA,UAAU,OAAA"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Modern, dependency-free console output for Bubblegum runs.
3
+ *
4
+ * The engine returns a {@link StepResult} for every act/verify; this module
5
+ * turns that into a clean, colorized one-line status you can print from your
6
+ * test helper, plus a {@link RunConsole} that tracks a run and prints an
7
+ * enterprise-style header/summary. No external libraries — ANSI only, and it
8
+ * auto-disables color for non-TTY / `NO_COLOR` so CI logs stay clean.
9
+ *
10
+ * ```ts
11
+ * import { RunConsole } from "@bubblegum-ai/node";
12
+ * const out = new RunConsole("Workout Creation");
13
+ * out.step(await bg.act("Click Save"));
14
+ * out.step(await bg.verify('status is "In Draft"'));
15
+ * out.summary();
16
+ * ```
17
+ */
18
+ import { StepResult } from "./types.js";
19
+ export interface ConsoleOptions {
20
+ /** Force color on/off. Default: auto (TTY and not NO_COLOR). */
21
+ color?: boolean;
22
+ /** Width the action text is padded to. Default 48. */
23
+ width?: number;
24
+ /** Include the resolver name + confidence. Default true. */
25
+ detail?: boolean;
26
+ }
27
+ /** Render a single step as a formatted, optionally-colorized line. */
28
+ export declare function formatStepLine(result: StepResult, opts?: ConsoleOptions): string;
29
+ /** Print a single step line (convenience over {@link formatStepLine}). */
30
+ export declare function logStep(result: StepResult, opts?: ConsoleOptions): void;
31
+ /**
32
+ * A small run tracker: prints a header, one line per step, and an
33
+ * enterprise-style summary with counts, pass rate and elapsed time.
34
+ */
35
+ export declare class RunConsole {
36
+ private title;
37
+ private opts;
38
+ private counts;
39
+ private fallbacks;
40
+ private started;
41
+ private on;
42
+ constructor(title?: string, opts?: ConsoleOptions);
43
+ private write;
44
+ private banner;
45
+ /** A labelled section divider between logical groups of steps. */
46
+ section(name: string): void;
47
+ /** Record and print one step. Returns the same result for chaining. */
48
+ step(result: StepResult): StepResult;
49
+ /** Print the run summary footer. */
50
+ summary(): void;
51
+ }
52
+ //# sourceMappingURL=console.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/console.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAyBpD,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,CA0BpF;AAED,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,IAAI,CAG3E;AAED;;;GAGG;AACH,qBAAa,UAAU;IAQT,OAAO,CAAC,KAAK;IAAoB,OAAO,CAAC,IAAI;IAPzD,OAAO,CAAC,MAAM,CAEZ;IACF,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,EAAE,CAAU;gBAEA,KAAK,SAAkB,EAAU,IAAI,GAAE,cAAmB;IAK9E,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,MAAM;IAQd,kEAAkE;IAClE,OAAO,CAAC,IAAI,EAAE,MAAM;IAKpB,uEAAuE;IACvE,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;IAOpC,oCAAoC;IACpC,OAAO;CA2BR"}
@@ -0,0 +1,130 @@
1
+ const ANSI = {
2
+ reset: "\x1b[0m", bold: "\x1b[1m", dim: "\x1b[2m",
3
+ green: "\x1b[32m", red: "\x1b[31m", amber: "\x1b[33m",
4
+ gray: "\x1b[90m", blue: "\x1b[34m", magenta: "\x1b[35m", cyan: "\x1b[36m",
5
+ };
6
+ function colorEnabled(opt) {
7
+ if (typeof opt === "boolean")
8
+ return opt;
9
+ const env = typeof process !== "undefined" ? process.env : {};
10
+ if (env.NO_COLOR)
11
+ return false;
12
+ if (env.FORCE_COLOR)
13
+ return true;
14
+ return !!(typeof process !== "undefined" && process.stdout && process.stdout.isTTY);
15
+ }
16
+ /** Per-status glyph + label + color. */
17
+ const STATUS_STYLE = {
18
+ passed: { icon: "✔", label: "PASS", color: "green" },
19
+ recovered: { icon: "✚", label: "HEAL", color: "amber" },
20
+ failed: { icon: "✖", label: "FAIL", color: "red" },
21
+ skipped: { icon: "○", label: "SKIP", color: "gray" },
22
+ dry_run: { icon: "◇", label: "PLAN", color: "blue" },
23
+ };
24
+ function paint(s, color, on) {
25
+ return on ? `${ANSI[color]}${s}${ANSI.reset}` : s;
26
+ }
27
+ function fallbackUsed(r) {
28
+ const m = (r.target && r.target.metadata) || {};
29
+ return r.target?.resolver_name === "fallback_selector" || m.fallback_selector_used === true;
30
+ }
31
+ /** Render a single step as a formatted, optionally-colorized line. */
32
+ export function formatStepLine(result, opts = {}) {
33
+ const on = colorEnabled(opts.color);
34
+ const width = opts.width ?? 48;
35
+ const detail = opts.detail ?? true;
36
+ const st = STATUS_STYLE[result.status] ?? STATUS_STYLE.skipped;
37
+ const badge = paint(`${st.icon} ${st.label}`, st.color, on);
38
+ const action = (result.action || "").replace(/\s+/g, " ").trim();
39
+ const actionCol = action.length > width ? action.slice(0, width - 1) + "…" : action.padEnd(width);
40
+ const parts = [badge, " ", actionCol];
41
+ if (detail) {
42
+ const resolver = result.target?.resolver_name ?? "—";
43
+ const conf = typeof result.confidence === "number" ? result.confidence.toFixed(2) : "—";
44
+ const ms = `${Math.round(result.duration_ms || 0)}ms`;
45
+ parts.push(paint(` ${resolver} · ${conf} · ${ms}`, "gray", on));
46
+ }
47
+ if (result.status === "recovered")
48
+ parts.push(paint(" (self-healed)", "amber", on));
49
+ if (fallbackUsed(result))
50
+ parts.push(paint(" ⚠ fallback selector", "magenta", on));
51
+ let line = parts.join("");
52
+ if (result.status === "failed" && result.error) {
53
+ const err = `${result.error.error_type}: ${result.error.message}`;
54
+ line += "\n" + paint(` ↳ ${err}`, "red", on);
55
+ }
56
+ return line;
57
+ }
58
+ /** Print a single step line (convenience over {@link formatStepLine}). */
59
+ export function logStep(result, opts = {}) {
60
+ // eslint-disable-next-line no-console
61
+ console.log(formatStepLine(result, opts));
62
+ }
63
+ /**
64
+ * A small run tracker: prints a header, one line per step, and an
65
+ * enterprise-style summary with counts, pass rate and elapsed time.
66
+ */
67
+ export class RunConsole {
68
+ title;
69
+ opts;
70
+ counts = {
71
+ passed: 0, failed: 0, recovered: 0, skipped: 0, dry_run: 0,
72
+ };
73
+ fallbacks = 0;
74
+ started = Date.now();
75
+ on;
76
+ constructor(title = "Bubblegum Run", opts = {}) {
77
+ this.title = title;
78
+ this.opts = opts;
79
+ this.on = colorEnabled(opts.color);
80
+ this.banner();
81
+ }
82
+ write(s) {
83
+ // eslint-disable-next-line no-console
84
+ console.log(s);
85
+ }
86
+ banner() {
87
+ const bar = "─".repeat(Math.max(8, this.title.length + 4));
88
+ this.write("");
89
+ this.write(paint(`┌${bar}┐`, "cyan", this.on));
90
+ this.write(paint(`│ ${this.title} │`, "cyan", this.on) + paint(" bubblegum", "gray", this.on));
91
+ this.write(paint(`└${bar}┘`, "cyan", this.on));
92
+ }
93
+ /** A labelled section divider between logical groups of steps. */
94
+ section(name) {
95
+ this.write("");
96
+ this.write(paint(`▸ ${name}`, "bold", this.on));
97
+ }
98
+ /** Record and print one step. Returns the same result for chaining. */
99
+ step(result) {
100
+ this.counts[result.status] = (this.counts[result.status] ?? 0) + 1;
101
+ if (fallbackUsed(result))
102
+ this.fallbacks += 1;
103
+ this.write(" " + formatStepLine(result, this.opts));
104
+ return result;
105
+ }
106
+ /** Print the run summary footer. */
107
+ summary() {
108
+ const total = Object.values(this.counts).reduce((a, b) => a + b, 0);
109
+ const done = total - this.counts.skipped;
110
+ const rate = done ? Math.round((this.counts.passed + this.counts.recovered) / done * 100) : 0;
111
+ const secs = ((Date.now() - this.started) / 1000).toFixed(1);
112
+ const ok = this.counts.failed === 0;
113
+ const chip = (label, n, color) => n > 0 ? paint(`${label} ${n}`, color, this.on) : paint(`${label} ${n}`, "gray", this.on);
114
+ this.write("");
115
+ this.write(paint("─".repeat(56), "gray", this.on));
116
+ this.write([
117
+ chip("✔", this.counts.passed, "green"),
118
+ chip("✚", this.counts.recovered, "amber"),
119
+ this.fallbacks ? paint(`⚠ ${this.fallbacks}`, "magenta", this.on) : "",
120
+ chip("✖", this.counts.failed, "red"),
121
+ chip("○", this.counts.skipped, "gray"),
122
+ paint(`· ${rate}% pass · ${secs}s`, "gray", this.on),
123
+ ].filter(Boolean).join(" "));
124
+ this.write(ok
125
+ ? paint(` ${this.title}: ALL PASSED`, "green", this.on)
126
+ : paint(` ${this.title}: ${this.counts.failed} FAILED`, "red", this.on));
127
+ this.write("");
128
+ }
129
+ }
130
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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AAE,CAAC,CAAC,CAAC,CAAC,EAAE;YACtE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;YACpC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;YACtC,KAAK,CAAC,KAAK,IAAI,YAAY,IAAI,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;SACrD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,CACR,EAAE;YACA,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YACxD,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAC3E,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;CACF"}
@@ -11,6 +11,8 @@ export type { Channel, LaunchOptions, AttachOptions, MobileAttachOptions, Recove
11
11
  export { BridgeClient, spawnBridgeTransport, resolveBridgeCommand } from "./client.js";
12
12
  export type { Transport, SpawnOptions, BridgeClientOptions } from "./client.js";
13
13
  export { BridgeError } from "./errors.js";
14
+ export { formatStepLine, logStep, RunConsole } from "./console.js";
15
+ export type { ConsoleOptions } from "./console.js";
14
16
  export { PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, ErrorCodes, } from "./protocol.js";
15
17
  export type { Handshake, JsonRpcResponse } from "./protocol.js";
16
18
  export type { StepResult, StepStatus, ResolvedTarget, ErrorInfo, SessionSummary, StepOptions, ReportOptions, ReportResult, } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts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B,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhE,YAAY,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
package/dist/esm/index.js CHANGED
@@ -9,5 +9,6 @@
9
9
  export { Bubblegum } from "./session.js";
10
10
  export { BridgeClient, spawnBridgeTransport, resolveBridgeCommand } from "./client.js";
11
11
  export { BridgeError } from "./errors.js";
12
+ export { formatStepLine, logStep, RunConsole } from "./console.js";
12
13
  export { PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, ErrorCodes, } from "./protocol.js";
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bubblegum-ai/node",
3
- "version": "0.0.6-alpha.15",
3
+ "version": "0.0.6-alpha.16",
4
4
  "description": "Node/TypeScript client for the Bubblegum engine — drive AI-powered, natural-language Playwright/Appium test steps from JS/TS via the Bubblegum JSON-RPC bridge.",
5
5
  "type": "module",
6
6
  "exports": {