@tabbio-technologies/cli 1.2.8 → 1.3.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/README.md +85 -18
- package/dist/chunks/{chunk-Y6GWIFHI.js → chunk-FO6AU5UZ.js} +3 -53
- package/dist/chunks/chunk-FO6AU5UZ.js.map +7 -0
- package/dist/chunks/{chunk-NAWA6NCZ.js → chunk-NRFVKK3S.js} +37 -96
- package/dist/chunks/chunk-NRFVKK3S.js.map +7 -0
- package/dist/chunks/chunk-TP3CRQJD.js +106 -0
- package/dist/chunks/chunk-TP3CRQJD.js.map +7 -0
- package/dist/chunks/{chunk-QVR5KIEQ.js → chunk-WRDHOZD7.js} +1796 -244
- package/dist/chunks/chunk-WRDHOZD7.js.map +7 -0
- package/dist/chunks/{chunk-7LNC3FIV.js → chunk-XR6APSWD.js} +95 -14
- package/dist/chunks/{chunk-7LNC3FIV.js.map → chunk-XR6APSWD.js.map} +4 -4
- package/dist/chunks/{entry-WENOOT6W.js → entry-E22QDWDP.js} +2023 -770
- package/dist/chunks/entry-E22QDWDP.js.map +7 -0
- package/dist/chunks/{mount-NGUARMCL.js → mount-36JUVX3R.js} +3 -2
- package/dist/chunks/{mount-NGUARMCL.js.map → mount-36JUVX3R.js.map} +1 -1
- package/dist/chunks/{program-O2BA5L6Z.js → program-HOHDF6FM.js} +314 -375
- package/dist/chunks/program-HOHDF6FM.js.map +7 -0
- package/dist/chunks/{status-I5UAQPBY.js → status-P5E6N54K.js} +3 -3
- package/dist/cli.js +1 -1
- package/package.json +2 -1
- package/dist/chunks/chunk-NAWA6NCZ.js.map +0 -7
- package/dist/chunks/chunk-QVR5KIEQ.js.map +0 -7
- package/dist/chunks/chunk-Y6GWIFHI.js.map +0 -7
- package/dist/chunks/entry-WENOOT6W.js.map +0 -7
- package/dist/chunks/program-O2BA5L6Z.js.map +0 -7
- /package/dist/chunks/{status-I5UAQPBY.js.map → status-P5E6N54K.js.map} +0 -0
|
@@ -744,7 +744,7 @@ function warn(message, hint) {
|
|
|
744
744
|
// src/core/version.ts
|
|
745
745
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
746
746
|
import { join as join3 } from "node:path";
|
|
747
|
-
var CLI_VERSION = true ? "1.
|
|
747
|
+
var CLI_VERSION = true ? "1.3.0" : readPackageField("version") ?? "0.0.0-dev";
|
|
748
748
|
var CLI_PACKAGE_NAME = true ? "@tabbio-technologies/cli" : readPackageField("name") ?? "@tabbio-technologies/cli";
|
|
749
749
|
function userAgent() {
|
|
750
750
|
return `tabbio-cli/${CLI_VERSION} node/${process.versions.node} ${process.platform}-${process.arch}`;
|
|
@@ -1653,23 +1653,58 @@ function paletteCss() {
|
|
|
1653
1653
|
function escapeHtml(value) {
|
|
1654
1654
|
return value.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
|
|
1655
1655
|
}
|
|
1656
|
+
var NEXT_STEPS = [
|
|
1657
|
+
["tabbio", "home: chat, tools, approvals"],
|
|
1658
|
+
["tabbio chat", "talk to Tabbio in the terminal"],
|
|
1659
|
+
["/logout", "sign out again, from inside the app"]
|
|
1660
|
+
];
|
|
1661
|
+
var RETRY_STEPS = [
|
|
1662
|
+
["/login", "try again from the app (tabbio)"],
|
|
1663
|
+
["tabbio login --email you@example.com", "sign in with a code instead"]
|
|
1664
|
+
];
|
|
1656
1665
|
function renderLoopbackPage(kind, message) {
|
|
1657
|
-
const
|
|
1658
|
-
const
|
|
1659
|
-
const
|
|
1666
|
+
const ok = kind === "success";
|
|
1667
|
+
const title = ok ? "Tabbio CLI connected" : "Tabbio CLI sign-in";
|
|
1668
|
+
const heading2 = ok ? "Connected." : "Not signed in.";
|
|
1669
|
+
const lead = ok ? "This computer is signed in to Tabbio." : "The terminal is still waiting, or the sign-in was stopped.";
|
|
1670
|
+
const list = ok ? NEXT_STEPS : RETRY_STEPS;
|
|
1671
|
+
const stacked = list.some(([command]) => command.length > 20);
|
|
1672
|
+
const steps = list.map(([command, what]) => `<dt><code>${escapeHtml(command)}</code></dt><dd>${escapeHtml(what)}</dd>`).join("");
|
|
1660
1673
|
return `<!doctype html>
|
|
1661
1674
|
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
1662
|
-
<meta name="referrer" content="no-referrer"><title>${title}</title>
|
|
1675
|
+
<meta name="referrer" content="no-referrer"><meta name="color-scheme" content="light dark"><title>${title}</title>
|
|
1663
1676
|
<style>
|
|
1664
1677
|
${paletteCss()}
|
|
1665
|
-
*{box-sizing:border-box}
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
.
|
|
1669
|
-
|
|
1678
|
+
*{box-sizing:border-box}
|
|
1679
|
+
html{background:var(--bg)}
|
|
1680
|
+
body{margin:0;min-height:100vh;background:var(--bg);color:var(--fg);-webkit-font-smoothing:antialiased;
|
|
1681
|
+
font:16px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
|
|
1682
|
+
main{max-width:600px;padding-block:min(14vh,120px) 48px;padding-inline:clamp(20px,6vw,56px)}
|
|
1683
|
+
code,.tag{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace}
|
|
1684
|
+
.tag{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted);letter-spacing:.02em}
|
|
1685
|
+
.dot{width:8px;height:8px;border-radius:50%;background:${ok ? "var(--accent)" : "transparent"};box-shadow:inset 0 0 0 1.5px ${ok ? "var(--accent)" : "var(--muted)"}}
|
|
1686
|
+
h1{font-size:clamp(34px,6vw,44px);line-height:1.1;letter-spacing:-.025em;font-weight:650;margin:40px 0 14px}
|
|
1687
|
+
.lead{font-size:18px;margin:0 0 6px}
|
|
1688
|
+
.note{color:var(--muted);margin:0}
|
|
1689
|
+
hr{border:0;border-top:1px solid var(--line);margin:36px 0 22px}
|
|
1690
|
+
h2{font:500 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 14px}
|
|
1691
|
+
dl{display:grid;grid-template-columns:max-content 1fr;gap:10px 24px;margin:0}
|
|
1692
|
+
dt{margin:0}dd{margin:0;color:var(--muted)}
|
|
1693
|
+
dt code{font-size:14px;color:var(--fg)}
|
|
1694
|
+
footer{margin-top:44px;font-size:13px;color:var(--muted)}
|
|
1695
|
+
dl.stack{grid-template-columns:1fr;gap:2px}dl.stack dd{margin-bottom:14px}
|
|
1696
|
+
@media (max-width:480px){dl{grid-template-columns:1fr;gap:2px}dd{margin-bottom:12px}}
|
|
1670
1697
|
</style></head>
|
|
1671
|
-
<body><main
|
|
1672
|
-
<
|
|
1698
|
+
<body><main>
|
|
1699
|
+
<div class="tag"><span class="dot" aria-hidden="true"></span>tabbio cli</div>
|
|
1700
|
+
<h1>${escapeHtml(heading2)}</h1>
|
|
1701
|
+
<p class="lead">${escapeHtml(lead)}</p>
|
|
1702
|
+
<p class="note" dir="auto">${escapeHtml(message)}</p>
|
|
1703
|
+
<hr>
|
|
1704
|
+
<h2>${ok ? "Next, in your terminal" : "In your terminal"}</h2>
|
|
1705
|
+
<dl${stacked ? ' class="stack"' : ""}>${steps}</dl>
|
|
1706
|
+
<footer>This page was served by the tabbio CLI on this computer (127.0.0.1).</footer>
|
|
1707
|
+
</main></body></html>`;
|
|
1673
1708
|
}
|
|
1674
1709
|
function send(res, status, html) {
|
|
1675
1710
|
res.writeHead(status, {
|
|
@@ -1950,6 +1985,48 @@ async function logoutProfile(profile, creds, opts = {}) {
|
|
|
1950
1985
|
return { warnings, revokedSession };
|
|
1951
1986
|
}
|
|
1952
1987
|
|
|
1988
|
+
// src/core/context.ts
|
|
1989
|
+
function readGlobalOptions(cmd) {
|
|
1990
|
+
const raw = cmd ? cmd.optsWithGlobals() : {};
|
|
1991
|
+
const current = getGlobalOptions();
|
|
1992
|
+
return setGlobalOptions({
|
|
1993
|
+
profile: raw.profile ?? current.profile,
|
|
1994
|
+
apiUrl: raw.apiUrl ?? current.apiUrl,
|
|
1995
|
+
appUrl: raw.appUrl ?? current.appUrl,
|
|
1996
|
+
json: Boolean(raw.json ?? current.json),
|
|
1997
|
+
color: raw.color ?? current.color,
|
|
1998
|
+
debug: Boolean(raw.debug ?? current.debug),
|
|
1999
|
+
yes: Boolean(raw.yes ?? current.yes),
|
|
2000
|
+
quiet: Boolean(raw.quiet ?? current.quiet)
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
function createCommandContext(cmd) {
|
|
2004
|
+
const globals2 = readGlobalOptions(cmd);
|
|
2005
|
+
const { profile, sources } = resolveProfileWithSources({
|
|
2006
|
+
profile: globals2.profile,
|
|
2007
|
+
apiUrl: globals2.apiUrl,
|
|
2008
|
+
appUrl: globals2.appUrl
|
|
2009
|
+
});
|
|
2010
|
+
const credentials = loadCredentials(profile.name);
|
|
2011
|
+
const api = new ApiClient(profile, credentials);
|
|
2012
|
+
let session = null;
|
|
2013
|
+
return {
|
|
2014
|
+
globals: globals2,
|
|
2015
|
+
profile,
|
|
2016
|
+
sources,
|
|
2017
|
+
credentials,
|
|
2018
|
+
api,
|
|
2019
|
+
interactive: isInteractive() && !globals2.json,
|
|
2020
|
+
mcp() {
|
|
2021
|
+
session ??= McpSession.connect(profile, api.credentials ?? credentials, { api });
|
|
2022
|
+
return session;
|
|
2023
|
+
},
|
|
2024
|
+
async close() {
|
|
2025
|
+
if (session) await (await session.catch(() => null))?.close();
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
}
|
|
2029
|
+
|
|
1953
2030
|
export {
|
|
1954
2031
|
ExitCode,
|
|
1955
2032
|
EXIT_CODE_DOCS,
|
|
@@ -1967,6 +2044,7 @@ export {
|
|
|
1967
2044
|
heading,
|
|
1968
2045
|
relativeTime,
|
|
1969
2046
|
DEFAULT_PROFILE,
|
|
2047
|
+
PRODUCTION_APP_URL,
|
|
1970
2048
|
PROFILE_PRESETS,
|
|
1971
2049
|
configPaths,
|
|
1972
2050
|
loadConfig,
|
|
@@ -1994,6 +2072,7 @@ export {
|
|
|
1994
2072
|
CLI_PACKAGE_NAME,
|
|
1995
2073
|
checkForUpdate,
|
|
1996
2074
|
readRequestId,
|
|
2075
|
+
combineSignals,
|
|
1997
2076
|
ApiClient,
|
|
1998
2077
|
parseJsonResponse,
|
|
1999
2078
|
PRIMARY_AGENT_KEY,
|
|
@@ -2014,6 +2093,8 @@ export {
|
|
|
2014
2093
|
getMcpAccessState,
|
|
2015
2094
|
revokeSession,
|
|
2016
2095
|
credentialsFromLogin,
|
|
2017
|
-
logoutProfile
|
|
2096
|
+
logoutProfile,
|
|
2097
|
+
readGlobalOptions,
|
|
2098
|
+
createCommandContext
|
|
2018
2099
|
};
|
|
2019
|
-
//# sourceMappingURL=chunk-
|
|
2100
|
+
//# sourceMappingURL=chunk-XR6APSWD.js.map
|