micro-models-agent 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +436 -436
- package/dist/agent/loop.d.ts +5 -5
- package/dist/agent/loop.d.ts.map +1 -1
- package/dist/agent/loop.js +421 -246
- package/dist/agent/loop.js.map +1 -1
- package/dist/agent/system-prompt.d.ts +3 -3
- package/dist/agent/system-prompt.d.ts.map +1 -1
- package/dist/agent/system-prompt.js +383 -278
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/cli/config.d.ts +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +53 -28
- package/dist/cli/config.js.map +1 -1
- package/dist/config/config.d.ts +2 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +75 -54
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +3 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/plugins/builtin/lint-on-write/index.ts +96 -96
- package/dist/plugins/builtin/notify/index.js +6 -6
- package/dist/plugins/builtin/notify/index.ts +104 -104
- package/dist/setup-wizard.d.ts +1 -1
- package/dist/setup-wizard.d.ts.map +1 -1
- package/dist/setup-wizard.js +137 -105
- package/dist/setup-wizard.js.map +1 -1
- package/dist/skills/builtin/agent-test/SKILL.md +68 -68
- package/dist/skills/builtin/grill-me/SKILL.md +46 -46
- package/dist/skills/builtin/web-scraping/SKILL.md +422 -422
- package/dist/tools/native/project-map.d.ts +2 -2
- package/dist/tools/native/project-map.d.ts.map +1 -1
- package/dist/tools/native/project-map.js +85 -57
- package/dist/tools/native/project-map.js.map +1 -1
- package/dist/tools/native/scaffold.js +113 -113
- package/dist/tools/web-browse.js +7 -7
- package/dist/ui/ink/components/App.d.ts +0 -1
- package/dist/ui/ink/components/App.d.ts.map +1 -1
- package/dist/ui/ink/components/App.js +2 -8
- package/dist/ui/ink/components/App.js.map +1 -1
- package/dist/ui/ink/components/Conversation.d.ts +1 -2
- package/dist/ui/ink/components/Conversation.d.ts.map +1 -1
- package/dist/ui/ink/components/Conversation.js +8 -2
- package/dist/ui/ink/components/Conversation.js.map +1 -1
- package/dist/ui/ink/components/MessageBlock.d.ts +13 -1
- package/dist/ui/ink/components/MessageBlock.d.ts.map +1 -1
- package/dist/ui/ink/components/MessageBlock.js +15 -27
- package/dist/ui/ink/components/MessageBlock.js.map +1 -1
- package/dist/ui/ink/components/PromptInput.d.ts +11 -0
- package/dist/ui/ink/components/PromptInput.d.ts.map +1 -1
- package/dist/ui/ink/components/PromptInput.js +18 -141
- package/dist/ui/ink/components/PromptInput.js.map +1 -1
- package/dist/ui/ink/components/SelectInput.d.ts.map +1 -1
- package/dist/ui/ink/components/SelectInput.js +3 -2
- package/dist/ui/ink/components/SelectInput.js.map +1 -1
- package/dist/ui/ink/components/StatusBar.d.ts.map +1 -1
- package/dist/ui/ink/components/StatusBar.js +14 -6
- package/dist/ui/ink/components/StatusBar.js.map +1 -1
- package/dist/ui/ink/components/StreamBlock.d.ts.map +1 -1
- package/dist/ui/ink/components/StreamBlock.js +3 -3
- package/dist/ui/ink/components/StreamBlock.js.map +1 -1
- package/dist/ui/ink/components/Tags.d.ts +8 -11
- package/dist/ui/ink/components/Tags.d.ts.map +1 -1
- package/dist/ui/ink/components/Tags.js +4 -16
- package/dist/ui/ink/components/Tags.js.map +1 -1
- package/dist/ui/ink/components/ToolCallBlock.d.ts +12 -0
- package/dist/ui/ink/components/ToolCallBlock.d.ts.map +1 -1
- package/dist/ui/ink/components/ToolCallBlock.js +8 -24
- package/dist/ui/ink/components/ToolCallBlock.js.map +1 -1
- package/dist/ui/ink/renderer.d.ts +0 -1
- package/dist/ui/ink/renderer.d.ts.map +1 -1
- package/dist/ui/ink/renderer.js +1 -4
- package/dist/ui/ink/renderer.js.map +1 -1
- package/package.json +47 -47
- package/dist/async-map.d.ts +0 -6
- package/dist/async-map.d.ts.map +0 -1
- package/dist/async-map.js +0 -16
- package/dist/async-map.js.map +0 -1
- package/dist/blog-api/types/index.d.ts +0 -2
- package/dist/blog-api/types/index.d.ts.map +0 -1
- package/dist/blog-api/types/index.js +0 -2
- package/dist/blog-api/types/index.js.map +0 -1
- package/dist/examples.d.ts +0 -22
- package/dist/examples.d.ts.map +0 -1
- package/dist/examples.js +0 -45
- package/dist/examples.js.map +0 -1
- package/dist/fibonacci.d.ts +0 -19
- package/dist/fibonacci.d.ts.map +0 -1
- package/dist/fibonacci.js +0 -61
- package/dist/fibonacci.js.map +0 -1
- package/dist/parfymerie-landing/src/App.d.ts +0 -4
- package/dist/parfymerie-landing/src/App.d.ts.map +0 -1
- package/dist/parfymerie-landing/src/App.js +0 -12
- package/dist/parfymerie-landing/src/App.js.map +0 -1
- package/dist/parfymerie-landing/src/main.d.ts +0 -2
- package/dist/parfymerie-landing/src/main.d.ts.map +0 -1
- package/dist/parfymerie-landing/src/main.js +0 -7
- package/dist/parfymerie-landing/src/main.js.map +0 -1
- package/dist/parfymerie-landing/vite.config.d.ts +0 -3
- package/dist/parfymerie-landing/vite.config.d.ts.map +0 -1
- package/dist/parfymerie-landing/vite.config.js +0 -7
- package/dist/parfymerie-landing/vite.config.js.map +0 -1
- package/dist/repl.d.ts +0 -5
- package/dist/repl.d.ts.map +0 -1
- package/dist/repl.js +0 -472
- package/dist/repl.js.map +0 -1
- package/dist/sort.d.ts +0 -8
- package/dist/sort.d.ts.map +0 -1
- package/dist/sort.js +0 -36
- package/dist/sort.js.map +0 -1
- package/dist/stack.d.ts +0 -9
- package/dist/stack.d.ts.map +0 -1
- package/dist/stack.js +0 -22
- package/dist/stack.js.map +0 -1
- package/dist/test-run.d.ts +0 -2
- package/dist/test-run.d.ts.map +0 -1
- package/dist/test-run.js +0 -13
- package/dist/test-run.js.map +0 -1
- package/dist/ui/components/diff-view.d.ts +0 -8
- package/dist/ui/components/diff-view.d.ts.map +0 -1
- package/dist/ui/components/diff-view.js +0 -25
- package/dist/ui/components/diff-view.js.map +0 -1
- package/dist/ui/double-press.d.ts +0 -9
- package/dist/ui/double-press.d.ts.map +0 -1
- package/dist/ui/double-press.js +0 -18
- package/dist/ui/double-press.js.map +0 -1
- package/dist/ui/ink/components/ActivityLog.d.ts +0 -12
- package/dist/ui/ink/components/ActivityLog.d.ts.map +0 -1
- package/dist/ui/ink/components/ActivityLog.js +0 -11
- package/dist/ui/ink/components/ActivityLog.js.map +0 -1
- package/dist/ui/ink/components/AgentStatus.d.ts +0 -13
- package/dist/ui/ink/components/AgentStatus.d.ts.map +0 -1
- package/dist/ui/ink/components/AgentStatus.js +0 -20
- package/dist/ui/ink/components/AgentStatus.js.map +0 -1
- package/dist/ui/ink/components/BottomBar.d.ts +0 -12
- package/dist/ui/ink/components/BottomBar.d.ts.map +0 -1
- package/dist/ui/ink/components/BottomBar.js +0 -22
- package/dist/ui/ink/components/BottomBar.js.map +0 -1
- package/dist/ui/ink/components/CheckboxInput.d.ts +0 -21
- package/dist/ui/ink/components/CheckboxInput.d.ts.map +0 -1
- package/dist/ui/ink/components/CheckboxInput.js +0 -36
- package/dist/ui/ink/components/CheckboxInput.js.map +0 -1
- package/dist/ui/ink/components/InputBox.d.ts +0 -25
- package/dist/ui/ink/components/InputBox.d.ts.map +0 -1
- package/dist/ui/ink/components/InputBox.js +0 -91
- package/dist/ui/ink/components/InputBox.js.map +0 -1
- package/dist/ui/ink/components/ModeSelector.d.ts +0 -8
- package/dist/ui/ink/components/ModeSelector.d.ts.map +0 -1
- package/dist/ui/ink/components/ModeSelector.js +0 -13
- package/dist/ui/ink/components/ModeSelector.js.map +0 -1
- package/dist/ui/ink/components/QuestionBox.d.ts +0 -14
- package/dist/ui/ink/components/QuestionBox.d.ts.map +0 -1
- package/dist/ui/ink/components/QuestionBox.js +0 -35
- package/dist/ui/ink/components/QuestionBox.js.map +0 -1
- package/dist/ui/ink/components/RadioInput.d.ts +0 -17
- package/dist/ui/ink/components/RadioInput.d.ts.map +0 -1
- package/dist/ui/ink/components/RadioInput.js +0 -30
- package/dist/ui/ink/components/RadioInput.js.map +0 -1
- package/dist/ui/ink/components/SliderInput.d.ts +0 -20
- package/dist/ui/ink/components/SliderInput.d.ts.map +0 -1
- package/dist/ui/ink/components/SliderInput.js +0 -40
- package/dist/ui/ink/components/SliderInput.js.map +0 -1
- package/dist/ui/ink/components/StartupScreen.d.ts +0 -19
- package/dist/ui/ink/components/StartupScreen.d.ts.map +0 -1
- package/dist/ui/ink/components/StartupScreen.js +0 -9
- package/dist/ui/ink/components/StartupScreen.js.map +0 -1
- package/dist/ui/ink/components/WelcomeScreen.d.ts +0 -10
- package/dist/ui/ink/components/WelcomeScreen.d.ts.map +0 -1
- package/dist/ui/ink/components/WelcomeScreen.js +0 -8
- package/dist/ui/ink/components/WelcomeScreen.js.map +0 -1
- package/dist/ui/ink/components/Window.d.ts +0 -30
- package/dist/ui/ink/components/Window.d.ts.map +0 -1
- package/dist/ui/ink/components/Window.js +0 -9
- package/dist/ui/ink/components/Window.js.map +0 -1
- package/dist/ui/ink/components/ui/_core.d.ts +0 -113
- package/dist/ui/ink/components/ui/_core.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/_core.js +0 -83
- package/dist/ui/ink/components/ui/_core.js.map +0 -1
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.d.ts +0 -23
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.js +0 -56
- package/dist/ui/ink/components/ui/autocomplete/Autocomplete.js.map +0 -1
- package/dist/ui/ink/components/ui/autocomplete/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/autocomplete/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/autocomplete/index.js +0 -2
- package/dist/ui/ink/components/ui/autocomplete/index.js.map +0 -1
- package/dist/ui/ink/components/ui/badge/Badge.d.ts +0 -13
- package/dist/ui/ink/components/ui/badge/Badge.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/badge/Badge.js +0 -17
- package/dist/ui/ink/components/ui/badge/Badge.js.map +0 -1
- package/dist/ui/ink/components/ui/badge/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/badge/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/badge/index.js +0 -2
- package/dist/ui/ink/components/ui/badge/index.js.map +0 -1
- package/dist/ui/ink/components/ui/divider/Divider.d.ts +0 -12
- package/dist/ui/ink/components/ui/divider/Divider.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/divider/Divider.js +0 -27
- package/dist/ui/ink/components/ui/divider/Divider.js.map +0 -1
- package/dist/ui/ink/components/ui/divider/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/divider/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/divider/index.js +0 -2
- package/dist/ui/ink/components/ui/divider/index.js.map +0 -1
- package/dist/ui/ink/components/ui/header/Header.d.ts +0 -13
- package/dist/ui/ink/components/ui/header/Header.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/header/Header.js +0 -33
- package/dist/ui/ink/components/ui/header/Header.js.map +0 -1
- package/dist/ui/ink/components/ui/header/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/header/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/header/index.js +0 -2
- package/dist/ui/ink/components/ui/header/index.js.map +0 -1
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.d.ts +0 -14
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.js +0 -144
- package/dist/ui/ink/components/ui/json-viewer/JSONViewer.js.map +0 -1
- package/dist/ui/ink/components/ui/json-viewer/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/json-viewer/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/json-viewer/index.js +0 -2
- package/dist/ui/ink/components/ui/json-viewer/index.js.map +0 -1
- package/dist/ui/ink/components/ui/key-hint/KeyHint.d.ts +0 -14
- package/dist/ui/ink/components/ui/key-hint/KeyHint.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/key-hint/KeyHint.js +0 -5
- package/dist/ui/ink/components/ui/key-hint/KeyHint.js.map +0 -1
- package/dist/ui/ink/components/ui/key-hint/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/key-hint/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/key-hint/index.js +0 -2
- package/dist/ui/ink/components/ui/key-hint/index.js.map +0 -1
- package/dist/ui/ink/components/ui/markdown/Markdown.d.ts +0 -11
- package/dist/ui/ink/components/ui/markdown/Markdown.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/markdown/Markdown.js +0 -129
- package/dist/ui/ink/components/ui/markdown/Markdown.js.map +0 -1
- package/dist/ui/ink/components/ui/markdown/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/markdown/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/markdown/index.js +0 -2
- package/dist/ui/ink/components/ui/markdown/index.js.map +0 -1
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.d.ts +0 -21
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.js +0 -42
- package/dist/ui/ink/components/ui/scroll-area/ScrollArea.js.map +0 -1
- package/dist/ui/ink/components/ui/scroll-area/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/scroll-area/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/scroll-area/index.js +0 -2
- package/dist/ui/ink/components/ui/scroll-area/index.js.map +0 -1
- package/dist/ui/ink/components/ui/select/Select.d.ts +0 -19
- package/dist/ui/ink/components/ui/select/Select.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/select/Select.js +0 -73
- package/dist/ui/ink/components/ui/select/Select.js.map +0 -1
- package/dist/ui/ink/components/ui/select/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/select/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/select/index.js +0 -2
- package/dist/ui/ink/components/ui/select/index.js.map +0 -1
- package/dist/ui/ink/components/ui/spinner/Spinner.d.ts +0 -14
- package/dist/ui/ink/components/ui/spinner/Spinner.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/spinner/Spinner.js +0 -16
- package/dist/ui/ink/components/ui/spinner/Spinner.js.map +0 -1
- package/dist/ui/ink/components/ui/spinner/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/spinner/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/spinner/index.js +0 -2
- package/dist/ui/ink/components/ui/spinner/index.js.map +0 -1
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.d.ts +0 -12
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.js +0 -39
- package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.js.map +0 -1
- package/dist/ui/ink/components/ui/status-indicator/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/status-indicator/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/status-indicator/index.js +0 -2
- package/dist/ui/ink/components/ui/status-indicator/index.js.map +0 -1
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.d.ts +0 -13
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.js +0 -22
- package/dist/ui/ink/components/ui/streaming-text/StreamingText.js.map +0 -1
- package/dist/ui/ink/components/ui/streaming-text/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/streaming-text/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/streaming-text/index.js +0 -2
- package/dist/ui/ink/components/ui/streaming-text/index.js.map +0 -1
- package/dist/ui/ink/components/ui/tabs/Tabs.d.ts +0 -20
- package/dist/ui/ink/components/ui/tabs/Tabs.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/tabs/Tabs.js +0 -53
- package/dist/ui/ink/components/ui/tabs/Tabs.js.map +0 -1
- package/dist/ui/ink/components/ui/tabs/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/tabs/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/tabs/index.js +0 -2
- package/dist/ui/ink/components/ui/tabs/index.js.map +0 -1
- package/dist/ui/ink/components/ui/text-input/TextInput.d.ts +0 -22
- package/dist/ui/ink/components/ui/text-input/TextInput.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/text-input/TextInput.js +0 -57
- package/dist/ui/ink/components/ui/text-input/TextInput.js.map +0 -1
- package/dist/ui/ink/components/ui/text-input/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/text-input/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/text-input/index.js +0 -2
- package/dist/ui/ink/components/ui/text-input/index.js.map +0 -1
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.d.ts +0 -17
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.js +0 -38
- package/dist/ui/ink/components/ui/token-counter/TokenCounter.js.map +0 -1
- package/dist/ui/ink/components/ui/token-counter/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/token-counter/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/token-counter/index.js +0 -2
- package/dist/ui/ink/components/ui/token-counter/index.js.map +0 -1
- package/dist/ui/ink/components/ui/typewriter/Typewriter.d.ts +0 -14
- package/dist/ui/ink/components/ui/typewriter/Typewriter.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/typewriter/Typewriter.js +0 -57
- package/dist/ui/ink/components/ui/typewriter/Typewriter.js.map +0 -1
- package/dist/ui/ink/components/ui/typewriter/index.d.ts +0 -3
- package/dist/ui/ink/components/ui/typewriter/index.d.ts.map +0 -1
- package/dist/ui/ink/components/ui/typewriter/index.js +0 -2
- package/dist/ui/ink/components/ui/typewriter/index.js.map +0 -1
- package/dist/ui/opentui-renderer.d.ts +0 -53
- package/dist/ui/opentui-renderer.d.ts.map +0 -1
- package/dist/ui/opentui-renderer.js +0 -463
- package/dist/ui/opentui-renderer.js.map +0 -1
- package/dist/utils/memoize.d.ts +0 -14
- package/dist/utils/memoize.d.ts.map +0 -1
- package/dist/utils/memoize.js +0 -51
- package/dist/utils/memoize.js.map +0 -1
- package/dist/utils/types.d.ts +0 -6
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.js.map +0 -1
- package/dist/utils.d.ts +0 -22
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -81
- package/dist/utils.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ToolDefinition } from
|
|
2
|
-
import type { ToolHandler } from
|
|
1
|
+
import type { ToolDefinition } from "../registry.js";
|
|
2
|
+
import type { ToolHandler } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Инструмент project_map — получение информации о структуре проекта.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-map.d.ts","sourceRoot":"","sources":["../../../src/tools/native/project-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-map.d.ts","sourceRoot":"","sources":["../../../src/tools/native/project-map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;GASG;AAEH,eAAO,MAAM,oBAAoB,EAAE,cA4BlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAsL/B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readdirSync } from "node:fs";
|
|
2
|
+
import { getOrBuildProjectMap } from "../../indexer/cache.js";
|
|
2
3
|
/**
|
|
3
4
|
* Инструмент project_map — получение информации о структуре проекта.
|
|
4
5
|
*
|
|
@@ -10,145 +11,172 @@ import { getOrBuildProjectMap } from '../../indexer/cache.js';
|
|
|
10
11
|
* @module tools/native/project-map
|
|
11
12
|
*/
|
|
12
13
|
export const projectMapDefinition = {
|
|
13
|
-
type:
|
|
14
|
+
type: "function",
|
|
14
15
|
function: {
|
|
15
|
-
name:
|
|
16
|
-
description:
|
|
16
|
+
name: "project_map",
|
|
17
|
+
description: "Get project structure information. Use this FIRST before reading any files to understand what exists in the project.",
|
|
17
18
|
parameters: {
|
|
18
|
-
type:
|
|
19
|
+
type: "object",
|
|
19
20
|
properties: {
|
|
20
21
|
action: {
|
|
21
|
-
type:
|
|
22
|
-
enum: [
|
|
23
|
-
description:
|
|
22
|
+
type: "string",
|
|
23
|
+
enum: ["list", "find", "info"],
|
|
24
|
+
description: "list = show all files, find = search by pattern, info = show details of specific file",
|
|
24
25
|
},
|
|
25
26
|
pattern: {
|
|
26
|
-
type:
|
|
27
|
+
type: "string",
|
|
27
28
|
description: 'For "find" action: glob pattern to match files (e.g. "*.tsx", "src/**/*.ts")',
|
|
28
29
|
},
|
|
29
30
|
path: {
|
|
30
|
-
type:
|
|
31
|
+
type: "string",
|
|
31
32
|
description: 'For "info" action: path to specific file',
|
|
32
33
|
},
|
|
33
34
|
},
|
|
34
|
-
required: [
|
|
35
|
+
required: ["action"],
|
|
35
36
|
},
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
export const projectMapHandler = {
|
|
39
|
-
name:
|
|
40
|
+
name: "project_map",
|
|
40
41
|
definition: projectMapDefinition,
|
|
41
42
|
async execute(args, ctx) {
|
|
42
|
-
const action = String(args.action ||
|
|
43
|
-
const pattern = String(args.pattern ||
|
|
44
|
-
const filePath = String(args.path ||
|
|
43
|
+
const action = String(args.action || "list");
|
|
44
|
+
const pattern = String(args.pattern || "");
|
|
45
|
+
const filePath = String(args.path || "");
|
|
45
46
|
try {
|
|
46
47
|
const { map, formatted } = getOrBuildProjectMap(process.cwd());
|
|
47
48
|
switch (action) {
|
|
48
|
-
case
|
|
49
|
+
case "list": {
|
|
49
50
|
if (map.files.length === 0) {
|
|
51
|
+
// Fallback: проверяем реальную файловую систему
|
|
52
|
+
const actualFiles = [];
|
|
53
|
+
try {
|
|
54
|
+
const entries = readdirSync(ctx.cwd, { withFileTypes: true });
|
|
55
|
+
for (const e of entries) {
|
|
56
|
+
if (e.isFile() && !e.name.startsWith(".")) {
|
|
57
|
+
actualFiles.push(e.name);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
/* ignore */
|
|
63
|
+
}
|
|
64
|
+
let msg = "Project is empty or not indexed. No source files found.";
|
|
65
|
+
if (actualFiles.length > 0) {
|
|
66
|
+
msg = `WARNING: project_map shows 0 files, but ${actualFiles.length} file(s) detected on disk:\n ${actualFiles.join("\n ")}\n\nThis means the indexer did not scan these files. Use list_dir or bash (Get-ChildItem -Recurse) to explore the project.`;
|
|
67
|
+
}
|
|
50
68
|
return {
|
|
51
|
-
stdout:
|
|
52
|
-
stderr:
|
|
69
|
+
stdout: msg,
|
|
70
|
+
stderr: "",
|
|
53
71
|
exitCode: 0,
|
|
54
72
|
truncated: false,
|
|
55
73
|
};
|
|
56
74
|
}
|
|
57
75
|
return {
|
|
58
76
|
stdout: formatted,
|
|
59
|
-
stderr:
|
|
77
|
+
stderr: "",
|
|
60
78
|
exitCode: 0,
|
|
61
79
|
truncated: false,
|
|
62
80
|
};
|
|
63
81
|
}
|
|
64
|
-
case
|
|
82
|
+
case "find": {
|
|
65
83
|
if (!pattern) {
|
|
66
84
|
return {
|
|
67
85
|
stdout: 'Error: pattern is required for "find" action. Example: "*.tsx" or "src/**/*.ts"',
|
|
68
|
-
stderr:
|
|
86
|
+
stderr: "",
|
|
69
87
|
exitCode: 1,
|
|
70
88
|
truncated: false,
|
|
71
89
|
};
|
|
72
90
|
}
|
|
73
91
|
// Simple glob matching — *.tsx matches any .tsx file, **/*.tsx matches nested
|
|
74
|
-
const hasSlash = pattern.includes(
|
|
92
|
+
const hasSlash = pattern.includes("/");
|
|
75
93
|
let regexStr;
|
|
76
94
|
if (hasSlash) {
|
|
77
95
|
// Pattern has directory separator — match exactly
|
|
78
|
-
regexStr =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
regexStr =
|
|
97
|
+
"^" +
|
|
98
|
+
pattern
|
|
99
|
+
.replace(/\*\*/g, "{{GLOBSTAR}}")
|
|
100
|
+
.replace(/\*/g, "[^/]*")
|
|
101
|
+
.replace(/\?/g, "[^/]")
|
|
102
|
+
.replace(/\./g, "\\.")
|
|
103
|
+
.replace(/\{\{GLOBSTAR\}\}/g, ".*") +
|
|
104
|
+
"$";
|
|
86
105
|
}
|
|
87
106
|
else {
|
|
88
107
|
// No directory separator — match filename only (any depth)
|
|
89
|
-
regexStr =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
regexStr =
|
|
109
|
+
"(^|/)" +
|
|
110
|
+
pattern
|
|
111
|
+
.replace(/\*\*/g, "{{GLOBSTAR}}")
|
|
112
|
+
.replace(/\*/g, "[^/]*")
|
|
113
|
+
.replace(/\?/g, "[^/]")
|
|
114
|
+
.replace(/\./g, "\\.")
|
|
115
|
+
.replace(/\{\{GLOBSTAR\}\}/g, ".*") +
|
|
116
|
+
"$";
|
|
97
117
|
}
|
|
98
118
|
const regex = new RegExp(regexStr);
|
|
99
|
-
const matches = map.files.filter(f => regex.test(f.path));
|
|
119
|
+
const matches = map.files.filter((f) => regex.test(f.path));
|
|
100
120
|
if (matches.length === 0) {
|
|
101
121
|
return {
|
|
102
122
|
stdout: `No files match pattern: ${pattern}`,
|
|
103
|
-
stderr:
|
|
123
|
+
stderr: "",
|
|
104
124
|
exitCode: 0,
|
|
105
125
|
truncated: false,
|
|
106
126
|
};
|
|
107
127
|
}
|
|
108
|
-
const output = matches
|
|
109
|
-
|
|
128
|
+
const output = matches
|
|
129
|
+
.map((f) => {
|
|
130
|
+
const expStr = f.exports.length > 0
|
|
131
|
+
? ` (exports: ${f.exports.join(", ")})`
|
|
132
|
+
: "";
|
|
110
133
|
return `${f.path}${expStr}`;
|
|
111
|
-
})
|
|
134
|
+
})
|
|
135
|
+
.join("\n");
|
|
112
136
|
return {
|
|
113
137
|
stdout: `Found ${matches.length} file(s):\n${output}`,
|
|
114
|
-
stderr:
|
|
138
|
+
stderr: "",
|
|
115
139
|
exitCode: 0,
|
|
116
140
|
truncated: false,
|
|
117
141
|
};
|
|
118
142
|
}
|
|
119
|
-
case
|
|
143
|
+
case "info": {
|
|
120
144
|
if (!filePath) {
|
|
121
145
|
return {
|
|
122
146
|
stdout: 'Error: path is required for "info" action. Example: "src/App.tsx"',
|
|
123
|
-
stderr:
|
|
147
|
+
stderr: "",
|
|
124
148
|
exitCode: 1,
|
|
125
149
|
truncated: false,
|
|
126
150
|
};
|
|
127
151
|
}
|
|
128
152
|
// Normalize path
|
|
129
|
-
const normalizedPath = filePath.replace(/\\/g,
|
|
130
|
-
const file = map.files.find(f => f.path === normalizedPath);
|
|
153
|
+
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
154
|
+
const file = map.files.find((f) => f.path === normalizedPath);
|
|
131
155
|
if (!file) {
|
|
132
156
|
// Try partial match
|
|
133
|
-
const partialMatch = map.files.find(f => f.path.endsWith(normalizedPath) ||
|
|
157
|
+
const partialMatch = map.files.find((f) => f.path.endsWith(normalizedPath) ||
|
|
158
|
+
f.path.includes(normalizedPath));
|
|
134
159
|
if (partialMatch) {
|
|
135
160
|
return {
|
|
136
|
-
stdout: `File not found at exact path: ${filePath}\nDid you mean: ${partialMatch.path}?\n\nPath: ${partialMatch.path}\nLines: ${partialMatch.lines}\nExports: ${partialMatch.exports.length > 0 ? partialMatch.exports.join(
|
|
137
|
-
stderr:
|
|
161
|
+
stdout: `File not found at exact path: ${filePath}\nDid you mean: ${partialMatch.path}?\n\nPath: ${partialMatch.path}\nLines: ${partialMatch.lines}\nExports: ${partialMatch.exports.length > 0 ? partialMatch.exports.join(", ") : "none"}`,
|
|
162
|
+
stderr: "",
|
|
138
163
|
exitCode: 0,
|
|
139
164
|
truncated: false,
|
|
140
165
|
};
|
|
141
166
|
}
|
|
142
167
|
return {
|
|
143
|
-
stdout: `File not found: ${filePath}\n\nAvailable files:\n${map.files
|
|
144
|
-
|
|
168
|
+
stdout: `File not found: ${filePath}\n\nAvailable files:\n${map.files
|
|
169
|
+
.slice(0, 20)
|
|
170
|
+
.map((f) => ` ${f.path}`)
|
|
171
|
+
.join("\n")}${map.files.length > 20 ? `\n ... and ${map.files.length - 20} more` : ""}`,
|
|
172
|
+
stderr: "",
|
|
145
173
|
exitCode: 0,
|
|
146
174
|
truncated: false,
|
|
147
175
|
};
|
|
148
176
|
}
|
|
149
177
|
return {
|
|
150
|
-
stdout: `Path: ${file.path}\nLines: ${file.lines}\nExports: ${file.exports.length > 0 ? file.exports.join(
|
|
151
|
-
stderr:
|
|
178
|
+
stdout: `Path: ${file.path}\nLines: ${file.lines}\nExports: ${file.exports.length > 0 ? file.exports.join(", ") : "none"}`,
|
|
179
|
+
stderr: "",
|
|
152
180
|
exitCode: 0,
|
|
153
181
|
truncated: false,
|
|
154
182
|
};
|
|
@@ -156,7 +184,7 @@ export const projectMapHandler = {
|
|
|
156
184
|
default:
|
|
157
185
|
return {
|
|
158
186
|
stdout: `Unknown action: ${action}. Use "list", "find", or "info".`,
|
|
159
|
-
stderr:
|
|
187
|
+
stderr: "",
|
|
160
188
|
exitCode: 1,
|
|
161
189
|
truncated: false,
|
|
162
190
|
};
|
|
@@ -165,7 +193,7 @@ export const projectMapHandler = {
|
|
|
165
193
|
catch (e) {
|
|
166
194
|
return {
|
|
167
195
|
stdout: `Error accessing project map: ${e.message}`,
|
|
168
|
-
stderr:
|
|
196
|
+
stderr: "",
|
|
169
197
|
exitCode: 1,
|
|
170
198
|
truncated: false,
|
|
171
199
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-map.js","sourceRoot":"","sources":["../../../src/tools/native/project-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-map.js","sourceRoot":"","sources":["../../../src/tools/native/project-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAmB;IAClD,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,sHAAsH;QACxH,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;oBAC9B,WAAW,EACT,uFAAuF;iBAC1F;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,8EAA8E;iBACjF;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,0CAA0C;iBACxD;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,oBAAoB;IAChC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG;QACrB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QAEzC,IAAI,CAAC;YACH,MAAM,EAAE,GAA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AE;wBAC1H,MAAM,EAAE,EAAE;wBACV,QAAQ,EAAE,CAAC;wBACX,SAAS,EAAE,KAAK;qBACjB,CAAC;gBACJ,CAAC;gBAED;oBACE,OAAO;wBACL,MAAM,EAAE,mBAAmB,MAAM,kCAAkC;wBACnE,MAAM,EAAE,EAAE;wBACV,QAAQ,EAAE,CAAC;wBACX,SAAS,EAAE,KAAK;qBACjB,CAAC;YACN,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,OAAO;gBACL,MAAM,EAAE,gCAAgC,CAAC,CAAC,OAAO,EAAE;gBACnD,MAAM,EAAE,EAAE;gBACV,QAAQ,EAAE,CAAC;gBACX,SAAS,EAAE,KAAK;aACjB,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -21,66 +21,66 @@ const TEMPLATES = {
|
|
|
21
21
|
vite: '^6.0.0',
|
|
22
22
|
},
|
|
23
23
|
}, null, 2),
|
|
24
|
-
'vite.config.ts': `import { defineConfig } from 'vite'
|
|
25
|
-
import react from '@vitejs/plugin-react'
|
|
26
|
-
|
|
27
|
-
export default defineConfig({
|
|
28
|
-
plugins: [react()],
|
|
29
|
-
})
|
|
24
|
+
'vite.config.ts': `import { defineConfig } from 'vite'
|
|
25
|
+
import react from '@vitejs/plugin-react'
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
plugins: [react()],
|
|
29
|
+
})
|
|
30
30
|
`,
|
|
31
|
-
'tsconfig.json': `{
|
|
32
|
-
"compilerOptions": {
|
|
33
|
-
"target": "ES2020",
|
|
34
|
-
"useDefineForClassFields": true,
|
|
35
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
36
|
-
"module": "ESNext",
|
|
37
|
-
"skipLibCheck": true,
|
|
38
|
-
"moduleResolution": "bundler",
|
|
39
|
-
"allowImportingTsExtensions": true,
|
|
40
|
-
"isolatedModules": true,
|
|
41
|
-
"moduleDetection": "force",
|
|
42
|
-
"noEmit": true,
|
|
43
|
-
"jsx": "react-jsx",
|
|
44
|
-
"strict": true,
|
|
45
|
-
"noUnusedLocals": true,
|
|
46
|
-
"noUnusedParameters": true,
|
|
47
|
-
"noFallthroughCasesInSwitch": true
|
|
48
|
-
},
|
|
49
|
-
"include": ["src"]
|
|
50
|
-
}
|
|
31
|
+
'tsconfig.json': `{
|
|
32
|
+
"compilerOptions": {
|
|
33
|
+
"target": "ES2020",
|
|
34
|
+
"useDefineForClassFields": true,
|
|
35
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
36
|
+
"module": "ESNext",
|
|
37
|
+
"skipLibCheck": true,
|
|
38
|
+
"moduleResolution": "bundler",
|
|
39
|
+
"allowImportingTsExtensions": true,
|
|
40
|
+
"isolatedModules": true,
|
|
41
|
+
"moduleDetection": "force",
|
|
42
|
+
"noEmit": true,
|
|
43
|
+
"jsx": "react-jsx",
|
|
44
|
+
"strict": true,
|
|
45
|
+
"noUnusedLocals": true,
|
|
46
|
+
"noUnusedParameters": true,
|
|
47
|
+
"noFallthroughCasesInSwitch": true
|
|
48
|
+
},
|
|
49
|
+
"include": ["src"]
|
|
50
|
+
}
|
|
51
51
|
`,
|
|
52
|
-
'index.html': `<!DOCTYPE html>
|
|
53
|
-
<html lang="en">
|
|
54
|
-
<head>
|
|
55
|
-
<meta charset="UTF-8" />
|
|
56
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
57
|
-
<title>Vite App</title>
|
|
58
|
-
</head>
|
|
59
|
-
<body>
|
|
60
|
-
<div id="root"></div>
|
|
61
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
62
|
-
</body>
|
|
63
|
-
</html>
|
|
52
|
+
'index.html': `<!DOCTYPE html>
|
|
53
|
+
<html lang="en">
|
|
54
|
+
<head>
|
|
55
|
+
<meta charset="UTF-8" />
|
|
56
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
57
|
+
<title>Vite App</title>
|
|
58
|
+
</head>
|
|
59
|
+
<body>
|
|
60
|
+
<div id="root"></div>
|
|
61
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
|
64
64
|
`,
|
|
65
|
-
'src/main.tsx': `import { StrictMode } from 'react'
|
|
66
|
-
import { createRoot } from 'react-dom/client'
|
|
67
|
-
import App from './App'
|
|
68
|
-
|
|
69
|
-
createRoot(document.getElementById('root')!).render(
|
|
70
|
-
<StrictMode>
|
|
71
|
-
<App />
|
|
72
|
-
</StrictMode>,
|
|
73
|
-
)
|
|
65
|
+
'src/main.tsx': `import { StrictMode } from 'react'
|
|
66
|
+
import { createRoot } from 'react-dom/client'
|
|
67
|
+
import App from './App'
|
|
68
|
+
|
|
69
|
+
createRoot(document.getElementById('root')!).render(
|
|
70
|
+
<StrictMode>
|
|
71
|
+
<App />
|
|
72
|
+
</StrictMode>,
|
|
73
|
+
)
|
|
74
74
|
`,
|
|
75
|
-
'src/App.tsx': `function App() {
|
|
76
|
-
return (
|
|
77
|
-
<div>
|
|
78
|
-
<h1>Hello Vite + React</h1>
|
|
79
|
-
</div>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export default App
|
|
75
|
+
'src/App.tsx': `function App() {
|
|
76
|
+
return (
|
|
77
|
+
<div>
|
|
78
|
+
<h1>Hello Vite + React</h1>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default App
|
|
84
84
|
`,
|
|
85
85
|
},
|
|
86
86
|
},
|
|
@@ -95,41 +95,41 @@ export default App
|
|
|
95
95
|
scripts: { dev: 'vite', build: 'tsc && vite build', preview: 'vite preview' },
|
|
96
96
|
devDependencies: { typescript: '^5.7.0', vite: '^6.0.0' },
|
|
97
97
|
}, null, 2),
|
|
98
|
-
'vite.config.ts': `import { defineConfig } from 'vite'
|
|
99
|
-
|
|
100
|
-
export default defineConfig({})
|
|
98
|
+
'vite.config.ts': `import { defineConfig } from 'vite'
|
|
99
|
+
|
|
100
|
+
export default defineConfig({})
|
|
101
101
|
`,
|
|
102
|
-
'tsconfig.json': `{
|
|
103
|
-
"compilerOptions": {
|
|
104
|
-
"target": "ES2020",
|
|
105
|
-
"useDefineForClassFields": true,
|
|
106
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
107
|
-
"module": "ESNext",
|
|
108
|
-
"skipLibCheck": true,
|
|
109
|
-
"moduleResolution": "bundler",
|
|
110
|
-
"allowImportingTsExtensions": true,
|
|
111
|
-
"isolatedModules": true,
|
|
112
|
-
"moduleDetection": "force",
|
|
113
|
-
"noEmit": true,
|
|
114
|
-
"strict": true
|
|
115
|
-
},
|
|
116
|
-
"include": ["src"]
|
|
117
|
-
}
|
|
102
|
+
'tsconfig.json': `{
|
|
103
|
+
"compilerOptions": {
|
|
104
|
+
"target": "ES2020",
|
|
105
|
+
"useDefineForClassFields": true,
|
|
106
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
107
|
+
"module": "ESNext",
|
|
108
|
+
"skipLibCheck": true,
|
|
109
|
+
"moduleResolution": "bundler",
|
|
110
|
+
"allowImportingTsExtensions": true,
|
|
111
|
+
"isolatedModules": true,
|
|
112
|
+
"moduleDetection": "force",
|
|
113
|
+
"noEmit": true,
|
|
114
|
+
"strict": true
|
|
115
|
+
},
|
|
116
|
+
"include": ["src"]
|
|
117
|
+
}
|
|
118
118
|
`,
|
|
119
|
-
'index.html': `<!DOCTYPE html>
|
|
120
|
-
<html lang="en">
|
|
121
|
-
<head>
|
|
122
|
-
<meta charset="UTF-8" />
|
|
123
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
124
|
-
<title>Vite App</title>
|
|
125
|
-
</head>
|
|
126
|
-
<body>
|
|
127
|
-
<div id="root"></div>
|
|
128
|
-
<script type="module" src="/src/main.ts"></script>
|
|
129
|
-
</body>
|
|
130
|
-
</html>
|
|
119
|
+
'index.html': `<!DOCTYPE html>
|
|
120
|
+
<html lang="en">
|
|
121
|
+
<head>
|
|
122
|
+
<meta charset="UTF-8" />
|
|
123
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
124
|
+
<title>Vite App</title>
|
|
125
|
+
</head>
|
|
126
|
+
<body>
|
|
127
|
+
<div id="root"></div>
|
|
128
|
+
<script type="module" src="/src/main.ts"></script>
|
|
129
|
+
</body>
|
|
130
|
+
</html>
|
|
131
131
|
`,
|
|
132
|
-
'src/main.ts': `console.log('Hello from Vite!')
|
|
132
|
+
'src/main.ts': `console.log('Hello from Vite!')
|
|
133
133
|
`,
|
|
134
134
|
},
|
|
135
135
|
},
|
|
@@ -150,32 +150,32 @@ export default defineConfig({})
|
|
|
150
150
|
tsx: '^4.0.0',
|
|
151
151
|
},
|
|
152
152
|
}, null, 2),
|
|
153
|
-
'tsconfig.json': `{
|
|
154
|
-
"compilerOptions": {
|
|
155
|
-
"target": "ES2022",
|
|
156
|
-
"module": "ESNext",
|
|
157
|
-
"moduleResolution": "bundler",
|
|
158
|
-
"outDir": "dist",
|
|
159
|
-
"rootDir": "src",
|
|
160
|
-
"strict": true,
|
|
161
|
-
"esModuleInterop": true,
|
|
162
|
-
"skipLibCheck": true
|
|
163
|
-
},
|
|
164
|
-
"include": ["src"]
|
|
165
|
-
}
|
|
153
|
+
'tsconfig.json': `{
|
|
154
|
+
"compilerOptions": {
|
|
155
|
+
"target": "ES2022",
|
|
156
|
+
"module": "ESNext",
|
|
157
|
+
"moduleResolution": "bundler",
|
|
158
|
+
"outDir": "dist",
|
|
159
|
+
"rootDir": "src",
|
|
160
|
+
"strict": true,
|
|
161
|
+
"esModuleInterop": true,
|
|
162
|
+
"skipLibCheck": true
|
|
163
|
+
},
|
|
164
|
+
"include": ["src"]
|
|
165
|
+
}
|
|
166
166
|
`,
|
|
167
|
-
'src/index.ts': `import express from 'express'
|
|
168
|
-
|
|
169
|
-
const app = express()
|
|
170
|
-
const PORT = process.env.PORT || 3000
|
|
171
|
-
|
|
172
|
-
app.get('/', (req, res) => {
|
|
173
|
-
res.json({ message: 'Hello from Express!' })
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
app.listen(PORT, () => {
|
|
177
|
-
console.log(\`Server running on port \${PORT}\`)
|
|
178
|
-
})
|
|
167
|
+
'src/index.ts': `import express from 'express'
|
|
168
|
+
|
|
169
|
+
const app = express()
|
|
170
|
+
const PORT = process.env.PORT || 3000
|
|
171
|
+
|
|
172
|
+
app.get('/', (req, res) => {
|
|
173
|
+
res.json({ message: 'Hello from Express!' })
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
app.listen(PORT, () => {
|
|
177
|
+
console.log(\`Server running on port \${PORT}\`)
|
|
178
|
+
})
|
|
179
179
|
`,
|
|
180
180
|
},
|
|
181
181
|
},
|
package/dist/tools/web-browse.js
CHANGED
|
@@ -574,13 +574,13 @@ async function actionEvaluate(page, args) {
|
|
|
574
574
|
}
|
|
575
575
|
else if (e instanceof TypeError && /slice is not a function/i.test(e.message)) {
|
|
576
576
|
// querySelectorAll вернул NodeList — подменяем querySelectorAll чтобы возвращал Array
|
|
577
|
-
const wrapped = `
|
|
578
|
-
(function(){
|
|
579
|
-
var _origQSA = document.querySelectorAll.bind(document);
|
|
580
|
-
document.querySelectorAll = function(s){ return Array.from(_origQSA(s)); };
|
|
581
|
-
var _origQE = document.querySelector.bind(document);
|
|
582
|
-
${script}
|
|
583
|
-
})()
|
|
577
|
+
const wrapped = `
|
|
578
|
+
(function(){
|
|
579
|
+
var _origQSA = document.querySelectorAll.bind(document);
|
|
580
|
+
document.querySelectorAll = function(s){ return Array.from(_origQSA(s)); };
|
|
581
|
+
var _origQE = document.querySelector.bind(document);
|
|
582
|
+
${script}
|
|
583
|
+
})()
|
|
584
584
|
`;
|
|
585
585
|
raw = eval(wrapped);
|
|
586
586
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/ui/ink/components/App.tsx"],"names":[],"mappings":"AAA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I,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7D,gBAAgB,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACtD;AAED,UAAU,QAAQ;IAChB,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,qBAkF3D"}
|
|
@@ -11,10 +11,6 @@ function reducer(state, action) {
|
|
|
11
11
|
const data = { ...action.data };
|
|
12
12
|
if (data.tag === 'user')
|
|
13
13
|
data.role = 'user';
|
|
14
|
-
else if (data.tag === 'subagent')
|
|
15
|
-
data.role = 'subagent';
|
|
16
|
-
else if (data.tag === 'expert' || data.tag === 'specialist')
|
|
17
|
-
data.role = 'expert';
|
|
18
14
|
return {
|
|
19
15
|
...state,
|
|
20
16
|
nextId: state.nextId + 1,
|
|
@@ -97,7 +93,7 @@ function reducer(state, action) {
|
|
|
97
93
|
};
|
|
98
94
|
}
|
|
99
95
|
case 'SPINNER':
|
|
100
|
-
return { ...state, showSpinner: action.show
|
|
96
|
+
return { ...state, showSpinner: action.show };
|
|
101
97
|
case 'STATUS':
|
|
102
98
|
return { ...state, status: { ...state.status, ...action.info } };
|
|
103
99
|
case 'CONTEXT':
|
|
@@ -120,7 +116,6 @@ function reducer(state, action) {
|
|
|
120
116
|
streamingContent: '',
|
|
121
117
|
isReasoning: false,
|
|
122
118
|
showSpinner: false,
|
|
123
|
-
spinnerText: '',
|
|
124
119
|
status: {},
|
|
125
120
|
contextUsage: '',
|
|
126
121
|
showPrompt: false,
|
|
@@ -154,7 +149,6 @@ const initialState = {
|
|
|
154
149
|
streamingContent: '',
|
|
155
150
|
isReasoning: false,
|
|
156
151
|
showSpinner: false,
|
|
157
|
-
spinnerText: '',
|
|
158
152
|
status: {},
|
|
159
153
|
contextUsage: '',
|
|
160
154
|
showPrompt: false,
|
|
@@ -199,7 +193,7 @@ export function App({ onReady, commands, onAbort }) {
|
|
|
199
193
|
getSelectResolve() { return selectResolveRef.current; },
|
|
200
194
|
});
|
|
201
195
|
}, []);
|
|
202
|
-
return (_jsxs(Box, { flexDirection: "column", height: "100%", children: [_jsx(
|
|
196
|
+
return (_jsxs(Box, { flexDirection: "column", height: "100%", children: [_jsx(Conversation, { entries: state.entries, streaming: state.streaming, streamingContent: state.streamingContent, isReasoning: state.isReasoning, showSpinner: state.showSpinner }), _jsx(Box, { flexShrink: 0, marginTop: 1, children: state.showSelect ? (_jsx(SelectInput, { question: state.selectQuestion, choices: state.selectChoices, onSelect: (value) => {
|
|
203
197
|
const resolve = selectResolveRef.current;
|
|
204
198
|
if (resolve) {
|
|
205
199
|
selectResolveRef.current = null;
|