yap2app 1.2.1 → 1.2.3

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/bin/cli.bundle.js CHANGED
@@ -1,3 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module';
3
+ const require = createRequire(import.meta.url);
1
4
  var __create = Object.create;
2
5
  var __defProp = Object.defineProperty;
3
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7027,6 +7030,7 @@ import http from "http";
7027
7030
  import fsSync2 from "fs";
7028
7031
  import path2 from "path";
7029
7032
  import util2 from "util";
7033
+ import { execSync } from "child_process";
7030
7034
 
7031
7035
  // scanner.js
7032
7036
  import fsSync from "fs";
@@ -7578,7 +7582,23 @@ var fs2 = fsSync2.promises || {
7578
7582
  var PORT = Number(process.env.YAP2APP_PORT) || 10420;
7579
7583
  var PROJECT_ROOT = process.cwd();
7580
7584
  var PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || "Y2A-" + Math.floor(1e3 + Math.random() * 9e3)).toUpperCase();
7581
- var CLI_VERSION = "1.2.0";
7585
+ var CLI_VERSION = "1.2.3";
7586
+ function getGitUserEmail() {
7587
+ try {
7588
+ const email2 = execSync("git config user.email", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
7589
+ return email2 || null;
7590
+ } catch (e) {
7591
+ return null;
7592
+ }
7593
+ }
7594
+ function resolveUserEmail() {
7595
+ const emailArgIdx = process.argv.indexOf("--email");
7596
+ if (emailArgIdx !== -1 && process.argv[emailArgIdx + 1]) {
7597
+ return process.argv[emailArgIdx + 1].trim();
7598
+ }
7599
+ return (process.env.YAP2APP_EMAIL || getGitUserEmail() || "").trim();
7600
+ }
7601
+ var USER_EMAIL = resolveUserEmail();
7582
7602
  function safeResolvePath(baseDir, relativePath) {
7583
7603
  const cleanRel = (relativePath || "").replace(/^[\\\/]+/, "");
7584
7604
  const resolved = path2.resolve(baseDir, cleanRel);
@@ -7759,6 +7779,7 @@ async function sendCloudHeartbeat() {
7759
7779
  const context = await scanCodebase(PROJECT_ROOT);
7760
7780
  const payload = {
7761
7781
  pair_code: PAIR_CODE,
7782
+ user_email: USER_EMAIL || void 0,
7762
7783
  project_name: path2.basename(PROJECT_ROOT),
7763
7784
  project_root: PROJECT_ROOT,
7764
7785
  framework: context.framework || "plain_html_css_js",
@@ -7815,8 +7836,10 @@ server.on("error", (err) => {
7815
7836
  ---------------------------------------------------------------`);
7816
7837
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7817
7838
  console.log(`Pair Code: ${PAIR_CODE}`);
7839
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7818
7840
  console.log(`Local Endpoint: http://127.0.0.1:${PORT}`);
7819
7841
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7842
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7820
7843
  console.log(`Status: Already active & ready on port ${PORT}`);
7821
7844
  console.log(`---------------------------------------------------------------
7822
7845
  `);
@@ -7836,13 +7859,14 @@ async function startBridge(port = PORT) {
7836
7859
  ---------------------------------------------------------------`);
7837
7860
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7838
7861
  console.log(`Pair Code: ${PAIR_CODE}`);
7862
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7839
7863
  console.log(`Local Endpoint: http://127.0.0.1:${port}`);
7840
7864
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7841
- console.log(`Web Studio: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com`);
7865
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7842
7866
  console.log(`---------------------------------------------------------------
7843
7867
  `);
7844
7868
  console.log(`Bridge is running & synced.`);
7845
- console.log(`Open Web Studio in your browser to automatically connect and sync.`);
7869
+ console.log(`Open Web Studio in your browser or click the link above to connect.`);
7846
7870
  console.log(`Press Ctrl/Cmd+C to stop.
7847
7871
  `);
7848
7872
  });
package/bin/cli.js CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from 'module';
3
+ const require = createRequire(import.meta.url);
2
4
  var __create = Object.create;
3
5
  var __defProp = Object.defineProperty;
4
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7028,6 +7030,7 @@ import http from "http";
7028
7030
  import fsSync2 from "fs";
7029
7031
  import path2 from "path";
7030
7032
  import util2 from "util";
7033
+ import { execSync } from "child_process";
7031
7034
 
7032
7035
  // scanner.js
7033
7036
  import fsSync from "fs";
@@ -7579,7 +7582,23 @@ var fs2 = fsSync2.promises || {
7579
7582
  var PORT = Number(process.env.YAP2APP_PORT) || 10420;
7580
7583
  var PROJECT_ROOT = process.cwd();
7581
7584
  var PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || "Y2A-" + Math.floor(1e3 + Math.random() * 9e3)).toUpperCase();
7582
- var CLI_VERSION = "1.2.0";
7585
+ var CLI_VERSION = "1.2.3";
7586
+ function getGitUserEmail() {
7587
+ try {
7588
+ const email2 = execSync("git config user.email", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
7589
+ return email2 || null;
7590
+ } catch (e) {
7591
+ return null;
7592
+ }
7593
+ }
7594
+ function resolveUserEmail() {
7595
+ const emailArgIdx = process.argv.indexOf("--email");
7596
+ if (emailArgIdx !== -1 && process.argv[emailArgIdx + 1]) {
7597
+ return process.argv[emailArgIdx + 1].trim();
7598
+ }
7599
+ return (process.env.YAP2APP_EMAIL || getGitUserEmail() || "").trim();
7600
+ }
7601
+ var USER_EMAIL = resolveUserEmail();
7583
7602
  function safeResolvePath(baseDir, relativePath) {
7584
7603
  const cleanRel = (relativePath || "").replace(/^[\\\/]+/, "");
7585
7604
  const resolved = path2.resolve(baseDir, cleanRel);
@@ -7760,6 +7779,7 @@ async function sendCloudHeartbeat() {
7760
7779
  const context = await scanCodebase(PROJECT_ROOT);
7761
7780
  const payload = {
7762
7781
  pair_code: PAIR_CODE,
7782
+ user_email: USER_EMAIL || void 0,
7763
7783
  project_name: path2.basename(PROJECT_ROOT),
7764
7784
  project_root: PROJECT_ROOT,
7765
7785
  framework: context.framework || "plain_html_css_js",
@@ -7816,8 +7836,10 @@ server.on("error", (err) => {
7816
7836
  ---------------------------------------------------------------`);
7817
7837
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7818
7838
  console.log(`Pair Code: ${PAIR_CODE}`);
7839
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7819
7840
  console.log(`Local Endpoint: http://127.0.0.1:${PORT}`);
7820
7841
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7842
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7821
7843
  console.log(`Status: Already active & ready on port ${PORT}`);
7822
7844
  console.log(`---------------------------------------------------------------
7823
7845
  `);
@@ -7837,13 +7859,14 @@ async function startBridge(port = PORT) {
7837
7859
  ---------------------------------------------------------------`);
7838
7860
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7839
7861
  console.log(`Pair Code: ${PAIR_CODE}`);
7862
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7840
7863
  console.log(`Local Endpoint: http://127.0.0.1:${port}`);
7841
7864
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7842
- console.log(`Web Studio: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com`);
7865
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7843
7866
  console.log(`---------------------------------------------------------------
7844
7867
  `);
7845
7868
  console.log(`Bridge is running & synced.`);
7846
- console.log(`Open Web Studio in your browser to automatically connect and sync.`);
7869
+ console.log(`Open Web Studio in your browser or click the link above to connect.`);
7847
7870
  console.log(`Press Ctrl/Cmd+C to stop.
7848
7871
  `);
7849
7872
  });
package/bridge.js CHANGED
@@ -2,6 +2,7 @@ import http from 'http';
2
2
  import fsSync from 'fs';
3
3
  import path from 'path';
4
4
  import util from 'util';
5
+ import { execSync } from 'child_process';
5
6
  import { scanCodebase } from './scanner.js';
6
7
 
7
8
  const fs = fsSync.promises || {
@@ -15,7 +16,26 @@ const fs = fsSync.promises || {
15
16
  const PORT = Number(process.env.YAP2APP_PORT) || 10420;
16
17
  const PROJECT_ROOT = process.cwd();
17
18
  const PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || ('Y2A-' + Math.floor(1000 + Math.random() * 9000))).toUpperCase();
18
- const CLI_VERSION = '1.2.0';
19
+ const CLI_VERSION = '1.2.3';
20
+
21
+ function getGitUserEmail() {
22
+ try {
23
+ const email = execSync('git config user.email', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
24
+ return email || null;
25
+ } catch (e) {
26
+ return null;
27
+ }
28
+ }
29
+
30
+ function resolveUserEmail() {
31
+ const emailArgIdx = process.argv.indexOf('--email');
32
+ if (emailArgIdx !== -1 && process.argv[emailArgIdx + 1]) {
33
+ return process.argv[emailArgIdx + 1].trim();
34
+ }
35
+ return (process.env.YAP2APP_EMAIL || getGitUserEmail() || '').trim();
36
+ }
37
+
38
+ const USER_EMAIL = resolveUserEmail();
19
39
 
20
40
  /**
21
41
  * Validates and resolves relative file paths strictly inside PROJECT_ROOT.
@@ -244,6 +264,7 @@ async function sendCloudHeartbeat() {
244
264
  const context = await scanCodebase(PROJECT_ROOT);
245
265
  const payload = {
246
266
  pair_code: PAIR_CODE,
267
+ user_email: USER_EMAIL || undefined,
247
268
  project_name: path.basename(PROJECT_ROOT),
248
269
  project_root: PROJECT_ROOT,
249
270
  framework: context.framework || 'plain_html_css_js',
@@ -307,8 +328,10 @@ server.on('error', (err) => {
307
328
  console.log(`\n---------------------------------------------------------------`);
308
329
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
309
330
  console.log(`Pair Code: ${PAIR_CODE}`);
331
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
310
332
  console.log(`Local Endpoint: http://127.0.0.1:${PORT}`);
311
333
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
334
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
312
335
  console.log(`Status: Already active & ready on port ${PORT}`);
313
336
  console.log(`---------------------------------------------------------------\n`);
314
337
  console.log(`Bridge is running & synced.`);
@@ -328,12 +351,13 @@ export async function startBridge(port = PORT) {
328
351
  console.log(`\n---------------------------------------------------------------`);
329
352
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
330
353
  console.log(`Pair Code: ${PAIR_CODE}`);
354
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
331
355
  console.log(`Local Endpoint: http://127.0.0.1:${port}`);
332
356
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
333
- console.log(`Web Studio: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com`);
357
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
334
358
  console.log(`---------------------------------------------------------------\n`);
335
359
  console.log(`Bridge is running & synced.`);
336
- console.log(`Open Web Studio in your browser to automatically connect and sync.`);
360
+ console.log(`Open Web Studio in your browser or click the link above to connect.`);
337
361
  console.log(`Press Ctrl/Cmd+C to stop.\n`);
338
362
  });
339
363
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yap2app",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "type": "module",
5
5
  "description": "Autonomous Vibe-to-Prod Localhost Bridge & Model Context Protocol (MCP) Server",
6
6
  "main": "bin/cli.bundle.js",
@@ -24,7 +24,8 @@
24
24
  "registry": "https://registry.npmjs.org/"
25
25
  },
26
26
  "scripts": {
27
- "start": "node ./bin/cli.js start",
27
+ "build": "npx esbuild bin/cli-esm.js --bundle --platform=node --target=node18 --format=esm --banner:js=\"#!/usr/bin/env node\nimport { createRequire } from 'module';\nconst require = createRequire(import.meta.url);\" --outfile=bin/cli.bundle.js && cp bin/cli.bundle.js bin/cli.js && chmod +x bin/cli.js bin/cli.bundle.js",
28
+ "start": "./bin/cli.js start",
28
29
  "bridge": "node ./bin/cli.js bridge",
29
30
  "mcp": "node ./bin/cli.js mcp",
30
31
  "scan": "node ./bin/cli.js scan"