flypod 0.18.0 → 0.19.0
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 +63 -27
- package/dist/bin/deploy.js +247 -43
- package/dist/{cli-4d5fkx95.js → cli-qtqg73w5.js} +434 -231
- package/dist/src/cli/agent-guide.d.ts +16 -0
- package/dist/src/cli/commands.d.ts +25 -1
- package/dist/src/cli/errors.d.ts +4 -1
- package/dist/src/cli/install-id.d.ts +16 -6
- package/dist/src/cli/invoked-via.d.ts +6 -0
- package/dist/src/cli/pending-login.d.ts +17 -0
- package/dist/src/cli-error-codes.d.ts +8 -0
- package/dist/src/cli.js +1 -1
- package/dist/src/client-meta.d.ts +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentGuide } from "../client-meta";
|
|
2
|
+
/** The folder the command runs in plus this many parents, at most. */
|
|
3
|
+
export declare const MAX_LEVELS = 4;
|
|
4
|
+
/** Bytes read from the start of each file. */
|
|
5
|
+
export declare const MAX_BYTES: number;
|
|
6
|
+
/**
|
|
7
|
+
* The nearest instruction file naming flypod, from `cwd` up to its repository
|
|
8
|
+
* root. `home` is the home directory, which is never read; tests inject it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectAgentGuide(cwd: string, opts?: {
|
|
11
|
+
home?: string;
|
|
12
|
+
}): Promise<AgentGuide>;
|
|
13
|
+
/** `detectAgentGuide`, once per folder per process. */
|
|
14
|
+
export declare function agentGuideFor(cwd: string, opts?: {
|
|
15
|
+
home?: string;
|
|
16
|
+
}): Promise<AgentGuide>;
|
|
@@ -43,6 +43,18 @@ export declare function emitHelp(text: string, args: {
|
|
|
43
43
|
}, io: Pick<CommandIO, "out">): number;
|
|
44
44
|
/** The help text for a verb, or undefined. */
|
|
45
45
|
export declare function subcommandHelp(name: string): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Finish a `flypod login` that is waiting for its person, from any other
|
|
48
|
+
* command: one poll, at most a couple of seconds, before the command runs.
|
|
49
|
+
* Approved → the session is saved and every site this machine remembers is
|
|
50
|
+
* kept, so the command that follows runs signed in. Still waiting or offline →
|
|
51
|
+
* nothing happens. Denied or expired → the record is dropped. Never fails the
|
|
52
|
+
* command it runs before, and prints one line only when it signed someone in
|
|
53
|
+
* and the output is for a person.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resumePendingLogin(io: CommandIO, opts: {
|
|
56
|
+
quiet: boolean;
|
|
57
|
+
}): Promise<void>;
|
|
46
58
|
export declare function login(args: {
|
|
47
59
|
token?: string;
|
|
48
60
|
deviceCode?: string;
|
|
@@ -65,6 +77,18 @@ export declare function claim(args: {
|
|
|
65
77
|
}, io: CommandIO): Promise<number>;
|
|
66
78
|
/** The pause before `update`'s one retry. */
|
|
67
79
|
export declare const UPDATE_RETRY_MS = 2000;
|
|
80
|
+
/** How `flypod` (a deploy in a folder that already has a site) runs `update`. */
|
|
81
|
+
export interface UpdateOptions {
|
|
82
|
+
/** Ran as `flypod`, not `flypod update`: fixes name `flypod --new` as the way to a second site. */
|
|
83
|
+
fromDeploy?: boolean;
|
|
84
|
+
/** The linked site is gone (404): forget the link and return this instead of failing. */
|
|
85
|
+
whenGone?: () => Promise<number>;
|
|
86
|
+
/** More receipt fields and screen lines, computed once the update is live (`--comments`). */
|
|
87
|
+
extra?: (siteId: string) => Promise<{
|
|
88
|
+
json: Record<string, unknown>;
|
|
89
|
+
lines: string[];
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
68
92
|
export declare function update(args: {
|
|
69
93
|
path?: string;
|
|
70
94
|
site?: string;
|
|
@@ -76,7 +100,7 @@ export declare function update(args: {
|
|
|
76
100
|
verbose?: boolean;
|
|
77
101
|
/** Turn the version timeline on (`true`) or off (`false`); unset leaves it alone. */
|
|
78
102
|
timeline?: boolean;
|
|
79
|
-
}, io: CommandIO): Promise<number>;
|
|
103
|
+
}, io: CommandIO, opts?: UpdateOptions): Promise<number>;
|
|
80
104
|
/**
|
|
81
105
|
* Turn the version timeline on or off, and report the state the site is
|
|
82
106
|
* actually in: a refusal leaves it as it was. `history_url` is where two
|
package/dist/src/cli/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CLI_ERROR_CODES, NO_SITE_REASONS, SENT_CREDENTIALS, SERVER_ERROR_ORIGINS } from "../cli-error-codes";
|
|
1
|
+
import type { CLI_ERROR_CODES, NO_SITE_REASONS, SENT_CREDENTIALS, SERVER_ERROR_ORIGINS, SITE_TARGETS } from "../cli-error-codes";
|
|
2
2
|
import type { CommandIO } from "./commands";
|
|
3
3
|
export { CLI_ERROR_CODES, NO_SITE_REASONS } from "../cli-error-codes";
|
|
4
4
|
/**
|
|
@@ -134,6 +134,7 @@ export declare const NO_SITE: CliError;
|
|
|
134
134
|
/** Why a folder has no site, as `reason` in the `no_site` envelope. */
|
|
135
135
|
export type NoSiteReason = (typeof NO_SITE_REASONS)[number];
|
|
136
136
|
type SentCredential = (typeof SENT_CREDENTIALS)[number];
|
|
137
|
+
export type SiteTarget = (typeof SITE_TARGETS)[number];
|
|
137
138
|
/**
|
|
138
139
|
* `no_site` for the version verbs (`update`, `versions`, `rollback`), told
|
|
139
140
|
* apart by what this machine remembers about the folder. It was one sentence
|
|
@@ -172,6 +173,8 @@ export declare function unauthorizedFor(ctx: {
|
|
|
172
173
|
sent: SentCredential;
|
|
173
174
|
/** Whether this machine has any record of the site. */
|
|
174
175
|
known: boolean;
|
|
176
|
+
/** How the command named the site. */
|
|
177
|
+
target: SiteTarget;
|
|
175
178
|
status?: number;
|
|
176
179
|
}): CliError;
|
|
177
180
|
export declare const NOT_SIGNED_IN: CliError;
|
|
@@ -4,6 +4,8 @@ export declare const VERSION_HEADER = "x-flypod-version";
|
|
|
4
4
|
export declare const RELINK_HEADER = "x-flypod-relink";
|
|
5
5
|
export declare const AGENT_HEADER = "x-flypod-agent";
|
|
6
6
|
export declare const CI_HEADER = "x-flypod-ci";
|
|
7
|
+
export declare const INVOKED_VIA_HEADER = "x-flypod-invoked-via";
|
|
8
|
+
export declare const AGENT_GUIDE_HEADER = "x-flypod-agent-guide";
|
|
7
9
|
/**
|
|
8
10
|
* True when the user asked not to be counted. `DO_NOT_TRACK` counts when set
|
|
9
11
|
* to anything but an explicit "no" (`""`, `0`, `false`), because the
|
|
@@ -27,13 +29,21 @@ export declare function installId(env?: NodeJS.ProcessEnv): Promise<InstallId |
|
|
|
27
29
|
export declare function setCliVersion(v: string): void;
|
|
28
30
|
export declare function cliVersion(): string | undefined;
|
|
29
31
|
/**
|
|
30
|
-
* The headers that say which install and which CLI version is calling,
|
|
31
|
-
* whether a coding agent or a CI system is running it (./agent-env.ts)
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* The headers that say which install and which CLI version is calling,
|
|
33
|
+
* whether a coding agent or a CI system is running it (./agent-env.ts), how
|
|
34
|
+
* the CLI was launched (./invoked-via.ts) and whether the project's agent
|
|
35
|
+
* instructions name flypod (./agent-guide.ts). The version is not identifying
|
|
36
|
+
* and is always sent (when known); everything else follows the opt-out,
|
|
37
|
+
* because "which agent does this person use" is a fact about them, not about
|
|
38
|
+
* the CLI.
|
|
39
|
+
*
|
|
40
|
+
* `cwd` is the folder the command runs in (the project), `script` the path
|
|
41
|
+
* the runtime was started with; both default to this process's own.
|
|
35
42
|
*/
|
|
36
|
-
export declare function identityHeaders(env: NodeJS.ProcessEnv
|
|
43
|
+
export declare function identityHeaders(env: NodeJS.ProcessEnv, opts?: {
|
|
44
|
+
cwd?: string;
|
|
45
|
+
script?: string;
|
|
46
|
+
}): Promise<Record<string, string>>;
|
|
37
47
|
/**
|
|
38
48
|
* The one line a person sees the first time an id is made, so being counted
|
|
39
49
|
* is never a surprise. One line because the default output is short, and it
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InvokedVia } from "../client-meta";
|
|
2
|
+
/**
|
|
3
|
+
* The launch, as one word. `script` is the script path the runtime was given
|
|
4
|
+
* (`process.argv[1]`), `cwd` the folder the command was run in. Never throws.
|
|
5
|
+
*/
|
|
6
|
+
export declare function detectInvokedVia(env: NodeJS.ProcessEnv, script: string | undefined, cwd: string): InvokedVia;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface PendingLogin {
|
|
2
|
+
device_code: string;
|
|
3
|
+
base_url: string;
|
|
4
|
+
/** Epoch ms after which the code is dead and the record is ignored. */
|
|
5
|
+
expires_at: number;
|
|
6
|
+
/**
|
|
7
|
+
* Set once the code became a session, so a later `flypod login --device-code`
|
|
8
|
+
* with the same code (the agent following the original instructions) is told
|
|
9
|
+
* it is signed in rather than that the code is invalid.
|
|
10
|
+
*/
|
|
11
|
+
completed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function pendingLoginPath(env?: NodeJS.ProcessEnv): string;
|
|
14
|
+
export declare function savePendingLogin(pending: PendingLogin, env?: NodeJS.ProcessEnv): Promise<void>;
|
|
15
|
+
/** The remembered login, or null when there is none, it is corrupt, or it has expired. */
|
|
16
|
+
export declare function loadPendingLogin(env?: NodeJS.ProcessEnv, now?: number): Promise<PendingLogin | null>;
|
|
17
|
+
export declare function clearPendingLogin(env?: NodeJS.ProcessEnv): Promise<void>;
|
|
@@ -26,3 +26,11 @@ export declare const NO_SITE_REASONS: readonly ["never_linked", "expired", "gone
|
|
|
26
26
|
* failure report): `--token`, the folder's manage token, an account, or none.
|
|
27
27
|
*/
|
|
28
28
|
export declare const SENT_CREDENTIALS: readonly ["flag", "manage_token", "account", "none"];
|
|
29
|
+
/**
|
|
30
|
+
* How an `unauthorized` site request named its site (`target` in the failure
|
|
31
|
+
* report, beside the `known` flag): this folder's link (`link`), or
|
|
32
|
+
* `--site <id>` (`flag`). The week of 2026-10-26 had 30 `unauthorized` on
|
|
33
|
+
* `update` with `credential: none`, all from Cursor installs, and nothing said
|
|
34
|
+
* whether those machines had ever held the site or were handed its id.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SITE_TARGETS: readonly ["link", "flag"];
|
package/dist/src/cli.js
CHANGED
|
@@ -4,6 +4,8 @@ export declare const VERSION_HEADER = "x-flypod-version";
|
|
|
4
4
|
export declare const RELINK_HEADER = "x-flypod-relink";
|
|
5
5
|
export declare const AGENT_HEADER = "x-flypod-agent";
|
|
6
6
|
export declare const CI_HEADER = "x-flypod-ci";
|
|
7
|
+
export declare const INVOKED_VIA_HEADER = "x-flypod-invoked-via";
|
|
8
|
+
export declare const AGENT_GUIDE_HEADER = "x-flypod-agent-guide";
|
|
7
9
|
/**
|
|
8
10
|
* Which coding agent ran the CLI, as one of these words and nothing else. The
|
|
9
11
|
* CLI reads it from environment variables the agents themselves set
|
|
@@ -20,6 +22,33 @@ export declare const CI_HEADER = "x-flypod-ci";
|
|
|
20
22
|
*/
|
|
21
23
|
export declare const CODING_AGENTS: readonly ["claude_code", "codex", "cursor", "gemini", "opencode", "other", "none"];
|
|
22
24
|
export type CodingAgent = (typeof CODING_AGENTS)[number];
|
|
25
|
+
/**
|
|
26
|
+
* How the CLI was launched, as one of these words and nothing else
|
|
27
|
+
* (src/cli/invoked-via.ts reads it from the package manager's environment and
|
|
28
|
+
* the shape of the script's own path, and sends only the word).
|
|
29
|
+
*
|
|
30
|
+
* Why it exists: on 2026-11-01, 75% of new deployers ran flypod under Cursor
|
|
31
|
+
* while the website saw about 58 visitors a week and `source: skill` read 0,
|
|
32
|
+
* so nobody could say how those people came to have flypod at all. A fetch
|
|
33
|
+
* per run (`npx`, `bunx`, `pnpm_dlx`, `yarn_dlx`) is someone or something
|
|
34
|
+
* typing the documented one-liner; `local` is a project dependency, `script`
|
|
35
|
+
* a package.json script that calls it, `global` an install on the machine.
|
|
36
|
+
* `other` is anything else (a checkout run from source, an unusual layout).
|
|
37
|
+
*/
|
|
38
|
+
export declare const INVOKED_VIA: readonly ["npx", "bunx", "pnpm_dlx", "yarn_dlx", "script", "local", "global", "other"];
|
|
39
|
+
export type InvokedVia = (typeof INVOKED_VIA)[number];
|
|
40
|
+
/**
|
|
41
|
+
* Which agent-instruction file in the project names flypod, as one of these
|
|
42
|
+
* words (src/cli/agent-guide.ts; never a file's content or name). `skill` is
|
|
43
|
+
* a flypod skill in the project (the same test as `source: skill`); `none` is
|
|
44
|
+
* a project whose instruction files, if it has any, never say "flypod".
|
|
45
|
+
*
|
|
46
|
+
* Why it exists: the same 2026-11-01 review. An agent that deploys with
|
|
47
|
+
* flypod either was told to by the project (one of these files) or found it
|
|
48
|
+
* on its own; the two need different work from us, and nothing said which.
|
|
49
|
+
*/
|
|
50
|
+
export declare const AGENT_GUIDES: readonly ["skill", "agents_md", "claude_md", "cursor_rules", "copilot", "gemini_md", "none"];
|
|
51
|
+
export type AgentGuide = (typeof AGENT_GUIDES)[number];
|
|
23
52
|
export interface ClientMeta {
|
|
24
53
|
install_id?: string;
|
|
25
54
|
/** Only on requests from the process that created the install id. */
|
|
@@ -31,6 +60,10 @@ export interface ClientMeta {
|
|
|
31
60
|
coding_agent?: CodingAgent;
|
|
32
61
|
/** The CLI ran under a CI system (`CI`, `GITHUB_ACTIONS`, …); absent from older CLIs. */
|
|
33
62
|
ci?: boolean;
|
|
63
|
+
/** How the CLI was launched (`npx`, `global`, …); absent from older CLIs. */
|
|
64
|
+
invoked_via?: InvokedVia;
|
|
65
|
+
/** Which instruction file in the project names flypod (`none` for none); absent from older CLIs. */
|
|
66
|
+
agent_guide?: AgentGuide;
|
|
34
67
|
}
|
|
35
68
|
/**
|
|
36
69
|
* The valid subset of the CLI's headers. Each is checked on its own and an
|
package/package.json
CHANGED