fix: address acp client typing
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
ClientSideConnection,
|
ClientSideConnection,
|
||||||
PROTOCOL_VERSION,
|
PROTOCOL_VERSION,
|
||||||
ndJsonStream,
|
ndJsonStream,
|
||||||
|
type RequestPermissionRequest,
|
||||||
type SessionNotification,
|
type SessionNotification,
|
||||||
} from "@agentclientprotocol/sdk";
|
} from "@agentclientprotocol/sdk";
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ export async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpC
|
|||||||
}
|
}
|
||||||
|
|
||||||
const input = Writable.toWeb(agent.stdin);
|
const input = Writable.toWeb(agent.stdin);
|
||||||
const output = Readable.toWeb(agent.stdout) as ReadableStream<Uint8Array>;
|
const output = Readable.toWeb(agent.stdout) as unknown as ReadableStream<Uint8Array>;
|
||||||
const stream = ndJsonStream(input, output);
|
const stream = ndJsonStream(input, output);
|
||||||
|
|
||||||
const client = new ClientSideConnection(
|
const client = new ClientSideConnection(
|
||||||
@@ -98,7 +99,7 @@ export async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpC
|
|||||||
sessionUpdate: async (params: SessionNotification) => {
|
sessionUpdate: async (params: SessionNotification) => {
|
||||||
printSessionUpdate(params);
|
printSessionUpdate(params);
|
||||||
},
|
},
|
||||||
requestPermission: async (params) => {
|
requestPermission: async (params: RequestPermissionRequest) => {
|
||||||
console.log("\n[permission requested]", params.toolCall?.title ?? "tool");
|
console.log("\n[permission requested]", params.toolCall?.title ?? "tool");
|
||||||
const allowOnce = params.options.find((option) => option.kind === "allow_once");
|
const allowOnce = params.options.find((option) => option.kind === "allow_once");
|
||||||
const fallback = params.options[0];
|
const fallback = params.options[0];
|
||||||
|
|||||||
@@ -117,11 +117,7 @@ export function registerMemoryCli(program: Command) {
|
|||||||
.option("--json", "Print JSON")
|
.option("--json", "Print JSON")
|
||||||
.option("--deep", "Probe embedding provider availability")
|
.option("--deep", "Probe embedding provider availability")
|
||||||
.option("--index", "Reindex if dirty (implies --deep)")
|
.option("--index", "Reindex if dirty (implies --deep)")
|
||||||
.option(
|
.option("--index-mode <mode>", "Index mode (auto|batch|direct) when indexing", "auto")
|
||||||
"--index-mode <mode>",
|
|
||||||
"Index mode (auto|batch|direct) when indexing",
|
|
||||||
"auto",
|
|
||||||
)
|
|
||||||
.option("--progress <mode>", "Progress output (auto|line|log|none)", "auto")
|
.option("--progress <mode>", "Progress output (auto|line|log|none)", "auto")
|
||||||
.option("--verbose", "Verbose logging", false)
|
.option("--verbose", "Verbose logging", false)
|
||||||
.action(async (opts: MemoryCommandOptions) => {
|
.action(async (opts: MemoryCommandOptions) => {
|
||||||
@@ -148,12 +144,12 @@ export function registerMemoryCli(program: Command) {
|
|||||||
await withProgress(
|
await withProgress(
|
||||||
{ label: "Checking memory…", total: 2, ...progressOptions },
|
{ label: "Checking memory…", total: 2, ...progressOptions },
|
||||||
async (progress) => {
|
async (progress) => {
|
||||||
progress.setLabel("Probing vector…");
|
progress.setLabel("Probing vector…");
|
||||||
await manager.probeVectorAvailability();
|
await manager.probeVectorAvailability();
|
||||||
progress.tick();
|
progress.tick();
|
||||||
progress.setLabel("Probing embeddings…");
|
progress.setLabel("Probing embeddings…");
|
||||||
embeddingProbe = await manager.probeEmbeddingAvailability();
|
embeddingProbe = await manager.probeEmbeddingAvailability();
|
||||||
progress.tick();
|
progress.tick();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (opts.index) {
|
if (opts.index) {
|
||||||
@@ -304,11 +300,7 @@ export function registerMemoryCli(program: Command) {
|
|||||||
.description("Reindex memory files")
|
.description("Reindex memory files")
|
||||||
.option("--agent <id>", "Agent id (default: default agent)")
|
.option("--agent <id>", "Agent id (default: default agent)")
|
||||||
.option("--force", "Force full reindex", false)
|
.option("--force", "Force full reindex", false)
|
||||||
.option(
|
.option("--index-mode <mode>", "Index mode (auto|batch|direct) when indexing", "auto")
|
||||||
"--index-mode <mode>",
|
|
||||||
"Index mode (auto|batch|direct) when indexing",
|
|
||||||
"auto",
|
|
||||||
)
|
|
||||||
.option("--progress <mode>", "Progress output (auto|line|log|none)", "auto")
|
.option("--progress <mode>", "Progress output (auto|line|log|none)", "auto")
|
||||||
.action(async (opts: MemoryCommandOptions & { force?: boolean }) => {
|
.action(async (opts: MemoryCommandOptions & { force?: boolean }) => {
|
||||||
const rawCfg = loadConfig();
|
const rawCfg = loadConfig();
|
||||||
|
|||||||
Reference in New Issue
Block a user