Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
4b7a4a2
refactor(cli): extract sandbox live state helpers
cv May 2, 2026
2ce87dd
refactor(cli): extract sandbox skill install action
cv May 2, 2026
4cd3cf3
refactor(cli): extract sandbox connect action
cv May 3, 2026
e9dd46e
refactor(cli): extract sandbox status action
cv May 3, 2026
aab6c86
refactor(cli): extract sandbox doctor action
cv May 3, 2026
8908521
refactor(cli): extract sandbox destroy action
cv May 3, 2026
56e4f05
refactor(cli): extract sandbox rebuild action
cv May 3, 2026
8bf1958
refactor(cli): extract upgrade sandboxes action
cv May 3, 2026
38eb84d
refactor(cli): remove runtime bridge
cv May 3, 2026
b2ad5da
refactor(cli): remove legacy dispatch fallbacks
cv May 3, 2026
edd2650
refactor(cli): expose explicit main entrypoint
cv May 3, 2026
a15da95
refactor(cli): add oclif examples for utility commands
cv May 3, 2026
4f57ebb
refactor(cli): validate logs flags with oclif
cv May 3, 2026
8b2d077
refactor(cli): improve sandbox diagnostic command metadata
cv May 3, 2026
a09cc51
refactor(cli): tighten policy and channel parser validation
cv May 3, 2026
75857dc
refactor(cli): improve snapshot command metadata
cv May 3, 2026
11c0676
refactor(cli): require skill install path in oclif
cv May 3, 2026
05f9eca
refactor(cli): add lifecycle confirmation flag aliases
cv May 3, 2026
4ebeae4
refactor(cli): split share into oclif subcommands
cv May 3, 2026
7d72437
Revert "refactor(cli): split share into oclif subcommands"
cv May 3, 2026
0ee5ca5
refactor(cli): split share into oclif subcommands
cv May 3, 2026
928219c
refactor(cli): model debug flags with oclif
cv May 3, 2026
36cce5e
refactor(cli): model onboard flags with oclif
cv May 3, 2026
702afb1
docs: sync oclif UX command reference
cv May 3, 2026
3224350
refactor(cli): extract public argv normalizer
cv May 3, 2026
cd4cdb8
refactor(cli): rename oclif dispatch module
cv May 3, 2026
9499ca6
refactor(cli): normalize policy command ids
cv May 3, 2026
42028ef
test(cli): require oclif command metadata
cv May 3, 2026
a05c6b3
refactor(cli): return typed debug parse results
cv May 3, 2026
1875fe9
refactor(cli): add public command display ids
cv May 3, 2026
36f1dbe
refactor(cli): use oclif summaries in root help
cv May 3, 2026
78bfd5a
refactor(cli): table-drive sandbox dispatch
cv May 3, 2026
96ce61f
refactor(cli): normalize gateway token command id
cv May 3, 2026
266ebc9
refactor(cli): render public oclif help
cv May 3, 2026
dc98994
refactor(cli): add shared oclif command base
cv May 3, 2026
d0d2a70
refactor(cli): use oclif flag relationships
cv May 3, 2026
8396c06
refactor(cli): pass lifecycle typed options
cv May 3, 2026
1532b19
refactor(cli): parse durations with oclif flags
cv May 3, 2026
7c0445a
refactor(cli): project public help through oclif
cv May 3, 2026
3978c32
test(cli): cover oclif metadata routing helpers
cv May 3, 2026
591eabb
test(cli): cover global oclif command adapters
cv May 3, 2026
8a6ecbc
test(cli): cover sandbox oclif command adapters
cv May 3, 2026
e5aa22f
refactor(cli): split share oclif commands
cv May 3, 2026
e179336
test(cli): narrow sandbox logs coverage ignores
cv May 3, 2026
a629813
test(cli): cover remaining global oclif adapters
cv May 3, 2026
c5954e7
test(cli): cover credentials oclif adapter
cv May 3, 2026
3380de9
test(cli): cover runtime utility helpers
cv May 3, 2026
f60a190
test(cli): improve global adapter coverage
cv May 3, 2026
78a16d1
merge: sync simple global adapter coverage
cv May 3, 2026
a58dc90
merge: sync credentials adapter coverage
cv May 3, 2026
034454f
merge: include credentials adapter coverage
cv May 3, 2026
28bc497
merge: sync combined global adapter coverage
cv May 3, 2026
e9ed6ba
test(cli): cover global action facade
cv May 3, 2026
00b288c
merge: sync global action facade coverage
cv May 3, 2026
7bd5f32
test(cli): stabilize coverage dist sourcemaps
cv May 4, 2026
d4b55d9
test(cli): rebaseline clean-dist function coverage
cv May 4, 2026
b872474
refactor(cli): extract maintenance image helpers
cv May 4, 2026
4965762
refactor(cli): extract upgrade sandbox helpers
cv May 4, 2026
9acd660
refactor(cli): extract sandbox destroy helpers
cv May 4, 2026
cc0eaa1
refactor(cli): extract sandbox logs helpers
cv May 4, 2026
847e115
refactor(cli): extract policy channel helpers
cv May 4, 2026
b6c0f5a
test(cli): allow clean coverage variance
cv May 4, 2026
5c98bd1
merge: sync coverage stabilization
cv May 4, 2026
4754f3e
merge: sync maintenance helper extraction
cv May 4, 2026
96f0758
merge: sync upgrade helper extraction
cv May 4, 2026
b6bd105
merge: sync destroy helper extraction
cv May 4, 2026
98fb75d
merge: sync logs helper extraction
cv May 4, 2026
5920d5b
test(cli): keep destroy helpers outside coverage ratchet
cv May 4, 2026
64d1646
merge: sync destroy helper coverage boundary
cv May 4, 2026
717c482
test(cli): keep logs helpers outside coverage ratchet
cv May 4, 2026
688074f
merge: sync logs helper coverage boundary
cv May 4, 2026
1314270
test(cli): keep policy channel helpers outside coverage ratchet
cv May 4, 2026
79d81c2
refactor(cli): group oclif core modules
cv May 4, 2026
5453a89
refactor(cli): split oclif commands by command tree
cv May 4, 2026
bbc297f
test(cli): reset credential command helper cache
cv May 4, 2026
25224c1
test(cli): avoid generic warning assertion in debug output
cv May 4, 2026
1ed9256
refactor(cli): group pure domain helpers
cv May 4, 2026
51799e4
refactor(cli): group openshell adapters
cv May 4, 2026
0b1e877
test(cli): enforce initial layer import boundaries
cv May 4, 2026
91d750b
refactor(cli): group sandbox actions
cv May 4, 2026
4321d63
refactor(cli): group global actions
cv May 4, 2026
5bc2242
test(cli): format layer boundary checker
cv May 4, 2026
073225e
ci(prek): tolerate unmatched biome format chunks
cv May 4, 2026
29a26ae
refactor(cli): group state modules
cv May 4, 2026
f25fcce
Merge branch 'test/layer-import-boundaries' into refactor/layer-sandb…
cv May 4, 2026
301b0a7
Merge branch 'refactor/layer-sandbox-actions' into refactor/layer-glo…
cv May 4, 2026
668235a
Merge branch 'refactor/layer-global-actions' into refactor/layer-stat…
cv May 4, 2026
7f14fbb
test(cli): update gateway state test description
cv May 6, 2026
176aed0
merge(main): reconcile state module grouping
cv May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ reviews:
gh workflow run nightly-e2e.yaml --ref <branch> -f jobs=deployment-services-e2e
```

- path: "src/lib/sandbox-state.ts"
- path: "src/lib/state/sandbox.ts"
instructions: |
This file manages sandbox state (backup, restore, rebuild,
snapshot). Changes affect data persistence across sandbox
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-legacy-migrated-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ type GuardedPath = {
const RUNTIME_MOVES: Record<string, string> = moveMap.runtimeMoves;
const REMOVED_SHIM_MOVES: Record<string, string> = {
"bin/lib/chat-filter.js": "src/lib/chat-filter.ts",
"bin/lib/config-io.js": "src/lib/config-io.ts",
"bin/lib/config-io.js": "src/lib/state/config-io.ts",
"bin/lib/debug.js": "src/lib/debug.ts",
"bin/lib/inference-config.js": "src/lib/inference-config.ts",
"bin/lib/local-inference.js": "src/lib/local-inference.ts",
"bin/lib/nim.js": "src/lib/nim.ts",
"bin/lib/onboard-session.js": "src/lib/onboard-session.ts",
"bin/lib/platform.js": "src/lib/platform.ts",
"bin/lib/preflight.js": "src/lib/preflight.ts",
"bin/lib/registry.js": "src/lib/registry.ts",
"bin/lib/registry.js": "src/lib/state/registry.ts",
"bin/lib/resolve-openshell.js": "src/lib/adapters/openshell/resolve.ts",
"bin/lib/runtime-recovery.js": "src/lib/runtime-recovery.ts",
"bin/lib/sandbox-build-context.js": "src/lib/sandbox-build-context.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev-tier-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const readline = require("readline");
// ── Stubs ──────────────────────────────────────────────────────────────────
const creds = require("../dist/lib/credentials.js");
const runner = require("../dist/lib/runner.js");
const registry = require("../dist/lib/registry.js");
const registry = require("../dist/lib/state/registry.js");

creds.ensureApiKey = async () => {};
creds.getCredential = () => null;
Expand Down
2 changes: 1 addition & 1 deletion scripts/ts-migration-assist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SPECIAL_REWRITES: Record<string, Array<[string, string]>> = {
['require("./platform")', 'require("../../bin/lib/platform")'],
['require("./resolve-openshell")', 'require("../../bin/lib/resolve-openshell")'],
['require("./credentials")', 'require("../../bin/lib/credentials")'],
['require("./registry")', 'require("../../bin/lib/registry")'],
['require("./state/registry")', 'require("../../bin/lib/registry")'],
['require("./nim")', 'require("../../bin/lib/nim")'],
['require("./onboard-session")', 'require("../../bin/lib/onboard-session")'],
['require("./policies")', 'require("../../bin/lib/policies")'],
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actions/maintenance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
import { dockerListImagesFormat, dockerRmi } from "../docker";
import { findOrphanedSandboxImages, parseSandboxImageRows } from "../domain/maintenance/images";
import { captureOpenshell } from "../adapters/openshell/runtime";
import * as registry from "../registry";
import * as registry from "../state/registry";
import { parseLiveSandboxNames } from "../runtime-recovery";
import * as sandboxState from "../sandbox-state";
import * as sandboxState from "../state/sandbox";

const useColor = !process.env.NO_COLOR && !!process.stdout.isTTY;
const trueColor =
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actions/sandbox/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import {
runOpenshell,
} from "../../adapters/openshell/runtime";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../../adapters/openshell/timeouts";
import * as registry from "../../registry";
import * as registry from "../../state/registry";
import { ROOT } from "../../runner";
import { ensureLiveSandboxOrExit } from "./gateway-state";
import {
createSystemDeps as createSessionDeps,
getActiveSandboxSessions,
} from "../../sandbox-session-state";
} from "../../state/sandbox-session";
import { checkAndRecoverSandboxProcesses } from "./process-recovery";
import * as sandboxVersion from "../../sandbox-version";
import { D, G, R, YW } from "../../terminal-style";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actions/sandbox/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import * as onboardSession from "../../onboard-session";
import type { Session } from "../../onboard-session";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../../adapters/openshell/timeouts";
import { DASHBOARD_PORT } from "../../ports";
import * as registry from "../../registry";
import * as registry from "../../state/registry";
import { resolveOpenshell } from "../../adapters/openshell/resolve";
import { parseLiveSandboxNames } from "../../runtime-recovery";
import {
createSystemDeps as createSessionDeps,
getActiveSandboxSessions,
} from "../../sandbox-session-state";
} from "../../state/sandbox-session";
import {
getSandboxDeleteOutcome,
shouldCleanupGatewayAfterDestroy,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actions/sandbox/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { stripAnsi } from "../../adapters/openshell/client";
import { captureOpenshell } from "../../adapters/openshell/runtime";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../../adapters/openshell/timeouts";
import { GATEWAY_PORT, OLLAMA_PORT } from "../../ports";
import * as registry from "../../registry";
import type { SandboxEntry } from "../../registry";
import * as registry from "../../state/registry";
import type { SandboxEntry } from "../../state/registry";
import { resolveOpenshell } from "../../adapters/openshell/resolve";
import { ROOT } from "../../runner";
import { parseLiveSandboxNames } from "../../runtime-recovery";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actions/sandbox/gateway-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import os from "node:os";
import path from "node:path";

import { CLI_DISPLAY_NAME, CLI_NAME } from "../../branding";
import { parseSandboxPhase } from "../../gateway-state";
import { parseSandboxPhase } from "../../state/gateway";
import {
getNamedGatewayLifecycleState,
recoverNamedGatewayRuntime,
Expand All @@ -30,7 +30,7 @@ import {
OPENSHELL_OPERATION_TIMEOUT_MS,
OPENSHELL_PROBE_TIMEOUT_MS,
} from "../../adapters/openshell/timeouts";
import * as registry from "../../registry";
import * as registry from "../../state/registry";

type SandboxGatewayState = {
state: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/sandbox/policy-channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { isNonInteractive } = require("../../onboard") as { isNonInteractive: ()
const onboardProviders = require("../../onboard-providers");
import * as policies from "../../policies";
import { parsePolicyAddArgs } from "../../domain/policy-channel";
import * as registry from "../../registry";
import * as registry from "../../state/registry";
import { runOpenshell } from "../../adapters/openshell/runtime";
import { rebuildSandbox } from "./runtime";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/sandbox/process-recovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
runOpenshell,
} from "../../adapters/openshell/runtime";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../../adapters/openshell/timeouts";
import { parseForwardList } from "../../sandbox-session-state";
import { parseForwardList } from "../../state/sandbox-session";
import { G, R } from "../../terminal-style";
import { sleepSeconds } from "../../wait";

Expand Down
6 changes: 3 additions & 3 deletions src/lib/actions/sandbox/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ import type { Session } from "../../onboard-session";
import * as onboardSession from "../../onboard-session";
import { captureOpenshell, runOpenshell } from "../../adapters/openshell/runtime";
import * as policies from "../../policies";
import * as registry from "../../registry";
import * as registry from "../../state/registry";
import { resolveOpenshell } from "../../adapters/openshell/resolve";
import { parseLiveSandboxNames } from "../../runtime-recovery";
import { removeSandboxRegistryEntry } from "./destroy";
import { executeSandboxCommand } from "./process-recovery";
import {
createSystemDeps as createSessionDeps,
getActiveSandboxSessions,
} from "../../sandbox-session-state";
import * as sandboxState from "../../sandbox-state";
} from "../../state/sandbox-session";
import * as sandboxState from "../../state/sandbox";
import * as sandboxVersion from "../../sandbox-version";
import { B, D, G, R, RD as _RD, YW } from "../../terminal-style";

Expand Down
8 changes: 4 additions & 4 deletions src/lib/actions/sandbox/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { parseLiveSandboxNames } from "../../runtime-recovery";
import { ROOT, run, shellQuote, validateName } from "../../runner";
import { captureOpenshell, getOpenshellBinary } from "../../adapters/openshell/runtime";
import * as policies from "../../policies";
import * as registry from "../../registry";
import type { SandboxEntry } from "../../registry";
import * as sandboxState from "../../sandbox-state";
import * as registry from "../../state/registry";
import type { SandboxEntry } from "../../state/registry";
import * as sandboxState from "../../state/sandbox";

const { parseRestoreArgs } = sandboxState;

Expand Down Expand Up @@ -119,7 +119,7 @@ async function autoCreateSandboxFromSource(
srcEntry: SandboxEntry | { name: string },
): Promise<void> {
const sandboxCreateStream = require("../../sandbox-create-stream");
const { isSandboxReady } = require("../../gateway-state");
const { isSandboxReady } = require("../../state/gateway");
const basePolicy = path.join(ROOT, "nemoclaw-blueprint", "policies", "openclaw-sandbox.yaml");
const openshellBin = getOpenshellBinary();

Expand Down
6 changes: 3 additions & 3 deletions src/lib/actions/sandbox/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* v8 ignore start -- exercised through CLI subprocess status tests. */

import { CLI_DISPLAY_NAME, CLI_NAME } from "../../branding";
import { parseSandboxPhase } from "../../gateway-state";
import { parseSandboxPhase } from "../../state/gateway";
import { getNamedGatewayLifecycleState } from "../../gateway-runtime-action";
import { parseGatewayInference } from "../../inference-config";
import { probeProviderHealth } from "../../inference-health";
Expand All @@ -15,7 +15,7 @@ import {
captureOpenshellForStatus,
isCommandTimeout,
} from "../../adapters/openshell/runtime";
import * as registry from "../../registry";
import * as registry from "../../state/registry";
import { resolveOpenshell } from "../../adapters/openshell/resolve";
import {
getReconciledSandboxGatewayState,
Expand All @@ -27,7 +27,7 @@ import { isSandboxGatewayRunningForStatus } from "./process-recovery";
import {
createSystemDeps as createSessionDeps,
getActiveSandboxSessions,
} from "../../sandbox-session-state";
} from "../../state/sandbox-session";
import * as sandboxVersion from "../../sandbox-version";
import * as shields from "../../shields";
import { D, G, R, RD, YW } from "../../terminal-style";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/upgrade-sandboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type UpgradeSandboxesOptions,
} from "../domain/lifecycle/options";
import { captureOpenshell } from "../adapters/openshell/runtime";
import * as registry from "../registry";
import * as registry from "../state/registry";
import { parseLiveSandboxNames } from "../runtime-recovery";
import { rebuildSandbox } from "./sandbox/rebuild";
import * as sandboxVersion from "../sandbox-version";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/agent-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// When the session agent is openclaw (or absent), all functions return
// defaults that match the hardcoded OpenClaw values on main.

import * as registry from "./registry";
import * as registry from "./state/registry";
import { DASHBOARD_PORT } from "./ports";
import * as onboardSession from "./onboard-session";
import { loadAgent, type AgentDefinition } from "./agent-defs";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/commands/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { runDebugCommandWithOptions } from "../debug-command";
import type { CaptureOpenshellResult } from "../adapters/openshell/client";
import { captureOpenshellCommand } from "../adapters/openshell/client";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../adapters/openshell/timeouts";
import * as registry from "../registry";
import * as registry from "../state/registry";
import { resolveOpenshell } from "../adapters/openshell/resolve";
import { parseLiveSandboxNames } from "../runtime-recovery";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/commands/simple-global-oclif-adapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ vi.mock("../actions/global", () => ({
showVersion: mocks.showVersion,
}));
vi.mock("../adapters/openshell/client", () => ({ captureOpenshellCommand: mocks.captureOpenshellCommand }));
vi.mock("../registry", () => ({ listSandboxes: mocks.listSandboxes }));
vi.mock("../state/registry", () => ({ listSandboxes: mocks.listSandboxes }));
vi.mock("../adapters/openshell/resolve", () => ({ resolveOpenshell: mocks.resolveOpenshell }));
vi.mock("../services", () => ({ startAll: mocks.startAll, stopAll: mocks.stopAll }));
vi.mock("../services-command", () => ({
Expand Down
2 changes: 1 addition & 1 deletion src/lib/commands/tunnel/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import * as registry from "../../registry";
import * as registry from "../../state/registry";

export function serviceDeps() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import os from "node:os";
import path from "node:path";
import readline from "node:readline";

import { rejectSymlinksOnPath } from "./config-io";
import { rejectSymlinksOnPath } from "./state/config-io";
import { isErrnoException } from "./errno";

const UNSAFE_HOME_PATHS = new Set(["/tmp", "/var/tmp", "/dev/shm", "/"]);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { platform, tmpdir } from "node:os";
import { basename, dirname, join } from "node:path";

import { DASHBOARD_PORT } from "./ports";
import { listSandboxes } from "./registry";
import { listSandboxes } from "./state/registry";

// ---------------------------------------------------------------------------
// Types
Expand Down
2 changes: 1 addition & 1 deletion src/lib/http-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "node:child_process";

import type { ProbeResult } from "./onboard-types";
import { ROOT } from "./paths";
import { ROOT } from "./state/paths";
import { compactText } from "./url-utils";

import { isErrnoException } from "./errno";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/list-command-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as onboardSession from "./onboard-session";
import type { ListSandboxesCommandDeps } from "./inventory-commands";
import { parseGatewayInference } from "./inference-config";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "./adapters/openshell/timeouts";
import { parseSshProcesses, createSystemDeps } from "./sandbox-session-state";
import { parseSshProcesses, createSystemDeps } from "./state/sandbox-session";
import { resolveOpenshell } from "./adapters/openshell/resolve";
import { captureOpenshell } from "./adapters/openshell/runtime";
import { recoverRegistryEntries } from "./registry-recovery-action";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/messaging-conflict.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { describe, expect, it, vi } from "vitest";

import type { SandboxEntry } from "./registry";
import type { SandboxEntry } from "./state/registry";
import {
backfillMessagingChannels,
findAllOverlaps,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/messaging-conflict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// added have no record — can optionally backfill the channel field by probing
// the live OpenShell gateway for known provider names.

import type { SandboxEntry } from "./registry";
import type { SandboxEntry } from "./state/registry";
import { getChannelDef, getChannelTokenKeys } from "./sandbox-channels";

type ProbeResult = "present" | "absent" | "error";
Expand Down
14 changes: 7 additions & 7 deletions src/lib/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const {
saveCredential,
} = credentials;
const { hashCredential }: typeof import("./credential-hash") = require("./credential-hash");
const registry: typeof import("./registry") = require("./registry");
const registry: typeof import("./state/registry") = require("./state/registry");
const nim: typeof import("./nim") = require("./nim");
const onboardSession: typeof import("./onboard-session") = require("./onboard-session");
const policies: typeof import("./policies") = require("./policies");
Expand All @@ -293,8 +293,8 @@ const {
const agentOnboard = require("./agent-onboard");
const agentDefs = require("./agent-defs");

const gatewayState: typeof import("./gateway-state") = require("./gateway-state");
const sandboxState: typeof import("./sandbox-state") = require("./sandbox-state");
const gatewayState: typeof import("./state/gateway") = require("./state/gateway");
const sandboxState: typeof import("./state/sandbox") = require("./state/sandbox");
const validation: typeof import("./validation") = require("./validation");
const urlUtils: typeof import("./url-utils") = require("./url-utils");
const buildContext = require("./build-context");
Expand All @@ -310,18 +310,18 @@ import type { AgentDefinition } from "./agent-defs";
import type { CurlProbeResult } from "./http-probe";
import type { GatewayInference, ProviderSelectionConfig } from "./inference-config";
import type { GpuInfo, ValidationResult } from "./local-inference";
import type { ContainerRuntime } from "./platform";
import type { SandboxEntry } from "./state/registry";
import type { Session, SessionUpdates } from "./onboard-session";
import type {
ModelCatalogFetchResult,
ModelValidationResult,
ProbeResult,
ValidationFailureLike,
} from "./onboard-types";
import type { ContainerRuntime } from "./platform";
import type { SandboxEntry } from "./registry";
import { listChannels } from "./sandbox-channels";
import type { StreamSandboxCreateResult } from "./sandbox-create-stream";
import type { BackupResult } from "./sandbox-state";
import type { BackupResult } from "./state/sandbox";
import type { TierDefinition, TierPreset } from "./tiers";
import type { SandboxCreateFailure, ValidationClassification } from "./validation";
import type { ProbeRecovery } from "./validation-recovery";
Expand Down Expand Up @@ -505,7 +505,7 @@ async function promptYesNoOrDefault(

// ── Helpers ──────────────────────────────────────────────────────

// Gateway state functions — delegated to src/lib/gateway-state.ts
// Gateway state functions — delegated to src/lib/state/gateway.ts
const {
isSandboxReady,
parseSandboxStatus,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const os = require("os");
const readline = require("readline");
const YAML = require("yaml");
const { ROOT, run, runCapture } = require("./runner");
const registry = require("./registry");
const registry = require("./state/registry");
const { loadAgent } = require("./agent-defs");

const PRESETS_DIR = path.join(ROOT, "nemoclaw-blueprint", "policies", "presets");
Expand Down
4 changes: 2 additions & 2 deletions src/lib/registry-recovery-action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

import type { SandboxEntry } from "./registry.js";
import type { SandboxEntry } from "./state/registry.js";

interface MockRegistryState {
sandboxes: Record<string, SandboxEntry>;
Expand All @@ -12,7 +12,7 @@ interface MockRegistryState {

const mockRegistryState: MockRegistryState = { sandboxes: {}, defaultSandbox: null };

vi.mock("./registry.js", () => ({
vi.mock("./state/registry.js", () => ({
listSandboxes: () => ({
sandboxes: Object.values(mockRegistryState.sandboxes),
defaultSandbox: mockRegistryState.defaultSandbox,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/registry-recovery-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { RecoveryResult } from "./inventory-commands";
import * as onboardSession from "./onboard-session";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "./adapters/openshell/timeouts";
import { captureOpenshell } from "./adapters/openshell/runtime";
import * as registry from "./registry";
import type { SandboxEntry } from "./registry";
import * as registry from "./state/registry";
import type { SandboxEntry } from "./state/registry";
import { resolveOpenshell } from "./adapters/openshell/resolve";
import { parseLiveSandboxNames } from "./runtime-recovery";
import { validateName } from "./runner";
Expand Down
Loading
Loading