Skip to content
Open
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ When creating your personal API key, ensure it has the following scopes enabled:

- `user:read` - Required to fetch user information
- `project:read` - Required to fetch project details and API token
- `introspection` - Required for API introspection
- `llm_gateway:read` - Required for LLM gateway access
- `dashboard:write` - Required to create dashboards
- `insight:write` - Required to create insights
Expand Down
29 changes: 7 additions & 22 deletions bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { hideBin } from 'yargs/helpers';
import { VERSION } from '@lib/version';

const WIZARD_VERSION = VERSION;

Check warning on line 8 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe assignment of an `any` value

const NODE_VERSION_RANGE = '>=18.17.0';

Expand All @@ -22,10 +22,7 @@
import { isNonInteractiveEnvironment } from '@utils/environment';
import { getUI, setUI } from '@ui';
import { LoggingUI } from '@ui/logging-ui';
import {
getSubcommandPrograms,
Program,
} from '@lib/programs/program-registry';
import { getSubcommandPrograms, Program } from '@lib/programs/program-registry';
import type { ProgramConfig } from '@lib/programs/program-step';
import type { WizardSession } from '@lib/wizard-session';
import { POSTHOG_DOCS_URL } from '@lib/constants';
Expand Down Expand Up @@ -364,7 +361,7 @@
const { startPlayground } = await import(
'@ui/tui/playground/start-playground'
);
(startPlayground as (version: string) => void)(WIZARD_VERSION);

