@autonav/core 1.1.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/claude-adapter.d.ts +2 -2
- package/dist/adapter/claude-adapter.d.ts.map +1 -1
- package/dist/adapter/claude-adapter.js +34 -8
- package/dist/adapter/claude-adapter.js.map +1 -1
- package/dist/cli/autonav.js +6 -0
- package/dist/cli/autonav.js.map +1 -1
- package/dist/cli/nav-migrate.d.ts +16 -0
- package/dist/cli/nav-migrate.d.ts.map +1 -0
- package/dist/cli/nav-migrate.js +180 -0
- package/dist/cli/nav-migrate.js.map +1 -0
- package/dist/cli/nav-query.js +1 -1
- package/dist/cli/nav-query.js.map +1 -1
- package/dist/interview/App.d.ts.map +1 -1
- package/dist/interview/App.js +3 -2
- package/dist/interview/App.js.map +1 -1
- package/dist/interview/prompts.d.ts +1 -1
- package/dist/interview/prompts.d.ts.map +1 -1
- package/dist/interview/prompts.js +3 -1
- package/dist/interview/prompts.js.map +1 -1
- package/dist/interview/ui/ActivityIndicator.d.ts +23 -0
- package/dist/interview/ui/ActivityIndicator.d.ts.map +1 -0
- package/dist/interview/ui/ActivityIndicator.js +81 -0
- package/dist/interview/ui/ActivityIndicator.js.map +1 -0
- package/dist/interview/ui/Banner.d.ts +14 -0
- package/dist/interview/ui/Banner.d.ts.map +1 -0
- package/dist/interview/ui/Banner.js +23 -0
- package/dist/interview/ui/Banner.js.map +1 -0
- package/dist/interview/ui/CompletionScreen.d.ts +12 -0
- package/dist/interview/ui/CompletionScreen.d.ts.map +1 -0
- package/dist/interview/ui/CompletionScreen.js +43 -0
- package/dist/interview/ui/CompletionScreen.js.map +1 -0
- package/dist/interview/ui/Divider.d.ts +7 -0
- package/dist/interview/ui/Divider.d.ts.map +1 -0
- package/dist/interview/ui/Divider.js +15 -0
- package/dist/interview/ui/Divider.js.map +1 -0
- package/dist/interview/ui/SystemMessage.d.ts +13 -0
- package/dist/interview/ui/SystemMessage.d.ts.map +1 -0
- package/dist/interview/ui/SystemMessage.js +37 -0
- package/dist/interview/ui/SystemMessage.js.map +1 -0
- package/dist/interview/ui/UserResponse.d.ts +12 -0
- package/dist/interview/ui/UserResponse.d.ts.map +1 -0
- package/dist/interview/ui/UserResponse.js +25 -0
- package/dist/interview/ui/UserResponse.js.map +1 -0
- package/dist/interview/ui/index.d.ts +12 -0
- package/dist/interview/ui/index.d.ts.map +1 -0
- package/dist/interview/ui/index.js +12 -0
- package/dist/interview/ui/index.js.map +1 -0
- package/dist/interview/ui/test-indicator.d.ts +9 -0
- package/dist/interview/ui/test-indicator.d.ts.map +1 -0
- package/dist/interview/ui/test-indicator.js +18 -0
- package/dist/interview/ui/test-indicator.js.map +1 -0
- package/dist/interview/ui/text-utils.d.ts +12 -0
- package/dist/interview/ui/text-utils.d.ts.map +1 -0
- package/dist/interview/ui/text-utils.js +60 -0
- package/dist/interview/ui/text-utils.js.map +1 -0
- package/dist/interview/ui/theme.d.ts +90 -0
- package/dist/interview/ui/theme.d.ts.map +1 -0
- package/dist/interview/ui/theme.js +114 -0
- package/dist/interview/ui/theme.js.map +1 -0
- package/dist/migrations/index.d.ts +38 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +74 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/types.d.ts +60 -0
- package/dist/migrations/types.d.ts.map +1 -0
- package/dist/migrations/types.js +8 -0
- package/dist/migrations/types.js.map +1 -0
- package/dist/migrations/versions/v1.3.1-submit-answer.d.ts +14 -0
- package/dist/migrations/versions/v1.3.1-submit-answer.d.ts.map +1 -0
- package/dist/migrations/versions/v1.3.1-submit-answer.js +230 -0
- package/dist/migrations/versions/v1.3.1-submit-answer.js.map +1 -0
- package/dist/skill-generator/index.d.ts.map +1 -1
- package/dist/skill-generator/index.js +9 -0
- package/dist/skill-generator/index.js.map +1 -1
- package/dist/templates/CLAUDE-pack.md.template +13 -1
- package/dist/templates/CLAUDE.md.template +39 -36
- package/dist/templates/system-configuration.md.template +17 -13
- package/dist/tools/response.d.ts.map +1 -1
- package/dist/tools/response.js +6 -3
- package/dist/tools/response.js.map +1 -1
- package/package.json +3 -2
|
@@ -17,7 +17,7 @@ export declare function getInterviewSystemPrompt(packContext?: PackContext, anal
|
|
|
17
17
|
/**
|
|
18
18
|
* Legacy export for backwards compatibility
|
|
19
19
|
*/
|
|
20
|
-
export declare const INTERVIEW_SYSTEM_PROMPT = "You are helping create a new Autonav navigator - a self-organizing knowledge assistant.\n\n## Your Role\nGuide the user through understanding their needs so you can create a well-configured navigator. Ask questions naturally, one at a time. Listen carefully and ask follow-up questions when needed.\n\n## Key Topics to Explore\n\n1. **Purpose**: What is this navigator for? What problems will it solve?\n2. **Scope**: What topics should it know about? What's explicitly out of scope?\n3. **Knowledge Structure**: How should knowledge be organized? (by topic, project, chronologically, as a journal, etc.)\n4. **Knowledge Sources**: What documentation will be added? How should new knowledge be captured over time?\n5. **Audience**: Who will use this? How should it communicate? (formal, casual, technical depth)\n6. **Autonomy**: How autonomous should it be? Should it create/modify files freely, or ask first?\n\n## Philosophy\nNavs are \"self-organizing notebooks that talk back\" - they edit their own knowledge files, learn from conversations, and maintain their own context. Help the user think through how they want this self-organization to work.\n\n## Interview Flow\n\n### Phase 1: Information Gathering (Exchanges 1-4)\n- Ask ONE question at a time\n- Be conversational and helpful\n- Ask follow-up questions when answers are vague\n- Focus on understanding their needs\n\n### Phase 2: Signal Readiness (After 4-6 exchanges)\nOnce you have gathered enough information to create a basic navigator configuration, signal that you're ready by saying something like:\n\n\"I have enough information to create your navigator. Type 'done' when you're ready, or we can continue refining if you have more details to share.\"\n\n**IMPORTANT**: After signaling readiness, DO NOT generate the JSON configuration yet. Wait for the user to explicitly type 'done', 'finish', 'ready', or similar. Continue answering any additional questions they have.\n\n### Phase 3: Configuration Generation (User types 'done')\nOnly generate the configuration when the user explicitly indicates they're ready.\n\n## When Creating the Navigator\nAfter the user types 'done' (or similar), output a JSON configuration block wrapped in ```json and ``` markers.\n\n**CRITICAL**: Output ONLY the JSON block and NOTHING ELSE. Do NOT add explanatory text before or after the JSON. The JSON itself IS your final response.\n\nThe JSON must include:\n\n```json\n{\n \"purpose\": \"One-sentence description of what this navigator is for\",\n \"scope\": \"Topics in scope and explicitly out of scope\",\n \"knowledgeStructure\": \"How knowledge should be organized (by topic, chronologically, by project, etc.)\",\n \"audience\": \"Who uses this navigator and how it should communicate\",\n \"autonomy\": \"Autonomy level - can it create files freely or should it ask first\",\n \"claudeMd\": \"The complete CLAUDE.md content as a string with proper newlines (\\n)\",\n \"suggestedDirectories\": [\"optional\", \"array\", \"of\", \"subdirectories\"]\n}\n```\n\n**IMPORTANT**: After outputting the JSON block, your job is complete. Do NOT add any commentary, instructions, or ask for further confirmation. The system will automatically use this configuration to create the navigator.\n\nThe claudeMd field should be a complete, personalized CLAUDE.md file based on what you learned, including:\n- Clear purpose statement\n- Grounding rules (always cite, never invent, acknowledge uncertainty)\n- Domain-specific scope definition\n- Knowledge organization guidance\n- Response format expectations\n- Self-organization rules based on their autonomy preference\n\n## Critical Rules\n1. Ask questions conversationally until you have enough information (4-6 exchanges typically)\n2. Signal readiness explicitly but DO NOT auto-generate configuration\n3. Wait for user's explicit 'done' command before generating JSON\n4. Never simulate user responses or create multi-turn conversations alone";
|
|
20
|
+
export declare const INTERVIEW_SYSTEM_PROMPT = "You are helping create a new Autonav navigator - a self-organizing knowledge assistant.\n\n## Your Role\nGuide the user through understanding their needs so you can create a well-configured navigator. Ask questions naturally, one at a time. Listen carefully and ask follow-up questions when needed.\n\n## Key Topics to Explore\n\n1. **Purpose**: What is this navigator for? What problems will it solve?\n2. **Scope**: What topics should it know about? What's explicitly out of scope?\n3. **Knowledge Structure**: How should knowledge be organized? (by topic, project, chronologically, as a journal, etc.)\n4. **Knowledge Sources**: What documentation will be added? How should new knowledge be captured over time?\n5. **Audience**: Who will use this? How should it communicate? (formal, casual, technical depth)\n6. **Autonomy**: How autonomous should it be? Should it create/modify files freely, or ask first?\n\n## Philosophy\nNavs are \"self-organizing notebooks that talk back\" - they edit their own knowledge files, learn from conversations, and maintain their own context. Help the user think through how they want this self-organization to work.\n\n## Interview Flow\n\n### Phase 1: Information Gathering (Exchanges 1-4)\n- Ask ONE question at a time\n- Be conversational and helpful\n- Ask follow-up questions when answers are vague\n- Focus on understanding their needs\n\n### Phase 2: Signal Readiness (After 4-6 exchanges)\nOnce you have gathered enough information to create a basic navigator configuration, signal that you're ready by saying something like:\n\n\"I have enough information to create your navigator. Type 'done' when you're ready, or we can continue refining if you have more details to share.\"\n\n**IMPORTANT**: After signaling readiness, DO NOT generate the JSON configuration yet. Wait for the user to explicitly type 'done', 'finish', 'ready', or similar. Continue answering any additional questions they have.\n\n### Phase 3: Configuration Generation (User types 'done')\nOnly generate the configuration when the user explicitly indicates they're ready.\n\n## When Creating the Navigator\nAfter the user types 'done' (or similar), output a JSON configuration block wrapped in ```json and ``` markers.\n\n**CRITICAL**: Output ONLY the JSON block and NOTHING ELSE. Do NOT add explanatory text before or after the JSON. The JSON itself IS your final response.\n\nThe JSON must include:\n\n```json\n{\n \"purpose\": \"One-sentence description of what this navigator is for\",\n \"scope\": \"Topics in scope and explicitly out of scope\",\n \"knowledgeStructure\": \"How knowledge should be organized (by topic, chronologically, by project, etc.)\",\n \"audience\": \"Who uses this navigator and how it should communicate\",\n \"autonomy\": \"Autonomy level - can it create files freely or should it ask first\",\n \"claudeMd\": \"The complete CLAUDE.md content as a string with proper newlines (\\n)\",\n \"suggestedDirectories\": [\"optional\", \"array\", \"of\", \"subdirectories\"]\n}\n```\n\n**IMPORTANT**: After outputting the JSON block, your job is complete. Do NOT add any commentary, instructions, or ask for further confirmation. The system will automatically use this configuration to create the navigator.\n\nThe claudeMd field should be a complete, personalized CLAUDE.md file based on what you learned, including:\n- Clear purpose statement\n- Grounding rules (always cite, never invent, acknowledge uncertainty)\n- Domain-specific scope definition\n- Knowledge organization guidance\n- Response format expectations (MUST use submit_answer tool, NOT plain text/JSON)\n- Self-organization rules based on their autonomy preference\n\n**CRITICAL**: The CLAUDE.md MUST include a \"Response Format\" section instructing the navigator to use the submit_answer tool for all responses. Never instruct navigators to output raw JSON - they must always use the submit_answer tool with answer, sources, and confidence parameters.\n\n## Critical Rules\n1. Ask questions conversationally until you have enough information (4-6 exchanges typically)\n2. Signal readiness explicitly but DO NOT auto-generate configuration\n3. Wait for user's explicit 'done' command before generating JSON\n4. Never simulate user responses or create multi-turn conversations alone";
|
|
21
21
|
/**
|
|
22
22
|
* Type for the navigator configuration from the interview
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/interview/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/interview/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6ED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,CAAC,EAAE,WAAW,EACzB,eAAe,CAAC,EAAE,cAAc,GAC/B,MAAM,CA+DR;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,+sIAAwB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAiCzE"}
|
|
@@ -65,9 +65,11 @@ The claudeMd field should be a complete, personalized CLAUDE.md file based on wh
|
|
|
65
65
|
- Grounding rules (always cite, never invent, acknowledge uncertainty)
|
|
66
66
|
- Domain-specific scope definition
|
|
67
67
|
- Knowledge organization guidance
|
|
68
|
-
- Response format expectations
|
|
68
|
+
- Response format expectations (MUST use submit_answer tool, NOT plain text/JSON)
|
|
69
69
|
- Self-organization rules based on their autonomy preference
|
|
70
70
|
|
|
71
|
+
**CRITICAL**: The CLAUDE.md MUST include a "Response Format" section instructing the navigator to use the submit_answer tool for all responses. Never instruct navigators to output raw JSON - they must always use the submit_answer tool with answer, sources, and confidence parameters.
|
|
72
|
+
|
|
71
73
|
## Critical Rules
|
|
72
74
|
1. Ask questions conversationally until you have enough information (4-6 exchanges typically)
|
|
73
75
|
2. Signal readiness explicitly but DO NOT auto-generate configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/interview/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;GAEG;AACH,MAAM,qBAAqB,GAAG
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/interview/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;GAEG;AACH,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAsE4C,CAAC;AAE3E;;GAEG;AACH,MAAM,UAAU,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Q,CAAoB,CAAC;QAEvD,2BAA2B;QAC3B,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACzD,uCAAuC;YACvC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,GAAG,EAAE,CAAC;gBACnE,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE;oBACjD,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO;oBAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK;oBACxB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ;iBAC/B,CAAC,CAAC;YACL,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gCAAgC;QAChC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,GAAG,EAAE,CAAC;YACnE,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matrix-style animated activity indicator
|
|
3
|
+
*
|
|
4
|
+
* Displays horizontal strips with Matrix digital rain aesthetics:
|
|
5
|
+
* - Block and numeric glyphs
|
|
6
|
+
* - Brightness wave effect (bright green to dark green)
|
|
7
|
+
* - Randomly cycling characters
|
|
8
|
+
*/
|
|
9
|
+
interface ActivityIndicatorProps {
|
|
10
|
+
/** Message to display next to the indicator */
|
|
11
|
+
message?: string;
|
|
12
|
+
/** Width of the indicator in characters */
|
|
13
|
+
width?: number;
|
|
14
|
+
/** Update interval in milliseconds */
|
|
15
|
+
interval?: number;
|
|
16
|
+
/** Number of lines to display */
|
|
17
|
+
lines?: number;
|
|
18
|
+
/** Custom glyph set to use */
|
|
19
|
+
glyphSet?: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function ActivityIndicator({ message, width, interval, lines, glyphSet, }: ActivityIndicatorProps): React.ReactNode;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=ActivityIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/ActivityIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,UAAU,sBAAsB;IAC9B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAgFD,wBAAgB,iBAAiB,CAAC,EAChC,OAAuB,EACvB,KAAU,EACV,QAAa,EACb,KAAS,EACT,QAAoB,GACrB,EAAE,sBAAsB,GAAG,KAAK,CAAC,SAAS,CA6B1C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Matrix-style animated activity indicator
|
|
4
|
+
*
|
|
5
|
+
* Displays horizontal strips with Matrix digital rain aesthetics:
|
|
6
|
+
* - Block and numeric glyphs
|
|
7
|
+
* - Brightness wave effect (bright green to dark green)
|
|
8
|
+
* - Randomly cycling characters
|
|
9
|
+
*/
|
|
10
|
+
import { useState, useEffect, useRef } from "react";
|
|
11
|
+
import { Box, Text } from "ink";
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
import { matrixBrightness, colors, glyphSetE } from "./theme.js";
|
|
14
|
+
/**
|
|
15
|
+
* Get a random glyph from the set
|
|
16
|
+
*/
|
|
17
|
+
function randomGlyph(glyphSet) {
|
|
18
|
+
const index = Math.floor(Math.random() * glyphSet.length);
|
|
19
|
+
return glyphSet[index] ?? "█";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Calculate brightness based on position and time
|
|
23
|
+
*/
|
|
24
|
+
function calculateBrightness(position, tick, lineOffset) {
|
|
25
|
+
const wave = Math.sin((position + tick + lineOffset * 10) / 4);
|
|
26
|
+
return Math.floor((wave + 1) * 1.5) % 4;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create initial strip of characters
|
|
30
|
+
*/
|
|
31
|
+
function createStrip(width, glyphSet, tick, lineOffset) {
|
|
32
|
+
return Array.from({ length: width }, (_, i) => ({
|
|
33
|
+
char: randomGlyph(glyphSet),
|
|
34
|
+
brightness: calculateBrightness(i, tick, lineOffset),
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update strip: recalculate brightness wave, randomly change some characters
|
|
39
|
+
*/
|
|
40
|
+
function updateStrip(strip, tick, glyphSet, lineOffset) {
|
|
41
|
+
return strip.map((item, i) => ({
|
|
42
|
+
char: Math.random() < 0.2 ? randomGlyph(glyphSet) : item.char,
|
|
43
|
+
brightness: calculateBrightness(i, tick, lineOffset),
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
/** Chalk color functions for each brightness level */
|
|
47
|
+
const brightnessColors = [
|
|
48
|
+
chalk.rgb(matrixBrightness.bright.r, matrixBrightness.bright.g, matrixBrightness.bright.b),
|
|
49
|
+
chalk.rgb(matrixBrightness.medium.r, matrixBrightness.medium.g, matrixBrightness.medium.b),
|
|
50
|
+
chalk.rgb(matrixBrightness.dim.r, matrixBrightness.dim.g, matrixBrightness.dim.b),
|
|
51
|
+
chalk.rgb(matrixBrightness.darkest.r, matrixBrightness.darkest.g, matrixBrightness.darkest.b),
|
|
52
|
+
];
|
|
53
|
+
/** Default color function for fallback */
|
|
54
|
+
const defaultColor = brightnessColors[3];
|
|
55
|
+
/**
|
|
56
|
+
* Render a strip to a colored string
|
|
57
|
+
*/
|
|
58
|
+
function renderStrip(strip) {
|
|
59
|
+
return strip
|
|
60
|
+
.map((item) => {
|
|
61
|
+
const colorFn = brightnessColors[item.brightness] ?? defaultColor;
|
|
62
|
+
if (!colorFn) {
|
|
63
|
+
return item.char;
|
|
64
|
+
}
|
|
65
|
+
return colorFn(item.char);
|
|
66
|
+
})
|
|
67
|
+
.join("");
|
|
68
|
+
}
|
|
69
|
+
export function ActivityIndicator({ message = "thinking...", width = 40, interval = 80, lines = 3, glyphSet = glyphSetE, }) {
|
|
70
|
+
const tickRef = useRef(0);
|
|
71
|
+
const [strips, setStrips] = useState(() => Array.from({ length: lines }, (_, i) => createStrip(width, glyphSet, 0, i)));
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const timer = setInterval(() => {
|
|
74
|
+
tickRef.current += 1;
|
|
75
|
+
setStrips((prev) => prev.map((strip, lineIndex) => updateStrip(strip, tickRef.current, glyphSet, lineIndex)));
|
|
76
|
+
}, interval);
|
|
77
|
+
return () => clearInterval(timer);
|
|
78
|
+
}, [interval, glyphSet, width, lines]);
|
|
79
|
+
return (_jsx(Box, { flexDirection: "column", children: strips.map((strip, i) => (_jsxs(Box, { children: [_jsx(Text, { children: renderStrip(strip) }), i === lines - 1 && _jsxs(Text, { color: colors.dimmed, children: [" ", message] })] }, i))) }));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=ActivityIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../../../src/interview/ui/ActivityIndicator.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,M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CAAC,CACxB,MAAC,GAAG,eACF,KAAC,IAAI,cAAE,WAAW,CAAC,KAAK,CAAC,GAAQ,EAChC,CAAC,KAAK,KAAK,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,mBAAK,OAAO,IAAQ,KAF1D,CAAC,CAGL,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welcome banner with block-letter AUTONAV header
|
|
3
|
+
*
|
|
4
|
+
* Uses a fixed-width box with simple string padding for alignment.
|
|
5
|
+
*/
|
|
6
|
+
interface BannerProps {
|
|
7
|
+
/** Navigator name being created */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Version string */
|
|
10
|
+
version?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Banner({ name, version }: BannerProps): React.ReactNode;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=Banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/Banner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,UAAU,WAAW;IACnB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,OAAiB,EAAE,EAAE,WAAW,GAAG,KAAK,CAAC,SAAS,CAoChF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Welcome banner with block-letter AUTONAV header
|
|
4
|
+
*
|
|
5
|
+
* Uses a fixed-width box with simple string padding for alignment.
|
|
6
|
+
*/
|
|
7
|
+
import { Box, Text } from "ink";
|
|
8
|
+
import { colors, boxChars } from "./theme.js";
|
|
9
|
+
/** Fixed inner width for the banner box */
|
|
10
|
+
const INNER_WIDTH = 60;
|
|
11
|
+
export function Banner({ name, version = "1.2.0" }) {
|
|
12
|
+
const { double } = boxChars;
|
|
13
|
+
// Block letter AUTONAV (30 chars each)
|
|
14
|
+
const logoLine1 = " ▄▀█ █░█ ▀█▀ █▀█ █▄░█ ▄▀█ █░█";
|
|
15
|
+
const logoLine2 = " █▀█ █▄█ ░█░ █▄█ █░▀█ █▀█ ▀▄▀";
|
|
16
|
+
// Build info line with proper spacing
|
|
17
|
+
const infoLine = ` Creating: ${name}`.padEnd(INNER_WIDTH - version.length - 2) + `v${version} `;
|
|
18
|
+
const topBorder = double.topLeft + double.horizontal.repeat(INNER_WIDTH) + double.topRight;
|
|
19
|
+
const midBorder = double.leftT + double.horizontal.repeat(INNER_WIDTH) + double.rightT;
|
|
20
|
+
const bottomBorder = double.bottomLeft + double.horizontal.repeat(INNER_WIDTH) + double.bottomRight;
|
|
21
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: colors.dimmed, children: topBorder }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, _jsx(Text, { color: colors.primary, children: logoLine1.padEnd(INNER_WIDTH) }), double.vertical] }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, _jsx(Text, { color: colors.primary, children: logoLine2.padEnd(INNER_WIDTH) }), double.vertical] }), _jsx(Text, { color: colors.dimmed, children: midBorder }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, _jsx(Text, { color: "white", children: infoLine }), double.vertical] }), _jsx(Text, { color: colors.dimmed, children: bottomBorder })] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/interview/ui/Banner.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAA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AAC,QAAQ,IACX,EACP,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,aACvB,MAAM,CAAC,QAAQ,EAChB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,YAAG,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,GAAQ,EAClE,MAAM,CAAC,QAAQ,IACX,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,SAAS,GAAQ,EAC9C,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,aACvB,MAAM,CAAC,QAAQ,EAChB,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,QAAQ,GAAQ,EACpC,MAAM,CAAC,QAAQ,IACX,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,YAAY,GAAQ,IAC7C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion screen shown when navigator is successfully created
|
|
3
|
+
*
|
|
4
|
+
* Displays a success banner with the navigator location and run command.
|
|
5
|
+
*/
|
|
6
|
+
interface CompletionScreenProps {
|
|
7
|
+
/** Name of the created navigator */
|
|
8
|
+
navigatorName: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function CompletionScreen({ navigatorName }: CompletionScreenProps): React.ReactNode;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=CompletionScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompletionScreen.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/CompletionScreen.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,UAAU,qBAAqB;IAC7B,oCAAoC;IACpC,aAAa,EAAE,MAAM,CAAC;CACvB;AAoBD,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,SAAS,CAgE1F"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Completion screen shown when navigator is successfully created
|
|
4
|
+
*
|
|
5
|
+
* Displays a success banner with the navigator location and run command.
|
|
6
|
+
*/
|
|
7
|
+
import { Box, Text } from "ink";
|
|
8
|
+
import { colors, boxChars } from "./theme.js";
|
|
9
|
+
/** Fixed inner width for the completion box */
|
|
10
|
+
const INNER_WIDTH = 60;
|
|
11
|
+
/**
|
|
12
|
+
* Create an empty line within the box
|
|
13
|
+
*/
|
|
14
|
+
function emptyLine(left, right, width) {
|
|
15
|
+
return left + " ".repeat(width) + right;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a content line with proper padding
|
|
19
|
+
* Returns the total character count for the line content
|
|
20
|
+
*/
|
|
21
|
+
function paddedContent(content, width) {
|
|
22
|
+
return content.padEnd(width);
|
|
23
|
+
}
|
|
24
|
+
export function CompletionScreen({ navigatorName }) {
|
|
25
|
+
const { double } = boxChars;
|
|
26
|
+
// Block letter CREATED (31 chars each)
|
|
27
|
+
const logoLine1 = " ░█▀▀░█▀▄░█▀▀░█▀█░▀█▀░█▀▀░█▀▄";
|
|
28
|
+
const logoLine2 = " ░█░░░█▀▄░█▀▀░█▀█░░█░░█▀▀░█░█";
|
|
29
|
+
const logoLine3 = " ░▀▀▀░▀░▀░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀░";
|
|
30
|
+
// Build info lines
|
|
31
|
+
const locationPath = `./${navigatorName}`;
|
|
32
|
+
const runCommand = `autonav chat ${navigatorName}`;
|
|
33
|
+
// Calculate padding for aligned labels
|
|
34
|
+
// " Location ./{name}"
|
|
35
|
+
// " Run autonav chat {name}"
|
|
36
|
+
const locationContent = ` Location ${locationPath}`;
|
|
37
|
+
const runContent = ` Run ${runCommand}`;
|
|
38
|
+
const topBorder = double.topLeft + double.horizontal.repeat(INNER_WIDTH) + double.topRight;
|
|
39
|
+
const bottomBorder = double.bottomLeft + double.horizontal.repeat(INNER_WIDTH) + double.bottomRight;
|
|
40
|
+
const empty = emptyLine(double.vertical, double.vertical, INNER_WIDTH);
|
|
41
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colors.dimmed, children: topBorder }), _jsx(Text, { color: colors.dimmed, children: empty }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, _jsx(Text, { color: colors.primary, children: paddedContent(logoLine1, INNER_WIDTH) }), double.vertical] }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, _jsx(Text, { color: colors.primary, children: paddedContent(logoLine2, INNER_WIDTH) }), double.vertical] }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, _jsx(Text, { color: colors.primary, children: paddedContent(logoLine3, INNER_WIDTH) }), double.vertical] }), _jsx(Text, { color: colors.dimmed, children: empty }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, " ", _jsx(Text, { color: colors.accent, children: "Location" }), " ", _jsx(Text, { color: "white", children: locationPath }), " ".repeat(Math.max(0, INNER_WIDTH - locationContent.length)), double.vertical] }), _jsxs(Text, { color: colors.dimmed, children: [double.vertical, " ", _jsx(Text, { color: colors.accent, children: "Run" }), " ", _jsx(Text, { color: "white", children: runCommand }), " ".repeat(Math.max(0, INNER_WIDTH - runContent.length)), double.vertical] }), _jsx(Text, { color: colors.dimmed, children: empty }), _jsx(Text, { color: colors.dimmed, children: bottomBorder })] }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=CompletionScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompletionScreen.js","sourceRoot":"","sources":["../../../src/interview/ui/CompletionScreen.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO9C,+CAA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MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,aACvB,MAAM,CAAC,QAAQ,EACf,IAAI,EACL,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,oBAAY,EACrC,UAAU,EACX,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,UAAU,GAAQ,EACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EACxD,MAAM,CAAC,QAAQ,IACX,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,KAAK,GAAQ,EAC1C,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,YAAY,GAAQ,IAC7C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/Divider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,wBAAgB,OAAO,IAAI,KAAK,CAAC,SAAS,CAQzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Visual divider between conversation turns
|
|
4
|
+
*
|
|
5
|
+
* Uses the lightest glitch block for a subtle separator.
|
|
6
|
+
*/
|
|
7
|
+
import { Box, Text } from "ink";
|
|
8
|
+
import { colors, glitchBlocks } from "./theme.js";
|
|
9
|
+
/** Width of the divider line */
|
|
10
|
+
const DIVIDER_WIDTH = 60;
|
|
11
|
+
export function Divider() {
|
|
12
|
+
const dividerLine = glitchBlocks[0].repeat(DIVIDER_WIDTH);
|
|
13
|
+
return (_jsx(Box, { flexDirection: "column", marginY: 1, children: _jsx(Text, { color: colors.dimmed, children: dividerLine }) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../src/interview/ui/Divider.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAElD,gCAAgC;AAChC,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,UAAU,OAAO;IACrB,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAE1D,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,YACpC,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,WAAW,GAAQ,GAC5C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System/assistant message display with glitch-corner borders
|
|
3
|
+
*
|
|
4
|
+
* Uses single-line box characters with decorative glitch blocks at corners.
|
|
5
|
+
* The glitch effect is achieved by replacing part of the horizontal border.
|
|
6
|
+
*/
|
|
7
|
+
interface SystemMessageProps {
|
|
8
|
+
/** Message content to display */
|
|
9
|
+
content: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function SystemMessage({ content }: SystemMessageProps): React.ReactNode;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=SystemMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemMessage.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/SystemMessage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,UAAU,kBAAkB;IAC1B,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAuC9E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* System/assistant message display with glitch-corner borders
|
|
4
|
+
*
|
|
5
|
+
* Uses single-line box characters with decorative glitch blocks at corners.
|
|
6
|
+
* The glitch effect is achieved by replacing part of the horizontal border.
|
|
7
|
+
*/
|
|
8
|
+
import { Box, Text } from "ink";
|
|
9
|
+
import { colors, boxChars, glitchBlocks } from "./theme.js";
|
|
10
|
+
import { wrapText } from "./text-utils.js";
|
|
11
|
+
/** Maximum content width (will wrap text to fit) */
|
|
12
|
+
const MAX_WIDTH = 76;
|
|
13
|
+
/** Number of glitch characters to show at corners */
|
|
14
|
+
const GLITCH_COUNT = 3;
|
|
15
|
+
export function SystemMessage({ content }) {
|
|
16
|
+
const { single } = boxChars;
|
|
17
|
+
const glitch = glitchBlocks[3]; // Solid block for corners
|
|
18
|
+
// Wrap text to fit within max width
|
|
19
|
+
const lines = wrapText(content, MAX_WIDTH);
|
|
20
|
+
const contentWidth = MAX_WIDTH;
|
|
21
|
+
// Total inner width includes 1 space padding on each side
|
|
22
|
+
const innerWidth = contentWidth + 2;
|
|
23
|
+
// Build borders - glitch replaces part of the horizontal line, not added to it
|
|
24
|
+
// Top: corner + (horizontal - glitch) + glitch + corner
|
|
25
|
+
// Bottom: corner + glitch + (horizontal - glitch) + corner
|
|
26
|
+
const horizontalLength = innerWidth - GLITCH_COUNT;
|
|
27
|
+
const topBorder = single.topLeft +
|
|
28
|
+
single.horizontal.repeat(horizontalLength) +
|
|
29
|
+
glitch.repeat(GLITCH_COUNT) +
|
|
30
|
+
single.topRight;
|
|
31
|
+
const bottomBorder = single.bottomLeft +
|
|
32
|
+
glitch.repeat(GLITCH_COUNT) +
|
|
33
|
+
single.horizontal.repeat(horizontalLength) +
|
|
34
|
+
single.bottomRight;
|
|
35
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: colors.dimmed, children: topBorder }), lines.map((line, i) => (_jsxs(Text, { color: colors.dimmed, children: [single.vertical + " ", _jsx(Text, { color: "white", children: line.padEnd(contentWidth) }), " " + single.vertical] }, i))), _jsx(Text, { color: colors.dimmed, children: bottomBorder })] }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=SystemMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemMessage.js","sourceRoot":"","sources":["../../../src/interview/ui/SystemMessage.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAO3C,oDAAoD;AACpD,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,qDAAqD;AACrD,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,UAAU,aAAa,CAAC,EAAE,OAAO,EAAsB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAC5B,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B;IAE1D,oCAAoC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3C,MAAM,YAAY,GAAG,SAAS,CAAC;IAE/B,0DAA0D;IAC1D,MAAM,UAAU,GAAG,YAAY,GAAG,CAAC,CAAC;IAEpC,+EAA+E;IAC/E,wDAAwD;IACxD,2DAA2D;IAC3D,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,CAAC;IACnD,MAAM,SAAS,GACb,MAAM,CAAC,OAAO;QACd,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;QAC3B,MAAM,CAAC,QAAQ,CAAC;IAClB,MAAM,YAAY,GAChB,MAAM,CAAC,UAAU;QACjB,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;QAC3B,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC1C,MAAM,CAAC,WAAW,CAAC;IAErB,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,SAAS,GAAQ,EAC7C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,IAAI,IAAS,KAAK,EAAE,MAAM,CAAC,MAAM,aAC/B,MAAM,CAAC,QAAQ,GAAG,GAAG,EACtB,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAQ,EACrD,GAAG,GAAG,MAAM,CAAC,QAAQ,KAHb,CAAC,CAIL,CACR,CAAC,EACF,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,YAAY,GAAQ,IAC7C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User response display with rounded borders
|
|
3
|
+
*
|
|
4
|
+
* Shows user input with a prompt indicator and rounded box styling.
|
|
5
|
+
*/
|
|
6
|
+
interface UserResponseProps {
|
|
7
|
+
/** User's response text */
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function UserResponse({ content }: UserResponseProps): React.ReactNode;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=UserResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserResponse.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/UserResponse.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,UAAU,iBAAiB;IACzB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,KAAK,CAAC,SAAS,CA6B5E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* User response display with rounded borders
|
|
4
|
+
*
|
|
5
|
+
* Shows user input with a prompt indicator and rounded box styling.
|
|
6
|
+
*/
|
|
7
|
+
import { Box, Text } from "ink";
|
|
8
|
+
import { colors, boxChars } from "./theme.js";
|
|
9
|
+
import { wrapText } from "./text-utils.js";
|
|
10
|
+
/** Maximum content width (will wrap text to fit) */
|
|
11
|
+
const MAX_WIDTH = 76;
|
|
12
|
+
/** Prompt indicator shown before user text */
|
|
13
|
+
const PROMPT = "▸ ";
|
|
14
|
+
export function UserResponse({ content }) {
|
|
15
|
+
const { rounded } = boxChars;
|
|
16
|
+
// Wrap text to fit within max width (accounting for prompt on first line)
|
|
17
|
+
const lines = wrapText(content, MAX_WIDTH - PROMPT.length);
|
|
18
|
+
const contentWidth = MAX_WIDTH;
|
|
19
|
+
// Inner width includes 1 space padding on each side
|
|
20
|
+
const innerWidth = contentWidth + 2;
|
|
21
|
+
const topBorder = rounded.topLeft + rounded.horizontal.repeat(innerWidth) + rounded.topRight;
|
|
22
|
+
const bottomBorder = rounded.bottomLeft + rounded.horizontal.repeat(innerWidth) + rounded.bottomRight;
|
|
23
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: colors.dimmed, children: topBorder }), lines.map((line, i) => (_jsxs(Text, { color: colors.dimmed, children: [rounded.vertical + " ", i === 0 && _jsx(Text, { color: colors.primary, children: PROMPT }), _jsx(Text, { color: "white", children: i === 0 ? line.padEnd(contentWidth - PROMPT.length) : line.padEnd(contentWidth) }), " " + rounded.vertical] }, i))), _jsx(Text, { color: colors.dimmed, children: bottomBorder })] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=UserResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserResponse.js","sourceRoot":"","sources":["../../../src/interview/ui/UserResponse.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAO3C,oDAAoD;AACpD,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,8CAA8C;AAC9C,MAAM,MAAM,GAAG,IAAI,CAAC;AAEpB,MAAM,UAAU,YAAY,CAAC,EAAE,OAAO,EAAqB;IACzD,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;IAE7B,0EAA0E;IAC1E,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,SAAS,CAAC;IAE/B,oDAAoD;IACpD,MAAM,UAAU,GAAG,YAAY,GAAG,CAAC,CAAC;IAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;IAC7F,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAEtG,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,SAAS,GAAQ,EAC7C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,IAAI,IAAS,KAAK,EAAE,MAAM,CAAC,MAAM,aAC/B,OAAO,CAAC,QAAQ,GAAG,GAAG,EACtB,CAAC,KAAK,CAAC,IAAI,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,YAAG,MAAM,GAAQ,EACxD,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAChB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAC3E,EACN,GAAG,GAAG,OAAO,CAAC,QAAQ,KANd,CAAC,CAOL,CACR,CAAC,EACF,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,YAAY,GAAQ,IAC7C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI components for interview TUI
|
|
3
|
+
*/
|
|
4
|
+
export { ActivityIndicator } from "./ActivityIndicator.js";
|
|
5
|
+
export { Banner } from "./Banner.js";
|
|
6
|
+
export { SystemMessage } from "./SystemMessage.js";
|
|
7
|
+
export { UserResponse } from "./UserResponse.js";
|
|
8
|
+
export { Divider } from "./Divider.js";
|
|
9
|
+
export { CompletionScreen } from "./CompletionScreen.js";
|
|
10
|
+
export * from "./theme.js";
|
|
11
|
+
export * from "./text-utils.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI components for interview TUI
|
|
3
|
+
*/
|
|
4
|
+
export { ActivityIndicator } from "./ActivityIndicator.js";
|
|
5
|
+
export { Banner } from "./Banner.js";
|
|
6
|
+
export { SystemMessage } from "./SystemMessage.js";
|
|
7
|
+
export { UserResponse } from "./UserResponse.js";
|
|
8
|
+
export { Divider } from "./Divider.js";
|
|
9
|
+
export { CompletionScreen } from "./CompletionScreen.js";
|
|
10
|
+
export * from "./theme.js";
|
|
11
|
+
export * from "./text-utils.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interview/ui/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-indicator.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/test-indicator.tsx"],"names":[],"mappings":";AACA;;;;;GAKG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Test script for Matrix-style ActivityIndicator
|
|
5
|
+
*
|
|
6
|
+
* Shows all combinations of glyph sets and line counts
|
|
7
|
+
* Run with: npm run test:indicator
|
|
8
|
+
*/
|
|
9
|
+
import { createElement } from "react";
|
|
10
|
+
import { render, Box, Text } from "ink";
|
|
11
|
+
import chalk from "chalk";
|
|
12
|
+
import { ActivityIndicator } from "./ActivityIndicator.js";
|
|
13
|
+
import { glyphSetA, glyphSetB, glyphSetC, glyphSetD, glyphSetE } from "./theme.js";
|
|
14
|
+
function TestApp() {
|
|
15
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: chalk.rgb(0, 255, 70)("▓▒░ MATRIX ACTIVITY INDICATOR TEST ░▒▓") }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "gray", children: "Compare glyph sets (A-E) and line counts (1-3). Press Ctrl+C to exit." }) }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "A. Classic Mix (Letters + Numbers + Symbols + Blocks)" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "A1. Single line" }) }), _jsx(ActivityIndicator, { message: "thinking...", width: 50, lines: 1, glyphSet: glyphSetA }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "A2. Two lines" }) }), _jsx(ActivityIndicator, { message: "processing...", width: 50, lines: 2, glyphSet: glyphSetA }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "A3. Three lines" }) }), _jsx(ActivityIndicator, { message: "analyzing...", width: 50, lines: 3, glyphSet: glyphSetA }), _jsx(Box, { marginTop: 2, marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "B. Block Heavy (Mostly blocks + symbols)" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "B1. Single line" }) }), _jsx(ActivityIndicator, { message: "thinking...", width: 50, lines: 1, glyphSet: glyphSetB }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "B2. Two lines" }) }), _jsx(ActivityIndicator, { message: "processing...", width: 50, lines: 2, glyphSet: glyphSetB }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "B3. Three lines" }) }), _jsx(ActivityIndicator, { message: "analyzing...", width: 50, lines: 3, glyphSet: glyphSetB }), _jsx(Box, { marginTop: 2, marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "C. Digital (Numbers + Symbols)" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "C1. Single line" }) }), _jsx(ActivityIndicator, { message: "thinking...", width: 50, lines: 1, glyphSet: glyphSetC }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "C2. Two lines" }) }), _jsx(ActivityIndicator, { message: "processing...", width: 50, lines: 2, glyphSet: glyphSetC }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "C3. Three lines" }) }), _jsx(ActivityIndicator, { message: "analyzing...", width: 50, lines: 3, glyphSet: glyphSetC }), _jsx(Box, { marginTop: 2, marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "D. Geometric (Box drawing + blocks)" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "D1. Single line" }) }), _jsx(ActivityIndicator, { message: "thinking...", width: 50, lines: 1, glyphSet: glyphSetD }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "D2. Two lines" }) }), _jsx(ActivityIndicator, { message: "processing...", width: 50, lines: 2, glyphSet: glyphSetD }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "D3. Three lines" }) }), _jsx(ActivityIndicator, { message: "analyzing...", width: 50, lines: 3, glyphSet: glyphSetD }), _jsx(Box, { marginTop: 2, marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "E. Minimal (Blocks + Numbers only)" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "E1. Single line" }) }), _jsx(ActivityIndicator, { message: "thinking...", width: 50, lines: 1, glyphSet: glyphSetE }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "E2. Two lines" }) }), _jsx(ActivityIndicator, { message: "processing...", width: 50, lines: 2, glyphSet: glyphSetE }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: "green", children: "E3. Three lines" }) }), _jsx(ActivityIndicator, { message: "analyzing...", width: 50, lines: 3, glyphSet: glyphSetE })] }));
|
|
16
|
+
}
|
|
17
|
+
render(createElement(TestApp));
|
|
18
|
+
//# sourceMappingURL=test-indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-indicator.js","sourceRoot":"","sources":["../../../src/interview/ui/test-indicator.tsx"],"names":[],"mappings":";;AACA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnF,SAAS,OAAO;IACd,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC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AC,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,YAChC,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,mDAA0C,GAC7D,EACN,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,gCAAuB,GACtC,EACN,KAAC,iBAAiB,IAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAI,EACrF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,YAChC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,8BAAqB,GACpC,EACN,KAAC,iBAAiB,IAAC,OAAO,EAAC,eAAe,EAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAI,EACvF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,YAChC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,gCAAuB,GACtC,EACN,KAAC,iBAAiB,IAAC,OAAO,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAI,IAClF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text utility functions for UI components
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Wrap text to fit within a maximum width, breaking at word boundaries
|
|
6
|
+
*
|
|
7
|
+
* @param text - Text to wrap
|
|
8
|
+
* @param maxWidth - Maximum width per line
|
|
9
|
+
* @returns Array of wrapped lines
|
|
10
|
+
*/
|
|
11
|
+
export declare function wrapText(text: string, maxWidth: number): string[];
|
|
12
|
+
//# sourceMappingURL=text-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-utils.d.ts","sourceRoot":"","sources":["../../../src/interview/ui/text-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAwDjE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text utility functions for UI components
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Wrap text to fit within a maximum width, breaking at word boundaries
|
|
6
|
+
*
|
|
7
|
+
* @param text - Text to wrap
|
|
8
|
+
* @param maxWidth - Maximum width per line
|
|
9
|
+
* @returns Array of wrapped lines
|
|
10
|
+
*/
|
|
11
|
+
export function wrapText(text, maxWidth) {
|
|
12
|
+
const lines = [];
|
|
13
|
+
// Split by existing newlines first
|
|
14
|
+
const paragraphs = text.split('\n');
|
|
15
|
+
for (const paragraph of paragraphs) {
|
|
16
|
+
if (paragraph.length === 0) {
|
|
17
|
+
lines.push('');
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (paragraph.length <= maxWidth) {
|
|
21
|
+
lines.push(paragraph);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
// Need to wrap this paragraph
|
|
25
|
+
const words = paragraph.split(' ');
|
|
26
|
+
let currentLine = '';
|
|
27
|
+
for (const word of words) {
|
|
28
|
+
// If word itself is longer than maxWidth, we have to break it
|
|
29
|
+
if (word.length > maxWidth) {
|
|
30
|
+
if (currentLine) {
|
|
31
|
+
lines.push(currentLine.trim());
|
|
32
|
+
currentLine = '';
|
|
33
|
+
}
|
|
34
|
+
// Break the long word into chunks
|
|
35
|
+
for (let i = 0; i < word.length; i += maxWidth) {
|
|
36
|
+
lines.push(word.slice(i, i + maxWidth));
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// Try adding word to current line
|
|
41
|
+
const testLine = currentLine ? `${currentLine} ${word}` : word;
|
|
42
|
+
if (testLine.length <= maxWidth) {
|
|
43
|
+
currentLine = testLine;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// Current line is full, start new line
|
|
47
|
+
if (currentLine) {
|
|
48
|
+
lines.push(currentLine);
|
|
49
|
+
}
|
|
50
|
+
currentLine = word;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Add remaining text
|
|
54
|
+
if (currentLine) {
|
|
55
|
+
lines.push(currentLine);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return lines;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=text-utils.js.map
|