flypod 0.11.1 → 0.11.3
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 +10 -3
- package/dist/bin/deploy.js +1 -1
- package/dist/{cli-nqpgfpnm.js → cli-zc5d42zg.js} +13 -1
- package/dist/src/cli.d.ts +4 -2
- package/dist/src/cli.js +1 -1
- package/dist/src/deploy-source.d.ts +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -387,7 +387,11 @@ Branch on `code` — it is stable; `error` is prose and may change; `fix`, when
|
|
|
387
387
|
present, is the literal next step. The codes: `no_build_dir`, `no_files`,
|
|
388
388
|
`no_site`, `not_signed_in`, `unauthorized`, `token_rejected`, `site_gone`,
|
|
389
389
|
`invalid_upload`, `too_large`, `blocked`, `challenge_required`, `rate_limited`,
|
|
390
|
-
`server_error`, `network`, `usage`, `unknown_flag`,
|
|
390
|
+
`server_error`, `network`, `usage`, `unknown_flag`, `unknown_command` (a
|
|
391
|
+
`flypod comments` verb that does not exist), `no_such_version` (nothing to roll
|
|
392
|
+
back to), `no_token` (`flypod token` on a site this machine holds no manage
|
|
393
|
+
token for), `already_claimed`, `not_found`, `bad_request` (any other 4xx),
|
|
394
|
+
`unexpected`, and the login codes below.
|
|
391
395
|
The [exit code](#exit-codes) follows the code, never the verb.
|
|
392
396
|
|
|
393
397
|
A credential that is sent but not accepted (an expired `FLYPOD_TOKEN`, say)
|
|
@@ -400,7 +404,10 @@ anonymous 14-day site.
|
|
|
400
404
|
of waiting. Hand the URL and code to the user; once they confirm, finish with
|
|
401
405
|
`flypod login --device-code <device_code>` — that polls once and either saves
|
|
402
406
|
the session (`{"ok": true, "logged_in": true}`) or reports
|
|
403
|
-
`authorization_pending` (exit 4) to try again.
|
|
407
|
+
`authorization_pending` (exit 4) to try again. The flow ends for good with
|
|
408
|
+
`login_denied` (exit 3, the user said no) or `login_expired` (exit 1, start
|
|
409
|
+
again); an interactive `flypod login` that gives up waiting reports
|
|
410
|
+
`login_timeout` (exit 4).
|
|
404
411
|
|
|
405
412
|
Or capture just the URL:
|
|
406
413
|
|
|
@@ -579,7 +586,7 @@ Targeting flags, on `update` / `versions` / `rollback` / `forget`:
|
|
|
579
586
|
| `FLYPOD_TOKEN` | Deploy as your account without logging in (agents / CI). Takes precedence over a saved session |
|
|
580
587
|
| `DEPLOY_URL` | The deploy server (default: `https://flypod.dev`) |
|
|
581
588
|
| `FLYPOD_CONFIG_DIR` | Where the CLI keeps its session + folder memory |
|
|
582
|
-
| `FLYPOD_SOURCE` | Override how the deploy reports its surface (`cli`, `skill`, `library`) |
|
|
589
|
+
| `FLYPOD_SOURCE` | Override how the deploy reports its surface (`cli`, `skill`, `library`). `deploySite()` reads it too when no `source` is passed |
|
|
583
590
|
| `FLYPOD_SHOW_TOKEN` | Set to `1` to print the site's manage token inline on deploy (off by default) |
|
|
584
591
|
| `NO_COLOR` | Disable ANSI colors |
|
|
585
592
|
| `FORCE_COLOR` | Force colors even when stderr is not a TTY |
|
package/dist/bin/deploy.js
CHANGED
|
@@ -331,6 +331,13 @@ step when there is one. Codes you will meet: \`no_build_dir\`, \`no_files\`,
|
|
|
331
331
|
\`invalid_upload\`, \`too_large\`, \`blocked\`, \`challenge_required\`,
|
|
332
332
|
\`rate_limited\`, \`server_error\`, \`network\`, \`unknown_flag\`, \`usage\`.
|
|
333
333
|
|
|
334
|
+
Rarer ones: \`unknown_command\` (a \`flypod comments\` verb that does not exist),
|
|
335
|
+
\`no_such_version\` (nothing to roll back to), \`no_token\` (\`flypod token\` on a
|
|
336
|
+
site this machine holds no manage token for), \`already_claimed\`, \`not_found\`,
|
|
337
|
+
\`bad_request\` (any other 4xx), \`unexpected\`, and from the login flow
|
|
338
|
+
\`login_denied\` (exit 3), \`login_expired\` (exit 1, start again) and
|
|
339
|
+
\`login_timeout\` (exit 4).
|
|
340
|
+
|
|
334
341
|
A \`FLYPOD_TOKEN\` the server does not accept fails the deploy with
|
|
335
342
|
\`token_rejected\` (exit 3). It never falls back to an anonymous deploy, so an
|
|
336
343
|
exit 0 with a token set always means the site is owned.
|
|
@@ -1500,12 +1507,17 @@ async function collectDist(path) {
|
|
|
1500
1507
|
await walk(path);
|
|
1501
1508
|
return files;
|
|
1502
1509
|
}
|
|
1510
|
+
function envSource() {
|
|
1511
|
+
const value = globalThis.process?.env?.FLYPOD_SOURCE;
|
|
1512
|
+
return value ? coerceSource(value) : undefined;
|
|
1513
|
+
}
|
|
1503
1514
|
async function deploySite(opts) {
|
|
1504
1515
|
const handle = opts.handle ?? ((request) => fetch(request));
|
|
1505
1516
|
const baseUrl = opts.baseUrl ?? "https://flypod.dev";
|
|
1506
1517
|
const zip = packDeploy(opts.files);
|
|
1507
1518
|
const bridgeFetch = async (input, init) => handle(new Request(typeof input === "string" ? input : input.url, init));
|
|
1508
|
-
const
|
|
1519
|
+
const source = opts.source ?? envSource() ?? "library";
|
|
1520
|
+
const client = buildClient(opts.apiKey, baseUrl, bridgeFetch, source);
|
|
1509
1521
|
const res = await client.createSite(zip);
|
|
1510
1522
|
if (!res.ok)
|
|
1511
1523
|
throw await DeployError.fromResponse(res);
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DeploySource } from "./deploy-source";
|
|
2
2
|
/**
|
|
3
3
|
* Build-output folders the common frontend frameworks emit, in priority order.
|
|
4
4
|
* `public` ranks low because some tools use it for *source* assets (Vite/CRA);
|
|
@@ -56,6 +56,7 @@ export interface DeployOptions {
|
|
|
56
56
|
* Surface reported to the server as `x-flypod-source`. Defaults to
|
|
57
57
|
* `library`, which is the truth for a direct call to this function; the
|
|
58
58
|
* `flypod` binary passes its own resolved source (`cli` or `skill`).
|
|
59
|
+
* When omitted, a `FLYPOD_SOURCE` environment variable is used if set.
|
|
59
60
|
*/
|
|
60
61
|
source?: DeploySource;
|
|
61
62
|
}
|
|
@@ -67,7 +68,8 @@ export interface DeployOptions {
|
|
|
67
68
|
* one request-building path. `buildClient` — not `createClient` — is used
|
|
68
69
|
* deliberately: this is a published library function callers can invoke
|
|
69
70
|
* directly with just `{files, apiKey}`, so it must never reach for a saved
|
|
70
|
-
* session or ambient env vars the caller didn't pass in `opts`.
|
|
71
|
+
* session or ambient env vars the caller didn't pass in `opts`. The single
|
|
72
|
+
* exception is the `FLYPOD_SOURCE` label; see `envSource`.
|
|
71
73
|
*/
|
|
72
74
|
export declare function deploySite(opts: DeployOptions): Promise<DeployResult>;
|
|
73
75
|
/**
|
package/dist/src/cli.js
CHANGED
|
@@ -7,6 +7,36 @@ export declare const SOURCE_HEADER = "x-flypod-source";
|
|
|
7
7
|
* it. It is a device id we minted, not PII — no IP, no user agent.
|
|
8
8
|
*/
|
|
9
9
|
export declare const ANON_ID_HEADER = "x-flypod-anon-id";
|
|
10
|
+
/**
|
|
11
|
+
* Request header that says "this request is ours". `1` or `true`.
|
|
12
|
+
*
|
|
13
|
+
* `source: ci` already says it for a deploy, but it does so by replacing the
|
|
14
|
+
* surface, and three kinds of our own traffic could not use it: the MCP
|
|
15
|
+
* endpoint (its source is fixed to `mcp`), the landing-page drop demo
|
|
16
|
+
* (`browser`), and everything a signed-in browser does on `/account`, which has
|
|
17
|
+
* no source at all. In the week of 2026-09-28 the north star read 11 activated
|
|
18
|
+
* builders, and by timing most of them were us exercising the features that
|
|
19
|
+
* shipped that week. Nothing on the events could say so.
|
|
20
|
+
*
|
|
21
|
+
* It is not a credential. Sending it only removes the caller from our growth
|
|
22
|
+
* numbers, so there is nothing to gain by forging it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const INTERNAL_HEADER = "x-flypod-internal";
|
|
25
|
+
/**
|
|
26
|
+
* Cookie that marks a browser as one of ours. `apps/site` and `apps/docs` set
|
|
27
|
+
* it on `.flypod.dev` when any page is loaded once with `?internal=1` (and
|
|
28
|
+
* clear it on `?internal=0`), then stop reporting pageviews from that browser.
|
|
29
|
+
* Because it rides on same-site requests, the drop demo and every `/account`
|
|
30
|
+
* action from that browser are recognised here with no further work.
|
|
31
|
+
*/
|
|
32
|
+
export declare const INTERNAL_COOKIE = "flypod_internal";
|
|
33
|
+
/**
|
|
34
|
+
* Is this request our own? True for `x-flypod-source: ci`, for the internal
|
|
35
|
+
* header, and for a browser carrying the internal cookie. Every product event
|
|
36
|
+
* then carries `internal: true`, and the growth report drops those events and
|
|
37
|
+
* every id that ever sent one (`scripts/growth-report.ts`, `notSelf`).
|
|
38
|
+
*/
|
|
39
|
+
export declare function isInternal(request: Request): boolean;
|
|
10
40
|
/**
|
|
11
41
|
* `ci` is ours, and it exists so the growth report can subtract us from our own
|
|
12
42
|
* numbers. Set `FLYPOD_SOURCE=ci` in anything that deploys on our behalf — a
|
package/package.json
CHANGED