Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.
JavaScript agent-collaborationagent-harnessagent-orchestrationagent-teamagent-workflowai-assistantai-automationai-employeeai-productivityai-teamai-workflowautonomous-agentsclaude-code-guiclaude-coworkdesktop-agentlocal-firstmulti-agentmulti-agent-systemself-evolving-agentstask-automation
// Shared security boundary for generated-artifact iframes.
//
// This file is intentionally a classic script: chat-artifact.js is eager and
// saved-apps.js is lazy-loaded, so both consume the same small global API.
(function (root, factory) {
const api = factory();
if (typeof module === 'object' && module.exports) module.exports = api;
if (root) root.OrkasArtifactSecurity = api;
})(typeof globalThis !== 'undefined' ? globalThis : this, function () {
'use strict';
// Generated apps may run code, submit forms, and use same-origin storage.
// They may not create popups or navigate the top-level renderer.
const SANDBOX = 'allow-scripts allow-same-origin allow-forms allow-downloads allow-popups allow-modals';
function safeExternalHttpUrl(raw) {
const value = String(raw == null ? '' : raw).trim();
if (!value || /[\u0000-\u001f\u007f]/.test(value)) return null;
try {
const parsed = new URL(value);
if (!['http:', 'https:'].includes(parsed.protocol)) return null;
if (!parsed.hostname || parsed.username || parsed.password) return null;
return parsed.href;
} catch (_) {
return null;
}
}
function trustedArtifactMessage(event, frame) {
if (!event || !frame) return false;
let source;
try { source = frame.contentWindow; } catch (_) { return false; }
if (!source || event.source !== source) return false;
try {
const expected = new URL(frame.src);
// Node's URL treats custom schemes as opaque; Electron registers chat-app
// as standard and serializes its origin as scheme + host.
if (expected.protocol !== 'chat-app:' || !expected.host || expected.username || expected.password
|| event.origin !== `chat-app://${expected.host}`) return false;
} catch (_) { return false; }
const data = event.data;
return !!data && typeof data === 'object' && data.__orkasArtifact === true;
}
return Object.freeze({ SANDBOX, safeExternalHttpUrl, trustedArtifactMessage });
});