fix(windows): update @composio imports to @aoagents scope
Our Windows-specific files were written before the @composio → @aoagents rename landed. Update all affected imports across runtime-process, workspace-clone, workspace-worktree, cli commands, and test files.
This commit is contained in:
parent
a828d09656
commit
b32f16068c
|
|
@ -12,9 +12,9 @@ vi.mock("../../src/lib/shell.js", () => ({
|
|||
exec: mockExec,
|
||||
}));
|
||||
|
||||
vi.mock("@composio/ao-core", async (importOriginal) => {
|
||||
vi.mock("@aoagents/ao-core", async (importOriginal) => {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
const actual = await importOriginal<typeof import("@composio/ao-core")>();
|
||||
const actual = await importOriginal<typeof import("@aoagents/ao-core")>();
|
||||
return {
|
||||
...actual,
|
||||
findPidByPort: mockFindPidByPort,
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ vi.mock("node:url", () => ({
|
|||
fileURLToPath: vi.fn(() => "/mock/cli/src/lib/script-runner.ts"),
|
||||
}));
|
||||
|
||||
vi.mock("@composio/ao-core", () => ({
|
||||
vi.mock("@aoagents/ao-core", () => ({
|
||||
isWindows: vi.fn(() => false),
|
||||
}));
|
||||
|
||||
import * as childProcess from "node:child_process";
|
||||
import * as core from "@composio/ao-core";
|
||||
import * as core from "@aoagents/ao-core";
|
||||
import { runRepoScript } from "../../src/lib/script-runner.js";
|
||||
|
||||
const mockIsWindows = core.isWindows as ReturnType<typeof vi.fn>;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ vi.mock("node:child_process", () => ({
|
|||
execFile: mockExecFile,
|
||||
}));
|
||||
|
||||
vi.mock("@composio/ao-core", () => ({
|
||||
vi.mock("@aoagents/ao-core", () => ({
|
||||
killProcessTree: mockKillProcessTree,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import * as fs from "node:fs";
|
||||
import * as aoCore from "@composio/ao-core";
|
||||
import type { OrchestratorConfig } from "@composio/ao-core";
|
||||
import * as aoCore from "@aoagents/ao-core";
|
||||
import type { OrchestratorConfig } from "@aoagents/ao-core";
|
||||
|
||||
vi.mock("node:fs", () => ({
|
||||
existsSync: vi.fn(),
|
||||
|
|
@ -13,9 +13,9 @@ vi.mock("node:fs", () => ({
|
|||
closeSync: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@composio/ao-core", async (importOriginal) => {
|
||||
vi.mock("@aoagents/ao-core", async (importOriginal) => {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
const actual = await importOriginal<typeof import("@composio/ao-core")>();
|
||||
const actual = await importOriginal<typeof import("@aoagents/ao-core")>();
|
||||
return {
|
||||
...actual,
|
||||
getProjectBaseDir: vi.fn(() => "/mock/project"),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|||
import { resolve } from "node:path";
|
||||
import chalk from "chalk";
|
||||
import type { Command } from "commander";
|
||||
import { findPidByPort, isWindows, killProcessTree, loadConfig } from "@composio/ao-core";
|
||||
import { findPidByPort, isWindows, killProcessTree, loadConfig } from "@aoagents/ao-core";
|
||||
import { findWebDir, buildDashboardEnv, waitForPortAndOpen } from "../lib/web-dir.js";
|
||||
import { forwardSignalsToChild } from "../lib/shell.js";
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
import { resolve } from "node:path";
|
||||
import { existsSync, rmSync } from "node:fs";
|
||||
import ora from "ora";
|
||||
import { findPidByPort } from "@composio/ao-core";
|
||||
import { findPidByPort } from "@aoagents/ao-core";
|
||||
import { exec } from "./shell.js";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
writeFileSync,
|
||||
} from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { getProjectBaseDir, isWindows, killProcessTree, type OrchestratorConfig } from "@composio/ao-core";
|
||||
import { getProjectBaseDir, isWindows, killProcessTree, type OrchestratorConfig } from "@aoagents/ao-core";
|
||||
|
||||
const LIFECYCLE_PID_FILE = "lifecycle-worker.pid";
|
||||
const LIFECYCLE_LOG_FILE = "lifecycle-worker.log";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|||
import { existsSync } from "node:fs";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { isWindows } from "@composio/ao-core";
|
||||
import { isWindows } from "@aoagents/ao-core";
|
||||
|
||||
const DEFAULT_REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../../../../");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type ChildProcess, execFile as execFileCb } from "node:child_process";
|
||||
import { promisify } from "node:util";
|
||||
import { killProcessTree } from "@composio/ao-core";
|
||||
import { killProcessTree } from "@aoagents/ao-core";
|
||||
|
||||
const execFileAsync = promisify(execFileCb);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import type { Session, RuntimeHandle, AgentLaunchConfig, WorkspaceHooksConfig } from "@composio/ao-core";
|
||||
import type { Session, RuntimeHandle, AgentLaunchConfig, WorkspaceHooksConfig } from "@aoagents/ao-core";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Hoisted mocks — available inside vi.mock factories
|
||||
|
|
@ -55,7 +55,7 @@ vi.mock("node:os", () => ({
|
|||
homedir: mockHomedir,
|
||||
}));
|
||||
|
||||
vi.mock("@composio/ao-core", async (importOriginal) => {
|
||||
vi.mock("@aoagents/ao-core", async (importOriginal) => {
|
||||
const actual = (await importOriginal()) as Record<string, unknown>;
|
||||
return {
|
||||
...actual,
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ vi.mock("node:child_process", async (importOriginal) => {
|
|||
};
|
||||
});
|
||||
|
||||
vi.mock("@composio/ao-core", async (importOriginal) => {
|
||||
vi.mock("@aoagents/ao-core", async (importOriginal) => {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
const actual = await importOriginal<typeof import("@composio/ao-core")>();
|
||||
const actual = await importOriginal<typeof import("@aoagents/ao-core")>();
|
||||
return {
|
||||
...actual,
|
||||
getShell: mockGetShell,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
type RuntimeHandle,
|
||||
type RuntimeMetrics,
|
||||
type AttachInfo,
|
||||
} from "@composio/ao-core";
|
||||
} from "@aoagents/ao-core";
|
||||
|
||||
export const manifest = {
|
||||
name: "process",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ vi.mock("node:child_process", () => {
|
|||
return { execFile: mockExecFile };
|
||||
});
|
||||
|
||||
vi.mock("@composio/ao-core", () => ({
|
||||
vi.mock("@aoagents/ao-core", () => ({
|
||||
getShell: vi.fn(() => ({ cmd: "sh", args: (c: string) => ["-c", c] })),
|
||||
}));
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ function makeProject(overrides?: Partial<ProjectConfig>): ProjectConfig {
|
|||
|
||||
// Import after mocks are set up
|
||||
import clonePlugin, { manifest, create } from "../index.js";
|
||||
import * as core from "@composio/ao-core";
|
||||
import * as core from "@aoagents/ao-core";
|
||||
|
||||
const mockGetShell = core.getShell as ReturnType<typeof vi.fn>;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { promisify } from "node:util";
|
|||
import { existsSync, rmSync, mkdirSync, readdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { homedir } from "node:os";
|
||||
import { getShell, type PluginModule, type Workspace, type WorkspaceCreateConfig, type WorkspaceInfo, type ProjectConfig } from "@composio/ao-core";
|
||||
import { getShell, type PluginModule, type Workspace, type WorkspaceCreateConfig, type WorkspaceInfo, type ProjectConfig } from "@aoagents/ao-core";
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ vi.mock("node:fs", () => ({
|
|||
readdirSync: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@composio/ao-core", () => ({
|
||||
vi.mock("@aoagents/ao-core", () => ({
|
||||
getShell: vi.fn(() => ({ cmd: "sh", args: (c: string) => ["-c", c] })),
|
||||
isWindows: vi.fn(() => false),
|
||||
}));
|
||||
|
|
@ -37,7 +37,7 @@ vi.mock("node:os", () => ({
|
|||
|
||||
import * as childProcess from "node:child_process";
|
||||
import { existsSync, lstatSync, symlinkSync, cpSync, rmSync, mkdirSync, readdirSync } from "node:fs";
|
||||
import * as core from "@composio/ao-core";
|
||||
import * as core from "@aoagents/ao-core";
|
||||
import { create, manifest } from "../index.js";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import * as fs from "node:fs";
|
|||
import { existsSync, lstatSync, symlinkSync, rmSync, mkdirSync, readdirSync } from "node:fs";
|
||||
import { join, resolve, basename, dirname, sep } from "node:path";
|
||||
import { homedir } from "node:os";
|
||||
import { getShell, isWindows, type PluginModule, type Workspace, type WorkspaceCreateConfig, type WorkspaceInfo, type ProjectConfig } from "@composio/ao-core";
|
||||
import { getShell, isWindows, type PluginModule, type Workspace, type WorkspaceCreateConfig, type WorkspaceInfo, type ProjectConfig } from "@aoagents/ao-core";
|
||||
|
||||
/** Timeout for git commands (30 seconds) */
|
||||
const GIT_TIMEOUT = 30_000;
|
||||
|
|
|
|||
Loading…
Reference in New Issue