@klarkxy/dsh-font 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +38 -0
- package/README.md +19 -19
- package/lib/client.inner.cjs +289 -6
- package/lib/client.inner.cjs.map +1 -1
- package/lib/client.js +289 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +649 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/docs/README.zh-CN.md +0 -38
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis'\nimport { PLUGIN_NAME } from './contracts.ts'\n\nexport const name = PLUGIN_NAME\n\n/**\n * The host half exists so the bundle has a loader row — the feature itself\n * lives entirely in the client half, which contributes its own Font section\n * page. Fonts are a property of the rendering environment, the conversation\n * font persists browser-local, and every host-backed write goes through the\n * official `ctx.theme` entries. Nothing here needs a Host service.\n */\nexport function apply(_ctx: Context): void {\n /* no host services, no RPC, no model calls */\n}\n"],"mappings":";;AAGA,MAAa,OAAO;;;;;;;;AASpB,SAAgB,MAAM,MAAqB,CAE3C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../dsh-plugin-kit/src/log-shared.ts","../../dsh-plugin-kit/src/logger.ts","../src/index.ts"],"sourcesContent":["export type PluginLogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fault'\n\nexport const PLUGIN_LOG_LEVELS: readonly PluginLogLevel[] = ['debug', 'info', 'warn', 'error', 'fault']\nexport const DEFAULT_PLUGIN_LOG_LEVEL: PluginLogLevel = 'info'\nexport const PLUGIN_LOG_MAX_MESSAGE_CHARS = 16_000\nexport const PLUGIN_LOG_MAX_CONTEXT_CHARS = 8_000\n\nexport type PluginLogScalar = string | number | boolean | null\nexport type PluginLogContext = Record<string, PluginLogScalar | undefined>\n\nexport interface PluginLogInput {\n level: PluginLogLevel\n event: string\n message: string\n context?: PluginLogContext\n error?: unknown\n}\n\nexport interface PluginLogError {\n name: string\n message: string\n stack?: string\n code?: string\n}\n\nexport interface PluginLogEntry {\n version: 1\n at: string\n level: PluginLogLevel\n source: string\n surface: 'host' | 'client'\n profile?: string\n event: string\n message: string\n pid?: number\n context?: Record<string, PluginLogScalar>\n error?: PluginLogError\n}\n\nexport interface PluginLogger {\n readonly source: string\n readonly file: string | null\n readonly lastWriteError: string | null\n debug(event: string, message: string, context?: PluginLogContext): boolean\n info(event: string, message: string, context?: PluginLogContext): boolean\n warn(event: string, message: string, error?: unknown, context?: PluginLogContext): boolean\n error(event: string, message: string, error?: unknown, context?: PluginLogContext): boolean\n fault(event: string, message: string, error?: unknown, context?: PluginLogContext): boolean\n write(input: PluginLogInput): boolean\n child(context: PluginLogContext): PluginLogger\n}\n\nconst SOURCE_RE = /^[a-z][a-z0-9-]{0,63}$/\nconst EVENT_RE = /^[a-z][a-z0-9._-]{0,127}$/\nconst CONTEXT_KEY_RE = /^[a-zA-Z][a-zA-Z0-9._-]{0,63}$/\nconst SECRET_KEY_RE = /(?:api[_-]?key|access[_-]?token|refresh[_-]?token|bearer|authorization|cookie|set[_-]?cookie|nonce|credential|private[_-]?key|password|secret|app[_-]?secret|client[_-]?secret|z_c0|d_c0)$/i\n\nconst CHAT_PAYLOAD_RE =\n /\"role\"\\s*:\\s*\"(?:system|user|assistant|tool)\"|\"(?:messages|content|prompt|input_text|input_image|image_url)\"\\s*:\\s*[\\[{\"']/i\nconst CREDENTIAL_BODY_RE =\n /-----BEGIN (?:RSA |EC |OPENSSH |PRIVATE )?PRIVATE KEY-----|\"type\"\\s*:\\s*\"service_account\"|credentials\\.json|\\.dsh[/\\\\](?:credentials|auth)/i\nconst AUTH_HEADER_RE = /\\b(Authorization|Proxy-Authorization|Cookie|Set-Cookie)\\s*:\\s*[^\\r\\n]*/gi\nconst BEARER_RE = /\\bBearer\\s+[A-Za-z0-9._\\-+=/]{8,}/g\nconst SECRET_FIELD_RE =\n /([\"']?(?:api[_-]?key|access[_-]?token|refresh[_-]?token|token|bearer|authorization|cookie|set-cookie|nonce|credential|private[_-]?key|password|secret|app[_-]?secret|client[_-]?secret|password|z_c0|d_c0)[\"']?\\s*[:=]\\s*)(?:\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*'|[^\\s,&;}]+)/gi\nconst SECRET_QUERY_RE =\n /([?&](?:token|api[_-]?key|key|secret|password|bootstrap|code|sig|signature|credential|password)=)[^\\s&#\"']+/gi\nconst URL_CREDENTIAL_RE = /\\b(https?:\\/\\/)[^\\s/:@]+:[^\\s/@]+@/gi\nconst BOOTSTRAP_RE = /\\/bootstrap\\/[^\\s\"'?&#]+/gi\nconst KNOWN_TOKEN_RE = /\\b(?:sk-[A-Za-z0-9_-]{10,}|gh[pousr]_[A-Za-z0-9_]{16,}|github_pat_[A-Za-z0-9_]{20,}|tvly-[A-Za-z0-9_-]{10,}|AKIA[0-9A-Z]{16})\\b/g\nconst PATH_RE = /(?:[A-Za-z]:\\\\|\\\\\\\\)[^\\s\"'`<>|]+|(?:\\/(?:home|Users|tmp|var|root)\\/|~\\/)[^\\s\"'`<>|]+/g\n\nexport function isPluginLogLevel(value: unknown): value is PluginLogLevel {\n return typeof value === 'string' && (PLUGIN_LOG_LEVELS as readonly string[]).includes(value)\n}\n\nexport function pluginLogLevelEnabled(level: PluginLogLevel, minimum: PluginLogLevel): boolean {\n return PLUGIN_LOG_LEVELS.indexOf(level) >= PLUGIN_LOG_LEVELS.indexOf(minimum)\n}\n\nexport function normalizePluginLogSource(raw: string): string {\n const stripped = String(raw || '').trim().replace(/^@[^/]+\\//, '').toLowerCase()\n .replace(/[^a-z0-9-]+/g, '-').replace(/^-+|-+$/g, '')\n const prefixed = /^[a-z]/.test(stripped) ? stripped : `p-${stripped}`\n const bounded = prefixed.slice(0, 64).replace(/-+$/g, '')\n return SOURCE_RE.test(bounded) ? bounded : 'dsh-plugin'\n}\n\nexport function normalizePluginLogEvent(raw: string): string {\n const cleaned = String(raw || '').trim().toLowerCase()\n .replace(/[^a-z0-9._-]+/g, '-').replace(/^[^a-z]+/, '').slice(0, 128)\n return EVENT_RE.test(cleaned) ? cleaned : 'plugin.event'\n}\n\n/**\n * Parse a level specification like `debug` or `dsh-zhihu=debug,dsh-dot:warn,info`.\n * Source-specific rules win over a bare fallback level.\n */\nexport function parsePluginLogLevel(\n spec: string | undefined | null,\n source?: string,\n fallback: PluginLogLevel = DEFAULT_PLUGIN_LOG_LEVEL,\n): PluginLogLevel {\n if (!spec || typeof spec !== 'string') return fallback\n const normalizedSource = source ? normalizePluginLogSource(source) : undefined\n let wildcard: PluginLogLevel | undefined\n for (const token of spec.split(',').map(part => part.trim()).filter(Boolean)) {\n const lowered = token.toLowerCase()\n if (isPluginLogLevel(lowered)) {\n wildcard = lowered\n continue\n }\n const match = /^([^=:]+)[=:]([a-z]+)$/i.exec(token)\n if (!match) continue\n const target = match[1]!.trim()\n const candidate = match[2]!.trim().toLowerCase()\n if (!isPluginLogLevel(candidate)) continue\n if (target === '*') {\n wildcard = candidate\n continue\n }\n if (normalizedSource && normalizePluginLogSource(target) === normalizedSource) {\n return candidate\n }\n }\n return wildcard ?? fallback\n}\n\nexport function sanitizePluginLogText(text: string, maxChars = PLUGIN_LOG_MAX_MESSAGE_CHARS): string {\n if (!text) return ''\n if (CREDENTIAL_BODY_RE.test(text)) return '[omitted credential material]'\n if (CHAT_PAYLOAD_RE.test(text)) return '[omitted chat payload]'\n const redacted = text\n .replace(AUTH_HEADER_RE, '$1: [redacted]')\n .replace(BEARER_RE, 'Bearer [redacted]')\n .replace(SECRET_FIELD_RE, (full, prefix: string) => {\n const value = full.slice(prefix.length)\n if (value.startsWith('\"')) return `${prefix}\"[redacted]\"`\n if (value.startsWith(\"'\")) return `${prefix}'[redacted]'`\n return `${prefix}[redacted]`\n })\n .replace(SECRET_QUERY_RE, '$1[redacted]')\n .replace(URL_CREDENTIAL_RE, '$1[redacted]@')\n .replace(BOOTSTRAP_RE, '/bootstrap/[redacted]')\n .replace(KNOWN_TOKEN_RE, '[redacted]')\n .replace(PATH_RE, '[path]')\n return truncateLogText(redacted, maxChars)\n}\n\nexport function sanitizePluginLogContext(\n input: PluginLogContext | undefined,\n): Record<string, PluginLogScalar> | undefined {\n if (!input) return undefined\n const output: Record<string, PluginLogScalar> = {}\n for (const [key, value] of Object.entries(input).slice(0, 32)) {\n if (value === undefined || !CONTEXT_KEY_RE.test(key)) continue\n if (typeof value === 'number' && !Number.isFinite(value)) continue\n if (SECRET_KEY_RE.test(key)) {\n output[key] = '[redacted]'\n continue\n }\n output[key] = typeof value === 'string' ? sanitizePluginLogText(value, 1_000) : value\n }\n if (!Object.keys(output).length) return undefined\n const encoded = JSON.stringify(output)\n if (encoded.length <= PLUGIN_LOG_MAX_CONTEXT_CHARS) return output\n return { omitted: true, reason: 'Diagnostic context exceeded its size limit.' }\n}\n\nexport function sanitizePluginLogError(error: unknown): PluginLogError | undefined {\n if (error === undefined) return undefined\n const row = error && typeof error === 'object'\n ? error as { name?: unknown; message?: unknown; stack?: unknown; code?: unknown }\n : {}\n const rawMessage = typeof row.message === 'string' ? row.message : String(error)\n const result: PluginLogError = {\n name: typeof row.name === 'string' && row.name.trim() ? sanitizePluginLogText(row.name.trim(), 100) : 'Error',\n message: sanitizePluginLogText(rawMessage) || 'Unknown error',\n }\n if (typeof row.stack === 'string' && row.stack.trim()) {\n result.stack = sanitizePluginLogText(row.stack, 24_000)\n }\n if (typeof row.code === 'string' && /^[A-Za-z0-9_./:-]{1,100}$/.test(row.code)) {\n result.code = sanitizePluginLogText(row.code, 100)\n } else if (typeof row.code === 'number' && Number.isFinite(row.code)) {\n result.code = String(row.code)\n }\n return result\n}\n\nexport function mergePluginLogContext(\n base: PluginLogContext | undefined,\n extra: PluginLogContext | undefined,\n): PluginLogContext | undefined {\n if (!base) return extra\n if (!extra) return base\n return { ...base, ...extra }\n}\n\nexport function buildPluginLogEntry(\n input: PluginLogInput,\n meta: {\n at: Date\n source: string\n surface: 'host' | 'client'\n profile?: string\n pid?: number\n correlation?: PluginLogContext\n },\n): PluginLogEntry {\n const entry: PluginLogEntry = {\n version: 1,\n at: meta.at.toISOString(),\n level: isPluginLogLevel(input.level) ? input.level : 'info',\n source: normalizePluginLogSource(meta.source),\n surface: meta.surface,\n ...(meta.profile ? { profile: meta.profile } : {}),\n event: normalizePluginLogEvent(input.event),\n message: sanitizePluginLogText(input.message || 'No diagnostic message was provided.', PLUGIN_LOG_MAX_MESSAGE_CHARS),\n ...(meta.pid !== undefined ? { pid: meta.pid } : {}),\n }\n const context = sanitizePluginLogContext(mergePluginLogContext(meta.correlation, input.context))\n if (context) entry.context = context\n const error = sanitizePluginLogError(input.error)\n if (error) entry.error = error\n return entry\n}\n\nexport function createChildPluginLogger(parent: PluginLogger, bound: PluginLogContext): PluginLogger {\n return {\n get source() { return parent.source },\n get file() { return parent.file },\n get lastWriteError() { return parent.lastWriteError },\n debug: (event, message, context) => parent.debug(event, message, mergePluginLogContext(bound, context)),\n info: (event, message, context) => parent.info(event, message, mergePluginLogContext(bound, context)),\n warn: (event, message, error, context) => parent.warn(event, message, error, mergePluginLogContext(bound, context)),\n error: (event, message, error, context) => parent.error(event, message, error, mergePluginLogContext(bound, context)),\n fault: (event, message, error, context) => parent.fault(event, message, error, mergePluginLogContext(bound, context)),\n write: input => parent.write({ ...input, context: mergePluginLogContext(bound, input.context) }),\n child: next => createChildPluginLogger(parent, mergePluginLogContext(bound, next) ?? {}),\n }\n}\n\nexport function truncateLogText(text: string, maxChars: number): string {\n if (text.length <= maxChars) return text\n const marker = '[truncated]\\n'\n if (maxChars <= marker.length) return text.slice(0, Math.max(0, maxChars))\n return `${marker}${text.slice(-(maxChars - marker.length))}`\n}\n","import { AsyncLocalStorage } from 'node:async_hooks'\nimport {\n appendFileSync, closeSync, existsSync, lstatSync, mkdirSync, openSync,\n readSync, readdirSync, realpathSync, renameSync, unlinkSync,\n} from 'node:fs'\nimport { homedir } from 'node:os'\nimport { basename, dirname, join, resolve, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport {\n DEFAULT_PLUGIN_LOG_LEVEL, buildPluginLogEntry, createChildPluginLogger,\n mergePluginLogContext, normalizePluginLogSource, parsePluginLogLevel,\n pluginLogLevelEnabled, sanitizePluginLogText,\n type PluginLogContext, type PluginLogEntry, type PluginLogInput,\n type PluginLogLevel, type PluginLogger,\n} from './log-shared.ts'\n\nexport * from './log-shared.ts'\n\nexport const PLUGIN_LOG_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000\nexport const PLUGIN_LOG_MAX_FILE_BYTES = 100 * 1024 * 1024\nexport const PLUGIN_LOG_MAX_ARCHIVE_BYTES = 100 * 1024 * 1024\nexport const PLUGIN_LOG_RECENT_LIMIT = 200\n\nconst PROFILE_RE = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/\nconst ARCHIVE_RE = /^[a-z][a-z0-9-]{0,63}\\.\\d{4}-\\d{2}-\\d{2}T\\d{2}-\\d{2}-\\d{2}\\.\\d{3}Z\\.\\d+\\.\\d+\\.jsonl$/\n\nconst correlationStorage = new AsyncLocalStorage<PluginLogContext>()\nconst processFileLoggers = new Map<string, RotatingPluginLogger>()\nlet operationSequence = 0\n\nexport interface RotatingPluginLoggerOptions {\n directory?: string\n home?: string\n profile?: string\n minimumLevel?: PluginLogLevel\n env?: NodeJS.ProcessEnv\n now?: () => Date\n pid?: number\n maxFileBytes?: number\n maxArchiveBytes?: number\n maxAgeMs?: number\n recentLimit?: number\n forwardHostWarnError?: boolean\n}\n\nexport interface InstallPluginLoggerOptions extends RotatingPluginLoggerOptions {\n loadedContext?: PluginLogContext\n}\n\ntype HostContextLike = {\n baseUrl?: unknown\n get?: (name: string, ...rest: unknown[]) => unknown\n effect?: (callback: () => () => void | Promise<void>, label?: string) => unknown\n logger?: {\n warn?: (...args: unknown[]) => void\n error?: (...args: unknown[]) => void\n }\n}\n\nexport function safeProfileName(profile: string | undefined | null): string {\n const trimmed = String(profile ?? '').trim()\n if (PROFILE_RE.test(trimmed)) return trimmed.toLowerCase()\n const cleaned = trimmed.toLowerCase().replace(/[^a-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 64)\n return cleaned && PROFILE_RE.test(cleaned) ? cleaned : 'default'\n}\n\nexport function pluginLogDirectory(home: string, profile = 'default'): string {\n return join(resolve(home), 'logs', 'plugins', safeProfileName(profile))\n}\n\nexport function resolveHostLogTarget(\n ctx: unknown,\n options: Pick<RotatingPluginLoggerOptions, 'directory' | 'home' | 'profile' | 'env'> = {},\n): { directory: string | null; anchor: string | null; profile?: string } {\n const env = options.env ?? process.env\n if (options.directory?.trim()) {\n const dir = resolve(options.directory.trim())\n return { directory: dir, anchor: dir, ...(options.profile ? { profile: safeProfileName(options.profile) } : {}) }\n }\n if (options.home?.trim()) {\n const home = resolve(options.home.trim())\n const profile = safeProfileName(options.profile)\n return { directory: pluginLogDirectory(home, profile), anchor: home, profile }\n }\n if (env.DSH_PLUGIN_LOG_DIR?.trim()) {\n const dir = resolve(env.DSH_PLUGIN_LOG_DIR.trim())\n return { directory: dir, anchor: dir, ...(options.profile ? { profile: safeProfileName(options.profile) } : {}) }\n }\n const host = ctx && typeof ctx === 'object' ? ctx as HostContextLike : undefined\n let profileCtx: { home?: unknown; name?: unknown; dir?: unknown } | undefined\n try {\n profileCtx = host?.get?.('profileContext', false) as typeof profileCtx\n } catch {\n try { profileCtx = host?.get?.('profileContext') as typeof profileCtx } catch { profileCtx = undefined }\n }\n if (\n typeof profileCtx?.home === 'string' && profileCtx.home.trim()\n && typeof profileCtx.dir === 'string' && profileCtx.dir.trim()\n ) {\n const home = resolve(profileCtx.home.trim())\n const dir = resolve(profileCtx.dir.trim())\n if (isInside(home, dir)) {\n const profile = safeProfileName(typeof profileCtx.name === 'string' ? profileCtx.name : basename(dir))\n return { directory: pluginLogDirectory(home, profile), anchor: home, profile }\n }\n }\n const inUnitTest = Boolean(env.VITEST || env.NODE_TEST_CONTEXT)\n if (!inUnitTest && typeof host?.baseUrl === 'string' && host.baseUrl.trim()) {\n const basePath = pathFromBaseUrl(host.baseUrl)\n const configuredHome = resolve((env.DSH_HOME?.trim() || join(homedir(), '.dsh')).trim())\n const profilesRoot = join(configuredHome, 'profiles')\n if (basePath && isInside(profilesRoot, basePath) && !samePath(profilesRoot, basePath)) {\n const rel = basePath.slice(profilesRoot.length).replace(/^[/\\\\]+/, '')\n const firstSegment = rel.split(/[/\\\\]/)[0]\n if (firstSegment) {\n const profile = safeProfileName(firstSegment)\n return { directory: pluginLogDirectory(configuredHome, profile), anchor: configuredHome, profile }\n }\n }\n }\n return { directory: null, anchor: null, ...(options.profile ? { profile: safeProfileName(options.profile) } : {}) }\n}\n\n/**\n * Synchronous, append-only rotating JSONL logger modeled on DSH Spaces\n * diagnostics: 7-day or 100 MiB active rotation, 7-day / 100 MiB archive\n * retention, secret and path redaction, and non-throwing write resilience.\n */\nexport class RotatingPluginLogger implements PluginLogger {\n readonly source: string\n readonly file: string | null\n private lastError: string | null = null\n private size = 0\n private openedAt = 0\n private initialized = false\n private writing = false\n private sequence = 0\n private loggedWriteFailure = false\n private readonly recent: PluginLogEntry[] = []\n private readonly directory: string | null\n private readonly anchor: string | null\n private readonly profile: string | undefined\n private readonly minimum: PluginLogLevel\n private readonly now: () => Date\n private readonly pid: number\n private readonly maxFileBytes: number\n private readonly maxArchiveBytes: number\n private readonly maxAgeMs: number\n private readonly recentLimit: number\n\n constructor(source: string, options: RotatingPluginLoggerOptions & { anchor?: string | null } = {}) {\n this.source = normalizePluginLogSource(source)\n const env = options.env ?? process.env\n const resolved = options.directory !== undefined || options.home !== undefined\n ? resolveHostLogTarget(undefined, options)\n : { directory: null, anchor: options.anchor ?? null, profile: options.profile }\n this.directory = resolved.directory\n this.anchor = options.anchor ?? resolved.anchor\n this.profile = options.profile ?? resolved.profile\n this.file = this.directory ? join(this.directory, `${this.source}.jsonl`) : null\n this.minimum = options.minimumLevel ?? parsePluginLogLevel(env.DSH_PLUGIN_LOG_LEVEL, this.source, DEFAULT_PLUGIN_LOG_LEVEL)\n this.now = options.now ?? (() => new Date())\n this.pid = options.pid ?? process.pid\n this.maxFileBytes = options.maxFileBytes ?? PLUGIN_LOG_MAX_FILE_BYTES\n this.maxArchiveBytes = options.maxArchiveBytes ?? PLUGIN_LOG_MAX_ARCHIVE_BYTES\n this.maxAgeMs = options.maxAgeMs ?? PLUGIN_LOG_MAX_AGE_MS\n this.recentLimit = Math.max(1, options.recentLimit ?? PLUGIN_LOG_RECENT_LIMIT)\n }\n\n get lastWriteError(): string | null {\n return this.lastError\n }\n\n recentEntries(limit = this.recentLimit): PluginLogEntry[] {\n return this.recent.slice(-Math.max(0, limit))\n }\n\n debug(event: string, message: string, context?: PluginLogContext): boolean {\n return this.write({ level: 'debug', event, message, ...(context ? { context } : {}) })\n }\n\n info(event: string, message: string, context?: PluginLogContext): boolean {\n return this.write({ level: 'info', event, message, ...(context ? { context } : {}) })\n }\n\n warn(event: string, message: string, error?: unknown, context?: PluginLogContext): boolean {\n return this.write({\n level: 'warn', event, message,\n ...(error !== undefined ? { error } : {}),\n ...(context ? { context } : {}),\n })\n }\n\n error(event: string, message: string, error?: unknown, context?: PluginLogContext): boolean {\n return this.write({\n level: 'error', event, message,\n ...(error !== undefined ? { error } : {}),\n ...(context ? { context } : {}),\n })\n }\n\n fault(event: string, message: string, error?: unknown, context?: PluginLogContext): boolean {\n return this.write({\n level: 'fault', event, message,\n ...(error !== undefined ? { error } : {}),\n ...(context ? { context } : {}),\n })\n }\n\n child(context: PluginLogContext): PluginLogger {\n return createChildPluginLogger(this, context)\n }\n\n write(input: PluginLogInput): boolean {\n if (!pluginLogLevelEnabled(input.level, this.minimum) || this.writing) return false\n const at = this.now()\n let entry: PluginLogEntry\n let line: string\n try {\n entry = buildPluginLogEntry(input, {\n at,\n source: this.source,\n surface: 'host',\n profile: this.profile,\n pid: this.pid,\n correlation: correlationStorage.getStore(),\n })\n line = `${JSON.stringify(entry)}\\n`\n } catch {\n return false\n }\n this.pushRecent(entry)\n if (!this.directory || !this.file) return true\n this.writing = true\n try {\n this.openManagedDirectory()\n this.prepare(at)\n // Other plugin bundles/processes may rotate or replace this path after\n // initialization. Recheck the target and size before every append.\n const active = this.regularFile(this.file)\n this.size = active?.size ?? 0\n if (!active) this.openedAt = at.getTime()\n if (\n this.size > 0\n && (this.size + Buffer.byteLength(line) > this.maxFileBytes || at.getTime() - this.openedAt >= this.maxAgeMs)\n ) {\n this.rotate(at)\n }\n appendFileSync(this.file, line, { encoding: 'utf8', mode: 0o600 })\n this.size += Buffer.byteLength(line)\n this.prune(at)\n this.lastError = null\n this.loggedWriteFailure = false\n return true\n } catch (error) {\n const detail = sanitizePluginLogText(error instanceof Error ? error.message : String(error), 500)\n this.lastError = `The plugin diagnostic log could not be written: ${detail}`\n this.initialized = false\n if (!this.loggedWriteFailure) {\n this.loggedWriteFailure = true\n try {\n process.stderr.write(`DSH Plugin (${this.source}): ${this.lastError}. The original operation continues unchanged.\\n`)\n } catch {\n // Broken stderr must never affect caller behavior.\n }\n }\n return false\n } finally {\n this.writing = false\n }\n }\n\n private pushRecent(entry: PluginLogEntry): void {\n this.recent.push(entry)\n const overflow = this.recent.length - this.recentLimit\n if (overflow > 0) this.recent.splice(0, overflow)\n }\n\n private prepare(at: Date): void {\n if (this.initialized || !this.file) return\n this.openManagedDirectory()\n const stat = this.regularFile(this.file)\n this.size = stat?.size ?? 0\n const stamps = stat ? [stat.birthtimeMs, stat.mtimeMs].filter(value => value > 0) : []\n this.openedAt = stamps.length ? Math.min(...stamps) : at.getTime()\n this.initialized = true\n }\n\n private rotate(at: Date): void {\n if (!this.directory || !this.file) return\n const stamp = at.toISOString().replace(/:/g, '-')\n const name = `${this.source}.${stamp}.${this.pid}.${this.sequence++}.jsonl`\n if (!ARCHIVE_RE.test(name)) throw new Error('Diagnostic log archive name is invalid.')\n const archive = join(this.directory, name)\n if (lexists(archive)) throw new Error('Diagnostic log archive already exists.')\n try {\n renameSync(this.file, archive)\n } catch (error) {\n const code = (error as NodeJS.ErrnoException).code\n if (code === 'ENOENT') {\n this.size = 0\n this.openedAt = at.getTime()\n return\n }\n throw error\n }\n this.size = 0\n this.openedAt = at.getTime()\n }\n\n private rotateStaleActive(at: Date): void {\n if (!this.file) return\n const stat = this.regularFile(this.file)\n if (!stat || stat.size === 0) return\n if (at.getTime() - stat.mtimeMs < this.maxAgeMs) return\n this.rotate(at)\n }\n\n private prune(at: Date): void {\n if (!this.directory) return\n this.rotateStaleActive(at)\n const archives: Array<{ name: string; size: number; mtime: number }> = []\n let total = 0\n for (const name of readdirSync(this.directory)) {\n if (!ARCHIVE_RE.test(name) || !name.startsWith(`${this.source}.`)) continue\n const file = join(this.directory, name)\n const stat = lstatSync(file)\n if (stat.isSymbolicLink() || !stat.isFile()) throw new Error('Diagnostic log archive is not a regular file.')\n if (at.getTime() - stat.mtimeMs >= this.maxAgeMs) {\n try { unlinkSync(file) } catch { /* concurrent prune */ }\n continue\n }\n archives.push({ name, size: stat.size, mtime: stat.mtimeMs })\n total += stat.size\n }\n archives.sort((left, right) => left.mtime - right.mtime || left.name.localeCompare(right.name))\n while (total > this.maxArchiveBytes && archives.length) {\n const oldest = archives.shift()!\n try { unlinkSync(join(this.directory, oldest.name)) } catch { /* concurrent prune */ }\n total -= oldest.size\n }\n }\n\n private openManagedDirectory(): void {\n if (!this.directory) return\n if (this.anchor) {\n const anchorStat = existsSync(this.anchor) ? lstatSync(this.anchor) : undefined\n if (anchorStat?.isSymbolicLink()) throw new Error('Diagnostic log anchor cannot be a symbolic link.')\n }\n mkdirSync(this.directory, { recursive: true, mode: 0o700 })\n const stat = lstatSync(this.directory)\n if (stat.isSymbolicLink() || !stat.isDirectory()) {\n throw new Error('Diagnostic log directory is not a real directory.')\n }\n const realDir = realpathSync(this.directory)\n if (this.anchor) {\n const realAnchor = realpathSync(this.anchor)\n if (!isInside(realAnchor, realDir)) {\n throw new Error('Diagnostic log directory escaped its managed root.')\n }\n }\n }\n\n private regularFile(file: string): { size: number; birthtimeMs: number; mtimeMs: number } | undefined {\n try {\n const stat = lstatSync(file)\n if (stat.isSymbolicLink() || !stat.isFile()) throw new Error('Diagnostic log is not a regular file.')\n const expected = join(realpathSync(dirname(file)), basename(file))\n if (!samePath(realpathSync(file), expected)) throw new Error('Diagnostic log path could not be verified.')\n return stat\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined\n throw error\n }\n }\n}\n\nexport function createPluginLogger(\n ctxOrSource: unknown,\n maybeSource?: string | RotatingPluginLoggerOptions,\n maybeOptions?: RotatingPluginLoggerOptions,\n): PluginLogger {\n const hasCtx = typeof ctxOrSource !== 'string'\n const ctx = hasCtx ? ctxOrSource : undefined\n const source = hasCtx ? String(maybeSource ?? 'dsh-plugin') : ctxOrSource\n const options = (hasCtx ? maybeOptions : maybeSource as RotatingPluginLoggerOptions | undefined) ?? {}\n const normalized = normalizePluginLogSource(source)\n const target = resolveHostLogTarget(ctx, options)\n\n let backing: RotatingPluginLogger\n const canShare = Boolean(\n target.directory\n && options.minimumLevel === undefined\n && options.now === undefined\n && options.pid === undefined\n && options.maxFileBytes === undefined\n && options.maxArchiveBytes === undefined\n && options.maxAgeMs === undefined,\n )\n if (canShare && target.directory) {\n const key = resolve(target.directory, `${normalized}.jsonl`)\n let shared = processFileLoggers.get(key)\n if (!shared) {\n shared = new RotatingPluginLogger(normalized, {\n ...options,\n directory: target.directory,\n anchor: target.anchor,\n profile: target.profile,\n })\n processFileLoggers.set(key, shared)\n }\n backing = shared\n } else {\n backing = new RotatingPluginLogger(normalized, {\n ...options,\n ...(target.directory ? { directory: target.directory, anchor: target.anchor } : {}),\n ...(target.profile ? { profile: target.profile } : {}),\n })\n }\n\n if (options.forwardHostWarnError === false || !ctx || typeof ctx !== 'object') {\n return backing\n }\n return wrapWithHostForwarding(backing, ctx as HostContextLike)\n}\n\nexport function installPluginLogger(\n ctx: unknown,\n source: string,\n options: InstallPluginLoggerOptions = {},\n): PluginLogger {\n const logger = createPluginLogger(ctx, source, options)\n logger.info('plugin.loaded', 'Host plugin initialized.', options.loadedContext)\n const host = ctx && typeof ctx === 'object' ? ctx as HostContextLike : undefined\n if (typeof host?.effect === 'function') {\n try {\n host.effect(() => () => {\n logger.debug('plugin.disposed', 'Host plugin disposed.')\n }, `${logger.source}.logger`)\n } catch {\n // Non-Cordis or mock effect implementation.\n }\n }\n return logger\n}\n\nfunction wrapWithHostForwarding(backing: PluginLogger, host: HostContextLike): PluginLogger {\n const forward = (input: PluginLogInput) => {\n if (input.level !== 'warn' && input.level !== 'error' && input.level !== 'fault') return\n try {\n const hostLogger = host.logger\n if (!hostLogger) return\n const detail = input.error instanceof Error\n ? `${input.message} (${input.error.message})`\n : input.error !== undefined\n ? `${input.message} (${String(input.error)})`\n : input.message\n const text = sanitizePluginLogText(`${backing.source} [${input.event}]: ${detail}`, 1_000)\n if (input.level === 'warn') {\n if (typeof hostLogger.warn === 'function') hostLogger.warn(text)\n } else if (typeof hostLogger.error === 'function') {\n hostLogger.error(text)\n } else if (typeof hostLogger.warn === 'function') {\n hostLogger.warn(text)\n }\n } catch {\n // Host logger forwarding is best-effort.\n }\n }\n const wrapped: PluginLogger = {\n get source() { return backing.source },\n get file() { return backing.file },\n get lastWriteError() { return backing.lastWriteError },\n debug: (event, message, context) => backing.debug(event, message, context),\n info: (event, message, context) => backing.info(event, message, context),\n warn: (event, message, error, context) => {\n const wrote = backing.warn(event, message, error, context)\n forward({ level: 'warn', event, message, error, context })\n return wrote\n },\n error: (event, message, error, context) => {\n const wrote = backing.error(event, message, error, context)\n forward({ level: 'error', event, message, error, context })\n return wrote\n },\n fault: (event, message, error, context) => {\n const wrote = backing.fault(event, message, error, context)\n forward({ level: 'fault', event, message, error, context })\n return wrote\n },\n write: input => {\n const wrote = backing.write(input)\n forward(input)\n return wrote\n },\n child: context => createChildPluginLogger(wrapped, context),\n }\n return wrapped\n}\n\nexport function nextPluginOperationId(prefix = 'op'): string {\n return `${normalizePluginLogSource(prefix)}-${process.pid}-${++operationSequence}`\n}\n\nexport function currentPluginLogContext(): PluginLogContext | undefined {\n return correlationStorage.getStore()\n}\n\nexport function withPluginLogContext<T>(context: PluginLogContext, action: () => T): T {\n const merged = mergePluginLogContext(correlationStorage.getStore(), context) ?? {}\n return correlationStorage.run(merged, action)\n}\n\nexport async function pluginLogStep<T>(\n logger: PluginLogger,\n step: string,\n context: PluginLogContext | undefined,\n action: () => Promise<T>,\n completedLevel: PluginLogLevel = 'debug',\n): Promise<T> {\n const started = Date.now()\n const base = { ...context, step }\n logger.debug('step.started', 'Operation step started.', base)\n try {\n const result = await action()\n logger.write({\n level: completedLevel,\n event: 'step.completed',\n message: 'Operation step completed.',\n context: { ...base, durationMs: Date.now() - started },\n })\n return result\n } catch (error) {\n logger.error('step.failed', 'Operation step failed.', error, {\n ...base,\n durationMs: Date.now() - started,\n })\n throw error\n }\n}\n\nexport function pluginLogSyncStep<T>(\n logger: PluginLogger,\n step: string,\n context: PluginLogContext | undefined,\n action: () => T,\n completedLevel: PluginLogLevel = 'debug',\n): T {\n const started = Date.now()\n const base = { ...context, step }\n logger.debug('step.started', 'Operation step started.', base)\n try {\n const result = action()\n logger.write({\n level: completedLevel,\n event: 'step.completed',\n message: 'Operation step completed.',\n context: { ...base, durationMs: Date.now() - started },\n })\n return result\n } catch (error) {\n logger.error('step.failed', 'Operation step failed.', error, {\n ...base,\n durationMs: Date.now() - started,\n })\n throw error\n }\n}\n\nexport function readPluginLogTail(file: string, maxBytes = 256 * 1024): string {\n const stat = lstatSync(file)\n if (stat.isSymbolicLink() || !stat.isFile()) throw new Error('Diagnostic log is not a regular file.')\n if (stat.size <= 0 || maxBytes <= 0) return ''\n const length = Math.min(stat.size, maxBytes)\n const descriptor = openSync(file, 'r')\n try {\n const buffer = Buffer.alloc(length)\n const read = readSync(descriptor, buffer, 0, buffer.length, stat.size - length)\n let text = buffer.subarray(0, read).toString('utf8')\n if (stat.size > length) {\n const newline = text.indexOf('\\n')\n text = newline === -1 ? '' : text.slice(newline + 1)\n }\n return text\n } finally {\n closeSync(descriptor)\n }\n}\n\nfunction lexists(file: string): boolean {\n try {\n lstatSync(file)\n return true\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false\n throw error\n }\n}\n\nfunction pathFromBaseUrl(baseUrl: string): string | null {\n try {\n return baseUrl.includes('://') ? resolve(fileURLToPath(baseUrl)) : resolve(baseUrl)\n } catch {\n return null\n }\n}\n\nfunction samePath(left: string, right: string): boolean {\n const a = resolve(left)\n const b = resolve(right)\n return process.platform === 'win32' ? a.toLowerCase() === b.toLowerCase() : a === b\n}\n\nfunction isInside(root: string, target: string): boolean {\n const rootResolved = resolve(root)\n const targetResolved = resolve(target)\n if (samePath(rootResolved, targetResolved)) return true\n const prefix = rootResolved.endsWith(sep) ? rootResolved : rootResolved + sep\n return process.platform === 'win32'\n ? targetResolved.toLowerCase().startsWith(prefix.toLowerCase())\n : targetResolved.startsWith(prefix)\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport { installPluginLogger } from '@klarkxy/dsh-plugin-kit/logger'\nimport { PLUGIN_NAME } from './contracts.ts'\n\nexport const name = PLUGIN_NAME\n\n/**\n * The host half exists so the bundle has a loader row — the feature itself\n * lives entirely in the client half, which contributes its own Font section\n * page. Fonts are a property of the rendering environment, the conversation\n * font persists browser-local, and every host-backed write goes through the\n * official `ctx.theme` entries. Nothing here needs a Host service.\n */\nexport function apply(ctx: Context): void {\n /* no host services, no RPC, no model calls */\n installPluginLogger(ctx, PLUGIN_NAME, { forwardHostWarnError: false })\n}\n"],"mappings":";;;;;;;AAEA,MAAa,oBAA+C;CAAC;CAAS;CAAQ;CAAQ;CAAS;AAAO;AACtG,MAAa,2BAA2C;AACxD,MAAa,+BAA+B;AAgD5C,MAAM,YAAY;AAClB,MAAM,WAAW;AACjB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AAEtB,MAAM,kBACJ;AACF,M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MAAM,KAAoB;CAExC,oBAAoB,KAAK,aAAa,EAAE,sBAAsB,MAAM,CAAC;AACvE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarkxy/dsh-font",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Font: customize the interface, conversation, code and terminal fonts and font sizes of the DeepSeek Harness Web GUI.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"lib",
|
|
35
35
|
"cordis.patch.yml",
|
|
36
36
|
"README.md",
|
|
37
|
-
"
|
|
37
|
+
"README.en.md",
|
|
38
38
|
"docs/preview.png",
|
|
39
39
|
"LICENSE"
|
|
40
40
|
],
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@deepseek-ai/cordis": ">=4.0.4"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@klarkxy/dsh-plugin-kit": "0.8.
|
|
64
|
+
"@klarkxy/dsh-plugin-kit": "0.8.2",
|
|
65
65
|
"@deepseek-ai/cordis": "4.1.0",
|
|
66
66
|
"react": "^18.2.0",
|
|
67
67
|
"@types/react": "18.3.31",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
},
|
|
100
100
|
"homepage": "https://klarkxy.github.io/dsh-plugins/plugins/font/",
|
|
101
101
|
"dshRelease": {
|
|
102
|
-
"contentHash": "
|
|
102
|
+
"contentHash": "ce59876b843019f0890c35082863ecd566d576fdd1321d4bc1a2bad498625df6"
|
|
103
103
|
},
|
|
104
104
|
"peerDependenciesMeta": {
|
|
105
105
|
"@deepseek-ai/cordis": {
|
package/docs/README.zh-CN.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# 字体
|
|
2
|
-
|
|
3
|
-
<!-- release-state-note -->
|
|
4
|
-
|
|
5
|
-
[English](../README.md)
|
|
6
|
-
|
|
7
|
-
自定义 DeepSeek Harness Web GUI 的界面字体、对话字体、代码与终端字体及字号。
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
## 安装
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
dsh plugin --profile web add @klarkxy/dsh-font
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
把 `web` 换成你的 profile 名,安装后重启 profile 或刷新页面。
|
|
18
|
-
|
|
19
|
-
## 使用
|
|
20
|
-
|
|
21
|
-
打开「设置 → 字体」——本插件新增的独立分区。安装期间「设置 → 通用」里的原生「字号大小」一行会被收起,同样的控件集中在这一个页面;卸载或停用插件后,原生行自动恢复。
|
|
22
|
-
|
|
23
|
-
- **界面字体**:选预设、手动输入字体名,或点「读取系统字体」从本机已装字体中选择。
|
|
24
|
-
- **对话字体**和**字号大小**:对话区独立的字体(选「跟随界面字体」则沿用界面字体)与会话内容字号。
|
|
25
|
-
- **代码字体**和**代码字号**:作用于代码块、行内代码与工具输出。
|
|
26
|
-
- **终端字体**和**终端字号**:作用于侧栏终端,与代码字体独立。
|
|
27
|
-
|
|
28
|
-
改动立即生效,并与 DSH 设置保持同步——包括桌面端 Ctrl/⌘± 字号快捷键(同时调整三项字号)。选择「默认」可恢复 DSH 原字体;「恢复默认字体」重置所有字体选择、不影响字号;「恢复默认字号」恢复三项字号默认、不影响字体。
|
|
29
|
-
|
|
30
|
-
## 限制
|
|
31
|
-
|
|
32
|
-
- 「读取系统字体」在 Chromium 系浏览器中可用,首次使用需浏览器授权。
|
|
33
|
-
- 界面、代码、终端字体与全部字号由 DSH 保存;对话字体仅保存在当前浏览器。在不同电脑打开界面时,每台电脑都需安装所选字体。
|
|
34
|
-
- 插件直接使用本机已安装的字体,本身不附带任何字体文件。
|
|
35
|
-
|
|
36
|
-
## 许可证
|
|
37
|
-
|
|
38
|
-
[SATA License 2.1](../LICENSE)
|