Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@
"@hono/node-server": "^1",
"@napi-rs/keyring": "^1.2.0",
"@workos-inc/node": "^8.7.0",
"@workos/migrations": "^2.0.0",
"@workos/openapi-spec": "^0.1.0",
"@workos/skills": "0.6.0",
"chalk": "^5.6.2",
"diff": "^8.0.3",
"fast-glob": "^3.3.3",
"hono": "^4",
"ink": "^6.8.0",
"opn": "^5.4.0",
"open": "^11.0.0",
"react": "^19.2.4",
"semver": "^7.7.4",
"uuid": "^13.0.0",
"@workos/migrations": "^2.0.0",
"xstate": "^5.28.0",
"yaml": "^2.8.2",
"yargs": "^18.0.0",
Expand Down
103 changes: 91 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
if (process.argv.includes('--local') || process.env.INSTALLER_DEV) {
const { config } = await import('dotenv');
// bin.ts compiles to dist/bin.js, so go up one level to find .env.local
config({ path: new URL('../.env.local', import.meta.url).pathname });
const { fileURLToPath } = await import('node:url');
config({ path: fileURLToPath(new URL('../.env.local', import.meta.url)) });
}

import { satisfies } from 'semver';
Expand Down
3 changes: 1 addition & 2 deletions src/commands/claim.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ vi.mock('../utils/debug.js', () => ({
logError: vi.fn(),
}));

// Mock opn (browser open)
const mockOpen = vi.fn().mockResolvedValue(undefined);
vi.mock('opn', () => ({ default: mockOpen }));
vi.mock('open', () => ({ default: mockOpen }));

// Mock clack
const mockSpinner = {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* until the environment is claimed.
*/

import open from 'opn';
import open from 'open';
import clack from '../utils/clack.js';
import { getActiveEnvironment, isUnclaimedEnvironment, markEnvironmentClaimed } from '../lib/config-store.js';
import { createClaimNonce, UnclaimedEnvApiError } from '../lib/unclaimed-env-api.js';
Expand Down
5 changes: 5 additions & 0 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { readFileSync, existsSync } from 'node:fs';
import { resolve } from 'node:path';
import { parse as parseYaml } from 'yaml';
import chalk from 'chalk';
import { IS_WINDOWS, SPAWN_OPTS } from '../utils/platform.js';

export interface DevArgs {
port: number;
Expand Down Expand Up @@ -122,6 +123,7 @@ export async function runDev(argv: DevArgs): Promise<void> {
...process.env,
...buildDevEnv(emulator.url, emulator.apiKey),
},
...SPAWN_OPTS,
});
} catch {
console.error(chalk.red(`Failed to start: ${devCmd.command} ${devCmd.args.join(' ')}`));
Expand Down Expand Up @@ -149,6 +151,9 @@ export async function runDev(argv: DevArgs): Promise<void> {
};
process.on('SIGINT', () => shutdown('SIGINT'));
process.on('SIGTERM', () => shutdown('SIGTERM'));
if (IS_WINDOWS) {
process.on('SIGBREAK', () => shutdown('SIGINT'));
}

// 6. If child exits, close emulator and exit with same code
child.on('exit', (code) => {
Expand Down
4 changes: 4 additions & 0 deletions src/commands/emulate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { readFileSync, existsSync } from 'node:fs';
import { resolve } from 'node:path';
import { parse as parseYaml } from 'yaml';
import chalk from 'chalk';
import { IS_WINDOWS } from '../utils/platform.js';

export interface EmulateArgs {
port: number;
Expand Down Expand Up @@ -75,4 +76,7 @@ export async function runEmulate(argv: EmulateArgs): Promise<void> {
};
process.once('SIGINT', shutdown);
process.once('SIGTERM', shutdown);
if (IS_WINDOWS) {
process.once('SIGBREAK', shutdown);
}
}
12 changes: 7 additions & 5 deletions src/commands/install-skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { existsSync } from 'fs';
import { mkdir, mkdtemp, cp, rename, rm, readdir, readFile, stat, access, writeFile } from 'fs/promises';
import chalk from 'chalk';
import { getSkillsDir as getSkillsPackageDir } from '@workos/skills';
import { IS_WINDOWS } from '../utils/platform.js';

export const SKILL_VERSION_MARKER_FILENAME = '.workos-skill-version';

Expand Down Expand Up @@ -48,30 +49,31 @@ export interface AgentConfig {
}

export function createAgents(home: string): Record<string, AgentConfig> {
const appData = process.env.APPDATA ?? join(home, 'AppData', 'Roaming');
return {
'claude-code': {
name: 'claude-code',
displayName: 'Claude Code',
globalSkillsDir: join(home, '.claude/skills'),
globalSkillsDir: join(home, '.claude', 'skills'),
detect: () => existsSync(join(home, '.claude')),
},
codex: {
name: 'codex',
displayName: 'Codex',
globalSkillsDir: join(home, '.codex/skills'),
globalSkillsDir: join(home, '.codex', 'skills'),
detect: () => existsSync(join(home, '.codex')),
},
cursor: {
name: 'cursor',
displayName: 'Cursor',
globalSkillsDir: join(home, '.cursor/skills'),
globalSkillsDir: join(home, '.cursor', 'skills'),
detect: () => existsSync(join(home, '.cursor')),
},
goose: {
name: 'goose',
displayName: 'Goose',
globalSkillsDir: join(home, '.config/goose/skills'),
detect: () => existsSync(join(home, '.config/goose')),
globalSkillsDir: IS_WINDOWS ? join(appData, 'goose', 'skills') : join(home, '.config', 'goose', 'skills'),
detect: () => (IS_WINDOWS ? existsSync(join(appData, 'goose')) : existsSync(join(home, '.config', 'goose'))),
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from 'node:path';
import { tmpdir } from 'node:os';

const mockOpen = vi.fn();
vi.mock('opn', () => ({ default: (...args: unknown[]) => mockOpen(...args) }));
vi.mock('open', () => ({ default: (...args: unknown[]) => mockOpen(...args) }));

class MockDeviceAuthTimeoutError extends Error {}
const mockRequestDeviceCode = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/commands/login.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import open from 'opn';
import open from 'open';
import chalk from 'chalk';
import clack from '../utils/clack.js';
import { saveCredentials, getCredentials, getAccessToken, isTokenExpired, updateTokens } from '../lib/credentials.js';
Expand Down
Loading
Loading