Protocol: lint fixes for client/program
This commit is contained in:
@@ -5,7 +5,6 @@ import { healthCommand } from "../commands/health.js";
|
||||
import { sendCommand } from "../commands/send.js";
|
||||
import { sessionsCommand } from "../commands/sessions.js";
|
||||
import { statusCommand } from "../commands/status.js";
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
|
||||
import { startGatewayServer } from "../gateway/server.js";
|
||||
import { danger, info, setVerbose } from "../globals.js";
|
||||
@@ -13,11 +12,8 @@ import { loginWeb, logoutWeb } from "../provider-web.js";
|
||||
import { runRpcLoop } from "../rpc/loop.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { VERSION } from "../version.js";
|
||||
import {
|
||||
ensureWebChatServerFromConfig,
|
||||
startWebChatServer,
|
||||
} from "../webchat/server.js";
|
||||
import { createDefaultDeps, logWebSelfId } from "./deps.js";
|
||||
import { startWebChatServer } from "../webchat/server.js";
|
||||
import { createDefaultDeps } from "./deps.js";
|
||||
|
||||
export function buildProgram() {
|
||||
const program = new Command();
|
||||
@@ -66,14 +62,8 @@ export function buildProgram() {
|
||||
'clawdis send --to +15555550123 --message "Hi" --json',
|
||||
"Send via your web session and print JSON result.",
|
||||
],
|
||||
[
|
||||
"clawdis gateway --port 18789",
|
||||
"Run the WebSocket Gateway locally.",
|
||||
],
|
||||
[
|
||||
"clawdis gw:status",
|
||||
"Fetch Gateway status over WS.",
|
||||
],
|
||||
["clawdis gateway --port 18789", "Run the WebSocket Gateway locally."],
|
||||
["clawdis gw:status", "Fetch Gateway status over WS."],
|
||||
[
|
||||
'clawdis agent --to +15555550123 --message "Run summary" --deliver',
|
||||
"Talk directly to the agent using the Gateway; optionally send the WhatsApp reply.",
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
} from "./protocol/index.js";
|
||||
|
||||
type Pending = {
|
||||
resolve: (value: any) => void;
|
||||
reject: (err: any) => void;
|
||||
resolve: (value: unknown) => void;
|
||||
reject: (err: unknown) => void;
|
||||
expectFinal: boolean;
|
||||
};
|
||||
|
||||
@@ -167,7 +167,11 @@ export class GatewayClient {
|
||||
}
|
||||
const expectFinal = opts?.expectFinal === true;
|
||||
const p = new Promise<T>((resolve, reject) => {
|
||||
this.pending.set(id, { resolve, reject, expectFinal });
|
||||
this.pending.set(id, {
|
||||
resolve: (value) => resolve(value as T),
|
||||
reject,
|
||||
expectFinal,
|
||||
});
|
||||
});
|
||||
this.ws.send(JSON.stringify(frame));
|
||||
return p;
|
||||
|
||||
@@ -9,31 +9,31 @@ import {
|
||||
type EventFrame,
|
||||
EventFrameSchema,
|
||||
errorShape,
|
||||
type GatewayFrame,
|
||||
GatewayFrameSchema,
|
||||
type Hello,
|
||||
type HelloError,
|
||||
HelloErrorSchema,
|
||||
type HelloOk,
|
||||
HelloOkSchema,
|
||||
HelloSchema,
|
||||
PROTOCOL_VERSION,
|
||||
type PresenceEntry,
|
||||
PresenceEntrySchema,
|
||||
ProtocolSchemas,
|
||||
PROTOCOL_VERSION,
|
||||
type RequestFrame,
|
||||
RequestFrameSchema,
|
||||
type ResponseFrame,
|
||||
ResponseFrameSchema,
|
||||
SendParamsSchema,
|
||||
type ShutdownEvent,
|
||||
ShutdownEventSchema,
|
||||
type Snapshot,
|
||||
SnapshotSchema,
|
||||
type StateVersion,
|
||||
StateVersionSchema,
|
||||
TickEventSchema,
|
||||
type TickEvent,
|
||||
GatewayFrameSchema,
|
||||
type GatewayFrame,
|
||||
type ShutdownEvent,
|
||||
ShutdownEventSchema,
|
||||
TickEventSchema,
|
||||
} from "./schema.js";
|
||||
|
||||
const ajv = new (
|
||||
|
||||
Reference in New Issue
Block a user