capybara-mcp-shared 0.1.0 → 0.1.2

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.
@@ -0,0 +1,10 @@
1
+ /** Production MCP API (Railway). */
2
+ export declare const CAPYBARA_MCP_API_URL = "https://caoybaramcp-production.up.railway.app/v1";
3
+ /** Capybara web app — API key session exchange. */
4
+ export declare const CAPYBARA_WEB_URL = "https://www.capybara.build";
5
+ /** Agent server — asset generation backend. */
6
+ export declare const AGENT_SERVER_URL = "https://agent-server-production-7b6f.up.railway.app";
7
+ /** MCP tool names — what coding agents call. */
8
+ export declare const TOOL_GENERATE_ASSETS = "generate_assets";
9
+ export declare const TOOL_GET_JOB_STATUS = "get_job_status";
10
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,eAAO,MAAM,oBAAoB,qDACmB,CAAC;AAGrD,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAG7D,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,wDAC0B,CAAC;AAGxD,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AACtD,eAAO,MAAM,mBAAmB,mBAAmB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** Production MCP API (Railway). */
2
+ export const CAPYBARA_MCP_API_URL = "https://caoybaramcp-production.up.railway.app/v1";
3
+ // "http://localhost:8080/v1";
4
+ /** Capybara web app — API key session exchange. */
5
+ export const CAPYBARA_WEB_URL = "https://www.capybara.build";
6
+ // "http://localhost:3000";
7
+ /** Agent server — asset generation backend. */
8
+ export const AGENT_SERVER_URL = "https://agent-server-production-7b6f.up.railway.app";
9
+ // "http://localhost:3001";
10
+ /** MCP tool names — what coding agents call. */
11
+ export const TOOL_GENERATE_ASSETS = "generate_assets";
12
+ export const TOOL_GET_JOB_STATUS = "get_job_status";
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAC/B,kDAAkD,CAAC;AACrD,8BAA8B;AAE9B,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AAC7D,2BAA2B;AAE3B,+CAA+C;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAC3B,qDAAqD,CAAC;AACxD,2BAA2B;AAE3B,gDAAgD;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
+ export * from "./constants.js";
1
2
  export * from "./types/api.js";
2
3
  export * from "./schemas/asset-tool-schema.js";
4
+ export * from "./lib/game-id.js";
3
5
  export * from "./streaming/api-client.js";
4
6
  export * from "./streaming/sse.js";
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
+ export * from "./constants.js";
1
2
  export * from "./types/api.js";
2
3
  export * from "./schemas/asset-tool-schema.js";
4
+ export * from "./lib/game-id.js";
3
5
  export * from "./streaming/api-client.js";
4
6
  export * from "./streaming/sse.js";
5
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare function parseGameIdFromIndexHtml(html: string): string | undefined;
2
+ /** Insert or replace `window.gameId` in index.html markup. */
3
+ export declare function setGameIdInIndexHtml(html: string, gameId: string): string;
4
+ export declare function resolveGameIdFromRequest(input: {
5
+ gameId?: string;
6
+ workspace_files?: Record<string, string>;
7
+ }): string | undefined;
8
+ //# sourceMappingURL=game-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"game-id.d.ts","sourceRoot":"","sources":["../../src/lib/game-id.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzE;AAMD,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUzE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C,GAAG,MAAM,GAAG,SAAS,CAWrB"}
@@ -0,0 +1,30 @@
1
+ const GAME_ID_PATTERN = /window\.gameId\s*=\s*["']([^"']+)["']/;
2
+ export function parseGameIdFromIndexHtml(html) {
3
+ const match = html.match(GAME_ID_PATTERN);
4
+ const gameId = match?.[1]?.trim();
5
+ return gameId || undefined;
6
+ }
7
+ function gameIdScriptTag(gameId) {
8
+ return ` <script>\n window.gameId = "${gameId}";\n </script>`;
9
+ }
10
+ /** Insert or replace `window.gameId` in index.html markup. */
11
+ export function setGameIdInIndexHtml(html, gameId) {
12
+ if (GAME_ID_PATTERN.test(html)) {
13
+ return html.replace(GAME_ID_PATTERN, `window.gameId = "${gameId}"`);
14
+ }
15
+ if (html.includes("</head>")) {
16
+ return html.replace("</head>", `${gameIdScriptTag(gameId)}\n </head>`);
17
+ }
18
+ return `${gameIdScriptTag(gameId)}\n${html}`;
19
+ }
20
+ export function resolveGameIdFromRequest(input) {
21
+ if (input.gameId?.trim()) {
22
+ return input.gameId.trim();
23
+ }
24
+ const indexHtml = input.workspace_files?.["index.html"];
25
+ if (indexHtml) {
26
+ return parseGameIdFromIndexHtml(indexHtml);
27
+ }
28
+ return undefined;
29
+ }
30
+ //# sourceMappingURL=game-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"game-id.js","sourceRoot":"","sources":["../../src/lib/game-id.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAEhE,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAClC,OAAO,MAAM,IAAI,SAAS,CAAC;AAC7B,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACrC,OAAO,wCAAwC,MAAM,mBAAmB,CAAC;AAC3E,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU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