Skip to content

Conversation

@intentionally-left-nil
Copy link
Contributor

@intentionally-left-nil intentionally-left-nil commented Aug 20, 2025

We want to run the runt agent in a browser. This means we need to isolate out our codebase into two sections:

  • browser compatible
  • node/deno compatible

The overall work will take three parts:

  1. Refactor the lib lib to extract out the common types and RuntimeAgent (this PR)
  2. Refactor the ai lib to be web compatible (needs to remove ollama, deal with secrets environment variables)
  3. Refactor the pyodide agent: Extract out a core web part, use the other web apis

Work to do

Needs a manual test pass to make sure the code works with anode :)

"@std/path": "jsr:@std/path@^1.0.0",
"npm:@livestore/livestore": "npm:@livestore/livestore@^0.3.1",
"@openai/openai": "jsr:@openai/openai@^4.98.0",
"npm:ollama": "npm:ollama@^0.5.16",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style wise, the reason I keep the npm: prefix is to make our code copy-pastable into a Deno notebook. Looking at this now though, I'd need to do the same with jsr: deps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, but local usage of this (prior to publishing to jsr) would need to have the right references. Guck.


Set environment variables to configure logging:

- `RUNT_LOG_LEVEL`: Set log level (DEBUG, INFO, WARN, ERROR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this means that we'd need to set VITE_RUNT_LOG_LEVEL. Instead we probably should be passing the log level into the log factory.

"@livestore/adapter-node": "npm:@livestore/adapter-node@^0.3.1",
"@livestore/livestore": "npm:@livestore/livestore@^0.3.1",
"@livestore/react": "npm:@livestore/react@^0.3.1",
"@livestore/sync-cf": "npm:@livestore/sync-cf@^0.3.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did these ones get taken out on accident?

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.

3 participants