style: apply oxfmt
This commit is contained in:
@@ -45,19 +45,13 @@ export function getFlagValue(argv: string[], name: string): string | null | unde
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getVerboseFlag(
|
export function getVerboseFlag(argv: string[], options?: { includeDebug?: boolean }): boolean {
|
||||||
argv: string[],
|
|
||||||
options?: { includeDebug?: boolean },
|
|
||||||
): boolean {
|
|
||||||
if (hasFlag(argv, "--verbose")) return true;
|
if (hasFlag(argv, "--verbose")) return true;
|
||||||
if (options?.includeDebug && hasFlag(argv, "--debug")) return true;
|
if (options?.includeDebug && hasFlag(argv, "--debug")) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPositiveIntFlagValue(
|
export function getPositiveIntFlagValue(argv: string[], name: string): number | null | undefined {
|
||||||
argv: string[],
|
|
||||||
name: string,
|
|
||||||
): number | null | undefined {
|
|
||||||
const raw = getFlagValue(argv, name);
|
const raw = getFlagValue(argv, name);
|
||||||
if (raw === null || raw === undefined) return raw;
|
if (raw === null || raw === undefined) return raw;
|
||||||
return parsePositiveInt(raw);
|
return parsePositiveInt(raw);
|
||||||
|
|||||||
@@ -197,8 +197,7 @@ export function registerChannelsCli(program: Command) {
|
|||||||
.option("--account <id>", "Account id (accountId)")
|
.option("--account <id>", "Account id (accountId)")
|
||||||
.option("--verbose", "Verbose connection logs", false)
|
.option("--verbose", "Verbose connection logs", false)
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
await runChannelsCommandWithDanger(
|
await runChannelsCommandWithDanger(async () => {
|
||||||
async () => {
|
|
||||||
await runChannelLogin(
|
await runChannelLogin(
|
||||||
{
|
{
|
||||||
channel: opts.channel as string | undefined,
|
channel: opts.channel as string | undefined,
|
||||||
@@ -207,9 +206,7 @@ export function registerChannelsCli(program: Command) {
|
|||||||
},
|
},
|
||||||
defaultRuntime,
|
defaultRuntime,
|
||||||
);
|
);
|
||||||
},
|
}, "Channel login failed");
|
||||||
"Channel login failed",
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
channels
|
channels
|
||||||
@@ -218,8 +215,7 @@ export function registerChannelsCli(program: Command) {
|
|||||||
.option("--channel <channel>", "Channel alias (default: whatsapp)")
|
.option("--channel <channel>", "Channel alias (default: whatsapp)")
|
||||||
.option("--account <id>", "Account id (accountId)")
|
.option("--account <id>", "Account id (accountId)")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
await runChannelsCommandWithDanger(
|
await runChannelsCommandWithDanger(async () => {
|
||||||
async () => {
|
|
||||||
await runChannelLogout(
|
await runChannelLogout(
|
||||||
{
|
{
|
||||||
channel: opts.channel as string | undefined,
|
channel: opts.channel as string | undefined,
|
||||||
@@ -227,8 +223,6 @@ export function registerChannelsCli(program: Command) {
|
|||||||
},
|
},
|
||||||
defaultRuntime,
|
defaultRuntime,
|
||||||
);
|
);
|
||||||
},
|
}, "Channel logout failed");
|
||||||
"Channel logout failed",
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,20 +36,20 @@ export function createMessageCliHelpers(
|
|||||||
await runCommandWithRuntime(
|
await runCommandWithRuntime(
|
||||||
defaultRuntime,
|
defaultRuntime,
|
||||||
async () => {
|
async () => {
|
||||||
await messageCommand(
|
await messageCommand(
|
||||||
{
|
{
|
||||||
...(() => {
|
...(() => {
|
||||||
const { account, ...rest } = opts;
|
const { account, ...rest } = opts;
|
||||||
return {
|
return {
|
||||||
...rest,
|
...rest,
|
||||||
accountId: typeof account === "string" ? account : undefined,
|
accountId: typeof account === "string" ? account : undefined,
|
||||||
};
|
};
|
||||||
})(),
|
})(),
|
||||||
action,
|
action,
|
||||||
},
|
},
|
||||||
deps,
|
deps,
|
||||||
defaultRuntime,
|
defaultRuntime,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
defaultRuntime.error(danger(String(err)));
|
defaultRuntime.error(danger(String(err)));
|
||||||
|
|||||||
@@ -361,10 +361,7 @@ describe("agentCommand", () => {
|
|||||||
const store = path.join(home, "sessions.json");
|
const store = path.join(home, "sessions.json");
|
||||||
mockConfig(home, store);
|
mockConfig(home, store);
|
||||||
|
|
||||||
await agentCommand(
|
await agentCommand({ message: "hi", to: "+1555", accountId: "kev" }, runtime);
|
||||||
{ message: "hi", to: "+1555", accountId: "kev" },
|
|
||||||
runtime,
|
|
||||||
);
|
|
||||||
|
|
||||||
const callArgs = vi.mocked(runEmbeddedPiAgent).mock.calls.at(-1)?.[0];
|
const callArgs = vi.mocked(runEmbeddedPiAgent).mock.calls.at(-1)?.[0];
|
||||||
expect(callArgs?.agentAccountId).toBe("kev");
|
expect(callArgs?.agentAccountId).toBe("kev");
|
||||||
|
|||||||
@@ -324,8 +324,7 @@ const FIELD_HELP: Record<string, string> = {
|
|||||||
'Optional allowlist of model ids (e.g. "gpt-5.2" or "openai/gpt-5.2").',
|
'Optional allowlist of model ids (e.g. "gpt-5.2" or "openai/gpt-5.2").',
|
||||||
"tools.exec.notifyOnExit":
|
"tools.exec.notifyOnExit":
|
||||||
"When true (default), backgrounded exec sessions enqueue a system event and request a heartbeat on exit.",
|
"When true (default), backgrounded exec sessions enqueue a system event and request a heartbeat on exit.",
|
||||||
"tools.exec.pathPrepend":
|
"tools.exec.pathPrepend": "Directories to prepend to PATH for exec runs (gateway/sandbox).",
|
||||||
"Directories to prepend to PATH for exec runs (gateway/sandbox).",
|
|
||||||
"tools.message.allowCrossContextSend":
|
"tools.message.allowCrossContextSend":
|
||||||
"Legacy override: allow cross-context sends across all providers.",
|
"Legacy override: allow cross-context sends across all providers.",
|
||||||
"tools.message.crossContext.allowWithinProvider":
|
"tools.message.crossContext.allowWithinProvider":
|
||||||
|
|||||||
Reference in New Issue
Block a user