@newpeak/barista-cli 0.2.199 → 0.2.205
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/liberica/teams/fp-config/index.d.ts +3 -0
- package/dist/commands/liberica/teams/fp-config/index.d.ts.map +1 -0
- package/dist/commands/liberica/teams/fp-config/index.js +15 -0
- package/dist/commands/liberica/teams/fp-config/index.js.map +1 -0
- package/dist/commands/liberica/teams/fp-config/list.d.ts +3 -0
- package/dist/commands/liberica/teams/fp-config/list.d.ts.map +1 -0
- package/dist/commands/liberica/teams/fp-config/list.js +43 -0
- package/dist/commands/liberica/teams/fp-config/list.js.map +1 -0
- package/dist/commands/liberica/teams/fp-config/reset.d.ts +3 -0
- package/dist/commands/liberica/teams/fp-config/reset.d.ts.map +1 -0
- package/dist/commands/liberica/teams/fp-config/reset.js +48 -0
- package/dist/commands/liberica/teams/fp-config/reset.js.map +1 -0
- package/dist/commands/liberica/teams/fp-config/set-project.d.ts +3 -0
- package/dist/commands/liberica/teams/fp-config/set-project.d.ts.map +1 -0
- package/dist/commands/liberica/teams/fp-config/set-project.js +56 -0
- package/dist/commands/liberica/teams/fp-config/set-project.js.map +1 -0
- package/dist/commands/liberica/teams/fp-config/set-team.d.ts +3 -0
- package/dist/commands/liberica/teams/fp-config/set-team.d.ts.map +1 -0
- package/dist/commands/liberica/teams/fp-config/set-team.js +65 -0
- package/dist/commands/liberica/teams/fp-config/set-team.js.map +1 -0
- package/dist/commands/liberica/teams/index.d.ts.map +1 -1
- package/dist/commands/liberica/teams/index.js +2 -0
- package/dist/commands/liberica/teams/index.js.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-actual.d.ts.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-actual.js +17 -21
- package/dist/commands/liberica/teams/issues/fp-actual.js.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-calibrate.d.ts +4 -0
- package/dist/commands/liberica/teams/issues/fp-calibrate.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/fp-calibrate.js +175 -0
- package/dist/commands/liberica/teams/issues/fp-calibrate.js.map +1 -0
- package/dist/commands/liberica/teams/issues/fp-estimate.d.ts.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-estimate.js +18 -35
- package/dist/commands/liberica/teams/issues/fp-estimate.js.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-guide.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/fp-guide.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/fp-guide.js +199 -0
- package/dist/commands/liberica/teams/issues/fp-guide.js.map +1 -0
- package/dist/commands/liberica/teams/issues/fp-review.d.ts.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-review.js +15 -11
- package/dist/commands/liberica/teams/issues/fp-review.js.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-stats.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/fp-stats.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/fp-stats.js +126 -0
- package/dist/commands/liberica/teams/issues/fp-stats.js.map +1 -0
- package/dist/commands/liberica/teams/issues/fp-summary.d.ts.map +1 -1
- package/dist/commands/liberica/teams/issues/fp-summary.js +15 -23
- package/dist/commands/liberica/teams/issues/fp-summary.js.map +1 -1
- package/dist/commands/liberica/teams/issues/index.d.ts.map +1 -1
- package/dist/commands/liberica/teams/issues/index.js +10 -0
- package/dist/commands/liberica/teams/issues/index.js.map +1 -1
- package/dist/core/api/client.d.ts +12 -6
- package/dist/core/api/client.d.ts.map +1 -1
- package/dist/core/api/client.js +69 -12
- package/dist/core/api/client.js.map +1 -1
- package/dist/types/fp-config.d.ts +35 -0
- package/dist/types/fp-config.d.ts.map +1 -0
- package/dist/types/fp-config.js +2 -0
- package/dist/types/fp-config.js.map +1 -0
- package/dist/types/fp-evaluation.d.ts +23 -127
- package/dist/types/fp-evaluation.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/barista-cli/data/commands.json +39 -5
- package/skills/barista-cli/data/commands.yaml +30 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,qBAAqB,IAAI,OAAO,CAU/C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { createFpConfigListCommand } from './list.js';
|
|
3
|
+
import { createFpConfigSetProjectCommand } from './set-project.js';
|
|
4
|
+
import { createFpConfigSetTeamCommand } from './set-team.js';
|
|
5
|
+
import { createFpConfigResetCommand } from './reset.js';
|
|
6
|
+
export function createFpConfigCommand() {
|
|
7
|
+
const cmd = new Command('fp-config');
|
|
8
|
+
cmd.description('Manage FP configuration parameters');
|
|
9
|
+
cmd.addCommand(createFpConfigListCommand());
|
|
10
|
+
cmd.addCommand(createFpConfigSetProjectCommand());
|
|
11
|
+
cmd.addCommand(createFpConfigSetTeamCommand());
|
|
12
|
+
cmd.addCommand(createFpConfigResetCommand());
|
|
13
|
+
return cmd;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC,GAAG,CAAC,WAAW,CAAC,oCAAoC,CAAC,CAAC;IAEtD,GAAG,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAC5C,GAAG,CAAC,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAC;IAClD,GAAG,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC,CAAC;IAC/C,GAAG,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAE7C,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,yBAAyB,IAAI,OAAO,CAmDnD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
5
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
6
|
+
import { shouldUseJson } from '../../../../utils/output.js';
|
|
7
|
+
export function createFpConfigListCommand() {
|
|
8
|
+
const cmd = new Command('list');
|
|
9
|
+
cmd.description('List all FP configuration parameters');
|
|
10
|
+
cmd.option('--json', 'Output as JSON');
|
|
11
|
+
cmd.action(async (options) => {
|
|
12
|
+
const context = configManager.getCurrentContext();
|
|
13
|
+
const environment = options.env || context.environment;
|
|
14
|
+
const tenant = options.tenant || context.tenant;
|
|
15
|
+
const outputJson = shouldUseJson(options);
|
|
16
|
+
const response = await apiClient.fpConfigGet(environment, tenant);
|
|
17
|
+
if (!response.success) {
|
|
18
|
+
if (outputJson) {
|
|
19
|
+
console.log(JSON.stringify(response));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.error(chalk.red(`\n✗ Error: ${response.error?.message || 'Unknown error'}\n`));
|
|
23
|
+
}
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
if (outputJson) {
|
|
27
|
+
console.log(JSON.stringify(response, null, 2));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const config = response.data || {};
|
|
31
|
+
const table = new Table({
|
|
32
|
+
head: [chalk.bold('Parameter'), chalk.bold('Value'), chalk.bold('Category')],
|
|
33
|
+
style: { head: ['cyan'] },
|
|
34
|
+
});
|
|
35
|
+
table.push([chalk.cyan('varianceThreshold'), config.varianceThreshold ?? '-', 'project'], [chalk.cyan('defaultMethod'), config.defaultMethod ?? '-', 'project'], [chalk.cyan('appType'), config.appType ?? '-', 'project'], [chalk.cyan('devType'), config.devType ?? '-', 'project'], [chalk.cyan('pdr'), config.pdr ?? '-', 'team'], [chalk.cyan('productivity'), config.productivity ?? '-', 'team'], [chalk.cyan('minFp'), config.minFp ?? '-', 'team'], [chalk.cyan('maxFp'), config.maxFp ?? '-', 'team'], [chalk.cyan('overloadDays'), config.overloadDays ?? '-', 'team'], [chalk.cyan('underloadDays'), config.underloadDays ?? '-', 'team'], [chalk.cyan('dailyHours'), config.dailyHours ?? '-', 'team']);
|
|
36
|
+
console.log(chalk.bold('\nFP Configuration Parameters'));
|
|
37
|
+
console.log(table.toString());
|
|
38
|
+
console.log();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return cmd;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE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C,YAAY,IAAI,GAAG,EAAE,MAAM,CAAC,EAChE,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,aAAa,IAAI,GAAG,EAAE,MAAM,CAAC,EAClE,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,UAAU,IAAI,GAAG,EAAE,MAAM,CAAC,CAC7D,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;YACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9B,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,0BAA0B,IAAI,OAAO,CA0CpD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
4
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
5
|
+
import { shouldUseJson } from '../../../../utils/output.js';
|
|
6
|
+
export function createFpConfigResetCommand() {
|
|
7
|
+
const cmd = new Command('reset');
|
|
8
|
+
cmd.description('Reset FP configuration to default values');
|
|
9
|
+
cmd.option('--project', 'Reset only project-level parameters');
|
|
10
|
+
cmd.option('--team', 'Reset only team-level parameters');
|
|
11
|
+
cmd.option('--json', 'Output as JSON');
|
|
12
|
+
cmd.action(async (options) => {
|
|
13
|
+
const context = configManager.getCurrentContext();
|
|
14
|
+
const environment = options.env || context.environment;
|
|
15
|
+
const tenant = options.tenant || context.tenant;
|
|
16
|
+
const outputJson = shouldUseJson(options);
|
|
17
|
+
const resetProject = options.project || (!options.project && !options.team);
|
|
18
|
+
const resetTeam = options.team || (!options.project && !options.team);
|
|
19
|
+
const response = await apiClient.fpConfigReset(environment, tenant);
|
|
20
|
+
if (!response.success) {
|
|
21
|
+
if (outputJson) {
|
|
22
|
+
console.log(JSON.stringify(response));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.error(chalk.red(`\n✗ Error: ${response.error?.message || 'Unknown error'}\n`));
|
|
26
|
+
}
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
if (outputJson) {
|
|
30
|
+
const result = { success: true };
|
|
31
|
+
if (resetProject)
|
|
32
|
+
result.projectReset = true;
|
|
33
|
+
if (resetTeam)
|
|
34
|
+
result.teamReset = true;
|
|
35
|
+
console.log(JSON.stringify(result));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const parts = [];
|
|
39
|
+
if (resetProject)
|
|
40
|
+
parts.push('project');
|
|
41
|
+
if (resetTeam)
|
|
42
|
+
parts.push('team');
|
|
43
|
+
console.log(chalk.green(`\n✓ ${parts.map(p => p.charAt(0).toUpperCase() + p.slice(1))} FP parameters reset to defaults\n`));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return cmd;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=reset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.js","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6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AAc,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,eAAe,IAAI,CAAC,CAAC,CAAC;YACzF,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,MAAM,GAA4B,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC1D,IAAI,YAAY;gBAAE,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAC7C,IAAI,SAAS;gBAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;YACvC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GAAa,EAAE,CAAC;YAC3B,IAAI,YAAY;gBAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxC,IAAI,SAAS;gBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAC9H,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-project.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/set-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,+BAA+B,IAAI,OAAO,CAkDzD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
4
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
5
|
+
import { shouldUseJson } from '../../../../utils/output.js';
|
|
6
|
+
export function createFpConfigSetProjectCommand() {
|
|
7
|
+
const cmd = new Command('set-project');
|
|
8
|
+
cmd.description('Set project-level FP parameters');
|
|
9
|
+
cmd.option('--variance-threshold <value>', 'Deviation threshold percentage (default: 30)');
|
|
10
|
+
cmd.option('--default-method <method>', 'Default evaluation method: INDICATIVE | ESTIMATED | DETAILED');
|
|
11
|
+
cmd.option('--app-type <type>', 'Application type: WEB | EMBEDDED | BATCH | API | MOBILE');
|
|
12
|
+
cmd.option('--dev-type <type>', 'Development type: NEW_DEV | ENHANCEMENT | CONVERSION');
|
|
13
|
+
cmd.option('--json', 'Output as JSON');
|
|
14
|
+
cmd.action(async (options) => {
|
|
15
|
+
const context = configManager.getCurrentContext();
|
|
16
|
+
const environment = options.env || context.environment;
|
|
17
|
+
const tenant = options.tenant || context.tenant;
|
|
18
|
+
const outputJson = shouldUseJson(options);
|
|
19
|
+
const data = {};
|
|
20
|
+
if (options.varianceThreshold !== undefined)
|
|
21
|
+
data.varianceThreshold = options.varianceThreshold;
|
|
22
|
+
if (options.defaultMethod !== undefined)
|
|
23
|
+
data.defaultMethod = options.defaultMethod;
|
|
24
|
+
if (options.appType !== undefined)
|
|
25
|
+
data.appType = options.appType;
|
|
26
|
+
if (options.devType !== undefined)
|
|
27
|
+
data.devType = options.devType;
|
|
28
|
+
if (Object.keys(data).length === 0) {
|
|
29
|
+
if (outputJson) {
|
|
30
|
+
console.log(JSON.stringify({ success: false, error: { code: 'NO_PARAMS', message: 'At least one parameter is required' } }));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
console.error(chalk.red('\n✗ Error: At least one parameter is required\n'));
|
|
34
|
+
}
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
const response = await apiClient.fpConfigSet(environment, tenant, data);
|
|
38
|
+
if (!response.success) {
|
|
39
|
+
if (outputJson) {
|
|
40
|
+
console.log(JSON.stringify(response));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.error(chalk.red(`\n✗ Error: ${response.error?.message || 'Unknown error'}\n`));
|
|
44
|
+
}
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
if (outputJson) {
|
|
48
|
+
console.log(JSON.stringify({ success: true, data }));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
console.log(chalk.green('\n✓ Project FP parameters updated successfully\n'));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return cmd;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=set-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-project.js","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/set-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,UAAU,+BAA+B;IAC7C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IACvC,GAAG,CAAC,WAAW,CAAC,iCAAiC,CAAC,CAAC;IAEnD,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,8CAA8C,CAAC,CAAC;IAC3F,GAAG,CAAC,MAAM,CAAC,2BAA2B,EAAE,8DAA8D,CAAC,CAAC;IACxG,GAAG,CAAC,MAAM,CAAC,mBAAmB,EAAE,yDAAyD,CAAC,CAAC;IAC3F,GAAG,CAAC,MAAM,CAAC,mBAAmB,EAAE,sDAAsD,CAAC,CAAC;IACxF,G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,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAExE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,eAAe,IAAI,CAAC,CAAC,CAAC;YACzF,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-team.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/set-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,4BAA4B,IAAI,OAAO,CAwDtD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
4
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
5
|
+
import { shouldUseJson } from '../../../../utils/output.js';
|
|
6
|
+
export function createFpConfigSetTeamCommand() {
|
|
7
|
+
const cmd = new Command('set-team');
|
|
8
|
+
cmd.description('Set team-level FP parameters');
|
|
9
|
+
cmd.option('--pdr <value>', 'Process Delivery Rate (hours/FP, default: 8.5)');
|
|
10
|
+
cmd.option('--productivity <value>', 'Relative baseline productivity (0.5-2.0, default: 1.0)');
|
|
11
|
+
cmd.option('--min-fp <value>', 'Minimum FP value per issue (default: 1)');
|
|
12
|
+
cmd.option('--max-fp <value>', 'Maximum FP value per issue (default: 999)');
|
|
13
|
+
cmd.option('--overload-days <value>', 'Overload threshold in days (default: 30)');
|
|
14
|
+
cmd.option('--underload-days <value>', 'Underload threshold in days (default: 5)');
|
|
15
|
+
cmd.option('--daily-hours <value>', 'Available daily working hours per person (default: 8)');
|
|
16
|
+
cmd.option('--json', 'Output as JSON');
|
|
17
|
+
cmd.action(async (options) => {
|
|
18
|
+
const context = configManager.getCurrentContext();
|
|
19
|
+
const environment = options.env || context.environment;
|
|
20
|
+
const tenant = options.tenant || context.tenant;
|
|
21
|
+
const outputJson = shouldUseJson(options);
|
|
22
|
+
const data = {};
|
|
23
|
+
if (options.pdr !== undefined)
|
|
24
|
+
data.pdr = options.pdr;
|
|
25
|
+
if (options.productivity !== undefined)
|
|
26
|
+
data.productivity = options.productivity;
|
|
27
|
+
if (options.minFp !== undefined)
|
|
28
|
+
data.minFp = options.minFp;
|
|
29
|
+
if (options.maxFp !== undefined)
|
|
30
|
+
data.maxFp = options.maxFp;
|
|
31
|
+
if (options.overloadDays !== undefined)
|
|
32
|
+
data.overloadDays = options.overloadDays;
|
|
33
|
+
if (options.underloadDays !== undefined)
|
|
34
|
+
data.underloadDays = options.underloadDays;
|
|
35
|
+
if (options.dailyHours !== undefined)
|
|
36
|
+
data.dailyHours = options.dailyHours;
|
|
37
|
+
if (Object.keys(data).length === 0) {
|
|
38
|
+
if (outputJson) {
|
|
39
|
+
console.log(JSON.stringify({ success: false, error: { code: 'NO_PARAMS', message: 'At least one parameter is required' } }));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.error(chalk.red('\n✗ Error: At least one parameter is required\n'));
|
|
43
|
+
}
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
const response = await apiClient.fpConfigSet(environment, tenant, data);
|
|
47
|
+
if (!response.success) {
|
|
48
|
+
if (outputJson) {
|
|
49
|
+
console.log(JSON.stringify(response));
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
console.error(chalk.red(`\n✗ Error: ${response.error?.message || 'Unknown error'}\n`));
|
|
53
|
+
}
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
if (outputJson) {
|
|
57
|
+
console.log(JSON.stringify({ success: true, data }));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
console.log(chalk.green('\n✓ Team FP parameters updated successfully\n'));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return cmd;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=set-team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-team.js","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/fp-config/set-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,UAAU,4BAA4B;IAC1C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,GAAG,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;IAEhD,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,gDAAgD,CAAC,CAAC;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,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/liberica/teams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/liberica/teams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,wBAAgB,kBAAkB,IAAI,OAAO,CAmB5C"}
|
|
@@ -11,6 +11,7 @@ import { createTestFlakyCommand } from './test-flaky/index.js';
|
|
|
11
11
|
import { createTestRunsCommand } from './test-runs/index.js';
|
|
12
12
|
import { createTestExecutionsCommand } from './test-executions/index.js';
|
|
13
13
|
import { createTestSuiteRunSummariesCommand } from './test-suite-run-summaries/index.js';
|
|
14
|
+
import { createFpConfigCommand } from './fp-config/index.js';
|
|
14
15
|
export function createTeamsCommand() {
|
|
15
16
|
const teamsCommand = new Command('teams');
|
|
16
17
|
teamsCommand.description('Manage teams and issues');
|
|
@@ -26,6 +27,7 @@ export function createTeamsCommand() {
|
|
|
26
27
|
teamsCommand.addCommand(createTestRunsCommand());
|
|
27
28
|
teamsCommand.addCommand(createTestExecutionsCommand());
|
|
28
29
|
teamsCommand.addCommand(createTestSuiteRunSummariesCommand());
|
|
30
|
+
teamsCommand.addCommand(createFpConfigCommand());
|
|
29
31
|
return teamsCommand;
|
|
30
32
|
}
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/liberica/teams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/liberica/teams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAA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AC9D,YAAY,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAEjD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fp-actual.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/issues/fp-actual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,qBAAqB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"fp-actual.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/issues/fp-actual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,qBAAqB,IAAI,OAAO,CA0D/C"}
|
|
@@ -5,41 +5,37 @@ import { apiClient } from '../../../../core/api/client.js';
|
|
|
5
5
|
import { shouldUseJson } from '../../../../utils/output.js';
|
|
6
6
|
export function createFpActualCommand() {
|
|
7
7
|
const cmd = new Command('fp-actual');
|
|
8
|
-
cmd.description('Submit actual FP counts');
|
|
9
|
-
cmd.option('--
|
|
10
|
-
cmd.option('--
|
|
11
|
-
cmd.option('--
|
|
8
|
+
cmd.description('Submit actual FP counts for a team issue');
|
|
9
|
+
cmd.option('--issue-id <id>', 'Team issue ID (required)');
|
|
10
|
+
cmd.option('--post-fp <number>', 'Actual function points');
|
|
11
|
+
cmd.option('--detail-json <json>', 'FP detail JSON');
|
|
12
|
+
cmd.option('--auditor <name>', 'Auditor name');
|
|
12
13
|
cmd.option('--json', 'Output as JSON');
|
|
13
14
|
cmd.action(async (options) => {
|
|
14
15
|
const context = configManager.getCurrentContext();
|
|
15
16
|
const environment = options.env || context.environment;
|
|
16
17
|
const tenant = options.tenant || context.tenant;
|
|
17
18
|
const outputJson = shouldUseJson(options);
|
|
18
|
-
if (!options.
|
|
19
|
+
if (!options.issueId) {
|
|
19
20
|
if (outputJson) {
|
|
20
|
-
console.log(JSON.stringify({ success: false, error: { code: '
|
|
21
|
+
console.log(JSON.stringify({ success: false, error: { code: 'MISSING_ISSUE_ID', message: '--issue-id is required' } }));
|
|
21
22
|
}
|
|
22
23
|
else {
|
|
23
|
-
console.error(chalk.red('\n✗ Error: --
|
|
24
|
-
}
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
if (!options.actualFp) {
|
|
28
|
-
if (outputJson) {
|
|
29
|
-
console.log(JSON.stringify({ success: false, error: { code: 'MISSING_ACTUAL_FP', message: '--actual-fp is required' } }));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.error(chalk.red('\n✗ Error: --actual-fp is required\n'));
|
|
24
|
+
console.error(chalk.red('\n✗ Error: --issue-id is required\n'));
|
|
33
25
|
}
|
|
34
26
|
process.exit(1);
|
|
35
27
|
}
|
|
36
28
|
const data = {
|
|
37
|
-
|
|
38
|
-
actualFunctionPoints: parseInt(options.actualFp, 10),
|
|
39
|
-
actualComponents: [],
|
|
29
|
+
teamIssueId: options.issueId,
|
|
40
30
|
};
|
|
41
|
-
if (options.
|
|
42
|
-
data.
|
|
31
|
+
if (options.postFp !== undefined) {
|
|
32
|
+
data.postFpActual = parseInt(options.postFp, 10);
|
|
33
|
+
}
|
|
34
|
+
if (options.detailJson) {
|
|
35
|
+
data.postFpDetailJson = options.detailJson;
|
|
36
|
+
}
|
|
37
|
+
if (options.auditor) {
|
|
38
|
+
data.postFpAuditor = options.auditor;
|
|
43
39
|
}
|
|
44
40
|
const response = await apiClient.fpActual(environment, tenant, data);
|
|
45
41
|
if (!response.success) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fp-actual.js","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/issues/fp-actual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM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AC,QAAQ,CAAC,CAAC,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,eAAe,IAAI,CAAC,CAAC,CAAC;YACzF,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fp-calibrate.d.ts","sourceRoot":"","sources":["../../../../../src/commands/liberica/teams/issues/fp-calibrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8CpC,wBAAgB,8BAA8B,IAAI,OAAO,CAkExD;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAkEzD"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
4
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
5
|
+
import { shouldUseJson } from '../../../../utils/output.js';
|
|
6
|
+
function getStabilityLabel(cv, sampleCount) {
|
|
7
|
+
if (sampleCount < 5)
|
|
8
|
+
return '冷启动';
|
|
9
|
+
if (cv === null || cv === undefined)
|
|
10
|
+
return '未知';
|
|
11
|
+
if (cv > 30)
|
|
12
|
+
return '剧烈波动';
|
|
13
|
+
if (cv > 15)
|
|
14
|
+
return '波动中';
|
|
15
|
+
return '稳定';
|
|
16
|
+
}
|
|
17
|
+
function getSuggestionCode(cv, sampleCount) {
|
|
18
|
+
if (sampleCount < 5)
|
|
19
|
+
return 'COLD_START';
|
|
20
|
+
if (sampleCount < 10)
|
|
21
|
+
return 'ACCUMULATING';
|
|
22
|
+
if (cv === null || cv === undefined)
|
|
23
|
+
return 'UNKNOWN';
|
|
24
|
+
if (cv > 30)
|
|
25
|
+
return 'INVESTIGATE';
|
|
26
|
+
if (cv > 15)
|
|
27
|
+
return 'HOLD';
|
|
28
|
+
return 'UPDATE_PDR';
|
|
29
|
+
}
|
|
30
|
+
function getSuggestionMessage(code, weightedPdr) {
|
|
31
|
+
switch (code) {
|
|
32
|
+
case 'COLD_START':
|
|
33
|
+
return '样本不足 5 个,保持行业基准 PDR 8.5,等待数据积累。';
|
|
34
|
+
case 'ACCUMULATING':
|
|
35
|
+
return '样本 5-9 个,可查看 CV 趋势,但建议不更新配置。';
|
|
36
|
+
case 'INVESTIGATE':
|
|
37
|
+
return 'CV > 30%,建议排查波动原因(需求类型混杂、估算不一致、人员能力差异等)。';
|
|
38
|
+
case 'HOLD':
|
|
39
|
+
return 'CV 在 15%-30% 之间,继续积累数据,保持当前配置。';
|
|
40
|
+
case 'UPDATE_PDR':
|
|
41
|
+
return `建议更新 PDR 为 ${weightedPdr?.toFixed(1) ?? '8.5'} 小时/FP:\n barista liberica teams fp-config set --pdr ${weightedPdr?.toFixed(1) ?? '8.5'}`;
|
|
42
|
+
default:
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function formatPdrByModule(pdrByModule) {
|
|
47
|
+
if (!pdrByModule || pdrByModule.length === 0)
|
|
48
|
+
return '无';
|
|
49
|
+
return pdrByModule.map(m => `${m.projectName || '未知'}: ${m.modulePdr?.toFixed(1) ?? '-'}`).join(' | ');
|
|
50
|
+
}
|
|
51
|
+
export function createFpCalibrateStatusCommand() {
|
|
52
|
+
const cmd = new Command('status');
|
|
53
|
+
cmd.description('Show PDR calibration status');
|
|
54
|
+
cmd.option('--project-id <id>', 'Filter by project ID');
|
|
55
|
+
cmd.option('--tag <tag>', 'Filter by tag');
|
|
56
|
+
cmd.option('--json', 'Output as JSON');
|
|
57
|
+
cmd.action(async (options) => {
|
|
58
|
+
const context = configManager.getCurrentContext();
|
|
59
|
+
const environment = options.env || context.environment;
|
|
60
|
+
const tenant = options.tenant || context.tenant;
|
|
61
|
+
const outputJson = shouldUseJson(options);
|
|
62
|
+
const params = {};
|
|
63
|
+
if (options.projectId)
|
|
64
|
+
params.projectId = options.projectId;
|
|
65
|
+
if (options.tag)
|
|
66
|
+
params.tag = options.tag;
|
|
67
|
+
const response = await apiClient.fpPdrCalibration(environment, tenant, params);
|
|
68
|
+
if (!response.success) {
|
|
69
|
+
if (outputJson) {
|
|
70
|
+
console.log(JSON.stringify(response));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
console.error(chalk.red(`\n✗ Error: ${response.error?.message || 'Unknown error'}\n`));
|
|
74
|
+
}
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
const data = response.data || {};
|
|
78
|
+
if (outputJson) {
|
|
79
|
+
const output = { success: true, data: {} };
|
|
80
|
+
const d = output.data;
|
|
81
|
+
d.totalIssues = data.totalIssues;
|
|
82
|
+
d.weightedPdr = data.weightedPdr;
|
|
83
|
+
d.cv = data.cv;
|
|
84
|
+
d.mr = data.mr;
|
|
85
|
+
d.convergenceStatus = data.convergenceStatus;
|
|
86
|
+
d.convergenceSampleCount = data.convergenceSampleCount;
|
|
87
|
+
d.stabilityLabel = getStabilityLabel(data.cv, data.convergenceSampleCount ?? 0);
|
|
88
|
+
d.suggestionCode = getSuggestionCode(data.cv, data.convergenceSampleCount ?? 0);
|
|
89
|
+
d.pdrByModule = data.pdrByModule || [];
|
|
90
|
+
console.log(JSON.stringify(output, null, 2));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
const sampleCount = data.convergenceSampleCount ?? 0;
|
|
94
|
+
const weightedPdr = data.weightedPdr;
|
|
95
|
+
const cv = data.cv;
|
|
96
|
+
const stability = getStabilityLabel(cv, sampleCount);
|
|
97
|
+
const suggestionCode = getSuggestionCode(cv, sampleCount);
|
|
98
|
+
console.log(chalk.bold('\n=== PDR Calibration Status ===\n'));
|
|
99
|
+
console.log(` ${chalk.cyan('Issues:')} ${data.totalIssues ?? 0}`);
|
|
100
|
+
console.log(` ${chalk.cyan('Weighted PDR:')} ${weightedPdr != null ? weightedPdr.toFixed(1) + ' 小时/FP' : '-'}`);
|
|
101
|
+
console.log(` ${chalk.cyan('CV:')} ${cv != null ? cv.toFixed(1) + '%' : '-'}`);
|
|
102
|
+
console.log(` ${chalk.cyan('MR:')} ${data.mr != null ? data.mr.toFixed(1) : '无'}`);
|
|
103
|
+
console.log(` ${chalk.cyan('Status:')} ${data.convergenceStatus ?? '-'}`);
|
|
104
|
+
console.log(` ${chalk.cyan('Samples:')} ${sampleCount}`);
|
|
105
|
+
console.log(` ${chalk.cyan('Stability:')} ${stability}`);
|
|
106
|
+
console.log(` ${chalk.cyan('Suggestion:')} ${getSuggestionMessage(suggestionCode, weightedPdr)}`);
|
|
107
|
+
console.log(` ${chalk.cyan('By Module:')} ${formatPdrByModule(data.pdrByModule)}`);
|
|
108
|
+
console.log();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return cmd;
|
|
112
|
+
}
|
|
113
|
+
export function createFpCalibrateSuggestCommand() {
|
|
114
|
+
const cmd = new Command('suggest');
|
|
115
|
+
cmd.description('Suggest PDR value based on calibration data');
|
|
116
|
+
cmd.option('--project-id <id>', 'Filter by project ID');
|
|
117
|
+
cmd.option('--tag <tag>', 'Filter by tag');
|
|
118
|
+
cmd.option('--json', 'Output as JSON');
|
|
119
|
+
cmd.action(async (options) => {
|
|
120
|
+
const context = configManager.getCurrentContext();
|
|
121
|
+
const environment = options.env || context.environment;
|
|
122
|
+
const tenant = options.tenant || context.tenant;
|
|
123
|
+
const outputJson = shouldUseJson(options);
|
|
124
|
+
const params = {};
|
|
125
|
+
if (options.projectId)
|
|
126
|
+
params.projectId = options.projectId;
|
|
127
|
+
if (options.tag)
|
|
128
|
+
params.tag = options.tag;
|
|
129
|
+
const response = await apiClient.fpPdrCalibration(environment, tenant, params);
|
|
130
|
+
if (!response.success) {
|
|
131
|
+
if (outputJson) {
|
|
132
|
+
console.log(JSON.stringify(response));
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
console.error(chalk.red(`\n✗ Error: ${response.error?.message || 'Unknown error'}\n`));
|
|
136
|
+
}
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
const data = response.data || {};
|
|
140
|
+
const sampleCount = data.convergenceSampleCount ?? 0;
|
|
141
|
+
const weightedPdr = data.weightedPdr;
|
|
142
|
+
const cv = data.cv;
|
|
143
|
+
if (outputJson) {
|
|
144
|
+
const suggestionCode = getSuggestionCode(cv, sampleCount);
|
|
145
|
+
console.log(JSON.stringify({
|
|
146
|
+
success: true,
|
|
147
|
+
data: {
|
|
148
|
+
totalIssues: data.totalIssues,
|
|
149
|
+
weightedPdr,
|
|
150
|
+
cv,
|
|
151
|
+
convergenceSampleCount: sampleCount,
|
|
152
|
+
suggestionCode,
|
|
153
|
+
suggestedPdr: suggestionCode === 'UPDATE_PDR' ? weightedPdr : null,
|
|
154
|
+
message: getSuggestionMessage(suggestionCode, weightedPdr),
|
|
155
|
+
pdrByModule: data.pdrByModule || [],
|
|
156
|
+
},
|
|
157
|
+
}, null, 2));
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
const suggestionCode = getSuggestionCode(cv, sampleCount);
|
|
161
|
+
const stability = getStabilityLabel(cv, sampleCount);
|
|
162
|
+
console.log(chalk.bold('\n=== PDR Calibration Suggestion ===\n'));
|
|
163
|
+
console.log(` ${chalk.cyan('Issues:')} ${data.totalIssues ?? 0}`);
|
|
164
|
+
console.log(` ${chalk.cyan('Weighted PDR:')} ${weightedPdr != null ? weightedPdr.toFixed(1) + ' 小时/FP' : '-'}`);
|
|
165
|
+
console.log(` ${chalk.cyan('CV:')} ${cv != null ? cv.toFixed(1) + '%' : '-'}`);
|
|
166
|
+
console.log(` ${chalk.cyan('Samples:')} ${sampleCount}`);
|
|
167
|
+
console.log(` ${chalk.cyan('Stability:')} ${stability}`);
|
|
168
|
+
console.log(` ${chalk.cyan('Suggestion:')} ${getSuggestionMessage(suggestionCode, weightedPdr)}`);
|
|
169
|
+
console.log(` ${chalk.cyan('By Module:')} ${formatPdrByModule(data.pdrByModule)}`);
|
|
170
|
+
console.log();
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return cmd;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=fp-calibrate.js.map
|