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
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* READ-FALLBACK for the legacy project-local cloud credential sink — transition window only
|
|
5
|
+
* (unified-machine-auth 06 D7 / F11.2).
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* purely the CLI's in-project pickup surface, mirroring the Unity CLI's
|
|
15
|
-
* `cloudToken` config field.
|
|
7
|
+
* Older CLI releases persisted the cloud bearer token to `<project>/.godot-mcp/credentials.json`.
|
|
8
|
+
* The CLI **no longer writes this file anywhere** — a default `login` commits to the shared
|
|
9
|
+
* machine store (`~/.ai-game-dev/`), and `login --project` commits to the per-project store
|
|
10
|
+
* (`<project>/.ai-game-dev/`), both via `@baizor/gamedev-cli-core`. This module only READS a
|
|
11
|
+
* pre-existing legacy file so those users keep working for one release; on first use the
|
|
12
|
+
* credential is migrated into the machine store (`connection.ts` migrate-on-touch), and the f4
|
|
13
|
+
* follow-up removes this fallback entirely. There is deliberately no write function left here —
|
|
14
|
+
* a v2-era write to this sink must never ship.
|
|
16
15
|
*/
|
|
17
16
|
export const CREDENTIALS_RELATIVE_PATH = '.godot-mcp/credentials.json';
|
|
18
17
|
export function getCredentialsPath(projectPath) {
|
|
19
18
|
return path.join(projectPath, CREDENTIALS_RELATIVE_PATH);
|
|
20
19
|
}
|
|
21
|
-
/** Read the credentials file. Returns null when absent; throws on malformed JSON. */
|
|
20
|
+
/** Read the legacy credentials file. Returns null when absent; throws on malformed JSON. */
|
|
22
21
|
export function readCredentials(projectPath) {
|
|
23
22
|
const credentialsPath = getCredentialsPath(projectPath);
|
|
24
23
|
if (!fs.existsSync(credentialsPath)) {
|
|
@@ -36,31 +35,9 @@ export function readCredentials(projectPath) {
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
40
|
-
* ensuring `credentials.json` is git-ignored so the token is never committed.
|
|
41
|
-
*/
|
|
42
|
-
export function writeCredentials(projectPath, credentials) {
|
|
43
|
-
const credentialsPath = getCredentialsPath(projectPath);
|
|
44
|
-
const dir = path.dirname(credentialsPath);
|
|
45
|
-
if (!fs.existsSync(dir)) {
|
|
46
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
47
|
-
}
|
|
48
|
-
// Owner-only perms: the file holds a raw cloud bearer token, so it must not be
|
|
49
|
-
// group/world-readable on a shared machine. `mode` only applies when the file is
|
|
50
|
-
// CREATED, so also chmod on overwrite (best-effort — no-op/again-fine on Windows).
|
|
51
|
-
fs.writeFileSync(credentialsPath, JSON.stringify(credentials, null, 2) + '\n', { mode: 0o600 });
|
|
52
|
-
try {
|
|
53
|
-
fs.chmodSync(credentialsPath, 0o600);
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
// Best-effort only — never fail the login over a chmod (e.g. Windows ACLs).
|
|
57
|
-
}
|
|
58
|
-
ensureGitignored(dir, 'credentials.json');
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Convenience reader for the persisted cloud token. Swallows a missing or
|
|
38
|
+
* Convenience reader for the persisted legacy cloud token. Swallows a missing or
|
|
62
39
|
* malformed file (returns undefined) so a broken credentials file can never
|
|
63
|
-
* crash `open` / `run-tool`; `login`
|
|
40
|
+
* crash `open` / `run-tool`; `login` writes the cli-core stores instead.
|
|
64
41
|
*/
|
|
65
42
|
export function readCloudToken(projectPath) {
|
|
66
43
|
let credentials;
|
|
@@ -73,27 +50,4 @@ export function readCloudToken(projectPath) {
|
|
|
73
50
|
const token = credentials?.cloudToken;
|
|
74
51
|
return typeof token === 'string' && token.trim().length > 0 ? token : undefined;
|
|
75
52
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Ensure `<dir>/.gitignore` ignores `entry`, so the secret is not committed.
|
|
78
|
-
* Idempotent: creates the file when absent, appends the line only when missing.
|
|
79
|
-
* Best-effort — a failure here never blocks persisting the token.
|
|
80
|
-
*/
|
|
81
|
-
function ensureGitignored(dir, entry) {
|
|
82
|
-
try {
|
|
83
|
-
const gitignorePath = path.join(dir, '.gitignore');
|
|
84
|
-
if (!fs.existsSync(gitignorePath)) {
|
|
85
|
-
fs.writeFileSync(gitignorePath, `${entry}\n`);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const existing = fs.readFileSync(gitignorePath, 'utf-8');
|
|
89
|
-
const lines = existing.split(/\r?\n/).map((l) => l.trim());
|
|
90
|
-
if (!lines.includes(entry)) {
|
|
91
|
-
const prefix = existing.length > 0 && !existing.endsWith('\n') ? '\n' : '';
|
|
92
|
-
fs.appendFileSync(gitignorePath, `${prefix}${entry}\n`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
// Best-effort only — never fail the login over a .gitignore write.
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
53
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/utils/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/utils/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAUvE,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,yBAAyB,CAAC,CAAC;AAC3D,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,eAAe,CAAC,WAAmB;IACjD,MAAM,eAAe,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACxD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACvD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAwB,CAAC;IACjD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,WAAW,EAAE,CAAC;YAC/B,MAAM,IAAI,WAAW,CAAC,uCAAuC,eAAe,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAClG,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,IAAI,WAAuC,CAAC;IAC5C,IAAI,CAAC;QACH,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,WAAW,EAAE,UAAU,CAAC;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { MachineCredentialStore, MachineCredentialLock, MachineCredentialProvider, type MachineCredentials } from '@baizor/gamedev-cli-core';
|
|
2
|
+
/**
|
|
3
|
+
* Thin resolution shim over the `@baizor/gamedev-cli-core` machine credential store — the ONLY
|
|
4
|
+
* store implementation this CLI ships (unified-machine-auth 06 D7: "CLI-local store copies …
|
|
5
|
+
* deleted; cli-core is the only TS implementation"). The former local copy
|
|
6
|
+
* (`machine-credentials.ts`, whitelist serializer + non-atomic write) is gone; everything here
|
|
7
|
+
* merely resolves WHERE a store lives and wires the shared provider/lock around cli-core.
|
|
8
|
+
*
|
|
9
|
+
* Two store locations exist:
|
|
10
|
+
*
|
|
11
|
+
* - **Machine store** — `~/.ai-game-dev/` (or the {@link MACHINE_STORE_DIR_ENV} override):
|
|
12
|
+
* the per-machine single sign-on credential every engine plugin/CLI shares (design 06 D12).
|
|
13
|
+
* - **Per-project store** — `<project>/.ai-game-dev/` (the `login --project` override): a
|
|
14
|
+
* per-project account kept OUT of the legacy `.godot-mcp/credentials.json` sink, which the
|
|
15
|
+
* CLI no longer writes (06 D7; read-fallback lives in `credentials.ts` until f4 removes it).
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Optional env override for the machine-store directory (advanced use / tests). When set, this
|
|
19
|
+
* exact directory is used verbatim; otherwise the store lives at `~/.ai-game-dev`. The default
|
|
20
|
+
* matches the C# store so cross-tool interop holds — the override never changes the production
|
|
21
|
+
* path. (cli-core's `MachineCredentialStore` takes an explicit base directory; honoring this env
|
|
22
|
+
* var is the CLI's own affordance, kept for behavioral compatibility.)
|
|
23
|
+
*/
|
|
24
|
+
export declare const MACHINE_STORE_DIR_ENV = "AI_GAME_DEV_CREDENTIALS_DIR";
|
|
25
|
+
/** Resolve the machine-store directory: explicit override → env override → `~/.ai-game-dev`. */
|
|
26
|
+
export declare function resolveMachineStoreDir(baseDirOverride?: string): string;
|
|
27
|
+
/** The shared machine credential store (honoring the env override). */
|
|
28
|
+
export declare function openMachineStore(baseDirOverride?: string): MachineCredentialStore;
|
|
29
|
+
/** Absolute path of the machine credential file (for user-facing messages). */
|
|
30
|
+
export declare function getMachineCredentialsPath(baseDirOverride?: string): string;
|
|
31
|
+
/** The 04 §2 cross-process lock guarding the machine store's directory. */
|
|
32
|
+
export declare function openMachineStoreLock(baseDirOverride?: string): MachineCredentialLock;
|
|
33
|
+
/** Directory name of the per-project credential store (same layout as the machine store). */
|
|
34
|
+
export declare const PROJECT_STORE_DIR_NAME = ".ai-game-dev";
|
|
35
|
+
/** Absolute path of a project's per-project store directory (`<project>/.ai-game-dev`). */
|
|
36
|
+
export declare function resolveProjectStoreDir(projectPath: string): string;
|
|
37
|
+
/** The per-project credential store (`login --project` — cli-core's documented per-project use). */
|
|
38
|
+
export declare function openProjectStore(projectPath: string): MachineCredentialStore;
|
|
39
|
+
/**
|
|
40
|
+
* Ensure `<project>/.ai-game-dev/.gitignore` ignores the credential + lock files, so a
|
|
41
|
+
* per-project credential is never committed while the sibling `project.json` marker stays
|
|
42
|
+
* version-controllable. Idempotent and best-effort — a failure never blocks persisting.
|
|
43
|
+
*/
|
|
44
|
+
export declare function ensureProjectStoreGitignored(projectPath: string): void;
|
|
45
|
+
/** Options for {@link createMachineCredentialProvider}. */
|
|
46
|
+
export interface CreateProviderOptions {
|
|
47
|
+
/** Store the provider serves: an explicit directory (per-project store / tests). */
|
|
48
|
+
storeDir?: string;
|
|
49
|
+
/** AS root used when a credential carries no `serverTarget`. Default `https://ai-game.dev`. */
|
|
50
|
+
serverBaseUrl?: string;
|
|
51
|
+
/** Injectable `fetch` for the refresher (tests / fake AS). */
|
|
52
|
+
fetchImpl?: typeof fetch;
|
|
53
|
+
/** Structured warning sink (never receives token material). */
|
|
54
|
+
onWarning?: (message: string) => void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Build the cli-core {@link MachineCredentialProvider} for a store — THE single entry point for
|
|
58
|
+
* credential access + refresh (unified-machine-auth 02/04): proactive refresh inside the 60 s
|
|
59
|
+
* skew, reactive refresh on 401, all writes under the 04 §2 cross-process lock, presenting the
|
|
60
|
+
* family's stored `clientId` (`godot-cli` only as the `families.legacy` default — 04 §3.7).
|
|
61
|
+
*/
|
|
62
|
+
export declare function createMachineCredentialProvider(options?: CreateProviderOptions): MachineCredentialProvider;
|
|
63
|
+
/**
|
|
64
|
+
* True when `document` holds at least one usable (access-token-bearing) family — the families
|
|
65
|
+
* view is schema-version independent (a v1 document reads as `families.legacy`).
|
|
66
|
+
*/
|
|
67
|
+
export declare function hasUsableFamily(document: MachineCredentials | null): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* True when `document` holds a usable **plugin-plane** credential — `families.plugin`, falling
|
|
70
|
+
* back to `families.legacy` (an adopted v1 credential IS the plugin-plane credential), mirroring
|
|
71
|
+
* the provider's plane resolution. An **agent-only** store (the F1 `partial` state: exchange
|
|
72
|
+
* failed after the agent family committed) is NOT signed in for CLI purposes — every command
|
|
73
|
+
* consumes the plugin plane, so treating the agent family as "signed in" wedges `login` into
|
|
74
|
+
* "Already authenticated" while every command raises `login required` (review f2 B1).
|
|
75
|
+
*/
|
|
76
|
+
export declare function hasPluginPlaneCredential(document: MachineCredentials | null): boolean;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as os from 'os';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { MachineCredentialStore, MachineCredentialLock, MachineCredentialProvider, HttpTokenRefresher, godotAdapter, effectiveFamilies, MACHINE_STORE_DIR_NAME, DEFAULT_CLOUD_BASE_URL, } from '@baizor/gamedev-cli-core';
|
|
5
|
+
/**
|
|
6
|
+
* Thin resolution shim over the `@baizor/gamedev-cli-core` machine credential store — the ONLY
|
|
7
|
+
* store implementation this CLI ships (unified-machine-auth 06 D7: "CLI-local store copies …
|
|
8
|
+
* deleted; cli-core is the only TS implementation"). The former local copy
|
|
9
|
+
* (`machine-credentials.ts`, whitelist serializer + non-atomic write) is gone; everything here
|
|
10
|
+
* merely resolves WHERE a store lives and wires the shared provider/lock around cli-core.
|
|
11
|
+
*
|
|
12
|
+
* Two store locations exist:
|
|
13
|
+
*
|
|
14
|
+
* - **Machine store** — `~/.ai-game-dev/` (or the {@link MACHINE_STORE_DIR_ENV} override):
|
|
15
|
+
* the per-machine single sign-on credential every engine plugin/CLI shares (design 06 D12).
|
|
16
|
+
* - **Per-project store** — `<project>/.ai-game-dev/` (the `login --project` override): a
|
|
17
|
+
* per-project account kept OUT of the legacy `.godot-mcp/credentials.json` sink, which the
|
|
18
|
+
* CLI no longer writes (06 D7; read-fallback lives in `credentials.ts` until f4 removes it).
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Optional env override for the machine-store directory (advanced use / tests). When set, this
|
|
22
|
+
* exact directory is used verbatim; otherwise the store lives at `~/.ai-game-dev`. The default
|
|
23
|
+
* matches the C# store so cross-tool interop holds — the override never changes the production
|
|
24
|
+
* path. (cli-core's `MachineCredentialStore` takes an explicit base directory; honoring this env
|
|
25
|
+
* var is the CLI's own affordance, kept for behavioral compatibility.)
|
|
26
|
+
*/
|
|
27
|
+
export const MACHINE_STORE_DIR_ENV = 'AI_GAME_DEV_CREDENTIALS_DIR';
|
|
28
|
+
/** Resolve the machine-store directory: explicit override → env override → `~/.ai-game-dev`. */
|
|
29
|
+
export function resolveMachineStoreDir(baseDirOverride) {
|
|
30
|
+
if (baseDirOverride)
|
|
31
|
+
return baseDirOverride;
|
|
32
|
+
const envDir = process.env[MACHINE_STORE_DIR_ENV];
|
|
33
|
+
if (envDir && envDir.trim().length > 0)
|
|
34
|
+
return envDir;
|
|
35
|
+
return path.join(os.homedir(), MACHINE_STORE_DIR_NAME);
|
|
36
|
+
}
|
|
37
|
+
/** The shared machine credential store (honoring the env override). */
|
|
38
|
+
export function openMachineStore(baseDirOverride) {
|
|
39
|
+
return new MachineCredentialStore(resolveMachineStoreDir(baseDirOverride));
|
|
40
|
+
}
|
|
41
|
+
/** Absolute path of the machine credential file (for user-facing messages). */
|
|
42
|
+
export function getMachineCredentialsPath(baseDirOverride) {
|
|
43
|
+
return openMachineStore(baseDirOverride).credentialsPath;
|
|
44
|
+
}
|
|
45
|
+
/** The 04 §2 cross-process lock guarding the machine store's directory. */
|
|
46
|
+
export function openMachineStoreLock(baseDirOverride) {
|
|
47
|
+
return new MachineCredentialLock(resolveMachineStoreDir(baseDirOverride));
|
|
48
|
+
}
|
|
49
|
+
/** Directory name of the per-project credential store (same layout as the machine store). */
|
|
50
|
+
export const PROJECT_STORE_DIR_NAME = MACHINE_STORE_DIR_NAME;
|
|
51
|
+
/** Absolute path of a project's per-project store directory (`<project>/.ai-game-dev`). */
|
|
52
|
+
export function resolveProjectStoreDir(projectPath) {
|
|
53
|
+
return path.join(projectPath, PROJECT_STORE_DIR_NAME);
|
|
54
|
+
}
|
|
55
|
+
/** The per-project credential store (`login --project` — cli-core's documented per-project use). */
|
|
56
|
+
export function openProjectStore(projectPath) {
|
|
57
|
+
return new MachineCredentialStore(resolveProjectStoreDir(projectPath));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Ensure `<project>/.ai-game-dev/.gitignore` ignores the credential + lock files, so a
|
|
61
|
+
* per-project credential is never committed while the sibling `project.json` marker stays
|
|
62
|
+
* version-controllable. Idempotent and best-effort — a failure never blocks persisting.
|
|
63
|
+
*/
|
|
64
|
+
export function ensureProjectStoreGitignored(projectPath) {
|
|
65
|
+
const entries = ['credentials.json', 'credentials.lock', 'credentials.lock.takeover'];
|
|
66
|
+
try {
|
|
67
|
+
const dir = resolveProjectStoreDir(projectPath);
|
|
68
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
69
|
+
const gitignorePath = path.join(dir, '.gitignore');
|
|
70
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
71
|
+
fs.writeFileSync(gitignorePath, entries.join('\n') + '\n');
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const existing = fs.readFileSync(gitignorePath, 'utf-8');
|
|
75
|
+
const lines = existing.split(/\r?\n/).map((l) => l.trim());
|
|
76
|
+
const missing = entries.filter((e) => !lines.includes(e));
|
|
77
|
+
if (missing.length > 0) {
|
|
78
|
+
const prefix = existing.length > 0 && !existing.endsWith('\n') ? '\n' : '';
|
|
79
|
+
fs.appendFileSync(gitignorePath, `${prefix}${missing.join('\n')}\n`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Best-effort only — never fail a login over a .gitignore write.
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Build the cli-core {@link MachineCredentialProvider} for a store — THE single entry point for
|
|
88
|
+
* credential access + refresh (unified-machine-auth 02/04): proactive refresh inside the 60 s
|
|
89
|
+
* skew, reactive refresh on 401, all writes under the 04 §2 cross-process lock, presenting the
|
|
90
|
+
* family's stored `clientId` (`godot-cli` only as the `families.legacy` default — 04 §3.7).
|
|
91
|
+
*/
|
|
92
|
+
export function createMachineCredentialProvider(options = {}) {
|
|
93
|
+
const store = options.storeDir
|
|
94
|
+
? new MachineCredentialStore(options.storeDir)
|
|
95
|
+
: openMachineStore();
|
|
96
|
+
const refresher = new HttpTokenRefresher({
|
|
97
|
+
defaultServerBaseUrl: options.serverBaseUrl ?? DEFAULT_CLOUD_BASE_URL,
|
|
98
|
+
...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
|
|
99
|
+
});
|
|
100
|
+
return new MachineCredentialProvider(store, refresher, {
|
|
101
|
+
defaultClientId: godotAdapter.clientId, // 'godot-cli'
|
|
102
|
+
...(options.onWarning ? { onWarning: options.onWarning } : {}),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* True when `document` holds at least one usable (access-token-bearing) family — the families
|
|
107
|
+
* view is schema-version independent (a v1 document reads as `families.legacy`).
|
|
108
|
+
*/
|
|
109
|
+
export function hasUsableFamily(document) {
|
|
110
|
+
if (!document)
|
|
111
|
+
return false;
|
|
112
|
+
return Object.values(effectiveFamilies(document)).some((family) => typeof family?.accessToken === 'string' && family.accessToken.trim().length > 0);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* True when `document` holds a usable **plugin-plane** credential — `families.plugin`, falling
|
|
116
|
+
* back to `families.legacy` (an adopted v1 credential IS the plugin-plane credential), mirroring
|
|
117
|
+
* the provider's plane resolution. An **agent-only** store (the F1 `partial` state: exchange
|
|
118
|
+
* failed after the agent family committed) is NOT signed in for CLI purposes — every command
|
|
119
|
+
* consumes the plugin plane, so treating the agent family as "signed in" wedges `login` into
|
|
120
|
+
* "Already authenticated" while every command raises `login required` (review f2 B1).
|
|
121
|
+
*/
|
|
122
|
+
export function hasPluginPlaneCredential(document) {
|
|
123
|
+
if (!document)
|
|
124
|
+
return false;
|
|
125
|
+
const families = effectiveFamilies(document);
|
|
126
|
+
const plane = families.plugin ?? families.legacy;
|
|
127
|
+
return typeof plane?.accessToken === 'string' && plane.accessToken.trim().length > 0;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=machine-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machine-store.js","sourceRoot":"","sources":["../../src/utils/machine-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,GAEvB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,6BAA6B,CAAC;AAEnE,gGAAgG;AAChG,MAAM,UAAU,sBAAsB,CAAC,eAAwB;IAC7D,IAAI,eAAe;QAAE,OAAO,eAAe,CAAC;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAClD,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IACtD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,sBAAsB,CAAC,CAAC;AACzD,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,eAAwB;IACvD,OAAO,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED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AAC,QAAQ,EAAE,cAAc;QACtD,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,QAAmC;IACjE,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CACpD,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,EAAE,WAAW,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAC5F,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAmC;IAC1E,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC;IACjD,OAAO,OAAO,KAAK,EAAE,WAAW,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* download entirely (offline / CI). Bumping the addon's server pin requires
|
|
6
6
|
* bumping this in the same PR or the parity test goes red.
|
|
7
7
|
*/
|
|
8
|
-
export declare const DEFAULT_SERVER_VERSION = "9.2.
|
|
8
|
+
export declare const DEFAULT_SERVER_VERSION = "9.2.5";
|
|
9
9
|
/** GitHub-release host the server zip + manifest are downloaded from. NOTHING else is trusted. */
|
|
10
10
|
export declare const TRUSTED_DOWNLOAD_HOST = "github.com";
|
|
11
11
|
/** The `owner/repo` the shared server releases live under. */
|
|
@@ -18,7 +18,7 @@ import { createHash } from 'crypto';
|
|
|
18
18
|
* download entirely (offline / CI). Bumping the addon's server pin requires
|
|
19
19
|
* bumping this in the same PR or the parity test goes red.
|
|
20
20
|
*/
|
|
21
|
-
export const DEFAULT_SERVER_VERSION = '9.2.
|
|
21
|
+
export const DEFAULT_SERVER_VERSION = '9.2.5';
|
|
22
22
|
/** GitHub-release host the server zip + manifest are downloaded from. NOTHING else is trusted. */
|
|
23
23
|
export const TRUSTED_DOWNLOAD_HOST = 'github.com';
|
|
24
24
|
/** The `owner/repo` the shared server releases live under. */
|
package/dist/utils/ui.d.ts
CHANGED
|
@@ -59,3 +59,8 @@ export declare function featureRow(name: string, enabled: boolean): void;
|
|
|
59
59
|
* Print a divider line.
|
|
60
60
|
*/
|
|
61
61
|
export declare function divider(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Interactive yes/no confirmation on the terminal (default **No**). Only call on a TTY —
|
|
64
|
+
* non-interactive callers must decide via their own flag (e.g. `login --yes`) instead.
|
|
65
|
+
*/
|
|
66
|
+
export declare function confirm(question: string): Promise<boolean>;
|
package/dist/utils/ui.js
CHANGED
|
@@ -235,4 +235,19 @@ export function featureRow(name, enabled) {
|
|
|
235
235
|
export function divider() {
|
|
236
236
|
console.log(chalk.dim('─'.repeat(50)));
|
|
237
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Interactive yes/no confirmation on the terminal (default **No**). Only call on a TTY —
|
|
240
|
+
* non-interactive callers must decide via their own flag (e.g. `login --yes`) instead.
|
|
241
|
+
*/
|
|
242
|
+
export async function confirm(question) {
|
|
243
|
+
const readline = await import('node:readline/promises');
|
|
244
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
245
|
+
try {
|
|
246
|
+
const answer = (await rl.question(`${question} [y/N] `)).trim().toLowerCase();
|
|
247
|
+
return answer === 'y' || answer === 'yes';
|
|
248
|
+
}
|
|
249
|
+
finally {
|
|
250
|
+
rl.close();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
238
253
|
//# sourceMappingURL=ui.js.map
|
package/dist/utils/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAA8B,MAAM,eAAe,CAAC;AAG3D,uBAAuB;AACvB,IAAI,cAAc,GAAG,KAAK,CAAC;AAE3B,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,cAAc,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,IAAI,cAAc,EAAE,CAAC;QACnB,IAAI,KAAK,EAAE,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC;AAED,wBAAwB;AACxB,SAAS,KAAK;IACZ,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,IAAY;IAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,CAAC;IAClB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,O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C,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9E,OAAO,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,KAAK,CAAC;IAC5C,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "godot-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Cross-platform CLI tool for Godot-MCP (Skills & MCP). Resolves and launches the Godot editor with MCP connection env vars, runs MCP/system tools over HTTP, probes server health, configures AI agents (Claude Code, Cursor, VS Code, …), and enables/disables the godot_mcp addon. Works with Claude Code, Cursor, Copilot, and any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/lib.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"node": "^20.19.0 || >=22.12.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@baizor/gamedev-cli-core": "^0.
|
|
65
|
+
"@baizor/gamedev-cli-core": "^0.4.0",
|
|
66
66
|
"chalk": "^5.6.2",
|
|
67
67
|
"commander": "^13.1.0",
|
|
68
68
|
"yocto-spinner": "^1.1.0"
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shared **machine credential store** at `~/.ai-game-dev/` — a single per-machine home for the
|
|
3
|
-
* ai-game.dev account credential (`credentials.json`). Engines, CLIs, and the local server all read
|
|
4
|
-
* this store, so **sign-in happens once per machine** (design `06-engine-plugins.md` / D12).
|
|
5
|
-
*
|
|
6
|
-
* This is the TypeScript peer of the shared C# `MachineCredentialStore`
|
|
7
|
-
* (`MCP-Plugin-dotnet/McpPlugin/src/AgentConfig/MachineCredentialStore.cs`). The on-disk contract is
|
|
8
|
-
* matched byte-for-byte so a credential written by `godot-cli login` is read by the engine plugin
|
|
9
|
-
* (which auto-adopts it on editor boot) and vice-versa:
|
|
10
|
-
*
|
|
11
|
-
* - **POSIX** — `credentials.json` is written plaintext with `0600` permissions inside a `0700`
|
|
12
|
-
* directory.
|
|
13
|
-
* - **Windows** — the file content is **DPAPI-encrypted** with the current user's key
|
|
14
|
-
* (`CryptProtectData`, `CurrentUser` scope, no entropy) so the on-disk bytes are never plaintext.
|
|
15
|
-
* Node has no built-in DPAPI, so we interop via PowerShell's `System.Security.Cryptography.
|
|
16
|
-
* ProtectedData`, which is a managed wrapper over the very same `CryptProtectData`/
|
|
17
|
-
* `CryptUnprotectData` calls the C# store uses — the blobs are cross-readable.
|
|
18
|
-
*
|
|
19
|
-
* Credentials are NEVER written to a project file / VCS. The optional `--project` per-project override
|
|
20
|
-
* (project-local `.godot-mcp/credentials.json`, gitignored) is handled by `credentials.ts`, not here.
|
|
21
|
-
*/
|
|
22
|
-
/** Directory name under the user home that holds the store (matches C# `MachineCredentialStore.DirectoryName`). */
|
|
23
|
-
export declare const MACHINE_STORE_DIR_NAME = ".ai-game-dev";
|
|
24
|
-
/** File name of the secret credential document. */
|
|
25
|
-
export declare const MACHINE_CREDENTIALS_FILE_NAME = "credentials.json";
|
|
26
|
-
/**
|
|
27
|
-
* Optional env override for the store directory (advanced use / tests). When set, this exact
|
|
28
|
-
* directory is used verbatim; otherwise the store lives at `~/.ai-game-dev`. The DEFAULT matches the
|
|
29
|
-
* C# store so cross-tool interop holds — the override never changes the production path.
|
|
30
|
-
*/
|
|
31
|
-
export declare const MACHINE_STORE_DIR_ENV = "AI_GAME_DEV_CREDENTIALS_DIR";
|
|
32
|
-
/**
|
|
33
|
-
* The secret credential material persisted per machine (mirrors the C# `MachineCredentials` document,
|
|
34
|
-
* camelCase field names). Unknown fields are ignored on read so the schema can grow forwards.
|
|
35
|
-
*/
|
|
36
|
-
export interface MachineCredentials {
|
|
37
|
-
/** Schema version of the persisted document (currently 1). */
|
|
38
|
-
version?: number;
|
|
39
|
-
/** The current short-lived JWT access token (the cloud bearer token). */
|
|
40
|
-
accessToken?: string;
|
|
41
|
-
/** The rotating refresh token used to mint a new access token before `expiresAt`. */
|
|
42
|
-
refreshToken?: string;
|
|
43
|
-
/** Absolute expiry of `accessToken` (ISO 8601); used to schedule proactive refresh. */
|
|
44
|
-
expiresAt?: string;
|
|
45
|
-
/** The server target the credential was issued for (hosted `https://ai-game.dev` or a local URL). */
|
|
46
|
-
serverTarget?: string;
|
|
47
|
-
/** The account id (`sub`) the credential resolves to. Audit/diagnostic only. */
|
|
48
|
-
subject?: string;
|
|
49
|
-
}
|
|
50
|
-
/** Absolute path of the store directory (honoring the env override). */
|
|
51
|
-
export declare function getMachineStoreDir(baseDirOverride?: string): string;
|
|
52
|
-
/** Absolute path of the secret credential file. */
|
|
53
|
-
export declare function getMachineCredentialsPath(baseDirOverride?: string): string;
|
|
54
|
-
/** True when a credential file exists in the store. */
|
|
55
|
-
export declare function machineCredentialsExist(baseDirOverride?: string): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Read and (on Windows) decrypt the stored credentials, or `null` when none are present / empty.
|
|
58
|
-
* Throws on a decryption failure or malformed JSON (a corrupt or foreign-user credential); callers on
|
|
59
|
-
* a hot path should use {@link readMachineAccessToken}, which swallows those.
|
|
60
|
-
*/
|
|
61
|
-
export declare function readMachineCredentials(baseDirOverride?: string): MachineCredentials | null;
|
|
62
|
-
/**
|
|
63
|
-
* Encrypt (Windows) / restrict (POSIX) and write `credentials` to the store, creating the store
|
|
64
|
-
* directory with owner-only permissions if needed.
|
|
65
|
-
*/
|
|
66
|
-
export declare function writeMachineCredentials(credentials: MachineCredentials, baseDirOverride?: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* Convenience reader for the persisted access token. Swallows a missing / malformed / undecryptable
|
|
69
|
-
* file (returns undefined) so a broken store can never crash a command; `login` re-authenticates and
|
|
70
|
-
* overwrites it.
|
|
71
|
-
*/
|
|
72
|
-
export declare function readMachineAccessToken(baseDirOverride?: string): string | undefined;
|
|
73
|
-
/** Delete the stored credentials (sign-out). No-op when none exist. */
|
|
74
|
-
export declare function deleteMachineCredentials(baseDirOverride?: string): void;
|