adhdev 0.9.81-rc.1 → 0.9.82-rc.1

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.
package/dist/cli/index.js CHANGED
@@ -574,6 +574,14 @@ var init_repo_mesh_types = __esm({
574
574
  });
575
575
 
576
576
  // ../../oss/packages/daemon-core/src/git/git-executor.ts
577
+ var git_executor_exports = {};
578
+ __export(git_executor_exports, {
579
+ GitCommandError: () => GitCommandError,
580
+ isPathInside: () => isPathInside,
581
+ normalizeGitOutput: () => normalizeGitOutput,
582
+ resolveGitRepository: () => resolveGitRepository,
583
+ runGit: () => runGit
584
+ });
577
585
  async function resolveGitRepository(workspace, options = {}) {
578
586
  const normalizedWorkspace = await validateWorkspace(workspace);
579
587
  const result = await execGitRaw(normalizedWorkspace, ["rev-parse", "--show-toplevel"], options, {
@@ -773,12 +781,17 @@ var init_git_executor = __esm({
773
781
  // ../../oss/packages/daemon-core/src/git/git-status.ts
774
782
  async function getGitRepoStatus(workspace, options = {}) {
775
783
  const lastCheckedAt = Date.now();
784
+ const includeSubmodules = options.includeSubmodules !== false;
776
785
  try {
777
786
  const repo = await resolveGitRepository(workspace, options);
778
787
  const statusOutput = await runGit(repo, ["status", "--porcelain=v2", "--branch"], options);
779
788
  const parsed = parsePorcelainV2Status(statusOutput.stdout);
780
789
  const head = await readHead(repo, options);
781
790
  const stashCount = await readStashCount(repo, options);
791
+ let submodules;
792
+ if (includeSubmodules) {
793
+ submodules = await getSubmoduleStatuses(repo, options);
794
+ }
782
795
  return {
783
796
  workspace: repo.workspace,
784
797
  repoRoot: repo.repoRoot,
@@ -797,7 +810,8 @@ async function getGitRepoStatus(workspace, options = {}) {
797
810
  hasConflicts: parsed.conflictFiles.length > 0,
798
811
  conflictFiles: parsed.conflictFiles,
799
812
  stashCount,
800
- lastCheckedAt
813
+ lastCheckedAt,
814
+ submodules
801
815
  };
802
816
  } catch (error48) {
803
817
  if (error48 instanceof GitCommandError) {
@@ -919,6 +933,37 @@ function emptyStatus(workspace, lastCheckedAt, error48) {
919
933
  reason: error48.reason
920
934
  };
921
935
  }
936
+ async function getSubmoduleStatuses(repo, options) {
937
+ if (!repo.repoRoot) return [];
938
+ try {
939
+ const result = await runGit(repo, ["submodule", "status", "--recursive"], options);
940
+ return parseSubmoduleStatusOutput(result.stdout, repo.repoRoot, options.submoduleIgnorePaths);
941
+ } catch {
942
+ return [];
943
+ }
944
+ }
945
+ function parseSubmoduleStatusOutput(output, repoRoot, ignorePaths) {
946
+ const submodules = [];
947
+ const ignoreSet = new Set(ignorePaths || []);
948
+ for (const line of output.split("\n")) {
949
+ if (!line.trim()) continue;
950
+ const match = line.match(/^([\-+\s])([0-9a-f]{40})\s+(\S+)(?:\s+\(([^)]+)\))?/);
951
+ if (!match) continue;
952
+ const prefix = match[1];
953
+ const commit = match[2];
954
+ const path42 = match[3];
955
+ if (ignoreSet.has(path42)) continue;
956
+ submodules.push({
957
+ path: path42,
958
+ commit,
959
+ repoPath: repoRoot + "/" + path42,
960
+ dirty: prefix === "+",
961
+ outOfSync: prefix === "-",
962
+ lastCheckedAt: Date.now()
963
+ });
964
+ }
965
+ return submodules;
966
+ }
922
967
  var init_git_status = __esm({
923
968
  "../../oss/packages/daemon-core/src/git/git-status.ts"() {
924
969
  "use strict";
@@ -48223,12 +48268,25 @@ var init_router = __esm({
48223
48268
  });
48224
48269
  if (!node) return { success: false, error: "Failed to register worktree node" };
48225
48270
  }
48271
+ const initSubmodules = sourceNode.policy?.initSubmodulesOnClone !== false;
48272
+ if (initSubmodules) {
48273
+ try {
48274
+ const { runGit: runGit2 } = await Promise.resolve().then(() => (init_git_executor(), git_executor_exports));
48275
+ await runGit2(
48276
+ { workspace: result.worktreePath, repoRoot: result.worktreePath, isGitRepo: true },
48277
+ ["submodule", "update", "--init", "--recursive"],
48278
+ { timeoutMs: 12e4 }
48279
+ );
48280
+ } catch (subErr) {
48281
+ console.warn("[mesh] Submodule init failed for worktree:", subErr.message);
48282
+ }
48283
+ }
48226
48284
  try {
48227
48285
  const { appendLedgerEntry: appendLedgerEntry2 } = await Promise.resolve().then(() => (init_mesh_ledger(), mesh_ledger_exports));
48228
48286
  appendLedgerEntry2(meshId, {
48229
48287
  kind: "node_cloned",
48230
48288
  nodeId: node.id,
48231
- payload: { sourceNodeId, branch: result.branch, worktreePath: result.worktreePath }
48289
+ payload: { sourceNodeId, branch: result.branch, worktreePath: result.worktreePath, submodulesInitialized: initSubmodules }
48232
48290
  });
48233
48291
  } catch {
48234
48292
  }
@@ -97637,7 +97695,7 @@ var init_adhdev_daemon = __esm({
97637
97695
  init_version();
97638
97696
  init_src();
97639
97697
  init_runtime_defaults();
97640
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.81-rc.1" });
97698
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.82-rc.1" });
97641
97699
  AdhdevDaemon = class _AdhdevDaemon {
97642
97700
  localHttpServer = null;
97643
97701
  localWss = null;