Conversation
Introduce AI-based extraction of friend-link info from comments: add LinkAiEndpoint (console routes for listing recent comments and extracting link data), DTOs LinkCommentDTO and LinkCommentAnalysisResult, and console client + UI wiring (api/index.ts and LinkForm.vue) to fetch comments and perform AI extraction. Add plugin documentation (plugin-ai-foundation-doc.md) describing the AI Foundation SDK usage, update plugin.yaml to require the ai-foundation plugin, and include a local api snapshot (api-1.0.0-SNAPSHOT.jar) referenced in build.gradle for compile/test.
- Replace api-1.0.0-SNAPSHOT.jar with api-0.0.0-7e636df07435.jar - Update AiModelService::defaultLanguageModel to ::languageModel - Make ai-foundation an optional dependency (ai-foundation?: *) - Split LinkAiEndpoint into LinkAiEndpoint (recent-comments) and LinkAiExtractEndpoint (ai-extract) to avoid class loading failures when ai-foundation is not installed - Add rssUrl field to LinkCommentAnalysisResult for RSS feed extraction - Update prompts to include RSS URL extraction - Improve AI extraction UI: card-style container, relative time display, loading/empty states, better comment list styling - Use utils.date.timeAgo from @halo-dev/ui-shared for time formatting - Apply extracted rssUrl to RSS feed URLs automatically
ruibaby
marked this pull request as ready for review
June 3, 2026 14:41
…is available - Add AiFoundationAvailableCondition to check ai-foundation presence via Class.forName before Spring attempts to load the bean - Apply @conditional to LinkAiExtractEndpoint so Spring skips it gracefully when ai-foundation classes are missing - Add rssUrl to handwritten LinkCommentAnalysisResult interface
- Replace handwritten LinkCommentDTO interface with generated version - Replace handwritten listRecentComments wrapper with generated ConsoleApiLinkHaloRunV1alpha1LinkAiApi - Keep handwritten extractFromComment wrapper since the endpoint is conditionally registered and not present in OpenAPI docs - Fix IconCloseLine → IconClose (correct Halo component export) - Fix selectedCommentName type to accept undefined from generated DTO
Add a new AI extraction endpoint (/apis/.../links/-/ai-extract) to the OpenAPI spec and generated TypeScript client: new LinkCommentAnalysisResult model, API methods, request types, and update .openapi-generator file list. Update server URL/BASE_PATH from localhost:51338 to localhost:8091 and enable useExistingServer in the Gradle OpenAPI plugin; bump run.halo.plugin.devtools to 0.8.0. Also make LinkDetailDTO.title required.
Replace custom axios extract helper with the generated AI client and clean up related types/imports. api/index.ts: remove AxiosResponse import, delete custom extractFromComment and LinkCommentAnalysisResult, and export the generated clients. LinkForm.vue: import types from the generated API, call linkAiApiClient.ai.extractLinkFromComment({ body }) instead of the removed helper, remove the previous catch error toast, and apply minor formatting/import reordering changes.
Delete the Halo AI Foundation SDK usage guide (plugin-ai-foundation-doc.md). The file containing detailed instructions for integrating and using AiModelService, language/embedding models, streaming, structured outputs, tools, timeouts, and provider options was removed.
Add LinkAiExtract.vue to encapsulate the AI-driven comment extraction UI and logic (fetch recent comments, select/edit comment, call AI extract API, emit result). Refactor LinkForm.vue to use the new component for new links (isNew computed) and remove duplicated AI extraction code and unused imports; rename the internal handler to applyAiExtractedResult and wire it to the component's @extract event. This centralizes AI extraction behavior and simplifies the link form.
Introduce LinkCommentExtractRequest to support AI-based friend-link extraction: add Java DTO (src/main/java/.../LinkCommentExtractRequest.java) and TypeScript model (console/src/api/generated/models/link-comment-extract-request.ts), update OpenAPI spec (api-docs/openapi/v3_0/linksV1alpha1Api.json) and regenerate client artifacts (console/src/api/generated/...), and wire the new model into the console UI and backend (updated LinkAiExtract.vue and LinkAiExtractEndpoint.java). These changes enable sending structured JSON requests to the AI extraction API and keep generated client code in sync with the spec.
Reformat the OpenAPI spec for the links API and update generated TypeScript models. - api-docs/openapi/v3_0/linksV1alpha1Api.json: regenerated/serialized with consistent spacing and content-type normalization (many responses/request bodies now use "*/*"); primarily formatting/serialization changes. - console/src/api/generated/models/link-comment-extract-request.ts and console/src/api/generated/models/link-detail-dto.ts: regenerated TypeScript models from the updated spec. These changes are codegen/formatting updates to keep the docs and client models in sync.
Normalize whitespace and trailing newlines in generated OpenAPI artifacts. Minor formatting changes applied to api-docs/openapi/v3_0/linksV1alpha1Api.json and generated TypeScript files under console/src/api/generated (API and model files) — mainly JSDoc blank-line spacing and EOF newlines. No functional or behavioral changes.
Remove the bundled api-0.0.0-*.jar from the repo and update build.gradle to pull the API from a Maven snapshot repository instead of a local file. Adds the Sonatype snapshots repository and replaces file-based compileOnly/testImplementation entries with 'run.halo.aifoundation:api:1.0.0-SNAPSHOT'. Also fixes EOF newline in build.gradle. This avoids committing the binary and uses the published snapshot artifact.
Introduce AI-assisted link extraction support: add GET /links/-/ai-status endpoint and LinkAiFeatureStatus schema, update generated API client and models. Add frontend changes to LinkAiExtract and LinkForm to display plain-text comment content, conditionally show AI extraction UI based on runtime status, and use FormKit for editing; include comment-content utility with tests. On the server add LinkAiSettings, LinkAiFeatureStatus DTO, LinkAiSettingsFetcher, wire settings checks into Ai endpoints and extraction flow to respect configured model and feature toggles. Add settings.yaml UI schema and unit tests for settings fetcher and extraction endpoint behavior.
Upgrade halo plugin version from 2.24 to 2.25.2. Replace the custom AiModelSelector entry in settings.yaml with a FormKit aiModelSelector and refactor its configuration: set modelType to "language", keep clearable true, map name/key to modelName, and preserve placeholder/help text. This migrates the settings to the new form component shape.
Add a new metadata annotation `store.halo.run/recommended-apps` pointing to `app-acslk9nu`, and include an inline comment linking to the AI Foundation app. This surfaces a recommended Halo store app for PluginLinks.
Rename AI comment analysis/extract types and endpoints to use "extraction" terminology, update generated client and model names, and adjust API paths and operation IDs (/ai-extract -> /extract-from-comment, getAiStatus -> getLinkAiFeatureStatus, listRecentComments -> listRecentLinkComments). Add AiFoundationAvailability utility and use it in the condition to avoid duplicated Class.forName logic. Improve error handling and logging for AI failures, add URL validation and user warnings when AI-provided URLs are invalid, and update related Vue components/utilities. Bump platform/plugin requirement to 2.25.0 and update build.gradle and plugin.yaml. Update and add unit tests to reflect the renames and new behaviors.
Remove the 'approved' filter from the recent comments endpoint so it now lists the 10 most recent comments regardless of approval status. Update the OpenAPI spec and generated TypeScript client comments to match the new behavior, and simplify the Java endpoint ListOptions construction (also removing the now-unused import).
Pass explicit mode ("create"/"edit") from LinkCreationModal and LinkEditingModal to LinkForm. LinkForm gains an optional mode prop and updates its isNew computed to prefer mode when provided, falling back to absence of name. This fixes incorrect new/edit detection when the creation modal provided an empty formState object.
# Conflicts: # build.gradle # src/main/resources/plugin.yaml
Remove the Sonatype snapshots repository and upgrade aifoundation dependency from 1.0.0-SNAPSHOT to 1.0.0-beta.4, using the stable release instead of snapshots.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adapts the plugin to the updated ai-foundation API and improves the AI-driven comment extraction UI.
Changes
API compatibility:
run.halo.aifoundation:api:1.0.0-SNAPSHOTfrom the Sonatype snapshots repositoryAiModelService::defaultLanguageModel→::languageModel(method renamed in the new API)Optional dependency:
ai-foundationan optional dependency (ai-foundation?: "*") inplugin.yamlstore.halo.run/recommended-appsLinkAiExtractEndpointimports ai-foundation classes and is skipped when ai-foundation is missingAI extraction enhancements:
rssUrlfield toLinkCommentExtractionResultfor RSS feed extractionrssUrlto RSS feed URLs automatically in the UIUI improvements:
utils.date.timeAgofor relative time display