deployai 0.1.0-beta.14 → 0.1.0-beta.16

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 +418 -87
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -98,6 +98,14 @@ var ISSUES = [
98
98
  agentLine: "{loc} runs a WebSocket server{detail}.",
99
99
  fixForAgent: "A standalone WebSocket server cannot run here. Use polling or server-sent events for live updates, or ask the developer before redesigning this feature."
100
100
  },
101
+ {
102
+ code: "durable_objects",
103
+ severity: "blocker",
104
+ titleEn: "Uses Durable Objects, not supported yet",
105
+ titleHe: "\u05D4\u05D0\u05EA\u05E8 \u05DE\u05E9\u05EA\u05DE\u05E9 \u05D1\u05BEDurable Objects, \u05E9\u05E2\u05D5\u05D3 \u05DC\u05D0 \u05E0\u05EA\u05DE\u05DB\u05D9\u05DD",
106
+ agentLine: "{loc} declares Durable Objects{detail}.",
107
+ fixForAgent: "Durable Objects do not run on customer sites yet. Keep the data in D1 (SQLite) and remove durable_objects from the wrangler config. For live updates use polling or server-sent events."
108
+ },
101
109
  {
102
110
  code: "bundle_too_large",
103
111
  severity: "blocker",
@@ -705,6 +713,120 @@ function frameworkDisplay(d) {
705
713
  if (notes.length) s += ` (${notes.join(", ")})`;
706
714
  return s;
707
715
  }
716
+ function jsoncToJson(src) {
717
+ let out2 = "";
718
+ let i = 0;
719
+ const n2 = src.length;
720
+ while (i < n2) {
721
+ const c = src[i];
722
+ if (c === '"') {
723
+ let j = i + 1;
724
+ while (j < n2 && src[j] !== '"') j += src[j] === "\\" ? 2 : 1;
725
+ out2 += src.slice(i, j + 1);
726
+ i = j + 1;
727
+ } else if (c === "/" && src[i + 1] === "/") {
728
+ while (i < n2 && src[i] !== "\n") i++;
729
+ } else if (c === "/" && src[i + 1] === "*") {
730
+ i += 2;
731
+ while (i < n2 && !(src[i] === "*" && src[i + 1] === "/")) i++;
732
+ i += 2;
733
+ } else {
734
+ out2 += c;
735
+ i++;
736
+ }
737
+ }
738
+ return out2.replace(/,(\s*[}\]])/g, "$1");
739
+ }
740
+ function durableObjectsOf(v) {
741
+ const list = v && typeof v === "object" ? v.bindings : null;
742
+ if (!Array.isArray(list)) return [];
743
+ return list.map((x) => x && typeof x === "object" && typeof x.name === "string" ? x.name : "");
744
+ }
745
+ function bindingsOf(list) {
746
+ if (!Array.isArray(list)) return [];
747
+ return list.map((x) => x && typeof x === "object" && typeof x.binding === "string" ? { binding: x.binding } : null).filter((x) => x !== null);
748
+ }
749
+ function parseWranglerConfig(fileName, text) {
750
+ const empty = { d1: [], r2: [], vars: [], main: null, assetsDir: null, compatibilityDate: null, compatibilityFlags: [], durableObjects: [] };
751
+ if (/\.toml$/.test(fileName)) return parseWranglerToml(text);
752
+ let j;
753
+ try {
754
+ j = JSON.parse(jsoncToJson(text));
755
+ } catch {
756
+ return empty;
757
+ }
758
+ if (!j || typeof j !== "object") return empty;
759
+ const assets = j.assets;
760
+ const vars = j.vars && typeof j.vars === "object" && !Array.isArray(j.vars) ? Object.keys(j.vars) : [];
761
+ return {
762
+ d1: bindingsOf(j.d1_databases),
763
+ r2: bindingsOf(j.r2_buckets),
764
+ vars,
765
+ main: typeof j.main === "string" ? j.main : null,
766
+ assetsDir: assets && typeof assets.directory === "string" ? assets.directory : null,
767
+ compatibilityDate: typeof j.compatibility_date === "string" ? j.compatibility_date : null,
768
+ compatibilityFlags: Array.isArray(j.compatibility_flags) ? j.compatibility_flags.filter((x) => typeof x === "string") : [],
769
+ durableObjects: durableObjectsOf(j.durable_objects)
770
+ };
771
+ }
772
+ function tomlString(v) {
773
+ const m = /^\s*(?:"((?:[^"\\]|\\.)*)"|'([^']*)')/.exec(v);
774
+ return m ? m[1] ?? m[2] ?? "" : null;
775
+ }
776
+ function parseWranglerToml(text) {
777
+ const decl = { d1: [], r2: [], vars: [], main: null, assetsDir: null, compatibilityDate: null, compatibilityFlags: [], durableObjects: [] };
778
+ let section = "";
779
+ for (const rawLine of text.split(/\r?\n/)) {
780
+ const line = rawLine.replace(/\s+#.*$/, "").replace(/^#.*$/, "").trim();
781
+ if (!line) continue;
782
+ const arr = /^\[\[\s*([\w.]+)\s*\]\]$/.exec(line);
783
+ if (arr) {
784
+ section = `[[${arr[1]}]]`;
785
+ if (arr[1] === "d1_databases") decl.d1.push({ binding: "" });
786
+ if (arr[1] === "r2_buckets") decl.r2.push({ binding: "" });
787
+ if (arr[1] === "durable_objects.bindings") decl.durableObjects.push("");
788
+ continue;
789
+ }
790
+ const tbl = /^\[\s*([\w.]+)\s*\]$/.exec(line);
791
+ if (tbl) {
792
+ section = tbl[1];
793
+ continue;
794
+ }
795
+ const kv = /^([\w-]+|"[^"]+")\s*=\s*(.*)$/.exec(line);
796
+ if (!kv) continue;
797
+ const key = kv[1].replace(/^"|"$/g, "");
798
+ const value = kv[2];
799
+ if (section === "") {
800
+ if (key === "main") decl.main = tomlString(value);
801
+ if (key === "compatibility_date") decl.compatibilityDate = tomlString(value);
802
+ if (key === "compatibility_flags") decl.compatibilityFlags = [...value.matchAll(/"([^"]+)"|'([^']+)'/g)].map((m) => m[1] ?? m[2]);
803
+ if (key === "d1_databases" || key === "r2_buckets") {
804
+ const target = key === "d1_databases" ? decl.d1 : decl.r2;
805
+ for (const m of value.matchAll(/binding\s*=\s*(?:"([^"]+)"|'([^']+)')/g)) target.push({ binding: m[1] ?? m[2] });
806
+ }
807
+ if (key === "vars") for (const m of value.matchAll(/([\w-]+)\s*=/g)) decl.vars.push(m[1]);
808
+ if (key === "durable_objects") for (const m of value.matchAll(/\bname\s*=\s*(?:"([^"]+)"|'([^']+)')/g)) decl.durableObjects.push(m[1] ?? m[2]);
809
+ } else if (section === "durable_objects" && key === "bindings") {
810
+ for (const m of value.matchAll(/\bname\s*=\s*(?:"([^"]+)"|'([^']+)')/g)) decl.durableObjects.push(m[1] ?? m[2]);
811
+ } else if (section === "[[durable_objects.bindings]]" && key === "name") {
812
+ const v = tomlString(value);
813
+ if (v != null) decl.durableObjects[decl.durableObjects.length - 1] = v;
814
+ } else if (section === "vars") {
815
+ decl.vars.push(key);
816
+ } else if (section === "assets" && key === "directory") {
817
+ decl.assetsDir = tomlString(value);
818
+ } else if (section === "[[d1_databases]]" && key === "binding") {
819
+ const v = tomlString(value);
820
+ if (v != null) decl.d1[decl.d1.length - 1].binding = v;
821
+ } else if (section === "[[r2_buckets]]" && key === "binding") {
822
+ const v = tomlString(value);
823
+ if (v != null) decl.r2[decl.r2.length - 1].binding = v;
824
+ }
825
+ }
826
+ decl.d1 = decl.d1.filter((b) => b.binding);
827
+ decl.r2 = decl.r2.filter((b) => b.binding);
828
+ return decl;
829
+ }
708
830
 
709
831
  // ../shared/src/issue-help.ts
710
832
  var HELP_ORIGIN = "https://deployai.co.il";
@@ -835,6 +957,19 @@ var ISSUE_HELP = {
835
957
  fix: ["Remove timers, job queues and scheduled task libraries from the site.", "If you need a task that runs on a clock, your agent asks you before building it."]
836
958
  }
837
959
  },
960
+ durable_objects: {
961
+ he: {
962
+ what: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D4\u05D0\u05EA\u05E8 (wrangler) \u05DE\u05D1\u05E7\u05E9\u05D5\u05EA Durable Objects, \u05D0\u05D7\u05E1\u05D5\u05DF \u05DC\u05DE\u05E6\u05D1 \u05D7\u05D9 \u05DB\u05DE\u05D5 \u05E6\u05F3\u05D0\u05D8 \u05D0\u05D5 \u05DE\u05D5\u05E0\u05D9\u05DD.",
963
+ why: "\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05DC \u05DC\u05E7\u05D5\u05D7\u05D5\u05EA \u05E2\u05D5\u05D3 \u05DC\u05D0 \u05D9\u05DB\u05D5\u05DC\u05D9\u05DD \u05DC\u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05D4\u05DD. \u05D4\u05D0\u05EA\u05E8 \u05D4\u05D9\u05D4 \u05E2\u05D5\u05DC\u05D4 \u05D5\u05E0\u05D5\u05E4\u05DC \u05D1\u05D1\u05E7\u05E9\u05D4 \u05D4\u05E8\u05D0\u05E9\u05D5\u05E0\u05D4 \u05E9\u05DE\u05D2\u05D9\u05E2\u05D4 \u05D0\u05DC\u05D9\u05D4\u05DD, \u05DC\u05DB\u05DF \u05D4\u05D5\u05D0 \u05DC\u05D0 \u05D9\u05E2\u05DC\u05D4.",
964
+ fix: ["\u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05E0\u05E9\u05DE\u05E8\u05D9\u05DD \u05D1\u05DE\u05E1\u05D3 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05E9\u05DC \u05D4\u05D0\u05EA\u05E8.", "\u05DC\u05E2\u05D3\u05DB\u05D5\u05E0\u05D9\u05DD \u05D7\u05D9\u05D9\u05DD \u05D1\u05D5\u05D3\u05E7\u05D9\u05DD \u05DE\u05D7\u05D3\u05E9 \u05DB\u05DC \u05DB\u05DE\u05D4 \u05E9\u05E0\u05D9\u05D5\u05EA, \u05D0\u05D5 \u05DE\u05E9\u05EA\u05DE\u05E9\u05D9\u05DD \u05D1\u05D6\u05E8\u05DD \u05E2\u05D3\u05DB\u05D5\u05E0\u05D9\u05DD \u05DE\u05D4\u05E9\u05E8\u05EA."],
965
+ prompt: "Durable Objects \u05DC\u05D0 \u05E8\u05E6\u05D9\u05DD \u05E2\u05D3\u05D9\u05D9\u05DF \u05D1\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05DC \u05DC\u05E7\u05D5\u05D7\u05D5\u05EA. \u05E9\u05DE\u05D5\u05E8 \u05D0\u05EA \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05D1\u05BED1 (SQLite) \u05D5\u05D4\u05E1\u05E8 \u05D0\u05EA durable_objects \u05DE\u05E7\u05D5\u05D1\u05E5 \u05D4\u05BEwrangler. \u05DC\u05E2\u05D3\u05DB\u05D5\u05E0\u05D9\u05DD \u05D7\u05D9\u05D9\u05DD \u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05BEpolling \u05D0\u05D5 \u05D1\u05BEserver-sent events."
966
+ },
967
+ en: {
968
+ what: "The site settings (wrangler) ask for Durable Objects, storage for live state such as a chat or counters.",
969
+ why: "Customer sites cannot use them yet. The site would go live and then fail on the first request that reaches one, so it will not go live.",
970
+ fix: ["Keep the data in the site database.", "For live updates, check again every few seconds, or use a stream of updates from the server."]
971
+ }
972
+ },
838
973
  websocket_server: {
839
974
  he: {
840
975
  what: "\u05D4\u05D0\u05EA\u05E8 \u05DE\u05E4\u05E2\u05D9\u05DC \u05E9\u05E8\u05EA WebSocket, \u05D7\u05D9\u05D1\u05D5\u05E8 \u05E4\u05EA\u05D5\u05D7 \u05E9\u05E0\u05E9\u05D0\u05E8 \u05E4\u05E2\u05D9\u05DC \u05DB\u05D3\u05D9 \u05DC\u05E9\u05DC\u05D5\u05D7 \u05E2\u05D3\u05DB\u05D5\u05E0\u05D9\u05DD \u05D7\u05D9\u05D9\u05DD.",
@@ -18997,8 +19132,8 @@ function currencyCode2(_params) {
18997
19132
  return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
18998
19133
  }
18999
19134
  function hash(alg, params) {
19000
- const enc = params?.enc ?? "hex";
19001
- const format = `${alg}_${enc}`;
19135
+ const enc4 = params?.enc ?? "hex";
19136
+ const format = `${alg}_${enc4}`;
19002
19137
  const regex = regexes_exports[format];
19003
19138
  if (!regex)
19004
19139
  throw new Error(`Unrecognized hash format: ${format}`);
@@ -21260,7 +21395,9 @@ var ARCH_NODES = [
21260
21395
  { id: "demos", kind: "worker", zone: "cloudflare", label: "deployai-demos", summary: "\u05D4\u05D3\u05DE\u05D5\u05D0\u05D9\u05DD \u05D1\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05DB\u05DE\u05D5 shop.deploy-net.com, \u05E2\u05DC \u05DB\u05DC \u05D3\u05D5\u05DE\u05D9\u05D9\u05DF \u05D0\u05EA\u05E8\u05D9\u05DD: \u05DE\u05D5\u05E9\u05DA \u05D0\u05EA /demo/<key> \u05DE\u05D4\u05D0\u05EA\u05E8 \u05E9\u05DC\u05E0\u05D5 \u05D5\u05DE\u05E1\u05D9\u05E8 \u05D0\u05EA \u05D4\u05E7\u05D9\u05D3\u05D5\u05DE\u05EA, noindex.", summaryEn: "The demos on hosts like shop.deploy-net.com, on every sites domain: fetches /demo/<key> from our site and strips the prefix, noindex.", code: ["workers/demos/src", "scripts/deploy-demos.ts", "packages/shared/src/demos.ts"], env: ["CHROME_PATH", "SHOTS_BASE"], docs: ["workers/demos/README.md"], decisions: ["D-112", "D-293"] },
21261
21396
  { id: "tools-worker", kind: "worker", zone: "cloudflare", label: "deployai-tools", summary: "\u05DE\u05D5\u05E8\u05D9\u05D3 \u05D0\u05EA \u05D4\u05E2\u05DE\u05D5\u05D3\u05D9\u05DD \u05D5\u05D4\u05EA\u05DE\u05D5\u05E0\u05D5\u05EA \u05E9\u05D4\u05DB\u05DC\u05D9\u05DD \u05D4\u05D7\u05D9\u05E0\u05DE\u05D9\u05D9\u05DD \u05D1\u05D5\u05D3\u05E7\u05D9\u05DD, \u05DB\u05D3\u05D9 \u05E9\u05DB\u05EA\u05D5\u05D1\u05EA \u05E9\u05DE\u05D1\u05E7\u05E8 \u05D4\u05E7\u05DC\u05D9\u05D3 \u05DC\u05D0 \u05EA\u05D9\u05D8\u05E2\u05DF \u05DE\u05D4\u05E9\u05E8\u05EA \u05E9\u05DC\u05E0\u05D5. \u05E8\u05E7 \u05E9\u05DE\u05D5\u05EA \u05E6\u05D9\u05D1\u05D5\u05E8\u05D9\u05D9\u05DD, \u05DB\u05DC \u05EA\u05E9\u05D5\u05D1\u05EA DNS \u05D5\u05DB\u05DC \u05D4\u05E4\u05E0\u05D9\u05D4 \u05E0\u05D1\u05D3\u05E7\u05D5\u05EA.", summaryEn: "Downloads the pages and images the free tools test, so an address a visitor typed is never fetched from our server. Public names only; every DNS answer and redirect is checked.", code: ["workers/tools/src", "scripts/deploy-tools.ts", "packages/shared/src/safe-url.ts"], env: ["TOOLS_FETCH_SECRET"], decisions: ["D-199"] },
21262
21397
  { id: "uptime-worker", kind: "worker", zone: "cloudflare", label: "deployai-uptime", summary: "\u05D1\u05D5\u05D3\u05E7 \u05DE\u05D1\u05D7\u05D5\u05E5 \u05DB\u05DC 2 \u05D3\u05E7\u05D5\u05EA \u05E9-/api/health \u05E2\u05D5\u05E0\u05D4, \u05DB\u05D9 \u05E9\u05E8\u05EA \u05E9\u05E0\u05E4\u05DC \u05DC\u05D0 \u05D9\u05DB\u05D5\u05DC \u05DC\u05D3\u05D5\u05D5\u05D7 \u05E2\u05DC \u05E2\u05E6\u05DE\u05D5. \u05E9\u05D5\u05DE\u05E8 \u05D0\u05EA \u05D4\u05EA\u05D5\u05E6\u05D0\u05D4 \u05D1\u05BEKV, \u05D5\u05E9\u05EA\u05D9 \u05E0\u05E4\u05D9\u05DC\u05D5\u05EA \u05D1\u05E8\u05E6\u05E3 \u05E9\u05D5\u05DC\u05D7\u05D5\u05EA \u05DE\u05D9\u05D9\u05DC \u05DC\u05E6\u05D5\u05D5\u05EA.", summaryEn: "Checks from outside every 2 minutes that /api/health answers, because a server that is down cannot report itself. Keeps the result in KV; two failures in a row email the team.", code: ["workers/uptime/src", "scripts/deploy-uptime.ts", "apps/web/src/app/api/health/route.ts"], env: ["UPTIME_ALERT_TO", "UPTIME_ALERT_TOKEN"], decisions: ["D-331"] },
21263
- { id: "dispatch", kind: "worker", zone: "cloudflare", label: "deployai-dispatch", summary: 'Worker \u05D0\u05D7\u05D3 \u05E2\u05DC */* \u05E9\u05DE\u05E0\u05EA\u05D1 \u05DB\u05DC \u05DB\u05EA\u05D5\u05D1\u05EA \u05DC\u05D0\u05EA\u05E8, \u05E1\u05D5\u05E4\u05E8 \u05D1\u05D9\u05E7\u05D5\u05E8\u05D9\u05DD, \u05DE\u05D2\u05D1\u05D9\u05DC \u05E7\u05E6\u05D1 \u05D5\u05DE\u05D5\u05E1\u05D9\u05E3 \u05D0\u05EA \u05D4\u05EA\u05D2 "\u05D1\u05D0\u05D5\u05D5\u05D9\u05E8 \u05E2\u05DD DeployAI" \u05DC\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05D1\u05D7\u05D1\u05D9\u05DC\u05D4 \u05E9\u05DC\u05D4\u05DD \u05D9\u05E9 \u05EA\u05D2, \u05D0\u05E3 \u05E4\u05E2\u05DD \u05DC\u05D0 \u05DC\u05D0\u05EA\u05E8 \u05D6\u05DE\u05E0\u05D9.', summaryEn: 'One Worker on */* that routes every address to its site, counts visits, limits the rate and adds the "Live with DeployAI" badge to sites whose plan has the badge, never to a temporary site.', code: ["workers/dispatch/src", "scripts/deploy-dispatch.ts"], env: ["DISPATCH_RATE_LIMIT_PERIOD", "PROBE_SECRET"], docs: ["workers/dispatch/README.md"], decisions: ["D-087", "D-113", "D-179", "D-238", "D-245", "D-528"] },
21398
+ { id: "app-uptime", kind: "worker", zone: "customer", label: "Uptime app site", summary: "\u05D0\u05EA\u05E8 \u05E0\u05D9\u05D8\u05D5\u05E8 \u05D6\u05DE\u05D9\u05E0\u05D5\u05EA \u05E9\u05DC \u05DC\u05E7\u05D5\u05D7: \u05D0\u05EA\u05E8 \u05D1\u05E4\u05E0\u05D9 \u05E2\u05E6\u05DE\u05D5 (site-<slug> \u05D1\u05DE\u05E8\u05D7\u05D1 \u05D4\u05E9\u05DE\u05D5\u05EA), \u05E2\u05DD \u05D4\u05E7\u05D5\u05D3 \u05E9\u05DC\u05E0\u05D5 \u05D1\u05DC\u05D1\u05D3, \u05E9\u05DE\u05EA\u05E2\u05D3\u05DB\u05DF \u05D1\u05DB\u05DC \u05D4\u05E2\u05DC\u05D0\u05D4 \u05E9\u05DC \u05D4\u05E9\u05E8\u05EA. Durable Object \u05E2\u05DD SQLite \u05D1\u05D0\u05D5\u05EA\u05D5 Worker \u05E9\u05D5\u05DE\u05E8 \u05D0\u05EA \u05D4\u05E0\u05D9\u05D8\u05D5\u05E8\u05D9\u05DD \u05D5\u05DE\u05E8\u05D9\u05E5 \u05D0\u05EA \u05D4\u05D1\u05D3\u05D9\u05E7\u05D5\u05EA \u05DE\u05E9\u05E2\u05D5\u05DF \u05DE\u05E2\u05D5\u05E8\u05E8 \u05DE\u05E9\u05DC\u05D5, \u05DE\u05E6\u05D9\u05D2 \u05D3\u05E3 \u05E1\u05D8\u05D8\u05D5\u05E1 \u05E6\u05D9\u05D1\u05D5\u05E8\u05D9 \u05D5\u05D3\u05E3 \u05E0\u05D9\u05D4\u05D5\u05DC \u05DC\u05D1\u05E2\u05DC\u05D9\u05DD (\u05DB\u05E0\u05D9\u05E1\u05D4 \u05E2\u05DD DeployAI \u05D0\u05D5 \u05E1\u05D9\u05E1\u05DE\u05D4 \u05DE\u05E9\u05DC\u05D5), \u05D5\u05E9\u05D5\u05DC\u05D7 \u05DE\u05D9\u05D9\u05DC \u05D3\u05E8\u05DA \u05D4\u05D0\u05E4\u05DC\u05D9\u05E7\u05E6\u05D9\u05D4 \u05D5\u05BEwebhook \u05D7\u05EA\u05D5\u05DD. \u05D4\u05E4\u05DC\u05D8\u05E4\u05D5\u05E8\u05DE\u05D4 \u05E4\u05D5\u05E0\u05D4 \u05D0\u05DC\u05D9\u05D5 \u05D1\u05BE/__app/ \u05E2\u05DD \u05D0\u05E1\u05D9\u05DE\u05D5\u05DF \u05D7\u05EA\u05D5\u05DD \u05D1\u05DE\u05E4\u05EA\u05D7 \u05E9\u05DC \u05D4\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4 \u05D1\u05DC\u05D1\u05D3.", summaryEn: "A customer's Uptime site: a site of its own (site-<slug> in the namespace) that runs only our code, upgraded on every server deploy. A SQLite Durable Object in the same Worker keeps the monitors and runs the checks from its own alarm; it serves a public status page and the owner's admin (sign in with DeployAI or its own password), emails through the app and sends a signed webhook. The platform calls it on /__app/ with a token signed with this site's own key.", code: ["workers/app-uptime/src", "scripts/build-app-uptime.ts", "apps/web/src/server/apps.ts", "apps/web/src/server/apps-uptime.ts", "packages/shared/src/uptime.ts"], env: ["APPS_SIGNING_SECRET", "APP_TRIAL_KEYS"], decisions: ["D-556", "D-559"] },
21399
+ { id: "app-cron", kind: "worker", zone: "customer", label: "Cron Trigger app site", summary: "\u05D0\u05EA\u05E8 \u05EA\u05D6\u05DE\u05D5\u05DF \u05DE\u05E9\u05D9\u05DE\u05D5\u05EA \u05E9\u05DC \u05DC\u05E7\u05D5\u05D7: \u05D0\u05EA\u05E8 \u05D1\u05E4\u05E0\u05D9 \u05E2\u05E6\u05DE\u05D5 (site-<slug> \u05D1\u05DE\u05E8\u05D7\u05D1 \u05D4\u05E9\u05DE\u05D5\u05EA) \u05E2\u05DD \u05D4\u05E7\u05D5\u05D3 \u05E9\u05DC\u05E0\u05D5 \u05D1\u05DC\u05D1\u05D3. Durable Object \u05E2\u05DD SQLite \u05D1\u05D0\u05D5\u05EA\u05D5 Worker \u05E9\u05D5\u05DE\u05E8 \u05D0\u05EA \u05D4\u05DE\u05E9\u05D9\u05DE\u05D5\u05EA \u05D5\u05DE\u05E8\u05D9\u05E5 \u05D0\u05D5\u05EA\u05DF \u05DE\u05E9\u05E2\u05D5\u05DF \u05DE\u05E2\u05D5\u05E8\u05E8 \u05DE\u05E9\u05DC\u05D5 \u05DC\u05E4\u05D9 \u05DC\u05D5\u05D7 \u05D6\u05DE\u05E0\u05D9\u05DD \u05D1\u05E9\u05E2\u05D5\u05DF \u05D9\u05E9\u05E8\u05D0\u05DC, \u05E2\u05DD \u05DE\u05D2\u05D1\u05DC\u05EA \u05D6\u05DE\u05DF \u05DC\u05DB\u05DC \u05E8\u05D9\u05E6\u05D4 (10 \u05E9\u05E0\u05D9\u05D5\u05EA, 3 \u05D0\u05D7\u05E8\u05D9 \u05E1\u05E3 \u05D4\u05E8\u05D9\u05E6\u05D5\u05EA \u05D4\u05D0\u05D9\u05D8\u05D9\u05D5\u05EA \u05E9\u05DC \u05D4\u05D7\u05D5\u05D3\u05E9), \u05E9\u05D5\u05DE\u05E8 \u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4 \u05D5\u05E9\u05D5\u05DC\u05D7 \u05DE\u05D9\u05D9\u05DC \u05D3\u05E8\u05DA \u05D4\u05D0\u05E4\u05DC\u05D9\u05E7\u05E6\u05D9\u05D4 \u05D5\u05BEwebhook \u05D7\u05EA\u05D5\u05DD \u05D1\u05BEPro.", summaryEn: "A customer's Cron Trigger site: a site of its own (site-<slug> in the namespace) that runs only our code. A SQLite Durable Object in the same Worker keeps the jobs and runs them from its own alarm on a schedule in Israel time, with a time limit per run (10 seconds, 3 after the month's slow-run threshold), keeps their history, and emails through the app and sends a signed webhook with Pro.", code: ["workers/app-cron/src", "scripts/build-app-cron.ts", "apps/web/src/server/apps.ts", "apps/web/src/server/apps-notify.ts", "packages/shared/src/cron.ts"], decisions: ["D-567", "D-568"] },
21400
+ { id: "dispatch", kind: "worker", zone: "cloudflare", label: "deployai-dispatch", summary: 'Worker \u05D0\u05D7\u05D3 \u05E2\u05DC */* \u05E9\u05DE\u05E0\u05EA\u05D1 \u05DB\u05DC \u05DB\u05EA\u05D5\u05D1\u05EA \u05DC\u05D0\u05EA\u05E8, \u05E1\u05D5\u05E4\u05E8 \u05D1\u05D9\u05E7\u05D5\u05E8\u05D9\u05DD, \u05DE\u05D2\u05D1\u05D9\u05DC \u05E7\u05E6\u05D1 \u05D5\u05DE\u05D5\u05E1\u05D9\u05E3 \u05D0\u05EA \u05D4\u05EA\u05D2 "\u05D1\u05D0\u05D5\u05D5\u05D9\u05E8 \u05E2\u05DD DeployAI" \u05DC\u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05D1\u05D7\u05D1\u05D9\u05DC\u05D4 \u05E9\u05DC\u05D4\u05DD \u05D9\u05E9 \u05EA\u05D2, \u05D0\u05E3 \u05E4\u05E2\u05DD \u05DC\u05D0 \u05DC\u05D0\u05EA\u05E8 \u05D6\u05DE\u05E0\u05D9.', summaryEn: 'One Worker on */* that routes every address to its site, counts visits, limits the rate and adds the "Live with DeployAI" badge to sites whose plan has the badge, never to a temporary site.', code: ["workers/dispatch/src", "scripts/deploy-dispatch.ts"], env: ["DISPATCH_RATE_LIMIT_PERIOD", "PROBE_SECRET", "APP_GATE_SECRET"], docs: ["workers/dispatch/README.md"], decisions: ["D-087", "D-113", "D-179", "D-238", "D-245", "D-528"] },
21264
21401
  // Customer sites
21265
21402
  { id: "site", kind: "worker", zone: "customer", label: SITE, summary: "\u05D4\u05D0\u05EA\u05E8 \u05E9\u05DC \u05D4\u05DC\u05E7\u05D5\u05D7: Worker \u05DC\u05DB\u05DC \u05D0\u05EA\u05E8, \u05E2\u05DD \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D5\u05D4\u05E7\u05D5\u05D3 \u05E9\u05DC\u05D5.", summaryEn: "The customer's site: a Worker per site, with its files and code.", portability: "Customer sites", decisions: ["D-113", "D-245"] },
21266
21403
  { id: "site-d1", kind: "db", zone: "customer", label: `D1 ${SITE_DATA}`, summary: "\u05DE\u05E1\u05D3 \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05DC\u05DB\u05DC \u05D0\u05EA\u05E8, \u05E0\u05D5\u05E6\u05E8 \u05E4\u05E2\u05DD \u05D0\u05D7\u05EA \u05D5\u05DE\u05D7\u05D5\u05D1\u05E8 \u05D1\u05DB\u05DC \u05D4\u05E2\u05DC\u05D0\u05D4.", summaryEn: "A database per site, created once and bound on every upload.", code: ["apps/web/src/server/site-data.ts"], portability: "Customer site data", decisions: ["D-076"] },
@@ -21285,6 +21422,14 @@ var ARCH_EDGES = [
21285
21422
  { id: "worker-build", from: "worker", to: "build", kind: "deploy", label: "build job" },
21286
21423
  { id: "worker-tools", from: "worker", to: "tools-worker", kind: "http", label: "tool page fetch" },
21287
21424
  { id: "uptime-web", from: "uptime-worker", to: "web", kind: "http", label: "health check" },
21425
+ { id: "web-app-uptime", from: "web", to: "app-uptime", kind: "http", label: "signed /__app/ calls" },
21426
+ { id: "web-app-cron", from: "web", to: "app-cron", kind: "http", label: "signed /__app/ calls" },
21427
+ { id: "app-cron-web", from: "app-cron", to: "web", kind: "http", label: "failure and slow-run email" },
21428
+ { id: "cfapi-app-cron", from: "cfapi", to: "app-cron", kind: "deploy", label: "upload app bundle" },
21429
+ { id: "dispatcher-app-cron", from: dispatchBindingId("DISPATCHER"), to: "app-cron", kind: "http", label: "dispatch" },
21430
+ { id: "app-uptime-web", from: "app-uptime", to: "web", kind: "http", label: "alert email, my sites" },
21431
+ { id: "cfapi-app-uptime", from: "cfapi", to: "app-uptime", kind: "deploy", label: "upload app bundle" },
21432
+ { id: "dispatcher-app-uptime", from: dispatchBindingId("DISPATCHER"), to: "app-uptime", kind: "http", label: "dispatch" },
21288
21433
  { id: "worker-pagespeed", from: "worker", to: "pagespeed", kind: "api", label: "speed, a11y, SEO" },
21289
21434
  { id: "web-turnstile", from: "web", to: "turnstile", kind: "api", label: "tool form check" },
21290
21435
  { id: "build-npm", from: "build", to: "npm", kind: "http", label: "install" },
@@ -21512,6 +21657,10 @@ var PLAN_FEATURES = [
21512
21657
  ];
21513
21658
  var KEYS = new Set(PLAN_FEATURES.map((f) => f.key));
21514
21659
 
21660
+ // ../shared/src/app-lifecycle.ts
21661
+ var APP_HOLD_MS = 30 * 6e4;
21662
+ var APP_RENEW_GRACE_MS = 8 * 864e5;
21663
+
21515
21664
  // ../shared/src/start-flow.ts
21516
21665
  var START_ID_RE = /^[a-hjkmnp-z2-9]{10}$/;
21517
21666
  var MIGRATION_DIR = ".deployai/migration";
@@ -21580,7 +21729,7 @@ function startSteps(kind, opts = {}) {
21580
21729
  }
21581
21730
  }
21582
21731
  var allowCommandsUrl = (lang = "he") => `${HELP_ORIGIN}${lang === "he" ? "" : "/en"}/connect-ai#allow`;
21583
- 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.`;
21732
+ 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. After the first command runs, ask the owner once: "Allow DeployAI commands in this folder without asking each time? (yes or no)", and only on yes run npx deployai@latest allow (add your tool's name if it asks: claude-code, cursor, copilot, codex or antigravity). Never change your tool's settings any other way. 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.`;
21584
21733
  var START_FAIL_LINE = "If anything fails, tell the owner in plain words what happened and what you will do next.";
21585
21734
 
21586
21735
  // ../shared/src/cli-map.ts
@@ -21619,6 +21768,7 @@ var CLI_MAP_NODES = [
21619
21768
  n("cmd-addon-run", "cli", "addon run / done", "\u05EA\u05D5\u05E1\u05E3 \u05D0\u05D7\u05D3 \u05DC\u05E4\u05D9 \u05E9\u05DD, \u05D5\u05D3\u05D9\u05D5\u05D5\u05D7 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05E1\u05EA\u05D9\u05D9\u05DD.", "One add-on by name, and the report that a step is done."),
21620
21769
  n("cmd-env", "cli", "env list / set / remove", "\u05DE\u05E9\u05EA\u05E0\u05D9 \u05D4\u05E1\u05D1\u05D9\u05D1\u05D4 \u05E9\u05DC \u05D4\u05D0\u05EA\u05E8. \u05E1\u05D5\u05D3 \u05DB\u05D1\u05E8\u05D9\u05E8\u05EA \u05DE\u05D7\u05D3\u05DC, \u05D5\u05DC\u05D0 \u05DE\u05D5\u05E6\u05D2 \u05E9\u05D5\u05D1.", "The site's environment variables. A secret by default, never shown again."),
21621
21770
  n("cmd-speed", "cli", "speed <url>", "\u05D1\u05D3\u05D9\u05E7\u05EA \u05DE\u05D4\u05D9\u05E8\u05D5\u05EA \u05E9\u05DC \u05DB\u05EA\u05D5\u05D1\u05EA \u05D7\u05D9\u05D4.", "A speed test of a live address."),
21771
+ 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."),
21622
21772
  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."),
21623
21773
  // The server routes the CLI calls.
21624
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."),
@@ -21811,6 +21961,9 @@ var ENV_KEYS = {
21811
21961
  TURNSTILE_SITE_KEY: { scope: "server", section: "tools", about: "Cloudflare Turnstile site key for the tool forms. Locally the Cloudflare test keys are built in." },
21812
21962
  TURNSTILE_SECRET: { scope: "server", section: "tools", about: "The Turnstile secret key of the same widget." },
21813
21963
  TOOLS_FETCH_SECRET: { scope: "same", section: "tools", about: "Shared secret between the app and the tools Worker, 32 random characters or more. pnpm tools:deploy uploads it." },
21964
+ APPS_SIGNING_SECRET: { scope: "own", section: "tools", about: 'Signs the 60 second tokens from the app to the Uptime app Worker, and the alert calls back from it (D-556); pnpm app-uptime:deploy uploads it. Unset: Apps answer "not set up". openssl rand -hex 32' },
21965
+ APP_GATE_SECRET: { scope: "own", section: "tools", about: "The gate on app sites (D-567): our server signs every /__app/op call with it and the dispatch Worker lets those paths reach an app only with a valid signature, so the public never starts a paused app. pnpm dispatch:deploy sends it to the dispatch Worker. Unset: no platform call reaches an app site. openssl rand -hex 32" },
21966
+ APP_TRIAL_KEYS: { scope: "own", section: "tools", about: "The trial key ring (D-567, docs/30 F3): v1:<hex>! (the ! marks the current key). Trial records keep only an HMAC of the mailbox under these keys. To rotate, add a key, deploy, then move the ! (docs/30). Unset: no trial can start. v1: then openssl rand -hex 32, then !" },
21814
21967
  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." },
21815
21968
  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." },
21816
21969
  A11Y_RENDER: { scope: "same", section: "tools", about: "0 turns off Cloudflare Browser Rendering for the online accessibility check (D-191)." },
@@ -21909,6 +22062,8 @@ var BUILD_WITH = [
21909
22062
  "Images: resize at build time or serve them as they are; no native image modules at runtime.",
21910
22063
  "Passwords: bcryptjs or Web Crypto, never native bcrypt.",
21911
22064
  "Server code runs per request: no long-running processes, background servers or child processes.",
22065
+ // D-574: a customer site cannot use Durable Objects yet; it would deploy and fail on its first request that reaches one.
22066
+ "No Durable Objects yet: keep state in D1, and use polling or server-sent events for live updates.",
21912
22067
  // 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.
21913
22068
  "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."
21914
22069
  ];
@@ -21960,19 +22115,77 @@ function stackSummary(s) {
21960
22115
 
21961
22116
  // ../shared/src/ui-sources.ts
21962
22117
  var UI_SOURCES = [
21963
- { key: "shadcn", name: "shadcn/ui", url: "https://ui.shadcn.com", install: "npx shadcn@latest add <component>", license: "MIT", terms: "Free for any use; keep the license notice.", use: "Forms, dialogs, menus, tabs, tables: the plain building blocks.", frameworks: "React (Astro with the React integration)", checkedOn: "2026-10-30" },
21964
- { key: "magicui", name: "Magic UI", url: "https://magicui.design", install: 'npx shadcn@latest add "https://magicui.design/r/<component>.json"', license: "MIT", terms: "Free components only (not Magic UI Pro); keep the license notice.", use: "Marketing sections: animated backgrounds, marquees, number tickers, bento grids.", frameworks: "React", checkedOn: "2026-10-30" },
21965
- { key: "aceternity", name: "Aceternity UI", url: "https://ui.aceternity.com", install: 'npx shadcn@latest add "https://ui.aceternity.com/registry/<component>.json"', license: "Aceternity licence", terms: "Free components only (not Pro or templates). Allowed in the owner's own site; never publish the component source on its own or sell it as a template.", use: "Hero effects: spotlight, background beams, cards with motion, scroll effects.", frameworks: "React", checkedOn: "2026-10-30" },
21966
- { key: "reactbits", name: "React Bits", url: "https://reactbits.dev", install: "Copy the component from its page (or its shadcn registry line on that page)", license: "MIT + Commons Clause", terms: "Allowed as part of a website; never sell the components themselves.", use: "Text animations, backgrounds, small interactive effects.", frameworks: "React", checkedOn: "2026-10-30" },
21967
- { key: "embla", name: "Embla Carousel", url: "https://www.embla-carousel.com", install: "npm install embla-carousel", license: "MIT", terms: "Free for any use.", use: "Sliders and carousels, with plain JavaScript in any framework.", frameworks: "Any (plain JS, React, Vue, Svelte)", checkedOn: "2026-10-30" },
21968
- { key: "swiper", name: "Swiper", url: "https://swiperjs.com", install: "npm install swiper", license: "MIT", terms: "Free for any use.", use: "Galleries and touch sliders, like many WordPress themes use.", frameworks: "Any (plain JS, React, Vue)", checkedOn: "2026-10-30" },
21969
- { key: "motion", name: "Motion", url: "https://motion.dev", install: "npm install motion", license: "MIT", terms: "The free library only (not Motion+).", use: "Animations on scroll and on enter, in plain JS or React.", frameworks: "Any (plain JS, React, Vue)", checkedOn: "2026-10-30" }
22118
+ { key: "shadcn", name: "shadcn/ui", url: "https://ui.shadcn.com", install: "npx shadcn@latest add <component>", license: "MIT", terms: "Free for any use; keep the license notice.", use: "Forms, dialogs, menus, tabs, tables: the plain building blocks.", frameworks: "React (Astro with the React integration)", react: true, fits: ["business", "shop", "blog", "portfolio", "restaurant", "clinic"], licenseUrl: "https://github.com/shadcn-ui/ui/blob/main/LICENSE.md", checkedOn: "2026-10-30" },
22119
+ { key: "magicui", name: "Magic UI", url: "https://magicui.design", install: 'npx shadcn@latest add "https://magicui.design/r/<component>.json"', license: "MIT", terms: "Free components only (not Magic UI Pro); keep the license notice.", use: "Marketing sections: animated backgrounds, marquees, number tickers, bento grids.", frameworks: "React", react: true, fits: ["business", "portfolio", "restaurant"], licenseUrl: "https://github.com/magicuidesign/magicui/blob/main/LICENSE.md", checkedOn: "2026-10-30" },
22120
+ { key: "aceternity", name: "Aceternity UI", url: "https://ui.aceternity.com", install: 'npx shadcn@latest add "https://ui.aceternity.com/registry/<component>.json"', license: "Aceternity licence", terms: "Free components only (not Pro or templates). Allowed in the owner's own site; never publish the component source on its own or sell it as a template.", use: "Hero effects: spotlight, background beams, cards with motion, scroll effects.", frameworks: "React", react: true, fits: ["business", "portfolio"], licenseUrl: "https://ui.aceternity.com/licence", checkedOn: "2026-10-30" },
22121
+ { key: "reactbits", name: "React Bits", url: "https://reactbits.dev", install: "Copy the component from its page (or its shadcn registry line on that page)", license: "MIT + Commons Clause", terms: "Allowed as part of a website; never sell the components themselves.", use: "Text animations, backgrounds, small interactive effects.", frameworks: "React", react: true, fits: ["portfolio", "business"], licenseUrl: "https://github.com/DavidHDev/react-bits/blob/main/LICENSE.md", checkedOn: "2026-10-30" },
22122
+ { key: "embla", name: "Embla Carousel", url: "https://www.embla-carousel.com", install: "npm install embla-carousel", license: "MIT", terms: "Free for any use.", use: "Sliders and carousels, with plain JavaScript in any framework.", frameworks: "Any (plain JS, React, Vue, Svelte)", react: false, fits: ["shop", "restaurant", "portfolio", "business"], licenseUrl: "https://github.com/davidjerleke/embla-carousel/blob/master/LICENSE", checkedOn: "2026-10-30" },
22123
+ { key: "swiper", name: "Swiper", url: "https://swiperjs.com", install: "npm install swiper", license: "MIT", terms: "Free for any use.", use: "Galleries and touch sliders, like many WordPress themes use.", frameworks: "Any (plain JS, React, Vue)", react: false, fits: ["restaurant", "portfolio", "shop"], licenseUrl: "https://github.com/nolimits4web/swiper/blob/master/LICENSE", checkedOn: "2026-10-30" },
22124
+ { key: "motion", name: "Motion", url: "https://motion.dev", install: "npm install motion", license: "MIT", terms: "The free library only (not Motion+).", use: "Animations on scroll and on enter, in plain JS or React.", frameworks: "Any (plain JS, React, Vue)", react: false, fits: ["business", "shop", "blog", "portfolio", "restaurant", "clinic"], licenseUrl: "https://github.com/motiondivision/motion/blob/main/LICENSE.md", checkedOn: "2026-10-30" },
22125
+ // Plain HTML and Tailwind kits (D-562): no React, so they fit the Astro samples as they are. Licenses read 2026-11-01.
22126
+ { key: "daisyui", name: "DaisyUI", url: "https://daisyui.com", install: 'npm i -D daisyui, then add @plugin "daisyui"; to the main CSS file (Tailwind 4)', license: "MIT", terms: "Free for any use; keep the license notice. Never the paid themes, templates or blocks from its store.", use: "Whole-site parts with themes: buttons, cards, navbars, forms, modals.", frameworks: "Any with Tailwind (plain HTML, Astro, React)", react: false, fits: ["business", "shop", "blog", "portfolio", "restaurant", "clinic"], licenseUrl: "https://github.com/saadeghi/daisyui/blob/master/LICENSE", checkedOn: "2026-11-01" },
22127
+ { key: "hyperui", name: "HyperUI", url: "https://hyperui.dev", install: "Copy the HTML from the component page", license: "MIT", terms: "Free for any use; keep the license notice.", use: "Marketing sections (hero, call to action, pricing, FAQ, footer) and shop blocks.", frameworks: "Any with Tailwind (plain HTML, Astro, React)", react: false, fits: ["business", "shop", "clinic", "restaurant"], licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", checkedOn: "2026-11-01" },
22128
+ { key: "flowbite", name: "Flowbite", url: "https://flowbite.com", install: "npm install flowbite, add its theme and plugin lines to the main CSS file as its Tailwind 4 guide says, then copy the component HTML", license: "MIT", terms: "The open-source library only; keep the license notice. Never Flowbite Pro blocks, the Figma kit or paid templates (they are not MIT).", use: "Interactive parts: dropdowns, modals, tabs, carousels, forms, tables.", frameworks: "Any (plain HTML, Astro, React, Vue, Svelte)", react: false, fits: ["business", "shop", "clinic"], licenseUrl: "https://github.com/themesberg/flowbite/blob/main/LICENSE.md", checkedOn: "2026-11-01" },
22129
+ { key: "preline", name: "Preline UI", url: "https://preline.co", install: "npm i preline, add its CSS and script lines as its install guide says, then copy the component HTML", license: "MIT + Preline Fair Use", terms: "Free in the owner's own site, commercial too. Never build a competing UI kit or builder from it; never anything marked Pro.", use: "Full sections with small scripts: hero, navbars, pricing, account pages.", frameworks: "Any (plain HTML, Astro, React, Vue)", react: false, fits: ["business", "clinic", "restaurant", "shop"], licenseUrl: "https://github.com/htmlstreamofficial/preline/blob/main/LICENSE", checkedOn: "2026-11-01" },
22130
+ { key: "uiverse", name: "Uiverse", url: "https://uiverse.io", install: "Copy the HTML and CSS (or Tailwind) from the element page", license: "MIT", terms: "Free for any use; keep the license notice. Made by many people, so check each one on a phone and with the keyboard.", use: "Small eye-catching pieces: buttons, loaders, toggles, cards.", frameworks: "Any (plain HTML and CSS)", react: false, fits: ["portfolio", "business", "restaurant"], licenseUrl: "https://github.com/uiverse-io/galaxy/blob/main/LICENSE", checkedOn: "2026-11-01" },
22131
+ // React, for forms and app parts on a site that already uses React islands.
22132
+ { key: "originui", name: "Origin UI (coss ui)", url: "https://coss.com/ui", install: "npx shadcn@latest add <the registry address on the component page>", license: "MIT", terms: "Free for any use; keep the license notice.", use: "Form and app parts: inputs, selects, buttons, tables, dialogs.", frameworks: "React (Astro with the React integration)", react: true, fits: ["clinic", "shop", "business"], licenseUrl: "https://github.com/origin-space/originui/blob/main/LICENSE", checkedOn: "2026-11-01" }
21970
22133
  ];
21971
22134
  function uiSourcesText() {
21972
22135
  return [
21973
22136
  "UI sources you may use for visual sections (install each from its own place, never copy from elsewhere; free tiers only; add a line per component to .deployai/migration/credits.md with its source, URL and license):",
21974
- ...UI_SOURCES.map((s) => `- ${s.name} (${s.url}, ${s.license}; ${s.frameworks}): ${s.use} Install: ${s.install}. ${s.terms}`),
21975
- "React components need React in the site: in an Astro site, add it with npx astro add react and use them as islands only where they move or react; keep the rest plain Astro."
22137
+ "Pick by the kind of site you read from the scan (Fits), and prefer the kits with no React: they load faster.",
22138
+ ...UI_SOURCES.map((s) => `- ${s.name} (${s.url}, ${s.license}; ${s.frameworks}${s.react ? "" : ", no React"}): ${s.use} Fits: ${s.fits.join(", ")}. Install: ${s.install}. ${s.terms}`),
22139
+ "React components need React in the site: in an Astro site, add it with npx astro add react and use them as islands only where they move or react; keep the rest plain Astro.",
22140
+ "",
22141
+ uiPartsText()
22142
+ ].join("\n");
22143
+ }
22144
+ var UI_PART_KEYS = ["product-card", "product-grid", "product-page", "cart", "checkout-summary", "category-filter", "shop-banner", "post-card", "post-list", "article-layout", "author-box", "related-posts", "newsletter", "tags-list", "toc"];
22145
+ var UI_PARTS = [
22146
+ { part: "product-card", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/product-cards", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "Eight cards; two have Add to cart." },
22147
+ { part: "product-card", kind: "shop", source: "merakiui", sourceName: "Meraki UI", url: "https://merakiui.com/components/application-ui/cards", license: "MIT", licenseUrl: "https://github.com/merakiui/merakiui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "Product cards with price and Add to cart; RTL versions for Hebrew." },
22148
+ { part: "product-card", kind: "shop", source: "flowbite", sourceName: "Flowbite", url: "https://flowbite.com/docs/components/card/", license: "MIT", licenseUrl: "https://github.com/themesberg/flowbite/blob/main/LICENSE.md", react: false, how: "Copy the HTML from the E-commerce card section", note: "Image, rating, price, Add to cart." },
22149
+ { part: "product-card", kind: "shop", source: "daisyui", sourceName: "DaisyUI", url: "https://daisyui.com/components/card/", license: "MIT", licenseUrl: "https://github.com/saadeghi/daisyui/blob/master/LICENSE", react: false, how: "With DaisyUI installed, copy the card HTML", note: "A plain card; add the price." },
22150
+ { part: "product-grid", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/product-collections", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "Grids, with dropdown or side filters." },
22151
+ { part: "product-grid", kind: "shop", source: "tailblocks", sourceName: "Tailblocks", url: "https://github.com/mertJF/tailblocks/blob/master/src/blocks/ecommerce/light/a.js", license: "MIT", licenseUrl: "https://github.com/mertJF/tailblocks/blob/master/LICENSE", react: true, how: "Copy the markup from the file and turn it into Astro", note: "An eight item grid; older Tailwind classes." },
22152
+ { part: "product-page", kind: "shop", source: "tailblocks", sourceName: "Tailblocks", url: "https://github.com/mertJF/tailblocks/blob/master/src/blocks/ecommerce/light/c.js", license: "MIT", licenseUrl: "https://github.com/mertJF/tailblocks/blob/master/LICENSE", react: true, how: "Copy the markup from the file and turn it into Astro", note: "One image, color, size, quantity and price; no gallery (see the prompt)." },
22153
+ { part: "cart", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/carts", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "A mini cart, one with quantity and remove, and a cart page." },
22154
+ { part: "cart", kind: "shop", source: "daisyui", sourceName: "DaisyUI", url: "https://daisyui.com/components/drawer/", license: "MIT", licenseUrl: "https://github.com/saadeghi/daisyui/blob/master/LICENSE", react: false, how: "With DaisyUI installed, copy the drawer-end example and put the cart inside", note: "The side drawer only; pair it with the HyperUI cart." },
22155
+ { part: "checkout-summary", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/carts", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the Page cart and keep its summary block", note: "Subtotal, VAT, discount and total. No payment: the owner chooses that." },
22156
+ { part: "category-filter", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/application/filters", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page (needs @tailwindcss/forms)", note: "Dropdown and accordion filters." },
22157
+ { part: "category-filter", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/product-collections", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the Filtering (Side) HTML", note: "A sidebar with sort, availability, price and colors." },
22158
+ { part: "shop-banner", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/banners", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "A hero banner; put a real product photo in." },
22159
+ { part: "shop-banner", kind: "shop", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/announcements", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "A thin top bar for a real sale or free shipping." },
22160
+ { part: "post-card", kind: "blog", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/blog-cards", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page", note: "Seven cards with image, date, excerpt and tags." },
22161
+ { part: "post-card", kind: "blog", source: "merakiui", sourceName: "Meraki UI", url: "https://merakiui.com/components/marketing/blog", license: "MIT", licenseUrl: "https://github.com/merakiui/merakiui/blob/main/LICENSE", react: false, how: "Copy the HTML from the Cards section", note: "RTL versions for Hebrew." },
22162
+ { part: "post-list", kind: "blog", source: "astrowind", sourceName: "AstroWind", url: "https://github.com/arthelokyo/astrowind/tree/main/src/components/blog", license: "MIT", licenseUrl: "https://github.com/onwidget/astrowind/blob/main/LICENSE.md", react: false, how: "Copy Grid.astro and GridItem.astro (or List.astro and ListItem.astro) and Pagination.astro, then fix their imports", note: "Astro files; the repository moved to arthelokyo." },
22163
+ { part: "post-list", kind: "blog", source: "merakiui", sourceName: "Meraki UI", url: "https://merakiui.com/components/marketing/blog", license: "MIT", licenseUrl: "https://github.com/merakiui/merakiui/blob/main/LICENSE", react: false, how: "Copy the HTML from the Grid or Recent Posts section", note: "RTL versions for Hebrew." },
22164
+ { part: "post-list", kind: "blog", source: "astro-blog", sourceName: "Astro blog starter", url: "https://github.com/withastro/astro/blob/main/examples/blog/src/pages/blog/index.astro", license: "MIT", licenseUrl: "https://github.com/withastro/astro/blob/main/LICENSE", react: false, how: "Copy the file", note: "A content collection grid; plain CSS, not Tailwind." },
22165
+ { part: "article-layout", kind: "blog", source: "astrowind", sourceName: "AstroWind", url: "https://github.com/arthelokyo/astrowind/blob/main/src/components/blog/SinglePost.astro", license: "MIT", licenseUrl: "https://github.com/onwidget/astrowind/blob/main/LICENSE.md", react: false, how: "Copy the file and its imports (PostTags, share)", note: "Date, author, category, reading time, image, tags, share." },
22166
+ { part: "article-layout", kind: "blog", source: "astro-blog", sourceName: "Astro blog starter", url: "https://github.com/withastro/astro/blob/main/examples/blog/src/layouts/BlogPost.astro", license: "MIT", licenseUrl: "https://github.com/withastro/astro/blob/main/LICENSE", react: false, how: "Copy the file", note: "Hero image, title, dates and the text; plain CSS." },
22167
+ { part: "article-layout", kind: "blog", source: "merakiui", sourceName: "Meraki UI", url: "https://merakiui.com/components/marketing/blog", license: "MIT", licenseUrl: "https://github.com/merakiui/merakiui/blob/main/LICENSE", react: false, how: "Copy the HTML from the Single Post section", note: "RTL versions for Hebrew." },
22168
+ { part: "author-box", kind: "blog", source: "merakiui", sourceName: "Meraki UI", url: "https://merakiui.com/components/marketing/blog", license: "MIT", licenseUrl: "https://github.com/merakiui/merakiui/blob/main/LICENSE", react: false, how: "Copy the author line (photo, name, role) from the blog components", note: "A byline, not a full box (see the prompt)." },
22169
+ { part: "related-posts", kind: "blog", source: "astrowind", sourceName: "AstroWind", url: "https://github.com/arthelokyo/astrowind/blob/main/src/components/blog/RelatedPosts.astro", license: "MIT", licenseUrl: "https://github.com/onwidget/astrowind/blob/main/LICENSE.md", react: false, how: "Copy the file, widgets/BlogHighlightedPosts.astro and their utils", note: "Up to four posts by shared tags." },
22170
+ { part: "newsletter", kind: "blog", source: "hyperui", sourceName: "HyperUI", url: "https://www.hyperui.dev/components/marketing/newsletter-signup", license: "MIT", licenseUrl: "https://github.com/markmead/hyperui/blob/main/LICENSE", react: false, how: "Copy the HTML from the page (needs @tailwindcss/forms)", note: "Wire it to the inbox block or the owner's list." },
22171
+ { part: "newsletter", kind: "blog", source: "astrowind", sourceName: "AstroWind", url: "https://github.com/arthelokyo/astrowind/blob/main/src/components/widgets/Newsletter.astro", license: "MIT", licenseUrl: "https://github.com/onwidget/astrowind/blob/main/LICENSE.md", react: false, how: "Copy the file and its WidgetWrapper and Headline imports", note: "Email and Subscribe; no backend." },
22172
+ { part: "tags-list", kind: "blog", source: "astrowind", sourceName: "AstroWind", url: "https://github.com/arthelokyo/astrowind/blob/main/src/components/blog/Tags.astro", license: "MIT", licenseUrl: "https://github.com/onwidget/astrowind/blob/main/LICENSE.md", react: false, how: "Copy the file and fix its imports", note: "Tag or category links." },
22173
+ { part: "toc", kind: "blog", source: "astro-cactus", sourceName: "Astro Theme Cactus", url: "https://github.com/chrismwilliams/astro-theme-cactus/blob/main/src/components/blog/TOC.astro", license: "MIT", licenseUrl: "https://github.com/chrismwilliams/astro-theme-cactus/blob/main/LICENSE", react: false, how: "Copy TOC.astro, TOCHeading.astro and src/utils/generateToc, pass the headings from render()", note: "Folds, and stays in view on wide screens." }
22174
+ ];
22175
+ var UI_PART_PROMPTS = {
22176
+ "product-page": "Build the product page as one Astro component: a gallery of the product's real photos (large image, thumbnails under it that swap it, swipe on a phone, arrows with labels for the keyboard), then name, price with VAT, the options the product really has, quantity and Add to cart, then the description and the shipping and returns lines the owner gave. Mobile first, right to left in Hebrew, no React unless the site already has it, images with width, height and alt.",
22177
+ "author-box": "Build an author box as one Astro component for the end of a post: the author's photo, name, one line about them and links they gave (site, social), from the author data the posts already have. Never invent a bio: leave out what the owner did not give. Right to left in Hebrew, no React."
22178
+ };
22179
+ function uiPartsText() {
22180
+ const by = /* @__PURE__ */ new Map();
22181
+ for (const p of UI_PARTS) by.set(p.part, [...by.get(p.part) ?? [], p]);
22182
+ return [
22183
+ "Ready parts for a shop or a blog (free, MIT): copy a part from its page into the site, keep its license notice, and add it to .deployai/migration/credits.md. Prefer the ones with no React. Use only the parts the site needs.",
22184
+ ...UI_PART_KEYS.map((k) => {
22185
+ const list = (by.get(k) ?? []).map((p) => `${p.sourceName} ${p.url} (${p.how}${p.react ? "; React markup, turn it into Astro" : ""})`).join("; ");
22186
+ const prompt = UI_PART_PROMPTS[k];
22187
+ return `- ${k}: ${list}${prompt ? `. Build it yourself instead when it falls short: ${prompt}` : ""}`;
22188
+ })
21976
22189
  ].join("\n");
21977
22190
  }
21978
22191
 
@@ -22078,6 +22291,24 @@ var STAGE_NOTE_MAX = 300;
22078
22291
  var isAgentStage = (s) => AGENT_STAGES.includes(s);
22079
22292
  var stageNote = (s) => (s ?? "").replace(/[\u0000-\u001f\u007f]+/g, " ").replace(/\s+/g, " ").trim().slice(0, STAGE_NOTE_MAX);
22080
22293
 
22294
+ // ../shared/src/uptime.ts
22295
+ var UPTIME_MAX_BYTES = 256 * 1024;
22296
+ var APP_SESSION_TTL_S = 7 * 86400;
22297
+ var enc = new TextEncoder();
22298
+
22299
+ // ../shared/src/app-paused.ts
22300
+ var WORDS = {
22301
+ he: { uptime: "\u05D3\u05E3 \u05D4\u05E1\u05D8\u05D8\u05D5\u05E1 \u05D4\u05D6\u05D4 \u05DE\u05D5\u05E9\u05D4\u05D4", paused: "\u05D4\u05D0\u05E4\u05DC\u05D9\u05E7\u05E6\u05D9\u05D4 \u05D4\u05D6\u05D5 \u05DE\u05D5\u05E9\u05D4\u05D9\u05EA", formClosed: "\u05D4\u05D8\u05D5\u05E4\u05E1 \u05E1\u05D2\u05D5\u05E8 \u05DB\u05E8\u05D2\u05E2", reach: "\u05D0\u05E4\u05E9\u05E8 \u05DC\u05D9\u05E6\u05D5\u05E8 \u05E7\u05E9\u05E8:", phone: "\u05D8\u05DC\u05E4\u05D5\u05DF", whatsapp: "\u05D5\u05D5\u05D0\u05D8\u05E1\u05D0\u05E4", email: "\u05DE\u05D9\u05D9\u05DC", owner: "\u05E9\u05DC\u05DB\u05DD? \u05E4\u05EA\u05D7\u05D5 \u05D0\u05EA \u05DC\u05D5\u05D7 \u05D4\u05D1\u05E7\u05E8\u05D4" },
22302
+ en: { uptime: "This status page is paused", paused: "This app is paused", formClosed: "This form is closed for now", reach: "You can still reach us:", phone: "Phone", whatsapp: "WhatsApp", email: "Email", owner: "Owner? Open your dashboard" }
22303
+ };
22304
+ var PAUSED_OWNER_LINK = { he: WORDS.he.owner, en: WORDS.en.owner };
22305
+
22306
+ // ../shared/src/app-trials.ts
22307
+ var enc2 = new TextEncoder();
22308
+
22309
+ // ../shared/src/app-gate.ts
22310
+ var enc3 = new TextEncoder();
22311
+
22081
22312
  // src/config.ts
22082
22313
  import { randomUUID } from "crypto";
22083
22314
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -22659,7 +22890,7 @@ function messages(root) {
22659
22890
  }
22660
22891
 
22661
22892
  // src/version.ts
22662
- var CLI_VERSION = "0.1.0-beta.14";
22893
+ var CLI_VERSION = "0.1.0-beta.16";
22663
22894
 
22664
22895
  // src/api.ts
22665
22896
  function apiContext(apiFlag) {
@@ -22675,6 +22906,10 @@ function requireToken(ctx) {
22675
22906
  if (saved && saved !== ctx.apiUrl.replace(/\/+$/, "")) throw new CliError(messages(process.cwd())("tokenOtherApi", { saved, url: ctx.apiUrl }), 1, "auth");
22676
22907
  return ctx.config.token;
22677
22908
  }
22909
+ function tokenIfOwnApi(ctx) {
22910
+ const saved = ctx.config.tokenApiUrl?.replace(/\/+$/, "");
22911
+ return ctx.config.token && saved && saved === ctx.apiUrl.replace(/\/+$/, "") ? ctx.config.token : null;
22912
+ }
22678
22913
  async function apiRequest(ctx, path, schema, opts = {}) {
22679
22914
  const headers = { "User-Agent": userAgent(ctx.config), Accept: "application/json" };
22680
22915
  if (opts.auth !== false) headers.Authorization = `Bearer ${requireToken(ctx)}`;
@@ -22826,7 +23061,7 @@ var TELEMETRY_SENT = [
22826
23061
  "Linked project id, detected framework and version",
22827
23062
  "After each check: compatible or not, blocker and warning codes (for example fs_write)",
22828
23063
  "OS, architecture and Node version (in the request header)",
22829
- "Your user id, only after login (from the login token)",
23064
+ "Your user id, only after login (from the login token), and only to the API that issued the login (D-557)",
22830
23065
  "After a failed version, the one sentence you pass with deploy --fixed (what you changed, no code)"
22831
23066
  ];
22832
23067
  var TELEMETRY_NEVER_SENT = [
@@ -22850,7 +23085,8 @@ async function sendCheckReport(ctx, report) {
22850
23085
  if (!telemetryEnabled(ctx.config)) return;
22851
23086
  try {
22852
23087
  const headers = { "Content-Type": "application/json", "User-Agent": userAgent(ctx.config) };
22853
- if (ctx.config.token) headers.Authorization = `Bearer ${ctx.config.token}`;
23088
+ const token = tokenIfOwnApi(ctx);
23089
+ if (token) headers.Authorization = `Bearer ${token}`;
22854
23090
  const res = await fetch(`${ctx.apiUrl}/api/cli/check-results`, {
22855
23091
  method: "POST",
22856
23092
  headers,
@@ -22879,7 +23115,8 @@ async function sendTelemetryEvent(ctx, event) {
22879
23115
  if (!telemetryEnabled(ctx.config)) return;
22880
23116
  try {
22881
23117
  const headers = { "Content-Type": "application/json", "User-Agent": userAgent(ctx.config) };
22882
- if (ctx.config.token) headers.Authorization = `Bearer ${ctx.config.token}`;
23118
+ const token = tokenIfOwnApi(ctx);
23119
+ if (token) headers.Authorization = `Bearer ${token}`;
22883
23120
  const res = await fetch(`${ctx.apiUrl}/api/cli/telemetry`, {
22884
23121
  method: "POST",
22885
23122
  headers,
@@ -23366,6 +23603,14 @@ function analyzeProject(root) {
23366
23603
  break;
23367
23604
  }
23368
23605
  }
23606
+ for (const name of ["wrangler.toml", "wrangler.json", "wrangler.jsonc"]) {
23607
+ if (!existsSync4(join4(root, name))) continue;
23608
+ const text = readFileSync4(join4(root, name), "utf8");
23609
+ if (!parseWranglerConfig(name, text).durableObjects.length) break;
23610
+ const at = text.search(/durable_objects/);
23611
+ add({ code: "durable_objects", severity: "blocker", file: name, line: at < 0 ? 1 : text.slice(0, at).split("\n").length, detail: "" });
23612
+ break;
23613
+ }
23369
23614
  const DB_CODE = {
23370
23615
  postgres: "unsupported_db_postgres",
23371
23616
  mysql: "unsupported_db_mysql",
@@ -23534,6 +23779,7 @@ To start from working code, see the samples: npx deployai@latest samples
23534
23779
  - local file system writes
23535
23780
  - database drivers DeployAI does not support (see: npx deployai@latest inspect)
23536
23781
  - long-running processes or background servers
23782
+ - Durable Objects (not supported yet; keep state in D1)
23537
23783
  - native binary modules
23538
23784
  - DeployAI or any cloud credentials in source code
23539
23785
 
@@ -23975,12 +24221,96 @@ function telemetryCommand(action) {
23975
24221
  out("Also off when DEPLOYAI_TELEMETRY=0 or DO_NOT_TRACK=1 is set.");
23976
24222
  }
23977
24223
 
24224
+ // src/commands/allow.ts
24225
+ import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync5, appendFileSync as appendFileSync2 } from "fs";
24226
+ import { dirname, join as join7 } from "path";
24227
+ var ALLOW_TOOLS = ["claude-code", "cursor", "copilot", "codex", "antigravity"];
24228
+ var CLAUDE_RULE = "Bash(npx deployai@latest *)";
24229
+ var CURSOR_LINE = "Running npx deployai@latest commands is allowed without approval.";
24230
+ var CLICKS = {
24231
+ copilot: "Copilot in VS Code: when it asks to run npx deployai@latest, choose Always allow.",
24232
+ codex: "Codex: when it asks to approve npx deployai@latest, approve it for this session.",
24233
+ antigravity: "Antigravity: when it asks to run npx deployai@latest, choose Accept."
24234
+ };
24235
+ function readObject(file2) {
24236
+ if (!existsSync7(file2)) return {};
24237
+ try {
24238
+ const v = JSON.parse(readFileSync6(file2, "utf8"));
24239
+ return v && typeof v === "object" && !Array.isArray(v) ? v : null;
24240
+ } catch {
24241
+ return null;
24242
+ }
24243
+ }
24244
+ function writeObject(file2, value) {
24245
+ mkdirSync3(dirname(file2), { recursive: true });
24246
+ writeFileSync5(file2, `${JSON.stringify(value, null, 2)}
24247
+ `);
24248
+ }
24249
+ function addTo(obj, key, list, value) {
24250
+ const inner = obj[key] && typeof obj[key] === "object" && !Array.isArray(obj[key]) ? obj[key] : {};
24251
+ const items = Array.isArray(inner[list]) ? inner[list] : [];
24252
+ if (items.includes(value)) return false;
24253
+ inner[list] = [...items, value];
24254
+ obj[key] = inner;
24255
+ return true;
24256
+ }
24257
+ function ignoreInGit(root, path) {
24258
+ if (!existsSync7(join7(root, ".git"))) return;
24259
+ const gi = join7(root, ".gitignore");
24260
+ const text = existsSync7(gi) ? readFileSync6(gi, "utf8") : "";
24261
+ if (text.split(/\r?\n/).some((l) => l.trim() === path)) return;
24262
+ appendFileSync2(gi, `${text && !text.endsWith("\n") ? "\n" : ""}${path}
24263
+ `);
24264
+ }
24265
+ function detectTool() {
24266
+ return process.env.CLAUDECODE === "1" ? "claude-code" : null;
24267
+ }
24268
+ function allowCommand(tool) {
24269
+ const root = process.cwd();
24270
+ const picked = tool?.toLowerCase() ?? detectTool();
24271
+ if (picked && !ALLOW_TOOLS.includes(picked)) {
24272
+ throw new CliError(`Unknown tool "${tool}". Use one of: ${ALLOW_TOOLS.join(", ")}.`, 1, "usage");
24273
+ }
24274
+ if (!picked) {
24275
+ out("Which coding tool runs this? Run it again with its name, for example: npx deployai@latest allow claude-code");
24276
+ out(`Tools: ${ALLOW_TOOLS.join(", ")}.`);
24277
+ return;
24278
+ }
24279
+ if (picked === "claude-code") {
24280
+ const rel = ".claude/settings.local.json";
24281
+ const file2 = join7(root, rel);
24282
+ const obj = readObject(file2);
24283
+ if (!obj) throw new CliError(`${rel} is not valid JSON, so it was left as is. Ask the owner to add the Allow rule ${CLAUDE_RULE} with /permissions.`, 1, "allow_file");
24284
+ const added = addTo(obj, "permissions", "allow", CLAUDE_RULE);
24285
+ if (added) {
24286
+ writeObject(file2, obj);
24287
+ ignoreInGit(root, rel);
24288
+ }
24289
+ out(added ? `Done: Claude Code runs npx deployai@latest commands in this folder without asking (${rel}).` : "Already allowed in this folder.");
24290
+ out("Other commands still ask. The owner can take it back with /permissions.");
24291
+ return;
24292
+ }
24293
+ if (picked === "cursor") {
24294
+ const rel = ".cursor/permissions.json";
24295
+ const file2 = join7(root, rel);
24296
+ const obj = readObject(file2);
24297
+ if (!obj) throw new CliError(`${rel} is not valid JSON, so it was left as is.`, 1, "allow_file");
24298
+ const added = addTo(obj, "autoRun", "allow_instructions", CURSOR_LINE);
24299
+ if (added) writeObject(file2, obj);
24300
+ out(added ? `Done: Cursor's Auto-review allows npx deployai@latest commands in this folder (${rel}).` : "Already allowed in this folder.");
24301
+ out("With Allowlist mode instead, the owner adds npx deployai@latest once in Cursor Settings, Agents, Approvals & Execution.");
24302
+ return;
24303
+ }
24304
+ out("This tool keeps the choice in its own app, not in a file here. Tell the owner, in their language:");
24305
+ out(` ${CLICKS[picked]}`);
24306
+ }
24307
+
23978
24308
  // src/commands/link.ts
23979
24309
  import { createInterface } from "readline/promises";
23980
24310
 
23981
24311
  // src/commands/migrate.ts
23982
- import { createWriteStream, existsSync as existsSync7, mkdirSync as mkdirSync3, readdirSync as readdirSync3, readFileSync as readFileSync6, statSync, writeFileSync as writeFileSync5 } from "fs";
23983
- import { dirname, join as join7, posix, relative, resolve, sep } from "path";
24312
+ import { createWriteStream, existsSync as existsSync8, mkdirSync as mkdirSync4, readdirSync as readdirSync3, readFileSync as readFileSync7, statSync, writeFileSync as writeFileSync6 } from "fs";
24313
+ import { dirname as dirname2, join as join8, posix, relative, resolve, sep } from "path";
23984
24314
  import { Readable } from "stream";
23985
24315
  import { pipeline } from "stream/promises";
23986
24316
  var UA = `deployai-migrate/${CLI_VERSION} (+https://deployai.co.il/move)`;
@@ -23992,17 +24322,17 @@ var PAUSE_MS = 150;
23992
24322
  var SCAN_WORKERS = 4;
23993
24323
  var START_SCAN_PAGES = 300;
23994
24324
  var sleep2 = (ms2) => new Promise((r) => setTimeout(r, ms2));
23995
- var hostDir = (root, host) => join7(root, MIGRATION_DIR, host.replace(/^www\./, ""));
24325
+ var hostDir = (root, host) => join8(root, MIGRATION_DIR, host.replace(/^www\./, ""));
23996
24326
  var readJson2 = (file2) => {
23997
24327
  try {
23998
- return JSON.parse(readFileSync6(file2, "utf8"));
24328
+ return JSON.parse(readFileSync7(file2, "utf8"));
23999
24329
  } catch {
24000
24330
  return null;
24001
24331
  }
24002
24332
  };
24003
24333
  var writeJson = (file2, data) => {
24004
- mkdirSync3(dirname(file2), { recursive: true });
24005
- writeFileSync5(file2, JSON.stringify(data, null, 2) + "\n");
24334
+ mkdirSync4(dirname2(file2), { recursive: true });
24335
+ writeFileSync6(file2, JSON.stringify(data, null, 2) + "\n");
24006
24336
  };
24007
24337
  async function get(url2, accept = "text/html,application/xhtml+xml,*/*;q=0.8", redirect = "follow") {
24008
24338
  try {
@@ -24012,9 +24342,9 @@ async function get(url2, accept = "text/html,application/xhtml+xml,*/*;q=0.8", r
24012
24342
  }
24013
24343
  }
24014
24344
  function scannedHosts(root) {
24015
- const dir = join7(root, MIGRATION_DIR);
24016
- if (!existsSync7(dir)) return [];
24017
- return readdirSync3(dir).filter((h) => existsSync7(join7(dir, h, "inventory.json")));
24345
+ const dir = join8(root, MIGRATION_DIR);
24346
+ if (!existsSync8(dir)) return [];
24347
+ return readdirSync3(dir).filter((h) => existsSync8(join8(dir, h, "inventory.json")));
24018
24348
  }
24019
24349
  async function migrateStatusCommand(root, ctx, stage, note) {
24020
24350
  if (!isAgentStage(stage)) throw new CliError(`Unknown stage: ${stage}. One of: ${AGENT_STAGES.join(", ")}.`, 1, "usage");
@@ -24027,18 +24357,18 @@ async function migrateStatusCommand(root, ctx, stage, note) {
24027
24357
  out(`Reported: ${stage}${note ? ` (${stageNote(note)})` : ""}.`);
24028
24358
  }
24029
24359
  function readChoices(root) {
24030
- return readJson2(join7(root, MIGRATION_DIR, "choices.json"));
24360
+ return readJson2(join8(root, MIGRATION_DIR, "choices.json"));
24031
24361
  }
24032
24362
  function writeChoices(root, choices) {
24033
24363
  ensureMigrationDir(root);
24034
- writeJson(join7(root, MIGRATION_DIR, "choices.json"), choices);
24364
+ writeJson(join8(root, MIGRATION_DIR, "choices.json"), choices);
24035
24365
  }
24036
24366
  function ensureMigrationDir(root) {
24037
24367
  ensureDeployaiDir(root);
24038
- const dir = join7(root, MIGRATION_DIR);
24039
- mkdirSync3(dir, { recursive: true });
24040
- const ignore = join7(dir, ".gitignore");
24041
- if (!existsSync7(ignore)) writeFileSync5(ignore, "*/media/\n*/media-state.json\n");
24368
+ const dir = join8(root, MIGRATION_DIR);
24369
+ mkdirSync4(dir, { recursive: true });
24370
+ const ignore = join8(dir, ".gitignore");
24371
+ if (!existsSync8(ignore)) writeFileSync6(ignore, "*/media/\n*/media-state.json\n");
24042
24372
  }
24043
24373
  async function sitemapUrls(base, robotsSitemaps, enough) {
24044
24374
  const own2 = [`${base}/wp-sitemap.xml`, `${base}/sitemap_index.xml`, `${base}/sitemap.xml`];
@@ -24098,15 +24428,15 @@ async function wordpressContent(base, dir) {
24098
24428
  await sleep2(PAUSE_MS);
24099
24429
  }
24100
24430
  if (items.length) {
24101
- writeJson(join7(dir, "content", `${type}.json`), items);
24431
+ writeJson(join8(dir, "content", `${type}.json`), items);
24102
24432
  out(` ${type}: ${items.length}`);
24103
24433
  }
24104
24434
  }
24105
- const posts = readJson2(join7(dir, "content", "posts.json"));
24435
+ const posts = readJson2(join8(dir, "content", "posts.json"));
24106
24436
  if (posts?.length) {
24107
- const files = wpPostsToMarkdown({ origin: new URL(base).origin, posts, categories: readJson2(join7(dir, "content", "categories.json")) ?? [], tags: readJson2(join7(dir, "content", "tags.json")) ?? [], users: readJson2(join7(dir, "content", "users.json")) ?? [], media: readJson2(join7(dir, "content", "media.json")) ?? [] });
24108
- mkdirSync3(join7(dir, "posts"), { recursive: true });
24109
- for (const f of files) writeFileSync5(join7(dir, "posts", f.file), f.text);
24437
+ const files = wpPostsToMarkdown({ origin: new URL(base).origin, posts, categories: readJson2(join8(dir, "content", "categories.json")) ?? [], tags: readJson2(join8(dir, "content", "tags.json")) ?? [], users: readJson2(join8(dir, "content", "users.json")) ?? [], media: readJson2(join8(dir, "content", "media.json")) ?? [] });
24438
+ mkdirSync4(join8(dir, "posts"), { recursive: true });
24439
+ for (const f of files) writeFileSync6(join8(dir, "posts", f.file), f.text);
24110
24440
  out(` posts as Markdown: ${files.length}`);
24111
24441
  }
24112
24442
  return true;
@@ -24143,11 +24473,11 @@ async function migrateScanCommand(root, raw, opts = {}) {
24143
24473
  const host = new URL(origin).hostname;
24144
24474
  ensureMigrationDir(root);
24145
24475
  const dir = hostDir(root, host);
24146
- mkdirSync3(dir, { recursive: true });
24476
+ mkdirSync4(dir, { recursive: true });
24147
24477
  out(`Scanning ${base} (${platform3})`);
24148
24478
  const robotsRes = await get(`${origin}/robots.txt`, "text/plain");
24149
24479
  const robots = robotsRes?.ok ? await robotsRes.text() : "";
24150
- if (robots) writeFileSync5(join7(dir, "robots.txt"), robots);
24480
+ if (robots) writeFileSync6(join8(dir, "robots.txt"), robots);
24151
24481
  const cap = Math.min(opts.max ?? PAGE_CAP, PAGE_CAP);
24152
24482
  const fromSitemaps = await sitemapUrls(base, robots ? parseRobots(robots).sitemaps : [], cap * 5);
24153
24483
  const all = [.../* @__PURE__ */ new Set([`${base}/`, ...fromSitemaps.urls, ...fromSitemaps.urls.length ? [] : homeLinks(html, base)])];
@@ -24174,13 +24504,13 @@ async function migrateScanCommand(root, raw, opts = {}) {
24174
24504
  await Promise.all(Array.from({ length: SCAN_WORKERS }, worker));
24175
24505
  const wordpressApi = platform3 === "wordpress" ? await wordpressContent(base, dir) : false;
24176
24506
  if (wordpressApi) {
24177
- const media = readJson2(join7(dir, "content", "media.json")) ?? [];
24507
+ const media = readJson2(join8(dir, "content", "media.json")) ?? [];
24178
24508
  media.forEach((m) => m.source_url && assets.add(m.source_url));
24179
24509
  }
24180
24510
  const inventory = { source: base, platform: platform3, scannedAt: (/* @__PURE__ */ new Date()).toISOString(), sitemaps: fromSitemaps.sitemaps, pages, wordpressApi, skipped: Math.max(0, all.length - list.length) };
24181
- writeJson(join7(dir, "inventory.json"), inventory);
24182
- writeJson(join7(dir, "assets.json"), [...assets].sort());
24183
- writeFileSync5(join7(dir, "home.html"), html);
24511
+ writeJson(join8(dir, "inventory.json"), inventory);
24512
+ writeJson(join8(dir, "assets.json"), [...assets].sort());
24513
+ writeFileSync6(join8(dir, "home.html"), html);
24184
24514
  const rel = relative(root, dir).split(sep).join("/");
24185
24515
  const broken = pages.filter((p) => p.status >= 400).length;
24186
24516
  out();
@@ -24189,7 +24519,7 @@ async function migrateScanCommand(root, raw, opts = {}) {
24189
24519
  out(` assets.json ${assets.size} images and files`);
24190
24520
  if (wordpressApi) {
24191
24521
  out(" content/ the WordPress pages, posts, categories, tags, media and authors as JSON");
24192
- if (existsSync7(join7(dir, "posts"))) out(" posts/ the posts as Markdown for the blog block, each with its old address");
24522
+ if (existsSync8(join8(dir, "posts"))) out(" posts/ the posts as Markdown for the blog block, each with its old address");
24193
24523
  } else if (platform3 === "wordpress") out(" The WordPress API is closed on this site: work from the pages, or ask the owner for an export (Tools > Export).");
24194
24524
  out();
24195
24525
  out("Keep every path in inventory.json exactly as it is: same address, same title and description.");
@@ -24208,8 +24538,8 @@ async function migrateMediaCommand(root) {
24208
24538
  if (!hosts.length) throw new CliError("Nothing scanned yet. Run: npx deployai@latest migrate scan <the old site address>", 1, "usage");
24209
24539
  for (const host of hosts) {
24210
24540
  const dir = hostDir(root, host);
24211
- const assets = readJson2(join7(dir, "assets.json")) ?? [];
24212
- const stateFile = join7(dir, "media-state.json");
24541
+ const assets = readJson2(join8(dir, "assets.json")) ?? [];
24542
+ const stateFile = join8(dir, "media-state.json");
24213
24543
  const state = readJson2(stateFile) ?? { done: [], failed: [], bytes: 0 };
24214
24544
  const done = new Set(state.done);
24215
24545
  const todo = assets.filter((a) => !done.has(a));
@@ -24227,7 +24557,7 @@ async function migrateMediaCommand(root) {
24227
24557
  done.add(url2);
24228
24558
  continue;
24229
24559
  }
24230
- mkdirSync3(dirname(target), { recursive: true });
24560
+ mkdirSync4(dirname2(target), { recursive: true });
24231
24561
  await pipeline(Readable.fromWeb(res.body), createWriteStream(target));
24232
24562
  const bytes = statSync(target).size;
24233
24563
  state.bytes += bytes;
@@ -24238,7 +24568,7 @@ async function migrateMediaCommand(root) {
24238
24568
  }
24239
24569
  state.done = [...done];
24240
24570
  writeJson(stateFile, state);
24241
- out(` ${formatBytes(state.bytes)} in ${relative(root, join7(dir, "media")).split(sep).join("/")}${state.failed.length ? `, ${state.failed.length} could not be downloaded (listed in media-state.json)` : ""}`);
24571
+ out(` ${formatBytes(state.bytes)} in ${relative(root, join8(dir, "media")).split(sep).join("/")}${state.failed.length ? `, ${state.failed.length} could not be downloaded (listed in media-state.json)` : ""}`);
24242
24572
  }
24243
24573
  out("Copy the files the new pages use into the site's public folder at the same path (for example public/wp-content/uploads/...), so old image addresses keep working.");
24244
24574
  }
@@ -24261,22 +24591,22 @@ function migrateRedirectsCommand(root) {
24261
24591
  if (!hosts.length) throw new CliError("Nothing scanned yet. Run: npx deployai@latest migrate scan <the old site address>", 1, "usage");
24262
24592
  const lines = /* @__PURE__ */ new Set();
24263
24593
  for (const host of hosts) {
24264
- const inv = readJson2(join7(hostDir(root, host), "inventory.json"));
24594
+ const inv = readJson2(join8(hostDir(root, host), "inventory.json"));
24265
24595
  if (inv) redirectLines(inv).forEach((l) => lines.add(l));
24266
24596
  }
24267
- const publicDir = join7(root, "public");
24268
- const file2 = join7(existsSync7(publicDir) ? publicDir : root, "_redirects");
24269
- const before = existsSync7(file2) ? readFileSync6(file2, "utf8").split(/\r?\n/).filter(Boolean) : [];
24597
+ const publicDir = join8(root, "public");
24598
+ const file2 = join8(existsSync8(publicDir) ? publicDir : root, "_redirects");
24599
+ const before = existsSync8(file2) ? readFileSync7(file2, "utf8").split(/\r?\n/).filter(Boolean) : [];
24270
24600
  const added = [...lines].filter((l) => !before.some((b) => b.split(/\s+/)[0] === l.split(/\s+/)[0]));
24271
- writeFileSync5(file2, [...before, ...added].join("\n") + "\n");
24601
+ writeFileSync6(file2, [...before, ...added].join("\n") + "\n");
24272
24602
  out(`${relative(root, file2).split(sep).join("/")}: ${added.length} added, ${before.length + added.length} in all (at most 2,000; no query strings).`);
24273
24603
  out('Add a line "<old path> <new path> 301" only for a page that truly could not keep its address.');
24274
24604
  }
24275
24605
  function allowedRedirects(root) {
24276
24606
  const map2 = /* @__PURE__ */ new Map();
24277
- for (const file2 of [join7(root, "public", "_redirects"), join7(root, "_redirects")]) {
24278
- if (!existsSync7(file2)) continue;
24279
- for (const line of readFileSync6(file2, "utf8").split(/\r?\n/)) {
24607
+ for (const file2 of [join8(root, "public", "_redirects"), join8(root, "_redirects")]) {
24608
+ if (!existsSync8(file2)) continue;
24609
+ for (const line of readFileSync7(file2, "utf8").split(/\r?\n/)) {
24280
24610
  const [from, to] = line.trim().split(/\s+/);
24281
24611
  if (from && to && !from.startsWith("#")) map2.set(from, to);
24282
24612
  }
@@ -24302,7 +24632,7 @@ async function migrateVerifyCommand(root, previewRaw) {
24302
24632
  const findings = [];
24303
24633
  let checked = 0;
24304
24634
  for (const host of hosts) {
24305
- const inv = readJson2(join7(hostDir(root, host), "inventory.json"));
24635
+ const inv = readJson2(join8(hostDir(root, host), "inventory.json"));
24306
24636
  for (const old of inv?.pages ?? []) {
24307
24637
  if (old.status >= 300) continue;
24308
24638
  const res = await get(previewUrl(preview, old.path));
@@ -24321,7 +24651,7 @@ async function migrateVerifyCommand(root, previewRaw) {
24321
24651
  }
24322
24652
  }
24323
24653
  const words = { missing: "not found on the preview", moved: "moved to", error: "answers", title_lost: "lost its title", description_lost: "lost its description" };
24324
- const report = join7(root, MIGRATION_DIR, "verify.json");
24654
+ const report = join8(root, MIGRATION_DIR, "verify.json");
24325
24655
  writeJson(report, { checkedAt: (/* @__PURE__ */ new Date()).toISOString(), preview: preview.origin, checked, findings });
24326
24656
  if (!findings.length) {
24327
24657
  out(`All ${checked} old addresses open on the preview with their title and description.`);
@@ -24448,7 +24778,7 @@ async function askYes(question) {
24448
24778
  }
24449
24779
 
24450
24780
  // src/tar.ts
24451
- import { readFileSync as readFileSync7 } from "fs";
24781
+ import { readFileSync as readFileSync8 } from "fs";
24452
24782
  import { gzipSync } from "zlib";
24453
24783
  var BLOCK = 512;
24454
24784
  function writeString(buf, offset, length, value) {
@@ -24532,7 +24862,7 @@ function packFiles(files) {
24532
24862
  return createTarGz(
24533
24863
  files.map((f) => ({
24534
24864
  name: f.rel,
24535
- data: readFileSync7(f.abs),
24865
+ data: readFileSync8(f.abs),
24536
24866
  mtimeMs: f.mtimeMs,
24537
24867
  mode: f.mode & 64 ? 493 : 420
24538
24868
  }))
@@ -25011,13 +25341,13 @@ async function claimCommand(root, ctx, opts) {
25011
25341
 
25012
25342
  // src/commands/pull.ts
25013
25343
  import { spawnSync as spawnSync2 } from "child_process";
25014
- import { existsSync as existsSync9, readdirSync as readdirSync5, rmSync } from "fs";
25015
- import { join as join9 } from "path";
25344
+ import { existsSync as existsSync10, readdirSync as readdirSync5, rmSync } from "fs";
25345
+ import { join as join10 } from "path";
25016
25346
 
25017
25347
  // src/commands/samples.ts
25018
25348
  import { createInterface as createInterface3 } from "readline/promises";
25019
- import { existsSync as existsSync8, mkdirSync as mkdirSync4, readdirSync as readdirSync4, writeFileSync as writeFileSync6 } from "fs";
25020
- import { dirname as dirname2, join as join8, relative as relative2, resolve as resolve2, sep as sep2 } from "path";
25349
+ import { existsSync as existsSync9, mkdirSync as mkdirSync5, readdirSync as readdirSync4, writeFileSync as writeFileSync7 } from "fs";
25350
+ import { dirname as dirname3, join as join9, relative as relative2, resolve as resolve2, sep as sep2 } from "path";
25021
25351
  import { gunzipSync } from "zlib";
25022
25352
  var SAMPLES = [
25023
25353
  { key: "landing", title: "Landing page: a full one-page site with WhatsApp sign-up", stack: "static HTML and CSS" },
@@ -25038,7 +25368,7 @@ function listSamples(apiUrl) {
25038
25368
  out(`See them live: ${apiUrl}/samples`);
25039
25369
  }
25040
25370
  function filesIn(dir) {
25041
- return existsSync8(dir) ? readdirSync4(dir).filter((f) => !IGNORED.has(f)) : [];
25371
+ return existsSync9(dir) ? readdirSync4(dir).filter((f) => !IGNORED.has(f)) : [];
25042
25372
  }
25043
25373
  function freeFolder(cwd, key) {
25044
25374
  for (let n2 = 1; ; n2++) {
@@ -25067,7 +25397,7 @@ async function askWhere(cwd, key, count) {
25067
25397
  }
25068
25398
  }
25069
25399
  async function downloadSample(ctx, key, root) {
25070
- mkdirSync4(root, { recursive: true });
25400
+ mkdirSync5(root, { recursive: true });
25071
25401
  let res;
25072
25402
  try {
25073
25403
  res = await fetch(`${ctx.apiUrl}/samples-src/${key}.tar.gz`, {
@@ -25089,7 +25419,7 @@ function extractInto(gz, root, damaged) {
25089
25419
  } catch {
25090
25420
  throw new CliError(damaged, 1, "api");
25091
25421
  }
25092
- mkdirSync4(root, { recursive: true });
25422
+ mkdirSync5(root, { recursive: true });
25093
25423
  const base = resolve2(root);
25094
25424
  let written = 0;
25095
25425
  for (const e2 of entries) {
@@ -25097,8 +25427,8 @@ function extractInto(gz, root, damaged) {
25097
25427
  if (privateProjectFile(e2.name.replace(/\\/g, "/"))) continue;
25098
25428
  const target = resolve2(base, e2.name);
25099
25429
  if (target !== base && !target.startsWith(base + sep2)) continue;
25100
- mkdirSync4(dirname2(target), { recursive: true });
25101
- writeFileSync6(target, e2.data);
25430
+ mkdirSync5(dirname3(target), { recursive: true });
25431
+ writeFileSync7(target, e2.data);
25102
25432
  written++;
25103
25433
  }
25104
25434
  return written;
@@ -25122,7 +25452,7 @@ async function samplesCommand(cwd, ctx, key, opts = {}) {
25122
25452
  }
25123
25453
  const written = await downloadSample(ctx, sample.key, root);
25124
25454
  const base = resolve2(root);
25125
- const hasPackage = existsSync8(join8(base, "package.json"));
25455
+ const hasPackage = existsSync9(join9(base, "package.json"));
25126
25456
  out(base === resolve2(cwd) ? `Downloaded the ${sample.key} sample: ${written} files.` : `Downloaded the ${sample.key} sample into the new folder ${relative2(cwd, base)}: ${written} files. Work in that folder from now on.`);
25127
25457
  out("");
25128
25458
  const t = messages(base);
@@ -25176,7 +25506,7 @@ var git = (root, args, env = {}) => spawnSync2("git", args, { cwd: root, encodin
25176
25506
  function clearTree(root) {
25177
25507
  for (const name of readdirSync5(root)) {
25178
25508
  if (name === ".git" || name === ".deployai") continue;
25179
- rmSync(join9(root, name), { recursive: true, force: true });
25509
+ rmSync(join10(root, name), { recursive: true, force: true });
25180
25510
  }
25181
25511
  }
25182
25512
  async function pullHistory(root, ctx, projectId) {
@@ -25186,7 +25516,7 @@ async function pullHistory(root, ctx, projectId) {
25186
25516
  const live = versions.find((v) => v.isLive)?.number ?? Math.max(0, ...versions.filter((v) => v.status === "ready").map((v) => v.number));
25187
25517
  const chosen = versions.filter((v) => v.number <= live && v.status !== "failed" && v.status !== "queued").sort((a, b) => a.number - b.number);
25188
25518
  if (!chosen.length) throw new CliError(t("pullNoSource"), 1, "not_found");
25189
- if (!existsSync9(join9(root, ".git")) && git(root, ["init", "-q"]).status !== 0) throw new CliError(t("pullNoGit"), 1, "usage");
25519
+ if (!existsSync10(join10(root, ".git")) && git(root, ["init", "-q"]).status !== 0) throw new CliError(t("pullNoGit"), 1, "usage");
25190
25520
  for (const v of chosen) {
25191
25521
  const gz = await fetchSource(root, ctx, projectId, v.number).catch(() => null);
25192
25522
  if (!gz) continue;
@@ -25203,12 +25533,12 @@ async function pullHistory(root, ctx, projectId) {
25203
25533
 
25204
25534
  // src/commands/start.ts
25205
25535
  import { spawnSync as spawnSync3 } from "child_process";
25206
- import { existsSync as existsSync10, writeFileSync as writeFileSync8 } from "fs";
25207
- import { join as join11, relative as relative3, resolve as resolve3 } from "path";
25536
+ import { existsSync as existsSync11, writeFileSync as writeFileSync9 } from "fs";
25537
+ import { join as join12, relative as relative3, resolve as resolve3 } from "path";
25208
25538
 
25209
25539
  // src/commands/starter.ts
25210
- import { writeFileSync as writeFileSync7 } from "fs";
25211
- import { join as join10 } from "path";
25540
+ import { writeFileSync as writeFileSync8 } from "fs";
25541
+ import { join as join11 } from "path";
25212
25542
  var esc2 = (s) => s.replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]);
25213
25543
  var TEXT = {
25214
25544
  he: { title: "\u05D4\u05D0\u05EA\u05E8 \u05E9\u05DC\u05D9", soon: "\u05D4\u05D0\u05EA\u05E8 \u05D1\u05D1\u05E0\u05D9\u05D9\u05D4, \u05D1\u05E7\u05E8\u05D5\u05D1 \u05DB\u05D0\u05DF." },
@@ -25256,8 +25586,8 @@ DeployAI wrote this page so the folder starts as a working site. Build the owner
25256
25586
  - Delete this README or replace it with notes about the site.
25257
25587
  `;
25258
25588
  function writeStarter(root, name, lang, stack) {
25259
- writeFileSync7(join10(root, "index.html"), page(name ?? "", lang, stack));
25260
- writeFileSync7(join10(root, "README.md"), README);
25589
+ writeFileSync8(join11(root, "index.html"), page(name ?? "", lang, stack));
25590
+ writeFileSync8(join11(root, "README.md"), README);
25261
25591
  }
25262
25592
 
25263
25593
  // src/commands/start.ts
@@ -25300,7 +25630,7 @@ async function startCommand(cwd, ctx, id, opts = {}) {
25300
25630
  if (sample && !sameSite) {
25301
25631
  const written = await downloadSample(ctx, sample.key, root);
25302
25632
  done.push(t("startDownloaded", { key: sample.key, n: written }));
25303
- if (existsSync10(join11(root, "package.json"))) {
25633
+ if (existsSync11(join12(root, "package.json"))) {
25304
25634
  if (opts.install !== false && install(root)) done.push(t("startInstalled"));
25305
25635
  else steps.unshift({ cmd: "npm install", say: "Installs the sample's packages." });
25306
25636
  }
@@ -25324,7 +25654,7 @@ async function startCommand(cwd, ctx, id, opts = {}) {
25324
25654
  const stackText = choices.stack ? stackBlock(choices.stack) : "";
25325
25655
  if (choices.brief || stackText) {
25326
25656
  ensureDeployaiDir(root);
25327
- writeFileSync8(join11(root, BRIEF_FILE), [choices.brief ? `# The owner's details
25657
+ writeFileSync9(join12(root, BRIEF_FILE), [choices.brief ? `# The owner's details
25328
25658
 
25329
25659
  ${choices.brief}
25330
25660
  ` : "", stackText].filter(Boolean).join("\n"));
@@ -25369,7 +25699,7 @@ ${choices.brief}
25369
25699
  }
25370
25700
 
25371
25701
  // src/commands/addon.ts
25372
- import { readFileSync as readFileSync8 } from "fs";
25702
+ import { readFileSync as readFileSync9 } from "fs";
25373
25703
  import { resolve as resolve4 } from "path";
25374
25704
  function linkedProjectId2(root) {
25375
25705
  const id = readProject(root)?.projectId;
@@ -25470,7 +25800,7 @@ async function addonDoneCommand(root, ctx, runId, opts) {
25470
25800
  let report;
25471
25801
  if (opts.report) {
25472
25802
  try {
25473
- report = JSON.parse(readFileSync8(resolve4(root, opts.report), "utf8"));
25803
+ report = JSON.parse(readFileSync9(resolve4(root, opts.report), "utf8"));
25474
25804
  } catch {
25475
25805
  throw new CliError(`Cannot read the report file ${opts.report} as JSON.`, 1, "usage");
25476
25806
  }
@@ -25527,8 +25857,8 @@ async function speedCommand(ctx, url2, opts) {
25527
25857
  }
25528
25858
 
25529
25859
  // src/commands/blocks.ts
25530
- import { existsSync as existsSync11, mkdirSync as mkdirSync5, writeFileSync as writeFileSync9 } from "fs";
25531
- import { dirname as dirname3, resolve as resolve5, sep as sep3 } from "path";
25860
+ import { existsSync as existsSync12, mkdirSync as mkdirSync6, writeFileSync as writeFileSync10 } from "fs";
25861
+ import { dirname as dirname4, resolve as resolve5, sep as sep3 } from "path";
25532
25862
  import { gunzipSync as gunzipSync2 } from "zlib";
25533
25863
  var BLOCKS = [
25534
25864
  { key: "inbox", title: "Contact form with the site's own messages page for the owner, and an email on each message (D1)" },
@@ -25568,12 +25898,12 @@ async function blocksCommand(root, ctx, name) {
25568
25898
  if (e2.type !== "0" && e2.type !== "\0") continue;
25569
25899
  const target = resolve5(base, e2.name);
25570
25900
  if (target === base || !target.startsWith(base + sep3)) continue;
25571
- if (existsSync11(target)) {
25901
+ if (existsSync12(target)) {
25572
25902
  kept.push(e2.name);
25573
25903
  continue;
25574
25904
  }
25575
- mkdirSync5(dirname3(target), { recursive: true });
25576
- writeFileSync9(target, e2.data);
25905
+ mkdirSync6(dirname4(target), { recursive: true });
25906
+ writeFileSync10(target, e2.data);
25577
25907
  written.push(e2.name);
25578
25908
  }
25579
25909
  out(`Added the ${block.key} block: ${written.length} files.`);
@@ -25642,6 +25972,7 @@ function buildProgram() {
25642
25972
  program.command("logout").description("cancel the login token and remove it from this computer").action((_opts, cmd) => logoutCommand(ctx(cmd)));
25643
25973
  program.command("whoami").description("show the logged in user").action((_opts, cmd) => whoamiCommand(ctx(cmd)));
25644
25974
  program.command("telemetry").description("show what is sent, or turn telemetry on or off").argument("[action]", "status, on or off", "status").action((action) => telemetryCommand(action));
25975
+ program.command("allow").description("stop your coding tool asking before every DeployAI command, in this folder only (run it after the owner says yes)").argument("[tool]", "claude-code, cursor, copilot, codex or antigravity (Claude Code is found by itself)").action((tool) => allowCommand(tool));
25645
25976
  program.command("link").description("link this folder to a DeployAI project").argument("[project]", "project slug or id").option("--create <name>", "create a new project and link it").action(
25646
25977
  (project, opts, cmd) => linkCommand(root(cmd), ctx(cmd), project, opts)
25647
25978
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deployai",
3
- "version": "0.1.0-beta.14",
3
+ "version": "0.1.0-beta.16",
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",