├── .idea ├── .name └── runConfigurations │ └── Run_Compose_Server.xml ├── gradle-252.properties ├── mpp-vscode ├── .gitignore ├── media │ ├── autodev.woff │ └── pluginIcon.png ├── webview │ ├── src │ │ ├── components │ │ │ └── plan │ │ │ │ └── index.ts │ │ └── main.tsx │ ├── index.html │ ├── vite.config.ts │ ├── tsconfig.json │ └── package.json ├── resources │ └── icon.svg ├── tsconfig.json ├── vitest.config.ts └── .vscodeignore ├── example ├── custom_llm_server │ ├── README.md │ └── requirements.txt ├── custom_agent │ ├── requirements.txt │ └── README.md ├── prompt │ ├── autodev │ │ ├── tasking.md │ │ ├── custom-prompt-dsl.md │ │ └── controller-output.md │ └── copilot │ │ └── completion │ │ ├── python-code.md │ │ └── java-code.md └── mcp │ └── issues.mcp.json ├── mpp-ui ├── .gitignore ├── src │ ├── jvmMain │ │ ├── resources │ │ │ ├── icon.ico │ │ │ ├── icon-16.png │ │ │ ├── icon-32.png │ │ │ ├── icon-48.png │ │ │ ├── icon-64.png │ │ │ ├── icon.icns │ │ │ ├── icon-128.png │ │ │ ├── icon-256.png │ │ │ ├── icon-512.png │ │ │ └── icon.ico.png │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── devins │ │ │ └── ui │ │ │ └── compose │ │ │ ├── agent │ │ │ └── FileViewerPanelWrapper.jvm.kt │ │ │ └── AutoDevApp.jvm.kt │ ├── androidMain │ │ ├── res │ │ │ └── font │ │ │ │ ├── firacode_bold.ttf │ │ │ │ ├── firacode_medium.ttf │ │ │ │ └── firacode_regular.ttf │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── devins │ │ │ └── ui │ │ │ ├── provider │ │ │ └── CopilotModelRefresher.android.kt │ │ │ ├── compose │ │ │ └── agent │ │ │ │ └── PlatformMessageTextContainer.android.kt │ │ │ ├── nano │ │ │ └── StatefulNanoRenderer.android.kt │ │ │ └── platform │ │ │ └── ClipboardImageReader.android.kt │ ├── commonMain │ │ ├── resources │ │ │ └── fonts │ │ │ │ ├── FiraCode-Bold.ttf │ │ │ │ ├── FiraCode-Medium.ttf │ │ │ │ └── FiraCode-Regular.ttf │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── devins │ │ │ └── ui │ │ │ └── compose │ │ │ ├── agent │ │ │ ├── FileViewerPanelWrapper.kt │ │ │ ├── FileSystemTreeView.kt │ │ │ ├── codereview │ │ │ │ └── FileViewerDialog.kt │ │ │ └── PlatformCodingAgentFactory.kt │ │ │ ├── sketch │ │ │ └── ScreenshotUtils.kt │ │ │ ├── terminal │ │ │ └── TerminalDisplay.kt │ │ │ ├── AutoDevAppPlatform.kt │ │ │ └── editor │ │ │ └── model │ │ │ └── EditorModels.kt │ ├── iosMain │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── devins │ │ │ ├── ui │ │ │ ├── AutoDevApp.apple.kt │ │ │ ├── provider │ │ │ │ └── CopilotModelRefresher.ios.kt │ │ │ ├── nano │ │ │ │ └── StatefulNanoRenderer.ios.kt │ │ │ ├── compose │ │ │ │ └── agent │ │ │ │ │ └── PlatformMessageTextContainer.ios.kt │ │ │ ├── Main.kt │ │ │ └── platform │ │ │ │ └── ClipboardImageReader.ios.kt │ │ │ └── db │ │ │ └── DatabaseDriverFactory.kt │ ├── jsMain │ │ ├── kotlin │ │ │ └── cc │ │ │ │ └── unitmesh │ │ │ │ └── devins │ │ │ │ └── ui │ │ │ │ ├── nano │ │ │ │ ├── NanoImageCache.js.kt │ │ │ │ └── StatefulNanoRenderer.js.kt │ │ │ │ ├── remote │ │ │ │ └── RemoteAgentClient.js.kt │ │ │ │ ├── provider │ │ │ │ └── CopilotModelRefresher.js.kt │ │ │ │ ├── Main.kt │ │ │ │ ├── compose │ │ │ │ ├── agent │ │ │ │ │ └── PlatformMessageTextContainer.js.kt │ │ │ │ ├── AutoDevApp.js.kt │ │ │ │ └── sketch │ │ │ │ │ ├── MermaidBlockRenderer.js.kt │ │ │ │ │ └── ScreenshotUtils.js.kt │ │ │ │ └── platform │ │ │ │ └── ClipboardImageReader.js.kt │ │ ├── typescript │ │ │ ├── modes │ │ │ │ └── index.ts │ │ │ └── ui │ │ │ │ └── Banner.tsx │ │ └── resources │ │ │ └── index.html │ └── wasmJsMain │ │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── devins │ │ └── ui │ │ ├── provider │ │ └── CopilotModelRefresher.wasmJs.kt │ │ ├── remote │ │ └── RemoteAgentClient.wasmJs.kt │ │ ├── nano │ │ └── StatefulNanoRenderer.wasmJs.kt │ │ ├── compose │ │ ├── agent │ │ │ └── PlatformMessageTextContainer.wasmJs.kt │ │ └── AutoDevApp.wasm.kt │ │ └── platform │ │ └── ClipboardImageReader.wasmJs.kt └── webpack.config.d │ └── zzzz-wasm-experiments.js ├── mpp-idea ├── mpp-idea-exts │ ├── .gitignore │ ├── devins-lang │ │ ├── .gitignore │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── agent │ │ │ │ │ └── toolExamples │ │ │ │ │ │ ├── open.devin │ │ │ │ │ │ ├── browse.devin │ │ │ │ │ │ ├── file-func.devin │ │ │ │ │ │ ├── x.devin │ │ │ │ │ │ ├── symbol.devin │ │ │ │ │ │ ├── related.devin │ │ │ │ │ │ ├── structure.devin │ │ │ │ │ │ ├── containerView.devin │ │ │ │ │ │ ├── database.devin │ │ │ │ │ │ ├── stylingView.devin │ │ │ │ │ │ ├── history.devin │ │ │ │ │ │ ├── rev.devin │ │ │ │ │ │ ├── dependencies.devin │ │ │ │ │ │ ├── componentView.devin │ │ │ │ │ │ ├── scc.devin │ │ │ │ │ │ ├── shell.devin │ │ │ │ │ │ ├── run.devin │ │ │ │ │ │ ├── rule.devin │ │ │ │ │ │ ├── dir.devin │ │ │ │ │ │ ├── refactor.devin │ │ │ │ │ │ ├── webApiView.devin │ │ │ │ │ │ ├── file.devin │ │ │ │ │ │ ├── localSearch.devin │ │ │ │ │ │ ├── commit.devin │ │ │ │ │ │ ├── knowledge.devin │ │ │ │ │ │ ├── write.devin │ │ │ │ │ │ ├── usage.devin │ │ │ │ │ │ ├── a2a.devin │ │ │ │ │ │ ├── patch.devin │ │ │ │ │ │ ├── agents.devin │ │ │ │ │ │ ├── library-version-fetch.devin │ │ │ │ │ │ ├── ripgrepSearch.devin │ │ │ │ │ │ ├── kill-process.devin │ │ │ │ │ │ ├── speckit.devin │ │ │ │ │ │ └── write-process-input.devin │ │ │ │ ├── intentionDescriptions │ │ │ │ │ ├── ShireIntention │ │ │ │ │ │ ├── before.txt.template │ │ │ │ │ │ ├── description.html │ │ │ │ │ │ └── after.txt.template │ │ │ │ │ └── ShireIntentionHelper │ │ │ │ │ │ ├── before.txt.template │ │ │ │ │ │ ├── description.html │ │ │ │ │ │ └── after.txt.template │ │ │ │ ├── inspectionDescriptions │ │ │ │ │ └── DevInsDuplicateAgent.html │ │ │ │ └── fileTemplates │ │ │ │ │ └── internal │ │ │ │ │ └── AutoDevAction.devin.ft │ │ │ └── kotlin │ │ │ │ └── cc │ │ │ │ └── unitmesh │ │ │ │ └── devti │ │ │ │ └── language │ │ │ │ ├── ast │ │ │ │ ├── shireql │ │ │ │ │ ├── ShireQLSchema.kt │ │ │ │ │ ├── variable │ │ │ │ │ │ └── frontend │ │ │ │ │ │ │ ├── ComponentProvider.kt │ │ │ │ │ │ │ └── Component.kt │ │ │ │ │ └── ShireQLFromType.kt │ │ │ │ ├── action │ │ │ │ │ ├── PatternProcessor.kt │ │ │ │ │ └── RuleBasedPatternAction.kt │ │ │ │ └── variable │ │ │ │ │ └── resolver │ │ │ │ │ └── base │ │ │ │ │ ├── VariableResolver.kt │ │ │ │ │ └── VariableResolverContext.kt │ │ │ │ ├── compiler │ │ │ │ ├── error │ │ │ │ │ └── DevInError.kt │ │ │ │ └── exec │ │ │ │ │ ├── PrintInsCommand.kt │ │ │ │ │ └── BrowseInsCommand.kt │ │ │ │ ├── DevInAstFactory.kt │ │ │ │ ├── lexer │ │ │ │ ├── DevInLexerAdapter.kt │ │ │ │ └── DevInTokenType.kt │ │ │ │ ├── psi │ │ │ │ └── DevInElementType.kt │ │ │ │ ├── DevInLanguage.kt │ │ │ │ ├── highlight │ │ │ │ └── DevInSyntaxHighlighterFactory.kt │ │ │ │ ├── parser │ │ │ │ └── ShireTokenTypeSets.kt │ │ │ │ ├── DevInIcons.kt │ │ │ │ ├── run │ │ │ │ ├── runner │ │ │ │ │ └── ShireRunnerContext.kt │ │ │ │ ├── flow │ │ │ │ │ └── DevInsProcessContext.kt │ │ │ │ └── DevInsProcessHandler.kt │ │ │ │ └── middleware │ │ │ │ └── select │ │ │ │ └── PsiElementStrategy.kt │ │ │ └── test │ │ │ ├── kotlin │ │ │ └── cc │ │ │ │ └── unitmesh │ │ │ │ └── devti │ │ │ │ └── language │ │ │ │ ├── compiler │ │ │ │ └── execute │ │ │ │ │ └── CrawlProcessorTest.kt │ │ │ │ └── completion │ │ │ │ └── dataprovider │ │ │ │ └── BuiltinCommandTest.kt │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── plugin.xml │ ├── nanodsl-lang │ │ ├── .gitignore │ │ └── src │ │ │ ├── main │ │ │ └── kotlin │ │ │ │ └── cc │ │ │ │ └── unitmesh │ │ │ │ └── nanodsl │ │ │ │ └── language │ │ │ │ ├── lexer │ │ │ │ ├── NanoDSLLexerAdapter.kt │ │ │ │ └── NanoDSLTokenType.kt │ │ │ │ ├── NanoDSLLanguage.kt │ │ │ │ ├── psi │ │ │ │ ├── NanoDSLElementType.kt │ │ │ │ └── NanoDSLFile.kt │ │ │ │ ├── NanoDSLIcons.kt │ │ │ │ ├── highlight │ │ │ │ └── NanoDSLSyntaxHighlighterFactory.kt │ │ │ │ └── NanoDSLFileType.kt │ │ │ └── test │ │ │ └── resources │ │ │ └── testcases │ │ │ ├── 01-simple-card.nanodsl │ │ │ └── 03-counter-card.nanodsl │ ├── ext-database │ │ ├── src │ │ │ ├── main │ │ │ │ ├── kotlin │ │ │ │ │ └── cc │ │ │ │ │ │ └── unitmesh │ │ │ │ │ │ └── database │ │ │ │ │ │ ├── util │ │ │ │ │ │ └── SqlUtil.kt │ │ │ │ │ │ ├── actions │ │ │ │ │ │ └── base │ │ │ │ │ │ │ └── SqlMigrationContext.kt │ │ │ │ │ │ └── flow │ │ │ │ │ │ └── AutoSqlContext.kt │ │ │ │ └── resources │ │ │ │ │ └── genius │ │ │ │ │ ├── en │ │ │ │ │ └── migration │ │ │ │ │ │ ├── gen-entity.vm │ │ │ │ │ │ ├── gen-function.vm │ │ │ │ │ │ └── gen-unittest.vm │ │ │ │ │ └── zh │ │ │ │ │ └── migration │ │ │ │ │ ├── gen-entity.vm │ │ │ │ │ ├── gen-function.vm │ │ │ │ │ └── gen-unittest.vm │ │ │ └── test │ │ │ │ └── resources │ │ │ │ ├── blog.pl.sql │ │ │ │ └── create_blog.sql │ │ └── README.md │ └── ext-terminal │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── terminal │ │ ├── sketch │ │ └── TerminalExecutionState.kt │ │ └── ShellSuggestContext.kt ├── mpp-idea-core │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── genius │ │ │ │ ├── en │ │ │ │ │ ├── code │ │ │ │ │ │ ├── code-complete.vm │ │ │ │ │ │ └── inline-chat.devin │ │ │ │ │ ├── practises │ │ │ │ │ │ ├── release-note.vm │ │ │ │ │ │ └── shell-suggest.vm │ │ │ │ │ ├── cicd │ │ │ │ │ │ └── generate-github-action.vm │ │ │ │ │ ├── quick │ │ │ │ │ │ └── quick-action.vm │ │ │ │ │ └── sre │ │ │ │ │ │ └── generate-dockerfile.vm │ │ │ │ └── zh │ │ │ │ │ ├── code │ │ │ │ │ ├── code-complete.vm │ │ │ │ │ ├── inline-chat.devin │ │ │ │ │ └── test-gen.vm │ │ │ │ │ ├── practises │ │ │ │ │ ├── release-note.vm │ │ │ │ │ ├── refactoring.vm │ │ │ │ │ ├── code-review.vm │ │ │ │ │ └── shell-suggest.vm │ │ │ │ │ ├── quick │ │ │ │ │ └── quick-action.vm │ │ │ │ │ ├── cicd │ │ │ │ │ └── generate-github-action.vm │ │ │ │ │ ├── sre │ │ │ │ │ └── generate-dockerfile.vm │ │ │ │ │ ├── page │ │ │ │ │ ├── page-gen-clarify.vm │ │ │ │ │ └── page-gen-design.vm │ │ │ │ │ └── sql │ │ │ │ │ ├── sql-gen-clarify.vm │ │ │ │ │ └── sql-gen-design.vm │ │ │ ├── intentionDescriptions │ │ │ │ ├── AutoSqlAction │ │ │ │ │ ├── after.txt.template │ │ │ │ │ ├── description.html │ │ │ │ │ └── before.txt.template │ │ │ │ ├── AutoDevIntention │ │ │ │ │ ├── before.txt.template │ │ │ │ │ ├── after.txt.template │ │ │ │ │ └── description.html │ │ │ │ ├── RefactorThisIntention │ │ │ │ │ └── description.html │ │ │ │ ├── AutoDevIntentionHelper │ │ │ │ │ ├── before.txt.template │ │ │ │ │ ├── description.html │ │ │ │ │ └── after.txt.template │ │ │ │ ├── CodeCompletionIntention │ │ │ │ │ ├── description.html │ │ │ │ │ ├── after.txt.template │ │ │ │ │ └── before.txt.template │ │ │ │ └── DefaultDocumentationIntention │ │ │ │ │ └── description.html │ │ │ ├── fileTemplates │ │ │ │ ├── code │ │ │ │ │ └── Java Controller.java.ft │ │ │ │ └── internal │ │ │ │ │ └── Custom Prompt Action.vm.ft │ │ │ ├── META-INF │ │ │ │ ├── docker.xml │ │ │ │ └── json-contrib.xml │ │ │ ├── prompts │ │ │ │ └── default │ │ │ │ │ ├── lookup_or_create_endpoint.vm │ │ │ │ │ ├── create_story_detail.vm │ │ │ │ │ ├── update_service_method.vm │ │ │ │ │ └── create_controller.vm │ │ │ └── icons │ │ │ │ ├── stop.svg │ │ │ │ └── check.svg │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── devti │ │ │ ├── settings │ │ │ ├── miscs │ │ │ │ ├── TokenLength.kt │ │ │ │ └── ResponseType.kt │ │ │ ├── ui │ │ │ │ └── ModelItem.kt │ │ │ ├── coder │ │ │ │ └── AutoDevCoderConfigurableProvider.kt │ │ │ ├── customize │ │ │ │ └── CustomizeConfigurableProvider.kt │ │ │ └── locale │ │ │ │ └── LocaleLanguages.kt │ │ │ ├── observer │ │ │ ├── agent │ │ │ │ └── AgentProcessor.kt │ │ │ └── plan │ │ │ │ └── PlanUpdateListener.kt │ │ │ ├── context │ │ │ ├── base │ │ │ │ ├── LLMCodeContext.kt │ │ │ │ └── LLMCodeContextProvider.kt │ │ │ └── builder │ │ │ │ ├── VariableContextBuilder.kt │ │ │ │ └── MethodContextBuilder.kt │ │ │ ├── agent │ │ │ ├── tool │ │ │ │ ├── Tool.kt │ │ │ │ └── browse │ │ │ │ │ ├── DocumentContent.kt │ │ │ │ │ └── Browse.kt │ │ │ └── extention │ │ │ │ ├── A2aServer.kt │ │ │ │ └── McpConfig.kt │ │ │ ├── provider │ │ │ ├── context │ │ │ │ ├── ChatOrigin.kt │ │ │ │ ├── ChatContextItem.kt │ │ │ │ └── ChatCreationContext.kt │ │ │ ├── runner │ │ │ │ ├── RunnerResultSeverity.kt │ │ │ │ └── RunnerStatus.kt │ │ │ └── http │ │ │ │ └── HttpClientProvider.kt │ │ │ ├── llms │ │ │ ├── recording │ │ │ │ ├── Recording.kt │ │ │ │ ├── EmptyRecording.kt │ │ │ │ └── RecordingInstruction.kt │ │ │ ├── tokenizer │ │ │ │ └── Tokenizer.kt │ │ │ └── custom │ │ │ │ └── SSE.kt │ │ │ ├── custom │ │ │ ├── CustomExtContext.kt │ │ │ ├── variable │ │ │ │ ├── VariableResolver.kt │ │ │ │ ├── SpecVariableResolver.kt │ │ │ │ ├── CustomResolvedVariableType.kt │ │ │ │ ├── SelectionVariableResolver.kt │ │ │ │ ├── ClassStructureVariableResolver.kt │ │ │ │ └── MethodInputOutputVariableResolver.kt │ │ │ ├── action │ │ │ │ ├── CustomIntentionPrompt.kt │ │ │ │ └── CustomIntentionConfig.kt │ │ │ └── schema │ │ │ │ └── InlayCodePromptsJsonSchemaProviderFactory.kt │ │ │ ├── devins │ │ │ ├── variable │ │ │ │ ├── Variable.kt │ │ │ │ └── VariableProvider.kt │ │ │ ├── provider │ │ │ │ ├── vcs │ │ │ │ │ ├── ShireFileBranch.kt │ │ │ │ │ ├── ShireFileCommit.kt │ │ │ │ │ └── ShireGitCommit.kt │ │ │ │ ├── terminal │ │ │ │ │ └── TerminalHandler.kt │ │ │ │ └── PsiCapture.kt │ │ │ └── PostFunction.kt │ │ │ ├── flow │ │ │ ├── model │ │ │ │ └── SimpleStory.kt │ │ │ └── kanban │ │ │ │ └── Kanban.kt │ │ │ ├── gui │ │ │ └── chat │ │ │ │ ├── message │ │ │ │ ├── ChatContext.kt │ │ │ │ └── ChatRole.kt │ │ │ │ └── ui │ │ │ │ └── AutoDevInputListener.kt │ │ │ ├── a2a │ │ │ └── AgentRequest.kt │ │ │ ├── history │ │ │ └── ChatSessionHistory.kt │ │ │ ├── statusbar │ │ │ ├── AutoDevStatusListener.kt │ │ │ └── AutoDevStatus.kt │ │ │ ├── mcp │ │ │ ├── host │ │ │ │ └── McpParam.kt │ │ │ └── ui │ │ │ │ └── model │ │ │ │ └── McpMessage.kt │ │ │ ├── vcs │ │ │ ├── VcsUtil.kt │ │ │ └── gitignore │ │ │ │ └── InvalidGitIgnorePatternException.kt │ │ │ ├── intentions │ │ │ └── action │ │ │ │ └── test │ │ │ │ └── TestCodeGenRequest.kt │ │ │ ├── inline │ │ │ └── AutoDevInlineChatProvider.kt │ │ │ ├── sketch │ │ │ ├── AutoSketchModeListener.kt │ │ │ └── ui │ │ │ │ ├── MarkdownPreviewSketchProvider.kt │ │ │ │ └── code │ │ │ │ └── HtmlHighlightSketch.kt │ │ │ ├── bridge │ │ │ ├── provider │ │ │ │ └── DatabaseFunction.kt │ │ │ └── archview │ │ │ │ └── model │ │ │ │ └── UiComponent.kt │ │ │ ├── inlay │ │ │ └── codecomplete │ │ │ │ └── InlayDisposeContext.kt │ │ │ ├── actions │ │ │ └── chat │ │ │ │ └── ExplainThisAction.kt │ │ │ ├── command │ │ │ ├── InsCommand.kt │ │ │ └── dataprovider │ │ │ │ └── FileFunc.kt │ │ │ ├── prompting │ │ │ └── code │ │ │ │ └── TechStack.kt │ │ │ ├── ui.kt │ │ │ └── AutoDevSnippetFile.kt │ │ └── test │ │ ├── resources │ │ ├── java │ │ │ └── endpoint │ │ │ │ └── HelloController.java │ │ └── META-INF │ │ │ └── plugin.xml │ │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── devti │ │ └── custom │ │ └── variable │ │ └── CustomVariableTest.kt ├── mpp-idea-lang │ ├── javascript │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ └── ts │ │ │ │ └── Sample.tsx │ │ │ └── main │ │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── ide │ │ │ └── javascript │ │ │ ├── provider │ │ │ └── testing │ │ │ │ └── JestCodeModifier.kt │ │ │ └── util │ │ │ └── JsUtil.kt │ ├── kotlin │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── cc │ │ │ └── unitmesh │ │ │ └── kotlin │ │ │ └── provider │ │ │ ├── KotlinCustomPromptProvider.kt │ │ │ └── KotlinContextPrompter.kt │ ├── java │ │ └── src │ │ │ ├── main │ │ │ └── kotlin │ │ │ │ └── cc │ │ │ │ └── unitmesh │ │ │ │ └── idea │ │ │ │ ├── flow │ │ │ │ └── ControllerContext.kt │ │ │ │ ├── observer │ │ │ │ └── GradleTaskAgentObserver.kt │ │ │ │ └── MvcUtil.kt │ │ │ └── test │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── plugin.xml │ ├── goland │ │ └── src │ │ │ └── test │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── plugin.xml │ ├── rust │ │ └── src │ │ │ └── test │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── plugin.xml │ └── pycharm │ │ └── src │ │ └── test │ │ └── resources │ │ └── META-INF │ │ └── plugin.xml ├── CHANGELOG.md └── src │ └── main │ ├── resources │ └── messages │ │ └── AutoDevIdeaBundle.properties │ └── kotlin │ └── cc │ └── unitmesh │ └── devins │ └── idea │ └── renderer │ └── nano │ └── components │ └── JewelTypeAliases.kt ├── mpp-viewer-web ├── .gitignore └── src │ ├── commonMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── viewer │ │ └── web │ │ ├── MermaidHtml.kt │ │ └── webedit │ │ └── WebEditAction.kt │ ├── jsMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── viewer │ │ └── web │ │ └── MermaidHtml.js.kt │ └── jvmMain │ └── kotlin │ └── cc │ └── unitmesh │ └── viewer │ └── web │ └── automation │ └── TestModels.kt ├── mpp-web ├── public │ ├── CNAME │ ├── robots.txt │ ├── index.html │ └── sitemap.xml ├── src │ ├── main.tsx │ ├── polyfills │ │ └── ws-polyfill.ts │ └── Router.tsx └── README.md ├── .adr.json ├── xiuper-ui ├── testcases │ ├── .gitignore │ ├── actual │ │ ├── .gitkeep │ │ └── integration │ │ │ └── 01-simple-card-OK.nanodsl │ └── expect │ │ ├── 01-simple-card.nanodsl │ │ ├── 03-counter-card.nanodsl │ │ └── 02-product-card.nanodsl └── src │ ├── main │ └── resources │ │ ├── prompts │ │ ├── minimal.txt │ │ └── examples │ │ │ ├── counter.nanodsl │ │ │ └── product-card.nanodsl │ │ └── logback.xml │ ├── commonMain │ ├── resources │ │ └── prompts │ │ │ ├── minimal.txt │ │ │ └── examples │ │ │ ├── counter.nanodsl │ │ │ └── product-card.nanodsl │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── xuiper │ │ ├── render │ │ └── theme │ │ │ ├── NanoDesignSystemSpec.kt │ │ │ └── NanoThemeFamily.kt │ │ └── prompt │ │ └── ResourceLoader.kt │ ├── jvmMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── xuiper │ │ └── prompt │ │ └── ResourceLoader.jvm.kt │ └── androidMain │ └── kotlin │ └── cc │ └── unitmesh │ └── xuiper │ └── prompt │ └── ResourceLoader.android.kt ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── mpp-core └── src │ ├── jvmTest │ └── resources │ │ ├── sample.ppt │ │ ├── sample.pptx │ │ ├── sample2.pdf │ │ ├── word-sample.doc │ │ └── word-sample.docx │ ├── iosMain │ ├── cinterop │ │ └── mcpBridge.def │ ├── kotlin │ │ └── cc │ │ │ └── unitmesh │ │ │ ├── agent │ │ │ ├── config │ │ │ │ └── McpServerLoadingState.ios.kt │ │ │ ├── logging │ │ │ │ ├── LoggingInitializer.ios.kt │ │ │ │ └── AutoDevLogger.ios.kt │ │ │ ├── linter │ │ │ │ └── LinterRegistry.ios.kt │ │ │ ├── tool │ │ │ │ └── impl │ │ │ │ │ ├── IosCodeParserFactory.kt │ │ │ │ │ └── http │ │ │ │ │ ├── HttpFetcherFactory.ios.kt │ │ │ │ │ └── HttpClientFactory.ios.kt │ │ │ └── database │ │ │ │ └── DatabaseConnection.ios.kt │ │ │ ├── devins │ │ │ └── document │ │ │ │ └── DocumentRegistry.ios.kt │ │ │ └── llm │ │ │ └── ExecutorFactory.ios.kt │ └── swift │ │ └── McpClientBridge.h │ ├── jvmMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── agent │ │ ├── config │ │ └── McpServerLoadingState.jvm.kt │ │ ├── tool │ │ └── impl │ │ │ ├── JvmCodeParserFactory.kt │ │ │ └── HttpFetcherFactory.jvm.kt │ │ └── logging │ │ └── PlatformLogging.jvm.kt │ ├── androidMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ ├── agent │ │ ├── config │ │ │ └── McpServerLoadingState.android.kt │ │ ├── linter │ │ │ └── LinterRegistry.android.kt │ │ ├── tool │ │ │ └── impl │ │ │ │ └── HttpFetcherFactory.android.kt │ │ └── database │ │ │ └── DatabaseConnection.android.kt │ │ └── devins │ │ └── document │ │ └── DocumentRegistry.android.kt │ ├── jsMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ ├── agent │ │ ├── config │ │ │ └── McpServerLoadingState.js.kt │ │ ├── tool │ │ │ └── impl │ │ │ │ ├── JsCodeParserFactory.kt │ │ │ │ └── HttpFetcherFactory.js.kt │ │ ├── database │ │ │ └── DatabaseConnection.js.kt │ │ └── logging │ │ │ └── PlatformLogging.js.kt │ │ └── llm │ │ └── ExecutorFactory.js.kt │ ├── wasmJsMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ ├── agent │ │ ├── config │ │ │ └── McpServerLoadingState.wasmJs.kt │ │ ├── linter │ │ │ └── LinterRegistry.wasmJs.kt │ │ ├── tool │ │ │ └── impl │ │ │ │ └── WasmJsCodeParserFactory.kt │ │ ├── database │ │ │ └── DatabaseConnection.wasmJs.kt │ │ └── logging │ │ │ └── PlatformLogging.wasmJs.kt │ │ ├── devins │ │ └── document │ │ │ └── DocumentRegistry.wasmJs.kt │ │ └── llm │ │ └── ExecutorFactory.wasmJs.kt │ └── commonMain │ └── kotlin │ └── cc │ └── unitmesh │ ├── agent │ ├── config │ │ └── ChatConfig.kt │ └── tool │ │ └── impl │ │ └── http │ │ ├── HttpFetcherFactory.kt │ │ └── HttpClientFactory.kt │ └── devins │ └── llm │ └── SessionStorage.kt ├── mpp-ios ├── AutoDevApp │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AutoDevApp.swift │ └── ContentView.swift └── Podfile 2 ├── src ├── main │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── devti │ │ └── Placeholder.kt └── description.html ├── mpp-server ├── src │ └── main │ │ ├── kotlin │ │ └── cc │ │ │ └── unitmesh │ │ │ └── server │ │ │ ├── plugins │ │ │ ├── SSE.kt │ │ │ └── Serialization.kt │ │ │ └── ServerApplication.kt │ │ └── resources │ │ └── application.conf └── railway.json ├── xiuper-fs └── src │ ├── iosMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── xiuper │ │ └── fs │ │ └── db │ │ └── DatabaseDriverFactory.kt │ ├── commonMain │ ├── sqldelight │ │ └── cc │ │ │ └── unitmesh │ │ │ └── xiuper │ │ │ └── fs │ │ │ └── db │ │ │ └── migrations │ │ │ └── 1.sqm │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── xiuper │ │ └── fs │ │ └── BackendCapabilities.kt │ ├── jvmMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── xiuper │ │ └── fs │ │ └── db │ │ └── DatabaseDriverFactory.kt │ ├── commonTest │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── xiuper │ │ └── fs │ │ └── FsPathTest.kt │ └── androidMain │ └── kotlin │ └── cc │ └── unitmesh │ └── xiuper │ └── fs │ └── db │ └── DatabaseDriverFactory.kt ├── mpp-codegraph └── src │ ├── jsMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── codegraph │ │ └── CodeGraphFactory.kt │ ├── iosMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── codegraph │ │ └── CodeGraphFactory.kt │ ├── jvmMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── codegraph │ │ └── CodeGraphFactory.kt │ ├── wasmJsMain │ └── kotlin │ │ └── cc │ │ └── unitmesh │ │ └── codegraph │ │ └── CodeGraphFactory.kt │ └── commonMain │ └── kotlin │ └── cc │ └── unitmesh │ └── codegraph │ └── CodeGraphFactory.kt ├── settings.gradle.kts ├── .github └── dependabot.yml └── render.yaml /.idea/.name: -------------------------------------------------------------------------------- 1 | Xiuper -------------------------------------------------------------------------------- /gradle-252.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mpp-vscode/.gitignore: -------------------------------------------------------------------------------- 1 | *.vsix 2 | -------------------------------------------------------------------------------- /example/custom_llm_server/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mpp-ui/.gitignore: -------------------------------------------------------------------------------- 1 | kcef-bundle 2 | kcef-cache -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/.gitignore: -------------------------------------------------------------------------------- 1 | exts/devin-lang 2 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/.gitignore: -------------------------------------------------------------------------------- 1 | src/gen -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/.gitignore: -------------------------------------------------------------------------------- 1 | src/gen -------------------------------------------------------------------------------- /mpp-viewer-web/.gitignore: -------------------------------------------------------------------------------- 1 | kcef-bundle 2 | kcef-cache -------------------------------------------------------------------------------- /mpp-web/public/CNAME: -------------------------------------------------------------------------------- 1 | www.xuiper.com 2 | 3 | 4 | -------------------------------------------------------------------------------- /.adr.json: -------------------------------------------------------------------------------- 1 | {"language":"en","path":"docs/adr/","prefix":"","digits":4} -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/code/code-complete.vm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/code/code-complete.vm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/custom_llm_server/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi==0.109.1 2 | requests==2.31.0 3 | uvicorn 4 | sseclient-py -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/open.devin: -------------------------------------------------------------------------------- 1 | /open:.github/dependabot.yml -------------------------------------------------------------------------------- /mpp-vscode/media/autodev.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-vscode/media/autodev.woff -------------------------------------------------------------------------------- /example/custom_agent/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi==0.110.0 2 | uvicorn~=0.27.1 3 | pydantic~=2.6.3 4 | starlette~=0.49.1 -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoSqlAction/after.txt.template: -------------------------------------------------------------------------------- 1 | // query recently blog -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/browse.devin: -------------------------------------------------------------------------------- 1 | /browse:https://ide.unitmesh.cc -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/file-func.devin: -------------------------------------------------------------------------------- 1 | /file-func:regex(".*\.txt") -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/x.devin: -------------------------------------------------------------------------------- 1 | /dependencies [list all dependencies] -------------------------------------------------------------------------------- /mpp-vscode/media/pluginIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-vscode/media/pluginIcon.png -------------------------------------------------------------------------------- /xiuper-ui/testcases/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore AI-generated outputs 2 | actual/*.nanodsl 3 | actual/*.json 4 | *.html 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoDevIntention/before.txt.template: -------------------------------------------------------------------------------- 1 | String s = -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/RefactorThisIntention/description.html: -------------------------------------------------------------------------------- 1 | Auto refactor code -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/symbol.devin: -------------------------------------------------------------------------------- 1 | /symbol:cc.unitmesh.devti.language.psi -------------------------------------------------------------------------------- /mpp-web/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://www.xuiper.com/sitemap.xml 5 | 6 | 7 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/related.devin: -------------------------------------------------------------------------------- 1 | /related:cc.unitmesh.devti.language.psi -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon.ico -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/fileTemplates/code/Java Controller.java.ft: -------------------------------------------------------------------------------- 1 | package ${packageName}; 2 | 3 | ${code} 4 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoDevIntentionHelper/before.txt.template: -------------------------------------------------------------------------------- 1 | String s = -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/structure.devin: -------------------------------------------------------------------------------- 1 | /structure:cc.unitmesh.devti.language.psi -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/intentionDescriptions/ShireIntention/before.txt.template: -------------------------------------------------------------------------------- 1 | 生成一个 Java hello, world: -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-16.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-32.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-48.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-64.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon.icns -------------------------------------------------------------------------------- /mpp-core/src/jvmTest/resources/sample.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-core/src/jvmTest/resources/sample.ppt -------------------------------------------------------------------------------- /mpp-core/src/jvmTest/resources/sample.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-core/src/jvmTest/resources/sample.pptx -------------------------------------------------------------------------------- /mpp-core/src/jvmTest/resources/sample2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-core/src/jvmTest/resources/sample2.pdf -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/practises/release-note.vm: -------------------------------------------------------------------------------- 1 | 根据如下的提交信息,生成本次发布的 Release Note:: 2 | 3 | $context.commitMsgs -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/CodeCompletionIntention/description.html: -------------------------------------------------------------------------------- 1 | Invoke Code completion on here. -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-128.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-256.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon-512.png -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/resources/icon.ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/jvmMain/resources/icon.ico.png -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/quick/quick-action.vm: -------------------------------------------------------------------------------- 1 | 生成一个简洁的代码片段,不包含额外的文本、描述或注释。该代码应实现以下任务: 2 | 3 | ${context.task} 4 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoDevIntentionHelper/description.html: -------------------------------------------------------------------------------- 1 | Invoke AutoDev Action on here. -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoSqlAction/description.html: -------------------------------------------------------------------------------- 1 | Invoke AutoDev Generate Action on here. -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/intentionDescriptions/ShireIntentionHelper/before.txt.template: -------------------------------------------------------------------------------- 1 | 生成一个 Java hello, world: -------------------------------------------------------------------------------- /mpp-ios/AutoDevApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | 8 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/cinterop/mcpBridge.def: -------------------------------------------------------------------------------- 1 | language = Objective-C 2 | headers = McpClientBridge.h 3 | compilerOpts = -framework Foundation 4 | 5 | -------------------------------------------------------------------------------- /mpp-core/src/jvmTest/resources/word-sample.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-core/src/jvmTest/resources/word-sample.doc -------------------------------------------------------------------------------- /mpp-core/src/jvmTest/resources/word-sample.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-core/src/jvmTest/resources/word-sample.docx -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/containerView.devin: -------------------------------------------------------------------------------- 1 | List all modules of current project 2 | /containerView -------------------------------------------------------------------------------- /mpp-ios/Podfile 2: -------------------------------------------------------------------------------- 1 | platform :ios, '14.0' 2 | use_frameworks! 3 | 4 | target 'AutoDevApp' do 5 | pod 'AutoDevUI', :path => '../mpp-ui' 6 | end 7 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/practises/release-note.vm: -------------------------------------------------------------------------------- 1 | Generate release note based on follow info: 2 | 3 | $context.commitMsgs -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoDevIntention/after.txt.template: -------------------------------------------------------------------------------- 1 | String url = "https://ide.unitmesh.cc/"; -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/database.devin: -------------------------------------------------------------------------------- 1 | 列出数据库的数据结构 2 | /database:schema 3 | 列出数据库中的所有表 4 | /database:table -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/stylingView.devin: -------------------------------------------------------------------------------- 1 | List all CSS, SCSS classes of current project 2 | /stylingView -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/res/font/firacode_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/androidMain/res/font/firacode_bold.ttf -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoDevIntentionHelper/after.txt.template: -------------------------------------------------------------------------------- 1 | String url = "https://ide.unitmesh.cc/"; -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/CodeCompletionIntention/after.txt.template: -------------------------------------------------------------------------------- 1 | String url = "https://www.phodal.com"; -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/CodeCompletionIntention/before.txt.template: -------------------------------------------------------------------------------- 1 | String s = "https://www.phodal.com"; -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/history.devin: -------------------------------------------------------------------------------- 1 | Get history commit message of current file 2 | /history:package.json -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/rev.devin: -------------------------------------------------------------------------------- 1 | 只支持获取某个 sha hash 的代码变更 2 | /rev:38d23de2 3 | 如果想进行更多的操作,请使用 bash + git 来获取 -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/res/font/firacode_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/androidMain/res/font/firacode_medium.ttf -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/res/font/firacode_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/androidMain/res/font/firacode_regular.ttf -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/resources/fonts/FiraCode-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/commonMain/resources/fonts/FiraCode-Bold.ttf -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/miscs/TokenLength.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.settings.miscs 2 | 3 | val MAX_TOKEN_LENGTH = 128000 -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/META-INF/docker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/resources/fonts/FiraCode-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/commonMain/resources/fonts/FiraCode-Medium.ttf -------------------------------------------------------------------------------- /xiuper-ui/testcases/actual/.gitkeep: -------------------------------------------------------------------------------- 1 | # This directory contains AI-generated DSL outputs 2 | # Files are generated by running: ./gradlew :xiuper-ui:runDslEval 3 | 4 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/DefaultDocumentationIntention/description.html: -------------------------------------------------------------------------------- 1 | Auto generate documentation for the current class or method. -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/intentionDescriptions/ShireIntention/description.html: -------------------------------------------------------------------------------- 1 | Invoke Shire Hobbit Action on here with AI ability. 2 | -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/resources/fonts/FiraCode-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/auto-dev/master/mpp-ui/src/commonMain/resources/fonts/FiraCode-Regular.ttf -------------------------------------------------------------------------------- /src/main/kotlin/cc/unitmesh/devti/Placeholder.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti 2 | 3 | /// Intellij Gradle Plugin required for not empty package 4 | class Placeholder { 5 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/dependencies.devin: -------------------------------------------------------------------------------- 1 | Get all dependencies (Gradle, Maven, package.json) of current project 2 | /dependencies -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/intentionDescriptions/ShireIntentionHelper/description.html: -------------------------------------------------------------------------------- 1 | Invoke Shire Hobbit Action on here with AI ability. 2 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/componentView.devin: -------------------------------------------------------------------------------- 1 | List all UI Component List of current project, like React Vue components 2 | /componentView -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/scc.devin: -------------------------------------------------------------------------------- 1 | Scc is a very fast accurate code counter with complexity calculations and COCOMO estimates 2 | /scc -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/shell.devin: -------------------------------------------------------------------------------- 1 | 执行 shell 脚本,要考虑生成的脚本是非阻塞的,即可以读取标准输入 2 | /shell:execute 3 | ```bash 4 | echo "Hello, World!" 5 | ``` -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/AutoDevApp.apple.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose 2 | 3 | // iOS uses appleMain implementation of PlatformAutoDevApp. 4 | 5 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/miscs/ResponseType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.settings.miscs 2 | 3 | enum class ResponseType { 4 | SSE, JSON; 5 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/cicd/generate-github-action.vm: -------------------------------------------------------------------------------- 1 | 创建 build.yml 文件,用于 GitHub Action 构建项目并运行测试。 2 | 3 | - ${context.buildContext} 4 | - OS: 最新版本的ubuntu 5 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/run.devin: -------------------------------------------------------------------------------- 1 | 启动 Spring 应用运行测试 2 | /run::bootRun 3 | 运行测试 4 | /run:src/main/cc/unitmesh/PythonPromptStrategyTest.kt 5 | -------------------------------------------------------------------------------- /mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/config/McpServerLoadingState.jvm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.config 2 | 3 | actual fun getCurrentTimeMillis(): Long = System.currentTimeMillis() 4 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/agent/AgentProcessor.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.observer.agent 2 | 3 | interface AgentProcessor { 4 | fun process() 5 | } 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/shireql/ShireQLSchema.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.shireql 2 | 3 | interface ShireQLSchema { 4 | 5 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/rule.devin: -------------------------------------------------------------------------------- 1 | 用户可以通过 rule 来自定义编程规范,以生成更符合自己需要的代码。 2 | 获取 service 相关的规则(将读取 promtps/rule/service.md 文件,请确保文件存在) 3 | /rule:service -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/context/base/LLMCodeContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.context.base 2 | 3 | interface LLMCodeContext { 4 | fun format(): String 5 | } 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/error/DevInError.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.compiler.error 2 | 3 | val DEVINS_ERROR = "" -------------------------------------------------------------------------------- /mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/config/McpServerLoadingState.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.config 2 | 3 | actual fun getCurrentTimeMillis(): Long = System.currentTimeMillis() 4 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/Tool.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.agent.tool 2 | 3 | public interface Tool { 4 | val name: String 5 | val description: String 6 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/context/ChatOrigin.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.provider.context 2 | 3 | enum class ChatOrigin { 4 | ChatAction, 5 | Intention 6 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoSqlAction/before.txt.template: -------------------------------------------------------------------------------- 1 | SELECT title, content, author, published_at 2 | FROM blogs 3 | ORDER BY published_at DESC 4 | LIMIT 10; 5 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/dir.devin: -------------------------------------------------------------------------------- 1 | 列出目录内容,默认深度为2,支持智能深度处理(单路径结构自动深入遍历,适合Java等层级深的结构,自动排除二进制文件、.idea目录和被版本控制系统忽略的文件)。 2 | /dir:. 3 | 列出特定目录: 4 | /dir:src/components -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/refactor.devin: -------------------------------------------------------------------------------- 1 | /refactor:rename cc.unitmesh.devti.language.run.DevInsProgramRunner to cc.unitmesh.devti.language.run.DevInsProgramRunnerImpl -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/webApiView.devin: -------------------------------------------------------------------------------- 1 | List all web apis of current project 2 | /webApiView 3 | If return no endpoints, we need to check Endpoint plugin installed. -------------------------------------------------------------------------------- /mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/config/McpServerLoadingState.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.config 2 | 3 | import kotlin.js.Date 4 | 5 | actual fun getCurrentTimeMillis(): Long = Date.now().toLong() 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/javascript/src/test/resources/ts/Sample.tsx: -------------------------------------------------------------------------------- 1 | class MyDocument { 2 | render() { 3 | return ( 4 |
5 | ); 6 | } 7 | } 8 | 9 | export default MyDocument; -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/recording/Recording.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.llms.recording 2 | 3 | interface Recording { 4 | fun write(instruction: RecordingInstruction) 5 | } 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/file.devin: -------------------------------------------------------------------------------- 1 | 找到指定文件(需要知道正确的文件路径,否则无法找到) 2 | /file:.github/dependabot.yml#L1C1-L2C12 3 | 根据文件名全局搜索(大小写敏感,不带路径) 4 | /file:PythonFrameworkContextProvider.kt -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/sre/generate-dockerfile.vm: -------------------------------------------------------------------------------- 1 | 请编写一个最小步骤的 Dockerfile。 2 | 3 | ${context.buildContext} 4 | 5 | - 我需要在与运行构建不同的基础镜像中进行构建 6 | - 我需要应用程序端口为 3000 7 | 8 | 仅输出 Dockerfile 内容,不要附带任何解释。 -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/DevInAstFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language 2 | 3 | import com.intellij.lang.ASTFactory 4 | 5 | class DevInAstFactory : ASTFactory() 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Detects multiple @[AGENT_ID] annotations. Multiple @[AGENT_ID] are not allowed. 4 | 5 | -------------------------------------------------------------------------------- /xiuper-ui/src/main/resources/prompts/minimal.txt: -------------------------------------------------------------------------------- 1 | Generate NanoDSL UI code. Syntax: Python-style indentation, components: VStack, HStack, Card, Text, Button, Image, Input, Badge. Output only code in ```nanodsl fence. 2 | 3 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/CustomExtContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom 2 | 3 | enum class CustomExtContext(val agentName: String) { 4 | TestContext("@autodev.ext-context.test"), 5 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/cicd/generate-github-action.vm: -------------------------------------------------------------------------------- 1 | Create build.yml YAML file for GitHub Action for build project and runs tests 2 | 3 | - ${context.buildContext} 4 | - OS: latest ubuntu version 5 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/quick/quick-action.vm: -------------------------------------------------------------------------------- 1 | Generate a concise code snippet with no extra text, description, or comments. 2 | 3 | The code should achieve the following task: 4 | 5 | ${context.task} 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/localSearch.devin: -------------------------------------------------------------------------------- 1 | 在项目中搜索关键字搜索时,不能有空格,而且至少是 4 个字符: 2 | /localSearch:photo 3 | 当你需要带空格时,语法如下: 4 | /localSearch:project 5 | ``` 6 | select * from blog 7 | ``` 8 | -------------------------------------------------------------------------------- /xiuper-ui/src/commonMain/resources/prompts/minimal.txt: -------------------------------------------------------------------------------- 1 | Generate NanoDSL UI code. Syntax: Python-style indentation, components: VStack, HStack, Card, Text, Button, Image, Input, Badge. Output only code in ```nanodsl fence. 2 | 3 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternProcessor.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.action 2 | 3 | interface PatternProcessor { 4 | val type: PatternActionFuncDef 5 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/commit.devin: -------------------------------------------------------------------------------- 1 | Execute git commit with commit message 2 | /commit 3 | ```markdown 4 | follow Conventional Commits, like feat: add 'graphiteWidth' option 5 | ``` 6 | -------------------------------------------------------------------------------- /src/description.html: -------------------------------------------------------------------------------- 1 | AutoDev: The AI-powered coding wizard with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying 2 | assistant 🐞! Customizable prompts 🎨 and a magic Auto Testing feature 🧪 included! 🚀 3 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/knowledge.devin: -------------------------------------------------------------------------------- 1 | 从 API 调用链来进行分析,默认 depth = 2(不可修改),即 Controller 到 Repository 的调用链 2 | /knowledge:GET#/api/blog/* [注:这里 * 代表 blog slug,等同于 SpringMVC 的 @PathVariable] 3 | -------------------------------------------------------------------------------- /xiuper-ui/testcases/expect/01-simple-card.nanodsl: -------------------------------------------------------------------------------- 1 | component GreetingCard: 2 | Card(padding="md"): 3 | VStack(spacing="sm"): 4 | Text("Hello!", style="h2") 5 | Text("Welcome to our app", style="body") 6 | -------------------------------------------------------------------------------- /mpp-vscode/webview/src/components/plan/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Plan components for VS Code webview 3 | */ 4 | export { PlanSummaryBar } from './PlanSummaryBar'; 5 | export type { PlanData, PlanTask, PlanStep, TaskStatus } from './PlanSummaryBar'; 6 | 7 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/config/McpServerLoadingState.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.config 2 | 3 | import kotlinx.datetime.Clock 4 | 5 | actual fun getCurrentTimeMillis(): Long = Clock.System.now().toEpochMilliseconds() 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/variable/Variable.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.variable 2 | 3 | interface Variable { 4 | val variableName: String 5 | val description: String 6 | var value: Any? 7 | } 8 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/write.devin: -------------------------------------------------------------------------------- 1 | 注意:如果原先的文件已经存在,请优先考虑使用 file 读取文件信息,再通过 edit_file 2 | /write:src/main/kotlin/cc/unitmesh/context/CppFileContextBuilder.kt 3 | ```kotlin 4 | // the kotlin code 5 | ``` 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/extention/A2aServer.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.agent.extention 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class A2aServer( 7 | val url: String 8 | ) {} -------------------------------------------------------------------------------- /mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SSE.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.server.plugins 2 | 3 | import io.ktor.server.application.* 4 | import io.ktor.server.sse.* 5 | 6 | fun Application.configureSSE() { 7 | install(SSE) 8 | } 9 | 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/context/ChatContextItem.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.provider.context 2 | 3 | import kotlin.reflect.KClass 4 | 5 | class ChatContextItem( 6 | val clazz: KClass<*>, 7 | var text: String 8 | ) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/code/inline-chat.devin: -------------------------------------------------------------------------------- 1 | 你是个代码专家,请根据用户的选择代码来回答他的问题。 2 | 3 | 项目相关的上下文: 4 | 5 | $frameworkContext 6 | 7 | 用户的选择代码: 8 | 9 | ```${language} 10 | ${selection} 11 | ``` 12 | 13 | 用户的问题是: 14 | 15 | $input 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/lexer/DevInLexerAdapter.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.lexer 2 | 3 | import com.intellij.lexer.FlexAdapter 4 | 5 | class DevInLexerAdapter : FlexAdapter(_DevInLexer()) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/util/SqlUtil.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.database.util 2 | 3 | import com.intellij.database.model.basic.BasicTableOrViewColumn 4 | 5 | fun columnType(it: BasicTableOrViewColumn) = it.dasType.specification -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/config/McpServerLoadingState.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.config 2 | 3 | import kotlinx.datetime.Clock 4 | 5 | actual fun getCurrentTimeMillis(): Long { 6 | return Clock.System.now().toEpochMilliseconds() 7 | } 8 | 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/recording/EmptyRecording.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.llms.recording 2 | 3 | class EmptyRecording: Recording { 4 | override fun write(instruction: RecordingInstruction) { 5 | // do nothing 6 | } 7 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/lexer/NanoDSLLexerAdapter.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language.lexer 2 | 3 | import com.intellij.lexer.FlexAdapter 4 | 5 | class NanoDSLLexerAdapter : FlexAdapter(_NanoDSLLexer()) 6 | 7 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/test/resources/testcases/01-simple-card.nanodsl: -------------------------------------------------------------------------------- 1 | component GreetingCard: 2 | Card(padding="md"): 3 | VStack(spacing="sm"): 4 | Text("Hello!", style="h2") 5 | Text("Welcome to our app", style="body") 6 | -------------------------------------------------------------------------------- /example/prompt/autodev/tasking.md: -------------------------------------------------------------------------------- 1 | controller: 2 | 3 | 接收用户请求,获取博客信息。 4 | 调用博客创建服务,并传入博客信息。 5 | 根据服务返回结果,构造响应数据。 6 | 7 | service: 8 | 9 | 验证博客信息是否完整。 10 | 生成博客 id,并保存博客信息。 11 | 返回博客 id 或者对应的错误信息。 12 | 13 | dao: 14 | 15 | 保存博客信息到数据库中。 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/VariableResolver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | interface VariableResolver { 4 | val type: CustomResolvedVariableType 5 | fun resolve(): String 6 | fun variableName() = type.name 7 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/flow/model/SimpleStory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.flow.model 2 | 3 | /** 4 | * A simple story 5 | */ 6 | class SimpleStory( 7 | val id: String, 8 | val title: String, 9 | val description: String 10 | ) { 11 | 12 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCustomPromptProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.kotlin.provider 2 | 3 | import cc.unitmesh.idea.provider.JavaCustomPromptProvider 4 | 5 | class KotlinCustomPromptProvider : JavaCustomPromptProvider() { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /xiuper-ui/testcases/actual/integration/01-simple-card-OK.nanodsl: -------------------------------------------------------------------------------- 1 | component GreetingCard: 2 | Card: 3 | padding: "md" 4 | content: 5 | VStack(spacing="sm"): 6 | Text("Hello!", style="h2") 7 | Text("Welcome to NanoDSL", style="body") -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/usage.devin: -------------------------------------------------------------------------------- 1 | Query usage of some method, should use following format: .. 2 | /usage:cc.unitmesh.untitled.demo.service.BlogService.createBlog 3 | the return include file path, usage's method (caller) text. -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/intentionDescriptions/ShireIntention/after.txt.template: -------------------------------------------------------------------------------- 1 | 生成一个 Java hello, world: 2 | 3 | ```java 4 | public class HelloWorld { 5 | public static void main(String[] args) { 6 | System.out.println("Hello, World!"); 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/browse/DocumentContent.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.agent.tool.browse 2 | 3 | data class DocumentContent( 4 | val title: String?, 5 | val language: String?, 6 | val description: String?, 7 | val body: String? 8 | ) { 9 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/context/base/LLMCodeContextProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.context.base; 2 | 3 | import com.intellij.psi.PsiElement 4 | 5 | interface LLMCodeContextProvider { 6 | fun from(psiElement: T): LLMCodeContext? 7 | } 8 | 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/message/ChatContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.gui.chat.message 2 | 3 | data class ChatContext( 4 | val postAction: ((response: String) -> Unit)? = null, 5 | val prefixText: String = "", 6 | val suffixText: String = "" 7 | ) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/RuleBasedPatternAction.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.action 2 | 3 | class RuleBasedPatternAction(val pattern: String, override val processors: List) : 4 | DirectAction(processors) 5 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/intentionDescriptions/ShireIntentionHelper/after.txt.template: -------------------------------------------------------------------------------- 1 | 生成一个 Java hello, world: 2 | 3 | ```java 4 | public class HelloWorld { 5 | public static void main(String[] args) { 6 | System.out.println("Hello, World!"); 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/NanoDSLLanguage.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language 2 | 3 | import com.intellij.lang.Language 4 | 5 | object NanoDSLLanguage : Language("NanoDSL") { 6 | override fun getDisplayName(): String = "NanoDSL" 7 | } 8 | 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/message/ChatRole.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.gui.chat.message 2 | 3 | enum class ChatRole { 4 | System, 5 | Assistant, 6 | User; 7 | 8 | fun roleName(): String { 9 | return this.name.lowercase() 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/recording/RecordingInstruction.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.llms.recording 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class RecordingInstruction( 7 | val instruction: String, 8 | val output: String, 9 | ) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/a2a.devin: -------------------------------------------------------------------------------- 1 | /a2a:anyPlaceHolderInHere 2 | ```json 3 | { 4 | "agent": "code-reviewer", 5 | "message": "Please review this code for potential security vulnerabilities" 6 | } 7 | ``` 8 | 9 | "code-reviewer" should be AgentName 10 | -------------------------------------------------------------------------------- /mpp-ios/AutoDevApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/vcs/ShireFileBranch.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.provider.vcs 2 | 3 | data class ShireFileBranch( 4 | val name: String, 5 | override val count: Int, 6 | override val commits: List 7 | ) : CommitModel(count, commits) -------------------------------------------------------------------------------- /example/mcp/issues.mcp.json: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": { 3 | "autodev.commitMenu": { 4 | "command": "/Users/phodal/test/github-mcp-server/cmd/github-mcp-server/github-mcp-server", 5 | "args": ["stdio"], 6 | "env": { 7 | "GITHUB_PERSONAL_ACCESS_TOKEN": "xxx" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/patch.devin: -------------------------------------------------------------------------------- 1 | /patch 2 | ```patch 3 | Index: src/main/route.py 4 | --- src/main/route.py (revision 1) 5 | +++ src/main/route.py (revision 2) 6 | // GNU unified diff format structure 7 | ``` 8 | 9 | If patch failured, please use write command 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/flow/ControllerContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.idea.flow 2 | 3 | import com.intellij.psi.PsiClass 4 | 5 | data class ControllerContext( 6 | val services: List, 7 | val models: List, 8 | val repository: List = listOf(), 9 | ) -------------------------------------------------------------------------------- /mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/MermaidHtml.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.viewer.web 2 | 3 | /** 4 | * Get the Mermaid HTML content from resources 5 | * 6 | * This should be implemented in platform-specific code to load from resources 7 | */ 8 | expect fun getMermaidHtml(): String 9 | 10 | -------------------------------------------------------------------------------- /mpp-vscode/webview/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import App from './App'; 4 | import './styles/index.css'; 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | 8 | 9 | 10 | ); 11 | 12 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/tokenizer/Tokenizer.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.llms.tokenizer 2 | 3 | import com.knuddels.jtokkit.api.IntArrayList 4 | 5 | interface Tokenizer { 6 | fun getMaxLength(): Int 7 | fun count(string: String): Int 8 | fun tokenize(chunk: String): IntArrayList? 9 | } -------------------------------------------------------------------------------- /mpp-idea/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [Unreleased] 4 | 5 | ## [2.4.6] 6 | 7 | ### Features 8 | 9 | * Initial composite build structure for better module organization 10 | 11 | [Unreleased]: https://github.com/unit-mesh/auto-dev/compare/v2.4.6...HEAD 12 | [2.4.6]: https://github.com/unit-mesh/auto-dev/commits/v2.4.6 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/code/inline-chat.devin: -------------------------------------------------------------------------------- 1 | According user's selection code and question to answer user's question. 2 | 3 | Project context: 4 | 5 | $frameworkContext 6 | 7 | User's selection code: 8 | 9 | ```${language} 10 | ${selection} 11 | ``` 12 | 13 | User's question: 14 | 15 | $input 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/psi/DevInElementType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.psi 2 | 3 | import cc.unitmesh.devti.language.DevInLanguage 4 | import com.intellij.psi.tree.IElementType 5 | 6 | class DevInElementType(debugName: String): IElementType(debugName, DevInLanguage.INSTANCE) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/base/SqlMigrationContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.database.actions.base 2 | 3 | import cc.unitmesh.devti.template.context.TemplateContext 4 | 5 | data class SqlMigrationContext( 6 | val lang: String = "", 7 | var sql: String = "", 8 | ) : TemplateContext -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinContextPrompter.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.kotlin.provider 2 | 3 | import cc.unitmesh.idea.prompting.JavaContextPrompter 4 | 5 | class KotlinContextPrompter: JavaContextPrompter() { 6 | override val psiElementDataBuilder = KotlinPsiElementDataBuilder() 7 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/AgentRequest.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.a2a 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | /** 6 | * Request for A2A agent communication 7 | */ 8 | @Serializable 9 | data class AgentRequest( 10 | val agent: String, 11 | val message: String 12 | ) 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/META-INF/json-contrib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/resources/genius/en/migration/gen-entity.vm: -------------------------------------------------------------------------------- 1 | You are a professional application migration programmer. Based on following Oracle PL/SQL code to Java entity, 2 | just need to convert the code to Java entity, no need to write any code logic. 3 | 4 | ```${context.lang} 5 | ${context.sql} 6 | ``` 7 | 8 | 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/resources/genius/zh/migration/gen-entity.vm: -------------------------------------------------------------------------------- 1 | You are a professional application migration programmer. Based on following Oracle PL/SQL code to Java entity, 2 | just need to convert the code to Java entity, no need to write any code logic. 3 | 4 | ```${context.lang} 5 | ${context.sql} 6 | ``` 7 | 8 | 9 | -------------------------------------------------------------------------------- /mpp-server/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | ktor { 2 | deployment { 3 | port = 8080 4 | port = ${?SERVER_PORT} 5 | host = "0.0.0.0" 6 | host = ${?SERVER_HOST} 7 | } 8 | 9 | application { 10 | modules = [ cc.unitmesh.server.ServerApplicationKt.module ] 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 31 14:10:42 CST 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/sre/generate-dockerfile.vm: -------------------------------------------------------------------------------- 1 | Please write a Dockerfile with minimal steps. 2 | 3 | ${context.buildContext} 4 | - I need the building to be done in separate base image than running the build 5 | - I need the application port to be 3000 6 | 7 | Output only the Dockerfile content without any explanation. 8 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/agents.devin: -------------------------------------------------------------------------------- 1 | List all available agents. 2 | 3 | /agents 4 | 5 | Invoke a specific agent with JSON format: 6 | 7 | /agents 8 | ```json 9 | { 10 | "agent": "code-reviewer", 11 | "message": "Please review this code for potential security vulnerabilities" 12 | } 13 | ``` 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/psi/NanoDSLElementType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language.psi 2 | 3 | import cc.unitmesh.nanodsl.language.NanoDSLLanguage 4 | import com.intellij.psi.tree.IElementType 5 | 6 | class NanoDSLElementType(debugName: String) : IElementType(debugName, NanoDSLLanguage) 7 | 8 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/logging/LoggingInitializer.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.logging 2 | 3 | actual fun initializePlatformLogging(config: LoggingConfig) { 4 | // iOS logging initialization 5 | // For now, we'll use simple console logging 6 | println("iOS logging initialized with level: ${config.logLevel}") 7 | } 8 | 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/extention/McpConfig.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.agent.extention 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class McpConfig( 7 | val mcpServers: Map = emptyMap(), 8 | val a2aServers: Map = emptyMap() 9 | ) 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/PostFunction.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins 2 | 3 | import com.intellij.openapi.util.TextRange 4 | 5 | /** 6 | * Don't remove public modifier, it's required Kotlin compile, in IDEA will failed. 7 | */ 8 | public typealias PostFunction = (response: String?, textRange: TextRange?) -> Unit 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/intentionDescriptions/AutoDevIntention/description.html: -------------------------------------------------------------------------------- 1 | InvokeAutoDev AI Intention Action on here. he AI-powered coding wizard with multilingual support 🌐, 2 | auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic 3 | Auto Dev/Testing/Document feature 🧪 included! 🚀 -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.nano 2 | 3 | internal actual suspend fun platformReadCachedImageBytes(key: String): ByteArray? = null 4 | 5 | internal actual suspend fun platformWriteCachedImageBytes(key: String, bytes: ByteArray) { 6 | // No persistent storage wired for JS target yet. 7 | } 8 | -------------------------------------------------------------------------------- /mpp-vscode/webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | AutoDev Chat 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/action/CustomIntentionPrompt.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.action 2 | 3 | import cc.unitmesh.devti.provider.context.ChatContextItem 4 | 5 | class CustomIntentionPrompt( 6 | val displayPrompt: String, 7 | val requestPrompt: String, 8 | val contextItems: List = listOf() 9 | ) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/prompts/default/lookup_or_create_endpoint.vm: -------------------------------------------------------------------------------- 1 | 你是一个资深的后端 CRUD 工程师,请根据下面的用户故事 和 Controller 列表。要求: 2 | 3 | - 请在下面的 Controller 列表中,寻找并返回最合适的 Controller 名字 4 | - 如果无法在给定列表中找到合适的 Controller 名字,请你自行设计一个合适的 Controller 名字。 5 | 6 | Controller 列表: 7 | 8 | ### 9 | {controllers} 10 | ### 11 | 12 | ### 13 | {storyDetail} 14 | ### 15 | -------------------------------------------------------------------------------- /mpp-vscode/resources/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.linter 2 | 3 | /** 4 | * iOS platform-specific linter registration 5 | */ 6 | actual fun registerPlatformLinters(registry: LinterRegistry) { 7 | // iOS doesn't typically run linters directly 8 | // Linters are usually run on development machines 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/vcs/ShireFileCommit.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.provider.vcs 2 | 3 | data class ShireFileCommit( 4 | val filename: String, 5 | val path: String, 6 | val status: String, 7 | override val count: Int, 8 | override val commits: List 9 | ) : CommitModel(count, commits) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/ui/ModelItem.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.settings.ui 2 | 3 | /** 4 | * Data class to store both display name and model ID for dropdown items 5 | */ 6 | data class ModelItem(val displayName: String, val modelId: String, val isCustom: Boolean = false) { 7 | override fun toString(): String = displayName 8 | } -------------------------------------------------------------------------------- /mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/config/ChatConfig.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.config 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | /** 6 | * Chat configuration settings 7 | */ 8 | @Serializable 9 | data class ChatConfig( 10 | val temperature: Double = 0.7, 11 | val systemPrompt: String = "", 12 | val maxTokens: Int = 128000 13 | ) -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/logging/AutoDevLogger.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.logging 2 | 3 | import kotlinx.cinterop.ExperimentalForeignApi 4 | import platform.Foundation.NSHomeDirectory 5 | 6 | @OptIn(ExperimentalForeignApi::class) 7 | actual fun getPlatformLogDirectory(): String { 8 | return "${NSHomeDirectory()}/.autodev/logs" 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/NanoDSLIcons.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language 2 | 3 | import com.intellij.openapi.util.IconLoader 4 | import javax.swing.Icon 5 | 6 | object NanoDSLIcons { 7 | @JvmField 8 | val DEFAULT: Icon = IconLoader.getIcon("/icons/nanodsl.svg", NanoDSLIcons::class.java) 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.remote 2 | 3 | import io.ktor.client.* 4 | import io.ktor.client.engine.js.* 5 | 6 | internal actual fun createHttpClient(): HttpClient { 7 | return HttpClient(Js) { 8 | expectSuccess = false // Don't throw on non-2xx responses 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.linter 2 | 3 | /** 4 | * WASM-JS platform-specific linter registration 5 | */ 6 | actual fun registerPlatformLinters(registry: LinterRegistry) { 7 | // WASM doesn't support shell execution yet 8 | // Linters would need to be implemented differently 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mpp-web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | AutoDev Web UI 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/observer/GradleTaskAgentObserver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.idea.observer 2 | 3 | import cc.unitmesh.devti.provider.observer.AgentObserver 4 | import com.intellij.openapi.project.Project 5 | 6 | 7 | class GradleTaskAgentObserver : AgentObserver { 8 | override fun onRegister(project: Project) { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.linter 2 | 3 | /** 4 | * Android platform-specific linter registration 5 | */ 6 | actual fun registerPlatformLinters(registry: LinterRegistry) { 7 | // Android doesn't typically run linters directly 8 | // Linters are usually run on development machines 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/IosCodeParserFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.ios.IosCodeParser 5 | 6 | /** 7 | * iOS implementation of CodeParser factory 8 | */ 9 | actual fun createCodeParser(): CodeParser { 10 | return IosCodeParser() 11 | } 12 | -------------------------------------------------------------------------------- /mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/JsCodeParserFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.js.JsCodeParser 5 | 6 | /** 7 | * JavaScript implementation of CodeParser factory 8 | */ 9 | actual fun createCodeParser(): CodeParser { 10 | return JsCodeParser() 11 | } 12 | -------------------------------------------------------------------------------- /mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/impl/JvmCodeParserFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.jvm.JvmCodeParser 5 | 6 | /** 7 | * JVM implementation of CodeParser factory 8 | */ 9 | actual fun createCodeParser(): CodeParser { 10 | return JvmCodeParser() 11 | } 12 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/library-version-fetch.devin: -------------------------------------------------------------------------------- 1 | /library-version-fetch 2 | ```json 3 | { 4 | "name": "react", 5 | "type": "npm" 6 | } 7 | ``` 8 | 9 | Legacy format also supported: 10 | /library-version-fetch:npm:react 11 | /library-version-fetch:maven:org.springframework:spring-core 12 | /library-version-fetch:react (auto-detect) 13 | -------------------------------------------------------------------------------- /example/custom_agent/README.md: -------------------------------------------------------------------------------- 1 | # Custom Agent Server example 2 | 3 | code:[server.py](server.py) 4 | 5 | 1. Create virtual environment 6 | 7 | ```bash 8 | python -m venv venv 9 | source venv/bin/activate 10 | ``` 11 | 12 | 2. Install the required packages 13 | 14 | ```bash 15 | pip install -r requirements.txt 16 | ``` 17 | 18 | 3. Run 19 | 20 | ```bash 21 | python server.py 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/terminal/TerminalHandler.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.provider.terminal 2 | 3 | import com.intellij.openapi.project.Project 4 | 5 | class TerminalHandler( 6 | val userInput: String, 7 | val project: Project, 8 | val onChunk: (str: String) -> Any?, 9 | val onFinish: ((str: String?) -> Any?)?, 10 | ) 11 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/history/ChatSessionHistory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.history 2 | 3 | import cc.unitmesh.devti.llms.custom.Message 4 | import kotlinx.serialization.Serializable 5 | 6 | @Serializable 7 | data class ChatSessionHistory( 8 | val id: String, 9 | val name: String, 10 | val messages: List, 11 | val createdAt: Long 12 | ) -------------------------------------------------------------------------------- /mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/impl/HttpFetcherFactory.jvm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import cc.unitmesh.agent.tool.impl.HttpFetcher 4 | 5 | /** 6 | * JVM implementation - uses Ktor with CIO engine 7 | */ 8 | actual object HttpFetcherFactory { 9 | actual fun create(): HttpFetcher { 10 | return KtorHttpFetcher.create() 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/impl/WasmJsCodeParserFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.wasm.WasmJsCodeParser 5 | 6 | /** 7 | * WebAssembly-JS implementation of CodeParser factory 8 | */ 9 | actual fun createCodeParser(): CodeParser { 10 | return WasmJsCodeParser() 11 | } 12 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/prompts/default/create_story_detail.vm: -------------------------------------------------------------------------------- 1 | 你是一个敏捷项目的 BA,请根据如下的信息,编写用户故事。 2 | 3 | - 你的项目是:### {project} ### 4 | - 你的需求是: ### {story} ###。 5 | - 必须要考虑、尽可能考虑各种异常场景,添加更多的 AC(至少 3 个)。 6 | - 你的返回模板如下所示: 7 | 8 | ### 9 | 用户故事:可以选择宝贝出行服务 10 | 作为 xxx 11 | 我想 在xx出行的手机客户端里选择宝贝出行服务 12 | 以便于 我能够带宝宝打车出行的时候打到有儿童座椅的车 13 | 14 | AC 1: xxx 15 | 假设 xxx 16 | 当 xxx 17 | 于是 xxx 18 | ### 19 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/DevInLanguage.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language 2 | 3 | import com.intellij.lang.Language 4 | 5 | object DevInLanguage : Language("DevIn", "text/devin", "text/x-devin", "application/x-devin") { 6 | val INSTANCE: Language = DevInLanguage 7 | override fun isCaseSensitive() = true 8 | override fun getDisplayName() = "DevIn" 9 | } -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpFetcherFactory.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import cc.unitmesh.agent.tool.impl.HttpFetcher 4 | 5 | /** 6 | * iOS implementation - uses Ktor with Darwin engine 7 | */ 8 | actual object HttpFetcherFactory { 9 | actual fun create(): HttpFetcher { 10 | return KtorHttpFetcher.create() 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/test/resources/java/endpoint/HelloController.java: -------------------------------------------------------------------------------- 1 | import org.springframework.web.bind.annotation.RestController; 2 | import org.springframework.web.bind.annotation.RequestMapping; 3 | 4 | @RestController 5 | public class HelloController { 6 | 7 | @RequestMapping("/hello") 8 | public String hello() { 9 | return "Greetings from Spring Boot!"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/typescript/modes/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Modes Module - 模式系统导出 3 | */ 4 | 5 | export type { Mode, ModeContext, ModeResult, ModeFactory } from './Mode.js'; 6 | export { ModeManager } from './ModeManager.js'; 7 | export type { ModeChangeEvent } from './ModeManager.js'; 8 | export { AgentMode, AgentModeFactory } from './AgentMode.js'; 9 | export { ChatMode, ChatModeFactory } from './ChatMode.js'; 10 | -------------------------------------------------------------------------------- /xiuper-fs/src/iosMain/kotlin/cc/unitmesh/xiuper/fs/db/DatabaseDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xiuper.fs.db 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import app.cash.sqldelight.driver.native.NativeSqliteDriver 5 | 6 | actual class DatabaseDriverFactory { 7 | actual fun createDriver(): SqlDriver { 8 | return NativeSqliteDriver(XiuperFsDatabase.Schema, "xiuper-fs.db") 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpFetcherFactory.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import cc.unitmesh.agent.tool.impl.HttpFetcher 4 | 5 | /** 6 | * Android implementation - uses Ktor with CIO engine 7 | */ 8 | actual object HttpFetcherFactory { 9 | actual fun create(): HttpFetcher { 10 | return KtorHttpFetcher.create() 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/variable/VariableProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.variable 2 | 3 | import com.intellij.openapi.editor.Editor 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.psi.PsiElement 6 | 7 | interface VariableProvider { 8 | fun resolve(variable: T, project: Project, editor: Editor, psiElement: PsiElement?,): Any 9 | } 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/statusbar/AutoDevStatusListener.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.statusbar 2 | 3 | import com.intellij.util.messages.Topic 4 | 5 | interface AutoDevStatusListener { 6 | fun onCopilotStatus(status: AutoDevStatus, icon: String?) 7 | 8 | companion object { 9 | val TOPIC = Topic.create("autodev.status", AutoDevStatusListener::class.java) 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/test/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | cc.unitmesh.devti 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/variable/resolver/base/VariableResolver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.variable.resolver.base 2 | 3 | /** 4 | * The `VariableResolver` interface is designed to provide a mechanism for resolving variables. 5 | */ 6 | interface VariableResolver { 7 | suspend fun resolve(initVariables: Map): Map 8 | } 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/host/McpParam.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.mcp.host 2 | 3 | /** 4 | * Annotation to provide description for MCP tool parameters 5 | * @param description The description of the parameter that will be exposed to MCP clients 6 | */ 7 | @Target(AnnotationTarget.VALUE_PARAMETER) 8 | @Retention(AnnotationRetention.RUNTIME) 9 | annotation class McpParam(val description: String) -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/runner/RunnerResultSeverity.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package cc.unitmesh.devti.provider.runner 3 | 4 | enum class RunnerResultSeverity { 5 | Info, Warning, Error; 6 | 7 | fun isWaring() = this == Warning 8 | fun isInfo() = this == Info 9 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/fileTemplates/internal/Custom Prompt Action.vm.ft: -------------------------------------------------------------------------------- 1 | --- 2 | interaction: AppendCursorStream 3 | --- 4 | 5 | ## For more options, see [the docs](https://ide.unitmesh.cc/custom/team-prompts) 6 | 7 | You are an experienced software development engineer skilled in using Test-Driven Development (TDD) to develop software. 8 | You need to help users write test code based on their requirements. 9 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/ripgrepSearch.devin: -------------------------------------------------------------------------------- 1 | 使用 ripgrep 在文件或目录中查找精确的模式匹配。支持正则表达式的全局搜索,如 2 | /ripgrepSearch:.*AutoDev.* 3 | 4 | 示例: 5 | - 搜索特定函数:`/ripgrepSearch:function\s+processData` 6 | - 搜索带命名空间的类:`/ripgrepSearch:cc\.unitmesh\..*Service` 7 | - 在特定文件类型中搜索:`/ripgrepSearch:import.*kotlin --include="*.kt"` 8 | 9 | 当你搜索业务领域名词出错时,可以尝试是否存在 prompts/domain.csv 来帮助你找到正确的领域名词 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/goland/src/test/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | cc.unitmesh.devti 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/java/src/test/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | cc.unitmesh.devti 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/CodeGraphFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.codegraph 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.js.JsCodeParser 5 | 6 | /** 7 | * JS implementation of CodeGraphFactory 8 | */ 9 | actual object CodeGraphFactory { 10 | actual fun createParser(): CodeParser { 11 | return JsCodeParser() 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/CodeGraphFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.codegraph 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.ios.IosCodeParser 5 | 6 | /** 7 | * iOS implementation of CodeGraphFactory 8 | */ 9 | actual object CodeGraphFactory { 10 | actual fun createParser(): CodeParser { 11 | return IosCodeParser() 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/CodeGraphFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.codegraph 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.jvm.JvmCodeParser 5 | 6 | /** 7 | * JVM implementation of CodeGraphFactory 8 | */ 9 | actual object CodeGraphFactory { 10 | actual fun createParser(): CodeParser { 11 | return JvmCodeParser() 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/swift/McpClientBridge.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for McpClientBridge. 4 | FOUNDATION_EXPORT double McpClientBridgeVersionNumber; 5 | 6 | //! Project version string for McpClientBridge. 7 | FOUNDATION_EXPORT const unsigned char McpClientBridgeVersionString[]; 8 | 9 | // Import Swift generated header 10 | // This will be auto-generated by Xcode/Swift compiler 11 | 12 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/shireql/variable/frontend/ComponentProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.shirecore.variable.frontend 2 | 3 | import cc.unitmesh.devti.language.ast.shireql.variable.frontend.Component 4 | 5 | interface ComponentProvider { 6 | fun getPages(): List 7 | fun getComponents(): List 8 | fun getRoutes(): Map 9 | } 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/rust/src/test/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | cc.unitmesh.devti 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/VcsUtil.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.vcs 2 | 3 | import com.intellij.openapi.actionSystem.AnActionEvent 4 | import com.intellij.openapi.vcs.VcsDataKeys 5 | import com.intellij.vcs.commit.CommitWorkflowUi 6 | 7 | object VcsUtil { 8 | fun getCommitWorkFlowUi(e: AnActionEvent): CommitWorkflowUi? { 9 | return e.getData(VcsDataKeys.COMMIT_WORKFLOW_UI) 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/lexer/NanoDSLTokenType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language.lexer 2 | 3 | import cc.unitmesh.nanodsl.language.NanoDSLLanguage 4 | import com.intellij.psi.tree.IElementType 5 | 6 | class NanoDSLTokenType(debugName: String) : IElementType(debugName, NanoDSLLanguage) { 7 | override fun toString(): String = "NanoDSLTokenType." + super.toString() 8 | } 9 | 10 | -------------------------------------------------------------------------------- /mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/CodeGraphFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.codegraph 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | import cc.unitmesh.codegraph.parser.wasm.WasmJsCodeParser 5 | 6 | /** 7 | * WASM-JS implementation of CodeGraphFactory 8 | */ 9 | actual object CodeGraphFactory { 10 | actual fun createParser(): CodeParser { 11 | return WasmJsCodeParser() 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/SpecVariableResolver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | class SpecVariableResolver(val key: String, val value: String) : VariableResolver { 4 | override val type: CustomResolvedVariableType get() = CustomResolvedVariableType.SPEC_VARIABLE 5 | 6 | override fun resolve(): String = value 7 | 8 | override fun variableName(): String = key 9 | } 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/resources/genius/en/migration/gen-function.vm: -------------------------------------------------------------------------------- 1 | You are a professional application migration programmer. 2 | Based on the following Oracle PL/SQL code to Java function, 3 | 4 | — When some function is missing in Java, just skip it. 5 | - If you find some function is not correct, please fix it. 6 | - Follow the Java coding style. 7 | 8 | 9 | ```${context.lang} 10 | ${context.sql} 11 | ``` 12 | 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/resources/genius/zh/migration/gen-function.vm: -------------------------------------------------------------------------------- 1 | You are a professional application migration programmer. 2 | Based on the following Oracle PL/SQL code to Java function, 3 | 4 | — When some function is missing in Java, just skip it. 5 | - If you find some function is not correct, please fix it. 6 | - Follow the Java coding style. 7 | 8 | 9 | ```${context.lang} 10 | ${context.sql} 11 | ``` 12 | 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/test/resources/blog.pl.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE PROCEDURE find_blog_by_id( 2 | p_blog_id IN NUMBER, 3 | p_blog_content OUT VARCHAR2 4 | ) AS 5 | BEGIN 6 | SELECT blog_content 7 | INTO p_blog_content 8 | FROM blogs 9 | WHERE blog_id = p_blog_id; 10 | 11 | EXCEPTION 12 | WHEN NO_DATA_FOUND THEN 13 | p_blog_content := NULL; -- 或者你可以选择处理其他错误 14 | END find_blog_by_id; 15 | / 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/pycharm/src/test/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | cc.unitmesh.devti 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mpp-server/railway.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://railway.app/railway.schema.json", 3 | "build": { 4 | "builder": "DOCKERFILE", 5 | "dockerfilePath": "mpp-server/Dockerfile" 6 | }, 7 | "deploy": { 8 | "startCommand": "java -jar /app/mpp-server.jar", 9 | "restartPolicyType": "ON_FAILURE", 10 | "restartPolicyMaxRetries": 10, 11 | "healthcheckPath": "/health", 12 | "healthcheckTimeout": 300 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/provider/CopilotModelRefresher.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.provider 2 | 3 | import cc.unitmesh.llm.NamedModelConfig 4 | 5 | /** 6 | * iOS implementation - GitHub Copilot not supported on mobile 7 | */ 8 | actual object CopilotModelRefresher { 9 | actual fun isAvailable(): Boolean = false 10 | actual suspend fun refreshModels(): List = emptyList() 11 | } 12 | 13 | -------------------------------------------------------------------------------- /mpp-web/public/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://www.xuiper.com/ 5 | weekly 6 | 1.0 7 | 8 | 9 | https://www.xuiper.com/#/app 10 | weekly 11 | 0.6 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/resources/genius/en/migration/gen-unittest.vm: -------------------------------------------------------------------------------- 1 | You are a professional application migration programmer. 2 | Write java unit test code to test the following Oracle PL/SQL code. 3 | 4 | — When some function is missing in Java, just skip it. 5 | - If you find some function is not correct, please fix it. 6 | - Follow the Java coding style. 7 | 8 | ```${context.lang} 9 | ${context.sql} 10 | ``` 11 | 12 | 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/resources/genius/zh/migration/gen-unittest.vm: -------------------------------------------------------------------------------- 1 | You are a professional application migration programmer. 2 | Write java unit test code to test the following Oracle PL/SQL code. 3 | 4 | — When some function is missing in Java, just skip it. 5 | - If you find some function is not correct, please fix it. 6 | - Follow the Java coding style. 7 | 8 | ```${context.lang} 9 | ${context.sql} 10 | ``` 11 | 12 | 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/action/CustomIntentionConfig.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.action 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | class CustomIntentionConfig { 7 | var title: String = "" 8 | var autoInvoke: Boolean = false 9 | var matchRegex: String = "" 10 | var template: String = "" 11 | val priority: Int = 0 12 | var selectedRegex: String = "" 13 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/lexer/DevInTokenType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.lexer 2 | 3 | import cc.unitmesh.devti.language.DevInLanguage 4 | import com.intellij.psi.tree.IElementType 5 | import org.jetbrains.annotations.NonNls 6 | 7 | class DevInTokenType(@NonNls debugName: String) : IElementType(debugName, DevInLanguage) { 8 | override fun toString(): String = "DevInTokenType." + super.toString() 9 | } -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.Modifier 5 | 6 | /** 7 | * Platform-specific file viewer panel wrapper 8 | */ 9 | @Composable 10 | expect fun FileViewerPanelWrapper( 11 | filePath: String, 12 | onClose: () -> Unit, 13 | modifier: Modifier = Modifier 14 | ) 15 | -------------------------------------------------------------------------------- /mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/provider/CopilotModelRefresher.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.provider 2 | 3 | import cc.unitmesh.llm.NamedModelConfig 4 | 5 | /** 6 | * WASM implementation - GitHub Copilot not supported in browser 7 | */ 8 | actual object CopilotModelRefresher { 9 | actual fun isAvailable(): Boolean = false 10 | actual suspend fun refreshModels(): List = emptyList() 11 | } 12 | 13 | -------------------------------------------------------------------------------- /mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.remote 2 | 3 | import io.ktor.client.* 4 | import io.ktor.client.engine.js.* 5 | 6 | /** 7 | * WASM implementation of createHttpClient 8 | * Uses JS engine for HTTP client 9 | */ 10 | actual fun createHttpClient(): HttpClient { 11 | return HttpClient(Js) { 12 | // Configure HTTP client for WASM/JS 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/page/page-gen-clarify.vm: -------------------------------------------------------------------------------- 1 | 你是一位专业的前端开发者。根据用户的需求,在列表中为用户选择最佳组件。 2 | 3 | 框架:${context.frameworks} 4 | 语言:${context.language} 5 | 用户组件:${context.componentNames},${context.pageNames} 6 | 例如: 7 | 8 | 问题(需求):为用户构建一个填写个人信息的表单。 9 | 你应该回答:[Input, Select, Radio, Checkbox, Button, Form] 10 | 11 | ---- 12 | 13 | 以下是用户需求: 14 | 15 | ```markdown 16 | ${context.requirement} 17 | ``` 18 | 19 | 请为用户选择最佳组件,只返回组件名称列表,不解释。 20 | -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/provider/CopilotModelRefresher.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.provider 2 | 3 | import cc.unitmesh.llm.NamedModelConfig 4 | 5 | /** 6 | * Android implementation - GitHub Copilot not supported on mobile 7 | */ 8 | actual object CopilotModelRefresher { 9 | actual fun isAvailable(): Boolean = false 10 | actual suspend fun refreshModels(): List = emptyList() 11 | } 12 | 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/flow/kanban/Kanban.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.flow.kanban 2 | 3 | import cc.unitmesh.devti.flow.model.SimpleStory 4 | 5 | interface Kanban { 6 | /** 7 | * Retrieves a user story by its ID. 8 | * 9 | * @param storyId The ID of the user story to retrieve. 10 | * @return The user story with the specified ID. 11 | */ 12 | fun getStoryById(storyId: String): SimpleStory 13 | } 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/test/resources/create_blog.sql: -------------------------------------------------------------------------------- 1 | -- sample for create blog 2 | CREATE TABLE `blog` 3 | ( 4 | `id` int(11) NOT NULL AUTO_INCREMENT, 5 | `title` varchar(255) DEFAULT NULL, 6 | `content` varchar(255) DEFAULT NULL, 7 | `create_time` datetime DEFAULT NULL, 8 | `update_time` datetime DEFAULT NULL, 9 | PRIMARY KEY (`id`) 10 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; 11 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.nano 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import org.jetbrains.compose.resources.decodeToImageBitmap 5 | 6 | /** 7 | * JS implementation of decodeImageBytesToBitmap using Compose Resources. 8 | */ 9 | internal actual fun decodeImageBytesToBitmap(bytes: ByteArray): ImageBitmap { 10 | return bytes.decodeToImageBitmap() 11 | } 12 | -------------------------------------------------------------------------------- /mpp-web/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import { Router } from './Router'; 4 | import './index.css'; 5 | 6 | const container = document.getElementById('root'); 7 | if (container) { 8 | const root = createRoot(container); 9 | root.render( 10 | 11 | 12 | 13 | ); 14 | } else { 15 | console.error('Root element not found'); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/SSE.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.llms.custom 2 | 3 | class SSE(val data: String) { 4 | fun toBytes(): ByteArray { 5 | return String.format("data: %s\n\n", this.data).toByteArray() 6 | } 7 | 8 | val isDone: Boolean 9 | get() = DONE_DATA.equals(this.data, ignoreCase = true) 10 | 11 | companion object { 12 | private const val DONE_DATA = "[DONE]" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/kill-process.devin: -------------------------------------------------------------------------------- 1 | Terminate a running process by its process ID. Supports both graceful termination and force kill options. 2 | 3 | Gracefully terminate a process: 4 | /kill-process:proc_1234567890_1 5 | 6 | Force kill a process: 7 | /kill-process:proc_1234567890_1 --force 8 | 9 | Use /list-processes to find the process ID of the process you want to terminate. Only running processes can be killed. 10 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/test/TestCodeGenRequest.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.intentions.action.test 2 | 3 | import com.intellij.openapi.editor.Editor 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.psi.PsiElement 6 | import com.intellij.psi.PsiFile 7 | 8 | class TestCodeGenRequest( 9 | val file: PsiFile, 10 | val element: PsiElement, 11 | val project: Project, 12 | val editor: Editor? 13 | ) -------------------------------------------------------------------------------- /mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.nano 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import org.jetbrains.compose.resources.decodeToImageBitmap 5 | 6 | /** 7 | * WASM implementation of decodeImageBytesToBitmap using Compose Resources. 8 | */ 9 | internal actual fun decodeImageBytesToBitmap(bytes: ByteArray): ImageBitmap { 10 | return bytes.decodeToImageBitmap() 11 | } 12 | 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/sql/sql-gen-clarify.vm: -------------------------------------------------------------------------------- 1 | 你是一名专业的数据库管理员。根据用户的要求,在列表中为用户选择最佳的表。 2 | 3 | - 用户使用的数据库版本:${context.databaseVersion} 4 | - 用户 schema 名称:${context.schemaName} 5 | - 用户表信息:${context.tableNames} 6 | 7 | 例如: 8 | 9 | - 问题(要求):计算按订阅者类型划分的平均行程长度。// 用户表:trips、users、subscriber_type 10 | - 你应该回答:[trips, subscriber_type] 11 | 12 | ---- 13 | 14 | 以下是用户的需求: 15 | 16 | ```markdown 17 | ${context.requirement} 18 | ``` 19 | 20 | 请为用户选择最佳的表,只需返回表名的列表,无需解释。 -------------------------------------------------------------------------------- /mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/HttpFetcherFactory.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import cc.unitmesh.agent.tool.impl.HttpFetcher 4 | 5 | /** 6 | * JavaScript implementation - uses native Node.js fetch API 7 | * 8 | * This bypasses Ktor's JS engine limitations in Node.js environment 9 | */ 10 | actual object HttpFetcherFactory { 11 | actual fun create(): HttpFetcher { 12 | return NodeFetchHttpFetcher() 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JestCodeModifier.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.ide.javascript.provider.testing 2 | 3 | import cc.unitmesh.ide.javascript.util.LanguageApplicableUtil 4 | import com.intellij.lang.Language 5 | 6 | class JestCodeModifier : JavaScriptTestCodeModifier() { 7 | override fun isApplicable(language: Language): Boolean { 8 | return LanguageApplicableUtil.isJavaScriptApplicable(language) 9 | } 10 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/practises/refactoring.vm: -------------------------------------------------------------------------------- 1 | 请你这段代码建议适当的重构。 2 | - 提高代码的可读性、质量,使代码更加有组织和易懂。 3 | - 如果代码太长,你需要考虑用更好的方式(诸如概念化)来组织代码。 4 | - 答案应包含重构描述和一个代码片段,展示重构后的结果。 5 | 使用一些众所周知的重构技巧,比如以下列表中的一个: 6 | - 重命名 7 | - 修改签名、声明 8 | - 提取或引入变量、函数、常量、参数、类型参数 9 | - 提取类、接口、超类 10 | - 内联类、函数、变量等 11 | - 移动字段、函数、语句等 12 | - 上移构造函数、字段、方法 13 | - 下移字段、方法 14 | 15 | 请勿生成多个代码片段,尝试将所有更改都整合到一个代码片段中。 16 | 请勿生成包含虚构周围类、方法的代码。不要模拟缺失的依赖项。 17 | 提供的代码已经整合到正确且可编译的代码中,不要在其周围添加额外的类。 18 | 19 | 重构以下代码: 20 | -------------------------------------------------------------------------------- /xiuper-fs/src/commonMain/sqldelight/cc/unitmesh/xiuper/fs/db/migrations/1.sqm: -------------------------------------------------------------------------------- 1 | -- Migration 1: Add extended attributes support 2 | -- From schema v1 (FsNode only) to v2 (FsNode + FsXattr) 3 | 4 | CREATE TABLE IF NOT EXISTS FsXattr ( 5 | path TEXT NOT NULL, 6 | name TEXT NOT NULL, 7 | value BLOB NOT NULL, 8 | PRIMARY KEY (path, name), 9 | FOREIGN KEY (path) REFERENCES FsNode(path) ON DELETE CASCADE 10 | ); 11 | 12 | CREATE INDEX IF NOT EXISTS idx_xattr_path ON FsXattr(path); 13 | -------------------------------------------------------------------------------- /.idea/runConfigurations/Run_Compose_Server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /mpp-codegraph/src/commonMain/kotlin/cc/unitmesh/codegraph/CodeGraphFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.codegraph 2 | 3 | import cc.unitmesh.codegraph.parser.CodeParser 4 | 5 | /** 6 | * Factory to create platform-specific CodeParser instances. 7 | * This uses expect/actual pattern for platform-specific implementations. 8 | */ 9 | expect object CodeGraphFactory { 10 | /** 11 | * Create a platform-specific CodeParser instance 12 | */ 13 | fun createParser(): CodeParser 14 | } 15 | 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/context/builder/VariableContextBuilder.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.context.builder 2 | 3 | import cc.unitmesh.devti.context.VariableContext 4 | import com.intellij.psi.PsiElement 5 | 6 | interface VariableContextBuilder { 7 | fun getVariableContext( 8 | psiElement: PsiElement, 9 | withMethodContext: Boolean, 10 | withClassContext: Boolean, 11 | gatherUsages: Boolean 12 | ): VariableContext? 13 | } 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/prompts/default/update_service_method.vm: -------------------------------------------------------------------------------- 1 | 你是一个资深的后端 CRUD 工程师,根据下面的信息编写 Service 层新方法的代码。要求: 2 | 3 | - 实现 // TODO 声明部分的方法。 4 | - 保证 Service 层的代码简洁易读,不要有冗余代码。 5 | - 你最后返回的代码示例如下: 6 | // TODO: implementation follows methods: {{some method}} 7 | ```java 8 | public {methodReturnType} {methodName}({methodParams}) { 9 | {methodBody} 10 | } 11 | ``` 12 | 13 | // current service code 14 | {prefixCode} 15 | // TODO: implementation follows methods: {suffixCode} 16 | 17 | -------------------------------------------------------------------------------- /mpp-viewer-web/src/jsMain/kotlin/cc/unitmesh/viewer/web/MermaidHtml.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.viewer.web 2 | 3 | /** 4 | * JS implementation: Return empty/stub Mermaid HTML 5 | */ 6 | actual fun getMermaidHtml(): String { 7 | return """ 8 | 9 | 10 | 11 | 12 | Mermaid (Stub) 13 | 14 | 15 |
Mermaid not supported in JS
16 | 17 | 18 | """.trimIndent() 19 | } 20 | -------------------------------------------------------------------------------- /xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/db/DatabaseDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xiuper.fs.db 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver 5 | 6 | actual class DatabaseDriverFactory { 7 | actual fun createDriver(): SqlDriver { 8 | // Intentionally use a file-based DB for production; tests should provide their own driver. 9 | return JdbcSqliteDriver("jdbc:sqlite:xiuper-fs.db") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/PrintInsCommand.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.compiler.exec 2 | 3 | import cc.unitmesh.devti.command.InsCommand 4 | import cc.unitmesh.devti.command.dataprovider.BuiltinCommand 5 | 6 | class PrintInsCommand(private val value: String) : InsCommand { 7 | override val commandName: BuiltinCommand = BuiltinCommand.OPEN 8 | 9 | override suspend fun execute(): String { 10 | return value 11 | } 12 | } -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DatabaseDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.db 2 | 3 | import app.cash.sqldelight.db.SqlDriver 4 | import app.cash.sqldelight.driver.native.NativeSqliteDriver 5 | 6 | /** 7 | * iOS 平台的数据库驱动工厂 8 | */ 9 | actual class DatabaseDriverFactory { 10 | actual fun createDriver(): SqlDriver { 11 | return NativeSqliteDriver( 12 | schema = DevInsDatabase.Schema, 13 | name = "autodev.db" 14 | ) 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /example/prompt/copilot/completion/python-code.md: -------------------------------------------------------------------------------- 1 | Q: 2 | ```python 3 | def foo(): 4 | x = 42 + 42 5 | print(x) 6 | # TODO: write me gcd algorithm here 7 | # end of the code completion 8 | return x + x 9 | ``` 10 | A: 11 | ```python 12 | def foo(): 13 | x = 42 + 42 14 | print(x) 15 | # TODO: write me gcd algorithm here 16 | def gcd(a,b): 17 | while(b): 18 | a,b = b,a%b 19 | return a 20 | # end of the code completion 21 | return x + x 22 | ``` 23 | Q: -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/ScreenshotUtils.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.sketch 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | 5 | /** 6 | * Encode an ImageBitmap to PNG bytes. 7 | * Platform-specific implementations handle the actual encoding. 8 | * 9 | * @param imageBitmap The ImageBitmap to encode 10 | * @return PNG bytes, or null if encoding fails 11 | */ 12 | expect fun encodeImageBitmapToPng(imageBitmap: ImageBitmap): ByteArray? 13 | 14 | -------------------------------------------------------------------------------- /mpp-web/src/polyfills/ws-polyfill.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * WebSocket polyfill for browser 3 | * The 'ws' package is a Node.js WebSocket library used by ktor-client. 4 | * In browsers, we use the native WebSocket API instead. 5 | */ 6 | 7 | // Export browser's native WebSocket as the default 8 | export default typeof window !== 'undefined' ? window.WebSocket : class {}; 9 | 10 | // Also provide named export for compatibility 11 | export const WebSocket = typeof window !== 'undefined' ? window.WebSocket : class {}; 12 | 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/model/McpMessage.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.mcp.ui.model 2 | 3 | import java.time.LocalDateTime 4 | 5 | enum class MessageType { 6 | REQUEST, 7 | RESPONSE 8 | } 9 | 10 | data class McpMessage( 11 | val type: MessageType, 12 | val method: String, 13 | val timestamp: LocalDateTime, 14 | val duration: Long? = null, 15 | val content: String, 16 | val toolName: String? = null, 17 | val parameters: String? = null 18 | ) 19 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/context/ChatCreationContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.provider.context 2 | 3 | import cc.unitmesh.devti.gui.chat.message.ChatActionType 4 | import com.intellij.psi.PsiElement 5 | import com.intellij.psi.PsiFile 6 | 7 | data class ChatCreationContext( 8 | val origin: ChatOrigin, 9 | val action: ChatActionType, 10 | val sourceFile: PsiFile?, 11 | val extraItems: List = emptyList(), 12 | val element: PsiElement? 13 | ) -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.jvm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.Modifier 5 | 6 | @Composable 7 | actual fun FileViewerPanelWrapper( 8 | filePath: String, 9 | onClose: () -> Unit, 10 | modifier: Modifier 11 | ) { 12 | FileViewerPanel( 13 | filePath = filePath, 14 | onClose = onClose, 15 | modifier = modifier 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import io.ktor.client.* 4 | import io.ktor.client.engine.darwin.* 5 | 6 | actual object HttpClientFactory { 7 | actual fun create(): HttpClient { 8 | return HttpClient(Darwin) { 9 | engine { 10 | configureRequest { 11 | setAllowsCellularAccess(true) 12 | } 13 | } 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/logging/PlatformLogging.jvm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.logging 2 | 3 | /** 4 | * JVM implementation of platform-specific logging initialization 5 | */ 6 | actual fun initializePlatformLogging(config: LoggingConfig) { 7 | JvmLoggingInitializer.initializeLogback(config) 8 | } 9 | 10 | /** 11 | * JVM implementation of platform-specific log directory 12 | */ 13 | actual fun getPlatformLogDirectory(): String { 14 | return JvmLoggingInitializer.getLogDirectory() 15 | } 16 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.database 2 | 3 | /** 4 | * WASM 平台数据库连接占位符 5 | * 6 | * WASM 平台当前不支持直接的数据库连接。 7 | * 应该通过服务器的 HTTP API 调用来访问数据库。 8 | */ 9 | actual fun createDatabaseConnection(config: DatabaseConfig): DatabaseConnection { 10 | throw UnsupportedOperationException( 11 | "Database connections are not supported on WASM platform. " + 12 | "Use the server API to access databases instead." 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /xiuper-ui/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /example/prompt/autodev/custom-prompt-dsl.md: -------------------------------------------------------------------------------- 1 | ## Custom Prompt DSL 2 | 3 | ```json 4 | [ 5 | { 6 | "title": "转译", 7 | "autoInvoke": true, 8 | "matchRegex": ".*", 9 | "template": "帮我重构下面的代码为 Kotlin 语言,方便于我理解: \n ${SPEC_XXX} ${SELECTION}" 10 | } 11 | ] 12 | ``` 13 | 14 | ### IDE Variable 15 | 16 | ``` 17 | $SELECTION 18 | ``` 19 | 20 | ### SPEC Variable 21 | 22 | ``` 23 | $SPEC.xxx 24 | ``` 25 | 26 | example: `$SPEC_CONTROLLER` 27 | 28 | ### CODE Context Variable 29 | 30 | `METHOD_INPUT_OUTPUT` 31 | 32 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/shireql/ShireQLFromType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.shireql 2 | 3 | enum class ShireQLFromType(val typeName: String) { 4 | // PSI Query 5 | PsiFile("PsiFile"), 6 | PsiPackage("PsiPackage"), 7 | PsiClass("PsiClass"), 8 | PsiMethod("PsiMethod"), 9 | PsiField("PsiField"), 10 | 11 | // GitQuery 12 | GitCommit("GitCommit"), 13 | GitBranch("GitBranch"), 14 | 15 | // Others 16 | Date("Date"), 17 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/highlight/DevInSyntaxHighlighterFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.highlight 2 | 3 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.openapi.vfs.VirtualFile 6 | 7 | class DevInSyntaxHighlighterFactory : SyntaxHighlighterFactory() { 8 | override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?) = DevInSyntaxHighlighter() 9 | } 10 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/provider/CopilotModelRefresher.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.provider 2 | 3 | import cc.unitmesh.llm.NamedModelConfig 4 | 5 | /** 6 | * JS implementation - GitHub Copilot not supported in browser/Node.js CLI 7 | * (Would need to implement Node.js file system access for CLI mode) 8 | */ 9 | actual object CopilotModelRefresher { 10 | actual fun isAvailable(): Boolean = false 11 | actual suspend fun refreshModels(): List = emptyList() 12 | } 13 | 14 | -------------------------------------------------------------------------------- /mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.jvm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | @Composable 6 | actual fun PlatformAutoDevApp( 7 | triggerFileChooser: Boolean, 8 | onFileChooserHandled: () -> Unit, 9 | initialMode: String 10 | ) { 11 | AutoDevApp( 12 | triggerFileChooser = triggerFileChooser, 13 | onFileChooserHandled = onFileChooserHandled, 14 | initialMode = initialMode 15 | ) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inline/AutoDevInlineChatProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.inline 2 | 3 | import com.intellij.openapi.project.Project 4 | 5 | object AutoDevInlineChatProvider { 6 | var isAdded = false 7 | 8 | fun addListener(project: Project) { 9 | if (isAdded) return 10 | AutoDevGutterHandler.getInstance(project).listen() 11 | } 12 | 13 | fun removeListener(project: Project) { 14 | AutoDevGutterHandler.getInstance(project).dispose() 15 | } 16 | } -------------------------------------------------------------------------------- /mpp-web/src/Router.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | import { LandingPage } from './LandingPage'; 3 | 4 | export const Router: React.FC = () => { 5 | useEffect(() => { 6 | // Redirect /#/app to the actual web.xiuper.com 7 | const hash = window.location.hash; 8 | const normalized = (hash || '').replace(/^#\/?/, ''); 9 | if (normalized.startsWith('app')) { 10 | window.location.href = 'https://web.xiuper.com/'; 11 | } 12 | }, []); 13 | 14 | return ; 15 | }; 16 | 17 | 18 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/coder/AutoDevCoderConfigurableProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.settings.coder 2 | 3 | import com.intellij.openapi.options.Configurable 4 | import com.intellij.openapi.options.ConfigurableProvider 5 | import com.intellij.openapi.project.Project 6 | 7 | class AutoDevCoderConfigurableProvider (private val project: Project) : ConfigurableProvider() { 8 | override fun createConfigurable(): Configurable { 9 | return AutoDevCoderConfigurable(project) 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/customize/CustomizeConfigurableProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.settings.customize 2 | 3 | import com.intellij.openapi.options.Configurable 4 | import com.intellij.openapi.options.ConfigurableProvider 5 | import com.intellij.openapi.project.Project 6 | 7 | class CustomizeConfigurableProvider (private val project: Project) : ConfigurableProvider() { 8 | override fun createConfigurable(): Configurable { 9 | return CustomizeConfigurable(project) 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/fileTemplates/internal/AutoDevAction.devin.ft: -------------------------------------------------------------------------------- 1 | --- 2 | name: "{{name}}" 3 | description: "Here is a description of the action." 4 | interaction: AppendCursor 5 | actionLocation: ContextMenu 6 | --- 7 | 8 | [notes]: For more options, see [the docs](https://ide.unitmesh.cc/local-agent/) 9 | 10 | You are an experienced software development engineer skilled in using Test-Driven Development (TDD) to develop software. 11 | You need to help users write test code based on their requirements. 12 | -------------------------------------------------------------------------------- /mpp-idea/src/main/resources/messages/AutoDevIdeaBundle.properties: -------------------------------------------------------------------------------- 1 | # AutoDev Compose UI Bundle 2 | toolwindow.name=AutoDev Compose 3 | toolwindow.title=AutoDev Chat 4 | 5 | # Chat UI 6 | chat.placeholder=Start a conversation with your AI Assistant! 7 | chat.input.placeholder=Type your message here... 8 | chat.send=Send 9 | chat.stop=Stop 10 | chat.new=New Conversation 11 | 12 | # Settings 13 | settings.ai.configure=Configure AI Provider 14 | settings.ai.provider=Provider 15 | settings.ai.model=Model 16 | settings.ai.apikey=API Key 17 | 18 | -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.terminal 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.Modifier 5 | 6 | /** 7 | * Platform-agnostic terminal output display. 8 | * On JVM: Uses JediTerm for rich terminal rendering 9 | * On other platforms: Falls back to simple text display 10 | */ 11 | @Composable 12 | expect fun PlatformTerminalDisplay( 13 | output: String, 14 | modifier: Modifier = Modifier 15 | ) 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/highlight/NanoDSLSyntaxHighlighterFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language.highlight 2 | 3 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.openapi.vfs.VirtualFile 6 | 7 | class NanoDSLSyntaxHighlighterFactory : SyntaxHighlighterFactory() { 8 | override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?) = NanoDSLSyntaxHighlighter() 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.database.flow 2 | 3 | import cc.unitmesh.devti.template.context.TemplateContext 4 | 5 | data class AutoSqlContext( 6 | val requirement: String, 7 | val databaseVersion: String, 8 | val schemaName: String, 9 | val tableNames: List, 10 | /** 11 | * Step 2. 12 | * A list of table names to retrieve the columns from. 13 | */ 14 | var tableInfos: List = emptyList(), 15 | ) : TemplateContext -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/CustomResolvedVariableType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | enum class CustomResolvedVariableType(@JvmField val description: String) { 4 | SELECTION("Currently selected code fragment with language name"), 5 | METHOD_INPUT_OUTPUT("Method input parameter's class as code snippets"), 6 | SPEC_VARIABLE("Load from spec config, and config to items"), 7 | SIMILAR_CHUNK("Similar code chunk with element's code and recently open code"), 8 | ; 9 | } 10 | -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.nano 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | import androidx.compose.ui.graphics.toComposeImageBitmap 5 | import org.jetbrains.skia.Image 6 | 7 | /** 8 | * iOS implementation of decodeImageBytesToBitmap using Skia. 9 | */ 10 | internal actual fun decodeImageBytesToBitmap(bytes: ByteArray): ImageBitmap { 11 | val skiaImage = Image.makeFromEncoded(bytes) 12 | return skiaImage.toComposeImageBitmap() 13 | } 14 | 15 | -------------------------------------------------------------------------------- /xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/prompt/ResourceLoader.jvm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xuiper.prompt 2 | 3 | /** 4 | * JVM implementation of ResourceLoader using classloader. 5 | */ 6 | actual object ResourceLoader { 7 | actual fun loadResource(path: String): String { 8 | return ResourceLoader::class.java.classLoader 9 | ?.getResourceAsStream(path) 10 | ?.bufferedReader() 11 | ?.readText() 12 | ?: throw IllegalStateException("Cannot load resource: $path") 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/SelectionVariableResolver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | class SelectionVariableResolver( 4 | private val languageName: String, 5 | private val code: String, 6 | ) : VariableResolver { 7 | override val type: CustomResolvedVariableType = CustomResolvedVariableType.SELECTION 8 | 9 | override fun resolve(): String { 10 | return """ 11 | |```$languageName 12 | |$code 13 | |```""".trimMargin() 14 | } 15 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/parser/ShireTokenTypeSets.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.parser 2 | 3 | import cc.unitmesh.devti.language.psi.DevInTypes 4 | import com.intellij.psi.TokenType 5 | import com.intellij.psi.tree.TokenSet 6 | 7 | object ShireTokenTypeSets { 8 | // DevInTypes.NEWLINE 9 | val WHITESPACES: TokenSet = TokenSet.create(TokenType.WHITE_SPACE) 10 | 11 | val SHIRE_COMMENTS = TokenSet.create(DevInTypes.CONTENT_COMMENTS, DevInTypes.COMMENTS, DevInTypes.BLOCK_COMMENT) 12 | } 13 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/Main.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui 2 | 3 | import androidx.compose.ui.ExperimentalComposeUiApi 4 | import androidx.compose.ui.window.ComposeViewport 5 | import cc.unitmesh.devins.ui.compose.AutoDevApp 6 | import org.jetbrains.skiko.wasm.onWasmReady 7 | 8 | /** 9 | * Markdown 渲染演示应用 - Web 版本 10 | */ 11 | @OptIn(ExperimentalComposeUiApi::class) 12 | @Suppress("DEPRECATION") 13 | fun main() { 14 | onWasmReady { 15 | ComposeViewport { 16 | AutoDevApp() 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /xiuper-ui/src/androidMain/kotlin/cc/unitmesh/xuiper/prompt/ResourceLoader.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xuiper.prompt 2 | 3 | /** 4 | * Android implementation of ResourceLoader using classloader. 5 | */ 6 | actual object ResourceLoader { 7 | actual fun loadResource(path: String): String { 8 | return ResourceLoader::class.java.classLoader 9 | ?.getResourceAsStream(path) 10 | ?.bufferedReader() 11 | ?.readText() 12 | ?: throw IllegalStateException("Cannot load resource: $path") 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/sketch/TerminalExecutionState.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.terminal.sketch 2 | 3 | /** 4 | * 终端执行命令的状态枚举 5 | */ 6 | enum class TerminalExecutionState { 7 | /** 8 | * 准备执行(初始状态) 9 | */ 10 | READY, 11 | 12 | /** 13 | * 正在执行中 14 | */ 15 | EXECUTING, 16 | 17 | /** 18 | * 执行成功 19 | */ 20 | SUCCESS, 21 | 22 | /** 23 | * 执行失败 24 | */ 25 | FAILED, 26 | 27 | /** 28 | * 执行被手动终止 29 | */ 30 | TERMINATED 31 | } 32 | -------------------------------------------------------------------------------- /mpp-ui/webpack.config.d/zzzz-wasm-experiments.js: -------------------------------------------------------------------------------- 1 | // Ensure WebAssembly support is enabled for webpack 5 in browser test builds. 2 | // This file is named with "zzzz" so it runs after other injected webpack config snippets. 3 | 4 | // config.experiments = config.experiments || {}; 5 | // config.experiments.asyncWebAssembly = true; 6 | // 7 | // config.module = config.module || {}; 8 | // config.module.rules = config.module.rules || []; 9 | // config.module.rules.push({ 10 | // test: /\.wasm$/, 11 | // type: "webassembly/async" 12 | // }); 13 | // 14 | // 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/NanoDSLFileType.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language 2 | 3 | import com.intellij.openapi.fileTypes.LanguageFileType 4 | import javax.swing.Icon 5 | 6 | object NanoDSLFileType : LanguageFileType(NanoDSLLanguage) { 7 | override fun getName(): String = "NanoDSL" 8 | 9 | override fun getDescription(): String = "NanoDSL Language File" 10 | 11 | override fun getDefaultExtension(): String = "nanodsl" 12 | 13 | override fun getIcon(): Icon = NanoDSLIcons.DEFAULT 14 | } 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/AutoSketchModeListener.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.sketch 2 | 3 | import com.intellij.util.messages.Topic 4 | import java.util.EventListener 5 | 6 | @FunctionalInterface 7 | interface AutoSketchModeListener : EventListener { 8 | fun start() 9 | 10 | fun done() 11 | 12 | companion object { 13 | @Topic.AppLevel 14 | val TOPIC: Topic = 15 | Topic(AutoSketchModeListener::class.java, Topic.BroadcastDirection.TO_DIRECT_CHILDREN) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputListener.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.gui.chat.ui 2 | 3 | import com.intellij.openapi.editor.ex.EditorEx 4 | import java.util.* 5 | 6 | enum class AutoDevInputTrigger { 7 | Button, 8 | Key 9 | } 10 | 11 | interface AutoDevInputListener : EventListener { 12 | fun editorAdded(editor: EditorEx) {} 13 | fun onSubmit(component: AutoDevInputSection, trigger: AutoDevInputTrigger) {} 14 | fun onStop(component: AutoDevInputSection) {} 15 | fun manualSend(userInput: String) {} 16 | } -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevAppPlatform.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | /** 6 | * 平台特定的 AutoDevApp 入口 7 | * 8 | * 使用 expect/actual 模式支持不同平台的 UI 实现: 9 | * - Android: BottomNavigation + Drawer 10 | * - Desktop: SessionSidebar + TopBar 11 | * - WASM: Minimal UI 12 | */ 13 | @Composable 14 | expect fun PlatformAutoDevApp( 15 | triggerFileChooser: Boolean = false, 16 | onFileChooserHandled: () -> Unit = {}, 17 | initialMode: String = "auto" 18 | ) 19 | 20 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "Xiuper" 2 | 3 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 4 | 5 | pluginManagement { 6 | repositories { 7 | google() 8 | mavenCentral() 9 | gradlePluginPortal() 10 | } 11 | } 12 | 13 | //include("mpp-linter") 14 | include("mpp-core") 15 | include("mpp-ui") 16 | include("mpp-codegraph") 17 | include("mpp-server") 18 | include("mpp-viewer") 19 | include("mpp-viewer-web") 20 | include("xiuper-ui") 21 | include("xiuper-fs") 22 | 23 | // IDEA plugin as composite build 24 | includeBuild("mpp-idea") 25 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/provider/DatabaseFunction.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.bridge.provider 2 | 3 | enum class DatabaseFunction(val funName: String) { 4 | Schema("schema"), 5 | Table("table"), 6 | Column("column"), 7 | Query("query") 8 | ; 9 | 10 | companion object { 11 | fun fromString(value: String): DatabaseFunction? { 12 | return entries.firstOrNull { it.funName == value } 13 | } 14 | 15 | fun allFuncNames(): List = entries.map(DatabaseFunction::funName) 16 | } 17 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/InlayDisposeContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.inlay.codecomplete 2 | 3 | enum class InlayDisposeContext { 4 | UserAction, 5 | IdeCompletion, 6 | CaretChange, 7 | SelectionChange, 8 | SettingsChange, 9 | Cycling, 10 | TypingAsSuggested, 11 | Typing, 12 | Applied, 13 | ; 14 | 15 | val isResetLastRequest: Boolean 16 | get() = this == SettingsChange || this == Applied 17 | val isSendRejectedTelemetry: Boolean 18 | get() = this == UserAction 19 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/test/kotlin/cc/unitmesh/devti/custom/variable/CustomVariableTest.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | import cc.unitmesh.devti.custom.compile.CustomVariable 4 | import junit.framework.TestCase.assertFalse 5 | import junit.framework.TestCase.assertTrue 6 | import org.junit.Test 7 | 8 | 9 | class CustomVariableTest { 10 | @Test 11 | fun should_parse_variable_from_content() { 12 | assertTrue(CustomVariable.hasVariable("解释一下代码:\$selection")) 13 | assertFalse(CustomVariable.hasVariable("解释一下代码:\$selectio")) 14 | } 15 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/DevInIcons.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language 2 | 3 | import com.intellij.openapi.util.IconLoader 4 | import javax.swing.Icon 5 | 6 | object DevInIcons { 7 | @JvmField 8 | val DEFAULT: Icon = IconLoader.getIcon("/icons/devin.svg", DevInIcons::class.java) 9 | @JvmField 10 | val COMMAND: Icon = IconLoader.getIcon("/icons/devins-command.svg", DevInIcons::class.java) 11 | @JvmField 12 | val Terminal: Icon = IconLoader.getIcon("/icons/terminal.svg", DevInIcons::class.java) 13 | } 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/test/kotlin/cc/unitmesh/devti/language/compiler/execute/CrawlProcessorTest.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.compiler.execute 2 | 3 | import cc.unitmesh.devti.language.processor.CrawlProcessor 4 | import com.intellij.testFramework.fixtures.BasePlatformTestCase 5 | 6 | class CrawlProcessorTest : BasePlatformTestCase() { 7 | fun testShouldParseLink() { 8 | val urls = arrayOf("https://ide.unitmesh.cc/local-agent") 9 | val results = CrawlProcessor.execute(urls) 10 | assertEquals(results.size, 1) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/BackendCapabilities.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xiuper.fs 2 | 3 | /** 4 | * Declares which POSIX-subset operations a backend implements. 5 | * 6 | * Conformance tests use this to decide whether to assert full POSIX semantics 7 | * or only verify that unsupported operations fail with ENOTSUP. 8 | */ 9 | data class BackendCapabilities( 10 | val supportsMkdir: Boolean = true, 11 | val supportsDelete: Boolean = true 12 | ) 13 | 14 | interface CapabilityAwareBackend { 15 | val capabilities: BackendCapabilities 16 | } 17 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/prompts/default/create_controller.vm: -------------------------------------------------------------------------------- 1 | 你是一个资深的后端 CRUD 工程师,请根据下面的用户故事以及 {controllerName} 的相关信息,编写 Controller 部分的 Java 代码。要求如下: 2 | {spec} 3 | - 只返回修改完的函数代码,不做解释。 4 | - 请确保 service 类的名称与 {controllerName} 相关的 service 类的名称一致。 5 | - 请参考标准的 RESTful API 设计规范,尽量使用标准的 HTTP 方法和状态码。 6 | 7 | ### 8 | // {controllerName} 相关信息如下: 9 | {controllers} 10 | ### 11 | 12 | ### 13 | // 相关 DTO 和 entity 类如下: 14 | {models} 15 | 16 | // 所有 service 类如下,{如果不存在需要的 service 类,请自行创建} 17 | {services} 18 | ### 19 | 20 | 用户故事如下: 21 | 22 | ### 23 | {storyDetail} 24 | ### 25 | 26 | -------------------------------------------------------------------------------- /mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Serialization.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.server.plugins 2 | 3 | import io.ktor.http.* 4 | import io.ktor.serialization.kotlinx.json.* 5 | import io.ktor.server.application.* 6 | import io.ktor.server.plugins.contentnegotiation.* 7 | import kotlinx.serialization.json.Json 8 | 9 | fun Application.configureSerialization() { 10 | install(ContentNegotiation) { 11 | json(Json { 12 | prettyPrint = true 13 | isLenient = true 14 | ignoreUnknownKeys = true 15 | }) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /mpp-web/README.md: -------------------------------------------------------------------------------- 1 | # xuiper.com Landing (mpp-web) 2 | 3 | 本目录基于现有 `mpp-web`(Vite + React)实现 **`www.xuiper.com` 的 landing page**,并保留原来的 Web UI(用于演示 `mpp-core`): 4 | 5 | - 访问 **Landing**:`/#/` 6 | - 访问 **Web UI**:`/#/app` 7 | 8 | ## 本地开发 9 | 10 | ```bash 11 | cd mpp-web 12 | npm run dev 13 | ``` 14 | 15 | ## 构建 16 | 17 | > `npm run build` 会先构建 Kotlin/JS 的 `mpp-core` 产物,再执行 Vite 构建。 18 | 19 | ```bash 20 | cd mpp-web 21 | npm run build 22 | ``` 23 | 24 | ## 部署到自定义域名 25 | 26 | - `public/CNAME` 已设置为 `www.xuiper.com`,适用于 GitHub Pages 自定义域名。 27 | - 如果你使用 Vercel/Cloudflare Pages,也可以保留该文件(不影响构建产物)。 -------------------------------------------------------------------------------- /mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.database 2 | 3 | /** 4 | * JS platform database connection placeholder 5 | * 6 | * JS platform does not support direct database connections. 7 | * Use server HTTP API to access databases instead. 8 | */ 9 | actual fun createDatabaseConnection(config: DatabaseConfig): DatabaseConnection { 10 | throw UnsupportedOperationException( 11 | "Database connections are not supported on JS platform. " + 12 | "Use the server API to access databases instead." 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/ShireRunnerContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.run.runner 2 | 3 | import cc.unitmesh.devti.language.ast.HobbitHole 4 | import cc.unitmesh.devti.language.compiler.DevInsCompiledResult 5 | import com.intellij.openapi.editor.Editor 6 | 7 | class ShireRunnerContext( 8 | val hole: HobbitHole?, 9 | val editor: Editor?, 10 | val compileResult: DevInsCompiledResult, 11 | val finalPrompt: String = "", 12 | val hasError: Boolean, 13 | val compiledVariables: Map, 14 | ) 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/ShellSuggestContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.terminal 2 | 3 | import cc.unitmesh.devti.template.context.TemplateContext 4 | import java.text.SimpleDateFormat 5 | import java.util.* 6 | 7 | data class ShellSuggestContext( 8 | val question: String, 9 | val shellPath: String, 10 | val cwd: String, 11 | // today's date like 20240322 12 | val today: String = SimpleDateFormat("yyyyMMdd").format(Date()), 13 | // operating system name 14 | val os: String = System.getProperty("os.name") 15 | ) : TemplateContext -------------------------------------------------------------------------------- /mpp-vscode/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2022", 5 | "lib": ["ES2022"], 6 | "outDir": "dist", 7 | "rootDir": "src", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "resolveJsonModule": true, 13 | "declaration": true, 14 | "declarationMap": true, 15 | "sourceMap": true, 16 | "moduleResolution": "node" 17 | }, 18 | "include": ["src/**/*"], 19 | "exclude": ["node_modules", "dist", "webview"] 20 | } 21 | 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Dependabot configuration: 2 | # https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | # Maintain dependencies for Gradle dependencies 7 | - package-ecosystem: "gradle" 8 | directory: "/" 9 | target-branch: "next" 10 | schedule: 11 | interval: "daily" 12 | # Maintain dependencies for GitHub Actions 13 | - package-ecosystem: "github-actions" 14 | directory: "/" 15 | target-branch: "next" 16 | schedule: 17 | interval: "daily" 18 | -------------------------------------------------------------------------------- /mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelTypeAliases.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.idea.renderer.nano.components 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.Modifier 5 | import cc.unitmesh.xuiper.render.stateful.NanoNodeContext 6 | import cc.unitmesh.xuiper.render.stateful.NanoNodeRenderer 7 | 8 | /** 9 | * Shared type aliases for Jewel nano components. 10 | */ 11 | typealias JewelContext = NanoNodeContext Unit> 12 | typealias JewelRenderer = NanoNodeRenderer Unit> 13 | -------------------------------------------------------------------------------- /mpp-vscode/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['src/**/*.test.ts', 'test/**/*.test.ts'], 8 | exclude: ['node_modules', 'dist'], 9 | coverage: { 10 | provider: 'v8', 11 | reporter: ['text', 'json', 'html'], 12 | include: ['src/**/*.ts'], 13 | exclude: ['src/**/*.test.ts', 'src/**/*.d.ts'] 14 | } 15 | }, 16 | resolve: { 17 | alias: { 18 | vscode: './test/mocks/vscode.ts' 19 | } 20 | } 21 | }); 22 | 23 | -------------------------------------------------------------------------------- /mpp-vscode/webview/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | import { resolve } from 'path'; 4 | 5 | export default defineConfig({ 6 | plugins: [react()], 7 | build: { 8 | outDir: '../dist/webview', 9 | emptyOutDir: true, 10 | rollupOptions: { 11 | input: resolve(__dirname, 'index.html'), 12 | output: { 13 | entryFileNames: 'assets/[name].js', 14 | chunkFileNames: 'assets/[name].js', 15 | assetFileNames: 'assets/[name].[ext]' 16 | } 17 | } 18 | }, 19 | base: './' 20 | }); 21 | 22 | -------------------------------------------------------------------------------- /xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/theme/NanoDesignSystemSpec.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xuiper.render.theme 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | /** 6 | * Platform-independent design system specification. 7 | * 8 | * Contains color tokens for both light and dark modes. 9 | * Platform implementations convert these to their specific color systems. 10 | */ 11 | @Serializable 12 | data class NanoDesignSystemSpec( 13 | val id: String, 14 | val displayName: String, 15 | val lightTokens: NanoColorToken, 16 | val darkTokens: NanoColorToken 17 | ) 18 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/flow/DevInsProcessContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.run.flow 2 | 3 | import cc.unitmesh.devti.language.compiler.DevInsCompiledResult 4 | 5 | data class DevInsProcessContext( 6 | val scriptPath: String, 7 | val compiledResult: DevInsCompiledResult, 8 | val llmResponse: String, 9 | val ideOutput: String, 10 | val messages: MutableList = mutableListOf(), 11 | var hadReRun: Boolean = false 12 | ) { 13 | // update messages when has Error or Warning 14 | } -------------------------------------------------------------------------------- /mpp-ios/AutoDevApp/AutoDevApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoDevApp.swift 3 | // AutoDevApp 4 | // 5 | // AutoDev iOS Application 6 | // Copyright © 2024 Unit Mesh. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | @main 12 | struct AutoDevApp: App { 13 | init() { 14 | print("🚀 AutoDev iOS App starting...") 15 | setupApp() 16 | } 17 | 18 | var body: some Scene { 19 | WindowGroup { 20 | ContentView() 21 | } 22 | } 23 | 24 | private func setupApp() { 25 | // 应用初始化配置 26 | // 例如: 设置日志级别、主题等 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlatformMessageTextContainer.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.foundation.text.selection.SelectionContainer 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | 7 | /** 8 | * JS 平台实现 - 支持文本选择 9 | */ 10 | @Composable 11 | actual fun PlatformMessageTextContainer( 12 | text: String, 13 | modifier: Modifier, 14 | content: @Composable () -> Unit 15 | ) { 16 | SelectionContainer(modifier = modifier) { 17 | content() 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/runner/RunnerStatus.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package cc.unitmesh.devti.provider.runner 3 | 4 | enum class RunnerStatus(val rawStatus: String) { 5 | Unchecked("UNCHECKED"), 6 | Solved("CORRECT"), 7 | Failed("WRONG"); 8 | 9 | companion object { 10 | fun String.toCheckStatus(): RunnerStatus = when (this) { 11 | "CORRECT" -> Solved 12 | "WRONG" -> Failed 13 | else -> Unchecked 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/select/PsiElementStrategy.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.middleware.select 2 | 3 | import com.intellij.openapi.editor.Editor 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.openapi.util.TextRange 6 | import com.intellij.psi.PsiElement 7 | import com.intellij.psi.PsiFile 8 | 9 | interface PsiElementStrategy { 10 | fun getElementToAction(project: Project?, editor: Editor?): PsiElement? 11 | fun getElementToAction(project: Project?, psiFile: PsiFile, range: TextRange): PsiElement? 12 | } 13 | -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlatformMessageTextContainer.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.foundation.text.selection.SelectionContainer 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | 7 | /** 8 | * iOS 平台实现 - 支持文本选择 9 | */ 10 | @Composable 11 | actual fun PlatformMessageTextContainer( 12 | text: String, 13 | modifier: Modifier, 14 | content: @Composable () -> Unit 15 | ) { 16 | SelectionContainer(modifier = modifier) { 17 | content() 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /xiuper-ui/src/main/resources/prompts/examples/counter.nanodsl: -------------------------------------------------------------------------------- 1 | component CounterCard: 2 | state: 3 | count: int = 1 4 | price: float = 99.0 5 | 6 | Card: 7 | padding: "lg" 8 | content: 9 | VStack: 10 | Text(content << f"Total: ${state.count * state.price}") 11 | 12 | HStack: 13 | Button("-"): 14 | on_click: state.count -= 1 15 | 16 | Input(value := state.count) 17 | 18 | Button("+"): 19 | on_click: state.count += 1 20 | 21 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/schema/InlayCodePromptsJsonSchemaProviderFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.schema 2 | 3 | import com.intellij.openapi.project.Project 4 | import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider 5 | import com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory 6 | 7 | class InlayCodePromptsJsonSchemaProviderFactory: JsonSchemaProviderFactory { 8 | override fun getProviders(project: Project): MutableList { 9 | return mutableListOf(InlayCodeCompletePromptsSchemaFileProvider(project)) 10 | } 11 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/speckit.devin: -------------------------------------------------------------------------------- 1 | # Spec-Kit Commands 2 | 3 | GitHub Spec-Kit provides a structured approach to Spec-Driven Development. These commands help you create specifications, plans, and implementations following the spec-driven methodology. 4 | 5 | ### 1. Constitution - Establish Project Principles 6 | 7 | Create or update project governing principles and development guidelines: 8 | 9 | ```devin 10 | /speckit.constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements 11 | ``` 12 | -------------------------------------------------------------------------------- /mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlatformMessageTextContainer.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.foundation.text.selection.SelectionContainer 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | 7 | /** 8 | * JS 平台实现 - 支持文本选择 9 | */ 10 | @Composable 11 | actual fun PlatformMessageTextContainer( 12 | text: String, 13 | modifier: Modifier, 14 | content: @Composable () -> Unit 15 | ) { 16 | SelectionContainer(modifier = modifier) { 17 | content() 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/ExplainThisAction.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.actions.chat 2 | 3 | import cc.unitmesh.devti.actions.chat.base.ChatCheckForUpdateAction 4 | import cc.unitmesh.devti.gui.chat.message.ChatActionType 5 | import cc.unitmesh.devti.settings.locale.LanguageChangedCallback.presentationText 6 | 7 | class ExplainThisAction() : ChatCheckForUpdateAction() { 8 | init{ 9 | presentationText("settings.autodev.rightClick.explain", templatePresentation) 10 | } 11 | 12 | override fun getActionType(): ChatActionType = ChatActionType.EXPLAIN 13 | } 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/MarkdownPreviewSketchProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.sketch.ui 2 | 3 | import com.intellij.openapi.project.Project 4 | 5 | class MarkdownPreviewSketchProvider : LanguageSketchProvider { 6 | /** 7 | * Since Webview had a bad performance, we disable it by default. 8 | */ 9 | override fun isSupported(lang: String): Boolean { 10 | return lang.lowercase() == "markdown" 11 | } 12 | 13 | override fun create(project: Project, content: String): ExtensionLangSketch = MarkdownPreviewHighlightSketch(project, content) 14 | } 15 | -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlatformMessageTextContainer.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.foundation.text.selection.SelectionContainer 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | 7 | /** 8 | * Android 平台实现 - 支持文本选择 9 | */ 10 | @Composable 11 | actual fun PlatformMessageTextContainer( 12 | text: String, 13 | modifier: Modifier, 14 | content: @Composable () -> Unit 15 | ) { 16 | SelectionContainer(modifier = modifier) { 17 | content() 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /xiuper-fs/src/commonTest/kotlin/cc/unitmesh/xiuper/fs/FsPathTest.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xiuper.fs 2 | 3 | import kotlin.test.Test 4 | import kotlin.test.assertEquals 5 | 6 | class FsPathTest { 7 | @Test 8 | fun normalizeRemovesDotSegments() { 9 | assertEquals("/a/b", FsPath.normalize("/a/./b")) 10 | assertEquals("/a/b", FsPath.normalize("/a/x/../b")) 11 | assertEquals("/", FsPath.normalize("/../")) 12 | } 13 | 14 | @Test 15 | fun resolveJoinsAndNormalizes() { 16 | val p = FsPath.of("/a").resolve("b/../c") 17 | assertEquals("/a/c", p.value) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /xiuper-ui/src/commonMain/resources/prompts/examples/counter.nanodsl: -------------------------------------------------------------------------------- 1 | component CounterCard: 2 | state: 3 | count: int = 1 4 | price: float = 99.0 5 | 6 | Card: 7 | padding: "lg" 8 | content: 9 | VStack: 10 | Text(content << f"Total: ${state.count * state.price}") 11 | 12 | HStack: 13 | Button("-"): 14 | on_click: state.count -= 1 15 | 16 | Input(value := state.count) 17 | 18 | Button("+"): 19 | on_click: state.count += 1 20 | 21 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/devins/document/DocumentRegistry.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.document 2 | 3 | import io.github.oshai.kotlinlogging.KotlinLogging 4 | 5 | private val logger = KotlinLogging.logger {} 6 | 7 | /** 8 | * WASM platform-specific initialization 9 | * Currently only Markdown is supported on WASM platform 10 | */ 11 | actual fun platformInitialize() { 12 | logger.info { "Initializing WASM document parsers (Markdown only)" } 13 | // WASM platform only supports Markdown for now 14 | // Markdown parser is already registered in DocumentRegistry init block 15 | } 16 | 17 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/HtmlHighlightSketch.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.sketch.ui.code 2 | 3 | import cc.unitmesh.devti.sketch.ui.ExtensionLangSketch 4 | import com.intellij.lang.html.HTMLLanguage 5 | import com.intellij.openapi.project.Project 6 | 7 | /** 8 | * Before WebView rendering, we use this class to highlight the HTML code. 9 | */ 10 | class HtmlHighlightSketch(override val project: Project, override val text: String) : 11 | CodeHighlightSketch(project, text, HTMLLanguage.INSTANCE), ExtensionLangSketch { 12 | override fun getExtensionName(): String = "HTML" 13 | } -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.Modifier 5 | 6 | /** 7 | * File system tree view - platform-specific implementation 8 | * 9 | * JVM/Android: Uses Bonsai library for rich tree view 10 | * JS: Provides a simplified placeholder (Bonsai doesn't support JS) 11 | */ 12 | @Composable 13 | expect fun FileSystemTreeView( 14 | rootPath: String, 15 | onFileClick: (String) -> Unit, 16 | onClose: () -> Unit, 17 | modifier: Modifier 18 | ) 19 | -------------------------------------------------------------------------------- /mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.wasm.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | /** 6 | * WASM 专属的 AutoDevApp 实现 7 | * 8 | * 委托给 commonMain 中的 AutoDevApp 实现 9 | */ 10 | @Composable 11 | actual fun PlatformAutoDevApp( 12 | triggerFileChooser: Boolean, 13 | onFileChooserHandled: () -> Unit, 14 | initialMode: String 15 | ) { 16 | AutoDevApp( 17 | triggerFileChooser = triggerFileChooser, 18 | onFileChooserHandled = onFileChooserHandled, 19 | initialMode = initialMode 20 | ) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /mpp-vscode/webview/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | "moduleResolution": "bundler", 9 | "allowImportingTsExtensions": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "noEmit": true, 13 | "jsx": "react-jsx", 14 | "strict": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "noFallthroughCasesInSwitch": true 18 | }, 19 | "include": ["src"] 20 | } 21 | 22 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/browse/Browse.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.agent.tool.browse 2 | 3 | import org.jsoup.Jsoup 4 | import org.jsoup.nodes.Document 5 | 6 | class Browse { 7 | companion object { 8 | /** 9 | * Doc for parseHtml 10 | * 11 | * Intellij API: [com.intellij.inspectopedia.extractor.utils.HtmlUtils.cleanupHtml] 12 | */ 13 | fun parse(url: String): DocumentContent { 14 | val doc: Document = Jsoup.connect(url).get() 15 | return DocumentCleaner().cleanHtml(doc) 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/sql/sql-gen-design.vm: -------------------------------------------------------------------------------- 1 | 你是一名专业的数据库管理员。 2 | 根据用户的需求和表信息,为用户编写 SQL。 3 | 4 | - 用户使用的数据库版本:${context.databaseVersion} 5 | - 用户架构名称:${context.schemaName} 6 | - 用户表信息:${context.tableInfos} 7 | 8 | 例如: 9 | 10 | - 问题(需求):按订阅者类型计算平均行程长度。 11 | // table `subscriber_type`: average_trip_length: int, subscriber_type: string 12 | - 回答: 13 | ```sql 14 | select average_trip_length from subscriber_type where subscriber_type = 'subscriber' 15 | ``` 16 | 17 | ---- 18 | 19 | 以下是需求: 20 | 21 | ```markdown 22 | ${context.requirement} 23 | ``` 24 | 请使用 Markdown 语法编写您的 SQL,无需解释。 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/test/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | cc.unitmesh.devti 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/MvcUtil.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.idea 2 | 3 | object MvcUtil { 4 | fun isController(fileName: String, lang: String): Boolean { 5 | return fileName.endsWith("Controller.${lang.lowercase()}") 6 | } 7 | 8 | fun isService(fileName: String, lang: String) = 9 | fileName.endsWith("Service.$${lang.lowercase()}") || fileName.endsWith("ServiceImpl.$${lang.lowercase()}") 10 | 11 | fun isRepository(fileName: String, lang: String) = 12 | fileName.endsWith("Repository.$${lang.lowercase()}") || fileName.endsWith("Repo.$${lang.lowercase()}") 13 | } 14 | -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.nano 2 | 3 | import android.graphics.BitmapFactory 4 | import androidx.compose.ui.graphics.ImageBitmap 5 | import androidx.compose.ui.graphics.asImageBitmap 6 | 7 | /** 8 | * Android implementation of decodeImageBytesToBitmap. 9 | */ 10 | internal actual fun decodeImageBytesToBitmap(bytes: ByteArray): ImageBitmap { 11 | val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size) 12 | ?: throw IllegalArgumentException("Failed to decode image bytes") 13 | return bitmap.asImageBitmap() 14 | } 15 | 16 | -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/Main.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui 2 | 3 | import androidx.compose.ui.window.ComposeUIViewController 4 | import cc.unitmesh.devins.ui.compose.PlatformAutoDevApp 5 | import platform.UIKit.UIViewController 6 | 7 | /** 8 | * iOS 应用入口点 9 | * 10 | * 这个函数会被 iOS 应用调用来创建 Compose UI 视图控制器 11 | * 12 | * 在 Swift 中使用: 13 | * ```swift 14 | * import AutoDevUI 15 | * 16 | * let viewController = MainKt.MainViewController() 17 | * ``` 18 | */ 19 | fun MainViewController(): UIViewController { 20 | return ComposeUIViewController { 21 | PlatformAutoDevApp() 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /mpp-vscode/.vscodeignore: -------------------------------------------------------------------------------- 1 | # VSCode extension ignore file 2 | # Exclude source files and build artifacts not needed in the packaged extension 3 | 4 | # Source files 5 | src/ 6 | webview/src/ 7 | webview/node_modules/ 8 | 9 | # Build artifacts 10 | *.map 11 | tsconfig.json 12 | .eslintrc.json 13 | 14 | # Development files 15 | .vscode/ 16 | node_modules/ 17 | .gitignore 18 | .git/ 19 | 20 | # Test files 21 | **/__tests__/** 22 | **/*.test.* 23 | **/*.spec.* 24 | 25 | # Documentation (keep README.md) 26 | CHANGELOG.md 27 | 28 | # Exclude parent directories 29 | ../ 30 | 31 | # Keep dist and wasm folders 32 | !dist/ 33 | !wasm/ 34 | 35 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/PsiCapture.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.provider 2 | 3 | import com.intellij.lang.Language 4 | import com.intellij.lang.LanguageExtension 5 | 6 | interface PsiCapture { 7 | fun capture(fileContent: String, type: String): List 8 | 9 | companion object { 10 | private val languageExtension: LanguageExtension = 11 | LanguageExtension("cc.unitmesh.shirePsiCapture") 12 | 13 | fun provide(language: Language): PsiCapture? { 14 | return languageExtension.forLanguage(language) 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/test/kotlin/cc/unitmesh/devti/language/completion/dataprovider/BuiltinCommandTest.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.completion.dataprovider 2 | 3 | import cc.unitmesh.devti.command.dataprovider.BuiltinCommand 4 | import junit.framework.TestCase.assertEquals 5 | import org.junit.Test 6 | 7 | class BuiltinCommandTest { 8 | @Test 9 | fun shouldEnableGetBuiltinExamples() { 10 | val commandList = BuiltinCommand.all() 11 | val map = commandList.map { 12 | BuiltinCommand.example(it) 13 | } 14 | 15 | assertEquals(commandList.size, map.size) 16 | } 17 | } -------------------------------------------------------------------------------- /mpp-ios/AutoDevApp/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // AutoDevApp 4 | // 5 | // Main content view for AutoDev iOS App 6 | // Copyright © 2024 Unit Mesh. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ContentView: View { 12 | var body: some View { 13 | ZStack { 14 | // 背景色 - 使用深色背景以匹配 AutoDev 主题 15 | Color.black 16 | .ignoresSafeArea() 17 | 18 | // Compose UI 视图 19 | ComposeView() 20 | .ignoresSafeArea() 21 | } 22 | } 23 | } 24 | 25 | #Preview { 26 | ContentView() 27 | } 28 | 29 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/code/test-gen.vm: -------------------------------------------------------------------------------- 1 | 为以下代码编写单元测试。 2 | 3 | ${context.frameworkContext} 4 | 5 | #if( $context.relatedClasses.length() > 0 ) 6 | ${context.relatedClasses} 7 | #end 8 | #if( $context.currentClass.length() > 0 ) 9 | 以下是当前类的信息: 10 | ${context.currentClass} 11 | #end 12 | ${context.extContext} 13 | 以下是待测试的源代码: 14 | 15 | ```$context.lang 16 | ${context.imports} 17 | ${context.sourceCode} 18 | ``` 19 | 20 | 如果是新文件 21 | #if( $context.isNewFile ) 22 | 请包含package和import,在此处使用 Markdown 代码块编写方法测试代码: 23 | #else 24 | 请包含package和import, 在此处使用 Markdown 代码块编写 ${context.testClassName} 测试代码: 25 | #end 26 | 27 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/icons/stop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rectangle 2 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/psi/NanoDSLFile.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.nanodsl.language.psi 2 | 3 | import cc.unitmesh.nanodsl.language.NanoDSLFileType 4 | import cc.unitmesh.nanodsl.language.NanoDSLLanguage 5 | import com.intellij.extapi.psi.PsiFileBase 6 | import com.intellij.openapi.fileTypes.FileType 7 | import com.intellij.psi.FileViewProvider 8 | 9 | class NanoDSLFile(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, NanoDSLLanguage) { 10 | override fun getFileType(): FileType = NanoDSLFileType 11 | 12 | override fun toString(): String = "NanoDSL File" 13 | } 14 | 15 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/en/practises/shell-suggest.vm: -------------------------------------------------------------------------------- 1 | Return only the command to be executed as a raw string, no string delimiters 2 | wrapping it, no yapping, no markdown, no fenced code blocks, what you return 3 | will be passed to subprocess.check_output() directly. 4 | 5 | - Today is: ${context.today}, user system is: ${context.os}, 6 | - User current directory is: ${context.cwd}, user use is: ${context.shellPath}, according the tool to create the command. 7 | 8 | For example, if the user asks: undo last git commit 9 | 10 | You return only line command: git reset --soft HEAD~1 11 | 12 | User asks: ${context.question} 13 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/practises/code-review.vm: -------------------------------------------------------------------------------- 1 | 你是一位经验丰富的软件开发者,我寻求您的专业知识来审查以下代码: 2 | 3 | - 专注于代码中的关键算法、逻辑流程和设计决策。讨论这些变化如何影响核心功能和代码的整体结构。 4 | - 确定并突出显示这些代码变化可能引入的任何潜在问题或风险。这将帮助审阅人员特别关注可能需要改进或进一步分析的领域。 5 | - 强调与现有代码库的兼容性和一致性的重要性。确保代码符合已建立的标准和实践,以确保代码的统一性和长期可维护性。 6 | 7 | ${context.frameworkContext} 8 | 9 | 如下是变更的结构化表示, + means new method, - means deleted method: 10 | 11 | ${context.structureContext} 12 | 13 | #if($context.stories.isNotEmpty()) 14 | 以下用户故事与这些变化相关: 15 | ${context.stories.joinToString("\n")} 16 | #end 17 | 18 | ${context.diffContext} 19 | 20 | 作为您的技术负责人,我只关注关键的代码审查问题。请在此提供关键总结。 21 | 在此处以不超过 5 句话提交您的关键见解: -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/practises/shell-suggest.vm: -------------------------------------------------------------------------------- 1 | Return only the command to be executed as a raw string, no string delimiters 2 | wrapping it, no yapping, no markdown, no fenced code blocks, what you return 3 | will be passed to subprocess.check_output() directly. 4 | 5 | - Today is: ${context.today}, user system is: ${context.os}, 6 | - User current directory is: ${context.cwd}, user use is: ${context.shellPath}, according the tool to create the command. 7 | 8 | For example, if the user asks: undo last git commit 9 | 10 | You return only line command: git reset --soft HEAD~1 11 | 12 | User asks: ${context.question} 13 | -------------------------------------------------------------------------------- /mpp-vscode/webview/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "autodev-webview", 3 | "version": "0.1.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "react": "^18.2.0", 13 | "react-dom": "^18.2.0", 14 | "react-markdown": "^9.0.1", 15 | "remark-gfm": "^4.0.0" 16 | }, 17 | "devDependencies": { 18 | "@types/react": "^18.2.0", 19 | "@types/react-dom": "^18.2.0", 20 | "@vitejs/plugin-react": "^4.2.0", 21 | "typescript": "^5.3.0", 22 | "vite": "^5.0.0" 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.database 2 | 3 | /** 4 | * iOS platform database connection placeholder 5 | * 6 | * iOS should use Core Data or SQLite for local storage, 7 | * not direct remote database connections. 8 | * Use server API when accessing remote databases. 9 | */ 10 | actual fun createDatabaseConnection(config: DatabaseConfig): DatabaseConnection { 11 | throw UnsupportedOperationException( 12 | "Direct database connections are not recommended on iOS. " + 13 | "Use Core Data for local storage or connect through server API." 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/locale/LocaleLanguages.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.settings.locale 2 | 3 | @Suppress("unused") 4 | enum class HUMAN_LANGUAGES(val abbr: String, val display: String) { 5 | ENGLISH("en", "English"), 6 | CHINESE("zh", "中文"); 7 | 8 | companion object { 9 | private val map: Map = values().map { it.display to it }.toMap() 10 | 11 | fun getAbbrByDispay(display: String): String { 12 | return map.getOrDefault(display, ENGLISH).abbr 13 | } 14 | } 15 | } 16 | val DEFAULT_HUMAN_LANGUAGE = HUMAN_LANGUAGES.ENGLISH.display 17 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | /** 6 | * JS 专属的 AutoDevApp 实现 7 | * 8 | * 委托给 commonMain 中的 AutoDevApp 实现 9 | */ 10 | @Composable 11 | actual fun PlatformAutoDevApp( 12 | triggerFileChooser: Boolean, 13 | onFileChooserHandled: () -> Unit, 14 | initialMode: String 15 | ) { 16 | // JS 平台使用 commonMain 中的原有实现 17 | AutoDevApp( 18 | triggerFileChooser = triggerFileChooser, 19 | onFileChooserHandled = onFileChooserHandled, 20 | initialMode = initialMode 21 | ) 22 | } 23 | 24 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/InsCommand.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.command 2 | 3 | import cc.unitmesh.devti.command.dataprovider.BuiltinCommand 4 | 5 | interface InsCommand { 6 | val commandName: BuiltinCommand 7 | 8 | /** 9 | * Check if the command is applicable , especially for the binary command, like ripgrep. 10 | */ 11 | fun isApplicable(): Boolean = true 12 | 13 | /** 14 | * Execute the command and return the result. 15 | */ 16 | suspend fun execute(): String? 17 | } 18 | 19 | enum class InsCommandStatus { 20 | SUCCESS, 21 | FAILED, 22 | RUNNING 23 | } 24 | 25 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/context/builder/MethodContextBuilder.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.context.builder 2 | 3 | import cc.unitmesh.devti.context.MethodContext 4 | import com.intellij.psi.PsiElement 5 | 6 | /** 7 | * The MethodContextBuilder interface provides a method for retrieving the method context of a given PsiElement. 8 | * A method context represents the context in which a method is defined or used within a codebase. 9 | * @see MethodContext 10 | */ 11 | interface MethodContextBuilder { 12 | fun getMethodContext(psiElement: PsiElement, includeClassContext: Boolean, gatherUsages: Boolean): MethodContext? 13 | } 14 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/prompting/code/TechStack.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.prompting.code 2 | 3 | data class TechStack( 4 | val coreFrameworks: MutableMap = mutableMapOf(), 5 | val testFrameworks: MutableMap = mutableMapOf(), 6 | val deps: MutableMap = mutableMapOf(), 7 | val devDeps: MutableMap = mutableMapOf() 8 | ) { 9 | fun coreFrameworks(): String { 10 | return coreFrameworks.keys.joinToString(", ") 11 | } 12 | 13 | fun testFrameworks(): String { 14 | return testFrameworks.keys.joinToString(", ") 15 | } 16 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/ui.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti 2 | 3 | import com.intellij.ui.dsl.builder.* 4 | import javax.swing.JComponent 5 | 6 | fun Row.fullWidthCell(component: T): Cell { 7 | return cell(component) 8 | .align(Align.FILL) 9 | } 10 | 11 | fun Cell.fullWidth(): Cell { 12 | return this.align(AlignX.FILL) 13 | } 14 | 15 | fun Cell.fullHeight(): Cell { 16 | return this.align(AlignY.FILL) 17 | } 18 | 19 | // align right 20 | fun Cell.alignRight(): Cell { 21 | return this.align(AlignX.RIGHT) 22 | } 23 | 24 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/variable/resolver/base/VariableResolverContext.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.variable.resolver.base 2 | 3 | import cc.unitmesh.devti.language.ast.HobbitHole 4 | import com.intellij.openapi.editor.Editor 5 | import com.intellij.openapi.project.Project 6 | import com.intellij.psi.PsiElement 7 | import cc.unitmesh.devti.language.ast.variable.VariableTable 8 | 9 | data class VariableResolverContext( 10 | val myProject: Project, 11 | val editor: Editor, 12 | val hole: HobbitHole?, 13 | val variableTable: VariableTable, 14 | var element: PsiElement? 15 | ) -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Markdown Renderer Demo - Web 7 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /xiuper-ui/testcases/expect/03-counter-card.nanodsl: -------------------------------------------------------------------------------- 1 | component CounterCard: 2 | state: 3 | count: int = 1 4 | price: float = 99.0 5 | 6 | Card: 7 | padding: "lg" 8 | content: 9 | VStack: 10 | Text(content << f"Total: ${state.count * state.price}") 11 | 12 | HStack: 13 | Button("-"): 14 | on_click: state.count -= 1 15 | 16 | Input(value := state.count) 17 | 18 | Button("+"): 19 | on_click: state.count += 1 20 | 21 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/gitignore/InvalidGitIgnorePatternException.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.vcs.gitignore 2 | 3 | /** 4 | * Exception thrown when a gitignore pattern is malformed or cannot be processed. 5 | * 6 | * @param originalPattern the original gitignore pattern that caused the error 7 | * @param message detailed error message 8 | * @param cause the underlying cause of the error, if any 9 | */ 10 | class InvalidGitIgnorePatternException( 11 | val originalPattern: String, 12 | message: String, 13 | cause: Throwable? = null 14 | ) : Exception("Invalid gitignore pattern '$originalPattern': $message", cause) 15 | -------------------------------------------------------------------------------- /mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditAction.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.viewer.web.webedit 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | /** 6 | * Structured browser action request executed by the injected WebEdit bridge script. 7 | * 8 | * Keep this schema small and stable so LLMs can reliably emit it. 9 | */ 10 | @Serializable 11 | data class WebEditAction( 12 | val action: String, 13 | val selector: String? = null, 14 | val text: String? = null, 15 | val clearFirst: Boolean? = null, 16 | val value: String? = null, 17 | val key: String? = null, 18 | val id: String? = null 19 | ) 20 | 21 | 22 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/devins/document/DocumentRegistry.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.document 2 | 3 | import io.github.oshai.kotlinlogging.KotlinLogging 4 | 5 | private val logger = KotlinLogging.logger {} 6 | 7 | /** 8 | * iOS platform-specific initialization 9 | * Currently only Markdown is supported on iOS platform 10 | * TODO: Consider adding iOS-specific document parsers 11 | */ 12 | actual fun platformInitialize() { 13 | logger.info { "Initializing iOS document parsers (Markdown only)" } 14 | // iOS platform only supports Markdown for now 15 | // Markdown parser is already registered in DocumentRegistry init block 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/ExecutorFactory.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.llm 2 | 3 | import ai.koog.prompt.executor.llms.SingleLLMPromptExecutor 4 | import cc.unitmesh.llm.provider.LLMClientProvider 5 | 6 | /** 7 | * JS implementation: GitHub Copilot not supported 8 | */ 9 | internal actual fun tryAutoRegisterGithubCopilot(): LLMClientProvider? = null 10 | 11 | /** 12 | * JS implementation: Blocking executor creation not supported 13 | * Use createAsync() instead for async initialization 14 | */ 15 | internal actual fun createExecutorBlocking( 16 | provider: LLMClientProvider, 17 | config: ModelConfig 18 | ): SingleLLMPromptExecutor? = null 19 | 20 | -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent.codereview 2 | 3 | import androidx.compose.runtime.Composable 4 | 5 | /** 6 | * File viewer dialog - platform-specific implementation 7 | * Shows file content in a dialog with modern features: 8 | * - Keyboard shortcuts (Esc to close, Ctrl+F/Cmd+F to search, Ctrl+W/Cmd+W to close) 9 | * - Syntax highlighting 10 | * - Line number highlighting 11 | */ 12 | @Composable 13 | expect fun FileViewerDialog( 14 | filePath: String, 15 | onClose: () -> Unit, 16 | startLine: Int? = null, 17 | endLine: Int? = null 18 | ) 19 | 20 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/typescript/ui/Banner.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Banner - Display ASCII art logo 3 | */ 4 | 5 | import React from 'react'; 6 | import { Box, Text } from 'ink'; 7 | import { AUTODEV_LOGO, AUTODEV_TAGLINE } from '../constants/asciiArt.js'; 8 | import { semanticInk } from '../design-system/theme-helpers.js'; 9 | 10 | export const Banner: React.FC = () => { 11 | return ( 12 | 13 | 14 | {AUTODEV_LOGO} 15 | 16 | 17 | {AUTODEV_TAGLINE} 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /example/prompt/autodev/controller-output.md: -------------------------------------------------------------------------------- 1 | # Output 2 | 3 | 4 | ``` 5 | @PostMapping("/blog") 6 | public ResponseEntity createBlog(@RequestBody Blog blog) { 7 | try { 8 | // 验证博客信息是否完整 9 | if (StringUtils.isBlank(blog.getTitle())) { 10 | return ResponseEntity.badRequest().body("请输入博客标题"); 11 | } 12 | 13 | // 调用 BlogService 创建博客 14 | Long blogId = blogService.createBlog(blog); 15 | 16 | // 返回博客 id 17 | return ResponseEntity.ok(blogId); 18 | } catch (Exception e) { 19 | // 返回错误信息 20 | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) 21 | .body("创建博客失败,请稍后重试"); 22 | } 23 | } 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.database 2 | 3 | /** 4 | * Android platform database connection placeholder 5 | * 6 | * Android should use Room or other local database frameworks, 7 | * not direct remote database connections. 8 | * Use server API when accessing remote databases. 9 | */ 10 | actual fun createDatabaseConnection(config: DatabaseConfig): DatabaseConnection { 11 | throw UnsupportedOperationException( 12 | "Direct database connections are not recommended on Android. " + 13 | "Use Room database for local storage or connect through server API." 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /mpp-core/src/iosMain/kotlin/cc/unitmesh/llm/ExecutorFactory.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.llm 2 | 3 | import ai.koog.prompt.executor.llms.SingleLLMPromptExecutor 4 | import cc.unitmesh.llm.provider.LLMClientProvider 5 | 6 | /** 7 | * iOS implementation: GitHub Copilot not supported 8 | */ 9 | internal actual fun tryAutoRegisterGithubCopilot(): LLMClientProvider? = null 10 | 11 | /** 12 | * iOS implementation: Blocking executor creation not supported 13 | * iOS doesn't support runBlocking, so we return null 14 | */ 15 | internal actual fun createExecutorBlocking( 16 | provider: LLMClientProvider, 17 | config: ModelConfig 18 | ): SingleLLMPromptExecutor? = null 19 | 20 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/ClassStructureVariableResolver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | import cc.unitmesh.devti.context.ClassContextProvider 4 | import com.intellij.psi.PsiElement 5 | 6 | class ClassStructureVariableResolver(val element: PsiElement) : VariableResolver { 7 | override val type: CustomResolvedVariableType = CustomResolvedVariableType.METHOD_INPUT_OUTPUT 8 | 9 | override fun resolve(): String { 10 | val classContext = ClassContextProvider(false).from(element) 11 | if (classContext.name == null) return "" 12 | 13 | return classContext.format() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/llm/ExecutorFactory.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.llm 2 | 3 | import ai.koog.prompt.executor.llms.SingleLLMPromptExecutor 4 | import cc.unitmesh.llm.provider.LLMClientProvider 5 | 6 | /** 7 | * WASM implementation: GitHub Copilot not supported 8 | */ 9 | internal actual fun tryAutoRegisterGithubCopilot(): LLMClientProvider? = null 10 | 11 | /** 12 | * WASM implementation: Blocking executor creation not supported 13 | * Use createAsync() instead for async initialization 14 | */ 15 | internal actual fun createExecutorBlocking( 16 | provider: LLMClientProvider, 17 | config: ModelConfig 18 | ): SingleLLMPromptExecutor? = null 19 | 20 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/FileFunc.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.command.dataprovider 2 | 3 | import com.intellij.icons.AllIcons 4 | import javax.swing.Icon 5 | 6 | enum class FileFunc(val funcName: String, val description: String, val icon: Icon) { 7 | Regex("regex", "Read the content of a file by regex", AllIcons.Actions.Regex), 8 | 9 | ; 10 | 11 | companion object { 12 | fun all(): List { 13 | return values().toList() 14 | } 15 | 16 | fun fromString(funcName: String): FileFunc? { 17 | return values().find { it.funcName == funcName } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/automation/TestModels.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.viewer.web.automation 2 | 3 | /** 4 | * Test result data class 5 | */ 6 | data class TestResult( 7 | val name: String, 8 | val category: TestCategory, 9 | val passed: Boolean, 10 | val duration: Long, 11 | val message: String = if (passed) "Test completed successfully" else "Test assertion failed" 12 | ) 13 | 14 | /** 15 | * Test categories for grouping related tests 16 | */ 17 | enum class TestCategory { 18 | BRIDGE_COMMUNICATION, 19 | DOM_INSPECTION, 20 | SHADOW_DOM, 21 | USER_INTERACTION, 22 | MUTATION_OBSERVER, 23 | GENERAL 24 | } 25 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/PlanUpdateListener.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.observer.plan 2 | 3 | import com.intellij.openapi.vcs.changes.Change 4 | import com.intellij.util.messages.Topic 5 | import java.util.* 6 | 7 | @FunctionalInterface 8 | interface PlanUpdateListener: EventListener { 9 | fun onPlanUpdate(items: MutableList) 10 | fun onUpdateChange(changes: MutableList) 11 | 12 | companion object { 13 | @Topic.AppLevel 14 | val TOPIC: Topic = Topic( 15 | PlanUpdateListener::class.java, Topic.BroadcastDirection.TO_DIRECT_CHILDREN 16 | ) 17 | } 18 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/genius/zh/page/page-gen-design.vm: -------------------------------------------------------------------------------- 1 | 你是一位专业的前端开发者。 2 | 根据用户的需求和组件信息,为用户编写组件。 3 | 4 | - 用户组件信息:${context.components} 5 | 6 | 例如: 7 | 8 | - 问题(需求):为用户构建一个填写个人信息的表单。 9 | // 组件名称: Form, props: { fields: [{name: 'name', type: 'text'}, {name: 'age', type: 'number'}] } 10 | // 组件名称: Input, props: { name: 'name', type: 'text' } 11 | // : Input, props: { name: 'age', type: 'number' } 12 | - 回答: 13 | ```react 14 |
15 | 16 | 17 |
18 | ``` 19 | 20 | ---- 21 | 22 | 以下是需求: 23 | 24 | ```markdown 25 | ${context.requirement} 26 | ``` 27 | 28 | 请使用 Markdown 语法编写您的代码,无需解释。 29 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/agent/toolExamples/write-process-input.devin: -------------------------------------------------------------------------------- 1 | Write input data to a running process's stdin. Supports interactive process communication and automation of command-line tools. 2 | 3 | Write input from code block: 4 | /write-process-input:proc_1234567890_1 5 | ``` 6 | hello world 7 | ``` 8 | 9 | Write input without automatic newline: 10 | /write-process-input:proc_1234567890_1 --no-newline 11 | ``` 12 | input without newline 13 | ``` 14 | 15 | Write simple text input: 16 | /write-process-input:proc_1234567890_1 simple text input 17 | 18 | Use /list-processes to find the process ID. Only works with running processes that accept stdin input. 19 | -------------------------------------------------------------------------------- /mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/document/DocumentRegistry.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.document 2 | 3 | import io.github.oshai.kotlinlogging.KotlinLogging 4 | 5 | private val logger = KotlinLogging.logger {} 6 | 7 | /** 8 | * Android platform-specific initialization 9 | * Currently only Markdown is supported on Android platform 10 | * TODO: Consider adding Android-specific document parsers 11 | */ 12 | actual fun platformInitialize() { 13 | logger.info { "Initializing Android document parsers (Markdown only)" } 14 | // Android platform only supports Markdown for now 15 | // Markdown parser is already registered in DocumentRegistry init block 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/BrowseInsCommand.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.compiler.exec 2 | 3 | import cc.unitmesh.devti.agent.tool.browse.Browse 4 | import cc.unitmesh.devti.command.InsCommand 5 | import cc.unitmesh.devti.command.dataprovider.BuiltinCommand 6 | import com.intellij.openapi.project.Project 7 | 8 | class BrowseInsCommand(val myProject: Project, private val prop: String) : InsCommand { 9 | override val commandName: BuiltinCommand = BuiltinCommand.BROWSE 10 | 11 | override suspend fun execute(): String? { 12 | val parse = Browse.parse(prop) 13 | return parse.body 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/DevInsProcessHandler.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.run 2 | 3 | import com.intellij.build.process.BuildProcessHandler 4 | import java.io.OutputStream 5 | 6 | class DevInsProcessHandler(private val myExecutionName: String) : BuildProcessHandler() { 7 | override fun detachIsDefault(): Boolean = false 8 | override fun destroyProcessImpl() = Unit 9 | override fun detachProcessImpl() = notifyProcessTerminated(0) 10 | fun exitWithError() = notifyProcessTerminated(-1) 11 | 12 | override fun getProcessInput(): OutputStream? = null 13 | override fun getExecutionName(): String = myExecutionName 14 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/nanodsl-lang/src/test/resources/testcases/03-counter-card.nanodsl: -------------------------------------------------------------------------------- 1 | component CounterCard: 2 | state: 3 | count: int = 1 4 | price: float = 99.0 5 | 6 | Card: 7 | padding: "lg" 8 | content: 9 | VStack: 10 | Text(content << f"Total: ${state.count * state.price}") 11 | 12 | HStack: 13 | Button("-"): 14 | on_click: state.count -= 1 15 | 16 | Input(value := state.count) 17 | 18 | Button("+"): 19 | on_click: state.count += 1 20 | 21 | -------------------------------------------------------------------------------- /mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.ios.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.platform 2 | 3 | /** 4 | * iOS implementation of ClipboardImageReader. 5 | * TODO: Implement using UIPasteboard for image reading. 6 | */ 7 | class IosClipboardImageReader : ClipboardImageReader { 8 | override fun hasImage(): Boolean { 9 | // TODO: Implement using UIPasteboard 10 | return false 11 | } 12 | 13 | override fun readImage(): ClipboardImageData? { 14 | // TODO: Implement using UIPasteboard 15 | return null 16 | } 17 | } 18 | 19 | actual fun createClipboardImageReader(): ClipboardImageReader = IosClipboardImageReader() 20 | 21 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.platform 2 | 3 | /** 4 | * JS implementation of ClipboardImageReader. 5 | * TODO: Implement using Clipboard API for image reading. 6 | */ 7 | class JsClipboardImageReader : ClipboardImageReader { 8 | override fun hasImage(): Boolean { 9 | // TODO: Implement using Clipboard API 10 | return false 11 | } 12 | 13 | override fun readImage(): ClipboardImageData? { 14 | // TODO: Implement using Clipboard API 15 | return null 16 | } 17 | } 18 | 19 | actual fun createClipboardImageReader(): ClipboardImageReader = JsClipboardImageReader() 20 | 21 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/MethodInputOutputVariableResolver.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.custom.variable 2 | 3 | import cc.unitmesh.devti.context.MethodContextProvider 4 | import com.intellij.psi.PsiElement 5 | 6 | class MethodInputOutputVariableResolver(val element: PsiElement) : VariableResolver { 7 | override val type: CustomResolvedVariableType = CustomResolvedVariableType.METHOD_INPUT_OUTPUT 8 | 9 | override fun resolve(): String { 10 | val methodContext = MethodContextProvider(false, false).from(element) 11 | if (methodContext.name == null) return "" 12 | 13 | return methodContext.inputOutputString() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/vcs/ShireGitCommit.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.devins.provider.vcs 2 | 3 | sealed class GitEntity 4 | 5 | // Base class for models containing commits 6 | sealed class CommitModel( 7 | open val count: Int, 8 | open val commits: List 9 | ) : GitEntity() 10 | 11 | data class ShireGitCommit( 12 | val hash: String, 13 | val authorName: String, 14 | val authorEmail: String, 15 | val authorDate: Long, 16 | val committerName: String, 17 | val committerEmail: String, 18 | val committerDate: Long, 19 | val message: String, 20 | val fullMessage: String 21 | ) : GitEntity() 22 | 23 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/statusbar/AutoDevStatus.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.statusbar 2 | 3 | import cc.unitmesh.devti.AutoDevIcons 4 | import javax.swing.Icon 5 | 6 | enum class AutoDevStatus { 7 | WAITING, 8 | Ready, 9 | InProgress, 10 | Error, 11 | Done; 12 | 13 | val icon: Icon 14 | get() { 15 | return when (this) { 16 | WAITING -> AutoDevIcons.DARK 17 | Ready -> AutoDevIcons.AI_COPILOT 18 | InProgress -> AutoDevIcons.LOADING 19 | Error -> AutoDevIcons.AUTODEV_ERROR 20 | Done -> AutoDevIcons.AI_COPILOT 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.sketch 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.graphics.Color 5 | 6 | /** 7 | * JS implementation of PlatformMermaidFullscreenDialog. 8 | * No-op for JS platform as it uses TypeScript/React for rendering. 9 | */ 10 | @Composable 11 | actual fun PlatformMermaidFullscreenDialog( 12 | mermaidCode: String, 13 | isDarkTheme: Boolean, 14 | backgroundColor: Color, 15 | onDismiss: () -> Unit 16 | ) { 17 | // No-op for JS platform 18 | // The JS/TypeScript implementation handles Mermaid rendering separately 19 | } 20 | 21 | -------------------------------------------------------------------------------- /xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/prompt/ResourceLoader.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xuiper.prompt 2 | 3 | /** 4 | * Platform-specific resource loader for prompt templates. 5 | * 6 | * On JVM: Uses classloader to load resources from JAR/classpath 7 | * On WasmJs: Returns embedded resource strings or loads from network 8 | */ 9 | expect object ResourceLoader { 10 | /** 11 | * Load a resource file as a string. 12 | * 13 | * @param path Resource path (e.g., "prompts/standard.txt") 14 | * @return Resource content as string 15 | * @throws IllegalStateException if resource cannot be loaded 16 | */ 17 | fun loadResource(path: String): String 18 | } 19 | 20 | -------------------------------------------------------------------------------- /mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/llm/SessionStorage.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.llm 2 | 3 | /** 4 | * Session 存储接口 5 | * 使用 expect/actual 模式实现跨平台文件 I/O 6 | * 7 | * 存储位置:~/.autodev/sessions/chat-sessions.json 8 | */ 9 | expect object SessionStorage { 10 | /** 11 | * 加载所有本地 sessions 12 | */ 13 | suspend fun loadSessions(): List 14 | 15 | /** 16 | * 保存所有本地 sessions 17 | */ 18 | suspend fun saveSessions(sessions: List) 19 | 20 | /** 21 | * 获取存储路径 22 | */ 23 | fun getStoragePath(): String 24 | 25 | /** 26 | * 检查存储文件是否存在 27 | */ 28 | suspend fun exists(): Boolean 29 | } 30 | 31 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/http/HttpClientProvider.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.provider.http 2 | 3 | import com.intellij.openapi.extensions.ExtensionPointName 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.openapi.vfs.VirtualFile 6 | 7 | interface HttpClientProvider { 8 | fun execute(project: Project, virtualFile: VirtualFile, text: String) 9 | 10 | companion object { 11 | private val EP_NAME: ExtensionPointName = 12 | ExtensionPointName("cc.unitmesh.httpClientExecutor") 13 | 14 | fun all(): List { 15 | return EP_NAME.extensionList 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/util/JsUtil.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.ide.javascript.util 2 | 3 | import com.intellij.javascript.testing.JSTestRunnerManager 4 | import com.intellij.openapi.application.runReadAction 5 | import com.intellij.psi.PsiFile 6 | 7 | object JsUtil { 8 | fun guessTestFrameworkName(file: PsiFile): String? { 9 | val findPackageDependentProducers = 10 | runReadAction { JSTestRunnerManager.getInstance().findPackageDependentProducers(file) } 11 | 12 | val testRunConfigurationProducer = findPackageDependentProducers.firstOrNull() 13 | return testRunConfigurationProducer?.configurationType?.displayName 14 | } 15 | } -------------------------------------------------------------------------------- /mpp-server/src/main/kotlin/cc/unitmesh/server/ServerApplication.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.server 2 | 3 | import cc.unitmesh.server.config.ServerConfig 4 | import cc.unitmesh.server.plugins.* 5 | import io.ktor.server.application.* 6 | import io.ktor.server.engine.* 7 | import io.ktor.server.netty.* 8 | 9 | fun main() { 10 | val config = ServerConfig.load() 11 | 12 | embeddedServer( 13 | Netty, 14 | port = config.port, 15 | host = config.host, 16 | module = Application::module 17 | ).start(wait = true) 18 | } 19 | 20 | fun Application.module() { 21 | configureSerialization() 22 | configureCORS() 23 | configureSSE() 24 | configureRouting() 25 | } 26 | 27 | -------------------------------------------------------------------------------- /xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/theme/NanoThemeFamily.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xuiper.render.theme 2 | 3 | import kotlinx.serialization.SerialName 4 | import kotlinx.serialization.Serializable 5 | 6 | /** 7 | * Platform-independent theme family identifier. 8 | * 9 | * Used to select between built-in themes or custom seed-based themes. 10 | * Platform implementations (Compose, Jewel, etc.) map these to their specific color systems. 11 | */ 12 | @Serializable 13 | enum class NanoThemeFamily { 14 | @SerialName("bank_black_gold") 15 | BANK_BLACK_GOLD, 16 | 17 | @SerialName("travel_airbnb") 18 | TRAVEL_AIRBNB, 19 | 20 | @SerialName("custom") 21 | CUSTOM 22 | } 23 | -------------------------------------------------------------------------------- /xiuper-ui/src/main/resources/prompts/examples/product-card.nanodsl: -------------------------------------------------------------------------------- 1 | component ProductCard(item: Product): 2 | padding: "md" 3 | shadow: "sm" 4 | 5 | content: 6 | VStack(spacing="sm"): 7 | Image(src=item.image, aspect=16/9, radius="md") 8 | 9 | HStack(align="center", justify="between"): 10 | Text(item.title, style="h3") 11 | if item.is_new: 12 | Badge("New", color="green") 13 | 14 | Text(item.description, style="body", limit=2) 15 | 16 | HStack(spacing="sm"): 17 | Text(f"${item.price}", style="h3") 18 | Button("Add to Cart", intent="primary", icon="cart") 19 | 20 | -------------------------------------------------------------------------------- /mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.platform 2 | 3 | /** 4 | * WASM JS implementation of ClipboardImageReader. 5 | * TODO: Implement using Clipboard API for image reading. 6 | */ 7 | class WasmJsClipboardImageReader : ClipboardImageReader { 8 | override fun hasImage(): Boolean { 9 | // TODO: Implement using Clipboard API 10 | return false 11 | } 12 | 13 | override fun readImage(): ClipboardImageData? { 14 | // TODO: Implement using Clipboard API 15 | return null 16 | } 17 | } 18 | 19 | actual fun createClipboardImageReader(): ClipboardImageReader = WasmJsClipboardImageReader() 20 | 21 | -------------------------------------------------------------------------------- /xiuper-ui/src/commonMain/resources/prompts/examples/product-card.nanodsl: -------------------------------------------------------------------------------- 1 | component ProductCard(item: Product): 2 | padding: "md" 3 | shadow: "sm" 4 | 5 | content: 6 | VStack(spacing="sm"): 7 | Image(src=item.image, aspect=16/9, radius="md") 8 | 9 | HStack(align="center", justify="between"): 10 | Text(item.title, style="h3") 11 | if item.is_new: 12 | Badge("New", color="green") 13 | 14 | Text(item.description, style="body", limit=2) 15 | 16 | HStack(spacing="sm"): 17 | Text(f"${item.price}", style="h3") 18 | Button("Add to Cart", intent="primary", icon="cart") 19 | 20 | -------------------------------------------------------------------------------- /mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/logging/PlatformLogging.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.logging 2 | 3 | /** 4 | * JavaScript implementation of platform-specific logging initialization 5 | * JS uses console logging, no file storage needed 6 | */ 7 | actual fun initializePlatformLogging(config: LoggingConfig) { 8 | // JavaScript platform uses console logging by default 9 | // No additional configuration needed 10 | } 11 | 12 | /** 13 | * JavaScript implementation of platform-specific log directory 14 | * JS doesn't support file logging, return a placeholder 15 | */ 16 | actual fun getPlatformLogDirectory(): String { 17 | return "console-only" // JS platform doesn't support file logging 18 | } 19 | -------------------------------------------------------------------------------- /mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpFetcherFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import cc.unitmesh.agent.tool.impl.HttpFetcher 4 | 5 | /** 6 | * Platform-specific HttpFetcher factory 7 | * 8 | * This factory creates the appropriate HttpFetcher implementation for each platform: 9 | * - JVM/Android: KtorHttpFetcher with CIO engine 10 | * - JS: NodeFetchHttpFetcher (bypasses Ktor's limitations in Node.js) 11 | */ 12 | expect object HttpFetcherFactory { 13 | /** 14 | * Create a platform-appropriate HttpFetcher instance 15 | * 16 | * @return HttpFetcher configured for the current platform 17 | */ 18 | fun create(): HttpFetcher 19 | } 20 | 21 | -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlatformCodingAgentFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.agent 2 | 3 | import cc.unitmesh.agent.CodingAgent 4 | import cc.unitmesh.agent.config.McpToolConfigService 5 | import cc.unitmesh.agent.render.CodingAgentRenderer 6 | import cc.unitmesh.llm.KoogLLMService 7 | 8 | /** 9 | * Platform-specific factory for creating CodingAgent instances 10 | * with platform-specific file system implementations 11 | */ 12 | expect fun createPlatformCodingAgent( 13 | projectPath: String, 14 | llmService: KoogLLMService, 15 | maxIterations: Int, 16 | renderer: CodingAgentRenderer, 17 | mcpToolConfigService: McpToolConfigService 18 | ): CodingAgent 19 | -------------------------------------------------------------------------------- /mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/ScreenshotUtils.js.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.sketch 2 | 3 | import androidx.compose.ui.graphics.ImageBitmap 4 | 5 | /** 6 | * JS implementation of encodeImageBitmapToPng. 7 | * Note: JS platform has limited support for image encoding. 8 | * Returns null as screenshot is not fully supported on JS platform. 9 | */ 10 | actual fun encodeImageBitmapToPng(imageBitmap: ImageBitmap): ByteArray? { 11 | // JS platform does not have direct access to Skia or native image encoding 12 | // Screenshot functionality is limited on this platform 13 | println("[ScreenshotUtils] Screenshot not supported on JS platform") 14 | return null 15 | } 16 | 17 | -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - type: web 3 | name: mpp-server 4 | runtime: docker 5 | dockerfilePath: ./mpp-server/Dockerfile 6 | dockerContext: . 7 | region: singapore 8 | plan: free 9 | numInstances: 1 10 | healthCheckPath: /health 11 | envVars: 12 | - key: SERVER_PORT 13 | value: 8080 14 | - key: SERVER_HOST 15 | value: 0.0.0.0 16 | - key: OPENAI_API_KEY 17 | sync: false # 需要在 Render Dashboard 手动设置 18 | - key: LOG_LEVEL 19 | value: INFO 20 | buildFilter: 21 | paths: 22 | - mpp-server/** 23 | - mpp-core/** 24 | - build.gradle.kts 25 | - settings.gradle.kts 26 | - gradle.properties 27 | 28 | -------------------------------------------------------------------------------- /xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/db/DatabaseDriverFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.xiuper.fs.db 2 | 3 | import android.content.Context 4 | import app.cash.sqldelight.db.SqlDriver 5 | import app.cash.sqldelight.driver.android.AndroidSqliteDriver 6 | 7 | actual class DatabaseDriverFactory { 8 | private var context: Context? = null 9 | 10 | fun init(context: Context) { 11 | this.context = context 12 | } 13 | 14 | actual fun createDriver(): SqlDriver { 15 | val context = requireNotNull(context) { "DatabaseDriverFactory.init(context) must be called before createDriver()" } 16 | return AndroidSqliteDriver(XiuperFsDatabase.Schema, context, "xiuper-fs.db") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/prompt/copilot/completion/java-code.md: -------------------------------------------------------------------------------- 1 | Q: 2 | ```java 3 | public void foo() { 4 | int x = 42 + 42; 5 | System.out.println(x); 6 | // TODO: write me gcd algorithm here 7 | // end of the code completion 8 | return x + x; 9 | } 10 | ``` 11 | A: 12 | ```java 13 | public void foo() { 14 | int x = 42 + 42; 15 | System.out.println(x); 16 | // TODO: write me gcd algorithm here 17 | int a = 42; 18 | int b = 42; 19 | 20 | while (b != 0) { 21 | int temp = b; 22 | b = a % b; 23 | a = temp; 24 | } 25 | 26 | int gcd = a; 27 | System.out.println("The GCD is: " + gcd); 28 | // end of the code completion 29 | return x + x; 30 | } 31 | ``` 32 | Q: -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/AutoDevSnippetFile.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti 2 | 3 | import com.intellij.openapi.vfs.VirtualFile 4 | import com.intellij.testFramework.LightVirtualFile 5 | 6 | object AutoDevSnippetFile { 7 | const val AUTODEV_SNIPPET_NAME = "autodev-snippet-" 8 | 9 | fun isSnippet(file: VirtualFile): Boolean { 10 | if (file !is LightVirtualFile) return false 11 | return file.name.startsWith("autodev-snippet-") || file.name.startsWith("DevIn-") || file.name.startsWith("devIn-") 12 | } 13 | 14 | fun naming(extension: String): String { 15 | val time = System.currentTimeMillis() 16 | return "$AUTODEV_SNIPPET_NAME$time.$extension" 17 | } 18 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/ext-database/README.md: -------------------------------------------------------------------------------- 1 | # Database Extensions 2 | 3 | Doc: [https://plugins.jetbrains.com/docs/intellij/data-grip-extension-point-list.html](https://plugins.jetbrains.com/docs/intellij/data-grip-extension-point-list.html) 4 | 5 | This directory contains extensions that are specific to a database. 6 | 7 | - Generate SQL DDL for a database from a schema 8 | 9 | Or others? 10 | 11 | ## 自然语言 SQL 生成 12 | 13 | 根据数据库表生成 JPA 、 MyBatis 、 Spring Data JDBC 等代码。 14 | 15 | ## Usecases: PL/SQL to Java 16 | 17 | 1. Generate Repository from PL/SQL code 18 | 2. Generate Entity from PL/SQL code 19 | 3. Generate Service from PL/SQL code 20 | - Create test cases for the service 21 | 4. Generate Java code from PL/SQL code 22 | -------------------------------------------------------------------------------- /mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.tool.impl.http 2 | 3 | import io.ktor.client.* 4 | 5 | /** 6 | * Platform-specific HttpClient factory using expect/actual pattern 7 | * 8 | * Each platform provides its own optimal HTTP client engine: 9 | * - JVM: CIO engine (fully asynchronous, coroutine-based) 10 | * - JS: JS engine (uses fetch API) 11 | * - Native: Platform-specific engines (Darwin, Curl, WinHttp) 12 | */ 13 | expect object HttpClientFactory { 14 | /** 15 | * Create a platform-specific HttpClient instance 16 | * 17 | * @return HttpClient configured for the current platform 18 | */ 19 | fun create(): HttpClient 20 | } 21 | 22 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/model/UiComponent.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.bridge.archview.model 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class UiComponent( 7 | val name: String, 8 | val path: String, 9 | val signature: String = "", 10 | val props: List = emptyList(), 11 | val methods: List = emptyList(), 12 | val slots: List = emptyList(), 13 | ) { 14 | fun format(): String { 15 | return """ 16 | |<$name/>, path: $path 17 | |props: $props 18 | |methods: $methods 19 | """.trimMargin() 20 | } 21 | 22 | fun simple(): String = "<$name/>, $path" 23 | } -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-core/src/main/resources/icons/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | checkbox-svgrepo-com (1) 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.android.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.platform 2 | 3 | /** 4 | * Android implementation of ClipboardImageReader. 5 | * TODO: Implement using Android ClipboardManager for image reading. 6 | */ 7 | class AndroidClipboardImageReader : ClipboardImageReader { 8 | override fun hasImage(): Boolean { 9 | // TODO: Implement using ClipboardManager 10 | return false 11 | } 12 | 13 | override fun readImage(): ClipboardImageData? { 14 | // TODO: Implement using ClipboardManager 15 | return null 16 | } 17 | } 18 | 19 | actual fun createClipboardImageReader(): ClipboardImageReader = AndroidClipboardImageReader() 20 | 21 | -------------------------------------------------------------------------------- /xiuper-ui/testcases/expect/02-product-card.nanodsl: -------------------------------------------------------------------------------- 1 | component ProductCard(item: Product): 2 | padding: "md" 3 | shadow: "sm" 4 | 5 | content: 6 | VStack(spacing="sm"): 7 | Image(src=item.image, aspect=16/9, radius="md") 8 | 9 | HStack(align="center", justify="between"): 10 | Text(item.title, style="h3") 11 | if item.is_new: 12 | Badge("New", color="green") 13 | 14 | Text(item.description, style="body", limit=2) 15 | 16 | HStack(spacing="sm"): 17 | Text(f"${item.price}", style="h3") 18 | Button("Add to Cart", intent="primary", icon="cart") 19 | 20 | -------------------------------------------------------------------------------- /mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/logging/PlatformLogging.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.agent.logging 2 | 3 | /** 4 | * WebAssembly implementation of platform-specific logging initialization 5 | * WASM uses console logging, no file storage available 6 | */ 7 | actual fun initializePlatformLogging(config: LoggingConfig) { 8 | // WebAssembly platform uses console logging by default 9 | // No additional configuration needed 10 | } 11 | 12 | /** 13 | * WebAssembly implementation of platform-specific log directory 14 | * WASM doesn't support file logging, return a placeholder 15 | */ 16 | actual fun getPlatformLogDirectory(): String { 17 | return "console-only" // WASM platform doesn't support file logging 18 | } 19 | -------------------------------------------------------------------------------- /mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/shireql/variable/frontend/Component.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devti.language.ast.shireql.variable.frontend 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | /** 6 | * the Design System Component 7 | */ 8 | @Serializable 9 | data class Component( 10 | val name: String, 11 | val path: String, 12 | val signature: String = "", 13 | val props: List = emptyList(), 14 | ) { 15 | fun format(): String { 16 | return """ 17 | |component name: $name 18 | |component path: $path 19 | |input signature: $signature 20 | |component props: $props 21 | """.trimMargin() 22 | } 23 | } -------------------------------------------------------------------------------- /mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/model/EditorModels.kt: -------------------------------------------------------------------------------- 1 | package cc.unitmesh.devins.ui.compose.editor.model 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.text.SpanStyle 5 | 6 | /** 7 | * 语法高亮样式 8 | * 这是 UI 层特定的类型,保留在此处 9 | */ 10 | data class HighlightStyle( 11 | val color: Color, 12 | val bold: Boolean = false, 13 | val italic: Boolean = false 14 | ) { 15 | fun toSpanStyle(): SpanStyle = 16 | SpanStyle( 17 | color = color, 18 | fontWeight = if (bold) androidx.compose.ui.text.font.FontWeight.Bold else null, 19 | fontStyle = if (italic) androidx.compose.ui.text.font.FontStyle.Italic else null 20 | ) 21 | } 22 | --------------------------------------------------------------------------------