Files
orca/src/shared/agent-feature-install-commands.test.ts
T
Brennan Benson dfddaa6dea fix(skills): skip npm's install prompt too, not just the CLI's
The pasted install command still stalled on npm's "Need to install the
following packages ... Ok to proceed?" whenever `skills@latest` was not
already in the npx cache — npx re-resolves the tag on every run, so a
first-time or outdated cache prompts. That is the same PTY-teardown
failure `-y` was added to fix. The headless updater already documents
both flags as load-bearing; the pasted command now matches it.
2026-07-28 18:26:34 -07:00

63 lines
2.7 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
buildAgentFeatureSkillInstallCommand,
buildAgentFeatureSkillUpdateCommand,
COMPUTER_USE_SKILL_UPDATE_COMMAND,
EPHEMERAL_VMS_SKILL_UPDATE_COMMAND,
LINEAR_TICKETS_SKILL_UPDATE_COMMAND,
ORCA_LINEAR_SKILL_UPDATE_COMMAND,
ORCA_CLI_ORCHESTRATION_SKILL_INSTALL_COMMAND,
ORCA_CLI_SKILL_INSTALL_COMMAND,
ORCA_CLI_SKILL_UPDATE_COMMAND,
ORCHESTRATION_SKILL_UPDATE_COMMAND
} from './agent-feature-install-commands'
describe('agent feature skill commands', () => {
it('builds single-skill update commands', () => {
expect(buildAgentFeatureSkillUpdateCommand('orchestration')).toBe(
'npx skills update orchestration --global'
)
})
it('trims and rejects blank update skill names', () => {
expect(buildAgentFeatureSkillUpdateCommand(' orca-cli ')).toBe(
'npx skills update orca-cli --global'
)
expect(() => buildAgentFeatureSkillUpdateCommand(' ')).toThrow('A skill name is required.')
})
it('exports single-skill update constants without changing install bundles', () => {
expect(ORCA_CLI_SKILL_UPDATE_COMMAND).toBe('npx skills update orca-cli --global')
expect(COMPUTER_USE_SKILL_UPDATE_COMMAND).toBe('npx skills update computer-use --global')
expect(ORCHESTRATION_SKILL_UPDATE_COMMAND).toBe('npx skills update orchestration --global')
expect(EPHEMERAL_VMS_SKILL_UPDATE_COMMAND).toBe(
'npx skills update orca-per-workspace-env --global'
)
expect(ORCA_LINEAR_SKILL_UPDATE_COMMAND).toBe('npx skills update orca-linear --global')
expect(LINEAR_TICKETS_SKILL_UPDATE_COMMAND).toBe('npx skills update linear-tickets --global')
expect(ORCA_CLI_ORCHESTRATION_SKILL_INSTALL_COMMAND).toBe(
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli orchestration --global -y'
)
})
it('builds install commands non-interactively so a pasted command never stops on a prompt', () => {
// Why: a pasted command hangs on npm's install-this-package prompt and on the
// CLI's agent selection, so both `npx --yes` and `-y` must not silently regress.
expect(buildAgentFeatureSkillInstallCommand(['orca-cli'])).toBe(
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli --global -y'
)
expect(buildAgentFeatureSkillInstallCommand(['orca-cli', 'orchestration'])).toBe(
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli orchestration --global -y'
)
expect(ORCA_CLI_SKILL_INSTALL_COMMAND).toBe(
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli --global -y'
)
})
it('rejects an empty install skill list', () => {
expect(() => buildAgentFeatureSkillInstallCommand([])).toThrow(
'At least one skill name is required.'
)
})
})