@raindrop-ai/wizard 0.0.1 → 0.0.2

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.
Files changed (71) hide show
  1. package/dist/src/docs/claude-agent-sdk.mdx +382 -0
  2. package/dist/src/docs/{typescript.md → typescript.mdx} +8 -4
  3. package/dist/src/docs/vercel-ai-sdk.mdx +769 -0
  4. package/dist/src/lib/agent-interface.d.ts +4 -3
  5. package/dist/src/lib/agent-interface.js +290 -197
  6. package/dist/src/lib/agent-interface.js.map +1 -1
  7. package/dist/src/lib/constants.d.ts +1 -0
  8. package/dist/src/lib/constants.js +1 -0
  9. package/dist/src/lib/constants.js.map +1 -1
  10. package/dist/src/lib/handlers.d.ts +16 -8
  11. package/dist/src/lib/handlers.js +232 -118
  12. package/dist/src/lib/handlers.js.map +1 -1
  13. package/dist/src/lib/integration-testing.d.ts +5 -5
  14. package/dist/src/lib/integration-testing.js +28 -12
  15. package/dist/src/lib/integration-testing.js.map +1 -1
  16. package/dist/src/lib/mcp.d.ts +1 -1
  17. package/dist/src/lib/mcp.js +88 -49
  18. package/dist/src/lib/mcp.js.map +1 -1
  19. package/dist/src/lib/sdk-messages.d.ts +8 -1
  20. package/dist/src/lib/sdk-messages.js +83 -27
  21. package/dist/src/lib/sdk-messages.js.map +1 -1
  22. package/dist/src/lib/wizard.js +16 -20
  23. package/dist/src/lib/wizard.js.map +1 -1
  24. package/dist/src/ui/App.d.ts +5 -4
  25. package/dist/src/ui/App.js +12 -12
  26. package/dist/src/ui/App.js.map +1 -1
  27. package/dist/src/ui/components/ClarifyingQuestionsPrompt.js +4 -2
  28. package/dist/src/ui/components/ClarifyingQuestionsPrompt.js.map +1 -1
  29. package/dist/src/ui/components/ContinuePrompt.d.ts +3 -2
  30. package/dist/src/ui/components/ContinuePrompt.js +4 -4
  31. package/dist/src/ui/components/ContinuePrompt.js.map +1 -1
  32. package/dist/src/ui/components/DiffDisplay.js +16 -6
  33. package/dist/src/ui/components/DiffDisplay.js.map +1 -1
  34. package/dist/src/ui/components/FeedbackSelectPrompt.js +6 -3
  35. package/dist/src/ui/components/FeedbackSelectPrompt.js.map +1 -1
  36. package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -3
  37. package/dist/src/ui/components/HistoryItemDisplay.js +10 -9
  38. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  39. package/dist/src/ui/components/Logo.js +19 -34
  40. package/dist/src/ui/components/Logo.js.map +1 -1
  41. package/dist/src/ui/components/OrgInfoBox.d.ts +2 -1
  42. package/dist/src/ui/components/OrgInfoBox.js +2 -4
  43. package/dist/src/ui/components/OrgInfoBox.js.map +1 -1
  44. package/dist/src/ui/components/PersistentTextInput.js +13 -11
  45. package/dist/src/ui/components/PersistentTextInput.js.map +1 -1
  46. package/dist/src/ui/components/PromptContainer.js +4 -8
  47. package/dist/src/ui/components/PromptContainer.js.map +1 -1
  48. package/dist/src/ui/components/ToolApprovalPrompt.js +4 -4
  49. package/dist/src/ui/components/ToolApprovalPrompt.js.map +1 -1
  50. package/dist/src/ui/components/WriteKeyDisplay.d.ts +1 -1
  51. package/dist/src/ui/components/WriteKeyDisplay.js +1 -1
  52. package/dist/src/ui/components/WriteKeyDisplay.js.map +1 -1
  53. package/dist/src/ui/contexts/WizardContext.d.ts +13 -5
  54. package/dist/src/ui/contexts/WizardContext.js +60 -20
  55. package/dist/src/ui/contexts/WizardContext.js.map +1 -1
  56. package/dist/src/ui/render.js +49 -5
  57. package/dist/src/ui/render.js.map +1 -1
  58. package/dist/src/ui/types.d.ts +4 -2
  59. package/dist/src/ui/types.js.map +1 -1
  60. package/dist/src/utils/oauth.js +0 -4
  61. package/dist/src/utils/oauth.js.map +1 -1
  62. package/dist/src/utils/session.d.ts +1 -0
  63. package/dist/src/utils/session.js +40 -1
  64. package/dist/src/utils/session.js.map +1 -1
  65. package/dist/src/utils/ui.d.ts +7 -2
  66. package/dist/src/utils/ui.js +9 -2
  67. package/dist/src/utils/ui.js.map +1 -1
  68. package/package.json +2 -1
  69. package/dist/src/docs/vercel-ai-sdk.md +0 -304
  70. /package/dist/src/docs/{browser.md → browser.mdx} +0 -0
  71. /package/dist/src/docs/{python.md → python.mdx} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"HistoryItemDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/HistoryItemDisplay.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,IAAI,GACoB;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CACjC,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,EAC3B,CAAC,MAAM,EAAE,OAAO,CAAC,CAClB,CAAC;IAEF,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,KAAC,IAAI,KAAG,CAAC;QAElB,KAAK,OAAO;YACV,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,QAAQ,mCAAU,EACxB,MAAC,IAAI,oBAAG,IAAI,CAAC,IAAI,IAAQ,IACrB,CACP,CAAC;QAEJ,KAAK,MAAM;YACT,OAAO,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC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3D,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["/**\n * Component to display a completed history item in the Static section.\n * Each item type has its own styled rendering.\n */\n\nimport React from 'react';\nimport { Box, Text, useStdout } from 'ink';\nimport Markdown from '@inkkit/ink-markdown';\nimport type { HistoryItem, ReceivedEventData } from '../contexts/WizardContext.js';\nimport { Logo } from './Logo.js';\nimport { ToolCallDisplay } from './ToolCallDisplay.js';\nimport { WriteKeyDisplay } from './WriteKeyDisplay.js';\nimport { OrgInfoBox } from './OrgInfoBox.js';\n\ninterface HistoryItemDisplayProps {\n item: HistoryItem;\n}\n\n/**\n * Renders a single history item based on its type\n */\nexport function HistoryItemDisplay({\n item,\n}: HistoryItemDisplayProps): React.ReactElement {\n const { stdout } = useStdout();\n const terminalWidth = React.useMemo(\n () => stdout?.columns || 80,\n [stdout?.columns],\n );\n\n switch (item.type) {\n case 'logo':\n return <Logo />;\n\n case 'outro':\n return (\n <Box>\n <Text dimColor>└─</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'note':\n return <NoteDisplay text={item.text} title={item.title} />;\n\n case 'cancel':\n return (\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> {item.text}</Text>\n </Box>\n );\n\n case 'response':\n return (\n <Box>\n <Text color=\"white\">●</Text>\n <Text color=\"white\"> {item.text}</Text>\n </Box>\n );\n\n case 'warning':\n return (\n <Box>\n <Text color=\"yellow\">●</Text>\n <Text color=\"yellow\"> {item.text}</Text>\n </Box>\n );\n\n case 'error':\n return <ErrorDisplay text={item.text} />;\n\n case 'success':\n return (\n <Box>\n <Text color=\"green\">●</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'step':\n return (\n <Box>\n <Text color=\"white\">●</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'phase':\n return (\n <Box>\n <Text backgroundColor=\"#C6C7FF\">{item.text}</Text>\n </Box>\n );\n\n case 'select-result':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"cyan\">›</Text>\n <Text> {item.text}</Text>\n </Box>\n {item.label && (\n <Box marginLeft={2}>\n <Text dimColor>└─ </Text>\n <Text color=\"cyan\">{item.label}</Text>\n </Box>\n )}\n </Box>\n );\n\n case 'text-result':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"cyan\">›</Text>\n <Text> {item.text}</Text>\n </Box>\n {item.label && (\n <Box marginLeft={2}>\n <Text dimColor>└─ </Text>\n <Text color=\"cyan\">{item.label}</Text>\n </Box>\n )}\n </Box>\n );\n\n case 'spinner-result':\n return (\n <Box>\n <Text color=\"green\">✓</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'tool-call':\n if (item.toolCall) {\n return <ToolCallDisplay toolCall={item.toolCall} />;\n }\n return (\n <Box>\n <Text color=\"cyan\">●</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'agent-message':\n return (\n <Box>\n <Text color=\"magenta\">◆ </Text>\n <Markdown showSectionPrefix={false}>{item.text}</Markdown>\n </Box>\n );\n\n case 'user-message':\n return (\n <Box>\n <Text backgroundColor=\"#4A4A4A\" color=\"white\"> › {item.text} </Text>\n </Box>\n );\n\n case 'clarifying-questions-result':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"white\">● </Text>\n <Text>{item.text}</Text>\n </Box>\n {item.questionsAndAnswers && item.questionsAndAnswers.map((qa, i) => {\n const isLast = i === item.questionsAndAnswers!.length - 1;\n const prefix = isLast ? '└' : '├';\n return (\n <Box key={i} marginLeft={2}>\n <Text dimColor>{prefix} · </Text>\n <Text>{qa.question}</Text>\n <Text dimColor> → </Text>\n <Text color=\"green\">{qa.answer}</Text>\n </Box>\n );\n })}\n </Box>\n );\n\n case 'declined-questions':\n return (\n <Box>\n <Text color=\"yellow\">⏺ </Text>\n <Text>{item.text}</Text>\n </Box>\n );\n\n case 'received-event':\n if (item.receivedEvent) {\n return <ReceivedEventDisplay event={item.receivedEvent} />;\n }\n return (\n <Box>\n <Text>{item.text}</Text>\n </Box>\n );\n\n case 'plan-review':\n return (\n <Box flexDirection=\"column\">\n <Text color=\"green\">{'─'.repeat(terminalWidth)}</Text>\n <Box marginBottom={1}>\n <Text bold>{item.text}</Text>\n </Box>\n <Box marginBottom={1}>\n <Text>Here is the Raindrop wizard's plan:</Text>\n </Box>\n {item.planContent && (\n <Box marginBottom={1} flexDirection=\"column\">\n <PlanContentDisplay content={item.planContent} />\n </Box>\n )}\n </Box>\n );\n\n case 'plan-approved':\n return (\n <Box>\n <Text color=\"green\">✓</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'plan-rejected':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> {item.text}</Text>\n </Box>\n {item.label && (\n <Box marginLeft={2}>\n <Text dimColor>└─ </Text>\n <Text color=\"red\">{item.label}</Text>\n </Box>\n )}\n </Box>\n );\n\n case 'org-info':\n if (item.orgName && item.writeKey) {\n return <OrgInfoBox orgName={item.orgName} writeKey={item.writeKey} />;\n }\n return (\n <Box>\n <Text color=\"white\">● </Text>\n <Text>{item.text}</Text>\n </Box>\n );\n\n case 'write-key':\n if (item.writeKey) {\n return <WriteKeyDisplay writeKey={item.writeKey} label={item.label} />;\n }\n return (\n <Box>\n <Text color=\"white\">● </Text>\n <Text>{item.text}</Text>\n </Box>\n );\n\n default:\n return (\n <Box>\n <Text>{item.text}</Text>\n </Box>\n );\n }\n}\n\n/**\n * Display plan content - let Markdown component handle everything including tables\n */\nfunction PlanContentDisplay({ content }: { content: string }): React.ReactElement {\n return (\n <Box>\n <Markdown showSectionPrefix={false}>{content}</Markdown>\n </Box>\n );\n}\n\n/**\n * Truncate text to a maximum length with ellipsis\n */\nfunction truncate(text: string | undefined, maxLength: number): string {\n if (!text) return 'N/A';\n if (text.length <= maxLength) return text;\n return text.substring(0, maxLength) + '...';\n}\n\n/**\n * Display for received events from the API\n */\nfunction ReceivedEventDisplay({\n event,\n}: {\n event: ReceivedEventData;\n}): React.ReactElement {\n const eventUrl = `https://app.raindrop.ai/home?event=${event.id}`;\n\n return (\n <Box flexDirection=\"column\" marginY={1}>\n <Box>\n <Text color=\"cyan\">◆ </Text>\n <Text bold color=\"cyan\">{event.eventName}</Text>\n </Box>\n <Box marginLeft={2} flexDirection=\"column\">\n <Box>\n <Text dimColor>Timestamp: </Text>\n <Text>{event.timestamp || 'N/A'}</Text>\n </Box>\n <Box>\n <Text dimColor>Model: </Text>\n <Text color=\"yellow\">{event.model || 'N/A'}</Text>\n </Box>\n <Box>\n <Text dimColor>User: </Text>\n <Text>{event.userId || 'N/A'}</Text>\n </Box>\n <Box>\n <Text dimColor>Input: </Text>\n <Text color=\"green\">{truncate(event.input, 80)}</Text>\n </Box>\n <Box>\n <Text dimColor>Output: </Text>\n <Text color=\"white\">{truncate(event.output, 80)}</Text>\n </Box>\n <Box>\n <Text dimColor>View: </Text>\n <Text color=\"blue\">{eventUrl}</Text>\n </Box>\n </Box>\n </Box>\n );\n}\n\n/**\n * Note display with optional title and tree-style formatting\n */\nfunction NoteDisplay({\n text,\n title,\n}: {\n text: string;\n title?: string;\n}): React.ReactElement {\n const lines = text.split('\\n');\n\n if (title) {\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text dimColor>┌─</Text>\n <Text bold> {title}</Text>\n </Box>\n {lines.map((line, i) => {\n const prefix = i === lines.length - 1 ? '└─' : '├─';\n return (\n <Box key={i}>\n <Text dimColor>{prefix}</Text>\n <Text dimColor> {line}</Text>\n </Box>\n );\n })}\n </Box>\n );\n }\n\n return (\n <Box flexDirection=\"column\">\n {lines.map((line, i) => (\n <Box key={i}>\n <Text dimColor>│ </Text>\n <Text dimColor>{line}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n\n/**\n * Error display with automatic truncation for long messages\n */\nfunction ErrorDisplay({ text }: { text: string }): React.ReactElement {\n const MAX_LINES = 15;\n const lines = text.split('\\n');\n const truncated = lines.length > MAX_LINES;\n const displayLines = truncated ? lines.slice(0, MAX_LINES) : lines;\n\n // For single-line errors, display inline\n if (lines.length === 1) {\n return (\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> {text}</Text>\n </Box>\n );\n }\n\n // For multi-line errors, display as a block with potential truncation\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> Error:</Text>\n </Box>\n <Box flexDirection=\"column\" marginLeft={2}>\n {displayLines.map((line, i) => (\n <Box key={i}>\n <Text color=\"red\">{line}</Text>\n </Box>\n ))}\n {truncated && (\n <Box marginTop={1}>\n <Text dimColor>... {lines.length - MAX_LINES} more lines</Text>\n </Box>\n )}\n </Box>\n </Box>\n );\n}\n\nexport default HistoryItemDisplay;\n"]}
1
+ {"version":3,"file":"HistoryItemDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/HistoryItemDisplay.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,IAAI,MAAM,UAAU,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,GACW;IACxB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,KAAC,IAAI,KAAG,CAAC;QAElB,KAAK,OAAO;YACV,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,QAAQ,mCAAU,EACxB,MAAC,IAAI,o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KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,uBAAS,EAC1B,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAe,IAC5B,EACN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAE,CAAC,aACtC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC7B,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,IAAI,GAAQ,IADvB,CAAC,CAEL,CACP,CAAC,EACD,SAAS,IAAI,CACZ,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,QAAQ,2BAAM,KAAK,CAAC,MAAM,GAAG,SAAS,mBAAmB,GAC3D,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,IAAI,CAClD,kBAAkB,EAClB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CACvB,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI;IACjC,SAAS,CAAC,aAAa,KAAK,SAAS,CAAC,aAAa,CACtD,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["/**\n * Component to display a completed history item in the history section.\n * Each item type has its own styled rendering.\n */\n\nimport React from 'react';\nimport { Box, Text } from 'ink';\nimport Markdown from '@inkkit/ink-markdown';\nimport Link from 'ink-link';\nimport type { HistoryItem, ReceivedEventData } from '../contexts/WizardContext.js';\nimport { Logo } from './Logo.js';\nimport { ToolCallDisplay } from './ToolCallDisplay.js';\nimport { WriteKeyDisplay } from './WriteKeyDisplay.js';\nimport { OrgInfoBox } from './OrgInfoBox.js';\n\ninterface HistoryItemDisplayProps {\n item: HistoryItem;\n terminalWidth: number;\n}\n\n/**\n * Renders a single history item based on its type\n */\nexport function HistoryItemDisplay({\n item,\n terminalWidth,\n}: HistoryItemDisplayProps): React.ReactElement {\n switch (item.type) {\n case 'logo':\n return <Logo />;\n\n case 'outro':\n return (\n <Box>\n <Text dimColor>└─</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'note':\n return <NoteDisplay text={item.text} title={item.title} />;\n\n case 'cancel':\n return (\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> {item.text}</Text>\n </Box>\n );\n\n case 'response':\n return (\n <Box>\n <Text color=\"white\">●</Text>\n <Text color=\"white\"> {item.text}</Text>\n </Box>\n );\n\n case 'warning':\n return (\n <Box>\n <Text color=\"yellow\">●</Text>\n <Text color=\"yellow\"> {item.text}</Text>\n </Box>\n );\n\n case 'error':\n return <ErrorDisplay text={item.text} />;\n\n case 'success':\n return (\n <Box>\n <Text color=\"green\">●</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'step':\n return (\n <Box>\n <Text color=\"white\">●</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'phase':\n return (\n <Box>\n <Text backgroundColor=\"#C6C7FF\">{item.text}</Text>\n </Box>\n );\n\n case 'select-result':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"cyan\">›</Text>\n <Text> {item.text}</Text>\n </Box>\n {item.label && (\n <Box marginLeft={2}>\n <Text dimColor>└─ </Text>\n <Text color=\"cyan\">{item.label}</Text>\n </Box>\n )}\n </Box>\n );\n\n case 'text-result':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"cyan\">›</Text>\n <Text> {item.text}</Text>\n </Box>\n {item.label && (\n <Box marginLeft={2}>\n <Text dimColor>└─ </Text>\n <Text color=\"cyan\">{item.label}</Text>\n </Box>\n )}\n </Box>\n );\n\n case 'spinner-result':\n return (\n <Box>\n <Text color=\"green\">✓</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'tool-call':\n if (item.toolCall) {\n return <ToolCallDisplay toolCall={item.toolCall} />;\n }\n return (\n <Box>\n <Text color=\"cyan\">●</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'agent-message':\n return (\n <Box>\n <Text color=\"magenta\">◆ </Text>\n <Markdown showSectionPrefix={false}>{item.text}</Markdown>\n </Box>\n );\n\n case 'user-message':\n return (\n <Box>\n <Text backgroundColor=\"#4A4A4A\" color=\"white\"> › {item.text} </Text>\n </Box>\n );\n\n case 'clarifying-questions-result':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"white\">● </Text>\n <Text>{item.text}</Text>\n </Box>\n {item.questionsAndAnswers && item.questionsAndAnswers.map((qa, i) => {\n const isLast = i === item.questionsAndAnswers!.length - 1;\n const prefix = isLast ? '└' : '├';\n return (\n <Box key={i} marginLeft={2}>\n <Text dimColor>{prefix} · </Text>\n <Text>{qa.question}</Text>\n <Text dimColor> → </Text>\n <Text color=\"green\">{qa.answer}</Text>\n </Box>\n );\n })}\n </Box>\n );\n\n case 'declined-questions':\n return (\n <Box>\n <Text color=\"yellow\">⏺ </Text>\n <Text>{item.text}</Text>\n </Box>\n );\n\n case 'received-event':\n if (item.receivedEvent) {\n return <ReceivedEventDisplay event={item.receivedEvent} />;\n }\n return (\n <Box>\n <Text>{item.text}</Text>\n </Box>\n );\n\n case 'plan-review':\n return (\n <Box flexDirection=\"column\">\n <Text color=\"green\">{'─'.repeat(terminalWidth)}</Text>\n <Box marginBottom={1}>\n <Text bold>{item.text}</Text>\n </Box>\n <Box marginBottom={1}>\n <Text>Here is the Raindrop wizard's plan:</Text>\n </Box>\n {item.planContent && (\n <Box marginBottom={1} flexDirection=\"column\">\n <PlanContentDisplay content={item.planContent} />\n </Box>\n )}\n </Box>\n );\n\n case 'plan-approved':\n return (\n <Box>\n <Text color=\"green\">✓</Text>\n <Text> {item.text}</Text>\n </Box>\n );\n\n case 'plan-rejected':\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> {item.text}</Text>\n </Box>\n {item.label && (\n <Box marginLeft={2}>\n <Text dimColor>└─ </Text>\n <Text color=\"red\">{item.label}</Text>\n </Box>\n )}\n </Box>\n );\n\n case 'org-info':\n if (item.orgName && item.writeKey) {\n return (\n <OrgInfoBox\n orgName={item.orgName}\n writeKey={item.writeKey}\n terminalWidth={terminalWidth}\n />\n );\n }\n return (\n <Box>\n <Text color=\"white\">● </Text>\n <Text>{item.text}</Text>\n </Box>\n );\n\n case 'write-key':\n if (item.writeKey) {\n return <WriteKeyDisplay writeKey={item.writeKey} label={item.label} />;\n }\n return (\n <Box>\n <Text color=\"white\">● </Text>\n <Text>{item.text}</Text>\n </Box>\n );\n\n default:\n return (\n <Box>\n <Text>{item.text}</Text>\n </Box>\n );\n }\n}\n\n/**\n * Display plan content - let Markdown component handle everything including tables\n */\nfunction PlanContentDisplay({ content }: { content: string }): React.ReactElement {\n return (\n <Box>\n <Markdown showSectionPrefix={false}>{content}</Markdown>\n </Box>\n );\n}\n\n/**\n * Truncate text to a maximum length with ellipsis\n */\nfunction truncate(text: string | undefined, maxLength: number): string {\n if (!text) return 'N/A';\n if (text.length <= maxLength) return text;\n return text.substring(0, maxLength) + '...';\n}\n\n/**\n * Display for received events from the API\n */\nfunction ReceivedEventDisplay({\n event,\n}: {\n event: ReceivedEventData;\n}): React.ReactElement {\n const eventUrl = `https://app.raindrop.ai/home?event=${encodeURIComponent(event.id)}`;\n\n return (\n <Box flexDirection=\"column\" marginY={1}>\n <Box>\n <Text color=\"cyan\">◆ </Text>\n <Text bold color=\"cyan\">{event.eventName}</Text>\n </Box>\n <Box marginLeft={2} flexDirection=\"column\">\n <Box>\n <Text dimColor>Timestamp: </Text>\n <Text>{event.timestamp || 'N/A'}</Text>\n </Box>\n <Box>\n <Text dimColor>Model: </Text>\n <Text color=\"yellow\">{event.model || 'N/A'}</Text>\n </Box>\n <Box>\n <Text dimColor>User: </Text>\n <Text>{event.userId || 'N/A'}</Text>\n </Box>\n <Box>\n <Text dimColor>Input: </Text>\n <Text color=\"green\">{truncate(event.input, 80)}</Text>\n </Box>\n <Box>\n <Text dimColor>Output: </Text>\n <Text color=\"white\">{truncate(event.output, 80)}</Text>\n </Box>\n {event.toolCallNames && event.toolCallNames.length > 0 && (\n <Box>\n <Text dimColor>Tool Calls: </Text>\n <Text color=\"magenta\">{truncate(event.toolCallNames.join(', '), 80)}</Text>\n </Box>\n )}\n <Box>\n <Link url={eventUrl}>\n <Text color=\"blue\">See it on Raindrop</Text>\n </Link>\n </Box>\n </Box>\n </Box>\n );\n}\n\n/**\n * Note display with optional title and tree-style formatting\n */\nfunction NoteDisplay({\n text,\n title,\n}: {\n text: string;\n title?: string;\n}): React.ReactElement {\n const lines = text.split('\\n');\n\n if (title) {\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text dimColor>┌─</Text>\n <Text bold> {title}</Text>\n </Box>\n {lines.map((line, i) => {\n const prefix = i === lines.length - 1 ? '└─' : '├─';\n return (\n <Box key={i}>\n <Text dimColor>{prefix}</Text>\n <Text dimColor> {line}</Text>\n </Box>\n );\n })}\n </Box>\n );\n }\n\n return (\n <Box flexDirection=\"column\">\n {lines.map((line, i) => (\n <Box key={i}>\n <Text dimColor>│ </Text>\n <Text dimColor>{line}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n\n/**\n * Error display with automatic truncation for long messages\n */\nfunction ErrorDisplay({ text }: { text: string }): React.ReactElement {\n const MAX_LINES = 15;\n const lines = text.split('\\n');\n const truncated = lines.length > MAX_LINES;\n const displayLines = truncated ? lines.slice(0, MAX_LINES) : lines;\n\n // For single-line errors, display inline\n if (lines.length === 1) {\n return (\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> {text}</Text>\n </Box>\n );\n }\n\n // For multi-line errors, display as a block with potential truncation\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text color=\"red\">●</Text>\n <Text color=\"red\"> Error:</Text>\n </Box>\n <Box flexDirection=\"column\" marginLeft={2}>\n {displayLines.map((line, i) => (\n <Box key={i}>\n <Text color=\"red\">{line}</Text>\n </Box>\n ))}\n {truncated && (\n <Box marginTop={1}>\n <Text dimColor>... {lines.length - MAX_LINES} more lines</Text>\n </Box>\n )}\n </Box>\n </Box>\n );\n}\n\nexport const MemoizedHistoryItemDisplay = React.memo(\n HistoryItemDisplay,\n (prevProps, nextProps) =>\n prevProps.item === nextProps.item &&\n prevProps.terminalWidth === nextProps.terminalWidth,\n);\n\nexport default MemoizedHistoryItemDisplay;\n"]}
@@ -4,44 +4,29 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  * Displays the ASCII art logo using Ink
5
5
  */
6
6
  import { Text } from 'ink';
7
- const LOGO = `
8
-
9
- .##########+
10
- -###########.
11
- -###########.
12
- ....-############+.....
13
- +#######################+
14
- +########################
15
- #########################
16
- #########################
17
- +#################################+.
18
- ###################################.
19
- ###################################.
20
- ###################################.
21
- .-++######################################+-.
22
- .#############################################.
23
- .#############################################.
24
- .#############################################.
25
- .################################+ #####.
26
- .################################- #####.
27
- .################################ #####.
28
- +##############################. +#####
29
- .#############################. .#####.
30
- .###########################. .######.
31
- .####################.... .######.
32
- .##################- .+######.
33
- .+################- .+#######.
34
- .###############- .-########..
35
- .##############+--+###########.
36
- +#######################+
37
- ..+###############+-.
38
- ..---..
39
- `;
7
+ const SMALL_LOGO = `
8
+
9
+ ######
10
+ ######
11
+ ############
12
+ ############
13
+ #################
14
+ ##################
15
+ ######################
16
+ ######################
17
+ ######################
18
+ ############### ###
19
+ ############## ###
20
+ ######### ###
21
+ ######## ####
22
+ ##############
23
+ ######
24
+ `;
40
25
  /**
41
26
  * Display the Raindrop logo
42
27
  */
43
28
  export function Logo() {
44
- return _jsx(Text, { color: "cyan", children: LOGO });
29
+ return _jsx(Text, { color: "cyan", children: SMALL_LOGO });
45
30
  }
46
31
  export default Logo;
47
32
  //# sourceMappingURL=Logo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../../../src/ui/components/Logo.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAgCqD,CAAC;AAEnE;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,CAAC;AAC1C,CAAC;AAED,eAAe,IAAI,CAAC","sourcesContent":["/**\n * Logo component for the Raindrop wizard\n * Displays the ASCII art logo using Ink\n */\n\nimport { Text } from 'ink';\nimport React from 'react';\n\nconst LOGO = ` \n \n .##########+ \n -###########. \n -###########. \n ....-############+..... \n +#######################+ \n +######################## \n ######################### \n ######################### \n +#################################+. \n ###################################. \n ###################################. \n ###################################. \n .-++######################################+-. \n .#############################################. \n .#############################################. \n .#############################################. \n .################################+ #####. \n .################################- #####. \n .################################ #####. \n +##############################. +##### \n .#############################. .#####. \n .###########################. .######. \n .####################.... .######. \n .##################- .+######. \n .+################- .+#######. \n .###############- .-########.. \n .##############+--+###########. \n +#######################+ \n ..+###############+-. \n ..---.. \n `;\n\n/**\n * Display the Raindrop logo\n */\nexport function Logo(): React.ReactElement {\n return <Text color=\"cyan\">{LOGO}</Text>;\n}\n\nexport default Logo;\n"]}
1
+ {"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../../../src/ui/components/Logo.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;CAiBlB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,UAAU,GAAQ,CAAC;AAChD,CAAC;AAED,eAAe,IAAI,CAAC","sourcesContent":["/**\n * Logo component for the Raindrop wizard\n * Displays the ASCII art logo using Ink\n */\n\nimport { Text } from 'ink';\nimport React from 'react';\n\nconst SMALL_LOGO = `\n\n ######\n ######\n ############\n ############\n #################\n ##################\n ######################\n ######################\n ######################\n ############### ###\n ############## ###\n ######### ###\n ######## ####\n ##############\n ######\n`;\n\n/**\n * Display the Raindrop logo\n */\nexport function Logo(): React.ReactElement {\n return <Text color=\"cyan\">{SMALL_LOGO}</Text>;\n}\n\nexport default Logo;\n"]}
@@ -6,6 +6,7 @@ import React from 'react';
6
6
  interface OrgInfoBoxProps {
7
7
  orgName: string;
8
8
  writeKey: string;
9
+ terminalWidth: number;
9
10
  }
10
- export declare function OrgInfoBox({ orgName, writeKey, }: OrgInfoBoxProps): React.ReactElement;
11
+ export declare function OrgInfoBox({ orgName, writeKey, terminalWidth, }: OrgInfoBoxProps): React.ReactElement;
11
12
  export default OrgInfoBox;
@@ -3,10 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * Beautiful box display for organization name and write key.
4
4
  * Shows after login in the wizard flow.
5
5
  */
6
- import { Box, Text, useStdout } from 'ink';
7
- export function OrgInfoBox({ orgName, writeKey, }) {
8
- const { stdout } = useStdout();
9
- const terminalWidth = stdout?.columns || 80;
6
+ import { Box, Text } from 'ink';
7
+ export function OrgInfoBox({ orgName, writeKey, terminalWidth, }) {
10
8
  // Account for border (2) + paddingX (2*2) = 6 chars of chrome
11
9
  const innerWidth = Math.max(terminalWidth - 6, 20);
12
10
  const divider = '─'.repeat(innerWidth);
@@ -1 +1 @@
1
- {"version":3,"file":"OrgInfoBox.js","sourceRoot":"","sources":["../../../../src/ui/components/OrgInfoBox.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAQ3C,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,QAAQ,GACQ;IAChB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;IAC5C,8DAA8D;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAEvC,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,aAEX,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,QAAQ,yCAA0B,EACxC,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,mBACrB,GAAG,EACH,OAAO,IACH,IACH,EAEN,KAAC,IAAI,IAAC,QAAQ,kBAAE,OAAO,GAAQ,EAE/B,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,QAAQ,yCAA0B,EACxC,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAChB,GAAG,EACH,QAAQ,IACJ,IACH,IACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Beautiful box display for organization name and write key.\n * Shows after login in the wizard flow.\n */\n\nimport { Box, Text, useStdout } from 'ink';\nimport React from 'react';\n\ninterface OrgInfoBoxProps {\n orgName: string;\n writeKey: string;\n}\n\nexport function OrgInfoBox({\n orgName,\n writeKey,\n}: OrgInfoBoxProps): React.ReactElement {\n const { stdout } = useStdout();\n const terminalWidth = stdout?.columns || 80;\n // Account for border (2) + paddingX (2*2) = 6 chars of chrome\n const innerWidth = Math.max(terminalWidth - 6, 20);\n const divider = '─'.repeat(innerWidth);\n\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor=\"cyan\"\n paddingX={2}\n paddingY={1}\n >\n <Box>\n <Text dimColor>Organization Name </Text>\n <Text color=\"white\" bold>\n {' '}\n {orgName}\n </Text>\n </Box>\n\n <Text dimColor>{divider}</Text>\n\n <Box>\n <Text dimColor>RAINDROP_WRITE_KEY</Text>\n <Text color=\"green\">\n {' '}\n {writeKey}\n </Text>\n </Box>\n </Box>\n );\n}\n\nexport default OrgInfoBox;\n"]}
1
+ {"version":3,"file":"OrgInfoBox.js","sourceRoot":"","sources":["../../../../src/ui/components/OrgInfoBox.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,aAAa,GACG;IAChB,8DAA8D;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAEvC,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,aAEX,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,QAAQ,yCAA0B,EACxC,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,mBACrB,GAAG,EACH,OAAO,IACH,IACH,EAEN,KAAC,IAAI,IAAC,QAAQ,kBAAE,OAAO,GAAQ,EAE/B,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,QAAQ,yCAA0B,EACxC,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAChB,GAAG,EACH,QAAQ,IACJ,IACH,IACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Beautiful box display for organization name and write key.\n * Shows after login in the wizard flow.\n */\n\nimport { Box, Text } from 'ink';\nimport React from 'react';\n\ninterface OrgInfoBoxProps {\n orgName: string;\n writeKey: string;\n terminalWidth: number;\n}\n\nexport function OrgInfoBox({\n orgName,\n writeKey,\n terminalWidth,\n}: OrgInfoBoxProps): React.ReactElement {\n // Account for border (2) + paddingX (2*2) = 6 chars of chrome\n const innerWidth = Math.max(terminalWidth - 6, 20);\n const divider = '─'.repeat(innerWidth);\n\n return (\n <Box\n flexDirection=\"column\"\n borderStyle=\"round\"\n borderColor=\"cyan\"\n paddingX={2}\n paddingY={1}\n >\n <Box>\n <Text dimColor>Organization Name </Text>\n <Text color=\"white\" bold>\n {' '}\n {orgName}\n </Text>\n </Box>\n\n <Text dimColor>{divider}</Text>\n\n <Box>\n <Text dimColor>RAINDROP_WRITE_KEY</Text>\n <Text color=\"green\">\n {' '}\n {writeKey}\n </Text>\n </Box>\n </Box>\n );\n}\n\nexport default OrgInfoBox;\n"]}
@@ -12,7 +12,7 @@ import { useState } from 'react';
12
12
  import { Box, Text, useInput } from 'ink';
13
13
  import TextInput from 'ink-text-input';
14
14
  import { PromptContainer } from './PromptContainer.js';
15
- import { useWizardActions } from '../contexts/WizardContext.js';
15
+ import { useWizardActions, useWizardState } from '../contexts/WizardContext.js';
16
16
  import { CANCEL_SYMBOL } from '../cancellation.js';
17
17
  /**
18
18
  * Unified text input component.
@@ -22,6 +22,8 @@ import { CANCEL_SYMBOL } from '../cancellation.js';
22
22
  export function PersistentTextInput({ props, }) {
23
23
  const { placeholder, message, defaultValue, validate, onSubmit, onInterrupt, onCtrlC, } = props;
24
24
  const { resolvePending, addItem, updatePersistentInputValue } = useWizardActions();
25
+ const { terminalSize } = useWizardState();
26
+ const inputWidth = Math.max(1, terminalSize.width - 2);
25
27
  const [value, setValue] = useState(defaultValue || '');
26
28
  const [error, setError] = useState(null);
27
29
  const [exitPending, setExitPending] = useState(false);
@@ -102,16 +104,16 @@ export function PersistentTextInput({ props, }) {
102
104
  resolvePending(submittedValue);
103
105
  }
104
106
  };
105
- return (_jsxs(PromptContainer, { children: [message && _jsx(Text, { children: message }), _jsxs(Box, { marginTop: message ? 1 : 0, children: [_jsx(Text, { color: "cyan", children: "\u203A " }), _jsx(TextInput, { value: value, onChange: (newValue) => {
106
- setValue(newValue);
107
- // Preserve value in context so it survives unmount/remount (e.g., during approval prompts)
108
- updatePersistentInputValue(newValue);
109
- if (error)
110
- setError(null);
111
- // Reset exit pending state when user types
112
- if (exitPending)
113
- setExitPending(false);
114
- }, placeholder: placeholder || 'Type a message or Esc to interrupt...', onSubmit: handleSubmit })] }), error && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "red", children: error }) }))] }));
107
+ return (_jsxs(PromptContainer, { children: [message && _jsx(Text, { children: message }), _jsxs(Box, { marginTop: message ? 1 : 0, width: terminalSize.width, children: [_jsx(Text, { color: "cyan", children: "\u203A " }), _jsx(Box, { width: inputWidth, children: _jsx(TextInput, { value: value, onChange: (newValue) => {
108
+ setValue(newValue);
109
+ // Preserve value in context so it survives unmount/remount (e.g., during approval prompts)
110
+ updatePersistentInputValue(newValue);
111
+ if (error)
112
+ setError(null);
113
+ // Reset exit pending state when user types
114
+ if (exitPending)
115
+ setExitPending(false);
116
+ }, placeholder: placeholder || 'Type a message or Esc to interrupt...', onSubmit: handleSubmit }) })] }), error && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "red", children: error }) }))] }));
115
117
  }
116
118
  export default PersistentTextInput;
117
119
  //# sourceMappingURL=PersistentTextInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistentTextInput.js","sourceRoot":"","sources":["../../../../src/ui/components/PersistentTextInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,C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OAAO,CACL,MAAC,eAAe,eAEb,OAAO,IAAI,KAAC,IAAI,cAAE,OAAO,GAAQ,EAGlC,MAAC,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAC7B,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,wBAAU,EAC5B,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;4BACrB,QAAQ,CAAC,QAAQ,CAAC,CAAC;4BACnB,2FAA2F;4BAC3F,0BAA0B,CAAC,QAAQ,CAAC,CAAC;4BACrC,IAAI,KAAK;gCAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;4BAC1B,2CAA2C;4BAC3C,IAAI,WAAW;gCAAE,cAAc,CAAC,KAAK,CAAC,CAAC;wBACzC,CAAC,EACD,WAAW,EAAE,WAAW,IAAI,uCAAuC,EACnE,QAAQ,EAAE,YAAY,GACtB,IACE,EAGL,KAAK,IAAI,CACR,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,KAAK,GAAQ,GAC5B,CACP,IACe,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,mBAAmB,CAAC","sourcesContent":["/**\n * Unified text input component for the wizard.\n *\n * Two modes:\n * 1. Callback mode: Uses onSubmit/onInterrupt callbacks (for persistent input during agent execution)\n * 2. Context mode: Uses resolvePending from WizardContext (for standalone text prompts)\n *\n * Note: Spinner is managed separately via ui.spinner() - this component is just the input.\n */\n\nimport React, { useState } from 'react';\nimport { Box, Text, useInput } from 'ink';\nimport TextInput from 'ink-text-input';\nimport { PromptContainer } from './PromptContainer.js';\nimport { useWizardActions } from '../contexts/WizardContext.js';\nimport { CANCEL_SYMBOL } from '../cancellation.js';\nimport type { PersistentInputProps } from '../types.js';\n\ninterface PersistentTextInputComponentProps {\n props: PersistentInputProps;\n}\n\n/**\n * Unified text input component.\n * - With callbacks (onSubmit/onInterrupt): Uses callbacks for submit/interrupt\n * - Without callbacks: Uses resolvePending from context (text prompt mode)\n */\nexport function PersistentTextInput({\n props,\n}: PersistentTextInputComponentProps): React.ReactElement {\n const {\n placeholder,\n message,\n defaultValue,\n validate,\n onSubmit,\n onInterrupt,\n onCtrlC,\n } = props;\n\n const { resolvePending, addItem, updatePersistentInputValue } =\n useWizardActions();\n const [value, setValue] = useState(defaultValue || '');\n const [error, setError] = useState<string | null>(null);\n const [exitPending, setExitPending] = useState(false);\n\n // Handle Escape and Ctrl+C\n useInput((input, key) => {\n // Handle Ctrl+C\n if (key.ctrl && input === 'c') {\n // If there's text, clear it first and set exit pending\n if (value.trim()) {\n setValue('');\n updatePersistentInputValue('');\n setExitPending(true);\n return;\n }\n\n // If no text and exit is pending, actually exit\n if (exitPending) {\n if (onCtrlC) {\n // Has Ctrl+C callback - use it\n onCtrlC();\n } else if (onInterrupt) {\n // No Ctrl+C callback, fall back to interrupt\n onInterrupt();\n } else {\n // No callback - cancel via resolvePending (text prompt mode)\n addItem({\n type: 'text-result',\n text: message || '',\n label: '(cancelled)',\n });\n resolvePending(CANCEL_SYMBOL);\n }\n return;\n }\n\n // If no text and not exit pending, set exit pending\n setExitPending(true);\n return;\n }\n\n // Handle Escape\n if (key.escape || input === '\\x1b') {\n if (onInterrupt) {\n // Has interrupt callback - use it\n onInterrupt();\n } else {\n // No callback - cancel via resolvePending (text prompt mode)\n addItem({\n type: 'text-result',\n text: message || '',\n label: '(cancelled)',\n });\n resolvePending(CANCEL_SYMBOL);\n }\n }\n });\n\n // Handle submission\n const handleSubmit = (submittedValue: string) => {\n // Validate if validator provided\n if (validate) {\n const validationError = validate(submittedValue);\n if (validationError) {\n setError(validationError);\n return;\n }\n }\n\n if (onSubmit) {\n // Has submit callback - use it\n if (submittedValue.trim()) {\n void Promise.resolve(onSubmit(submittedValue.trim()));\n setValue('');\n // Clear saved value in context\n updatePersistentInputValue('');\n }\n } else {\n // No callback - resolve via context (text prompt mode)\n resolvePending(submittedValue);\n }\n };\n\n return (\n <PromptContainer>\n {/* Message */}\n {message && <Text>{message}</Text>}\n\n {/* Text input */}\n <Box marginTop={message ? 1 : 0}>\n <Text color=\"cyan\">› </Text>\n <TextInput\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n // Preserve value in context so it survives unmount/remount (e.g., during approval prompts)\n updatePersistentInputValue(newValue);\n if (error) setError(null);\n // Reset exit pending state when user types\n if (exitPending) setExitPending(false);\n }}\n placeholder={placeholder || 'Type a message or Esc to interrupt...'}\n onSubmit={handleSubmit}\n />\n </Box>\n\n {/* Validation error */}\n {error && (\n <Box marginTop={1}>\n <Text color=\"red\">{error}</Text>\n </Box>\n )}\n </PromptContainer>\n );\n}\n\nexport default PersistentTextInput;\n"]}
1
+ {"version":3,"file":"PersistentTextInput.js","sourceRoot":"","sources":["../../../../src/ui/components/PersistentTextInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,KAAK,GAC6B;IAClC,MAAM,EACJ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,0BAA0B,EAAE,GAC3D,gBAAgB,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,G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CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,aACxD,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,wBAAU,EAC5B,KAAC,GAAG,IAAC,KAAK,EAAE,UAAU,YACpB,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;gCACrB,QAAQ,CAAC,QAAQ,CAAC,CAAC;gCACnB,2FAA2F;gCAC3F,0BAA0B,CAAC,QAAQ,CAAC,CAAC;gCACrC,IAAI,KAAK;oCAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;gCAC1B,2CAA2C;gCAC3C,IAAI,WAAW;oCAAE,cAAc,CAAC,KAAK,CAAC,CAAC;4BACzC,CAAC,EACD,WAAW,EAAE,WAAW,IAAI,uCAAuC,EACnE,QAAQ,EAAE,YAAY,GACtB,GACE,IACF,EAGL,KAAK,IAAI,CACR,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,KAAK,GAAQ,GAC5B,CACP,IACe,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,mBAAmB,CAAC","sourcesContent":["/**\n * Unified text input component for the wizard.\n *\n * Two modes:\n * 1. Callback mode: Uses onSubmit/onInterrupt callbacks (for persistent input during agent execution)\n * 2. Context mode: Uses resolvePending from WizardContext (for standalone text prompts)\n *\n * Note: Spinner is managed separately via ui.spinner() - this component is just the input.\n */\n\nimport React, { useState } from 'react';\nimport { Box, Text, useInput } from 'ink';\nimport TextInput from 'ink-text-input';\nimport { PromptContainer } from './PromptContainer.js';\nimport { useWizardActions, useWizardState } from '../contexts/WizardContext.js';\nimport { CANCEL_SYMBOL } from '../cancellation.js';\nimport type { PersistentInputProps } from '../types.js';\n\ninterface PersistentTextInputComponentProps {\n props: PersistentInputProps;\n}\n\n/**\n * Unified text input component.\n * - With callbacks (onSubmit/onInterrupt): Uses callbacks for submit/interrupt\n * - Without callbacks: Uses resolvePending from context (text prompt mode)\n */\nexport function PersistentTextInput({\n props,\n}: PersistentTextInputComponentProps): React.ReactElement {\n const {\n placeholder,\n message,\n defaultValue,\n validate,\n onSubmit,\n onInterrupt,\n onCtrlC,\n } = props;\n\n const { resolvePending, addItem, updatePersistentInputValue } =\n useWizardActions();\n const { terminalSize } = useWizardState();\n const inputWidth = Math.max(1, terminalSize.width - 2);\n const [value, setValue] = useState(defaultValue || '');\n const [error, setError] = useState<string | null>(null);\n const [exitPending, setExitPending] = useState(false);\n\n // Handle Escape and Ctrl+C\n useInput((input, key) => {\n // Handle Ctrl+C\n if (key.ctrl && input === 'c') {\n // If there's text, clear it first and set exit pending\n if (value.trim()) {\n setValue('');\n updatePersistentInputValue('');\n setExitPending(true);\n return;\n }\n\n // If no text and exit is pending, actually exit\n if (exitPending) {\n if (onCtrlC) {\n // Has Ctrl+C callback - use it\n onCtrlC();\n } else if (onInterrupt) {\n // No Ctrl+C callback, fall back to interrupt\n onInterrupt();\n } else {\n // No callback - cancel via resolvePending (text prompt mode)\n addItem({\n type: 'text-result',\n text: message || '',\n label: '(cancelled)',\n });\n resolvePending(CANCEL_SYMBOL);\n }\n return;\n }\n\n // If no text and not exit pending, set exit pending\n setExitPending(true);\n return;\n }\n\n // Handle Escape\n if (key.escape || input === '\\x1b') {\n if (onInterrupt) {\n // Has interrupt callback - use it\n onInterrupt();\n } else {\n // No callback - cancel via resolvePending (text prompt mode)\n addItem({\n type: 'text-result',\n text: message || '',\n label: '(cancelled)',\n });\n resolvePending(CANCEL_SYMBOL);\n }\n }\n });\n\n // Handle submission\n const handleSubmit = (submittedValue: string) => {\n // Validate if validator provided\n if (validate) {\n const validationError = validate(submittedValue);\n if (validationError) {\n setError(validationError);\n return;\n }\n }\n\n if (onSubmit) {\n // Has submit callback - use it\n if (submittedValue.trim()) {\n void Promise.resolve(onSubmit(submittedValue.trim()));\n setValue('');\n // Clear saved value in context\n updatePersistentInputValue('');\n }\n } else {\n // No callback - resolve via context (text prompt mode)\n resolvePending(submittedValue);\n }\n };\n\n return (\n <PromptContainer>\n {/* Message */}\n {message && <Text>{message}</Text>}\n\n {/* Text input */}\n <Box marginTop={message ? 1 : 0} width={terminalSize.width}>\n <Text color=\"cyan\">› </Text>\n <Box width={inputWidth}>\n <TextInput\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n // Preserve value in context so it survives unmount/remount (e.g., during approval prompts)\n updatePersistentInputValue(newValue);\n if (error) setError(null);\n // Reset exit pending state when user types\n if (exitPending) setExitPending(false);\n }}\n placeholder={placeholder || 'Type a message or Esc to interrupt...'}\n onSubmit={handleSubmit}\n />\n </Box>\n </Box>\n\n {/* Validation error */}\n {error && (\n <Box marginTop={1}>\n <Text color=\"red\">{error}</Text>\n </Box>\n )}\n </PromptContainer>\n );\n}\n\nexport default PersistentTextInput;\n"]}
@@ -1,17 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Reusable container for prompt components.
4
- * Provides consistent styling with dim horizontal lines above and below.
5
- */
6
- import React from 'react';
7
- import { Box, Text, useStdout } from 'ink';
2
+ import { Box, Text } from 'ink';
3
+ import { useWizardState } from '../contexts/WizardContext.js';
8
4
  /**
9
5
  * Container that wraps prompt content with dim horizontal lines.
10
6
  * Ensures consistent styling across all input components.
11
7
  */
12
8
  export function PromptContainer({ children, }) {
13
- const { stdout } = useStdout();
14
- const terminalWidth = React.useMemo(() => stdout?.columns || 80, [stdout?.columns]);
9
+ const { terminalSize } = useWizardState();
10
+ const terminalWidth = terminalSize.width;
15
11
  return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "gray", children: '─'.repeat(terminalWidth) }), children, _jsx(Text, { color: "gray", children: '─'.repeat(terminalWidth) })] }));
16
12
  }
17
13
  export default PromptContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"PromptContainer.js","sourceRoot":"","sources":["../../../../src/ui/components/PromptContainer.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAM3C;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,GACa;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CACjC,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,EAC3B,CAAC,MAAM,EAAE,OAAO,CAAC,CAClB,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAQ,EACpD,QAAQ,EACT,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAQ,IACjD,CACP,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["/**\n * Reusable container for prompt components.\n * Provides consistent styling with dim horizontal lines above and below.\n */\n\nimport React, { type ReactNode } from 'react';\nimport { Box, Text, useStdout } from 'ink';\n\ninterface PromptContainerProps {\n children: ReactNode;\n}\n\n/**\n * Container that wraps prompt content with dim horizontal lines.\n * Ensures consistent styling across all input components.\n */\nexport function PromptContainer({\n children,\n}: PromptContainerProps): React.ReactElement {\n const { stdout } = useStdout();\n const terminalWidth = React.useMemo(\n () => stdout?.columns || 80,\n [stdout?.columns],\n );\n\n return (\n <Box flexDirection=\"column\">\n <Text color=\"gray\">{'─'.repeat(terminalWidth)}</Text>\n {children}\n <Text color=\"gray\">{'─'.repeat(terminalWidth)}</Text>\n </Box>\n );\n}\n\nexport default PromptContainer;\n"]}
1
+ {"version":3,"file":"PromptContainer.js","sourceRoot":"","sources":["../../../../src/ui/components/PromptContainer.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,GACa;IACrB,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAC1C,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC;IAEzC,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAQ,EACpD,QAAQ,EACT,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAQ,IACjD,CACP,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["/**\n * Reusable container for prompt components.\n * Provides consistent styling with dim horizontal lines above and below.\n */\n\nimport React, { type ReactNode } from 'react';\nimport { Box, Text } from 'ink';\nimport { useWizardState } from '../contexts/WizardContext.js';\n\ninterface PromptContainerProps {\n children: ReactNode;\n}\n\n/**\n * Container that wraps prompt content with dim horizontal lines.\n * Ensures consistent styling across all input components.\n */\nexport function PromptContainer({\n children,\n}: PromptContainerProps): React.ReactElement {\n const { terminalSize } = useWizardState();\n const terminalWidth = terminalSize.width;\n\n return (\n <Box flexDirection=\"column\">\n <Text color=\"gray\">{'─'.repeat(terminalWidth)}</Text>\n {children}\n <Text color=\"gray\">{'─'.repeat(terminalWidth)}</Text>\n </Box>\n );\n}\n\nexport default PromptContainer;\n"]}
@@ -4,9 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * Displays tool details and allows user to approve or deny execution.
5
5
  */
6
6
  import { useMemo } from 'react';
7
- import { Box, Text, useInput, useStdout } from 'ink';
7
+ import { Box, Text, useInput } from 'ink';
8
8
  import SelectInput from 'ink-select-input';
9
- import { useWizardActions } from '../contexts/WizardContext.js';
9
+ import { useWizardActions, useWizardState } from '../contexts/WizardContext.js';
10
10
  import { DiffDisplay } from './DiffDisplay.js';
11
11
  import { PromptContainer } from './PromptContainer.js';
12
12
  /**
@@ -37,8 +37,8 @@ function extractCommandPattern(command) {
37
37
  export function ToolApprovalPrompt({ props, }) {
38
38
  const { toolName, input, diffContent, fileName, description } = props;
39
39
  const { resolvePending } = useWizardActions();
40
- const { stdout } = useStdout();
41
- const terminalWidth = useMemo(() => stdout?.columns || 80, [stdout?.columns]);
40
+ const { terminalSize } = useWizardState();
41
+ const terminalWidth = terminalSize.width;
42
42
  // Handle Escape and Ctrl+C to cancel (deny the tool)
43
43
  useInput((inputKey, key) => {
44
44
  if (key.escape || (key.ctrl && inputKey === 'c')) {
@@ -1 +1 @@
1
- {"version":3,"file":"ToolApprovalPrompt.js","sourceRoot":"","sources":["../../../../src/ui/components/ToolApprovalPrompt.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAcvD;;;;;;;GAOG;AACH,SAAS,qBAAqB,CAAC,OAAe;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEnC,gEAAgE;IAChE,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;Q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\n * Tool approval prompt component.\n * Displays tool details and allows user to approve or deny execution.\n */\n\nimport React, { useMemo } from 'react';\nimport { Box, Text, useInput, useStdout } from 'ink';\nimport SelectInput from 'ink-select-input';\nimport { useWizardActions } from '../contexts/WizardContext.js';\nimport { DiffDisplay } from './DiffDisplay.js';\nimport { PromptContainer } from './PromptContainer.js';\nimport type { ToolApprovalProps, ToolApprovalResult } from '../types.js';\n\ninterface ToolApprovalPromptComponentProps {\n props: ToolApprovalProps;\n}\n\ntype ApprovalOption = 'allow' | 'allow-all-session' | 'allow-all-command' | 'deny';\n\ninterface SelectItem {\n label: string;\n value: ApprovalOption;\n}\n\n/**\n * Extract the command pattern from a bash command for session approval.\n * Returns the base command with the first argument(s) to match similar commands.\n * Examples:\n * \"npm install axios\" -> \"npm install\"\n * \"npm run build\" -> \"npm run\"\n * \"pip install requests\" -> \"pip install\"\n */\nfunction extractCommandPattern(command: string): string {\n const trimmed = command.trim();\n const parts = trimmed.split(/\\s+/);\n\n // For package managers with subcommands, include the subcommand\n if (parts.length >= 2) {\n const [cmd, subcmd] = parts;\n // Common package managers\n if (\n ['npm', 'yarn', 'bun', 'pip', 'pip3', 'poetry', 'cargo', 'go'].includes(cmd)\n ) {\n return `${cmd} ${subcmd}`;\n }\n }\n\n // For other commands, just return the first part\n return parts[0] || trimmed;\n}\n\n/**\n * Tool approval prompt that shows tool details and approval options.\n */\nexport function ToolApprovalPrompt({\n props,\n}: ToolApprovalPromptComponentProps): React.ReactElement {\n const { toolName, input, diffContent, fileName, description } = props;\n const { resolvePending } = useWizardActions();\n const { stdout } = useStdout();\n const terminalWidth = useMemo(() => stdout?.columns || 80, [stdout?.columns]);\n\n // Handle Escape and Ctrl+C to cancel (deny the tool)\n useInput((inputKey, key) => {\n if (key.escape || (key.ctrl && inputKey === 'c')) {\n handleSelection({ value: 'deny', label: '' });\n }\n });\n\n // Get filename without path for the question\n const fileNameOnly = useMemo(() => {\n if (!fileName) return '';\n return fileName.split('/').pop() || fileName;\n }, [fileName]);\n\n // Get command pattern for Bash commands\n const commandPattern = useMemo(() => {\n if (toolName === 'Bash' && typeof input.command === 'string') {\n return extractCommandPattern(input.command);\n }\n return undefined;\n }, [toolName, input.command]);\n\n // Approval options\n const items: SelectItem[] = useMemo(() => {\n // For file edits, show file-specific \"allow all\" option\n if ((toolName === 'Edit' || toolName === 'Write') && fileNameOnly) {\n return [\n { label: 'Yes', value: 'allow' },\n { label: `Yes, allow all edits to ${fileNameOnly} during this session`, value: 'allow-all-session' },\n { label: 'No', value: 'deny' },\n ];\n }\n\n // For Bash commands, show command-specific \"allow all\" option\n if (toolName === 'Bash' && commandPattern) {\n return [\n { label: 'Yes', value: 'allow' },\n { label: `Yes, allow all ${commandPattern} commands this session`, value: 'allow-all-command' },\n { label: 'No', value: 'deny' },\n ];\n }\n\n // Default options\n return [\n { label: 'Yes', value: 'allow' },\n { label: 'No', value: 'deny' },\n ];\n }, [toolName, fileNameOnly, commandPattern]);\n\n // Handle selection\n const handleSelection = (item: { value: ApprovalOption; label: string }) => {\n let result: ToolApprovalResult;\n\n if (item.value === 'allow') {\n result = { behavior: 'allow', updatedInput: input };\n } else if (item.value === 'allow-all-session') {\n result = {\n behavior: 'allow',\n updatedInput: input,\n allowAllForFile: fileName\n };\n } else if (item.value === 'allow-all-command') {\n result = {\n behavior: 'allow',\n updatedInput: input,\n allowAllForCommandPattern: commandPattern\n };\n } else {\n result = { behavior: 'deny', message: 'User denied this action' };\n }\n\n resolvePending(result);\n };\n\n // Custom indicator component\n const indicatorComponent = ({ isSelected }: { isSelected: boolean }) => (\n <Text color=\"cyan\">{isSelected ? '›' : ' '}</Text>\n );\n\n // Custom item component with numbers and bold command\n const itemComponent = ({\n isSelected,\n label,\n }: {\n isSelected: boolean;\n label: string;\n }) => {\n const index = items.findIndex((item) => item.label === label);\n const color = isSelected ? 'cyan' : undefined;\n\n // Check if this label contains the command pattern to bold it\n if (commandPattern && label.includes(commandPattern)) {\n const parts = label.split(commandPattern);\n return (\n <Text color={color}>\n {index + 1}. {parts[0]}\n <Text bold>{commandPattern}</Text>\n {parts[1]}\n </Text>\n );\n }\n\n return (\n <Text color={color}>\n {index + 1}. {label}\n </Text>\n );\n };\n\n // Render tool-specific details\n const renderToolDetails = () => {\n // For file modifications with diff content, show the diff\n if (diffContent && fileName) {\n const action = toolName === 'Write' ? 'Write file' : 'Edit file';\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text bold>{action} </Text>\n <Text color=\"cyan\">{fileName}</Text>\n </Box>\n <Box marginTop={1}>\n <DiffDisplay diffContent={diffContent} maxHeight={20} />\n </Box>\n </Box>\n );\n }\n\n // For Bash commands, show the command\n if (toolName === 'Bash' && input.command) {\n return (\n <Box flexDirection=\"column\">\n <Text>Command:</Text>\n <Box marginLeft={2}>\n <Text bold>{String(input.command)}</Text>\n </Box>\n </Box>\n );\n }\n\n // For other tools, show input as JSON\n return (\n <Box flexDirection=\"column\">\n <Text bold>Input:</Text>\n <Box marginLeft={2}>\n <Text dimColor>{JSON.stringify(input, null, 2)}</Text>\n </Box>\n </Box>\n );\n };\n\n return (\n <PromptContainer>\n {/* Tool details (Edit file path and diff) */}\n <Box marginBottom={1} flexDirection=\"column\">\n {renderToolDetails()}\n </Box>\n\n {/* Horizontal separator */}\n <Box>\n <Text dimColor>{'─'.repeat(terminalWidth)}</Text>\n </Box>\n\n {/* Question */}\n <Box marginBottom={1}>\n <Text>\n {toolName === 'Bash'\n ? 'Do you want to proceed?'\n : `Do you want to make this ${toolName.toLowerCase()} to ${fileNameOnly || 'this file'}?`}\n </Text>\n </Box>\n\n {/* Selection options */}\n <Box>\n <SelectInput\n items={items}\n indicatorComponent={indicatorComponent}\n itemComponent={itemComponent}\n onSelect={handleSelection}\n />\n </Box>\n </PromptContainer>\n );\n}\n\nexport default ToolApprovalPrompt;\n"]}
1
+ {"version":3,"file":"ToolApprovalPrompt.js","sourceRoot":"","sources":["../../../../src/ui/components/ToolApprovalPrompt.tsx"],"names":[],"mappings":";AAAA;;;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AAI,IAAC,QAAQ,kBAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAQ,GAC7C,EAGN,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,cACF,QAAQ,KAAK,MAAM;wBAClB,CAAC,CAAC,yBAAyB;wBAC3B,CAAC,CAAC,4BAA4B,QAAQ,CAAC,WAAW,EAAE,OAAO,YAAY,IAAI,WAAW,GAAG,GACtF,GACH,EAGN,KAAC,GAAG,cACF,KAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,eAAe,GACzB,GACE,IACU,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["/**\n * Tool approval prompt component.\n * Displays tool details and allows user to approve or deny execution.\n */\n\nimport React, { useMemo } from 'react';\nimport { Box, Text, useInput } from 'ink';\nimport SelectInput from 'ink-select-input';\nimport { useWizardActions, useWizardState } from '../contexts/WizardContext.js';\nimport { DiffDisplay } from './DiffDisplay.js';\nimport { PromptContainer } from './PromptContainer.js';\nimport type { ToolApprovalProps, ToolApprovalResult } from '../types.js';\n\ninterface ToolApprovalPromptComponentProps {\n props: ToolApprovalProps;\n}\n\ntype ApprovalOption = 'allow' | 'allow-all-session' | 'allow-all-command' | 'deny';\n\ninterface SelectItem {\n label: string;\n value: ApprovalOption;\n}\n\n/**\n * Extract the command pattern from a bash command for session approval.\n * Returns the base command with the first argument(s) to match similar commands.\n * Examples:\n * \"npm install axios\" -> \"npm install\"\n * \"npm run build\" -> \"npm run\"\n * \"pip install requests\" -> \"pip install\"\n */\nfunction extractCommandPattern(command: string): string {\n const trimmed = command.trim();\n const parts = trimmed.split(/\\s+/);\n\n // For package managers with subcommands, include the subcommand\n if (parts.length >= 2) {\n const [cmd, subcmd] = parts;\n // Common package managers\n if (\n ['npm', 'yarn', 'bun', 'pip', 'pip3', 'poetry', 'cargo', 'go'].includes(cmd)\n ) {\n return `${cmd} ${subcmd}`;\n }\n }\n\n // For other commands, just return the first part\n return parts[0] || trimmed;\n}\n\n/**\n * Tool approval prompt that shows tool details and approval options.\n */\nexport function ToolApprovalPrompt({\n props,\n}: ToolApprovalPromptComponentProps): React.ReactElement {\n const { toolName, input, diffContent, fileName, description } = props;\n const { resolvePending } = useWizardActions();\n const { terminalSize } = useWizardState();\n const terminalWidth = terminalSize.width;\n\n // Handle Escape and Ctrl+C to cancel (deny the tool)\n useInput((inputKey, key) => {\n if (key.escape || (key.ctrl && inputKey === 'c')) {\n handleSelection({ value: 'deny', label: '' });\n }\n });\n\n // Get filename without path for the question\n const fileNameOnly = useMemo(() => {\n if (!fileName) return '';\n return fileName.split('/').pop() || fileName;\n }, [fileName]);\n\n // Get command pattern for Bash commands\n const commandPattern = useMemo(() => {\n if (toolName === 'Bash' && typeof input.command === 'string') {\n return extractCommandPattern(input.command);\n }\n return undefined;\n }, [toolName, input.command]);\n\n // Approval options\n const items: SelectItem[] = useMemo(() => {\n // For file edits, show file-specific \"allow all\" option\n if ((toolName === 'Edit' || toolName === 'Write') && fileNameOnly) {\n return [\n { label: 'Yes', value: 'allow' },\n { label: `Yes, allow all edits to ${fileNameOnly} during this session`, value: 'allow-all-session' },\n { label: 'No', value: 'deny' },\n ];\n }\n\n // For Bash commands, show command-specific \"allow all\" option\n if (toolName === 'Bash' && commandPattern) {\n return [\n { label: 'Yes', value: 'allow' },\n { label: `Yes, allow all ${commandPattern} commands this session`, value: 'allow-all-command' },\n { label: 'No', value: 'deny' },\n ];\n }\n\n // Default options\n return [\n { label: 'Yes', value: 'allow' },\n { label: 'No', value: 'deny' },\n ];\n }, [toolName, fileNameOnly, commandPattern]);\n\n // Handle selection\n const handleSelection = (item: { value: ApprovalOption; label: string }) => {\n let result: ToolApprovalResult;\n\n if (item.value === 'allow') {\n result = { behavior: 'allow', updatedInput: input };\n } else if (item.value === 'allow-all-session') {\n result = {\n behavior: 'allow',\n updatedInput: input,\n allowAllForFile: fileName\n };\n } else if (item.value === 'allow-all-command') {\n result = {\n behavior: 'allow',\n updatedInput: input,\n allowAllForCommandPattern: commandPattern\n };\n } else {\n result = { behavior: 'deny', message: 'User denied this action' };\n }\n\n resolvePending(result);\n };\n\n // Custom indicator component\n const indicatorComponent = ({ isSelected }: { isSelected: boolean }) => (\n <Text color=\"cyan\">{isSelected ? '›' : ' '}</Text>\n );\n\n // Custom item component with numbers and bold command\n const itemComponent = ({\n isSelected,\n label,\n }: {\n isSelected: boolean;\n label: string;\n }) => {\n const index = items.findIndex((item) => item.label === label);\n const color = isSelected ? 'cyan' : undefined;\n\n // Check if this label contains the command pattern to bold it\n if (commandPattern && label.includes(commandPattern)) {\n const parts = label.split(commandPattern);\n return (\n <Text color={color}>\n {index + 1}. {parts[0]}\n <Text bold>{commandPattern}</Text>\n {parts[1]}\n </Text>\n );\n }\n\n return (\n <Text color={color}>\n {index + 1}. {label}\n </Text>\n );\n };\n\n // Render tool-specific details\n const renderToolDetails = () => {\n // For file modifications with diff content, show the diff\n if (diffContent && fileName) {\n const action = toolName === 'Write' ? 'Write file' : 'Edit file';\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text bold>{action} </Text>\n <Text color=\"cyan\">{fileName}</Text>\n </Box>\n <Box marginTop={1}>\n <DiffDisplay diffContent={diffContent} maxHeight={20} />\n </Box>\n </Box>\n );\n }\n\n // For Bash commands, show the command\n if (toolName === 'Bash' && input.command) {\n return (\n <Box flexDirection=\"column\">\n <Text>Command:</Text>\n <Box marginLeft={2}>\n <Text bold>{String(input.command)}</Text>\n </Box>\n </Box>\n );\n }\n\n // For other tools, show input as JSON\n return (\n <Box flexDirection=\"column\">\n <Text bold>Input:</Text>\n <Box marginLeft={2}>\n <Text dimColor>{JSON.stringify(input, null, 2)}</Text>\n </Box>\n </Box>\n );\n };\n\n return (\n <PromptContainer>\n {/* Tool details (Edit file path and diff) */}\n <Box marginBottom={1} flexDirection=\"column\">\n {renderToolDetails()}\n </Box>\n\n {/* Horizontal separator */}\n <Box>\n <Text dimColor>{'─'.repeat(terminalWidth)}</Text>\n </Box>\n\n {/* Question */}\n <Box marginBottom={1}>\n <Text>\n {toolName === 'Bash'\n ? 'Do you want to proceed?'\n : `Do you want to make this ${toolName.toLowerCase()} to ${fileNameOnly || 'this file'}?`}\n </Text>\n </Box>\n\n {/* Selection options */}\n <Box>\n <SelectInput\n items={items}\n indicatorComponent={indicatorComponent}\n itemComponent={itemComponent}\n onSelect={handleSelection}\n />\n </Box>\n </PromptContainer>\n );\n}\n\nexport default ToolApprovalPrompt;\n"]}
@@ -8,7 +8,7 @@ interface WriteKeyDisplayProps {
8
8
  label?: string;
9
9
  }
10
10
  /**
11
- * Static write key display for history.
11
+ * Write key display for history.
12
12
  * Shows the key masked with dots for security.
13
13
  */
14
14
  export declare function WriteKeyDisplay({ writeKey, label, }: WriteKeyDisplayProps): React.ReactElement;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Text } from 'ink';
3
3
  /**
4
- * Static write key display for history.
4
+ * Write key display for history.
5
5
  * Shows the key masked with dots for security.
6
6
  */
7
7
  export function WriteKeyDisplay({ writeKey, label, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"WriteKeyDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/WriteKeyDisplay.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,EACR,KAAK,GACgB;IACrB,yBAAyB;IACzB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAE5D,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAU,EAC7B,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,qCAA4B,EAC9C,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,SAAS,GAAQ,EACpC,KAAK,IAAI,MAAC,IAAI,IAAC,QAAQ,yBAAI,KAAK,SAAS,IACtC,CACP,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["/**\n * Write key display component for history items.\n * Shows the key masked for security (non-interactive reference).\n */\n\nimport React from 'react';\nimport { Box, Text } from 'ink';\n\ninterface WriteKeyDisplayProps {\n writeKey: string;\n label?: string;\n}\n\n/**\n * Static write key display for history.\n * Shows the key masked with dots for security.\n */\nexport function WriteKeyDisplay({\n writeKey,\n label,\n}: WriteKeyDisplayProps): React.ReactElement {\n // Mask the key with dots\n const maskedKey = '•'.repeat(Math.min(writeKey.length, 32));\n\n return (\n <Box>\n <Text color=\"white\">● </Text>\n <Text color=\"cyan\">RAINDROP_WRITE_KEY: </Text>\n <Text color=\"gray\">{maskedKey}</Text>\n {label && <Text dimColor> ({label})</Text>}\n </Box>\n );\n}\n\nexport default WriteKeyDisplay;\n"]}
1
+ {"version":3,"file":"WriteKeyDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/WriteKeyDisplay.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,EACR,KAAK,GACgB;IACrB,yBAAyB;IACzB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAE5D,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAU,EAC7B,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,qCAA4B,EAC9C,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,SAAS,GAAQ,EACpC,KAAK,IAAI,MAAC,IAAI,IAAC,QAAQ,yBAAI,KAAK,SAAS,IACtC,CACP,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["/**\n * Write key display component for history items.\n * Shows the key masked for security (non-interactive reference).\n */\n\nimport React from 'react';\nimport { Box, Text } from 'ink';\n\ninterface WriteKeyDisplayProps {\n writeKey: string;\n label?: string;\n}\n\n/**\n * Write key display for history.\n * Shows the key masked with dots for security.\n */\nexport function WriteKeyDisplay({\n writeKey,\n label,\n}: WriteKeyDisplayProps): React.ReactElement {\n // Mask the key with dots\n const maskedKey = '•'.repeat(Math.min(writeKey.length, 32));\n\n return (\n <Box>\n <Text color=\"white\">● </Text>\n <Text color=\"cyan\">RAINDROP_WRITE_KEY: </Text>\n <Text color=\"gray\">{maskedKey}</Text>\n {label && <Text dimColor> ({label})</Text>}\n </Box>\n );\n}\n\nexport default WriteKeyDisplay;\n"]}
@@ -5,7 +5,7 @@
5
5
  import React, { type ReactNode } from 'react';
6
6
  import type { SelectOptions, TextOptions, SpinnerInstance, ToolApprovalProps, ToolApprovalResult, ClarifyingQuestionsProps, ClarifyingQuestionsResult, PlanApprovalProps, PlanApprovalResult, PersistentInputProps, ToolCallInfo, AgentQueryHandle, FeedbackSelectOptions, FeedbackSelectResult, ContinuePromptOptions } from '../types.js';
7
7
  /**
8
- * Types of items that can appear in the history (Static section)
8
+ * Types of items that can appear in history
9
9
  */
10
10
  export type HistoryItemType = 'logo' | 'outro' | 'note' | 'cancel' | 'response' | 'warning' | 'error' | 'success' | 'step' | 'phase' | 'select-result' | 'text-result' | 'spinner-result' | 'tool-call' | 'agent-message' | 'user-message' | 'clarifying-questions-result' | 'declined-questions' | 'received-event' | 'plan-review' | 'plan-approved' | 'plan-rejected' | 'write-key' | 'org-info';
11
11
  /**
@@ -19,9 +19,10 @@ export interface ReceivedEventData {
19
19
  userId?: string;
20
20
  input?: string;
21
21
  output?: string;
22
+ toolCallNames?: string[];
22
23
  }
23
24
  /**
24
- * A completed item that goes into the Static history
25
+ * A completed item that goes into history
25
26
  */
26
27
  export interface HistoryItem {
27
28
  id: number;
@@ -99,7 +100,7 @@ export interface AgentState {
99
100
  * Wizard state that's exposed via context
100
101
  */
101
102
  export interface WizardState {
102
- /** Completed history items (rendered in Static) */
103
+ /** Completed history items */
103
104
  history: HistoryItem[];
104
105
  /** Currently active prompt (rendered as pending) */
105
106
  pendingItem: PendingItem | null;
@@ -109,13 +110,20 @@ export interface WizardState {
109
110
  agentState: AgentState;
110
111
  /** Active spinner message (separate from pendingItem so both can be visible) */
111
112
  activeSpinner: string | null;
113
+ /** Terminal dimensions for responsive rendering */
114
+ terminalSize: {
115
+ width: number;
116
+ height: number;
117
+ };
112
118
  }
113
119
  /**
114
120
  * Actions to modify wizard state
115
121
  */
116
122
  export interface WizardActions {
117
- /** Add an item to history (like gemini-cli's addItem) */
118
- addItem: (item: HistoryItemInput) => void;
123
+ /** Add an item to history, returns the assigned item ID */
124
+ addItem: (item: HistoryItemInput) => number;
125
+ /** Update an existing history item by ID */
126
+ updateItem: (id: number, updates: Partial<HistoryItemInput>) => void;
119
127
  /** Deactivate all write-key items in history */
120
128
  deactivateWriteKeys: () => void;
121
129
  /** Display a select prompt and return the selected value */