deployai 0.1.0-beta.25 → 0.1.0-beta.26

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +142 -21
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -134,7 +134,7 @@ Never uploaded:
134
134
  Sent when on:
135
135
 
136
136
  - Install id (random, made on this computer) and CLI version
137
- - After each command: command name and result (success, blocked, error category)
137
+ - After each command: command name and result (success, blocked, error category). A start that has to wait for a login sends one more, before it waits
138
138
  - Linked project id, detected framework and version
139
139
  - After each check: compatible or not, blocker and warning codes (for example `fs_write`)
140
140
  - OS, architecture and Node version (in the request header)
package/dist/index.js CHANGED
@@ -21504,7 +21504,8 @@ var ARCH_NODES = [
21504
21504
  // Outside
21505
21505
  { id: "browser", kind: "actor", zone: "outside", label: "\u05D3\u05E4\u05D3\u05E4\u05DF", labelEn: "Browser", summary: "\u05DC\u05E7\u05D5\u05D7\u05D5\u05EA \u05D5\u05D0\u05D3\u05DE\u05D9\u05E0\u05D9\u05DD \u05E4\u05D5\u05EA\u05D7\u05D9\u05DD \u05D0\u05EA \u05D4\u05D0\u05EA\u05E8, \u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E8\u05D4 \u05D5\u05D4\u05D0\u05D3\u05DE\u05D9\u05DF.", summaryEn: "Customers and admins open the site, the dashboard and the admin." },
21506
21506
  { id: "cli", kind: "actor", zone: "outside", label: "deployai CLI", summary: "\u05D4\u05E1\u05D5\u05DB\u05DF \u05D0\u05D5 \u05D4\u05DC\u05E7\u05D5\u05D7 \u05DE\u05E8\u05D9\u05E6\u05D9\u05DD check \u05D5\u05BEdeploy, \u05D5\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05D1\u05E7\u05D5\u05D3 \u05DE\u05DB\u05E9\u05D9\u05E8.", summaryEn: "The agent or the customer runs check and deploy, and logs in with a device code.", code: ["packages/cli"], docs: ["docs/07-cli.md"] },
21507
- { id: "board-watcher", kind: "actor", zone: "outside", label: "Board watcher", summary: "\u05E8\u05E5 \u05D0\u05E6\u05DC \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD (pnpm board:watch): \u05DC\u05D5\u05E7\u05D7 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05DE\u05DC\u05D5\u05D7 \u05D4\u05E2\u05D1\u05D5\u05D3\u05D4 (\u05E8\u05E7 \u05DB\u05E9\u05D4\u05DE\u05EA\u05D2 \u05E9\u05DC\u05D5 \u05D1\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E4\u05D5\u05E2\u05DC, \u05D5\u05E8\u05E7 \u05D0\u05D7\u05E8\u05D9 \u05E9\u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05D5\u05E9\u05E8 \u05D5\u05E0\u05E9\u05DC\u05D7 \u05D0\u05DC\u05D9\u05D5), \u05DE\u05E8\u05D9\u05E5 Claude Code \u05DC\u05E7\u05E8\u05D9\u05D0\u05D4 \u05D1\u05DC\u05D1\u05D3 \u05D5\u05DE\u05D7\u05D6\u05D9\u05E8 \u05EA\u05D5\u05DB\u05E0\u05D9\u05EA. \u05DB\u05E8\u05D8\u05D9\u05E1 \u05E2\u05DD \u05D1\u05E0\u05D9\u05D9\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA \u05E9\u05D0\u05D5\u05E9\u05E8 \u05E0\u05D1\u05E0\u05D4 \u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05EA \u05D4\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8, \u05D0\u05D7\u05D3 \u05D1\u05DB\u05DC \u05E4\u05E2\u05DD. \u05D4\u05D5\u05D0 \u05D2\u05DD \u05DB\u05D5\u05EA\u05D1 \u05D2\u05E8\u05E1\u05D0\u05D5\u05EA \u05D7\u05D3\u05E9\u05D5\u05EA \u05DC\u05E1\u05E4\u05E8\u05D9\u05D9\u05EA \u05D4\u05E4\u05E8\u05D5\u05DE\u05E4\u05D8\u05D9\u05DD \u05DC\u05E4\u05D9 \u05D4\u05E2\u05E8\u05D5\u05EA \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD, \u05DC\u05D1\u05D3\u05D9\u05E7\u05D4 \u05D5\u05E4\u05E8\u05E1\u05D5\u05DD.", summaryEn: "Runs on the owner computer (pnpm board:watch): claims a work board ticket (only while its settings switch is on), runs Claude Code read only and posts a plan back. An approved auto build ticket is built in the project folder, one at a time. It also writes new versions of prompt library prompts from the owner notes, for review and publishing.", code: ["scripts/board-watch.ts", "scripts/prompts-sync.ts"], env: ["BOARD_RUNNER_TOKEN", "BOARD_URL"], decisions: ["D-110", "D-127", "D-182", "D-250"] },
21507
+ { id: "board-watcher", kind: "actor", zone: "outside", label: "Board watcher", summary: "\u05E8\u05E5 \u05D0\u05E6\u05DC \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD (pnpm board:watch): \u05DC\u05D5\u05E7\u05D7 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05DE\u05DC\u05D5\u05D7 \u05D4\u05E2\u05D1\u05D5\u05D3\u05D4 (\u05E8\u05E7 \u05DB\u05E9\u05D4\u05DE\u05EA\u05D2 \u05E9\u05DC\u05D5 \u05D1\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E4\u05D5\u05E2\u05DC, \u05D5\u05E8\u05E7 \u05D0\u05D7\u05E8\u05D9 \u05E9\u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05D5\u05E9\u05E8 \u05D5\u05E0\u05E9\u05DC\u05D7 \u05D0\u05DC\u05D9\u05D5), \u05DE\u05E8\u05D9\u05E5 Claude Code \u05DC\u05E7\u05E8\u05D9\u05D0\u05D4 \u05D1\u05DC\u05D1\u05D3 \u05D5\u05DE\u05D7\u05D6\u05D9\u05E8 \u05EA\u05D5\u05DB\u05E0\u05D9\u05EA. \u05DB\u05E8\u05D8\u05D9\u05E1 \u05E2\u05DD \u05D1\u05E0\u05D9\u05D9\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA \u05E9\u05D0\u05D5\u05E9\u05E8 \u05E0\u05D1\u05E0\u05D4 \u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05EA \u05D4\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8, \u05D0\u05D7\u05D3 \u05D1\u05DB\u05DC \u05E4\u05E2\u05DD. \u05D4\u05D5\u05D0 \u05D2\u05DD \u05DB\u05D5\u05EA\u05D1 \u05D4\u05E6\u05E2\u05EA \u05E0\u05D9\u05E1\u05D5\u05D7 \u05DC\u05E4\u05E8\u05D5\u05DE\u05E4\u05D8 \u05DC\u05E4\u05D9 \u05D4\u05E2\u05E8\u05D5\u05EA \u05D4\u05D1\u05E2\u05DC\u05D9\u05DD, \u05D5\u05D4\u05D4\u05E6\u05E2\u05D4 \u05DE\u05DE\u05EA\u05D9\u05E0\u05D4 \u05E2\u05D3 \u05E9\u05DE\u05E7\u05D1\u05DC\u05D9\u05DD \u05D0\u05D5 \u05D3\u05D5\u05D7\u05D9\u05DD \u05D0\u05D5\u05EA\u05D4.", summaryEn: "Runs on the owner computer (pnpm board:watch): claims a work board ticket (only while its settings switch is on), runs Claude Code read only and posts a plan back. An approved auto build ticket is built in the project folder, one at a time. It also writes a suggested rewrite of a prompt from the owner notes, which waits until it is accepted or rejected.", code: ["scripts/board-watch.ts"], decisions: ["D-110", "D-127", "D-182", "D-189", "D-250", "D-696"] },
21508
+ { id: "local-scripts", kind: "actor", zone: "outside", label: "Local scripts", summary: "\u05E4\u05E7\u05D5\u05D3\u05D5\u05EA \u05E9\u05D4\u05E6\u05D5\u05D5\u05EA \u05DE\u05E8\u05D9\u05E5 \u05DE\u05D4\u05DE\u05D7\u05E9\u05D1: prompts:pull \u05D5\u05BEprompts:push (\u05E7\u05D5\u05D1\u05E5 \u05E4\u05E8\u05D5\u05DE\u05E4\u05D8 \u05DE\u05D5\u05DC \u05D4\u05D8\u05E7\u05E1\u05D8 \u05D4\u05D7\u05D9), costs:push (\u05DE\u05D7\u05D9\u05E8\u05D9 Cloudflare), content:push \u05D5\u05BEcontent:pull (\u05D4\u05EA\u05D5\u05DB\u05DF \u05D1\u05D9\u05DF \u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05E9\u05DC \u05D4\u05DE\u05D7\u05E9\u05D1 \u05DC\u05D6\u05D4 \u05E9\u05DC \u05D4\u05E9\u05E8\u05EA, \u05D3\u05E8\u05DA SSH). LOCAL_SCRIPTS_TOKEN \u05E4\u05D5\u05EA\u05D7 \u05D0\u05EA \u05D4\u05BEAPI \u05E9\u05DC \u05D4\u05E4\u05E7\u05D5\u05D3\u05D5\u05EA \u05D4\u05D0\u05DC\u05D4 \u05D5\u05E9\u05DC \u05D4\u05BEBoard watcher, \u05D5\u05D9\u05DB\u05D5\u05DC \u05DC\u05E9\u05E0\u05D5\u05EA \u05E4\u05E8\u05D5\u05DE\u05E4\u05D8\u05D9\u05DD \u05D5\u05DE\u05D7\u05D9\u05E8\u05D9\u05DD \u05D7\u05D9\u05D9\u05DD.", summaryEn: "Commands the team runs from the computer: prompts:pull and prompts:push (a prompt file against the live text), costs:push (Cloudflare prices), content:push and content:pull (content between the computer's database and the server's, over SSH). LOCAL_SCRIPTS_TOKEN opens the API of these commands and of the Board watcher, and can change live prompts and prices.", code: ["scripts/prompts-sync.ts", "scripts/costs-push.ts", "scripts/content-sync.ts"], env: ["LOCAL_SCRIPTS_TOKEN", "BOARD_URL"], docs: ["docs/13-run-locally.md"], decisions: ["D-204", "D-471", "D-677", "D-696"] },
21508
21509
  { id: "visitor", kind: "actor", zone: "outside", label: "\u05DE\u05D1\u05E7\u05E8 \u05D1\u05D0\u05EA\u05E8", labelEn: "Site visitor", summary: "\u05DE\u05D1\u05E7\u05E8 \u05D1\u05D0\u05EA\u05E8 \u05E9\u05DC \u05DC\u05E7\u05D5\u05D7 \u05D1\u05DB\u05EA\u05D5\u05D1\u05EA <slug>.<\u05D3\u05D5\u05DE\u05D9\u05D9\u05DF \u05D0\u05EA\u05E8\u05D9\u05DD> (\u05DB\u05DE\u05D5 deploy-net.com \u05D0\u05D5 freesite.click) \u05D0\u05D5 \u05D1\u05D3\u05D5\u05DE\u05D9\u05D9\u05DF \u05DE\u05E9\u05DC\u05D5.", summaryEn: "A visitor on a customer site at <slug>.<a sites domain> (like deploy-net.com or freesite.click) or on their own domain." },
21509
21510
  // Platform
21510
21511
  { id: "web", kind: "app", zone: "platform", label: "Web app (Next.js)", summary: "\u05D0\u05EA\u05E8 \u05D4\u05E9\u05D9\u05D5\u05D5\u05E7, \u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E8\u05D4, \u05D4\u05D0\u05D3\u05DE\u05D9\u05DF \u05D5\u05D4\u05BEAPI \u05E9\u05DC \u05D4\u05BECLI. \u05DE\u05DB\u05E0\u05D9\u05E1 \u05E2\u05D1\u05D5\u05D3\u05D5\u05EA \u05DC\u05EA\u05D5\u05E8.", summaryEn: "The marketing site, the dashboard, the admin and the CLI API. Puts jobs in the queue.", code: ["apps/web/src/app", "apps/web/src/server"], env: ["DEPLOYAI_SPACE", "BETTER_AUTH_SECRET", "NEXT_PUBLIC_SUPPORT_WHATSAPP", "DEV_SUPERADMIN_PASSWORD", "OPENAI_APPS_CHALLENGE"], portability: "Our app (site, dashboard, API, builds)", docs: ["docs/04-architecture.md"], decisions: ["D-020", "D-057", "D-104", "D-149", "D-238", "D-293"] },
@@ -21544,6 +21545,8 @@ var ARCH_EDGES = [
21544
21545
  { id: "npm-cli", from: "npm", to: "cli", kind: "deploy", label: "npx deployai" },
21545
21546
  { id: "cli-web", from: "cli", to: "web", kind: "api", label: "/api/cli/*" },
21546
21547
  { id: "board-watcher-web", from: "board-watcher", to: "web", kind: "api", label: "/api/board/*, /api/library-prompts/*" },
21548
+ { id: "local-scripts-web", from: "local-scripts", to: "web", kind: "api", label: "/api/library-prompts/*, /api/costs/push" },
21549
+ { id: "local-scripts-postgres", from: "local-scripts", to: "postgres", kind: "deploy", label: "content:push over SSH" },
21547
21550
  { id: "web-postgres", from: "web", to: "postgres", kind: "sql", label: "Drizzle" },
21548
21551
  { id: "web-queue", from: "web", to: "queue", kind: "queue", label: "enqueue" },
21549
21552
  { id: "web-files", from: "web", to: "files", kind: "api", label: "upload source" },
@@ -21654,6 +21657,19 @@ var ARCH_FLOWS = [
21654
21657
  { edge: "worker-cfapi", text: "\u05E2\u05D1\u05D5\u05D3\u05EA cf-caps \u05E1\u05D5\u05E4\u05E8\u05EA \u05D0\u05EA \u05D4\u05D7\u05E9\u05D1\u05D5\u05DF \u05DE\u05D5\u05DC \u05D4\u05DE\u05D2\u05D1\u05DC\u05D5\u05EA \u05E9\u05DC Cloudflare (\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05DE\u05D5\u05EA\u05D0\u05DE\u05D5\u05EA, D1, R2, \u05E1\u05E7\u05E8\u05D9\u05E4\u05D8\u05D9\u05DD) \u05D5\u05DE\u05D5\u05E6\u05D0\u05EA \u05E9\u05D0\u05E8\u05D9\u05D5\u05EA, \u05D1\u05DB\u05DE\u05D4 \u05E7\u05E8\u05D9\u05D0\u05D5\u05EA \u05E7\u05E8\u05D9\u05D0\u05D4 \u05D1\u05DC\u05D1\u05D3 (D-283).", textEn: "The cf-caps job counts the account against Cloudflare's limits (custom hostnames, D1, R2, scripts) and finds leftovers, in a few read only calls (D-283)." },
21655
21658
  { edge: "worker-postgres", text: "\u05DB\u05DC \u05E7\u05E8\u05D9\u05D0\u05D4 \u05DC\u05BECloudflare \u05E0\u05E1\u05E4\u05E8\u05EA \u05DC\u05E4\u05D9 \u05D3\u05E7\u05D4 \u05D1\u05BEcf_api_minutes, \u05DE\u05D5\u05DC 1,200 \u05E7\u05E8\u05D9\u05D0\u05D5\u05EA \u05D5\u05BE320 \u05E9\u05D0\u05D9\u05DC\u05EA\u05D5\u05EA GraphQL \u05D1\u05BE5 \u05D3\u05E7\u05D5\u05EA (D-283).", textEn: "Every Cloudflare call is counted per minute in cf_api_minutes, against 1,200 calls and 320 GraphQL queries per 5 minutes (D-283)." }
21656
21659
  ]
21660
+ },
21661
+ {
21662
+ id: "content-sync",
21663
+ label: "\u05E2\u05D3\u05DB\u05D5\u05DF \u05EA\u05D5\u05DB\u05DF: \u05E4\u05E8\u05D5\u05DE\u05E4\u05D8\u05D9\u05DD, \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC\u05D9\u05DD, \u05EA\u05D5\u05E1\u05E4\u05D9\u05DD \u05D5\u05DE\u05E1\u05DC\u05D5\u05DC\u05D9\u05DD",
21664
+ labelEn: "Content sync: prompts, emails, add-ons and plans",
21665
+ steps: [
21666
+ { edge: "web-postgres", text: "\u05D3\u05E8\u05DA \u05D4\u05E7\u05D5\u05D3: \u05E4\u05E8\u05D9\u05E1\u05D4 \u05D5\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05D0\u05E4\u05DC\u05D9\u05E7\u05E6\u05D9\u05D4 \u05DE\u05D1\u05D9\u05D0\u05D5\u05EA \u05D8\u05E7\u05E1\u05D8\u05D9\u05DD \u05D7\u05D3\u05E9\u05D9\u05DD \u05DC\u05DE\u05E1\u05D3, \u05E9\u05D3\u05D4 \u05D0\u05D7\u05E8 \u05E9\u05D3\u05D4. \u05E9\u05D3\u05D4 \u05E9\u05E0\u05E2\u05E8\u05DA \u05D1\u05D0\u05D3\u05DE\u05D9\u05DF \u05E0\u05E9\u05D0\u05E8.", textEn: "From the code: a deploy and the app start bring new texts into the database, field by field. A field edited in admin stays." },
21667
+ { edge: "local-scripts-postgres", text: "\u05E2\u05E8\u05D9\u05DB\u05D5\u05EA \u05DE\u05D4\u05D0\u05D3\u05DE\u05D9\u05DF \u05D1\u05DE\u05D7\u05E9\u05D1: content:push \u05DE\u05D9\u05D9\u05E6\u05D0 \u05E7\u05D5\u05D1\u05E5, \u05DE\u05E2\u05EA\u05D9\u05E7 \u05D0\u05D5\u05EA\u05D5 \u05DC\u05E9\u05E8\u05EA \u05D1\u05BESSH \u05D5\u05DE\u05E8\u05D0\u05D4 \u05DE\u05D4 \u05D9\u05E9\u05EA\u05E0\u05D4. \u05E8\u05E7 --apply \u05DB\u05D5\u05EA\u05D1.", textEn: "Edits from the admin on the computer: content:push exports a file, copies it to the server over SSH and lists what would change. Only --apply writes." },
21668
+ { edge: "browser-tunnel", text: "\u05D1\u05D0\u05D5\u05EA\u05D4 \u05D3\u05E8\u05DA \u05D1\u05D9\u05D3: Export \u05D5\u05BEImport \u05D1\u05E2\u05DE\u05D5\u05D3 /admin/server/content.", textEn: "The same by hand: Export and Import on /admin/server/content." },
21669
+ { edge: "tunnel-web", text: "Import \u05DE\u05E6\u05D9\u05D2 \u05E7\u05D5\u05D3\u05DD \u05EA\u05E6\u05D5\u05D2\u05D4 \u05DE\u05E7\u05D3\u05D9\u05DE\u05D4 \u05E9\u05DC \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD, \u05D5\u05D0\u05D6 \u05DE\u05D1\u05E7\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8.", textEn: "Import first shows a preview of the changes, then asks to confirm." },
21670
+ { edge: "web-postgres", text: "\u05D4\u05DB\u05EA\u05D9\u05D1\u05D4 \u05E7\u05D5\u05E8\u05D9\u05EA \u05D1\u05D1\u05EA \u05D0\u05D7\u05EA. \u05D4\u05E9\u05D5\u05E8\u05D5\u05EA \u05D4\u05E7\u05D5\u05D3\u05DE\u05D5\u05EA \u05E0\u05E9\u05DE\u05E8\u05D5\u05EA \u05DC\u05BEUndo, \u05D5\u05E1\u05D5\u05D3\u05D5\u05EA, \u05E0\u05EA\u05D5\u05E0\u05D9 \u05DC\u05E7\u05D5\u05D7\u05D5\u05EA \u05D5\u05DE\u05EA\u05D2 \u05D4\u05D4\u05E4\u05E2\u05DC\u05D4 \u05E9\u05DC \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05DC\u05D0 \u05E2\u05D5\u05D1\u05E8\u05D9\u05DD.", textEn: "The write happens at once. The rows before are kept for Undo, and secrets, customer data and an email's on switch never travel." },
21671
+ { edge: "local-scripts-web", text: "\u05E4\u05E8\u05D5\u05DE\u05E4\u05D8 \u05D3\u05D7\u05D5\u05E3 \u05D1\u05D9\u05DF \u05E4\u05E8\u05D9\u05E1\u05D5\u05EA: prompts:push \u05E9\u05D5\u05DC\u05D7 \u05E7\u05D5\u05D1\u05E5 \u05D0\u05D7\u05D3 \u05DB\u05D8\u05E7\u05E1\u05D8 \u05D4\u05D7\u05D9 \u05E2\u05DD LOCAL_SCRIPTS_TOKEN, \u05D5\u05E0\u05D3\u05D7\u05D4 \u05D0\u05DD \u05D4\u05D8\u05E7\u05E1\u05D8 \u05D4\u05D7\u05D9 \u05D4\u05E9\u05EA\u05E0\u05D4 \u05DE\u05D0\u05D6 \u05D4\u05BEpull.", textEn: "An urgent prompt between deploys: prompts:push sends one file as the live text with LOCAL_SCRIPTS_TOKEN, and is refused if the live text changed since the pull." }
21672
+ ]
21657
21673
  }
21658
21674
  ];
