Initial commit after recreate

This commit is contained in:
2026-04-11 09:21:22 +02:00
commit 02704133f4
378 changed files with 93091 additions and 0 deletions
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
import type { GlitchComponentProps } from './types';
export default function AssumptionToggle({ config, onComplete, onProgress, theme, className, host }: GlitchComponentProps): import("react/jsx-runtime").JSX.Element;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import './dev-theme.css';
@@ -0,0 +1,8 @@
import type { GlitchHostBridge } from './types';
export type DevHostBridgeOptions = {
isMuted?: () => boolean;
onSound?: (id: string, payload?: Record<string, unknown>) => void;
onEmit?: (type: string, payload?: unknown) => void;
};
export declare function createDevHostBridge(options?: DevHostBridgeOptions): GlitchHostBridge;
export declare function attachWindowSoundBridge(host: GlitchHostBridge): () => void;
@@ -0,0 +1,14 @@
{
"componentId": "assumption-toggle",
"displayName": "Assumption Toggle",
"version": "1.0.0",
"folderName": "glitch_assumption_toggle",
"packageName": "@nommo/assumption-toggle",
"entry": "dist/assumption-toggle.js",
"source": "src/index.tsx",
"tags": [
"glitch-component",
"crt",
"logic"
]
}
+17
View File
@@ -0,0 +1,17 @@
import type { GlitchHostBridge } from './types';
export declare const HOST_SOUND_EVENT = "glitch:play-sound";
export declare const HOST_STOP_SOUND_EVENT = "glitch:stop-sound";
export declare const HOST_EMIT_PREFIX = "glitch:host:";
export declare const SOUND_IDS: {
readonly click: "ui.button_click";
readonly hover: "ui.button_hover";
readonly computeStart: "machine.compute_start";
readonly computeStep: "machine.compute_step";
readonly computeDone: "machine.compute_done";
readonly verdictStable: "machine.verdict_stable";
readonly verdictAlert: "machine.verdict_alert";
};
export type SoundId = (typeof SOUND_IDS)[keyof typeof SOUND_IDS];
export declare function safePlaySound(host: GlitchHostBridge | undefined, id: string, payload?: Record<string, unknown>): void;
export declare function safeStopSound(host: GlitchHostBridge | undefined, id: string, payload?: Record<string, unknown>): void;
export declare function safeEmit(host: GlitchHostBridge | undefined, type: string, payload?: unknown): void;
+6
View File
@@ -0,0 +1,6 @@
import './styles.css';
import Component from './Component';
import type { GlitchComponentMetadata } from './types';
export default Component;
export declare const metadata: GlitchComponentMetadata;
export type { GlitchComponentProps, GlitchComponentConfig, GlitchComponentResult } from './types';
Binary file not shown.
+56
View File
@@ -0,0 +1,56 @@
export interface GlitchComponentConfig {
id: string;
name: string;
version: string;
params: Record<string, unknown>;
}
export interface GlitchHostBridge {
playSound?: (id: string, payload?: Record<string, unknown>) => void;
stopSound?: (id: string, payload?: Record<string, unknown>) => void;
emit?: (type: string, payload?: unknown) => void;
}
export interface GlitchComponentProps {
config: GlitchComponentConfig;
onComplete: (result: GlitchComponentResult) => void;
onProgress?: (percent: number) => void;
theme?: GlitchTheme;
className?: string;
host?: GlitchHostBridge;
}
export interface GlitchComponentResult {
success: boolean;
score?: number;
data?: unknown;
error?: string;
}
export interface GlitchTheme {
primary: string;
accent: string;
bg: string;
bgSecondary: string;
text: string;
textMuted: string;
border: string;
}
export interface GlitchComponentMetadata {
name: string;
displayName: string;
version: string;
paramSchema: ParamSchema;
defaultParams: Record<string, unknown>;
}
export interface ParamSchema {
[key: string]: {
type: 'number' | 'string' | 'boolean' | 'color' | 'select' | 'range';
label?: string;
description?: string;
default: unknown;
options?: {
value: string | number;
label: string;
}[];
min?: number;
max?: number;
step?: number;
};
}