@somewhere-cloud/cli 0.38.110 → 0.38.112
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 +12 -0
- package/dist/commands/ai.js +3 -2
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/api.js +2 -1
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/auth.js +16 -15
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/browser.js +4 -3
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/call.js +6 -5
- package/dist/commands/call.js.map +1 -1
- package/dist/commands/catalog.js +2 -1
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/check.js +10 -9
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/claim.js +5 -4
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/cron.js +10 -9
- package/dist/commands/cron.js.map +1 -1
- package/dist/commands/db.js +5 -4
- package/dist/commands/db.js.map +1 -1
- package/dist/commands/deploy.d.ts +2 -2
- package/dist/commands/deploy.js +134 -140
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/deploys.d.ts +2 -0
- package/dist/commands/deploys.js +82 -0
- package/dist/commands/deploys.js.map +1 -0
- package/dist/commands/dev.js +38 -37
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.js +28 -27
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/email.js +3 -2
- package/dist/commands/email.js.map +1 -1
- package/dist/commands/env.js +3 -2
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/errors.js +2 -1
- package/dist/commands/errors.js.map +1 -1
- package/dist/commands/feedback.js +2 -1
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/fs.js +2 -1
- package/dist/commands/fs.js.map +1 -1
- package/dist/commands/git.js +3 -2
- package/dist/commands/git.js.map +1 -1
- package/dist/commands/hooks.js +2 -1
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/init.js +20 -19
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.js +15 -14
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/postgres.js +13 -12
- package/dist/commands/postgres.js.map +1 -1
- package/dist/commands/project.js +5 -4
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/promote.js +10 -9
- package/dist/commands/promote.js.map +1 -1
- package/dist/commands/pull.js +5 -4
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/restore.d.ts +1 -1
- package/dist/commands/restore.js +6 -5
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/rollback.js +7 -3
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/run.js +3 -2
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/skills.js +3 -2
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/support.js +2 -1
- package/dist/commands/support.js.map +1 -1
- package/dist/commands/tasks.js +4 -3
- package/dist/commands/tasks.js.map +1 -1
- package/dist/commands/typecheck.d.ts +1 -1
- package/dist/commands/typecheck.js +6 -5
- package/dist/commands/typecheck.js.map +1 -1
- package/dist/commands/update.js +3 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upgrade.js +4 -3
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/commands/verify.js +13 -12
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/advisor-runs.js +3 -2
- package/dist/lib/advisor-runs.js.map +1 -1
- package/dist/lib/agent-hooks.js +4 -3
- package/dist/lib/agent-hooks.js.map +1 -1
- package/dist/lib/browser-run.js +3 -2
- package/dist/lib/browser-run.js.map +1 -1
- package/dist/lib/claim-handoff.js +3 -2
- package/dist/lib/claim-handoff.js.map +1 -1
- package/dist/lib/cli-invocation.d.ts +2 -0
- package/dist/lib/cli-invocation.js +5 -0
- package/dist/lib/cli-invocation.js.map +1 -0
- package/dist/lib/client.js +6 -5
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/config.js +4 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/device-login.js +4 -3
- package/dist/lib/device-login.js.map +1 -1
- package/dist/lib/files.js +4 -3
- package/dist/lib/files.js.map +1 -1
- package/dist/lib/frontend-dev.js +3 -2
- package/dist/lib/frontend-dev.js.map +1 -1
- package/dist/lib/init-features.js +9 -8
- package/dist/lib/init-features.js.map +1 -1
- package/dist/lib/link-hint.js +3 -2
- package/dist/lib/link-hint.js.map +1 -1
- package/dist/lib/next-actions.js +9 -19
- package/dist/lib/next-actions.js.map +1 -1
- package/dist/lib/notify/index.d.ts +3 -0
- package/dist/lib/notify/index.js +9 -0
- package/dist/lib/notify/index.js.map +1 -1
- package/dist/lib/notify/providers/update.d.ts +1 -1
- package/dist/lib/notify/providers/update.js +4 -3
- package/dist/lib/notify/providers/update.js.map +1 -1
- package/dist/lib/operational-files.js +2 -1
- package/dist/lib/operational-files.js.map +1 -1
- package/dist/lib/output.js +2 -1
- package/dist/lib/output.js.map +1 -1
- package/dist/lib/post-live-render.d.ts +1 -1
- package/dist/lib/post-live-render.js +2 -1
- package/dist/lib/post-live-render.js.map +1 -1
- package/dist/lib/preview-jobs.js +3 -2
- package/dist/lib/preview-jobs.js.map +1 -1
- package/dist/lib/project-pin.js +2 -1
- package/dist/lib/project-pin.js.map +1 -1
- package/dist/lib/promote-handoff.js +2 -1
- package/dist/lib/promote-handoff.js.map +1 -1
- package/dist/lib/publish-surface.js +2 -1
- package/dist/lib/publish-surface.js.map +1 -1
- package/dist/lib/skills-pack.js +4 -3
- package/dist/lib/skills-pack.js.map +1 -1
- package/dist/lib/surface-counts.js +2 -24
- package/dist/lib/surface-counts.js.map +1 -1
- package/dist/lib/typecheck.js +3 -2
- package/dist/lib/typecheck.js.map +1 -1
- package/dist/lib/update-security.js +2 -1
- package/dist/lib/update-security.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/dist/commands/verify.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cliInvocation } from '../lib/cli-invocation.js';
|
|
1
2
|
import { safeCode, safeInvalid, safeStatus } from '../lib/repro-packet.js';
|
|
2
3
|
import { preflightBrowserActions } from '../lib/browser-flow-preflight.js';
|
|
3
4
|
import { randomBytes } from 'node:crypto';
|
|
@@ -125,7 +126,7 @@ function undeclaredStatusVerdict(first, all) {
|
|
|
125
126
|
+ 'Each viewport runs the whole flow as its own browser session against the same live app, at the same time. '
|
|
126
127
|
+ 'One possible cause is a step that creates something unique (an account, a slug) in each viewport, so it conflicts in all but one; '
|
|
127
128
|
+ `verify records failed requests only, so this is not established. If that is the cause, declaring ${first.status} would not fit, because ${others} would not see it: `
|
|
128
|
-
+
|
|
129
|
+
+ `run the creating flow in one viewport ("viewports": ["desktop"]), then continue as the same actor with "viewport": "mobile" in a multi-user journey (${cliInvocation()} verify --schema). `
|
|
129
130
|
+ `Otherwise the ${first.status} is an app failure to fix.`;
|
|
130
131
|
}
|
|
131
132
|
const who = first.initiator === 'eval'
|
|
@@ -274,7 +275,7 @@ export function normalizeVerifyFlow(raw, baseDir = process.cwd()) {
|
|
|
274
275
|
if (!isRecord(raw))
|
|
275
276
|
throw new Error('flow must be a JSON object.');
|
|
276
277
|
if (raw.actors !== undefined || raw.journey !== undefined) {
|
|
277
|
-
throw new Error(
|
|
278
|
+
throw new Error(`This is a multi-user flow (actors + journey). Run it with \`${cliInvocation()} verify --project <project> --flow <file>\`.`);
|
|
278
279
|
}
|
|
279
280
|
const supported = new Set(['actions', 'auth', 'local_storage', 'cookies', 'headers', 'expect_requests', 'visible_only', 'viewports']);
|
|
280
281
|
const unknown = Object.keys(raw).filter((key) => !supported.has(key));
|
|
@@ -310,15 +311,15 @@ function readVerifyFlowFile(absolute, flag) {
|
|
|
310
311
|
}
|
|
311
312
|
catch (cause) {
|
|
312
313
|
if (cause instanceof Error && 'code' in cause && cause.code === 'ENOENT') {
|
|
313
|
-
throw new Error(`Flow file not found. Pass ${flag} <path> with an existing JSON file. Run
|
|
314
|
+
throw new Error(`Flow file not found. Pass ${flag} <path> with an existing JSON file. Run \`${cliInvocation()} verify --schema\` for the flow format.`);
|
|
314
315
|
}
|
|
315
|
-
throw new Error(`Flow file could not be read. Pass ${flag} <path> with a readable JSON file; check its file permissions. Run
|
|
316
|
+
throw new Error(`Flow file could not be read. Pass ${flag} <path> with a readable JSON file; check its file permissions. Run \`${cliInvocation()} verify --schema\` for the flow format.`);
|
|
316
317
|
}
|
|
317
318
|
try {
|
|
318
319
|
return JSON.parse(source);
|
|
319
320
|
}
|
|
320
321
|
catch {
|
|
321
|
-
throw new Error(`Flow file is not valid JSON. Fix the JSON in the file passed to ${flag}, then rerun. Run
|
|
322
|
+
throw new Error(`Flow file is not valid JSON. Fix the JSON in the file passed to ${flag}, then rerun. Run \`${cliInvocation()} verify --schema\` for the flow format.`);
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
325
|
export function loadVerifyFlow(path, cwd = process.cwd()) {
|
|
@@ -1125,7 +1126,7 @@ export function createVerifyJourneyRun(target, journey, client, opts = {}) {
|
|
|
1125
1126
|
throw new Error('Multi-user verification needs --project <project>: every actor signs in to that project, and its browsers stay on its addresses.');
|
|
1126
1127
|
}
|
|
1127
1128
|
if (target.url && isLoopbackUrl(target.url)) {
|
|
1128
|
-
throw new Error(
|
|
1129
|
+
throw new Error(`Multi-user journeys run on the deployed app. Deploy first, then run ${cliInvocation()} verify --project <project> --flow <file>.`);
|
|
1129
1130
|
}
|
|
1130
1131
|
const createStartedAt = now();
|
|
1131
1132
|
await createTestUsers();
|
|
@@ -1319,7 +1320,7 @@ export function createVerifyJourneyRun(target, journey, client, opts = {}) {
|
|
|
1319
1320
|
...(report.session_expires_at ? { session_expires_at: report.session_expires_at } : {}),
|
|
1320
1321
|
...(report.idle_expires_at ? { idle_expires_at: report.idle_expires_at } : {}),
|
|
1321
1322
|
...(report.absolute_expires_at ? { absolute_expires_at: report.absolute_expires_at } : {}),
|
|
1322
|
-
close:
|
|
1323
|
+
close: `${cliInvocation()} call browser '${JSON.stringify({ project_id: target.project_id, session_id: sessionId, close: true })}'`,
|
|
1323
1324
|
});
|
|
1324
1325
|
}
|
|
1325
1326
|
segments.push({ ...base, ...timing, ran: true, passed: false, incomplete: capped, ...(report.session_closed === true ? { session_closed: true } : {}), ...(report.final_url ? { final_url: reportUrl(report.final_url) } : {}) });
|
|
@@ -1356,7 +1357,7 @@ export function createVerifyJourneyRun(target, journey, client, opts = {}) {
|
|
|
1356
1357
|
...(report.session_expires_at ? { session_expires_at: report.session_expires_at } : {}),
|
|
1357
1358
|
...(report.idle_expires_at ? { idle_expires_at: report.idle_expires_at } : {}),
|
|
1358
1359
|
...(report.absolute_expires_at ? { absolute_expires_at: report.absolute_expires_at } : {}),
|
|
1359
|
-
close:
|
|
1360
|
+
close: `${cliInvocation()} verify --flow <this flow> --close-actors`,
|
|
1360
1361
|
});
|
|
1361
1362
|
}
|
|
1362
1363
|
}
|
|
@@ -1480,7 +1481,7 @@ export function verifyFlowSchema() {
|
|
|
1480
1481
|
};
|
|
1481
1482
|
return {
|
|
1482
1483
|
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
1483
|
-
title:
|
|
1484
|
+
title: `${cliInvocation()} verify --flow`,
|
|
1484
1485
|
oneOf: [
|
|
1485
1486
|
{
|
|
1486
1487
|
title: 'One user',
|
|
@@ -1739,7 +1740,7 @@ Save that object as flow.json, then pass --flow flow.json.
|
|
|
1739
1740
|
Each viewport runs every action as its own browser session, at the same time,
|
|
1740
1741
|
against the same live app, so a step that signs up or creates a unique record
|
|
1741
1742
|
runs once per viewport. Create it in one viewport, or use the journey below.
|
|
1742
|
-
For the complete flow and action schema, run:
|
|
1743
|
+
For the complete flow and action schema, run: ${cliInvocation()} docs browser
|
|
1743
1744
|
|
|
1744
1745
|
Several users in one run (--project required; each actor is its own browser):
|
|
1745
1746
|
{
|
|
@@ -1762,7 +1763,7 @@ every actor browser is closed within ${VERIFY_JOURNEY_LIMITS.cleanup_budget_ms /
|
|
|
1762
1763
|
confirmed is reported, and the platform closes idle browsers within 5 minutes.
|
|
1763
1764
|
Several users need a claimed account and a CLI login approved for all your
|
|
1764
1765
|
projects: a login approved for "Only these projects" cannot open named browsers
|
|
1765
|
-
(SESSION_SCOPE_FORBIDDEN). Print the full flow schema with:
|
|
1766
|
+
(SESSION_SCOPE_FORBIDDEN). Print the full flow schema with: ${cliInvocation()} verify --schema
|
|
1766
1767
|
`)
|
|
1767
1768
|
.action(async (target, opts) => {
|
|
1768
1769
|
if (opts.schema) {
|
|
@@ -1995,7 +1996,7 @@ projects: a login approved for "Only these projects" cannot open named browsers
|
|
|
1995
1996
|
}
|
|
1996
1997
|
if (cause instanceof CliApiError) {
|
|
1997
1998
|
if (cause.code === 'BROWSER_ORIGIN_NOT_AUTHORIZED') {
|
|
1998
|
-
error(`${cause.message} ${dim(`[${cause.code}${cause.statusCode ? `, HTTP ${cause.statusCode}` : ''}]`)} To drive an app you own, rerun with --project <your-project-id> (for example:
|
|
1999
|
+
error(`${cause.message} ${dim(`[${cause.code}${cause.statusCode ? `, HTTP ${cause.statusCode}` : ''}]`)} To drive an app you own, rerun with --project <your-project-id> (for example: ${cliInvocation()} verify --project <your-project-id> --url <your-app-url> --flow flow.json).`, cause);
|
|
1999
2000
|
}
|
|
2000
2001
|
else {
|
|
2001
2002
|
error(`${cause.message} ${dim(`[${cause.code}${cause.statusCode ? `, HTTP ${cause.statusCode}` : ''}]`)}`, cause);
|