deployai 0.1.0-beta.17 → 0.1.0-beta.19

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 CHANGED
@@ -62,7 +62,7 @@ Node 20 or newer. No other setup: the CLI talks to https://deployai.co.il.
62
62
  | `deployai blocks [inbox\|blog]` | Adds one of DeployAI's building blocks to an existing site, never over a file, with a guide in `.deployai/blocks/<key>.md`. With no key it lists them. |
63
63
  | `deployai claim` | Prints this folder's temporary site keep link again. `--email <address>` mails it, with a reminder before the delete. |
64
64
  | `deployai samples [name] [folder]` | Lists the six sample sites, or downloads one. More below. |
65
- | `deployai start <id>` | The one line copied on the DeployAI site. Prepares this folder, then prints the steps for your agent. No login needed. More below. |
65
+ | `deployai start <id>` | The one line copied on the DeployAI site. Prepares this folder, then prints the steps for your agent. A site's line logs in first; a temporary site needs no login. More below. |
66
66
  | `deployai speed <url>` | Google PageSpeed test of a page: lab results, real visitor data when Google has it and the biggest opportunities. `--desktop` tests a desktop load. |
67
67
  | `deployai addons` | The marketplace add-ons of the linked site: which it has, which are done and which is next. Works once the DeployAI marketplace is open; the server checks that the site has each add-on. |
68
68
  | `deployai addon next` | Prints the next add-on of the site for your agent. `deployai addon run <name>` prints one by name. |
@@ -99,7 +99,7 @@ Global options:
99
99
  **`deployai start <id>`**
100
100
  - The one line copied on the DeployAI site.
101
101
  - Prepares this folder with every choice made there: a new folder for a new site when this one has files, the sample and its install, the owner's details, the link to the site. Then prints the steps for your agent.
102
- - No login needed.
102
+ - A line for a site opens only for its owner or an editor, so it logs in first if needed. A temporary site's line needs no login.
103
103
  - It saves the owner's language, so later results print in it (D-266; `--lang he|en` or `DEPLOYAI_LANG` override it).
104
104
  - `--here` keeps this folder, `--no-install` skips the install.
105
105
 
