chore: rename project to clawdbot
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// unintentionally breaking on newlines. Using [\s\S] keeps newlines inside
|
||||
// the chunk so messages are only split when they truly exceed the limit.
|
||||
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
|
||||
export type TextChunkSurface =
|
||||
| "whatsapp"
|
||||
@@ -24,7 +24,7 @@ const DEFAULT_CHUNK_LIMIT_BY_SURFACE: Record<TextChunkSurface, number> = {
|
||||
};
|
||||
|
||||
export function resolveTextChunkLimit(
|
||||
cfg: ClawdisConfig | undefined,
|
||||
cfg: ClawdbotConfig | undefined,
|
||||
surface?: TextChunkSurface,
|
||||
): number {
|
||||
const surfaceOverride = (() => {
|
||||
|
||||
@@ -22,7 +22,7 @@ vi.mock("../agents/model-catalog.js", () => ({
|
||||
}));
|
||||
|
||||
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-stream-"));
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-stream-"));
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = base;
|
||||
try {
|
||||
|
||||
@@ -35,7 +35,7 @@ vi.mock("../agents/model-catalog.js", () => ({
|
||||
}));
|
||||
|
||||
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-reply-"));
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-reply-"));
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = base;
|
||||
try {
|
||||
|
||||
@@ -32,7 +32,7 @@ function makeResult(text: string) {
|
||||
}
|
||||
|
||||
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-queue-"));
|
||||
const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-queue-"));
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = base;
|
||||
try {
|
||||
|
||||
@@ -26,7 +26,7 @@ const webMocks = vi.hoisted(() => ({
|
||||
vi.mock("../web/session.js", () => webMocks);
|
||||
|
||||
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
const base = await fs.mkdtemp(join(tmpdir(), "clawdis-triggers-"));
|
||||
const base = await fs.mkdtemp(join(tmpdir(), "clawdbot-triggers-"));
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = base;
|
||||
try {
|
||||
@@ -580,7 +580,7 @@ describe("trigger handling", () => {
|
||||
allowFrom: ["*"],
|
||||
},
|
||||
session: {
|
||||
store: join(tmpdir(), `clawdis-session-test-${Date.now()}.json`),
|
||||
store: join(tmpdir(), `clawdbot-session-test-${Date.now()}.json`),
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -619,7 +619,7 @@ describe("trigger handling", () => {
|
||||
allowFrom: ["*"],
|
||||
},
|
||||
session: {
|
||||
store: join(tmpdir(), `clawdis-session-test-${Date.now()}.json`),
|
||||
store: join(tmpdir(), `clawdbot-session-test-${Date.now()}.json`),
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from "../agents/workspace.js";
|
||||
import {
|
||||
type AgentElevatedAllowFromConfig,
|
||||
type ClawdisConfig,
|
||||
type ClawdbotConfig,
|
||||
loadConfig,
|
||||
} from "../config/config.js";
|
||||
import { resolveSessionTranscriptPath } from "../config/sessions.js";
|
||||
@@ -180,7 +180,7 @@ function isApprovedElevatedSender(params: {
|
||||
export async function getReplyFromConfig(
|
||||
ctx: MsgContext,
|
||||
opts?: GetReplyOptions,
|
||||
configOverride?: ClawdisConfig,
|
||||
configOverride?: ClawdbotConfig,
|
||||
): Promise<ReplyPayload | ReplyPayload[] | undefined> {
|
||||
const cfg = configOverride ?? loadConfig();
|
||||
const agentCfg = cfg.agent;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import { resolveTextChunkLimit, type TextChunkSurface } from "../chunk.js";
|
||||
|
||||
const DEFAULT_BLOCK_STREAM_MIN = 800;
|
||||
@@ -23,7 +23,7 @@ function normalizeChunkSurface(surface?: string): TextChunkSurface | undefined {
|
||||
}
|
||||
|
||||
export function resolveBlockStreamingChunking(
|
||||
cfg: ClawdisConfig | undefined,
|
||||
cfg: ClawdbotConfig | undefined,
|
||||
surface?: string,
|
||||
): {
|
||||
minChars: number;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import {
|
||||
type SessionEntry,
|
||||
type SessionScope,
|
||||
saveSessionStore,
|
||||
} from "../../config/sessions.js";
|
||||
import { logVerbose } from "../../globals.js";
|
||||
import { triggerClawdisRestart } from "../../infra/restart.js";
|
||||
import { triggerClawdbotRestart } from "../../infra/restart.js";
|
||||
import { resolveSendPolicy } from "../../sessions/send-policy.js";
|
||||
import { normalizeE164 } from "../../utils.js";
|
||||
import { resolveHeartbeatSeconds } from "../../web/reconnect.js";
|
||||
@@ -37,7 +37,7 @@ export type CommandContext = {
|
||||
|
||||
export function buildCommandContext(params: {
|
||||
ctx: MsgContext;
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
sessionKey?: string;
|
||||
isGroup: boolean;
|
||||
triggerBodyNormalized: string;
|
||||
@@ -99,7 +99,7 @@ export function buildCommandContext(params: {
|
||||
|
||||
export async function handleCommands(params: {
|
||||
ctx: MsgContext;
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
command: CommandContext;
|
||||
sessionEntry?: SessionEntry;
|
||||
sessionStore?: Record<string, SessionEntry>;
|
||||
@@ -226,11 +226,11 @@ export async function handleCommands(params: {
|
||||
);
|
||||
return { shouldContinue: false };
|
||||
}
|
||||
const restartMethod = triggerClawdisRestart();
|
||||
const restartMethod = triggerClawdbotRestart();
|
||||
return {
|
||||
shouldContinue: false,
|
||||
reply: {
|
||||
text: `⚙️ Restarting clawdis via ${restartMethod}; give me a few seconds to come back online.`,
|
||||
text: `⚙️ Restarting clawdbot via ${restartMethod}; give me a few seconds to come back online.`,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
resolveConfiguredModelRef,
|
||||
resolveModelRefFromString,
|
||||
} from "../../agents/model-selection.js";
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import { type SessionEntry, saveSessionStore } from "../../config/sessions.js";
|
||||
import { enqueueSystemEvent } from "../../infra/system-events.js";
|
||||
import { extractModelDirective } from "../model.js";
|
||||
@@ -134,7 +134,7 @@ export function isDirectiveOnly(params: {
|
||||
directives: InlineDirectives;
|
||||
cleanedBody: string;
|
||||
ctx: MsgContext;
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
isGroup: boolean;
|
||||
}): boolean {
|
||||
const { directives, cleanedBody, ctx, cfg, isGroup } = params;
|
||||
@@ -436,7 +436,7 @@ export async function persistInlineDirectives(params: {
|
||||
model: string;
|
||||
initialModelLabel: string;
|
||||
formatModelSwitchEvent: (label: string, alias?: string) => string;
|
||||
agentCfg: ClawdisConfig["agent"] | undefined;
|
||||
agentCfg: ClawdbotConfig["agent"] | undefined;
|
||||
}): Promise<{ provider: string; model: string; contextTokens: number }> {
|
||||
const {
|
||||
directives,
|
||||
@@ -551,7 +551,7 @@ export async function persistInlineDirectives(params: {
|
||||
};
|
||||
}
|
||||
|
||||
export function resolveDefaultModel(params: { cfg: ClawdisConfig }): {
|
||||
export function resolveDefaultModel(params: { cfg: ClawdbotConfig }): {
|
||||
defaultProvider: string;
|
||||
defaultModel: string;
|
||||
aliasIndex: ModelAliasIndex;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import type {
|
||||
GroupKeyResolution,
|
||||
SessionEntry,
|
||||
@@ -7,7 +7,7 @@ import { normalizeGroupActivation } from "../group-activation.js";
|
||||
import type { TemplateContext } from "../templating.js";
|
||||
|
||||
export function resolveGroupRequireMention(params: {
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
ctx: TemplateContext;
|
||||
groupResolution?: GroupKeyResolution;
|
||||
}): boolean {
|
||||
@@ -86,7 +86,7 @@ export function buildGroupIntro(params: {
|
||||
: "Activation: trigger-only (you are invoked only when explicitly mentioned; recent context may be included).";
|
||||
const silenceLine =
|
||||
activation === "always"
|
||||
? `If no response is needed, reply with exactly "${params.silentToken}" (no other text) so Clawdis stays silent.`
|
||||
? `If no response is needed, reply with exactly "${params.silentToken}" (no other text) so Clawdbot stays silent.`
|
||||
: undefined;
|
||||
const cautionLine =
|
||||
activation === "always"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import type { MsgContext } from "../templating.js";
|
||||
|
||||
export function stripStructuralPrefixes(text: string): string {
|
||||
@@ -18,7 +18,7 @@ export function stripStructuralPrefixes(text: string): string {
|
||||
export function stripMentions(
|
||||
text: string,
|
||||
ctx: MsgContext,
|
||||
cfg: ClawdisConfig | undefined,
|
||||
cfg: ClawdbotConfig | undefined,
|
||||
): string {
|
||||
let result = text;
|
||||
const patterns = cfg?.routing?.groupChat?.mentionPatterns ?? [];
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
resolveModelRefFromString,
|
||||
resolveThinkingDefault,
|
||||
} from "../../agents/model-selection.js";
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import { type SessionEntry, saveSessionStore } from "../../config/sessions.js";
|
||||
import type { ThinkLevel } from "./directives.js";
|
||||
|
||||
@@ -32,8 +32,8 @@ type ModelSelectionState = {
|
||||
};
|
||||
|
||||
export async function createModelSelectionState(params: {
|
||||
cfg: ClawdisConfig;
|
||||
agentCfg: ClawdisConfig["agent"] | undefined;
|
||||
cfg: ClawdbotConfig;
|
||||
agentCfg: ClawdbotConfig["agent"] | undefined;
|
||||
sessionEntry?: SessionEntry;
|
||||
sessionStore?: Record<string, SessionEntry>;
|
||||
sessionKey?: string;
|
||||
@@ -177,7 +177,7 @@ export function resolveModelDirectiveSelection(params: {
|
||||
}
|
||||
|
||||
export function resolveContextTokens(params: {
|
||||
agentCfg: ClawdisConfig["agent"] | undefined;
|
||||
agentCfg: ClawdbotConfig["agent"] | undefined;
|
||||
model: string;
|
||||
}): number {
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { SkillSnapshot } from "../../agents/skills.js";
|
||||
import { parseDurationMs } from "../../cli/parse-duration.js";
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import type { SessionEntry } from "../../config/sessions.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import type { ElevatedLevel, ThinkLevel, VerboseLevel } from "./directives.js";
|
||||
@@ -28,7 +28,7 @@ export type FollowupRun = {
|
||||
surface?: string;
|
||||
sessionFile: string;
|
||||
workspaceDir: string;
|
||||
config: ClawdisConfig;
|
||||
config: ClawdbotConfig;
|
||||
skillsSnapshot?: SkillSnapshot;
|
||||
provider: string;
|
||||
model: string;
|
||||
@@ -435,7 +435,7 @@ function defaultQueueModeForSurface(surface?: string): QueueMode {
|
||||
return "collect";
|
||||
}
|
||||
export function resolveQueueSettings(params: {
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
surface?: string;
|
||||
sessionEntry?: SessionEntry;
|
||||
inlineMode?: QueueMode;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import crypto from "node:crypto";
|
||||
|
||||
import { buildWorkspaceSkillSnapshot } from "../../agents/skills.js";
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import { type SessionEntry, saveSessionStore } from "../../config/sessions.js";
|
||||
import { buildProviderSummary } from "../../infra/provider-summary.js";
|
||||
import { drainSystemEvents } from "../../infra/system-events.js";
|
||||
|
||||
export async function prependSystemEvents(params: {
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
isMainSession: boolean;
|
||||
isNewSession: boolean;
|
||||
prefixedBodyBase: string;
|
||||
@@ -49,7 +49,7 @@ export async function ensureSkillSnapshot(params: {
|
||||
sessionId?: string;
|
||||
isFirstTurnInSession: boolean;
|
||||
workspaceDir: string;
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
}): Promise<{
|
||||
sessionEntry?: SessionEntry;
|
||||
skillsSnapshot?: SessionEntry["skillsSnapshot"];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import crypto from "node:crypto";
|
||||
|
||||
import type { ClawdisConfig } from "../../config/config.js";
|
||||
import type { ClawdbotConfig } from "../../config/config.js";
|
||||
import {
|
||||
buildGroupDisplayName,
|
||||
DEFAULT_IDLE_MINUTES,
|
||||
@@ -36,7 +36,7 @@ export type SessionInitResult = {
|
||||
|
||||
export async function initSessionState(params: {
|
||||
ctx: MsgContext;
|
||||
cfg: ClawdisConfig;
|
||||
cfg: ClawdbotConfig;
|
||||
}): Promise<SessionInitResult> {
|
||||
const { ctx, cfg } = params;
|
||||
const sessionCfg = cfg.session;
|
||||
|
||||
@@ -74,7 +74,7 @@ describe("buildStatusMessage", () => {
|
||||
});
|
||||
|
||||
it("prefers cached prompt tokens from the session log", async () => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "clawdis-status-"));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-status-"));
|
||||
const previousHome = process.env.HOME;
|
||||
process.env.HOME = dir;
|
||||
try {
|
||||
@@ -83,11 +83,11 @@ describe("buildStatusMessage", () => {
|
||||
"./status.js"
|
||||
);
|
||||
|
||||
const storePath = path.join(dir, ".clawdis", "sessions", "sessions.json");
|
||||
const storePath = path.join(dir, ".clawdbot", "sessions", "sessions.json");
|
||||
const sessionId = "sess-1";
|
||||
const logPath = path.join(
|
||||
dir,
|
||||
".clawdis",
|
||||
".clawdbot",
|
||||
"sessions",
|
||||
`${sessionId}.jsonl`,
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
normalizeUsage,
|
||||
type UsageLike,
|
||||
} from "../agents/usage.js";
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import {
|
||||
resolveSessionTranscriptPath,
|
||||
type SessionEntry,
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
import { shortenHomePath } from "../utils.js";
|
||||
import type { ThinkLevel, VerboseLevel } from "./thinking.js";
|
||||
|
||||
type AgentConfig = NonNullable<ClawdisConfig["agent"]>;
|
||||
type AgentConfig = NonNullable<ClawdbotConfig["agent"]>;
|
||||
|
||||
type StatusArgs = {
|
||||
agent: AgentConfig;
|
||||
@@ -79,7 +79,7 @@ const readUsageFromSessionLog = (
|
||||
model?: string;
|
||||
}
|
||||
| undefined => {
|
||||
// Transcripts always live at: ~/.clawdis/sessions/<SessionId>.jsonl
|
||||
// Transcripts always live at: ~/.clawdbot/sessions/<SessionId>.jsonl
|
||||
if (!sessionId) return undefined;
|
||||
const logPath = resolveSessionTranscriptPath(sessionId);
|
||||
if (!fs.existsSync(logPath)) return undefined;
|
||||
@@ -166,7 +166,7 @@ export function buildStatusMessage(args: StatusArgs): string {
|
||||
|
||||
const webLine = (() => {
|
||||
if (args.webLinked === false) {
|
||||
return "Web: not linked — run `clawdis login` to scan the QR.";
|
||||
return "Web: not linked — run `clawdbot login` to scan the QR.";
|
||||
}
|
||||
const authAge = formatAge(args.webAuthAgeMs);
|
||||
const heartbeat =
|
||||
|
||||
@@ -26,7 +26,7 @@ describe("transcribeInboundAudio", () => {
|
||||
|
||||
it("downloads mediaUrl to temp file and returns transcript", async () => {
|
||||
const tmpBuf = Buffer.from("audio-bytes");
|
||||
const tmpFile = path.join(os.tmpdir(), `clawdis-audio-${Date.now()}.ogg`);
|
||||
const tmpFile = path.join(os.tmpdir(), `clawdbot-audio-${Date.now()}.ogg`);
|
||||
await fs.writeFile(tmpFile, tmpBuf);
|
||||
|
||||
const fetchMock = vi.fn(async () => ({
|
||||
|
||||
@@ -3,7 +3,7 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { logVerbose, shouldLogVerbose } from "../globals.js";
|
||||
import { runExec } from "../process/exec.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
@@ -14,7 +14,7 @@ export function isAudio(mediaType?: string | null) {
|
||||
}
|
||||
|
||||
export async function transcribeInboundAudio(
|
||||
cfg: ClawdisConfig,
|
||||
cfg: ClawdbotConfig,
|
||||
ctx: MsgContext,
|
||||
runtime: RuntimeEnv,
|
||||
): Promise<{ text: string } | undefined> {
|
||||
@@ -32,7 +32,7 @@ export async function transcribeInboundAudio(
|
||||
const buffer = Buffer.from(arrayBuf);
|
||||
tmpPath = path.join(
|
||||
os.tmpdir(),
|
||||
`clawdis-audio-${crypto.randomUUID()}.ogg`,
|
||||
`clawdbot-audio-${crypto.randomUUID()}.ogg`,
|
||||
);
|
||||
await fs.writeFile(tmpPath, buffer);
|
||||
mediaPath = tmpPath;
|
||||
|
||||
Reference in New Issue
Block a user