@aayambansal/squint 0.1.3 → 0.2.0

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  cdpCapture,
4
4
  hasWebSocket
5
- } from "./chunk-ABF4QAMZ.js";
5
+ } from "./chunk-VJGE7HSP.js";
6
6
  export {
7
7
  cdpCapture,
8
8
  hasWebSocket
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  findChrome,
4
4
  screenshot
5
- } from "./chunk-MURKQ7SI.js";
6
- import "./chunk-YIVPCWSG.js";
5
+ } from "./chunk-Z46MXU64.js";
6
+ import "./chunk-MCYQXOE7.js";
7
7
  export {
8
8
  findChrome,
9
9
  screenshot
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  cdpCapture,
4
4
  hasWebSocket
5
- } from "./chunk-ABF4QAMZ.js";
5
+ } from "./chunk-VJGE7HSP.js";
6
6
  import {
7
7
  findChrome,
8
8
  screenshot
9
- } from "./chunk-MURKQ7SI.js";
9
+ } from "./chunk-Z46MXU64.js";
10
10
 
11
11
  // src/preview/preview.ts
12
12
  import fs2 from "fs";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-5IR2AZVK.js";
6
6
  import {
7
7
  runAgent
8
- } from "./chunk-MGHJSERZ.js";
8
+ } from "./chunk-FPTBBHOH.js";
9
9
  import {
10
10
  FIRST_TURN_ADDENDUM
11
11
  } from "./chunk-NT2HR4RD.js";
@@ -48,6 +48,9 @@ function detectGates(cwd) {
48
48
  }
49
49
  return gates;
50
50
  }
51
+ function detectFastGates(cwd) {
52
+ return detectGates(cwd).filter((gate) => gate.id === "typecheck" || gate.id === "lint");
53
+ }
51
54
  var TAIL_LINES = 40;
52
55
  var GATE_TIMEOUT_MS = 5 * 60 * 1e3;
