text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
mod live;
mod support;
<|endoftext|> | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>;
<|fim_prefix|>mod support;
mod s<|fim_middle|>ystem<|endoftext|> | fim | zeroclaw-labs/zeroclaw | rust |
use clap::Parser;
use std::collections::HashMap;
use std::io::Write;
use std::path::PathBuf;
use std::sync::Mutex;
#[derive(Parser)]
#[command(about = "Fill empty/fuzzy .po entries via a configured model_provider")]
struct Args {
#[arg(long)]
po: PathBuf,
#[arg(long)]
locale: String,
/// Re-transla... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>import {
Component,
createContext,
useContext,
useEffect,
useState,
type ErrorInfo,
type ReactNode,
} from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { ThemeProvider } from "./contexts/ThemeContext";
import { loadLocale, saveLocale } from "./contexts/ThemeC... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>>
{c}
</span>
</EntityLink>
))}
</ChipRow>
)}
<p
className="text-xs flex items-center gap-1.5"
style={{ color: 'var(--pc-text-muted)' }}
>
<MessageSquare className="h-3 w-3" />
... | fim | zeroclaw-labs/zeroclaw | typescript |
import { useEffect, useRef, useState } from 'react';
import { X } from 'lucide-react';
interface Props {
label: string;
suggestion: string;
onConfirm: (alias: string) => void;
onCancel: () => void;
}
export default function AliasPromptDialog({ label, suggestion, onConfirm, onCancel }: Props) {
const [value,... | fim | zeroclaw-labs/zeroclaw | typescript |
import { useEffect, useState } from 'react';
import { AlertTriangle, Check, X, ShieldCheck } from 'lucide-react';
import type { ApprovalDecision, PendingApproval } from '@/types/api';
import { t } from '@/lib/i18n';
interface ApprovalBannerProps {
pending: PendingApproval;
onRespond: (decision: ApprovalDecision) =... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>eProps) {
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
const flip = async () => {
if (busy) return;
const next = !enabled;
setBusy(true);
setError(null);
try {
await patchConfig([
{ op: 'replace', path: `${prefix... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { Link } from 'react-router-dom';
import type { ReactNode, CSSProperties, MouseEventHandler } from 'react';
import { entityConfigPath, type EntityKind } from '@/lib/entityLinks';
export interface EntityLinkProps {
kind: EntityKind;
id: string;
className?: string;
style?: CSSProperties;
t... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>{{ color: 'white' }} />}
</button>
))}
</div>
</div>
</>
)}
{/* Themes Tab */}
{tab === 'themes' && (
<>
<SectionTitle>Dark Themes</SectionTitle>
<div clas... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import type { LucideIcon } from 'lucide-rea<|fim_suffix|>>
{resolved ? (
<CheckCircle2 className="h-3.5 w-3.5 flex-shrink-0" style={{ color: '#34d399' }} />
) : (
<Loader2 className="h-3.5 w-3.5 flex-shrink-0 animate-spin" style={{ color: 'var(--pc-accent)' }} />
... | fim | zeroclaw-labs/zeroclaw | typescript |
import { useState, useRef, useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import { LogOut, Settings, ChevronDown, PanelLeftClose, PanelLeftOpen, Menu, Globe } from 'lucide-react';
import { t, SUPPORTED_LOCALES } from '@/lib/i18n';
import { useLocaleContext } from '@/App';
import { useAuth } f... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useState, useEffect } from 'react';
import { Outlet, useLocation } from 'react-router-dom';
import Sidebar from '@/components/layout/Sidebar';
import Header from '@/components/layout/Header';
import ReloadBanner from '@/components/layout/ReloadBanner';
import UnsavedChangesBanner from '@/componen... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';
import { AlertTriangle, X } from 'lucide-react';
import { getDrift, getReloadStatus, type DriftEntry } from '@/lib/api';
import ReloadDaemonButton from '@/components/sections/ReloadDaemonButton';
const POLL_INTER... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { NavLink } from 'react-router-dom';
import { basePath } from '../../lib/basePath';
import {
Activity,
Clock,
LayoutDashboard,
MessageSquare,
Monitor,
Puzzle,
Settings,
Stethoscope,
Terminal,
Wrench,
} from 'lucide-react';
import { t } from '@/lib/i18n';
import { useEffect, useS... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Top-of-page banner shown whenever the cross-section ConfigDraftStore
// has pending edits. Lists the affected top-level section keys, offers
// Save-all / Discard-all. Hides itself when there are no drafts.
//
// Section help and labels come from the gateway's section info; the
// banner falls back to ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Schema-driven editor for `[cost.rates.providers.<category>.<type>.<resource>]`.
// Reuses the same FieldForm machinery that powers /config so the
// rendered inputs always match the Configurable derive (input_per_mtok,
// output_per_mtok, cached_input_per_mtok for models; per_mchar for tts;
// per_minu... | fim | zeroclaw-labs/zeroclaw | typescript |
// One-level directory browser scoped to `<install>/shared/`. Backs the
// skill-bundle directory field on /config/skill-bundles/<alias>. Opens
// inside a popover anchored to the input; lists folders + files for the
// current path, lets the operator step in/out, and writes the relative
// path back to the field on se... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Shared form renderer for a section's fields. Used by both /quickstart and
// /config. Walks the entries returned by GET /api/config/list?prefix=...,
// dispatches each input by `kind` (no value-sniffing), and submits all
// changed fields as one PATCH on save.
//
// Per-field behavior:
// * bool ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Tabbed text editor for the per-workspace personality markdown files
// (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, TOOLS.md, HEARTBEAT.md,
// BOOTSTRAP.md, MEMORY.md). The runtime injects these into the system
// prompt at request time — this component is the dashboard's authoring
// surface for them.
/... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>but every
subsystem tears down and re-initializes from the on-disk
config:
</p>
<ul className="list-disc pl-5 space-y-1">
<li>Gateway listener stops and rebinds (clients briefly see connection-refused).</li>
<li>Ch... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Picker view used by /config to mirror the TUI's
// ZeroClaw Sections › Providers › [filter:_____] › <pickable list>
// flow. Items come from /api/config/sections/<section> (gateway derives
// them from list_providers / selectable_memory_backends / schema-walk).
//
// Fuzzy filter is inline (web/src/l... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Generic horizontal tab strip for config sections that have more than
// one authoring surface (Agents: Settings + Personality; Model
// providers: Connection / Model / Advanced; ...). Tab state lives in the
// `?tab=` URL query so navigation + reloads keep the active tab. The
// component is presentati... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Drill-in editor for a single skill-bundle: list the skills in the
// bundle's resolved directory, scaffold new ones (strict-spec: name +
// description required), open a selected skill in a CodeMirror SKILL.md
// editor, and archive a skill on demand.
//
// Lazy-load pattern mirrors PersonalityEditor —... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>essages(mapServerMessagesToPersisted(res.messages)));
}
} else if (!res.session_persistence) {
setMessages((prev) => {
if (prev.length > 0) return prev;
const ls = loadChatHistory(sid);
return ls.length ? persistedToUiMessages(ls) : prev;
... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { createContext, useState, useEffect, useCallback, type ReactNode } from 'react';
import { colorThemeMap, DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, type ColorThemeId } from './colorThemes';
// ── Types (was ThemeContextDef.ts) ───────────────────────────────────────────
export type ThemeMode = 'sy... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>meId = 'default-light';
<|fim_prefix|>import themesData from './themes.json';
export type ColorThemeId =
| 'default-dark' | 'default-light' | 'oled-black'
| 'icy-blue'
| 'nord-dark' | 'nord-light'
| 'dracula' | 'monokai'
| 'solarized-dark' | 'solarized-light'
| 'kanagawa-wave' | 'kanagawa-dra... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useState, useEffect, useCallback, useRef } from 'react';
import {
getStatus,
getTools,
getCronJobs,
getIntegrations,
getMemory,
getCliTools,
getHealth,
runDoctor,
} from '../lib/api';
import type {
StatusResponse,
ToolSpec,
CronJob,
Integration,
MemoryEntry,
CliTool,
... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import {
createContext,
useContext,
useState,
useCallback,
useEffect,
type ReactNode,
} from 'react';
import React from 'react';
import {
getToken as readToken,
setToken as writeToken,
clearToken as removeToken,
isAuthenticated as checkAuth,
} from '../lib/auth';
import { pair as apiPa... | fim | zeroclaw-labs/zeroclaw | typescript |
import { useState, useEffect, useCallback } from 'react';
interface Device {
id: string;
name: string | null;
device_type: string | null;
paired_at: string;
last_seen: string;
ip_address: string | null;
}
export function useDevices() {
const [devices, setDevices] = useState<Device[]>([]);
const [loadi... | fim | zeroclaw-labs/zeroclaw | typescript |
import { createContext, useContext, useCallback, useRef } from 'react';
/**
* In-memory draft store that survives component unmounts but not page reloads.
* Keyed by an arbitrary string (e.g. route path or conversation id).
*/
export interface DraftContextType {
getDraft: (key: string) => string;
setDraft: (ke... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useState, useEffect, useRef, useCallback } from 'react';
import { SSEClient, type SSEClientOptions } from '../lib/sse';
import type { SSEEvent } from '../types/api';
export type SSEConnectionStatus = 'disconnected' | 'connecting' | 'connected';
export interface UseSSEResult {
/** Array of all... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|> useContext(ThemeContext);
<|fim_prefix|>import { useContext } from 'react';
import { ThemeContext } from '../contexts/ThemeContext';
export const useTheme = ()<|fim_middle|> =><|endoftext|> | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useState, useEffect, useRef, useCallback } from 'react';
import { WebSocketClient, type WebSocketClientOptions } from '../lib/ws';
import type { WsMessage } from '../types/api';
export type ConnectionStatus = 'disconnected' | 'connecting' | 'connected';
export interface UseWebSocketResult {
/... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>uthMethods?: unknown[];
_meta?: unknown;
}
export interface AcpSessionNewResult {
sessionId?: string;
workspaceDir?: string;
}
export interface AcpSessionPromptResult {
sessionId?: string;
stopReason?: string;
content?: string;
}
export interface AcpSessionUpdateParams {
sessionId?: strin... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>ush({ composite, type, alias, identity });
}
return out;
}
<|fim_prefix|>// Resolve an agent's bound channels and the room/username identity field
// of each. Consumed by the Cron UI: when an operator picks an agent for a
// new cron job, the delivery-channel select narrows to that agent's
// `agents.... | fim | zeroclaw-labs/zeroclaw | typescript |
import { getCost, getMapKeys, getMemory, getSessions, listProps, patchConfig } from './api';
export interface AgentSummary {
alias: string;
enabled: boolean;
modelProvider: string;
channels: string[];
riskProfile: string;
runtimeProfile: string;
/** Memory backend kind from `[agents.<alias>.memory].backe... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>th ? `?path=${encodeURIComponent(path)}` : "";
return apiFetch<BrowseResponse>(`/api/browse${q}`);
}
/** Create a new directory under `<install>/shared/`. Idempotent on success. */
export function mkdirShared(path: string): Promise<{ created: string }> {
return apiFetch<{ created: string }>(`/api/bro... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>n some private browsing modes)
}
}
/**
* Remove the stored authentication token.
*/
export function clearToken(): void {
try {
localStorage.removeItem(TOKEN_KEY);
} catch {
// Ignore
}
}
/**
* Returns true if a token is currently stored.
*/
export function isAuthenticated(): boolean ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Runtime base path injected by the Rust gateway into index.html.
// Allows the SPA to work under a reverse-proxy path prefix.
// When running inside Tauri, the frontend is served from disk so basePath is
// empty and API calls target the gateway URL directly.
import { isTauri, tauriGate<|fim_suffix|>. ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import type { SessionMessageRow } from '@/types/api';
import { generateUUID } from '@/lib/uuid';
const MAX_MESSAGES = 100;
const PREFIX = 'zeroclaw_chat_history_v1:';
export interface PersistedChatBubble {
id: string;
role: 'user' | 'agent';
content: string;
thinking?: string;
markdown?: boole... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { getMapKeys, getProp, getTemplates } from './api';
export type ConfiguredModelCategory = 'models' | 'tts' | 'transcription';
export interface ConfiguredModelBinding {
type: string;
alias: string;
resource: string;
}
export async function walkConfiguredModelBindings(
category: Config<|fi... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Cross-section draft store for the config dashboard.
//
// Each field's unsaved value lives here keyed by its dotted prop path so
// drafts survive section navigation (clicking Channels then Memory and
// back doesn't lose the half-typed Channels webhook). The store also
// holds the tombstones (paths t... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Resolves an entity reference (agent alias, channel composite, model
// provider composite, profile / bundle alias) to its `/config/...` edit
// surface. The route shape follows `Section::shape()` in
// `crates/zeroclaw-config/src/sections.rs`:
//
// alias → /config/<section>/<id>
// typed → /... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Tiny fuzzy filter: matches when every query character appears in the target
// in order, scoring by tightness (consecutive matches > spread-out). Returns
// the matching items sorted by score (best first). Empty query returns the
// input unchanged. Case-insensitive.
//
// No npm dep — the dashboard's ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>derDisplayName(provider: string): string {
return displayByName.get(normalize(provider)) ?? provider;
}
<|fim_prefix|>// Local-vs-remote provider classification, sourced from the backend catalog
// (`GET /api/config/catalog`, which serves `zeroclaw_providers::list_model_providers()`).
// The registry is... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import type { SSEEvent } from '../types/api';
import { getToken } from './auth';
import { apiOrigin, basePath } from './basePath';
export type SSEEventHandler = (event: SSEEvent) => void;
export type SSEErrorHandler = (error: Event | Error) => void;
export interface SSEClientOptions {
/** Endpoint pat... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>// Tauri detection uti<|fim_suffix|>_?: unknown;
__ZEROCLAW_GATEWAY__?: string;
}
}
/** Returns true when running inside a Tauri WebView. */
export const isTauri = (): boolean => '__TAURI__' in window;
/** Gateway base URL when running inside Tauri (defaults to localhost). */
export const tauriGat... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>[6] = (bytes[6]! & 0x0f) | 0x40;
bytes[8] = (bytes[8]! & 0x3f) | 0x80;
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('');
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
}
<|fim_prefix|>/**
* Generate a UUID v... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import type { ApprovalDecision, WsMessage } from '../types/api';
import { getToken } from './auth';
import { apiOrigin, basePath } from './basePath';
import { isTauri } from './tauri';
import { generateUUID } from './uuid';
export type WsMessageHandler = (msg: WsMessage) => void;
export type WsOpenHandle... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from '<|fim_suffix|>r =
document.documentElement.getAttribute('data-unsupported-browser') === '1';
if (!unsupportedBrowser) {
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMod... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|> </h2>
</div>
<div className="p-4 space-y-3">
{permissions.length === 0 ? (
<p className="text-sm" style={{ color: 'var(--pc-text-muted)' }}>
{t('acp.permissions_empty')}
</p>
) : (
perm... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { memo, useState, useEffect, useRef, useCallback } from 'react';
import { Navigate, useParams } from 'react-router-dom';
import { Send, Square, Bot, User, AlertCircle, Copy, Check, X, Trash2, Minimize2, Maximize2, ChevronDown, Wrench } from 'lucide-react';
import ReactMarkdown from 'react-markdown'... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useEffect, useMemo, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import {
ArrowLeft,
ArrowUp,
Edit2,
FileText,
FolderOpen,
FolderPlus,
Lock,
RefreshCw,
Trash2,
} from 'lucide-react';
import {
ApiError,
createAgentWorkspaceDirectory,
deleteAg... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>.alias);
return next;
});
}
}, []);
return (
<div className="p-6 max-w-6xl mx-auto">
<header className="flex items-center justify-between mb-6">
<div>
<h1
className="text-2xl font-semibold"
style={{ color: 'var(--pc-text-primary)' ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>ms-center gap-3">
<Monitor className="h-6 w-6" style={{ color: 'var(--pc-accent)' }} />
<h1 className="text-xl font-semibold" style={{ color: 'var(--pc-text-primary)' }}>
Live Canvas
</h1>
<span
className="text-xs px-2 py-0.5 rounded-full fon... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|> type="button"
onClick={onTrashClick}
disabled={deleting}
title={armed ? "Click again to confirm delete" : "Delete this alias"}
className="btn-icon flex-shrink-0"
style={
armed
? {
color: "var(--color-status-error, #f8717... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|> </h3>
<button
onClick={closeModal}
className="btn-icon"
>
<X className="h-5 w-5" />
</button>
</div>
{formError && (
<div className="mb-4 rounded-xl border p-3 text-sm animate... | fim | zeroclaw-labs/zeroclaw | typescript |
import { useState, useEffect, useCallback, useMemo } from "react";
import { Link, useNavigate, useSearchParams } from "react-router-dom";
import {
Clock,
Globe,
Activity,
ArrowUpDown,
DollarSign,
Radio,
LayoutDashboard,
Users,
MessageSquare,
Wifi,
Plus,
Trash2,
Eye,
X,
Bot,
Filter,
Hea... | fim | zeroclaw-labs/zeroclaw | typescript |
import { useState } from 'react';
import {
Stethoscope,
Play,
CheckCircle,
AlertTriangle,
XCircle,
Loader2,
} from 'lucide-react';
import type { DiagResult } from '@/types/api';
import { runDoctor } from '@/lib/api';
import { t } from '@/lib/i18n';
function severityIcon(severity: DiagResult['severity']) {
... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|> Cards */}
{Object.keys(grouped).length === 0 ? (
<div className="card p-8 text-center">
<Puzzle className="h-10 w-10 mx-auto mb-3" style={{ color: 'var(--pc-text-faint)' }} />
<p style={{ color: 'var(--pc-text-muted)' }}>{t('integrations.empty')}</p>
</div>
... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>| !cursorOlder}
className="btn-electric px-3 py-1.5 text-xs font-semibold"
>
{loadingOlder ? 'Loading…' : 'Load older'}
</button>
</div>
)}
</div>
</div>
);
}
function LogRow({ event }: { event: LogEvent }) {
const style ... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>iring.paired')}</th>
<th>{t('pairing.last_seen')}</th>
<th>IP</th>
<th className="text-right">{t('pairing.actions')}</th>
</tr>
</thead>
<tbody>
{devices.map((device) => (
<tr key={device.id... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { useState, useEffect } from 'react';
import {
Wrench,
Search,
ChevronDown,
ChevronRight,
Terminal,
Package,
} from 'lucide-react';
import type { ToolSpec, CliTool } from '@/types/api';
import { getTools, getCliTools } from '@/lib/api';
import { t } from '@/lib/i18n';
export default fu... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>(
<LabeledInput
key={d.key}
label={d.label}
type={d.is_secret ? "password" : "text"}
value={extras[d.key] ?? ""}
onChange={(v) => setExtras((x) => ({ ...x, [d.key]: v }))}
placeholder={d.help}
/>
... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>ort('../pages/AgentsList'));
export const AgentWorkspaceExplorer = lazy(() => import('../pages/AgentWorkspaceExplorer'));
export const Tools = lazy(() => import('../pages/Tools'));
export const Cron = lazy(() => import('../pages/Cron'));
export const Integrations = lazy(() => import('../pages/Integrations... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>
} from './lazyPages';
function RouteFallback() {
return (
<div className="min-h-[60vh] flex items-center justify-center">
<div
className="h-8 w-8 border-2 rounded-full animate-spin"
style={{ borderColor: 'var(--pc-border)', borderTopColor: 'var(--pc-accent)' }}
/>
<... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_suffix|>ull` on the
* first sample after boot (no baseline) or on unsupported platforms. */
cpu_percent: number | null;
num_cpus: number;
}
export interface HealthSnapshot {
pid: number;
updated_at: string;
uptime_seconds: number;
components: Record<string, ComponentHealth>;
}
export interface Co... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>/// <reference<|fim_suffix|>"vite/client" />
<|fim_middle|> types=<|endoftext|> | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import path from "path";
const gatewayPort = process.env.ZEROCLAW_GATEWAY_PORT ?? "42617";
const gatewayTarget = `http://127.0.0.1:${gatewayPort}`;
export default defineConfig(({ c... | fim | zeroclaw-labs/zeroclaw | typescript |
<|fim_prefix|>use clap::{Parser, Subcommand};
use xtask::cmd;
#[derive(Parser)]
#[command(name = "fluent", about = "ZeroClaw Fluent app UI translation")]
struct Cl<|fim_suffix|>)]
force: bool,
/// Provider alias from `[providers.models.<kind>.<alias>]` in config.toml.
/// Pass a bare alias (e.g... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|> cmd::mdbook::versions::run(),
Cmd::PruneRoot => cmd::mdbook::versions::prune_root(),
Cmd::RetrofitSelector => cmd::mdbook::versions::retrofit_selector(),
Cmd::Themes => cmd::mdbook::themes::run(&xtask::util::repo_root()),
Cmd::Hardware => cmd::mdbook::hardware::run(&xtask:... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>ckage-lock.json
// after the last install. Sentinel is OLDER than lock → reinstall.
let dir = fresh_web_dir();
let nm = dir.path().join("node_modules");
fs::create_dir(&nm).unwrap();
fs::write(nm.join(".package-lock.json"), "{}").unwrap();
// Wait a measurab... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>smallest AI assistant.
"#;
assert_eq!(
message_ids(src).unwrap(),
vec!["cli-agent-long-about", "cli-about"]
);
}
#[test]
fn message_ids_report_parse_errors_with_line_numbers() {
let errors = message_ids(
r#"
valid-key = ok
bad key =... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::cmd::fluent::catalog::message_ids;
use crate::util::*;
use std::path::Path;
pub fn run(catalog: Option<&str>) -> anyhow::Result<()> {
let root = repo_root();
let mut error_count = 0;
let mut checked_any = false;
for locales_dir in fluent_catalog_roots_for(&root, catalog)? {
... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::util::*;
use std::path::{Path, PathBuf};
use zeroclaw_api::model_provider::ModelProvider;
const DEFAULT_BATCH_SIZE: usize = 50;
pub fn run(
locale: Option<&str>,
force: bool,
model_provider: Option<&str>,
config_dir: Option<&str>,
catalog: Option<&str>,
batch: Option<u... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|> stats;
<|fim_prefix|>pub mod catalog;
pub mod<|fim_middle|> check;
pub mod fill;
pub mod scan;
pub mod<|endoftext|> | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::cmd::fluent::catalog::message_ids_from_file;
use crate::util::*;
use std::collections::HashSet;
use std::path::{Path, PathBuf};
pub fn run(catalog: Option<&str>) -> anyhow::Result<()> {
let root = repo_root();
// Collect all en keys across every catalogue root.
let mut en_keys: Ha... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::cmd::fluent::catalog::message_ids_from_file;
use crate::util::*;
pub fn run(catalog: Option<&str>) -> anyhow::Result<()> {
let root = repo_root();
for locales_dir in fluent_catalog_roots_for(&root, catalog)? {
let en_dir = locales_dir.join("en");
if !en_dir.exists() {
... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::cmd::mdbook::refs::{build_api, build_refs};
use crate::util::*;
use std::path::Path;
use std::process::Command;
const DEFAULT_TAG: &str = "master";
pub fn run(tag: Option<&str>) -> anyhow::Result<()> {
let root = repo_root();
require_tool("cargo", "https://rustup.rs")?;
ensure_car... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|> #[test]
fn ignores_non_toml_fenced_config_like_text() {
let clean = entry(
"```text\n[placeholder]\nexample_value = 1\n```",
"```text\n[marcador]\nvalor_de_ejemplo = 1\n```",
);
assert_eq!(protected_literal_reason(&clean), None);
}
#[test]
... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>//! Generate the hardware reference snippets for the mdBook from canonical
//! source: the board registry, transport kinds, the tool catalog, and the
//! release target matrix. The registry is the single source of truth; the docs
//! render whatever it carries so a board add, transport rename, tool rename... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>et d = c.display();
if !seen.contains(&d) {
seen.push(d);
}
}
seen.join(" / ")
}
fn quickstart_rows() -> Vec<(String, &'static str)> {
QuickstartTabAction::all()
.iter()
.map(|a| (render_chords(&a.defaults()), a.human_label()))
.collect()
}
... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>e
// added/owned outside the authored Markdown.
if href.starts_with('/') || href.starts_with("api/") || href.contains("/api/") {
return false;
}
true
}
/// Resolve `.`/`..` segments without touching the filesystem (the target may
/// not exist, which is exactly what we are testing... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>ub mod themes;
pub mod versions;
<|fim_prefix|>pub mod build;
pub mod check;
pub mod hardware;
pub mod keymap;
pub mod linkcheck;
pub mod peer_groups;
pub mod refs;
pub mod ser<|fim_middle|>ve;
pub mod stats;
pub mod sync;
p<|endoftext|> | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>//! mdBook preprocessor: expand `{{#peer-group <channel>}}` directives.
//!
//! Implements the mdBook preprocessor protocol directly over JSON (no `mdbook`
//! crate dependency). mdBook invokes this as:
//!
//! * `mdbook preprocess supports <renderer>` — exit 0 if supported.
//! * `mdbook preprocess` ... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>rest
} else {
l
}
})
.collect::<Vec<_>>()
.join("\n");
std::fs::write(ref_dir.join("cli.md"), cli_content + "\n")?;
let schema = Command::new("cargo")
.args([
"run",
"--no-default-features",
... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::cmd::mdbook::refs::{build_api, build_refs};
use crate::util::*;
use std::path::Path;
use std::process::{Command, Stdio};
use std::sync::{
Arc,
atomic::{AtomicBool, Ordering},
};
const PORT: u16 = 3000;
pub fn run(locale: Option<&str>, tag: Option<&str>) -> anyhow::Result<()> {
let... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>o_string_lossy();
print!(" {locale:<8} ");
let out = Command::new("msgfmt")
.args(["--statistics", "-o", "/dev/null"])
.arg(&path)
.env("LANG", "C")
.output()?;
print!("{}", String::from_utf8_lossy(&out.stderr));
}
Ok(())
}... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use crate::util::*;
use std::path::Path;
use std::process::Command;
pub fn run(
locale: Option<&str>,
force: bool,
model_provider: Option<&str>,
config_dir: Option<&str>,
batch: Option<usize>,
) -> anyhow::Result<()> {
let root = repo_root();
require_tool(
"mdbook-xget... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>//! Generate the mdBook dashboard-theme CSS and switcher button list from the
//! web dashboard's theme registry (`web/src/contexts/themes.json`). That JSON
//! is the single source of truth shared with the React dashboard; the docs
//! mirror it so both surfaces expose the same named themes without a sec... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_suffix|>
fn is_version_dir_accepts_only_real_versions() {
for ok in ["master", "stable", "v0.8.0", "v0.8.0-beta-2", "v1.2.3"] {
assert!(is_version_dir(ok), "{ok} should be a version dir");
}
for orphan in ["en", "fr", "zh-CN", "api", "_shared", "main", "v1.2"] {
... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>pub mod flu<|fim_suffix|>;
pub mod mdbook;
<|fim_middle|>ent<|endoftext|> | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>pub mod cmd<|fim_suffix|>d util;
<|fim_middle|>;
pub mo<|endoftext|> | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>use std::path::{Path, PathBuf};
use std::process::Command;
pub fn repo_root() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
<|fim_suffix|>to_owned());
}
}
out.sort();
Ok(out)
}
pub fn fluent_locales(root: &Path) -> anyhow::Result<Vec<String>> {
f... | fim | zeroclaw-labs/zeroclaw | rust |
<|fim_prefix|>package bloom
import (
"context"
_ "embed"
"errors"
"strconv"
"github.com/zeromicro/go-zero/core/hash"
"github.com/zeromicro/go-zero/core/stores/redis"
)
// for detailed error rate table, see http://pages.cs.wisc.edu/~cao/papers/summary-cache/node8.html
// maps as k in the error rate table
const ... | fim | zeromicro/go-zero | go |
package bloom
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/stores/redis/redistest"
)
func TestRedisBitSet_New_Set_Test(t *testing.T) {
store := redistest.CreateRedis(t)
ctx := context.Background()
bitSet := newR... | fim | zeromicro/go-zero | go |
<|fim_prefix|>package breaker
import (
"context"
"errors"
"fmt"
"strings"
"sync"
"time"
"github.com/zeromicro/go-zero/core/proc"
"github.com/zeromicro/go-zero/core/stat"
"github.com/zeromicro/go-zero/core/stringx"
)
const numHistoryReasons = 5
// ErrServiceUnavailable is returned when the Breaker state is ... | fim | zeromicro/go-zero | go |
<|fim_suffix|>turn nil
}, func(err error) error {
return err
})
assert.ErrorIs(t, err, context.DeadlineExceeded)
})
t.Run("doWithFallback with ctx cancel", func(t *testing.T) {
b := NewBreaker()
assert.True(t, len(b.Name()) > 0)
for i := 0; i < 100; i++ {
ctx, cancel := context.WithTimeout(context.... | fim | zeromicro/go-zero | go |
<|fim_prefix|>package breaker
import (
"context"
"sync"
)
var (
lock sync.RWMutex
breakers = make(map[string]Breaker)
)
// Do calls Breaker.Do on the Breaker with given name.
func Do(name string, req func() error) error {
return do(name, func(b Breaker) error {
return b.Do(req)
})
}
// DoCtx calls Break... | fim | zeromicro/go-zero | go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.