@devbie/fewbie-cli 1.13.2 → 1.14.0

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.
@@ -105,7 +105,7 @@ exports.TEMPLATE_ASSETS = [
105
105
  { path: "src/app/page.tsx", ownership: "host" },
106
106
  { path: "src/app/favicon.ico", ownership: "host" },
107
107
  { path: "src/components/**", ownership: "host" },
108
- { path: "src/modules/**", ownership: "host", note: "registry items are written by modules add/update" },
108
+ { path: "src/features/**", ownership: "host", note: "registry items are written by modules add/update" },
109
109
  { path: "src/adapters/**", ownership: "host", note: "generated by modules adapters; host may adjust the glue" },
110
110
  { path: "src/i18n/**", ownership: "host" },
111
111
  { path: "src/smoke.test.ts", ownership: "host" },
@@ -1 +1 @@
1
- {"version":3,"file":"template-ownership.js","sourceRoot":"","sources":["../../src/lib/template-ownership.ts"],"names":[],"mappings":";;;AA0FA,oCAEC;AA8HD,0CAEC;AAuCD,0CAMC;AAGD,gDAEC;AAaD,oDAOC;AAcD,gEAUC;AAOD,kCAEC;AAiBD,wCAMC;AAOD,wDAWC;AAGD,gEAKC;AAMD,wDAsBC;AAwBD,sDAMC;AAgBD,sEAEC;AAGD,gDAKC;AAGD,gDAQC;AAuED,gDAyGC;AAjlBD,6CAAyC;AAE5B,QAAA,sBAAsB,GAAG,8BAA8B,CAAC;AACxD,QAAA,oBAAoB,GAAG,4BAA4B,CAAC;AAGpD,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AACnD,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAQ5C,MAAM,eAAe,GAAoB,EAAE,KAAK,EAAE,8BAAsB,EAAE,GAAG,EAAE,4BAAoB,EAAE,CAAC;AAyBtG,SAAgB,YAAY,CAAC,KAAoB;IAC/C,OAAO,KAAK,CAAC,OAAO,IAAI,eAAe,CAAC;AAC1C,CAAC;AAEY,QAAA,eAAe,GAA6B;IAKvD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,UAA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WAAW,CAAC,cAAc,CAAC,CAAC;YAChD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACtC,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;gBAC7B,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK;oBACL,IAAI,EAAE,oBAAoB;oBAC1B,WAAW,EAAE,IAAI;oBACjB,iBAAiB,EAAE,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC;oBAC7D,kBAAkB,EAAE,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC;oBAC/D,YAAY,EAAE,QAAQ,IAAI,IAAI;iBAC/B,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;QACH,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,KAAK;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,eAAe;YAC5B,iBAAiB,EAAE,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC;YAC7D,kBAAkB,EAAE,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC;SAChE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,87 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "framework": "^1.7.0",
4
+ "entry": "src/components/copilot/index.ts",
5
+ "labels": [
6
+ "aboutSkill",
7
+ "analyzing",
8
+ "approvalBody",
9
+ "approvalRequired",
10
+ "approvedExecuting",
11
+ "availableOnPage",
12
+ "cancel",
13
+ "confirm",
14
+ "confirmFailedTitle",
15
+ "configureModel",
16
+ "context",
17
+ "conversationForbiddenMessage",
18
+ "conversationForbiddenTitle",
19
+ "dataTruncated",
20
+ "decisionNotSent",
21
+ "detailResult",
22
+ "disclaimer",
23
+ "disclaimerShortcuts",
24
+ "dismiss",
25
+ "emptyIntro",
26
+ "failed",
27
+ "listResult",
28
+ "loadingCapabilities",
29
+ "manageModels",
30
+ "manageModelsAria",
31
+ "newConversation",
32
+ "newConversationAria",
33
+ "noData",
34
+ "noModelMessage",
35
+ "noModelTitle",
36
+ "otherCapabilities",
37
+ "placeholderIdle",
38
+ "placeholderRunning",
39
+ "querying",
40
+ "queryTruncated",
41
+ "requestFailedBeforeResponse",
42
+ "requestFailedTitle",
43
+ "resizeAria",
44
+ "rowsCount",
45
+ "runInProgressMessage",
46
+ "runInProgressTitle",
47
+ "sendAria",
48
+ "showingRows",
49
+ "statistics",
50
+ "statusAwaitingApproval",
51
+ "statusDenied",
52
+ "statusError",
53
+ "statusRunning",
54
+ "statusSuccess",
55
+ "steps",
56
+ "stopAria",
57
+ "stopped",
58
+ "suggestAria",
59
+ "suggestGeneric",
60
+ "suggestOnPage",
61
+ "thinking",
62
+ "title",
63
+ "tokens",
64
+ "tooLongMessage",
65
+ "tooLongTitle",
66
+ "unavailableTitle",
67
+ "viewQuery"
68
+ ],
69
+ "ports": [
70
+ "confirm",
71
+ "fetchCatalog",
72
+ "send"
73
+ ],
74
+ "ui": [
75
+ "badge",
76
+ "button",
77
+ "table",
78
+ "textarea",
79
+ "tooltip"
80
+ ],
81
+ "states": [
82
+ "loading",
83
+ "empty",
84
+ "error",
85
+ "ready"
86
+ ]
87
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/r/registry-item.json",
3
+ "name": "copilot",
4
+ "type": "registry:component",
5
+ "x-fewbie.contract": {
6
+ "version": "1.0.0",
7
+ "framework": "^1.7.0",
8
+ "entry": "src/components/copilot/index.ts",
9
+ "labels": [
10
+ "aboutSkill",
11
+ "analyzing",
12
+ "approvalBody",
13
+ "approvalRequired",
14
+ "approvedExecuting",
15
+ "availableOnPage",
16
+ "cancel",
17
+ "confirm",
18
+ "confirmFailedTitle",
19
+ "configureModel",
20
+ "context",
21
+ "conversationForbiddenMessage",
22
+ "conversationForbiddenTitle",
23
+ "dataTruncated",
24
+ "decisionNotSent",
25
+ "detailResult",
26
+ "disclaimer",
27
+ "disclaimerShortcuts",
28
+ "dismiss",
29
+ "emptyIntro",
30
+ "failed",
31
+ "listResult",
32
+ "loadingCapabilities",
33
+ "manageModels",
34
+ "manageModelsAria",
35
+ "newConversation",
36
+ "newConversationAria",
37
+ "noData",
38
+ "noModelMessage",
39
+ "noModelTitle",
40
+ "otherCapabilities",
41
+ "placeholderIdle",
42
+ "placeholderRunning",
43
+ "querying",
44
+ "queryTruncated",
45
+ "requestFailedBeforeResponse",
46
+ "requestFailedTitle",
47
+ "resizeAria",
48
+ "rowsCount",
49
+ "runInProgressMessage",
50
+ "runInProgressTitle",
51
+ "sendAria",
52
+ "showingRows",
53
+ "statistics",
54
+ "statusAwaitingApproval",
55
+ "statusDenied",
56
+ "statusError",
57
+ "statusRunning",
58
+ "statusSuccess",
59
+ "steps",
60
+ "stopAria",
61
+ "stopped",
62
+ "suggestAria",
63
+ "suggestGeneric",
64
+ "suggestOnPage",
65
+ "thinking",
66
+ "title",
67
+ "tokens",
68
+ "tooLongMessage",
69
+ "tooLongTitle",
70
+ "unavailableTitle",
71
+ "viewQuery"
72
+ ],
73
+ "ports": [
74
+ "confirm",
75
+ "fetchCatalog",
76
+ "send"
77
+ ],
78
+ "ui": [
79
+ "badge",
80
+ "button",
81
+ "table",
82
+ "textarea",
83
+ "tooltip"
84
+ ],
85
+ "states": [
86
+ "loading",
87
+ "empty",
88
+ "error",
89
+ "ready"
90
+ ]
91
+ },
92
+ "files": [
93
+ {
94
+ "path": "src/components/copilot/types.ts",
95
+ "content": "import type { ReactNode } from \"react\";\n\n/**\n * Copy for every surface. The host translates; the item owns no language and\n * no product vocabulary. `{name}` placeholders are filled by the surfaces.\n */\nexport interface CopilotLabels {\n title: string;\n resizeAria: string;\n context: string;\n manageModelsAria: string;\n manageModels: string;\n newConversationAria: string;\n newConversation: string;\n placeholderRunning: string;\n placeholderIdle: string;\n stopAria: string;\n sendAria: string;\n disclaimer: string;\n disclaimerShortcuts: string;\n suggestAria: string;\n suggestOnPage: string;\n suggestGeneric: string;\n confirm: string;\n cancel: string;\n configureModel: string;\n dismiss: string;\n tooLongTitle: string;\n tooLongMessage: string;\n unavailableTitle: string;\n confirmFailedTitle: string;\n noModelTitle: string;\n runInProgressTitle: string;\n conversationForbiddenTitle: string;\n requestFailedTitle: string;\n requestFailedBeforeResponse: string;\n decisionNotSent: string;\n noModelMessage: string;\n runInProgressMessage: string;\n conversationForbiddenMessage: string;\n emptyIntro: string;\n loadingCapabilities: string;\n availableOnPage: string;\n otherCapabilities: string;\n aboutSkill: string;\n thinking: string;\n querying: string;\n analyzing: string;\n failed: string;\n stopped: string;\n steps: string;\n tokens: string;\n statusAwaitingApproval: string;\n statusRunning: string;\n statusSuccess: string;\n statusError: string;\n statusDenied: string;\n approvalRequired: string;\n approvalBody: string;\n approvedExecuting: string;\n listResult: string;\n detailResult: string;\n statistics: string;\n noData: string;\n dataTruncated: string;\n rowsCount: string;\n showingRows: string;\n viewQuery: string;\n queryTruncated: string;\n}\n\n// ---------------------------------------------------------------------------\n// Neutral agent event protocol (v1). This is the item's input contract; the\n// host adapts its transport (SSE, WebSocket, ...) to it. Structurally identical\n// to the backend protocol, so it is a serialization, not a second protocol.\n// ---------------------------------------------------------------------------\n\nexport const COPILOT_PROTOCOL_VERSION = 1 as const;\n\nexport interface CopilotLinkAction {\n type: \"link\";\n label: string;\n href: string;\n}\n\nexport type CopilotToolStatus = \"running\" | \"success\" | \"error\" | \"denied\";\nexport type CopilotConfirmationState = \"waiting\" | \"confirmed\" | \"denied\" | \"expired\";\nexport type CopilotConfirmationDecision = \"confirmed\" | \"denied\";\n\nexport interface CopilotChartDataset {\n label: string;\n data: number[];\n}\n\nexport interface CopilotChartBlock {\n kind: \"chart\";\n chartType: \"line\" | \"bar\" | \"pie\" | \"doughnut\";\n title: string;\n labels: string[];\n datasets: CopilotChartDataset[];\n truncated?: boolean;\n}\n\nexport interface CopilotTableColumn {\n field: string;\n header: string;\n width?: number;\n formatHint?: \"ms\" | \"pct\";\n}\n\nexport interface CopilotTableBlock {\n kind: \"table\";\n title: string;\n columns: CopilotTableColumn[];\n rows: Array<Record<string, unknown>>;\n totalRows: number;\n truncated?: boolean;\n}\n\nexport interface CopilotQueryBlock {\n kind: \"query\";\n templateId: string;\n title: string;\n sql: string;\n truncated?: boolean;\n}\n\nexport interface CopilotErrorBlock {\n kind: \"error\";\n title: string;\n message: string;\n truncated?: boolean;\n}\n\nexport type CopilotSkillBlock = CopilotChartBlock | CopilotTableBlock | CopilotQueryBlock | CopilotErrorBlock;\n\nexport type CopilotAgentEvent =\n | {\n v: 1;\n type: \"run-started\";\n requestId: string;\n conversationId: string;\n modelId: string;\n skills: string[];\n }\n | { v: 1; type: \"text-delta\"; text: string }\n | { v: 1; type: \"tool-started\"; toolCallId: string; name: string; inputSummary: string }\n | {\n v: 1;\n type: \"tool-finished\";\n toolCallId: string;\n name: string;\n status: \"success\" | \"error\" | \"denied\";\n summary: string;\n durationMs: number;\n blocks?: CopilotSkillBlock[];\n }\n | {\n v: 1;\n type: \"confirm-required\";\n confirmationId: string;\n toolCallId: string;\n name: string;\n arguments: unknown;\n }\n | {\n v: 1;\n type: \"confirm-resolved\";\n confirmationId: string;\n toolCallId: string;\n name: string;\n decision: CopilotConfirmationDecision;\n reason: \"user\" | \"timeout\" | \"aborted\";\n }\n | { v: 1; type: \"action\"; toolCallId: string; source: string; action: CopilotLinkAction }\n | {\n v: 1;\n type: \"run-finished\";\n requestId: string;\n steps: number;\n finishReason: \"stop\" | \"tool-calls\" | \"length\" | \"error\" | \"other\";\n usage?: { promptTokens: number; completionTokens: number; totalTokens: number };\n }\n | {\n v: 1;\n type: \"failed\";\n requestId: string;\n code: string;\n message: string;\n aborted?: boolean;\n };\n\nexport type CopilotResultKind = \"list\" | \"detail\" | \"stats\";\n\nexport interface CopilotSkillCatalogEntry {\n name: string;\n description: string;\n resultHint: { kind: CopilotResultKind; description: string };\n pages?: string[];\n relevant: boolean;\n}\n\nexport interface CopilotRecommendedPrompt {\n label: string;\n prompt: string;\n}\n\nexport interface CopilotSkillsCatalog {\n v: number;\n skills: CopilotSkillCatalogEntry[];\n recommendedPrompts: CopilotRecommendedPrompt[];\n}\n\n/** Host-computed page scope; the item only forwards it to the port. */\nexport interface CopilotPageContext {\n route?: string;\n params?: Record<string, string>;\n}\n\nexport interface CopilotSendInput {\n message: string;\n requestId: string;\n conversationId?: string;\n pageContext?: CopilotPageContext;\n signal: AbortSignal;\n onEvent: (event: CopilotAgentEvent) => void;\n}\n\n/** Errors thrown by the port may carry the protocol's `code`. */\nexport interface CopilotPortError extends Error {\n code?: string;\n}\n\n/**\n * Host-owned transport. Streaming, authentication, request ids and model\n * selection stay in the host; the item only folds protocol events into a view.\n */\nexport interface CopilotPort {\n send(input: CopilotSendInput): Promise<void>;\n confirm(input: { confirmationId: string; decision: CopilotConfirmationDecision }): Promise<void>;\n fetchCatalog(route?: string): Promise<CopilotSkillsCatalog>;\n}\n\n/** Props handed to the host's chart renderer. */\nexport interface CopilotChartView {\n chartType: CopilotChartBlock[\"chartType\"];\n labels: string[];\n datasets: CopilotChartDataset[];\n className: string;\n}\n\nexport interface CopilotDockProps {\n labels: CopilotLabels;\n port: CopilotPort;\n open: boolean;\n onClose: () => void;\n /** Translated name of the current page scope. */\n contextLabel?: string;\n pageContext?: CopilotPageContext;\n /** Cache key for the skill catalog; defaults to `pageContext.route`. */\n catalogKey?: string;\n /** Renders the settings button when present. */\n settingsHref?: string;\n canManageModels?: boolean;\n /** Optional model indicator (name + health dot), owned by the host. */\n modelBadge?: ReactNode;\n renderChart?: (view: CopilotChartView) => ReactNode;\n /** Slot above the capability list, e.g. a host-specific snapshot card. */\n emptyStateExtra?: ReactNode;\n /** Host-side navigation and safety checks; the item never imports a router. */\n onOpenLink: (href: string) => void;\n onNavigate?: (href: string) => void;\n /** Called after a tool call succeeds so the host can refresh affected data. */\n onToolFinished?: (name: string) => void;\n locale?: string;\n minWidth?: number;\n maxWidth?: number;\n defaultWidth?: number;\n storageKey?: string;\n className?: string;\n}\n",
96
+ "type": "registry:component"
97
+ },
98
+ {
99
+ "path": "src/components/copilot/view-model.ts",
100
+ "content": "import type { CopilotAgentEvent, CopilotConfirmationState, CopilotLinkAction, CopilotSkillBlock } from \"./types\";\n\n/**\n * Timeline view-model assembled from the neutral event stream. Text deltas are\n * concatenated, tool calls transition running -> success/error/denied, write\n * confirmations move waiting -> confirmed/denied/expired, and action links\n * attach to the tool call that produced them.\n */\n\nexport interface CopilotConfirmationVM {\n confirmationId: string;\n /** Full validated, server-redacted arguments for the approval card. */\n arguments: unknown;\n state: CopilotConfirmationState;\n}\n\nexport interface CopilotToolCallVM {\n id: string;\n name: string;\n status: \"running\" | \"success\" | \"error\" | \"denied\";\n inputSummary: string;\n summary?: string;\n durationMs?: number;\n actions: CopilotLinkAction[];\n blocks: CopilotSkillBlock[];\n confirmation?: CopilotConfirmationVM;\n}\n\nexport type CopilotRunStatus = \"streaming\" | \"done\" | \"error\";\n\nexport interface CopilotAssistantVM {\n requestId?: string;\n conversationId?: string;\n modelId?: string;\n status: CopilotRunStatus;\n text: string;\n toolCalls: CopilotToolCallVM[];\n steps?: number;\n finishReason?: string;\n usage?: { promptTokens: number; completionTokens: number; totalTokens: number };\n errorCode?: string;\n errorMessage?: string;\n aborted?: boolean;\n}\n\nexport function createAssistantVM(): CopilotAssistantVM {\n return { status: \"streaming\", text: \"\", toolCalls: [] };\n}\n\n/** Fold one protocol event into the assistant draft. */\nexport function applyAgentEvent(vm: CopilotAssistantVM, event: CopilotAgentEvent): CopilotAssistantVM {\n switch (event.type) {\n case \"run-started\":\n vm.requestId = event.requestId;\n vm.conversationId = event.conversationId;\n vm.modelId = event.modelId;\n break;\n case \"text-delta\":\n vm.text += event.text;\n break;\n case \"tool-started\":\n vm.toolCalls.push({\n id: event.toolCallId,\n name: event.name,\n status: \"running\",\n inputSummary: event.inputSummary,\n actions: [],\n blocks: [],\n });\n break;\n case \"tool-finished\": {\n const toolCall = findOrCreateToolCall(vm, event.toolCallId, event.name);\n toolCall.status = event.status;\n toolCall.summary = event.summary;\n toolCall.durationMs = event.durationMs;\n if (event.blocks) toolCall.blocks = event.blocks;\n break;\n }\n case \"confirm-required\": {\n const toolCall = findOrCreateToolCall(vm, event.toolCallId, event.name);\n toolCall.confirmation = {\n confirmationId: event.confirmationId,\n arguments: event.arguments,\n state: \"waiting\",\n };\n break;\n }\n case \"confirm-resolved\": {\n const toolCall =\n vm.toolCalls.find((candidate) => candidate.id === event.toolCallId) ??\n vm.toolCalls.find((candidate) => candidate.confirmation?.confirmationId === event.confirmationId);\n if (toolCall?.confirmation) {\n toolCall.confirmation.state =\n event.decision === \"confirmed\" ? \"confirmed\" : event.reason === \"timeout\" ? \"expired\" : \"denied\";\n }\n break;\n }\n case \"action\": {\n const toolCall =\n vm.toolCalls.find((candidate) => candidate.id === event.toolCallId) ?? vm.toolCalls[vm.toolCalls.length - 1];\n if (toolCall) toolCall.actions.push(event.action);\n break;\n }\n case \"run-finished\":\n vm.status = \"done\";\n vm.steps = event.steps;\n vm.finishReason = event.finishReason;\n if (event.usage) vm.usage = event.usage;\n break;\n case \"failed\":\n vm.status = \"error\";\n vm.errorCode = event.code;\n vm.errorMessage = event.message;\n vm.aborted = Boolean(event.aborted);\n break;\n }\n return vm;\n}\n\n/** Every navigation action in run order, handy for footer action chips. */\nexport function collectActions(vm: CopilotAssistantVM): CopilotLinkAction[] {\n return vm.toolCalls.flatMap((toolCall) => toolCall.actions);\n}\n\nfunction findOrCreateToolCall(vm: CopilotAssistantVM, id: string, name: string): CopilotToolCallVM {\n const existing = vm.toolCalls.find((candidate) => candidate.id === id);\n if (existing) return existing;\n const created: CopilotToolCallVM = { id, name, status: \"running\", inputSummary: \"\", actions: [], blocks: [] };\n vm.toolCalls.push(created);\n return created;\n}\n",
101
+ "type": "registry:component"
102
+ },
103
+ {
104
+ "path": "src/components/copilot/copilot-context.tsx",
105
+ "content": "\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\nimport type { CopilotChartView, CopilotLabels } from \"./types\";\n\nexport interface CopilotRuntime {\n labels: CopilotLabels;\n locale: string;\n renderChart?: (view: CopilotChartView) => ReactNode;\n /** Host-side link opening, including same-origin/external checks. */\n onOpenLink: (href: string) => void;\n}\n\nconst CopilotContext = createContext<CopilotRuntime | null>(null);\n\nexport function CopilotProvider({ value, children }: { value: CopilotRuntime; children: ReactNode }) {\n return <CopilotContext.Provider value={value}>{children}</CopilotContext.Provider>;\n}\n\nexport function useCopilotRuntime(): CopilotRuntime {\n const value = useContext(CopilotContext);\n if (!value) throw new Error(\"Copilot surfaces must render inside <CopilotProvider>.\");\n return value;\n}\n\n/** Replace `{name}` placeholders; unknown placeholders are left untouched. */\nexport function interpolate(template: string, values: Record<string, string | number | undefined>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, name: string) => (name in values ? String(values[name]) : match));\n}\n\n/** Client-generated request id with a fallback for non-secure contexts. */\nexport function newRequestId(): string {\n if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") return crypto.randomUUID();\n return `req-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\nconst WORD_OVERRIDES: Record<string, string> = { aws: \"AWS\" };\n\n/** Humanizes a snake_case skill name, e.g. list_aws_accounts -> List AWS Accounts. */\nexport function skillDisplayName(name: string): string {\n return name\n .split(\"_\")\n .map((word) => WORD_OVERRIDES[word] ?? word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}\n\nexport function prettifyCode(code: string): string {\n return code\n .split(\"_\")\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\" \");\n}\n",
106
+ "type": "registry:component"
107
+ },
108
+ {
109
+ "path": "src/components/copilot/use-copilot-chat.ts",
110
+ "content": "\"use client\";\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { newRequestId } from \"./copilot-context\";\nimport type { CopilotAgentEvent, CopilotConfirmationDecision, CopilotPageContext, CopilotPort } from \"./types\";\nimport { applyAgentEvent, createAssistantVM, type CopilotAssistantVM } from \"./view-model\";\n\nexport interface CopilotUserEntry {\n id: string;\n role: \"user\";\n text: string;\n}\n\nexport interface CopilotAssistantEntry {\n id: string;\n role: \"assistant\";\n /** Immutable per-render snapshot of the stream draft. */\n vm: CopilotAssistantVM;\n}\n\nexport type CopilotEntry = CopilotUserEntry | CopilotAssistantEntry;\n\nexport type CopilotBannerTone = \"conflict\" | \"model\" | \"auth\" | \"error\";\n\nexport type CopilotBannerTitleKey =\n | \"tooLongTitle\"\n | \"unavailableTitle\"\n | \"confirmFailedTitle\"\n | \"noModelTitle\"\n | \"runInProgressTitle\"\n | \"conversationForbiddenTitle\"\n | \"requestFailedTitle\";\n\nexport type CopilotBannerMessageKey =\n | \"tooLongMessage\"\n | \"requestFailedBeforeResponse\"\n | \"decisionNotSent\"\n | \"noModelMessage\"\n | \"runInProgressMessage\"\n | \"conversationForbiddenMessage\";\n\nexport interface CopilotBanner {\n tone: CopilotBannerTone;\n titleKey: CopilotBannerTitleKey;\n messageKey?: CopilotBannerMessageKey;\n /** Values for `{limit}` in a message template. */\n values?: { limit?: number };\n /** Server-supplied message rendered verbatim when no label applies. */\n rawMessage?: string;\n}\n\nexport interface UseCopilotChat {\n entries: CopilotEntry[];\n stoppedIds: ReadonlySet<string>;\n running: boolean;\n /** confirmationId whose resolution call is currently in flight. */\n confirmingId: string | null;\n conversationId?: string;\n banner: CopilotBanner | null;\n send: (text: string) => void;\n stop: () => void;\n confirm: (confirmationId: string, decision: CopilotConfirmationDecision) => void;\n resetConversation: () => void;\n dismissBanner: () => void;\n}\n\nconst MAX_MESSAGE_LENGTH = 4000;\n\n/** Shallow-clone the draft so React state always sees a fresh snapshot. */\nfunction snapshotVm(vm: CopilotAssistantVM): CopilotAssistantVM {\n return {\n ...vm,\n toolCalls: vm.toolCalls.map((toolCall) => ({\n ...toolCall,\n actions: [...toolCall.actions],\n blocks: [...toolCall.blocks],\n ...(toolCall.confirmation ? { confirmation: { ...toolCall.confirmation } } : {}),\n })),\n };\n}\n\nexport interface UseCopilotChatOptions {\n port: CopilotPort;\n pageContext?: CopilotPageContext;\n /** Host-side hook for successful tool calls (e.g. invalidate a data query). */\n onToolFinished?: (name: string) => void;\n}\n\nexport function useCopilotChat({ port, pageContext, onToolFinished }: UseCopilotChatOptions): UseCopilotChat {\n const [entries, setEntries] = useState<CopilotEntry[]>([]);\n const [stoppedIds, setStoppedIds] = useState<ReadonlySet<string>>(new Set());\n const [running, setRunning] = useState(false);\n const [conversationId, setConversationId] = useState<string | undefined>(undefined);\n const [banner, setBanner] = useState<CopilotBanner | null>(null);\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const abortRef = useRef<AbortController | null>(null);\n const stoppedByUserRef = useRef(false);\n const conversationRef = useRef<string | undefined>(undefined);\n const pageContextRef = useRef(pageContext);\n useEffect(() => {\n pageContextRef.current = pageContext;\n }, [pageContext]);\n\n const send = useCallback(\n (rawText: string) => {\n const text = rawText.trim();\n if (!text) return;\n if (text.length > MAX_MESSAGE_LENGTH) {\n setBanner({\n tone: \"error\",\n titleKey: \"tooLongTitle\",\n messageKey: \"tooLongMessage\",\n values: { limit: MAX_MESSAGE_LENGTH },\n });\n return;\n }\n if (abortRef.current) return; // a run is already in flight\n\n setBanner(null);\n const userEntry: CopilotUserEntry = { id: `u-${Date.now()}`, role: \"user\", text };\n const assistantId = `a-${Date.now()}`;\n const draft = createAssistantVM();\n setEntries((current) => [...current, userEntry, { id: assistantId, role: \"assistant\", vm: draft }]);\n setRunning(true);\n\n const controller = new AbortController();\n abortRef.current = controller;\n stoppedByUserRef.current = false;\n\n const publish = () => {\n setEntries((current) =>\n current.map((entry) =>\n entry.role === \"assistant\" && entry.id === assistantId ? { ...entry, vm: snapshotVm(draft) } : entry,\n ),\n );\n };\n\n const handleEvent = (event: CopilotAgentEvent) => {\n applyAgentEvent(draft, event);\n if (event.type === \"run-started\" && !conversationRef.current) {\n conversationRef.current = event.conversationId;\n setConversationId(event.conversationId);\n }\n if (event.type === \"tool-finished\" && event.status === \"success\") onToolFinished?.(event.name);\n publish();\n };\n\n port\n .send({\n message: text,\n requestId: newRequestId(),\n ...(conversationRef.current ? { conversationId: conversationRef.current } : {}),\n ...(pageContextRef.current ? { pageContext: pageContextRef.current } : {}),\n signal: controller.signal,\n onEvent: handleEvent,\n })\n .catch((error: unknown) => {\n if (stoppedByUserRef.current && isAbortError(error)) {\n setStoppedIds((current) => new Set(current).add(assistantId));\n publish();\n return;\n }\n const code = readErrorCode(error);\n // A dead session already redirects to login; a banner the user cannot\n // read before the reload is noise.\n if (code === \"unauthorized\") return;\n if (code) {\n setBanner(toBanner(code, error));\n return;\n }\n setBanner(\n error instanceof Error\n ? { tone: \"error\", titleKey: \"unavailableTitle\", rawMessage: error.message }\n : { tone: \"error\", titleKey: \"unavailableTitle\", messageKey: \"requestFailedBeforeResponse\" },\n );\n })\n .finally(() => {\n setRunning(false);\n setConfirmingId(null);\n abortRef.current = null;\n });\n },\n [port, onToolFinished],\n );\n\n const stop = useCallback(() => {\n if (!abortRef.current) return;\n stoppedByUserRef.current = true;\n abortRef.current.abort();\n }, []);\n\n const confirm = useCallback(\n (confirmationId: string, decision: CopilotConfirmationDecision) => {\n setConfirmingId(confirmationId);\n void port.confirm({ confirmationId, decision }).catch((error: unknown) => {\n setBanner(\n error instanceof Error\n ? { tone: \"error\", titleKey: \"confirmFailedTitle\", rawMessage: error.message }\n : { tone: \"error\", titleKey: \"confirmFailedTitle\", messageKey: \"decisionNotSent\" },\n );\n setConfirmingId(null);\n });\n },\n [port],\n );\n\n const resetConversation = useCallback(() => {\n abortRef.current?.abort();\n abortRef.current = null;\n stoppedByUserRef.current = false;\n conversationRef.current = undefined;\n setEntries([]);\n setStoppedIds(new Set());\n setConversationId(undefined);\n setBanner(null);\n setRunning(false);\n setConfirmingId(null);\n }, []);\n\n const dismissBanner = useCallback(() => setBanner(null), []);\n\n return {\n entries,\n stoppedIds,\n running,\n confirmingId,\n conversationId,\n banner,\n send,\n stop,\n confirm,\n resetConversation,\n dismissBanner,\n };\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === \"AbortError\";\n}\n\nfunction readErrorCode(error: unknown): string | undefined {\n if (typeof error === \"object\" && error !== null && \"code\" in error) {\n const code = (error as { code?: unknown }).code;\n if (typeof code === \"string\" && code.length > 0) return code;\n }\n return undefined;\n}\n\nfunction toBanner(code: string, error: unknown): CopilotBanner {\n switch (code) {\n case \"no_active_model\":\n return { tone: \"model\", titleKey: \"noModelTitle\", messageKey: \"noModelMessage\" };\n case \"run_in_progress\":\n return { tone: \"conflict\", titleKey: \"runInProgressTitle\", messageKey: \"runInProgressMessage\" };\n case \"conversation_forbidden\":\n return {\n tone: \"auth\",\n titleKey: \"conversationForbiddenTitle\",\n messageKey: \"conversationForbiddenMessage\",\n };\n default:\n return {\n tone: \"error\",\n titleKey: \"requestFailedTitle\",\n rawMessage: error instanceof Error ? error.message : undefined,\n };\n }\n}\n",
111
+ "type": "registry:component"
112
+ },
113
+ {
114
+ "path": "src/components/copilot/copilot-blocks.tsx",
115
+ "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { AlertTriangle, Check, ChevronDown, ChevronUp, Copy } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from \"@/components/ui/table\";\nimport { interpolate, useCopilotRuntime } from \"./copilot-context\";\nimport type {\n CopilotChartBlock,\n CopilotErrorBlock,\n CopilotQueryBlock,\n CopilotSkillBlock,\n CopilotTableBlock,\n CopilotTableColumn,\n} from \"./types\";\n\nexport function CopilotBlocks({ blocks }: { blocks: CopilotSkillBlock[] }) {\n if (blocks.length === 0) return null;\n return (\n <>\n {blocks.map((block, index) => {\n const key = `${block.kind}-${index}`;\n switch (block.kind) {\n case \"chart\":\n return <CopilotChartBlockView key={key} block={block} />;\n case \"table\":\n return <CopilotTableBlockView key={key} block={block} />;\n case \"query\":\n return <CopilotQueryBlockView key={key} block={block} />;\n case \"error\":\n return <CopilotErrorBlockView key={key} block={block} />;\n default:\n return null;\n }\n })}\n </>\n );\n}\n\nfunction CopilotChartBlockView({ block }: { block: CopilotChartBlock }) {\n const { labels, renderChart } = useCopilotRuntime();\n const { chartType, title, labels: axisLabels, datasets, truncated } = block;\n const isEmpty =\n axisLabels.length === 0 ||\n datasets.every((dataset) => dataset.data.length === 0 || dataset.data.every((value) => value === 0));\n\n return (\n <div className=\"mt-2 rounded-md border border-border bg-background p-3\">\n {title ? <p className=\"mb-2 text-xs font-medium text-foreground\">{title}</p> : null}\n {isEmpty ? (\n <p className=\"py-8 text-center text-xs text-muted-foreground\">{labels.noData}</p>\n ) : renderChart ? (\n renderChart({ chartType, labels: axisLabels, datasets, className: \"h-48\" })\n ) : (\n <ul className=\"flex flex-col gap-1\">\n {axisLabels.map((label, index) => (\n <li key={`${label}-${index}`} className=\"flex justify-between gap-2 text-[11px]\">\n <span className=\"truncate text-muted-foreground\">{label}</span>\n <span className=\"tabular-nums text-foreground\">\n {datasets.map((dataset) => dataset.data[index] ?? 0).join(\" / \")}\n </span>\n </li>\n ))}\n </ul>\n )}\n {truncated ? <p className=\"mt-1.5 text-[10px] text-muted-foreground/70\">{labels.dataTruncated}</p> : null}\n </div>\n );\n}\n\n/** Long text cells are truncated beyond this length; full text on hover. */\nconst MAX_CELL_TEXT = 80;\n\nfunction CopilotTableBlockView({ block }: { block: CopilotTableBlock }) {\n const { labels, locale } = useCopilotRuntime();\n const { title, columns, rows, totalRows, truncated } = block;\n\n return (\n <div className=\"mt-2 rounded-md border border-border bg-background p-3\">\n {title ? <p className=\"mb-2 text-xs font-medium text-foreground\">{title}</p> : null}\n {rows.length === 0 ? (\n <p className=\"py-6 text-center text-xs text-muted-foreground\">{labels.noData}</p>\n ) : (\n <div className=\"max-h-64 overflow-y-auto\">\n <Table>\n <TableHeader>\n <TableRow>\n {columns.map((column) => (\n <TableHead\n key={column.field}\n style={column.width ? { width: column.width } : undefined}\n className=\"sticky top-0 z-10 h-8 bg-background text-[11px]\"\n >\n {column.header}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((row, rowIndex) => (\n <TableRow key={rowIndex}>\n {columns.map((column) => (\n <TableCell key={column.field} className=\"py-1.5 text-[11px]\">\n <SmartCell value={row[column.field]} column={column} locale={locale} />\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n )}\n {rows.length > 0 ? (\n <p className=\"mt-1.5 text-[10px] text-muted-foreground/70\">\n {rows.length === totalRows\n ? interpolate(labels.rowsCount, { count: totalRows })\n : interpolate(labels.showingRows, { shown: rows.length, total: totalRows })}\n {truncated ? ` · ${labels.dataTruncated}` : \"\"}\n </p>\n ) : null}\n </div>\n );\n}\n\n/** Null/empty -> \"-\", locale-formatted numbers, formatHint units, long-text truncation. */\nfunction SmartCell({ value, column, locale }: { value: unknown; column: CopilotTableColumn; locale: string }) {\n if (value === null || value === undefined || value === \"\") {\n return <span className=\"text-muted-foreground/60\">{\"-\"}</span>;\n }\n\n if (typeof value === \"number\" && Number.isFinite(value)) {\n const formatted = new Intl.NumberFormat(locale, { maximumFractionDigits: 2 }).format(value);\n const withUnit =\n column.formatHint === \"ms\" ? `${formatted} ms` : column.formatHint === \"pct\" ? `${formatted} %` : formatted;\n return <span className=\"tabular-nums\">{withUnit}</span>;\n }\n\n const text = String(value);\n if (text.length <= MAX_CELL_TEXT) return <span className=\"break-all\">{text}</span>;\n return (\n <span className=\"break-all\" title={text}>\n {text.slice(0, MAX_CELL_TEXT)}\n {\"…\"}\n </span>\n );\n}\n\nfunction CopilotQueryBlockView({ block }: { block: CopilotQueryBlock }) {\n const { labels } = useCopilotRuntime();\n const [open, setOpen] = useState(false);\n const [copied, setCopied] = useState(false);\n\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(block.sql);\n setCopied(true);\n window.setTimeout(() => setCopied(false), 1500);\n } catch {\n setCopied(false);\n }\n };\n\n return (\n <div className=\"mt-2 rounded-md border border-border\">\n <button\n type=\"button\"\n onClick={() => setOpen((value) => !value)}\n className=\"flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-medium hover:bg-muted/50\"\n >\n {open ? <ChevronUp className=\"size-3.5\" /> : <ChevronDown className=\"size-3.5\" />}\n <span>{labels.viewQuery}</span>\n <span className=\"ml-auto text-[10px] text-muted-foreground\">{block.templateId}</span>\n </button>\n {open ? (\n <div className=\"relative border-t border-border\">\n <pre className=\"max-h-64 overflow-auto p-3 font-mono text-[11px] break-all whitespace-pre-wrap text-muted-foreground\">\n {block.sql}\n </pre>\n {block.truncated ? (\n <p className=\"border-t border-border px-3 py-1.5 text-[10px] text-muted-foreground/70\">\n {labels.queryTruncated}\n </p>\n ) : null}\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"absolute top-1 right-1\" onClick={copy}>\n {copied ? <Check className=\"size-3\" /> : <Copy className=\"size-3\" />}\n </Button>\n </div>\n ) : null}\n </div>\n );\n}\n\nfunction CopilotErrorBlockView({ block }: { block: CopilotErrorBlock }) {\n return (\n <div className=\"mt-2 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2 text-xs text-destructive\">\n <AlertTriangle className=\"mt-0.5 size-3.5 shrink-0\" />\n <div>\n <p className=\"font-medium\">{block.title}</p>\n <p className=\"mt-0.5 text-destructive/90\">{block.message}</p>\n </div>\n </div>\n );\n}\n",
116
+ "type": "registry:component"
117
+ },
118
+ {
119
+ "path": "src/components/copilot/copilot-tool-card.tsx",
120
+ "content": "\"use client\";\n\nimport { AlertTriangle, Ban, BarChart3, CheckCircle2, FileText, List, LoaderCircle, Lock } from \"lucide-react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { CopilotBlocks } from \"./copilot-blocks\";\nimport { useCopilotRuntime } from \"./copilot-context\";\nimport type { CopilotConfirmationDecision, CopilotResultKind } from \"./types\";\nimport type { CopilotToolCallVM } from \"./view-model\";\n\nconst KIND_META: Record<\n CopilotResultKind,\n { icon: typeof List; labelKey: \"listResult\" | \"detailResult\" | \"statistics\" }\n> = {\n list: { icon: List, labelKey: \"listResult\" },\n detail: { icon: FileText, labelKey: \"detailResult\" },\n stats: { icon: BarChart3, labelKey: \"statistics\" },\n};\n\nexport interface CopilotToolCardProps {\n toolCall: CopilotToolCallVM;\n kind?: CopilotResultKind;\n kindDescription?: string;\n /** True while the confirmation call is in flight. */\n confirming?: boolean;\n onConfirm?: (confirmationId: string, decision: CopilotConfirmationDecision) => void;\n}\n\nexport function CopilotToolCard({ toolCall, kind, kindDescription, confirming, onConfirm }: CopilotToolCardProps) {\n const { labels, onOpenLink } = useCopilotRuntime();\n const KindIcon = kind ? KIND_META[kind].icon : null;\n const confirmation = toolCall.confirmation;\n const waiting = confirmation?.state === \"waiting\";\n const isRunning = toolCall.status === \"running\";\n const isError = toolCall.status === \"error\";\n const isDenied = toolCall.status === \"denied\";\n\n return (\n <div\n className={\n waiting\n ? \"rounded-md border border-warning/50 bg-warning/5 p-2.5\"\n : \"rounded-md border border-border bg-muted/30 p-2.5\"\n }\n >\n <div className=\"flex items-center gap-2\">\n {waiting ? (\n <Lock className=\"size-3.5 shrink-0 text-warning\" />\n ) : isRunning ? (\n <LoaderCircle className=\"size-3.5 shrink-0 animate-spin text-muted-foreground\" />\n ) : isError ? (\n <AlertTriangle className=\"size-3.5 shrink-0 text-destructive\" />\n ) : isDenied ? (\n <Ban className=\"size-3.5 shrink-0 text-muted-foreground\" />\n ) : (\n <CheckCircle2 className=\"size-3.5 shrink-0 text-primary\" />\n )}\n <span className=\"font-mono text-xs font-medium\">{toolCall.name}</span>\n <Badge variant=\"outline\" className=\"ml-auto text-muted-foreground\">\n {waiting\n ? labels.statusAwaitingApproval\n : isRunning\n ? labels.statusRunning\n : toolCall.status === \"success\"\n ? labels.statusSuccess\n : toolCall.status === \"error\"\n ? labels.statusError\n : labels.statusDenied}\n </Badge>\n </div>\n\n {waiting && confirmation ? (\n <div data-testid=\"copilot-confirm-card\" className=\"mt-2\">\n <p className=\"text-xs font-medium\">{labels.approvalRequired}</p>\n <p className=\"mt-0.5 text-[11px] text-muted-foreground\">{labels.approvalBody}</p>\n <pre\n data-testid=\"copilot-confirm-args\"\n className=\"mt-2 max-h-48 overflow-auto rounded border border-border bg-background p-2 font-mono text-[10px] text-muted-foreground\"\n >\n {safeFormatJson(confirmation.arguments)}\n </pre>\n <div className=\"mt-2 flex gap-2\">\n <Button\n size=\"xs\"\n disabled={confirming}\n onClick={() => onConfirm?.(confirmation.confirmationId, \"confirmed\")}\n >\n {confirming ? <LoaderCircle className=\"size-3 animate-spin\" /> : null}\n {labels.confirm}\n </Button>\n <Button\n variant=\"outline\"\n size=\"xs\"\n disabled={confirming}\n onClick={() => onConfirm?.(confirmation.confirmationId, \"denied\")}\n >\n {labels.cancel}\n </Button>\n </div>\n </div>\n ) : null}\n\n {!waiting && isRunning && toolCall.inputSummary ? (\n <p className=\"mt-1.5 truncate font-mono text-[11px] text-muted-foreground\">{toolCall.inputSummary}</p>\n ) : null}\n\n {confirmation?.state === \"confirmed\" && isRunning ? (\n <p className=\"mt-1.5 text-[11px] text-muted-foreground\">{labels.approvedExecuting}</p>\n ) : null}\n\n {toolCall.blocks.length > 0 ? <CopilotBlocks blocks={toolCall.blocks} /> : null}\n\n {!isRunning && toolCall.summary ? (\n <p className=\"mt-1.5 text-xs whitespace-pre-wrap text-muted-foreground\">{toolCall.summary}</p>\n ) : null}\n\n {kind && !isError && !isDenied ? (\n <div className=\"mt-2 flex items-center gap-1.5 text-[11px] text-muted-foreground\">\n {KindIcon ? <KindIcon className=\"size-3\" /> : null}\n <span>{labels[KIND_META[kind].labelKey]}</span>\n {kindDescription ? <span className=\"truncate\">&middot; {kindDescription}</span> : null}\n </div>\n ) : null}\n\n {toolCall.actions.length > 0 ? (\n <div className=\"mt-2 flex flex-wrap gap-1.5\">\n {toolCall.actions.map((action) => (\n <Button\n key={`${action.href}-${action.label}`}\n variant=\"outline\"\n size=\"xs\"\n onClick={() => onOpenLink(action.href)}\n >\n {action.label}\n </Button>\n ))}\n </div>\n ) : null}\n\n {!isRunning && typeof toolCall.durationMs === \"number\" ? (\n <p className=\"mt-1.5 text-[10px] text-muted-foreground/70\">\n {toolCall.durationMs} {\"ms\"}\n </p>\n ) : null}\n </div>\n );\n}\n\nfunction safeFormatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n",
121
+ "type": "registry:component"
122
+ },
123
+ {
124
+ "path": "src/components/copilot/copilot-timeline.tsx",
125
+ "content": "\"use client\";\n\nimport { AlertTriangle, Ban } from \"lucide-react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { interpolate, prettifyCode, useCopilotRuntime } from \"./copilot-context\";\nimport { CopilotToolCard } from \"./copilot-tool-card\";\nimport type { CopilotConfirmationDecision, CopilotSkillCatalogEntry } from \"./types\";\nimport type { CopilotEntry } from \"./use-copilot-chat\";\n\nexport interface CopilotTimelineProps {\n entries: CopilotEntry[];\n catalog: CopilotSkillCatalogEntry[] | undefined;\n stoppedIds: ReadonlySet<string>;\n confirmingId: string | null;\n onConfirm: (confirmationId: string, decision: CopilotConfirmationDecision) => void;\n}\n\nexport function CopilotTimeline({ entries, catalog, stoppedIds, confirmingId, onConfirm }: CopilotTimelineProps) {\n const kindByName = new Map(catalog?.map((skill) => [skill.name, skill]));\n\n return (\n <div className=\"flex flex-col gap-4\">\n {entries.map((entry) =>\n entry.role === \"user\" ? (\n <div key={entry.id} className=\"flex justify-end\">\n <p className=\"max-w-[85%] rounded-lg bg-primary px-3 py-2 text-sm whitespace-pre-wrap text-primary-foreground\">\n {entry.text}\n </p>\n </div>\n ) : (\n <AssistantTurn\n key={entry.id}\n entry={entry}\n kindByName={kindByName}\n stopped={stoppedIds.has(entry.id)}\n confirmingId={confirmingId}\n onConfirm={onConfirm}\n />\n ),\n )}\n </div>\n );\n}\n\nfunction AssistantTurn({\n entry,\n kindByName,\n stopped,\n confirmingId,\n onConfirm,\n}: {\n entry: Extract<CopilotEntry, { role: \"assistant\" }>;\n kindByName: Map<string, CopilotSkillCatalogEntry>;\n stopped: boolean;\n confirmingId: string | null;\n onConfirm: (confirmationId: string, decision: CopilotConfirmationDecision) => void;\n}) {\n const { labels } = useCopilotRuntime();\n const { vm } = entry;\n const toolRunning = vm.toolCalls.some((toolCall) => toolCall.status === \"running\");\n const showWaiting = vm.status === \"streaming\" && !stopped && vm.text === \"\" && vm.toolCalls.length === 0;\n const showCaret = vm.status === \"streaming\" && !stopped && vm.text !== \"\";\n const showQuerying = vm.status === \"streaming\" && !stopped && toolRunning;\n const showAnalyzing =\n vm.status === \"streaming\" && !stopped && !toolRunning && vm.text !== \"\" && vm.toolCalls.length > 0;\n\n return (\n <div className=\"flex flex-col gap-2\">\n {vm.toolCalls.map((toolCall) => {\n const skill = kindByName.get(toolCall.name);\n return (\n <CopilotToolCard\n key={toolCall.id}\n toolCall={toolCall}\n kind={skill?.resultHint.kind}\n kindDescription={skill?.resultHint.description}\n confirming={\n toolCall.confirmation?.state === \"waiting\" && confirmingId === toolCall.confirmation.confirmationId\n }\n onConfirm={onConfirm}\n />\n );\n })}\n\n {vm.text ? (\n <p className=\"text-sm break-words whitespace-pre-wrap text-foreground\">\n {vm.text}\n {showCaret ? <span className=\"ml-0.5 inline-block animate-pulse text-primary\">{\"\\u258C\"}</span> : null}\n </p>\n ) : null}\n\n {showWaiting ? <p className=\"text-xs text-muted-foreground\">{labels.thinking}</p> : null}\n {showQuerying ? <p className=\"text-xs text-muted-foreground\">{labels.querying}</p> : null}\n {showAnalyzing ? <p className=\"text-xs text-muted-foreground\">{labels.analyzing}</p> : null}\n\n {vm.status === \"error\" ? (\n <div className=\"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2 text-xs text-destructive\">\n <AlertTriangle className=\"mt-0.5 size-3.5 shrink-0\" />\n <div>\n <p className=\"font-medium\">{vm.errorCode ? prettifyCode(vm.errorCode) : labels.failed}</p>\n {vm.errorMessage ? <p className=\"mt-0.5 text-destructive/90\">{vm.errorMessage}</p> : null}\n </div>\n </div>\n ) : null}\n\n {stopped ? (\n <Badge variant=\"outline\" className=\"w-fit gap-1 text-muted-foreground\">\n <Ban className=\"size-3\" />\n {labels.stopped}\n </Badge>\n ) : null}\n\n {vm.status === \"done\" && vm.usage ? (\n <p className=\"text-[10px] text-muted-foreground/70\">\n {vm.steps ? `${interpolate(labels.steps, { count: vm.steps })} · ` : \"\"}\n {interpolate(labels.tokens, { count: vm.usage.totalTokens })}\n </p>\n ) : null}\n </div>\n );\n}\n",
126
+ "type": "registry:component"
127
+ },
128
+ {
129
+ "path": "src/components/copilot/copilot-empty-state.tsx",
130
+ "content": "\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { ChevronRight, Info } from \"lucide-react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/ui/tooltip\";\nimport { interpolate, skillDisplayName, useCopilotRuntime } from \"./copilot-context\";\nimport type { CopilotSkillsCatalog } from \"./types\";\n\nexport interface CopilotEmptyStateProps {\n catalog: CopilotSkillsCatalog | undefined;\n isLoading: boolean;\n /** Host-specific card rendered above the capability list. */\n extra?: ReactNode;\n}\n\nexport function CopilotEmptyState({ catalog, isLoading, extra }: CopilotEmptyStateProps) {\n const { labels } = useCopilotRuntime();\n const relevant = catalog?.skills.filter((skill) => skill.relevant) ?? [];\n const others = catalog?.skills.filter((skill) => !skill.relevant) ?? [];\n const showHint = isLoading;\n\n return (\n <div className=\"flex flex-col gap-4\">\n {extra}\n <div className=\"rounded-md border border-border bg-muted/30 px-3 py-2.5\">\n <p className=\"text-xs text-muted-foreground\">{labels.emptyIntro}</p>\n </div>\n {showHint ? <p className=\"text-xs text-muted-foreground\">{labels.loadingCapabilities}</p> : null}\n\n <SkillSection title={labels.availableOnPage} skills={relevant} collapsible defaultOpen />\n <SkillSection title={labels.otherCapabilities} skills={others} collapsible />\n </div>\n );\n}\n\nfunction SkillSection({\n title,\n skills,\n collapsible = false,\n defaultOpen = false,\n}: {\n title: string;\n skills: CopilotSkillsCatalog[\"skills\"];\n collapsible?: boolean;\n defaultOpen?: boolean;\n}) {\n const { labels } = useCopilotRuntime();\n const [open, setOpen] = useState(defaultOpen || !collapsible);\n if (skills.length === 0) return null;\n\n return (\n <section className=\"flex flex-col gap-2\">\n {collapsible ? (\n <button\n type=\"button\"\n aria-expanded={open}\n onClick={() => setOpen((value) => !value)}\n className=\"flex items-center gap-1 text-left text-xs font-semibold text-foreground\"\n >\n <ChevronRight className={`size-3.5 transition-transform ${open ? \"rotate-90\" : \"\"}`} />\n {title}\n <span className=\"font-normal text-muted-foreground\">\n {\"(\"}\n {skills.length}\n {\")\"}\n </span>\n </button>\n ) : (\n <h3 className=\"text-xs font-semibold text-foreground\">{title}</h3>\n )}\n {open ? (\n <ul className=\"flex flex-col gap-1.5\">\n {skills.map((skill) => (\n <li key={skill.name} className=\"rounded-md border border-border px-2.5 py-2\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-xs font-medium\">{skillDisplayName(skill.name)}</span>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={interpolate(labels.aboutSkill, { name: skillDisplayName(skill.name) })}\n className=\"text-muted-foreground transition-colors hover:text-foreground\"\n >\n <Info className=\"size-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"left\" className=\"max-w-64\">\n {skill.description}\n </TooltipContent>\n </Tooltip>\n <Badge variant=\"secondary\" className=\"ml-auto text-[10px] capitalize\">\n {skill.resultHint.kind}\n </Badge>\n </div>\n </li>\n ))}\n </ul>\n ) : null}\n </section>\n );\n}\n",
131
+ "type": "registry:component"
132
+ },
133
+ {
134
+ "path": "src/components/copilot/copilot-dock.tsx",
135
+ "content": "\"use client\";\n\nimport { AlertTriangle, Bot, Lightbulb, RotateCcw, SendHorizontal, Settings, Square } from \"lucide-react\";\nimport { useCallback, useEffect, useRef, useState, type PointerEvent as ReactPointerEvent } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/ui/tooltip\";\nimport { CopilotEmptyState } from \"./copilot-empty-state\";\nimport { CopilotProvider, interpolate, useCopilotRuntime } from \"./copilot-context\";\nimport { CopilotTimeline } from \"./copilot-timeline\";\nimport type { CopilotDockProps, CopilotSkillsCatalog } from \"./types\";\nimport { useCopilotChat, type CopilotBanner } from \"./use-copilot-chat\";\n\nconst MIN_DEFAULT = 480;\nconst MAX_DEFAULT = 960;\nconst WIDTH_DEFAULT = 576;\nconst STORAGE_DEFAULT = \"copilot-dock-width-v2\";\nconst CATALOG_TTL_MS = 5 * 60 * 1000;\n\n/** Resizable chat dock. All transport, navigation and domain data enter as props. */\nexport function CopilotDock(props: CopilotDockProps) {\n const {\n labels,\n port,\n open,\n onClose,\n contextLabel,\n pageContext,\n catalogKey,\n settingsHref,\n canManageModels,\n modelBadge,\n renderChart,\n emptyStateExtra,\n onOpenLink,\n onNavigate,\n locale,\n className,\n } = props;\n const minWidth = props.minWidth ?? MIN_DEFAULT;\n const maxWidth = props.maxWidth ?? MAX_DEFAULT;\n const defaultWidth = props.defaultWidth ?? WIDTH_DEFAULT;\n const storageKey = props.storageKey ?? STORAGE_DEFAULT;\n const resolvedLocale = locale ?? (typeof navigator === \"undefined\" ? \"en\" : navigator.language);\n\n const clamp = useCallback((value: number) => Math.min(maxWidth, Math.max(minWidth, value)), [minWidth, maxWidth]);\n\n const [draft, setDraft] = useState(\"\");\n const [width, setWidth] = useState(() => {\n const stored = typeof window !== \"undefined\" ? window.localStorage.getItem(storageKey) : null;\n const parsed = stored ? Number(stored) : Number.NaN;\n return Number.isFinite(parsed) ? clamp(parsed) : defaultWidth;\n });\n const [dragging, setDragging] = useState(false);\n const [showSuggest, setShowSuggest] = useState(false);\n const dragState = useRef<{ startX: number; startWidth: number } | null>(null);\n const scrollRef = useRef<HTMLDivElement | null>(null);\n\n const chat = useCopilotChat({ port, pageContext, onToolFinished: props.onToolFinished });\n const catalog = useCatalog(port, catalogKey ?? pageContext?.route ?? \"generic\", pageContext?.route, open);\n const prompts = catalog.data?.recommendedPrompts ?? [];\n\n const navigate = useCallback(\n (href: string) => {\n if (onNavigate) onNavigate(href);\n else onOpenLink(href);\n },\n [onNavigate, onOpenLink],\n );\n\n const onResizeStart = (event: ReactPointerEvent<HTMLDivElement>) => {\n event.preventDefault();\n dragState.current = { startX: event.clientX, startWidth: width };\n setDragging(true);\n event.currentTarget.setPointerCapture(event.pointerId);\n };\n const onResizeMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const drag = dragState.current;\n if (!drag) return;\n setWidth(clamp(drag.startWidth + (drag.startX - event.clientX)));\n };\n const onResizeEnd = () => {\n if (!dragState.current) return;\n dragState.current = null;\n setDragging(false);\n window.localStorage.setItem(storageKey, String(width));\n };\n\n useEffect(() => {\n if (!open) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, [open, onClose]);\n\n useEffect(() => {\n const element = scrollRef.current;\n if (element && open) element.scrollTop = element.scrollHeight;\n }, [chat.entries, open]);\n\n const submit = () => {\n const text = draft.trim();\n if (!text || chat.running) return;\n chat.send(text);\n setDraft(\"\");\n };\n\n return (\n <CopilotProvider value={{ labels, locale: resolvedLocale, renderChart, onOpenLink }}>\n {/* Spacer in flex flow so main content shrinks; the dock itself is fixed. */}\n <div\n aria-hidden\n className={`shrink-0 ${dragging ? \"transition-none\" : \"transition-all duration-200\"} ${className ?? \"\"}`}\n style={{ width: open ? width : 0 }}\n />\n <aside\n aria-label={labels.title}\n aria-hidden={!open}\n className={`fixed top-14 right-0 bottom-0 z-20 flex flex-col overflow-hidden border-l border-border bg-card ${\n dragging ? \"transition-none\" : \"transition-all duration-200\"\n } ${open ? \"\" : \"pointer-events-none\"}`}\n style={{ width: open ? width : 0 }}\n >\n {open ? (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={labels.resizeAria}\n className=\"absolute inset-y-0 left-0 z-10 w-1.5 cursor-col-resize bg-transparent transition-colors hover:bg-primary/30\"\n onPointerDown={onResizeStart}\n onPointerMove={onResizeMove}\n onPointerUp={onResizeEnd}\n onPointerCancel={onResizeEnd}\n />\n ) : null}\n\n <header className=\"flex h-12 shrink-0 items-center gap-2 border-b border-border px-3\">\n <Bot className=\"size-4 text-primary\" />\n <h2 className=\"text-sm font-semibold\">{labels.title}</h2>\n {modelBadge}\n <span className=\"ml-2 truncate text-xs text-muted-foreground\">\n {contextLabel ? interpolate(labels.context, { label: contextLabel }) : null}\n </span>\n <div className=\"ml-auto flex items-center gap-1\">\n {canManageModels && settingsHref ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={labels.manageModelsAria}\n onClick={() => navigate(settingsHref)}\n >\n <Settings />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{labels.manageModels}</TooltipContent>\n </Tooltip>\n ) : null}\n {chat.conversationId ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={labels.newConversationAria}\n onClick={chat.resetConversation}\n >\n <RotateCcw />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{labels.newConversation}</TooltipContent>\n </Tooltip>\n ) : null}\n </div>\n </header>\n\n {chat.banner ? (\n <CopilotBannerView\n banner={chat.banner}\n onConfigure={settingsHref ? () => navigate(settingsHref) : undefined}\n onReset={chat.resetConversation}\n onDismiss={chat.dismissBanner}\n />\n ) : null}\n\n <div ref={scrollRef} className=\"flex-1 overflow-y-auto px-3 py-3\">\n {chat.entries.length === 0 ? (\n <CopilotEmptyState catalog={catalog.data} isLoading={catalog.isLoading} extra={emptyStateExtra} />\n ) : (\n <CopilotTimeline\n entries={chat.entries}\n catalog={catalog.data?.skills}\n stoppedIds={chat.stoppedIds}\n confirmingId={chat.confirmingId}\n onConfirm={chat.confirm}\n />\n )}\n </div>\n\n <div className=\"shrink-0 border-t border-border p-3\">\n <div className=\"relative flex items-end gap-2\">\n {prompts.length > 0 && !chat.running ? (\n <div\n className=\"group/suggest relative shrink-0\"\n onMouseEnter={() => setShowSuggest(true)}\n onMouseLeave={() => setShowSuggest(false)}\n >\n <button\n type=\"button\"\n onFocus={() => setShowSuggest(true)}\n onBlur={() => setShowSuggest(false)}\n aria-label={labels.suggestAria}\n aria-expanded={showSuggest}\n className={`flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-primary ${\n showSuggest ? \"bg-accent text-primary\" : \"\"\n }`}\n >\n <Lightbulb className=\"size-4\" />\n </button>\n\n <div\n className={`absolute bottom-full left-0 z-20 w-72 origin-bottom-left pb-2 transition-all duration-150 ${\n showSuggest ? \"pointer-events-auto scale-100 opacity-100\" : \"pointer-events-none scale-95 opacity-0\"\n }`}\n >\n <div className=\"rounded-lg border border-border bg-card p-3 shadow-lg\">\n <div className=\"mb-2 text-[11px] font-semibold tracking-wider text-muted-foreground uppercase\">\n {contextLabel\n ? interpolate(labels.suggestOnPage, { label: contextLabel })\n : labels.suggestGeneric}\n </div>\n <div className=\"flex flex-col gap-1\">\n {prompts.map((prompt) => (\n <button\n key={prompt.label}\n type=\"button\"\n onClick={() => {\n chat.send(prompt.prompt);\n setShowSuggest(false);\n }}\n className=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-accent hover:text-primary\"\n >\n <span className=\"min-w-0 flex-1\">{prompt.label}</span>\n </button>\n ))}\n </div>\n </div>\n </div>\n </div>\n ) : null}\n\n <Textarea\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n submit();\n }\n }}\n placeholder={chat.running ? labels.placeholderRunning : labels.placeholderIdle}\n rows={2}\n disabled={chat.running}\n className=\"min-h-0 resize-none\"\n />\n {chat.running ? (\n <Button variant=\"destructive\" size=\"icon\" aria-label={labels.stopAria} onClick={chat.stop}>\n <Square />\n </Button>\n ) : (\n <Button size=\"icon\" aria-label={labels.sendAria} onClick={submit} disabled={!draft.trim()}>\n <SendHorizontal />\n </Button>\n )}\n </div>\n <p className=\"mt-1.5 text-[10px] text-muted-foreground/70\">{labels.disclaimer}</p>\n <p className=\"text-[10px] text-muted-foreground/50\">{labels.disclaimerShortcuts}</p>\n </div>\n </aside>\n </CopilotProvider>\n );\n}\n\nfunction CopilotBannerView({\n banner,\n onConfigure,\n onReset,\n onDismiss,\n}: {\n banner: CopilotBanner;\n onConfigure?: () => void;\n onReset: () => void;\n onDismiss: () => void;\n}) {\n const { labels } = useCopilotRuntime();\n const message = banner.rawMessage\n ? banner.rawMessage\n : banner.messageKey\n ? interpolate(labels[banner.messageKey], banner.values ?? {})\n : null;\n\n return (\n <div className=\"flex items-start gap-2 border-b border-border bg-muted/40 px-3 py-2\">\n <AlertTriangle className=\"mt-0.5 size-3.5 shrink-0 text-warning\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-xs font-medium\">{labels[banner.titleKey]}</p>\n {message ? <p className=\"mt-0.5 text-xs text-muted-foreground\">{message}</p> : null}\n <div className=\"mt-1.5 flex gap-2\">\n {banner.tone === \"model\" && onConfigure ? (\n <Button variant=\"outline\" size=\"xs\" onClick={onConfigure}>\n {labels.configureModel}\n </Button>\n ) : null}\n {banner.tone === \"conflict\" || banner.tone === \"auth\" ? (\n <Button variant=\"outline\" size=\"xs\" onClick={onReset}>\n {labels.newConversation}\n </Button>\n ) : null}\n <Button variant=\"ghost\" size=\"xs\" onClick={onDismiss}>\n {labels.dismiss}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Catalog fetch with a per-key in-memory cache. A short TTL keeps capability\n * lists fresh enough without a query library or a provider requirement.\n */\nfunction useCatalog(\n port: CopilotDockProps[\"port\"],\n cacheKey: string,\n route: string | undefined,\n enabled: boolean,\n): { data: CopilotSkillsCatalog | undefined; isLoading: boolean } {\n const cache = useRef(new Map<string, { data: CopilotSkillsCatalog; at: number }>());\n const [data, setData] = useState<CopilotSkillsCatalog | undefined>(undefined);\n const [isLoading, setLoading] = useState(false);\n\n useEffect(() => {\n if (!enabled) return;\n const cached = cache.current.get(cacheKey);\n if (cached && Date.now() - cached.at < CATALOG_TTL_MS) {\n setData(cached.data);\n return;\n }\n let alive = true;\n setLoading(true);\n port\n .fetchCatalog(route)\n .then((result) => {\n if (!alive) return;\n cache.current.set(cacheKey, { data: result, at: Date.now() });\n setData(result);\n })\n .catch(() => {\n if (alive) setData(undefined);\n })\n .finally(() => {\n if (alive) setLoading(false);\n });\n return () => {\n alive = false;\n };\n }, [port, cacheKey, route, enabled]);\n\n return { data, isLoading };\n}\n",
136
+ "type": "registry:component"
137
+ },
138
+ {
139
+ "path": "src/components/copilot/index.ts",
140
+ "content": "export { CopilotDock } from \"./copilot-dock\";\nexport {\n CopilotProvider,\n useCopilotRuntime,\n interpolate,\n newRequestId,\n prettifyCode,\n skillDisplayName,\n} from \"./copilot-context\";\nexport type { CopilotRuntime } from \"./copilot-context\";\nexport { CopilotTimeline } from \"./copilot-timeline\";\nexport type { CopilotTimelineProps } from \"./copilot-timeline\";\nexport { CopilotToolCard } from \"./copilot-tool-card\";\nexport type { CopilotToolCardProps } from \"./copilot-tool-card\";\nexport { CopilotBlocks } from \"./copilot-blocks\";\nexport { CopilotEmptyState } from \"./copilot-empty-state\";\nexport type { CopilotEmptyStateProps } from \"./copilot-empty-state\";\nexport { applyAgentEvent, collectActions, createAssistantVM } from \"./view-model\";\nexport type { CopilotAssistantVM, CopilotConfirmationVM, CopilotRunStatus, CopilotToolCallVM } from \"./view-model\";\nexport { useCopilotChat } from \"./use-copilot-chat\";\nexport type {\n CopilotAssistantEntry,\n CopilotBanner,\n CopilotBannerMessageKey,\n CopilotBannerTitleKey,\n CopilotBannerTone,\n CopilotEntry,\n CopilotUserEntry,\n UseCopilotChat,\n} from \"./use-copilot-chat\";\nexport type {\n CopilotAgentEvent,\n CopilotChartBlock,\n CopilotChartDataset,\n CopilotChartView,\n CopilotConfirmationDecision,\n CopilotConfirmationState,\n CopilotDockProps,\n CopilotErrorBlock,\n CopilotLabels,\n CopilotLinkAction,\n CopilotPageContext,\n CopilotPort,\n CopilotPortError,\n CopilotQueryBlock,\n CopilotRecommendedPrompt,\n CopilotResultKind,\n CopilotSendInput,\n CopilotSkillBlock,\n CopilotSkillCatalogEntry,\n CopilotSkillsCatalog,\n CopilotTableBlock,\n CopilotTableColumn,\n CopilotToolStatus,\n} from \"./types\";\nexport { COPILOT_PROTOCOL_VERSION } from \"./types\";\n",
141
+ "type": "registry:component"
142
+ }
143
+ ]
144
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "framework": "^1.7.0",
4
- "entry": "src/modules/forgot-password/index.ts",
4
+ "entry": "src/features/forgot-password/index.ts",
5
5
  "labels": [
6
6
  "title",
7
7
  "description",
@@ -11,7 +11,7 @@
11
11
  "x-fewbie.contract": {
12
12
  "version": "1.0.0",
13
13
  "framework": "^1.7.0",
14
- "entry": "src/modules/forgot-password/index.ts",
14
+ "entry": "src/features/forgot-password/index.ts",
15
15
  "labels": [
16
16
  "title",
17
17
  "description",
@@ -59,18 +59,18 @@
59
59
  },
60
60
  "files": [
61
61
  {
62
- "path": "src/modules/forgot-password/index.ts",
62
+ "path": "src/features/forgot-password/index.ts",
63
63
  "content": "export { ForgotPasswordPage } from \"./forgot-password\";\nexport type {\n ForgotPasswordLabels,\n ForgotPasswordPort,\n ForgotPasswordProps,\n ResetPasswordInput,\n SendResetCodeResult,\n} from \"./types\";\n",
64
64
  "type": "registry:block"
65
65
  },
66
66
  {
67
- "path": "src/modules/forgot-password/types.ts",
67
+ "path": "src/features/forgot-password/types.ts",
68
68
  "content": "import type { ReactNode } from \"react\";\n\n/**\n * Every string the page renders. The host supplies translated copy; the module\n * owns no user-facing text of its own.\n */\nexport interface ForgotPasswordLabels {\n title: string;\n description: string;\n emailLabel: string;\n codeLabel: string;\n newPasswordLabel: string;\n getCode: string;\n resetButton: string;\n back: string;\n clearEmail: string;\n clearCode: string;\n clearPassword: string;\n showPassword: string;\n hidePassword: string;\n invalidEmail: string;\n emailRequired: string;\n codeDigits: string;\n codeRequired: string;\n passwordRule: string;\n passwordRequired: string;\n requestFailed: string;\n resetFailed: string;\n passwordRequirements: string;\n passwordRuleLength: string;\n passwordRuleLowercase: string;\n passwordRuleUppercase: string;\n passwordRuleNumber: string;\n passwordRuleSymbol: string;\n}\n\nexport interface ResetPasswordInput {\n email: string;\n verificationCode: string;\n newPassword: string;\n}\n\nexport interface SendResetCodeResult {\n /** Resend cooldown reported by the backend; defaults to 60 seconds. */\n secondsOfCountdown?: number;\n}\n\n/**\n * Host-owned transport. The module never calls fetch, a router or a toast\n * library: the host decides how to reach its backend and what to do after a\n * successful reset.\n */\nexport interface ForgotPasswordPort {\n sendResetCode(email: string): Promise<SendResetCodeResult>;\n resetPassword(input: ResetPasswordInput): Promise<void>;\n}\n\nexport interface ForgotPasswordProps {\n labels: ForgotPasswordLabels;\n port: ForgotPasswordPort;\n /** Email carried over from the sign-in page, used to seed the form. */\n initialEmail?: string;\n /** Persistent banners, host-styled. */\n notices?: ReactNode;\n /** Called after a verification code was sent; the host may toast. */\n onCodeSent?: () => void;\n /** Called after a successful reset; the host navigates. */\n onReset?: () => void;\n /** Renders the back link when provided; the host navigates. */\n onBack?: () => void;\n}\n",
69
69
  "type": "registry:block"
70
70
  },
71
71
  {
72
- "path": "src/modules/forgot-password/forgot-password.tsx",
73
- "content": "\"use client\";\n\nimport { useEffect, useState, type FormEvent } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { checkPasswordPolicy, isStrongPassword } from \"@/modules/password-checklist\";\nimport type { ForgotPasswordLabels, ForgotPasswordProps } from \"./types\";\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nconst CODE_LENGTH = 6;\nconst DEFAULT_RESEND_SECONDS = 60;\n\nfunction Spinner() {\n return (\n <span\n aria-hidden=\"true\"\n className=\"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n );\n}\n\nfunction ClearIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n className=\"h-4 w-4\"\n >\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\nfunction EyeIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n >\n <path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nfunction EyeOffIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n >\n <path d=\"M3 3l18 18\" />\n <path d=\"M10.6 10.6a3 3 0 0 0 4.2 4.2\" />\n <path d=\"M9.9 5.2A10.9 10.9 0 0 1 12 5c6.5 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1\" />\n <path d=\"M6.2 6.2A17.4 17.4 0 0 0 2 12s3.5 7 10 7a10.6 10.6 0 0 0 4.2-.9\" />\n </svg>\n );\n}\n\nfunction CheckIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-3.5 w-3.5\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nfunction PasswordChecklist({ password, labels }: { password: string; labels: ForgotPasswordLabels }) {\n // Show nothing until the user starts typing, to keep the form calm.\n if (!password) return null;\n\n const checks = checkPasswordPolicy(password);\n const rules = [\n { key: \"length\", label: labels.passwordRuleLength, met: checks.length },\n { key: \"lowercase\", label: labels.passwordRuleLowercase, met: checks.lowercase },\n { key: \"uppercase\", label: labels.passwordRuleUppercase, met: checks.uppercase },\n { key: \"number\", label: labels.passwordRuleNumber, met: checks.number },\n { key: \"symbol\", label: labels.passwordRuleSymbol, met: checks.symbol },\n ];\n\n return (\n <ul className=\"space-y-1.5 rounded-md border bg-muted/40 p-3\" aria-label={labels.passwordRequirements}>\n {rules.map((rule) => (\n <li\n key={rule.key}\n className={`flex items-center gap-2 text-xs ${\n rule.met ? \"text-green-600 dark:text-green-500\" : \"text-muted-foreground\"\n }`}\n >\n {rule.met ? <CheckIcon /> : <ClearIcon />}\n {rule.label}\n </li>\n ))}\n </ul>\n );\n}\n\n/**\n * Page-level password reset module: email plus verification code plus a new\n * password, with a live strength checklist. Transport, navigation and toasts\n * belong to the host and enter through `port` and the `on*` callbacks.\n */\nexport function ForgotPasswordPage({\n labels,\n port,\n initialEmail = \"\",\n notices,\n onCodeSent,\n onReset,\n onBack,\n}: ForgotPasswordProps) {\n const [email, setEmail] = useState(initialEmail);\n const [code, setCode] = useState(\"\");\n const [newPassword, setNewPassword] = useState(\"\");\n const [showPassword, setShowPassword] = useState(false);\n // Seconds left before the user can request another verification code.\n const [secondsLeft, setSecondsLeft] = useState(0);\n const [sendPending, setSendPending] = useState(false);\n const [resetPending, setResetPending] = useState(false);\n const [errors, setErrors] = useState<{ email?: string; code?: string; newPassword?: string }>({});\n const [error, setError] = useState<string | null>(null);\n\n const isCountingDown = secondsLeft > 0;\n\n // Countdown timer for resending the verification code.\n useEffect(() => {\n if (!isCountingDown) return;\n const timer = setInterval(() => setSecondsLeft((prev) => Math.max(0, prev - 1)), 1000);\n return () => clearInterval(timer);\n }, [isCountingDown]);\n\n function validateEmail(value: string): string | undefined {\n if (!value.trim()) return labels.emailRequired;\n if (!EMAIL_PATTERN.test(value)) return labels.invalidEmail;\n return undefined;\n }\n\n async function handleGetCode(): Promise<void> {\n if (secondsLeft > 0 || sendPending) return;\n const emailError = validateEmail(email);\n setErrors((prev) => ({ ...prev, email: emailError }));\n if (emailError) return;\n\n setSendPending(true);\n setError(null);\n try {\n const result = await port.sendResetCode(email);\n // Follow the resend cooldown returned by the backend.\n setSecondsLeft(result.secondsOfCountdown ?? DEFAULT_RESEND_SECONDS);\n onCodeSent?.();\n } catch {\n setError(labels.requestFailed);\n } finally {\n setSendPending(false);\n }\n }\n\n async function handleSubmit(event: FormEvent<HTMLFormElement>): Promise<void> {\n event.preventDefault();\n if (resetPending) return;\n\n const nextErrors = {\n email: validateEmail(email),\n code: !code ? labels.codeRequired : code.length !== CODE_LENGTH ? labels.codeDigits : undefined,\n newPassword: !newPassword\n ? labels.passwordRequired\n : isStrongPassword(newPassword)\n ? undefined\n : labels.passwordRule,\n };\n setErrors(nextErrors);\n if (nextErrors.email || nextErrors.code || nextErrors.newPassword) return;\n\n setResetPending(true);\n setError(null);\n try {\n await port.resetPassword({ email, verificationCode: code, newPassword });\n onReset?.();\n } catch {\n setError(labels.resetFailed);\n } finally {\n setResetPending(false);\n }\n }\n\n return (\n <Card className=\"w-full shadow-sm\">\n <CardHeader>\n <CardTitle className=\"text-xl\">{labels.title}</CardTitle>\n <CardDescription>{labels.description}</CardDescription>\n </CardHeader>\n <CardContent>\n {notices}\n\n {/* method=\"post\" keeps a native submit (before hydration) from\n serializing the new password into the query string. */}\n <form method=\"post\" onSubmit={(event) => void handleSubmit(event)} noValidate className=\"space-y-5\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"forgot-password-email\">{labels.emailLabel}</Label>\n <div className=\"relative\">\n <Input\n id=\"forgot-password-email\"\n autoComplete=\"email\"\n value={email}\n onChange={(event) => setEmail(event.target.value)}\n className=\"pr-10\"\n />\n {email && (\n <button\n type=\"button\"\n onClick={() => setEmail(\"\")}\n className=\"absolute top-1/2 right-2 -translate-y-1/2 text-muted-foreground hover:text-foreground\"\n aria-label={labels.clearEmail}\n >\n <ClearIcon />\n </button>\n )}\n </div>\n {errors.email && <p className=\"text-sm text-destructive\">{errors.email}</p>}\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"forgot-password-code\">{labels.codeLabel}</Label>\n <div className=\"relative\">\n <Input\n id=\"forgot-password-code\"\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n value={code}\n onChange={(event) => setCode(event.target.value.replace(/\\D/g, \"\").slice(0, CODE_LENGTH))}\n className=\"pr-32\"\n />\n <div className=\"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-2\">\n {code && (\n <button\n type=\"button\"\n onClick={() => setCode(\"\")}\n className=\"text-muted-foreground hover:text-foreground\"\n aria-label={labels.clearCode}\n >\n <ClearIcon />\n </button>\n )}\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto p-0 text-xs font-normal\"\n onClick={() => void handleGetCode()}\n disabled={secondsLeft > 0 || sendPending}\n >\n {sendPending ? <Spinner /> : secondsLeft > 0 ? `${secondsLeft}s` : labels.getCode}\n </Button>\n </div>\n </div>\n {errors.code && <p className=\"text-sm text-destructive\">{errors.code}</p>}\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"forgot-password-new-password\">{labels.newPasswordLabel}</Label>\n <div className=\"relative\">\n <Input\n id=\"forgot-password-new-password\"\n type={showPassword ? \"text\" : \"password\"}\n autoComplete=\"new-password\"\n value={newPassword}\n onChange={(event) => setNewPassword(event.target.value)}\n className=\"pr-20\"\n />\n <div className=\"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1\">\n {newPassword && (\n <button\n type=\"button\"\n onClick={() => setNewPassword(\"\")}\n className=\"text-muted-foreground hover:text-foreground\"\n aria-label={labels.clearPassword}\n >\n <ClearIcon />\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => setShowPassword((prev) => !prev)}\n className=\"text-muted-foreground hover:text-foreground\"\n aria-label={showPassword ? labels.hidePassword : labels.showPassword}\n >\n {showPassword ? <EyeOffIcon /> : <EyeIcon />}\n </button>\n </div>\n </div>\n <PasswordChecklist password={newPassword} labels={labels} />\n {errors.newPassword && <p className=\"text-sm text-destructive\">{errors.newPassword}</p>}\n </div>\n\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n\n {onBack && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto p-0 text-xs font-normal\"\n onClick={onBack}\n >\n {labels.back}\n </Button>\n </div>\n )}\n\n <Button type=\"submit\" className=\"w-full\" disabled={resetPending}>\n {resetPending ? <Spinner /> : labels.resetButton}\n </Button>\n </form>\n </CardContent>\n </Card>\n );\n}\n",
72
+ "path": "src/features/forgot-password/forgot-password.tsx",
73
+ "content": "\"use client\";\n\nimport { useEffect, useState, type FormEvent } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { checkPasswordPolicy, isStrongPassword } from \"@/features/password-checklist\";\nimport type { ForgotPasswordLabels, ForgotPasswordProps } from \"./types\";\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nconst CODE_LENGTH = 6;\nconst DEFAULT_RESEND_SECONDS = 60;\n\nfunction Spinner() {\n return (\n <span\n aria-hidden=\"true\"\n className=\"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n );\n}\n\nfunction ClearIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n className=\"h-4 w-4\"\n >\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\nfunction EyeIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n >\n <path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nfunction EyeOffIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n >\n <path d=\"M3 3l18 18\" />\n <path d=\"M10.6 10.6a3 3 0 0 0 4.2 4.2\" />\n <path d=\"M9.9 5.2A10.9 10.9 0 0 1 12 5c6.5 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1\" />\n <path d=\"M6.2 6.2A17.4 17.4 0 0 0 2 12s3.5 7 10 7a10.6 10.6 0 0 0 4.2-.9\" />\n </svg>\n );\n}\n\nfunction CheckIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-3.5 w-3.5\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nfunction PasswordChecklist({ password, labels }: { password: string; labels: ForgotPasswordLabels }) {\n // Show nothing until the user starts typing, to keep the form calm.\n if (!password) return null;\n\n const checks = checkPasswordPolicy(password);\n const rules = [\n { key: \"length\", label: labels.passwordRuleLength, met: checks.length },\n { key: \"lowercase\", label: labels.passwordRuleLowercase, met: checks.lowercase },\n { key: \"uppercase\", label: labels.passwordRuleUppercase, met: checks.uppercase },\n { key: \"number\", label: labels.passwordRuleNumber, met: checks.number },\n { key: \"symbol\", label: labels.passwordRuleSymbol, met: checks.symbol },\n ];\n\n return (\n <ul className=\"space-y-1.5 rounded-md border bg-muted/40 p-3\" aria-label={labels.passwordRequirements}>\n {rules.map((rule) => (\n <li\n key={rule.key}\n className={`flex items-center gap-2 text-xs ${\n rule.met ? \"text-green-600 dark:text-green-500\" : \"text-muted-foreground\"\n }`}\n >\n {rule.met ? <CheckIcon /> : <ClearIcon />}\n {rule.label}\n </li>\n ))}\n </ul>\n );\n}\n\n/**\n * Page-level password reset module: email plus verification code plus a new\n * password, with a live strength checklist. Transport, navigation and toasts\n * belong to the host and enter through `port` and the `on*` callbacks.\n */\nexport function ForgotPasswordPage({\n labels,\n port,\n initialEmail = \"\",\n notices,\n onCodeSent,\n onReset,\n onBack,\n}: ForgotPasswordProps) {\n const [email, setEmail] = useState(initialEmail);\n const [code, setCode] = useState(\"\");\n const [newPassword, setNewPassword] = useState(\"\");\n const [showPassword, setShowPassword] = useState(false);\n // Seconds left before the user can request another verification code.\n const [secondsLeft, setSecondsLeft] = useState(0);\n const [sendPending, setSendPending] = useState(false);\n const [resetPending, setResetPending] = useState(false);\n const [errors, setErrors] = useState<{ email?: string; code?: string; newPassword?: string }>({});\n const [error, setError] = useState<string | null>(null);\n\n const isCountingDown = secondsLeft > 0;\n\n // Countdown timer for resending the verification code.\n useEffect(() => {\n if (!isCountingDown) return;\n const timer = setInterval(() => setSecondsLeft((prev) => Math.max(0, prev - 1)), 1000);\n return () => clearInterval(timer);\n }, [isCountingDown]);\n\n function validateEmail(value: string): string | undefined {\n if (!value.trim()) return labels.emailRequired;\n if (!EMAIL_PATTERN.test(value)) return labels.invalidEmail;\n return undefined;\n }\n\n async function handleGetCode(): Promise<void> {\n if (secondsLeft > 0 || sendPending) return;\n const emailError = validateEmail(email);\n setErrors((prev) => ({ ...prev, email: emailError }));\n if (emailError) return;\n\n setSendPending(true);\n setError(null);\n try {\n const result = await port.sendResetCode(email);\n // Follow the resend cooldown returned by the backend.\n setSecondsLeft(result.secondsOfCountdown ?? DEFAULT_RESEND_SECONDS);\n onCodeSent?.();\n } catch {\n setError(labels.requestFailed);\n } finally {\n setSendPending(false);\n }\n }\n\n async function handleSubmit(event: FormEvent<HTMLFormElement>): Promise<void> {\n event.preventDefault();\n if (resetPending) return;\n\n const nextErrors = {\n email: validateEmail(email),\n code: !code ? labels.codeRequired : code.length !== CODE_LENGTH ? labels.codeDigits : undefined,\n newPassword: !newPassword\n ? labels.passwordRequired\n : isStrongPassword(newPassword)\n ? undefined\n : labels.passwordRule,\n };\n setErrors(nextErrors);\n if (nextErrors.email || nextErrors.code || nextErrors.newPassword) return;\n\n setResetPending(true);\n setError(null);\n try {\n await port.resetPassword({ email, verificationCode: code, newPassword });\n onReset?.();\n } catch {\n setError(labels.resetFailed);\n } finally {\n setResetPending(false);\n }\n }\n\n return (\n <Card className=\"w-full shadow-sm\">\n <CardHeader>\n <CardTitle className=\"text-xl\">{labels.title}</CardTitle>\n <CardDescription>{labels.description}</CardDescription>\n </CardHeader>\n <CardContent>\n {notices}\n\n {/* method=\"post\" keeps a native submit (before hydration) from\n serializing the new password into the query string. */}\n <form method=\"post\" onSubmit={(event) => void handleSubmit(event)} noValidate className=\"space-y-5\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"forgot-password-email\">{labels.emailLabel}</Label>\n <div className=\"relative\">\n <Input\n id=\"forgot-password-email\"\n autoComplete=\"email\"\n value={email}\n onChange={(event) => setEmail(event.target.value)}\n className=\"pr-10\"\n />\n {email && (\n <button\n type=\"button\"\n onClick={() => setEmail(\"\")}\n className=\"absolute top-1/2 right-2 -translate-y-1/2 text-muted-foreground hover:text-foreground\"\n aria-label={labels.clearEmail}\n >\n <ClearIcon />\n </button>\n )}\n </div>\n {errors.email && <p className=\"text-sm text-destructive\">{errors.email}</p>}\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"forgot-password-code\">{labels.codeLabel}</Label>\n <div className=\"relative\">\n <Input\n id=\"forgot-password-code\"\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n value={code}\n onChange={(event) => setCode(event.target.value.replace(/\\D/g, \"\").slice(0, CODE_LENGTH))}\n className=\"pr-32\"\n />\n <div className=\"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-2\">\n {code && (\n <button\n type=\"button\"\n onClick={() => setCode(\"\")}\n className=\"text-muted-foreground hover:text-foreground\"\n aria-label={labels.clearCode}\n >\n <ClearIcon />\n </button>\n )}\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto p-0 text-xs font-normal\"\n onClick={() => void handleGetCode()}\n disabled={secondsLeft > 0 || sendPending}\n >\n {sendPending ? <Spinner /> : secondsLeft > 0 ? `${secondsLeft}s` : labels.getCode}\n </Button>\n </div>\n </div>\n {errors.code && <p className=\"text-sm text-destructive\">{errors.code}</p>}\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"forgot-password-new-password\">{labels.newPasswordLabel}</Label>\n <div className=\"relative\">\n <Input\n id=\"forgot-password-new-password\"\n type={showPassword ? \"text\" : \"password\"}\n autoComplete=\"new-password\"\n value={newPassword}\n onChange={(event) => setNewPassword(event.target.value)}\n className=\"pr-20\"\n />\n <div className=\"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1\">\n {newPassword && (\n <button\n type=\"button\"\n onClick={() => setNewPassword(\"\")}\n className=\"text-muted-foreground hover:text-foreground\"\n aria-label={labels.clearPassword}\n >\n <ClearIcon />\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => setShowPassword((prev) => !prev)}\n className=\"text-muted-foreground hover:text-foreground\"\n aria-label={showPassword ? labels.hidePassword : labels.showPassword}\n >\n {showPassword ? <EyeOffIcon /> : <EyeIcon />}\n </button>\n </div>\n </div>\n <PasswordChecklist password={newPassword} labels={labels} />\n {errors.newPassword && <p className=\"text-sm text-destructive\">{errors.newPassword}</p>}\n </div>\n\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n\n {onBack && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto p-0 text-xs font-normal\"\n onClick={onBack}\n >\n {labels.back}\n </Button>\n </div>\n )}\n\n <Button type=\"submit\" className=\"w-full\" disabled={resetPending}>\n {resetPending ? <Spinner /> : labels.resetButton}\n </Button>\n </form>\n </CardContent>\n </Card>\n );\n}\n",
74
74
  "type": "registry:block"
75
75
  }
76
76
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "framework": "^1.7.0",
4
- "entry": "src/modules/login-form/index.ts",
4
+ "entry": "src/features/login-form/index.ts",
5
5
  "labels": [
6
6
  "title",
7
7
  "description",
@@ -11,7 +11,7 @@
11
11
  "x-fewbie.contract": {
12
12
  "version": "1.0.0",
13
13
  "framework": "^1.7.0",
14
- "entry": "src/modules/login-form/index.ts",
14
+ "entry": "src/features/login-form/index.ts",
15
15
  "labels": [
16
16
  "title",
17
17
  "description",
@@ -38,17 +38,17 @@
38
38
  },
39
39
  "files": [
40
40
  {
41
- "path": "src/modules/login-form/index.ts",
41
+ "path": "src/features/login-form/index.ts",
42
42
  "content": "export { LoginForm } from \"./login-form\";\nexport type { LoginFormLabels, LoginFormProps } from \"./types\";\n",
43
43
  "type": "registry:block"
44
44
  },
45
45
  {
46
- "path": "src/modules/login-form/types.ts",
46
+ "path": "src/features/login-form/types.ts",
47
47
  "content": "/**\n * Every string the form renders. The host supplies translated copy; the module\n * owns no user-facing text of its own.\n */\nexport interface LoginFormLabels {\n title: string;\n description: string;\n account: string;\n accountPlaceholder: string;\n password: string;\n submit: string;\n loginFailed: string;\n}\n\nexport interface LoginFormProps {\n labels: LoginFormLabels;\n /** App path to open after a successful sign-in; the host usually reads `?redirect=`. */\n redirectPath?: string;\n /** Called after sign-in succeeds; the host performs the navigation. */\n onLoggedIn: (path: string) => void;\n /**\n * Maps a sign-in failure to user-facing copy. Defaults to\n * `labels.loginFailed` so a host error message never leaks into the form.\n */\n formatError?: (error: unknown) => string;\n}\n",
48
48
  "type": "registry:block"
49
49
  },
50
50
  {
51
- "path": "src/modules/login-form/login-form.tsx",
51
+ "path": "src/features/login-form/login-form.tsx",
52
52
  "content": "\"use client\";\n\nimport { useState, type FormEvent } from \"react\";\nimport { Loader2 } from \"lucide-react\";\n\nimport { login } from \"@/lib/auth\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"@/components/ui/card\";\n\nimport type { LoginFormProps } from \"./types\";\n\nexport function LoginForm({ labels, redirectPath = \"/\", onLoggedIn, formatError }: LoginFormProps) {\n const [account, setAccount] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [error, setError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n async function handleSubmit(event: FormEvent<HTMLFormElement>) {\n event.preventDefault();\n setError(null);\n setSubmitting(true);\n try {\n await login({ account, password });\n onLoggedIn(redirectPath);\n } catch (err) {\n setError(formatError ? formatError(err) : labels.loginFailed);\n } finally {\n setSubmitting(false);\n }\n }\n\n return (\n <div className=\"flex min-h-svh items-center justify-center p-4\">\n <Card className=\"w-full max-w-sm\">\n <CardHeader>\n <CardTitle className=\"text-xl\">{labels.title}</CardTitle>\n <CardDescription>{labels.description}</CardDescription>\n </CardHeader>\n <CardContent>\n <form onSubmit={handleSubmit} className=\"flex flex-col gap-4\" noValidate>\n <div className=\"flex flex-col gap-2\">\n <Label htmlFor=\"account\">{labels.account}</Label>\n <Input\n id=\"account\"\n name=\"account\"\n autoComplete=\"username\"\n placeholder={labels.accountPlaceholder}\n value={account}\n onChange={(event) => setAccount(event.target.value)}\n required\n />\n </div>\n\n <div className=\"flex flex-col gap-2\">\n <Label htmlFor=\"password\">{labels.password}</Label>\n <Input\n id=\"password\"\n name=\"password\"\n type=\"password\"\n autoComplete=\"current-password\"\n value={password}\n onChange={(event) => setPassword(event.target.value)}\n required\n />\n </div>\n\n {error ? <p className=\"text-sm text-destructive\">{error}</p> : null}\n\n <Button type=\"submit\" disabled={submitting} className=\"w-full\">\n {submitting ? <Loader2 className=\"size-4 animate-spin\" /> : labels.submit}\n </Button>\n </form>\n </CardContent>\n </Card>\n </div>\n );\n}\n",
53
53
  "type": "registry:block"
54
54
  }