@copado/agentia-cli 0.37.0-alpha.0 → 0.40.0-alpha.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/README.md +573 -136
- package/dist/commands/auth/set.d.ts +2 -13
- package/dist/commands/auth/set.js +42 -110
- package/dist/commands/auth/set.js.map +1 -1
- package/dist/commands/auth/unset.d.ts +15 -0
- package/dist/commands/auth/unset.js +64 -0
- package/dist/commands/auth/unset.js.map +1 -0
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +16 -7
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/testing/build/abort.d.ts +26 -0
- package/dist/commands/testing/build/abort.js +38 -0
- package/dist/commands/testing/build/abort.js.map +1 -0
- package/dist/commands/testing/build/list.js +2 -2
- package/dist/commands/testing/build/list.js.map +1 -1
- package/dist/commands/testing/build/run.d.ts +8 -0
- package/dist/commands/testing/build/run.js +4 -2
- package/dist/commands/testing/build/run.js.map +1 -1
- package/dist/commands/testing/job/create.d.ts +7 -0
- package/dist/commands/testing/job/create.js +11 -2
- package/dist/commands/testing/job/create.js.map +1 -1
- package/dist/commands/testing/job/delete.d.ts +24 -0
- package/dist/commands/testing/job/delete.js +30 -0
- package/dist/commands/testing/job/delete.js.map +1 -0
- package/dist/commands/testing/job/list.js +2 -2
- package/dist/commands/testing/job/list.js.map +1 -1
- package/dist/commands/testing/job/run.d.ts +1 -0
- package/dist/commands/testing/job/run.js +2 -0
- package/dist/commands/testing/job/run.js.map +1 -0
- package/dist/commands/testing/job/update.d.ts +42 -0
- package/dist/commands/testing/job/update.js +137 -0
- package/dist/commands/testing/job/update.js.map +1 -0
- package/dist/commands/testing/project/delete.d.ts +22 -0
- package/dist/commands/testing/project/delete.js +29 -0
- package/dist/commands/testing/project/delete.js.map +1 -0
- package/dist/commands/testing/robot/delete.d.ts +21 -0
- package/dist/commands/testing/robot/delete.js +30 -0
- package/dist/commands/testing/robot/delete.js.map +1 -0
- package/dist/commands/testing/run.d.ts +8 -0
- package/dist/commands/testing/run.js +4 -2
- package/dist/commands/testing/run.js.map +1 -1
- package/dist/commands/testing/status.js +2 -2
- package/dist/commands/testing/status.js.map +1 -1
- package/dist/commands/testing/test/run.d.ts +34 -1
- package/dist/commands/testing/test/run.js +58 -1
- package/dist/commands/testing/test/run.js.map +1 -1
- package/dist/commands/testing/variable/create.d.ts +1 -1
- package/dist/commands/testing/variable/update.d.ts +21 -0
- package/dist/commands/testing/variable/update.js +63 -0
- package/dist/commands/testing/variable/update.js.map +1 -0
- package/dist/lib/auth-config.d.ts +62 -0
- package/dist/lib/auth-config.js +246 -0
- package/dist/lib/auth-config.js.map +1 -0
- package/dist/lib/credential-store.d.ts +3 -0
- package/dist/lib/credential-store.js +9 -0
- package/dist/lib/credential-store.js.map +1 -1
- package/dist/lib/cursor-mcp-config.d.ts +62 -0
- package/dist/lib/cursor-mcp-config.js +173 -0
- package/dist/lib/cursor-mcp-config.js.map +1 -0
- package/dist/lib/mcp/testing-tools.d.ts +98 -2
- package/dist/lib/mcp/testing-tools.js +227 -15
- package/dist/lib/mcp/testing-tools.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +158 -0
- package/dist/lib/mcp/tools.js +10 -34
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/project-setup.d.ts +16 -14
- package/dist/lib/project-setup.js +101 -145
- package/dist/lib/project-setup.js.map +1 -1
- package/dist/lib/setup-prompts.d.ts +30 -0
- package/dist/lib/setup-prompts.js +13 -0
- package/dist/lib/setup-prompts.js.map +1 -0
- package/dist/lib/setup-wizard.d.ts +42 -0
- package/dist/lib/setup-wizard.js +422 -0
- package/dist/lib/setup-wizard.js.map +1 -0
- package/dist/lib/testing-config.d.ts +4 -2
- package/dist/lib/testing-config.js +23 -3
- package/dist/lib/testing-config.js.map +1 -1
- package/dist/lib/testing-flags.d.ts +35 -1
- package/dist/lib/testing-flags.js +85 -0
- package/dist/lib/testing-flags.js.map +1 -1
- package/dist/lib/testing-gateway.d.ts +13 -0
- package/dist/lib/testing-gateway.js +42 -1
- package/dist/lib/testing-gateway.js.map +1 -1
- package/dist/lib/testing-operations.d.ts +93 -5
- package/dist/lib/testing-operations.js +211 -19
- package/dist/lib/testing-operations.js.map +1 -1
- package/dist/lib/testing-types.d.ts +76 -5
- package/dist/lib/testing-types.js +65 -1
- package/dist/lib/testing-types.js.map +1 -1
- package/oclif.manifest.json +1237 -191
- package/package.json +2 -1
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { applyAuthSet, formatCicdApiKeyHelp, getCicdAuthStatus, getCrtAuthStatus, } from './auth-config.js';
|
|
3
|
+
import { normalizeCicdBaseUrl } from './cicd-gateway.js';
|
|
4
|
+
import { detectCursorInstall, getCursorMcpStatus, globalCursorMcpPath, localCursorMcpPath, upsertAgentiaCursorMcp, } from './cursor-mcp-config.js';
|
|
5
|
+
import { resolveProjectContext, runProjectSetup, } from './project-setup.js';
|
|
6
|
+
import { createInquirerSetupPrompts } from './setup-prompts.js';
|
|
7
|
+
import { normalizeCrtDomain, normalizeCrtOrgId } from './testing-config.js';
|
|
8
|
+
let testWizardDeps;
|
|
9
|
+
export function setSetupWizardDepsForTests(deps) {
|
|
10
|
+
testWizardDeps = deps;
|
|
11
|
+
}
|
|
12
|
+
export function resetSetupWizardDepsForTests() {
|
|
13
|
+
testWizardDeps = undefined;
|
|
14
|
+
}
|
|
15
|
+
function resolveWizardDeps(overrides = {}) {
|
|
16
|
+
const merged = { ...testWizardDeps, ...overrides };
|
|
17
|
+
return {
|
|
18
|
+
...merged,
|
|
19
|
+
applyAuthSet: merged.applyAuthSet ?? applyAuthSet,
|
|
20
|
+
detectCursorInstall: merged.detectCursorInstall ?? detectCursorInstall,
|
|
21
|
+
getCicdAuthStatus: merged.getCicdAuthStatus ?? getCicdAuthStatus,
|
|
22
|
+
getCrtAuthStatus: merged.getCrtAuthStatus ?? getCrtAuthStatus,
|
|
23
|
+
getCursorMcpStatus: merged.getCursorMcpStatus ?? getCursorMcpStatus,
|
|
24
|
+
upsertAgentiaCursorMcp: merged.upsertAgentiaCursorMcp ?? upsertAgentiaCursorMcp,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function withCursorStatus(current, action) {
|
|
28
|
+
return {
|
|
29
|
+
...current,
|
|
30
|
+
status: action,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function logSection(log, title) {
|
|
34
|
+
log('');
|
|
35
|
+
log(title);
|
|
36
|
+
}
|
|
37
|
+
function formatCicdStatusLine(status) {
|
|
38
|
+
if (!status.set) {
|
|
39
|
+
if (status.local && status.baseUrl) {
|
|
40
|
+
return `CICD: not set (endpoint: ${status.baseUrl}, local)`;
|
|
41
|
+
}
|
|
42
|
+
return 'CICD: not set';
|
|
43
|
+
}
|
|
44
|
+
const endpoint = status.baseUrl ?? 'not set';
|
|
45
|
+
const localSuffix = status.local ? ', local' : '';
|
|
46
|
+
return `CICD: ${status.masked} (endpoint: ${endpoint}${localSuffix})`;
|
|
47
|
+
}
|
|
48
|
+
function formatCrtStatusLine(status) {
|
|
49
|
+
const domain = status.domain ?? 'not set';
|
|
50
|
+
const orgId = status.orgId ?? 'not set';
|
|
51
|
+
if (!status.set) {
|
|
52
|
+
return `CRT: not set (domain: ${domain}, org: ${orgId})`;
|
|
53
|
+
}
|
|
54
|
+
return `CRT: ${status.masked} (domain: ${domain}, org: ${orgId})`;
|
|
55
|
+
}
|
|
56
|
+
async function runWithSpinner(options, message, action) {
|
|
57
|
+
if (options.withSpinner === undefined) {
|
|
58
|
+
return action();
|
|
59
|
+
}
|
|
60
|
+
return options.withSpinner(message, action);
|
|
61
|
+
}
|
|
62
|
+
async function configureCicd(context) {
|
|
63
|
+
const { deps, log, options, prompts } = context;
|
|
64
|
+
const current = deps.getCicdAuthStatus();
|
|
65
|
+
log(formatCicdStatusLine(current));
|
|
66
|
+
if (options.noPrompt || prompts === undefined) {
|
|
67
|
+
return {
|
|
68
|
+
baseUrl: current.baseUrl ?? undefined,
|
|
69
|
+
configured: current.set,
|
|
70
|
+
status: current.set ? 'unchanged' : 'skipped',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const shouldConfigure = await prompts.confirm({
|
|
74
|
+
default: !current.set,
|
|
75
|
+
message: current.set ? 'Reconfigure CICD authentication?' : 'Configure CICD authentication?',
|
|
76
|
+
});
|
|
77
|
+
if (!shouldConfigure) {
|
|
78
|
+
log('Skipped CICD authentication.');
|
|
79
|
+
return {
|
|
80
|
+
baseUrl: current.baseUrl ?? undefined,
|
|
81
|
+
configured: current.set,
|
|
82
|
+
status: 'skipped',
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
log(formatCicdApiKeyHelp());
|
|
86
|
+
while (true) {
|
|
87
|
+
// Sequential prompts are required to retry authentication with a new key.
|
|
88
|
+
// eslint-disable-next-line no-await-in-loop
|
|
89
|
+
const apiKey = await prompts.password({
|
|
90
|
+
message: 'Copado API key',
|
|
91
|
+
validate: (value) => (value.trim().length > 0 ? true : 'Copado API key cannot be empty.'),
|
|
92
|
+
});
|
|
93
|
+
// eslint-disable-next-line no-await-in-loop
|
|
94
|
+
const endpointMode = await prompts.select({
|
|
95
|
+
choices: [
|
|
96
|
+
{ name: 'Auto-detect', value: 'auto' },
|
|
97
|
+
{ name: 'Custom URL', value: 'custom' },
|
|
98
|
+
],
|
|
99
|
+
default: 'auto',
|
|
100
|
+
message: 'CICD API URL',
|
|
101
|
+
});
|
|
102
|
+
let customUrl;
|
|
103
|
+
if (endpointMode === 'custom') {
|
|
104
|
+
// eslint-disable-next-line no-await-in-loop
|
|
105
|
+
customUrl = await prompts.input({
|
|
106
|
+
message: 'CICD custom URL',
|
|
107
|
+
validate(value) {
|
|
108
|
+
try {
|
|
109
|
+
normalizeCicdBaseUrl(value);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
return error.message;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
// eslint-disable-next-line no-await-in-loop
|
|
120
|
+
const result = await runWithSpinner(options, endpointMode === 'custom' ? 'Validating CICD API key for custom endpoint' : 'Discovering CICD endpoint', () => deps.applyAuthSet({
|
|
121
|
+
cicd: apiKey,
|
|
122
|
+
customUrl,
|
|
123
|
+
}));
|
|
124
|
+
log(`Stored CICD endpoint: ${result.baseUrl}.`);
|
|
125
|
+
return {
|
|
126
|
+
baseUrl: result.baseUrl,
|
|
127
|
+
configured: true,
|
|
128
|
+
status: current.set ? 'updated' : 'created',
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
log(error.message);
|
|
133
|
+
// eslint-disable-next-line no-await-in-loop
|
|
134
|
+
const retry = await prompts.confirm({
|
|
135
|
+
default: true,
|
|
136
|
+
message: 'CICD authentication failed. Try another API key?',
|
|
137
|
+
});
|
|
138
|
+
if (!retry) {
|
|
139
|
+
return {
|
|
140
|
+
baseUrl: current.baseUrl ?? undefined,
|
|
141
|
+
configured: current.set,
|
|
142
|
+
status: 'failed',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// CRT prompts, discovery, and storage are intentionally sequential.
|
|
149
|
+
// eslint-disable-next-line complexity
|
|
150
|
+
async function configureCrt(context) {
|
|
151
|
+
const { deps, log, options, prompts } = context;
|
|
152
|
+
const current = deps.getCrtAuthStatus();
|
|
153
|
+
log(formatCrtStatusLine(current));
|
|
154
|
+
if (options.noPrompt || prompts === undefined) {
|
|
155
|
+
return {
|
|
156
|
+
configured: current.set,
|
|
157
|
+
domain: current.domain ?? undefined,
|
|
158
|
+
orgId: current.orgId ?? undefined,
|
|
159
|
+
status: current.set ? 'unchanged' : 'skipped',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const shouldConfigure = await prompts.confirm({
|
|
163
|
+
default: !current.set,
|
|
164
|
+
message: current.set ? 'Reconfigure CRT authentication?' : 'Configure CRT authentication?',
|
|
165
|
+
});
|
|
166
|
+
if (!shouldConfigure) {
|
|
167
|
+
log('Skipped CRT authentication.');
|
|
168
|
+
return {
|
|
169
|
+
configured: current.set,
|
|
170
|
+
domain: current.domain ?? undefined,
|
|
171
|
+
orgId: current.orgId ?? undefined,
|
|
172
|
+
status: 'skipped',
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
while (true) {
|
|
176
|
+
// Sequential prompts are required to retry authentication with new credentials.
|
|
177
|
+
// eslint-disable-next-line no-await-in-loop
|
|
178
|
+
const pat = await prompts.password({
|
|
179
|
+
message: 'CRT PAT token',
|
|
180
|
+
validate: (value) => (value.trim().length > 0 ? true : 'CRT PAT token cannot be empty.'),
|
|
181
|
+
});
|
|
182
|
+
// eslint-disable-next-line no-await-in-loop
|
|
183
|
+
const orgRaw = await prompts.input({
|
|
184
|
+
default: current.orgId ?? undefined,
|
|
185
|
+
message: 'CRT organization ID',
|
|
186
|
+
validate(value) {
|
|
187
|
+
try {
|
|
188
|
+
normalizeCrtOrgId(value);
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
return error.message;
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
const orgId = normalizeCrtOrgId(orgRaw);
|
|
197
|
+
// eslint-disable-next-line no-await-in-loop
|
|
198
|
+
const endpointMode = await prompts.select({
|
|
199
|
+
choices: [
|
|
200
|
+
{ name: 'Auto-detect', value: 'auto' },
|
|
201
|
+
{ name: 'Custom domain', value: 'custom' },
|
|
202
|
+
],
|
|
203
|
+
default: 'auto',
|
|
204
|
+
message: 'CRT domain',
|
|
205
|
+
});
|
|
206
|
+
let crtDomain;
|
|
207
|
+
if (endpointMode === 'custom') {
|
|
208
|
+
// eslint-disable-next-line no-await-in-loop
|
|
209
|
+
crtDomain = await prompts.input({
|
|
210
|
+
default: current.domain ?? undefined,
|
|
211
|
+
message: 'CRT custom domain',
|
|
212
|
+
validate(value) {
|
|
213
|
+
try {
|
|
214
|
+
normalizeCrtDomain(value);
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
return error.message;
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
// eslint-disable-next-line no-await-in-loop
|
|
225
|
+
const result = await runWithSpinner(options, endpointMode === 'custom' ? 'Validating CRT credentials for custom domain' : 'Discovering CRT domain', () => deps.applyAuthSet({
|
|
226
|
+
crt: pat,
|
|
227
|
+
crtDomain,
|
|
228
|
+
crtOrg: orgId,
|
|
229
|
+
}));
|
|
230
|
+
const storedDomain = result.crt?.domain ?? crtDomain;
|
|
231
|
+
const storedOrgId = (result.crt?.orgId ?? orgId).toString();
|
|
232
|
+
if (storedDomain !== undefined) {
|
|
233
|
+
log(`Stored CRT domain: ${storedDomain}.`);
|
|
234
|
+
}
|
|
235
|
+
log(`Stored CRT organization ID: ${storedOrgId}.`);
|
|
236
|
+
return {
|
|
237
|
+
configured: true,
|
|
238
|
+
domain: storedDomain,
|
|
239
|
+
orgId: storedOrgId,
|
|
240
|
+
status: current.set ? 'updated' : 'created',
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
log(error.message);
|
|
245
|
+
// eslint-disable-next-line no-await-in-loop
|
|
246
|
+
const retry = await prompts.confirm({
|
|
247
|
+
default: true,
|
|
248
|
+
message: 'CRT authentication failed. Try another PAT token?',
|
|
249
|
+
});
|
|
250
|
+
if (!retry) {
|
|
251
|
+
return {
|
|
252
|
+
configured: current.set,
|
|
253
|
+
domain: current.domain ?? undefined,
|
|
254
|
+
orgId: current.orgId ?? undefined,
|
|
255
|
+
status: 'failed',
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function cursorStatusLabel(status) {
|
|
262
|
+
if (status.configured) {
|
|
263
|
+
const name = status.serverName === undefined ? '' : ` as "${status.serverName}"`;
|
|
264
|
+
return `configured${name} (${status.path})`;
|
|
265
|
+
}
|
|
266
|
+
if (status.conflicting) {
|
|
267
|
+
return `different Agentia entry (${status.path})`;
|
|
268
|
+
}
|
|
269
|
+
if (status.exists) {
|
|
270
|
+
return `not configured (${status.path})`;
|
|
271
|
+
}
|
|
272
|
+
return `not found (${status.path})`;
|
|
273
|
+
}
|
|
274
|
+
async function configureCursorMcp(context, projectRoot) {
|
|
275
|
+
const { deps, log, options, prompts } = context;
|
|
276
|
+
const install = deps.detectCursorInstall();
|
|
277
|
+
const status = await deps.getCursorMcpStatus(projectRoot);
|
|
278
|
+
log(`Cursor install: ${install.detected ? 'detected' : 'not detected (advisory)'}`);
|
|
279
|
+
log(`Project MCP: ${cursorStatusLabel(status.local)}`);
|
|
280
|
+
log(`Global MCP: ${cursorStatusLabel(status.global)}`);
|
|
281
|
+
if (status.local.configured && status.global.configured) {
|
|
282
|
+
log('Agentia MCP is already configured for Cursor locally and globally.');
|
|
283
|
+
return {
|
|
284
|
+
detected: install.detected,
|
|
285
|
+
global: withCursorStatus(status.global, 'unchanged'),
|
|
286
|
+
local: withCursorStatus(status.local, 'unchanged'),
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (options.noPrompt || prompts === undefined) {
|
|
290
|
+
return {
|
|
291
|
+
detected: install.detected,
|
|
292
|
+
global: withCursorStatus(status.global, status.global.configured ? 'unchanged' : 'skipped'),
|
|
293
|
+
local: withCursorStatus(status.local, status.local.configured ? 'unchanged' : 'skipped'),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
const shouldConfigure = await prompts.confirm({
|
|
297
|
+
default: !status.local.configured && !status.global.configured,
|
|
298
|
+
message: 'Configure Agentia MCP for Cursor?',
|
|
299
|
+
});
|
|
300
|
+
if (!shouldConfigure) {
|
|
301
|
+
log('Skipped Cursor MCP configuration.');
|
|
302
|
+
return {
|
|
303
|
+
detected: install.detected,
|
|
304
|
+
global: withCursorStatus(status.global, 'skipped'),
|
|
305
|
+
local: withCursorStatus(status.local, 'skipped'),
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
const scope = await prompts.select({
|
|
309
|
+
choices: [
|
|
310
|
+
{ name: 'Project (.cursor/mcp.json)', value: 'local' },
|
|
311
|
+
{ name: 'Global (~/.cursor/mcp.json)', value: 'global' },
|
|
312
|
+
{ name: 'Both', value: 'both' },
|
|
313
|
+
],
|
|
314
|
+
message: 'Where should Agentia MCP be configured?',
|
|
315
|
+
});
|
|
316
|
+
const writeScope = async (target, current) => {
|
|
317
|
+
if (current.configured) {
|
|
318
|
+
log(`Agentia MCP already configured (${current.path}).`);
|
|
319
|
+
return withCursorStatus(current, 'unchanged');
|
|
320
|
+
}
|
|
321
|
+
if (current.conflicting) {
|
|
322
|
+
const replace = await prompts.confirm({
|
|
323
|
+
default: false,
|
|
324
|
+
message: `Replace the existing Agentia MCP entry in ${current.path}?`,
|
|
325
|
+
});
|
|
326
|
+
if (!replace) {
|
|
327
|
+
log(`Left existing Agentia MCP entry unchanged (${current.path}).`);
|
|
328
|
+
return withCursorStatus(current, 'skipped');
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
const filePath = target === 'local' ? localCursorMcpPath(projectRoot) : globalCursorMcpPath(deps.homedir?.() ?? homedir());
|
|
332
|
+
try {
|
|
333
|
+
const written = await deps.upsertAgentiaCursorMcp(filePath);
|
|
334
|
+
log(`Agentia MCP ${written.status} at ${written.path}. Restart Cursor to load the server.`);
|
|
335
|
+
return {
|
|
336
|
+
configured: true,
|
|
337
|
+
conflicting: false,
|
|
338
|
+
exists: true,
|
|
339
|
+
path: written.path,
|
|
340
|
+
status: written.status,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
log(error.message);
|
|
345
|
+
return withCursorStatus(current, 'failed');
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
let localResult = withCursorStatus(status.local, status.local.configured ? 'unchanged' : 'skipped');
|
|
349
|
+
let globalResult = withCursorStatus(status.global, status.global.configured ? 'unchanged' : 'skipped');
|
|
350
|
+
if (scope === 'local' || scope === 'both') {
|
|
351
|
+
localResult = await writeScope('local', status.local);
|
|
352
|
+
}
|
|
353
|
+
if (scope === 'global' || scope === 'both') {
|
|
354
|
+
globalResult = await writeScope('global', status.global);
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
detected: install.detected,
|
|
358
|
+
global: globalResult,
|
|
359
|
+
local: localResult,
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function buildNextSteps(params) {
|
|
363
|
+
const steps = [];
|
|
364
|
+
if (!params.cicdConfigured) {
|
|
365
|
+
steps.push(`Run \`${params.bin} auth set --cicd <copado-api-key>\` (or \`${params.bin} setup\`) to store CICD credentials.`);
|
|
366
|
+
}
|
|
367
|
+
if (!params.crtConfigured) {
|
|
368
|
+
steps.push(`Run \`${params.bin} auth set --crt <pat-token> --crt-org <org-id>\` to store CRT credentials.`);
|
|
369
|
+
}
|
|
370
|
+
if (!params.mcpConfigured) {
|
|
371
|
+
steps.push(`If you use Cursor, configure it to run \`${params.bin} mcp start\` as an MCP server.`);
|
|
372
|
+
}
|
|
373
|
+
if (steps.length === 0) {
|
|
374
|
+
steps.push(`Use \`${params.bin} work list --assigned-to-me\` to start working on a user story.`);
|
|
375
|
+
}
|
|
376
|
+
return steps;
|
|
377
|
+
}
|
|
378
|
+
export async function runSetupWizard(options = {}, deps = {}) {
|
|
379
|
+
const resolved = resolveWizardDeps(deps);
|
|
380
|
+
const bin = options.bin ?? 'agentia';
|
|
381
|
+
const log = options.log ?? (() => {
|
|
382
|
+
/* no human output */
|
|
383
|
+
});
|
|
384
|
+
const noPrompt = options.noPrompt ?? false;
|
|
385
|
+
const prompts = noPrompt ? undefined : (resolved.prompts ?? createInquirerSetupPrompts());
|
|
386
|
+
const cwd = options.cwd ?? process.cwd();
|
|
387
|
+
const context = await resolveProjectContext(cwd, resolved);
|
|
388
|
+
const section = { deps: resolved, log, options, prompts };
|
|
389
|
+
logSection(log, 'CICD authentication');
|
|
390
|
+
const cicd = await configureCicd(section);
|
|
391
|
+
logSection(log, 'CRT authentication');
|
|
392
|
+
const crt = await configureCrt(section);
|
|
393
|
+
logSection(log, 'Cursor MCP');
|
|
394
|
+
const cursorMcp = await configureCursorMcp(section, context.projectRoot);
|
|
395
|
+
logSection(log, 'Project files');
|
|
396
|
+
const assets = await runProjectSetup({
|
|
397
|
+
...options,
|
|
398
|
+
log,
|
|
399
|
+
noPrompt,
|
|
400
|
+
}, {
|
|
401
|
+
...resolved,
|
|
402
|
+
prompts,
|
|
403
|
+
});
|
|
404
|
+
const nextSteps = buildNextSteps({
|
|
405
|
+
bin,
|
|
406
|
+
cicdConfigured: cicd.configured,
|
|
407
|
+
crtConfigured: crt.configured,
|
|
408
|
+
mcpConfigured: cursorMcp.local.configured || cursorMcp.global.configured,
|
|
409
|
+
});
|
|
410
|
+
log('');
|
|
411
|
+
log('Next steps:');
|
|
412
|
+
for (const step of nextSteps) {
|
|
413
|
+
log(` • ${step}`);
|
|
414
|
+
}
|
|
415
|
+
return {
|
|
416
|
+
...assets,
|
|
417
|
+
auth: { cicd, crt },
|
|
418
|
+
cursorMcp,
|
|
419
|
+
nextSteps,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
//# sourceMappingURL=setup-wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-wizard.js","sourceRoot":"","sources":["../../src/lib/setup-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAA;AAE/B,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAC,oBAAoB,EAAC,MAAM,mBAAmB,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AG,CAAC,aAAa,CAAC,CAAA;IAClB,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;IACpB,CAAC;IAED,OAAO;QACL,GAAG,MAAM;QACT,IAAI,EAAE,EAAC,IAAI,EAAE,GAAG,EAAC;QACjB,SAAS;QACT,SAAS;KACV,CAAA;AACH,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
export declare const CRT_ALLOWED_DOMAINS: readonly ["dev-robotic.copado.com", "qa.robotic.copado.com", "au-robotic.copado.com", "ca-robotic.copado.com", "eu-robotic.copado.com", "gb-robotic.copado.com", "in-robotic.copado.com", "jp-robotic.copado.com", "sg-robotic.copado.com", "robotic.copado.com"];
|
|
2
2
|
export type CrtAllowedDomain = (typeof CRT_ALLOWED_DOMAINS)[number];
|
|
3
|
+
export declare const CRT_DISCOVERY_DOMAINS: readonly ["robotic.copado.com", "sg-robotic.copado.com", "eu-robotic.copado.com", "ca-robotic.copado.com", "au-robotic.copado.com"];
|
|
3
4
|
export type TestingConnectionOverrides = {
|
|
4
5
|
domain?: string;
|
|
5
6
|
org?: number | string;
|
|
6
7
|
pat?: string;
|
|
7
8
|
};
|
|
8
9
|
export type TestingCredentials = {
|
|
9
|
-
domain:
|
|
10
|
+
domain: string;
|
|
10
11
|
orgId: number;
|
|
11
12
|
pat: string;
|
|
12
13
|
};
|
|
13
|
-
export declare function
|
|
14
|
+
export declare function isCrtAllowedDomain(value: string): value is CrtAllowedDomain;
|
|
15
|
+
export declare function normalizeCrtDomain(value: string): string;
|
|
14
16
|
export declare function normalizeCrtOrgId(value: number | string): number;
|
|
15
17
|
export declare function resolveTestingCredentials(overrides?: TestingConnectionOverrides): TestingCredentials;
|
|
16
18
|
export declare function platformBaseUrl(domain: string): string;
|
|
@@ -12,10 +12,30 @@ export const CRT_ALLOWED_DOMAINS = [
|
|
|
12
12
|
'sg-robotic.copado.com',
|
|
13
13
|
'robotic.copado.com',
|
|
14
14
|
];
|
|
15
|
+
export const CRT_DISCOVERY_DOMAINS = [
|
|
16
|
+
'robotic.copado.com',
|
|
17
|
+
'sg-robotic.copado.com',
|
|
18
|
+
'eu-robotic.copado.com',
|
|
19
|
+
'ca-robotic.copado.com',
|
|
20
|
+
'au-robotic.copado.com',
|
|
21
|
+
];
|
|
22
|
+
const CRT_HOSTNAME_PATTERN = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))+$/u;
|
|
23
|
+
export function isCrtAllowedDomain(value) {
|
|
24
|
+
return CRT_ALLOWED_DOMAINS.includes(value);
|
|
25
|
+
}
|
|
15
26
|
export function normalizeCrtDomain(value) {
|
|
16
|
-
const trimmed = value.trim().replace(/^https?:\/\//
|
|
17
|
-
if (
|
|
18
|
-
throw new Error(
|
|
27
|
+
const trimmed = value.trim().replace(/^https?:\/\//iu, '').replace(/\/+$/u, '').toLowerCase();
|
|
28
|
+
if (trimmed.length === 0) {
|
|
29
|
+
throw new Error('CRT domain cannot be empty.');
|
|
30
|
+
}
|
|
31
|
+
if (trimmed.includes('/') || trimmed.includes(':') || trimmed.includes('@')) {
|
|
32
|
+
throw new Error('CRT domain must be a hostname without a path, port, or userinfo.');
|
|
33
|
+
}
|
|
34
|
+
if (isCrtAllowedDomain(trimmed)) {
|
|
35
|
+
return trimmed;
|
|
36
|
+
}
|
|
37
|
+
if (!CRT_HOSTNAME_PATTERN.test(trimmed)) {
|
|
38
|
+
throw new Error('CRT domain must be a valid hostname.');
|
|
19
39
|
}
|
|
20
40
|
return trimmed;
|
|
21
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-config.js","sourceRoot":"","sources":["../../src/lib/testing-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EA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AA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO,oBAAoB,MAAM,EAAE,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,eAAe,MAAM,EAAE,CAAA;AAChC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type TestingConnectionOptions } from './testing-operations.js';
|
|
1
|
+
import { type TestingConnectionOptions, type TestingRunOptions } from './testing-operations.js';
|
|
2
|
+
import { type TestingRecordBuildOption } from './testing-types.js';
|
|
2
3
|
export declare const testingConnectionFlags: {
|
|
3
4
|
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
4
5
|
org: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -13,6 +14,16 @@ export declare const testingJobFlag: {
|
|
|
13
14
|
export declare const testingBranchFlag: {
|
|
14
15
|
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
};
|
|
17
|
+
export declare const testingRunOptionFlags: {
|
|
18
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
include: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
param: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
record: import("@oclif/core/interfaces").OptionFlag<"none" | "failed" | "all" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'rerun-failed': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'rerun-failed-from-latest': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
tag: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
};
|
|
16
27
|
export declare const testingOutputFlags: {
|
|
17
28
|
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
29
|
};
|
|
@@ -20,6 +31,15 @@ export declare const testingFileInputFlags: {
|
|
|
20
31
|
dir: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
32
|
file: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
33
|
};
|
|
34
|
+
export declare const testingGitStorageFlags: {
|
|
35
|
+
'git-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
36
|
+
'git-domain-credential': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
37
|
+
'git-password': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
38
|
+
'git-tag': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
39
|
+
'git-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
40
|
+
'git-use-caller-credentials': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
41
|
+
'git-username': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
42
|
+
};
|
|
23
43
|
export declare const testingUploadOperationFlags: {
|
|
24
44
|
add: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
45
|
remove: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -30,4 +50,18 @@ export type TestingConnectionFlagValues = {
|
|
|
30
50
|
org?: number;
|
|
31
51
|
pat?: string;
|
|
32
52
|
};
|
|
53
|
+
export type TestingRunFlagValues = TestingConnectionFlagValues & {
|
|
54
|
+
branch?: string;
|
|
55
|
+
exclude?: string[];
|
|
56
|
+
include?: string[];
|
|
57
|
+
param?: string[];
|
|
58
|
+
record?: TestingRecordBuildOption;
|
|
59
|
+
'rerun-failed'?: number;
|
|
60
|
+
'rerun-failed-from-latest'?: boolean;
|
|
61
|
+
tag?: string;
|
|
62
|
+
};
|
|
33
63
|
export declare function testingConnectionOptions(flags: TestingConnectionFlagValues): TestingConnectionOptions;
|
|
64
|
+
export declare function testingRunOptions(flags: TestingRunFlagValues, ids: {
|
|
65
|
+
jobId: number;
|
|
66
|
+
projectId: number;
|
|
67
|
+
}): TestingRunOptions;
|