Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion console/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const esc = (value) => String(value ?? "").replace(/[&<>"']/g, (char) => ({
"'": "&#39;",
})[char]);

// The FliskOS logo for empty states: the page's favicon is the canonical mark (flisk-emoji apps/fliskos.svg).
const logoIcon = () => `<img class="empty-icon empty-logo" src="${esc(document.querySelector('link[rel="icon"]')?.href || "")}" alt="" aria-hidden="true">`;

async function api(url, options = {}) {
const response = await fetch(url, {
...options,
Expand Down Expand Up @@ -341,7 +344,7 @@ function renderDetail(project) {
${configSection(project)}
${toolsSection(project)}
${agentsSection(project)}
${collapsible("stacks", "Stacks & resources", `<div class="stack-list">${project.pending ? `<div class="skel-row"></div><div class="skel-row"></div>` : stackMarkup || `<div class="empty"><span class="empty-icon" aria-hidden="true">F</span><strong>No resources found</strong><p>Initialize this folder with the Flisk CLI to add resources.</p></div>`}</div>`, `${resources.length} total <span class="scope-note">Stop and Restart act on the whole project</span><button class="link-btn" type="button" data-action="new-stack" data-project="${esc(project.id)}">${btnIcon("stack")}New stack</button><button class="link-btn" type="button" data-action="new-resource" data-project="${esc(project.id)}">${btnIcon("plus")}Add resource</button>`)}
${collapsible("stacks", "Stacks & resources", `<div class="stack-list">${project.pending ? `<div class="skel-row"></div><div class="skel-row"></div>` : stackMarkup || `<div class="empty">${logoIcon()}<strong>No resources found</strong><p>Initialize this folder with the Flisk CLI to add resources.</p></div>`}</div>`, `${resources.length} total <span class="scope-note">Stop and Restart act on the whole project</span><button class="link-btn" type="button" data-action="new-stack" data-project="${esc(project.id)}">${btnIcon("stack")}New stack</button><button class="link-btn" type="button" data-action="new-resource" data-project="${esc(project.id)}">${btnIcon("plus")}Add resource</button>`)}
</div>`;
}

Expand Down
13 changes: 7 additions & 6 deletions console/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<!-- FliskOS frontend from flisk-sh/fliskos@b9569ef, copied by scripts/sync-console.mjs. Do not edit here. -->
<!-- FliskOS frontend from flisk-sh/fliskos@ee2ae38, copied by scripts/sync-console.mjs. Do not edit here. -->
<meta name="robots" content="noindex" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down Expand Up @@ -194,6 +194,7 @@
.resource-actions .button:hover { border-color: var(--line); background: var(--surface-alt); color: var(--label); }
.empty { display: grid; justify-items: center; padding: 76px 24px; border: 1px dashed var(--line); border-radius: 10px; color: var(--secondary); text-align: center; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--tertiary); font-size: 16px; }
.empty-logo { padding: 0; border: 0; background: none; }
.empty strong { margin-bottom: 5px; color: var(--label); font-size: 14px; font-weight: 600; }
.empty p { max-width: 400px; margin: 0; font-size: 11px; line-height: 1.55; }
.loading { padding: 28px 12px; color: var(--secondary); font-size: 12px; }
Expand Down Expand Up @@ -1076,10 +1077,10 @@
</div>
<dialog class="modal form-modal" id="form-dialog" aria-labelledby="form-title"></dialog>
<dialog class="modal" id="logs" aria-labelledby="log-title"><div class="modal-head"><h2 id="log-title">Recent logs</h2><div class="modal-actions"><button class="copy-icon" id="copy-logs" type="button" aria-label="Copy logs" title="Copy logs"><svg viewBox="0 0 20 20" aria-hidden="true"><rect x="7" y="6" width="9" height="11" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.4"/><path d="M12.5 4H5.8A1.8 1.8 0 0 0 4 5.8v8.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg></button><button class="button" id="ask-agent-logs" type="button" title="Start an agent thread with these logs">Ask an agent</button><button class="button quiet" id="close-logs" type="button">Close</button></div></div><div id="log-ai"></div><pre id="log-body">Loading…</pre></dialog>
<script src="sample-data.js"></script>
<script src="sample.js"></script>
<script src="inspect.js" defer></script>
<script src="app.js" defer></script>
<script src="os.js" defer></script>
<script src="sample-data.js?v=ee2ae38"></script>
<script src="sample.js?v=ee2ae38"></script>
<script src="inspect.js?v=ee2ae38" defer></script>
<script src="app.js?v=ee2ae38" defer></script>
<script src="os.js?v=ee2ae38" defer></script>
</body>
</html>
2 changes: 1 addition & 1 deletion console/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function threadListMarkup() {
function newThreadMarkup() {
const draft = agents.draft;
const list = sortedProjects();
if (!list.length) return `<div class="agent-form"><div class="empty"><span class="empty-icon" aria-hidden="true">F</span><strong>No Flisk projects yet</strong><p>Agents work inside a Flisk project. Create or open one first.</p></div></div>`;
if (!list.length) return `<div class="agent-form"><div class="empty">${logoIcon()}<strong>No Flisk projects yet</strong><p>Agents work inside a Flisk project. Create or open one first.</p></div></div>`;
if (!list.some((project) => project.id === draft.project)) draft.project = selectedProjectId ?? list[0].id;
const known = agents.providers ?? [];
const installed = known.filter((provider) => provider.installed);
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1>The local runtime your <span class="aw-accent">AI agent</span> can start, ch
<button type="button" data-stage-step="fix" data-cta="stage_step_fix">Apply the fix</button>
<button type="button" class="aw-stage-reset" data-stage-step="reset" data-cta="stage_step_reset">Start over</button>
</div>
<iframe class="aw-stage-frame" src="{{ '/console/' | relative_url }}" title="FliskOS, the desktop console for Flisk projects, with sample data" data-stage-frame></iframe>
<iframe class="aw-stage-frame" src="{{ '/console/' | relative_url }}?v={{ site.time | date: '%s' }}" title="FliskOS, the desktop console for Flisk projects, with sample data" data-stage-frame></iframe>
<p class="aw-try-note">This is the real FliskOS interface with sample data. Nothing starts on your machine and nothing leaves your browser. <a href="{{ '/docs/claims/' | relative_url }}#console">How it was made</a></p>
</div>

Expand Down
9 changes: 5 additions & 4 deletions scripts/sync-console.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copies the FliskOS frontend (flisk-sh/fliskos, MIT) into console/ for the homepage demo.
// Usage: node scripts/sync-console.mjs <path to a fliskos checkout>
// app.js, os.js and inspect.js are copied as they are. index.html gets four changes: the token placeholder, relative script
// app.js, os.js and inspect.js are copied as they are; index.html loads every script with ?v=<fliskos commit> so a
// cached copy never outlives a sync. index.html gets four changes: the token placeholder, relative script
// paths, the dark colours on every system (the homepage is dark), and the two sample scripts that answer the /api/ calls.
import { execFileSync } from 'node:child_process';
import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
Expand All @@ -25,9 +26,9 @@ const replaceOnce = (text, from, to) => {

let html = readFileSync(join(source, 'public', 'index.html'), 'utf8');
html = replaceOnce(html, '__FLISK_CENTER_TOKEN__', 'demo');
html = replaceOnce(html, '<script src="/inspect.js" defer></script>', '<script src="sample-data.js"></script>\n <script src="sample.js"></script>\n <script src="inspect.js" defer></script>');
html = replaceOnce(html, '<script src="/app.js" defer></script>', '<script src="app.js" defer></script>');
html = replaceOnce(html, '<script src="/os.js" defer></script>', '<script src="os.js" defer></script>');
html = replaceOnce(html, '<script src="/inspect.js" defer></script>', `<script src="sample-data.js?v=${commit}"></script>\n <script src="sample.js?v=${commit}"></script>\n <script src="inspect.js?v=${commit}" defer></script>`);
html = replaceOnce(html, '<script src="/app.js" defer></script>', `<script src="app.js?v=${commit}" defer></script>`);
html = replaceOnce(html, '<script src="/os.js" defer></script>', `<script src="os.js?v=${commit}" defer></script>`);
html = html.replaceAll('@media (prefers-color-scheme: dark)', '@media all');
html = html.replaceAll('color-scheme: light dark;', 'color-scheme: dark;');
html = replaceOnce(html, '<head>', `<head>\n <!-- FliskOS frontend from flisk-sh/fliskos@${commit}, copied by scripts/sync-console.mjs. Do not edit here. -->\n <meta name="robots" content="noindex" />`);
Expand Down
Loading