mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-18 15:03:06 +00:00
Rename Foundry handoffs to tasks (#239)
* Restore foundry onboarding stack * Consolidate foundry rename * Create foundry tasks without prompts * Rename Foundry handoffs to tasks
This commit is contained in:
parent
d30cc0bcc8
commit
d75e8c31d1
281 changed files with 9242 additions and 4356 deletions
35
foundry/packages/frontend-errors/src/client.ts
Normal file
35
foundry/packages/frontend-errors/src/client.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import type { FrontendErrorContext } from "./types.js";
|
||||
|
||||
interface FrontendErrorCollectorGlobal {
|
||||
setContext: (context: FrontendErrorContext) => void;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__FOUNDRY_FRONTEND_ERROR_COLLECTOR__?: FrontendErrorCollectorGlobal;
|
||||
__FOUNDRY_FRONTEND_ERROR_CONTEXT__?: FrontendErrorContext;
|
||||
}
|
||||
}
|
||||
|
||||
export function setFrontendErrorContext(context: FrontendErrorContext): void {
|
||||
if (typeof window === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextContext = sanitizeContext(context);
|
||||
window.__FOUNDRY_FRONTEND_ERROR_CONTEXT__ = {
|
||||
...(window.__FOUNDRY_FRONTEND_ERROR_CONTEXT__ ?? {}),
|
||||
...nextContext,
|
||||
};
|
||||
window.__FOUNDRY_FRONTEND_ERROR_COLLECTOR__?.setContext(nextContext);
|
||||
}
|
||||
|
||||
function sanitizeContext(input: FrontendErrorContext): FrontendErrorContext {
|
||||
const output: FrontendErrorContext = {};
|
||||
for (const [key, value] of Object.entries(input)) {
|
||||
if (value === null || value === undefined || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
||||
output[key] = value;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue