@namzu/cli 14.2.0 → 14.2.1
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 +8 -6
- package/dist/commands/login.d.ts +21 -3
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +33 -21
- package/dist/commands/login.js.map +1 -1
- package/dist/integrations/providers/identity.d.ts +16 -21
- package/dist/integrations/providers/identity.d.ts.map +1 -1
- package/dist/integrations/providers/identity.js +16 -21
- package/dist/integrations/providers/identity.js.map +1 -1
- package/dist/integrations/providers/index.d.ts +1 -1
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/index.js +1 -1
- package/dist/integrations/providers/index.js.map +1 -1
- package/dist/integrations/providers/subscription-login.d.ts +7 -41
- package/dist/integrations/providers/subscription-login.d.ts.map +1 -1
- package/dist/integrations/providers/subscription-login.js +16 -143
- package/dist/integrations/providers/subscription-login.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +76 -71
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Picker.d.ts +4 -2
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/Picker.js +99 -10
- package/dist/tui/Picker.js.map +1 -1
- package/dist/tui/StatusBar.d.ts +1 -1
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/StatusBar.js +8 -5
- package/dist/tui/StatusBar.js.map +1 -1
- package/dist/tui/login-prompt.d.ts +0 -1
- package/dist/tui/login-prompt.d.ts.map +1 -1
- package/dist/tui/login-prompt.js +1 -6
- package/dist/tui/login-prompt.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -77,15 +77,17 @@ must rotate its refresh grant, Namzu preserves the complete owner envelope and
|
|
|
77
77
|
publishes the successor pair back to that exact file so `Claude` is not logged
|
|
78
78
|
out. A Namzu-owned sign-in is needed only when no usable device session exists
|
|
79
79
|
or when you explicitly want a separate login; its `Claude` route uses direct
|
|
80
|
-
subscription authorization rather than API-usage billing
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
subscription authorization rather than API-usage billing, and its returned
|
|
81
|
+
authorization code can be pasted back into the same picker that started it.
|
|
82
|
+
API keys remain optional alternatives through environment variables or the
|
|
83
|
+
session-only credential picker, and detecting one does not hide the subscription
|
|
84
|
+
sign-in action.
|
|
84
85
|
|
|
85
86
|
Bare `/effort` and `/permissions` open finite keyboard choosers; their argument
|
|
86
87
|
forms remain available for scripts. The footer keeps `model effort · cwd` on the
|
|
87
|
-
left and reserves the right edge for
|
|
88
|
-
state.
|
|
88
|
+
left and reserves the right edge for a state-specific interaction or durable
|
|
89
|
+
goal state. Idle conversation leaves the key legend to `/help` instead of
|
|
90
|
+
repeating it on every frame.
|
|
89
91
|
|
|
90
92
|
Repository policy stays live for the whole session. The CLI starts with the
|
|
91
93
|
applicable `AGENTS.md` chain, discovers nested instruction files after
|
package/dist/commands/login.d.ts
CHANGED
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
* started. There is no `--code` flag for that reason: it would look like it
|
|
28
28
|
* should work and could not.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* The registered browser callback shows a code rather than returning to a
|
|
31
|
+
* local listener. Standard input takes that code or the finished address;
|
|
32
|
+
* the timeout bounds an unattended terminal.
|
|
33
33
|
*/
|
|
34
34
|
import { type SubscriptionProviderId } from '../integrations/providers/index.js';
|
|
35
35
|
import type { CommandDef } from './types.js';
|
|
@@ -40,6 +40,24 @@ interface LoginFlags {
|
|
|
40
40
|
readonly unknown: readonly string[];
|
|
41
41
|
}
|
|
42
42
|
export declare function parseLoginFlags(argv: readonly string[]): LoginFlags;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve with the first NON-BLANK line standard input offers, or never.
|
|
45
|
+
*
|
|
46
|
+
* Two deliberate choices, both found by running this rather than by reading it.
|
|
47
|
+
*
|
|
48
|
+
* **Blank lines are ignored, not answered.** `once('line')` took a bare Enter
|
|
49
|
+
* — the keystroke a person makes while waiting, and the one a piped empty
|
|
50
|
+
* stdin delivers immediately — and spent the sign-in on it: the empty string
|
|
51
|
+
* went to `completeWithPastedCode`, came back "that does not contain an
|
|
52
|
+
* authorization code", and the attempt was over before the browser had loaded
|
|
53
|
+
* the page.
|
|
54
|
+
*
|
|
55
|
+
* **A closed or absent stream resolves as absent, not as a blank code.** A
|
|
56
|
+
* pending promise with only an unref'd timeout does not keep Node alive, so
|
|
57
|
+
* `< /dev/null` otherwise exits zero before printing an outcome. The caller
|
|
58
|
+
* turns absence into an explicit failed login.
|
|
59
|
+
*/
|
|
60
|
+
export declare function firstStdinLine(signal: AbortSignal, input?: NodeJS.ReadableStream): Promise<string | null>;
|
|
43
61
|
export declare const loginCommand: CommandDef;
|
|
44
62
|
export declare const logoutCommand: CommandDef;
|
|
45
63
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,EAEN,KAAK,sBAAsB,EAO3B,MAAM,oCAAoC,CAAA;AAQ3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAsB5C,UAAU,UAAU;IACnB,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAsCnE;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,EAEN,KAAK,sBAAsB,EAO3B,MAAM,oCAAoC,CAAA;AAQ3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAsB5C,UAAU,UAAU;IACnB,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAsCnE;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,WAAW,EACnB,KAAK,GAAE,MAAM,CAAC,cAA8B,GAC1C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuBxB;AAED,eAAO,MAAM,YAAY,EAAE,UA4G1B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,UAiB3B,CAAA"}
|
package/dist/commands/login.js
CHANGED
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
* started. There is no `--code` flag for that reason: it would look like it
|
|
28
28
|
* should work and could not.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* The registered browser callback shows a code rather than returning to a
|
|
31
|
+
* local listener. Standard input takes that code or the finished address;
|
|
32
|
+
* the timeout bounds an unattended terminal.
|
|
33
33
|
*/
|
|
34
34
|
import { createInterface } from 'node:readline';
|
|
35
35
|
import { EXIT_FAIL, EXIT_OK, EXIT_USAGE } from '../exit-codes.js';
|
|
@@ -46,8 +46,8 @@ const LOGIN_HELP = [
|
|
|
46
46
|
' --timeout <seconds> Give up waiting after this long (default: 300).',
|
|
47
47
|
' -h, --help Show this help.',
|
|
48
48
|
'',
|
|
49
|
-
'Claude sign-in opens a browser
|
|
50
|
-
'
|
|
49
|
+
'Claude sign-in opens a registered browser flow; paste the returned code or',
|
|
50
|
+
'finished address into this terminal. Codex sign-in prints a device code and',
|
|
51
51
|
'polls while you approve it in the browser.',
|
|
52
52
|
'',
|
|
53
53
|
'The credential is written to ~/.namzu/credentials.json, readable only by your',
|
|
@@ -110,27 +110,36 @@ export function parseLoginFlags(argv) {
|
|
|
110
110
|
* authorization code", and the attempt was over before the browser had loaded
|
|
111
111
|
* the page.
|
|
112
112
|
*
|
|
113
|
-
* **A closed or absent stream
|
|
114
|
-
*
|
|
115
|
-
* `< /dev/null`
|
|
116
|
-
*
|
|
113
|
+
* **A closed or absent stream resolves as absent, not as a blank code.** A
|
|
114
|
+
* pending promise with only an unref'd timeout does not keep Node alive, so
|
|
115
|
+
* `< /dev/null` otherwise exits zero before printing an outcome. The caller
|
|
116
|
+
* turns absence into an explicit failed login.
|
|
117
117
|
*/
|
|
118
|
-
function firstStdinLine(signal) {
|
|
118
|
+
export function firstStdinLine(signal, input = process.stdin) {
|
|
119
|
+
if (!input.readable)
|
|
120
|
+
return Promise.resolve(null);
|
|
119
121
|
return new Promise((resolve) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
const rl = createInterface({ input });
|
|
123
|
+
let settled = false;
|
|
124
|
+
const finish = (value) => {
|
|
125
|
+
if (settled)
|
|
126
|
+
return;
|
|
127
|
+
settled = true;
|
|
128
|
+
signal.removeEventListener('abort', onAbort);
|
|
129
|
+
resolve(value);
|
|
130
|
+
};
|
|
131
|
+
const onAbort = () => {
|
|
132
|
+
finish(null);
|
|
124
133
|
rl.close();
|
|
125
134
|
};
|
|
126
|
-
signal.addEventListener('abort',
|
|
135
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
127
136
|
rl.on('line', (line) => {
|
|
128
137
|
if (line.trim().length === 0)
|
|
129
138
|
return;
|
|
130
|
-
|
|
139
|
+
finish(line);
|
|
131
140
|
rl.close();
|
|
132
|
-
resolve(line);
|
|
133
141
|
});
|
|
142
|
+
rl.once('close', () => finish(null));
|
|
134
143
|
});
|
|
135
144
|
}
|
|
136
145
|
export const loginCommand = {
|
|
@@ -197,7 +206,6 @@ export const loginCommand = {
|
|
|
197
206
|
ctx.formatter.print({
|
|
198
207
|
text: describeLoginStart({
|
|
199
208
|
url: login.url,
|
|
200
|
-
loopback: login.loopback,
|
|
201
209
|
browserOpened: flags.noBrowser ? false : openInBrowser(login.url),
|
|
202
210
|
completionHint: 'paste it here and press enter',
|
|
203
211
|
}),
|
|
@@ -207,9 +215,13 @@ export const loginCommand = {
|
|
|
207
215
|
ok: false,
|
|
208
216
|
reason: 'Timed out waiting for the sign-in to finish. Nothing was stored.',
|
|
209
217
|
}), flags.timeoutMs).unref());
|
|
210
|
-
const pasted = firstStdinLine(stop.signal).then((line) =>
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
const pasted = firstStdinLine(stop.signal).then((line) => line === null
|
|
219
|
+
? {
|
|
220
|
+
ok: false,
|
|
221
|
+
reason: 'Standard input closed before an authorization code was pasted. Nothing was stored.',
|
|
222
|
+
}
|
|
223
|
+
: login.completeWithPastedCode(line));
|
|
224
|
+
const outcome = await Promise.race([pasted, timeout]);
|
|
213
225
|
stop.abort();
|
|
214
226
|
login.cancel();
|
|
215
227
|
ctx.formatter.print({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAGN,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,eAAe,EACf,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,oCAAoC,CAAA;AAC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AC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;IACxC,CAAC;CACD,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAe;IACxC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,kEAAkE;IAC/E,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,eAAe,EAAE,CAAA;QAC9B,MAAM,GAAG,GAAG,gCAAgC,EAAE,KAAK,IAAI,IAAI,yBAAyB,EAAE,KAAK,IAAI,CAAA;QAC/F,IAAI,CAAC;YACJ,yBAAyB,EAAE,CAAA;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC;gBACnB,IAAI,EAAE,oBAAoB,IAAI,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;aACrF,CAAC,CAAA;YACF,OAAO,SAAS,CAAA;QACjB,CAAC;QACD,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;QACxD,OAAO,OAAO,CAAA;IACf,CAAC;CACD,CAAA"}
|
|
@@ -36,34 +36,29 @@
|
|
|
36
36
|
*
|
|
37
37
|
* ## The addresses
|
|
38
38
|
*
|
|
39
|
-
* Re-verified
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* platform callback
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* The redirect port is fixed and NOT free to change: it is part of what the
|
|
47
|
-
* client identity above is registered with, so a different port is simply not
|
|
48
|
-
* an accepted redirect. That is why a busy port degrades to the paste flow
|
|
49
|
-
* rather than picking another one.
|
|
39
|
+
* Re-verified by capturing the exact URL emitted by the installed owner client
|
|
40
|
+
* (`claude auth login --claudeai`, 2.1.241) on 2026-08-23. Its live production
|
|
41
|
+
* contract uses the CAI authorize endpoint, the platform token endpoint and
|
|
42
|
+
* the platform callback below. That client does not offer a loopback redirect
|
|
43
|
+
* on this flow. A localhost callback may be valid OAuth in general, but it is
|
|
44
|
+
* not registered for this client identity; sending one makes the consent page
|
|
45
|
+
* refuse the request before sign-in.
|
|
50
46
|
*/
|
|
51
47
|
export declare const OAUTH_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
|
|
52
48
|
export declare const OAUTH_TOKEN_URL = "https://platform.claude.com/v1/oauth/token";
|
|
53
49
|
export declare const AUTHORIZE_URL = "https://claude.com/cai/oauth/authorize";
|
|
54
|
-
/** Registered
|
|
55
|
-
export declare const SUBSCRIPTION_REDIRECT_PORT = 53692;
|
|
56
|
-
export declare const REDIRECT_URI = "http://localhost:53692/callback";
|
|
57
|
-
/** Browser-to-terminal callback used when no local listener is reachable. */
|
|
50
|
+
/** Registered browser-to-terminal callback; not ours to replace with localhost. */
|
|
58
51
|
export declare const MANUAL_REDIRECT_URI = "https://platform.claude.com/oauth/code/callback";
|
|
59
52
|
/**
|
|
60
53
|
* The direct Claude Pro/Max scope set used by the current Claude harness.
|
|
61
54
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
55
|
+
* This looks broader than the inference capability Namzu consumes, but it is
|
|
56
|
+
* the exact set the current owner client sends for `--claudeai`, not its
|
|
57
|
+
* separately selected `--console` flow. The CAI endpoint validates the whole
|
|
58
|
+
* registered request shape; deleting `org:create_api_key` because its name
|
|
59
|
+
* sounds unrelated produces "Invalid request format" before the account can
|
|
60
|
+
* authorize anything. Keep this as one captured protocol value rather than a
|
|
61
|
+
* hand-curated list of what Namzu later uses.
|
|
67
62
|
*/
|
|
68
|
-
export declare const OAUTH_SCOPES = "user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload";
|
|
63
|
+
export declare const OAUTH_SCOPES = "org:create_api_key user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload";
|
|
69
64
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/identity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,eAAO,MAAM,eAAe,yCAAyC,CAAA;AACrE,eAAO,MAAM,eAAe,+CAA+C,CAAA;AAC3E,eAAO,MAAM,aAAa,2CAA2C,CAAA;AAErE,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,oDAAoD,CAAA;AAEpF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,+GACoF,CAAA"}
|
|
@@ -36,34 +36,29 @@
|
|
|
36
36
|
*
|
|
37
37
|
* ## The addresses
|
|
38
38
|
*
|
|
39
|
-
* Re-verified
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* platform callback
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* The redirect port is fixed and NOT free to change: it is part of what the
|
|
47
|
-
* client identity above is registered with, so a different port is simply not
|
|
48
|
-
* an accepted redirect. That is why a busy port degrades to the paste flow
|
|
49
|
-
* rather than picking another one.
|
|
39
|
+
* Re-verified by capturing the exact URL emitted by the installed owner client
|
|
40
|
+
* (`claude auth login --claudeai`, 2.1.241) on 2026-08-23. Its live production
|
|
41
|
+
* contract uses the CAI authorize endpoint, the platform token endpoint and
|
|
42
|
+
* the platform callback below. That client does not offer a loopback redirect
|
|
43
|
+
* on this flow. A localhost callback may be valid OAuth in general, but it is
|
|
44
|
+
* not registered for this client identity; sending one makes the consent page
|
|
45
|
+
* refuse the request before sign-in.
|
|
50
46
|
*/
|
|
51
47
|
export const OAUTH_CLIENT_ID = '9d1c250a-e61b-44d9-88ed-5944d1962f5e';
|
|
52
48
|
export const OAUTH_TOKEN_URL = 'https://platform.claude.com/v1/oauth/token';
|
|
53
49
|
export const AUTHORIZE_URL = 'https://claude.com/cai/oauth/authorize';
|
|
54
|
-
/** Registered
|
|
55
|
-
export const SUBSCRIPTION_REDIRECT_PORT = 53692;
|
|
56
|
-
export const REDIRECT_URI = `http://localhost:${SUBSCRIPTION_REDIRECT_PORT}/callback`;
|
|
57
|
-
/** Browser-to-terminal callback used when no local listener is reachable. */
|
|
50
|
+
/** Registered browser-to-terminal callback; not ours to replace with localhost. */
|
|
58
51
|
export const MANUAL_REDIRECT_URI = 'https://platform.claude.com/oauth/code/callback';
|
|
59
52
|
/**
|
|
60
53
|
* The direct Claude Pro/Max scope set used by the current Claude harness.
|
|
61
54
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
55
|
+
* This looks broader than the inference capability Namzu consumes, but it is
|
|
56
|
+
* the exact set the current owner client sends for `--claudeai`, not its
|
|
57
|
+
* separately selected `--console` flow. The CAI endpoint validates the whole
|
|
58
|
+
* registered request shape; deleting `org:create_api_key` because its name
|
|
59
|
+
* sounds unrelated produces "Invalid request format" before the account can
|
|
60
|
+
* authorize anything. Keep this as one captured protocol value rather than a
|
|
61
|
+
* hand-curated list of what Namzu later uses.
|
|
67
62
|
*/
|
|
68
|
-
export const OAUTH_SCOPES = 'user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload';
|
|
63
|
+
export const OAUTH_SCOPES = 'org:create_api_key user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload';
|
|
69
64
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/integrations/providers/identity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/integrations/providers/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,sCAAsC,CAAA;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,4CAA4C,CAAA;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,wCAAwC,CAAA;AAErE,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iDAAiD,CAAA;AAEpF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GACxB,4GAA4G,CAAA"}
|
|
@@ -4,7 +4,7 @@ export { type AgentOAuthCredential, isAnthropicOAuthToken, readAgentKeychainCred
|
|
|
4
4
|
export { beginCodexDeviceLogin, CODEX_AUTH_ORIGIN, CODEX_OAUTH_CLIENT_ID, type CodexDeviceLogin, type CodexDeviceLoginOptions, type CodexDeviceLoginOutcome, } from './codex-device-login.js';
|
|
5
5
|
export { clearAllStoredCredentials, clearStoredSubscriptionCredential, clearStoredCodexCredential, CREDENTIALS_FILE_VERSION, CredentialStoreError, credentialsPath, readStoredSubscriptionCredential, readStoredCodexCredential, replaceStoredCodexCredential, type StoredCodexCredential, writeStoredSubscriptionCredential, writeStoredCodexCredential, } from './credential-store.js';
|
|
6
6
|
export { ensureFreshStoredCodexCredential, type StoredCodexRefreshOptions, } from './codex-oauth.js';
|
|
7
|
-
export {
|
|
7
|
+
export { MANUAL_REDIRECT_URI, OAUTH_SCOPES } from './identity.js';
|
|
8
8
|
export { CredentialPublicationError, CredentialRefreshRejectedError, CredentialWithdrawnError, type CredentialOrigin, ensureFreshAnthropicToken, type OAuthMetadata, readSubscriptionCredential, refreshAgentOAuthToken, sameOAuthCredential, } from './oauth.js';
|
|
9
9
|
export { beginSubscriptionLogin, type LoginOutcome, parsePastedInput, type SubscriptionLogin, type SubscriptionLoginOptions, subscriptionDetectedProvider, } from './subscription-login.js';
|
|
10
10
|
export { type CapabilityDisagreement, chainCapabilityDisagreements, describeAcceptedMismatch, describeCapabilityRefusal, type MemberCapabilities, unresolvedMembers, } from './chain-capabilities.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,iBAAiB,EACjB,YAAY,EACZ,6BAA6B,GAC7B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACN,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,2BAA2B,GAC3B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC5B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACN,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,iCAAiC,EACjC,0BAA0B,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,gCAAgC,EAChC,KAAK,yBAAyB,GAC9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,iBAAiB,EACjB,YAAY,E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OAAO,EACN,iBAAiB,EACjB,KAAK,WAAW,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACN,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,0BAA0B,GAC1B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,GACxB,MAAM,eAAe,CAAA"}
|
|
@@ -4,7 +4,7 @@ export { isAnthropicOAuthToken, readAgentKeychainCredential, } from './keychain.
|
|
|
4
4
|
export { beginCodexDeviceLogin, CODEX_AUTH_ORIGIN, CODEX_OAUTH_CLIENT_ID, } from './codex-device-login.js';
|
|
5
5
|
export { clearAllStoredCredentials, clearStoredSubscriptionCredential, clearStoredCodexCredential, CREDENTIALS_FILE_VERSION, CredentialStoreError, credentialsPath, readStoredSubscriptionCredential, readStoredCodexCredential, replaceStoredCodexCredential, writeStoredSubscriptionCredential, writeStoredCodexCredential, } from './credential-store.js';
|
|
6
6
|
export { ensureFreshStoredCodexCredential, } from './codex-oauth.js';
|
|
7
|
-
export {
|
|
7
|
+
export { MANUAL_REDIRECT_URI, OAUTH_SCOPES } from './identity.js';
|
|
8
8
|
export { CredentialPublicationError, CredentialRefreshRejectedError, CredentialWithdrawnError, ensureFreshAnthropicToken, readSubscriptionCredential, refreshAgentOAuthToken, sameOAuthCredential, } from './oauth.js';
|
|
9
9
|
export { beginSubscriptionLogin, parsePastedInput, subscriptionDetectedProvider, } from './subscription-login.js';
|
|
10
10
|
export { chainCapabilityDisagreements, describeAcceptedMismatch, describeCapabilityRefusal, unresolvedMembers, } from './chain-capabilities.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,iBAAiB,EACjB,YAAY,EACZ,6BAA6B,GAC7B,MAAM,eAAe,CAAA;AACtB,OAAO,EAEN,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEN,qBAAqB,EACrB,2BAA2B,GAC3B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,GAIrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACN,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,EAE5B,iCAAiC,EACjC,0BAA0B,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,gCAAgC,GAEhC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,iBAAiB,EACjB,YAAY,EACZ,6BAA6B,GAC7B,MAAM,eAAe,CAAA;AACtB,OAAO,EAEN,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEN,qBAAqB,EACrB,2BAA2B,GAC3B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,GAIrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACN,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,EAE5B,iCAAiC,EACjC,0BAA0B,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,gCAAgC,GAEhC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EACN,0BAA0B,EAC1B,8BAA8B,EAC9B,wBAAwB,EAExB,yBAAyB,EAEzB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACN,sBAAsB,EAEtB,gBAAgB,EAGhB,4BAA4B,GAC5B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEN,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EAEzB,iBAAiB,GACjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACN,iBAAiB,EAEjB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,eAAe,EAGf,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACN,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EAKjB,0BAA0B,GAC1B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,GACxB,MAAM,eAAe,CAAA"}
|
|
@@ -10,21 +10,11 @@
|
|
|
10
10
|
*
|
|
11
11
|
* ## The flow
|
|
12
12
|
*
|
|
13
|
-
* Authorization code with PKCE (RFC 7636, S256), redirected to
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* never touches a screen.
|
|
19
|
-
* 2. **Paste.** The operator copies the code — or the whole redirect URL —
|
|
20
|
-
* out of a browser and hands it back.
|
|
21
|
-
*
|
|
22
|
-
* The second is not a consolation prize. A container, a remote shell over
|
|
23
|
-
* SSH, a machine with no graphical session: none of them can be redirected
|
|
24
|
-
* to, and on all of them the loopback server is either unreachable from
|
|
25
|
-
* wherever the browser actually is or cannot bind at all. `start()` says
|
|
26
|
-
* which of the two it managed to arrange (`loopback`), and the paste path
|
|
27
|
-
* works whether or not it did.
|
|
13
|
+
* Authorization code with PKCE (RFC 7636, S256), redirected to the platform
|
|
14
|
+
* callback registered for the owner client's public identity. The operator
|
|
15
|
+
* copies the code — or the whole finished address — back to the initiating
|
|
16
|
+
* surface. This flow deliberately does not invent a localhost redirect: the
|
|
17
|
+
* authorization server rejects an unregistered callback before sign-in.
|
|
28
18
|
*
|
|
29
19
|
* ## What never happens here
|
|
30
20
|
*
|
|
@@ -51,26 +41,9 @@ export interface SubscriptionLogin {
|
|
|
51
41
|
/** The page to open. Safe to print — it carries a challenge, never a secret. */
|
|
52
42
|
readonly url: string;
|
|
53
43
|
readonly redirectUri: string;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the loopback listener came up.
|
|
56
|
-
*
|
|
57
|
-
* `false` is not a failure: the port was busy, or the environment forbids
|
|
58
|
-
* listening. The paste path is unaffected, and a surface should say so
|
|
59
|
-
* rather than imply the login is broken.
|
|
60
|
-
*/
|
|
61
|
-
readonly loopback: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Resolve when the browser reaches the loopback listener, or never.
|
|
64
|
-
*
|
|
65
|
-
* `null` when `loopback` is false, so a caller cannot await a promise that
|
|
66
|
-
* has no way to settle. Racing this against `completeWithPastedCode` is the
|
|
67
|
-
* intended use; whichever finishes first wins and `cancel()` releases the
|
|
68
|
-
* other.
|
|
69
|
-
*/
|
|
70
|
-
waitForCallback(): Promise<LoginOutcome> | null;
|
|
71
44
|
/** Finish from a pasted redirect URL, `code#state`, or a bare code. */
|
|
72
45
|
completeWithPastedCode(input: string): Promise<LoginOutcome>;
|
|
73
|
-
/**
|
|
46
|
+
/** Withdraw the attempt. Safe to call twice, and safe to call after success. */
|
|
74
47
|
cancel(): void;
|
|
75
48
|
}
|
|
76
49
|
export interface SubscriptionLoginOptions {
|
|
@@ -78,18 +51,11 @@ export interface SubscriptionLoginOptions {
|
|
|
78
51
|
readonly home?: string;
|
|
79
52
|
/** Override the token-exchange transport (tests inject a stub). */
|
|
80
53
|
readonly fetch?: typeof fetch;
|
|
81
|
-
/**
|
|
82
|
-
* Try to listen on the loopback redirect. Default true.
|
|
83
|
-
*
|
|
84
|
-
* A caller that knows there is no browser here — `--no-browser`, a
|
|
85
|
-
* container — passes false and skips a bind that would only ever time out.
|
|
86
|
-
*/
|
|
87
|
-
readonly loopback?: boolean;
|
|
88
54
|
/** Authority of the surface that started this attempt. */
|
|
89
55
|
readonly signal?: AbortSignal;
|
|
90
56
|
}
|
|
91
57
|
/**
|
|
92
|
-
* Begin a login. Returns the page to open plus the
|
|
58
|
+
* Begin a login. Returns the page to open plus the paste-completion handle.
|
|
93
59
|
*
|
|
94
60
|
* Deliberately does NOT open a browser. Which of `open`, `xdg-open` or a
|
|
95
61
|
* Windows protocol handler to spawn — and whether spawning anything is even
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-login.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/subscription-login.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"subscription-login.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/subscription-login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAQrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAGzD,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GACrB;IACA,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;IACjB,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAA;IACzC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACxB,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MA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