@gaia-ai/addon-herdr 0.11.1 → 0.11.3
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/src/root-anchor.d.ts +11 -24
- package/dist/src/root-anchor.js +10 -38
- package/package.json +4 -4
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export type RootGitExec
|
|
3
|
-
|
|
4
|
-
export declare const defaultRootGitExec: RootGitExec;
|
|
1
|
+
import { defaultRootGitExec, deriveCheckoutRoot, type RootGitExec } from '@gaia-ai/core';
|
|
2
|
+
export type { RootGitExec };
|
|
3
|
+
export { defaultRootGitExec };
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* (`linked_worktree_source`). Instead ask git: `git rev-parse
|
|
14
|
-
* --path-format=absolute --git-common-dir`, run from the config dir, always
|
|
15
|
-
* resolves to the shared main `.git` even from a linked worktree; its parent is
|
|
16
|
-
* the main clone.
|
|
17
|
-
*
|
|
18
|
-
* `override` (a factory `root:` option) always wins and skips git entirely.
|
|
19
|
-
* Best-effort: a missing `config_path` or a git failure (e.g. not a repo) falls
|
|
20
|
-
* back to `dirname(config_path)` — the previous behaviour — and finally
|
|
21
|
-
* `process.cwd()`.
|
|
5
|
+
* herdr's own name for the shared checkout-root anchor (GAIA-177), kept as a
|
|
6
|
+
* thin alias so `index.ts` and `workspace.ts` need no rename. The behaviour —
|
|
7
|
+
* including the injected git-exec seam — now lives in `@gaia-ai/core` as
|
|
8
|
+
* `deriveCheckoutRoot()` (GAIA-450 D2): two other call sites
|
|
9
|
+
* (`@gaia-ai/conductor`'s `checkoutRootOf()` and `addon-workspace-git`'s
|
|
10
|
+
* `gitWorkspace` fallback) needed the same derivation and neither may import
|
|
11
|
+
* this addon, so the helper moved to the kernel rather than staying herdr-owned.
|
|
22
12
|
*/
|
|
23
|
-
export declare
|
|
24
|
-
override?: string;
|
|
25
|
-
execGit?: RootGitExec;
|
|
26
|
-
}): Promise<string>;
|
|
13
|
+
export declare const deriveHerdrRoot: typeof deriveCheckoutRoot;
|
package/dist/src/root-anchor.js
CHANGED
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/** Default git runner for root derivation: real `git` in the given cwd. */
|
|
4
|
-
export const defaultRootGitExec = (args, cwd) => exec('git', args, { cwd });
|
|
1
|
+
import { defaultRootGitExec, deriveCheckoutRoot, } from '@gaia-ai/core';
|
|
2
|
+
export { defaultRootGitExec };
|
|
5
3
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* (`linked_worktree_source`). Instead ask git: `git rev-parse
|
|
14
|
-
* --path-format=absolute --git-common-dir`, run from the config dir, always
|
|
15
|
-
* resolves to the shared main `.git` even from a linked worktree; its parent is
|
|
16
|
-
* the main clone.
|
|
17
|
-
*
|
|
18
|
-
* `override` (a factory `root:` option) always wins and skips git entirely.
|
|
19
|
-
* Best-effort: a missing `config_path` or a git failure (e.g. not a repo) falls
|
|
20
|
-
* back to `dirname(config_path)` — the previous behaviour — and finally
|
|
21
|
-
* `process.cwd()`.
|
|
4
|
+
* herdr's own name for the shared checkout-root anchor (GAIA-177), kept as a
|
|
5
|
+
* thin alias so `index.ts` and `workspace.ts` need no rename. The behaviour —
|
|
6
|
+
* including the injected git-exec seam — now lives in `@gaia-ai/core` as
|
|
7
|
+
* `deriveCheckoutRoot()` (GAIA-450 D2): two other call sites
|
|
8
|
+
* (`@gaia-ai/conductor`'s `checkoutRootOf()` and `addon-workspace-git`'s
|
|
9
|
+
* `gitWorkspace` fallback) needed the same derivation and neither may import
|
|
10
|
+
* this addon, so the helper moved to the kernel rather than staying herdr-owned.
|
|
22
11
|
*/
|
|
23
|
-
export
|
|
24
|
-
if (opts.override !== undefined) {
|
|
25
|
-
return opts.override;
|
|
26
|
-
}
|
|
27
|
-
const configDir = configPath ? dirname(configPath) : undefined;
|
|
28
|
-
const fallback = configDir ?? process.cwd();
|
|
29
|
-
if (configDir === undefined) {
|
|
30
|
-
return fallback;
|
|
31
|
-
}
|
|
32
|
-
const execGit = opts.execGit ?? defaultRootGitExec;
|
|
33
|
-
try {
|
|
34
|
-
const commonDir = (await execGit(['rev-parse', '--path-format=absolute', '--git-common-dir'], configDir)).trim();
|
|
35
|
-
return commonDir ? dirname(commonDir) : fallback;
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
return fallback;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
12
|
+
export const deriveHerdrRoot = deriveCheckoutRoot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaia-ai/addon-herdr",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "GAIA herdr integration: spawn executor + per-ticket worktree workspace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"directory": "gaia-cli/addons/herdr"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@gaia-ai/addon-workspace-git": "^0.11.
|
|
23
|
+
"@gaia-ai/addon-workspace-git": "^0.11.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@gaia-ai/conductor": "^0.11.
|
|
27
|
-
"@gaia-ai/core": "^0.11.
|
|
26
|
+
"@gaia-ai/conductor": "^0.11.3",
|
|
27
|
+
"@gaia-ai/core": "^0.11.3"
|
|
28
28
|
}
|
|
29
29
|
}
|