refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* permissions are written against the actual resolved install directory.
|
||||
*/
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -15,7 +15,7 @@ const path = require('node:path');
|
||||
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
const { configureOpencodePermissions } = require('../bin/install.js');
|
||||
const { PACKAGE_NAME } = require('../gsd-core/bin/lib/package-identity.cjs');
|
||||
const { PACKAGE_NAME } = require('../msd-core/bin/lib/package-identity.cjs');
|
||||
const { runNode } = require('./helpers/process-seam.cjs');
|
||||
const { INSTALL_SCRIPT, installerEnv } = require('./helpers/install-shared.cjs');
|
||||
const { INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
@@ -68,13 +68,13 @@ describe('configureOpencodePermissions', () => {
|
||||
configureOpencodePermissions(true, configDir);
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
const gsdPath = `${configDir.replace(/\\/g, '/')}/gsd-core/*`;
|
||||
const msdPath = `${configDir.replace(/\\/g, '/')}/msd-core/*`;
|
||||
|
||||
assert.strictEqual(config.permission.read[gsdPath], 'allow');
|
||||
assert.strictEqual(config.permission.external_directory[gsdPath], 'allow');
|
||||
assert.strictEqual(config.permission.read[msdPath], 'allow');
|
||||
assert.strictEqual(config.permission.external_directory[msdPath], 'allow');
|
||||
});
|
||||
|
||||
test('registers the companion MCP server (mcp.gsd) for object configs (#1682)', () => {
|
||||
test('registers the companion MCP server (mcp.msd) for object configs (#1682)', () => {
|
||||
const configPath = path.join(configDir, 'opencode.json');
|
||||
fs.writeFileSync(configPath, JSON.stringify({ permission: {} }, null, 2) + '\n');
|
||||
process.env.OPENCODE_CONFIG_DIR = configDir;
|
||||
@@ -82,24 +82,24 @@ describe('configureOpencodePermissions', () => {
|
||||
configureOpencodePermissions(true, configDir);
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
assert.deepEqual(config.mcp.gsd, {
|
||||
assert.deepEqual(config.mcp.msd, {
|
||||
type: 'local',
|
||||
command: ['npx', '-y', '-p', PACKAGE_NAME, 'gsd-mcp-server'],
|
||||
command: ['npx', '-y', '-p', PACKAGE_NAME, 'msd-mcp-server'],
|
||||
enabled: true,
|
||||
});
|
||||
});
|
||||
|
||||
test('does not clobber a user-defined mcp.gsd entry (#1682)', () => {
|
||||
test('does not clobber a user-defined mcp.msd entry (#1682)', () => {
|
||||
const configPath = path.join(configDir, 'opencode.json');
|
||||
const userMcp = { type: 'local', command: ['node', '/custom/server.js'], enabled: false };
|
||||
fs.writeFileSync(configPath, JSON.stringify({ permission: {}, mcp: { gsd: userMcp } }, null, 2) + '\n');
|
||||
fs.writeFileSync(configPath, JSON.stringify({ permission: {}, mcp: { msd: userMcp } }, null, 2) + '\n');
|
||||
process.env.OPENCODE_CONFIG_DIR = configDir;
|
||||
|
||||
configureOpencodePermissions(true, configDir);
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
// User's own mcp.gsd is preserved untouched (Hyrum's Law — non-clobbering).
|
||||
assert.deepEqual(config.mcp.gsd, userMcp);
|
||||
// User's own mcp.msd is preserved untouched (Hyrum's Law — non-clobbering).
|
||||
assert.deepEqual(config.mcp.msd, userMcp);
|
||||
});
|
||||
|
||||
test('finishInstall passes the REAL resolved config dir to OpenCode permissions (not a hardcoded path)', () => {
|
||||
@@ -109,9 +109,9 @@ describe('configureOpencodePermissions', () => {
|
||||
// finishInstall's `configureOpencodePermissions(isGlobal, configDir);`
|
||||
// call site (the exported `install()` function alone does NOT call
|
||||
// finishInstall — only the CLI/installAllRuntimes flow does, and that
|
||||
// flow is also where the GSD_TEST_MODE gate on this writer is normally
|
||||
// flow is also where the MSD_TEST_MODE gate on this writer is normally
|
||||
// active, so a real spawn — whose env deliberately excludes
|
||||
// GSD_TEST_MODE via installerEnv() — is required to exercise it) —
|
||||
// MSD_TEST_MODE via installerEnv() — is required to exercise it) —
|
||||
// then asserts the resulting opencode.json's permission paths are
|
||||
// anchored on THAT exact config dir. A hardcoded or stale configDir at
|
||||
// the finishInstall call site would write permission paths anchored on
|
||||
@@ -133,15 +133,15 @@ describe('configureOpencodePermissions', () => {
|
||||
'finishInstall must write opencode.json into the resolved config dir'
|
||||
);
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
const gsdPath = `${configDir.replace(/\\/g, '/')}/gsd-core/*`;
|
||||
const msdPath = `${configDir.replace(/\\/g, '/')}/msd-core/*`;
|
||||
assert.strictEqual(
|
||||
config.permission?.read?.[gsdPath], 'allow',
|
||||
config.permission?.read?.[msdPath], 'allow',
|
||||
'finishInstall must call configureOpencodePermissions with the REAL resolved configDir, ' +
|
||||
`not a hardcoded path — expected a read permission entry for ${gsdPath}`
|
||||
`not a hardcoded path — expected a read permission entry for ${msdPath}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
config.permission?.external_directory?.[gsdPath], 'allow',
|
||||
`expected an external_directory permission entry for ${gsdPath}`
|
||||
config.permission?.external_directory?.[msdPath], 'allow',
|
||||
`expected an external_directory permission entry for ${msdPath}`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user