Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ body:
id: extras-version
attributes:
label: Codex Extras version
placeholder: "1.0.0"
placeholder: "1.0.1"
validations:
required: true

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to Codex Extras are documented in this file.

## 1.0.1

- Add an original code-brackets-and-plus icon for the New Codex Agent toolbar button.
- Delegate the custom toolbar action to the official `chatgpt.newCodexPanel` command.

## 1.0.0

- Initial stable release.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Small, focused workflow improvements for the official Codex extension in Visual

### New Codex Agent toolbar button

Adds a visible `+` action to the editor toolbar. Select it to execute the official Codex command `chatgpt.newCodexPanel` and open a new Codex agent.
Adds a visible code-brackets-and-plus action to the editor toolbar. Select it to execute the official Codex command `chatgpt.newCodexPanel` and open a new Codex agent.

The button is available without assigning a keyboard shortcut.

Expand Down Expand Up @@ -42,12 +42,12 @@ For an unpublished development build:
```sh
npm ci
npm run package
code --install-extension codex-extras-1.0.0.vsix
code --install-extension codex-extras-1.0.1.vsix
```

## Privacy

Codex Extras contains no telemetry, network requests, or runtime code. It contributes a menu item that invokes a command provided by the official Codex extension.
Codex Extras contains no telemetry or network requests. Its small runtime wrapper only delegates the toolbar action to a command provided by the official Codex extension.

## Contributing

Expand Down
3 changes: 3 additions & 0 deletions assets/toolbar-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/toolbar-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Never commit or paste the token into an issue, pull request, workflow file, or b
5. Tag the exact version and push it:

```sh
git tag v1.0.0
git push origin v1.0.0
git tag v1.0.1
git push origin v1.0.1
```

The release workflow verifies that the tag matches `package.json`, packages the VSIX, publishes it to the Visual Studio Marketplace, and creates a GitHub release containing the same VSIX.
22 changes: 22 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use strict";

const vscode = require("vscode");

const COMMAND_ID = "codexExtras.newCodexAgent";
const OFFICIAL_CODEX_COMMAND_ID = "chatgpt.newCodexPanel";

/**
* Registers the branded toolbar action and delegates its behavior to the
* official Codex extension.
*
* @param {import("vscode").ExtensionContext} context
*/
function activate(context) {
const command = vscode.commands.registerCommand(COMMAND_ID, () =>
vscode.commands.executeCommand(OFFICIAL_CODEX_COMMAND_ID),
);

context.subscriptions.push(command);
}

module.exports = { activate };
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"name": "codex-extras",
"displayName": "Codex Extras",
"description": "Convenient toolbar actions and workflow enhancements for Codex in Visual Studio Code.",
"version": "1.0.0",
"version": "1.0.1",
"publisher": "netroforge",
"license": "MIT",
"icon": "assets/icon.png",
"main": "./extension.js",
"activationEvents": [
"onCommand:codexExtras.newCodexAgent"
],
"engines": {
"vscode": "^1.96.2"
},
Expand Down Expand Up @@ -49,6 +53,17 @@
}
},
"contributes": {
"commands": [
{
"command": "codexExtras.newCodexAgent",
"title": "New Codex Agent",
"category": "Codex Extras",
"icon": {
"light": "assets/toolbar-light.svg",
"dark": "assets/toolbar-dark.svg"
}
}
],
"configuration": {
"title": "Codex Extras",
"properties": {
Expand All @@ -62,10 +77,16 @@
"menus": {
"editor/title": [
{
"command": "chatgpt.newCodexPanel",
"command": "codexExtras.newCodexAgent",
"group": "navigation@100",
"when": "config.codexExtras.showNewAgentButton"
}
],
"commandPalette": [
{
"command": "codexExtras.newCodexAgent",
"when": "false"
}
]
}
},
Expand Down
51 changes: 50 additions & 1 deletion scripts/validate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ assert.match(manifest.version, /^\d+\.\d+\.\d+$/);
assert.equal(manifest.license, "MIT");
assert.equal(manifest.repository.url, "https://github.com/netroforge/codex-extras.git");
assert.ok(manifest.extensionDependencies.includes("openai.chatgpt"));
assert.equal(manifest.main, "./extension.js");
assert.ok(
manifest.activationEvents.includes("onCommand:codexExtras.newCodexAgent"),
);

const newAgentCommand = manifest.contributes?.commands?.find(
({ command }) => command === "codexExtras.newCodexAgent",
);

assert.ok(newAgentCommand, "New Codex Agent command contribution is missing");
assert.deepEqual(newAgentCommand.icon, {
light: "assets/toolbar-light.svg",
dark: "assets/toolbar-dark.svg",
});

const editorTitleItems = manifest.contributes?.menus?.["editor/title"] ?? [];
const newAgentButton = editorTitleItems.find(
({ command }) => command === "chatgpt.newCodexPanel",
({ command }) => command === "codexExtras.newCodexAgent",
);

assert.ok(newAgentButton, "New Codex Agent toolbar contribution is missing");
Expand All @@ -38,6 +52,41 @@ assert.equal(
true,
);

const commandPaletteItems =
manifest.contributes?.menus?.commandPalette ?? [];
assert.ok(
commandPaletteItems.some(
({ command, when }) =>
command === "codexExtras.newCodexAgent" && when === "false",
),
"Wrapper command must stay hidden from the Command Palette",
);

const extensionSource = await readFile(
path.join(root, manifest.main),
"utf8",
);
assert.match(
extensionSource,
/registerCommand\(COMMAND_ID/,
"Extension must register its wrapper command",
);
assert.match(
extensionSource,
/executeCommand\(OFFICIAL_CODEX_COMMAND_ID\)/,
"Wrapper command must delegate to the official Codex command",
);

for (const [theme, iconPath] of Object.entries(newAgentCommand.icon)) {
const toolbarIcon = await readFile(path.join(root, iconPath), "utf8");
assert.match(toolbarIcon, /viewBox="0 0 16 16"/);
assert.match(toolbarIcon, /stroke-width="1\.5"/);
assert.match(
toolbarIcon,
theme === "light" ? /stroke="#424242"/ : /stroke="#C5C5C5"/,
);
}

const icon = await readFile(path.join(root, manifest.icon));
assert.equal(icon.subarray(0, 8).toString("hex"), "89504e470d0a1a0a");
assert.ok(icon.length >= 24, "Icon is not a valid PNG");
Expand Down