-
Notifications
You must be signed in to change notification settings - Fork 16
refactor: create app-info file #1909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * App identity constants — single source of truth for build-configurable | ||
| * values shared across forge config, deep links, and scripts. | ||
| */ | ||
|
|
||
| export const DEEP_LINK_PROTOCOL = 'toolhive-gui' | ||
| export const FLATPAK_APP_ID = 'com.stacklok.ToolHive' | ||
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
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
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
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
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
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
Empty file.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import { promises as fs } from 'node:fs' | ||
| import path from 'node:path' | ||
| import { DEEP_LINK_PROTOCOL, FLATPAK_APP_ID } from '../common/app-info' | ||
|
|
||
| const FLATPAK_DIR = path.resolve(import.meta.dirname, '..', 'flatpak') | ||
|
|
||
| function desktopFileContent(): string { | ||
| return `[Desktop Entry] | ||
| Name=ToolHive | ||
| Comment=Install, manage and run MCP servers and connect them to AI agents and clients | ||
| GenericName=ToolHive | ||
| Exec=toolhive-wrapper %U | ||
| Icon=${FLATPAK_APP_ID} | ||
| Type=Application | ||
| StartupNotify=true | ||
| Categories=Development;Utility; | ||
| MimeType=x-scheme-handler/${DEEP_LINK_PROTOCOL}; | ||
| ` | ||
| } | ||
|
|
||
| function metainfoFileContent(): string { | ||
| return `<?xml version="1.0" encoding="UTF-8"?> | ||
| <component type="desktop-application"> | ||
| <id>${FLATPAK_APP_ID}</id> | ||
| <name>ToolHive</name> | ||
| <summary>Install, manage and run MCP servers</summary> | ||
| <metadata_license>CC0-1.0</metadata_license> | ||
| <project_license>Apache-2.0</project_license> | ||
|
|
||
| <developer id="com.stacklok"> | ||
| <name>Stacklok</name> | ||
| </developer> | ||
|
|
||
| <description> | ||
| <p>ToolHive is an application that allows you to install, manage and run MCP servers and connect them to AI agents and clients.</p> | ||
| </description> | ||
|
|
||
| <launchable type="desktop-id">${FLATPAK_APP_ID}.desktop</launchable> | ||
|
|
||
| <url type="homepage">https://github.com/stacklok/toolhive-studio</url> | ||
| <url type="bugtracker">https://github.com/stacklok/toolhive-studio/issues</url> | ||
|
|
||
| <content_rating type="oars-1.1" /> | ||
|
|
||
| <releases> | ||
| <release version="0.0.1" date="2026-02-18"> | ||
| <description> | ||
| <p>Initial release.</p> | ||
| </description> | ||
| </release> | ||
| </releases> | ||
|
|
||
| <!-- TODO: Add real screenshots before Flathub submission --> | ||
| <screenshots> | ||
| <screenshot type="default"> | ||
| <caption>ToolHive main window</caption> | ||
| <image>https://raw.githubusercontent.com/stacklok/toolhive-studio/main/assets/screenshot.png</image> | ||
| </screenshot> | ||
| </screenshots> | ||
| </component> | ||
| ` | ||
| } | ||
|
|
||
| async function writeIfChanged( | ||
| filePath: string, | ||
| content: string | ||
| ): Promise<void> { | ||
| await fs.mkdir(path.dirname(filePath), { recursive: true }) | ||
| const existing = await fs.readFile(filePath, 'utf8').catch(() => null) | ||
| if (existing !== content) { | ||
| await fs.writeFile(filePath, content, 'utf8') | ||
| } | ||
| } | ||
|
|
||
| export async function generateFlatpakAssets(): Promise<void> { | ||
| await Promise.all([ | ||
| writeIfChanged( | ||
| path.join(FLATPAK_DIR, `${FLATPAK_APP_ID}.desktop`), | ||
| desktopFileContent() | ||
| ), | ||
| writeIfChanged( | ||
| path.join(FLATPAK_DIR, `${FLATPAK_APP_ID}.metainfo.xml`), | ||
| metainfoFileContent() | ||
| ), | ||
| ]) | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.