feat(#792): add devin-desktop runtime alias for windsurf (#1086)

windsurf now also answers to devin-desktop (CLI --devin-desktop) for the Windsurf→Devin Desktop rebrand; all paths unchanged. The .devin/skills/ workspace migration is split to #1085. Closes #792.
This commit is contained in:
Tom Boucher
2026-06-11 22:32:49 -04:00
committed by GitHub
parent e644819d59
commit 93c5ecd645
9 changed files with 87 additions and 8 deletions

View File

@@ -43,6 +43,7 @@ const {
buildRuntimePromptText,
resolveKiloConfigPath,
configureKiloPermissions,
selectRuntimesFromArgs,
} = require('../bin/install.js');
const { getGlobalConfigDir } = require('../gsd-core/bin/lib/runtime-homes.cjs');
@@ -835,6 +836,20 @@ describe('install — changeset CLI lands at scripts/changeset/cli.cjs (#935)',
});
});
// ─── Section 6: Windsurf / devin-desktop alias (#792) ───────────────────────
describe('install — --devin-desktop CLI flag routes to windsurf runtime (#792)', () => {
test('--devin-desktop resolves to ["windsurf"] via selectRuntimesFromArgs', () => {
const runtimes = selectRuntimesFromArgs(['--devin-desktop']);
assert.deepStrictEqual(runtimes, ['windsurf'],
'--devin-desktop must resolve to ["windsurf"] via selectRuntimesFromArgs');
});
test('--windsurf and --devin-desktop both resolve to ["windsurf"]', () => {
assert.deepStrictEqual(selectRuntimesFromArgs(['--windsurf']), ['windsurf']);
assert.deepStrictEqual(selectRuntimesFromArgs(['--devin-desktop']), ['windsurf']);
});
});
// ─── Section N+1: #767 — disallowedTools injection for read-only agents ──────
//
// Verifies (installer-behavioral test — drives install() to a temp dir):

View File

@@ -3,6 +3,7 @@
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const path = require('node:path');
const fs = require('node:fs');
const ROOT = path.join(__dirname, '..');
const {
@@ -17,4 +18,56 @@ describe('runtime-name-policy canonical runtime ids', () => {
assert.strictEqual(resolveRuntimeNameFromCandidates('', null, 'kimi'), 'kimi');
assert.strictEqual(canonicalizeRuntimeName('kimi-cli'), null);
});
test('canonicalizes devin-desktop to windsurf (#792)', () => {
assert.strictEqual(canonicalizeRuntimeName('devin-desktop'), 'windsurf');
assert.strictEqual(canonicalizeRuntimeName('DEVIN-DESKTOP'), 'windsurf');
assert.strictEqual(resolveRuntimeNameFromCandidates('devin-desktop'), 'windsurf');
});
});
describe('runtime-name-policy windsurf alias parity — manifest vs FALLBACK_ALIASES (#792)', () => {
// DEFECT.GENERATIVE-FIX: manifest and FALLBACK_ALIASES are manually mirrored;
// this test fails if they diverge for the windsurf key.
const manifestPath = path.join(ROOT, 'gsd-core', 'bin', 'shared', 'runtime-aliases.manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
test('manifest windsurf array includes devin-desktop', () => {
assert.ok(
Array.isArray(manifest.windsurf) && manifest.windsurf.includes('devin-desktop'),
`runtime-aliases.manifest.json windsurf array must include 'devin-desktop'; got: ${JSON.stringify(manifest.windsurf)}`,
);
});
test('FALLBACK_ALIASES windsurf includes devin-desktop (via canonicalization round-trip)', () => {
// The built module merges manifest over FALLBACK_ALIASES; if the manifest is present
// this verifies the combined set. The manifest test above separately guards the manifest.
// Here we verify the live canonicalizer sees devin-desktop -> windsurf.
assert.strictEqual(
canonicalizeRuntimeName('devin-desktop'),
'windsurf',
'devin-desktop must resolve to windsurf via alias lookup',
);
});
test('manifest and FALLBACK_ALIASES windsurf alias sets are identical', () => {
// Read FALLBACK_ALIASES from source to detect manual drift before a build.
const srcPath = path.join(ROOT, 'src', 'runtime-name-policy.cts');
// allow-test-rule: runtime-contract-is-the-product — FALLBACK_ALIASES source text IS the
// product contract for runtimes that can't load the manifest at runtime; verifying
// both surfaces contain the same windsurf aliases catches manual-mirror drift.
const src = fs.readFileSync(srcPath, 'utf8');
const match = src.match(/windsurf:\s*\[([^\]]+)\]/);
assert.ok(match, 'FALLBACK_ALIASES windsurf row must exist in src/runtime-name-policy.cts');
const srcAliases = match[1]
.split(',')
.map(s => s.trim().replace(/^['"]|['"]$/g, ''))
.filter(Boolean);
const manifestAliases = [...manifest.windsurf].sort();
assert.deepStrictEqual(
[...srcAliases].sort(),
manifestAliases,
`FALLBACK_ALIASES windsurf=${JSON.stringify(srcAliases.sort())} must match manifest windsurf=${JSON.stringify(manifestAliases)}`,
);
});
});