larness 0.3.1 → 0.4.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.
Files changed (54) hide show
  1. package/apps/server/dist/{address-Dh8XUuOk.js → address-BDs0FfMq.js} +1 -1
  2. package/apps/server/dist/{client-D64wZ3lt.js → client-D88ULjn9.js} +1 -1
  3. package/apps/server/dist/{doctor-rEr7DMMb.js → doctor-dwTQiTef.js} +1 -1
  4. package/apps/server/dist/doctor.js +1 -1
  5. package/apps/server/dist/index.js +11987 -5714
  6. package/apps/server/dist/{managed-nCF4mKiY.js → managed-Br7VqQiP.js} +70 -6
  7. package/apps/server/dist/{paths-Dds-A0kx.js → paths-DUfwiH2X.js} +641 -19
  8. package/apps/server/dist/{status-toJt8Dby.js → status-D2oSIMoj.js} +1 -1
  9. package/apps/server/dist/status.js +3 -3
  10. package/apps/server/dist/tui.js +4 -4
  11. package/apps/server/drizzle/0032_agent_profile.sql +1 -0
  12. package/apps/server/drizzle/0033_agent_profile_service_ops.sql +1 -0
  13. package/apps/server/drizzle/0034_agent_profile_coding_plan.sql +1 -0
  14. package/apps/server/drizzle/0035_session_title_source.sql +1 -0
  15. package/apps/server/drizzle/0036_project_memory.sql +62 -0
  16. package/apps/server/drizzle/0037_web_search.sql +14 -0
  17. package/apps/server/drizzle/0038_document_attachments.sql +16 -0
  18. package/apps/server/drizzle/meta/0032_snapshot.json +5169 -0
  19. package/apps/server/drizzle/meta/0035_snapshot.json +5177 -0
  20. package/apps/server/drizzle/meta/0036_snapshot.json +5576 -0
  21. package/apps/server/drizzle/meta/0037_snapshot.json +5667 -0
  22. package/apps/server/drizzle/meta/0038_snapshot.json +5776 -0
  23. package/apps/server/drizzle/meta/_journal.json +49 -0
  24. package/apps/server/package.json +10 -0
  25. package/apps/web/dist/assets/{FileEditor-Qgvegzha.js → FileEditor-EgU1WoyG.js} +1 -1
  26. package/apps/web/dist/assets/{FileViewer-DOkamgXq.js → FileViewer-CK3jt-Kt.js} +1 -1
  27. package/apps/web/dist/assets/{cssMode-CNLukUsc.js → cssMode-C8rMoO9f.js} +1 -1
  28. package/apps/web/dist/assets/{editor.api-BGAC2PgT.js → editor.api-oDs5eZGS.js} +1 -1
  29. package/apps/web/dist/assets/{freemarker2-DmzUAvZs.js → freemarker2-Bpg8JM09.js} +1 -1
  30. package/apps/web/dist/assets/{handlebars-CMacXF3P.js → handlebars-17J16rlT.js} +1 -1
  31. package/apps/web/dist/assets/{html-BufzDub2.js → html-DJQFF1_1.js} +1 -1
  32. package/apps/web/dist/assets/{htmlMode-vSvsTicL.js → htmlMode-H8gHwZ6x.js} +1 -1
  33. package/apps/web/dist/assets/{index-Pz8dIHnt.js → index-BTVfvWIs.js} +2 -2
  34. package/apps/web/dist/assets/{javascript-CWkrvOWF.js → javascript-CjeM-nVA.js} +1 -1
  35. package/apps/web/dist/assets/{jsonMode-D6vtcW2h.js → jsonMode-C6seMV0X.js} +1 -1
  36. package/apps/web/dist/assets/{liquid-D5KkJyqT.js → liquid-B33LyktO.js} +1 -1
  37. package/apps/web/dist/assets/{lspLanguageFeatures-DI8_dTOp.js → lspLanguageFeatures-H7IuoVNs.js} +1 -1
  38. package/apps/web/dist/assets/main-CQzbYrTZ.js +157 -0
  39. package/apps/web/dist/assets/main-gq3n_vn8.css +1 -0
  40. package/apps/web/dist/assets/{mdx-BdPaDdpH.js → mdx-CcNcLUd8.js} +1 -1
  41. package/apps/web/dist/assets/{monaco-EglqICVw.js → monaco-xD43LINc.js} +3 -3
  42. package/apps/web/dist/assets/{python-BrXsyyj_.js → python-BfhjzxvI.js} +1 -1
  43. package/apps/web/dist/assets/{razor-xmumdcGT.js → razor-COinq8YD.js} +1 -1
  44. package/apps/web/dist/assets/{tsMode-CkDNjbjK.js → tsMode-CXpnR4mr.js} +1 -1
  45. package/apps/web/dist/assets/{typescript-BYDg93Ut.js → typescript-DAgfuTsy.js} +1 -1
  46. package/apps/web/dist/assets/{workers-CMKTm3o5.js → workers-DI76FldO.js} +1 -1
  47. package/apps/web/dist/assets/{xml-DLqAxpyK.js → xml-CSNVYs0K.js} +1 -1
  48. package/apps/web/dist/assets/{yaml-Y5128Ncw.js → yaml-Bzp-4SkQ.js} +1 -1
  49. package/apps/web/dist/index.html +1 -1
  50. package/docs/README.md +1 -0
  51. package/docs/guides/install.md +3 -3
  52. package/package.json +1 -1
  53. package/apps/web/dist/assets/main-D1Y-WDQ4.css +0 -1
  54. package/apps/web/dist/assets/main-LsqGdepC.js +0 -158
