esque-bridge 0.6.4 → 0.6.5
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/index.js +22 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -476,6 +476,24 @@ app.use((req, res, next) => {
|
|
|
476
476
|
next();
|
|
477
477
|
});
|
|
478
478
|
|
|
479
|
+
// Directory identity the app binds a project to. Lets the phone detect when a
|
|
480
|
+
// project is being re-pointed at a DIFFERENT folder, or scaffolded fresh onto
|
|
481
|
+
// a folder that already has files — the two silent-mismatch foot-guns.
|
|
482
|
+
function workdirInfo() {
|
|
483
|
+
let empty = false;
|
|
484
|
+
let git = false;
|
|
485
|
+
let entries = -1;
|
|
486
|
+
try {
|
|
487
|
+
const all = fs.readdirSync(WORKDIR).filter((f) => f !== '.DS_Store');
|
|
488
|
+
entries = all.length;
|
|
489
|
+
empty = entries === 0;
|
|
490
|
+
git = all.includes('.git');
|
|
491
|
+
} catch {
|
|
492
|
+
/* unreadable dir — report unknown via -1 */
|
|
493
|
+
}
|
|
494
|
+
return { workdir: WORKDIR, workdirName: path.basename(WORKDIR), empty, git, entries };
|
|
495
|
+
}
|
|
496
|
+
|
|
479
497
|
// Public health probe.
|
|
480
498
|
app.get('/', (_req, res) => {
|
|
481
499
|
res.json({
|
|
@@ -483,8 +501,8 @@ app.get('/', (_req, res) => {
|
|
|
483
501
|
service: 'esque-bridge',
|
|
484
502
|
agent: AGENT_TYPE,
|
|
485
503
|
agentLabel: adapter.label,
|
|
486
|
-
workdir: WORKDIR,
|
|
487
504
|
sessions: Object.keys(sessionMap[AGENT_TYPE] ?? {}).length,
|
|
505
|
+
...workdirInfo(),
|
|
488
506
|
});
|
|
489
507
|
});
|
|
490
508
|
|
|
@@ -492,12 +510,13 @@ app.get('/', (_req, res) => {
|
|
|
492
510
|
// the phone includes the pair secret we validate it and report back via
|
|
493
511
|
// `paired` so the app can verify the secret BEFORE showing a green
|
|
494
512
|
// "Paired" state. `paired` is true (match), false (wrong/stale secret), or
|
|
495
|
-
// null (no secret sent — older app builds; we can't say either way).
|
|
513
|
+
// null (no secret sent — older app builds; we can't say either way). We also
|
|
514
|
+
// return workdir identity so the app can warn on a folder mismatch.
|
|
496
515
|
app.post('/', (req, res, next) => {
|
|
497
516
|
if (req.body && req.body._probe === true) {
|
|
498
517
|
const provided = req.header('x-esque-pair') || req.body?.pairSecret;
|
|
499
518
|
const paired = provided == null ? null : provided === PAIRING_SECRET;
|
|
500
|
-
return res.json({ ok: true, service: 'esque-bridge', agent: AGENT_TYPE, paired });
|
|
519
|
+
return res.json({ ok: true, service: 'esque-bridge', agent: AGENT_TYPE, paired, ...workdirInfo() });
|
|
501
520
|
}
|
|
502
521
|
return next();
|
|
503
522
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esque-bridge",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Desktop-side receiver for the Esque Agent mobile app. Pairs your phone with a local coding-agent CLI (Claude Code, Codex, Aider, or any custom command) via a tunnel + QR code, so prompts run through your subscription instead of per-token API billing.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"esque-bridge": "index.js"
|