godot-cli 0.11.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -3
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.js +66 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/install-plugin.js +44 -6
- package/dist/commands/install-plugin.js.map +1 -1
- package/dist/commands/open.js +24 -1
- package/dist/commands/open.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/build.d.ts +36 -0
- package/dist/lib/build.js +174 -0
- package/dist/lib/build.js.map +1 -0
- package/dist/lib/install-plugin.d.ts +15 -8
- package/dist/lib/install-plugin.js +238 -16
- package/dist/lib/install-plugin.js.map +1 -1
- package/dist/lib/open.js +33 -0
- package/dist/lib/open.js.map +1 -1
- package/dist/lib/types.d.ts +138 -0
- package/dist/lib.d.ts +2 -1
- package/dist/lib.js +1 -0
- package/dist/lib.js.map +1 -1
- package/dist/utils/addon-deps.d.ts +15 -0
- package/dist/utils/addon-deps.js +27 -0
- package/dist/utils/addon-deps.js.map +1 -0
- package/dist/utils/addon-source.d.ts +36 -0
- package/dist/utils/addon-source.js +68 -0
- package/dist/utils/addon-source.js.map +1 -0
- package/dist/utils/csproj-deps.d.ts +40 -0
- package/dist/utils/csproj-deps.js +121 -0
- package/dist/utils/csproj-deps.js.map +1 -0
- package/dist/utils/unzip.d.ts +25 -0
- package/dist/utils/unzip.js +79 -0
- package/dist/utils/unzip.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// The NuGet PackageReferences a consumer's Godot C# project MUST declare so the
|
|
2
|
+
// `addons/godot_mcp/` sources compile into the project assembly (Godot globs every
|
|
3
|
+
// `*.cs` under the project into one assembly — see the addon README
|
|
4
|
+
// "Consumer-install story"). `install-plugin` writes these into the generated
|
|
5
|
+
// consumer `.csproj` so a from-scratch terminal install actually builds.
|
|
6
|
+
//
|
|
7
|
+
// SINGLE SOURCE OF TRUTH: these values mirror the addon's own reused pins in
|
|
8
|
+
// `Godot-MCP.csproj` (`com.IvanMurzak.ReflectorNet`, `com.IvanMurzak.McpPlugin`).
|
|
9
|
+
// They are NOT a bump of those pins — they are the SAME values, copied so the
|
|
10
|
+
// scaffold installs exactly what the addon was built against. A parity test
|
|
11
|
+
// (`cli/tests/addon-deps-parity.test.ts`) reads `Godot-MCP.csproj` and FAILS the
|
|
12
|
+
// build if these constants ever drift from the addon's pins, so the scaffold can
|
|
13
|
+
// never silently install a mismatched version.
|
|
14
|
+
//
|
|
15
|
+
// No top-level side effects; pure data + pure string transforms only.
|
|
16
|
+
/**
|
|
17
|
+
* The exact NuGet `PackageReference`s the consumer's project `.csproj` needs,
|
|
18
|
+
* single-sourced from the addon's `Godot-MCP.csproj` pins. Order matches the
|
|
19
|
+
* addon csproj (ReflectorNet first, then McpPlugin).
|
|
20
|
+
*/
|
|
21
|
+
export const ADDON_PACKAGE_REFERENCES = [
|
|
22
|
+
{ id: 'com.IvanMurzak.ReflectorNet', version: '5.3.1' },
|
|
23
|
+
{ id: 'com.IvanMurzak.McpPlugin', version: '6.10.0' },
|
|
24
|
+
];
|
|
25
|
+
/** The resource path of the addon manifest a consumer project loads the plugin from. */
|
|
26
|
+
export const ADDON_PLUGIN_CFG_RESOURCE = 'res://addons/godot_mcp/plugin.cfg';
|
|
27
|
+
//# sourceMappingURL=addon-deps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon-deps.js","sourceRoot":"","sources":["../../src/utils/addon-deps.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,mFAAmF;AACnF,oEAAoE;AACpE,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,6EAA6E;AAC7E,kFAAkF;AAClF,8EAA8E;AAC9E,4EAA4E;AAC5E,iFAAiF;AACjF,iFAAiF;AACjF,+CAA+C;AAC/C,EAAE;AACF,sEAAsE;AAUtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE,EAAE,EAAE,EAAE,6BAA6B,EAAE,OAAO,EAAE,OAAO,EAAE;IACvD,EAAE,EAAE,EAAE,0BAA0B,EAAE,OAAO,EAAE,QAAQ,EAAE;CAC7C,CAAC;AAEX,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** GitHub-release host the addon zip is downloaded from. NOTHING else is trusted. */
|
|
2
|
+
export declare const TRUSTED_DOWNLOAD_HOST = "github.com";
|
|
3
|
+
/** The `owner/repo` the addon releases live under. */
|
|
4
|
+
export declare const ADDON_RELEASE_REPO = "IvanMurzak/Godot-MCP";
|
|
5
|
+
/**
|
|
6
|
+
* The release-asset name for an addon version: `godot-mcp-addon-<version>.zip`.
|
|
7
|
+
* Matches the asset the release workflow attaches (`release.yml` → "Package addon
|
|
8
|
+
* zip": `zip_name="godot-mcp-addon-${version}.zip"`). The `<version>` is the bare
|
|
9
|
+
* version WITHOUT a leading `v` (the `v` only appears in the tag). Pure.
|
|
10
|
+
*/
|
|
11
|
+
export declare function addonAssetName(version: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The git release TAG for an addon version: the version with a leading `v`
|
|
14
|
+
* (`0.11.1` → `v0.11.1`). The release workflow tags every release `v<version>`
|
|
15
|
+
* (`release.yml` → `tag=v${version}`); an already-`v`-prefixed input is passed
|
|
16
|
+
* through unchanged so a caller cannot double-prefix. Pure.
|
|
17
|
+
*/
|
|
18
|
+
export declare function releaseTag(version: string): string;
|
|
19
|
+
/** Drop a single leading `v`/`V` from a version string. Pure. */
|
|
20
|
+
export declare function stripLeadingV(version: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The download URL for an addon version's zip:
|
|
23
|
+
* `https://github.com/IvanMurzak/Godot-MCP/releases/download/v<version>/godot-mcp-addon-<version>.zip`.
|
|
24
|
+
* Mirrors `GodotMcpServerView.DownloadUrl`. Pure string build. The host is always
|
|
25
|
+
* `github.com` by construction; `assertTrustedDownloadUrl` re-checks a
|
|
26
|
+
* caller-supplied URL before any network call.
|
|
27
|
+
*/
|
|
28
|
+
export declare function addonDownloadUrl(version: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Fail-closed host trust check: throw unless `url` is an HTTPS URL whose host is
|
|
31
|
+
* EXACTLY `github.com` (no subdomains, no `github.com.evil.test`, no http). This
|
|
32
|
+
* is the security boundary the task requires — reject non-github hosts. Returns
|
|
33
|
+
* the parsed URL on success. Pure (throws on the unhappy path; the caller turns
|
|
34
|
+
* it into a structured failure so nothing escapes the public boundary).
|
|
35
|
+
*/
|
|
36
|
+
export declare function assertTrustedDownloadUrl(url: string): URL;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Pure helpers for resolving WHERE the `addons/godot_mcp/` files come from when
|
|
2
|
+
// `install-plugin` materializes them: the trusted GitHub-release download URL and
|
|
3
|
+
// the host-trust check. Mirrors the addon's own trusted-source pattern in
|
|
4
|
+
// `addons/godot_mcp/Runtime/Connection/GodotMcpServerView.cs` (github.com only,
|
|
5
|
+
// `releases/download/v<version>/<asset>`). No side effects; unit-testable.
|
|
6
|
+
/** GitHub-release host the addon zip is downloaded from. NOTHING else is trusted. */
|
|
7
|
+
export const TRUSTED_DOWNLOAD_HOST = 'github.com';
|
|
8
|
+
/** The `owner/repo` the addon releases live under. */
|
|
9
|
+
export const ADDON_RELEASE_REPO = 'IvanMurzak/Godot-MCP';
|
|
10
|
+
/**
|
|
11
|
+
* The release-asset name for an addon version: `godot-mcp-addon-<version>.zip`.
|
|
12
|
+
* Matches the asset the release workflow attaches (`release.yml` → "Package addon
|
|
13
|
+
* zip": `zip_name="godot-mcp-addon-${version}.zip"`). The `<version>` is the bare
|
|
14
|
+
* version WITHOUT a leading `v` (the `v` only appears in the tag). Pure.
|
|
15
|
+
*/
|
|
16
|
+
export function addonAssetName(version) {
|
|
17
|
+
return `godot-mcp-addon-${stripLeadingV(version)}.zip`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The git release TAG for an addon version: the version with a leading `v`
|
|
21
|
+
* (`0.11.1` → `v0.11.1`). The release workflow tags every release `v<version>`
|
|
22
|
+
* (`release.yml` → `tag=v${version}`); an already-`v`-prefixed input is passed
|
|
23
|
+
* through unchanged so a caller cannot double-prefix. Pure.
|
|
24
|
+
*/
|
|
25
|
+
export function releaseTag(version) {
|
|
26
|
+
const v = (version ?? '').trim();
|
|
27
|
+
return v.startsWith('v') ? v : `v${v}`;
|
|
28
|
+
}
|
|
29
|
+
/** Drop a single leading `v`/`V` from a version string. Pure. */
|
|
30
|
+
export function stripLeadingV(version) {
|
|
31
|
+
const v = (version ?? '').trim();
|
|
32
|
+
return /^v/i.test(v) ? v.slice(1) : v;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The download URL for an addon version's zip:
|
|
36
|
+
* `https://github.com/IvanMurzak/Godot-MCP/releases/download/v<version>/godot-mcp-addon-<version>.zip`.
|
|
37
|
+
* Mirrors `GodotMcpServerView.DownloadUrl`. Pure string build. The host is always
|
|
38
|
+
* `github.com` by construction; `assertTrustedDownloadUrl` re-checks a
|
|
39
|
+
* caller-supplied URL before any network call.
|
|
40
|
+
*/
|
|
41
|
+
export function addonDownloadUrl(version) {
|
|
42
|
+
const bare = stripLeadingV(version);
|
|
43
|
+
return `https://${TRUSTED_DOWNLOAD_HOST}/${ADDON_RELEASE_REPO}/releases/download/${releaseTag(version)}/${addonAssetName(bare)}`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Fail-closed host trust check: throw unless `url` is an HTTPS URL whose host is
|
|
47
|
+
* EXACTLY `github.com` (no subdomains, no `github.com.evil.test`, no http). This
|
|
48
|
+
* is the security boundary the task requires — reject non-github hosts. Returns
|
|
49
|
+
* the parsed URL on success. Pure (throws on the unhappy path; the caller turns
|
|
50
|
+
* it into a structured failure so nothing escapes the public boundary).
|
|
51
|
+
*/
|
|
52
|
+
export function assertTrustedDownloadUrl(url) {
|
|
53
|
+
let parsed;
|
|
54
|
+
try {
|
|
55
|
+
parsed = new URL(url);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new Error(`Refusing to download addon: malformed URL "${url}".`);
|
|
59
|
+
}
|
|
60
|
+
if (parsed.protocol !== 'https:') {
|
|
61
|
+
throw new Error(`Refusing to download addon: only https is allowed, got "${parsed.protocol}" (${url}).`);
|
|
62
|
+
}
|
|
63
|
+
if (parsed.hostname.toLowerCase() !== TRUSTED_DOWNLOAD_HOST) {
|
|
64
|
+
throw new Error(`Refusing to download addon from untrusted host "${parsed.hostname}". Only ${TRUSTED_DOWNLOAD_HOST} is trusted.`);
|
|
65
|
+
}
|
|
66
|
+
return parsed;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=addon-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon-source.js","sourceRoot":"","sources":["../../src/utils/addon-source.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,kFAAkF;AAClF,0EAA0E;AAC1E,gFAAgF;AAChF,2EAA2E;AAE3E,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAElD,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,mBAAmB,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACzC,C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idempotently reconcile a Godot consumer `.csproj`'s `<PackageReference>`s so it
|
|
4
|
+
* declares exactly the addon's two required NuGet pins (see `addon-deps.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Pure: operates on the csproj TEXT and returns the new text + what changed; never
|
|
7
|
+
* touches the filesystem. Exported for unit tests. Handles, idempotently:
|
|
8
|
+
* - a project with NO `<ItemGroup>` at all (appends one before `</Project>`);
|
|
9
|
+
* - a project that already declares both pins at the right version (no change);
|
|
10
|
+
* - a project that declares one or both at a DIFFERENT version (reconciles in place);
|
|
11
|
+
* - a project that declares only one of the two (adds the missing one).
|
|
12
|
+
*
|
|
13
|
+
* It deliberately does a minimal, well-scoped text edit rather than a full XML
|
|
14
|
+
* parse/serialize, to preserve the rest of the consumer's csproj formatting
|
|
15
|
+
* verbatim. The `<PackageReference Include="..." />` shape it reads/writes is the
|
|
16
|
+
* single self-closing form the scaffold and the addon README both use.
|
|
17
|
+
*/
|
|
18
|
+
export type CsprojPatchChange = {
|
|
19
|
+
id: string;
|
|
20
|
+
action: 'added';
|
|
21
|
+
version: string;
|
|
22
|
+
} | {
|
|
23
|
+
id: string;
|
|
24
|
+
action: 'updated';
|
|
25
|
+
from: string;
|
|
26
|
+
version: string;
|
|
27
|
+
} | {
|
|
28
|
+
id: string;
|
|
29
|
+
action: 'unchanged';
|
|
30
|
+
version: string;
|
|
31
|
+
};
|
|
32
|
+
export interface CsprojPatchResult {
|
|
33
|
+
/** The new csproj text (identical to input when nothing changed). */
|
|
34
|
+
text: string;
|
|
35
|
+
/** True when the text was modified. */
|
|
36
|
+
changed: boolean;
|
|
37
|
+
/** One entry per required package describing what happened to it. */
|
|
38
|
+
changes: CsprojPatchChange[];
|
|
39
|
+
}
|
|
40
|
+
export declare function addAddonPackageReferences(csprojText: string, requiredRefs?: readonly AddonPackageReference[]): CsprojPatchResult;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ADDON_PACKAGE_REFERENCES } from './addon-deps.js';
|
|
2
|
+
/** Escape a string for use inside a RegExp source. */
|
|
3
|
+
function escapeRegExp(value) {
|
|
4
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Match an existing `<PackageReference Include="<id>" Version="<ver>" />` element
|
|
8
|
+
* for a specific package id, capturing the whole element and its version, in
|
|
9
|
+
* either attribute order (`Include` before or after `Version`). The element may
|
|
10
|
+
* also be a `<PackageReference ...></PackageReference>` open/close pair.
|
|
11
|
+
*/
|
|
12
|
+
function packageRefRegex(id) {
|
|
13
|
+
const escId = escapeRegExp(id);
|
|
14
|
+
// <PackageReference ... Include="id" ... Version="x" ... /> (Include before Version)
|
|
15
|
+
// or Version before Include. Two alternations cover both orders; either may end
|
|
16
|
+
// with a self-close `/>` or an explicit `></PackageReference>`.
|
|
17
|
+
return new RegExp(`<PackageReference\\b[^>]*?\\bInclude\\s*=\\s*"${escId}"[^>]*?\\bVersion\\s*=\\s*"([^"]*)"[^>]*?(?:/>|></PackageReference>)` +
|
|
18
|
+
`|` +
|
|
19
|
+
`<PackageReference\\b[^>]*?\\bVersion\\s*=\\s*"([^"]*)"[^>]*?\\bInclude\\s*=\\s*"${escId}"[^>]*?(?:/>|></PackageReference>)`, 'i');
|
|
20
|
+
}
|
|
21
|
+
/** Render the canonical self-closing element for a required reference. */
|
|
22
|
+
function renderRef(ref) {
|
|
23
|
+
return `<PackageReference Include="${ref.id}" Version="${ref.version}" />`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Detect the indentation used by the FIRST existing `<PackageReference>` (or fall
|
|
27
|
+
* back to 4 spaces) so appended/inserted elements match the consumer's style.
|
|
28
|
+
*/
|
|
29
|
+
function detectIndent(text) {
|
|
30
|
+
const m = text.match(/\n([ \t]*)<PackageReference\b/);
|
|
31
|
+
return m ? m[1] : ' ';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Detect the dominant line ending of the csproj so inserted/appended XML matches
|
|
35
|
+
* it (a CRLF csproj should not gain bare-LF lines). Returns `\r\n` when CRLF
|
|
36
|
+
* line endings outnumber bare-LF ones, else `\n`.
|
|
37
|
+
*/
|
|
38
|
+
function detectEol(text) {
|
|
39
|
+
const crlf = (text.match(/\r\n/g) ?? []).length;
|
|
40
|
+
const lf = (text.match(/\n/g) ?? []).length - crlf;
|
|
41
|
+
return crlf > lf ? '\r\n' : '\n';
|
|
42
|
+
}
|
|
43
|
+
export function addAddonPackageReferences(csprojText, requiredRefs = ADDON_PACKAGE_REFERENCES) {
|
|
44
|
+
const changes = [];
|
|
45
|
+
let text = csprojText;
|
|
46
|
+
const indent = detectIndent(text);
|
|
47
|
+
const eol = detectEol(text);
|
|
48
|
+
// First pass: reconcile any references that already exist (possibly at a
|
|
49
|
+
// different version). Collect the ones still missing for the append pass.
|
|
50
|
+
const missing = [];
|
|
51
|
+
for (const ref of requiredRefs) {
|
|
52
|
+
const re = packageRefRegex(ref.id);
|
|
53
|
+
const match = text.match(re);
|
|
54
|
+
if (!match) {
|
|
55
|
+
missing.push(ref);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const existingVersion = match[1] ?? match[2] ?? '';
|
|
59
|
+
if (existingVersion === ref.version) {
|
|
60
|
+
changes.push({ id: ref.id, action: 'unchanged', version: ref.version });
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
// Reconcile in place: replace the whole element with the canonical pin.
|
|
64
|
+
text = text.replace(re, renderRef(ref));
|
|
65
|
+
changes.push({ id: ref.id, action: 'updated', from: existingVersion, version: ref.version });
|
|
66
|
+
}
|
|
67
|
+
// Second pass: add the missing references. Prefer an existing <ItemGroup> that
|
|
68
|
+
// already holds a <PackageReference> (group them together); else append a fresh
|
|
69
|
+
// <ItemGroup> just before </Project>.
|
|
70
|
+
if (missing.length > 0) {
|
|
71
|
+
const block = missing.map((ref) => `${indent}${renderRef(ref)}`).join(eol);
|
|
72
|
+
const pkgItemGroupClose = findPackageReferenceItemGroupClose(text);
|
|
73
|
+
if (pkgItemGroupClose !== -1) {
|
|
74
|
+
// Insert the missing refs just before that ItemGroup's closing tag.
|
|
75
|
+
text = `${text.slice(0, pkgItemGroupClose)}${block}${eol}${text.slice(pkgItemGroupClose)}`;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// No PackageReference ItemGroup — append a new one before </Project>.
|
|
79
|
+
const groupIndent = indent.length >= 2 ? indent.slice(0, Math.floor(indent.length / 2)) : ' ';
|
|
80
|
+
const newGroup = `${groupIndent}<ItemGroup>${eol}${block}${eol}${groupIndent}</ItemGroup>${eol}`;
|
|
81
|
+
const closeIdx = text.lastIndexOf('</Project>');
|
|
82
|
+
if (closeIdx === -1) {
|
|
83
|
+
// Not a recognizable csproj; append best-effort at EOF.
|
|
84
|
+
text = `${text}${eol}${newGroup}`;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
text = `${text.slice(0, closeIdx)}${newGroup}${text.slice(closeIdx)}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
for (const ref of missing) {
|
|
91
|
+
changes.push({ id: ref.id, action: 'added', version: ref.version });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Restore the required-order in `changes` to match `requiredRefs` for stable output.
|
|
95
|
+
const orderedChanges = requiredRefs
|
|
96
|
+
.map((ref) => changes.find((c) => c.id === ref.id))
|
|
97
|
+
.filter((c) => c !== undefined);
|
|
98
|
+
return {
|
|
99
|
+
text,
|
|
100
|
+
changed: orderedChanges.some((c) => c.action !== 'unchanged'),
|
|
101
|
+
changes: orderedChanges,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Return the index of the `</ItemGroup>` that closes the FIRST `<ItemGroup>`
|
|
106
|
+
* containing a `<PackageReference>`, or -1 when none exists. Used to group the
|
|
107
|
+
* added pins with the consumer's existing package references.
|
|
108
|
+
*/
|
|
109
|
+
function findPackageReferenceItemGroupClose(text) {
|
|
110
|
+
const itemGroupRe = /<ItemGroup\b[^>]*>([\s\S]*?)<\/ItemGroup>/gi;
|
|
111
|
+
let m;
|
|
112
|
+
while ((m = itemGroupRe.exec(text)) !== null) {
|
|
113
|
+
if (/<PackageReference\b/i.test(m[1])) {
|
|
114
|
+
// The close tag starts at the end of the match minus its length.
|
|
115
|
+
const closeTag = '</ItemGroup>';
|
|
116
|
+
return m.index + m[0].length - closeTag.length;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return -1;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=csproj-deps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csproj-deps.js","sourceRoot":"","sources":["../../src/utils/csproj-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA8B,MAAM,iBAAiB,CAAC;AAiCvF,sDAAsD;AACtD,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,EAAU;IACjC,MAAM,KAAK,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;IAC/B,qFAAqF;IACrF,gFAAgF;IAChF,gEAAgE;IAChE,OAAO,IAAI,MAAM,CACf,iDAAiD,KAAK,sEAAsE;QAC1H,GAAG;QACH,mFAAmF,KAAK,oCAAoC,EAC9H,GAAG,CACJ,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,SAAS,SAAS,CAAC,GAA0B;IAC3C,OAAO,8BAA8B,GAAG,CAAC,EAAE,cAAc,GAAG,CAAC,OAAO,MAAM,CAAC;AAC7E,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACtD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC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CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,iEAAiE;YACjE,MAAM,QAAQ,GAAG,cAAc,CAAC;YAChC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal, dependency-free ZIP reader for the addon-install path. Parses the ZIP
|
|
3
|
+
* central directory and inflates each entry (STORED `0` + DEFLATE `8` — the only
|
|
4
|
+
* two compression methods the GitHub release `zip -r` produces). Pure: takes the
|
|
5
|
+
* archive bytes, returns `{ path, bytes }` entries; performs NO filesystem writes
|
|
6
|
+
* (the caller decides where the files land, after path-safety checks).
|
|
7
|
+
*
|
|
8
|
+
* This avoids adding a native/3rd-party unzip dependency to the lean `godot-cli`
|
|
9
|
+
* package while staying cross-platform (no shelling out to a system `unzip`).
|
|
10
|
+
* Exported for unit tests.
|
|
11
|
+
*/
|
|
12
|
+
export interface ZipEntry {
|
|
13
|
+
/** The entry's path inside the archive, using forward slashes. */
|
|
14
|
+
path: string;
|
|
15
|
+
/** Decompressed bytes. Empty for directory entries. */
|
|
16
|
+
bytes: Buffer;
|
|
17
|
+
/** True when the entry is a directory (path ends with `/`). */
|
|
18
|
+
isDirectory: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse a ZIP archive buffer into its entries. Throws a descriptive Error on a
|
|
22
|
+
* malformed archive (the caller wraps this into a structured failure — it never
|
|
23
|
+
* propagates past the library's public boundary).
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseZip(buffer: Buffer): ZipEntry[];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as zlib from 'zlib';
|
|
2
|
+
// ZIP signatures.
|
|
3
|
+
const EOCD_SIGNATURE = 0x06054b50; // End Of Central Directory
|
|
4
|
+
const CDH_SIGNATURE = 0x02014b50; // Central Directory Header
|
|
5
|
+
const LFH_SIGNATURE = 0x04034b50; // Local File Header
|
|
6
|
+
/**
|
|
7
|
+
* Parse a ZIP archive buffer into its entries. Throws a descriptive Error on a
|
|
8
|
+
* malformed archive (the caller wraps this into a structured failure — it never
|
|
9
|
+
* propagates past the library's public boundary).
|
|
10
|
+
*/
|
|
11
|
+
export function parseZip(buffer) {
|
|
12
|
+
const eocdOffset = findEndOfCentralDirectory(buffer);
|
|
13
|
+
if (eocdOffset === -1) {
|
|
14
|
+
throw new Error('Invalid zip: End Of Central Directory record not found.');
|
|
15
|
+
}
|
|
16
|
+
const entryCount = buffer.readUInt16LE(eocdOffset + 10);
|
|
17
|
+
const centralDirOffset = buffer.readUInt32LE(eocdOffset + 16);
|
|
18
|
+
const entries = [];
|
|
19
|
+
let ptr = centralDirOffset;
|
|
20
|
+
for (let i = 0; i < entryCount; i++) {
|
|
21
|
+
if (buffer.readUInt32LE(ptr) !== CDH_SIGNATURE) {
|
|
22
|
+
throw new Error(`Invalid zip: bad central directory header at entry ${i}.`);
|
|
23
|
+
}
|
|
24
|
+
const compressionMethod = buffer.readUInt16LE(ptr + 10);
|
|
25
|
+
const compressedSize = buffer.readUInt32LE(ptr + 20);
|
|
26
|
+
const fileNameLength = buffer.readUInt16LE(ptr + 28);
|
|
27
|
+
const extraFieldLength = buffer.readUInt16LE(ptr + 30);
|
|
28
|
+
const commentLength = buffer.readUInt16LE(ptr + 32);
|
|
29
|
+
const localHeaderOffset = buffer.readUInt32LE(ptr + 42);
|
|
30
|
+
const fileName = buffer.toString('utf8', ptr + 46, ptr + 46 + fileNameLength);
|
|
31
|
+
const bytes = readLocalEntry(buffer, localHeaderOffset, compressionMethod, compressedSize);
|
|
32
|
+
entries.push({
|
|
33
|
+
path: fileName.replace(/\\/g, '/'),
|
|
34
|
+
bytes,
|
|
35
|
+
isDirectory: fileName.endsWith('/'),
|
|
36
|
+
});
|
|
37
|
+
ptr += 46 + fileNameLength + extraFieldLength + commentLength;
|
|
38
|
+
}
|
|
39
|
+
return entries;
|
|
40
|
+
}
|
|
41
|
+
/** Read + decompress a single entry given its central-directory metadata. */
|
|
42
|
+
function readLocalEntry(buffer, localHeaderOffset, compressionMethod, compressedSize) {
|
|
43
|
+
if (buffer.readUInt32LE(localHeaderOffset) !== LFH_SIGNATURE) {
|
|
44
|
+
throw new Error('Invalid zip: bad local file header.');
|
|
45
|
+
}
|
|
46
|
+
// The local header repeats the name/extra lengths; the data starts after them.
|
|
47
|
+
const lfhNameLength = buffer.readUInt16LE(localHeaderOffset + 26);
|
|
48
|
+
const lfhExtraLength = buffer.readUInt16LE(localHeaderOffset + 28);
|
|
49
|
+
const dataStart = localHeaderOffset + 30 + lfhNameLength + lfhExtraLength;
|
|
50
|
+
const compressed = buffer.subarray(dataStart, dataStart + compressedSize);
|
|
51
|
+
if (compressionMethod === 0) {
|
|
52
|
+
// STORED — no compression.
|
|
53
|
+
return Buffer.from(compressed);
|
|
54
|
+
}
|
|
55
|
+
if (compressionMethod === 8) {
|
|
56
|
+
// DEFLATE (raw, no zlib header).
|
|
57
|
+
return zlib.inflateRawSync(compressed);
|
|
58
|
+
}
|
|
59
|
+
throw new Error(`Unsupported zip compression method ${compressionMethod}.`);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Locate the End Of Central Directory record by scanning backwards from EOF for
|
|
63
|
+
* its signature (the trailing comment is almost always empty, so it is usually
|
|
64
|
+
* the last 22 bytes — but we scan to be safe).
|
|
65
|
+
*/
|
|
66
|
+
function findEndOfCentralDirectory(buffer) {
|
|
67
|
+
const minEocdSize = 22;
|
|
68
|
+
if (buffer.length < minEocdSize)
|
|
69
|
+
return -1;
|
|
70
|
+
// Max comment length is 0xFFFF; scan that far back at most.
|
|
71
|
+
const scanStart = Math.max(0, buffer.length - minEocdSize - 0xffff);
|
|
72
|
+
for (let i = buffer.length - minEocdSize; i >= scanStart; i--) {
|
|
73
|
+
if (buffer.readUInt32LE(i) === EOCD_SIGNATURE) {
|
|
74
|
+
return i;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return -1;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=unzip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unzip.js","sourceRoot":"","sources":["../../src/utils/unzip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAuB7B,kBAAkB;AAClB,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,2BAA2B;AAC9D,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,2BAA2B;AAC7D,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,oBAAoB;AAEtD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,MAAM,UAAU,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAe,EAAE,CAAC;IAC/B,IAAI,GAAG,GAAG,gBAAgB,CAAC;IAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,aAAa,EAAE,CAAC;YAC/C,MAAM,IAAI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C;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "godot-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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",
|