@@ -1,4 +1,4 @@
1
- import { Fn as FilePathSchema, Hn as MAX_EDITABLE_FILE_BYTES, bn as OriginUrlSchema } from "./paths-Dds-A0kx.js";
1
+ import { Yn as FilePathSchema, jn as OriginUrlSchema, nr as MAX_EDITABLE_FILE_BYTES } from "./paths-DUfwiH2X.js";
2
2
  import { createHash, randomInt, randomUUID } from "node:crypto";
3
3
  import { constants, existsSync, readFileSync, realpathSync, statSync, watch } from "node:fs";
4
4
  import path from "node:path";
@@ -635,10 +635,10 @@ async function runCommand(options) {
635
635
  setTimeout(() => finishStop?.(), 200);
636
636
  });
637
637
  };
638
- const launch = windows ? windowsLaunch(options.executable, options.args, options.cwd) : {
638
+ const launch = options.shell === true || !windows ? {
639
639
  executable: options.executable,
640
640
  args: options.args
641
- };
641
+ } : windowsLaunch(options.executable, options.args, options.cwd);
642
642
  const child = spawn(launch.executable, launch.args, {
643
643
  cwd: options.cwd,
644
644
  env: {
@@ -704,8 +704,8 @@ async function runCommand(options) {
704
704
  resolve();
705
705
  });
706
706
  });
