@treeseed/sdk 0.6.9 → 0.6.11

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,5 +1,6 @@
1
1
  import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, readlinkSync, rmSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
2
2
  import { dirname, relative, resolve } from "node:path";
3
+ import { spawnSync } from "node:child_process";
3
4
  import { workspacePackages, workspaceRoot } from "./workspace-tools.js";
4
5
  const METADATA_VERSION = 1;
5
6
  const INTERNAL_DEPENDENCY_FIELDS = ["dependencies", "optionalDependencies", "peerDependencies", "devDependencies"];
@@ -64,24 +65,15 @@ function writeMetadata(root, links) {
64
65
  `, "utf8");
65
66
  }
66
67
  function gitInfoExcludePath(repoPath) {
67
- const gitPath = resolve(repoPath, ".git");
68
- const stat = safeLstat(gitPath);
69
- if (!stat) return null;
70
- if (stat.isDirectory()) {
71
- return resolve(gitPath, "info", "exclude");
72
- }
73
- if (stat.isFile()) {
74
- try {
75
- const content = readFileSync(gitPath, "utf8").trim();
76
- const match = /^gitdir:\s*(.+)$/iu.exec(content);
77
- if (!match) return null;
78
- const gitDir = resolve(repoPath, match[1]);
79
- return resolve(gitDir, "info", "exclude");
80
- } catch {
81
- return null;
82
- }
83
- }
84
- return null;
68
+ const result = spawnSync("git", ["rev-parse", "--git-common-dir"], {
69
+ cwd: repoPath,
70
+ stdio: "pipe",
71
+ encoding: "utf8"
72
+ });
73
+ if (result.status !== 0) return null;
74
+ const gitDir = result.stdout.trim();
75
+ if (!gitDir) return null;
76
+ return resolve(repoPath, gitDir, "info", "exclude");
85
77
  }
86
78
  function ensureGitInfoExcludes(root, links) {
87
79
  const patternsByRepo = /* @__PURE__ */ new Map();
@@ -17,6 +17,7 @@ const TRESEED_OPERATION_SPECS = [
17
17
  operation({ id: "deploy.rollback", name: "rollback", aliases: [], group: "Workflow", summary: "Roll back staging or production to a recorded deployment.", description: "Redeploy a previously recorded staging or production commit using a temporary checkout of that revision.", provider: "default", related: ["status", "release"] }),
18
18
  operation({ id: "workspace.doctor", name: "doctor", aliases: [], group: "Validation", summary: "Diagnose Treeseed tooling, auth, and workflow readiness.", description: "Collect doctor-style diagnostics for workspace readiness and optional safe repairs.", provider: "default", related: ["status", "config"] }),
19
19
  operation({ id: "workspace.install", name: "install", aliases: [], group: "Utilities", summary: "Install Treeseed-managed local dependencies.", description: "Install or repair Treeseed-managed CLI dependencies including GitHub CLI, Wrangler, Railway, Copilot, and optional gh-act support.", provider: "default", related: ["config", "doctor"] }),
20
+ operation({ id: "workspace.tools", name: "tools", aliases: [], group: "Utilities", summary: "Report Treeseed-managed executable locations.", description: "Inspect Treeseed-managed executable paths, invocation commands, cache roots, and GitHub CLI authentication state without installing or mutating tools.", provider: "default", related: ["install", "doctor"] }),
20
21
  operation({ id: "auth.login", name: "auth:login", aliases: [], group: "Validation", summary: "Authenticate against the configured Treeseed API.", description: "Start the device login flow against the active Treeseed API host and persist the returned session locally.", provider: "default", related: ["auth:check", "auth:whoami", "auth:logout"] }),
21
22
  operation({ id: "auth.logout", name: "auth:logout", aliases: [], group: "Validation", summary: "Clear locally stored Treeseed API credentials.", description: "Remove the persisted local device-flow session for the active Treeseed API host.", provider: "default", related: ["auth:login", "auth:whoami"] }),
22
23
  operation({ id: "auth.whoami", name: "auth:whoami", aliases: [], group: "Validation", summary: "Inspect the active Treeseed API identity.", description: "Use the persisted local remote session to query the active Treeseed API principal.", provider: "default", related: ["auth:login", "status"] }),
@@ -145,7 +145,8 @@ async function run() {
145
145
  }
146
146
  }
147
147
  if (existingFiles.length === 0) {
148
- throw new Error('Unable to find any Starlight collection helper files to patch.');
148
+ console.log('Starlight dependency tree not found; skipping knowledge-path patch.');
149
+ return;
149
150
  }
150
151
  let patchedAny = false;
151
152
  for (const collectionFile of existingFiles) {