Skip to content

Add StreamDock plugin for OpenAI Codex / ChatGPT#1

Draft
Bigduang with Copilot wants to merge 3 commits into
mainfrom
copilot/astream-dock-plugin-for-codex
Draft

Add StreamDock plugin for OpenAI Codex / ChatGPT#1
Bigduang with Copilot wants to merge 3 commits into
mainfrom
copilot/astream-dock-plugin-for-codex

Conversation

Copilot AI commented Jul 5, 2026

Copy link
Copy Markdown

Implements a complete StreamDock plugin (com.bigduang.streamdock.codex.sdPlugin) that integrates OpenAI Codex and ChatGPT into StreamDock key workflows.

Actions

  • Ask Codex — sends a configurable prompt to the OpenAI Chat Completions API on key press, copies the response text to the system clipboard. Configurable: API key, model, prompt template, max tokens, temperature.
  • Open ChatGPT — opens a configurable URL (default: https://chatgpt.com) in the default browser via the StreamDock openUrl event.

Plugin structure

Follows the MiraboxSpace StreamDock Plugin SDK (SDNodeJsSDK) conventions:

com.bigduang.streamdock.codex.sdPlugin/
├── manifest.json / en.json / zh_CN.json
├── plugin/
│   ├── index.js              # backend: WebSocket ↔ StreamDock, HTTPS → OpenAI API
│   ├── package.json          # deps: ws, log4js
│   └── utils/plugin.js       # StreamDock SDK (Plugins / Actions classes)
├── propertyInspector/
│   ├── askCodex/{index.html,index.js}
│   ├── openChatGPT/{index.html,index.js}
│   └── utils/{action.js,common.js}
└── static/css/sdpi.css + icons/*.svg

Security

WebSocket message dispatch validates incoming event names against an explicit allowlist before any dynamic method call, preventing unvalidated dynamic dispatch (CodeQL js/unvalidated-dynamic-method-call):

const ALLOWED_EVENTS = new Set([
    'willAppear', 'willDisappear', 'keyDown', 'keyUp', /* … */
]);
const event = data.event;
if (!ALLOWED_EVENTS.has(event)) return;
if (typeof this[event] === 'function') this[event](data);

The API key is stored exclusively in the StreamDock local settings file and transmitted only to api.openai.com.

Original prompt

AStreamDockPluginForCodex

Copilot AI changed the title [WIP] Add AStream dock plugin for Codex Add StreamDock plugin for OpenAI Codex / ChatGPT Jul 5, 2026
Copilot AI requested a review from Bigduang July 5, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants