@copado/agentia-cli 1.2.0 → 1.4.0
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/CHANGELOG.md +58 -1
- package/README.md +2299 -1615
- package/dist/commands/auth/get.js +21 -1
- package/dist/commands/auth/set.js +13 -0
- package/dist/commands/auth/unset.js +37 -0
- package/dist/commands/cicd/cloud/commit.js +6 -5
- package/dist/commands/cicd/cloud/promote.js +44 -8
- package/dist/commands/cicd/credential/auth/status.js +2 -2
- package/dist/commands/cicd/credential/auth/web/login.js +2 -2
- package/dist/commands/cicd/credential/create.js +2 -2
- package/dist/commands/cicd/credential/list.js +4 -3
- package/dist/commands/cicd/credential/open.js +2 -2
- package/dist/commands/cicd/credential/update.js +2 -2
- package/dist/commands/cicd/data/commit/create.js +2 -2
- package/dist/commands/cicd/data/commit/list.js +2 -2
- package/dist/commands/cicd/data/dataset-file/content.js +2 -2
- package/dist/commands/cicd/data/dataset-file/list.js +2 -2
- package/dist/commands/cicd/data/filter/add.js +2 -2
- package/dist/commands/cicd/data/filter/delete.js +2 -2
- package/dist/commands/cicd/data/filter/list.js +2 -2
- package/dist/commands/cicd/data/filter/update.js +2 -2
- package/dist/commands/cicd/data/formula/create.js +2 -2
- package/dist/commands/cicd/data/formula/list.js +2 -2
- package/dist/commands/cicd/data/formula/update.js +2 -2
- package/dist/commands/cicd/data/records/match.js +2 -2
- package/dist/commands/cicd/data/records/search.js +2 -2
- package/dist/commands/cicd/data/sobject/fields.js +2 -2
- package/dist/commands/cicd/data/sobject/relationships.js +2 -2
- package/dist/commands/cicd/data/sync/apply.js +2 -2
- package/dist/commands/cicd/data/sync/preview-updates.js +2 -2
- package/dist/commands/cicd/data/template/convert-old.js +2 -2
- package/dist/commands/cicd/data/template/create.js +2 -2
- package/dist/commands/cicd/data/template/delete.js +2 -2
- package/dist/commands/cicd/data/template/get-detail.js +2 -2
- package/dist/commands/cicd/data/template/get.js +2 -2
- package/dist/commands/cicd/data/template/list.js +2 -2
- package/dist/commands/cicd/data/template/open.js +2 -2
- package/dist/commands/cicd/data/template/save-detail.js +2 -2
- package/dist/commands/cicd/environment/auth/status.js +2 -2
- package/dist/commands/cicd/environment/auth/web/login.js +2 -2
- package/dist/commands/cicd/environment/create.js +2 -2
- package/dist/commands/cicd/environment/get.js +2 -2
- package/dist/commands/cicd/environment/list.js +4 -3
- package/dist/commands/cicd/environment/open.js +2 -2
- package/dist/commands/cicd/environment/update.js +2 -2
- package/dist/commands/cicd/extension/create.js +2 -2
- package/dist/commands/cicd/extension/install.js +2 -2
- package/dist/commands/cicd/extension/package.js +2 -2
- package/dist/commands/cicd/extension/publish.js +2 -2
- package/dist/commands/cicd/extension/uninstall.js +2 -2
- package/dist/commands/cicd/extension/validate.js +2 -2
- package/dist/commands/cicd/extension-configuration/get.js +2 -2
- package/dist/commands/cicd/extension-configuration/list.js +4 -3
- package/dist/commands/cicd/extension-configuration/open.js +2 -2
- package/dist/commands/cicd/function/defaults.js +2 -2
- package/dist/commands/cicd/function/delete.js +2 -2
- package/dist/commands/cicd/function/get.js +2 -2
- package/dist/commands/cicd/function/list.js +12 -15
- package/dist/commands/cicd/function/open.js +2 -2
- package/dist/commands/cicd/function/result/get.js +2 -2
- package/dist/commands/cicd/function/result/log/get.js +2 -2
- package/dist/commands/cicd/function/run-local.js +2 -2
- package/dist/commands/cicd/function/run.js +2 -2
- package/dist/commands/cicd/function/upsert.js +2 -2
- package/dist/commands/cicd/health-check.js +2 -2
- package/dist/commands/cicd/job/get.js +2 -2
- package/dist/commands/cicd/job/kill.js +2 -2
- package/dist/commands/cicd/job/list.js +4 -3
- package/dist/commands/cicd/job/log/get.js +2 -2
- package/dist/commands/cicd/job/open.js +2 -2
- package/dist/commands/cicd/job/pause.js +2 -2
- package/dist/commands/cicd/job/result-file/get.js +13 -8
- package/dist/commands/cicd/job/result-file/list.js +2 -2
- package/dist/commands/cicd/job/resume.js +2 -2
- package/dist/commands/cicd/job/run.js +2 -2
- package/dist/commands/cicd/metadata/content/compare.js +2 -2
- package/dist/commands/cicd/metadata/content/get.js +2 -2
- package/dist/commands/cicd/metadata/dependency/list.js +44 -21
- package/dist/commands/cicd/metadata/explore.js +2 -2
- package/dist/commands/cicd/metadata/index/compare.js +2 -2
- package/dist/commands/cicd/metadata/list.js +2 -2
- package/dist/commands/cicd/metadata/refresh/deleted.js +2 -2
- package/dist/commands/cicd/metadata/refresh/run.js +2 -2
- package/dist/commands/cicd/metadata/refresh/status.js +2 -2
- package/dist/commands/cicd/notification/configure.js +2 -2
- package/dist/commands/cicd/notification/get.js +2 -2
- package/dist/commands/cicd/pipeline/automation/activate.js +2 -2
- package/dist/commands/cicd/pipeline/automation/create.js +2 -2
- package/dist/commands/cicd/pipeline/automation/deactivate.js +2 -2
- package/dist/commands/cicd/pipeline/automation/delete.js +2 -2
- package/dist/commands/cicd/pipeline/automation/get.js +2 -2
- package/dist/commands/cicd/pipeline/automation/list.js +4 -3
- package/dist/commands/cicd/pipeline/automation/open.js +2 -2
- package/dist/commands/cicd/pipeline/automation/update.js +2 -2
- package/dist/commands/cicd/pipeline/connection/create.js +2 -2
- package/dist/commands/cicd/pipeline/connection/delete.js +2 -2
- package/dist/commands/cicd/pipeline/connection/list.js +2 -2
- package/dist/commands/cicd/pipeline/connection/open.js +2 -2
- package/dist/commands/cicd/pipeline/connection/update.js +2 -2
- package/dist/commands/cicd/pipeline/create.js +2 -2
- package/dist/commands/cicd/pipeline/get.js +2 -2
- package/dist/commands/cicd/pipeline/list.js +4 -3
- package/dist/commands/cicd/pipeline/open.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/activate.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/create.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/deactivate.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/delete.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/get.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/list.js +4 -3
- package/dist/commands/cicd/pipeline/quality-gate/open.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/update.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/create.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/delete.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/list.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/open.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/update.js +2 -2
- package/dist/commands/cicd/pipeline/update.js +2 -2
- package/dist/commands/cicd/project/create.js +2 -2
- package/dist/commands/cicd/project/default/get.js +2 -2
- package/dist/commands/cicd/project/default/set.js +2 -2
- package/dist/commands/cicd/project/default/unset.js +2 -2
- package/dist/commands/cicd/project/delete.js +2 -2
- package/dist/commands/cicd/project/get.js +2 -2
- package/dist/commands/cicd/project/list.js +4 -3
- package/dist/commands/cicd/project/open.js +2 -2
- package/dist/commands/cicd/project/update.js +2 -2
- package/dist/commands/cicd/promotion/conflict/get.js +2 -2
- package/dist/commands/cicd/promotion/conflict/list.js +2 -2
- package/dist/commands/cicd/promotion/conflict/resolve.js +2 -2
- package/dist/commands/cicd/promotion/conflict/unresolve.js +2 -2
- package/dist/commands/cicd/promotion/get.js +2 -2
- package/dist/commands/cicd/promotion/job-step/update.js +2 -2
- package/dist/commands/cicd/promotion/list.js +4 -3
- package/dist/commands/cicd/promotion/open.js +2 -2
- package/dist/commands/cicd/promotion/queue/list.js +28 -0
- package/dist/commands/cicd/promotion/queue/remove.js +37 -0
- package/dist/commands/cicd/promotion/run.js +2 -2
- package/dist/commands/cicd/promotion/status.js +29 -0
- package/dist/commands/cicd/repository/auth/https/configure.js +2 -2
- package/dist/commands/cicd/repository/auth/oauth/login.js +2 -2
- package/dist/commands/cicd/repository/auth/setup.js +2 -2
- package/dist/commands/cicd/repository/auth/ssh/configure.js +2 -2
- package/dist/commands/cicd/repository/create.js +2 -2
- package/dist/commands/cicd/repository/delete.js +2 -2
- package/dist/commands/cicd/repository/get.js +2 -2
- package/dist/commands/cicd/repository/list.js +7 -10
- package/dist/commands/cicd/repository/open.js +2 -2
- package/dist/commands/cicd/repository/reset.js +2 -2
- package/dist/commands/cicd/repository/update.js +2 -2
- package/dist/commands/cicd/repository/validate.js +2 -2
- package/dist/commands/cicd/stage/create.js +2 -2
- package/dist/commands/cicd/stage/delete.js +2 -2
- package/dist/commands/cicd/stage/get.js +2 -2
- package/dist/commands/cicd/stage/list.js +4 -3
- package/dist/commands/cicd/stage/open.js +2 -2
- package/dist/commands/cicd/stage/update.js +2 -2
- package/dist/commands/cicd/template/defaults.js +2 -2
- package/dist/commands/cicd/template/delete.js +2 -2
- package/dist/commands/cicd/template/get.js +2 -2
- package/dist/commands/cicd/template/list.js +11 -14
- package/dist/commands/cicd/template/upsert.js +2 -2
- package/dist/commands/cicd/user/get.js +2 -2
- package/dist/commands/cicd/work/ahead-behind.js +2 -2
- package/dist/commands/cicd/work/create.js +2 -2
- package/dist/commands/cicd/work/delete.js +4 -4
- package/dist/commands/cicd/work/deployment-step/create.js +2 -2
- package/dist/commands/cicd/work/deployment-step/delete.js +2 -2
- package/dist/commands/cicd/work/deployment-step/list.js +2 -2
- package/dist/commands/cicd/work/deployment-step/reorder.js +2 -2
- package/dist/commands/cicd/work/deployment-step/salesforce-flows.js +2 -2
- package/dist/commands/cicd/work/deployment-step/types.js +2 -2
- package/dist/commands/cicd/work/deployment-step/update.js +2 -2
- package/dist/commands/cicd/work/done.js +2 -2
- package/dist/commands/cicd/work/environment-sync.js +140 -64
- package/dist/commands/cicd/work/get.js +4 -4
- package/dist/commands/cicd/work/list.js +4 -3
- package/dist/commands/cicd/work/open.js +2 -2
- package/dist/commands/cicd/work/promote.js +2 -2
- package/dist/commands/cicd/work/publish.js +2 -2
- package/dist/commands/cicd/work/push.js +2 -2
- package/dist/commands/cicd/work/set.js +2 -2
- package/dist/commands/cicd/work/status.js +2 -2
- package/dist/commands/cicd/work/submit.js +2 -2
- package/dist/commands/cicd/work/test/apex.js +20 -35
- package/dist/commands/cicd/work/test.js +116 -11
- package/dist/commands/cicd/work/update.js +4 -4
- package/dist/commands/help-agent.js +15 -0
- package/dist/commands/help.js +38 -0
- package/dist/commands/history/clear.js +42 -0
- package/dist/commands/history/list.js +50 -0
- package/dist/commands/support.js +15 -0
- package/dist/commands/testing/browser/execute.js +49 -0
- package/dist/commands/testing/browser/history.js +49 -0
- package/dist/commands/testing/browser/inspect.js +35 -0
- package/dist/commands/testing/browser/recorder.js +52 -0
- package/dist/commands/testing/browser/screenshot.js +27 -0
- package/dist/commands/testing/browser/set-options.js +35 -0
- package/dist/commands/testing/browser/start.js +51 -0
- package/dist/commands/testing/browser/status.js +26 -0
- package/dist/commands/testing/browser/stop.js +34 -0
- package/dist/commands/testing/browser/view.js +35 -0
- package/dist/commands/testing/job/runs/abort.js +1 -1
- package/dist/commands/testing/job/runs/get.js +1 -1
- package/dist/commands/testing/job/runs/list.js +1 -1
- package/dist/commands/testing/job/runs/logs.js +1 -1
- package/dist/commands/testing/job/runs/search.js +1 -1
- package/dist/hooks/init/cicd-connection.js +59 -0
- package/dist/lib/agentia-command.js +69 -6
- package/dist/lib/cicd-command.js +3 -0
- package/dist/lib/cicd-connection.js +22 -0
- package/dist/lib/cicd-gateway.js +2 -1
- package/dist/lib/command-history-sanitization.js +9 -0
- package/dist/lib/command-history.js +11 -0
- package/dist/lib/command-output-buffer.js +6 -1
- package/dist/lib/defaults-store.js +5 -1
- package/dist/lib/dependency-from-changes.js +3 -1
- package/dist/lib/dependency-source-context.js +3 -0
- package/dist/lib/function-list.js +3 -0
- package/dist/lib/git-worktree.js +4 -1
- package/dist/lib/help-agent-command.js +3 -0
- package/dist/lib/help-agent-interaction-history.js +10 -0
- package/dist/lib/help-agent-session.js +3 -0
- package/dist/lib/job-get.js +2 -1
- package/dist/lib/job-types.js +2 -1
- package/dist/lib/list-pagination.js +6 -1
- package/dist/lib/local-quality-gates.js +4 -1
- package/dist/lib/mcp/result.js +41 -3
- package/dist/lib/mcp/server.js +3 -2
- package/dist/lib/mcp/testing-browser-tools.js +179 -0
- package/dist/lib/mcp/testing-tools.js +4 -3
- package/dist/lib/mcp/tool-annotations.js +31 -12
- package/dist/lib/mcp/tools.js +115 -59
- package/dist/lib/mcp/work-tools.js +100 -47
- package/dist/lib/promotion-queue.js +5 -0
- package/dist/lib/promotion-run.js +4 -1
- package/dist/lib/promotion-status.js +12 -0
- package/dist/lib/quality-gates.js +13 -0
- package/dist/lib/repository-list.js +3 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/stock-quality-gates.js +2 -1
- package/dist/lib/support-ai-context.js +11 -0
- package/dist/lib/support-ai-stream-parser.js +4 -0
- package/dist/lib/support-ai.js +9 -0
- package/dist/lib/template-list.js +3 -0
- package/dist/lib/testing-browser-command.js +6 -0
- package/dist/lib/testing-browser-operations.js +16 -0
- package/dist/lib/testing-browser-requests.js +11 -0
- package/dist/lib/testing-browser-robot.js +9 -0
- package/dist/lib/testing-browser-session.js +13 -0
- package/dist/lib/testing-browser-state.js +17 -0
- package/dist/lib/testing-browser-stream.js +7 -0
- package/dist/lib/testing-browser-types.js +3 -0
- package/dist/lib/testing-browser-viewer-key.js +7 -0
- package/dist/lib/testing-gateway.js +2 -1
- package/dist/lib/testing-operations.js +21 -1
- package/dist/lib/testing-sanitization.js +2 -1
- package/dist/lib/work-apex-test-failures.js +2 -1
- package/dist/lib/work-environment-sync-ready.js +7 -1
- package/dist/lib/work-environment-sync.js +8 -1
- package/dist/lib/work-local-run-tests.js +2 -1
- package/dist/lib/work-promote-deploy.js +3 -1
- package/dist/lib/work-promote.js +2 -1
- package/dist/lib/work-types.js +3 -1
- package/oclif.manifest.json +3544 -1828
- package/package.json +11 -4
- package/templates/skills/agentia-ai/SKILL.md +6 -2
- package/templates/skills/agentia-ai/references/ai-agents.md +19 -1
- package/templates/skills/agentia-cicd/SKILL.md +6 -5
- package/templates/skills/agentia-cicd/references/environments-and-credentials.md +16 -0
- package/templates/skills/agentia-cicd/references/jobs.md +3 -2
- package/templates/skills/agentia-cicd/references/promotions.md +26 -5
- package/templates/skills/agentia-cicd/references/work.md +25 -11
- package/templates/skills/agentia-metadata/SKILL.md +9 -3
- package/templates/skills/agentia-metadata/references/metadata-dependency.md +70 -0
- package/templates/skills/agentia-metadata/references/metadata-explore.md +8 -4
- package/templates/skills/agentia-testing/SKILL.md +9 -4
- package/templates/skills/agentia-testing/references/browser-testing.md +92 -0
- package/templates/skills/agentia-testing/references/flow-automation.md +112 -0
- package/templates/skills/agentia-testing/references/qforce.md +88 -0
- package/templates/skills/agentia-testing/references/qweb.md +103 -0
- package/templates/skills/agentia-testing/references/tests.md +17 -9
- package/vendor/java/var-replace-command.jar +0 -0
- package/dist/commands/testing/live/continue.js +0 -16
- package/dist/commands/testing/live/execute.js +0 -43
- package/dist/commands/testing/live/history.js +0 -40
- package/dist/commands/testing/live/inspect.js +0 -31
- package/dist/commands/testing/live/interrupt.js +0 -16
- package/dist/commands/testing/live/recorder.js +0 -42
- package/dist/commands/testing/live/reports.js +0 -31
- package/dist/commands/testing/live/screenshot.js +0 -25
- package/dist/commands/testing/live/set-options.js +0 -35
- package/dist/commands/testing/live/start.js +0 -58
- package/dist/commands/testing/live/status.js +0 -24
- package/dist/commands/testing/live/stop.js +0 -36
- package/dist/commands/testing/live/view.js +0 -36
- package/dist/lib/mcp/testing-live-tools.js +0 -226
- package/dist/lib/testing-live-command.js +0 -8
- package/dist/lib/testing-live-operations.js +0 -25
- package/dist/lib/testing-live-recorder.js +0 -11
- package/dist/lib/testing-live-robot.js +0 -9
- package/dist/lib/testing-live-state.js +0 -12
- package/dist/lib/testing-live-types.js +0 -3
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
4
4
|
import { getCurrentBranch } from '../../../lib/git-worktree.js';
|
|
5
|
-
import { LocalQualityGatesError, parseQualityGatesEnvAssignments, resolveLocalQualityGatesScript, } from '../../../lib/local-quality-gates.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { isInsideQualityGatesScript, LocalQualityGatesError, parseQualityGatesEnvAssignments, resolveLocalQualityGatesScript, } from '../../../lib/local-quality-gates.js';
|
|
6
|
+
import { formatDeclaredQualityGates, isApexOnlySelection, resolveQualityGateSelection, UnknownQualityGateError, } from '../../../lib/quality-gates.js';
|
|
7
|
+
import { listLocalQualityGates, runWorkTestLocalQualityGates } from '../../../lib/stock-quality-gates.js';
|
|
8
|
+
import { executeWorkApexTestRun, WorkApexRerunError } from '../../../lib/work-apex-test-failures.js';
|
|
9
|
+
import { DEFAULT_APEX_TEST_WAIT_MINUTES, formatWorkApexTestHuman, parseApexTestClassNames, validateApexTestWaitMinutes, WorkApexTestError, } from '../../../lib/work-apex-test.js';
|
|
10
|
+
import { reportApexGateRun, reportLocalQualityGatesFailure, reportLocalQualityGatesOutcome, } from '../../../lib/work-local-run-tests.js';
|
|
8
11
|
import { extractUserStoryFromFeatureBranch } from '../../../lib/work-types.js';
|
|
9
|
-
export default class WorkTest extends
|
|
12
|
+
export default class WorkTest extends CicdCommand {
|
|
10
13
|
static description = [
|
|
11
14
|
'Run quality gates for the current work item.',
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
+
'Runs the project-root .agentia_quality_gates.sh (macOS/Linux) or .agentia_quality_gates.cmd (Windows);',
|
|
16
|
+
'when none exists it warns and runs the stock Agentia sample from a temporary file.',
|
|
17
|
+
'Every gate runs by default. Use --gate <id> (repeatable or comma-separated) to select gates; the selection is exported as AGENTIA_GATES.',
|
|
18
|
+
'Standard ids are apex, lint and lwc; scripts declare gates with `# agentia-gate: <id> - <description>` comments (see --list-gates).',
|
|
19
|
+
'`--gate apex` alone skips the script, runs the Apex tests directly and uploads the result to the work item (nested inside a script it does not upload; the outer run reports).',
|
|
15
20
|
'With --cloud it runs remote Copado quality gates (not implemented yet).',
|
|
16
21
|
].join(' ');
|
|
17
22
|
static examples = [
|
|
18
23
|
'<%= config.bin %> <%= command.id %>',
|
|
19
|
-
'<%= config.bin %> <%= command.id %> --
|
|
20
|
-
'<%= config.bin %> <%= command.id %> --
|
|
24
|
+
'<%= config.bin %> <%= command.id %> --gate lint --gate lwc',
|
|
25
|
+
'<%= config.bin %> <%= command.id %> --gate apex --apex-test-classes=MyTest,OtherTest',
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --list-gates',
|
|
21
27
|
'<%= config.bin %> <%= command.id %> -e SKIP_LWC_TESTS=1 -e TOOL_API_KEY=secret',
|
|
22
28
|
'<%= config.bin %> <%= command.id %> --json',
|
|
23
29
|
'<%= config.bin %> <%= command.id %> --cloud',
|
|
24
30
|
];
|
|
25
31
|
static flags = {
|
|
32
|
+
all: Flags.boolean({
|
|
33
|
+
default: false,
|
|
34
|
+
description: 'Run every gate in the quality-gates script (the default when no --gate is given).',
|
|
35
|
+
exclusive: ['gate', 'list-gates'],
|
|
36
|
+
}),
|
|
26
37
|
'apex-test-classes': Flags.string({
|
|
27
38
|
description: 'Comma-separated Apex test class names passed to local quality gates as AGENTIA_APEX_TEST_CLASSES',
|
|
28
39
|
}),
|
|
@@ -35,13 +46,27 @@ export default class WorkTest extends AgentiaCommand {
|
|
|
35
46
|
description: 'Extra environment variable for the quality-gate script as NAME=value. Repeatable. Applied before reserved AGENTIA_APEX_* variables.',
|
|
36
47
|
multiple: true,
|
|
37
48
|
}),
|
|
49
|
+
gate: Flags.string({
|
|
50
|
+
description: 'Run only this gate id (for example apex, lint, lwc or a custom id declared in the script). Repeatable or comma-separated. Exported to the script as AGENTIA_GATES.',
|
|
51
|
+
exclusive: ['all', 'list-gates'],
|
|
52
|
+
multiple: true,
|
|
53
|
+
}),
|
|
54
|
+
'list-gates': Flags.boolean({
|
|
55
|
+
default: false,
|
|
56
|
+
description: 'List the gates declared in the quality-gates script (or the stock sample) and exit.',
|
|
57
|
+
}),
|
|
38
58
|
local: Flags.boolean({
|
|
39
59
|
default: false,
|
|
40
60
|
description: 'Run local project-root quality gates scripts. Used by default when --cloud is omitted.',
|
|
41
61
|
}),
|
|
42
62
|
'rerun-failed-apex-tests': Flags.boolean({
|
|
43
63
|
default: false,
|
|
44
|
-
description: 'Pass AGENTIA_APEX_RERUN_FAILED=--rerun-failed-apex-tests to local quality gates so sample scripts forward that flag to
|
|
64
|
+
description: 'Pass AGENTIA_APEX_RERUN_FAILED=--rerun-failed-apex-tests to local quality gates so sample scripts forward that flag to the apex gate.',
|
|
65
|
+
}),
|
|
66
|
+
wait: Flags.integer({
|
|
67
|
+
char: 'w',
|
|
68
|
+
default: DEFAULT_APEX_TEST_WAIT_MINUTES,
|
|
69
|
+
description: 'Minutes to wait for Apex test results (only with --gate apex alone).',
|
|
45
70
|
}),
|
|
46
71
|
};
|
|
47
72
|
async run() {
|
|
@@ -62,6 +87,19 @@ export default class WorkTest extends AgentiaCommand {
|
|
|
62
87
|
catch (error) {
|
|
63
88
|
this.error(error.message, { exit: 2 });
|
|
64
89
|
}
|
|
90
|
+
let selection;
|
|
91
|
+
try {
|
|
92
|
+
selection = resolveQualityGateSelection({ all: flags.all, gates: flags.gate });
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
this.error(error.message, { exit: 2 });
|
|
96
|
+
}
|
|
97
|
+
if (flags['list-gates']) {
|
|
98
|
+
return this.listGates();
|
|
99
|
+
}
|
|
100
|
+
if (isApexOnlySelection(selection)) {
|
|
101
|
+
return this.runApexGate({ classNames: flags['apex-test-classes'], rerunFailed: flags['rerun-failed-apex-tests'] === true, wait: flags.wait }, startedAt);
|
|
102
|
+
}
|
|
65
103
|
let qualityGates;
|
|
66
104
|
try {
|
|
67
105
|
const scriptPath = resolveLocalQualityGatesScript();
|
|
@@ -78,6 +116,7 @@ export default class WorkTest extends AgentiaCommand {
|
|
|
78
116
|
qualityGates = await runWorkTestLocalQualityGates({
|
|
79
117
|
apexTestClasses: flags['apex-test-classes'],
|
|
80
118
|
env: flags.env,
|
|
119
|
+
gates: selection.gates,
|
|
81
120
|
onWarning: (message) => this.warn(message),
|
|
82
121
|
rerunFailed: flags['rerun-failed-apex-tests'] === true,
|
|
83
122
|
});
|
|
@@ -100,6 +139,9 @@ export default class WorkTest extends AgentiaCommand {
|
|
|
100
139
|
exit: error.exitCode || 1,
|
|
101
140
|
});
|
|
102
141
|
}
|
|
142
|
+
if (error instanceof UnknownQualityGateError) {
|
|
143
|
+
this.error(error.message, { exit: 2 });
|
|
144
|
+
}
|
|
103
145
|
throw error;
|
|
104
146
|
}
|
|
105
147
|
this.logElapsed(startedAt);
|
|
@@ -108,6 +150,35 @@ export default class WorkTest extends AgentiaCommand {
|
|
|
108
150
|
qualityGates,
|
|
109
151
|
};
|
|
110
152
|
}
|
|
153
|
+
async listGates() {
|
|
154
|
+
const catalog = await listLocalQualityGates();
|
|
155
|
+
this.display(() => {
|
|
156
|
+
if (catalog.gates.length === 0) {
|
|
157
|
+
this.log('No gates declared. Add `# agentia-gate: <id> - <description>` comments to the quality-gates script.');
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.log(`Gates declared in ${catalog.stock ? 'the stock sample' : path.basename(catalog.scriptPath)}:`);
|
|
161
|
+
this.log(formatDeclaredQualityGates(catalog.gates));
|
|
162
|
+
});
|
|
163
|
+
return { gates: catalog.gates, local: true, qualityGates: { ran: false, skipped: false } };
|
|
164
|
+
}
|
|
165
|
+
async reportApexGate(result, failed) {
|
|
166
|
+
if (isInsideQualityGatesScript()) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const workItem = await this.resolveWorkItemForReport();
|
|
170
|
+
if (workItem === undefined) {
|
|
171
|
+
this.warn('Failed to report local quality gates result: not on a feature/US-XXXX branch.');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
await reportApexGateRun({
|
|
175
|
+
failed,
|
|
176
|
+
onLog: (message) => this.display(() => this.log(message)),
|
|
177
|
+
onWarning: (message) => this.warn(message),
|
|
178
|
+
result,
|
|
179
|
+
workItem,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
111
182
|
async reportLocalFailure(error) {
|
|
112
183
|
const workItem = await this.resolveWorkItemForReport();
|
|
113
184
|
if (workItem === undefined) {
|
|
@@ -138,5 +209,39 @@ export default class WorkTest extends AgentiaCommand {
|
|
|
138
209
|
const branch = await getCurrentBranch();
|
|
139
210
|
return extractUserStoryFromFeatureBranch(branch);
|
|
140
211
|
}
|
|
212
|
+
async runApexGate(options, startedAt) {
|
|
213
|
+
let requestedClassNames;
|
|
214
|
+
let waitMinutes;
|
|
215
|
+
try {
|
|
216
|
+
requestedClassNames = parseApexTestClassNames(options.classNames);
|
|
217
|
+
waitMinutes = validateApexTestWaitMinutes(options.wait);
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
this.error(error.message, { exit: 2 });
|
|
221
|
+
}
|
|
222
|
+
try {
|
|
223
|
+
const apex = await executeWorkApexTestRun({
|
|
224
|
+
requestedClassNames,
|
|
225
|
+
rerunFailed: options.rerunFailed,
|
|
226
|
+
waitMinutes,
|
|
227
|
+
}, {
|
|
228
|
+
onResult: (result) => this.display(() => this.log(formatWorkApexTestHuman(result))),
|
|
229
|
+
onSkip: (message) => this.display(() => this.log(message)),
|
|
230
|
+
withSpinner: (message, action) => this.withSpinner(message, action),
|
|
231
|
+
});
|
|
232
|
+
await this.reportApexGate(apex, false);
|
|
233
|
+
this.logElapsed(startedAt);
|
|
234
|
+
return { apex, local: true, qualityGates: { ran: apex.skipped !== true, skipped: false } };
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
if (error instanceof WorkApexRerunError) {
|
|
238
|
+
this.error(error.message, { exit: 2 });
|
|
239
|
+
}
|
|
240
|
+
if (error instanceof WorkApexTestError) {
|
|
241
|
+
await this.reportApexGate(error.result, true);
|
|
242
|
+
}
|
|
243
|
+
throw error;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
141
246
|
}
|
|
142
247
|
//# sourceMappingURL=test.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
|
-
import {
|
|
2
|
+
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
3
3
|
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
4
|
import { resolveWorkItemId, WorkActiveResolutionError } from '../../../lib/work-active.js';
|
|
5
5
|
import { buildWorkMutationPayload, collectWorkMutationFlagKeys, validateWorkMutationPayload, workMutationFlags, } from '../../../lib/work-flags.js';
|
|
6
6
|
import { workEndpoint } from '../../../lib/work-types.js';
|
|
7
|
-
export default class WorkUpdate extends
|
|
7
|
+
export default class WorkUpdate extends CicdCommand {
|
|
8
8
|
static args = {
|
|
9
9
|
id: Args.string({
|
|
10
|
-
description: 'User story ID (defaults to the active work item from `work set`)',
|
|
10
|
+
description: 'User story ID or name (defaults to the active work item from `work set`)',
|
|
11
11
|
required: false,
|
|
12
12
|
}),
|
|
13
13
|
};
|
|
14
|
-
static description = 'Update a Copado user story by ID';
|
|
14
|
+
static description = 'Update a Copado user story by ID or name';
|
|
15
15
|
static examples = [
|
|
16
16
|
'<%= config.bin %> <%= command.id %> --title "Updated story"',
|
|
17
17
|
'<%= config.bin %> <%= command.id %> --custom-field JIRA_Key__c=CICD-1',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../lib/agentia-command.js';
|
|
2
|
+
import { runInteractiveHelpAgent } from '../lib/help-agent-command.js';
|
|
3
|
+
export default class HelpAgent extends AgentiaCommand {
|
|
4
|
+
static description = `Chat interactively with the Copado Help Agent.
|
|
5
|
+
|
|
6
|
+
Starts without a credential preflight, sends bounded non-secret CLI context, and requests a fresh short-lived AI token through the CICD gateway for every turn. Type /help during the session to list chat commands.`;
|
|
7
|
+
static enableJsonFlag = false;
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
9
|
+
static experimental = true;
|
|
10
|
+
async run() {
|
|
11
|
+
await this.parse(HelpAgent);
|
|
12
|
+
return runInteractiveHelpAgent(this);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=help-agent.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Args, Flags, loadHelpClass } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../lib/agentia-command.js';
|
|
3
|
+
import { runInteractiveHelpAgent } from '../lib/help-agent-command.js';
|
|
4
|
+
export default class Help extends AgentiaCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
command: Args.string({ description: 'Command to show help for.', required: false }),
|
|
7
|
+
};
|
|
8
|
+
static description = 'Display help for <%= config.bin %> or open the interactive Copado support expert.';
|
|
9
|
+
static enableJsonFlag = false;
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %>',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> <command>',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --agent',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
agent: Flags.boolean({
|
|
17
|
+
description: 'Open the interactive Copado support expert.',
|
|
18
|
+
}),
|
|
19
|
+
'nested-commands': Flags.boolean({
|
|
20
|
+
char: 'n',
|
|
21
|
+
description: 'Include all nested commands in the output.',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
static strict = false;
|
|
25
|
+
async run() {
|
|
26
|
+
const { argv, flags } = await this.parse(Help);
|
|
27
|
+
if (flags.agent) {
|
|
28
|
+
if (argv.length > 0 || flags['nested-commands']) {
|
|
29
|
+
this.error('--agent cannot be combined with a command or --nested-commands.', { exit: 2 });
|
|
30
|
+
}
|
|
31
|
+
return runInteractiveHelpAgent(this);
|
|
32
|
+
}
|
|
33
|
+
const HelpClass = await loadHelpClass(this.config);
|
|
34
|
+
const help = new HelpClass(this.config, { all: flags['nested-commands'] });
|
|
35
|
+
await help.showHelp(argv);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
2
|
+
import { Flags } from '@oclif/core';
|
|
3
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
4
|
+
import { clearCommandHistory } from '../../lib/command-history.js';
|
|
5
|
+
import { clearHelpAgentInteractions } from '../../lib/help-agent-interaction-history.js';
|
|
6
|
+
import { redactErrorMessage } from '../../lib/secret-redaction.js';
|
|
7
|
+
export default class HistoryClear extends AgentiaCommand {
|
|
8
|
+
static description = 'Clear temporary command and Help Agent interaction history';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --yes',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --yes --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
yes: Flags.boolean({
|
|
15
|
+
char: 'y',
|
|
16
|
+
default: false,
|
|
17
|
+
description: 'Confirm clearing temporary history without prompting.',
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(HistoryClear);
|
|
22
|
+
if (!flags.yes) {
|
|
23
|
+
if (this.jsonEnabled() || process.stdin.isTTY !== true || process.stdout.isTTY !== true) {
|
|
24
|
+
this.error('Clearing temporary history requires confirmation. Pass --yes for headless or JSON execution.', {
|
|
25
|
+
exit: 2,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (!(await confirm({ default: false, message: 'Clear temporary command and Help Agent history?' }))) {
|
|
29
|
+
this.error('History clearing canceled.', { exit: 1 });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
await Promise.all([clearCommandHistory(), clearHelpAgentInteractions()]);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.error(`Could not clear temporary history: ${redactErrorMessage(error)}`, { exit: 1 });
|
|
37
|
+
}
|
|
38
|
+
this.display(() => this.log('Temporary history cleared.'));
|
|
39
|
+
return { cleared: true };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=clear.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
3
|
+
import { COMMAND_HISTORY_DEFAULT_LIST_LIMIT, COMMAND_HISTORY_LIMIT, readCommandHistory, } from '../../lib/command-history.js';
|
|
4
|
+
import { table } from '../../lib/format.js';
|
|
5
|
+
export default class HistoryList extends AgentiaCommand {
|
|
6
|
+
static description = 'List recent sanitized Agentia CLI command executions';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --limit 10',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --limit 10 --json',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
limit: Flags.integer({
|
|
14
|
+
default: COMMAND_HISTORY_DEFAULT_LIST_LIMIT,
|
|
15
|
+
description: 'Maximum entries to return (newest first).',
|
|
16
|
+
max: COMMAND_HISTORY_LIMIT,
|
|
17
|
+
min: 1,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(HistoryList);
|
|
22
|
+
const history = await readCommandHistory();
|
|
23
|
+
const entries = history.slice(-flags.limit).reverse();
|
|
24
|
+
this.display(() => {
|
|
25
|
+
if (entries.length === 0) {
|
|
26
|
+
this.log('No command history.');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.log(table([
|
|
30
|
+
{ alias: 'Timestamp', value: 'timestamp' },
|
|
31
|
+
{ alias: 'Command', minContentWidth: 12, value: 'commandId' },
|
|
32
|
+
{ alias: 'Origin', value: 'clientOrigin' },
|
|
33
|
+
{ alias: 'Status', value: 'status' },
|
|
34
|
+
{ alias: 'Exit', value: 'exitCode' },
|
|
35
|
+
{ alias: 'Duration', value: 'duration' },
|
|
36
|
+
{ alias: 'Workspace', minContentWidth: 8, value: 'workspace' },
|
|
37
|
+
], entries.map((entry) => ({
|
|
38
|
+
clientOrigin: entry.clientOrigin ?? 'unknown',
|
|
39
|
+
commandId: entry.commandId,
|
|
40
|
+
duration: `${entry.durationMs}ms`,
|
|
41
|
+
exitCode: entry.exitCode,
|
|
42
|
+
status: entry.status,
|
|
43
|
+
timestamp: entry.timestamp,
|
|
44
|
+
workspace: entry.workspace,
|
|
45
|
+
}))));
|
|
46
|
+
});
|
|
47
|
+
return { entries, limit: flags.limit, total: history.length };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../lib/agentia-command.js';
|
|
2
|
+
import { runInteractiveHelpAgent } from '../lib/help-agent-command.js';
|
|
3
|
+
export default class Support extends AgentiaCommand {
|
|
4
|
+
static description = `Chat interactively with the Copado support expert.
|
|
5
|
+
|
|
6
|
+
Sends bounded local CLI context and requests a fresh short-lived AI token through the CICD gateway for every turn. Type /help during the session to list chat commands.`;
|
|
7
|
+
static enableJsonFlag = false;
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
9
|
+
static experimental = true;
|
|
10
|
+
async run() {
|
|
11
|
+
await this.parse(Support);
|
|
12
|
+
return runInteractiveHelpAgent(this);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=support.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { testingBrowserCommonFlags, testingBrowserOptionalJobArg } from '../../../lib/testing-browser-command.js';
|
|
4
|
+
import { executeTestingLive } from '../../../lib/testing-browser-operations.js';
|
|
5
|
+
import { normalizeTestingLiveExecuteSource } from '../../../lib/testing-browser-requests.js';
|
|
6
|
+
import { TESTING_LIVE_MAX_ROBOT_BYTES } from '../../../lib/testing-browser-robot.js';
|
|
7
|
+
import { readBoundedStream } from '../../../lib/testing-secret-input.js';
|
|
8
|
+
export default class TestingBrowserExecute extends AgentiaCommand {
|
|
9
|
+
static args = testingBrowserOptionalJobArg;
|
|
10
|
+
static deprecateAliases = true;
|
|
11
|
+
static description = 'Execute Robot Framework keywords in an active CRT browser session';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --keyword GoTo --arg https://example.com',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --line "GoTo https://example.com"',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <job-id> --project <project-id> --file smoke.robot',
|
|
16
|
+
'cat smoke.robot | <%= config.bin %> <%= command.id %> --project <project-id> --stdin',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
...testingBrowserCommonFlags,
|
|
20
|
+
arg: Flags.string({ description: 'Keyword argument. Repeat for multiple arguments.', multiple: true }),
|
|
21
|
+
file: Flags.string({ description: 'Robot Framework input file.' }),
|
|
22
|
+
keyword: Flags.string({ description: 'Robot Framework keyword name.' }),
|
|
23
|
+
line: Flags.string({ description: 'Raw Robot Framework keyword line. Repeat for multiple lines.', multiple: true }),
|
|
24
|
+
raw: Flags.boolean({ default: false, description: 'Treat file or stdin input as raw keyword lines.' }),
|
|
25
|
+
stdin: Flags.boolean({ default: false, description: 'Read Robot Framework lines or suite content from stdin.' }),
|
|
26
|
+
};
|
|
27
|
+
static hiddenAliases = ['testing:live:execute'];
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(TestingBrowserExecute);
|
|
30
|
+
const source = normalizeTestingLiveExecuteSource({ file: flags.file, keyword: flags.keyword, lines: flags.line, stdin: flags.stdin }, { file: '--file', keyword: '--keyword', line: '--line', stdin: '--stdin' });
|
|
31
|
+
const stdinText = source === 'stdin'
|
|
32
|
+
? await readBoundedStream(process.stdin, 'Robot input', TESTING_LIVE_MAX_ROBOT_BYTES)
|
|
33
|
+
: undefined;
|
|
34
|
+
const result = await this.withSpinner('Executing CRT browser keyword', () => executeTestingLive({
|
|
35
|
+
args: flags.arg,
|
|
36
|
+
file: flags.file,
|
|
37
|
+
jobId: args['job-id'],
|
|
38
|
+
keyword: flags.keyword,
|
|
39
|
+
lines: flags.line,
|
|
40
|
+
projectId: flags.project,
|
|
41
|
+
raw: flags.raw,
|
|
42
|
+
sessionId: flags['session-id'],
|
|
43
|
+
text: stdinText,
|
|
44
|
+
}));
|
|
45
|
+
this.display(() => this.log(`Execution ${result.executionId}: ${result.status}`));
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { testingBrowserCommonFlags } from '../../../lib/testing-browser-command.js';
|
|
4
|
+
import { getTestingLiveHistory } from '../../../lib/testing-browser-operations.js';
|
|
5
|
+
import { formatTestingLiveHistoryLines } from '../../../lib/testing-browser-requests.js';
|
|
6
|
+
export default class TestingBrowserHistory extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
'job-id': Args.integer({ description: 'CRT job ID; defaults to the active session.', required: false }),
|
|
9
|
+
};
|
|
10
|
+
static deprecateAliases = true;
|
|
11
|
+
static description = 'Read local CRT browser execution history';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> <%= command.id %> <job-id> --project <project-id> --limit 20 --json',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --keyword ClickText --lines-only',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...testingBrowserCommonFlags,
|
|
18
|
+
'include-failed': Flags.boolean({ default: false, description: 'Include failed keyword executions.' }),
|
|
19
|
+
job: Flags.integer({
|
|
20
|
+
description: 'CRT job ID override; defaults to the positional job-id or active session.',
|
|
21
|
+
min: 1,
|
|
22
|
+
}),
|
|
23
|
+
keyword: Flags.string({ description: 'Filter to records containing this Robot Framework keyword name.' }),
|
|
24
|
+
limit: Flags.integer({ default: 10, description: 'Maximum records to return.', max: 500, min: 1 }),
|
|
25
|
+
'lines-only': Flags.boolean({ default: false, description: 'Print only the keyword lines for script export.' }),
|
|
26
|
+
status: Flags.option({
|
|
27
|
+
description: 'Execution status filter.',
|
|
28
|
+
options: ['completed', 'failed', 'recorded'],
|
|
29
|
+
})(),
|
|
30
|
+
};
|
|
31
|
+
static hiddenAliases = ['testing:live:history'];
|
|
32
|
+
async run() {
|
|
33
|
+
const { args, flags } = await this.parse(TestingBrowserHistory);
|
|
34
|
+
const result = await getTestingLiveHistory({
|
|
35
|
+
includeFailed: flags['include-failed'],
|
|
36
|
+
jobId: args['job-id'] ?? flags.job,
|
|
37
|
+
keyword: flags.keyword,
|
|
38
|
+
limit: flags.limit,
|
|
39
|
+
projectId: flags.project,
|
|
40
|
+
status: flags.status,
|
|
41
|
+
});
|
|
42
|
+
this.display(() => {
|
|
43
|
+
for (const line of formatTestingLiveHistoryLines(result, flags['lines-only']))
|
|
44
|
+
this.log(line);
|
|
45
|
+
});
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { testingBrowserCommonFlags, testingBrowserOptionalJobArg } from '../../../lib/testing-browser-command.js';
|
|
4
|
+
import { inspectTestingLive } from '../../../lib/testing-browser-operations.js';
|
|
5
|
+
import { normalizeTestingLiveInspectDom } from '../../../lib/testing-browser-requests.js';
|
|
6
|
+
import { formatTestingRecord } from '../../../lib/testing-types.js';
|
|
7
|
+
export default class TestingBrowserInspect extends AgentiaCommand {
|
|
8
|
+
static args = testingBrowserOptionalJobArg;
|
|
9
|
+
static deprecateAliases = true;
|
|
10
|
+
static description = 'Inspect page state from an active CRT browser session';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --json',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --dom --output page.html',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
...testingBrowserCommonFlags,
|
|
17
|
+
dom: Flags.boolean({ default: false, description: 'Fetch raw page DOM; requires --output unless --json is used.' }),
|
|
18
|
+
output: Flags.string({ dependsOn: ['dom'], description: 'Output file path for raw DOM.' }),
|
|
19
|
+
};
|
|
20
|
+
static hiddenAliases = ['testing:live:inspect'];
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(TestingBrowserInspect);
|
|
23
|
+
const dom = normalizeTestingLiveInspectDom({ dom: flags.dom, json: this.jsonEnabled(), output: flags.output });
|
|
24
|
+
const result = await this.withSpinner('Inspecting CRT browser session', () => inspectTestingLive({
|
|
25
|
+
...dom,
|
|
26
|
+
jobId: args['job-id'],
|
|
27
|
+
output: flags.output,
|
|
28
|
+
projectId: flags.project,
|
|
29
|
+
sessionId: flags['session-id'],
|
|
30
|
+
}));
|
|
31
|
+
this.display(() => this.log(flags.dom ? `DOM written to ${String(result.path)}.` : formatTestingRecord(result)));
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=inspect.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { testingBrowserCommonFlags, testingBrowserOptionalJobArg } from '../../../lib/testing-browser-command.js';
|
|
4
|
+
import { recordTestingLiveSession } from '../../../lib/testing-browser-operations.js';
|
|
5
|
+
export default class TestingBrowserRecorder extends AgentiaCommand {
|
|
6
|
+
static args = testingBrowserOptionalJobArg;
|
|
7
|
+
static deprecateAliases = true;
|
|
8
|
+
static description = 'Record CRT browser interactions as Robot Framework lines';
|
|
9
|
+
static enableJsonFlag = false;
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --output recorded.robot',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --json',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
...testingBrowserCommonFlags,
|
|
16
|
+
debug: Flags.boolean({ default: false, description: 'Print recorder event types and sizes.' }),
|
|
17
|
+
force: Flags.boolean({ default: false, description: 'Override an existing recorder lock for this session.' }),
|
|
18
|
+
json: Flags.boolean({ default: false, description: 'Stream each recorded keyword event as a JSON line.' }),
|
|
19
|
+
'no-enable': Flags.boolean({ default: false, description: 'Do not manage the server recorder toggle.' }),
|
|
20
|
+
output: Flags.string({ char: 'o', description: 'Robot file to append recorded keywords to.' }),
|
|
21
|
+
};
|
|
22
|
+
static hiddenAliases = ['testing:live:recorder'];
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(TestingBrowserRecorder);
|
|
25
|
+
const controller = new AbortController();
|
|
26
|
+
const stop = () => controller.abort();
|
|
27
|
+
process.once('SIGINT', stop);
|
|
28
|
+
try {
|
|
29
|
+
return await recordTestingLiveSession({
|
|
30
|
+
appendRobot: flags.output,
|
|
31
|
+
force: flags.force,
|
|
32
|
+
jobId: args['job-id'],
|
|
33
|
+
noEnable: flags['no-enable'],
|
|
34
|
+
onError: (error) => this.warn(error.message),
|
|
35
|
+
onFrameSummary: flags.debug
|
|
36
|
+
? ({ bytes, type }) => this.warn(`Recorder event ${type} (${bytes} bytes).`)
|
|
37
|
+
: undefined,
|
|
38
|
+
onKeywordLine: flags.json ? undefined : (line) => this.log(line),
|
|
39
|
+
onReady: flags.json ? undefined : () => this.log('Recording CRT interactions. Press Ctrl-C to stop.'),
|
|
40
|
+
onRecorderEvent: flags.json ? (event) => this.log(JSON.stringify(event)) : undefined,
|
|
41
|
+
onTimeout: (message) => this.warn(`Recorder session timed out: ${message}`),
|
|
42
|
+
projectId: flags.project,
|
|
43
|
+
sessionId: flags['session-id'],
|
|
44
|
+
signal: controller.signal,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
process.removeListener('SIGINT', stop);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=recorder.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { testingBrowserCommonFlags, testingBrowserOptionalJobArg } from '../../../lib/testing-browser-command.js';
|
|
4
|
+
import { saveTestingLiveScreenshot } from '../../../lib/testing-browser-operations.js';
|
|
5
|
+
export default class TestingBrowserScreenshot extends AgentiaCommand {
|
|
6
|
+
static args = testingBrowserOptionalJobArg;
|
|
7
|
+
static deprecateAliases = true;
|
|
8
|
+
static description = 'Save a CRT browser screenshot to a file';
|
|
9
|
+
static examples = ['<%= config.bin %> <%= command.id %> --project <project-id> --output screenshot.png'];
|
|
10
|
+
static flags = {
|
|
11
|
+
...testingBrowserCommonFlags,
|
|
12
|
+
output: Flags.string({ char: 'o', description: 'Screenshot output file path.', required: true }),
|
|
13
|
+
};
|
|
14
|
+
static hiddenAliases = ['testing:live:screenshot'];
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(TestingBrowserScreenshot);
|
|
17
|
+
const result = await this.withSpinner('Saving CRT browser screenshot', () => saveTestingLiveScreenshot({
|
|
18
|
+
jobId: args['job-id'],
|
|
19
|
+
output: flags.output,
|
|
20
|
+
projectId: flags.project,
|
|
21
|
+
sessionId: flags['session-id'],
|
|
22
|
+
}));
|
|
23
|
+
this.display(() => this.log(`Wrote ${result.bytes} bytes to ${result.path}.`));
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=screenshot.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { testingBrowserCommonFlags, testingBrowserOptionalJobArg, testingBrowserRecorderOptionFlags, } from '../../../lib/testing-browser-command.js';
|
|
3
|
+
import { setTestingLiveOptions } from '../../../lib/testing-browser-operations.js';
|
|
4
|
+
import { normalizeTestingLiveRecorderOptions } from '../../../lib/testing-browser-requests.js';
|
|
5
|
+
export default class TestingBrowserSetOptions extends AgentiaCommand {
|
|
6
|
+
static args = testingBrowserOptionalJobArg;
|
|
7
|
+
static deprecateAliases = true;
|
|
8
|
+
static description = 'Set CRT browser recorder options';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --project <project-id> --enable --scroll-text --table-keywords',
|
|
11
|
+
];
|
|
12
|
+
static flags = { ...testingBrowserCommonFlags, ...testingBrowserRecorderOptionFlags };
|
|
13
|
+
static hiddenAliases = ['testing:live:set-options'];
|
|
14
|
+
async run() {
|
|
15
|
+
const { args, flags } = await this.parse(TestingBrowserSetOptions);
|
|
16
|
+
const recorder = normalizeTestingLiveRecorderOptions({
|
|
17
|
+
enabled: flags.enable,
|
|
18
|
+
enableHealingContext: flags['healing-context'],
|
|
19
|
+
enableHoverText: flags['hover-text'],
|
|
20
|
+
enableScrollText: flags['scroll-text'],
|
|
21
|
+
enableSystemState: flags['system-state'],
|
|
22
|
+
enableVerifyText: flags['verify-text'],
|
|
23
|
+
preferTableKeywords: flags['table-keywords'],
|
|
24
|
+
});
|
|
25
|
+
const result = await setTestingLiveOptions({
|
|
26
|
+
jobId: args['job-id'],
|
|
27
|
+
projectId: flags.project,
|
|
28
|
+
recorder,
|
|
29
|
+
sessionId: flags['session-id'],
|
|
30
|
+
});
|
|
31
|
+
this.display(() => this.log('CRT browser recorder options updated.'));
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=set-options.js.map
|