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 .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "propulsion",
"source": {
"source": "local",
"path": "./"
"path": "./plugins/propulsion"
},
"policy": {
"installation": "AVAILABLE",
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "propulsion",
"version": "1.0.0",
"version": "1.0.1",
"description": "Propulsion workflow routing and skills for agentic coding.",
"author": {
"name": "Moon Pixels"
Expand Down
14 changes: 14 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
import { createRequire } from 'node:module';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

const require = createRequire(import.meta.url);
const {
getPropulsionBootstrapGuidance,
} = require('./lib/bootstrap-guidance.js');
const PROPULSION_SKILLS_DIR = join(
dirname(fileURLToPath(import.meta.url)),
'skills',
);

async function PropulsionPlugin() {
return {
config: async (config) => {
config.skills = config.skills || {};
config.skills.paths = config.skills.paths || [];

if (!config.skills.paths.includes(PROPULSION_SKILLS_DIR)) {
config.skills.paths.push(PROPULSION_SKILLS_DIR);
}
},
'experimental.chat.messages.transform': async (_input, output) => {
output.messages = [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "propulsion",
"version": "1.0.0",
"version": "1.0.1",
"main": "./index.mjs",
"exports": "./index.mjs",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions plugins/propulsion/.codex-plugin
1 change: 1 addition & 0 deletions plugins/propulsion/assets
1 change: 1 addition & 0 deletions plugins/propulsion/hooks
1 change: 1 addition & 0 deletions plugins/propulsion/skills
51 changes: 51 additions & 0 deletions tests/opencode-plugin.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { describe, expect, test } from 'bun:test';
import { readFile } from 'node:fs/promises';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

import { getPropulsionBootstrapGuidance } from '../lib/bootstrap-guidance.js';

Expand All @@ -21,6 +23,55 @@ describe('OpenCode Propulsion bootstrap guidance', () => {
).toBe(true);
});

test('publishes Propulsion through a non-empty Codex marketplace plugin path', async () => {
const marketplace = JSON.parse(
await readFile('.agents/plugins/marketplace.json', 'utf8'),
);
const plugin = marketplace.plugins.find(
({ name }) => name === 'propulsion',
);

expect(plugin.source).toEqual({
source: 'local',
path: './plugins/propulsion',
});

const pluginManifest = JSON.parse(
await readFile(
'plugins/propulsion/.codex-plugin/plugin.json',
'utf8',
),
);

expect(pluginManifest.name).toBe('propulsion');
});

test('registers bundled skills with OpenCode config', async () => {
const pluginPackage = (await import('../index.mjs')).default;
const PropulsionPlugin = pluginPackage.server;
const hooks = await PropulsionPlugin({});
const config = {};
const skillsDir = join(
dirname(fileURLToPath(import.meta.url)),
'..',
'skills',
);

expect(hooks).toEqual(
expect.objectContaining({
config: expect.any(Function),
}),
);

await hooks.config(config);
await hooks.config(config);

expect(config.skills.paths).toEqual([skillsDir]);
await expect(
readFile(join(skillsDir, 'debug', 'SKILL.md'), 'utf8'),
).resolves.toContain('# Debug');
});

test('provides high-priority Propulsion routing guidance', () => {
const guidance = getPropulsionBootstrapGuidance();

Expand Down