53
56
  function runGate(cwd, gate) {
@@ -112,6 +115,7 @@ After fixing, the failing commands above must pass.`;
112
115
 
113
116
  export {
114
117
  detectGates,
118
+ detectFastGates,
115
119
  runGate,
116
120
  runGates,
117
121
  buildGatePrompt
@@ -3,7 +3,7 @@ import {
3
3
  findEngineBinary,
4
4
  lineSplitter,
5
5
  truncate
6
- } from "./chunk-YIVPCWSG.js";
6
+ } from "./chunk-MCYQXOE7.js";
7
7
 
8
8
  // src/runner/run.ts
9
9
  import { spawn } from "child_process";
@@ -139,6 +139,7 @@ var claude = {
139
139
  install: "npm install -g @anthropic-ai/claude-code",
140
140
  supportsResume: true,
141
141
  buildArgs(opts) {
142
+ const permissionMode = opts.mode === "plan" ? "plan" : opts.mode === "yolo" ? "bypassPermissions" : "acceptEdits";
142
143
  const args = [
143
144
  "-p",
144
145
  opts.prompt,
@@ -147,7 +148,7 @@ var claude = {
147
148
  "--verbose",
148
149
  "--include-partial-messages",
149
150
  "--permission-mode",
150
- "acceptEdits"
151
+ permissionMode
151
152
  ];
152
153
  if (opts.model) args.push("--model", opts.model);
153
154
  if (opts.sessionId) args.push("--resume", opts.sessionId);
@@ -164,9 +165,10 @@ var codex = {
164
165
  install: "npm install -g @openai/codex",
165
166
  supportsResume: true,
166
167
  buildArgs(opts) {
168
+ const sandbox = opts.mode === "plan" ? "read-only" : opts.mode === "yolo" ? "danger-full-access" : "workspace-write";
167
169
  const args = ["exec"];
168
170
  if (opts.sessionId) args.push("resume", opts.sessionId);
169
- args.push("--json", "--sandbox", "workspace-write", "--skip-git-repo-check");
171
+ args.push("--json", "--sandbox", sandbox, "--skip-git-repo-check");
170
172
  if (opts.model) args.push("--model", opts.model);
171
173
  args.push(opts.prompt);
172
174
  return args;
@@ -278,7 +280,9 @@ var cursor = {
278
280
  install: "curl https://cursor.com/install -fsS | bash",
279
281
  supportsResume: true,
280
282
  buildArgs(opts) {
281
- const args = ["-p", opts.prompt, "--output-format", "stream-json", "--force"];
283
+ const args = ["-p", opts.prompt, "--output-format", "stream-json"];
284
+ if (opts.mode === "plan") args.push("--mode", "plan");
285
+ else args.push("--force");
282
286
  if (opts.model) args.push("--model", opts.model);
283
287
  if (opts.sessionId) args.push(`--resume=${opts.sessionId}`);
284
288
  return args;
@@ -294,7 +298,8 @@ var gemini = {
294
298
  install: "npm install -g @google/gemini-cli",
295
299
  supportsResume: false,
296
300
  buildArgs(opts) {
297
- const args = ["-p", opts.prompt, "--yolo"];
301
+ const approval = opts.mode === "plan" ? "plan" : opts.mode === "yolo" ? "yolo" : "auto_edit";
302
+ const args = ["-p", opts.prompt, "--approval-mode", approval];
298
303
  if (opts.model) args.push("-m", opts.model);
299
304
  return args;
300
305
  }
@@ -394,7 +399,6 @@ function detectEngines() {
394
399
  export {
395
400
  lineSplitter,
396
401
  truncate,
397
- engines,
398
402
  getEngine,
399
403
  findBinary,
400
404
  findEngineBinary,
@@ -113,7 +113,7 @@ function launchChrome(chromePath) {
113
113
  [
114
114
  "--headless=new",
115
115
  "--disable-gpu",
116
- ...process.env.CI ? ["--no-sandbox"] : [],
116
+ ...process.env.CI ? ["--no-sandbox", "--disable-dev-shm-usage"] : [],
117
117
  "--no-first-run",
118
118
  "--remote-debugging-port=0",
119
119
  `--user-data-dir=${profileDir}`,
@@ -122,10 +122,13 @@ function launchChrome(chromePath) {
122
122
  { stdio: ["ignore", "ignore", "pipe"] }
123
123
  );
124
124
  let stderr = "";
125
- const timer = setTimeout(() => {
126
- child.kill("SIGKILL");
127
- reject(new Error("Chrome did not announce DevTools endpoint"));
128
- }, 15e3);
125
+ const timer = setTimeout(
126
+ () => {
127
+ child.kill("SIGKILL");
128
+ reject(new Error("Chrome did not announce DevTools endpoint"));
129
+ },
130
+ process.env.CI ? 45e3 : 15e3
131
+ );
129
132
  child.stderr.setEncoding("utf8");
130
133
  child.stderr.on("data", (chunk) => {
131
134
  stderr += chunk;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  findBinary
4
- } from "./chunk-YIVPCWSG.js";
4
+ } from "./chunk-MCYQXOE7.js";
5
5
 
6
6
  // src/preview/chrome.ts
7
7
  import { spawn } from "child_process";
@@ -34,8 +34,8 @@ function screenshot(chromePath, url, outPath, opts) {
34
34
  const args = [
35
35
  "--headless=new",
36
36
  "--disable-gpu",
37
- // CI runners commonly need this; local runs keep the sandbox.
38
- ...process.env.CI ? ["--no-sandbox"] : [],
37
+ // CI containers need these; local runs keep the sandbox and shm.
38
+ ...process.env.CI ? ["--no-sandbox", "--disable-dev-shm-usage"] : [],
39
39
  "--hide-scrollbars",
40
40
  "--force-device-scale-factor=1",
41
41
  `--window-size=${opts.width},${opts.height}`,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  lineSplitter
4
- } from "./chunk-YIVPCWSG.js";
4
+ } from "./chunk-MCYQXOE7.js";
5
5
 
6
6
  // src/devserver/devserver.ts
7
7
  import { spawn } from "child_process";