Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cc96522
feat: add unified plugin marketplace
zortos293 Aug 15, 2026
0fc7449
feat: unify plugin marketplace authentication flows
zortos293 Aug 15, 2026
4540c3f
fix(plugins): harden marketplace integration
zortos293 Aug 15, 2026
f9695dd
fix(plugins): address marketplace review feedback
zortos293 Aug 15, 2026
2a29242
fix(plugins): resolve follow-up review findings
zortos293 Aug 15, 2026
e74cabc
fix(plugins): tighten oauth and status handling
zortos293 Aug 15, 2026
f357f8c
fix(plugins): handle oauth exit and focus states
zortos293 Aug 15, 2026
14da182
Merge branch 'main' into t3code/build-unified-marketplace-prototype
zortos293 Aug 15, 2026
1f5f0ca
fix(plugins): stabilize auth errors and empty states
zortos293 Aug 15, 2026
328b8da
Merge branch 'main' into t3code/build-unified-marketplace-prototype
zortos293 Aug 16, 2026
e8ea0e3
fix(web): align plugin empty state spacing
zortos293 Aug 16, 2026
877099a
fix(web): wire plugin settings search target
zortos293 Aug 16, 2026
3bf0992
fix(web): support headerless settings search sections
zortos293 Aug 16, 2026
16c860e
refactor(plugins): inject host process context
zortos293 Aug 16, 2026
687aa1c
Merge branch 'main' into t3code/build-unified-marketplace-prototype
zortos293 Aug 16, 2026
8e1bd10
fix(desktop): wait for ASAR writes to finish
zortos293 Aug 16, 2026
e63e302
fix(desktop): use Effect timing for ASAR flush
zortos293 Aug 16, 2026
0eb7c7f
fix: address plugin marketplace review feedback
zortos293 Aug 16, 2026
bd76ff2
fix(web): announce marketplace loading state
zortos293 Aug 16, 2026
2d82108
fix(web): stabilize plugin detail header
zortos293 Aug 16, 2026
9da8821
fix(web): align MCP callback controls
zortos293 Aug 16, 2026
70ac146
fix(web): refine marketplace filters and section layout
zortos293 Aug 16, 2026
541b561
feat(plugins): unify marketplace listings across harnesses
zortos293 Aug 17, 2026
731d43d
fix(plugins): fall back to Codex CLI MCP login
zortos293 Aug 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions apps/server/src/plugins/ChatGptPublicPlugins.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { assert, describe, it } from "@effect/vitest";
import * as Effect from "effect/Effect";

import {
CHATGPT_PUBLIC_MARKETPLACE_SOURCE,
chatGptPublicPluginFromDirectoryItem,
chatGptPublicPluginListUrl,
chatGptPublicPluginMarketplaceUrl,
chatGptPublicPluginNameFromPublicId,
chatGptPublicPluginSearchUrl,
chatGptPublicPluginSourceId,
chatGptPublicPluginsFromListResponse,
decodeChatGptPublicPluginListResponse,
decodeCodexChatGptAccessToken,
} from "./ChatGptPublicPlugins.ts";

const tickTickListing = {
id: "ticktick-public",
name: "ticktick",
release: {
version: "1.2.0",
display_name: "TickTick:To-Do List & Calendar",
description: "Reminder, Planner, Countdown",
app_ids: ["ticktick-app"],
interface: {
short_description: "Reminder, Planner, Countdown",
developer_name: "TickTick",
category: "Productivity",
website_url: "https://ticktick.com",
logo_url: "https://ticktick.com/icon.png",
},
},
};

