yap2app 1.1.5 ā 1.1.6
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-esm.js +11 -13
- package/bin/cli.bundle.js +38 -43
- package/bin/cli.js +38 -43
- package/bridge.js +22 -26
- package/mcp.js +1 -1
- package/package.json +1 -1
package/bin/cli-esm.js
CHANGED
|
@@ -13,30 +13,28 @@ async function main() {
|
|
|
13
13
|
await runMcpServer();
|
|
14
14
|
} else if (command === 'scan') {
|
|
15
15
|
// Run standalone shallow scanner and print summary
|
|
16
|
-
console.log(`\
|
|
16
|
+
console.log(`\nYap2App Codebase Context:\n`);
|
|
17
17
|
const context = await scanCodebase(process.cwd());
|
|
18
|
-
console.log(
|
|
19
|
-
console.log(`Framework:
|
|
20
|
-
console.log(`Path Alias:
|
|
21
|
-
|
|
22
|
-
console.log(`
|
|
23
|
-
console.log(`UI Components Catalog: ${(context.component_names || []).join(', ') || 'None'}`);
|
|
24
|
-
console.log(`\nFull Context JSON:\n`, JSON.stringify(context, null, 2));
|
|
18
|
+
console.log(` Project: ${context.project_name}`);
|
|
19
|
+
console.log(` Framework: ${context.framework_display_name || context.framework}`);
|
|
20
|
+
console.log(` Path Alias: ${context.path_alias || '@/'}`);
|
|
21
|
+
console.log(` Files: ${context.discovered_files?.length || 0}`);
|
|
22
|
+
console.log(` Components: ${(context.component_names || []).join(', ') || 'None'}\n`);
|
|
25
23
|
} else if (command === 'start' || command === 'bridge' || command === 'server') {
|
|
26
24
|
// Start Localhost Bridge for Web Studio UI
|
|
27
25
|
startBridge();
|
|
28
26
|
} else if (command === 'help' || command === '--help' || command === '-h') {
|
|
29
27
|
console.log(`
|
|
30
|
-
|
|
28
|
+
Yap2App CLI
|
|
31
29
|
|
|
32
30
|
Usage:
|
|
33
31
|
npx yap2app [command]
|
|
34
32
|
|
|
35
33
|
Commands:
|
|
36
|
-
start
|
|
37
|
-
mcp
|
|
38
|
-
scan
|
|
39
|
-
help
|
|
34
|
+
start, bridge Start local bridge for Web Studio sync (default)
|
|
35
|
+
mcp Run MCP server over stdio for Cursor / Claude
|
|
36
|
+
scan Scan codebase context and detected components
|
|
37
|
+
help Show this help message
|
|
40
38
|
`);
|
|
41
39
|
} else {
|
|
42
40
|
// Default fallback to bridge
|
package/bin/cli.bundle.js
CHANGED
|
@@ -7682,8 +7682,8 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7682
7682
|
res.writeHead(200, headers);
|
|
7683
7683
|
res.end(JSON.stringify({
|
|
7684
7684
|
status: "healthy",
|
|
7685
|
-
service: "
|
|
7686
|
-
version: "1.1.
|
|
7685
|
+
service: "yap2app-bridge",
|
|
7686
|
+
version: "1.1.6",
|
|
7687
7687
|
port: PORT,
|
|
7688
7688
|
pair_code: PAIR_CODE,
|
|
7689
7689
|
project_root: PROJECT_ROOT,
|
|
@@ -7695,12 +7695,12 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7695
7695
|
if (req.method === "GET" && (pathname === "/api/context" || pathname === "/context")) {
|
|
7696
7696
|
try {
|
|
7697
7697
|
const promptQuery = searchParams.get("q") || "";
|
|
7698
|
-
console.log(`[
|
|
7698
|
+
console.log(` [bridge] Scanning codebase in ${import_path2.default.basename(PROJECT_ROOT)}${promptQuery ? ` (query: "${promptQuery}")` : ""}`);
|
|
7699
7699
|
const context = await scanCodebase(PROJECT_ROOT, promptQuery);
|
|
7700
7700
|
res.writeHead(200, headers);
|
|
7701
7701
|
res.end(JSON.stringify(context));
|
|
7702
7702
|
} catch (e) {
|
|
7703
|
-
console.error("[
|
|
7703
|
+
console.error(" [bridge] Context scan error:", e.message);
|
|
7704
7704
|
res.writeHead(500, headers);
|
|
7705
7705
|
res.end(JSON.stringify({ error: e.message }));
|
|
7706
7706
|
}
|
|
@@ -7739,7 +7739,7 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7739
7739
|
diffs: diffResults
|
|
7740
7740
|
}));
|
|
7741
7741
|
} catch (e) {
|
|
7742
|
-
console.error("[
|
|
7742
|
+
console.error(" [bridge] Diff error:", e.message);
|
|
7743
7743
|
res.writeHead(500, headers);
|
|
7744
7744
|
res.end(JSON.stringify({ error: e.message }));
|
|
7745
7745
|
}
|
|
@@ -7758,7 +7758,7 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7758
7758
|
const fullPath = import_path2.default.join(PROJECT_ROOT, file.path);
|
|
7759
7759
|
await fs2.mkdir(import_path2.default.dirname(fullPath), { recursive: true });
|
|
7760
7760
|
await fs2.writeFile(fullPath, file.content, "utf8");
|
|
7761
|
-
console.log(`[
|
|
7761
|
+
console.log(` [bridge] Wrote ${file.path}`);
|
|
7762
7762
|
written.push(file.path);
|
|
7763
7763
|
}
|
|
7764
7764
|
res.writeHead(200, headers);
|
|
@@ -7770,7 +7770,7 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7770
7770
|
message: `Successfully wrote ${written.length} files to ${import_path2.default.basename(PROJECT_ROOT)}`
|
|
7771
7771
|
}));
|
|
7772
7772
|
} catch (e) {
|
|
7773
|
-
console.error("[
|
|
7773
|
+
console.error(" [bridge] Write error:", e.message);
|
|
7774
7774
|
res.writeHead(500, headers);
|
|
7775
7775
|
res.end(JSON.stringify({ error: e.message }));
|
|
7776
7776
|
}
|
|
@@ -7783,30 +7783,28 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7783
7783
|
server.on("error", (err) => {
|
|
7784
7784
|
if (err && err.code === "EADDRINUSE") {
|
|
7785
7785
|
console.log(`
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
console.log(
|
|
7789
|
-
console.log(
|
|
7790
|
-
console.log(
|
|
7791
|
-
console.log(
|
|
7786
|
+
Yap2App Bridge
|
|
7787
|
+
`);
|
|
7788
|
+
console.log(` Port ${PORT} is active. Cloud Relay connected.`);
|
|
7789
|
+
console.log(` Workspace: ${PROJECT_ROOT}`);
|
|
7790
|
+
console.log(` Pair Code: ${PAIR_CODE}`);
|
|
7791
|
+
console.log(` Web Studio: ${CLOUD_RELAY_URL}
|
|
7792
7792
|
`);
|
|
7793
7793
|
return;
|
|
7794
7794
|
}
|
|
7795
|
-
console.error("[
|
|
7795
|
+
console.error(" [bridge] Error:", err.message || err);
|
|
7796
7796
|
});
|
|
7797
7797
|
async function startBridge(port = PORT) {
|
|
7798
7798
|
server.listen(port, "0.0.0.0", () => {
|
|
7799
7799
|
console.log(`
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
console.log(
|
|
7803
|
-
console.log(
|
|
7804
|
-
console.log(
|
|
7805
|
-
console.log(
|
|
7806
|
-
console.log(`\u{1F6E1}\uFE0F Enterprise Diff, W3C PNA & Cloud Relay Enabled`);
|
|
7807
|
-
console.log(`===============================================================
|
|
7800
|
+
Yap2App Bridge v1.1.6
|
|
7801
|
+
`);
|
|
7802
|
+
console.log(` Local: http://127.0.0.1:${port}`);
|
|
7803
|
+
console.log(` Workspace: ${PROJECT_ROOT}`);
|
|
7804
|
+
console.log(` Pair Code: ${PAIR_CODE}`);
|
|
7805
|
+
console.log(` Web Studio: ${CLOUD_RELAY_URL}
|
|
7808
7806
|
`);
|
|
7809
|
-
console.log(`Ready for
|
|
7807
|
+
console.log(` Ready for sync.
|
|
7810
7808
|
`);
|
|
7811
7809
|
});
|
|
7812
7810
|
try {
|
|
@@ -7817,7 +7815,7 @@ async function startBridge(port = PORT) {
|
|
|
7817
7815
|
project_root: PROJECT_ROOT,
|
|
7818
7816
|
framework: initialContext.framework,
|
|
7819
7817
|
context: initialContext,
|
|
7820
|
-
version: "1.1.
|
|
7818
|
+
version: "1.1.6"
|
|
7821
7819
|
});
|
|
7822
7820
|
} catch (e) {
|
|
7823
7821
|
}
|
|
@@ -7830,7 +7828,7 @@ async function startBridge(port = PORT) {
|
|
|
7830
7828
|
project_root: PROJECT_ROOT,
|
|
7831
7829
|
framework: context.framework,
|
|
7832
7830
|
context,
|
|
7833
|
-
version: "1.1.
|
|
7831
|
+
version: "1.1.6"
|
|
7834
7832
|
});
|
|
7835
7833
|
if (hbResult && hbResult.data && hbResult.data.pending_writes_count > 0) {
|
|
7836
7834
|
const pollResult = await sendCloudRelayRequest("GET", `/api/v1/bridge/poll-writes?pair_code=${PAIR_CODE}`);
|
|
@@ -7841,7 +7839,7 @@ async function startBridge(port = PORT) {
|
|
|
7841
7839
|
const fullPath = import_path2.default.join(PROJECT_ROOT, file.path);
|
|
7842
7840
|
await fs2.mkdir(import_path2.default.dirname(fullPath), { recursive: true });
|
|
7843
7841
|
await fs2.writeFile(fullPath, file.content, "utf8");
|
|
7844
|
-
console.log(`[
|
|
7842
|
+
console.log(` [bridge] Wrote ${file.path}`);
|
|
7845
7843
|
written.push(file.path);
|
|
7846
7844
|
}
|
|
7847
7845
|
await sendCloudRelayRequest("POST", "/api/v1/bridge/complete-write", {
|
|
@@ -16561,7 +16559,7 @@ server2.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
16561
16559
|
async function runMcpServer() {
|
|
16562
16560
|
const transport = new StdioServerTransport();
|
|
16563
16561
|
await server2.connect(transport);
|
|
16564
|
-
console.error("
|
|
16562
|
+
console.error("Yap2App MCP Server running on stdio");
|
|
16565
16563
|
}
|
|
16566
16564
|
var isDirectRun2 = Boolean(typeof process !== "undefined" && process.argv && process.argv[1] && (process.argv[1].endsWith("mcp.js") || process.argv[1].endsWith("mcp")));
|
|
16567
16565
|
if (isDirectRun2) {
|
|
@@ -16578,32 +16576,29 @@ async function main() {
|
|
|
16578
16576
|
await runMcpServer();
|
|
16579
16577
|
} else if (command === "scan") {
|
|
16580
16578
|
console.log(`
|
|
16581
|
-
|
|
16579
|
+
Yap2App Codebase Context:
|
|
16580
|
+
`);
|
|
16582
16581
|
const context = await scanCodebase(process.cwd());
|
|
16583
|
-
console.log(`
|
|
16584
|
-
|
|
16585
|
-
console.log(`
|
|
16586
|
-
console.log(`
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
console.log(`UI Components Catalog: ${(context.component_names || []).join(", ") || "None"}`);
|
|
16590
|
-
console.log(`
|
|
16591
|
-
Full Context JSON:
|
|
16592
|
-
`, JSON.stringify(context, null, 2));
|
|
16582
|
+
console.log(` Project: ${context.project_name}`);
|
|
16583
|
+
console.log(` Framework: ${context.framework_display_name || context.framework}`);
|
|
16584
|
+
console.log(` Path Alias: ${context.path_alias || "@/"}`);
|
|
16585
|
+
console.log(` Files: ${context.discovered_files?.length || 0}`);
|
|
16586
|
+
console.log(` Components: ${(context.component_names || []).join(", ") || "None"}
|
|
16587
|
+
`);
|
|
16593
16588
|
} else if (command === "start" || command === "bridge" || command === "server") {
|
|
16594
16589
|
startBridge();
|
|
16595
16590
|
} else if (command === "help" || command === "--help" || command === "-h") {
|
|
16596
16591
|
console.log(`
|
|
16597
|
-
|
|
16592
|
+
Yap2App CLI
|
|
16598
16593
|
|
|
16599
16594
|
Usage:
|
|
16600
16595
|
npx yap2app [command]
|
|
16601
16596
|
|
|
16602
16597
|
Commands:
|
|
16603
|
-
start
|
|
16604
|
-
mcp
|
|
16605
|
-
scan
|
|
16606
|
-
help
|
|
16598
|
+
start, bridge Start local bridge for Web Studio sync (default)
|
|
16599
|
+
mcp Run MCP server over stdio for Cursor / Claude
|
|
16600
|
+
scan Scan codebase context and detected components
|
|
16601
|
+
help Show this help message
|
|
16607
16602
|
`);
|
|
16608
16603
|
} else {
|
|
16609
16604
|
startBridge();
|
package/bin/cli.js
CHANGED
|
@@ -7682,8 +7682,8 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7682
7682
|
res.writeHead(200, headers);
|
|
7683
7683
|
res.end(JSON.stringify({
|
|
7684
7684
|
status: "healthy",
|
|
7685
|
-
service: "
|
|
7686
|
-
version: "1.1.
|
|
7685
|
+
service: "yap2app-bridge",
|
|
7686
|
+
version: "1.1.6",
|
|
7687
7687
|
port: PORT,
|
|
7688
7688
|
pair_code: PAIR_CODE,
|
|
7689
7689
|
project_root: PROJECT_ROOT,
|
|
@@ -7695,12 +7695,12 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7695
7695
|
if (req.method === "GET" && (pathname === "/api/context" || pathname === "/context")) {
|
|
7696
7696
|
try {
|
|
7697
7697
|
const promptQuery = searchParams.get("q") || "";
|
|
7698
|
-
console.log(`[
|
|
7698
|
+
console.log(` [bridge] Scanning codebase in ${import_path2.default.basename(PROJECT_ROOT)}${promptQuery ? ` (query: "${promptQuery}")` : ""}`);
|
|
7699
7699
|
const context = await scanCodebase(PROJECT_ROOT, promptQuery);
|
|
7700
7700
|
res.writeHead(200, headers);
|
|
7701
7701
|
res.end(JSON.stringify(context));
|
|
7702
7702
|
} catch (e) {
|
|
7703
|
-
console.error("[
|
|
7703
|
+
console.error(" [bridge] Context scan error:", e.message);
|
|
7704
7704
|
res.writeHead(500, headers);
|
|
7705
7705
|
res.end(JSON.stringify({ error: e.message }));
|
|
7706
7706
|
}
|
|
@@ -7739,7 +7739,7 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7739
7739
|
diffs: diffResults
|
|
7740
7740
|
}));
|
|
7741
7741
|
} catch (e) {
|
|
7742
|
-
console.error("[
|
|
7742
|
+
console.error(" [bridge] Diff error:", e.message);
|
|
7743
7743
|
res.writeHead(500, headers);
|
|
7744
7744
|
res.end(JSON.stringify({ error: e.message }));
|
|
7745
7745
|
}
|
|
@@ -7758,7 +7758,7 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7758
7758
|
const fullPath = import_path2.default.join(PROJECT_ROOT, file.path);
|
|
7759
7759
|
await fs2.mkdir(import_path2.default.dirname(fullPath), { recursive: true });
|
|
7760
7760
|
await fs2.writeFile(fullPath, file.content, "utf8");
|
|
7761
|
-
console.log(`[
|
|
7761
|
+
console.log(` [bridge] Wrote ${file.path}`);
|
|
7762
7762
|
written.push(file.path);
|
|
7763
7763
|
}
|
|
7764
7764
|
res.writeHead(200, headers);
|
|
@@ -7770,7 +7770,7 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7770
7770
|
message: `Successfully wrote ${written.length} files to ${import_path2.default.basename(PROJECT_ROOT)}`
|
|
7771
7771
|
}));
|
|
7772
7772
|
} catch (e) {
|
|
7773
|
-
console.error("[
|
|
7773
|
+
console.error(" [bridge] Write error:", e.message);
|
|
7774
7774
|
res.writeHead(500, headers);
|
|
7775
7775
|
res.end(JSON.stringify({ error: e.message }));
|
|
7776
7776
|
}
|
|
@@ -7783,30 +7783,28 @@ var server = import_http.default.createServer(async (req, res) => {
|
|
|
7783
7783
|
server.on("error", (err) => {
|
|
7784
7784
|
if (err && err.code === "EADDRINUSE") {
|
|
7785
7785
|
console.log(`
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
console.log(
|
|
7789
|
-
console.log(
|
|
7790
|
-
console.log(
|
|
7791
|
-
console.log(
|
|
7786
|
+
Yap2App Bridge
|
|
7787
|
+
`);
|
|
7788
|
+
console.log(` Port ${PORT} is active. Cloud Relay connected.`);
|
|
7789
|
+
console.log(` Workspace: ${PROJECT_ROOT}`);
|
|
7790
|
+
console.log(` Pair Code: ${PAIR_CODE}`);
|
|
7791
|
+
console.log(` Web Studio: ${CLOUD_RELAY_URL}
|
|
7792
7792
|
`);
|
|
7793
7793
|
return;
|
|
7794
7794
|
}
|
|
7795
|
-
console.error("[
|
|
7795
|
+
console.error(" [bridge] Error:", err.message || err);
|
|
7796
7796
|
});
|
|
7797
7797
|
async function startBridge(port = PORT) {
|
|
7798
7798
|
server.listen(port, "0.0.0.0", () => {
|
|
7799
7799
|
console.log(`
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
console.log(
|
|
7803
|
-
console.log(
|
|
7804
|
-
console.log(
|
|
7805
|
-
console.log(
|
|
7806
|
-
console.log(`\u{1F6E1}\uFE0F Enterprise Diff, W3C PNA & Cloud Relay Enabled`);
|
|
7807
|
-
console.log(`===============================================================
|
|
7800
|
+
Yap2App Bridge v1.1.6
|
|
7801
|
+
`);
|
|
7802
|
+
console.log(` Local: http://127.0.0.1:${port}`);
|
|
7803
|
+
console.log(` Workspace: ${PROJECT_ROOT}`);
|
|
7804
|
+
console.log(` Pair Code: ${PAIR_CODE}`);
|
|
7805
|
+
console.log(` Web Studio: ${CLOUD_RELAY_URL}
|
|
7808
7806
|
`);
|
|
7809
|
-
console.log(`Ready for
|
|
7807
|
+
console.log(` Ready for sync.
|
|
7810
7808
|
`);
|
|
7811
7809
|
});
|
|
7812
7810
|
try {
|
|
@@ -7817,7 +7815,7 @@ async function startBridge(port = PORT) {
|
|
|
7817
7815
|
project_root: PROJECT_ROOT,
|
|
7818
7816
|
framework: initialContext.framework,
|
|
7819
7817
|
context: initialContext,
|
|
7820
|
-
version: "1.1.
|
|
7818
|
+
version: "1.1.6"
|
|
7821
7819
|
});
|
|
7822
7820
|
} catch (e) {
|
|
7823
7821
|
}
|
|
@@ -7830,7 +7828,7 @@ async function startBridge(port = PORT) {
|
|
|
7830
7828
|
project_root: PROJECT_ROOT,
|
|
7831
7829
|
framework: context.framework,
|
|
7832
7830
|
context,
|
|
7833
|
-
version: "1.1.
|
|
7831
|
+
version: "1.1.6"
|
|
7834
7832
|
});
|
|
7835
7833
|
if (hbResult && hbResult.data && hbResult.data.pending_writes_count > 0) {
|
|
7836
7834
|
const pollResult = await sendCloudRelayRequest("GET", `/api/v1/bridge/poll-writes?pair_code=${PAIR_CODE}`);
|
|
@@ -7841,7 +7839,7 @@ async function startBridge(port = PORT) {
|
|
|
7841
7839
|
const fullPath = import_path2.default.join(PROJECT_ROOT, file.path);
|
|
7842
7840
|
await fs2.mkdir(import_path2.default.dirname(fullPath), { recursive: true });
|
|
7843
7841
|
await fs2.writeFile(fullPath, file.content, "utf8");
|
|
7844
|
-
console.log(`[
|
|
7842
|
+
console.log(` [bridge] Wrote ${file.path}`);
|
|
7845
7843
|
written.push(file.path);
|
|
7846
7844
|
}
|
|
7847
7845
|
await sendCloudRelayRequest("POST", "/api/v1/bridge/complete-write", {
|
|
@@ -16561,7 +16559,7 @@ server2.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
16561
16559
|
async function runMcpServer() {
|
|
16562
16560
|
const transport = new StdioServerTransport();
|
|
16563
16561
|
await server2.connect(transport);
|
|
16564
|
-
console.error("
|
|
16562
|
+
console.error("Yap2App MCP Server running on stdio");
|
|
16565
16563
|
}
|
|
16566
16564
|
var isDirectRun2 = Boolean(typeof process !== "undefined" && process.argv && process.argv[1] && (process.argv[1].endsWith("mcp.js") || process.argv[1].endsWith("mcp")));
|
|
16567
16565
|
if (isDirectRun2) {
|
|
@@ -16578,32 +16576,29 @@ async function main() {
|
|
|
16578
16576
|
await runMcpServer();
|
|
16579
16577
|
} else if (command === "scan") {
|
|
16580
16578
|
console.log(`
|
|
16581
|
-
|
|
16579
|
+
Yap2App Codebase Context:
|
|
16580
|
+
`);
|
|
16582
16581
|
const context = await scanCodebase(process.cwd());
|
|
16583
|
-
console.log(`
|
|
16584
|
-
|
|
16585
|
-
console.log(`
|
|
16586
|
-
console.log(`
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
console.log(`UI Components Catalog: ${(context.component_names || []).join(", ") || "None"}`);
|
|
16590
|
-
console.log(`
|
|
16591
|
-
Full Context JSON:
|
|
16592
|
-
`, JSON.stringify(context, null, 2));
|
|
16582
|
+
console.log(` Project: ${context.project_name}`);
|
|
16583
|
+
console.log(` Framework: ${context.framework_display_name || context.framework}`);
|
|
16584
|
+
console.log(` Path Alias: ${context.path_alias || "@/"}`);
|
|
16585
|
+
console.log(` Files: ${context.discovered_files?.length || 0}`);
|
|
16586
|
+
console.log(` Components: ${(context.component_names || []).join(", ") || "None"}
|
|
16587
|
+
`);
|
|
16593
16588
|
} else if (command === "start" || command === "bridge" || command === "server") {
|
|
16594
16589
|
startBridge();
|
|
16595
16590
|
} else if (command === "help" || command === "--help" || command === "-h") {
|
|
16596
16591
|
console.log(`
|
|
16597
|
-
|
|
16592
|
+
Yap2App CLI
|
|
16598
16593
|
|
|
16599
16594
|
Usage:
|
|
16600
16595
|
npx yap2app [command]
|
|
16601
16596
|
|
|
16602
16597
|
Commands:
|
|
16603
|
-
start
|
|
16604
|
-
mcp
|
|
16605
|
-
scan
|
|
16606
|
-
help
|
|
16598
|
+
start, bridge Start local bridge for Web Studio sync (default)
|
|
16599
|
+
mcp Run MCP server over stdio for Cursor / Claude
|
|
16600
|
+
scan Scan codebase context and detected components
|
|
16601
|
+
help Show this help message
|
|
16607
16602
|
`);
|
|
16608
16603
|
} else {
|
|
16609
16604
|
startBridge();
|
package/bridge.js
CHANGED
|
@@ -148,8 +148,8 @@ const server = http.createServer(async (req, res) => {
|
|
|
148
148
|
res.writeHead(200, headers);
|
|
149
149
|
res.end(JSON.stringify({
|
|
150
150
|
status: 'healthy',
|
|
151
|
-
service: '
|
|
152
|
-
version: '1.1.
|
|
151
|
+
service: 'yap2app-bridge',
|
|
152
|
+
version: '1.1.6',
|
|
153
153
|
port: PORT,
|
|
154
154
|
pair_code: PAIR_CODE,
|
|
155
155
|
project_root: PROJECT_ROOT,
|
|
@@ -163,12 +163,12 @@ const server = http.createServer(async (req, res) => {
|
|
|
163
163
|
if (req.method === 'GET' && (pathname === '/api/context' || pathname === '/context')) {
|
|
164
164
|
try {
|
|
165
165
|
const promptQuery = searchParams.get('q') || '';
|
|
166
|
-
console.log(`[
|
|
166
|
+
console.log(` [bridge] Scanning codebase in ${path.basename(PROJECT_ROOT)}${promptQuery ? ` (query: "${promptQuery}")` : ''}`);
|
|
167
167
|
const context = await scanCodebase(PROJECT_ROOT, promptQuery);
|
|
168
168
|
res.writeHead(200, headers);
|
|
169
169
|
res.end(JSON.stringify(context));
|
|
170
170
|
} catch (e) {
|
|
171
|
-
console.error('[
|
|
171
|
+
console.error(' [bridge] Context scan error:', e.message);
|
|
172
172
|
res.writeHead(500, headers);
|
|
173
173
|
res.end(JSON.stringify({ error: e.message }));
|
|
174
174
|
}
|
|
@@ -211,7 +211,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
211
211
|
diffs: diffResults
|
|
212
212
|
}));
|
|
213
213
|
} catch (e) {
|
|
214
|
-
console.error('[
|
|
214
|
+
console.error(' [bridge] Diff error:', e.message);
|
|
215
215
|
res.writeHead(500, headers);
|
|
216
216
|
res.end(JSON.stringify({ error: e.message }));
|
|
217
217
|
}
|
|
@@ -237,7 +237,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
237
237
|
|
|
238
238
|
// Write file with utf8 encoding
|
|
239
239
|
await fs.writeFile(fullPath, file.content, 'utf8');
|
|
240
|
-
console.log(`[
|
|
240
|
+
console.log(` [bridge] Wrote ${file.path}`);
|
|
241
241
|
written.push(file.path);
|
|
242
242
|
}
|
|
243
243
|
|
|
@@ -250,7 +250,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
250
250
|
message: `Successfully wrote ${written.length} files to ${path.basename(PROJECT_ROOT)}`
|
|
251
251
|
}));
|
|
252
252
|
} catch (e) {
|
|
253
|
-
console.error('[
|
|
253
|
+
console.error(' [bridge] Write error:', e.message);
|
|
254
254
|
res.writeHead(500, headers);
|
|
255
255
|
res.end(JSON.stringify({ error: e.message }));
|
|
256
256
|
}
|
|
@@ -266,28 +266,24 @@ const server = http.createServer(async (req, res) => {
|
|
|
266
266
|
// Gracefully handle EADDRINUSE without crashing
|
|
267
267
|
server.on('error', (err) => {
|
|
268
268
|
if (err && err.code === 'EADDRINUSE') {
|
|
269
|
-
console.log(`\n
|
|
270
|
-
console.log(
|
|
271
|
-
console.log(
|
|
272
|
-
console.log(
|
|
273
|
-
console.log(
|
|
274
|
-
console.log(`===============================================================\n`);
|
|
269
|
+
console.log(`\n Yap2App Bridge\n`);
|
|
270
|
+
console.log(` Port ${PORT} is active. Cloud Relay connected.`);
|
|
271
|
+
console.log(` Workspace: ${PROJECT_ROOT}`);
|
|
272
|
+
console.log(` Pair Code: ${PAIR_CODE}`);
|
|
273
|
+
console.log(` Web Studio: ${CLOUD_RELAY_URL}\n`);
|
|
275
274
|
return;
|
|
276
275
|
}
|
|
277
|
-
console.error('[
|
|
276
|
+
console.error(' [bridge] Error:', err.message || err);
|
|
278
277
|
});
|
|
279
278
|
|
|
280
279
|
export async function startBridge(port = PORT) {
|
|
281
280
|
server.listen(port, '0.0.0.0', () => {
|
|
282
|
-
console.log(`\n
|
|
283
|
-
console.log(
|
|
284
|
-
console.log(
|
|
285
|
-
console.log(
|
|
286
|
-
console.log(
|
|
287
|
-
console.log(
|
|
288
|
-
console.log(`š”ļø Enterprise Diff, W3C PNA & Cloud Relay Enabled`);
|
|
289
|
-
console.log(`===============================================================\n`);
|
|
290
|
-
console.log(`Ready for 1-click sync from Yap2App Web Studio UI...\n`);
|
|
281
|
+
console.log(`\n Yap2App Bridge v1.1.6\n`);
|
|
282
|
+
console.log(` Local: http://127.0.0.1:${port}`);
|
|
283
|
+
console.log(` Workspace: ${PROJECT_ROOT}`);
|
|
284
|
+
console.log(` Pair Code: ${PAIR_CODE}`);
|
|
285
|
+
console.log(` Web Studio: ${CLOUD_RELAY_URL}\n`);
|
|
286
|
+
console.log(` Ready for sync.\n`);
|
|
291
287
|
});
|
|
292
288
|
|
|
293
289
|
// Initial scan and Cloud Relay registration
|
|
@@ -299,7 +295,7 @@ export async function startBridge(port = PORT) {
|
|
|
299
295
|
project_root: PROJECT_ROOT,
|
|
300
296
|
framework: initialContext.framework,
|
|
301
297
|
context: initialContext,
|
|
302
|
-
version: '1.1.
|
|
298
|
+
version: '1.1.6'
|
|
303
299
|
});
|
|
304
300
|
} catch (e) {}
|
|
305
301
|
|
|
@@ -313,7 +309,7 @@ export async function startBridge(port = PORT) {
|
|
|
313
309
|
project_root: PROJECT_ROOT,
|
|
314
310
|
framework: context.framework,
|
|
315
311
|
context: context,
|
|
316
|
-
version: '1.1.
|
|
312
|
+
version: '1.1.6'
|
|
317
313
|
});
|
|
318
314
|
|
|
319
315
|
// If pending write tasks, fetch and execute them on local disk
|
|
@@ -326,7 +322,7 @@ export async function startBridge(port = PORT) {
|
|
|
326
322
|
const fullPath = path.join(PROJECT_ROOT, file.path);
|
|
327
323
|
await fs.mkdir(path.dirname(fullPath), { recursive: true });
|
|
328
324
|
await fs.writeFile(fullPath, file.content, 'utf8');
|
|
329
|
-
console.log(`[
|
|
325
|
+
console.log(` [bridge] Wrote ${file.path}`);
|
|
330
326
|
written.push(file.path);
|
|
331
327
|
}
|
|
332
328
|
await sendCloudRelayRequest('POST', '/api/v1/bridge/complete-write', {
|
package/mcp.js
CHANGED
|
@@ -155,7 +155,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
155
155
|
export async function runMcpServer() {
|
|
156
156
|
const transport = new StdioServerTransport();
|
|
157
157
|
await server.connect(transport);
|
|
158
|
-
console.error("
|
|
158
|
+
console.error("Yap2App MCP Server running on stdio");
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
const isDirectRun = Boolean(typeof process !== 'undefined' && process.argv && process.argv[1] && (process.argv[1].endsWith('mcp.js') || process.argv[1].endsWith('mcp')));
|