@kodycodes/cli 3.1.5 → 3.2.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 +24 -2
- package/dist/{auth-NTZANX2B.js → auth-GVBMBBDV.js} +6 -4
- package/dist/auth.d.ts +24 -0
- package/dist/bin.js +6 -6
- package/dist/{chunk-AEJ6ZT67.js → chunk-2GSKFEWW.js} +2 -2
- package/dist/{chunk-V52NRCIT.js → chunk-FMBLQ7J2.js} +113 -58
- package/dist/chunk-FMBLQ7J2.js.map +6 -0
- package/dist/{chunk-PWFCXE4N.js → chunk-H4BN6EPW.js} +3 -3
- package/dist/{chunk-2YTCP3WU.js → chunk-LISUPAAK.js} +2 -2
- package/dist/{chunk-2YTCP3WU.js.map → chunk-LISUPAAK.js.map} +1 -1
- package/dist/{chunk-BGQBKEEG.js → chunk-NRLXYJKW.js} +3 -3
- package/dist/{chunk-VGO6VYIU.js → chunk-OIXNZ63K.js} +6 -6
- package/dist/{chunk-3ANPXKS3.js → chunk-OWIJPBAX.js} +4 -4
- package/dist/{chunk-MLQ5RB2C.js → chunk-SAK2XRKX.js} +3 -3
- package/dist/{chunk-Z4OZYLCE.js → chunk-VEYAO5OE.js} +289 -75
- package/dist/{chunk-Z4OZYLCE.js.map → chunk-VEYAO5OE.js.map} +1 -1
- package/dist/{chunk-TQISDGI4.js → chunk-ZK52DY36.js} +2 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +6 -6
- package/dist/{dev-command-XY5SDMPO.js → dev-command-NUN5HHRC.js} +7 -7
- package/dist/{git-credential-AGGSKTO3.js → git-credential-XTJ5JZ6V.js} +5 -5
- package/dist/{local-execute-VQBMQ3DE.js → local-execute-5J53ZM5Z.js} +4 -4
- package/dist/{local-package-graph-YHDXLH3V.js → local-package-graph-7TEPDAGV.js} +3 -3
- package/dist/{local-package-run-3NQ3N5JJ.js → local-package-run-OPC7VXO3.js} +7 -7
- package/dist/login-notice.d.ts +28 -1
- package/dist/{mock-dep-resolve-VWFSGZ5U.js → mock-dep-resolve-RRR74F7X.js} +5 -5
- package/dist/{mock-local-deps-4KSWAKJI.js → mock-local-deps-EUL62AHI.js} +4 -4
- package/dist/oauth-browser.d.ts +24 -0
- package/dist/{open-api-client-TIXO6ZXH.js → open-api-client-K2BEQBO3.js} +3 -3
- package/dist/{remote-execute-WUSAX4OB.js → remote-execute-BRXK2NIJ.js} +3 -3
- package/dist/{setup-git-S5WSARSD.js → setup-git-DCMWZYIG.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-V52NRCIT.js.map +0 -6
- /package/dist/{auth-NTZANX2B.js.map → auth-GVBMBBDV.js.map} +0 -0
- /package/dist/{chunk-AEJ6ZT67.js.map → chunk-2GSKFEWW.js.map} +0 -0
- /package/dist/{chunk-PWFCXE4N.js.map → chunk-H4BN6EPW.js.map} +0 -0
- /package/dist/{chunk-BGQBKEEG.js.map → chunk-NRLXYJKW.js.map} +0 -0
- /package/dist/{chunk-VGO6VYIU.js.map → chunk-OIXNZ63K.js.map} +0 -0
- /package/dist/{chunk-3ANPXKS3.js.map → chunk-OWIJPBAX.js.map} +0 -0
- /package/dist/{chunk-MLQ5RB2C.js.map → chunk-SAK2XRKX.js.map} +0 -0
- /package/dist/{chunk-TQISDGI4.js.map → chunk-ZK52DY36.js.map} +0 -0
- /package/dist/{dev-command-XY5SDMPO.js.map → dev-command-NUN5HHRC.js.map} +0 -0
- /package/dist/{git-credential-AGGSKTO3.js.map → git-credential-XTJ5JZ6V.js.map} +0 -0
- /package/dist/{local-execute-VQBMQ3DE.js.map → local-execute-5J53ZM5Z.js.map} +0 -0
- /package/dist/{local-package-graph-YHDXLH3V.js.map → local-package-graph-7TEPDAGV.js.map} +0 -0
- /package/dist/{local-package-run-3NQ3N5JJ.js.map → local-package-run-OPC7VXO3.js.map} +0 -0
- /package/dist/{mock-dep-resolve-VWFSGZ5U.js.map → mock-dep-resolve-RRR74F7X.js.map} +0 -0
- /package/dist/{mock-local-deps-4KSWAKJI.js.map → mock-local-deps-EUL62AHI.js.map} +0 -0
- /package/dist/{open-api-client-TIXO6ZXH.js.map → open-api-client-K2BEQBO3.js.map} +0 -0
- /package/dist/{remote-execute-WUSAX4OB.js.map → remote-execute-BRXK2NIJ.js.map} +0 -0
- /package/dist/{setup-git-S5WSARSD.js.map → setup-git-DCMWZYIG.js.map} +0 -0
package/README.md
CHANGED
|
@@ -70,13 +70,35 @@ org. Git auth stays user-wide (`kody auth setup-git` once covers every repo
|
|
|
70
70
|
across orgs). Existing single-org keychain credentials migrate silently into the
|
|
71
71
|
multi-org store as the active org (no re-login).
|
|
72
72
|
|
|
73
|
+
## Remote or headless machines
|
|
74
|
+
|
|
75
|
+
`kody login` opens a browser and waits for it on `http://127.0.0.1:43742`, so
|
|
76
|
+
the browser has to run on the same machine as the CLI. On a remote VM, a NAS, or
|
|
77
|
+
over SSH, use the device flow instead:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
kody login --device # prints a URL and a code; approve on any device
|
|
81
|
+
kody login --device --org acme # same, bound to the acme org
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The CLI prints `https://kody.codes/device` and an 8-letter code such as
|
|
85
|
+
`BCDF-GHJK`, plus a link that fills the code in for you. Open either one on your
|
|
86
|
+
phone or laptop, sign in, check that the code matches, and choose **Approve**.
|
|
87
|
+
The CLI polls in the background and stores the same device API token
|
|
88
|
+
`kody login` stores. Codes expire after 10 minutes. Only approve a code you
|
|
89
|
+
started yourself on a device you control.
|
|
90
|
+
|
|
91
|
+
`kody login` suggests `--device` when it detects an SSH session or no display,
|
|
92
|
+
when it cannot open a browser, or when the callback port is busy. The browser
|
|
93
|
+
flow stays the default.
|
|
94
|
+
|
|
73
95
|
## Commands
|
|
74
96
|
|
|
75
97
|
| Command | Purpose |
|
|
76
98
|
| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
99
|
| `kody install` | Detect running local MCP clients and write their remote MCP config. The host client starts OAuth when the user connects. **Recommended long-term path.** |
|
|
78
100
|
| `kody skill install` | Installs the hosted `kody-cli` skill (or the bundled stub offline) into Claude Code / Cursor / Codex / `.agents`. Later CLI runs refresh stale copies by digest. |
|
|
79
|
-
| `kody login` | Browser OAuth (CIMD + PKCE) for the CLI itself. Adds/replaces one org login (browser picker, or `kody login --org acme`) and keeps other org logins.
|
|
101
|
+
| `kody login` | Browser OAuth (CIMD + PKCE) for the CLI itself. Adds/replaces one org login (browser picker, or `kody login --org acme`) and keeps other org logins. `--device` signs in from another device instead ([Remote or headless machines](#remote-or-headless-machines)). |
|
|
80
102
|
| `kody org list` | Lists logged-in orgs and marks the active one. `--json` for agents. |
|
|
81
103
|
| `kody org use [<slug>]` | Switches the active org. With a slug (agents) switches directly; with no slug on a TTY opens a chooser; without a TTY pass a slug. |
|
|
82
104
|
| `kody logout` | Removes the active org login (or `--org <slug>` for one org) and clears a stored bootstrap/API token when appropriate. |
|
|
@@ -111,7 +133,7 @@ you pass `--token` explicitly):
|
|
|
111
133
|
|
|
112
134
|
```bash
|
|
113
135
|
# Preferred for agents on MCP (no tokenCreate, no second OAuth):
|
|
114
|
-
# 1. MCP api
|
|
136
|
+
# 1. MCP api tool, operationId cliCredentialBootstrap → { bootstrap_code, cli_command }
|
|
115
137
|
npx @kodycodes/cli auth bootstrap --code 'kody_bc_…' --lifetime short
|
|
116
138
|
npx @kodycodes/cli execute --local --file ./task.js
|
|
117
139
|
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
ensureOpenApiCredentials,
|
|
6
6
|
isAccessTokenExpired,
|
|
7
7
|
login,
|
|
8
|
+
loginWithDevice,
|
|
8
9
|
refreshStoredCredentials,
|
|
9
10
|
resolvePendingOrgSlug
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VEYAO5OE.js";
|
|
11
12
|
import "./chunk-CASGRYOF.js";
|
|
12
13
|
import "./chunk-GVSGNTG6.js";
|
|
13
14
|
import "./chunk-CWWHR4FH.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-2GSKFEWW.js";
|
|
15
16
|
import "./chunk-46IJPEID.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-LISUPAAK.js";
|
|
17
18
|
import "./chunk-BML3W5CO.js";
|
|
18
19
|
import "./chunk-NHRYNRXG.js";
|
|
19
20
|
import "./chunk-CMIH7XDH.js";
|
|
@@ -25,7 +26,8 @@ export {
|
|
|
25
26
|
ensureOpenApiCredentials,
|
|
26
27
|
isAccessTokenExpired,
|
|
27
28
|
login,
|
|
29
|
+
loginWithDevice,
|
|
28
30
|
refreshStoredCredentials,
|
|
29
31
|
resolvePendingOrgSlug
|
|
30
32
|
};
|
|
31
|
-
//# sourceMappingURL=auth-
|
|
33
|
+
//# sourceMappingURL=auth-GVBMBBDV.js.map
|
package/dist/auth.d.ts
CHANGED
|
@@ -118,3 +118,27 @@ export declare function login(options?: LoginOptions): Promise<{
|
|
|
118
118
|
org?: string;
|
|
119
119
|
account?: LoginCallbackAccount;
|
|
120
120
|
}>;
|
|
121
|
+
export type DeviceLoginPrompt = {
|
|
122
|
+
userCode: string;
|
|
123
|
+
verificationUri: string;
|
|
124
|
+
verificationUriComplete?: string;
|
|
125
|
+
expiresIn: number;
|
|
126
|
+
};
|
|
127
|
+
export type DeviceLoginOptions = Omit<LoginOptions, 'openBrowser' | 'onAuthorizationUrl' | 'onBrowserOpenResult' | 'openUrlFn'> & {
|
|
128
|
+
/** Called once with the code and URLs the person must open elsewhere. */
|
|
129
|
+
onDeviceCode?: (prompt: DeviceLoginPrompt) => void;
|
|
130
|
+
/** Test seam for the poll wait. */
|
|
131
|
+
sleep?: (ms: number) => Promise<void>;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* `kody login --device`: OAuth 2.0 Device Authorization Grant (RFC 8628,
|
|
135
|
+
* ADR 0082) for machines whose browser cannot reach the localhost callback.
|
|
136
|
+
* The result is stored exactly like the browser flow (device API token).
|
|
137
|
+
*/
|
|
138
|
+
export declare function loginWithDevice(options?: DeviceLoginOptions): Promise<{
|
|
139
|
+
credentials: StoredCredentials;
|
|
140
|
+
backendKind: 'keyring' | 'file';
|
|
141
|
+
backendPath?: string;
|
|
142
|
+
org?: string;
|
|
143
|
+
account?: LoginCallbackAccount;
|
|
144
|
+
}>;
|
package/dist/bin.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
runCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FMBLQ7J2.js";
|
|
6
6
|
import "./chunk-2XPH7L2P.js";
|
|
7
7
|
import "./chunk-SLNAWWQK.js";
|
|
8
8
|
import "./chunk-YDWTXEKQ.js";
|
|
9
9
|
import "./chunk-7PRJ36I5.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-H4BN6EPW.js";
|
|
11
|
+
import "./chunk-OWIJPBAX.js";
|
|
12
12
|
import "./chunk-6ZYUGXVW.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-VEYAO5OE.js";
|
|
14
14
|
import "./chunk-CASGRYOF.js";
|
|
15
15
|
import "./chunk-GVSGNTG6.js";
|
|
16
16
|
import "./chunk-CWWHR4FH.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-2GSKFEWW.js";
|
|
18
18
|
import "./chunk-46IJPEID.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-LISUPAAK.js";
|
|
20
20
|
import "./chunk-BML3W5CO.js";
|
|
21
21
|
import "./chunk-NHRYNRXG.js";
|
|
22
22
|
import "./chunk-CMIH7XDH.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readInsufficientScopeDetails,
|
|
8
8
|
readPackageVersion,
|
|
9
9
|
rejectedApiTokenMessage
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LISUPAAK.js";
|
|
11
11
|
import {
|
|
12
12
|
userCacheDir
|
|
13
13
|
} from "./chunk-BML3W5CO.js";
|
|
@@ -1687,4 +1687,4 @@ export {
|
|
|
1687
1687
|
toolResultFromHttpBody,
|
|
1688
1688
|
whoamiWithApiToken
|
|
1689
1689
|
};
|
|
1690
|
-
//# sourceMappingURL=chunk-
|
|
1690
|
+
//# sourceMappingURL=chunk-2GSKFEWW.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-7PRJ36I5.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveLocalExecuteBearer
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-H4BN6EPW.js";
|
|
18
18
|
import {
|
|
19
19
|
authBootstrap,
|
|
20
20
|
authBootstrapWithScopes,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
parseCliScopesFlag,
|
|
25
25
|
refreshGitCredentialHelperPinIfNeeded,
|
|
26
26
|
resolveCliTokenLifetime
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-OWIJPBAX.js";
|
|
28
28
|
import {
|
|
29
29
|
redactError
|
|
30
30
|
} from "./chunk-CASGRYOF.js";
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
readPackageVersion,
|
|
45
45
|
requireApiToken,
|
|
46
46
|
resolveScopedApiToken
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-LISUPAAK.js";
|
|
48
48
|
import {
|
|
49
49
|
deleteCredentials,
|
|
50
50
|
listStoredOrgs,
|
|
@@ -95,7 +95,7 @@ function buildUsage(input = {}) {
|
|
|
95
95
|
Install Kody as a remote MCP server in local agents, or use this CLI as a local client.
|
|
96
96
|
|
|
97
97
|
Usage:
|
|
98
|
-
kody login [--mcp-url <url>] [--org <slug>] [--no-browser]
|
|
98
|
+
kody login [--mcp-url <url>] [--org <slug>] [--no-browser | --device]
|
|
99
99
|
kody logout [--org <slug>] [--mcp-url <url>] [--api-url <url>]
|
|
100
100
|
kody org list [--json] [--mcp-url <url>]
|
|
101
101
|
kody org use [<slug>] [--mcp-url <url>]
|
|
@@ -156,10 +156,10 @@ ${orgBlock}
|
|
|
156
156
|
--clients Comma-separated ids: ${hostIds.join(", ")}
|
|
157
157
|
|
|
158
158
|
auth bootstrap
|
|
159
|
-
Agents on Kody MCP: call \`
|
|
160
|
-
\`
|
|
161
|
-
|
|
162
|
-
\`
|
|
159
|
+
Agents on Kody MCP: call the MCP \`api\` tool with operationId
|
|
160
|
+
\`cliCredentialBootstrap\` and params \`{ lifetime: "short",
|
|
161
|
+
scopes: [...] }\` (\`execute\` is refused) and run the returned
|
|
162
|
+
\`cli_command\`
|
|
163
163
|
(never ask a human to paste a token). Humans: \`kody login\`.
|
|
164
164
|
This command redeems a one-shot \`kody_bc_\u2026\` (POST
|
|
165
165
|
/v1/tokens/bootstrap/redeem, no Authorization header).
|
|
@@ -711,7 +711,57 @@ function formatLoginUrlNotice(input) {
|
|
|
711
711
|
Waiting for you to finish signing in\u2026
|
|
712
712
|
`;
|
|
713
713
|
}
|
|
714
|
-
var loginBrowserOpenFailedNotice = "Kody could not open your browser automatically. Copy the link above into your browser to continue.\n";
|
|
714
|
+
var loginBrowserOpenFailedNotice = "Kody could not open your browser automatically. Copy the link above into your browser to continue.\nIf that browser is on another machine, press Ctrl+C and run `kody login --device` instead.\n";
|
|
715
|
+
function detectHeadlessLoginReason(env = process.env, platform = process.platform) {
|
|
716
|
+
if (env.SSH_CONNECTION || env.SSH_CLIENT || env.SSH_TTY) return "ssh";
|
|
717
|
+
if (platform !== "darwin" && platform !== "win32" && !env.DISPLAY && !env.WAYLAND_DISPLAY) {
|
|
718
|
+
return "no_display";
|
|
719
|
+
}
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
function formatDeviceLoginSuggestion(reason) {
|
|
723
|
+
const why = reason === "ssh" ? "This looks like an SSH session" : "No display was found on this machine";
|
|
724
|
+
return `${why}, so a browser here may not be able to finish the sign-in.
|
|
725
|
+
If it can't, press Ctrl+C and run \`kody login --device\` to sign in from any other device.
|
|
726
|
+
|
|
727
|
+
`;
|
|
728
|
+
}
|
|
729
|
+
function formatDeviceLoginNotice(input) {
|
|
730
|
+
const minutes = Math.max(1, Math.round(input.expiresIn / 60));
|
|
731
|
+
const direct = input.verificationUriComplete ? `
|
|
732
|
+
Or open this link, which fills in the code for you:
|
|
733
|
+
|
|
734
|
+
${input.verificationUriComplete}
|
|
735
|
+
` : "";
|
|
736
|
+
return `To sign in, open this page on any device:
|
|
737
|
+
|
|
738
|
+
${input.verificationUri}
|
|
739
|
+
|
|
740
|
+
and enter the code:
|
|
741
|
+
|
|
742
|
+
${input.userCode}
|
|
743
|
+
${direct}
|
|
744
|
+
Only approve it if the page shows this same code. The code expires in ${minutes} minutes.
|
|
745
|
+
Waiting for approval\u2026
|
|
746
|
+
`;
|
|
747
|
+
}
|
|
748
|
+
function formatLoginSuccess(result) {
|
|
749
|
+
const orgLabel = result.org ? ` as org ${result.org}` : result.credentials.org ? ` as org ${result.credentials.org}` : "";
|
|
750
|
+
const accountLabel = result.account?.email ? ` (${result.account.email})` : result.account?.displayName ? ` (${result.account.displayName})` : "";
|
|
751
|
+
const lines = [
|
|
752
|
+
`Logged in to ${result.credentials.mcpUrl}${orgLabel}${accountLabel}.
|
|
753
|
+
`
|
|
754
|
+
];
|
|
755
|
+
if (result.backendKind === "file" && result.backendPath) {
|
|
756
|
+
lines.push(
|
|
757
|
+
`OS keychain was unavailable; credentials saved at ${result.backendPath} (mode 0600).
|
|
758
|
+
`
|
|
759
|
+
);
|
|
760
|
+
} else {
|
|
761
|
+
lines.push("Credentials stored in the OS keychain.\n");
|
|
762
|
+
}
|
|
763
|
+
return lines.join("");
|
|
764
|
+
}
|
|
715
765
|
|
|
716
766
|
// src/cli.ts
|
|
717
767
|
var orgScopedCommands = /* @__PURE__ */ new Set([
|
|
@@ -755,6 +805,7 @@ var cliFlagOptions = {
|
|
|
755
805
|
scopes: { type: "string" },
|
|
756
806
|
project: { type: "boolean" },
|
|
757
807
|
"no-browser": { type: "boolean" },
|
|
808
|
+
device: { type: "boolean" },
|
|
758
809
|
org: { type: "string" },
|
|
759
810
|
target: { type: "string" },
|
|
760
811
|
"reset-storage": { type: "boolean" },
|
|
@@ -948,14 +999,31 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
948
999
|
`);
|
|
949
1000
|
return 0;
|
|
950
1001
|
case "login": {
|
|
951
|
-
const { login } = await import("./auth-
|
|
1002
|
+
const { login, loginWithDevice } = await import("./auth-GVBMBBDV.js");
|
|
952
1003
|
const openBrowser = parsed.values["no-browser"] !== true;
|
|
1004
|
+
const lifetimeOption = typeof parsed.values.lifetime === "string" ? {
|
|
1005
|
+
lifetime: parsed.values.lifetime === "short" ? "short" : "long"
|
|
1006
|
+
} : {};
|
|
1007
|
+
const loginApiUrl = apiUrlFrom({
|
|
1008
|
+
apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
|
|
1009
|
+
});
|
|
1010
|
+
if (parsed.values.device === true) {
|
|
1011
|
+
const result2 = await loginWithDevice({
|
|
1012
|
+
mcpUrl,
|
|
1013
|
+
apiUrl: loginApiUrl,
|
|
1014
|
+
...lifetimeOption,
|
|
1015
|
+
...orgFlagOnly ? { org: orgFlagOnly } : {},
|
|
1016
|
+
onDeviceCode: (prompt) => write(formatDeviceLoginNotice(prompt))
|
|
1017
|
+
});
|
|
1018
|
+
write(formatLoginSuccess(result2));
|
|
1019
|
+
return 0;
|
|
1020
|
+
}
|
|
1021
|
+
const headlessReason = openBrowser ? detectHeadlessLoginReason() : null;
|
|
1022
|
+
if (headlessReason) write(formatDeviceLoginSuggestion(headlessReason));
|
|
953
1023
|
const result = await login({
|
|
954
1024
|
mcpUrl,
|
|
955
|
-
apiUrl:
|
|
956
|
-
|
|
957
|
-
}),
|
|
958
|
-
...typeof parsed.values.lifetime === "string" ? { lifetime: parsed.values.lifetime === "short" ? "short" : "long" } : {},
|
|
1025
|
+
apiUrl: loginApiUrl,
|
|
1026
|
+
...lifetimeOption,
|
|
959
1027
|
...orgFlagOnly ? { org: orgFlagOnly } : {},
|
|
960
1028
|
openBrowser,
|
|
961
1029
|
onAuthorizationUrl: (url) => {
|
|
@@ -965,20 +1033,7 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
965
1033
|
if (!opened) write(loginBrowserOpenFailedNotice);
|
|
966
1034
|
}
|
|
967
1035
|
});
|
|
968
|
-
|
|
969
|
-
const accountLabel = result.account?.email ? ` (${result.account.email})` : result.account?.displayName ? ` (${result.account.displayName})` : "";
|
|
970
|
-
write(
|
|
971
|
-
`Logged in to ${result.credentials.mcpUrl}${orgLabel}${accountLabel}.
|
|
972
|
-
`
|
|
973
|
-
);
|
|
974
|
-
if (result.backendKind === "file" && result.backendPath) {
|
|
975
|
-
write(
|
|
976
|
-
`OS keychain was unavailable; credentials saved at ${result.backendPath} (mode 0600).
|
|
977
|
-
`
|
|
978
|
-
);
|
|
979
|
-
} else {
|
|
980
|
-
write("Credentials stored in the OS keychain.\n");
|
|
981
|
-
}
|
|
1036
|
+
write(formatLoginSuccess(result));
|
|
982
1037
|
return 0;
|
|
983
1038
|
}
|
|
984
1039
|
case "logout": {
|
|
@@ -1112,7 +1167,7 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
1112
1167
|
);
|
|
1113
1168
|
if (!code && !scopes) {
|
|
1114
1169
|
throw new Error(
|
|
1115
|
-
"Provide --code <kody_bc_\u2026> from cliCredentialBootstrap (MCP api
|
|
1170
|
+
"Provide --code <kody_bc_\u2026> from cliCredentialBootstrap (MCP api tool), or --scopes <list> to mint one with the current kody login session or API token."
|
|
1116
1171
|
);
|
|
1117
1172
|
}
|
|
1118
1173
|
const lifetime = resolveCliTokenLifetime({
|
|
@@ -1174,7 +1229,7 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
1174
1229
|
parseGitCredentialAction,
|
|
1175
1230
|
parseGitCredentialInput,
|
|
1176
1231
|
readGitCredentialStdin
|
|
1177
|
-
} = await import("./git-credential-
|
|
1232
|
+
} = await import("./git-credential-XTJ5JZ6V.js");
|
|
1178
1233
|
const action = parseGitCredentialAction(parsed.positionals);
|
|
1179
1234
|
const raw = await readGitCredentialStdin(process.stdin);
|
|
1180
1235
|
const output = await handleGitCredential({
|
|
@@ -1241,7 +1296,7 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
1241
1296
|
allowEnvWithoutLogin: true,
|
|
1242
1297
|
...org ? { org } : {}
|
|
1243
1298
|
})) {
|
|
1244
|
-
const { whoamiWithApiToken: whoamiWithApiToken2 } = await import("./open-api-client-
|
|
1299
|
+
const { whoamiWithApiToken: whoamiWithApiToken2 } = await import("./open-api-client-K2BEQBO3.js");
|
|
1245
1300
|
const identity2 = await whoamiWithApiToken2({
|
|
1246
1301
|
token: requireApiToken(tokenValues, process.env, "whoami", {
|
|
1247
1302
|
apiUrl
|
|
@@ -1268,13 +1323,13 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
1268
1323
|
);
|
|
1269
1324
|
return 0;
|
|
1270
1325
|
}
|
|
1271
|
-
const { ensureOpenApiCredentials } = await import("./auth-
|
|
1326
|
+
const { ensureOpenApiCredentials } = await import("./auth-GVBMBBDV.js");
|
|
1272
1327
|
const credentials = await ensureOpenApiCredentials({
|
|
1273
1328
|
mcpUrl,
|
|
1274
1329
|
org,
|
|
1275
1330
|
apiUrl
|
|
1276
1331
|
});
|
|
1277
|
-
const { whoamiWithApiToken } = await import("./open-api-client-
|
|
1332
|
+
const { whoamiWithApiToken } = await import("./open-api-client-K2BEQBO3.js");
|
|
1278
1333
|
const identity = await whoamiWithApiToken({
|
|
1279
1334
|
token: credentials.accessToken,
|
|
1280
1335
|
apiUrl,
|
|
@@ -1328,7 +1383,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1328
1383
|
});
|
|
1329
1384
|
apiUrl = mock.apiUrl;
|
|
1330
1385
|
closeMock = mock.started ? () => mock.server.close() : void 0;
|
|
1331
|
-
const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-
|
|
1386
|
+
const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-K2BEQBO3.js");
|
|
1332
1387
|
const result2 = await searchWithApiToken2({
|
|
1333
1388
|
token: mock.token,
|
|
1334
1389
|
apiUrl,
|
|
@@ -1347,7 +1402,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1347
1402
|
allowEnvWithoutLogin: true,
|
|
1348
1403
|
...org ? { org } : {}
|
|
1349
1404
|
})) {
|
|
1350
|
-
const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-
|
|
1405
|
+
const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-K2BEQBO3.js");
|
|
1351
1406
|
const result2 = await searchWithApiToken2({
|
|
1352
1407
|
token: requireApiToken(tokenValues, process.env, "search", {
|
|
1353
1408
|
apiUrl
|
|
@@ -1362,13 +1417,13 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1362
1417
|
write(formatToolResult(result2, json));
|
|
1363
1418
|
return result2.isError ? 1 : 0;
|
|
1364
1419
|
}
|
|
1365
|
-
const { ensureOpenApiCredentials } = await import("./auth-
|
|
1420
|
+
const { ensureOpenApiCredentials } = await import("./auth-GVBMBBDV.js");
|
|
1366
1421
|
const credentials = await ensureOpenApiCredentials({
|
|
1367
1422
|
mcpUrl,
|
|
1368
1423
|
org,
|
|
1369
1424
|
apiUrl
|
|
1370
1425
|
});
|
|
1371
|
-
const { searchWithApiToken } = await import("./open-api-client-
|
|
1426
|
+
const { searchWithApiToken } = await import("./open-api-client-K2BEQBO3.js");
|
|
1372
1427
|
const result = await searchWithApiToken({
|
|
1373
1428
|
token: credentials.accessToken,
|
|
1374
1429
|
apiUrl,
|
|
@@ -1475,7 +1530,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1475
1530
|
apiUrl = mock.apiUrl;
|
|
1476
1531
|
mockToken = mock.token;
|
|
1477
1532
|
closeMock = mock.started ? () => mock.server.close() : void 0;
|
|
1478
|
-
const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-
|
|
1533
|
+
const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-RRR74F7X.js");
|
|
1479
1534
|
mockDepResolve = await tryResolveMockDepResolve({
|
|
1480
1535
|
tokenValues,
|
|
1481
1536
|
apiUrl: prodApiUrl,
|
|
@@ -1484,7 +1539,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1484
1539
|
});
|
|
1485
1540
|
}
|
|
1486
1541
|
if (localPackageRun) {
|
|
1487
|
-
const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-
|
|
1542
|
+
const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-OPC7VXO3.js");
|
|
1488
1543
|
const result2 = await runLocalPackageModule({
|
|
1489
1544
|
modulePath: localPackageRun.modulePath,
|
|
1490
1545
|
params: args.params,
|
|
@@ -1528,7 +1583,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1528
1583
|
packageRootForMocks = void 0;
|
|
1529
1584
|
}
|
|
1530
1585
|
}
|
|
1531
|
-
const result = local ? await (await import("./local-execute-
|
|
1586
|
+
const result = local ? await (await import("./local-execute-5J53ZM5Z.js")).runLocalExecute({
|
|
1532
1587
|
code: args.code,
|
|
1533
1588
|
...modulePath !== void 0 ? { modulePath } : {},
|
|
1534
1589
|
params: args.params,
|
|
@@ -1550,7 +1605,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1550
1605
|
allowPrivateNetwork: parsed.values["allow-private-network"] === true,
|
|
1551
1606
|
onStatus: (message) => writeErr(`${message}
|
|
1552
1607
|
`)
|
|
1553
|
-
}) : useToken ? await (await import("./remote-execute-
|
|
1608
|
+
}) : useToken ? await (await import("./remote-execute-BRXK2NIJ.js")).runRemoteExecuteWithToken({
|
|
1554
1609
|
code: typeof args.code === "string" ? args.code : void 0,
|
|
1555
1610
|
invoke,
|
|
1556
1611
|
params: args.params,
|
|
@@ -1565,13 +1620,13 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1565
1620
|
apiUrl,
|
|
1566
1621
|
...org ? { org } : {}
|
|
1567
1622
|
}) : await (async () => {
|
|
1568
|
-
const { ensureOpenApiCredentials } = await import("./auth-
|
|
1623
|
+
const { ensureOpenApiCredentials } = await import("./auth-GVBMBBDV.js");
|
|
1569
1624
|
const session = await ensureOpenApiCredentials({
|
|
1570
1625
|
mcpUrl,
|
|
1571
1626
|
org,
|
|
1572
1627
|
apiUrl
|
|
1573
1628
|
});
|
|
1574
|
-
return (await import("./remote-execute-
|
|
1629
|
+
return (await import("./remote-execute-BRXK2NIJ.js")).runRemoteExecuteWithToken({
|
|
1575
1630
|
code: typeof args.code === "string" ? args.code : void 0,
|
|
1576
1631
|
invoke,
|
|
1577
1632
|
params: args.params,
|
|
@@ -1586,7 +1641,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1586
1641
|
return result.isError ? 1 : 0;
|
|
1587
1642
|
} catch (error) {
|
|
1588
1643
|
if (json && local) {
|
|
1589
|
-
const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-
|
|
1644
|
+
const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-7TEPDAGV.js");
|
|
1590
1645
|
if (error instanceof LocalPackageGraphError) {
|
|
1591
1646
|
const redacted = redactError(error).message;
|
|
1592
1647
|
const result = packageGraphErrorToolResult(error);
|
|
@@ -1616,7 +1671,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1616
1671
|
runDevServe,
|
|
1617
1672
|
runDevWebhook,
|
|
1618
1673
|
tryAttachedDevFetch
|
|
1619
|
-
} = await import("./dev-command-
|
|
1674
|
+
} = await import("./dev-command-NUN5HHRC.js");
|
|
1620
1675
|
const target = resolveTarget({
|
|
1621
1676
|
command: "dev",
|
|
1622
1677
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
@@ -1642,8 +1697,8 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1642
1697
|
{ callOpenApiOperation, formatOpenApiHttpDebugLine },
|
|
1643
1698
|
{ parsePackageCheckResult, PublishChecksAuthError }
|
|
1644
1699
|
] = await Promise.all([
|
|
1645
|
-
import("./open-api-client-
|
|
1646
|
-
import("./dev-command-
|
|
1700
|
+
import("./open-api-client-K2BEQBO3.js"),
|
|
1701
|
+
import("./dev-command-NUN5HHRC.js")
|
|
1647
1702
|
]);
|
|
1648
1703
|
let token2;
|
|
1649
1704
|
try {
|
|
@@ -1754,7 +1809,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1754
1809
|
purpose: "kody dev",
|
|
1755
1810
|
...org ? { org } : {}
|
|
1756
1811
|
}) : "mock";
|
|
1757
|
-
const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-
|
|
1812
|
+
const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-RRR74F7X.js")).tryResolveMockDepResolve({
|
|
1758
1813
|
tokenValues,
|
|
1759
1814
|
apiUrl: prodApiUrl,
|
|
1760
1815
|
mcpUrl,
|
|
@@ -1895,7 +1950,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1895
1950
|
const params = parseApiParamsJson(
|
|
1896
1951
|
typeof parsed.values.params === "string" ? parsed.values.params : void 0
|
|
1897
1952
|
);
|
|
1898
|
-
const { callOpenApiOperation } = await import("./open-api-client-
|
|
1953
|
+
const { callOpenApiOperation } = await import("./open-api-client-K2BEQBO3.js");
|
|
1899
1954
|
const result = await callOpenApiOperation({
|
|
1900
1955
|
operationId,
|
|
1901
1956
|
params,
|
|
@@ -1930,7 +1985,7 @@ scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
|
1930
1985
|
mcpUrl,
|
|
1931
1986
|
org
|
|
1932
1987
|
});
|
|
1933
|
-
const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-
|
|
1988
|
+
const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-K2BEQBO3.js");
|
|
1934
1989
|
write(
|
|
1935
1990
|
await runPackageCollaboratorPlan({
|
|
1936
1991
|
plan,
|
|
@@ -1956,7 +2011,7 @@ ${packageCollaboratorUsage}`
|
|
|
1956
2011
|
positional: parsed.positionals[1],
|
|
1957
2012
|
paramsJson: typeof parsed.values.params === "string" ? parsed.values.params : void 0
|
|
1958
2013
|
});
|
|
1959
|
-
const { callOpenApiOperation } = await import("./open-api-client-
|
|
2014
|
+
const { callOpenApiOperation } = await import("./open-api-client-K2BEQBO3.js");
|
|
1960
2015
|
const publishToken = await accessTokenForOpenApi({
|
|
1961
2016
|
tokenValues,
|
|
1962
2017
|
apiUrl,
|
|
@@ -2094,7 +2149,7 @@ function attachExecuteCommonArgs(args, input) {
|
|
|
2094
2149
|
return args;
|
|
2095
2150
|
}
|
|
2096
2151
|
async function runAuthSetupGit(input) {
|
|
2097
|
-
const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-
|
|
2152
|
+
const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-DCMWZYIG.js");
|
|
2098
2153
|
const apiUrl = apiUrlFrom({
|
|
2099
2154
|
apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
|
|
2100
2155
|
});
|
|
@@ -2151,7 +2206,7 @@ async function runAuthSetupGit(input) {
|
|
|
2151
2206
|
return 0;
|
|
2152
2207
|
}
|
|
2153
2208
|
async function runAuthRemoveGit(input) {
|
|
2154
|
-
const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-
|
|
2209
|
+
const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-DCMWZYIG.js");
|
|
2155
2210
|
const apiUrl = apiUrlFrom({
|
|
2156
2211
|
apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
|
|
2157
2212
|
});
|
|
@@ -2179,7 +2234,7 @@ function bootstrapMinter(input) {
|
|
|
2179
2234
|
apiUrl: input.apiUrl
|
|
2180
2235
|
}
|
|
2181
2236
|
);
|
|
2182
|
-
const { callOpenApiOperation } = await import("./open-api-client-
|
|
2237
|
+
const { callOpenApiOperation } = await import("./open-api-client-K2BEQBO3.js");
|
|
2183
2238
|
try {
|
|
2184
2239
|
return await callOpenApiOperation({
|
|
2185
2240
|
token,
|
|
@@ -2200,13 +2255,13 @@ function bootstrapMinter(input) {
|
|
|
2200
2255
|
if (loadCredentials(input.mcpUrl, void 0, void 0, {
|
|
2201
2256
|
org: input.org
|
|
2202
2257
|
})) {
|
|
2203
|
-
const { ensureOpenApiCredentials } = await import("./auth-
|
|
2258
|
+
const { ensureOpenApiCredentials } = await import("./auth-GVBMBBDV.js");
|
|
2204
2259
|
const session = await ensureOpenApiCredentials({
|
|
2205
2260
|
mcpUrl: input.mcpUrl,
|
|
2206
2261
|
apiUrl: input.apiUrl,
|
|
2207
2262
|
...input.org ? { org: input.org } : {}
|
|
2208
2263
|
});
|
|
2209
|
-
const { callOpenApiOperation } = await import("./open-api-client-
|
|
2264
|
+
const { callOpenApiOperation } = await import("./open-api-client-K2BEQBO3.js");
|
|
2210
2265
|
return callOpenApiOperation({
|
|
2211
2266
|
operationId: cliCredentialBootstrapOperationId,
|
|
2212
2267
|
params,
|
|
@@ -2232,7 +2287,7 @@ async function accessTokenForOpenApi(input) {
|
|
|
2232
2287
|
apiUrl: input.apiUrl
|
|
2233
2288
|
});
|
|
2234
2289
|
if (explicit) return explicit;
|
|
2235
|
-
const { ensureOpenApiCredentials } = await import("./auth-
|
|
2290
|
+
const { ensureOpenApiCredentials } = await import("./auth-GVBMBBDV.js");
|
|
2236
2291
|
const session = await ensureOpenApiCredentials({
|
|
2237
2292
|
mcpUrl: input.mcpUrl,
|
|
2238
2293
|
apiUrl: input.apiUrl,
|
|
@@ -2317,4 +2372,4 @@ export {
|
|
|
2317
2372
|
resolvePackagePublishTarget,
|
|
2318
2373
|
shouldUseApiToken
|
|
2319
2374
|
};
|
|
2320
|
-
//# sourceMappingURL=chunk-
|
|
2375
|
+
//# sourceMappingURL=chunk-FMBLQ7J2.js.map
|