deployai 0.1.0-beta.10 → 0.1.0-beta.11

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 +43 -7
  2. package/package.json +3 -22
package/dist/index.js CHANGED
@@ -205,6 +205,14 @@ var ISSUES = [
205
205
  fixForAgent: "A custom server that listens on a port cannot run here. Move the routes to Hono (very similar to Express and runs on Cloudflare Workers) or to Astro API routes, and remove app.listen."
206
206
  },
207
207
  // Warnings
208
+ {
209
+ code: "email_smtp",
210
+ severity: "warning",
211
+ titleEn: "Sends email through SMTP, which does not run here",
212
+ titleHe: "\u05E9\u05D5\u05DC\u05D7 \u05DE\u05D9\u05D9\u05DC \u05D3\u05E8\u05DA SMTP, \u05E9\u05DC\u05D0 \u05E2\u05D5\u05D1\u05D3 \u05D0\u05E6\u05DC\u05E0\u05D5",
213
+ agentLine: "The site sends email with{detail}, which needs SMTP. SMTP does not run on DeployAI, so the email part will fail.",
214
+ fixForAgent: "For email to the site owner (a form answer, a new order), use the built-in email: POST JSON { subject, text, replyTo } to `${DEPLOYAI_API}/api/site/notify` with Authorization: Bearer DEPLOYAI_KEY, with no keys to ask for. For email to customers, use an HTTP email API (Resend, Postmark) with its key set by npx deployai@latest env set. Remove the SMTP library."
215
+ },
208
216
  {
209
217
  code: "no_build_script",
210
218
  severity: "warning",
@@ -925,6 +933,19 @@ var ISSUE_HELP = {
925
933
  fix: ["Move the routes to Hono, which is very similar to Express and works on DeployAI.", "Or to Astro API routes.", "Delete the line that starts the server (app.listen)."]
926
934
  }
927
935
  },
