Skip to content

feat(assistant): add ask-page command#11

Merged
Microck merged 2 commits intomainfrom
feat/ask-page
Mar 19, 2026
Merged

feat(assistant): add ask-page command#11
Microck merged 2 commits intomainfrom
feat/ask-page

Conversation

@Microck
Copy link
Owner

@Microck Microck commented Mar 19, 2026

Summary

  • add kagi ask-page <URL> <QUESTION> for page-focused Assistant queries
  • return JSON with source metadata, thread metadata, and the Assistant reply
  • refresh docs and add a recorded ask-page demo

Implementation

  • reverse engineer the live web flow and confirm it reuses POST /assistant/prompt
  • shape the prompt as URL + newline + question to match Kagi's page-aware Assistant behavior
  • add URL and question validation plus a dedicated ask-page response envelope
  • normalize full Session Link URLs when loading session auth from env or config

Docs and Demo

  • add docs/commands/ask-page.mdx
  • update README, quickstart, auth matrix, coverage, output contract, error reference, docs nav, and llms index
  • add scripts/demo-ask-page.sh
  • record docs/demo-assets/ask-page.gif and images/demos/ask-page.gif

Verification

  • cargo fmt --all --check
  • cargo test
  • cargo test live_ask_page_rust_homepage -- --ignored --nocapture
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build
  • ./target/debug/kagi auth check
  • ./target/debug/kagi ask-page https://rust-lang.org/ "What is this page about?"
  • ./target/debug/kagi ask-page https://rust-lang.org/ "What learning resources does this page mention?"
  • invalid URL, invalid scheme, and empty-question failure paths
  • ./scripts/demo-ask-page.sh

Notes

  • there is no separate ask-page endpoint; the live browser flow reuses the normal Assistant prompt stream
  • page context is activated by sending the prompt as URL + newline + question

Resolve the ask-page branch against main after Assistant V2 landed.
Keep ask-page, Assistant thread management, updated docs, and demo coverage together on one branch.
@Microck Microck enabled auto-merge March 19, 2026 18:40
@Microck Microck merged commit 9013b78 into main Mar 19, 2026
6 checks passed
@Microck Microck deleted the feat/ask-page branch March 19, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant