@cruxy/cli 1.0.2 → 1.0.4
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/agent/loop.js +3 -0
- package/dist/agent/session.js +2 -1
- package/dist/theme/tokens.js +3 -0
- package/dist/usage/collect.js +41 -2
- package/dist/usage/index.js +1 -1
- package/dist/usage/summary.js +19 -0
- package/dist/usage/types.js +9 -0
- package/package.json +1 -1
- package/dist/agent/budget.d.ts +0 -52
- package/dist/agent/index.d.ts +0 -3
- package/dist/agent/loop.d.ts +0 -159
- package/dist/agent/prompts.d.ts +0 -69
- package/dist/agent/session.d.ts +0 -212
- package/dist/approval/classify.d.ts +0 -18
- package/dist/approval/index.d.ts +0 -6
- package/dist/approval/mutex.d.ts +0 -45
- package/dist/approval/policy.d.ts +0 -43
- package/dist/approval/prompt.d.ts +0 -48
- package/dist/approval/service.d.ts +0 -36
- package/dist/approval/types.d.ts +0 -82
- package/dist/brand/index.d.ts +0 -1
- package/dist/brand/voice.d.ts +0 -94
- package/dist/checkpoint/capture.d.ts +0 -17
- package/dist/checkpoint/gate-hook.d.ts +0 -28
- package/dist/checkpoint/gate.d.ts +0 -71
- package/dist/checkpoint/git-store.d.ts +0 -61
- package/dist/checkpoint/index.d.ts +0 -10
- package/dist/checkpoint/restore.d.ts +0 -23
- package/dist/checkpoint/service.d.ts +0 -89
- package/dist/checkpoint/set-rollback.d.ts +0 -51
- package/dist/checkpoint/set.d.ts +0 -44
- package/dist/checkpoint/shadow-store.d.ts +0 -23
- package/dist/checkpoint/types.d.ts +0 -164
- package/dist/cli/commands/checkpoint.d.ts +0 -7
- package/dist/cli/commands/config.d.ts +0 -2
- package/dist/cli/commands/hooks.d.ts +0 -8
- package/dist/cli/commands/index.d.ts +0 -7
- package/dist/cli/commands/init.d.ts +0 -7
- package/dist/cli/commands/login.d.ts +0 -8
- package/dist/cli/commands/mcp.d.ts +0 -9
- package/dist/cli/commands/memory.d.ts +0 -8
- package/dist/cli/commands/pr.d.ts +0 -8
- package/dist/cli/commands/rollback.d.ts +0 -18
- package/dist/cli/commands/run.d.ts +0 -2
- package/dist/cli/commands/skills.d.ts +0 -8
- package/dist/cli/commands/test.d.ts +0 -9
- package/dist/cli/commands/usage.d.ts +0 -9
- package/dist/cli/onboard.d.ts +0 -25
- package/dist/cli/program.d.ts +0 -2
- package/dist/cli/repl.d.ts +0 -27
- package/dist/cli/session-factory.d.ts +0 -42
- package/dist/cli/stream-print.d.ts +0 -14
- package/dist/components/autocomplete.d.ts +0 -32
- package/dist/components/frame.d.ts +0 -28
- package/dist/components/fuzzy.d.ts +0 -61
- package/dist/components/index.d.ts +0 -6
- package/dist/components/input.d.ts +0 -78
- package/dist/components/keys.d.ts +0 -48
- package/dist/components/select.d.ts +0 -28
- package/dist/config/credentials.d.ts +0 -18
- package/dist/config/index.d.ts +0 -5
- package/dist/config/manager.d.ts +0 -39
- package/dist/config/owner-only.d.ts +0 -19
- package/dist/config/paths.d.ts +0 -9
- package/dist/config/project.d.ts +0 -10
- package/dist/config/schema.d.ts +0 -2143
- package/dist/constants.d.ts +0 -65
- package/dist/errors/boundary.d.ts +0 -43
- package/dist/errors/constructors.d.ts +0 -411
- package/dist/errors/format.d.ts +0 -31
- package/dist/errors/index.d.ts +0 -4
- package/dist/errors/types.d.ts +0 -270
- package/dist/hooks/config.d.ts +0 -21
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/router.d.ts +0 -58
- package/dist/hooks/runner.d.ts +0 -88
- package/dist/hooks/service.d.ts +0 -38
- package/dist/hooks/slash.d.ts +0 -48
- package/dist/hooks/trust.d.ts +0 -46
- package/dist/hooks/types.d.ts +0 -147
- package/dist/index.d.ts +0 -2
- package/dist/indexing/chunker.d.ts +0 -28
- package/dist/indexing/embedder.d.ts +0 -98
- package/dist/indexing/index.d.ts +0 -9
- package/dist/indexing/indexer.d.ts +0 -45
- package/dist/indexing/retriever.d.ts +0 -61
- package/dist/indexing/service.d.ts +0 -49
- package/dist/indexing/store.d.ts +0 -103
- package/dist/indexing/types.d.ts +0 -78
- package/dist/indexing/util.d.ts +0 -34
- package/dist/indexing/walker.d.ts +0 -53
- package/dist/jobs/approval-queue.d.ts +0 -85
- package/dist/jobs/dispatch-tool.d.ts +0 -34
- package/dist/jobs/index.d.ts +0 -6
- package/dist/jobs/log-buffer.d.ts +0 -31
- package/dist/jobs/log-renderer.d.ts +0 -32
- package/dist/jobs/manager.d.ts +0 -139
- package/dist/jobs/types.d.ts +0 -81
- package/dist/lsp/client.d.ts +0 -25
- package/dist/lsp/index.d.ts +0 -8
- package/dist/lsp/pool.d.ts +0 -48
- package/dist/lsp/registry.d.ts +0 -38
- package/dist/lsp/server.d.ts +0 -48
- package/dist/lsp/service.d.ts +0 -44
- package/dist/lsp/tools/common.d.ts +0 -50
- package/dist/lsp/tools/find-definition.d.ts +0 -23
- package/dist/lsp/tools/find-references.d.ts +0 -23
- package/dist/lsp/tools/get-diagnostics.d.ts +0 -17
- package/dist/lsp/tools/hover.d.ts +0 -23
- package/dist/lsp/tools/index.d.ts +0 -4
- package/dist/lsp/transport.d.ts +0 -39
- package/dist/lsp/types.d.ts +0 -107
- package/dist/mcp/adapter.d.ts +0 -44
- package/dist/mcp/bounds.d.ts +0 -35
- package/dist/mcp/client.d.ts +0 -19
- package/dist/mcp/demarcate.d.ts +0 -12
- package/dist/mcp/http-transport.d.ts +0 -89
- package/dist/mcp/index.d.ts +0 -12
- package/dist/mcp/service.d.ts +0 -71
- package/dist/mcp/sibling-banner.d.ts +0 -25
- package/dist/mcp/transport.d.ts +0 -30
- package/dist/mcp/trust-gate.d.ts +0 -59
- package/dist/mcp/trust.d.ts +0 -62
- package/dist/mcp/types.d.ts +0 -62
- package/dist/mcp/url-guard.d.ts +0 -48
- package/dist/memory/index.d.ts +0 -7
- package/dist/memory/recall.d.ts +0 -56
- package/dist/memory/remember-tool.d.ts +0 -28
- package/dist/memory/secrets.d.ts +0 -29
- package/dist/memory/service.d.ts +0 -92
- package/dist/memory/store.d.ts +0 -32
- package/dist/memory/trust.d.ts +0 -52
- package/dist/memory/types.d.ts +0 -101
- package/dist/net/ip-guard.d.ts +0 -55
- package/dist/onboarding/detect.d.ts +0 -26
- package/dist/onboarding/flow.d.ts +0 -28
- package/dist/onboarding/index.d.ts +0 -5
- package/dist/onboarding/io.d.ts +0 -9
- package/dist/onboarding/steps.d.ts +0 -17
- package/dist/onboarding/types.d.ts +0 -81
- package/dist/plan/approve.d.ts +0 -16
- package/dist/plan/execute.d.ts +0 -28
- package/dist/plan/index.d.ts +0 -7
- package/dist/plan/policy.d.ts +0 -26
- package/dist/plan/render.d.ts +0 -5
- package/dist/plan/service.d.ts +0 -58
- package/dist/plan/submit-plan.d.ts +0 -33
- package/dist/plan/types.d.ts +0 -60
- package/dist/render/capabilities.d.ts +0 -31
- package/dist/render/diff.d.ts +0 -18
- package/dist/render/highlight.d.ts +0 -47
- package/dist/render/index.d.ts +0 -22
- package/dist/render/layout.d.ts +0 -59
- package/dist/render/motion.d.ts +0 -76
- package/dist/render/plain-renderer.d.ts +0 -39
- package/dist/render/resize.d.ts +0 -36
- package/dist/render/screen-reader-renderer.d.ts +0 -45
- package/dist/render/state.d.ts +0 -49
- package/dist/render/tty-renderer.d.ts +0 -106
- package/dist/render/types.d.ts +0 -201
- package/dist/routing/index.d.ts +0 -2
- package/dist/routing/resolve.d.ts +0 -17
- package/dist/routing/router.d.ts +0 -47
- package/dist/routing/types.d.ts +0 -42
- package/dist/sandbox/detect.d.ts +0 -22
- package/dist/sandbox/docker-runtime.d.ts +0 -32
- package/dist/sandbox/index.d.ts +0 -7
- package/dist/sandbox/policy.d.ts +0 -26
- package/dist/sandbox/service.d.ts +0 -64
- package/dist/sandbox/types.d.ts +0 -123
- package/dist/skills/index.d.ts +0 -4
- package/dist/skills/loader.d.ts +0 -43
- package/dist/skills/parser.d.ts +0 -31
- package/dist/skills/service.d.ts +0 -41
- package/dist/skills/types.d.ts +0 -94
- package/dist/subagent/index.d.ts +0 -5
- package/dist/subagent/orchestrator.d.ts +0 -169
- package/dist/subagent/registry-scope.d.ts +0 -41
- package/dist/subagent/semaphore.d.ts +0 -56
- package/dist/subagent/spawn-tool.d.ts +0 -86
- package/dist/subagent/types.d.ts +0 -65
- package/dist/testing/detect.d.ts +0 -3
- package/dist/testing/index.d.ts +0 -5
- package/dist/testing/parse.d.ts +0 -33
- package/dist/testing/run-tests-tool.d.ts +0 -64
- package/dist/testing/runner.d.ts +0 -26
- package/dist/testing/sandbox-runner.d.ts +0 -16
- package/dist/testing/types.d.ts +0 -66
- package/dist/theme/index.d.ts +0 -2
- package/dist/theme/resolve.d.ts +0 -43
- package/dist/theme/tokens.d.ts +0 -119
- package/dist/tools/create-pull-request.d.ts +0 -27
- package/dist/tools/file/apply-patch.d.ts +0 -94
- package/dist/tools/file/edit-file.d.ts +0 -12
- package/dist/tools/file/glob.d.ts +0 -17
- package/dist/tools/file/grep-files.d.ts +0 -43
- package/dist/tools/file/index.d.ts +0 -7
- package/dist/tools/file/match.d.ts +0 -43
- package/dist/tools/file/paths.d.ts +0 -160
- package/dist/tools/file/read-file.d.ts +0 -8
- package/dist/tools/file/write-file.d.ts +0 -10
- package/dist/tools/git-status.d.ts +0 -15
- package/dist/tools/index.d.ts +0 -9
- package/dist/tools/list-files.d.ts +0 -13
- package/dist/tools/list-skills.d.ts +0 -9
- package/dist/tools/load-skill.d.ts +0 -21
- package/dist/tools/registry.d.ts +0 -23
- package/dist/tools/search-codebase.d.ts +0 -35
- package/dist/tools/shell/exec.d.ts +0 -53
- package/dist/tools/shell/index.d.ts +0 -1
- package/dist/tools/shell/resolve-shell.d.ts +0 -81
- package/dist/tools/shell/run-command.d.ts +0 -14
- package/dist/tools/types.d.ts +0 -257
- package/dist/usage/collect.d.ts +0 -40
- package/dist/usage/cost.d.ts +0 -19
- package/dist/usage/index.d.ts +0 -15
- package/dist/usage/store.d.ts +0 -37
- package/dist/usage/summary.d.ts +0 -32
- package/dist/usage/types.d.ts +0 -220
- package/dist/utils/child-tree.d.ts +0 -33
- package/dist/utils/git.d.ts +0 -17
- package/dist/utils/logger.d.ts +0 -18
- package/dist/utils/process-tree.d.ts +0 -16
- package/dist/vcs/auth.d.ts +0 -22
- package/dist/vcs/generate.d.ts +0 -74
- package/dist/vcs/git.d.ts +0 -60
- package/dist/vcs/github.d.ts +0 -50
- package/dist/vcs/guidance.d.ts +0 -20
- package/dist/vcs/index.d.ts +0 -7
- package/dist/vcs/service.d.ts +0 -61
- package/dist/vcs/types.d.ts +0 -73
- package/dist/web/demarcate.d.ts +0 -13
- package/dist/web/fetch.d.ts +0 -11
- package/dist/web/index.d.ts +0 -7
- package/dist/web/provider.d.ts +0 -29
- package/dist/web/search.d.ts +0 -17
- package/dist/web/ssrf.d.ts +0 -41
- package/dist/web/tools.d.ts +0 -20
- package/dist/web/types.d.ts +0 -64
- package/dist/workspace/add-root.d.ts +0 -27
- package/dist/workspace/index.d.ts +0 -6
- package/dist/workspace/resolve.d.ts +0 -54
- package/dist/workspace/select.d.ts +0 -41
- package/dist/workspace/types.d.ts +0 -30
- package/dist/workspace/workspace.d.ts +0 -61
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { DeclaredRoot, RootSpec } from "./types.js";
|
|
2
|
-
export { Workspace, buildWorkspace, sessionWorkspace } from "./workspace.js";
|
|
3
|
-
export { PathEscapeError, confineToRoot, isInside, resolveInWorkspace, } from "./resolve.js";
|
|
4
|
-
export { selectRoot } from "./select.js";
|
|
5
|
-
export type { RootRef, SelectedRoot } from "./select.js";
|
|
6
|
-
export { addRootToWorkspace, type AddRootOptions } from "./add-root.js";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { CruxyError } from "../errors/index.js";
|
|
2
|
-
import type { Workspace } from "./workspace.js";
|
|
3
|
-
/**
|
|
4
|
-
* The single path-confinement funnel for the whole CLI (C.26). Two things live
|
|
5
|
-
* here so there is exactly ONE confinement implementation, not several:
|
|
6
|
-
* • {@link confineToRoot} — the pure 2-layer check (lexical + symlink) against
|
|
7
|
-
* ONE root. It never sees any other root, which is the structural argument
|
|
8
|
-
* that a validated target can't cross into a sibling root.
|
|
9
|
-
* • {@link resolveInWorkspace} — select the one named root, then confine to it.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Thrown when a tool argument resolves to a path outside the root it is acting in
|
|
13
|
-
* — via `../` traversal, an absolute path, an outward symlink, OR a path that
|
|
14
|
-
* lands in a *different* declared root. A cross-root path is deliberately the
|
|
15
|
-
* SAME error as any other escape (R2): a distinct code would wrongly imply
|
|
16
|
-
* "less bad". A {@link CruxyError} (code CRUXY_E_PATH_ESCAPE) so it carries a code
|
|
17
|
-
* if it reaches the boundary; tools still catch it and surface `{ ok:false }`.
|
|
18
|
-
*/
|
|
19
|
-
export declare class PathEscapeError extends CruxyError {
|
|
20
|
-
constructor(message: string);
|
|
21
|
-
}
|
|
22
|
-
/** Is `target` the root itself or a descendant of it? */
|
|
23
|
-
export declare function isInside(root: string, target: string): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Resolve `p` against a SINGLE root and prove it stays inside — the pure kernel
|
|
26
|
-
* every file tool ultimately funnels through.
|
|
27
|
-
*
|
|
28
|
-
* Two layers: (1) a lexical check that the resolved absolute path is within root
|
|
29
|
-
* (rejects `../` and absolute-outside before touching the FS); (2) a symlink
|
|
30
|
-
* check that the real target — or, for a new path, its nearest existing parent —
|
|
31
|
-
* resolves inside the *real* root. The root is realpath'd too, so this is correct
|
|
32
|
-
* even when the root itself sits under a symlink (macOS `/var → /private/var`).
|
|
33
|
-
*
|
|
34
|
-
* Crucially, this function is a pure function of `(one root, the path)`. The rest
|
|
35
|
-
* of the declared root set is NOT in scope here, so there is no code path by
|
|
36
|
-
* which a target validated against this root can be accepted into another root.
|
|
37
|
-
*
|
|
38
|
-
* @returns the resolved absolute path (lexical, not realpath'd — so callers
|
|
39
|
-
* operate on the intended location).
|
|
40
|
-
* @throws {PathEscapeError} if the path escapes the root.
|
|
41
|
-
*/
|
|
42
|
-
export declare function confineToRoot(rootAbsPath: string, p: string): Promise<string>;
|
|
43
|
-
/**
|
|
44
|
-
* Resolve a tool-supplied path against ONE named root of the workspace and prove
|
|
45
|
-
* it stays inside that root. Selection happens first (by exact name — see
|
|
46
|
-
* {@link Workspace.rootByName}, which fail-loud refuses an unknown name), and
|
|
47
|
-
* confinement runs against only that one root's path. A `../otherRoot/x` that
|
|
48
|
-
* would land in a sibling declared root is refused exactly as any escape is (R2),
|
|
49
|
-
* because {@link confineToRoot} is only ever handed this one root.
|
|
50
|
-
*
|
|
51
|
-
* @throws {CruxyError} CRUXY_E_ROOT_UNKNOWN if `rootName` is not declared.
|
|
52
|
-
* @throws {PathEscapeError} if `p` escapes the selected root.
|
|
53
|
-
*/
|
|
54
|
-
export declare function resolveInWorkspace(ws: Workspace, rootName: string, p: string): Promise<string>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { DeclaredRoot } from "./types.js";
|
|
2
|
-
import type { Workspace } from "./workspace.js";
|
|
3
|
-
/**
|
|
4
|
-
* How a tool call addresses a workspace root (C.26, R1). Either an explicit `root`
|
|
5
|
-
* name plus a root-relative `path`, or just a `path` that may carry a leading
|
|
6
|
-
* root-name segment. Bare relative paths fall back to the primary root; absolute
|
|
7
|
-
* paths select the unique root that contains them.
|
|
8
|
-
*/
|
|
9
|
-
export interface RootRef {
|
|
10
|
-
/** Explicit root name (`root: "service"`). Wins over any name in `path`. */
|
|
11
|
-
readonly root?: string;
|
|
12
|
-
/** The path argument (root-relative, name-prefixed, or absolute). */
|
|
13
|
-
readonly path: string;
|
|
14
|
-
}
|
|
15
|
-
/** The outcome of resolving a {@link RootRef}: the chosen root + a path within it. */
|
|
16
|
-
export interface SelectedRoot {
|
|
17
|
-
readonly root: DeclaredRoot;
|
|
18
|
-
/** The path to hand to `confineToRoot` (root-relative or absolute-inside). */
|
|
19
|
-
readonly relPath: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Resolve a {@link RootRef} to exactly one declared root and a path within it —
|
|
23
|
-
* the selection half of confinement, run BEFORE any resolution so a call always
|
|
24
|
-
* commits to a single root first (§1.1). Precedence:
|
|
25
|
-
*
|
|
26
|
-
* 1. explicit `root` name → that root, exactly (fail-loud on unknown name);
|
|
27
|
-
* 2. absolute `path` → the unique declared root containing it (fail-loud on
|
|
28
|
-
* unknown / — defensively — ambiguous);
|
|
29
|
-
* 3. `path` whose first segment exactly matches a declared root name → that
|
|
30
|
-
* root, with the segment stripped (only when the name is unambiguous);
|
|
31
|
-
* 4. bare relative `path` → the primary root.
|
|
32
|
-
*
|
|
33
|
-
* `requireExplicit` (set by mutating tools per ⚖︎#3) refuses the case-4 default
|
|
34
|
-
* in a multi-root session: a write must NAME its root rather than silently land
|
|
35
|
-
* in the primary. Read/enumeration tools leave it false.
|
|
36
|
-
*
|
|
37
|
-
* @throws CRUXY_E_ROOT_UNKNOWN / CRUXY_E_ROOT_AMBIGUOUS per the rules above.
|
|
38
|
-
*/
|
|
39
|
-
export declare function selectRoot(ws: Workspace, ref: RootRef, opts?: {
|
|
40
|
-
requireExplicit?: boolean;
|
|
41
|
-
}): SelectedRoot;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-repo workspace model (C.26). A session may operate across N repo/package
|
|
3
|
-
* roots. The {@link Workspace} is the single value that carries the declared root
|
|
4
|
-
* set; every path-taking tool resolves *through* it rather than through a bare
|
|
5
|
-
* `cwd` string.
|
|
6
|
-
*
|
|
7
|
-
* Two invariants the type system helps enforce:
|
|
8
|
-
* • The root set is **immutable for the session** — a {@link Workspace} exposes
|
|
9
|
-
* no mutator, so nothing the model can call adds a root. The set only grows by
|
|
10
|
-
* the CLI constructing a *new* Workspace from an explicit human act (argv, or
|
|
11
|
-
* an interactive add-root that prompts + trusts first).
|
|
12
|
-
* • Roots are addressed by a stable **name** (R1), matched **exactly** — never
|
|
13
|
-
* by prefix or nearest-match. An unknown name is a fail-loud refusal.
|
|
14
|
-
*/
|
|
15
|
-
/** One declared workspace root: a stable name + its resolved absolute path. */
|
|
16
|
-
export interface DeclaredRoot {
|
|
17
|
-
/** Stable, user-facing identifier (assigned at declaration, unique per session). */
|
|
18
|
-
readonly name: string;
|
|
19
|
-
/** Absolute, lexically-resolved path (realpath is applied at confinement time). */
|
|
20
|
-
readonly absPath: string;
|
|
21
|
-
/** Exactly one root is primary — the default for bare relative paths + git info. */
|
|
22
|
-
readonly primary: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** A root as declared on the CLI (or interactively), before resolution/validation. */
|
|
25
|
-
export interface RootSpec {
|
|
26
|
-
/** Explicit name (`--root name=path`); defaults to a deduped basename of `path`. */
|
|
27
|
-
readonly name?: string;
|
|
28
|
-
/** Path as supplied (resolved against `process.cwd()` by `buildWorkspace`). */
|
|
29
|
-
readonly path: string;
|
|
30
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { DeclaredRoot, RootSpec } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* The declared workspace root set for a session (C.26). Immutable by design: it
|
|
4
|
-
* exposes readers only, no mutator. The root set grows solely by the CLI building
|
|
5
|
-
* a *new* Workspace from an explicit human act — so no tool, and nothing the model
|
|
6
|
-
* emits, can add a root. Roots are addressed by exact name (R1).
|
|
7
|
-
*/
|
|
8
|
-
export declare class Workspace {
|
|
9
|
-
private readonly rootsByName;
|
|
10
|
-
private readonly ordered;
|
|
11
|
-
private readonly primaryRoot;
|
|
12
|
-
constructor(roots: readonly DeclaredRoot[]);
|
|
13
|
-
/** All declared roots, in declaration order. */
|
|
14
|
-
roots(): readonly DeclaredRoot[];
|
|
15
|
-
/** The primary root — the default for bare relative paths and git/instructions. */
|
|
16
|
-
primary(): DeclaredRoot;
|
|
17
|
-
/** True when more than one root is declared (i.e. a genuine multi-repo session). */
|
|
18
|
-
get isMultiRoot(): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Look up a root by EXACT name (R1). Never fuzzy-, prefix-, or nearest-matched
|
|
21
|
-
* — a silent near-match would be a cross-root misfire.
|
|
22
|
-
* @throws {CruxyError} CRUXY_E_ROOT_UNKNOWN if no root has that exact name.
|
|
23
|
-
*/
|
|
24
|
-
rootByName(name: string): DeclaredRoot;
|
|
25
|
-
/** Like {@link rootByName} but returns undefined instead of throwing. */
|
|
26
|
-
tryRootByName(name: string): DeclaredRoot | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* The single declared root that contains `absPath`. Roots never overlap (that's
|
|
29
|
-
* refused at declaration), so at most one can match.
|
|
30
|
-
* @throws CRUXY_E_ROOT_UNKNOWN if the path is inside no declared root.
|
|
31
|
-
* @throws CRUXY_E_ROOT_AMBIGUOUS if — defensively — it matches more than one.
|
|
32
|
-
*/
|
|
33
|
-
rootContaining(absPath: string): DeclaredRoot;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Build a {@link Workspace} from declared specs (R1, ⚖︎#5). Each path is resolved
|
|
37
|
-
* against `process.cwd()`, must exist and be a directory, and the set must not
|
|
38
|
-
* overlap (a root nested in / equal to another is refused — declare the monorepo
|
|
39
|
-
* root OR its packages, never both). The first spec is primary unless one is
|
|
40
|
-
* marked. Names are explicit-or-basename, validated, and deduped.
|
|
41
|
-
*
|
|
42
|
-
* This is the ONLY constructor of a Workspace from user input; it is called by the
|
|
43
|
-
* CLI from argv and by the interactive add-root path — never from a tool.
|
|
44
|
-
*
|
|
45
|
-
* @throws CRUXY_E_ROOT_OVERLAP on a nested/overlapping/duplicate root.
|
|
46
|
-
* @throws CRUXY_E_USAGE on a missing path, non-directory, or bad/duplicate name.
|
|
47
|
-
*/
|
|
48
|
-
export declare function buildWorkspace(specs: readonly RootSpec[], opts?: {
|
|
49
|
-
cwd?: string;
|
|
50
|
-
}): Promise<Workspace>;
|
|
51
|
-
/**
|
|
52
|
-
* Build THE session's workspace from a single absolute path — the trivial
|
|
53
|
-
* single-root case. This is a *session construction* primitive, not a per-call
|
|
54
|
-
* fallback: after C.26 Step 6 it is called ONLY at the two CLI entry points that
|
|
55
|
-
* turn argv into a session (`cli/commands/run.ts`, `cli/onboard.ts`), never in the
|
|
56
|
-
* middle of a subsystem. Synthesizing one elsewhere would silently scope that
|
|
57
|
-
* subsystem to its own cwd while the fan tools see N roots (a split-brain) — the
|
|
58
|
-
* `no-split-brain` guard fails on any `sessionWorkspace(` outside those two files.
|
|
59
|
-
* The one root is primary and named by its basename.
|
|
60
|
-
*/
|
|
61
|
-
export declare function sessionWorkspace(absPath: string): Workspace;
|