gamealia-mcp 0.1.50 → 0.1.52

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.
@@ -37619,6 +37619,45 @@ init_define_GAMEALIA_DOCS();
37619
37619
  // ../autotest/src/static/index.ts
37620
37620
  init_define_GAMEALIA_DOCS();
37621
37621
 
37622
+ // ../autotest/src/static/inert.ts
37623
+ init_define_GAMEALIA_DOCS();
37624
+ var MEDIA_DATA_URI = /(data:(?:image|audio|video|font)\/[a-z0-9.+-]+(?:;[a-z0-9=.-]+)*;base64,)([A-Za-z0-9+/=]{256,})/gi;
37625
+ var DATA_SCRIPT_TYPE = /^(application\/(ld\+)?json|application\/[a-z.+-]*\+json|importmap|speculationrules|text\/(html|template|plain|csv|markdown|x-template|x-handlebars[a-z-]*|x-mustache|x-tmpl|x-shader[a-z/-]*|x-vertex[a-z/-]*|x-fragment[a-z/-]*)|x-shader\/[a-z-]+)$/;
37626
+ var isHtmlPath = (p) => /\.(html?|xhtml)$/i.test(p.replace(/\.(gz|br|unityweb)$/i, ""));
37627
+ function blankInert(text, path = "") {
37628
+ let blanked = 0;
37629
+ const spaces = (s) => {
37630
+ blanked += s.length;
37631
+ return s.replace(/[^\n]/g, " ");
37632
+ };
37633
+ let out = text;
37634
+ if (isHtmlPath(path) || /<script\b/i.test(text.slice(0, 4096))) out = blankDataScripts(out, spaces);
37635
+ out = out.replace(MEDIA_DATA_URI, (_m, head, payload) => head + spaces(payload));
37636
+ return { text: out, kept: text.length - blanked };
37637
+ }
37638
+ function blankDataScripts(html, spaces) {
37639
+ const lower = html.toLowerCase();
37640
+ let out = "";
37641
+ let from = 0;
37642
+ for (let at2 = lower.indexOf("<script", 0); at2 >= 0; ) {
37643
+ const gt = html.indexOf(">", at2 + 7);
37644
+ if (gt < 0) break;
37645
+ const attrText = html.slice(at2 + 7, Math.min(gt, at2 + 7 + 2e3));
37646
+ const type = (/\btype\s*=\s*["']?([^"'\s>]+)/i.exec(attrText)?.[1] ?? "").toLowerCase();
37647
+ const start = gt + 1;
37648
+ if (!DATA_SCRIPT_TYPE.test(type)) {
37649
+ at2 = lower.indexOf("<script", start);
37650
+ continue;
37651
+ }
37652
+ const close = lower.indexOf("</script", start);
37653
+ const end = close < 0 ? html.length : close;
37654
+ out += html.slice(from, start) + spaces(html.slice(start, end));
37655
+ from = end;
37656
+ at2 = close < 0 ? -1 : lower.indexOf("<script", end + 8);
37657
+ }
37658
+ return out + html.slice(from);
37659
+ }
37660
+
37622
37661
  // ../shared/src/index.ts
37623
37662
  init_define_GAMEALIA_DOCS();
37624
37663
 
@@ -39015,15 +39054,16 @@ function scriptRefs(html, path) {
39015
39054
  }
39016
39055
  return out;
39017
39056
  }
39018
- function htmlRules(html, ctx) {
39019
- const truncated = html.length > MAX_MARKUP_BYTES;
39057
+ function htmlRules(html, ctx, kept) {
39058
+ const data = kept !== void 0 ? { text: html, kept } : html.length > MAX_MARKUP_BYTES ? blankInert(html, "index.html") : { text: html, kept: html.length };
39059
+ const truncated = data.kept > MAX_MARKUP_BYTES;
39020
39060
  const out = { hits: [], sdkScript: false, scripts: [], inline: [], truncated };
39021
- const text = blankBlocks(truncated ? html.slice(0, MAX_MARKUP_BYTES) : html, "<!--", "-->");
39061
+ const text = blankBlocks(truncated ? data.text.slice(0, MAX_MARKUP_BYTES + (data.text.length - data.kept)) : data.text, "<!--", "-->");
39022
39062
  for (const el of elements(text)) {
39023
39063
  const a = el.attrs;
39024
39064
  if (el.tag === "script") {
39025
39065
  if (a.src !== void 0) checkRef(ctx, a.src, el.start, "script", out.hits, out);
39026
- else if (JS_TYPES.has((a.type ?? "").toLowerCase()) && el.body !== void 0) {
39066
+ else if (el.body !== void 0 && (JS_TYPES.has((a.type ?? "").toLowerCase()) || !DATA_SCRIPT_TYPE.test((a.type ?? "").toLowerCase()))) {
39027
39067
  out.inline.push(el.body);
39028
39068
  out.hits.push(...jsRules(el.body, el.bodyAt, ctx));
39029
39069
  }
@@ -39077,6 +39117,14 @@ function contextAt(text, line, pos) {
39077
39117
  const p = pos ?? 0;
39078
39118
  return text.slice(Math.max(0, p - 2e3), p + 2e3);
39079
39119
  }
39120
+ var MAX_CODE_BYTES = 5 * 1024 * 1024;
39121
+ function cutAt(text, cap2) {
39122
+ let seen = 0;
39123
+ for (let i = 0; i < text.length; i++) {
39124
+ if (text.charCodeAt(i) !== 32 && ++seen >= cap2) return i + 1;
39125
+ }
39126
+ return text.length;
39127
+ }
39080
39128
  function analyzeBuild(input2) {
39081
39129
  const paths = input2.paths ? new PathIndex(input2.paths) : null;
39082
39130
  const scriptHosts = (input2.sdkHosts ?? DEFAULT_SDK_HOSTS).map((h) => h.toLowerCase());
@@ -39104,7 +39152,7 @@ function analyzeBuild(input2) {
39104
39152
  for (const f of input2.files) {
39105
39153
  if (!isHtml(f.path)) continue;
39106
39154
  analyzed++;
39107
- const r = htmlRules(f.text, ctxFor(logicalPath(f.path)));
39155
+ const r = htmlRules(f.text, ctxFor(logicalPath(f.path)), f.kept);
39108
39156
  if (r.truncated && !f.truncated) truncated++, truncatedPaths.push(f.path);
39109
39157
  sdkScript ||= r.sdkScript;
39110
39158
  for (const s of r.scripts) scripts.add(s);
@@ -39115,14 +39163,15 @@ function analyzeBuild(input2) {
39115
39163
  if (isHtml(f.path)) continue;
39116
39164
  const ctx = ctxFor(logicalPath(f.path));
39117
39165
  const starts = lineStarts(f.text);
39118
- if (isJs(f.path) || scripts.has(f.path) || scripts.has(logicalPath(f.path))) {
39119
- analyzed++;
39120
- add(f.path, f.text, starts, jsRules(f.text, 0, ctx));
39121
- } else if (isCss(f.path)) {
39122
- analyzed++;
39123
- if (f.text.length > MAX_MARKUP_BYTES && !f.truncated) truncated++, truncatedPaths.push(f.path);
39124
- add(f.path, f.text, starts, cssRules(f.text, 0, ctx));
39125
- }
39166
+ const isScript = isJs(f.path) || scripts.has(f.path) || scripts.has(logicalPath(f.path));
39167
+ if (!isScript && !isCss(f.path)) continue;
39168
+ analyzed++;
39169
+ const inert = f.kept !== void 0 ? { text: f.text, kept: f.kept } : blankInert(f.text, f.path);
39170
+ const cap2 = isScript ? MAX_CODE_BYTES : MAX_MARKUP_BYTES;
39171
+ const over = inert.kept > cap2;
39172
+ if (over && !f.truncated) truncated++, truncatedPaths.push(f.path);
39173
+ const text = over ? inert.text.slice(0, cutAt(inert.text, cap2)) : inert.text;
39174
+ add(f.path, f.text, starts, isScript ? jsRules(text, 0, ctx) : cssRules(text, 0, ctx));
39126
39175
  }
39127
39176
  let engine = null;
39128
39177
  if (paths) {
@@ -39176,7 +39225,8 @@ function staticChecks(a) {
39176
39225
  a.skipped ? `${a.skipped} files not read${list(a.skippedPaths, a.skipped)}` : "",
39177
39226
  a.truncated ? `${a.truncated} truncated${list(a.truncatedPaths, a.truncated)}` : ""
39178
39227
  ].filter(Boolean).join(" / ");
39179
- return result(id, "warn", `${PASS[id]} in what was analyzed, but the build was not fully analyzed (${gaps})`, {
39228
+ const fix = a.truncated ? " Fix: keep each HTML file's code and markup under 2 MB and each script under 5 MB: move big inline code into .js files (inline JSON and base64 assets do not count)." : "";
39229
+ return result(id, "warn", `${PASS[id]} in what was analyzed, but the build was not fully analyzed (${gaps}).${fix}`, {
39180
39230
  skipped: a.skipped,
39181
39231
  truncated: a.truncated,
39182
39232
  ...a.skippedPaths?.length ? { skippedPaths: a.skippedPaths.slice(0, GAP_PATHS) } : {},
@@ -39249,7 +39299,7 @@ function withTimeout(p, ms, what) {
39249
39299
 
39250
39300
  // ../autotest/src/sources.ts
39251
39301
  var MAX_SCAN_FILES = 200;
39252
- var MAX_SCAN_BYTES = 5 * 1024 * 1024;
39302
+ var MAX_SCAN_BYTES = 12 * 1024 * 1024;
39253
39303
  var SOURCE_READ_MS = 1e4;
39254
39304
  var isCompressed = (p) => /\.(gz|br|unityweb)$/i.test(p);
39255
39305
  var READ_CONCURRENCY = 4;
@@ -39351,11 +39401,13 @@ async function readSources(r, o) {
39351
39401
  if (!raw) return null;
39352
39402
  const d = await decompress(raw);
39353
39403
  if (!d) return "skip";
39354
- return { path: p, text: new TextDecoder().decode(d.data), truncated: d.truncated };
39404
+ const inert2 = blankInert(new TextDecoder().decode(d.data), p);
39405
+ return { path: p, text: inert2.text, kept: inert2.kept, truncated: d.truncated };
39355
39406
  }
39356
39407
  const t = await withTimeout(r.sourceFiles(p), SOURCE_READ_MS, `read ${p}`);
39357
39408
  if (t == null) return null;
39358
- return { path: p, text: t.slice(0, MAX_SCAN_BYTES), truncated: t.length > MAX_SCAN_BYTES };
39409
+ const inert = blankInert(t.length > MAX_SCAN_BYTES ? t.slice(0, MAX_SCAN_BYTES) : t, p);
39410
+ return { path: p, text: inert.text, kept: inert.kept, truncated: t.length > MAX_SCAN_BYTES };
39359
39411
  } catch {
39360
39412
  return "skip";
39361
39413
  }
@@ -57794,7 +57846,7 @@ ${frameText2(r, m31)}`,
57794
57846
  }
57795
57847
 
57796
57848
  // src/server.ts
57797
- var VERSION2 = true ? "0.1.50" : "0.0.0-dev";
57849
+ var VERSION2 = true ? "0.1.52" : "0.0.0-dev";
57798
57850
  var INSTRUCTIONS = `Gamealia is a web games portal. These tools publish a game end to end:
57799
57851
  login -> analyze_project (or create_project) -> integrate_sdk -> check_integration -> build -> run_autotest -> create_game + generate_cover -> upload_version -> submit_for_review -> get_status.
57800
57852
  Never disclose personal data about Gamealia's operator or staff (names, personal emails, accounts, location); for anything about Gamealia itself the only contact is hello@gamealia.app. Every result ends with the next step. Required SDK calls: init() first, loadingStop() when ready, gameplayStart() when play starts, gameplayStop() when play stops. Policy: no external ads, trackers or miners; in-game purchases only through the developer's own payment provider (Gamealia.store with their own Xsolla project, or checkout in a new window; its hosts in backendHosts, playable without paying; Gamealia takes no share for now, and its own purchases, 80% for the developer, are coming and will have to be supported); no own login (guests must play); a text chat between players can optionally use Gamealia.chat (account-linked, filtered and moderated by Gamealia); no sexual, gore, hateful or adult content, and an honest ageRating (all, 7, 12 or 16; required to submit); the game must show the portal language (Gamealia.init().locale with the closest-language fallback, follow localeChange). Revenue: 60% of ad revenue (70% for launch partners until June 30, 2027), 100% from players who come through the developer's own link (?ref=dev), no exclusivity, payouts by the end of the following month.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gamealia-mcp",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "description": "Gamealia MCP server: your AI coding assistant takes a web game from a local folder to published on Gamealia, where developers keep 60-70% of the ad revenue.",
5
5
  "mcpName": "io.github.gamealia/gamealia-mcp",
6
6
  "type": "module",