package/dist/index.js CHANGED
@@ -21580,6 +21580,12 @@ function isSpaShell(html) {
21580
21580
  return /<div\b[^>]*\bid\s*=\s*["'](?:root|app|__nuxt|svelte)["'][^>]*>\s*<\/div>/i.test(html) && !/<h1\b/i.test(html);
21581
21581
  }
21582
21582
 
21583
+ // ../shared/src/known-bot-rule.ts
21584
+ var KNOWN_BOT_RULES = [
21585
+ { description: "known-bot yes", expression: "cf.client.bot", value: "1" },
21586
+ { description: "known-bot no", expression: "not cf.client.bot", value: "0" }
21587
+ ].map((r) => ({ description: r.description, expression: r.expression, action: "rewrite", action_parameters: { headers: { "x-deployai-known-bot": { operation: "set", value: r.value } } }, enabled: true }));
21588
+
21583
21589
  // ../shared/src/tool-fetch.ts
21584
21590
  var FILE_BYTES = 512 * 1024;
21585
21591
 
@@ -21698,6 +21704,9 @@ var MANAGED_STEPS = [
21698
21704
  ];
21699
21705
  var PULL = { cmd: "npx deployai@latest pull", say: "This folder was empty, so it downloads the code of the live site first. Work on that code." };
21700
21706
  function startSteps(kind, opts = {}) {
21707
+ return opts.signedIn ? stepsOf(kind, opts).filter((s) => s !== LOGIN) : stepsOf(kind, opts);
21708
+ }
21709
+ function stepsOf(kind, opts) {
21701
21710
  switch (kind) {
21702
21711
  case "new":
21703
21712
  return [...opts.starter ? [BUILD] : [], CHECK, ASK, LOGIN, { cmd: 'npx deployai@latest deploy -m "first version"', say: DEPLOY_SAY }, PROMOTE];
@@ -21741,6 +21750,7 @@ var CLI_MAP_NODES = [
21741
21750
  n("page-new", "site", "/dashboard/new", "\u05D0\u05EA\u05E8 \u05D7\u05D3\u05E9: \u05D4\u05D3\u05D5\u05D2\u05DE\u05D4, \u05D4\u05E9\u05DD \u05D5\u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E0\u05E9\u05DE\u05E8\u05D9\u05DD \u05D1\u05D0\u05EA\u05E8, \u05D5\u05D4 id \u05E0\u05D5\u05E9\u05D0 \u05D0\u05EA \u05DB\u05D5\u05DC\u05DD.", "New site: the sample, name and details are saved on the site, and the id carries them all."),
21742
21751
  n("page-site", "site", "/project/<id>", "\u05E2\u05DE\u05D5\u05D3 \u05D4\u05D0\u05EA\u05E8: \u05E9\u05D5\u05E8\u05EA \u05D4\u05EA\u05D7\u05DC\u05D4 \u05E2\u05D3 \u05D4\u05D2\u05E8\u05E1\u05D4 \u05D4\u05E8\u05D0\u05E9\u05D5\u05E0\u05D4, \u05D5\u05D0\u05D7\u05E8\u05D9\u05D4 \u05E9\u05D5\u05E8\u05EA \u05E2\u05D3\u05DB\u05D5\u05DF.", "The site page: a new site line until the first version, then an update line."),
21743
21752
  n("page-move-url", "site", "/move", "\u05D4\u05E2\u05D1\u05D9\u05E8\u05D5 \u05D0\u05EA \u05D4\u05D0\u05EA\u05E8 \u05E9\u05DC\u05D9: \u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05D0\u05EA\u05E8 \u05D4\u05D9\u05E9\u05DF, \u05D4\u05E4\u05DC\u05D8\u05E4\u05D5\u05E8\u05DE\u05D4, \u05E1\u05D5\u05D2 \u05D4\u05D0\u05EA\u05E8 \u05D5\u05D4\u05E2\u05D9\u05E6\u05D5\u05D1. \u05D4 id \u05E0\u05D5\u05E9\u05D0 \u05D0\u05EA \u05DB\u05D5\u05DC\u05DD.", "Move my site: the old site address, the platform, the kind of site and the design. The id carries them all."),
21753
+ n("page-refresh", "site", "/project/<id>/refresh", "\u05E8\u05E2\u05E0\u05D5\u05DF \u05D4\u05E2\u05D9\u05E6\u05D5\u05D1: \u05E9\u05D5\u05E8\u05D4 \u05DC\u05E2\u05D9\u05E6\u05D5\u05D1 \u05D7\u05D3\u05E9 \u05DC\u05D0\u05EA\u05E8 \u05D7\u05D9, \u05DE\u05EA\u05D5\u05DA \u05D4\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05DC\u05D9.", "Freshen it up: a line for a new look on a live site, from My sites."),
21744
21754
  n("page-move", "site", "/dashboard", "\u05D9\u05E9 \u05DC\u05D9 \u05DB\u05D1\u05E8 \u05D0\u05EA\u05E8: \u05E9\u05D5\u05E8\u05D4 \u05DC\u05D4\u05E2\u05D1\u05E8\u05EA \u05D4\u05D0\u05EA\u05E8 \u05E9\u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4.", "I already have a site: a line to move the site in the folder."),
21745
21755
  // The CLI: every command (packages/cli/src/cli.ts).
21746
21756
  n("cmd-start", "cli", "start <id>", "\u05DE\u05DB\u05D9\u05DF \u05D0\u05EA \u05D4\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05DC\u05E4\u05D9 \u05DB\u05DC \u05D4\u05D1\u05D7\u05D9\u05E8\u05D5\u05EA: \u05EA\u05D9\u05E7\u05D9\u05D9\u05D4, \u05D3\u05D5\u05D2\u05DE\u05D4 \u05D5\u05D4\u05EA\u05E7\u05E0\u05D4, \u05E7\u05D5\u05D1\u05E5 \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05D5\u05D7\u05D9\u05D1\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8. \u05DE\u05D3\u05E4\u05D9\u05E1 \u05DC\u05E1\u05D5\u05DB\u05DF \u05D0\u05EA \u05D4\u05D8\u05E7\u05E1\u05D8 \u05D5\u05D0\u05EA \u05D4\u05E4\u05E7\u05D5\u05D3\u05D5\u05EA.", "Prepares the folder with every choice: folder, sample and install, the details file and the site link. Prints the text and the commands for the agent."),
@@ -21771,7 +21781,7 @@ var CLI_MAP_NODES = [
21771
21781
  n("cmd-allow", "cli", "allow [tool]", "\u05D0\u05D7\u05E8\u05D9 \u05E9\u05D4\u05D1\u05E2\u05DC\u05D9\u05DD \u05D0\u05D9\u05E9\u05E8: \u05DB\u05DC\u05D9 \u05D4\u05E7\u05D5\u05D3 \u05DE\u05E4\u05E1\u05D9\u05E7 \u05DC\u05E9\u05D0\u05D5\u05DC \u05DC\u05E4\u05E0\u05D9 \u05DB\u05DC \u05E4\u05E7\u05D5\u05D3\u05EA DeployAI, \u05E8\u05E7 \u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D4\u05D6\u05D5.", "After the owner says yes: the coding tool stops asking before every DeployAI command, in this folder only."),
21772
21782
  n("cmd-telemetry", "cli", "telemetry", "\u05D4\u05E4\u05E2\u05DC\u05D4 \u05D0\u05D5 \u05DB\u05D9\u05D1\u05D5\u05D9 \u05E9\u05DC \u05E0\u05EA\u05D5\u05E0\u05D9 \u05E9\u05D9\u05DE\u05D5\u05E9 \u05D0\u05E0\u05D5\u05E0\u05D9\u05DE\u05D9\u05D9\u05DD.", "Turns anonymous usage data on or off."),
21773
21783
  // The server routes the CLI calls.
21774
- n("api-starts", "server", "GET /api/starts/:id", "\u05D4\u05D1\u05D7\u05D9\u05E8\u05D5\u05EA \u05D5\u05D4\u05D8\u05E7\u05E1\u05D8 \u05DC\u05E1\u05D5\u05DB\u05DF. 7 \u05D9\u05DE\u05D9\u05DD, 5 \u05E9\u05DC\u05D9\u05E4\u05D5\u05EA \u05DC\u05D0\u05EA\u05E8.", "The choices and the agent text. 7 days, 5 fetches for a site."),
21784
+ n("api-starts", "server", "GET /api/starts/:id", "\u05D4\u05D1\u05D7\u05D9\u05E8\u05D5\u05EA \u05D5\u05D4\u05D8\u05E7\u05E1\u05D8 \u05DC\u05E1\u05D5\u05DB\u05DF. 7 \u05D9\u05DE\u05D9\u05DD, 5 \u05E9\u05DC\u05D9\u05E4\u05D5\u05EA \u05DC\u05D0\u05EA\u05E8. \u05E9\u05D5\u05E8\u05D4 \u05E9\u05DC \u05D0\u05EA\u05E8 \u05E0\u05E4\u05EA\u05D7\u05EA \u05E8\u05E7 \u05E2\u05DD \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD \u05D0\u05D5 \u05E9\u05DC \u05DE\u05D9 \u05E9\u05D9\u05E9 \u05DC\u05D5 \u05D4\u05E8\u05E9\u05D0\u05EA \u05E2\u05E8\u05D9\u05DB\u05D4.", "The choices and the agent text. 7 days, 5 fetches for a site. A site's line opens only with the login of its owner or an editor."),
21775
21785
  n("api-blocks", "server", "GET /blocks-src/<key>", "\u05E7\u05D5\u05D3 \u05D4\u05DE\u05E7\u05D5\u05E8 \u05E9\u05DC \u05D0\u05D1\u05DF \u05D1\u05E0\u05D9\u05D9\u05DF, \u05E6\u05D9\u05D1\u05D5\u05E8\u05D9.", "A block's source, public."),
21776
21786
  n("api-migrate-grant", "server", "POST /api/cli/migrations/grant", "\u05D0\u05D7\u05E8\u05D9 link \u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05DE /move: \u05D4\u05EA\u05D5\u05E1\u05E4\u05D9\u05DD \u05D1\u05D7\u05D9\u05E0\u05DD \u05DC\u05D0\u05EA\u05E8 \u05E9\u05E2\u05D1\u05E8, \u05E4\u05E2\u05DD \u05D0\u05D7\u05EA \u05DC\u05DB\u05DC start \u05D5\u05E2\u05D3 3 \u05D0\u05EA\u05E8\u05D9\u05DD \u05DC\u05D7\u05E9\u05D1\u05D5\u05DF.", "After link in a folder from /move: the add-ons free for the moved site, once per start and up to 3 sites an account."),
21777
21787
  n("api-migrate-progress", "server", "POST /api/migrations/progress", "\u05DE\u05E2\u05D1\u05E8 \u05DE\u05E0\u05D5\u05D4\u05DC: \u05D4\u05E9\u05DC\u05D1 \u05D5\u05D4\u05E2\u05E8\u05D4 \u05E9\u05DC \u05E9\u05D5\u05E8\u05D4 \u05D0\u05D7\u05EA \u05DE migrate status, \u05DC\u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E9\u05D5\u05EA \u05D5\u05DC\u05E2\u05DE\u05D5\u05D3 \u05D4\u05E1\u05D8\u05D8\u05D5\u05E1 \u05E9\u05DC \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD.", "Managed move: the stage and a one line note from migrate status, to the requests board and the owner's status page."),
@@ -21793,6 +21803,7 @@ var CLI_MAP_NODES = [
21793
21803
  n("text-start-blank", "agent", "site.start-blank", "\u05D1\u05D5\u05E0\u05D9\u05DD \u05D0\u05EA\u05E8 \u05D1\u05DC\u05D9 \u05D3\u05D5\u05D2\u05DE\u05D4.", "Build a site with no sample."),
21794
21804
  n("text-details", "agent", "site.details / site.ask-details", "\u05E7\u05D5\u05E8\u05D0\u05D9\u05DD \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05DE .deployai/brief.md, \u05D0\u05D5 \u05E9\u05D5\u05D0\u05DC\u05D9\u05DD \u05D0\u05EA \u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8.", "Read the details from .deployai/brief.md, or ask the owner."),
21795
21805
  n("text-update", "agent", "site.update", "\u05E2\u05D5\u05E9\u05D9\u05DD \u05D0\u05EA \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9 \u05E9\u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D1\u05D9\u05E7\u05E9.", "Make the change the owner asked for."),
21806
+ n("text-refresh", "agent", "site.refresh", "\u05E2\u05D9\u05E6\u05D5\u05D1 \u05D7\u05D3\u05E9 \u05DC\u05D0\u05EA\u05E8 \u05D7\u05D9: \u05DB\u05DC \u05E2\u05DE\u05D5\u05D3, \u05DB\u05EA\u05D5\u05D1\u05EA, \u05DE\u05D9\u05DC\u05D4 \u05D5\u05DE\u05D5\u05EA\u05D2 \u05E0\u05E9\u05D0\u05E8\u05D9\u05DD, \u05EA\u05E6\u05D5\u05D2\u05D4 \u05DE\u05E7\u05D3\u05D9\u05DE\u05D4 \u05DC\u05E4\u05E0\u05D9 \u05E9\u05E2\u05D5\u05DC\u05D4.", "A new look for a live site: every page, address, word and the brand stay, a preview before it goes live."),
21796
21807
  n("text-migrate", "agent", "site.migrate", "\u05D1\u05D5\u05E0\u05D9\u05DD \u05DE\u05D7\u05D3\u05E9 \u05D0\u05EA \u05D4\u05D0\u05EA\u05E8 \u05D4\u05D9\u05E9\u05DF \u05E2\u05DC \u05D4\u05D3\u05D5\u05D2\u05DE\u05D4, \u05E9\u05D5\u05DE\u05E8\u05D9\u05DD \u05DB\u05DC \u05DB\u05EA\u05D5\u05D1\u05EA \u05D5\u05DB\u05D5\u05EA\u05E8\u05EA, \u05EA\u05D5\u05DB\u05E0\u05D9\u05EA \u05E2\u05DD \u05E1\u05D8\u05D8\u05D5\u05E1 \u05DC\u05DB\u05DC \u05D9\u05DB\u05D5\u05DC\u05EA.", "Rebuild the old site on the sample, keep every address and title, a plan with a status for each feature."),
21797
21808
  n("text-move", "agent", "site.move", "\u05DE\u05E2\u05D1\u05D9\u05E8\u05D9\u05DD \u05D0\u05EA\u05E8 \u05E7\u05D9\u05D9\u05DD \u05D1\u05DC\u05D9 \u05DC\u05E9\u05E0\u05D5\u05EA \u05D0\u05EA \u05D4\u05E2\u05D9\u05E6\u05D5\u05D1 \u05D0\u05D5 \u05D4\u05DE\u05E1\u05D2\u05E8\u05EA.", "Move an existing site without changing its design or framework."),
21798
21809
  n("text-guest", "agent", "site.guest / site.guest-sample", "\u05D0\u05EA\u05E8 \u05D6\u05DE\u05E0\u05D9: \u05D4\u05DE\u05D2\u05D1\u05DC\u05D5\u05EA, \u05D5\u05DE\u05D4 \u05DC\u05E9\u05D0\u05D5\u05DC \u05D0\u05EA \u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8.", "A temporary site: the limits, and what to ask the owner."),
@@ -21804,14 +21815,17 @@ var CLI_MAP_EDGES = [
21804
21815
  e("page-go-live", "cmd-start"),
21805
21816
  e("page-new", "cmd-start"),
21806
21817
  e("page-site", "cmd-start"),
21818
+ e("page-refresh", "cmd-start"),
21807
21819
  e("page-move", "cmd-start"),
21808
21820
  e("cmd-start", "api-starts"),
21821
+ e("cmd-start", "cmd-login"),
21809
21822
  e("cmd-start", "api-samples"),
21810
21823
  e("cmd-samples", "api-samples"),
21811
21824
  e("cmd-start", "text-start"),
21812
21825
  e("cmd-start", "text-start-blank"),
21813
21826
  e("cmd-start", "text-details"),
21814
21827
  e("cmd-start", "text-update"),
21828
+ e("cmd-start", "text-refresh"),
21815
21829
  e("cmd-start", "text-move"),
21816
21830
  e("cmd-start", "text-guest"),
21817
21831
  e("cmd-login", "api-device"),
@@ -21915,6 +21929,7 @@ var ENV_KEYS = {
21915
21929
  DEPLOYAI_SPACE: { scope: "own", section: "app", required: ["local", "server"], sample: { local: "dev", server: "prod" }, about: "Which entry of packages/shared/src/spaces.ts this machine runs: dev on your computer, prod on the server. Every Cloudflare name, bucket and address comes from there." },
21916
21930
  DATABASE_URL: { scope: "own", section: "app", required: ["local", "server"], sample: { local: "postgres://deployai:deployai@localhost:5434/deployai", server: "postgres://deployai:<password>@localhost:5432/deployai" }, about: "Our own Postgres: users, sites, versions, billing. Not customer data." },
21917
21931
  BETTER_AUTH_SECRET: { scope: "own", section: "app", required: ["server"], sample: { local: "change-me-to-a-long-random-string", server: "" }, about: "Signs login sessions and our own links; changing it logs everyone out. 32 characters or more in production: openssl rand -base64 48" },
21932
+ APP_SHOTS_SITES: { scope: "local", section: "app", about: "The demo app sites whose product page screenshots are taken again with each new app version (D-609): uptime:<siteId>:<host>,cron:<siteId>:<host>. Unset: no automatic screenshots; pnpm apps:shots still works by hand." },
21918
21933
  DEV_SUPERADMIN_PASSWORD: { scope: "local", section: "app", about: "The superadmin password after every local wipe. Without it the one in apps/web/local-logins.md is kept (D-100)." },
21919
21934
  NEXT_PUBLIC_SUPPORT_WHATSAPP: { scope: "same", section: "app", about: "The WhatsApp number people reach us on, digits with the country code (972...). Empty shows only the email (D-237)." },
21920
21935
  OPENAI_APPS_CHALLENGE: { scope: "server", section: "app", about: "The domain check token from the OpenAI platform portal (Plugins, domain verification), served as plain text at /.well-known/openai-apps-challenge (D-474). Unset: that page is a 404." },
@@ -22569,6 +22584,9 @@ var M = {
22569
22584
  siteDeleted: "This site was deleted in the DeployAI dashboard. The owner can restore it from the dashboard (My sites, deleted sites) within 7 days. To deploy somewhere else, run: npx deployai@latest link",
22570
22585
  notEntitled: "This site does not have this add-on. The site owner can buy it for this site here: {url}",
22571
22586
  forbidden: "This account cannot change this site. Check that you logged in with the account that owns it.",
22587
+ notOnSite: "This site belongs to another account. Ask its owner to add you as an editor. If it is your site, log in with the account that owns it: npx deployai@latest logout, then npx deployai@latest login",
22588
+ viewOnly: "This account can only view this site. Ask its owner to make you an editor.",
22589
+ startLoginFirst: "This line opens only for the site's owner or an editor, so first log in.",
22572
22590
  notFound: "DeployAI did not find it, or this account cannot see it. Check the name or the link, and that you logged in with the account that made the site: npx deployai@latest whoami",
22573
22591
  badArchive: "The upload arrived broken or empty. Run the same command again. If it happens again, update the CLI: npx deployai@latest",
22574
22592
  invalidRequest: "DeployAI did not accept this request. Run it again with the newest CLI: npx deployai@latest",
@@ -22785,6 +22803,9 @@ var M = {
22785
22803
  siteDeleted: "\u05D4\u05D0\u05EA\u05E8 \u05E0\u05DE\u05D7\u05E7 \u05D1\u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E8\u05D4 \u05E9\u05DC DeployAI. \u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D9\u05DB\u05D5\u05DC \u05DC\u05E9\u05D7\u05D6\u05E8 \u05D0\u05D5\u05EA\u05D5 \u05DE\u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E8\u05D4 (\u05D4\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05DC\u05D9, \u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05E0\u05DE\u05D7\u05E7\u05D5) \u05EA\u05D5\u05DA 7 \u05D9\u05DE\u05D9\u05DD. \u05DB\u05D3\u05D9 \u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05DC\u05D0\u05EA\u05E8 \u05D0\u05D7\u05E8, \u05D4\u05E8\u05D9\u05E6\u05D5: npx deployai@latest link",
22786
22804
  notEntitled: "\u05DC\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4 \u05D0\u05D9\u05DF \u05D0\u05EA \u05D4\u05EA\u05D5\u05E1\u05E3 \u05D4\u05D6\u05D4. \u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D9\u05DB\u05D5\u05DC \u05DC\u05E7\u05E0\u05D5\u05EA \u05D0\u05D5\u05EA\u05D5 \u05DC\u05D0\u05EA\u05E8 \u05DB\u05D0\u05DF: {url}",
22787
22805
  forbidden: "\u05D4\u05D7\u05E9\u05D1\u05D5\u05DF \u05D4\u05D6\u05D4 \u05DC\u05D0 \u05D9\u05DB\u05D5\u05DC \u05DC\u05E9\u05E0\u05D5\u05EA \u05D0\u05EA \u05D4\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4. \u05D1\u05D3\u05E7\u05D5 \u05E9\u05E0\u05DB\u05E0\u05E1\u05EA\u05DD \u05E2\u05DD \u05D4\u05D7\u05E9\u05D1\u05D5\u05DF \u05E9\u05D4\u05D0\u05EA\u05E8 \u05E9\u05D9\u05D9\u05DA \u05DC\u05D5.",
22806
+ notOnSite: "\u05D4\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4 \u05E9\u05D9\u05D9\u05DA \u05DC\u05D7\u05E9\u05D1\u05D5\u05DF \u05D0\u05D7\u05E8. \u05D1\u05E7\u05E9\u05D5 \u05DE\u05D4\u05D1\u05E2\u05DC\u05D9\u05DD \u05E9\u05DC\u05D5 \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 \u05D0\u05EA\u05DB\u05DD \u05E2\u05DD \u05D4\u05E8\u05E9\u05D0\u05EA \u05E2\u05E8\u05D9\u05DB\u05D4. \u05D0\u05DD \u05D4\u05D0\u05EA\u05E8 \u05E9\u05DC\u05DB\u05DD, \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05E2\u05DD \u05D4\u05D7\u05E9\u05D1\u05D5\u05DF \u05E9\u05D4\u05D5\u05D0 \u05E9\u05D9\u05D9\u05DA \u05DC\u05D5: npx deployai@latest logout \u05D5\u05D0\u05D6 npx deployai@latest login",
22807
+ viewOnly: "\u05DC\u05D7\u05E9\u05D1\u05D5\u05DF \u05D4\u05D6\u05D4 \u05D9\u05E9 \u05D4\u05E8\u05E9\u05D0\u05EA \u05E6\u05E4\u05D9\u05D9\u05D4 \u05D1\u05DC\u05D1\u05D3 \u05D1\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4. \u05D1\u05E7\u05E9\u05D5 \u05DE\u05D4\u05D1\u05E2\u05DC\u05D9\u05DD \u05DC\u05EA\u05EA \u05DC\u05DB\u05DD \u05D4\u05E8\u05E9\u05D0\u05EA \u05E2\u05E8\u05D9\u05DB\u05D4.",
22808
+ startLoginFirst: "\u05D4\u05E9\u05D5\u05E8\u05D4 \u05D4\u05D6\u05D5 \u05E0\u05E4\u05EA\u05D7\u05EA \u05E8\u05E7 \u05DC\u05D1\u05E2\u05DC\u05D9\u05DD \u05E9\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D0\u05D5 \u05DC\u05DE\u05D9 \u05E9\u05D9\u05E9 \u05DC\u05D5 \u05D4\u05E8\u05E9\u05D0\u05EA \u05E2\u05E8\u05D9\u05DB\u05D4, \u05D0\u05D6 \u05E7\u05D5\u05D3\u05DD \u05DE\u05EA\u05D7\u05D1\u05E8\u05D9\u05DD.",
22788
22809
  notFound: "DeployAI \u05DC\u05D0 \u05DE\u05E6\u05D0 \u05D0\u05EA \u05D6\u05D4, \u05D0\u05D5 \u05E9\u05D4\u05D7\u05E9\u05D1\u05D5\u05DF \u05D4\u05D6\u05D4 \u05DC\u05D0 \u05E8\u05D5\u05D0\u05D4 \u05D0\u05EA \u05D6\u05D4. \u05D1\u05D3\u05E7\u05D5 \u05D0\u05EA \u05D4\u05E9\u05DD \u05D0\u05D5 \u05D4\u05E7\u05D9\u05E9\u05D5\u05E8, \u05D5\u05E9\u05E0\u05DB\u05E0\u05E1\u05EA\u05DD \u05E2\u05DD \u05D4\u05D7\u05E9\u05D1\u05D5\u05DF \u05E9\u05D9\u05E6\u05E8 \u05D0\u05EA \u05D4\u05D0\u05EA\u05E8: npx deployai@latest whoami",
22789
22810
  badArchive: "\u05D4\u05D4\u05E2\u05DC\u05D0\u05D4 \u05D4\u05D2\u05D9\u05E2\u05D4 \u05E4\u05D2\u05D5\u05DE\u05D4 \u05D0\u05D5 \u05E8\u05D9\u05E7\u05D4. \u05D4\u05E8\u05D9\u05E6\u05D5 \u05E9\u05D5\u05D1 \u05D0\u05EA \u05D0\u05D5\u05EA\u05D4 \u05E4\u05E7\u05D5\u05D3\u05D4. \u05D0\u05DD \u05D6\u05D4 \u05D7\u05D5\u05D6\u05E8, \u05E2\u05D3\u05DB\u05E0\u05D5 \u05D0\u05EA \u05D4\u05BECLI: npx deployai@latest",
22790
22811
  invalidRequest: "DeployAI \u05DC\u05D0 \u05E7\u05D9\u05D1\u05DC \u05D0\u05EA \u05D4\u05D1\u05E7\u05E9\u05D4. \u05D4\u05E8\u05D9\u05E6\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05E9\u05D5\u05D1 \u05E2\u05DD \u05D4\u05BECLI \u05D4\u05E2\u05D3\u05DB\u05E0\u05D9: npx deployai@latest",
@@ -22892,7 +22913,7 @@ function messages(root) {
22892
22913
  }
22893
22914
 
22894
22915
  // src/version.ts
22895
- var CLI_VERSION = "0.1.0-beta.17";
22916
+ var CLI_VERSION = "0.1.0-beta.19";
22896
22917
 
22897
22918
  // src/api.ts
22898
22919
  function apiContext(apiFlag) {
@@ -22951,6 +22972,8 @@ async function apiRequest(ctx, path, schema, opts = {}) {
22951
22972
  if (parsed2.success && parsed2.data.error === "site_deleted") {
22952
22973
  throw new CliError(t("siteDeleted"), 1, "site_deleted");
22953
22974
  }
22975
+ if (parsed2.success && parsed2.data.error === "not_on_site") throw new CliError(t("notOnSite"), 1, "not_found");
22976
+ if (parsed2.success && parsed2.data.error === "view_only") throw new CliError(t("viewOnly"), 1, "forbidden");
22954
22977
  if (parsed2.success && parsed2.data.error === "not_entitled") {
22955
22978
  throw new CliError(t("notEntitled", { url: parsed2.data.buyUrl ?? ctx.apiUrl }), 1, "not_entitled");
22956
22979
  }
@@ -24165,6 +24188,10 @@ async function loginCommand(ctx, opts = {}) {
24165
24188
  updateConfig({ token: poll2.token, email: poll2.email, apiUrl: ctx.apiUrl, tokenApiUrl: ctx.apiUrl });
24166
24189
  out();
24167
24190
  out(poll2.email ? t("loggedInAs", { email: poll2.email }) : t("loggedIn"));
24191
+ if (opts.quiet) {
24192
+ out();
24193
+ return;
24194
+ }
24168
24195
  out(t("nextStep"));
24169
24196
  out(opts.root && readProject(opts.root)?.projectId ? t("runDeploy") : t("runLink"));
24170
24197
  return;
@@ -25495,9 +25522,12 @@ async function fetchSource(root, ctx, projectId, version2) {
25495
25522
  if (res.status === 401) throw new CliError(t("sessionExpired"), 1, "auth");
25496
25523
  if (res.status === 404) {
25497
25524
  const code = (await res.clone().json().catch(() => null))?.error;
25498
- throw new CliError(code === "no_source" ? t("pullNoSource") : t("notFound"), 1, "not_found");
25525
+ throw new CliError(code === "no_source" ? t("pullNoSource") : code === "not_on_site" ? t("notOnSite") : t("notFound"), 1, "not_found");
25526
+ }
25527
+ if (res.status === 403) {
25528
+ const code = (await res.clone().json().catch(() => null))?.error;
25529
+ throw new CliError(code === "view_only" ? t("viewOnly") : t("forbidden"), 1, "forbidden");
25499
25530
  }
25500
- if (res.status === 403) throw new CliError(t("forbidden"), 1, "forbidden");
25501
25531
  if (!res.ok) throw new CliError(t("apiError", { code: `HTTP ${res.status}` }), 1, "api");
25502
25532
  const gz = Buffer.from(await res.arrayBuffer());
25503
25533
  if (gz.length > MAX_BYTES2) throw new CliError(t("pullTooLarge"), 1, "too_large");
@@ -25596,13 +25626,17 @@ function writeStarter(root, name, lang, stack) {
25596
25626
  var REASONS = { start_not_found: "startNotFound", start_expired: "startExpired", start_used_up: "startUsedUp" };
25597
25627
  var reason = (code) => messages(process.cwd())(REASONS[code] ?? "startNotFound");
25598
25628
  async function fetchStart(ctx, id) {
25629
+ const token = tokenIfOwnApi(ctx);
25599
25630
  let res;
25600
25631
  try {
25601
- res = await fetch(`${ctx.apiUrl}/api/starts/${id}`, { headers: { "User-Agent": userAgent(ctx.config), Accept: "application/json" }, signal: AbortSignal.timeout(3e4) });
25632
+ res = await fetch(`${ctx.apiUrl}/api/starts/${id}`, { headers: { "User-Agent": userAgent(ctx.config), Accept: "application/json", ...token ? { Authorization: `Bearer ${token}` } : {} }, signal: AbortSignal.timeout(3e4) });
25602
25633
  } catch {
25603
25634
  throw new CliError(messages()("unreachable", { url: ctx.apiUrl }), 1, "network");
25604
25635
  }
25605
25636
  const data = await res.json().catch(() => null);
25637
+ if (data?.error === "login_required") return "login_required";
25638
+ if (data?.error === "not_on_site") throw new CliError(messages(process.cwd())("notOnSite"), 1, "not_found");
25639
+ if (data?.error === "view_only") throw new CliError(messages(process.cwd())("viewOnly"), 1, "forbidden");
25606
25640
  if (!res.ok || !data?.kind || !data.choices || typeof data.agent !== "string") {
25607
25641
  const code = typeof data?.error === "string" ? data.error : "";
25608
25642
  throw new CliError(code in REASONS ? reason(code) : messages(process.cwd())("apiError", { code: `HTTP ${res.status}` }), 1, res.status === 404 ? "not_found" : "api");
@@ -25616,7 +25650,17 @@ function install(root) {
25616
25650
  async function startCommand(cwd, ctx, id, opts = {}) {
25617
25651
  const key = id.trim().toLowerCase();
25618
25652
  if (!START_ID_RE.test(key)) throw new CliError(reason("start_not_found"), 1, "not_found");
25619
- const { kind, choices, agent } = await fetchStart(ctx, key);
25653
+ let ctxNow = ctx;
25654
+ let start = await fetchStart(ctxNow, key);
25655
+ if (start === "login_required") {
25656
+ out(messages(process.cwd())("startLoginFirst"));
25657
+ out();
25658
+ await loginCommand(ctxNow, { pollMs: opts.pollMs, quiet: true });
25659
+ ctxNow = { ...ctxNow, config: loadConfig() };
25660
+ start = await fetchStart(ctxNow, key);
25661
+ if (start === "login_required") throw new CliError(messages(process.cwd())("sessionExpired"), 1, "auth");
25662
+ }
25663
+ const { kind, choices, agent } = start;
25620
25664
  const sample = choices.sampleKey ? SAMPLES.find((s) => s.key === choices.sampleKey) : void 0;
25621
25665
  if (choices.sampleKey && !sample) throw new CliError(messages()("unknownSample", { key: choices.sampleKey }), 1, "not_found");
25622
25666
  const fresh = kind === "new" || kind === "migrate" || kind === "guest" && sample;
@@ -25626,11 +25670,12 @@ async function startCommand(cwd, ctx, id, opts = {}) {
25626
25670
  const done = [];
25627
25671
  const empty = !filesIn(root).length;
25628
25672
  const starter = (kind === "new" || kind === "guest") && !sample && empty;
25629
- const steps = startSteps(kind, { emptyFolder: kind === "update" && empty, starter, managed: Boolean(choices.migration?.requestId) });
25673
+ const signedIn = Boolean(choices.projectId && tokenIfOwnApi(ctxNow));
25674
+ const steps = startSteps(kind, { emptyFolder: kind === "update" && empty, starter, managed: Boolean(choices.migration?.requestId), signedIn });
25630
25675
  updateProject(root, { lang: langOf(choices.ownerLanguage) });
25631
25676
  const t = messages(root);
25632
25677
  if (sample && !sameSite) {
25633
- const written = await downloadSample(ctx, sample.key, root);
25678
+ const written = await downloadSample(ctxNow, sample.key, root);
25634
25679
  done.push(t("startDownloaded", { key: sample.key, n: written }));
25635
25680
  if (existsSync11(join12(root, "package.json"))) {
25636
25681
  if (opts.install !== false && install(root)) done.push(t("startInstalled"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deployai",
3
- "version": "0.1.0-beta.17",
3
+ "version": "0.1.0-beta.19",
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",