@inspecto-dev/cli 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-test.log +5160 -92
- package/CHANGELOG.md +20 -0
- package/README.md +126 -6
- package/dist/bin.js +59 -361
- package/dist/{chunk-PSYZB5GI.js → chunk-LJOKPCPD.js} +1389 -91
- package/dist/index.d.ts +74 -1
- package/dist/index.js +3 -1
- package/package.json +2 -2
- package/src/bin.ts +85 -6
- package/src/commands/integration-automation.ts +485 -0
- package/src/commands/integration-dispatch-mode.ts +92 -0
- package/src/commands/integration-doctor.ts +117 -0
- package/src/commands/integration-host-ide.ts +156 -0
- package/src/commands/integration-install.ts +262 -101
- package/src/commands/onboard.ts +19 -0
- package/src/index.ts +1 -0
- package/src/inject/extension.ts +144 -24
- package/src/integrations/capabilities.ts +131 -0
- package/src/utils/process.ts +3 -0
- package/tests/extension-installer.test.ts +205 -0
- package/tests/install-wrapper.test.ts +45 -4
- package/tests/integration-automation.test.ts +491 -0
- package/tests/integration-dispatch-mode.test.ts +203 -0
- package/tests/integration-doctor.test.ts +165 -0
- package/tests/integration-host-ide.test.ts +172 -0
- package/tests/integration-install.test.ts +282 -20
- package/tests/onboard.test.ts +118 -0
- package/tests/shared-capabilities.test.ts +45 -0
package/dist/index.d.ts
CHANGED
|
@@ -245,6 +245,79 @@ interface DoctorCommandOptions {
|
|
|
245
245
|
declare function collectDoctorResult(root?: string): Promise<DoctorResult>;
|
|
246
246
|
declare function doctor(options?: DoctorCommandOptions | boolean): Promise<DoctorResult>;
|
|
247
247
|
|
|
248
|
+
interface IntegrationAutomationOptions {
|
|
249
|
+
ide?: string;
|
|
250
|
+
inspectoVsix?: string;
|
|
251
|
+
preview?: boolean;
|
|
252
|
+
silent?: boolean;
|
|
253
|
+
}
|
|
254
|
+
interface IntegrationAutomationDetails {
|
|
255
|
+
hostIde?: {
|
|
256
|
+
id: string | null;
|
|
257
|
+
label?: string;
|
|
258
|
+
source?: string;
|
|
259
|
+
confidence: string;
|
|
260
|
+
candidates: string[];
|
|
261
|
+
};
|
|
262
|
+
inspectoExtension?: {
|
|
263
|
+
source: 'marketplace' | 'local_vsix';
|
|
264
|
+
reference: string;
|
|
265
|
+
binaryAvailable?: boolean;
|
|
266
|
+
binaryPath?: string | null;
|
|
267
|
+
status?: string;
|
|
268
|
+
};
|
|
269
|
+
runtime?: {
|
|
270
|
+
assistant: string;
|
|
271
|
+
ready: boolean;
|
|
272
|
+
mode: string | null;
|
|
273
|
+
};
|
|
274
|
+
workspace?: {
|
|
275
|
+
path?: string;
|
|
276
|
+
attempted: boolean;
|
|
277
|
+
opened?: boolean;
|
|
278
|
+
};
|
|
279
|
+
onboarding?: {
|
|
280
|
+
uri: string;
|
|
281
|
+
autoSend: boolean;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
interface IntegrationAutomationResult {
|
|
285
|
+
status: 'launched' | 'partial' | 'blocked' | 'preview' | 'preview_blocked';
|
|
286
|
+
message: string;
|
|
287
|
+
nextStep?: string;
|
|
288
|
+
details?: IntegrationAutomationDetails;
|
|
289
|
+
}
|
|
290
|
+
declare function runIntegrationAutomation(assistant: string, options?: IntegrationAutomationOptions, cwd?: string): Promise<IntegrationAutomationResult>;
|
|
291
|
+
|
|
292
|
+
type ClaudeScope = 'project' | 'user';
|
|
293
|
+
type CopilotMode = 'skills' | 'instructions' | 'agents';
|
|
294
|
+
type CursorMode = 'skills' | 'rules' | 'agents';
|
|
295
|
+
interface InstallIntegrationOptions {
|
|
296
|
+
scope?: ClaudeScope;
|
|
297
|
+
mode?: CopilotMode | CursorMode;
|
|
298
|
+
force?: boolean;
|
|
299
|
+
ide?: string;
|
|
300
|
+
inspectoVsix?: string;
|
|
301
|
+
compact?: boolean;
|
|
302
|
+
preview?: boolean;
|
|
303
|
+
json?: boolean;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface IntegrationDoctorOptions extends Pick<InstallIntegrationOptions, 'scope' | 'mode' | 'ide' | 'inspectoVsix' | 'json'> {
|
|
307
|
+
compact?: boolean;
|
|
308
|
+
failOnBlocked?: boolean;
|
|
309
|
+
}
|
|
310
|
+
interface IntegrationDoctorResult {
|
|
311
|
+
schemaVersion: string;
|
|
312
|
+
status: 'ok' | 'blocked';
|
|
313
|
+
assistant: string;
|
|
314
|
+
assets: string[];
|
|
315
|
+
message: string;
|
|
316
|
+
nextStep?: string;
|
|
317
|
+
automation: Awaited<ReturnType<typeof runIntegrationAutomation>>;
|
|
318
|
+
}
|
|
319
|
+
declare function integrationDoctor(assistant: string, options?: IntegrationDoctorOptions): Promise<IntegrationDoctorResult>;
|
|
320
|
+
|
|
248
321
|
interface OnboardCommandOptions {
|
|
249
322
|
json?: boolean;
|
|
250
323
|
target?: string;
|
|
@@ -269,4 +342,4 @@ declare function reportCommandError(error: unknown, options?: ReportCommandError
|
|
|
269
342
|
|
|
270
343
|
type Framework = 'react' | 'vue';
|
|
271
344
|
|
|
272
|
-
export { type BuildTool, type DoctorDiagnostic, type DoctorResult, type Framework, type InitOptions, type InstallLock, type OnboardCommandResult, type OnboardStatus, type PackageManager, type ResolvedOnboardingSession, apply, collectDoctorResult, detect, doctor, init, onboard, plan, reportCommandError, teardown, writeCommandOutput };
|
|
345
|
+
export { type BuildTool, type DoctorDiagnostic, type DoctorResult, type Framework, type InitOptions, type InstallLock, type OnboardCommandResult, type OnboardStatus, type PackageManager, type ResolvedOnboardingSession, apply, collectDoctorResult, detect, doctor, init, integrationDoctor, onboard, plan, reportCommandError, teardown, writeCommandOutput };
|
package/dist/index.js
CHANGED
|
@@ -4,18 +4,20 @@ import {
|
|
|
4
4
|
detect,
|
|
5
5
|
doctor,
|
|
6
6
|
init,
|
|
7
|
+
integrationDoctor,
|
|
7
8
|
onboard,
|
|
8
9
|
plan,
|
|
9
10
|
reportCommandError,
|
|
10
11
|
teardown,
|
|
11
12
|
writeCommandOutput
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LJOKPCPD.js";
|
|
13
14
|
export {
|
|
14
15
|
apply,
|
|
15
16
|
collectDoctorResult,
|
|
16
17
|
detect,
|
|
17
18
|
doctor,
|
|
18
19
|
init,
|
|
20
|
+
integrationDoctor,
|
|
19
21
|
onboard,
|
|
20
22
|
plan,
|
|
21
23
|
reportCommandError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inspecto-dev/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "CLI tools for Inspecto onboarding and lifecycle management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"inspecto",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"ora": "^9.3.0",
|
|
21
21
|
"picocolors": "^1.0.0",
|
|
22
22
|
"prompts": "^2.4.2",
|
|
23
|
-
"@inspecto-dev/types": "0.3.
|
|
23
|
+
"@inspecto-dev/types": "0.3.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^20.0.0",
|
package/src/bin.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
printIntegrationList,
|
|
20
20
|
printIntegrationPath,
|
|
21
21
|
} from './commands/integration-install.js'
|
|
22
|
+
import { integrationDoctor } from './commands/integration-doctor.js'
|
|
22
23
|
import { reportCommandError } from './utils/output.js'
|
|
23
24
|
|
|
24
25
|
const require = createRequire(import.meta.url)
|
|
@@ -58,14 +59,18 @@ interface OnboardCliOptions extends JsonCommandOptions {
|
|
|
58
59
|
extension?: boolean
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
interface IntegrationCommandOptions extends
|
|
62
|
+
interface IntegrationCommandOptions extends JsonCommandOptions {
|
|
62
63
|
scope?: string
|
|
63
64
|
mode?: string
|
|
65
|
+
hostIde?: string
|
|
66
|
+
inspectoVsix?: string
|
|
67
|
+
compact?: boolean
|
|
68
|
+
preview?: boolean
|
|
64
69
|
force?: boolean
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
const integrationScopes = ['project', 'user'] as const
|
|
68
|
-
const integrationModes = ['instructions', 'agents', 'rules'] as const
|
|
73
|
+
const integrationModes = ['skills', 'instructions', 'agents', 'rules'] as const
|
|
69
74
|
|
|
70
75
|
function exitWithError(error: unknown, options: JsonCommandOptions = {}): never {
|
|
71
76
|
reportCommandError(error, {
|
|
@@ -205,14 +210,19 @@ export function createCli(_argv: readonly string[] = process.argv): CAC {
|
|
|
205
210
|
|
|
206
211
|
cli
|
|
207
212
|
.command('integrations [...args]', 'Manage assistant integration assets')
|
|
213
|
+
.option('--json', 'Print machine-readable JSON output', { default: false })
|
|
208
214
|
.option(
|
|
209
215
|
'--scope <scope>',
|
|
210
216
|
'Set install scope for supported assistants (e.g. claude-code: project|user)',
|
|
211
217
|
)
|
|
212
218
|
.option(
|
|
213
219
|
'--mode <mode>',
|
|
214
|
-
'Set install mode for supported assistants (e.g. copilot: instructions|agents)',
|
|
220
|
+
'Set install mode for supported assistants (e.g. copilot: skills|instructions|agents)',
|
|
215
221
|
)
|
|
222
|
+
.option('--host-ide <ide>', 'Choose the host IDE for automatic extension install and launch')
|
|
223
|
+
.option('--inspecto-vsix <path>', 'Install the Inspecto extension from a local .vsix path')
|
|
224
|
+
.option('--compact', 'Print a shorter text summary for integration doctor')
|
|
225
|
+
.option('--preview', 'Preview integration changes and IDE automation without executing them')
|
|
216
226
|
.option('--force', 'Overwrite existing integration files', { default: false })
|
|
217
227
|
.option('--debug', 'Enable debug mode to show full error traces', { default: false })
|
|
218
228
|
.action(async (args: string[], options: IntegrationCommandOptions) => {
|
|
@@ -221,9 +231,20 @@ export function createCli(_argv: readonly string[] = process.argv): CAC {
|
|
|
221
231
|
const integrationOptions = buildIntegrationOptions(options)
|
|
222
232
|
|
|
223
233
|
if (subcommand === 'list') {
|
|
224
|
-
if (
|
|
234
|
+
if (
|
|
235
|
+
assistant ||
|
|
236
|
+
rest.length > 0 ||
|
|
237
|
+
options.scope ||
|
|
238
|
+
options.mode ||
|
|
239
|
+
options.hostIde ||
|
|
240
|
+
options.inspectoVsix ||
|
|
241
|
+
options.compact ||
|
|
242
|
+
options.json ||
|
|
243
|
+
options.preview ||
|
|
244
|
+
options.force
|
|
245
|
+
) {
|
|
225
246
|
throw new Error(
|
|
226
|
-
'The `list` subcommand does not accept assistant names, --scope, --mode, or --force.',
|
|
247
|
+
'The `list` subcommand does not accept assistant names, --scope, --mode, --host-ide, --inspecto-vsix, --compact, --json, --preview, or --force.',
|
|
227
248
|
)
|
|
228
249
|
}
|
|
229
250
|
|
|
@@ -240,17 +261,55 @@ export function createCli(_argv: readonly string[] = process.argv): CAC {
|
|
|
240
261
|
throw new Error('The `path` subcommand does not support `--force`.')
|
|
241
262
|
}
|
|
242
263
|
|
|
264
|
+
if (options.hostIde) {
|
|
265
|
+
throw new Error('The `path` subcommand does not support `--host-ide`.')
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (options.inspectoVsix) {
|
|
269
|
+
throw new Error('The `path` subcommand does not support `--inspecto-vsix`.')
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (options.preview) {
|
|
273
|
+
throw new Error('The `path` subcommand does not support `--preview`.')
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (options.compact) {
|
|
277
|
+
throw new Error('The `path` subcommand does not support `--compact`.')
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (options.json) {
|
|
281
|
+
throw new Error('The `path` subcommand does not support `--json`.')
|
|
282
|
+
}
|
|
283
|
+
|
|
243
284
|
printIntegrationPath(assistant, integrationOptions)
|
|
244
285
|
return
|
|
245
286
|
}
|
|
246
287
|
|
|
288
|
+
if (subcommand === 'doctor' && assistant) {
|
|
289
|
+
if (rest.length > 0) {
|
|
290
|
+
throw new Error('The `doctor` subcommand accepts exactly one assistant argument.')
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (options.force) {
|
|
294
|
+
throw new Error('The `doctor` subcommand does not support `--force`.')
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (options.preview) {
|
|
298
|
+
throw new Error('The `doctor` subcommand does not support `--preview`.')
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
await integrationDoctor(assistant, { ...integrationOptions, failOnBlocked: true })
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
|
|
247
305
|
if (subcommand !== 'install' || !assistant) {
|
|
248
306
|
throw new Error(
|
|
249
307
|
[
|
|
250
308
|
'Usage:',
|
|
251
309
|
' inspecto integrations list',
|
|
252
310
|
' inspecto integrations path <assistant> [--scope <scope>] [--mode <mode>]',
|
|
253
|
-
' inspecto integrations
|
|
311
|
+
' inspecto integrations doctor <assistant> [--scope <scope>] [--mode <mode>] [--host-ide <ide>] [--inspecto-vsix <path>] [--compact] [--json]',
|
|
312
|
+
' inspecto integrations install <assistant> [--scope <scope>] [--mode <mode>] [--host-ide <ide>] [--inspecto-vsix <path>] [--preview] [--json] [--force]',
|
|
254
313
|
].join('\n'),
|
|
255
314
|
)
|
|
256
315
|
}
|
|
@@ -293,6 +352,26 @@ function buildIntegrationOptions(options: IntegrationCommandOptions): InstallInt
|
|
|
293
352
|
}
|
|
294
353
|
}
|
|
295
354
|
|
|
355
|
+
if (options.hostIde) {
|
|
356
|
+
resolved.ide = options.hostIde
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (options.inspectoVsix) {
|
|
360
|
+
resolved.inspectoVsix = options.inspectoVsix
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (options.compact) {
|
|
364
|
+
resolved.compact = options.compact
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (options.preview) {
|
|
368
|
+
resolved.preview = options.preview
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (options.json) {
|
|
372
|
+
resolved.json = options.json
|
|
373
|
+
}
|
|
374
|
+
|
|
296
375
|
return resolved
|
|
297
376
|
}
|
|
298
377
|
|