Check warning on line 364 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe argument of type `any` assigned to a parameter of type `string`
})();
} else if (options.skill) {
// Run a specific skill by ID
Expand Down Expand Up @@ -431,19 +428,15 @@
.map((s) => s.trim())
.filter(Boolean);
void (async () => {
const { readApiKeyFromEnv } = await import(
'@utils/env-api-key'
);
const { readApiKeyFromEnv } = await import('@utils/env-api-key');
const apiKey =
(options.apiKey as string | undefined) || readApiKeyFromEnv();

try {
const { startTUI } = await import('@ui/tui/start-tui');
const { buildSession } = await import(
'@lib/wizard-session'
);
const { buildSession } = await import('@lib/wizard-session');

const tui = startTUI(WIZARD_VERSION, Program.McpAdd);

Check warning on line 439 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe argument of type `any` assigned to a parameter of type `string`
const session = buildSession({
debug: options.debug,
localMcp: options.local,
Expand Down Expand Up @@ -484,11 +477,9 @@
void (async () => {
try {
const { startTUI } = await import('@ui/tui/start-tui');
const { buildSession } = await import(
'@lib/wizard-session'
);
const { buildSession } = await import('@lib/wizard-session');

const tui = startTUI(WIZARD_VERSION, Program.McpRemove);

Check warning on line 482 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe argument of type `any` assigned to a parameter of type `string`
const session = buildSession({
debug: options.debug,
localMcp: options.local,
Expand Down Expand Up @@ -557,9 +548,7 @@

void (async () => {
try {
const { provisionNewAccount } = await import(
'@utils/provisioning'
);
const { provisionNewAccount } = await import('@utils/provisioning');
if (!jsonMode) {
getUI().log.info(`Provisioning account for ${email} in ${region}...`);
}
Expand Down Expand Up @@ -598,7 +587,7 @@
// ── Skill-based program subcommands (derived from registry) ─────────
for (const programConfig of getSubcommandPrograms()) {
cli.command(
programConfig.command!,

Check warning on line 590 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Forbidden non-null assertion
programConfig.description,
(y) =>
y.options({
Expand Down Expand Up @@ -649,7 +638,7 @@
);
const { analytics } = await import('@utils/analytics');

const tui = startTUI(WIZARD_VERSION, config.id as any);

Check warning on line 641 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

Check warning on line 641 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check warning on line 641 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe argument of type `any` assigned to a parameter of type `string`

const session = buildSession({
debug: options.debug as boolean | undefined,
Expand All @@ -662,7 +651,7 @@
projectId: options.projectId as string | undefined,
email: options.email as string | undefined,
menu: options.menu as boolean | undefined,
integration: options.integration as any,

Check warning on line 654 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

Check warning on line 654 in bin.ts

View workflow job for this annotation

GitHub Actions / Lint

Unsafe assignment of an `any` value
benchmark: options.benchmark as boolean | undefined,
yaraReport: options.yaraReport as boolean | undefined,
});
Expand Down Expand Up @@ -690,9 +679,7 @@
const skipAgent = config.run == null;

if (skipAgent) {
const { getOrAskForProjectData } = await import(
'@utils/setup-utils'
);
const { getOrAskForProjectData } = await import('@utils/setup-utils');
const { projectApiKey, host, accessToken, projectId } =
await getOrAskForProjectData({
signup: session.signup,
Expand Down Expand Up @@ -780,9 +767,7 @@
const { configureLogFileFromEnvironment, logToFile } = await import(
'@utils/debug'
);
const { wizardAbort, WizardError } = await import(
'@utils/wizard-abort'
);
const { wizardAbort, WizardError } = await import('@utils/wizard-abort');

configureLogFileFromEnvironment();

Expand Down
10 changes: 6 additions & 4 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ export const WIZARD_PROVISIONING_SCOPES = [

/**
* Scopes the wizard requests during the OAuth login flow. Superset of
* `WIZARD_PROVISIONING_SCOPES` with two scopes that only apply to the login
* path and are not in the provisioning allowlist:
* - introspection lets the wizard introspect its own token
* `WIZARD_PROVISIONING_SCOPES` with one extra scope that only applies to the
* login path and is not in the provisioning allowlist:
* - health_issue:read used by `wizard doctor`
*
* Note: `introspection` is intentionally absent. Per RFC 7662 it is the token
* introspection endpoint, not a grantable scope, and the authorization server
* rejects it as `invalid_scope`. Introspection still works via the bearer token.
*/
export const WIZARD_OAUTH_SCOPES = [
...WIZARD_PROVISIONING_SCOPES,
'introspection',
'health_issue:read',
] as const;

Expand Down
5 changes: 4 additions & 1 deletion src/ui/tui/components/LearnCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import type { WizardStore } from '@ui/tui/store';
import { ContentSequencer, TextRevealMode } from '@ui/tui/primitives/index';
import type { ContentBlock } from '@ui/tui/primitives/index';
import { useStdoutDimensions } from '@ui/tui/hooks/useStdoutDimensions';
import { COLLAPSED_COUNT, EXPANDED_COUNT } from '@ui/tui/primitives/TabContainer';
import {
COLLAPSED_COUNT,
EXPANDED_COUNT,
} from '@ui/tui/primitives/TabContainer';

/** Fixed chrome: ScreenContainer (3) + TabContainer tab bar (2) */
const FIXED_CHROME = 5;
Expand Down
5 changes: 1 addition & 4 deletions src/ui/tui/components/TipsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import { Box, Text, useInput } from 'ink';
import type { WizardStore } from '@ui/tui/store';
import { Colors, Icons } from '@ui/tui/styles';
import {
DiscoveredFeature,
AdditionalFeature,
} from '@lib/wizard-session';
import { DiscoveredFeature, AdditionalFeature } from '@lib/wizard-session';

/** A discrete tip shown in the TipsCard during the agent run. */
interface Tip {
Expand Down
9 changes: 7 additions & 2 deletions src/ui/tui/screens/McpScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import {
GroupedPickerMenu,
} from '@ui/tui/primitives/index';
import { Colors } from '@ui/tui/styles';
import type { McpInstaller, McpClientInfo } from '@ui/tui/services/mcp-installer';
import type {
McpInstaller,
McpClientInfo,
} from '@ui/tui/services/mcp-installer';
import {
AVAILABLE_FEATURES,
ALL_FEATURE_VALUES,
Expand Down Expand Up @@ -235,7 +238,9 @@ export const McpScreen = ({
<>
<Text color="green" bold>
{'\u2714'} MCP server
{!isRemove && pluginClients.length > 0 ? ' and plugin' : ''}{' '}
{!isRemove && pluginClients.length > 0
? ' and plugin'
: ''}{' '}
{isRemove ? 'removed from' : 'installed for'}:
</Text>
{resultClients.map((name, i) => (
Expand Down
19 changes: 7 additions & 12 deletions src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import { spawnSync } from 'node:child_process';
import type { ReactNode } from 'react';
import { useEffect, useState, useSyncExternalStore } from 'react';
import type { WizardStore } from '@ui/tui/store';
import {
Integration,
WIZARD_TOOLS_MENU_FLAG_KEY,
} from '@lib/constants';
import { Integration, WIZARD_TOOLS_MENU_FLAG_KEY } from '@lib/constants';
import { PickerMenu, LoadingBox } from '@ui/tui/primitives/index';
import { IntroScreenLayout, type DetectionRow } from './IntroScreenLayout.js';
import { SkillSourceInfo, useSkillEntry } from './SkillSourceInfo.js';
Expand Down Expand Up @@ -60,14 +57,12 @@ const FrameworkPicker = ({
options={options}
onSelect={(value) => {
const integration = Array.isArray(value) ? value[0] : value;
void import('@lib/registry').then(
({ FRAMEWORK_REGISTRY }) => {
const config = FRAMEWORK_REGISTRY[integration];
store.setFrameworkConfig(integration, config);
store.setDetectedFramework(config.metadata.name);
onComplete?.();
},
);
void import('@lib/registry').then(({ FRAMEWORK_REGISTRY }) => {
const config = FRAMEWORK_REGISTRY[integration];
store.setFrameworkConfig(integration, config);
store.setDetectedFramework(config.metadata.name);
onComplete?.();
});
}}
/>
);
Expand Down
5 changes: 1 addition & 4 deletions src/ui/tui/screens/audit-3000/Audit3000ChecksPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

import { Box, Text } from 'ink';
import { Spinner } from '@inkjs/ui';
import {
type AuditCheck,
type AuditStatus,
} from '@lib/programs/audit/types';
import { type AuditCheck, type AuditStatus } from '@lib/programs/audit/types';
import { Colors, Icons } from '@ui/tui/styles';
import { LoadingBox } from '@ui/tui/primitives/index';

Expand Down
5 changes: 4 additions & 1 deletion src/ui/tui/screens/audit-3000/Audit3000IntroScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { Box, Text } from 'ink';
import { useEffect, useState, useSyncExternalStore } from 'react';
import type { WizardStore } from '@ui/tui/store';
import { IntroScreenLayout } from '@ui/tui/screens/IntroScreenLayout';
import { SkillSourceInfo, useSkillEntry } from '@ui/tui/screens/SkillSourceInfo';
import {
SkillSourceInfo,
useSkillEntry,
} from '@ui/tui/screens/SkillSourceInfo';
import { NEON_BLUE, NEON_GOLD, NEON_PINK } from './arcade-colors.js';

const AUDIT3000_SKILL_ID = 'audit-3000';
Expand Down
5 changes: 1 addition & 4 deletions src/ui/tui/screens/audit/AuditChecksViewer/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Box, Text } from 'ink';
import type {
AuditCheck,
AuditStatus,
} from '@lib/programs/audit/types';
import type { AuditCheck, AuditStatus } from '@lib/programs/audit/types';
import type { ViewerLayout } from './layout.js';

interface HeaderProps {
Expand Down
5 changes: 4 additions & 1 deletion src/ui/tui/screens/audit/AuditIntroScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { Box, Text } from 'ink';
import { useState, useSyncExternalStore } from 'react';
import type { WizardStore } from '@ui/tui/store';
import { IntroScreenLayout } from '@ui/tui/screens/IntroScreenLayout';
import { SkillSourceInfo, useSkillEntry } from '@ui/tui/screens/SkillSourceInfo';
import {
SkillSourceInfo,
useSkillEntry,
} from '@ui/tui/screens/SkillSourceInfo';

interface AuditIntroScreenProps {
store: WizardStore;
Expand Down
Loading