duoops 0.2.7 → 0.2.8

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.
@@ -1,5 +1,5 @@
1
1
  import { BigQuery } from '@google-cloud/bigquery';
2
- import { confirm, input, password, select } from '@inquirer/prompts';
2
+ import { checkbox, confirm, input, password, select } from '@inquirer/prompts';
3
3
  import { Command } from '@oclif/core';
4
4
  import axios from 'axios';
5
5
  import { bold, gray, green, yellow } from 'kleur/colors';
@@ -310,9 +310,16 @@ export default class Init extends Command {
310
310
  message: 'GitLab Personal Access Token',
311
311
  });
312
312
  }
313
- const enableMeasure = await confirm({
314
- message: 'Enable Measure/Sustainability Tracking (BigQuery)?',
313
+ const features = await checkbox({
314
+ choices: [
315
+ { checked: true, name: 'Carbon measurement (BigQuery)', value: 'measure' },
316
+ { checked: true, name: 'Duo agents and flows', value: 'agents' },
317
+ { checked: true, name: 'MCP server (Cloud Run)', value: 'mcp' },
318
+ { checked: true, name: 'CI project wiring (variables + runner)', value: 'ci' },
319
+ ],
320
+ message: 'What would you like to set up?',
315
321
  });
322
+ const enableMeasure = features.includes('measure');
316
323
  let bigqueryDataset;
317
324
  let bigqueryTable;
318
325
  let googleProjectId;
@@ -384,11 +391,7 @@ export default class Init extends Command {
384
391
  };
385
392
  configManager.set(config);
386
393
  this.log(green('Configuration saved.'));
387
- const setupAgents = await confirm({
388
- default: true,
389
- message: 'Set up DuoOps agents and flows in this project?',
390
- });
391
- if (setupAgents) {
394
+ if (features.includes('agents')) {
392
395
  const { scaffoldProject } = await import('../lib/scaffold.js');
393
396
  const result = scaffoldProject(process.cwd());
394
397
  for (const f of result.created) {
@@ -399,30 +402,20 @@ export default class Init extends Command {
399
402
  }
400
403
  }
401
404
  this.log(`\nTry '${this.config.bin} pipelines:list <project>' to verify GitLab access.\n`);
402
- if (enableMeasure) {
403
- const deployMcp = await confirm({
404
- default: true,
405
- message: 'Deploy the DuoOps MCP Server to Cloud Run now?',
406
- });
407
- if (deployMcp && googleProjectId && bigqueryDataset && bigqueryTable) {
408
- try {
409
- await McpDeploy.run([
410
- '--gcp-project', googleProjectId,
411
- '--bq-dataset', bigqueryDataset,
412
- '--bq-table', bigqueryTable,
413
- '--gitlab-url', gitlabUrl,
414
- ]);
415
- }
416
- catch (error) {
417
- this.warn(`MCP Deployment failed: ${error}`);
418
- }
405
+ if (features.includes('mcp') && googleProjectId && bigqueryDataset && bigqueryTable) {
406
+ try {
407
+ await McpDeploy.run([
408
+ '--gcp-project', googleProjectId,
409
+ '--bq-dataset', bigqueryDataset,
410
+ '--bq-table', bigqueryTable,
411
+ '--gitlab-url', gitlabUrl,
412
+ ]);
413
+ }
414
+ catch (error) {
415
+ this.warn(`MCP Deployment failed: ${error}`);
419
416
  }
420
417
  }
421
- const configureProject = await confirm({
422
- default: true,
423
- message: 'Configure a GitLab project (CI variables + optional GCP runner) now?',
424
- });
425
- if (!configureProject) {
418
+ if (!features.includes('ci')) {
426
419
  return;
427
420
  }
428
421
  const updatedDefaultProject = await this.configureGitLabProject({ baseUrl: gitlabUrl, token: gitlabToken }, config.defaultProjectId);
@@ -669,5 +669,5 @@
669
669
  ]
670
670
  }
671
671
  },
672
- "version": "0.2.7"
672
+ "version": "0.2.8"
673
673
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duoops",
3
3
  "description": "Toolset for Explainable and Sustainable CI on Gitlab.",
4
- "version": "0.2.7",
4
+ "version": "0.2.8",
5
5
  "author": "Younes Laaroussi",
6
6
  "bin": {
7
7
  "duoops": "./bin/run.js"