describe("ChatGptPublicPlugins", () => {
it.effect("decodes the ChatGPT public directory payload", () =>
Effect.gen(function* () {
const decoded = yield* decodeChatGptPublicPluginListResponse({
plugins: [tickTickListing, { id: "broken" }],
pagination: { next_page_token: "page-2" },
});
const plugins = chatGptPublicPluginsFromListResponse(decoded);
const plugin = plugins[0]!;

assert.strictEqual(plugins.length, 1);
assert.strictEqual(plugin.displayName, "TickTick:To-Do List & Calendar");
assert.strictEqual(plugin.description, "Reminder, Planner, Countdown");
assert.strictEqual(plugin.developer, "TickTick");
assert.strictEqual(plugin.category, "Productivity");
assert.strictEqual(plugin.appCount, 1);
assert.strictEqual(plugin.logoUrl, "https://ticktick.com/icon.png");
assert.strictEqual(
chatGptPublicPluginSourceId(plugin),
`ticktick@${CHATGPT_PUBLIC_MARKETPLACE_SOURCE}`,
);
assert.strictEqual(
chatGptPublicPluginMarketplaceUrl(plugin),
"https://chatgpt.com/plugins?q=TickTick%3ATo-Do+List+%26+Calendar",
);
assert.strictEqual(decoded.pagination?.next_page_token, "page-2");
}),
);

it.effect("reads ChatGPT tokens and account id from Codex auth.json", () =>
Effect.gen(function* () {
const decoded = yield* decodeCodexChatGptAccessToken(
'{"tokens":{"access_token":"chatgpt-access-token","account_id":"acct"}}',
);
assert.strictEqual(decoded.tokens.access_token, "chatgpt-access-token");
assert.strictEqual(decoded.tokens.account_id, "acct");
}),
);

it("pages the shared ChatGPT plugin directory and search index", () => {
assert.strictEqual(
chatGptPublicPluginListUrl(),
"https://chatgpt.com/backend-api/ps/plugins/list?scope=GLOBAL&limit=200",
);
assert.strictEqual(
chatGptPublicPluginListUrl("abc"),
"https://chatgpt.com/backend-api/ps/plugins/list?scope=GLOBAL&limit=200&pageToken=abc",
);
assert.strictEqual(
chatGptPublicPluginSearchUrl("tick"),
"https://chatgpt.com/backend-api/ps/plugins/search?q=tick&limit=200",
);
assert.strictEqual(
chatGptPublicPluginNameFromPublicId("codex:app-69ddbaba@chatgpt-public"),
"app-69ddbaba",
);
});

it("maps a directory item without a release interface", () => {
const plugin = chatGptPublicPluginFromDirectoryItem({
id: "bare",
name: "bare-plugin",
release: { display_name: "Bare Plugin" },
});
assert.strictEqual(plugin.displayName, "Bare Plugin");
assert.strictEqual(plugin.description, "Bare Plugin");
assert.strictEqual(plugin.developer, "ChatGPT");
});
});
166 changes: 166 additions & 0 deletions apps/server/src/plugins/ChatGptPublicPlugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import * as Option from "effect/Option";
import * as Schema from "effect/Schema";

export const CHATGPT_PUBLIC_MARKETPLACE_NAME = "ChatGPT Public";
export const CHATGPT_PUBLIC_MARKETPLACE_SOURCE = "chatgpt-public";
export const CHATGPT_BACKEND_API_URL = "https://chatgpt.com/backend-api";
export const CHATGPT_PUBLIC_PLUGIN_LIST_PAGE_LIMIT = 200;
export const CHATGPT_PUBLIC_PLUGIN_SEARCH_MAX_PAGES = 3;
export const CHATGPT_PUBLIC_PLUGIN_SEARCH_MIN_QUERY_LENGTH = 2;

export interface ChatGptPublicPlugin {
readonly id: string;
readonly name: string;
readonly displayName: string;
readonly description: string;
readonly developer: string;
readonly category: string;
readonly version: string;
readonly logoUrl: string | null;
readonly homepage: string | null;
readonly appCount: number;
readonly skillCount: number;
}

export interface CodexChatGptAuth {
readonly accessToken: string;
readonly accountId: string | null;
}

const ChatGptPublicPluginReleaseInterface = Schema.Struct({
short_description: Schema.optional(Schema.String),
long_description: Schema.optional(Schema.String),
developer_name: Schema.optional(Schema.String),
category: Schema.optional(Schema.String),
website_url: Schema.optional(Schema.String),
logo_url: Schema.optional(Schema.String),
composer_icon_url: Schema.optional(Schema.String),
});

const ChatGptPublicPluginRelease = Schema.Struct({
version: Schema.optional(Schema.String),
display_name: Schema.optional(Schema.String),
description: Schema.optional(Schema.String),
app_ids: Schema.optional(Schema.Array(Schema.String)),
app_templates: Schema.optional(Schema.Array(Schema.Unknown)),
interface: Schema.optional(ChatGptPublicPluginReleaseInterface),
});

const ChatGptPublicPluginDirectoryItem = Schema.Struct({
id: Schema.String,
name: Schema.String,
release: ChatGptPublicPluginRelease,
});
type ChatGptPublicPluginDirectoryItem = typeof ChatGptPublicPluginDirectoryItem.Type;
const decodeChatGptPublicPluginDirectoryItem = Schema.decodeUnknownOption(
ChatGptPublicPluginDirectoryItem,
);

