A little library for auditing DOM modifications.
- Tracks DOM modifications (textContent, innerHTML, className)
- Extensible audit system for custom operations
- Formatted audit trail output
- Event-based subscription for real-time monitoring
| node_modules |
| import { | |
| signal, | |
| effect, | |
| useSignal, | |
| type useSignalEffect, | |
| type Signal, | |
| type ReadonlySignal, | |
| } from '@preact/signals'; | |
| import { VNode, type ComponentChildren } from 'preact'; | |
| import { |
| import { useState, useEffect } from 'preact/hooks'; | |
| const cache = new Map<string, any>(); | |
| const inflight = new Map<string, Promise<any>>(); | |
| export interface SWRResponse<T> { | |
| data: T | undefined; | |
| error: Error | null; | |
| loading: boolean; | |
| } |
Claude generates this anti-pattern due to shallow pattern matching across incompatible mental models:
Every getter access creates a new computed signal with fresh subscriptions:
obj.fullName; // Creates computed signal #1
obj.fullName; // Creates computed signal #2 (never cleaned up!)A minimalist, zero-dependency OpenAI-compatible streaming client with automatic tool calling.
Ultra-lightweight MCP server for shell execution with session management.
| // parse-ms | |
| // MIT License, copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) | |
| // Modified by Dobby233Liu in slight cooperation with MIT License | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), | |
| // to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | |
| // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
| // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| import ai from "ko-ai"; | |
| const BASE_URL = "https://proxy-shopify-ai.local.shop.dev/v1"; | |
| const MODEL = "openai:gpt-4o-mini"; | |
| const PROMPT = "In one sentence, what is the capital of Japan?"; | |
| async function run(label: string, mode: "completions" | "responses", stream: boolean) { | |
| const chat = ai({ baseURL: BASE_URL, apiKey: "", model: MODEL, temperature: 0, max_output_tokens: 100, mode, stream }); | |
| const t = performance.now(); | |
| let text = "", chunks = 0; |