Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(get_page): type the selector names as strings

garrytan475d348d9525
diff --git a/src/core/ops/get-page-body.ts b/src/core/ops/get-page-body.ts
index 6fd99fcac1..41ec7f5dd3 100644
--- a/src/core/ops/get-page-body.ts
+++ b/src/core/ops/get-page-body.ts
@@ -136,7 +136,7 @@ export function parseBodyRequest(ctx: Pick<OperationContext, 'remote' | 'transpo
selectors.push({ kind: 'cursor', raw: p.cursor });
}
if (selectors.length > 1) {
- const [keep, ...drop] = selectors.map(s => s.kind === 'around' ? 'around_chunk_id' : s.kind);
+ const [keep, ...drop]: string[] = selectors.map(s => s.kind === 'around' ? 'around_chunk_id' : s.kind);
const conflicts = ['include_content', 'content_only', ...(keep === 'around_chunk_id' && p.view === 'markdown' ? ['view'] : [])];
const args = Object.fromEntries(Object.entries(p).filter(([k, v]) => v !== undefined && k !== '_meta' && !drop.includes(k) && !conflicts.includes(k)));
const name = (k: string) => opTransport(ctx) === 'cli' ? `--${k.replace(/_/g, '-')}` : `\`${k}\``;