@withandeo/cli 0.19.18 → 0.19.20
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 +38 -0
- package/dist/api.d.ts +17 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +10 -0
- package/dist/api.js.map +1 -1
- package/dist/cloud-agent.d.ts +5 -0
- package/dist/cloud-agent.d.ts.map +1 -1
- package/dist/cloud-agent.js +41 -5
- package/dist/cloud-agent.js.map +1 -1
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/feedback.d.ts +12 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +40 -0
- package/dist/feedback.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +48 -3
- package/dist/main.js.map +1 -1
- package/dist/workflow-dev.js +1 -1
- package/dist/workflow-dev.js.map +1 -1
- package/package.json +3 -3
- package/skill/publication.json +1 -1
- package/skill/tender-accounts/SKILL.md +25 -3
- package/skill/tender-accounts/references/authentication.md +40 -0
- package/skill/tender-accounts/references/delivery.md +1 -1
- package/skill/tender-accounts/references/managed-source.md +22 -3
- package/skill/tender-accounts/references/releases-recovery.md +18 -0
- package/skill/tender-accounts/references/skills.md +1 -0
- package/templates/shopify-customer-account/apps/gateway/.tender/artifacts/current/tender-accounts-build.json +0 -99
- package/templates/shopify-customer-account/apps/gateway/.tender/artifacts/current/worker.mjs +0 -1785
- package/templates/shopify-customer-account/apps/gateway/.tender/build/worker.mjs +0 -1785
package/dist/main.js
CHANGED
|
@@ -5,6 +5,7 @@ import { lstat, mkdtemp, readFile, readdir, realpath, rm } from "node:fs/promise
|
|
|
5
5
|
import { basename, join, relative, resolve, sep } from "node:path";
|
|
6
6
|
import { homedir, hostname, tmpdir } from "node:os";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
|
+
import { readFeedbackInput } from "./feedback.js";
|
|
8
9
|
import { AgentApiClient } from "./api.js";
|
|
9
10
|
import { emailDuration, waitForEmail } from "./email.js";
|
|
10
11
|
import { CLI_AUTH_SCHEMA, DEFAULT_AUTH_PROFILE, createDefaultAuthStore, validateAuthProfile, validateNamedAuthProfile, } from "./auth-store.js";
|
|
@@ -227,6 +228,8 @@ async function execute(topic, options, cwd, runtime) {
|
|
|
227
228
|
return { value: await linkProject(cwd, options, runtime) };
|
|
228
229
|
case "doctor":
|
|
229
230
|
return await doctor(cwd, options, runtime);
|
|
231
|
+
case "feedback":
|
|
232
|
+
return { value: await sendFeedback(cwd, options, runtime) };
|
|
230
233
|
case "preview": {
|
|
231
234
|
const value = await preview(cwd, options, runtime);
|
|
232
235
|
return { value, exitCode: value.status === "timeout" ? 3 : 0 };
|
|
@@ -236,6 +239,7 @@ async function execute(topic, options, cwd, runtime) {
|
|
|
236
239
|
case "preview open":
|
|
237
240
|
return { value: await previewOpen(cwd, options, runtime) };
|
|
238
241
|
case "production releases":
|
|
242
|
+
case "production verify":
|
|
239
243
|
case "production rollback": {
|
|
240
244
|
const context = await optionalContext(cwd);
|
|
241
245
|
const { client, projectId } = await sourceProjectAccess(cwd, context?.link ?? null, options, runtime, false);
|
|
@@ -244,12 +248,29 @@ async function execute(topic, options, cwd, runtime) {
|
|
|
244
248
|
const revision = Number(requiredFlag(options, "expected-revision"));
|
|
245
249
|
if (!Number.isSafeInteger(revision) || revision < 1)
|
|
246
250
|
throw new CliError("argument_invalid", "--expected-revision must be a positive integer.");
|
|
251
|
+
if (topic === "production verify") {
|
|
252
|
+
const value = await client.verifyProduction(projectId, requiredFlag(options, "activation"), {
|
|
253
|
+
compositionId: requiredFlag(options, "composition"), expectedRuntimeRevision: revision,
|
|
254
|
+
});
|
|
255
|
+
return { value, exitCode: value.status === "verified" ? 0 : 2 };
|
|
256
|
+
}
|
|
247
257
|
return { value: await client.rollbackProduction(projectId, { productionReleaseId: requiredFlag(options, "release"),
|
|
248
258
|
expectedProductionReleaseId: requiredFlag(options, "expected-release"), expectedRuntimeRevision: revision,
|
|
249
259
|
idempotencyKey: requiredFlag(options, "idempotency-key") }) };
|
|
250
260
|
}
|
|
251
261
|
case "source status":
|
|
252
262
|
return { value: await sourceStatus(cwd, options, runtime) };
|
|
263
|
+
case "source continue": {
|
|
264
|
+
const change = options.flags.get("change"), work = options.flags.get("work");
|
|
265
|
+
if (Boolean(change) === Boolean(work) || change && !/^scr_[A-Za-z0-9_]+$/u.test(change) || work && !/^asw_[A-Za-z0-9_]+$/u.test(work))
|
|
266
|
+
throw new CliError("source_continuation_required", "Choose exactly one existing --change scr_... or --work asw_... to continue.");
|
|
267
|
+
const client = await cloudAgentClient(runtime.environment, cwd, runtime.fetcher, { tokenStdin: options.booleans.has("token-stdin"), profile: options.flags.has("profile"),
|
|
268
|
+
apiUrl: selectedApiUrl(options, null, runtime.environment, runtime.defaultApiUrl), continuation: change ? { continueChangeId: change } : { continueWorkId: work } });
|
|
269
|
+
if (!client)
|
|
270
|
+
throw new CliError("cloud_agent_required", "Source continuation requires Cloud run authentication.");
|
|
271
|
+
return { value: { status: "continued", runId: client.runId, runExpiresAt: client.runExpiresAt, resources: client.resources,
|
|
272
|
+
...(change ? { changeId: change } : {}), next: change ? `andeo source change show --change ${change} --json` : "andeo source status --json" } };
|
|
273
|
+
}
|
|
253
274
|
case "source branches":
|
|
254
275
|
return { value: await sourceBranches(cwd, options, runtime) };
|
|
255
276
|
case "source log":
|
|
@@ -1544,9 +1565,12 @@ async function sourceChangeCreate(cwd, options, runtime) {
|
|
|
1544
1565
|
projectId: access.projectId,
|
|
1545
1566
|
repositoryId: access.repository.id,
|
|
1546
1567
|
changeRequest: created.changeRequest,
|
|
1568
|
+
pendingReason: created.changeRequest.status === "checks_pending" && !created.changeRequest.buildId ? "exact_preview_missing" : null,
|
|
1547
1569
|
next: created.changeRequest.status === "ready_for_review"
|
|
1548
1570
|
? "A merchant administrator can open the exact preview and approve this change in Andeo."
|
|
1549
|
-
:
|
|
1571
|
+
: created.changeRequest.status === "checks_pending" && !created.changeRequest.buildId
|
|
1572
|
+
? `Run andeo preview --json for commit ${created.changeRequest.headSha}; if the run expired, first run andeo source continue --change ${created.changeRequest.id} --json.`
|
|
1573
|
+
: "Wait for Andeo to validate and seal the exact preview, then inspect this change again.",
|
|
1550
1574
|
};
|
|
1551
1575
|
});
|
|
1552
1576
|
}
|
|
@@ -2310,6 +2334,21 @@ async function deliveryRetry(cwd, options, runtime) {
|
|
|
2310
2334
|
const { client } = await authenticatedClient(cwd, context.link, options, runtime);
|
|
2311
2335
|
return await client.retryDelivery(requiredDeliveryId(options), options.booleans.has("reauthorize") ? context.link.projectId : undefined);
|
|
2312
2336
|
}
|
|
2337
|
+
async function sendFeedback(cwd, options, runtime) {
|
|
2338
|
+
const bodyFile = requiredFlag(options, "body-file");
|
|
2339
|
+
if (bodyFile === "-" && options.booleans.has("token-stdin")) {
|
|
2340
|
+
throw new CliError("feedback_stdin_conflict", "--body-file - cannot be combined with --token-stdin.");
|
|
2341
|
+
}
|
|
2342
|
+
const input = await readFeedbackInput({ title: requiredFlag(options, "title"), category: options.flags.get("category") ?? "other", bodyFile }, cwd, runtime.stdin);
|
|
2343
|
+
const context = await optionalContext(cwd);
|
|
2344
|
+
const explicitProject = options.flags.get("project");
|
|
2345
|
+
const projectId = explicitProject ? requiredProjectId(explicitProject) : context?.link?.projectId;
|
|
2346
|
+
if (options.booleans.has("dry-run")) {
|
|
2347
|
+
return { status: "dry_run", title: input.title, category: input.category, projectId: projectId ?? null, bodyCharacters: input.body.length, body: input.body };
|
|
2348
|
+
}
|
|
2349
|
+
const { client } = await authenticatedClient(cwd, context?.link ?? null, options, runtime);
|
|
2350
|
+
return client.feedback({ ...input, ...(projectId ? { projectId } : {}), cliVersion: CLI_VERSION });
|
|
2351
|
+
}
|
|
2313
2352
|
async function authenticatedClient(cwd, link, options, runtime) {
|
|
2314
2353
|
let apiUrl = selectedApiUrl(options, link, runtime.environment, runtime.defaultApiUrl);
|
|
2315
2354
|
const cloud = await cloudAgentClient(runtime.environment, cwd, runtime.fetcher, { tokenStdin: options.booleans.has("token-stdin"), profile: options.flags.has("profile"), apiUrl });
|
|
@@ -2941,6 +2980,7 @@ function assertAllowedOptions(topic, options) {
|
|
|
2941
2980
|
"agents complete": [...common, ...authentication, "expected-revision", "run"],
|
|
2942
2981
|
link: [...common, ...authentication, "project"],
|
|
2943
2982
|
doctor: [...common, ...authentication],
|
|
2983
|
+
feedback: [...common, ...authentication, "project", "title", "category", "body-file", "dry-run"],
|
|
2944
2984
|
preview: [
|
|
2945
2985
|
...common,
|
|
2946
2986
|
...authentication,
|
|
@@ -2956,7 +2996,9 @@ function assertAllowedOptions(topic, options) {
|
|
|
2956
2996
|
"preview entries": [...common, ...authentication],
|
|
2957
2997
|
"preview open": [...common, ...authentication, "from", "through", "return-path"],
|
|
2958
2998
|
"source status": [...common, ...authentication, "project"],
|
|
2999
|
+
"source continue": [...common, ...authentication, "change", "work"],
|
|
2959
3000
|
"production releases": [...common, ...authentication, "project"],
|
|
3001
|
+
"production verify": [...common, ...authentication, "project", "activation", "composition", "expected-revision"],
|
|
2960
3002
|
"production rollback": [...common, ...authentication, "project", "release", "expected-release", "expected-revision", "idempotency-key"],
|
|
2961
3003
|
"source branches": [...common, ...authentication, "project"],
|
|
2962
3004
|
"source reconnect prepare": [...common, ...authentication, "project", "repository", "idempotency-key"],
|
|
@@ -3229,16 +3271,19 @@ Account workflow entitlement is required for new starts. Run status is authorita
|
|
|
3229
3271
|
"auth logout": "Usage: andeo auth logout [--all] [--local] [--json]\n\nRevoke the default login. --local removes only the local copy; --all must be explicit to remove every login and directory binding.",
|
|
3230
3272
|
link: "Usage: andeo link [--project PROJECT_ID] [--profile NAME] [--api-url URL] [--json]\n\nLink this checkout to exactly one project. The project ID remains a target guard; profile activation stays machine-local.",
|
|
3231
3273
|
doctor: "Usage: andeo doctor [--json]\n\nValidate configuration, authentication, project scope, and local artifact readiness.",
|
|
3274
|
+
feedback: "Usage: andeo feedback --title TEXT --body-file PATH [--category bug|docs|feature|other] [--project PROJECT_ID] [--dry-run] [--json]\n\nSend feedback to the Andeo team. Requires login. Use --body-file - to read the body from stdin. Bodies can be up to 65,000 characters, so include the context that helps. Leave out credentials and customer data. --dry-run prints what would be sent, without sending it. Sending identical feedback again returns the original receipt.\n\nExamples:\n andeo feedback --title \"Preview logs omit build errors\" --category bug --body-file notes.md --json\n andeo feedback --title \"Clarify workflow retries\" --category docs --body-file - --dry-run --json",
|
|
3232
3275
|
dev: "Usage: andeo dev\n\nRun the app's declared local development command. This starts local development and does not create an Andeo deployment.",
|
|
3233
3276
|
check: "Usage: andeo check [--json]\n\nRun the app's declared validation command.",
|
|
3234
3277
|
build: "Usage: andeo build [--json]\n\nRun validation and packaging, then verify the complete portable artifact.",
|
|
3235
3278
|
upload: "Usage: andeo upload [--dry-run] [--submission-key KEY] [--json]\n\nValidate, package and retain an exact artifact for administrator review. Does not create a preview or publish production.",
|
|
3236
3279
|
preview: "Usage: andeo preview [--through PROJECT_ID] [--return-path /account] [--dry-run] [--no-wait] [--idempotency-key KEY] [--json]\n\nBuild an exact app preview. Persistent Cloud agents with preview.build/open request an isolated build of their assigned pushed branch. Explicit preview.share consent automatically resolves its published gateway and issues a handoff lasting up to seven days, independently of normal run completion. --through overrides an eligible entry when needed. Without sharing consent, access stays run-bound. Unsupported bindings fail closed. Use preview open --from sbl_... (persistent) or dly_... to reopen without rebuilding.",
|
|
3237
|
-
production: "Usage: andeo production <releases|rollback> [options]",
|
|
3280
|
+
production: "Usage: andeo production <releases|verify|rollback> [options]",
|
|
3281
|
+
"production verify": "Usage: andeo production verify [--project PROJECT_ID] --activation ACTIVATION_ID --composition COMPOSITION_ID --expected-revision N [--json]\n\nAdministrators recheck the exact current activation without building, uploading or changing production. Exit 2 means verification remains incomplete.",
|
|
3238
3282
|
"production releases": "Usage: andeo production releases [--project PROJECT_ID] [--json]\n\nList immutable production releases and rollback eligibility.",
|
|
3239
3283
|
"production rollback": "Usage: andeo production rollback [--project PROJECT_ID] --release RELEASE_ID --expected-release CURRENT_ID --expected-revision N --idempotency-key KEY [--json]\n\nMerchant administrators restore a previously successful app release without building or uploading code.",
|
|
3240
3284
|
source: "Usage: andeo source <status|branches|branch|log|compare|connect|reconnect|policy|pull|push|change|default|promote|history|operation> [options]\n\nUse standard Git through Andeo for a gateway or service project. Default-branch changes follow the saved publication policy.",
|
|
3241
3285
|
"source status": "Usage: andeo source status [--project PROJECT_ID] [--json]\n\nRead the managed repository, immutable build contract, and recent source builds. --project works before a checkout is linked.\n\nExamples:\n andeo source status --project prj_... --json\n andeo source status --json",
|
|
3286
|
+
"source continue": "Usage: andeo source continue --change scr_... [--json]\n andeo source continue --work asw_... [--json]\n\nStart a fresh bounded Cloud run assigned to existing source work from the same agent, grant and installation. Preserves the original branch and change history. Use after run expiry, or as the first authenticated command in a fresh task. Pending source mutations and live writers must settle first. No source, preview, merge or production effect is started.\n\nExample:\n andeo source continue --change scr_0123456789abcdef --json",
|
|
3242
3287
|
"source branches": "Usage: andeo source branches [--project PROJECT_ID] [--json]\n\nList exact branch refs and identify Andeo's authoritative default separately from the provider's create-time default. Uses a short-lived read credential without persisting it.",
|
|
3243
3288
|
"source log": "Usage: andeo source log [--project PROJECT_ID] [--branch BRANCH] [--limit 20] [--json]\n\nRead bounded commit history from one exact managed branch without requiring a checkout.",
|
|
3244
3289
|
"source compare": "Usage: andeo source compare [--project PROJECT_ID] --base BRANCH --head BRANCH [--json]\n\nCompare exact managed refs and report identical, fast-forward, behind, diverged, or unrelated history plus a bounded file list.",
|
|
@@ -3300,7 +3345,7 @@ Account workflow entitlement is required for new starts. Run status is authorita
|
|
|
3300
3345
|
};
|
|
3301
3346
|
if (topic && topics[topic])
|
|
3302
3347
|
return topics[topic];
|
|
3303
|
-
return `Andeo merchant developer CLI ${CLI_VERSION}\n\nCommands:\n docs Read version-matched offline guides\n capabilities Inspect scoped support, enablement and permissions\n init Create a new Shopify account starter\n auth login Create or refresh the default login\n auth create Create or re-authorize a named login\n auth activate Bind a named login to a directory tree\n auth deactivate Remove an exact directory binding\n auth status Validate one login or scoped credential\n auth list List local login profiles and bindings\n auth delete Revoke one named login\n auth logout Revoke the default or every login\n agents Human administration of persistent agents\n agent Inspect or end this Cloud task's run\n link Link this checkout to one permitted project\n doctor Check developer readiness\n dev Run the project-owned local dev command\n check Run project validation\n build Package and verify a portable artifact\n upload Retain a build for administrator publication\n preview Build and deploy an exact preview\n preview entries List eligible connected entry apps\n preview open Reopen an exact deployed preview\n source status Inspect Andeo-managed Git and recent builds\n source branches List exact managed branches and default policy\n source compare Compare two managed branches\n source connect Connect this linked project to managed Git\n source reconnect Prepare, inspect, complete or cancel a tenant namespace cutover\n source pull Clone or fast-forward the exact connected repository\n source token Issue a short-lived repository credential\n source push Push the exact commit without persisting a token\n source promote Fast-forward the default after successful preview checks\n source history Run guarded, archived source-history migration\n email Create and reuse merchant email identities\n workflows Inspect and control app-defined background runs\n vars Manage saved per-environment runtime variables\n source policy Inspect or change automatic publication\n tail Stream logs for one exact linked project\n delivery status Read preview workflow state\n delivery retry Retry a failed preview workflow\n upgrade Upgrade a verified global CLI installation\n config autoupgrade Configure automatic CLI upgrades\n skill install Install the Andeo agent skill\n skill status Inspect installed guidance freshness\n skill sync Refresh unchanged managed guidance\n skills list Discover authenticated practice skills\n skills get Read an authenticated practice skill\n skills file Read one authenticated skill resource\n config example Print the project configuration contract\n\nThere is intentionally no production publish command.\nRun andeo <command> --help for examples.`;
|
|
3348
|
+
return `Andeo merchant developer CLI ${CLI_VERSION}\n\nCommands:\n docs Read version-matched offline guides\n capabilities Inspect scoped support, enablement and permissions\n feedback Send feedback to the Andeo team\n init Create a new Shopify account starter\n auth login Create or refresh the default login\n auth create Create or re-authorize a named login\n auth activate Bind a named login to a directory tree\n auth deactivate Remove an exact directory binding\n auth status Validate one login or scoped credential\n auth list List local login profiles and bindings\n auth delete Revoke one named login\n auth logout Revoke the default or every login\n agents Human administration of persistent agents\n agent Inspect or end this Cloud task's run\n link Link this checkout to one permitted project\n doctor Check developer readiness\n dev Run the project-owned local dev command\n check Run project validation\n build Package and verify a portable artifact\n upload Retain a build for administrator publication\n preview Build and deploy an exact preview\n preview entries List eligible connected entry apps\n preview open Reopen an exact deployed preview\n source status Inspect Andeo-managed Git and recent builds\n source branches List exact managed branches and default policy\n source compare Compare two managed branches\n source connect Connect this linked project to managed Git\n source reconnect Prepare, inspect, complete or cancel a tenant namespace cutover\n source pull Clone or fast-forward the exact connected repository\n source token Issue a short-lived repository credential\n source push Push the exact commit without persisting a token\n source promote Fast-forward the default after successful preview checks\n source history Run guarded, archived source-history migration\n email Create and reuse merchant email identities\n workflows Inspect and control app-defined background runs\n vars Manage saved per-environment runtime variables\n source policy Inspect or change automatic publication\n tail Stream logs for one exact linked project\n delivery status Read preview workflow state\n delivery retry Retry a failed preview workflow\n upgrade Upgrade a verified global CLI installation\n config autoupgrade Configure automatic CLI upgrades\n skill install Install the Andeo agent skill\n skill status Inspect installed guidance freshness\n skill sync Refresh unchanged managed guidance\n skills list Discover authenticated practice skills\n skills get Read an authenticated practice skill\n skills file Read one authenticated skill resource\n config example Print the project configuration contract\n\nThere is intentionally no production publish command.\nRun andeo <command> --help for examples.`;
|
|
3304
3349
|
}
|
|
3305
3350
|
function normalizeError(error) {
|
|
3306
3351
|
if (error instanceof FlagCompatibilityError)
|