707
- child.once("error", () => {
708
- reason ??= "SPAWN_FAILED";
707
+ child.once("error", (error) => {
708
+ reason ??= error.code === "ENOENT" ? options.shell === true ? "SHELL_UNAVAILABLE" : "COMMAND_NOT_FOUND" : "SPAWN_FAILED";
709
709
  });
710
710
  child.once("spawn", () => {
711
711
  if (child.pid) {
@@ -1703,6 +1703,10 @@ async function runGit(root, args, options = {}) {
1703
1703
  } catch (error) {
1704
1704
  if (!(error instanceof Error)) throw new GitError("GIT_UNAVAILABLE", "Git command failed");
1705
1705
  const value = error;
1706
+ if (typeof value.code === "number" && options.allowedExitCodes?.includes(value.code)) return {
1707
+ stdout: (value.stdout ?? Buffer.alloc(0)).toString("utf8"),
1708
+ stderr: (value.stderr ?? Buffer.alloc(0)).toString("utf8")
1709
+ };
1706
1710
  if (value.code === "ENOENT") throw new GitError("GIT_UNAVAILABLE", "Git is not installed");
1707
1711
  if (value.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER") throw new GitError("PAYLOAD_TOO_LARGE", "Git output exceeds the limit");
1708
1712
  if (value.killed || value.code === "ETIMEDOUT") throw new GitError("GIT_CONFLICT", "Git command timed out");
@@ -1718,6 +1722,66 @@ function validateGitPath(root, value, gitReported = false) {
1718
1722
  if (!isInsideRoot(root, path.resolve(root, normalized))) throw new GitError("GIT_CONFLICT", "Git path escapes root");
1719
1723
  return normalized;
1720
1724
  }
1725
+ /**
1726
+ * Git runs inside the project directory but still reports every path relative
1727
+ * to the repository root and applies pathspecs relative to the current
1728
+ * directory. A project may be a subdirectory of a larger repository, so paths
1729
+ * have to be rebased onto the project before they are listed or reused.
1730
+ */
1731
+ async function gitPrefix(root, options = {}) {
1732
+ const { stdout } = await runGit(root, ["rev-parse", "--show-prefix"], {
1733
+ readOnly: true,
1734
+ timeoutMs: options.timeoutMs ?? 15e3
1735
+ });
1736
+ const value = stdout.trim().replaceAll("\\", "/");
1737
+ if (!value) return "";
1738
+ return value.endsWith("/") ? value : `${value}/`;
1739
+ }
1740
+ /**
1741
+ * Rebase the NUL separated `git status --porcelain=v2` stream onto the project
1742
+ * directory: changes outside it are dropped and the rest keep their record
1743
+ * shape, so `parseStatus` and the snapshot hash stay stable.
1744
+ */
1745
+ function scopeStatusToPrefix(raw, prefix) {
1746
+ if (!prefix) return raw;
1747
+ const base = prefix.endsWith("/") ? prefix : `${prefix}/`;
1748
+ const tokens = raw.split("\0");
1749
+ const scoped = [];
1750
+ for (let index = 0; index < tokens.length; index++) {
1751
+ const token = tokens[index] ?? "";
1752
+ if (!token) continue;
1753
+ const fields = token.split(" ");
1754
+ const kind = fields[0];
1755
+ if (kind === "2") {
1756
+ const origPath = tokens[index + 1] ?? "";
1757
+ index += 1;
1758
+ const renamed = toProjectPath(fields.slice(9).join(" "), base);
1759
+ if (renamed === null) continue;
1760
+ scoped.push([...fields.slice(0, 9), renamed].join(" "));
1761
+ scoped.push(toProjectPath(origPath, base) ?? renamed);
1762
+ continue;
1763
+ }
1764
+ const head = kind === "1" ? 8 : kind === "u" ? 10 : 0;
1765
+ if (head > 0) {
1766
+ const pathValue = toProjectPath(fields.slice(head).join(" "), base);
1767
+ if (pathValue !== null) scoped.push([...fields.slice(0, head), pathValue].join(" "));
1768
+ continue;
1769
+ }
1770
+ if (kind === "?") {
1771
+ const pathValue = toProjectPath(token.slice(2), base);
1772
+ if (pathValue !== null) scoped.push(`? ${pathValue}`);
1773
+ continue;
1774
+ }
1775
+ scoped.push(token);
1776
+ }
1777
+ return scoped.map((token) => `${token}\0`).join("");
1778
+ }
1779
+ function toProjectPath(value, base) {
1780
+ const normalized = value.replaceAll("\\", "/");
1781
+ if (!normalized.startsWith(base)) return null;
1782
+ const relative = normalized.slice(base.length);
1783
+ return relative ? relative : null;
1784
+ }
1721
1785
  function parseStatus(raw) {
1722
1786
  const tokens = raw.split("\0");
1723
1787
  const status = {
@@ -2220,4 +2284,4 @@ function waitChildMessage(child, parse, signal, phase = "Server") {
2220
2284
  if (signal?.aborted) abort();
2221
2285
  });
2222
2286
  }
2223
- export { MAX_COMMAND_OUTPUT_BYTES as $, scanWatchPath as A, DEFAULT_IGNORED as B, parseBranches as C, snapshotOf as D, runGit as E, normalizeFilePath as F, isIgnoredFile as G, applyPatch$1 as H, readEditableFile as I, searchCode as J, listFiles as K, resolveFilePath as L, encodeEditableContent as M, fileEntryVersion as N, validateGitPath as O, listDirectory as P, resolveInsideRoot as Q, saveEditableFile as R, GitError as S, parseStatus as T, createTextFile as U, FileError as V, hashContent as W, canonicalDirectory as X, PathGuardError as Y, isInsideRoot as Z, formatPairingCode as _, DevWebControl as a, processSnapshot as at, normalizePairingCode as b, EntryConfigError as c, commandEnvironment as ct, devWebCache as d, OutputRedactor as dt, runCommand as et, isDevPath as f, PAIRING_REQUEST_TTL_MS as g, PAIRING_CODE_TTL_MS as h, DevWebAttachedSchema as i, processCommandLine as it, FileManagerError as j, createDirectoryWatcher as k, HMR_PATH as l, powerShellEncodedCommand as lt, ENROLLMENT_TTL_MS as m, receiveDevWebTarget as n, windowsLaunch as nt, DevWebTargetSchema as o, terminateProcessTree as ot, permittedPath as p, readTextFile as q, waitChildMessage as r, processAlive as rt, DevWebUnavailable as s, windowsTcpListeners as st, managedWebFiles as t, resolveWindowsExecutable as tt, NONCE_MARKER as u, windowsPowerShell as ut, generatePairingCode as v, parseLog as w, ManagedPty as x, generateShortCode as y, searchFiles as z };
2287
+ export { isInsideRoot as $, validateGitPath as A, saveEditableFile as B, gitPrefix as C, runGit as D, parseStatus as E, fileEntryVersion as F, createTextFile as G, DEFAULT_IGNORED as H, listDirectory as I, listFiles as J, hashContent as K, normalizeFilePath as L, scanWatchPath as M, FileManagerError as N, scopeStatusToPrefix as O, encodeEditableContent as P, canonicalDirectory as Q, readEditableFile as R, GitError as S, parseLog as T, FileError as U, searchFiles as V, applyPatch$1 as W, searchCode as X, readTextFile as Y, PathGuardError as Z, formatPairingCode as _, DevWebControl as a, resolveWindowsExecutable as at, normalizePairingCode as b, EntryConfigError as c, processCommandLine as ct, devWebCache as d, windowsTcpListeners as dt, resolveInsideRoot as et, isDevPath as f, commandEnvironment as ft, PAIRING_REQUEST_TTL_MS as g, OutputRedactor as gt, PAIRING_CODE_TTL_MS as h, windowsPowerShell as ht, DevWebAttachedSchema as i, stopCommandGroup as it, createDirectoryWatcher as j, snapshotOf as k, HMR_PATH as l, processSnapshot as lt, ENROLLMENT_TTL_MS as m, powerShellEncodedCommand as mt, receiveDevWebTarget as n, groupAlive as nt, DevWebTargetSchema as o, windowsLaunch as ot, permittedPath as p, powerShellArguments as pt, isIgnoredFile as q, waitChildMessage as r, runCommand as rt, DevWebUnavailable as s, processAlive as st, managedWebFiles as t, MAX_COMMAND_OUTPUT_BYTES as tt, NONCE_MARKER as u, terminateProcessTree as ut, generatePairingCode as v, parseBranches as w, ManagedPty as x, generateShortCode as y, resolveFilePath as z };