936
+ email_smtp: {
937
+ he: {
938
+ what: "\u05D4\u05D0\u05EA\u05E8 \u05E9\u05D5\u05DC\u05D7 \u05DE\u05D9\u05D9\u05DC \u05D3\u05E8\u05DA SMTP (\u05DC\u05DE\u05E9\u05DC \u05E2\u05DD nodemailer).",
939
+ why: "\u05D6\u05D5 \u05D0\u05D6\u05D4\u05E8\u05D4. \u05D4\u05D0\u05EA\u05E8 \u05E2\u05D5\u05DC\u05D4, \u05D0\u05D1\u05DC SMTP \u05DC\u05D0 \u05E2\u05D5\u05D1\u05D3 \u05D0\u05E6\u05DC\u05E0\u05D5, \u05D0\u05D6 \u05D4\u05DE\u05D9\u05D9\u05DC\u05D9\u05DD \u05DC\u05D0 \u05D9\u05D9\u05E9\u05DC\u05D7\u05D5.",
940
+ fix: ["\u05DE\u05D9\u05D9\u05DC \u05D0\u05DC\u05D9\u05DB\u05DD, \u05DC\u05DE\u05E9\u05DC \u05E2\u05DC \u05D8\u05D5\u05E4\u05E1 \u05E9\u05DE\u05D5\u05DC\u05D0: \u05D4\u05DE\u05D9\u05D9\u05DC \u05D4\u05DE\u05D5\u05D1\u05E0\u05D4 \u05E9\u05DC DeployAI, \u05D1\u05DC\u05D9 \u05E1\u05E4\u05E7 \u05DE\u05D9\u05D9\u05DC \u05D5\u05D1\u05DC\u05D9 \u05DE\u05E4\u05EA\u05D7\u05D5\u05EA.", "\u05DE\u05D9\u05D9\u05DC \u05DC\u05DC\u05E7\u05D5\u05D7\u05D5\u05EA: \u05E9\u05D9\u05E8\u05D5\u05EA \u05DE\u05D9\u05D9\u05DC \u05D3\u05E8\u05DA HTTP, \u05DB\u05DE\u05D5 Resend \u05D0\u05D5 Postmark."],
941
+ prompt: "\u05D4\u05D0\u05EA\u05E8 \u05E9\u05D5\u05DC\u05D7 \u05DE\u05D9\u05D9\u05DC \u05D3\u05E8\u05DA SMTP, \u05E9\u05DC\u05D0 \u05E2\u05D5\u05D1\u05D3 \u05D1\u05BEDeployAI. \u05DC\u05DE\u05D9\u05D9\u05DC \u05D0\u05DC\u05D9\u05D9 (\u05D8\u05D5\u05E4\u05E1 \u05E9\u05DE\u05D5\u05DC\u05D0, \u05D4\u05D6\u05DE\u05E0\u05D4 \u05D7\u05D3\u05E9\u05D4) \u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05DE\u05D9\u05D9\u05DC \u05D4\u05DE\u05D5\u05D1\u05E0\u05D4: POST \u05E2\u05DD JSON { subject, text, replyTo } \u05D0\u05DC ${DEPLOYAI_API}/api/site/notify \u05E2\u05DD \u05D4\u05DB\u05D5\u05EA\u05E8\u05EA Authorization: Bearer DEPLOYAI_KEY. \u05DC\u05DE\u05D9\u05D9\u05DC \u05DC\u05DC\u05E7\u05D5\u05D7\u05D5\u05EA \u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05BEResend \u05D0\u05D5 Postmark \u05D3\u05E8\u05DA HTTP. \u05D4\u05E1\u05E8 \u05D0\u05EA \u05E1\u05E4\u05E8\u05D9\u05D9\u05EA \u05D4\u05BESMTP."
942
+ },
943
+ en: {
944
+ what: "The site sends email through SMTP (for example with nodemailer).",
945
+ why: "This is a warning. The site goes live, but SMTP does not run here, so the emails will not be sent.",
946
+ fix: ["Email to you, for example on a form answer: the DeployAI built-in email, with no email provider and no keys.", "Email to customers: an email service over HTTP, like Resend or Postmark."]
947
+ }
948
+ },
928
949
  no_build_script: {
929
950
  he: {
930
951
  what: "\u05D1\u05E7\u05D5\u05D1\u05E5 package.json \u05D0\u05D9\u05DF \u05E4\u05E7\u05D5\u05D3\u05EA build, \u05D4\u05E4\u05E7\u05D5\u05D3\u05D4 \u05E9\u05D1\u05D5\u05E0\u05D4 \u05D0\u05EA \u05D4\u05D0\u05EA\u05E8.",
@@ -21324,7 +21345,7 @@ var LOGIN = { cmd: "npx deployai@latest login", say: "The owner approves it in t
21324
21345
  var STATUS = { cmd: "npx deployai@latest status", say: "Run it until the new version is ready, then send the owner the preview address." };
21325
21346
  var PROMOTE = { cmd: "npx deployai@latest promote v<N>", say: "Only after the owner approves the preview. N is the version number deploy printed. Then give the owner the live address." };
21326
21347
  var DEPLOY_SAY = "It builds a preview first. Write the -m message in a few words in the language of the owner, about what they see changed.";
21327
- var BUILD = { say: `Build the owner's site in this folder in place of the starter page, as the instructions above say, following README.md "Before you go live". Run check only after that.` };
21348
+ 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. 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. Then show it to the owner and offer to add those details. Run check only after that." };
21328
21349
  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." };
21329
21350
  function startSteps(kind, opts = {}) {
21330
21351
  switch (kind) {
@@ -21346,7 +21367,8 @@ function startSteps(kind, opts = {}) {
21346
21367
  ];
21347
21368
  case "guest":
21348
21369
  return [
21349
- { ...CHECK, say: "Fix every blocker it lists, then run it again until it shows none. If the site needs environment variables, secrets, file storage or sending email, stop and tell the owner it needs a free account." },
21370
+ ...opts.starter ? [BUILD] : [],
21371
+ { ...CHECK, say: "Fix every blocker it lists, then run it again until it shows none. If the site needs environment variables, secrets, file storage or sending email, never stop building for it: tell the owner once, in one plain line, that putting those parts live needs a free account (one link, about a minute), keep building what they asked, and ask about the account only at the deploy step." },
21350
21372
  ASK,
21351
21373
  { cmd: "npx deployai@latest deploy --guest", say: "It prints the address, the claim link and any owner keys." },
21352
21374
  { say: "The site goes live about a minute later: wait, then open the address to see it is live before you tell the owner." },
@@ -21355,6 +21377,8 @@ function startSteps(kind, opts = {}) {
21355
21377
  ];
21356
21378
  }
21357
21379
  }
21380
+ var allowCommandsUrl = (lang = "he") => `${HELP_ORIGIN}${lang === "he" ? "" : "/en"}/connect-ai#allow`;
21381
+ var runCommandsRule = (lang = "he") => `Run every npx deployai@latest command yourself. If your tool asks before it runs one, ask the owner one short yes or no question that names the command, for example "Run npx deployai@latest check? (yes or no)", and run it when they say yes. Never ask the owner to copy, paste or type a command. Never change your tool's own settings to allow it. If it is still blocked after their yes, tell them in plain words and send them ${allowCommandsUrl(lang)}, which shows them the one setting that allows it.`;
21358
21382
  var START_FAIL_LINE = "If anything fails, tell the owner in plain words what happened and what you will do next.";
21359
21383
 
21360
21384
  // ../shared/src/cli-map.ts
@@ -21657,7 +21681,9 @@ var BUILD_WITH = [
21657
21681
  "Settings and secrets: environment variables, set with: npx deployai@latest env set <key>",
21658
21682
  "Images: resize at build time or serve them as they are; no native image modules at runtime.",
21659
21683
  "Passwords: bcryptjs or Web Crypto, never native bcrypt.",
21660
- "Server code runs per request: no long-running processes, background servers or child processes."
21684
+ "Server code runs per request: no long-running processes, background servers or child processes.",
21685
+ // D-535: the agent knows our built-in email, so it never adds an email provider or asks the owner for keys to email them.
21686
+ "Email to the site owner (a form answer, a new order): the built-in email, with no email provider or keys. POST JSON { subject, text, replyTo } to `${DEPLOYAI_API}/api/site/notify` with the header Authorization: Bearer DEPLOYAI_KEY (both are environment variables every upload gets). It reaches only the owner. On a temporary site it works once the owner has a free account: keep building, and say so only when it is time to go live. Email to customers needs an HTTP email API (Resend, Postmark), never SMTP."
21661
21687
  ];
21662
21688
  var KEEP_DATA_RULES = [
21663
21689
  "Moving to DeployAI changes where data lives. It never moves the data by itself. Before you switch any of these, save a copy inside the project and tell the user, in simple words, what was saved and where:",
@@ -22172,7 +22198,7 @@ function messages(root) {
22172
22198
  }
22173
22199
 
22174
22200
  // src/version.ts
22175
- var CLI_VERSION = "0.1.0-beta.10";
22201
+ var CLI_VERSION = "0.1.0-beta.11";
22176
22202
 
22177
22203
  // src/api.ts
22178
22204
  function apiContext(apiFlag) {
@@ -22933,6 +22959,8 @@ function analyzeProject(root) {
22933
22959
  if (framework.id === "unknown" && !otherStack && !empty) {
22934
22960
  add({ code: "unknown_framework", severity: "warning", detail: framework.flavor ? ` (looks like ${framework.flavor})` : "" });
22935
22961
  }
22962
+ const smtp = ["nodemailer", "emailjs", "smtp-client"].find((d) => deps[d]);
22963
+ if (smtp) add({ code: "email_smtp", severity: "warning", file: "package.json", detail: ` ${smtp}` });
22936
22964
  const hasBuildScript = Boolean(pkg?.scripts?.build);
22937
22965
  if (pkg && !hasBuildScript && framework.id !== "static" && framework.id !== "hono") {
22938
22966
  add({ code: "no_build_script", severity: "warning", file: "package.json" });
@@ -23052,6 +23080,12 @@ To start from working code, see the samples: npx deployai@latest samples
23052
23080
 
23053
23081
  ${KEEP_DATA_RULES.join("\n")}
23054
23082
 
23083
+ ## Running DeployAI commands
23084
+
23085
+ ${runCommandsRule()}
23086
+
23087
+ Never stop building for an account, a plan or a limit. Build what the owner asks; say once, in one plain line, what going live will need, and ask about it only at the deploy step.
23088
+
23055
23089
  ## Check
23056
23090
 
23057
23091
  Before adding a dependency or a new server feature, run: npx deployai@latest check
@@ -23141,7 +23175,8 @@ var PROMPT_RULES = [
23141
23175
  "Never add credentials to source code.",
23142
23176
  "Explain every step to the user in simple words, in the language they write to you in.",
23143
23177
  "For the database, use D1 as shown in the DeployAI CRUD sample.",
23144
- "Follow DEPLOYAI.md for every future change. If it is missing, run: npx deployai@latest init"
23178
+ "Follow DEPLOYAI.md for every future change. If it is missing, run: npx deployai@latest init",
23179
+ runCommandsRule()
23145
23180
  ];
23146
23181
  var DATA_CODES = /* @__PURE__ */ new Set(["fs_write", "unsupported_db_postgres", "unsupported_db_mysql", "unsupported_db_mongodb", "unsupported_db_sqlite_file", "native_module_bcrypt"]);
23147
23182
  var MAX_LOCATIONS = 3;
@@ -24144,7 +24179,7 @@ DeployAI wrote this page so the folder starts as a working site. Build the owner
24144
24179
 
24145
24180
  ## Before you go live
24146
24181
 
24147
- - Replace \`index.html\` with the owner's real site, in the languages they want. Keep it static HTML and CSS unless the site needs server code (forms, logins, data): then follow the stack in DEPLOYAI.md.
24182
+ - Replace \`index.html\` with a first version of the owner's site right away, from what you know: one short question at most, details you do not have left out until the owner sees it. Keep it static HTML and CSS unless the site needs server code (forms, logins, data): then follow the stack in DEPLOYAI.md.
24148
24183
  - Nothing from this starter stays: no "coming soon" text goes live.
24149
24184
  - Delete this README or replace it with notes about the site.
24150
24185
  `;
@@ -24186,7 +24221,7 @@ async function startCommand(cwd, ctx, id, opts = {}) {
24186
24221
  const root = fresh && filesIn(here).length && !opts.here && !sameSite ? freeFolder(here, choices.slug ?? sample?.key ?? "site") : here;
24187
24222
  const done = [];
24188
24223
  const empty = !filesIn(root).length;
24189
- const starter = kind === "new" && !sample && empty;
24224
+ const starter = (kind === "new" || kind === "guest") && !sample && empty;
24190
24225
  const steps = startSteps(kind, { emptyFolder: kind === "update" && empty, starter });
24191
24226
  updateProject(root, { lang: langOf(choices.ownerLanguage) });
24192
24227
  const t = messages(root);
@@ -24232,6 +24267,7 @@ ${choices.brief}
24232
24267
  out("Then, in this order:");
24233
24268
  steps.forEach((s, i) => out(`${i + 1}. ${s.cmd ? `Run ${s.cmd}. ` : ""}${s.say}`));
24234
24269
  out();
24270
+ out(runCommandsRule(langOf(choices.ownerLanguage)));
24235
24271
  out(START_FAIL_LINE);
24236
24272
  }
24237
24273
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deployai",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.11",
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",
@@ -22,8 +22,7 @@
22
22
  "homepage": "https://deployai.co.il/developers",
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "git+https://github.com/yobotn/deployai.git",
26
- "directory": "packages/cli"
25
+ "url": "git+https://github.com/yobotn/deployai-cli.git"
27
26
  },
28
27
  "license": "MIT",
29
28
  "author": "DeployAI <info@deployai.co.il>",
@@ -39,23 +38,5 @@
39
38
  },
40
39
  "dependencies": {
41
40
  "commander": "15.0.0"
42
- },
43
- "devDependencies": {
44
- "@deployai/shared": "0.1.0",
45
- "@eslint/js": "9.39.5",
46
- "eslint": "9.39.5",
47
- "typescript-eslint": "8.71.1",
48
- "typescript": "^5",
49
- "vitest": "5.0.3",
50
- "tsx": "^4",
51
- "tsup": "^8",
52
- "@types/node": "^22"
53
- },
54
- "scripts": {
55
- "start": "tsx src/index.ts",
56
- "build": "tsup",
57
- "typecheck": "tsc --noEmit",
58
- "test": "vitest run",
59
- "lint": "eslint"
60
41
  }
61
- }
42
+ }