sphica 0.6.66 → 0.6.67

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.66",
4
+ "version": "0.6.67",
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.66",
3
+ "version": "0.6.67",
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/dist/capture.js CHANGED
@@ -12026,7 +12026,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
12026
12026
  import fs5 from "node:fs";
12027
12027
  import os3 from "node:os";
12028
12028
  import path5 from "node:path";
12029
- function markOnce(kind, key) {
12029
+ function marksDir() {
12030
12030
  const user = (() => {
12031
12031
  try {
12032
12032
  return os3.userInfo().username;
@@ -12034,9 +12034,25 @@ function markOnce(kind, key) {
12034
12034
  return String(process.getuid?.() ?? "user");
12035
12035
  }
12036
12036
  })();
12037
- const dir = path5.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`, kind);
12037
+ return path5.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`);
12038
+ }
12039
+ function ours(dir) {
12040
+ if (process.platform === "win32" || !process.getuid)
12041
+ return true;
12042
+ const st = fs5.lstatSync(dir);
12043
+ return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
12044
+ }
12045
+ function markOnce(kind, key) {
12046
+ const top = marksDir();
12047
+ const dir = path5.join(top, kind);
12038
12048
  try {
12039
12049
  fs5.mkdirSync(dir, { recursive: true, mode: 448 });
12050
+ if (!ours(top))
12051
+ return true;
12052
+ } catch {
12053
+ return true;
12054
+ }
12055
+ try {
12040
12056
  fs5.writeFileSync(path5.join(dir, sha256(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
12041
12057
  return true;
12042
12058
  } catch (e) {
package/dist/cli.js CHANGED
@@ -16406,7 +16406,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
16406
16406
  import fs7 from "node:fs";
16407
16407
  import os4 from "node:os";
16408
16408
  import path7 from "node:path";
16409
- function markOnce(kind, key) {
16409
+ function marksDir() {
16410
16410
  const user = (() => {
16411
16411
  try {
16412
16412
  return os4.userInfo().username;
@@ -16414,9 +16414,25 @@ function markOnce(kind, key) {
16414
16414
  return String(process.getuid?.() ?? "user");
16415
16415
  }
16416
16416
  })();
16417
- const dir = path7.join(os4.tmpdir(), `sphica-${sha2562(user).toString("hex").slice(0, 12)}`, kind);
16417
+ return path7.join(os4.tmpdir(), `sphica-${sha2562(user).toString("hex").slice(0, 12)}`);
16418
+ }
16419
+ function ours(dir) {
16420
+ if (process.platform === "win32" || !process.getuid)
16421
+ return true;
16422
+ const st = fs7.lstatSync(dir);
16423
+ return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
16424
+ }
16425
+ function markOnce(kind, key) {
16426
+ const top = marksDir();
16427
+ const dir = path7.join(top, kind);
16418
16428
  try {
16419
16429
  fs7.mkdirSync(dir, { recursive: true, mode: 448 });
16430
+ if (!ours(top))
16431
+ return true;
16432
+ } catch {
16433
+ return true;
16434
+ }
16435
+ try {
16420
16436
  fs7.writeFileSync(path7.join(dir, sha2562(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
16421
16437
  return true;
16422
16438
  } catch (e) {
package/dist/deliver.js CHANGED
@@ -12124,7 +12124,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
12124
12124
  import fs5 from "node:fs";
12125
12125
  import os3 from "node:os";
12126
12126
  import path6 from "node:path";
12127
- function markOnce(kind, key) {
12127
+ function marksDir() {
12128
12128
  const user = (() => {
12129
12129
  try {
12130
12130
  return os3.userInfo().username;
@@ -12132,9 +12132,25 @@ function markOnce(kind, key) {
12132
12132
  return String(process.getuid?.() ?? "user");
12133
12133
  }
12134
12134
  })();
12135
- const dir = path6.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`, kind);
12135
+ return path6.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`);
12136
+ }
12137
+ function ours(dir) {
12138
+ if (process.platform === "win32" || !process.getuid)
12139
+ return true;
12140
+ const st = fs5.lstatSync(dir);
12141
+ return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
12142
+ }
12143
+ function markOnce(kind, key) {
12144
+ const top = marksDir();
12145
+ const dir = path6.join(top, kind);
12136
12146
  try {
12137
12147
  fs5.mkdirSync(dir, { recursive: true, mode: 448 });
12148
+ if (!ours(top))
12149
+ return true;
12150
+ } catch {
12151
+ return true;
12152
+ }
12153
+ try {
12138
12154
  fs5.writeFileSync(path6.join(dir, sha256(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
12139
12155
  return true;
12140
12156
  } catch (e) {
@@ -46974,7 +46974,7 @@ var sessionId = (projectId, host, externalId) => uuidFrom(String(projectId), hos
46974
46974
  import fs5 from "node:fs";
46975
46975
  import os3 from "node:os";
46976
46976
  import path5 from "node:path";
46977
- function markOnce(kind, key) {
46977
+ function marksDir() {
46978
46978
  const user = (() => {
46979
46979
  try {
46980
46980
  return os3.userInfo().username;
@@ -46982,9 +46982,25 @@ function markOnce(kind, key) {
46982
46982
  return String(process.getuid?.() ?? "user");
46983
46983
  }
46984
46984
  })();
46985
- const dir = path5.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`, kind);
46985
+ return path5.join(os3.tmpdir(), `sphica-${sha256(user).toString("hex").slice(0, 12)}`);
46986
+ }
46987
+ function ours(dir) {
46988
+ if (process.platform === "win32" || !process.getuid)
46989
+ return true;
46990
+ const st = fs5.lstatSync(dir);
46991
+ return st.isDirectory() && st.uid === process.getuid() && (st.mode & 63) === 0;
46992
+ }
46993
+ function markOnce(kind, key) {
46994
+ const top = marksDir();
46995
+ const dir = path5.join(top, kind);
46986
46996
  try {
46987
46997
  fs5.mkdirSync(dir, { recursive: true, mode: 448 });
46998
+ if (!ours(top))
46999
+ return true;
47000
+ } catch {
47001
+ return true;
47002
+ }
47003
+ try {
46988
47004
  fs5.writeFileSync(path5.join(dir, sha256(key).toString("hex").slice(0, 24)), "", { flag: "wx" });
46989
47005
  return true;
46990
47006
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sphica",
3
- "version": "0.6.66",
3
+ "version": "0.6.67",
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
  "license": "MIT",
6
6
  "type": "module",