21659
21675
 
@@ -21930,8 +21946,10 @@ function stepsOf(kind, opts) {
21930
21946
  }
21931
21947
  }
21932
21948
  var allowCommandsUrl = (lang = "he") => `${HELP_ORIGIN}${lang === "he" ? "" : "/en"}/go-live#allow`;
21933
- var runCommandsRule = (lang = "he") => `Run every npx deployai@latest command yourself. If your tool shows the owner its own approval for a command, that approval is the question, so do not ask again. If it needs approval and shows the owner nothing, ask the owner one short yes or no question that names the command, for example "Run npx deployai@latest check?", and run it when they say yes. Never ask the owner to copy, paste or type a command. Right after the first command runs, before any other work, ask the owner once, unless your tool already allows our commands here: "Let your coding tool run DeployAI commands in this folder without asking each time? It adds one allow rule for npx deployai@latest to the tool's settings in this folder. Going live still waits for your answer." Only on yes run npx deployai@latest allow (add your tool's name if it asks: claude-code, cursor, copilot, codex or antigravity). Either way go on without stopping, and do not ask again. Never change your tool's settings any other way. If a command is still blocked after their yes, also by a safety check of your tool, never retry it, change it or run it another way. Say in plain words what was stopped, send them ${allowCommandsUrl(lang)}, which shows how to approve it in their tool, and ask: "Your coding tool stopped this step. I approved it, or not yet?" If the stopped command was a deploy with --live, also offer a preview first. On I approved it, try once more.`;
21934
- var START_FAIL_LINE = "If anything fails, tell the owner in plain words what happened and what you will do next.";
21949
+ var runCommandsRule = (lang = "he") => `Run every npx deployai@latest command yourself. The package is DeployAI's own CLI: its code is public at github.com/yobotn/deployai-cli and npm shows where each version was built. If your tool shows the owner its own approval for a command, that approval is the question, so do not ask again. If it needs approval and shows the owner nothing, ask the owner one short yes or no question that names the command, for example "Run npx deployai@latest check?", and run it when they say yes. Never ask the owner to copy, paste or type a command. Right after the first command runs, before any other work, ask the owner once, unless your tool already allows our commands here: "Let your coding tool run DeployAI commands in this folder without asking each time? New versions of DeployAI will run too. Going live still waits for your answer." Only on yes run npx deployai@latest allow (add your tool's name if it asks: claude-code, cursor, copilot, codex or antigravity). Either way go on without stopping, and do not ask again. Never change your tool's settings any other way. If a command is still blocked after their yes, also by a safety check of your tool, never retry it, change it or run it another way. Say in one short sentence what was stopped, send them ${allowCommandsUrl(lang)}, which shows how to approve it in their tool, without copying its steps, and ask: "Your coding tool stopped this step. I approved it, or not yet?" If the stopped command was a deploy with --live, also offer a preview first. On I approved it, try once more.`;
21950
+ var OWNER_TEXT_RULE = "Write to the owner in short plain text, with no file paths or setting names, and no escape codes or invisible direction marks such as \\u200E.";
21951
+ var START_LOGIN_WAIT_LINE = "For the agent: this command prints your instructions after the owner approves the login in the browser. Ask the owner to approve it now. If your tool stops this command, run the same command again. Do not build, scan or download anything before your instructions print.";
21952
+ var START_FAIL_LINE = "If anything fails, tell the owner in one or two short sentences what happened and what happens now, with no technical words. Give the cause only when it helps them, in simple words. Do not suggest another coding tool.";
21935
21953
 
