mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
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.
This commit is contained in:
@@ -119,7 +119,7 @@ describe('onboarding feature setup runner', () => {
|
||||
|
||||
expect(text).toBe(ALL_SKILL_INSTALL_COMMAND)
|
||||
expect(text).toBe(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orca-cli computer-use orchestration orca-linear --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli computer-use orchestration orca-linear --global -y'
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ describe('CliSkillRuntimeSetup runtime helpers', () => {
|
||||
)
|
||||
|
||||
// Expectations are pinned rather than rebuilt from the builder: this is the only
|
||||
// coverage that the non-interactive `-y` reaches the Windows rewrite.
|
||||
// coverage that both non-interactive flags reach the Windows rewrite.
|
||||
it('reinstalls Windows-host skill updates through the add path', () => {
|
||||
expect(
|
||||
buildSkillCommandForRuntime(
|
||||
@@ -129,13 +129,15 @@ describe('CliSkillRuntimeSetup runtime helpers', () => {
|
||||
},
|
||||
'win32'
|
||||
)
|
||||
).toBe('npx skills add https://github.com/stablyai/orca --skill orchestration --global -y')
|
||||
).toBe(
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
)
|
||||
})
|
||||
|
||||
it('treats missing runtime as a Windows host fallback for skill updates', () => {
|
||||
expect(
|
||||
buildSkillCommandForRuntime('npx skills update orca-cli --global', undefined, 'win32')
|
||||
).toBe('npx skills add https://github.com/stablyai/orca --skill orca-cli --global -y')
|
||||
).toBe('npx --yes skills add https://github.com/stablyai/orca --skill orca-cli --global -y')
|
||||
})
|
||||
|
||||
it('keeps non-Windows host skill updates on the update path', () => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { getOrchestrationUsageExamples } from '@/lib/orchestration-usage-example
|
||||
import { OrchestrationPane } from './OrchestrationPane'
|
||||
|
||||
const INSTALL_COMMAND =
|
||||
'npx skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
const UPDATE_COMMAND = INSTALL_COMMAND
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
|
||||
@@ -115,7 +115,7 @@ describe('LinearAgentSkillInstallCta', () => {
|
||||
expect(rendered.textContent).toContain('Not installed')
|
||||
expect(rendered.textContent).toContain('Let your agents read and edit Linear tasks.')
|
||||
expect(rendered.textContent).toContain(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orca-linear --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orca-linear --global -y'
|
||||
)
|
||||
})
|
||||
|
||||
@@ -129,7 +129,7 @@ describe('LinearAgentSkillInstallCta', () => {
|
||||
})
|
||||
|
||||
expect(mocks.clipboardWrite).toHaveBeenCalledWith(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orca-linear --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orca-linear --global -y'
|
||||
)
|
||||
expect(mocks.toastSuccess).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
@@ -344,7 +344,7 @@ describe('LinearAgentSkillSetupPrompt', () => {
|
||||
setupButton?.dispatchEvent(new MouseEvent('click', { bubbles: true }))
|
||||
})
|
||||
|
||||
expect(document.body.textContent).toContain("wsl.exe -d 'Fedora' -- bash -lc 'npx skills add")
|
||||
expect(document.body.textContent).toContain("bash -lc 'npx --yes skills add")
|
||||
expect(mocks.panelProps.at(-1)).toEqual(
|
||||
expect.objectContaining({
|
||||
installedCommand:
|
||||
|
||||
@@ -438,7 +438,7 @@ describe('SkillFreshnessUpdateDialog', () => {
|
||||
await openViaRequest()
|
||||
|
||||
expect(container?.textContent).toContain(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ describe('skippedReason', () => {
|
||||
const reason = skippedReason([row(null)], 'orchestration')
|
||||
expect(reason).toContain('reports the skill as already up to date')
|
||||
expect(reason).toContain(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orchestration --global -y'
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -36,21 +36,21 @@ describe('agent feature skill commands', () => {
|
||||
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 skills add https://github.com/stablyai/orca --skill orca-cli orchestration --global -y'
|
||||
'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: with more than one agent installed the CLI prompts for a target and the
|
||||
// pasted command hangs, so `-y` is the fix and must not silently regress.
|
||||
// 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 skills add https://github.com/stablyai/orca --skill orca-cli --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli --global -y'
|
||||
)
|
||||
expect(buildAgentFeatureSkillInstallCommand(['orca-cli', 'orchestration'])).toBe(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orca-cli orchestration --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli orchestration --global -y'
|
||||
)
|
||||
expect(ORCA_CLI_SKILL_INSTALL_COMMAND).toBe(
|
||||
'npx skills add https://github.com/stablyai/orca --skill orca-cli --global -y'
|
||||
'npx --yes skills add https://github.com/stablyai/orca --skill orca-cli --global -y'
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -12,10 +12,11 @@ export function buildAgentFeatureSkillInstallCommand(skillNames: readonly string
|
||||
if (skillNames.length === 0) {
|
||||
throw new Error('At least one skill name is required.')
|
||||
}
|
||||
// Why: `-y` because this command is pasted into a live terminal — with more than one
|
||||
// agent installed the CLI stops on an agent-selection prompt the user cannot see coming,
|
||||
// and closing the panel tears the session down mid-prompt.
|
||||
return `npx skills add ${ORCA_SKILLS_REPOSITORY_URL} --skill ${skillNames.join(' ')} --global -y`
|
||||
// Why: pasted into a live terminal, so any prompt strands the user and closing the panel
|
||||
// kills the session mid-prompt. Both flags are load-bearing, as in the headless updater:
|
||||
// `npx --yes` skips npm's install-this-package prompt (npx re-resolves `latest` every
|
||||
// run, so a cold or stale cache prompts); `skills … -y` skips agent selection.
|
||||
return `npx --yes skills add ${ORCA_SKILLS_REPOSITORY_URL} --skill ${skillNames.join(' ')} --global -y`
|
||||
}
|
||||
|
||||
export function buildAgentFeatureSkillUpdateCommand(skillName: string): string {
|
||||
|
||||
Reference in New Issue
Block a user