@aayambansal/squint 0.4.5 → 0.4.7

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.
@@ -7,7 +7,7 @@ import {
7
7
  loadLocks,
8
8
  loadRules,
9
9
  loadSkills
10
- } from "./chunk-ZLEP2TWF.js";
10
+ } from "./chunk-ARDV4XH6.js";
11
11
  import {
12
12
  loadBrief
13
13
  } from "./chunk-WAJXATCO.js";
@@ -10,11 +10,11 @@ import {
10
10
  probeRuntime,
11
11
  routeShotName,
12
12
  runtimeSummary
13
- } from "./chunk-CV5WVKHU.js";
14
- import "./chunk-O2S6PAJE.js";
13
+ } from "./chunk-ZSDCMYZR.js";
14
+ import "./chunk-7CAGWFAQ.js";
15
+ import "./chunk-HC4E42SV.js";
15
16
  import "./chunk-IMDRXXFU.js";
16
17
  import "./chunk-KVYGPLWW.js";
17
- import "./chunk-RQHOE5MV.js";
18
18
  export {
19
19
  VIEWPORTS,
20
20
  buildReviewPrompt,
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ connectDaemon,
4
+ socketPath
5
+ } from "./chunk-NX7XQY2X.js";
6
+ import "./chunk-7MOKOZOR.js";
7
+ import "./chunk-ARDV4XH6.js";
8
+ import "./chunk-AUJJGMZG.js";
9
+ import "./chunk-YHRAOBI2.js";
10
+ import "./chunk-QCHBDP46.js";
11
+ import "./chunk-YGSF2TSO.js";
12
+ import "./chunk-VH7OOFQP.js";
13
+ import "./chunk-K5QJMSJH.js";
14
+ import "./chunk-WAJXATCO.js";
15
+ import "./chunk-62JNF5M2.js";
16
+ import "./chunk-ZSDCMYZR.js";
17
+ import "./chunk-7CAGWFAQ.js";
18
+ import "./chunk-HC4E42SV.js";
19
+ import "./chunk-IMDRXXFU.js";
20
+ import "./chunk-KVYGPLWW.js";
21
+
22
+ // src/daemon/remote.ts
23
+ var noteId = 0;
24
+ var RemoteSession = class _RemoteSession {
25
+ constructor(client, engineId) {
26
+ this.client = client;
27
+ this.state = {
28
+ items: [],
29
+ liveText: "",
30
+ running: false,
31
+ runStartedAt: 0,
32
+ engineId,
33
+ devState: "stopped",
34
+ devUrl: null,
35
+ totals: { turns: 0, costUsd: 0 },
36
+ queue: [],
37
+ mode: "safe",
38
+ problems: [],
39
+ sandbox: false
40
+ };
41
+ client.onMessage((msg) => {
42
+ if (msg.type === "state" && msg.state) {
43
+ this.state = msg.state;
44
+ this.emit();
45
+ } else if (msg.type === "hello") {
46
+ this.role = msg.role === "observer" ? "observer" : "driver";
47
+ if (msg.role === "driver" && Date.now() - this.attachedAt > 1e3) {
48
+ this.overlay("the driver detached \u2014 this terminal now steers");
49
+ }
50
+ } else if (msg.type === "denied") {
51
+ this.overlay(String(msg.reason ?? "observer \u2014 read-only"));
52
+ }
53
+ });
54
+ }
55
+ client;
56
+ state;
57
+ listeners = /* @__PURE__ */ new Set();
58
+ attachedAt = Date.now();
59
+ role = "driver";
60
+ static async connect(cwd) {
61
+ const client = await connectDaemon(socketPath(cwd));
62
+ return new Promise((resolve, reject) => {
63
+ const timer = setTimeout(() => reject(new Error("daemon never said hello")), 3e3);
64
+ const session = new _RemoteSession(client, "unknown");
65
+ client.onMessage((msg) => {
66
+ if (msg.type === "hello") {
67
+ clearTimeout(timer);
68
+ session.state = { ...session.state, engineId: String(msg.engineId ?? "unknown") };
69
+ resolve(session);
70
+ }
71
+ });
72
+ });
73
+ }
74
+ emit() {
75
+ for (const listener of this.listeners) listener();
76
+ }
77
+ /** Local-only status line layered onto the current snapshot. */
78
+ overlay(text) {
79
+ this.state = {
80
+ ...this.state,
81
+ items: [...this.state.items, { id: 1e6 + ++noteId, role: "status", text }]
82
+ };
83
+ this.emit();
84
+ }
85
+ subscribe(listener) {
86
+ this.listeners.add(listener);
87
+ return () => this.listeners.delete(listener);
88
+ }
89
+ getState() {
90
+ return this.state;
91
+ }
92
+ input(raw) {
93
+ this.client.send({ type: "input", text: raw });
94
+ }
95
+ interrupt() {
96
+ this.client.send({ type: "interrupt" });
97
+ }
98
+ cycleMode() {
99
+ this.client.send({ type: "cycleMode" });
100
+ }
101
+ note(text) {
102
+ this.overlay(text);
103
+ }
104
+ summary() {
105
+ const mins = Math.max(1, Math.round((Date.now() - this.attachedAt) / 6e4));
106
+ return `detached after ${mins}m \u2014 the session keeps running (squint attach rejoins)`;
107
+ }
108
+ dispose() {
109
+ this.client.close();
110
+ }
111
+ };
112
+ export {
113
+ RemoteSession
114
+ };
@@ -7,7 +7,7 @@ import {
7
7
  sandboxDir,
8
8
  sandboxExists,
9
9
  sandboxFiles
10
- } from "./chunk-XEQ6JXXL.js";
10
+ } from "./chunk-AUJJGMZG.js";
11
11
  export {
12
12
  applySandbox,
13
13
  discardSandbox,
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-QCHBDP46.js";
5
5
  import "./chunk-YGSF2TSO.js";
6
6
  import "./chunk-VH7OOFQP.js";
7
- import "./chunk-IMDRXXFU.js";
8
- import "./chunk-KVYGPLWW.js";
9
7
  import "./chunk-K5QJMSJH.js";
10
8
  import "./chunk-WAJXATCO.js";
9
+ import "./chunk-IMDRXXFU.js";
10
+ import "./chunk-KVYGPLWW.js";
11
11
  export {
12
12
  screenshotVariants
13
13
  };
@@ -6,7 +6,7 @@ import {
6
6
  loadSkills,
7
7
  matchSkills,
8
8
  parseSkill
9
- } from "./chunk-ZLEP2TWF.js";
9
+ } from "./chunk-ARDV4XH6.js";
10
10
  export {
11
11
  enrich,
12
12
  loadLocks,
@@ -4,7 +4,7 @@ import {
4
4
  ensureSquintIgnore,
5
5
  loadState,
6
6
  saveState
7
- } from "./chunk-O2S6PAJE.js";
7
+ } from "./chunk-7CAGWFAQ.js";
8
8
  export {
9
9
  clearState,
10
10
  ensureSquintIgnore,
@@ -11,9 +11,9 @@ import {
11
11
  variantsRoot
12
12
  } from "./chunk-YGSF2TSO.js";
13
13
  import "./chunk-VH7OOFQP.js";
14
- import "./chunk-KVYGPLWW.js";
15
14
  import "./chunk-K5QJMSJH.js";
16
15
  import "./chunk-WAJXATCO.js";
16
+ import "./chunk-KVYGPLWW.js";
17
17
  export {
18
18
  MAX_VARIANTS,
19
19
  applyVariant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aayambansal/squint",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Lovable for your terminal \u2014 a frontend harness on top of Claude Code, Codex, and other coding agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",