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