@lucenaone/coder 1.1.0 → 1.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucenaone/coder",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Private tunnel for connecting LucenaCoder.com to your local folder. Always remains folder scoped while providing full terminal access.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/agent.js CHANGED
@@ -130,10 +130,9 @@ export class LucenaAgent {
130
130
  if (!data) return;
131
131
  remove(snapshot.ref);
132
132
 
133
- // Wait for indexing to finish if it hasn't yet
134
- const index = await this.indexPromise;
135
- if (index) {
136
- this.pushIndexSnapshot(index);
133
+ // Index is guaranteed ready (awaited in start()), push immediately
134
+ if (this.indexData) {
135
+ this.pushIndexSnapshot(this.indexData);
137
136
  }
138
137
  });
139
138
 
@@ -152,6 +151,11 @@ export class LucenaAgent {
152
151
 
153
152
  this.startWatcher();
154
153
  this.connected = true;
154
+
155
+ // ── Wait for indexing to finish before opening the browser ──
156
+ // This guarantees the snapshot is ready the instant the browser connects
157
+ await this.indexPromise;
158
+
155
159
  return this.tunnelId;
156
160
  }
157
161
 
@@ -373,4 +377,4 @@ export class LucenaAgent {
373
377
 
374
378
  this.connected = false;
375
379
  }
376
- }
380
+ }
package/src/main.js CHANGED
@@ -42,8 +42,6 @@ export async function main() {
42
42
  console.log(` ${c.cyan}📍 Scoped to:${c.reset} ${cwd}`);
43
43
  console.log(` ${c.yellow}🛡️ Safe Mode:${c.reset} ON by default (All edits require approval)`);
44
44
  console.log(` ${c.dim}Optionally switch to YOLO on LucenaCoder.com${c.reset}\n`);
45
- console.log(` ${c.dim}⏳ Indexing workspace...${c.reset}`);
46
- console.log(` Starting tunnel...`);
47
45
 
48
46
  const agent = new LucenaAgent(cwd);
49
47
 
@@ -57,8 +55,10 @@ export async function main() {
57
55
  process.on('SIGTERM', shutdown);
58
56
 
59
57
  try {
58
+ console.log(` ${c.dim}⏳ Indexing workspace...${c.reset}`);
60
59
  const tunnelId = await agent.start();
61
- console.log(`\n ${c.green}✔ Tunnel active!${c.reset}\n`);
60
+ console.log(` ${c.green}✔ Indexed${c.reset}\n`);
61
+ console.log(` ${c.green}✔ Tunnel active!${c.reset}\n`);
62
62
 
63
63
  const idLabel = "Tunnel ID:";
64
64
  const boxWidth = idLabel.length + tunnelId.length + 5;
@@ -82,4 +82,4 @@ export async function main() {
82
82
  console.error(`\n ${c.yellow}✖ Failed to start tunnel: ${err.message}${c.reset}\n`);
83
83
  process.exit(1);
84
84
  }
85
- }
85
+ }