feat: add Lightcone integration with a Wikipedia search example and docs#270
feat: add Lightcone integration with a Wikipedia search example and docs#270eddieogola wants to merge 6 commits into
Conversation
…esponding documentation.
|
# Conflicts: # docs/docs.json # docs/src/content/docs/integrations/tzafon.mdx
|
@eddieogola is attempting to deploy a commit to the Inngest Team on Vercel. A member of the Team first needs to authorize it. |
Refresh the integration to the current Lightcone product surface: - Example: switch from the legacy `tzafon` SDK to `@tzafon/lightcone` (`client.computers.create`, CDP endpoint from `session.endpoints.cdp`, Bearer-token auth, session cleanup), use `LIGHTCONE_API_KEY`, and make the Wikipedia lookup robust by navigating the search endpoint directly. - Docs: rewrite `tzafon.mdx` using Astro Starlight components (Steps/Tabs/ TabItem/LinkCard, ::: asides) to match the migrated docs system, and rebrand to Lightcone (docs.lightcone.ai). Verified end-to-end against the live Lightcone API. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Register the integrations/tzafon page in the manual Astro Starlight sidebar so it appears in the Integrations nav section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0128f8e136
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Build the CDP URL from the session's endpoint path and connect, | ||
| // authenticating with a Bearer token. | ||
| const cdpUrl = `${BASE_URL}${session.endpoints?.cdp}`; | ||
| const browser = await chromium.connectOverCDP(cdpUrl, { |
There was a problem hiding this comment.
Delete the session if CDP connection fails
If client.computers.create() succeeds but chromium.connectOverCDP() rejects (for example because the endpoint is missing/invalid, the token is wrong, or the network flakes), execution never enters the try/finally, so client.computers.delete(session.id!) is skipped and the managed Lightcone browser is left running. Wrap the connect and browser use in a try/finally or delete the session from a catch so failed connections do not leak sessions.
Useful? React with 👍 / 👎.
|
|
||
| async function main() { | ||
| const server = createServer({ | ||
| agents: [searchAgent], |
There was a problem hiding this comment.
Do not register a standalone agent without a model
Registering searchAgent here creates an extra agent-wikipedia_searcher Inngest function, but the agent has no model of its own and only works through wikipediaSearchNetwork.defaultModel; triggering that standalone function from the Dev Server will call agent.run() without a network and throw No model provided to agent. Either remove the agents entry or give the agent its own model so every exposed function is runnable.
Useful? React with 👍 / 👎.
| description: "An agent that searches Wikipedia for relevant information", | ||
| system: | ||
| "You are a helpful assistant that searches Wikipedia for relevant information.", | ||
| }); |
There was a problem hiding this comment.
Attach the Lightcone tool in the guide snippet
Following the guide as written creates searchWikipedia in the next step but never adds it to searchAgent, so the documented network has an agent with no tools and cannot actually browse Wikipedia via Lightcone. The complete example includes tools: [searchWikipedia]; the integration guide should also instruct readers to add that property when defining or updating the agent.
Useful? React with 👍 / 👎.
This PR adds an integration for Lightcone (by Tzafon), enabling AgentKit agents to autonomously browse the web using managed cloud browsers. It adds an integration guide plus a runnable Wikipedia search example.
What's included
Integration guide —
docs/src/content/docs/integrations/tzafon.mdxSteps/Tabs/TabItem/LinkCardand:::note/:::tipasides), matching the other integration pages.@tzafon/lightcone+playwright-core, wiring up an Agent/Network, and building a browser tool.index.mdx).Example project —
examples/wikipedia-search-tzafon/src/main.ts), with.env.example,package.json, lockfile, and README.client.computers.create({ kind: "browser" }), CDP URL fromsession.endpoints.cdp, Bearer-token auth, and session cleanup.Notes
tzafonSDK and Mintlify-era doc components — both since superseded by@tzafon/lightconeand the Astro Starlight docs.