yap2app 1.2.1 → 1.2.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.
package/bin/cli.bundle.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7027,6 +7028,7 @@ import http from "http";
7027
7028
  import fsSync2 from "fs";
7028
7029
  import path2 from "path";
7029
7030
  import util2 from "util";
7031
+ import { execSync } from "child_process";
7030
7032
 
7031
7033
  // scanner.js
7032
7034
  import fsSync from "fs";
@@ -7578,7 +7580,23 @@ var fs2 = fsSync2.promises || {
7578
7580
  var PORT = Number(process.env.YAP2APP_PORT) || 10420;
7579
7581
  var PROJECT_ROOT = process.cwd();
7580
7582
  var PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || "Y2A-" + Math.floor(1e3 + Math.random() * 9e3)).toUpperCase();
7581
- var CLI_VERSION = "1.2.0";
7583
+ var CLI_VERSION = "1.2.2";
7584
+ function getGitUserEmail() {
7585
+ try {
7586
+ const email2 = execSync("git config user.email", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
7587
+ return email2 || null;
7588
+ } catch (e) {
7589
+ return null;
7590
+ }
7591
+ }
7592
+ function resolveUserEmail() {
7593
+ const emailArgIdx = process.argv.indexOf("--email");
7594
+ if (emailArgIdx !== -1 && process.argv[emailArgIdx + 1]) {
7595
+ return process.argv[emailArgIdx + 1].trim();
7596
+ }
7597
+ return (process.env.YAP2APP_EMAIL || getGitUserEmail() || "").trim();
7598
+ }
7599
+ var USER_EMAIL = resolveUserEmail();
7582
7600
  function safeResolvePath(baseDir, relativePath) {
7583
7601
  const cleanRel = (relativePath || "").replace(/^[\\\/]+/, "");
7584
7602
  const resolved = path2.resolve(baseDir, cleanRel);
@@ -7759,6 +7777,7 @@ async function sendCloudHeartbeat() {
7759
7777
  const context = await scanCodebase(PROJECT_ROOT);
7760
7778
  const payload = {
7761
7779
  pair_code: PAIR_CODE,
7780
+ user_email: USER_EMAIL || void 0,
7762
7781
  project_name: path2.basename(PROJECT_ROOT),
7763
7782
  project_root: PROJECT_ROOT,
7764
7783
  framework: context.framework || "plain_html_css_js",
@@ -7815,8 +7834,10 @@ server.on("error", (err) => {
7815
7834
  ---------------------------------------------------------------`);
7816
7835
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7817
7836
  console.log(`Pair Code: ${PAIR_CODE}`);
7837
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7818
7838
  console.log(`Local Endpoint: http://127.0.0.1:${PORT}`);
7819
7839
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7840
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7820
7841
  console.log(`Status: Already active & ready on port ${PORT}`);
7821
7842
  console.log(`---------------------------------------------------------------
7822
7843
  `);
@@ -7836,13 +7857,14 @@ async function startBridge(port = PORT) {
7836
7857
  ---------------------------------------------------------------`);
7837
7858
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7838
7859
  console.log(`Pair Code: ${PAIR_CODE}`);
7860
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7839
7861
  console.log(`Local Endpoint: http://127.0.0.1:${port}`);
7840
7862
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7841
- console.log(`Web Studio: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com`);
7863
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7842
7864
  console.log(`---------------------------------------------------------------
7843
7865
  `);
7844
7866
  console.log(`Bridge is running & synced.`);
7845
- console.log(`Open Web Studio in your browser to automatically connect and sync.`);
7867
+ console.log(`Open Web Studio in your browser or click the link above to connect.`);
7846
7868
  console.log(`Press Ctrl/Cmd+C to stop.
7847
7869
  `);
7848
7870
  });
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7028,6 +7028,7 @@ import http from "http";
7028
7028
  import fsSync2 from "fs";
7029
7029
  import path2 from "path";
7030
7030
  import util2 from "util";
7031
+ import { execSync } from "child_process";
7031
7032
 
7032
7033
  // scanner.js
7033
7034
  import fsSync from "fs";
@@ -7579,7 +7580,23 @@ var fs2 = fsSync2.promises || {
7579
7580
  var PORT = Number(process.env.YAP2APP_PORT) || 10420;
7580
7581
  var PROJECT_ROOT = process.cwd();
7581
7582
  var PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || "Y2A-" + Math.floor(1e3 + Math.random() * 9e3)).toUpperCase();
7582
- var CLI_VERSION = "1.2.0";
7583
+ var CLI_VERSION = "1.2.2";
7584
+ function getGitUserEmail() {
7585
+ try {
7586
+ const email2 = execSync("git config user.email", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
7587
+ return email2 || null;
7588
+ } catch (e) {
7589
+ return null;
7590
+ }
7591
+ }
7592
+ function resolveUserEmail() {
7593
+ const emailArgIdx = process.argv.indexOf("--email");
7594
+ if (emailArgIdx !== -1 && process.argv[emailArgIdx + 1]) {
7595
+ return process.argv[emailArgIdx + 1].trim();
7596
+ }
7597
+ return (process.env.YAP2APP_EMAIL || getGitUserEmail() || "").trim();
7598
+ }
7599
+ var USER_EMAIL = resolveUserEmail();
7583
7600
  function safeResolvePath(baseDir, relativePath) {
7584
7601
  const cleanRel = (relativePath || "").replace(/^[\\\/]+/, "");
7585
7602
  const resolved = path2.resolve(baseDir, cleanRel);
@@ -7760,6 +7777,7 @@ async function sendCloudHeartbeat() {
7760
7777
  const context = await scanCodebase(PROJECT_ROOT);
7761
7778
  const payload = {
7762
7779
  pair_code: PAIR_CODE,
7780
+ user_email: USER_EMAIL || void 0,
7763
7781
  project_name: path2.basename(PROJECT_ROOT),
7764
7782
  project_root: PROJECT_ROOT,
7765
7783
  framework: context.framework || "plain_html_css_js",
@@ -7816,8 +7834,10 @@ server.on("error", (err) => {
7816
7834
  ---------------------------------------------------------------`);
7817
7835
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7818
7836
  console.log(`Pair Code: ${PAIR_CODE}`);
7837
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7819
7838
  console.log(`Local Endpoint: http://127.0.0.1:${PORT}`);
7820
7839
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7840
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7821
7841
  console.log(`Status: Already active & ready on port ${PORT}`);
7822
7842
  console.log(`---------------------------------------------------------------
7823
7843
  `);
@@ -7837,13 +7857,14 @@ async function startBridge(port = PORT) {
7837
7857
  ---------------------------------------------------------------`);
7838
7858
  console.log(`Yap2App Local Bridge v${CLI_VERSION}`);
7839
7859
  console.log(`Pair Code: ${PAIR_CODE}`);
7860
+ if (USER_EMAIL) console.log(`Linked Email: ${USER_EMAIL}`);
7840
7861
  console.log(`Local Endpoint: http://127.0.0.1:${port}`);
7841
7862
  console.log(`Active Workspace: ${PROJECT_ROOT}`);
7842
- console.log(`Web Studio: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com`);
7863
+ console.log(`Web Studio Link: https://yap2app-dot-cybage-hackathon.uc.r.appspot.com/?pair=${PAIR_CODE}`);
7843
7864
  console.log(`---------------------------------------------------------------
7844
7865
  `);
7845
7866
  console.log(`Bridge is running & synced.`);
7846
- console.log(`Open Web Studio in your browser to automatically connect and sync.`);
7867
+ console.log(`Open Web Studio in your browser or click the link above to connect.`);
7847
7868
  console.log(`Press Ctrl/Cmd+C to stop.
7848
7869
  `);
7849
7870
  });
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.2';
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.2",
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,6 +24,7 @@
24
24
  "registry": "https://registry.npmjs.org/"
25
25
  },
26
26
  "scripts": {
27
+ "build": "npx esbuild bin/cli-esm.js --bundle --platform=node --target=node18 --format=esm --banner:js=\"import { createRequire } from 'module'; const require = createRequire(import.meta.url);\" --outfile=bin/cli.bundle.js && cp bin/cli.bundle.js bin/cli.js",
27
28
  "start": "node ./bin/cli.js start",
28
29
  "bridge": "node ./bin/cli.js bridge",
29
30
  "mcp": "node ./bin/cli.js mcp",