godot-cli 0.20.1 → 0.21.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/CHANGELOG.md +34 -0
- package/README.md +20 -4
- package/dist/commands/login.js +54 -24
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/open.js +2 -2
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/run-tool-builder.js +1 -1
- package/dist/commands/run-tool-builder.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/wait-for-ready.js +1 -1
- package/dist/commands/wait-for-ready.js.map +1 -1
- package/dist/lib/enroll.js +29 -19
- package/dist/lib/enroll.js.map +1 -1
- package/dist/utils/addon-deps.js +1 -1
- package/dist/utils/cloud-login.d.ts +80 -14
- package/dist/utils/cloud-login.js +204 -51
- package/dist/utils/cloud-login.js.map +1 -1
- package/dist/utils/connection.d.ts +13 -8
- package/dist/utils/connection.js +116 -15
- package/dist/utils/connection.js.map +1 -1
- package/dist/utils/credentials.d.ts +13 -19
- package/dist/utils/credentials.js +13 -59
- package/dist/utils/credentials.js.map +1 -1
- package/dist/utils/machine-store.d.ts +76 -0
- package/dist/utils/machine-store.js +129 -0
- package/dist/utils/machine-store.js.map +1 -0
- package/dist/utils/server-source.d.ts +1 -1
- package/dist/utils/server-source.js +1 -1
- package/dist/utils/ui.d.ts +5 -0
- package/dist/utils/ui.js +15 -0
- package/dist/utils/ui.js.map +1 -1
- package/package.json +2 -2
- package/dist/utils/machine-credentials.d.ts +0 -74
- package/dist/utils/machine-credentials.js +0 -182
- package/dist/utils/machine-credentials.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,40 @@ All notable changes to `godot-cli` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
- **Unified machine auth (unified-machine-auth f2).** The CLI adopts
|
|
8
|
+
`@baizor/gamedev-cli-core@0.4.0`'s shared machine-auth stack; the CLI-local machine-credential
|
|
9
|
+
store copy (`src/utils/machine-credentials.ts`) is **deleted** — cli-core is the only TS store
|
|
10
|
+
implementation (families schema v2, atomic writes, cross-process lock, unreadable-store honesty).
|
|
11
|
+
- `login` now runs the F1 agent login: an **agent-scope** (`mcp:agent`) device grant, committed
|
|
12
|
+
under a first lock hold, with the tools (`mcp:plugin`) credential **derived via RFC 8693 token
|
|
13
|
+
exchange** and committed (+ the v1 compat mirror) under a second hold. A failed exchange leaves
|
|
14
|
+
the machine "partially authorized" (agent family committed) and the derivation is retried.
|
|
15
|
+
- New **`login --tools-only`** (O10): CI/automation mode — mints and stores a plugin family
|
|
16
|
+
ONLY, so the desktop App cannot pick the sign-in up and the runner is its own revocable device.
|
|
17
|
+
- New **`login --yes`** + account-switch guard (D6/F7): signing in as a *different* account than
|
|
18
|
+
the machine store holds now requires confirmation (TTY prompt, `--yes`, or fail-closed decline
|
|
19
|
+
in non-interactive runs); declining revokes the just-minted credential and leaves the store
|
|
20
|
+
untouched.
|
|
21
|
+
- Commands that use a persisted cloud credential (`open --mode Cloud`, `run-tool`, `status`,
|
|
22
|
+
`wait-for-ready`) now resolve it through cli-core's `MachineCredentialProvider` — an expired
|
|
23
|
+
access token is **refreshed automatically** under the cross-process lock (presenting the
|
|
24
|
+
family's stored `client_id`, `scope`/`resource` omitted) instead of being handed out stale.
|
|
25
|
+
- The legacy per-project sink `<project>/.godot-mcp/credentials.json` is **no longer written
|
|
26
|
+
anywhere**. It is still read as a fallback for one release and is **migrated into the machine
|
|
27
|
+
store on first use** (as a legacy family, under the lock, only when the machine store is
|
|
28
|
+
empty); `login --project` now persists to the per-project store
|
|
29
|
+
`<project>/.ai-game-dev/credentials.json` (gitignored) instead.
|
|
30
|
+
- `install-plugin --enroll` commits its redeemed credential through the same shared machinery
|
|
31
|
+
(plugin family, own `client_id`, under the lock), with the account-switch guard failing closed.
|
|
32
|
+
- The `login` "already authenticated" gate is **plugin-plane-gated**, and a **partially
|
|
33
|
+
authorized** machine (agent family committed, plugin derivation failed) is repaired by
|
|
34
|
+
`login` in place: it re-runs ONLY the derivation leg from the committed agent family — no
|
|
35
|
+
second device flow, no browser — or fails with an actionable message naming `--force`.
|
|
36
|
+
An agent-only store never reads as "already authenticated" (review f2 B1).
|
|
37
|
+
- An **unreadable per-project credential store** now surfaces "re-authorize this project"
|
|
38
|
+
instead of silently falling back to the machine account (review f2 A1 — a command must not
|
|
39
|
+
run as a different account than the project chose).
|
|
40
|
+
|
|
7
41
|
- **BREAKING (requires a matching addon).** `status` and `wait-for-ready` now probe
|
|
8
42
|
`/api/system-tools/ping` instead of `/api/tools/ping`. The addon's `ping` became a **System** tool
|
|
9
43
|
(owner ruling 2026-07-25, for parity with Unity-MCP), and `McpPluginBuilder` partitions tools by
|
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ npx godot-cli install-plugin /path/to/godot/project
|
|
|
89
89
|
| `run-system-tool <tool> [path]` | POST to `<url>/api/system-tools/<tool>` (tools not exposed to MCP clients). |
|
|
90
90
|
| `status [path]` | Detect a running Godot editor for the project and probe MCP-server health. |
|
|
91
91
|
| `wait-for-ready [path]` | Poll the MCP server until it answers `ping`. |
|
|
92
|
-
| `login [path]` | Authenticate with the ai-game.dev cloud via the OAuth 2.1 device-authorization flow (RFC 8628) — opens a browser, then saves a cloud credential to the shared machine store (`~/.ai-game-dev/credentials.json`) the editor plugin auto-adopts. See the `login` section below for its `--project` / `--base-url` / `--force` flags. |
|
|
92
|
+
| `login [path]` | Authenticate with the ai-game.dev cloud via the OAuth 2.1 device-authorization flow (RFC 8628) — opens a browser, then saves a cloud credential to the shared machine store (`~/.ai-game-dev/credentials.json`) the editor plugin auto-adopts. See the `login` section below for its `--project` / `--base-url` / `--force` / `--tools-only` / `--yes` flags. |
|
|
93
93
|
| `setup-mcp <agent> [path]` | Write the agent's MCP-client config pointing at the project-pinned `<host>/mcp/p/<pin>` URL (so the agent routes to *this* project's editor). Add `--no-pin` for the bare `<host>/mcp` URL. |
|
|
94
94
|
| `setup-skills <agent> [path]` | Generate Godot-MCP skill files (a `SKILL.md`-per-tool-family) under the agent's skills path. `--list` shows each agent's skills support. |
|
|
95
95
|
| `configure [path]` | List / enable / disable tools, prompts, and resources in the project-local `.godot-mcp/features.json`. |
|
|
@@ -151,7 +151,8 @@ tool `ping`) is resolved as:
|
|
|
151
151
|
5. The **enrolled project marker** (`.ai-game-dev/project.json` `serverTarget`, written by
|
|
152
152
|
`install-plugin --enroll`): a hosted target routes to its `/mcp` hub, a `localhost` target is used
|
|
153
153
|
verbatim. This makes an **enrolled cloud project reachable with zero env config** — the persisted
|
|
154
|
-
cloud credential (project store
|
|
154
|
+
cloud credential (per-project store `<project>/.ai-game-dev/`, then the legacy project sink, then
|
|
155
|
+
`~/.ai-game-dev/credentials.json`) is used automatically, refreshed through expiry.
|
|
155
156
|
6. Local fallback: `http://localhost:<derived-port>`, the deterministic v2 project-path port the
|
|
156
157
|
editor addon binds locally (a marker `portOverride` wins over the hash-derived port).
|
|
157
158
|
|
|
@@ -172,16 +173,31 @@ godot-cli login # sign in once per machine (default)
|
|
|
172
173
|
godot-cli login --project ./MyGame # keep a per-project credential instead
|
|
173
174
|
godot-cli login --base-url <url> # authenticate against a non-default server
|
|
174
175
|
godot-cli login --force # re-authenticate over an existing credential
|
|
176
|
+
godot-cli login --tools-only # CI/automation: tools credential only (no App pickup)
|
|
177
|
+
godot-cli login --yes # non-interactive: confirm replacing another account's credential
|
|
175
178
|
```
|
|
176
179
|
|
|
177
180
|
- By default the credential is saved to the shared **machine store** `~/.ai-game-dev/credentials.json`
|
|
178
181
|
(`0600` on POSIX / DPAPI on Windows) — sign in **once per machine** and the Godot editor plugin
|
|
179
182
|
auto-adopts it, so `godot-cli open --mode Cloud` connects with **no `--token`**.
|
|
183
|
+
- The default login signs the whole machine in: the flow requests an **agent-scope** grant and
|
|
184
|
+
derives the narrower **tools (plugin) credential** from it via RFC 8693 token exchange, so every
|
|
185
|
+
AI-Game-Dev tool on the machine (engine plugins, CLIs, the desktop App) picks the sign-in up.
|
|
186
|
+
- `--tools-only` mints the tools credential **only** — nothing agent-scoped is stored, the desktop
|
|
187
|
+
App cannot adopt the sign-in, and the runner shows up as its own revocable device on
|
|
188
|
+
[ai-game.dev](https://ai-game.dev). Use it for CI and shared automation runners.
|
|
189
|
+
- If the machine already holds a **different account's** credential, login asks before replacing it
|
|
190
|
+
(declining revokes the just-minted credential and leaves the store untouched). Pass `--yes` to
|
|
191
|
+
confirm non-interactively.
|
|
180
192
|
- `--project <path>` (or the positional `[path]`) keeps a per-project credential
|
|
181
|
-
(`<path>/.
|
|
193
|
+
(`<path>/.ai-game-dev/credentials.json`, gitignored) for per-project accounts. The old
|
|
194
|
+
per-project sink `<path>/.godot-mcp/credentials.json` is **no longer written** — it is still
|
|
195
|
+
read (and migrated into the machine store on first use) for one release.
|
|
182
196
|
- The flow persists the **full** credential set (access token + rotating refresh token + expiry) — **no
|
|
183
197
|
personal access token (PAT) is ever minted**. On any failure nothing is written, so an existing
|
|
184
|
-
credential survives a denied / expired / network error intact.
|
|
198
|
+
credential survives a denied / expired / network error intact. Commands refresh an expired
|
|
199
|
+
access token automatically (via `@baizor/gamedev-cli-core`), so a signed-in machine stays
|
|
200
|
+
signed in without re-running `login`.
|
|
185
201
|
|
|
186
202
|
## `setup-skills`
|
|
187
203
|
|
package/dist/commands/login.js
CHANGED
|
@@ -4,37 +4,65 @@ import * as path from 'path';
|
|
|
4
4
|
import * as ui from '../utils/ui.js';
|
|
5
5
|
import { verbose } from '../utils/ui.js';
|
|
6
6
|
import { DEFAULT_CLOUD_BASE_URL } from '../utils/connection.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { runCloudLogin } from '../utils/cloud-login.js';
|
|
7
|
+
import { openMachineStore, openProjectStore, getMachineCredentialsPath, resolveProjectStoreDir, } from '../utils/machine-store.js';
|
|
8
|
+
import { runCloudLogin, completePartialLogin, classifyLoginState, } from '../utils/cloud-login.js';
|
|
10
9
|
export const loginCommand = new Command('login')
|
|
11
10
|
.description('Authenticate with the Godot-MCP cloud server (ai-game.dev) via the RFC 8628 device-authorization flow. ' +
|
|
12
11
|
'By default the credential is saved to the shared machine store (~/.ai-game-dev/credentials.json, 0600 / ' +
|
|
13
12
|
'DPAPI) so you sign in once per machine and the editor plugin auto-adopts it. Use --project <path> to keep ' +
|
|
14
|
-
'a per-project credential (project-local .
|
|
13
|
+
'a per-project credential (project-local .ai-game-dev/credentials.json, gitignored) instead.')
|
|
15
14
|
.argument('[path]', 'Project path for a per-project credential override (alias of --project). Omit for the machine store.')
|
|
16
|
-
.option('--project <path>', 'Save a per-project credential under <path>/.
|
|
15
|
+
.option('--project <path>', 'Save a per-project credential under <path>/.ai-game-dev/ instead of the machine store')
|
|
17
16
|
.option('--path <path>', 'Alias of --project (kept for backward compatibility)')
|
|
18
17
|
.option('--base-url <url>', 'Override the cloud base URL (default: https://ai-game.dev)')
|
|
19
18
|
.option('--force', 'Re-authenticate even if a credential is already saved')
|
|
19
|
+
.option('--tools-only', 'CI/automation mode: mint a tools (mcp:plugin) credential only — no agent-plane credential is ' +
|
|
20
|
+
'stored, so the desktop App cannot pick this sign-in up and the runner appears as its own ' +
|
|
21
|
+
'revocable device on ai-game.dev')
|
|
22
|
+
.option('--yes', 'Do not prompt: confirm replacing a credential stored for a different account')
|
|
20
23
|
.action(async (positionalPath, options) => {
|
|
21
24
|
const baseUrl = (options.baseUrl ?? DEFAULT_CLOUD_BASE_URL).replace(/\/$/, '');
|
|
22
25
|
const { sink, savedLocationLabel } = resolveSink(positionalPath, options);
|
|
23
26
|
verbose(`Credential store: ${savedLocationLabel}`);
|
|
24
|
-
// Only short-circuit when a credential is saved in the SAME store AND it
|
|
25
|
-
// SAME base URL
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
// Only short-circuit when a usable PLUGIN-PLANE credential is saved in the SAME store AND it
|
|
28
|
+
// was issued against the SAME base URL (an agent-only "partial" store must never read as
|
|
29
|
+
// signed in — review f2 B1). And `login --base-url <other>` (without --force) never silently
|
|
30
|
+
// reuses a credential minted for a different server.
|
|
31
|
+
if (!options.force) {
|
|
32
|
+
const state = classifyLoginState(readStoreDocument(sink), baseUrl);
|
|
33
|
+
if (state === 'signed-in') {
|
|
34
|
+
ui.success('Already authenticated with the cloud server.');
|
|
35
|
+
ui.info('Use --force to re-authenticate.');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (state === 'partial' && !options.toolsOnly) {
|
|
39
|
+
// F1 failure-path repair: the agent family is committed; finish the derivation leg
|
|
40
|
+
// alone — no second device flow, no browser hop.
|
|
41
|
+
ui.info('A previous sign-in was only partially authorized — finishing it now (no browser needed)...');
|
|
42
|
+
const repaired = await completePartialLogin({ baseUrl, sink });
|
|
43
|
+
if (repaired) {
|
|
44
|
+
ui.success(`Authentication complete. Cloud credential saved to ${savedLocationLabel}.`);
|
|
45
|
+
ui.info('Run: godot-cli open --mode Cloud (no --token needed).');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
ui.error('Could not finish the partially-authorized sign-in. Run `godot-cli login --force` to start a fresh one.');
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
31
51
|
}
|
|
32
52
|
ui.heading('Cloud Authentication');
|
|
33
53
|
ui.label('Server', baseUrl);
|
|
54
|
+
if (options.toolsOnly) {
|
|
55
|
+
ui.info('Tools-only login: no agent credential will be stored on this machine.');
|
|
56
|
+
}
|
|
34
57
|
ui.divider();
|
|
35
|
-
const token = await runCloudLogin({
|
|
58
|
+
const token = await runCloudLogin({
|
|
59
|
+
baseUrl,
|
|
60
|
+
sink,
|
|
61
|
+
toolsOnly: options.toolsOnly ?? false,
|
|
62
|
+
assumeYes: options.yes ?? false,
|
|
63
|
+
});
|
|
36
64
|
if (token) {
|
|
37
|
-
ui.success(`Authentication complete. Cloud
|
|
65
|
+
ui.success(`Authentication complete. Cloud credential saved to ${savedLocationLabel}.`);
|
|
38
66
|
ui.info('Run: godot-cli open --mode Cloud (no --token needed).');
|
|
39
67
|
}
|
|
40
68
|
else {
|
|
@@ -43,7 +71,9 @@ export const loginCommand = new Command('login')
|
|
|
43
71
|
});
|
|
44
72
|
/**
|
|
45
73
|
* Resolve where the credential should be stored. A project override (via --project, the legacy
|
|
46
|
-
* --path, or the positional arg) selects the project
|
|
74
|
+
* --path, or the positional arg) selects the per-project store (`<project>/.ai-game-dev/` — the
|
|
75
|
+
* legacy `.godot-mcp/credentials.json` sink is read-fallback only and never written, 06 D7);
|
|
76
|
+
* otherwise the shared machine store.
|
|
47
77
|
*/
|
|
48
78
|
function resolveSink(positionalPath, options) {
|
|
49
79
|
const overrideRaw = options.project ?? options.path ?? positionalPath;
|
|
@@ -55,22 +85,22 @@ function resolveSink(positionalPath, options) {
|
|
|
55
85
|
}
|
|
56
86
|
return {
|
|
57
87
|
sink: { kind: 'project', projectPath },
|
|
58
|
-
savedLocationLabel: path.join(projectPath, '
|
|
88
|
+
savedLocationLabel: path.join(resolveProjectStoreDir(projectPath), 'credentials.json'),
|
|
59
89
|
};
|
|
60
90
|
}
|
|
61
91
|
return { sink: { kind: 'machine' }, savedLocationLabel: getMachineCredentialsPath() };
|
|
62
92
|
}
|
|
63
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Read the sink's stored credential document; a missing OR unreadable store reads as null, i.e.
|
|
95
|
+
* `signed-out` (04 §1: an explicit login may replace an unreadable store, so the flow proceeds).
|
|
96
|
+
*/
|
|
97
|
+
function readStoreDocument(sink) {
|
|
64
98
|
try {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return !!creds?.cloudToken && creds.cloudBaseUrl === baseUrl;
|
|
68
|
-
}
|
|
69
|
-
const creds = readMachineCredentials(sink.storeBaseDir);
|
|
70
|
-
return !!creds?.accessToken && creds.serverTarget === baseUrl;
|
|
99
|
+
const store = sink.kind === 'project' ? openProjectStore(sink.projectPath) : openMachineStore(sink.storeBaseDir);
|
|
100
|
+
return store.read();
|
|
71
101
|
}
|
|
72
102
|
catch {
|
|
73
|
-
return
|
|
103
|
+
return null;
|
|
74
104
|
}
|
|
75
105
|
}
|
|
76
106
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AAYjC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CACV,yGAAyG;IACvG,0GAA0G;IAC1G,4GAA4G;IAC5G,6FAA6F,CAChG;KACA,QAAQ,CAAC,QAAQ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O,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,EAAE,CAAC,KAAK,CAAC,gCAAgC,WAAW,EAAE,CAAC,CAAC;YACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE;YACtC,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;SACvF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,EAAE,CAAC;AACxF,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,IAAoB;IAC7C,IAAI,CAAC;QACH,MAAM,KAAK,GACT,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrG,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/commands/open.js
CHANGED
|
@@ -61,9 +61,9 @@ export const openCommand = new Command('open')
|
|
|
61
61
|
}
|
|
62
62
|
// In Cloud mode with no explicit --token / GODOT_MCP_TOKEN, inject the
|
|
63
63
|
// token persisted by `godot-cli login` so `open --mode Cloud` auto-connects.
|
|
64
|
-
const authToken = resolveOpenAuthToken(projectPath, { token: options.token, mode: options.mode });
|
|
64
|
+
const authToken = await resolveOpenAuthToken(projectPath, { token: options.token, mode: options.mode });
|
|
65
65
|
if (authToken !== undefined && options.token === undefined) {
|
|
66
|
-
verbose('Using persisted cloud
|
|
66
|
+
verbose('Using persisted cloud credential (per-project store, legacy fallback, or machine store)');
|
|
67
67
|
}
|
|
68
68
|
const spinner = ui.startSpinner(options.build === false ? 'Locating Godot editor...' : 'Building C# assembly...');
|
|
69
69
|
const result = await openProject({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/commands/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,WAAW,EACX,kBAAkB,IAAI,qBAAqB,EAC3C,iBAAiB,IAAI,oBAAoB,GAC1C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAU9D;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,cAAkC,EAClC,UAA8B,EAC9B,GAAW;IAEX,MAAM,QAAQ,GAAG,cAAc,IAAI,UAAU,CAAC;IAC9C,OAAO,qBAAqB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CACV,0MAA0M,CAC3M;KACA,QAAQ,CAAC,QAAQ,EAAE,2DAA2D,CAAC;KAC/E,MAAM,CAAC,eAAe,EAAE,2DAA2D,CAAC;KACpF,MAAM,CAAC,sBAAsB,EAAE,gEAAgE,CAAC;KAChG,MAAM,CAAC,YAAY,EAAE,4FAA4F,CAAC;KAClH,MAAM,CAAC,6BAA6B,EAAE,+DAA+D,CAAC;KACtG,MAAM,CAAC,cAAc,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
|
26
26
|
// Resolve path + connection up front so the heading and verbose output
|
|
27
27
|
// reflect the final endpoint before the HTTP call fires.
|
|
28
28
|
const projectPath = resolveAndValidateProjectPath(positionalPath, options);
|
|
29
|
-
const { url: baseUrl, token } = resolveConnection(projectPath, options);
|
|
29
|
+
const { url: baseUrl, token } = await resolveConnection(projectPath, options);
|
|
30
30
|
const body = parseInput(options);
|
|
31
31
|
const endpoint = `${baseUrl}${cfg.routePrefix}/${encodeURIComponent(toolName)}`;
|
|
32
32
|
const authSource = options.token ? '--token flag' : 'config/env';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-tool-builder.js","sourceRoot":"","sources":["../../src/commands/run-tool-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA2C/C,MAAM,UAAU,mBAAmB,CAAC,GAAmB;IACrD,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;SACzB,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;SAC5B,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,cAAc,CAAC;SAC3C,QAAQ,CAAC,QAAQ,EAAE,2EAA2E,CAAC;SAC/F,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC;SAC7C,MAAM,CAAC,aAAa,EAAE,wDAAwD,CAAC;SAC/E,MAAM,CAAC,iBAAiB,EAAE,qDAAqD,CAAC;SAChF,MAAM,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;SACzD,MAAM,CAAC,qBAAqB,EAAE,+BAA+B,CAAC;SAC9D,MAAM,CAAC,OAAO,EAAE,iCAAiC,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,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/commands/status.js
CHANGED
|
@@ -13,7 +13,7 @@ export const statusCommand = new Command('status')
|
|
|
13
13
|
.option('--timeout <ms>', 'Probe timeout in milliseconds (default: 5000)', '5000')
|
|
14
14
|
.action(async (positionalPath, options) => {
|
|
15
15
|
const projectPath = resolveAndValidateProjectPath(positionalPath, options);
|
|
16
|
-
const { url: serverUrl, token } = resolveConnection(projectPath, options);
|
|
16
|
+
const { url: serverUrl, token } = await resolveConnection(projectPath, options);
|
|
17
17
|
const timeoutMs = parseInt(options.timeout ?? '5000', 10);
|
|
18
18
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
19
19
|
ui.error(`Invalid --timeout value: "${options.timeout}". Must be a positive integer (milliseconds).`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAS1C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,qDAAqD,CAAC;KAClE,QAAQ,CAAC,QAAQ,EAAE,iFAAiF,CAAC;KACrG,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC;KAC7C,MAAM,CAAC,aAAa,EAAE,wDAAwD,CAAC;KAC/E,MAAM,CAAC,iBAA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,MAAM,GAAG,MAAM,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC7B,OAAO,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,kBAAkB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IACpD,CAAC;IAED,EAAE,CAAC,OAAO,EAAE,CAAC;IAEb,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACd,EAAE,CAAC,OAAO,CAAC,gDAAgD,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;SAAM,IAAI,IAAI,EAAE,CAAC;QAChB,EAAE,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ export const waitForReadyCommand = new Command('wait-for-ready')
|
|
|
14
14
|
.option('--interval <ms>', 'Polling interval in milliseconds (default: 3000)', '3000')
|
|
15
15
|
.action(async (positionalPath, options) => {
|
|
16
16
|
const projectPath = resolveAndValidateProjectPath(positionalPath, options);
|
|
17
|
-
const { url: serverUrl, token } = resolveConnection(projectPath, options);
|
|
17
|
+
const { url: serverUrl, token } = await resolveConnection(projectPath, options);
|
|
18
18
|
const timeoutMs = parseInt(options.timeout ?? '120000', 10);
|
|
19
19
|
const intervalMs = parseInt(options.interval ?? '3000', 10);
|
|
20
20
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-ready.js","sourceRoot":"","sources":["../../src/commands/wait-for-ready.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,oBAAoB,GAAG,KAAM,CAAC;AAUpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,CAAC,gBAAgB,CAAC;KAC7D,WAAW,CAAC,2EAA2E,CAAC;KACxF,QAAQ,CAAC,QAAQ,EAAE,sDAAsD,CAAC;KAC1E,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC;KAC7C,MAAM,CAAC,aAAa,EAAE,wDAAwD,CAAC;KAC/E,MAAM,CAAC,iBAAiB,EAAE,qDAAqD,CAAC;KAChF,MAAM,CAAC,gBAAgB,EAAE,wDAAwD,EAAE,QAAQ,CAAC;KAC5F,MAAM,CAAC,iBAAiB,EAAE,kDAAkD,EAAE,MAAM,CAAC;KACrF,MAAM,CAAC,KAAK,EAAE,cAAkC,EAAE,OAA4B,EAAE,EAAE;IACjF,MAAM,WAAW,GAAG,6BAA6B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"wait-for-ready.js","sourceRoot":"","sources":["../../src/commands/wait-for-ready.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CA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G,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QAE7D,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;YACd,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClE,OAAO,CAAC,OAAO,CAAC,0BAA0B,MAAM,CAAC,OAAO,kBAAkB,YAAY,IAAI,CAAC,CAAC;YAC5F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,WAAW,GAAG,SAAS,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;QACzD,IAAI,WAAW,IAAI,CAAC;YAAE,SAAS;QAC/B,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/lib/enroll.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import { commitToolsOnlyLogin, decodeJwtSubject, godotAdapter } from '@baizor/gamedev-cli-core';
|
|
3
4
|
import { DEFAULT_CLOUD_BASE_URL } from '../utils/connection.js';
|
|
4
5
|
import { redeemEnrollment } from '../utils/enroll.js';
|
|
5
|
-
import {
|
|
6
|
+
import { openMachineStore } from '../utils/machine-store.js';
|
|
6
7
|
import { deriveProjectIdentityV2 } from '../utils/project-identity.js';
|
|
7
8
|
import { writeProjectMarker, getProjectMarkerPath, isLocalhostUrl, upsertPinIntoAgentConfigs, } from '../utils/project-marker.js';
|
|
8
9
|
import { emitProgress } from './progress.js';
|
|
@@ -41,27 +42,36 @@ export async function enrollPlugin(opts) {
|
|
|
41
42
|
}
|
|
42
43
|
const { access_token, refresh_token, expires_in, server_url } = redeem.credential;
|
|
43
44
|
const serverTarget = server_url;
|
|
44
|
-
// 2. Machine store:
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
catch {
|
|
51
|
-
existing = {};
|
|
52
|
-
}
|
|
45
|
+
// 2. Machine store: commit the enroll-minted `mcp:plugin` credential as a PLUGIN family via
|
|
46
|
+
// the shared cli-core tools-only commit (unified-machine-auth F10 — enroll is the code-based
|
|
47
|
+
// plugin-only mint), under the 04 §2 cross-process lock, stamped with this CLI's own client
|
|
48
|
+
// id. The D6/F7 account-switch guard applies with NO confirmation channel here (library
|
|
49
|
+
// path), so a KNOWN-subject mismatch fails closed instead of silently replacing the account.
|
|
50
|
+
const store = openMachineStore(opts.storeBaseDir);
|
|
53
51
|
const expiresAt = typeof expires_in === 'number' && expires_in > 0
|
|
54
52
|
? new Date(Date.now() + expires_in * 1000).toISOString()
|
|
55
53
|
: undefined;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
const subject = decodeJwtSubject(access_token);
|
|
55
|
+
const commit = await commitToolsOnlyLogin({
|
|
56
|
+
store,
|
|
57
|
+
clientId: godotAdapter.clientId, // 'godot-cli'
|
|
58
|
+
credentials: {
|
|
59
|
+
accessToken: access_token,
|
|
60
|
+
refreshToken: refresh_token,
|
|
61
|
+
...(expiresAt ? { expiresAt } : {}),
|
|
62
|
+
serverTarget,
|
|
63
|
+
...(subject !== undefined ? { subject } : {}),
|
|
64
|
+
},
|
|
65
|
+
onWarning: (message) => warnings.push(message),
|
|
66
|
+
});
|
|
67
|
+
if (commit.status === 'switch-declined') {
|
|
68
|
+
throw new Error(`This machine is signed in as a different account (${commit.storedSubject}); the enrollment ` +
|
|
69
|
+
'credential was revoked and nothing was written. Sign out first (or enroll on a clean machine).');
|
|
70
|
+
}
|
|
71
|
+
if (commit.status === 'aborted') {
|
|
72
|
+
throw new Error('The machine credential store changed concurrently; re-run the enrollment.');
|
|
73
|
+
}
|
|
74
|
+
const credentialsPath = store.credentialsPath;
|
|
65
75
|
emitProgress(opts.onProgress, { phase: 'enroll-redeemed', message: 'Credential planted', serverTarget });
|
|
66
76
|
// 3. Project marker: server target + pin (+ derived port for a localhost target). The pin/port
|
|
67
77
|
// are derived with the cli-core **v2** algorithm (`\`→`/` normalization — defect B5): on a
|
package/dist/lib/enroll.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enroll.js","sourceRoot":"","sources":["../../src/lib/enroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"enroll.js","sourceRoot":"","sources":["../../src/lib/enroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,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@@
|
|
|
20
20
|
*/
|
|
21
21
|
export const ADDON_PACKAGE_REFERENCES = [
|
|
22
22
|
{ id: 'com.IvanMurzak.ReflectorNet', version: '5.4.0' },
|
|
23
|
-
{ id: 'com.IvanMurzak.McpPlugin', version: '
|
|
23
|
+
{ id: 'com.IvanMurzak.McpPlugin', version: '8.1.0' },
|
|
24
24
|
];
|
|
25
25
|
/**
|
|
26
26
|
* The exact `<EmbeddedResource>`s the consumer's project `.csproj` needs, single-sourced
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { type DeviceAuthTransport } from '@baizor/gamedev-cli-core';
|
|
1
|
+
import { type DeviceAuthTransport, type MachineCredentials, type TokenExchangeClient } from '@baizor/gamedev-cli-core';
|
|
2
2
|
/**
|
|
3
3
|
* Where a successful `login` persists the credential.
|
|
4
4
|
*
|
|
5
5
|
* - `machine` (the default) → the shared per-machine store `~/.ai-game-dev/credentials.json`
|
|
6
6
|
* (0600 on POSIX / DPAPI on Windows), so the engine plugin auto-adopts it — sign in once per
|
|
7
7
|
* machine (design 06 · D12). `storeBaseDir` overrides the store directory (tests only).
|
|
8
|
-
* - `project` → the
|
|
9
|
-
*
|
|
8
|
+
* - `project` → the per-project store `<projectPath>/.ai-game-dev/credentials.json` (gitignored),
|
|
9
|
+
* kept for per-project accounts (the `--project` flag). The CLI NEVER writes the legacy
|
|
10
|
+
* `<projectPath>/.godot-mcp/credentials.json` sink any more (06 D7 — read-fallback only, f4
|
|
11
|
+
* removes it).
|
|
10
12
|
*/
|
|
11
13
|
export type CredentialSink = {
|
|
12
14
|
kind: 'machine';
|
|
@@ -22,13 +24,32 @@ export interface CloudLoginOptions {
|
|
|
22
24
|
openBrowserImpl?: (url: string) => void;
|
|
23
25
|
/** Where to persist the credential. Defaults to the shared machine store. */
|
|
24
26
|
sink?: CredentialSink;
|
|
27
|
+
/**
|
|
28
|
+
* O10/F10 `--tools-only`: mint a `scope=mcp:plugin` credential and commit it as a plugin
|
|
29
|
+
* family ONLY — the store then holds no agent family, so desktop-App pickup is impossible by
|
|
30
|
+
* design and the runner appears as its own revocable device group.
|
|
31
|
+
*/
|
|
32
|
+
toolsOnly?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* `--yes`: auto-confirm the D6/F7 account-switch guard. Without it a subject mismatch prompts
|
|
35
|
+
* on a TTY and is DECLINED in a non-interactive session (fail closed — the just-minted family
|
|
36
|
+
* is revoked best-effort and the store stays untouched).
|
|
37
|
+
*/
|
|
38
|
+
assumeYes?: boolean;
|
|
39
|
+
/** Injectable account-switch confirmation (tests). Overrides the `assumeYes`/TTY prompt. */
|
|
40
|
+
confirmAccountSwitch?: (info: {
|
|
41
|
+
storedSubject: string;
|
|
42
|
+
newSubject: string;
|
|
43
|
+
}) => boolean | Promise<boolean>;
|
|
25
44
|
/**
|
|
26
45
|
* Injectable device-authorization transport (tests). Defaults to the real fetch-backed
|
|
27
46
|
* {@link HttpDeviceAuthTransport} which POSTs to `{base}/oauth/device_authorization` +
|
|
28
47
|
* `{base}/oauth/token` (the OAuth 2.1 device grant — NOT the retired legacy JSON device flow).
|
|
29
48
|
*/
|
|
30
49
|
transport?: DeviceAuthTransport;
|
|
31
|
-
/** Injectable
|
|
50
|
+
/** Injectable RFC 8693 exchange client (tests). Defaults to {@link HttpTokenExchangeClient}. */
|
|
51
|
+
exchangeClient?: TokenExchangeClient;
|
|
52
|
+
/** Injectable fetch for the default transport/exchange/revocation clients (tests). */
|
|
32
53
|
fetchImpl?: typeof fetch;
|
|
33
54
|
/** Injectable poll delay (tests) — bypass the real RFC 8628 polling wait. */
|
|
34
55
|
delay?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
@@ -36,17 +57,62 @@ export interface CloudLoginOptions {
|
|
|
36
57
|
now?: () => number;
|
|
37
58
|
}
|
|
38
59
|
/**
|
|
39
|
-
* Run the OAuth 2.1 device-authorization login (RFC 8628)
|
|
40
|
-
*
|
|
41
|
-
* browser, poll `/oauth/token` to completion, and persist the **full** {@link MachineCredentials}
|
|
42
|
-
* (access + rotating refresh + expiry + subject) to the resolved {@link CredentialSink}.
|
|
60
|
+
* Run the OAuth 2.1 device-authorization login (RFC 8628) and commit the mint through the shared
|
|
61
|
+
* cli-core login-commit machinery (unified-machine-auth 03 F1 / F10):
|
|
43
62
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
63
|
+
* - **Default (agent login, F1):** the device flow requests **`scope=mcp:agent`** with the
|
|
64
|
+
* product client id `godot-cli`; {@link commitAgentLogin} then writes the agent family under a
|
|
65
|
+
* FIRST lock hold, derives the plugin family via RFC 8693 token exchange with the lock
|
|
66
|
+
* released, and writes it (+ the v1 compat mirror) under a SECOND hold. A failed exchange
|
|
67
|
+
* leaves the agent family committed ("partially authorized") and the derivation is retried
|
|
68
|
+
* once here with backoff.
|
|
69
|
+
* - **`--tools-only` (O10/F10):** the device flow requests `scope=mcp:plugin` and
|
|
70
|
+
* {@link commitToolsOnlyLogin} writes a plugin family ONLY.
|
|
71
|
+
* - **Account-switch guard (D6/F7):** a subject mismatch against the stored credential requires
|
|
72
|
+
* confirmation (`--yes` / TTY prompt); a decline revokes the just-minted family (best effort,
|
|
73
|
+
* RFC 7009) and aborts with the store untouched.
|
|
49
74
|
*
|
|
50
|
-
*
|
|
75
|
+
* On any failure before the commit NOTHING is written (design 03 F4) — the store survives a
|
|
76
|
+
* denied/expired/network error intact. Nothing here logs token material.
|
|
77
|
+
*
|
|
78
|
+
* Returns the plugin-plane access token on success, or null on failure (errors are printed).
|
|
51
79
|
*/
|
|
52
80
|
export declare function runCloudLogin(options?: CloudLoginOptions): Promise<string | null>;
|
|
81
|
+
/**
|
|
82
|
+
* What a stored credential document means for a `login` against `baseUrl`:
|
|
83
|
+
*
|
|
84
|
+
* - `signed-in` — a usable **plugin-plane** credential exists for this server; `login` without
|
|
85
|
+
* `--force` short-circuits.
|
|
86
|
+
* - `partial` — the F1 failure state: an agent family is committed for this server but the
|
|
87
|
+
* plugin family was never derived (exchange failed). `login` must FINISH the derivation (no
|
|
88
|
+
* second device flow), never report "Already authenticated" — the agent family alone serves
|
|
89
|
+
* no command, so treating it as signed-in wedges the CLI (review f2 B1: `login` said
|
|
90
|
+
* "already authenticated" while every command raised `login required`, with `--force` as the
|
|
91
|
+
* only, unnamed exit).
|
|
92
|
+
* - `signed-out` — no credential for this server (missing/empty store, or a credential issued
|
|
93
|
+
* against a different base URL): run the full device flow.
|
|
94
|
+
*/
|
|
95
|
+
export type LoginState = 'signed-in' | 'partial' | 'signed-out';
|
|
96
|
+
/** Classify a stored document for the `login` gate (see {@link LoginState}). */
|
|
97
|
+
export declare function classifyLoginState(document: MachineCredentials | null, baseUrl: string): LoginState;
|
|
98
|
+
/** Options for {@link completePartialLogin}. */
|
|
99
|
+
export interface CompletePartialLoginOptions {
|
|
100
|
+
/** Cloud base URL the credential belongs to (default https://ai-game.dev). */
|
|
101
|
+
baseUrl?: string;
|
|
102
|
+
/** The store the partial credential lives in. Defaults to the shared machine store. */
|
|
103
|
+
sink?: CredentialSink;
|
|
104
|
+
/** Injectable RFC 8693 exchange client (tests). Defaults to {@link HttpTokenExchangeClient}. */
|
|
105
|
+
exchangeClient?: TokenExchangeClient;
|
|
106
|
+
/** Injectable fetch for the default exchange client / provider refresher (tests). */
|
|
107
|
+
fetchImpl?: typeof fetch;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Finish a partially-authorized login (03 F1 failure path): the agent family is already
|
|
111
|
+
* committed, so re-run ONLY the derivation leg — obtain a fresh agent access token through the
|
|
112
|
+
* provider (refreshing under the lock if it expired) and {@link derivePluginFamily} from it.
|
|
113
|
+
* **No second device flow, no browser.** On failure nothing is written and the agent family
|
|
114
|
+
* survives for the next attempt.
|
|
115
|
+
*
|
|
116
|
+
* Returns the derived plugin-plane access token, or null (errors printed, store untouched).
|
|
117
|
+
*/
|
|
118
|
+
export declare function completePartialLogin(options?: CompletePartialLoginOptions): Promise<string | null>;
|