borgmcp 1.1.9 → 1.1.12

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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Resolve the repository identity for the directory hosting this MCP child.
3
+ *
4
+ * The report carries only a canonical repository identity (`host/org/repo`)
5
+ * and its derived name. Local filesystem paths and raw remote URLs are never
6
+ * included in lifecycle metadata.
7
+ */
8
+ export interface WorkingRepo {
9
+ name: string | null;
10
+ /** Canonical host/path identity, never a raw Git remote URL. */
11
+ origin: string | null;
12
+ }
13
+ export interface WorkingRepoDeps {
14
+ runGit?: (cwd: string, args: string[]) => {
15
+ status: number | null;
16
+ stdout?: string | null;
17
+ };
18
+ }
19
+ /**
20
+ * Convert a Git remote to a non-secret `host/org/repo` identity.
21
+ *
22
+ * URL userinfo, query strings, fragments, scheme, and SCP-style user prefixes
23
+ * are deliberately discarded. Inputs that cannot identify a host and path are
24
+ * treated as unreportable rather than forwarded verbatim.
25
+ */
26
+ export declare function canonicalizeWorkingRepoIdentity(origin: string): string | null;
27
+ /**
28
+ * Return a reportable identity for the caller's current directory.
29
+ *
30
+ * `git rev-parse --show-toplevel` supports both ordinary clones and linked
31
+ * worktrees. Any git failure reports no repository identity instead of
32
+ * disclosing the caller's local filesystem layout.
33
+ */
34
+ export declare function resolveWorkingRepo(cwd?: string, deps?: WorkingRepoDeps): WorkingRepo;
35
+ //# sourceMappingURL=working-repo.d.ts.map
@@ -0,0 +1 @@
1
+ import{spawnSync as a}from"node:child_process";function c(n,e){const o=a("git",e,{cwd:n,encoding:"utf-8"});return{status:o.status,stdout:o.stdout}}function i(n){const e=n?.trim();return e||null}function p(n){return n.replace(/\/$/,"").split("/").pop()?.replace(/\.git$/i,"").trim()||null}function m(n){const e=n.trim();if(!e)return null;const o=e.match(/^([A-Za-z0-9.-]+)\/([^?#\s]+)$/);if(o){const t=o[1].toLowerCase(),r=o[2].replace(/^\/+|\/+$/g,"").replace(/\.git$/i,"");return t&&r?`${t}/${r}`:null}try{const t=new URL(n);if(!["http:","https:","ssh:","git:"].includes(t.protocol))return null;const r=t.pathname.replace(/^\/+|\/+$/g,"").replace(/\.git$/i,"");return t.hostname&&r?`${t.hostname.toLowerCase()}/${r}`:null}catch{const t=e.match(/^(?:[^@\s/:]+@)?([A-Za-z0-9.-]+):\/?([^?#\s]+)(?:[?#].*)?$/);if(t){const r=t[1].toLowerCase(),s=t[2].replace(/^\/+|\/+$/g,"").replace(/\.git$/i,"");return r&&s?`${r}/${s}`:null}return null}}function h(n=process.cwd(),e={}){const o=e.runGit??c,t=o(n,["rev-parse","--show-toplevel"]);if(!(t.status===0?i(t.stdout):null))return{name:null,origin:null};const s=o(n,["config","--get","remote.origin.url"]),u=s.status===0?i(s.stdout):null,l=u?m(u):null;return{name:l?p(l):null,origin:l}}export{m as canonicalizeWorkingRepoIdentity,h as resolveWorkingRepo};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "borgmcp",
3
- "version": "1.1.9",
3
+ "version": "1.1.12",
4
4
  "description": "Coordinate AI coding agents in shared cubes. Works with Claude Code and Codex. Create projects, assign roles, and share a live activity log.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",