fimo 2.1.0 → 2.2.0-staging.1

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.
@@ -38,7 +38,7 @@ async function translate(text: string, _to: string): Promise<string> {
38
38
 
39
39
  async function writeBack(_entry: Entry, _locale: string, _value: string): Promise<void> {
40
40
  // Stub — create/update the target locale entry via
41
- // `/api/management/projects/:id/envs/:env/tenant/entries/:type`.
41
+ // `/api/tenant/:projectId/branches/:branch/entries/:type`.
42
42
  }
43
43
 
44
44
  async function main(): Promise<void> {
@@ -17,7 +17,7 @@ async function main(): Promise<void> {
17
17
  const base = process.env.FIMO_API_URL ?? 'http://localhost:3000';
18
18
 
19
19
  const since = new Date(Date.now() - minutes * 60_000).toISOString();
20
- const url = `${base}/api/management/projects/${projectId}/envs/${encodeURIComponent(env)}/logs?since=${encodeURIComponent(since)}&level=error`;
20
+ const url = `${base}/api/management/projects/${projectId}/branches/${encodeURIComponent(env)}/logs?since=${encodeURIComponent(since)}&level=error`;
21
21
 
22
22
  try {
23
23
  const res = await fetch(url, { credentials: 'include' });
@@ -4,9 +4,9 @@
4
4
  * Enumerate every public route in the project via the Fimo management
5
5
  * API. Returns paths the audit walks one-by-one through `fetch-page`.
6
6
  *
7
- * Inputs (env):
7
+ * Inputs (branch):
8
8
  * - FIMO_PROJECT_ID — provided by the runtime (M16 sandbox adapter)
9
- * - FIMO_ENV — provided by the runtime
9
+ * - FIMO_ENV — provided by the runtime (legacy runtime selector)
10
10
  * - FIMO_API_URL — provided by the runtime
11
11
  *
12
12
  * Outputs (stdout JSON):
@@ -28,7 +28,7 @@ async function main(): Promise<void> {
28
28
  process.exit(1);
29
29
  }
30
30
 
31
- const url = `${base}/api/management/projects/${projectId}/envs/${encodeURIComponent(env)}/routes`;
31
+ const url = `${base}/api/management/projects/${projectId}/branches/${encodeURIComponent(env)}/routes`;
32
32
  const res = await fetch(url, { credentials: 'include' });
33
33
  if (!res.ok) {
34
34
  console.error(`Failed to list routes: ${res.status} ${res.statusText}`);
@@ -44,7 +44,7 @@ A Fimo project is identified by `.fimo/project.json`, written by `fimo init`. Th
44
44
 
45
45
  ## Critical: commands target the Branch matching the current git branch
46
46
 
47
- A project can have multiple **Branches** — each is a git branch _plus_ its own DB, sandbox, preview, and assets. Project-scoped commands (`deploy`, `status`, `entries`, `diff`, …) operate on the Branch matching the **current git branch**, and print a one-line banner saying which one. New projects start on `main`. Override for a single command with the canonical `--branch <name>` flag; the legacy `--env <name>` spelling remains a compatibility alias. Never edit the link file to switch. The full git-shaped workflow (`branch` / `checkout` / `switch` / `pull` / `diff` / `merge` / `status` / `publish`) lives in `references/branches.md`.
47
+ A project can have multiple **Branches** — each is a git branch _plus_ its own DB, sandbox, preview, and assets. Project-scoped commands (`deploy`, `status`, `entries`, `diff`, …) operate on the Branch matching the **current git branch**, and print a one-line banner saying which one. New projects start on `main`. Override for a single command with the canonical `--branch <name>` flag; the legacy `--env <name>` spelling still works, but passing both with different values fails (`BRANCH_OPTION_CONFLICT`) instead of picking one. Never edit the link file to switch. The full git-shaped workflow (`branch` / `checkout` / `switch` / `pull` / `diff` / `merge` / `status` / `publish`) lives in `references/branches.md`.
48
48
 
49
49
  ## Quick Start
50
50
 
@@ -15,7 +15,7 @@ fimo --branch <name> <command> # peek at another Branch for one command (does n
15
15
  ```
16
16
 
17
17
  - **`--branch <name>`** is the canonical global override. `fimo --branch main status` inspects `main` while you stay checked out on your feature Branch.
18
- - **`--env <name>`** remains a compatibility alias for `--branch`; it still carries the legacy `env` wire name.
18
+ - **`--env <name>`** remains a deprecated alias for `--branch`. Passing both with **different** values fails with `BRANCH_OPTION_CONFLICT` rather than picking a winner; passing both with the same value is fine.
19
19
  - Git-changing commands use the current branch; cross-branch status only reports the mismatch.
20
20
  - If the git branch maps to no Fimo Branch, the CLI errors with a hint (`fimo branch` to list, `fimo branch <name>` to create) rather than guessing.
21
21
  - **`main`** is the default Branch and cannot be deleted.
@@ -14,7 +14,7 @@ fimo preview url --all # print every destination a
14
14
  curl -L "$(fimo preview url)" # fetch the raw sandbox preview
15
15
  ```
16
16
 
17
- `--env <name>` remains a compatibility alias for `--branch <name>`. The API and JSON response still use the legacy `env` field and `/env/` dashboard path.
17
+ `--env <name>` remains a deprecated alias for `--branch <name>`; the two disagreeing is an error, not a precedence rule. The JSON envelope carries `branch` and keeps `env` as a duplicate of it. Studio deep links still use the `/env/` path, which redirects to `/branch/`.
18
18
 
19
19
  ## Human and machine behavior
20
20
 
@@ -30,12 +30,14 @@ curl -L "$(fimo preview url)" # fetch the raw sandbox pre
30
30
  "status": "ok",
31
31
  "data": {
32
32
  "project_id": "prj_abc",
33
+ "branch": "main",
34
+ "env": "main",
33
35
  "env": "main",
34
36
  "preview_url": "https://fimo.ai/preview/prj_abc/main",
35
37
  "sandbox_url": "https://preview.provider.example/session",
36
38
  "sandbox_expires_at": "2026-08-20T18:42:00.000Z",
37
- "studio_url": "https://fimo.ai/app/projects/prj_abc/env/main/preview",
38
- "dashboard_url": "https://fimo.ai/app/projects/prj_abc/env/main/preview"
39
+ "studio_url": "https://fimo.ai/app/projects/prj_abc/branch/main/preview",
40
+ "dashboard_url": "https://fimo.ai/app/projects/prj_abc/branch/main/preview"
39
41
  }
40
42
  }
41
43
  ```
@@ -71,7 +71,7 @@ artifact, and record which one.
71
71
 
72
72
  Before workers start, the root process must establish a real Fimo project and
73
73
  environment, link the migration checkout to it, and prove the data plane is
74
- reachable with a read such as `fimo schemas list -C <target> --env <env>` using
74
+ reachable with a read such as `fimo schemas list -C <target> --branch <branch>` using
75
75
  the selected pinned CLI. Give workers the project id, environment, exact CLI
76
76
  invocation, and verification command. Generated `.fimo` JSON without a
77
77
  successful platform read is not initialization.
@@ -79,8 +79,8 @@ successful platform read is not initialization.
79
79
  Pick the setup path from the evidence:
80
80
 
81
81
  - **Source-backed, same framework** — copy or `git worktree` the source into the
82
- target directory first, then run `fimo link -C <target> --env <env>`
83
- (`fimo link <project-id> -C <target> --env <env>` when the owner supplied an
82
+ target directory first, then run `fimo link -C <target> --branch <branch>`
83
+ (`fimo link <project-id> -C <target> --branch <branch>` when the owner supplied an
84
84
  id). Link creates or selects the project, keeps the source's code, framework,
85
85
  git history, and `origin`, initializes a repository when the copy has none,
86
86
  and adds only the Fimo dependency, `.fimo/project.json`, the `fimo` remote,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-08-26T08:34:43.135Z",
4
+ "bundledAt": "2026-08-26T13:08:32.124Z",
5
5
  "cliVersion": "2.1.0",
6
6
  "external": [
7
7
  "oxc-parser",