mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-12 03:30:28 +01:00
Install /captain only on Capy machines (GST-1833) (#4143)
* Load the Capy crew skills only on Capy machines (GST-1833) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Add changelog entry for Capy-only crew skills (GST-1833) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Test that the harness registrar leaves /captain out off Capy Review-Finding: p1/specialist-batched#2 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Say in the skills guide that /captain installs only on Capy machines Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
7cb151bff7
commit
bb3b7d072a
10 files changed
+239
-12
No files matched your search
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import type { HostConfig } from './host-config';
|
||||
|
||||
@@ -20,6 +21,23 @@ const SKIP = new Set(['node_modules', '.git', 'dist']);
|
||||
*/
|
||||
export const RETIRED_SKILLS = ['plan-eng-review', 'investigate'];
|
||||
|
||||
/**
|
||||
* The gstack-on-Capy skills (crew/README.md): registered only on a Capy
|
||||
* machine, and kept off every host elsewhere like a retired skill. Same list
|
||||
* as GSTACK_CREW_SKILLS in bin/gstack-install-registry.sh, and the same Capy
|
||||
* test as its gstack_on_capy.
|
||||
*/
|
||||
export const CREW_SKILLS = ['captain'];
|
||||
|
||||
export function onCapyMachine(env: NodeJS.ProcessEnv = process.env, home = os.homedir()): boolean {
|
||||
return Boolean(env.CAPY_MACHINE_CONFIG) || fs.existsSync(path.join(home, '.capy', 'system'));
|
||||
}
|
||||
|
||||
/** What no host registers on this machine: the retired skills, plus the crew skills off Capy. */
|
||||
export function unregisteredSkills(env: NodeJS.ProcessEnv = process.env, home = os.homedir()): string[] {
|
||||
return onCapyMachine(env, home) ? RETIRED_SKILLS : [...RETIRED_SKILLS, ...CREW_SKILLS];
|
||||
}
|
||||
|
||||
/** The generator and its coverage checks use the same include-minus-skip rule. */
|
||||
export function includesSkill(host: HostConfig, skillDir: string): boolean {
|
||||
const { includeSkills, skipSkills } = host.generation;
|
||||
|
||||
Reference in new issue
Block a user