const ChatGptPublicPluginListResponse = Schema.Struct({
plugins: Schema.Array(Schema.Unknown),
pagination: Schema.optional(
Schema.Struct({
next_page_token: Schema.optional(Schema.NullOr(Schema.String)),
}),
),
});
export const decodeChatGptPublicPluginListResponse = Schema.decodeUnknownEffect(
ChatGptPublicPluginListResponse,
);

const CodexAuthTokens = Schema.Struct({
tokens: Schema.Struct({
access_token: Schema.String,
account_id: Schema.optional(Schema.String),
}),
});
export const decodeCodexChatGptAccessToken = Schema.decodeUnknownEffect(
Schema.fromJsonString(CodexAuthTokens),
);

function firstText(...values: ReadonlyArray<string | null | undefined>): string | null {
for (const value of values) {
const cleaned = value?.trim();
if (cleaned) return cleaned;
}
return null;
}

export function chatGptPublicPluginFromDirectoryItem(
item: ChatGptPublicPluginDirectoryItem,
): ChatGptPublicPlugin {
const displayName = firstText(item.release.display_name, item.name) ?? item.name;
const pluginInterface = item.release.interface;
return {
id: item.id,
name: item.name,
displayName,
description:
firstText(
pluginInterface?.short_description,
item.release.description,
pluginInterface?.long_description,
) ?? displayName,
developer: firstText(pluginInterface?.developer_name, "ChatGPT") ?? "ChatGPT",
category: firstText(pluginInterface?.category, "Other") ?? "Other",
version: firstText(item.release.version, "Latest") ?? "Latest",
logoUrl: firstText(pluginInterface?.logo_url, pluginInterface?.composer_icon_url) ?? null,
homepage: firstText(pluginInterface?.website_url) ?? null,
appCount: (item.release.app_ids?.length ?? 0) + (item.release.app_templates?.length ?? 0),
skillCount: 0,
};
}

export function chatGptPublicPluginsFromListResponse(payload: {
readonly plugins: ReadonlyArray<unknown>;
}): ChatGptPublicPlugin[] {
return payload.plugins.flatMap((item) => {
const decoded = decodeChatGptPublicPluginDirectoryItem(item);
return Option.isSome(decoded) ? [chatGptPublicPluginFromDirectoryItem(decoded.value)] : [];
});
}

export function chatGptPublicPluginListUrl(pageToken?: string): string {
const url = new URL(`${CHATGPT_BACKEND_API_URL}/ps/plugins/list`);
url.searchParams.set("scope", "GLOBAL");
url.searchParams.set("limit", String(CHATGPT_PUBLIC_PLUGIN_LIST_PAGE_LIMIT));
if (pageToken) url.searchParams.set("pageToken", pageToken);
return url.toString();
}

export function chatGptPublicPluginSearchUrl(query: string, pageToken?: string): string {
const url = new URL(`${CHATGPT_BACKEND_API_URL}/ps/plugins/search`);
url.searchParams.set("q", query);
url.searchParams.set("limit", String(CHATGPT_PUBLIC_PLUGIN_LIST_PAGE_LIMIT));
if (pageToken) url.searchParams.set("pageToken", pageToken);
return url.toString();
}

export function chatGptPublicPluginMarketplaceUrl(
plugin: Pick<ChatGptPublicPlugin, "displayName">,
) {
const url = new URL("https://chatgpt.com/plugins");
url.searchParams.set("q", plugin.displayName);
return url.toString();
}

export function chatGptPublicPluginSourceId(plugin: Pick<ChatGptPublicPlugin, "name">) {
return `${plugin.name}@${CHATGPT_PUBLIC_MARKETPLACE_SOURCE}`;
}

export function chatGptPublicPluginNameFromPublicId(pluginId: string): string | null {
const prefix = "codex:";
const suffix = `@${CHATGPT_PUBLIC_MARKETPLACE_SOURCE}`;
if (!pluginId.startsWith(prefix) || !pluginId.endsWith(suffix)) return null;
return pluginId.slice(prefix.length, -suffix.length);
}

export function codexChatGptAuthFromTokens(tokens: {
readonly access_token: string;
readonly account_id?: string | undefined;
}): CodexChatGptAuth {
return {
accessToken: tokens.access_token,
accountId: firstText(tokens.account_id),
};
}
Loading
Loading