sphica 0.6.48 → 0.6.50

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "sphica",
4
- "version": "0.6.48",
4
+ "version": "0.6.50",
5
5
  "description": "Records Claude Code and Codex sessions on your machine and keeps past implementation and decisions, with their sources, for your agent to find.",
6
6
  "author": {
7
7
  "name": "iroha924",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sphica",
3
- "version": "0.6.48",
3
+ "version": "0.6.50",
4
4
  "description": "Records Claude Code and Codex sessions on your machine and keeps past implementation and decisions, with their sources, for your agent to find.",
5
5
  "author": {
6
6
  "name": "iroha924",
package/README.md CHANGED
@@ -31,7 +31,7 @@ The database is a single SQLite file on your machine.
31
31
  - **See what is live, and what needs a look.** Ask for the overview: `view: "live"` lists every active decision and constraint by the directory it applies to; `view: "look"` lists records whose file is gone or whose symbol is not found, conditions you said would bring a rejected option back, and lines in your instruction files whose record was replaced. Nothing is expired or changed on its own.
32
32
  - **See what Sphica showed your agent.** Ask what Sphica has been showing: `view: "delivery"` (with `days`, 1 to 90, 7 by default) counts the deliveries the hooks logged by event and by main agent or subagent, lists the records shown most, and gives recent sessions with each record's key, so you can judge whether each helped. It says what the log leaves out, and marks a record "named later" only when a later reply wrote its key.
33
33
  - **Track your own fields on records (trial).** Say in a session which extra field to keep on records (the affected tenant, a p95 figure); trace then saves a value only when the conversation writes it, with the quote. `/sphica:fields` shows each field and how many records carry a value.
34
- - **Share decisions as a file.** `/sphica:export` writes the live decisions you pick, with the words quoted for them and the older decisions they replaced, to a Markdown file in your repository for people who do not run Sphica. You see the whole file before it is written, and it is never committed for you.
34
+ - **Share decisions as a file.** `/sphica:export` writes the live decisions you pick, with the words quoted for them and the older decisions they replaced, to a Markdown file in your repository for people who do not run Sphica. You see the whole file before it is written, and it is never committed for you. One file holds about 29 KB, what a single reply to the agent carries whole; more decisions go into several files.
35
35
  - **Rule text from records.** `/sphica:rules` drafts lines for CLAUDE.md, AGENTS.md, or `.claude/rules` from the constraints and decisions you pick, each marked with its record key so the overview flags it once the record changes. It never edits the file.
36
36
  - **Reviews check past decisions.** `/sphica:review` runs a reviewer per focus (correctness, security, written conventions, and past decisions by default; redundancy with `full`), and checks the diff against the records it touches.
37
37
 
@@ -200,6 +200,7 @@ Run `sphica doctor` first. It shows which part is out of date or not working. Co
200
200
  - **The MCP servers report an older version.** Restart the session, or run `/reload-plugins` in Claude Code.
201
201
  - **A search finds nothing.** Search matches words. Try other words, the other language, an identifier, or fewer words. Ask the agent to check `status`: sessions not traced yet are searchable only as captured text.
202
202
  - **`doctor` says the full-text index is broken.** Run `sphica doctor --reindex`.
203
+ - **A review says Sphica's git worker would not start, or `doctor` shows it under `Git worker`.** Sphica reads your working tree with git in a folder of its own, `.sphica/git` under your home directory, and refuses to when that folder overlaps the temp directory or the working tree itself (an agent in a sandbox can write there), or is a link. `sphica doctor`, run inside the repository, says which. Until it is fixed, the check before a review cannot read your local change.
203
204
 
204
205
  ## Commands
205
206
 
package/dist/capture.js CHANGED
@@ -11159,7 +11159,7 @@ var commitDiffNames = (root, a, b, limits) => list(text(root, ["diff", ...DIFF_O
11159
11159
  var originUrl = (root, limits) => text(root, ["remote", "get-url", "origin"], limits).trim();
11160
11160
  async function worktreeStatus(root, deadline) {
11161
11161
  const out = await inIsolation(root, [{ kind: "status" }], { deadline, max: 16 * 1024 * 1024 });
11162
- return out?.[0] ?? null;
11162
+ return Array.isArray(out) ? out[0] ?? null : null;
11163
11163
  }
11164
11164
  function workerFile() {
11165
11165
  const js = path.join(import.meta.dirname, "git-worker.js");
@@ -11176,7 +11176,7 @@ function inIsolation(root, ops, { deadline, max }) {
11176
11176
  detached: process.platform !== "win32"
11177
11177
  });
11178
11178
  } catch {
11179
- resolve(null);
11179
+ resolve({ unread: "failed" });
11180
11180
  return;
11181
11181
  }
11182
11182
  const chunks = [];
@@ -11187,7 +11187,7 @@ function inIsolation(root, ops, { deadline, max }) {
11187
11187
  return;
11188
11188
  done = true;
11189
11189
  clearTimeout(timer);
11190
- if (out === null) {
11190
+ if (!Array.isArray(out)) {
11191
11191
  try {
11192
11192
  if (process.platform !== "win32" && child.pid)
11193
11193
  process.kill(-child.pid, "SIGKILL");
@@ -11202,25 +11202,30 @@ function inIsolation(root, ops, { deadline, max }) {
11202
11202
  }
11203
11203
  resolve(out);
11204
11204
  };
11205
- const timer = setTimeout(() => finish(null), deadline);
11205
+ const timer = setTimeout(() => finish({ unread: "timeout" }), deadline);
11206
11206
  const cap = 6 * max * Math.max(1, ops.length * 2) + 64 * 1024;
11207
11207
  child.stdout?.on("data", (c) => {
11208
11208
  size += c.length;
11209
11209
  if (size > cap)
11210
- finish(null);
11210
+ finish({ unread: "too_large" });
11211
11211
  else
11212
11212
  chunks.push(c);
11213
11213
  });
11214
- child.on("error", () => finish(null));
11214
+ child.on("error", () => finish({ unread: "failed" }));
11215
11215
  child.on("close", () => {
11216
11216
  try {
11217
11217
  const result = JSON.parse(Buffer.concat(chunks).toString("utf8"));
11218
- finish(result.ok ? result.out : null);
11218
+ if (result.ok)
11219
+ finish(result.out);
11220
+ else if ("refused" in result)
11221
+ finish({ unread: "refused", code: result.refused });
11222
+ else
11223
+ finish({ unread: result.failed });
11219
11224
  } catch {
11220
- finish(null);
11225
+ finish({ unread: "failed" });
11221
11226
  }
11222
11227
  });
11223
- child.stdin?.on("error", () => finish(null));
11228
+ child.stdin?.on("error", () => finish({ unread: "failed" }));
11224
11229
  child.stdin?.end(JSON.stringify({
11225
11230
  root,
11226
11231
  ops,
package/dist/cli.js CHANGED
@@ -93,6 +93,7 @@ var require_src = __commonJS(function(exports, module) {
93
93
 
94
94
  // server/src/cli.ts
95
95
  import fs11 from "node:fs";
96
+ import os4 from "node:os";
96
97
  import path11 from "node:path";
97
98
 
98
99
  // server/node_modules/@clack/core/dist/index.mjs
@@ -4193,12 +4194,26 @@ function listFiles(root, kind, { pathspecs = [], ...limits } = {}) {
4193
4194
  var originUrl = (root, limits) => text(root, ["remote", "get-url", "origin"], limits).trim();
4194
4195
  async function worktreeStatus(root, deadline) {
4195
4196
  const out = await inIsolation(root, [{ kind: "status" }], { deadline, max: 16 * 1024 * 1024 });
4196
- return out?.[0] ?? null;
4197
+ return Array.isArray(out) ? out[0] ?? null : null;
4197
4198
  }
4198
4199
  function workerFile() {
4199
4200
  const js = path2.join(import.meta.dirname, "git-worker.js");
4200
4201
  return fs2.existsSync(js) ? js : path2.join(import.meta.dirname, "git-worker.ts");
4201
4202
  }
4203
+ function refusalText(code) {
4204
+ const folder = "Sphica's git folder (.sphica/git under your home directory)";
4205
+ return {
4206
+ hooks_not_empty: `the hooks folder inside ${folder}, which Sphica keeps empty, holds files`,
4207
+ not_plain_dir: "one of Sphica's folders under your home directory (.sphica, .sphica/git, or .sphica/git/hooks) is a link or not a directory",
4208
+ outside_home: `${folder} leads out of your home directory`,
4209
+ overlaps_worktree: `${folder} overlaps this work tree, which an agent can write`,
4210
+ overlaps_tmp: `${folder} overlaps the temp directory, which an agent can write`
4211
+ }[code];
4212
+ }
4213
+ async function workerPlace(root, deadline = 5000) {
4214
+ const out = await inIsolation(root, [{ kind: "place" }], { deadline, max: 1024 });
4215
+ return Array.isArray(out) ? "ready" : out;
4216
+ }
4202
4217
  function inIsolation(root, ops, { deadline, max }) {
4203
4218
  return new Promise((resolve) => {
4204
4219
  let child;
@@ -4210,7 +4225,7 @@ function inIsolation(root, ops, { deadline, max }) {
4210
4225
  detached: process.platform !== "win32"
4211
4226
  });
4212
4227
  } catch {
4213
- resolve(null);
4228
+ resolve({ unread: "failed" });
4214
4229
  return;
4215
4230
  }
4216
4231
  const chunks = [];
@@ -4221,7 +4236,7 @@ function inIsolation(root, ops, { deadline, max }) {
4221
4236
  return;
4222
4237
  done = true;
4223
4238
  clearTimeout(timer);
4224
- if (out === null) {
4239
+ if (!Array.isArray(out)) {
4225
4240
  try {
4226
4241
  if (process.platform !== "win32" && child.pid)
4227
4242
  process.kill(-child.pid, "SIGKILL");
@@ -4236,25 +4251,30 @@ function inIsolation(root, ops, { deadline, max }) {
4236
4251
  }
4237
4252
  resolve(out);
4238
4253
  };
4239
- const timer = setTimeout(() => finish(null), deadline);
4254
+ const timer = setTimeout(() => finish({ unread: "timeout" }), deadline);
4240
4255
  const cap = 6 * max * Math.max(1, ops.length * 2) + 64 * 1024;
4241
4256
  child.stdout?.on("data", (c) => {
4242
4257
  size += c.length;
4243
4258
  if (size > cap)
4244
- finish(null);
4259
+ finish({ unread: "too_large" });
4245
4260
  else
4246
4261
  chunks.push(c);
4247
4262
  });
4248
- child.on("error", () => finish(null));
4263
+ child.on("error", () => finish({ unread: "failed" }));
4249
4264
  child.on("close", () => {
4250
4265
  try {
4251
4266
  const result = JSON.parse(Buffer.concat(chunks).toString("utf8"));
4252
- finish(result.ok ? result.out : null);
4267
+ if (result.ok)
4268
+ finish(result.out);
4269
+ else if ("refused" in result)
4270
+ finish({ unread: "refused", code: result.refused });
4271
+ else
4272
+ finish({ unread: result.failed });
4253
4273
  } catch {
4254
- finish(null);
4274
+ finish({ unread: "failed" });
4255
4275
  }
4256
4276
  });
4257
- child.stdin?.on("error", () => finish(null));
4277
+ child.stdin?.on("error", () => finish({ unread: "failed" }));
4258
4278
  child.stdin?.end(JSON.stringify({
4259
4279
  root,
4260
4280
  ops,
@@ -19195,6 +19215,16 @@ async function doctor(cwd) {
19195
19215
  runtime = false;
19196
19216
  say2("fail", "Node", plain(reason(e)));
19197
19217
  }
19218
+ const tree = fs11.lstatSync(path11.join(os4.homedir(), ".sphica"), { throwIfNoEntry: false }) ? repositoryRoot(cwd) : null;
19219
+ if (tree) {
19220
+ const place = await workerPlace(tree);
19221
+ if (place === "ready")
19222
+ say2("ok", "Git worker", "ready");
19223
+ else if (place.unread === "refused")
19224
+ say2("warn", "Git worker", `would not start: ${refusalText(place.code)}. Reviews cannot read this work tree until that changes`);
19225
+ else
19226
+ say2("warn", "Git worker", place.unread === "timeout" ? "did not answer in time" : "could not be started");
19227
+ }
19198
19228
  const file = dbFile();
19199
19229
  let usable2 = false;
19200
19230
  if (!runtime)
package/dist/deliver.js CHANGED
@@ -11474,16 +11474,32 @@ function listFiles(root, kind, { pathspecs = [], ...limits } = {}) {
11474
11474
  var originUrl = (root, limits) => text(root, ["remote", "get-url", "origin"], limits).trim();
11475
11475
  async function worktreeStatus(root, deadline) {
11476
11476
  const out = await inIsolation(root, [{ kind: "status" }], { deadline, max: 16 * 1024 * 1024 });
11477
- return out?.[0] ?? null;
11477
+ return Array.isArray(out) ? out[0] ?? null : null;
11478
11478
  }
11479
11479
  async function worktreeDiff(root, from, { max, deadline }) {
11480
11480
  const out = await inIsolation(root, [{ kind: "diff", from: objectId(from) }], { deadline, max });
11481
- return out && out.length === 2 ? { patch: out[0] ?? "", names: list(out[1] ?? "") } : null;
11481
+ if (!Array.isArray(out))
11482
+ return out;
11483
+ return out.length === 2 ? { patch: out[0] ?? "", names: list(out[1] ?? "") } : { unread: "failed" };
11482
11484
  }
11483
11485
  function workerFile() {
11484
11486
  const js = path2.join(import.meta.dirname, "git-worker.js");
11485
11487
  return fs.existsSync(js) ? js : path2.join(import.meta.dirname, "git-worker.ts");
11486
11488
  }
11489
+ function unreadOf(e) {
11490
+ const code = e?.code;
11491
+ return { unread: code === "ETIMEDOUT" ? "timeout" : code === "ENOBUFS" ? "too_large" : "failed" };
11492
+ }
11493
+ function refusalText(code) {
11494
+ const folder = "Sphica's git folder (.sphica/git under your home directory)";
11495
+ return {
11496
+ hooks_not_empty: `the hooks folder inside ${folder}, which Sphica keeps empty, holds files`,
11497
+ not_plain_dir: "one of Sphica's folders under your home directory (.sphica, .sphica/git, or .sphica/git/hooks) is a link or not a directory",
11498
+ outside_home: `${folder} leads out of your home directory`,
11499
+ overlaps_worktree: `${folder} overlaps this work tree, which an agent can write`,
11500
+ overlaps_tmp: `${folder} overlaps the temp directory, which an agent can write`
11501
+ }[code];
11502
+ }
11487
11503
  function inIsolation(root, ops, { deadline, max }) {
11488
11504
  return new Promise((resolve) => {
11489
11505
  let child;
@@ -11495,7 +11511,7 @@ function inIsolation(root, ops, { deadline, max }) {
11495
11511
  detached: process.platform !== "win32"
11496
11512
  });
11497
11513
  } catch {
11498
- resolve(null);
11514
+ resolve({ unread: "failed" });
11499
11515
  return;
11500
11516
  }
11501
11517
  const chunks = [];
@@ -11506,7 +11522,7 @@ function inIsolation(root, ops, { deadline, max }) {
11506
11522
  return;
11507
11523
  done = true;
11508
11524
  clearTimeout(timer);
11509
- if (out === null) {
11525
+ if (!Array.isArray(out)) {
11510
11526
  try {
11511
11527
  if (process.platform !== "win32" && child.pid)
11512
11528
  process.kill(-child.pid, "SIGKILL");
@@ -11521,25 +11537,30 @@ function inIsolation(root, ops, { deadline, max }) {
11521
11537
  }
11522
11538
  resolve(out);
11523
11539
  };
11524
- const timer = setTimeout(() => finish(null), deadline);
11540
+ const timer = setTimeout(() => finish({ unread: "timeout" }), deadline);
11525
11541
  const cap = 6 * max * Math.max(1, ops.length * 2) + 64 * 1024;
11526
11542
  child.stdout?.on("data", (c) => {
11527
11543
  size += c.length;
11528
11544
  if (size > cap)
11529
- finish(null);
11545
+ finish({ unread: "too_large" });
11530
11546
  else
11531
11547
  chunks.push(c);
11532
11548
  });
11533
- child.on("error", () => finish(null));
11549
+ child.on("error", () => finish({ unread: "failed" }));
11534
11550
  child.on("close", () => {
11535
11551
  try {
11536
11552
  const result = JSON.parse(Buffer.concat(chunks).toString("utf8"));
11537
- finish(result.ok ? result.out : null);
11553
+ if (result.ok)
11554
+ finish(result.out);
11555
+ else if ("refused" in result)
11556
+ finish({ unread: "refused", code: result.refused });
11557
+ else
11558
+ finish({ unread: result.failed });
11538
11559
  } catch {
11539
- finish(null);
11560
+ finish({ unread: "failed" });
11540
11561
  }
11541
11562
  });
11542
- child.stdin?.on("error", () => finish(null));
11563
+ child.stdin?.on("error", () => finish({ unread: "failed" }));
11543
11564
  child.stdin?.end(JSON.stringify({
11544
11565
  root,
11545
11566
  ops,
@@ -12966,10 +12987,8 @@ if (process.argv[1] && /capture\.(ts|js)$/.test(process.argv[1])) {
12966
12987
  main().catch(() => {});
12967
12988
  }
12968
12989
 
12969
- // server/src/read.ts
12990
+ // server/src/reply-budget.ts
12970
12991
  var READ_BUDGET = 32 * 1024;
12971
- var CONTROL_SEQUENCE = /(?:\u001b\[|\u009b)[0-?]*[ -/]*[@-~]?/;
12972
- var HIDDEN = new RegExp(`${STRING_SEQUENCE.source}|${CONTROL_SEQUENCE.source}`, "g");
12973
12992
 
12974
12993
  // server/src/review.ts
12975
12994
  var ESCAPES = { a: 7, b: 8, t: 9, n: 10, v: 11, f: 12, r: 13, '"': 34, "\\": 92 };
@@ -13144,6 +13163,13 @@ function reviewCall(input) {
13144
13163
  return null;
13145
13164
  return { name, args: typeof args === "string" ? args.slice(0, 1000) : "" };
13146
13165
  }
13166
+ function unreadText(why) {
13167
+ if (why.unread === "refused")
13168
+ return `Sphica's git worker would not start, because ${refusalText(why.code)} (run sphica doctor in this work tree)`;
13169
+ if (why.unread === "failed")
13170
+ return "the change could not be read (git failed or could not be started)";
13171
+ return "the change could not be read in time, or is too large to read (over 4 MB of diff or file names)";
13172
+ }
13147
13173
  async function localChange(root, args) {
13148
13174
  if (/^\s*#?\d+\s*$|(^|\s)#\d+\b|\/pull\/\d+/.test(args))
13149
13175
  return { problem: "it names a pull request, and Sphica sees only the local change" };
@@ -13166,15 +13192,13 @@ async function localChange(root, args) {
13166
13192
  return { problem: `HEAD shares no history with ${base}` };
13167
13193
  }
13168
13194
  const got = await worktreeDiff(root, from, { max: MAX_DIFF, deadline: left() });
13195
+ if ("unread" in got)
13196
+ return { problem: unreadText(got) };
13169
13197
  let untracked;
13170
13198
  try {
13171
- if (!got)
13172
- throw new Error("no diff");
13173
13199
  untracked = listFiles(root, "untracked", { max: MAX_DIFF, timeout: left() });
13174
- } catch {
13175
- return {
13176
- problem: "the change could not be read in time, or is too large to read (over 4 MB of diff or file names)"
13177
- };
13200
+ } catch (e) {
13201
+ return { problem: unreadText(unreadOf(e)) };
13178
13202
  }
13179
13203
  const { patch: diff, names } = got;
13180
13204
  const files = parseDiff(diff);
@@ -104,6 +104,13 @@ function configGet(root, key, limits) {
104
104
  }
105
105
 
106
106
  // server/src/git-worker.ts
107
+ class Refused extends Error {
108
+ code;
109
+ constructor(code) {
110
+ super(code);
111
+ this.code = code;
112
+ }
113
+ }
107
114
  var INDEX_LIMIT = 256 * 1024 * 1024;
108
115
  var FILE_LIMIT = 1024 * 1024;
109
116
  var STALE_MS = 60 * 60 * 1000;
@@ -114,11 +121,13 @@ var inside = (root, p) => {
114
121
  var overlap = (a, b) => inside(a, b) || inside(b, a);
115
122
  function ownDir(parent, name) {
116
123
  const dir = path2.join(parent, name);
117
- if (!fs2.existsSync(dir))
124
+ let st = fs2.lstatSync(dir, { throwIfNoEntry: false });
125
+ if (!st) {
118
126
  fs2.mkdirSync(dir, { mode: 448 });
119
- const st = fs2.lstatSync(dir);
127
+ st = fs2.lstatSync(dir);
128
+ }
120
129
  if (!st.isDirectory() || st.isSymbolicLink())
121
- throw new Error(`${dir} is not a plain directory`);
130
+ throw new Refused("not_plain_dir");
122
131
  return dir;
123
132
  }
124
133
  function isolatedHome(root) {
@@ -126,18 +135,26 @@ function isolatedHome(root) {
126
135
  const git = ownDir(ownDir(home, ".sphica"), "git");
127
136
  const hooks = ownDir(git, "hooks");
128
137
  if (fs2.readdirSync(hooks).length)
129
- throw new Error(`${hooks} is not empty`);
138
+ throw new Refused("hooks_not_empty");
130
139
  const iso = fs2.mkdtempSync(path2.join(git, "iso-"));
131
- const st = fs2.lstatSync(iso);
132
- if (!st.isDirectory() || st.isSymbolicLink())
133
- throw new Error(`${iso} is not a plain directory`);
134
- const real = fs2.realpathSync(iso);
135
- if (!inside(home, real) || real !== iso)
136
- throw new Error(`${iso} leads out of HOME`);
137
- for (const other of [root, os2.tmpdir()]) {
138
- const otherReal = fs2.realpathSync(other);
139
- if (overlap(real, otherReal) || overlap(git, otherReal))
140
- throw new Error(`${git} overlaps ${otherReal}, which an agent can write`);
140
+ try {
141
+ const st = fs2.lstatSync(iso);
142
+ if (!st.isDirectory() || st.isSymbolicLink())
143
+ throw new Refused("not_plain_dir");
144
+ const real = fs2.realpathSync(iso);
145
+ if (!inside(home, real) || real !== iso)
146
+ throw new Refused("outside_home");
147
+ for (const [other, code] of [
148
+ [root, "overlaps_worktree"],
149
+ [os2.tmpdir(), "overlaps_tmp"]
150
+ ]) {
151
+ const otherReal = fs2.realpathSync(other);
152
+ if (overlap(real, otherReal) || overlap(git, otherReal))
153
+ throw new Refused(code);
154
+ }
155
+ } catch (e) {
156
+ fs2.rmSync(iso, { recursive: true, force: true });
157
+ throw e;
141
158
  }
142
159
  return { git, iso, hooks };
143
160
  }
@@ -317,8 +334,12 @@ function work(request) {
317
334
  sweep(git);
318
335
  const remaining = () => ({ timeout: Math.max(1, Math.floor(request.until - Date.now())) });
319
336
  try {
337
+ if (request.ops.every((op) => op.kind === "place"))
338
+ return { ok: true, out: [] };
320
339
  const { env, options } = prepare(request.root, iso, hooks, remaining);
321
340
  const out = request.ops.flatMap((op) => {
341
+ if (op.kind === "place")
342
+ return [];
322
343
  const run2 = (args) => execFileSync2("git", ["-C", request.root, ...options, ...args], {
323
344
  cwd: startDir(),
324
345
  env,
@@ -340,7 +361,13 @@ function work(request) {
340
361
  fs2.rmSync(iso, { recursive: true, force: true });
341
362
  }
342
363
  } catch (e) {
343
- return { ok: false, error: e.message };
364
+ if (e instanceof Refused)
365
+ return { ok: false, refused: e.code };
366
+ const code = e.code;
367
+ return {
368
+ ok: false,
369
+ failed: code === "ETIMEDOUT" ? "timeout" : code === "ENOBUFS" ? "too_large" : "failed"
370
+ };
344
371
  }
345
372
  }
346
373
  if (process.argv[1] && path2.resolve(process.argv[1]) === path2.resolve(import.meta.filename ?? "")) {
@@ -351,7 +378,7 @@ if (process.argv[1] && path2.resolve(process.argv[1]) === path2.resolve(import.m
351
378
  try {
352
379
  request = JSON.parse(Buffer.concat(chunks).toString("utf8"));
353
380
  } catch {
354
- process.stdout.write(JSON.stringify({ ok: false, error: "the request is not JSON" }));
381
+ process.stdout.write(JSON.stringify({ ok: false, failed: "failed" }));
355
382
  return;
356
383
  }
357
384
  process.stdout.write(JSON.stringify(work(request)));