refactor(cli): rename ps to ls and add top-level agent commands

This commit is contained in:
Mohamed Boudra
2026-01-29 10:41:19 +07:00
parent 7d4636ecff
commit dfda6daeed
46 changed files with 4473 additions and 542 deletions

View File

@@ -656,6 +656,29 @@ export class DaemonClientV2 {
this.sendSessionMessage(message);
}
async waitForSessionState(timeout = 5000, requestId?: string): Promise<void> {
const resolvedRequestId = this.createRequestId(requestId);
const message = SessionInboundMessageSchema.parse({
type: "request_session_state",
requestId: resolvedRequestId,
});
// First check the existing message queue in case session_state was already received
for (const msg of this.messageQueue) {
if (msg.type === "session_state") {
return;
}
}
// If not in queue, wait for the session_state message
await this.sendSessionMessageOrThrow(message);
return this.waitFor(
(msg) => msg.type === "session_state" ? undefined : null,
timeout,
{ skipQueue: false }
);
}
async loadVoiceConversation(
voiceConversationId: string,
requestId?: string

View File

@@ -5,3 +5,20 @@ export { resolvePaseoHome } from "./paseo-home.js";
export { createRootLogger, type LogLevel, type LogFormat } from "./logger.js";
export { loadPersistedConfig, type PersistedConfig } from "./persisted-config.js";
export { DaemonClientV2, type DaemonClientV2Config, type ConnectionState, type DaemonEvent } from "../client/daemon-client-v2.js";
// Agent SDK types for CLI commands
export type {
AgentMode,
AgentUsage,
AgentCapabilityFlags,
AgentPermissionRequest,
AgentTimelineItem,
} from "./agent/agent-sdk-types.js";
// WebSocket message types for CLI streaming
export type {
AgentSnapshotPayload,
AgentStreamEventPayload,
AgentStreamMessage,
AgentStreamSnapshotMessage,
} from "../shared/messages.js";