gamealia-mcp 0.1.51 → 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
 
@@ -38933,37 +38972,6 @@ function elements(text) {
38933
38972
  return out;
38934
38973
  }
38935
38974
  var JS_TYPES = /* @__PURE__ */ new Set(["", "text/javascript", "application/javascript", "module", "text/ecmascript", "application/ecmascript"]);
38936
- 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-]+)$/;
38937
- var DATA_URI_PAYLOAD = /(data:[a-z]+\/[a-z0-9.+-]+(?:;[a-z0-9=.-]+)*;base64,)([A-Za-z0-9+/=\s]{256,})/gi;
38938
- function blankInlineData(html) {
38939
- let blanked = 0;
38940
- const spaces = (s) => {
38941
- blanked += s.length;
38942
- return s.replace(/[^\n]/g, " ");
38943
- };
38944
- const lower = html.toLowerCase();
38945
- let out = "";
38946
- let from = 0;
38947
- for (let at2 = lower.indexOf("<script", 0); at2 >= 0; ) {
38948
- const gt = html.indexOf(">", at2 + 7);
38949
- if (gt < 0) break;
38950
- const attrText = html.slice(at2 + 7, Math.min(gt, at2 + 7 + 2e3));
38951
- const type = (/\btype\s*=\s*["']?([^"'\s>]+)/i.exec(attrText)?.[1] ?? "").toLowerCase();
38952
- const start = gt + 1;
38953
- if (!DATA_SCRIPT_TYPE.test(type)) {
38954
- at2 = lower.indexOf("<script", start);
38955
- continue;
38956
- }
38957
- const close = lower.indexOf("</script", start);
38958
- const end = close < 0 ? html.length : close;
38959
- out += html.slice(from, start) + spaces(html.slice(start, end));
38960
- from = end;
38961
- at2 = close < 0 ? -1 : lower.indexOf("<script", end + 8);
38962
- }
38963
- out += html.slice(from);
38964
- out = out.replace(DATA_URI_PAYLOAD, (_m, head, payload) => head + spaces(payload));
38965
- return { text: out, kept: html.length - blanked };
38966
- }
38967
38975
  var NO_LOAD_RELS = /* @__PURE__ */ new Set(["canonical", "alternate", "author", "license", "help", "dns-prefetch", "preconnect", "prefetch", "search", "me", "next", "prev", "bookmark", "external", "nofollow", "noopener", "noreferrer"]);
38968
38976
  var SKIP_REF = /^(#|%23|data:|blob:|javascript:|about:|mailto:|tel:)|\{\{|<%|\$\{/i;
38969
38977
  function checkRef(ctx, ref, pos, kind, hits, out) {
@@ -39046,11 +39054,11 @@ function scriptRefs(html, path) {
39046
39054
  }
39047
39055
  return out;
39048
39056
  }
39049
- function htmlRules(html, ctx) {
39050
- const data = html.length > MAX_MARKUP_BYTES ? blankInlineData(html) : { text: html, kept: html.length };
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 };
39051
39059
  const truncated = data.kept > MAX_MARKUP_BYTES;
39052
39060
  const out = { hits: [], sdkScript: false, scripts: [], inline: [], truncated };
39053
- const text = blankBlocks(truncated ? data.text.slice(0, MAX_MARKUP_BYTES) : data.text, "<!--", "-->");
39061
+ const text = blankBlocks(truncated ? data.text.slice(0, MAX_MARKUP_BYTES + (data.text.length - data.kept)) : data.text, "<!--", "-->");
39054
39062
  for (const el of elements(text)) {
39055
39063
  const a = el.attrs;
39056
39064
  if (el.tag === "script") {
@@ -39109,6 +39117,14 @@ function contextAt(text, line, pos) {
39109
39117
  const p = pos ?? 0;
39110
39118
  return text.slice(Math.max(0, p - 2e3), p + 2e3);
39111
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
+ }
39112
39128
  function analyzeBuild(input2) {
39113
39129
  const paths = input2.paths ? new PathIndex(input2.paths) : null;
39114
39130
  const scriptHosts = (input2.sdkHosts ?? DEFAULT_SDK_HOSTS).map((h) => h.toLowerCase());
@@ -39136,7 +39152,7 @@ function analyzeBuild(input2) {
39136
39152
  for (const f of input2.files) {
39137
39153
  if (!isHtml(f.path)) continue;
39138
39154
  analyzed++;
39139
- const r = htmlRules(f.text, ctxFor(logicalPath(f.path)));
39155
+ const r = htmlRules(f.text, ctxFor(logicalPath(f.path)), f.kept);
39140
39156
  if (r.truncated && !f.truncated) truncated++, truncatedPaths.push(f.path);
39141
39157
  sdkScript ||= r.sdkScript;
39142
39158
  for (const s of r.scripts) scripts.add(s);
@@ -39147,14 +39163,15 @@ function analyzeBuild(input2) {
39147
39163
  if (isHtml(f.path)) continue;
39148
39164
  const ctx = ctxFor(logicalPath(f.path));
39149
39165
  const starts = lineStarts(f.text);
39150
- if (isJs(f.path) || scripts.has(f.path) || scripts.has(logicalPath(f.path))) {
39151
- analyzed++;
39152
- add(f.path, f.text, starts, jsRules(f.text, 0, ctx));
39153
- } else if (isCss(f.path)) {
39154
- analyzed++;
39155
- if (f.text.length > MAX_MARKUP_BYTES && !f.truncated) truncated++, truncatedPaths.push(f.path);
39156
- add(f.path, f.text, starts, cssRules(f.text, 0, ctx));
39157
- }
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));
39158
39175
  }
39159
39176
  let engine = null;
39160
39177
  if (paths) {
@@ -39282,7 +39299,7 @@ function withTimeout(p, ms, what) {
39282
39299
 
39283
39300
  // ../autotest/src/sources.ts
39284
39301
  var MAX_SCAN_FILES = 200;
39285
- var MAX_SCAN_BYTES = 5 * 1024 * 1024;
39302
+ var MAX_SCAN_BYTES = 12 * 1024 * 1024;
39286
39303
  var SOURCE_READ_MS = 1e4;
39287
39304
  var isCompressed = (p) => /\.(gz|br|unityweb)$/i.test(p);
39288
39305
  var READ_CONCURRENCY = 4;
@@ -39384,11 +39401,13 @@ async function readSources(r, o) {
39384
39401
  if (!raw) return null;
39385
39402
  const d = await decompress(raw);
39386
39403
  if (!d) return "skip";
39387
- 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 };
39388
39406
  }
39389
39407
  const t = await withTimeout(r.sourceFiles(p), SOURCE_READ_MS, `read ${p}`);
39390
39408
  if (t == null) return null;
39391
- 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 };
39392
39411
  } catch {
39393
39412
  return "skip";
39394
39413
  }
@@ -57827,7 +57846,7 @@ ${frameText2(r, m31)}`,
57827
57846
  }
57828
57847
 
57829
57848
  // src/server.ts
57830
- var VERSION2 = true ? "0.1.51" : "0.0.0-dev";
57849
+ var VERSION2 = true ? "0.1.52" : "0.0.0-dev";
57831
57850
  var INSTRUCTIONS = `Gamealia is a web games portal. These tools publish a game end to end:
57832
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.
57833
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.51",
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",