@tabbio-technologies/cli 1.2.8

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,16 @@
1
+ import { createRequire as __tabbioCreateRequire } from 'node:module';
2
+ const require = __tabbioCreateRequire(import.meta.url);
3
+ import {
4
+ collectStatus,
5
+ mcpSummary,
6
+ registerStatusCommand
7
+ } from "./chunk-Y6GWIFHI.js";
8
+ import "./chunk-7LNC3FIV.js";
9
+ import "./chunk-NK5RPNSV.js";
10
+ import "./chunk-VHHZFMIF.js";
11
+ export {
12
+ collectStatus,
13
+ mcpSummary,
14
+ registerStatusCommand
15
+ };
16
+ //# sourceMappingURL=status-I5UAQPBY.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/dist/cli.js ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __tabbioCreateRequire } from 'node:module';
3
+ const require = __tabbioCreateRequire(import.meta.url);
4
+ import {
5
+ cancelActiveCommand
6
+ } from "./chunks/chunk-NK5RPNSV.js";
7
+
8
+ // src/core/color-env.ts
9
+ function isOffValue(value) {
10
+ return value === "0" || value.toLowerCase() === "false";
11
+ }
12
+ function decideColor(args, env, isTTY) {
13
+ const cut = args.indexOf("--");
14
+ const flags = cut === -1 ? args : args.slice(0, cut);
15
+ const lastColorFlag = [...flags].reverse().find((a) => a === "--color" || a === "--no-color");
16
+ if (lastColorFlag === "--no-color") return { enabled: false, reason: "--no-color", forceColor: "0" };
17
+ if (lastColorFlag === "--color") {
18
+ const current = env.FORCE_COLOR;
19
+ if (current && !isOffValue(current)) return { enabled: true, reason: "--color", forceColor: current };
20
+ return { enabled: true, reason: "--color", forceColor: isTTY ? null : "1" };
21
+ }
22
+ const force = env.FORCE_COLOR;
23
+ if (force !== void 0 && force !== "") {
24
+ return { enabled: !isOffValue(force), reason: "FORCE_COLOR", forceColor: force };
25
+ }
26
+ if (env.NO_COLOR !== void 0 && env.NO_COLOR !== "") return { enabled: false, reason: "NO_COLOR", forceColor: "0" };
27
+ if (env.CLICOLOR_FORCE && env.CLICOLOR_FORCE !== "0") {
28
+ return { enabled: true, reason: "CLICOLOR_FORCE", forceColor: isTTY ? void 0 : "1" };
29
+ }
30
+ if (env.CLICOLOR === "0") return { enabled: false, reason: "CLICOLOR=0", forceColor: "0" };
31
+ if (env.TERM === "dumb") return { enabled: false, reason: "TERM=dumb", forceColor: "0" };
32
+ return isTTY ? { enabled: true, reason: "tty" } : { enabled: false, reason: "not a tty", forceColor: "0" };
33
+ }
34
+ function applyColorEnv(args = process.argv.slice(2), env = process.env, isTTY = Boolean(process.stdout.isTTY)) {
35
+ const decision = decideColor(args, env, isTTY);
36
+ if (decision.forceColor === null) delete env.FORCE_COLOR;
37
+ else if (decision.forceColor !== void 0) env.FORCE_COLOR = decision.forceColor;
38
+ return decision;
39
+ }
40
+
41
+ // src/index.ts
42
+ applyColorEnv();
43
+ var interrupted = false;
44
+ process.on("SIGINT", () => {
45
+ if (process.listenerCount("SIGINT") > 1) return;
46
+ interrupted = true;
47
+ cancelActiveCommand();
48
+ });
49
+ process.stdout.on("error", (error) => {
50
+ if (error.code === "EPIPE") {
51
+ process.exitCode = 0;
52
+ return;
53
+ }
54
+ throw error;
55
+ });
56
+ function flush(stream) {
57
+ return new Promise((resolve) => {
58
+ if (stream.writableLength === 0) resolve();
59
+ else stream.write("", () => resolve());
60
+ });
61
+ }
62
+ var { runCli } = await import("./chunks/program-O2BA5L6Z.js");
63
+ var code = await runCli(process.argv);
64
+ await Promise.all([flush(process.stdout), flush(process.stderr)]);
65
+ process.exitCode = interrupted ? 130 : code;
66
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/color-env.ts", "../src/index.ts"],
4
+ "sourcesContent": ["/**\n * Colour decision, applied to the environment BEFORE chalk or Ink load.\n *\n * chalk and Ink read FORCE_COLOR/NO_COLOR once, at import time (and Ink uses\n * its own chalk copy), so `src/index.ts` calls `applyColorEnv()` first and only\n * then dynamically imports the program. This module must not import anything.\n *\n * Precedence (plan \u00A712.4): --color/--no-color \u2192 FORCE_COLOR \u2192 NO_COLOR \u2192\n * CLICOLOR_FORCE / CLICOLOR \u2192 TERM=dumb \u2192 whether stdout is a TTY.\n */\n\n/** `forceColor`: value to write to FORCE_COLOR; null deletes it; undefined leaves it. */\nexport type ColorDecision = { enabled: boolean; reason: string; forceColor?: string | null };\n\nfunction isOffValue(value: string): boolean {\n return value === '0' || value.toLowerCase() === 'false';\n}\n\nexport function decideColor(args: readonly string[], env: NodeJS.ProcessEnv, isTTY: boolean): ColorDecision {\n const cut = args.indexOf('--');\n const flags = cut === -1 ? args : args.slice(0, cut);\n const lastColorFlag = [...flags].reverse().find((a) => a === '--color' || a === '--no-color');\n if (lastColorFlag === '--no-color') return { enabled: false, reason: '--no-color', forceColor: '0' };\n if (lastColorFlag === '--color') {\n const current = env.FORCE_COLOR;\n if (current && !isOffValue(current)) return { enabled: true, reason: '--color', forceColor: current };\n // On a TTY let chalk detect the depth (truecolor etc.); piped, force basic colour.\n return { enabled: true, reason: '--color', forceColor: isTTY ? null : '1' };\n }\n\n const force = env.FORCE_COLOR;\n if (force !== undefined && force !== '') {\n return { enabled: !isOffValue(force), reason: 'FORCE_COLOR', forceColor: force };\n }\n if (env.NO_COLOR !== undefined && env.NO_COLOR !== '') return { enabled: false, reason: 'NO_COLOR', forceColor: '0' };\n if (env.CLICOLOR_FORCE && env.CLICOLOR_FORCE !== '0') {\n return { enabled: true, reason: 'CLICOLOR_FORCE', forceColor: isTTY ? undefined : '1' };\n }\n if (env.CLICOLOR === '0') return { enabled: false, reason: 'CLICOLOR=0', forceColor: '0' };\n if (env.TERM === 'dumb') return { enabled: false, reason: 'TERM=dumb', forceColor: '0' };\n return isTTY ? { enabled: true, reason: 'tty' } : { enabled: false, reason: 'not a tty', forceColor: '0' };\n}\n\n/** Writes the decision into `env.FORCE_COLOR` so chalk and Ink agree with it. */\nexport function applyColorEnv(\n args: readonly string[] = process.argv.slice(2),\n env: NodeJS.ProcessEnv = process.env,\n isTTY: boolean = Boolean(process.stdout.isTTY),\n): ColorDecision {\n const decision = decideColor(args, env, isTTY);\n if (decision.forceColor === null) delete env.FORCE_COLOR;\n else if (decision.forceColor !== undefined) env.FORCE_COLOR = decision.forceColor;\n return decision;\n}\n", "/**\n * `tabbio` bin entry.\n *\n * The colour decision must reach the environment before chalk or Ink\n * evaluate (they read FORCE_COLOR/NO_COLOR at import time, and Ink bundles\n * its own chalk). So this file imports nothing that pulls them in; the\n * program is loaded with a dynamic import, which the esbuild build emits as a\n * separate, lazily evaluated chunk.\n */\nimport { applyColorEnv } from './core/color-env';\nimport { cancelActiveCommand } from './core/cancellation';\n\napplyColorEnv();\n\n// Let the command unwind its finally blocks before reporting Ctrl-C.\nlet interrupted = false;\nprocess.on('SIGINT', () => {\n if (process.listenerCount('SIGINT') > 1) return;\n interrupted = true;\n cancelActiveCommand();\n});\n\n// `tabbio tools | head` closes the pipe early; that is not an error.\nprocess.stdout.on('error', (error: NodeJS.ErrnoException) => {\n if (error.code === 'EPIPE') {\n process.exitCode = 0;\n return;\n }\n throw error;\n});\n\nfunction flush(stream: NodeJS.WriteStream): Promise<void> {\n return new Promise((resolve) => {\n if (stream.writableLength === 0) resolve();\n else stream.write('', () => resolve());\n });\n}\n\nconst { runCli } = await import('./program');\nconst code = await runCli(process.argv);\nawait Promise.all([flush(process.stdout), flush(process.stderr)]);\nprocess.exitCode = interrupted ? 130 : code;\n"],
5
+ "mappings": ";;;;;;;AAcA,SAAS,WAAW,OAAwB;AAC1C,SAAO,UAAU,OAAO,MAAM,YAAY,MAAM;AAClD;AAEO,SAAS,YAAY,MAAyB,KAAwB,OAA+B;AAC1G,QAAM,MAAM,KAAK,QAAQ,IAAI;AAC7B,QAAM,QAAQ,QAAQ,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KAAK;AAC7C,MAAI,SAAS,eAAe,KAAM,QAAO,IAAI;AAAA,WACpC,SAAS,eAAe,OAAW,KAAI,cAAc,SAAS;AACvE,SAAO;AACT;;;ACzCA,cAAc;AAGd,IAAI,cAAc;AAClB,QAAQ,GAAG,UAAU,MAAM;AACzB,MAAI,QAAQ,cAAc,QAAQ,IAAI,EAAG;AACzC,gBAAc;AACd,sBAAoB;AACtB,CAAC;AAGD,QAAQ,OAAO,GAAG,SAAS,CAAC,UAAiC;AAC3D,MAAI,MAAM,SAAS,SAAS;AAC1B,YAAQ,WAAW;AACnB;AAAA,EACF;AACA,QAAM;AACR,CAAC;AAED,SAAS,MAAM,QAA2C;AACxD,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,QAAI,OAAO,mBAAmB,EAAG,SAAQ;AAAA,QACpC,QAAO,MAAM,IAAI,MAAM,QAAQ,CAAC;AAAA,EACvC,CAAC;AACH;AAEA,IAAM,EAAE,OAAO,IAAI,MAAM,OAAO,8BAAW;AAC3C,IAAM,OAAO,MAAM,OAAO,QAAQ,IAAI;AACtC,MAAM,QAAQ,IAAI,CAAC,MAAM,QAAQ,MAAM,GAAG,MAAM,QAAQ,MAAM,CAAC,CAAC;AAChE,QAAQ,WAAW,cAAc,MAAM;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@tabbio-technologies/cli",
3
+ "version": "1.2.8",
4
+ "description": "Tabbio in your terminal: every Tabbio tool, streaming chat, approvals and a stdio MCP bridge.",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/ibilalchaudhary/tabbio-v2.git",
9
+ "directory": "apps/cli"
10
+ },
11
+ "homepage": "https://www.tabbio.com/en/cli",
12
+ "bugs": "https://github.com/ibilalchaudhary/tabbio-v2/issues",
13
+ "keywords": ["tabbio", "career", "cli", "mcp"],
14
+ "publishConfig": { "access": "public" },
15
+ "type": "module",
16
+ "bin": {
17
+ "tabbio": "dist/cli.js"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "scripts": {
26
+ "dev": "tsx src/index.ts",
27
+ "build": "node scripts/build.mjs",
28
+ "type-check": "tsc --noEmit",
29
+ "lint": "eslint src test",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest",
32
+ "clean": "rm -rf dist .turbo node_modules"
33
+ },
34
+ "dependencies": {
35
+ "@modelcontextprotocol/sdk": "^1.27.1",
36
+ "chalk": "^5.6.2",
37
+ "commander": "^14.0.3",
38
+ "eventsource-parser": "^3.0.8",
39
+ "ink": "6.4.0",
40
+ "ink-gradient": "4.0.0",
41
+ "ink-select-input": "^6.2.0",
42
+ "ink-spinner": "^5.0.0",
43
+ "ink-text-input": "^6.0.0",
44
+ "marked": "^15.0.12",
45
+ "open": "^10.2.0",
46
+ "react": "19.1.0",
47
+ "zod": "3.25.76"
48
+ },
49
+ "devDependencies": {
50
+ "@eslint/js": "^9.18.0",
51
+ "@tabbio/eslint-config": "workspace:*",
52
+ "@tabbio/types": "workspace:*",
53
+ "@tabbio/typescript-config": "workspace:*",
54
+ "@types/node": "^20.19.0",
55
+ "@types/react": "~19.2.14",
56
+ "esbuild": "^0.27.4",
57
+ "eslint": "^9.18.0",
58
+ "globals": "^16.0.0",
59
+ "ink-testing-library": "^4.0.0",
60
+ "tsx": "^4.21.0",
61
+ "typescript": "~5.9.2",
62
+ "typescript-eslint": "^8.20.0",
63
+ "vitest": "^3.2.4"
64
+ }
65
+ }