deployai 0.1.0-beta.36 → 0.1.0-beta.38

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.
Files changed (2) hide show
  1. package/dist/index.js +131 -46
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21272,7 +21272,9 @@ var DeployResponse = external_exports.object({
21272
21272
  queuePosition: external_exports.number(),
21273
21273
  previewUrl: external_exports.string(),
21274
21274
  /** Only for a heavy home page (D-420): the files it loads from the site and whether it prefetches links. */
21275
- page: external_exports.object({ files: external_exports.number(), prefetches: external_exports.boolean() }).optional()
21275
+ page: external_exports.object({ files: external_exports.number(), prefetches: external_exports.boolean() }).optional(),
21276
+ /** The site goes live by itself once built (D-916), the owner's setting. Missing on older servers. */
21277
+ autoLive: external_exports.boolean().optional()
21276
21278
  });
21277
21279
  var VersionStatus = external_exports.enum(["queued", "building", "ready", "failed", "replaced"]);
21278
21280
  var MigrationStatus = external_exports.enum(["waiting", "queued", "running", "done", "failed"]);
@@ -22599,6 +22601,9 @@ var V6_PRIVATE = [[[...Array(16).fill(0)], 127], [[252, ...Array(15).fill(0)], 7
22599
22601
 
22600
22602
  // ../shared/src/probe.ts
22601
22603
  var TEAM_PASS_MAX_AGE_S = 8 * 3600;
22604
+ var HUMAN_CHECK_PATH = "/__deployai/check";
22605
+ var HUMAN_COOKIE = "__deployai_human";
22606
+ var HUMAN_MAX_AGE_S = 7 * 86400;
22602
22607
 
22603
22608
  // ../shared/src/deploy-tools.ts
22604
22609
  var DEPLOY_TOOL_NAMES = {
@@ -22651,8 +22656,8 @@ var ASK_SOUND_STEP = { say: 'With your first question to the owner, and only onc
22651
22656
  var CHECK = { cmd: "npx deployai@latest check", say: "Fix every blocker it lists, then run it again until it shows none." };
22652
22657
  var FIRST_LOOK_MESSAGE = "first look";
22653
22658
  var FIRST_SITE_RULE = 'A site that has never been live (this folder is not linked yet, or npx deployai@latest status shows no live version) follows this, and not the rule for later changes. Right at the start, before you build, ask once, naming the site and its address when you know it: "When your site is ready, should I put it live for you? Anyone will be able to see it." The answers: Yes, put it live (recommended), or Show me first. Then go on working, and do not ask it again for this first version. Deploy twice. First, the first look: when a first version works, deploy without --live and send the owner the preview address. Make every change they ask for in the folder, without deploying. Second, when everything they asked for is done: on Yes, deploy with --live and give them the live address, with no more questions. On Show me first, deploy without it, send the preview address and ask: "Put it live, or change something first?" If nothing changed since the first look, there is nothing to build: run promote on that version instead of a second deploy. Deploy again only when a deploy failed, or the owner asks for more after the last one, and then put all of it in one deploy. Database changes still get their own yes.';
22654
- var DEPLOY_ASK_RULE = 'Once a site has been live, never deploy on your own, and never after each small edit: every deploy is a full build. Deploy only when what the owner asked for is done. Then say in short what changed and ask: "Put it live, see a preview first, or not yet?" Put it live: deploy with --live. Preview first: deploy without it and send the owner the preview address. Not yet: keep working, and the next change goes up in the same deploy. If the owner said to always put changes live, deploy with --live without asking. Database changes still get their own yes.';
22655
- var LOCAL_PREVIEW_RULE = "While you build, show the site on this computer, never a deploy after each change. Start the site's own dev command (the dev script in package.json, for example npm run dev) yourself, in the background, so it keeps running while you work: in Claude Code as a background command, in another tool with its own way to run a command in the background or in a terminal of its own. Never ask the owner to open a terminal or type a command. If a local preview of this folder is already running, use it instead of starting a second one. Send the owner the local address it prints once, as a link, and say in one line that it updates by itself while you work and opens only on this computer. Check every change there yourself. The local preview is not the hosting: it has a local test database that starts empty, and the built-in email to the owner, visitor countries, 301 redirects and the DeployAI badge work only on a deployed preview, so test those there, and the owner checks a phone there. When to deploy does not change. When the work is done, stop the local preview you started.";
22659
+ var DEPLOY_ASK_RULE = 'Once a site has been live, never deploy on your own, and never after each small edit: every deploy is a full build. Deploy only when what the owner asked for is done. Then say in short what changed and ask: "Put it live, see a preview first, or not yet?" Put it live: deploy with --live. Preview first: deploy without it and send the owner the preview address. Not yet: keep working, and the next change goes up in the same deploy. If the owner said to always put changes live, deploy with --live without asking. When deploy says the site goes live by itself, that is a setting the owner chose: do not ask about going live or a preview, deploy once the request is done, and tell the owner it is live and that Settings on the site page can make versions wait. Database changes still get their own yes.';
22660
+ var LOCAL_PREVIEW_RULE = "While you build, show the site on this computer, never a deploy after each change. Start the site's own dev command (the dev script in package.json, for example npm run dev) yourself, in the background, so it keeps running while you work: in Claude Code as a background command, in another tool with its own way to run a command in the background or in a terminal of its own. Never ask the owner to open a terminal or type a command. If a local preview of this folder is already running, use it instead of starting a second one. Send the owner the local address it prints once, as a link, and say in one line that it updates by itself while you work and opens only on this computer. Check every change there yourself. To see a page at phone width, run npx deployai@latest shot <address> and look at the phone picture it saves: resizing a browser window often keeps the page at desktop width, so never judge the phone layout from the code alone (D-916). The local preview is not the hosting: it has a local test database that starts empty, and the built-in email to the owner, visitor countries, 301 redirects and the DeployAI badge work only on a deployed preview, so test those there, and the owner checks a phone there. When to deploy does not change. When the work is done, stop the local preview you started.";
22656
22661
  var GIT_HISTORY_RULE = "Keep the site's history with git in this folder: run git init if there is none, commit before you start and after each part that works, with a short message in the owner's language about what they see changed. Never commit .env files or secrets. When the owner asks to undo a change, or to bring back or remove a feature, do it from the git history yourself and tell them in one line what changed; never ask them to run git. Git brings back code, not data: rows, files and tables that were deleted stay deleted, so ask the owner before a change that removes data.";
22657
22662
  var ASK_OWNER_RULE = `When a question to the owner has set answers, use your tool's own question feature with clickable choices if it has one, for example AskUserQuestion in Claude Code, AskQuestion in Cursor, askQuestions in Copilot in VS Code, request_user_input in Codex, or ask_user_question in Grok Build. Use the owner's language, with each answer as its own choice. If your tool has no such feature, or it is refused or fails, ask the same question once in plain text and go on. Never change a mode or a setting to get it. A yes or no question has set answers too. This holds for every question, also one you think of yourself in the middle of the work: say what you have to say, then ask through the feature, never as the last line of your message. A question about going live names the site and its address when you know it, and says anyone will be able to see it, so the owner's answer is about this exact site (D-691). Open details, like a phone number or hours, stay in plain text, in one short list. How the owner wants you to work is saved in .deployai/owner-mode (D-865): on-my-own or check-with-me. If the file is missing, ask once, "How should I work?", with "On my own (recommended)": I build and choose the recommended option at every step, I stop only for money, deleting your content or your real domain, and I leave you a short list at the end; and "Check with me". Save the answer there, and change it when the owner says so. On my own: take the recommended option without asking, install the tools you need, and stop only for money, deleting the owner's content, a real domain going live or a fact you would have to invent, which you leave out and list. Every question opens with a short tag naming who asks, like "Search add-on \xB7 1 of 2" or "Move \xB7 forms", and a question with several items offers "Approve all (recommended)" first. Never ask the owner about a package, library, framework, tool, file path or size: ask about the outcome in plain words.`;
22658
22663
  var QUESTION_FEATURE = { claudeCode: "AskUserQuestion", cursor: "AskQuestion", copilot: "askQuestions", codex: "request_user_input", grok: "ask_user_question" };
@@ -22670,10 +22675,10 @@ var DEPLOY_SAY = "Add --live only if the owner chose to put it live right away.
22670
22675
  var BUILD = { say: "This folder had no site, so start wrote a starter page. Do not ask where the site comes from or which way to start: build a first version of the owner's site in its place now. Use what you know (the instructions above, .deployai/brief.md if it exists, the folder name) and choose the layout, colors and wording yourself. Besides the question about going live, ask at most one short question, and only if you cannot tell what the site is for. Leave out what you do not know (phone, prices, hours) instead of asking for it. The steps below show it to the owner as the first look: offer to add those details then. Run check only after you built it." };
22671
22676
  var OFFER_DASHBOARD = { cmd: "npx deployai@latest addon run dashboard", say: "Only after the site is live, and only if the owner says yes: in one sentence, offer the site's own free dashboard, to read form messages, hide and edit pages and manage a blog or a shop without an agent." };
22672
22677
  var ADDONS_RUN = { cmd: "npx deployai@latest addons run", say: "With more than one add-on picked, it prints what you know about each and asks you to suggest the order for this site. Tell the owner your order and why, ask how to run them, run the command for their answer, work through each step it prints, and report each add-on as it says." };
22673
- var TAGS_SEEN = { cmd: "npx deployai@latest migrate tags --requests <file>", say: "While you look at the old site, save the outside addresses your browser asks for to a file, one a line, and run this: Tag Manager loads tags that are not in the page. Never send a form on the old site." };
22678
+ var TAGS_SEEN = { cmd: "npx deployai@latest migrate tags --requests <file>", say: "While you look at the old site, save the outside addresses your browser asks for to a file, one a line, and run this: Tag Manager loads tags that are not in the page. Never send a form on the old site. If the old site shows a security check (Cloudflare, a captcha) or blocks a command but opens in a browser (D-916): open it in your browser tool, tell the owner in one line that a check may show in that window and to pass it there, wait up to three minutes, and read the pages in that browser. Offer this first, as the recommended answer, when you ask the owner; turning the check off for the move or sending an export are the other answers." };
22674
22679
  var PLAN_SHOW = "Then show the owner the plan as one chat message, never as the file, a table or one long paragraph, since a long table breaks in a terminal: Moves as it is, with a count and at most three names. Changes, one short line for each Replaced with row. Needs you, one short line for each Needs me or Not possible row. End with the link it printed, for the full list. Do not use a plan mode: it changes the owner's setting.";
22675
22680
  var REPORT_SAY = "Once .deployai/migration/plan.md is written, with its features as one table (| Feature | Status | Note |) and a row for each tag and connection in tags.json: this adds it to the owner's move report and prints the link.";
22676
- var MOVE_REPORT = { cmd: "npx deployai@latest migrate report", say: `${REPORT_SAY} ${PLAN_SHOW} Then ask: "Go ahead with this plan?" The answers: Go ahead and put it live when it is ready (recommended), Go ahead and show me first, or Change something. Say that the old site and its domain do not change either way.` };
22681
+ var MOVE_REPORT = { cmd: "npx deployai@latest migrate report", say: `${REPORT_SAY} ${PLAN_SHOW} Then ask: "Go ahead with this plan?" The answers: Go ahead and put it live when it is ready (recommended), Go ahead and show me first, or Change something. Say that the old site and its domain do not change either way. If .deployai/owner-mode says on-my-own, do not ask (D-928): show the plan, say in one line that you go on and the owner sees the preview before anything goes live, and go on as if they chose to see it first.` };
22677
22682
  var TAGS_FIRED = { cmd: "npx deployai@latest migrate tags --requests <file> --fired", say: "Open the preview, save the outside addresses your browser asks for to a file and run this: it shows which tags really fired there. Tags on the preview are real: a test form send shows up as a real lead in the owner's Google and Meta accounts, so send at most one, and tell the owner first." };
22678
22683
  var SEND_PREVIEW = { say: 'Send the owner the preview address and, in short lines with no table, what changed from the plan and what still needs them. Ask: "Put it live now, or change something first?" Make all their changes first and put them in one deploy, never one deploy for each change.' };
22679
22684
  var AFTER_LIVE = { say: "Only after it is live: tell the owner, in one short message, that the site is live, that their old site and email did not change, that Google keeps showing the old site until the domain is connected, and that they can connect their domain whenever they are ready, as a separate step, from Site addresses on the site's page. Do not explain DNS, do not change DNS and do not start that step in this chat. Then go on with the next step." };
@@ -22685,7 +22690,7 @@ var DASHBOARD = { cmd: "npx deployai@latest blocks dashboard", say: "Every move
22685
22690
  var MOVE_POSTS = { cmd: "npx deployai@latest migrate posts", say: "Only if the old site has posts, news or articles: they go into the dashboard's Blog, each at its old address, so the owner can edit them from day one." };
22686
22691
  var MOVE_PAGES = { cmd: "npx deployai@latest migrate pages", say: "Lists every page the move keeps in the dashboard's Pages, at its old address, with only the old menu's pages in the menu. Run it before you build the rest of the pages, and build each one at exactly its path in src/kit/moved-pages.json, keeping its look and words: these stay pages of the site's code, never rebuilt from the dashboard's sections. A page the plan drops, remove from that file too. Every form goes to the dashboard's messages, as the step before says." };
22687
22692
  var MOVE_LEGAL = { cmd: "npx deployai@latest migrate legal", say: "Starts the dashboard's Documents and Accessibility pages from what the scan found. Ask the owner nothing here, and write no legal text of your own. An old page at exactly /privacy, /terms or /cancellation goes into `docs` in src/kit/moved-legal.json, as .deployai/blocks/dashboard.md says, so it stays live at its address and the owner can edit it. Every other old legal or accessibility page stays exactly as it is. This finishes nothing: never say the legal side is handled or taken care of. In what still needs the owner, say one line: the dashboard's Documents page lists what is left, it is help and not legal advice, and an expert should check it." };
22688
- var SELF_SEND = { say: 'If the owner chose to put it live when it is ready: when verify lists nothing, run promote on that version with no more questions, and give them the live address and, in short lines with no table, what changed from the plan and what still needs them. If they chose to see it first, send the preview address with the same lines and ask: "Put it live now, or change something first?" Make all their changes first and put them in one deploy, never one deploy for each change.' };
22693
+ var SELF_SEND = { say: 'On my own (.deployai/owner-mode, D-928): this is the one question at the end. Send the preview address, the list of what you left out or need from the owner, and ask once: "Put it live now, or change something first?" Never put it live without that yes. If the owner chose to put it live when it is ready: when verify lists nothing, run promote on that version with no more questions, and give them the live address and, in short lines with no table, what changed from the plan and what still needs them. If they chose to see it first, send the preview address with the same lines and ask: "Put it live now, or change something first?" Make all their changes first and put them in one deploy, never one deploy for each change.' };
22689
22694
  var MIGRATE_STEPS = [
22690
22695
  TAGS_SEEN,
22691
22696
  MOVE_REPORT,
@@ -23061,7 +23066,7 @@ var TAG_CATALOG = [
23061
23066
  e2("sentry", "Sentry", "widget", [/browser\.sentry-cdn\.com/i, /js\.sentry-cdn\.com/i], ["browser.sentry-cdn.com"], `<script src="https://browser.sentry-cdn.com/7.0.0/bundle.min.js"></script>`),
23062
23067
  e2("impact", "Impact (affiliates)", "ads", [/\bimpactcdn\.com/i, /\bire\(\s*['"]identify['"]/], [], `<script>s.src='https://utt.impactcdn.com/abc.js';</script>`)
23063
23068
  ];
23064
- var OUTSIDE_KINDS = ["oldHost", "fonts", "design", "icons", "code", "analytics", "profile", "images", "unknown"];
23069
+ var OUTSIDE_KINDS = ["oldHost", "fonts", "design", "icons", "code", "analytics", "profile", "images", "media", "widget", "unknown"];
23065
23070
  var OUTSIDE_SERVICES = [
23066
23071
  { key: "wix", name: "Wix", kind: "oldHost", host: /(^|\.)(wixstatic|parastorage)\.com$/ },
23067
23072
  { key: "squarespace", name: "Squarespace", kind: "oldHost", host: /(^|\.)squarespace(-cdn)?\.com$/ },
@@ -23080,7 +23085,10 @@ var OUTSIDE_SERVICES = [
23080
23085
  { key: "cfinsights", name: "Cloudflare Web Analytics", kind: "analytics", host: /(^|\.)cloudflareinsights\.com$/ },
23081
23086
  { key: "gravatar", name: "Gravatar", kind: "profile", host: /(^|\.)gravatar\.com$/ },
23082
23087
  { key: "cloudinary", name: "Cloudinary", kind: "images", host: /(^|\.)cloudinary\.com$/ },
23083
- { key: "unsplash", name: "Unsplash", kind: "images", host: /(^|\.)unsplash\.com$/ }
23088
+ { key: "unsplash", name: "Unsplash", kind: "images", host: /(^|\.)unsplash\.com$/ },
23089
+ { key: "youtube", name: "YouTube", kind: "media", host: /(^|\.)(youtube(-nocookie)?\.com|ytimg\.com|youtu\.be)$/ },
23090
+ { key: "vimeo", name: "Vimeo", kind: "media", host: /(^|\.)(vimeo\.com|vimeocdn\.com)$/ },
23091
+ { key: "userway", name: "UserWay", kind: "widget", host: /(^|\.)userway\.org$/ }
23084
23092
  ];
23085
23093
  var outsideService = (host) => OUTSIDE_SERVICES.find((s) => s.host.test(host.toLowerCase())) ?? null;
23086
23094
  function outsideRows(hosts) {
@@ -23260,6 +23268,14 @@ function cspAllows(csp, directive, host) {
23260
23268
  return h.startsWith("*.") ? host === h.slice(2) || host.endsWith(h.slice(1)) : host === h;
23261
23269
  });
23262
23270
  }
23271
+ var PHONE_TAGS = /* @__PURE__ */ new Set(["whatsapp"]);
23272
+ var phoneCore = (s) => s.replace(/\D/g, "").replace(/^00/, "").replace(/^0/, "");
23273
+ function sameTagId(key2, a, b) {
23274
+ if (a === b) return true;
23275
+ if (!a || !b || !PHONE_TAGS.has(key2)) return false;
23276
+ const [short, long] = [phoneCore(a), phoneCore(b)].sort((x, y) => x.length - y.length);
23277
+ return short.length >= 7 && long.endsWith(short) && long.length - short.length <= 3;
23278
+ }
23263
23279
  var isRemoved = (removed, what) => what.some((w) => w && removed.some((r) => r.toLowerCase() === w.toLowerCase()));
23264
23280
  function compareTags(old, next, opts = {}) {
23265
23281
  const removed = opts.removed ?? [];
@@ -23267,7 +23283,7 @@ function compareTags(old, next, opts = {}) {
23267
23283
  for (const t of old.tags) {
23268
23284
  if (isRemoved(removed, [t.id ?? "", t.key, t.name, t.id ? `${t.name} ${t.id}` : ""])) continue;
23269
23285
  if (t.source !== "page") continue;
23270
- const here = next.tags.some((n2) => n2.key === t.key && n2.id === t.id);
23286
+ const here = next.tags.some((n2) => n2.key === t.key && sameTagId(t.key, t.id, n2.id));
23271
23287
  if (!here) findings.push({ problem: "tag_lost", what: `${t.name}${t.id ? ` ${t.id}` : ""}`, page: t.pages[0] });
23272
23288
  else if (opts.csp) {
23273
23289
  const entry = TAG_CATALOG.find((c) => c.key === t.key);
@@ -23393,6 +23409,8 @@ var moveReportSchema = external_exports.object({
23393
23409
  checkedAt: text(40),
23394
23410
  pagesChecked: external_exports.number().int().min(0),
23395
23411
  pageProblems: external_exports.number().int().min(0),
23412
+ /** Which pages failed the page check (D-928), so a page reads lost only from its own check. Older reports have only the count. */
23413
+ pageFindings: external_exports.array(external_exports.object({ path: page, problem: text(30) })).max(150).optional(),
23396
23414
  findings: external_exports.array(external_exports.object({ problem: text(30), what: text(240), detail: text(300).optional(), page: page.optional() })).max(300),
23397
23415
  seen: external_exports.array(external_exports.object({ key: external_exports.enum(tagKeys), id: text(80).nullable() })).max(300),
23398
23416
  /** Asked for by a browser on the preview, so really fired there, not only present in the code. */
@@ -23612,7 +23630,8 @@ var SPACES = {
23612
23630
  };
23613
23631
 
23614
23632
  // ../shared/src/protection-rule.ts
23615
- var SKIP_COUNTRY = ['http.request.uri.query contains "deployai_preview"', 'http.cookie contains "deployai_preview"', 'http.request.uri.query contains "deployai_team"', 'http.cookie contains "__deployai_team"', ...UNVERIFIED_BOT_TOKENS.map((t) => `lower(http.user_agent) contains "${t}"`)];
23633
+ var SKIP_COUNTRY = [`http.cookie contains "${HUMAN_COOKIE}"`, 'http.request.uri.query contains "deployai_preview"', 'http.cookie contains "deployai_preview"', 'http.request.uri.query contains "deployai_team"', 'http.cookie contains "__deployai_team"', ...UNVERIFIED_BOT_TOKENS.map((t) => `lower(http.user_agent) contains "${t}"`)];
23634
+ var HUMAN_CHECK_CLAUSE = `http.request.uri.path eq "${HUMAN_CHECK_PATH}"`;
23616
23635
 
23617
23636
  // ../shared/src/agent-rules.ts
23618
23637
  var IPHONE_RULE = "iPhone: Safari is its own browser engine, so working in Chrome or on Android proves nothing. Full height sections use svh or dvh, never 100vh. Typing fields are at least 16px, or the page zooms. A video that plays by itself has muted and playsinline. Bars fixed to the bottom pad with env(safe-area-inset-bottom). Nothing needs a hover. Newer CSS and browser features need a working fallback.";
@@ -24511,6 +24530,8 @@ var M = {
24511
24530
  pasteFix: " Paste the prompt below into your AI editor, then run: npx deployai@latest check",
24512
24531
  copied: " (copied to clipboard)",
24513
24532
  runDeploy: ' Run: npx deployai@latest deploy -m "<message>"',
24533
+ movedSlug: "The address of the site follows the old domain: {url}",
24534
+ autoLiveOn: "This site goes live by itself once built, as the owner set in Settings on the site page. Waiting for it to be live.",
24514
24535
  moveOfferGranted: "Moved from /move: the site got {n} add-ons free. They wait until the move is done, and the last step offers them.",
24515
24536
  moveOfferCap: "The free add-ons for moved sites were already used on 3 sites of this account.",
24516
24537
  moveOfferOver: "The free add-ons offer for moved sites is over.",
@@ -24617,6 +24638,7 @@ var M = {
24617
24638
  buildLogTail: "End of the build log:",
24618
24639
  buildFixHint: 'Fix the error above, then run: npx deployai@latest check, then npx deployai@latest deploy -m "<message>" --fixed "<one sentence: what you changed, no code>"',
24619
24640
  buildFixHintNoNote: 'Fix the error above, then run: npx deployai@latest check, then npx deployai@latest deploy -m "<message>"',
24641
+ buildFailedAfter: 'The build itself finished: its log ends without an error, so the failure came in a step after it, on our side. Change nothing and deploy again with the same command. If it fails the same way, tell us: npx deployai@latest feedback --kind blocker --command deploy --what "<what you ran and what it printed>"',
24620
24642
  linkedTo: "Linked to {name} ({slug}).",
24621
24643
  loginTitle: "DeployAI login",
24622
24644
  browserOpened: "Opened the browser. Approve the code there.",
@@ -24733,6 +24755,7 @@ var M = {
24733
24755
  sqlConfirmServer: "These changes remove or overwrite data, so they are approved only at the owner's terminal or in the dashboard: {url}",
24734
24756
  sqlAgentAsk: ' Show the owner the changes above and ask: "Version {n} changes the database {db}. Run the changes and put it live?"',
24735
24757
  sqlAgentThen: " After a yes: npx deployai@latest promote v{n} --approve-sql {hash}",
24758
+ sqlLater: " Version {n} changes the database. Nothing runs now and nothing goes live: ask nothing about it yet. When the owner says yes to putting it live, run npx deployai@latest promote v{n}, which shows the changes to approve.",
24736
24759
  sqlNone: "v{n} has no new database changes.",
24737
24760
  sqlFirst: "The database changes run first. If they fail, the live version stays.",
24738
24761
  sqlFailed: "The database changes of v{n} failed. The live version stayed.",
@@ -24784,6 +24807,8 @@ var M = {
24784
24807
  pasteFix: " \u05D4\u05D3\u05D1\u05D9\u05E7\u05D5 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D5\u05DE\u05E4\u05D8 \u05E9\u05DC\u05DE\u05D8\u05D4 \u05DC\u05E1\u05D5\u05DB\u05DF, \u05D5\u05D0\u05D6 \u05D4\u05E8\u05D9\u05E6\u05D5: npx deployai@latest check",
24785
24808
  copied: " (\u05D4\u05D5\u05E2\u05EA\u05E7)",
24786
24809
  runDeploy: ' \u05D4\u05E8\u05D9\u05E6\u05D5: npx deployai@latest deploy -m "<message>"',
24810
+ movedSlug: "\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05D0\u05EA\u05E8 \u05DC\u05E4\u05D9 \u05D4\u05D3\u05D5\u05DE\u05D9\u05D9\u05DF \u05D4\u05D9\u05E9\u05DF: {url}",
24811
+ autoLiveOn: "\u05D4\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4 \u05E2\u05D5\u05DC\u05D4 \u05DC\u05D0\u05D5\u05D5\u05D9\u05E8 \u05DC\u05D1\u05D3 \u05DB\u05E9\u05D4\u05D2\u05E8\u05E1\u05D4 \u05E0\u05D1\u05E0\u05D9\u05EA (\u05D4\u05D2\u05D3\u05E8\u05D4 \u05E9\u05DC \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD, \u05D1\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D4\u05D0\u05EA\u05E8). \u05DE\u05D7\u05DB\u05D9\u05DD \u05E9\u05D9\u05E2\u05DC\u05D4.",
24787
24812
  moveOfferGranted: "\u05D4\u05D0\u05EA\u05E8 \u05E2\u05D1\u05E8 \u05DE /move \u05D5\u05E7\u05D9\u05D1\u05DC {n} \u05EA\u05D5\u05E1\u05E4\u05D9\u05DD \u05D1\u05D7\u05D9\u05E0\u05DD. \u05D4\u05DD \u05DE\u05D7\u05DB\u05D9\u05DD \u05DC\u05E1\u05D5\u05E3 \u05D4\u05DE\u05E2\u05D1\u05E8, \u05D5\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D0\u05D7\u05E8\u05D5\u05DF \u05DE\u05E6\u05D9\u05E2 \u05D0\u05D5\u05EA\u05DD.",
24788
24813
  moveOfferCap: "\u05D4\u05EA\u05D5\u05E1\u05E4\u05D9\u05DD \u05D4\u05D7\u05D9\u05E0\u05DE\u05D9\u05D9\u05DD \u05DC\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05E2\u05D1\u05E8\u05D5 \u05DB\u05D1\u05E8 \u05E0\u05D5\u05E6\u05DC\u05D5 \u05D1 3 \u05D0\u05EA\u05E8\u05D9\u05DD \u05D1\u05D7\u05E9\u05D1\u05D5\u05DF \u05D4\u05D6\u05D4.",
24789
24814
  moveOfferOver: "\u05DE\u05D1\u05E6\u05E2 \u05D4\u05EA\u05D5\u05E1\u05E4\u05D9\u05DD \u05D4\u05D7\u05D9\u05E0\u05DE\u05D9\u05D9\u05DD \u05DC\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05E2\u05D1\u05E8\u05D5 \u05D4\u05E1\u05EA\u05D9\u05D9\u05DD.",
@@ -24890,6 +24915,7 @@ var M = {
24890
24915
  buildLogTail: "\u05E1\u05D5\u05E3 \u05D9\u05D5\u05DE\u05DF \u05D4\u05D1\u05E0\u05D9\u05D9\u05D4:",
24891
24916
  buildFixHint: '\u05EA\u05E7\u05E0\u05D5 \u05D0\u05EA \u05D4\u05E9\u05D2\u05D9\u05D0\u05D4 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4, \u05D5\u05D0\u05D6 \u05D4\u05E8\u05D9\u05E6\u05D5: npx deployai@latest check, \u05D5\u05D0\u05D7\u05E8\u05D9\u05D5 npx deployai@latest deploy -m "<message>" --fixed "<one sentence: what you changed, no code>"',
24892
24917
  buildFixHintNoNote: '\u05EA\u05E7\u05E0\u05D5 \u05D0\u05EA \u05D4\u05E9\u05D2\u05D9\u05D0\u05D4 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4, \u05D5\u05D0\u05D6 \u05D4\u05E8\u05D9\u05E6\u05D5: npx deployai@latest check, \u05D5\u05D0\u05D7\u05E8\u05D9\u05D5 npx deployai@latest deploy -m "<message>"',
24918
+ buildFailedAfter: '\u05D4\u05D1\u05E0\u05D9\u05D9\u05D4 \u05E2\u05E6\u05DE\u05D4 \u05D4\u05E1\u05EA\u05D9\u05D9\u05DE\u05D4: \u05D4\u05D9\u05D5\u05DE\u05DF \u05E9\u05DC\u05D4 \u05E0\u05D2\u05DE\u05E8 \u05D1\u05DC\u05D9 \u05E9\u05D2\u05D9\u05D0\u05D4, \u05DB\u05DA \u05E9\u05D4\u05DB\u05D9\u05E9\u05DC\u05D5\u05DF \u05E7\u05E8\u05D4 \u05D1\u05E9\u05DC\u05D1 \u05E9\u05D0\u05D7\u05E8\u05D9\u05D4, \u05D0\u05E6\u05DC\u05E0\u05D5. \u05D0\u05DC \u05EA\u05E9\u05E0\u05D5 \u05DB\u05DC\u05D5\u05DD \u05D5\u05E4\u05E8\u05E1\u05D5 \u05E9\u05D5\u05D1 \u05D1\u05D0\u05D5\u05EA\u05D4 \u05E4\u05E7\u05D5\u05D3\u05D4. \u05D0\u05DD \u05D6\u05D4 \u05E0\u05DB\u05E9\u05DC \u05E9\u05D5\u05D1 \u05D1\u05D0\u05D5\u05EA\u05D4 \u05E6\u05D5\u05E8\u05D4, \u05E1\u05E4\u05E8\u05D5 \u05DC\u05E0\u05D5: npx deployai@latest feedback --kind blocker --command deploy --what "<what you ran and what it printed>"',
24893
24919
  linkedTo: "\u05DE\u05D7\u05D5\u05D1\u05E8 \u05DC {name} ({slug}).",
24894
24920
  loginTitle: "DeployAI login",
24895
24921
  browserOpened: "\u05D4\u05D3\u05E4\u05D3\u05E4\u05DF \u05E0\u05E4\u05EA\u05D7. \u05D0\u05E9\u05E8\u05D5 \u05E9\u05DD \u05D0\u05EA \u05D4\u05E7\u05D5\u05D3.",
@@ -25006,6 +25032,7 @@ var M = {
25006
25032
  sqlConfirmServer: "\u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05D4\u05D0\u05DC\u05D4 \u05DE\u05D5\u05D7\u05E7\u05D9\u05DD \u05D0\u05D5 \u05D3\u05D5\u05E8\u05E1\u05D9\u05DD \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD, \u05D5\u05DC\u05DB\u05DF \u05DE\u05D0\u05E9\u05E8\u05D9\u05DD \u05D0\u05D5\u05EA\u05DD \u05E8\u05E7 \u05D1\u05DE\u05E1\u05D5\u05E3 \u05E9\u05DC \u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D0\u05D5 \u05D1\u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E8\u05D4: {url}",
25007
25033
  sqlAgentAsk: ' \u05D4\u05E8\u05D0\u05D5 \u05DC\u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D0\u05EA \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05E9\u05D0\u05DC\u05D5: "\u05D2\u05E8\u05E1\u05D4 {n} \u05DE\u05E9\u05E0\u05D4 \u05D0\u05EA \u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD {db}. \u05DC\u05D4\u05E8\u05D9\u05E5 \u05D0\u05EA \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05D5\u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05D0\u05D5\u05EA\u05D4 \u05DC\u05D0\u05D5\u05D5\u05D9\u05E8?"',
25008
25034
  sqlAgentThen: " \u05D0\u05D7\u05E8\u05D9 \u05EA\u05E9\u05D5\u05D1\u05D4 \u05D7\u05D9\u05D5\u05D1\u05D9\u05EA: npx deployai@latest promote v{n} --approve-sql {hash}",
25035
+ sqlLater: " \u05D2\u05E8\u05E1\u05D4 {n} \u05DE\u05E9\u05E0\u05D4 \u05D0\u05EA \u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD. \u05E9\u05D5\u05DD \u05D3\u05D1\u05E8 \u05DC\u05D0 \u05E8\u05E5 \u05E2\u05DB\u05E9\u05D9\u05D5 \u05D5\u05E9\u05D5\u05DD \u05D3\u05D1\u05E8 \u05DC\u05D0 \u05E2\u05D5\u05DC\u05D4 \u05DC\u05D0\u05D5\u05D5\u05D9\u05E8: \u05D0\u05DC \u05EA\u05E9\u05D0\u05DC\u05D5 \u05E2\u05DC \u05D6\u05D4 \u05E2\u05D3\u05D9\u05D9\u05DF. \u05DB\u05E9\u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05DE\u05D0\u05E9\u05E8 \u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05D0\u05D5\u05EA\u05D4 \u05DC\u05D0\u05D5\u05D5\u05D9\u05E8, \u05D4\u05E8\u05D9\u05E6\u05D5 npx deployai@latest promote v{n}, \u05D5\u05D4\u05D5\u05D0 \u05D9\u05E8\u05D0\u05D4 \u05D0\u05EA \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8.",
25009
25036
  sqlNone: "\u05D1\u05BEv{n} \u05D0\u05D9\u05DF \u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05D7\u05D3\u05E9\u05D9\u05DD \u05D1\u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD.",
25010
25037
  sqlFirst: "\u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05D1\u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05E8\u05E6\u05D9\u05DD \u05E7\u05D5\u05D3\u05DD. \u05D0\u05DD \u05D4\u05DD \u05E0\u05DB\u05E9\u05DC\u05D9\u05DD, \u05D4\u05D2\u05E8\u05E1\u05D4 \u05E9\u05D1\u05D0\u05D5\u05D5\u05D9\u05E8 \u05E0\u05E9\u05D0\u05E8\u05EA.",
25011
25038
  sqlFailed: "\u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05D1\u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05E9\u05DC v{n} \u05E0\u05DB\u05E9\u05DC\u05D5. \u05D4\u05D2\u05E8\u05E1\u05D4 \u05E9\u05D1\u05D0\u05D5\u05D5\u05D9\u05E8 \u05E0\u05E9\u05D0\u05E8\u05D4.",
@@ -25041,7 +25068,7 @@ function messages(root) {
25041
25068
  }
25042
25069
 
25043
25070
  // src/version.ts
25044
- var CLI_VERSION = "0.1.0-beta.36";
25071
+ var CLI_VERSION = "0.1.0-beta.38";
25045
25072
 
25046
25073
  // src/api.ts
25047
25074
  function apiContext(apiFlag, root) {
@@ -27312,7 +27339,7 @@ async function migrateScanCommand(root, raw, opts = {}) {
27312
27339
  if (isBlockedMoveSite(source)) throw new CliError("We do not move sites of banks, hospitals, health funds, insurers, payment services or government bodies. Tell the owner this in one line and stop.", 1, "blocked_site");
27313
27340
  const home = await get(source);
27314
27341
  if (!home) throw new CliError(`Could not reach ${source}. Check the address, or that the site is up.`, 1, "network");
27315
- if (home.status === 401 || home.status === 403) throw new CliError(`${source} answers ${home.status}: it is behind a login or blocks visitors. Ask the owner to open it to the public while it moves, or work from their export.`, 1, "blocked");
27342
+ if (home.status === 401 || home.status === 403) throw new CliError(`${source} answers ${home.status}: it is behind a login or a security check. If it opens in a browser, open it in your browser tool, ask the owner to pass any check in that window, and read the pages there (recommended). Else ask the owner to pause the check while it moves, or work from their export.`, 1, "blocked");
27316
27343
  const origin = new URL(home.url).origin;
27317
27344
  const base = (origin + new URL(home.url).pathname).replace(/\/+$/, "");
27318
27345
  const html = await home.text();
@@ -27618,7 +27645,7 @@ async function migrateTagsCommand(root, ctx, opts) {
27618
27645
  const names = removableNames(site);
27619
27646
  const known = opts.removed.filter((r) => names.some((n2) => n2.toLowerCase() === r.toLowerCase()));
27620
27647
  const unknown2 = opts.removed.filter((r) => !known.includes(r));
27621
- if (known.length) out(`Marked as removed by the owner: ${known.join(", ")}. Verify will not ask for these.`);
27648
+ if (known.length) out(`Marked as left out on purpose: ${known.join(", ")}. Verify will not ask for these. The report shows what took its place from the plan row "Replaced with ...".`);
27622
27649
  if (unknown2.length) out(`Not found in what the old site has: ${unknown2.join(", ")}. Use the name verify prints, exactly as it prints it.`);
27623
27650
  }
27624
27651
  for (const a of answers) {
@@ -27721,7 +27748,7 @@ async function migrateVerifyCommand(root, previewRaw, ctx, retryMs = PREVIEW_RET
27721
27748
  for (const t of oldSite.triggers.filter((x) => x.type === "page")) pageOnPreview[t.value] = Boolean((await page3(t.value))?.ok);
27722
27749
  const found = compareTags(oldSite, nextSite, { removed: state.removed ?? [], csp, fileOnPreview, triggerFound, pageOnPreview, formIdFound });
27723
27750
  tagFindings.push(...found);
27724
- perHost.push({ host, checked: checked - checkedBefore, problems: findings.length - findingsBefore, seen: nextSite.tags.map((t) => ({ key: t.key, id: t.id })), found, removed: state.removed ?? [] });
27751
+ perHost.push({ host, checked: checked - checkedBefore, problems: findings.length - findingsBefore, pages: findings.slice(findingsBefore), seen: nextSite.tags.map((t) => ({ key: t.key, id: t.id })), found, removed: state.removed ?? [] });
27725
27752
  }
27726
27753
  }
27727
27754
  const words = { missing: "not found on the preview", moved: "moved to", error: "answers", title_lost: "lost its title", description_lost: "lost its description" };
@@ -27750,13 +27777,13 @@ async function migrateVerifyCommand(root, previewRaw, ctx, retryMs = PREVIEW_RET
27750
27777
  out(`${tagFindings.length} tags and connections need a fix:`);
27751
27778
  for (const f of tagFindings.slice(0, 60)) out(` ${f.what} ${TAG_WORDS[f.problem]}${f.detail ? ` (${f.detail})` : ""}${f.page ? ` on ${f.page}` : ""}`);
27752
27779
  if (tagFindings.length > 60) out(` and ${tagFindings.length - 60} more in verify.json`);
27753
- out('Put each one back, deploy again and run verify again. If the owner asked to drop one: npx deployai@latest migrate tags --removed "<its number or name>".');
27780
+ out('Put each one back, deploy again and run verify again. If one was left out on purpose (the owner asked, or the plan replaced it with ours): npx deployai@latest migrate tags --removed "<its number or name>", and give its plan row the status "Replaced with <what took its place>" so the report says so.');
27754
27781
  process.exitCode = 1;
27755
27782
  }
27756
27783
  const clean3 = !findings.length && !tagFindings.length && !credits.size && !vendors.size && !leftOnOld.length;
27757
27784
  for (const h of perHost) {
27758
27785
  const dir = hostDir(root, h.host);
27759
- const verify = { checkedAt: (/* @__PURE__ */ new Date()).toISOString(), pagesChecked: h.checked, pageProblems: h.problems, findings: h.found.map((f) => ({ problem: f.problem, what: f.what.slice(0, 240), ...f.detail ? { detail: f.detail.slice(0, 300) } : {}, ...f.page ? { page: f.page.slice(0, 300) } : {} })).slice(0, 300), seen: h.seen.slice(0, 300), removed: h.removed, vendors: [...vendors.keys()].map((v) => v.slice(0, 80)).slice(0, 40) };
27786
+ const verify = { checkedAt: (/* @__PURE__ */ new Date()).toISOString(), pagesChecked: h.checked, pageProblems: h.problems, pageFindings: h.pages.map((f) => ({ path: f.path.slice(0, 300), problem: f.problem })).slice(0, 150), findings: h.found.map((f) => ({ problem: f.problem, what: f.what.slice(0, 240), ...f.detail ? { detail: f.detail.slice(0, 300) } : {}, ...f.page ? { page: f.page.slice(0, 300) } : {} })).slice(0, 300), seen: h.seen.slice(0, 300), removed: h.removed, vendors: [...vendors.keys()].map((v) => v.slice(0, 80)).slice(0, 40) };
27760
27787
  writeJson(join13(dir, "verify-report.json"), { report: verify });
27761
27788
  await sendReport(root, ctx, h.host, clean3 ? "verify" : null, verify);
27762
27789
  }
@@ -27788,6 +27815,10 @@ async function moveOffer(root, p, ctx) {
27788
27815
  const t = messages(root);
27789
27816
  try {
27790
27817
  const r = await apiRequest(ctx, "/api/cli/migrations/grant", null, { method: "POST", body: { projectId: p.id, startId } });
27818
+ if (typeof r.slug === "string" && /^[a-z0-9-]{2,40}$/.test(r.slug)) {
27819
+ updateProject(root, { slug: r.slug });
27820
+ out(t("movedSlug", { url: r.url ?? r.slug }));
27821
+ }
27791
27822
  if (r.granted?.length) out(t("moveOfferGranted", { n: r.granted.length }));
27792
27823
  else if (r.reason && r.reason !== "start_used") out(t(r.reason === "cap" ? "moveOfferCap" : "moveOfferOver"));
27793
27824
  } catch {
@@ -28580,8 +28611,14 @@ function printStatus(root, ctx, projectId, s) {
28580
28611
  for (const line of s.latest.logTail.split("\n")) out(` ${line}`);
28581
28612
  }
28582
28613
  out();
28614
+ const lastLines = (s.latest.logTail ?? "").trim().split("\n").slice(-4).join("\n");
28615
+ if (!s.latest.error && BUILD_FINISHED.test(lastLines)) {
28616
+ out(t("buildFailedAfter"));
28617
+ return;
28618
+ }
28583
28619
  out(t(telemetryEnabled(ctx.config) ? "buildFixHint" : "buildFixHintNoNote"));
28584
28620
  }
28621
+ var BUILD_FINISHED = /(\bComplete!|\bbuilt in \d|Compiled successfully|\bDone in \d|\bbuild complete)/i;
28585
28622
 
28586
28623
  // src/commands/sql.ts
28587
28624
  function fetchSqlPlan(ctx, projectId, n2) {
@@ -28793,7 +28830,8 @@ async function deployVersion(root, ctx, opts, guest) {
28793
28830
  out(t("thenPromote", { n: res.number }));
28794
28831
  return;
28795
28832
  }
28796
- await afterBuild(root, ctx, project.projectId, res.number, { live, pollMs: opts.pollMs ?? 3e3, homeRetryMs: opts.pollMs });
28833
+ if (res.autoLive && !live) out(t("autoLiveOn"));
28834
+ await afterBuild(root, ctx, project.projectId, res.number, { live: live || Boolean(res.autoLive), pollMs: opts.pollMs ?? 3e3, homeRetryMs: opts.pollMs });
28797
28835
  }
28798
28836
  var CREDIT_WAIT_MS = 1e4;
28799
28837
  var sleep3 = (ms2) => new Promise((r) => setTimeout(r, ms2));
@@ -28838,6 +28876,11 @@ async function afterBuild(root, ctx, projectId, n2, o) {
28838
28876
  const sqlWaits = ready && built.latest?.migrationStatus === "waiting";
28839
28877
  let approval = null;
28840
28878
  let live = o.live;
28879
+ if (sqlWaits && !o.live && !isInteractive()) {
28880
+ out(t("sqlLater", { n: n2 }));
28881
+ printStatus(root, ctx, projectId, built);
28882
+ return;
28883
+ }
28841
28884
  if (sqlWaits) {
28842
28885
  if (built.latest?.preview) out(t("showPreview", { url: built.latest.preview }));
28843
28886
  approval = await approveSqlStep(root, ctx, projectId, n2);
@@ -29531,11 +29574,36 @@ async function speedCommand(ctx, url2, opts, deps = {}) {
29531
29574
 
29532
29575
  // src/commands/shot.ts
29533
29576
  import { spawn as spawn4 } from "child_process";
29534
- import { existsSync as existsSync18, mkdirSync as mkdirSync11 } from "fs";
29577
+ import { existsSync as existsSync18, mkdirSync as mkdirSync11, readFileSync as readFileSync15, rmSync as rmSync5, writeFileSync as writeFileSync17 } from "fs";
29578
+ import { tmpdir as tmpdir3 } from "os";
29535
29579
  import { join as join22, resolve as resolve6 } from "path";
29536
29580
  var SHOT_SIZES = [{ name: "phone", size: "390,844" }, { name: "desktop", size: "1440,900" }];
29537
29581
  var PLAYWRIGHT = "playwright@1.56";
29538
29582
  var WAIT_MS3 = 18e4;
29583
+ var TIMED_OUT = 124;
29584
+ var TAKER = String.raw`const fs = require('fs'), path = require('path');
29585
+ const a = process.argv.slice(2), opt = (k) => (a.find((x) => x.startsWith('--' + k + '=')) || '').split('=')[1];
29586
+ const [url, file] = a.filter((x) => !x.startsWith('--'));
29587
+ const step = (s) => fs.writeFileSync(file + '.step', s);
29588
+ const bin = (process.env.PATH || '').split(path.delimiter).find((d) => fs.existsSync(path.join(d, '..', 'playwright', 'package.json')));
29589
+ const pw = require(path.join(bin, '..', 'playwright'));
29590
+ (async () => {
29591
+ step('start the browser');
29592
+ const [w, h] = opt('viewport-size').split(',').map(Number);
29593
+ const browser = opt('browser') === 'webkit' ? await pw.webkit.launch() : await pw.chromium.launch({ channel: opt('channel') });
29594
+ const page = await browser.newPage({ viewport: { width: w, height: h } });
29595
+ step('open the page');
29596
+ await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
29597
+ await page.waitForLoadState('load', { timeout: 15000 }).catch(() => {});
29598
+ step('scroll to the bottom');
29599
+ await page.evaluate(async () => { for (let y = 0; y < Math.min(document.body.scrollHeight, 40000); y += innerHeight) { scrollTo(0, y); await new Promise((r) => setTimeout(r, 150)); } scrollTo(0, 0); });
29600
+ await page.waitForTimeout(1500);
29601
+ step('take the picture');
29602
+ await page.screenshot({ path: file, fullPage: true, animations: 'disabled', timeout: 60000 });
29603
+ await browser.close();
29604
+ fs.rmSync(file + '.step', { force: true });
29605
+ })().catch((e) => { try { fs.appendFileSync(file + '.step', ': ' + String(e && e.message || e).split(String.fromCharCode(10))[0]); } catch {} process.exit(1); });
29606
+ `;
29539
29607
  var channelFor = (browser) => /msedge|edge/i.test(browser) ? "msedge" : "chrome";
29540
29608
  function shotName(address, width) {
29541
29609
  const u = new URL(address);
@@ -29546,14 +29614,18 @@ function runNpx(args) {
29546
29614
  const win = process.platform === "win32";
29547
29615
  return new Promise((done) => {
29548
29616
  const child = win ? spawn4(["npx", ...args.map((a) => `"${a}"`)].join(" "), { stdio: "ignore", windowsHide: true, shell: true }) : spawn4("npx", args, { stdio: "ignore" });
29549
- const timer = setTimeout(() => child.kill(), WAIT_MS3);
29617
+ let killed = false;
29618
+ const timer = setTimeout(() => {
29619
+ killed = true;
29620
+ child.kill();
29621
+ }, WAIT_MS3);
29550
29622
  child.once("error", () => {
29551
29623
  clearTimeout(timer);
29552
29624
  done(1);
29553
29625
  });
29554
29626
  child.once("exit", (code) => {
29555
29627
  clearTimeout(timer);
29556
- done(code ?? 1);
29628
+ done(killed ? TIMED_OUT : code ?? 1);
29557
29629
  });
29558
29630
  });
29559
29631
  }
@@ -29570,12 +29642,19 @@ async function shotCommand(root, address, opts = {}, run = runNpx) {
29570
29642
  if (opts.webkit && await run(["--yes", PLAYWRIGHT, "install", "webkit"]) !== 0) throw new CliError("Safari's engine could not be installed. Run shot without --webkit to use Chrome or Edge.", 1, "shot_failed");
29571
29643
  const dir = resolve6(root, opts.out ?? join22(".deployai", "shots"));
29572
29644
  mkdirSync11(dir, { recursive: true });
29645
+ const taker = join22(tmpdir3(), "deployai-shot.cjs");
29646
+ writeFileSync17(taker, TAKER);
29573
29647
  const saved = [];
29574
29648
  for (const s of SHOT_SIZES) {
29575
29649
  const file2 = join22(dir, shotName(url2.toString(), s.name));
29576
29650
  const engine = opts.webkit ? ["--browser=webkit"] : [`--channel=${channelFor(browser)}`];
29577
- const code = await run(["--yes", PLAYWRIGHT, "screenshot", ...engine, `--viewport-size=${s.size}`, "--full-page", "--wait-for-timeout=1500", url2.toString(), file2]);
29578
- if (code !== 0 || !existsSync18(file2)) throw new CliError(`The ${s.name} picture of ${url2} could not be taken. Check that the page opens, then run shot again.`, 1, "shot_failed");
29651
+ rmSync5(file2, { force: true });
29652
+ const code = await run(["--yes", "-p", PLAYWRIGHT, "node", taker, ...engine, `--viewport-size=${s.size}`, url2.toString(), file2]);
29653
+ if (code !== 0 || !existsSync18(file2)) {
29654
+ const step = existsSync18(`${file2}.step`) ? readFileSync15(`${file2}.step`, "utf8").trim() : "";
29655
+ rmSync5(`${file2}.step`, { force: true });
29656
+ throw new CliError(`The ${s.name} picture of ${url2} could not be taken${step ? `, stopped at: ${step}` : code === TIMED_OUT ? ", it took over 3 minutes" : ""}. Check that the page opens, then run shot again; if it stops again, look with your own browser tool or at home.html.`, 1, "shot_failed");
29657
+ }
29579
29658
  saved.push(file2);
29580
29659
  out(`${s.name.padEnd(8)} ${file2}`);
29581
29660
  }
@@ -29585,7 +29664,7 @@ async function shotCommand(root, address, opts = {}, run = runNpx) {
29585
29664
 
29586
29665
  // src/commands/images.ts
29587
29666
  import { spawnSync as spawnSync5 } from "child_process";
29588
- import { existsSync as existsSync19, mkdirSync as mkdirSync12, readdirSync as readdirSync6, statSync as statSync3, writeFileSync as writeFileSync17 } from "fs";
29667
+ import { existsSync as existsSync19, mkdirSync as mkdirSync12, readdirSync as readdirSync6, statSync as statSync3, writeFileSync as writeFileSync18 } from "fs";
29589
29668
  import { createRequire } from "module";
29590
29669
  import { homedir as homedir3 } from "os";
29591
29670
  import { extname, join as join23, relative as relative4, resolve as resolve7 } from "path";
@@ -29616,7 +29695,7 @@ function loadSharp() {
29616
29695
  const dir = join23(homedir3(), ".deployai", "tools", "sharp");
29617
29696
  if (!existsSync19(join23(dir, "node_modules", "sharp"))) {
29618
29697
  mkdirSync12(dir, { recursive: true });
29619
- if (!existsSync19(join23(dir, "package.json"))) writeFileSync17(join23(dir, "package.json"), '{"private":true}');
29698
+ if (!existsSync19(join23(dir, "package.json"))) writeFileSync18(join23(dir, "package.json"), '{"private":true}');
29620
29699
  out("Getting the image tool once (it stays outside the site)...");
29621
29700
  const r = spawnSync5(process.platform === "win32" ? "npm.cmd" : "npm", ["install", SHARP, "--no-audit", "--no-fund", "--silent"], { cwd: dir, stdio: "ignore", shell: process.platform === "win32" });
29622
29701
  if (r.status !== 0) throw new CliError("The image tool could not be installed. Check the internet connection and run optimize again.", 1, "images_failed");
@@ -29658,7 +29737,7 @@ async function imagesCommand(root, folder, sharp = loadSharp) {
29658
29737
 
29659
29738
  // src/commands/blocks.ts
29660
29739
  import { createHash as createHash4 } from "crypto";
29661
- import { existsSync as existsSync20, mkdirSync as mkdirSync13, readFileSync as readFileSync15, writeFileSync as writeFileSync18 } from "fs";
29740
+ import { existsSync as existsSync20, mkdirSync as mkdirSync13, readFileSync as readFileSync16, writeFileSync as writeFileSync19 } from "fs";
29662
29741
  import { dirname as dirname7, resolve as resolve8, sep as sep3 } from "path";
29663
29742
  import { gunzipSync as gunzipSync3 } from "zlib";
29664
29743
  var BLOCKS = [
@@ -29713,25 +29792,30 @@ async function blocksCommand(root, ctx, name, opts = {}) {
29713
29792
  const target = resolve8(base, e3.name);
29714
29793
  if (target === base || !target.startsWith(base + sep3)) continue;
29715
29794
  if (existsSync20(target)) {
29716
- const now = sha(readFileSync15(target));
29795
+ const now = sha(readFileSync16(target));
29717
29796
  if (now === sha(e3.data)) {
29718
29797
  lock[e3.name] = now;
29719
29798
  } else if (opts.update && lock[e3.name] === now) {
29720
- writeFileSync18(target, e3.data);
29799
+ writeFileSync19(target, e3.data);
29721
29800
  lock[e3.name] = sha(e3.data);
29722
29801
  updated.push(e3.name);
29723
29802
  } else {
29803
+ const upstream = resolve8(base, ".deployai", "blocks", `${block.key}-upstream`, e3.name);
29804
+ if (upstream.startsWith(base + sep3)) {
29805
+ mkdirSync13(dirname7(upstream), { recursive: true });
29806
+ writeFileSync19(upstream, e3.data);
29807
+ }
29724
29808
  kept.push(e3.name);
29725
29809
  }
29726
29810
  continue;
29727
29811
  }
29728
29812
  mkdirSync13(dirname7(target), { recursive: true });
29729
- writeFileSync18(target, e3.data);
29813
+ writeFileSync19(target, e3.data);
29730
29814
  lock[e3.name] = sha(e3.data);
29731
29815
  written.push(e3.name);
29732
29816
  }
29733
29817
  mkdirSync13(dirname7(lockPath(base, block.key)), { recursive: true });
29734
- writeFileSync18(lockPath(base, block.key), `${JSON.stringify(lock, null, 2)}
29818
+ writeFileSync19(lockPath(base, block.key), `${JSON.stringify(lock, null, 2)}
29735
29819
  `);
29736
29820
  out(`Added the ${block.key} block: ${written.length} files.`);
29737
29821
  written.forEach((f) => out(` + ${f}`));
@@ -29742,6 +29826,7 @@ async function blocksCommand(root, ctx, name, opts = {}) {
29742
29826
  if (kept.length) {
29743
29827
  out(`These ${kept.length} files already exist and were left as they are; merge what the block needs into them:`);
29744
29828
  kept.forEach((f) => out(` = ${f}`));
29829
+ out(`The block's own version of each is in .deployai/blocks/${block.key}-upstream/ at the same path: compare the two (git diff --no-index <yours> <its>), merge, then delete that folder.`);
29745
29830
  }
29746
29831
  out(`Read .deployai/blocks/${block.key}.md and follow it: it says what to wire and what to set.`);
29747
29832
  }
@@ -29792,9 +29877,9 @@ async function integrationsCommand(ctx, name, opts = {}) {
29792
29877
 
29793
29878
  // src/commands/brand.ts
29794
29879
  import { spawn as spawn5 } from "child_process";
29795
- import { copyFileSync, existsSync as existsSync21, mkdirSync as mkdirSync14, mkdtempSync as mkdtempSync3, readdirSync as readdirSync7, readFileSync as readFileSync16, rmSync as rmSync5, statSync as statSync4, writeFileSync as writeFileSync19 } from "fs";
29880
+ import { copyFileSync, existsSync as existsSync21, mkdirSync as mkdirSync14, mkdtempSync as mkdtempSync3, readdirSync as readdirSync7, readFileSync as readFileSync17, rmSync as rmSync6, statSync as statSync4, writeFileSync as writeFileSync20 } from "fs";
29796
29881
  import { createServer } from "http";
29797
- import { tmpdir as tmpdir3 } from "os";
29882
+ import { tmpdir as tmpdir4 } from "os";
29798
29883
  import { basename as basename2, dirname as dirname8, extname as extname2, join as join24, relative as relative5, sep as sep4 } from "path";
29799
29884
  import { randomBytes } from "crypto";
29800
29885
 
@@ -29918,7 +30003,7 @@ function existingFavicon(root) {
29918
30003
  for (const d of ["app", "src/app"]) for (const f of ["favicon.ico", "icon.svg", "icon.png", "icon.tsx", "icon.jpg"]) if (existsSync21(join24(root, d, f))) return `${d}/${f}`;
29919
30004
  for (const f of walk(root).filter((p) => /\.(html|astro|tsx|jsx|vue|svelte)$/.test(p)).slice(0, 400)) {
29920
30005
  try {
29921
- const m = readFileSync16(f, "utf8").match(/<link\b[^>]*\brel=["'](?:shortcut )?icon["'][^>]*>/i);
30006
+ const m = readFileSync17(f, "utf8").match(/<link\b[^>]*\brel=["'](?:shortcut )?icon["'][^>]*>/i);
29922
30007
  if (!m) continue;
29923
30008
  const href = m[0].match(/\shref=["']([^"']+)/i)?.[1] ?? "";
29924
30009
  if (href.startsWith("data:") || /^https?:/.test(href) || existsSync21(join24(web, href.split("?")[0]))) return relative5(root, f).split(sep4).join("/");
@@ -29938,7 +30023,7 @@ function scannedIcons(root) {
29938
30023
  for (const i of list) {
29939
30024
  const path = join24(dir, i.file);
29940
30025
  if (!existsSync21(path)) continue;
29941
- const size = imageSize(readFileSync16(path));
30026
+ const size = imageSize(readFileSync17(path));
29942
30027
  found.push({ path, kind: i.kind, big: !size || size.width >= 64 });
29943
30028
  }
29944
30029
  } catch {
@@ -29964,7 +30049,7 @@ var CODE_EXT2 = /\.(css|scss|sass|less|html|astro|vue|svelte)$/i;
29964
30049
  var READ_CAP = 300;
29965
30050
  function readText2(path) {
29966
30051
  try {
29967
- return readFileSync16(path, "utf8");
30052
+ return readFileSync17(path, "utf8");
29968
30053
  } catch {
29969
30054
  return "";
29970
30055
  }
@@ -30014,7 +30099,7 @@ function writeSiteFile(root, file2, data) {
30014
30099
  copyFileSync(target, join24(keep, file2));
30015
30100
  }
30016
30101
  mkdirSync14(dirname8(target), { recursive: true });
30017
- writeFileSync19(target, data);
30102
+ writeFileSync20(target, data);
30018
30103
  }
30019
30104
  var send = (res, status, body = "", type = "text/plain; charset=utf-8") => {
30020
30105
  res.writeHead(status, { "content-type": type, "cache-control": "no-store", "x-content-type-options": "nosniff" });
@@ -30049,7 +30134,7 @@ function allowed(req, url2, port, token) {
30049
30134
  return req.headers.host === `127.0.0.1:${port}` && url2.searchParams.get("t") === token;
30050
30135
  }
30051
30136
  async function headless(browser, url2, width, until, timeoutMs) {
30052
- const profile = mkdtempSync3(join24(tmpdir3(), "deployai-brand-"));
30137
+ const profile = mkdtempSync3(join24(tmpdir4(), "deployai-brand-"));
30053
30138
  const child = spawn5(browser, ["--headless=new", "--disable-gpu", "--no-first-run", "--no-default-browser-check", "--disable-extensions", `--user-data-dir=${profile}`, `--window-size=${width},900`, url2], { stdio: "ignore", windowsHide: true });
30054
30139
  child.on("error", () => {
30055
30140
  });
@@ -30069,7 +30154,7 @@ async function headless(browser, url2, width, until, timeoutMs) {
30069
30154
  setTimeout(done, 3e3);
30070
30155
  });
30071
30156
  try {
30072
- rmSync5(profile, { recursive: true, force: true, maxRetries: 3, retryDelay: 200 });
30157
+ rmSync6(profile, { recursive: true, force: true, maxRetries: 3, retryDelay: 200 });
30073
30158
  } catch {
30074
30159
  }
30075
30160
  }
@@ -30149,7 +30234,7 @@ async function drawInBrowser(o, browser) {
30149
30234
  }
30150
30235
  }
30151
30236
  function sourceBytes(path) {
30152
- return { bytes: readFileSync16(path), type: TYPES[extname2(path).toLowerCase()] ?? "application/octet-stream" };
30237
+ return { bytes: readFileSync17(path), type: TYPES[extname2(path).toLowerCase()] ?? "application/octet-stream" };
30153
30238
  }
30154
30239
  function report(root, r) {
30155
30240
  const where = relative5(root, webRoot(root)).split(sep4).join("/") || "the site root";
@@ -30167,7 +30252,7 @@ function plainIcon(root, source, name, color) {
30167
30252
  const ext = extname2(source.path).toLowerCase();
30168
30253
  if (ext === ".ico" || ext === ".svg" || ext === ".png") {
30169
30254
  const file2 = `favicon${ext}`;
30170
- writeSiteFile(root, file2, readFileSync16(source.path));
30255
+ writeSiteFile(root, file2, readFileSync17(source.path));
30171
30256
  return [file2];
30172
30257
  }
30173
30258
  }
@@ -30323,7 +30408,7 @@ function judgeFiles(root) {
30323
30408
  for (const f of files) {
30324
30409
  let bytes;
30325
30410
  try {
30326
- bytes = readFileSync16(f);
30411
+ bytes = readFileSync17(f);
30327
30412
  } catch {
30328
30413
  continue;
30329
30414
  }
@@ -30376,7 +30461,7 @@ async function brandImagesCommand(root, urls, opts) {
30376
30461
  mkdirSync14(join24(root, BRAND_DIR), { recursive: true });
30377
30462
  const file2 = `${BRAND_DIR}/images.json`;
30378
30463
  const data = { measuredAt: (/* @__PURE__ */ new Date()).toISOString(), pages: urls, unmeasured, filesChecked: total, imagesMeasured: shown.size, weak };
30379
- writeFileSync19(join24(root, file2), `${JSON.stringify(data, null, 2)}
30464
+ writeFileSync20(join24(root, file2), `${JSON.stringify(data, null, 2)}
30380
30465
  `);
30381
30466
  if (opts.json) {
30382
30467
  out(JSON.stringify(data));
@@ -30599,7 +30684,7 @@ async function main(argv = process.argv) {
30599
30684
 
30600
30685
  // src/update.ts
30601
30686
  import { spawnSync as spawnSync6 } from "child_process";
30602
- import { existsSync as existsSync23, mkdirSync as mkdirSync15, readdirSync as readdirSync8, readFileSync as readFileSync17, rmSync as rmSync6, writeFileSync as writeFileSync20 } from "fs";
30687
+ import { existsSync as existsSync23, mkdirSync as mkdirSync15, readdirSync as readdirSync8, readFileSync as readFileSync18, rmSync as rmSync7, writeFileSync as writeFileSync21 } from "fs";
30603
30688
  import { join as join26 } from "path";
30604
30689
  var CHECK_EVERY_MS = 60 * 60 * 1e3;
30605
30690
  var ASK_NPM_MS = 1500;
@@ -30642,7 +30727,7 @@ function statePath() {
30642
30727
  }
30643
30728
  function readState() {
30644
30729
  try {
30645
- const data = JSON.parse(readFileSync17(statePath(), "utf8"));
30730
+ const data = JSON.parse(readFileSync18(statePath(), "utf8"));
30646
30731
  return data && typeof data === "object" ? data : {};
30647
30732
  } catch {
30648
30733
  return {};
@@ -30651,7 +30736,7 @@ function readState() {
30651
30736
  function writeState(state) {
30652
30737
  try {
30653
30738
  mkdirSync15(configDir(), { recursive: true });
30654
- writeFileSync20(statePath(), JSON.stringify(state) + "\n");
30739
+ writeFileSync21(statePath(), JSON.stringify(state) + "\n");
30655
30740
  } catch {
30656
30741
  }
30657
30742
  }
@@ -30675,12 +30760,12 @@ function getVersion(version2, env) {
30675
30760
  const root = join26(configDir(), "cli");
30676
30761
  const dir = join26(root, version2);
30677
30762
  mkdirSync15(dir, { recursive: true });
30678
- writeFileSync20(join26(dir, "package.json"), '{"private":true}\n');
30763
+ writeFileSync21(join26(dir, "package.json"), '{"private":true}\n');
30679
30764
  const installed = spawnSync6(`npm install deployai@${version2} --ignore-scripts --no-audit --no-fund --silent`, { cwd: dir, env, shell: true, stdio: "ignore", windowsHide: true, timeout: GET_VERSION_MS });
30680
30765
  if (installed.status !== 0) return false;
30681
30766
  const ran = spawnSync6(process.execPath, [versionEntry(version2), "--version"], { env: { ...env, DEPLOYAI_NO_UPDATE: "1" }, encoding: "utf8", timeout: GET_VERSION_MS });
30682
30767
  if (ran.status !== 0 || ran.stdout.trim() !== version2) return false;
30683
- for (const old of readdirSync8(root)) if (old !== version2) rmSync6(join26(root, old), { recursive: true, force: true });
30768
+ for (const old of readdirSync8(root)) if (old !== version2) rmSync7(join26(root, old), { recursive: true, force: true });
30684
30769
  return true;
30685
30770
  }
30686
30771
  function runVersion(version2, args, env = process.env) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deployai",
3
- "version": "0.1.0-beta.36",
3
+ "version": "0.1.0-beta.38",
4
4
  "description": "Check a site built with an AI editor, see what has to change, and publish it to DeployAI. Hebrew first.",
5
5
  "keywords": [
6
6
  "deployai",