chore: rename project to clawdbot
This commit is contained in:
@@ -5,7 +5,7 @@ import path from "node:path";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { CliDeps } from "../cli/deps.js";
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { CronJob } from "./types.js";
|
||||
|
||||
vi.mock("../agents/pi-embedded.js", () => ({
|
||||
@@ -23,7 +23,7 @@ import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
||||
import { runCronIsolatedAgentTurn } from "./isolated-agent.js";
|
||||
|
||||
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-cron-"));
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-cron-"));
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = base;
|
||||
try {
|
||||
@@ -35,7 +35,7 @@ async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
}
|
||||
|
||||
async function writeSessionStore(home: string) {
|
||||
const dir = path.join(home, ".clawdis", "sessions");
|
||||
const dir = path.join(home, ".clawdbot", "sessions");
|
||||
await fs.mkdir(dir, { recursive: true });
|
||||
const storePath = path.join(dir, "sessions.json");
|
||||
await fs.writeFile(
|
||||
@@ -60,15 +60,15 @@ async function writeSessionStore(home: string) {
|
||||
function makeCfg(
|
||||
home: string,
|
||||
storePath: string,
|
||||
overrides: Partial<ClawdisConfig> = {},
|
||||
): ClawdisConfig {
|
||||
const base: ClawdisConfig = {
|
||||
overrides: Partial<ClawdbotConfig> = {},
|
||||
): ClawdbotConfig {
|
||||
const base: ClawdbotConfig = {
|
||||
agent: {
|
||||
model: "anthropic/claude-opus-4-5",
|
||||
workspace: path.join(home, "clawd"),
|
||||
},
|
||||
session: { store: storePath, mainKey: "main" },
|
||||
} as ClawdisConfig;
|
||||
} as ClawdbotConfig;
|
||||
return { ...base, ...overrides };
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { chunkText, resolveTextChunkLimit } from "../auto-reply/chunk.js";
|
||||
import { normalizeThinkLevel } from "../auto-reply/thinking.js";
|
||||
import type { CliDeps } from "../cli/deps.js";
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import {
|
||||
DEFAULT_IDLE_MINUTES,
|
||||
loadSessionStore,
|
||||
@@ -57,7 +57,7 @@ function pickSummaryFromPayloads(
|
||||
}
|
||||
|
||||
function resolveDeliveryTarget(
|
||||
cfg: ClawdisConfig,
|
||||
cfg: ClawdbotConfig,
|
||||
jobPayload: {
|
||||
channel?:
|
||||
| "last"
|
||||
@@ -128,7 +128,7 @@ function resolveDeliveryTarget(
|
||||
}
|
||||
|
||||
function resolveCronSession(params: {
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
sessionKey: string;
|
||||
nowMs: number;
|
||||
}) {
|
||||
@@ -160,7 +160,7 @@ function resolveCronSession(params: {
|
||||
}
|
||||
|
||||
export async function runCronIsolatedAgentTurn(params: {
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
deps: CliDeps;
|
||||
job: CronJob;
|
||||
message: string;
|
||||
|
||||
@@ -20,7 +20,7 @@ describe("cron run log", () => {
|
||||
});
|
||||
|
||||
it("appends JSONL and prunes by line count", async () => {
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-cron-log-"));
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-cron-log-"));
|
||||
const logPath = path.join(dir, "runs", "job-1.jsonl");
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
@@ -51,7 +51,7 @@ describe("cron run log", () => {
|
||||
|
||||
it("reads newest entries and filters by jobId", async () => {
|
||||
const dir = await fs.mkdtemp(
|
||||
path.join(os.tmpdir(), "clawdis-cron-log-read-"),
|
||||
path.join(os.tmpdir(), "clawdbot-cron-log-read-"),
|
||||
);
|
||||
const logPathA = path.join(dir, "runs", "a.jsonl");
|
||||
const logPathB = path.join(dir, "runs", "b.jsonl");
|
||||
|
||||
@@ -14,7 +14,7 @@ const noopLogger = {
|
||||
};
|
||||
|
||||
async function makeStorePath() {
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-cron-"));
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-cron-"));
|
||||
return {
|
||||
storePath: path.join(dir, "cron", "jobs.json"),
|
||||
cleanup: async () => {
|
||||
|
||||
Reference in New Issue
Block a user