21936
21954
  // ../shared/src/cli-map.ts
21937
21955
  var n = (id, lane, label, summaryHe, summaryEn) => ({ id, lane, label, summaryHe, summaryEn });
@@ -22097,7 +22115,7 @@ var ENV_KEYS = {
22097
22115
  CARDCOM_API_PASSWORD: { scope: "same", section: "payments", about: "The API password of that terminal." },
22098
22116
  CARDCOM_INVOICES: { scope: "same", section: "payments", about: "0 stops Cardcom from issuing a tax invoice per charge (on by default)." },
22099
22117
  CARDCOM_DEPARTMENT_ID: { scope: "same", section: "payments", about: "Optional. The Cardcom department number put on every invoice and credit invoice, for reports on a shared terminal (D-371)." },
22100
- CARDCOM_CSS_URL: { scope: "own", section: "payments", about: "Our stylesheet for Cardcom's card page, https only. Leave unset: the app address is used, the tunnel in dev." },
22118
+ CARDCOM_CSS_URL: { scope: "own", section: "payments", about: "Our stylesheet for Cardcom's card page, https only, test terminals only (D-699). Leave unset: the app address is used, the tunnel in dev." },
22101
22119
  CARDCOM_TOKEN_KEY: { scope: "server", section: "payments", required: ["server"], about: "32 bytes in base64 that seal saved card tokens (openssl rand -base64 32). Back it up offline; without it no saved card works." },
22102
22120
  BUILD_MODE: { scope: "own", section: "builds", sample: { server: "docker" }, about: "docker = a fresh container per build. Default local." },
22103
22121
  BUILD_SLOTS: { scope: "own", section: "builds", about: "Builds running at the same time in the queue worker. Default 2." },
@@ -22119,7 +22137,7 @@ var ENV_KEYS = {
22119
22137
  UPTIME_ALERT_TO: { scope: "own", section: "tools", about: "Who gets the down and back up emails of the uptime Worker, comma separated. Without it no email is sent." },
22120
22138
  UPTIME_ALERT_TOKEN: { scope: "own", section: "tools", about: "A Cloudflare token with Email Sending edit only, stored as the uptime Worker's secret. Default CF_API_TOKEN." },
22121
22139
  A11Y_RENDER: { scope: "same", section: "tools", about: "0 turns off Cloudflare Browser Rendering for the online accessibility check (D-191)." },
22122
- BOARD_RUNNER_TOKEN: { scope: "own", section: "board", about: "Token the local watcher (pnpm board:watch) sends, 24 characters or more. Each machine its own." },
22140
+ LOCAL_SCRIPTS_TOKEN: { scope: "own", section: "board", about: "Token our local scripts send to the app: board:watch, prompts:pull, prompts:push and costs:push. It can change live prompts and prices. 24 characters or more. Each machine its own." },
22123
22141
  BOARD_URL: { scope: "own", section: "board", about: "The app pnpm board:watch, prompts:push and costs:push talk to. Default http://localhost:3000; the live address to push there." },
22124
22142
  LIFECYCLE_NOW: { scope: "local", section: "testing", about: "An ISO date the lifecycle job uses as today, to trigger each email (D-180). Ignored in production." },
22125
22143
  CHROME_PATH: { scope: "local", section: "testing", about: "The browser pnpm samples:shots uses. Default Chrome or Edge in their usual places." },
@@ -22206,6 +22224,7 @@ var SPACES = {
22206
22224
  };
22207
22225
 
22208
22226
  // ../shared/src/agent-rules.ts
22227
+ 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.";
22209
22228
  var BUILD_WITH = [
22210
22229
  `Frameworks: ${SUPPORTED_FRAMEWORKS.map((f) => f.name).join(", ")}. In beta: ${BETA_FRAMEWORKS.map((f) => f.name).join(", ")} (Next.js through the OpenNext Cloudflare adapter).`,
22211
22230
  "Database: Cloudflare D1 (SQLite), through Drizzle with drizzle-orm/d1 or Prisma with the D1 adapter.",
@@ -22217,8 +22236,7 @@ var BUILD_WITH = [
22217
22236
  // D-661: the site carries its owner's name. Our badge comes with the Free plan, so nothing here may hide it (D-179).
22218
22237
  `Footer: the site carries its own name, not its builder's. No "Built with" or "Powered by" credit for a platform or tool. Use \xA9 <year> <name>, with a year that follows the date. Ask the owner, Remove or Keep, about a credit to a real designer or agency. Keep a credit a template's license requires. Never remove or hide the DeployAI badge: the hosting adds it on the Free plan, and a paid plan removes it.`,
22219
22238
  "Passwords: bcryptjs or Web Crypto, never native bcrypt.",
22220
- // D-633: Safari on an iPhone is its own engine, so every site gets these whatever add-ons it has.
22221
- "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.",
22239
+ IPHONE_RULE,
22222
22240
  "Server code runs per request: no long-running processes, background servers or child processes.",
22223
22241
  // D-611: Durable Objects run when the site's own code exports them; D1 stays the default, they cost more for plain data.
22224
22242
  "Data goes in D1 by default. Use a Durable Object only for live state that needs one place to coordinate (a chat room, a live counter, booking slots that must not double-book, presence): export the class from this site's Worker and bind it with a name and class_name in the wrangler config, never script_name. Never remove or rename a class once it is live: that would delete its data, so the upload is refused. A preview starts with empty objects.",
@@ -22233,7 +22251,8 @@ var KEEP_DATA_RULES = [
22233
22251
  "- Sessions and cache (Redis, memory): these can be lost, and users may have to log in again. Say so.",
22234
22252
  "Never delete the old database, files or storage service."
22235
22253
  ];
22236
- var AGENT_POINTER = "Read DEPLOYAI.md before you write code, change the plan or add a dependency: this project is published with DeployAI.";
22254
+ var AGENT_POINTER = "Read DEPLOYAI.md before your first answer and before you write code, change the plan or add a dependency: this project is published with DeployAI.";
22255
+ var FOLDER_READY_RULE = `This folder is already set up. When the owner has not asked for anything yet, say only, in their language: "The folder is set up and ready. What do you want to change?" Add the site's name when .deployai/project.json has it. If the folder has no site files yet, ask instead: "The folder is set up and ready. What do you want to build?" Never ask them for a start line, a command or an id. While the folder holds a site, never offer a sample or a new start: go on with that site.`;
22237
22256
 
22238
22257
  // ../shared/src/stack.ts
22239
22258
  var SITE_LANG_INFO = {
@@ -22348,6 +22367,55 @@ function uiPartsText() {
22348
22367
  }
22349
22368
 
22350
22369
  // ../shared/src/migration.ts
22370
+ var BLOCKED_MOVE_ENDINGS = ["gov", "gov.il", "mil", "mil.il", "idf.il", "muni.il", "bank", "insurance"];
22371
+ var BLOCKED_MOVE_HOSTS = [
22372
+ // Banks and payment cards in Israel, and the central bank.
22373
+ "leumi.co.il",
22374
+ "bankhapoalim.co.il",
22375
+ "discountbank.co.il",
22376
+ "mizrahi-tefahot.co.il",
22377
+ "fibi.co.il",
22378
+ "mercantile.co.il",
22379
+ "bankjerusalem.co.il",
22380
+ "boi.org.il",
22381
+ "isracard.co.il",
22382
+ "cal-online.co.il",
22383
+ "max.co.il",
22384
+ // Health funds and hospitals in Israel.
22385
+ "clalit.co.il",
22386
+ "maccabi4u.co.il",
22387
+ "meuhedet.co.il",
22388
+ "leumit.co.il",
22389
+ "sheba.co.il",
22390
+ "hadassah.org.il",
22391
+ "tasmc.org.il",
22392
+ "rambam.org.il",
22393
+ "szmc.org.il",
22394
+ "assuta.co.il",
22395
+ // Insurers in Israel.
22396
+ "harel-group.co.il",
22397
+ "migdal.co.il",
22398
+ "fnx.co.il",
22399
+ "menoramivt.co.il",
22400
+ "clalbit.co.il",
22401
+ // Payment services and large banks abroad.
22402
+ "paypal.com",
22403
+ "stripe.com",
22404
+ "chase.com",
22405
+ "bankofamerica.com",
22406
+ "wellsfargo.com",
22407
+ "hsbc.com",
22408
+ "barclays.co.uk"
22409
+ ];
22410
+ function isBlockedMoveSite(url2) {
22411
+ let host;
22412
+ try {
22413
+ host = new URL(url2).hostname.toLowerCase().replace(/\.$/, "");
22414
+ } catch {
22415
+ return false;
22416
+ }
22417
+ return [...BLOCKED_MOVE_ENDINGS, ...BLOCKED_MOVE_HOSTS].some((name) => host === name || host.endsWith(`.${name}`));
22418
+ }
22351
22419
  function normalizeSourceUrl(raw) {
22352
22420
  const text = raw.trim();
22353
22421
  if (!text || text.length > 300) return null;
@@ -22905,6 +22973,7 @@ var M = {
22905
22973
  en: {
22906
22974
  startTitle: "DeployAI start",
22907
22975
  startNewFolder: "This folder already has files, so the new site is in a new folder: {dir}",
22976
+ startUpdateFolder: "This folder holds other files, so the site's live code is in a new folder: {dir}. Nothing here changed.",
22908
22977
  startDownloaded: "Downloaded the {key} sample: {n} files.",
22909
22978
  startInstalled: "Installed its packages (npm install).",
22910
22979
  startBrief: "Wrote the owner's details to {file} (kept out of git and never uploaded).",
@@ -23031,6 +23100,7 @@ var M = {
23031
23100
  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",
23032
23101
  viewOnly: "This account can only view this site. Ask its owner to make you an editor.",
23033
23102
  startLoginFirst: "This line opens only for the site's owner or an editor, so first log in.",
23103
+ startLoginExpired: "The login code expired. Run the same line again: npx deployai@latest start {id}",
23034
23104
  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",
23035
23105
  badArchive: "The upload arrived broken or empty. Run the same command again. If it happens again, update the CLI: npx deployai@latest",
23036
23106
  invalidRequest: "DeployAI did not accept this request. Run it again with the newest CLI: npx deployai@latest",
@@ -23131,6 +23201,7 @@ var M = {
23131
23201
  he: {
23132
23202
  startTitle: "DeployAI start",
23133
23203
  startNewFolder: "\u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D4\u05D6\u05D5 \u05DB\u05D1\u05E8 \u05D9\u05E9 \u05E7\u05D1\u05E6\u05D9\u05DD, \u05D0\u05D6 \u05D4\u05D0\u05EA\u05E8 \u05D4\u05D7\u05D3\u05E9 \u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D7\u05D3\u05E9\u05D4: {dir}",
23204
+ startUpdateFolder: "\u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D4\u05D6\u05D5 \u05D9\u05E9 \u05E7\u05D1\u05E6\u05D9\u05DD \u05D0\u05D7\u05E8\u05D9\u05DD, \u05D0\u05D6 \u05D4\u05E7\u05D5\u05D3 \u05E9\u05DC \u05D4\u05D0\u05EA\u05E8 \u05E0\u05DE\u05E6\u05D0 \u05D1\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D7\u05D3\u05E9\u05D4: {dir}. \u05DC\u05D0 \u05E9\u05D9\u05E0\u05D9\u05E0\u05D5 \u05DB\u05D0\u05DF \u05DB\u05DC\u05D5\u05DD.",
23134
23205
  startDownloaded: "\u05D4\u05D3\u05D5\u05D2\u05DE\u05D4 {key} \u05D4\u05D5\u05E8\u05D3\u05D4: {n} \u05E7\u05D1\u05E6\u05D9\u05DD.",
23135
23206
  startInstalled: "\u05D4\u05D7\u05D1\u05D9\u05DC\u05D5\u05EA \u05E9\u05DC\u05D4 \u05D4\u05D5\u05EA\u05E7\u05E0\u05D5 (npm install).",
23136
23207
  startBrief: "\u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC \u05D1\u05E2\u05DC \u05D4\u05D0\u05EA\u05E8 \u05E0\u05DB\u05EA\u05D1\u05D5 \u05DC {file} (\u05DC\u05D0 \u05E0\u05DB\u05E0\u05E1\u05D9\u05DD \u05DC\u05BEgit \u05D5\u05DC\u05D0 \u05E2\u05D5\u05DC\u05D9\u05DD \u05DC\u05D0\u05EA\u05E8).",
@@ -23257,6 +23328,7 @@ var M = {
23257
23328
  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",
23258
23329
  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.",
23259
23330
  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.",
23331
+ startLoginExpired: "\u05E7\u05D5\u05D3 \u05D4\u05DB\u05E0\u05D9\u05E1\u05D4 \u05E4\u05D2. \u05D4\u05E8\u05D9\u05E6\u05D5 \u05E9\u05D5\u05D1 \u05D0\u05EA \u05D0\u05D5\u05EA\u05D4 \u05D4\u05E9\u05D5\u05E8\u05D4: npx deployai@latest start {id}",
23260
23332
  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",
23261
23333
  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",
23262
23334
  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",
@@ -23365,7 +23437,7 @@ function messages(root) {
23365
23437
  }
23366
23438
 
23367
23439
  // src/version.ts
23368
- var CLI_VERSION = "0.1.0-beta.25";
23440
+ var CLI_VERSION = "0.1.0-beta.26";
23369
23441
 
23370
23442
  // src/api.ts
23371
23443
  function apiContext(apiFlag) {
@@ -23534,7 +23606,7 @@ function formatBytes(n2) {
23534
23606
  import { arch as arch2, platform as platform2 } from "os";
23535
23607
  var TELEMETRY_SENT = [
23536
23608
  "Install id (random, made on this computer) and CLI version",
23537
- "After each command: command name, result (success, blocked, error category), how long it took and which AI tool ran it, when the environment says so",
23609
+ "After each command: command name, result (success, blocked, error category), how long it took and which AI tool ran it, when the environment says so. A start that has to wait for a login sends one more, before it waits",
23538
23610
  "After an error: the error line with addresses, paths, file names, emails and ids removed, or the wrong command or flag name",
23539
23611
  "A note your agent sends with the feedback command: what got in its way and what would help, one sentence each, shown to you as it was sent",
23540
23612
  "Linked project id, detected framework and version",
@@ -24302,8 +24374,14 @@ var DEPLOYAI_MD = `# DeployAI rules
24302
24374
 
24303
24375
  This project is published with DeployAI.
24304
24376
 
24377
+ ${FOLDER_READY_RULE}
24378
+
24305
24379
  Always explain to the user in simple words, in the language they write to you in. The user may not read English.
24306
24380
 
24381
+ ${START_FAIL_LINE}
24382
+
24383
+ ${OWNER_TEXT_RULE}
24384
+
24307
24385
  When you install or set something up, say what it does for the site, not the package name. Say "installing the site runtime" or "setting up a local test database", not "installing the Cloudflare adapter" or "installing wrangler".
24308
24386
 
24309
24387
  Before you write code or change the plan, compare it with these rules. If something in it does not fit, say what and propose the change.
@@ -24312,7 +24390,7 @@ Before you write code or change the plan, compare it with these rules. If someth
24312
24390
 
24313
24391
  ${BUILD_WITH.map((l) => `- ${l}`).join("\n")}
24314
24392
 
24315
- To start from working code, see the samples: npx deployai@latest samples
24393
+ Only when this folder has no site yet and the owner asks to start from working code: npx deployai@latest samples
24316
24394
 
24317
24395
  ## Do not add
24318
24396
 
@@ -24359,13 +24437,31 @@ Files:
24359
24437
  - .deployai/last-check.json: latest check result (not committed)
24360
24438
  `;
24361
24439
  var AGENT_FILES = ["AGENTS.md", "CLAUDE.md"];
24440
+ var LATER_RULES = [
24441
+ { has: "iPhone:", text: IPHONE_RULE },
24442
+ { has: "set up and ready", text: FOLDER_READY_RULE },
24443
+ { has: "one or two short sentences", text: START_FAIL_LINE },
24444
+ { has: "direction marks", text: OWNER_TEXT_RULE },
24445
+ { has: "deployai@latest feedback", text: AGENT_FEEDBACK_RULES.join(" ") }
24446
+ ];
24447
+ function addMissingRules(md) {
24448
+ const text = readFileSync5(md, "utf8");
24449
+ const missing = LATER_RULES.filter((r) => !text.includes(r.has));
24450
+ if (!missing.length) return false;
24451
+ const eol = text.includes("\r\n") ? "\r\n" : "\n";
24452
+ const gap = text.endsWith("\n") ? eol : eol + eol;
24453
+ appendFileSync(md, `${gap}## Added later by DeployAI${eol}${eol}${missing.map((r) => r.text).join(eol + eol)}${eol}`);
24454
+ return true;
24455
+ }
24362
24456
  function runInit(root, opts = {}) {
24363
24457
  const created = [];
24364
24458
  const kept = [];
24365
24459
  const updated = [];
24366
24460
  const md = join5(root, "DEPLOYAI.md");
24461
+ let rulesAdded = false;
24367
24462
  if (existsSync5(md) && !opts.force) {
24368
24463
  kept.push("DEPLOYAI.md");
24464
+ rulesAdded = addMissingRules(md);
24369
24465
  } else {
24370
24466
  writeFileSync3(md, DEPLOYAI_MD);
24371
24467
  created.push("DEPLOYAI.md");
@@ -24398,7 +24494,7 @@ function runInit(root, opts = {}) {
24398
24494
  created.push(".deployai/project.json");
24399
24495
  }
24400
24496
  const hasCode = existsSync5(join5(root, "package.json")) || framework !== "unknown";
24401
- return { created, kept, updated, hasCode };
24497
+ return { rulesAdded, created, kept, updated, hasCode };
24402
24498
  }
24403
24499
  function initCommand(root, opts) {
24404
24500
  const res = runInit(root, opts);
@@ -24436,11 +24532,12 @@ var PROMPT_RULES = [
24436
24532
  "Do not remove features without asking.",
24437
24533
  "Keep the project runnable outside DeployAI.",
24438
24534
  "Never add credentials to source code.",
24439
- "Explain every step to the user in simple words, in the language they write to you in.",
24535
+ "Write to the user briefly, in simple words, in the language they write to you in.",
24440
24536
  "For the database, use D1 as shown in the DeployAI CRUD sample.",
24441
24537
  "Follow DEPLOYAI.md for every future change. If it is missing, run: npx deployai@latest init",
24442
24538
  runCommandsRule(),
24443
- ASK_OWNER_RULE
24539
+ ASK_OWNER_RULE,
24540
+ OWNER_TEXT_RULE
24444
24541
  ];
24445
24542
  var DATA_CODES = /* @__PURE__ */ new Set(["fs_write", "unsupported_db_postgres", "unsupported_db_mysql", "unsupported_db_mongodb", "unsupported_db_sqlite_file", "native_module_bcrypt"]);
24446
24543
  var MAX_LOCATIONS = 3;
@@ -24851,7 +24948,7 @@ function allowCommand(tool) {
24851
24948
  }
24852
24949
  out(added ? `Done: Claude Code runs npx deployai@latest commands in this folder without asking (${rel}).` : "Already allowed in this folder.");
24853
24950
  out("Other commands still ask, and going live still waits for the owner. The owner can take it back with /permissions.");
24854
- out(`If a safety check of the tool still stops a command, do not run it another way: send the owner ${allowCommandsUrl()} (D-691).`);
24951
+ out(`If a safety check of the tool still stops a command, do not run it another way: send the owner ${allowCommandsUrl()}, the link only, not its steps (D-691).`);
24855
24952
  return;
24856
24953
  }
24857
24954
  if (picked === "cursor") {
@@ -24934,6 +25031,17 @@ function ensureMigrationDir(root) {
24934
25031
  const ignore = join9(dir, ".gitignore");
24935
25032
  if (!existsSync9(ignore)) writeFileSync6(ignore, "*/media/\n*/media-state.json\n");
24936
25033
  }
25034
+ function sameAddress(from, to) {
25035
+ try {
25036
+ const a = new URL(from);
25037
+ const b = new URL(to, from);
25038
+ const host = (u) => u.hostname.replace(/^www\./, "");
25039
+ const path = (u) => u.pathname.replace(/\/+$/, "");
25040
+ return host(a) === host(b) && path(a) === path(b) && a.search === b.search;
25041
+ } catch {
25042
+ return false;
25043
+ }
25044
+ }
24937
25045
  async function sitemapUrls(base, robotsSitemaps, enough) {
24938
25046
  const own2 = [`${base}/wp-sitemap.xml`, `${base}/sitemap_index.xml`, `${base}/sitemap.xml`];
24939
25047
  const prefix = new URL(base).pathname.replace(/\/$/, "");
@@ -25103,6 +25211,7 @@ async function saveOldStyles(html, pageUrl, dir) {
25103
25211
  async function migrateScanCommand(root, raw, opts = {}) {
25104
25212
  const source = normalizeSourceUrl(raw);
25105
25213
  if (!source) throw new CliError(`Not a site address: ${raw}. Use the full address, for example https://example.co.il`, 1, "usage");
25214
+ 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");
25106
25215
  const home = await get(source);
25107
25216
  if (!home) throw new CliError(`Could not reach ${source}. Check the address, or that the site is up.`, 1, "network");
25108
25217
  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");
@@ -25132,7 +25241,9 @@ async function migrateScanCommand(root, raw, opts = {}) {
25132
25241
  while (next < list.length) {
25133
25242
  const i = next++;
25134
25243
  const url2 = list[i];
25135
- const res = i === 0 ? null : await get(url2, void 0, "manual");
25244
+ let res = i === 0 ? null : await get(url2, void 0, "manual");
25245
+ const moved = res && res.status >= 300 && res.status < 400 ? res.headers.get("location") : null;
25246
+ if (moved && sameAddress(url2, moved)) res = await get(new URL(moved, url2).href);
25136
25247
  const status = i === 0 ? home.status : res?.status ?? 0;
25137
25248
  const body = i === 0 ? html : res && res.ok ? await res.text() : "";
25138
25249
  const seo = body ? readPageSeo(body) : null;
@@ -26316,8 +26427,13 @@ async function startCommand(cwd, ctx, id, opts = {}) {
26316
26427
  let start = await fetchStart(ctxNow, key);
26317
26428
  if (start === "login_required") {
26318
26429
  out(messages(process.cwd())("startLoginFirst"));
26430
+ out(START_LOGIN_WAIT_LINE);
26319
26431
  out();
26320
- await loginCommand(ctxNow, { pollMs: opts.pollMs, quiet: true });
26432
+ await sendTelemetryEvent(ctxNow, buildTelemetryEvent(ctxNow.config.installId, "start", "blocked"));
26433
+ await loginCommand(ctxNow, { pollMs: opts.pollMs, quiet: true }).catch((e2) => {
26434
+ if (e2 instanceof CliError && e2.category === "auth_expired") throw new CliError(messages(process.cwd())("startLoginExpired", { id: key }), 1, "auth_expired");
26435
+ throw e2;
26436
+ });
26321
26437
  ctxNow = { ...ctxNow, config: loadConfig() };
26322
26438
  start = await fetchStart(ctxNow, key);
26323
26439
  if (start === "login_required") throw new CliError(messages(process.cwd())("sessionExpired"), 1, "auth");
@@ -26328,12 +26444,14 @@ async function startCommand(cwd, ctx, id, opts = {}) {
26328
26444
  const fresh = kind === "new" || kind === "migrate" || kind === "guest" && sample;
26329
26445
  const here = resolve3(cwd);
26330
26446
  const sameSite = Boolean(choices.projectId && readProject(here)?.projectId === choices.projectId);
26331
- const root = fresh && filesIn(here).length && !opts.here && !sameSite ? freeFolder(here, choices.slug ?? sample?.key ?? "site") : here;
26447
+ const update = kind === "update" && Boolean(choices.projectId);
26448
+ const root = (fresh || update) && filesIn(here).length && !opts.here && !sameSite ? freeFolder(here, choices.slug ?? sample?.key ?? "site") : here;
26332
26449
  const done = [];
26333
26450
  const empty = !filesIn(root).length;
26334
26451
  const starter = (kind === "new" || kind === "guest") && !sample && empty;
26335
26452
  const signedIn = Boolean(choices.projectId && tokenIfOwnApi(ctxNow));
26336
- const steps = startSteps(kind, { emptyFolder: kind === "update" && empty, starter, managed: Boolean(choices.migration?.requestId), signedIn, addons: Boolean(choices.runAddons) });
26453
+ const pullNow = update && empty && signedIn;
26454
+ const steps = startSteps(kind, { emptyFolder: kind === "update" && empty && !pullNow, starter, managed: Boolean(choices.migration?.requestId), signedIn, addons: Boolean(choices.runAddons) });
26337
26455
  updateProject(root, { lang: langOf(choices.ownerLanguage) });
26338
26456
  const t = messages(root);
26339
26457
  if (sample && !sameSite) {
@@ -26374,15 +26492,17 @@ ${choices.brief}
26374
26492
  updateProject(root, { stack: choices.stack });
26375
26493
  done.push(t("startStack", { stack: stackSummary(choices.stack) }));
26376
26494
  }
26377
- if (runInit(root).created.includes("DEPLOYAI.md")) done.push(t("startRules"));
26495
+ const init = runInit(root);
26496
+ if (init.created.includes("DEPLOYAI.md") || init.rulesAdded) done.push(t("startRules"));
26378
26497
  if (choices.projectId) {
26379
26498
  const before = readProject(root);
26380
26499
  writeProject(root, { ...before ?? {}, projectId: choices.projectId, name: choices.name ?? void 0, slug: choices.slug ?? void 0, createdAt: before?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString() });
26381
26500
  done.push(t(before?.projectId && before.projectId !== choices.projectId ? "startRelinked" : "startLinked", { name: choices.name ?? "" }));
26382
26501
  }
26502
+ if (pullNow) await pullCommand(root, ctxNow);
26383
26503
  out(t("startTitle"));
26384
26504
  out();
26385
- if (root !== here) out(t("startNewFolder", { dir: relative3(here, root) }));
26505
+ if (root !== here) out(t(update ? "startUpdateFolder" : "startNewFolder", { dir: relative3(here, root) }));
26386
26506
  for (const line of done) out(`- ${line}`);
26387
26507
  out();
26388
26508
  out("----- Instructions for the agent -----");
@@ -26406,6 +26526,7 @@ ${choices.brief}
26406
26526
  out();
26407
26527
  out(runCommandsRule(langOf(choices.ownerLanguage)));
26408
26528
  out(ASK_OWNER_RULE);
26529
+ out(OWNER_TEXT_RULE);
26409
26530
  out(START_FAIL_LINE);
26410
26531
  }
26411
26532
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deployai",
3
- "version": "0.1.0-beta.25",
3
+ "version": "0.1.0-beta.26",
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",