Files
hermes-web/packages/client/src/composables/useNotification.ts
T
toor 4baccd5d88 Phase 005: vendor ArkScope, land the Arco style baseline, and fix bridge interpreter resolution
- Vendor ArkScope decorative layers (ScrambleTitle / IsometricWave) with provenance notes; decorative-only per AGENTS.md red lines
- Migrate theme tokens to Arco, register the Arco theme, and add hook adapter composables (useMessage / useDialog / useNotification) with matching signatures
- Sample pages: LoginView and AppSidebar on the new baseline; docs/arco-mapping.md and docs/ui-baseline.md land
- agent-bridge: prefer the PM-selected venv from facts.json over legacy in-tree venvs (legacy lacks the mcp extra, so every MCP server showed 0 tools / not connected)
- agent-bridge python (vendored, deliberate deviation): MCP discovery import fallback and pyyaml -> hermes_yaml so plugins and MCP work under the PM env; install the mcp extra via `hermes pm install --extra mcp`
- Chat-chain fragment: docs/chat-chain-changes/2026-10-17-phase005-arkscope-baseline.md

Verified: harness:check, test (2020 passed), test:e2e (30 passed), build all green; manual: plugins 100/0 warnings, MCP 6/6 servers connected with 104 tools.
2026-10-17 09:45:30 +08:00

33 lines
1.1 KiB
TypeScript

import { Notification } from '@arco-design/web-vue'
// Frozen API (Phase 005). Mirrors the Naive `useNotification` option names
// (title/description) and maps description onto Arco's `content`.
// Extend this adapter instead of importing Arco's Notification directly in views.
export interface AppNotificationOptions {
title?: string
description?: string
duration?: number
}
function normalize(options: AppNotificationOptions) {
return {
title: options.title,
// NotificationConfig.content is required; fall back to the title so a
// bare title still renders.
content: options.description ?? options.title ?? '',
duration: options.duration,
}
}
export function useNotification() {
return {
success: (options: AppNotificationOptions) => Notification.success(normalize(options)),
error: (options: AppNotificationOptions) => Notification.error(normalize(options)),
warning: (options: AppNotificationOptions) => Notification.warning(normalize(options)),
info: (options: AppNotificationOptions) => Notification.info(normalize(options)),
}
}
export type AppNotification = ReturnType<typeof useNotification>