Skip to content

fix(agent-tars): share serialize error with html artifacts #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/agent-tars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@agent-infra/mcp-server-browser": "workspace:*"
},
"devDependencies": {
"serialize-javascript": "6.0.2",
"@modelcontextprotocol/sdk": "^1.7.0",
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^4.0.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/agent-tars/src/main/ipcRoutes/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import fs, { readFile } from 'fs-extra';
import { shell } from 'electron';
import fetch from 'node-fetch';
import FormData from 'form-data';
import serialize from 'serialize-javascript';
import {
normalizeMessages,
parseArtifacts,
Expand Down Expand Up @@ -145,7 +146,7 @@ export const actionRoute = t.router({
.replace(
' <!-- DATA -->',
'<script>window.__OMEGA_REPORT_DATA__ = ' +
JSON.stringify({
serialize({
messages,
artifacts,
}) +
Expand Down
17 changes: 17 additions & 0 deletions apps/agent-tars/src/renderer/mock/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ export const createClient = () => ({
runAgent: async () => {
return 'Hello from mock agent';
},

updateFileSystemSettings: async () => {
return true;
},

getSettings: async () => {
return {
model: {},
fileSystem: {
availableDirectories: ['/mock/path/to/allowed/directories'],
},
search: {},
};
},
getAllowedDirectories: async () => {
return ['/mock/path/to/allowed/directories'];
},
});

declare global {
Expand Down
17 changes: 17 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading