@skylandnpm/octopus-proxy 0.1.67 → 0.1.68

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.
@@ -7819,12 +7819,16 @@ import { join as join16 } from "node:path";
7819
7819
  // src/workspace-diff.ts
7820
7820
  import { execFile as execFile2 } from "node:child_process";
7821
7821
  import { promisify as promisify2 } from "node:util";
7822
- import { realpath } from "node:fs/promises";
7822
+ import { realpath, stat as stat3 } from "node:fs/promises";
7823
7823
  import { relative, resolve } from "node:path";
7824
7824
  var execute = promisify2(execFile2);
7825
7825
  var MAX_PATCH = 256 * 1024;
7826
7826
  var MAX_TOTAL = 1024 * 1024;
7827
- async function workspaceDiff(workspace, project) {
7827
+ var MAX_LINES = 2e3;
7828
+ async function workspaceDiff(workspace, project, page = {}) {
7829
+ const offset = page.paged ? page.offset ?? 0 : 0;
7830
+ const limit = page.paged ? page.limit ?? 20 : 200;
7831
+ if (!Number.isSafeInteger(offset) || offset < 0 || !Number.isSafeInteger(limit) || limit < 1 || limit > 200) throw new Error("Invalid diff page");
7828
7832
  const root = await workspace.root(project);
7829
7833
  const git = async (...args) => (await execute("git", ["--no-optional-locks", "-c", "core.quotePath=false", ...args], {
7830
7834
  cwd: root,
@@ -7868,13 +7872,8 @@ async function workspaceDiff(workspace, project) {
7868
7872
  if (!base) throw new Error("\u65E0\u6CD5\u8BFB\u53D6 Git \u6BD4\u8F83\u57FA\u51C6");
7869
7873
  const files = [];
7870
7874
  let bytes = 0;
7871
- for (const entry of entries.slice(0, 200)) {
7875
+ for (const entry of entries.slice(offset, offset + limit)) {
7872
7876
  const change = { ...entry, patch: "", additions: 0, deletions: 0 };
7873
- if (bytes >= MAX_TOTAL) {
7874
- change.notice = "\u53D8\u66F4\u8F83\u591A\uFF0C\u672A\u52A0\u8F7D\u6B64\u6587\u4EF6\u5185\u5BB9";
7875
- files.push(change);
7876
- continue;
7877
- }
7878
7877
  try {
7879
7878
  if (entry.status === "??") {
7880
7879
  const read = await workspace.read(project, entry.file, 0, MAX_PATCH);
@@ -7891,16 +7890,30 @@ ${lines.map((line) => `+${line}`).join("\n")}
7891
7890
  `;
7892
7891
  }
7893
7892
  } else {
7894
- change.patch = await git("diff", "--no-ext-diff", "--no-textconv", "--no-renames", "--no-color", "--relative", "--unified=3", base, "--", entry.file);
7895
- change.binary = change.patch.includes("Binary files ");
7896
- if (Buffer.byteLength(change.patch) > MAX_PATCH) {
7897
- change.patch = "";
7898
- change.notice = "\u5DEE\u5F02\u8FC7\u5927\uFF0C\u8BF7\u5728\u672C\u5730 Git \u67E5\u770B";
7893
+ let currentSize = 0, baseSize = 0;
7894
+ try {
7895
+ currentSize = (await stat3(await workspace.path(project, entry.file))).size;
7896
+ } catch (error) {
7897
+ if (error.code !== "ENOENT") throw error;
7898
+ }
7899
+ try {
7900
+ baseSize = Number((await git("cat-file", "-s", `${base}:${prefix ? `${prefix}/` : ""}${entry.file}`)).trim());
7901
+ } catch {
7902
+ }
7903
+ if (Math.max(currentSize, baseSize) > MAX_PATCH) change.notice = "\u6587\u4EF6\u8D85\u8FC7 256 KiB\uFF0C\u672A\u52A0\u8F7D\u5DEE\u5F02\uFF0C\u8BF7\u5728\u6587\u4EF6\u9762\u677F\u6216\u672C\u5730 Git \u67E5\u770B";
7904
+ else {
7905
+ change.patch = await git("diff", "--no-ext-diff", "--no-textconv", "--no-renames", "--no-color", "--relative", "--unified=3", base, "--", entry.file);
7906
+ change.binary = change.patch.includes("Binary files ");
7899
7907
  }
7900
7908
  }
7901
7909
  } catch (error) {
7902
7910
  change.notice = error instanceof Error ? error.message.slice(0, 250) : "\u65E0\u6CD5\u52A0\u8F7D\u6587\u4EF6\u5DEE\u5F02";
7903
7911
  }
7912
+ if (Buffer.byteLength(change.patch) > MAX_PATCH || change.patch.split("\n").length > MAX_LINES) {
7913
+ change.patch = "";
7914
+ change.notice = "\u5DEE\u5F02\u8D85\u8FC7 256 KiB \u6216 2000 \u884C\uFF0C\u672A\u52A0\u8F7D\u5DEE\u5F02\uFF0C\u8BF7\u5728\u672C\u5730 Git \u67E5\u770B";
7915
+ }
7916
+ if (bytes + Buffer.byteLength(change.patch) > MAX_TOTAL) break;
7904
7917
  let inHunk = false;
7905
7918
  for (const line of change.patch.split("\n")) {
7906
7919
  if (line.startsWith("@@ ")) inHunk = true;
@@ -7910,12 +7923,13 @@ ${lines.map((line) => `+${line}`).join("\n")}
7910
7923
  bytes += Buffer.byteLength(change.patch);
7911
7924
  files.push(change);
7912
7925
  }
7913
- return { scope: "workspace", files, total: entries.length, truncated: entries.length > 200 || files.some((file) => file.notice), directory: prefix || ".", capturedAt: Date.now() };
7926
+ const nextOffset = offset + files.length < entries.length ? offset + files.length : void 0;
7927
+ return { scope: "workspace", files, total: entries.length, nextOffset, truncated: nextOffset !== void 0 || files.some((file) => file.notice), directory: prefix || ".", capturedAt: Date.now() };
7914
7928
  }
7915
7929
 
7916
7930
  // src/workspace.ts
7917
7931
  import { constants } from "node:fs";
7918
- import { mkdir as mkdir2, open as open2, readdir, realpath as realpath2, stat as stat3, link, unlink as unlink3 } from "node:fs/promises";
7932
+ import { mkdir as mkdir2, open as open2, readdir, realpath as realpath2, stat as stat4, link, unlink as unlink3 } from "node:fs/promises";
7919
7933
  import { basename, dirname, extname, isAbsolute as isAbsolute2, relative as relative2, resolve as resolve2, sep } from "node:path";
7920
7934
  import { createHash as createHash2 } from "node:crypto";
7921
7935
  var mimeOf = (name) => ({ ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".webp": "image/webp", ".svg": "image/svg+xml", ".md": "text/markdown", ".txt": "text/plain", ".json": "application/json", ".pdf": "application/pdf" })[extname(name).toLowerCase()] ?? "application/octet-stream";
@@ -7950,7 +7964,7 @@ var Workspace = class {
7950
7964
  const name = relative2(await this.root(id), resolve2(full, e.name));
7951
7965
  try {
7952
7966
  const safe = await this.path(id, name);
7953
- const info = await stat3(safe);
7967
+ const info = await stat4(safe);
7954
7968
  return { name: e.name, path: name, type: info.isDirectory() ? "directory" : "file", size: info.size };
7955
7969
  } catch {
7956
7970
  return null;
@@ -8047,7 +8061,7 @@ var Workspace = class {
8047
8061
 
8048
8062
  // src/uploads.ts
8049
8063
  import { constants as constants2 } from "node:fs";
8050
- import { open as open3, readdir as readdir2, unlink as unlink4, stat as stat4 } from "node:fs/promises";
8064
+ import { open as open3, readdir as readdir2, unlink as unlink4, stat as stat5 } from "node:fs/promises";
8051
8065
  import { basename as basename2, dirname as dirname3, join as join4 } from "node:path";
8052
8066
  import { createHash as createHash3, randomUUID as randomUUID4 } from "node:crypto";
8053
8067
 
@@ -8106,7 +8120,7 @@ var Uploads = class {
8106
8120
  if (!u || u.projectId !== projectId) throw new Error("Upload not found in this project");
8107
8121
  if (u.state === "pending" && u.offset === u.size) {
8108
8122
  try {
8109
- await stat4(u.temp);
8123
+ await stat5(u.temp);
8110
8124
  } catch (e) {
8111
8125
  if (e.code !== "ENOENT") throw e;
8112
8126
  const target = await this.workspace.path(projectId, u.destination);
@@ -8131,7 +8145,7 @@ var Uploads = class {
8131
8145
  } else destination = `${String(input.directory ?? ".")}/${name}`;
8132
8146
  const dest = await this.workspace.path(projectId, destination, true);
8133
8147
  try {
8134
- await stat4(dest);
8148
+ await stat5(dest);
8135
8149
  throw new Error("Destination exists; rename the file");
8136
8150
  } catch (e) {
8137
8151
  if (e.code !== "ENOENT") throw e;
@@ -8514,7 +8528,7 @@ function pageHistory(input, payload) {
8514
8528
  // src/artifacts.ts
8515
8529
  import { createHash as createHash5 } from "node:crypto";
8516
8530
  import { join as join6 } from "node:path";
8517
- import { readFile as readFile4, writeFile as writeFile3, mkdir as mkdir4, stat as stat5 } from "node:fs/promises";
8531
+ import { readFile as readFile4, writeFile as writeFile3, mkdir as mkdir4, stat as stat6 } from "node:fs/promises";
8518
8532
  var Artifacts = class {
8519
8533
  constructor(workspace, directory, emit) {
8520
8534
  this.workspace = workspace;
@@ -8538,6 +8552,12 @@ var Artifacts = class {
8538
8552
  scan(project) {
8539
8553
  return this.serial(project, () => this.scanUnlocked(project));
8540
8554
  }
8555
+ async scanPage(project, offset = 0, limit = 20) {
8556
+ if (!Number.isSafeInteger(offset) || offset < 0 || !Number.isSafeInteger(limit) || limit < 1 || limit > 200) throw new Error("Invalid artifact page");
8557
+ const all = (await this.scan(project)).sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
8558
+ const items = all.slice(offset, offset + limit).map((item) => ({ ...item, revisions: item.revisions.slice(-1) }));
8559
+ return { items, total: all.length, nextOffset: offset + items.length < all.length ? offset + items.length : void 0 };
8560
+ }
8541
8561
  async scanUnlocked(project) {
8542
8562
  await this.workspace.root(project);
8543
8563
  const index = await readJson(this.index(project)) ?? {}, seen = /* @__PURE__ */ new Set();
@@ -8586,7 +8606,7 @@ var Artifacts = class {
8586
8606
  }
8587
8607
  for (const item of Object.values(index)) if (!seen.has(item.path) && !item.revisions.at(-1)?.deleted) {
8588
8608
  try {
8589
- await stat5(await this.workspace.path(project, item.path));
8609
+ await stat6(await this.workspace.path(project, item.path));
8590
8610
  } catch (e) {
8591
8611
  if (e.code === "ENOENT") {
8592
8612
  item.revisions.push({ hash: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), deleted: true });
@@ -8597,7 +8617,7 @@ var Artifacts = class {
8597
8617
  }
8598
8618
  if (changed) {
8599
8619
  await atomicJson(this.index(project), index);
8600
- this.emit(project, "artifacts.updated", Object.values(index));
8620
+ this.emit(project, "artifacts.updated", { total: Object.keys(index).length });
8601
8621
  }
8602
8622
  return Object.values(index);
8603
8623
  }
@@ -8608,6 +8628,14 @@ var Artifacts = class {
8608
8628
  if (!/^[a-f0-9]{64}$/.test(hash) || !(await this.history(project, path)).some((r) => r.hash === hash)) throw new Error("Unknown revision");
8609
8629
  return readFile4(join6(this.directory, project, "blobs", hash), "utf8");
8610
8630
  }
8631
+ async preview(project, path, hash) {
8632
+ if (!/^[a-f0-9]{64}$/.test(hash) || !(await this.history(project, path)).some((r) => r.hash === hash)) throw new Error("Unknown revision");
8633
+ const blob = join6(this.directory, project, "blobs", hash);
8634
+ if ((await stat6(blob)).size > 256 * 1024) return { content: "", notice: "\u6587\u4EF6\u8D85\u8FC7 256 KiB\uFF0C\u5DF2\u8DF3\u8FC7\u9884\u89C8\uFF0C\u8BF7\u5728\u6587\u4EF6\u9762\u677F\u6216\u672C\u5730\u67E5\u770B\u3002" };
8635
+ const content = await readFile4(blob, "utf8");
8636
+ if (content.split("\n").length > 2e3) return { content: "", notice: "\u6587\u4EF6\u8D85\u8FC7 2000 \u884C\uFF0C\u5DF2\u8DF3\u8FC7\u9884\u89C8\uFF0C\u8BF7\u5728\u6587\u4EF6\u9762\u677F\u6216\u672C\u5730\u67E5\u770B\u3002" };
8637
+ return { content };
8638
+ }
8611
8639
  associate(project, path, sessionId) {
8612
8640
  return this.serial(project, () => this.associateUnlocked(project, path, sessionId));
8613
8641
  }
@@ -8629,7 +8657,7 @@ import { TLSSocket, createSecureContext } from "node:tls";
8629
8657
 
8630
8658
  // src/host-auth.ts
8631
8659
  import { spawn } from "node:child_process";
8632
- import { chmod as chmod3, mkdir as mkdir5, rename as rename3, stat as stat6, unlink as unlink5 } from "node:fs/promises";
8660
+ import { chmod as chmod3, mkdir as mkdir5, rename as rename3, stat as stat7, unlink as unlink5 } from "node:fs/promises";
8633
8661
  import { userInfo, platform as platform2 } from "node:os";
8634
8662
  import { randomUUID as randomUUID6 } from "node:crypto";
8635
8663
  import { join as join7 } from "node:path";
@@ -8644,8 +8672,8 @@ async function ensureHostAuth(stateDirectory) {
8644
8672
  if (system !== "darwin" && system !== "linux") throw new Error("Host authentication is supported only on macOS and Linux");
8645
8673
  const mac = system === "darwin";
8646
8674
  const source = fileURLToPath2(new URL(mac ? "../native/auth-macos.m" : "../native/auth-linux.c", import.meta.url));
8647
- const sourceInfo = await stat6(source);
8648
- const existing = await stat6(target).catch(() => null);
8675
+ const sourceInfo = await stat7(source);
8676
+ const existing = await stat7(target).catch(() => null);
8649
8677
  if (existing?.isFile() && existing.mtimeMs >= sourceInfo.mtimeMs && (existing.mode & 63) === 0) return target;
8650
8678
  const temporary = `${target}.${randomUUID6()}`;
8651
8679
  const args = mac ? ["-O2", "-framework", "Foundation", "-framework", "OpenDirectory", source, "-o", target] : ["-O2", source, "-o", temporary, "-lpam"];
@@ -13618,7 +13646,7 @@ function createAdapter(runtime, workspace, uploads, emit) {
13618
13646
  }
13619
13647
 
13620
13648
  // src/project-registry.ts
13621
- import { realpath as realpath6, readFile as readFile9, stat as stat7 } from "node:fs/promises";
13649
+ import { realpath as realpath6, readFile as readFile9, stat as stat8 } from "node:fs/promises";
13622
13650
  import { isAbsolute as isAbsolute4 } from "node:path";
13623
13651
  import { isDeepStrictEqual } from "node:util";
13624
13652
  var ProjectMutationSchema = ProjectSchema.extend({
@@ -13706,7 +13734,7 @@ var ProjectRegistry = class {
13706
13734
  const raw = await this.readCurrent();
13707
13735
  const directory = expandHome(parsed.directory);
13708
13736
  if (!isAbsolute4(directory)) throw new Error("\u9879\u76EE\u76EE\u5F55\u5FC5\u987B\u662F Proxy \u4E3B\u673A\u4E0A\u7684\u7EDD\u5BF9\u8DEF\u5F84");
13709
- const info = await stat7(directory).catch(() => void 0);
13737
+ const info = await stat8(directory).catch(() => void 0);
13710
13738
  if (!info?.isDirectory()) throw new Error(`\u9879\u76EE\u76EE\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u662F\u76EE\u5F55\uFF1A${directory}`);
13711
13739
  const canonical = await realpath6(directory);
13712
13740
  if (this.config.projects.some((project2) => project2.id === parsed.id)) throw new Error(`\u9879\u76EE ID \u5DF2\u5B58\u5728\uFF1A${parsed.id}`);
@@ -13725,7 +13753,7 @@ var ProjectRegistry = class {
13725
13753
  if (index < 0) throw new Error(`\u672A\u77E5\u6388\u6743\u9879\u76EE\uFF1A${parsed.id}`);
13726
13754
  const directory = expandHome(parsed.directory);
13727
13755
  if (!isAbsolute4(directory)) throw new Error("\u9879\u76EE\u76EE\u5F55\u5FC5\u987B\u662F Proxy \u4E3B\u673A\u4E0A\u7684\u7EDD\u5BF9\u8DEF\u5F84");
13728
- const info = await stat7(directory).catch(() => void 0);
13756
+ const info = await stat8(directory).catch(() => void 0);
13729
13757
  if (!info?.isDirectory()) throw new Error(`\u9879\u76EE\u76EE\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u662F\u76EE\u5F55\uFF1A${directory}`);
13730
13758
  const canonical = await realpath6(directory);
13731
13759
  for (const project of this.config.projects) {
@@ -13756,7 +13784,7 @@ var ProjectRegistry = class {
13756
13784
 
13757
13785
  // src/terminal.ts
13758
13786
  import { randomUUID as randomUUID17 } from "node:crypto";
13759
- import { access as access2, stat as stat9 } from "node:fs/promises";
13787
+ import { access as access2, stat as stat10 } from "node:fs/promises";
13760
13788
  import { constants as constants5 } from "node:fs";
13761
13789
  import { platform as platform3, userInfo as userInfo3 } from "node:os";
13762
13790
  import { delimiter } from "node:path";
@@ -13764,7 +13792,7 @@ import * as pty from "node-pty";
13764
13792
 
13765
13793
  // src/terminal-support.ts
13766
13794
  import { createRequire } from "node:module";
13767
- import { access, chmod as chmod4, stat as stat8 } from "node:fs/promises";
13795
+ import { access, chmod as chmod4, stat as stat9 } from "node:fs/promises";
13768
13796
  import { constants as constants4 } from "node:fs";
13769
13797
  import { dirname as dirname6, resolve as resolve4 } from "node:path";
13770
13798
  var require2 = createRequire(import.meta.url);
@@ -13774,7 +13802,7 @@ function terminalHelperPath() {
13774
13802
  return resolve4(dirname6(utilsPath), native.dir, "spawn-helper");
13775
13803
  }
13776
13804
  async function prepareTerminalHelper(path, fix) {
13777
- const info = await stat8(path);
13805
+ const info = await stat9(path);
13778
13806
  if (!info.isFile()) throw new Error(`\u7EC8\u7AEF\u8F85\u52A9\u7A0B\u5E8F\u4E0D\u662F\u666E\u901A\u6587\u4EF6\uFF1A${path}`);
13779
13807
  try {
13780
13808
  await access(path, constants4.X_OK);
@@ -13833,7 +13861,7 @@ var TerminalManager = class {
13833
13861
  const count = [...this.terminals.values()].filter((t) => t.owner === owner).length;
13834
13862
  if (count >= 8) throw new Error("Terminal limit reached");
13835
13863
  const cwd = await this.workspace.path(project, typeof p.cwd === "string" ? p.cwd : ".");
13836
- if (!(await stat9(cwd)).isDirectory()) throw new Error(`\u7EC8\u7AEF\u5DE5\u4F5C\u76EE\u5F55\u4E0D\u662F\u76EE\u5F55\uFF1A${cwd}`);
13864
+ if (!(await stat10(cwd)).isDirectory()) throw new Error(`\u7EC8\u7AEF\u5DE5\u4F5C\u76EE\u5F55\u4E0D\u662F\u76EE\u5F55\uFF1A${cwd}`);
13837
13865
  const shell = process.env.SHELL || (platform3() === "darwin" ? "/bin/zsh" : "/bin/sh");
13838
13866
  try {
13839
13867
  await access2(shell, constants5.X_OK);
@@ -13964,7 +13992,7 @@ import { randomBytes as randomBytes2, randomUUID as randomUUID19 } from "node:cr
13964
13992
  import { fileURLToPath as fileURLToPath5 } from "node:url";
13965
13993
 
13966
13994
  // src/remote-native.ts
13967
- import { chmod as chmod5, mkdir as mkdir9, readFile as readFile10, rename as rename5, rm as rm3, stat as stat10, writeFile as writeFile7 } from "node:fs/promises";
13995
+ import { chmod as chmod5, mkdir as mkdir9, readFile as readFile10, rename as rename5, rm as rm3, stat as stat11, writeFile as writeFile7 } from "node:fs/promises";
13968
13996
  import { join as join14 } from "node:path";
13969
13997
  import { fileURLToPath as fileURLToPath4 } from "node:url";
13970
13998
  import { createHash as createHash10, randomUUID as randomUUID18 } from "node:crypto";
@@ -13975,7 +14003,7 @@ async function ensureRemoteHelper(stateDirectory, adapter = RemotePlatformRegist
13975
14003
  const target = join14(stateDirectory, "octopus-remote-desktop");
13976
14004
  const stamp = `${target}.sha256`;
13977
14005
  const fingerprint = createHash10("sha256").update(await readFile10(source)).update(JSON.stringify([adapter.context.platform, adapter.context.arch, build.flags])).digest("hex");
13978
- const existing = await stat10(target).catch(() => void 0);
14006
+ const existing = await stat11(target).catch(() => void 0);
13979
14007
  if (existing?.isFile() && (existing.mode & 63) === 0 && await readFile10(stamp, "utf8").catch(() => "") === fingerprint) return target;
13980
14008
  const temporary = `${target}.${randomUUID18()}`, temporaryStamp = `${temporary}.sha256`;
13981
14009
  const args = build.args(source, temporary);
@@ -14224,7 +14252,7 @@ import { platform as platform5 } from "node:os";
14224
14252
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
14225
14253
 
14226
14254
  // src/node-resolution.ts
14227
- import { realpath as realpath7, stat as stat11 } from "node:fs/promises";
14255
+ import { realpath as realpath7, stat as stat12 } from "node:fs/promises";
14228
14256
  import { execFile as execFile7 } from "node:child_process";
14229
14257
  import { promisify as promisify7 } from "node:util";
14230
14258
  import { join as join15 } from "node:path";
@@ -14279,7 +14307,7 @@ async function resolveCommandOnPath(name, extraDirs = []) {
14279
14307
  for (const dir of new Set(dirs)) {
14280
14308
  const full = join15(dir, name);
14281
14309
  try {
14282
- const info = await stat11(full);
14310
+ const info = await stat12(full);
14283
14311
  if (info.isFile() && info.mode & 73) return full;
14284
14312
  } catch {
14285
14313
  }
@@ -14489,7 +14517,7 @@ async function runDaemon(configPath, authenticate = verifyHostPassword) {
14489
14517
  workspace.project(project);
14490
14518
  if (c.operation === "workspace.list") return p.paged === true ? workspace.listPage(project, String(p.path ?? "."), p.cursor === void 0 ? "" : p.cursor, p.limit === void 0 ? 200 : Number(p.limit)) : workspace.list(project, String(p.path ?? "."));
14491
14519
  if (c.operation === "workspace.read") return workspace.read(project, String(p.path), Number(p.offset ?? 0), Number(p.length ?? 512 * 1024));
14492
- if (c.operation === "workspace.diff") return workspaceDiff(workspace, project);
14520
+ if (c.operation === "workspace.diff") return workspaceDiff(workspace, project, { paged: p.paged === true, offset: Number(p.offset ?? 0), limit: Number(p.limit ?? 20) });
14493
14521
  if (c.operation === "workspace.search") return workspace.search(project, String(p.query));
14494
14522
  if (c.operation === "workspace.write") return workspace.write(project, String(p.path), String(p.content), String(p.expectedHash));
14495
14523
  if (c.operation === "uploads.init") {
@@ -14503,9 +14531,9 @@ async function runDaemon(configPath, authenticate = verifyHostPassword) {
14503
14531
  if (c.operation === "uploads.chunk") return uploads.chunk(project, String(p.id), Number(p.offset), String(p.data));
14504
14532
  if (c.operation === "uploads.complete") return uploads.complete(project, String(p.id));
14505
14533
  if (c.operation === "uploads.cancel") return uploads.cancel(project, String(p.id));
14506
- if (c.operation === "artifacts.list") return artifacts.scan(project);
14534
+ if (c.operation === "artifacts.list") return p.paged === true ? artifacts.scanPage(project, Number(p.offset ?? 0), Number(p.limit ?? 20)) : artifacts.scan(project);
14507
14535
  if (c.operation === "artifacts.history") return artifacts.history(project, String(p.path));
14508
- if (c.operation === "artifacts.read") return artifacts.read(project, String(p.path), String(p.hash));
14536
+ if (c.operation === "artifacts.read") return p.preview === true ? artifacts.preview(project, String(p.path), String(p.hash)) : artifacts.read(project, String(p.path), String(p.hash));
14509
14537
  if (c.operation === "artifacts.associate") {
14510
14538
  if (!c.sessionId) throw new Error("Session required");
14511
14539
  await adapter.session(project, c.sessionId);
package/dist/cli.js CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  supportedPlatform,
36
36
  systemdUnitPath,
37
37
  toolSearchDirs
38
- } from "./chunk-4CKW4ICE.js";
38
+ } from "./chunk-6G2W4KWC.js";
39
39
  import {
40
40
  DESKTOP_PERMISSION_GUIDANCE,
41
41
  PlatformDesktop,
package/dist/main.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ConfigError,
4
4
  runDaemon
5
- } from "./chunk-4CKW4ICE.js";
5
+ } from "./chunk-6G2W4KWC.js";
6
6
  import "./chunk-OTKNRBZ7.js";
7
7
 
8
8
  // src/main.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skylandnpm/octopus-proxy",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "type": "module",
5
5
  "description": "Octopus host proxy: OpenCode, Codex, ZCode and Pi adapters with service installer CLI",
6
6
  "bin": {