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.
- package/dist/commands/init.js +23 -30
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -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
|
|
314
|
-
|
|
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
|
-
|
|
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 (
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
-
|
|
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);
|
package/oclif.manifest.json
CHANGED