@alook/daemon 0.1.3 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +13 -7
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -25253,7 +25253,7 @@ async function createDaemon(opts) {
25253
25253
  };
25254
25254
  }
25255
25255
  // src/diagnostics/snapshotReader.ts
25256
- import { closeSync as closeSync3, constants as constants3, fstatSync as fstatSync3, openSync as openSync3, readSync as readSync2 } from "node:fs";
25256
+ import { closeSync as closeSync3, constants as constants3, fstatSync as fstatSync3, lstatSync as lstatSync4, openSync as openSync3, readSync as readSync2 } from "node:fs";
25257
25257
  function pushWarning(warnings, warning) {
25258
25258
  warnings.push(warning);
25259
25259
  }
@@ -25403,6 +25403,12 @@ async function readPinnedJsonFile(args) {
25403
25403
  let fd = null;
25404
25404
  try {
25405
25405
  const noFollow = "O_NOFOLLOW" in constants3 ? constants3.O_NOFOLLOW : 0;
25406
+ if (process.platform === "win32" || noFollow === 0) {
25407
+ const preopenStat = lstatSync4(args.path);
25408
+ if (!preopenStat.isFile() || preopenStat.isSymbolicLink()) {
25409
+ return { value: null, warnings: ["source_unavailable"] };
25410
+ }
25411
+ }
25406
25412
  fd = openSync3(args.path, constants3.O_RDONLY | noFollow);
25407
25413
  const stat = fstatSync3(fd);
25408
25414
  if (!stat.isFile())
@@ -25982,7 +25988,7 @@ import {
25982
25988
  createReadStream,
25983
25989
  existsSync as existsSync7,
25984
25990
  fsyncSync as fsyncSync2,
25985
- lstatSync as lstatSync4,
25991
+ lstatSync as lstatSync5,
25986
25992
  mkdirSync as mkdirSync8,
25987
25993
  openSync as openSync4,
25988
25994
  readFileSync as readFileSync6,
@@ -26069,7 +26075,7 @@ function createDiagnosticReportCoordinator(args) {
26069
26075
  const sidecarPath = (reportId) => join12(dir, `report-${reportId}.json`);
26070
26076
  const ensureDir = () => {
26071
26077
  if (existsSync7(dir)) {
26072
- const stat = lstatSync4(dir);
26078
+ const stat = lstatSync5(dir);
26073
26079
  if (!stat.isDirectory() || stat.isSymbolicLink())
26074
26080
  throw new CoordinatorError("local_artifact_invalid");
26075
26081
  if (process.platform !== "win32")
@@ -26085,7 +26091,7 @@ function createDiagnosticReportCoordinator(args) {
26085
26091
  };
26086
26092
  const removeExact = (path11) => {
26087
26093
  try {
26088
- const stat = lstatSync4(path11);
26094
+ const stat = lstatSync5(path11);
26089
26095
  if (stat.isFile() && !stat.isSymbolicLink())
26090
26096
  unlinkSync6(path11);
26091
26097
  } catch {}
@@ -26127,7 +26133,7 @@ function createDiagnosticReportCoordinator(args) {
26127
26133
  const committedArchive = (reportId) => {
26128
26134
  const path11 = archivePath(reportId);
26129
26135
  try {
26130
- const stat = lstatSync4(path11);
26136
+ const stat = lstatSync5(path11);
26131
26137
  if (!stat.isFile() || stat.isSymbolicLink())
26132
26138
  return null;
26133
26139
  const bytes = readFileSync6(path11);
@@ -26220,7 +26226,7 @@ function createDiagnosticReportCoordinator(args) {
26220
26226
  const temp = join12(dir, `.${command.reportId}.archive.${fsOps.randomSuffix()}.tmp`);
26221
26227
  const artifact2 = await args.buildBundle({ command, outputPath: temp });
26222
26228
  checkpoint("archive_temp_written");
26223
- const fd = fsOps.open(artifact2.path, "r");
26229
+ const fd = fsOps.open(artifact2.path, "r+");
26224
26230
  try {
26225
26231
  fsOps.fsync(fd);
26226
26232
  checkpoint("archive_temp_fsynced");
@@ -26257,7 +26263,7 @@ function createDiagnosticReportCoordinator(args) {
26257
26263
  const readSidecar = (reportId) => {
26258
26264
  const path11 = sidecarPath(reportId);
26259
26265
  try {
26260
- const stat = lstatSync4(path11);
26266
+ const stat = lstatSync5(path11);
26261
26267
  if (!stat.isFile() || stat.isSymbolicLink())
26262
26268
  return null;
26263
26269
  return parseSidecar(JSON.parse(readFileSync6(path11, "utf8")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alook/daemon",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Alook agent daemon — host-side runtime backend, process manager, credential proxy, and control plane.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/alookai/alook#readme",