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.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import type { MessageConfig, MessageReturn } from '@arco-design/web-vue/es/message/interface'
|
||||
|
||||
// Frozen API (Phase 005). Naive-style call sites migrate here; extend this
|
||||
// adapter instead of importing Arco's Message directly in views/components.
|
||||
// Naive: message.success(text, { duration }) — Arco only accepts
|
||||
// (config, appContext), so options must be merged into the config object.
|
||||
|
||||
export interface AppMessageOptions {
|
||||
content: string
|
||||
duration?: number
|
||||
closable?: boolean
|
||||
}
|
||||
|
||||
export type AppMessageContent = string | AppMessageOptions
|
||||
|
||||
export interface AppMessageCallOptions {
|
||||
duration?: number
|
||||
closable?: boolean
|
||||
}
|
||||
|
||||
function toConfig(content: AppMessageContent, options?: AppMessageCallOptions): MessageConfig {
|
||||
const config: MessageConfig =
|
||||
typeof content === 'string' ? { content } : { ...content }
|
||||
if (options?.duration !== undefined) config.duration = options.duration
|
||||
if (options?.closable !== undefined) config.closable = options.closable
|
||||
return config
|
||||
}
|
||||
|
||||
// Naive's MessageReactive exposes destroy(); Arco's MessageReturn only
|
||||
// exposes close(). Expose both so migrated call sites can use either.
|
||||
export type AppMessageReturn = MessageReturn & { destroy: () => void }
|
||||
|
||||
function wrap(ret: MessageReturn): AppMessageReturn {
|
||||
return { ...ret, destroy: () => ret.close() }
|
||||
}
|
||||
|
||||
export function useMessage() {
|
||||
return {
|
||||
success: (content: AppMessageContent, options?: AppMessageCallOptions) =>
|
||||
wrap(Message.success(toConfig(content, options))),
|
||||
error: (content: AppMessageContent, options?: AppMessageCallOptions) =>
|
||||
wrap(Message.error(toConfig(content, options))),
|
||||
warning: (content: AppMessageContent, options?: AppMessageCallOptions) =>
|
||||
wrap(Message.warning(toConfig(content, options))),
|
||||
info: (content: AppMessageContent, options?: AppMessageCallOptions) =>
|
||||
wrap(Message.info(toConfig(content, options))),
|
||||
loading: (content: AppMessageContent, options?: AppMessageCallOptions) =>
|
||||
wrap(Message.loading(toConfig(content, options))),
|
||||
}
|
||||
}
|
||||
|
||||
export type AppMessage = ReturnType<typeof useMessage>
|
||||
Reference in New Issue
Block a user