fimo 2.2.0-staging.13 → 2.2.0-staging.15

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 (37) hide show
  1. package/assets/agent-templates/broken-link-sweeper/config.yaml +1 -0
  2. package/assets/skills/fimo-cli/SKILL.md +4 -2
  3. package/assets/skills/fimo-cli/references/agents.md +27 -3
  4. package/assets/skills/fimo-cli/references/branches.md +9 -8
  5. package/assets/skills/fimo-cli/references/credits.md +12 -19
  6. package/assets/skills/fimo-cli/references/deploy.md +6 -6
  7. package/assets/skills/fimo-cli/references/history.md +2 -2
  8. package/assets/skills/fimo-cli/references/inbox.md +86 -0
  9. package/assets/skills/fimo-cli/references/init.md +7 -6
  10. package/assets/skills/fimo-cli/references/invite.md +11 -9
  11. package/assets/skills/fimo-cli/references/labels.md +3 -11
  12. package/assets/skills/fimo-cli/references/locales.md +5 -3
  13. package/assets/skills/fimo-cli/references/preview.md +1 -2
  14. package/assets/skills/fimo-cli/references/projects.md +8 -8
  15. package/assets/skills/fimo-cli/references/schedules.md +2 -2
  16. package/assets/skills/fimo-cli/references/webhooks.md +4 -4
  17. package/assets/skills/fimo-code/references/frameworks/astro.md +1 -1
  18. package/assets/skills/fimo-code/references/frameworks/next/locales.md +2 -2
  19. package/assets/skills/fimo-code/references/locales.md +4 -2
  20. package/assets/skills/fimo-studio/references/ai-chat.md +1 -2
  21. package/assets/skills/fimo-studio/references/billing-and-credits.md +14 -7
  22. package/assets/skills/fimo-studio/references/webhooks.md +1 -1
  23. package/dist/cli/bundle.json +1 -1
  24. package/dist/cli/index.js +194 -178
  25. package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
  26. package/dist/runtime/shared/local-runtime-env.js +14 -9
  27. package/package.json +9 -8
  28. package/templates/astro/AGENTS.md +1 -1
  29. package/templates/astro/package.json +2 -2
  30. package/templates/nextjs/AGENTS.md +1 -1
  31. package/templates/nextjs/package.json +3 -3
  32. package/templates/react-router/AGENTS.md +2 -2
  33. package/templates/react-router/package.json +4 -4
  34. package/templates/sveltekit/AGENTS.md +1 -1
  35. package/templates/sveltekit/package.json +2 -2
  36. package/templates/vite/AGENTS.md +5 -1
  37. package/templates/vite/package.json +4 -4
@@ -31,8 +31,8 @@ export interface LocalProjectLink {
31
31
  }
32
32
  /**
33
33
  * Derive the local runtime env, or `null` when this directory is not a linked
34
- * Fimo project (or the link predates `tenantApiBaseUrl` — nothing safe to
35
- * derive, so nothing is).
34
+ * Fimo project, Git cannot name the current Branch, or the link predates
35
+ * `tenantApiBaseUrl`.
36
36
  */
37
37
  export declare function resolveLocalRuntimeEnv(options: {
38
38
  readonly cwd: string;
@@ -19,11 +19,11 @@ import { execFileSync } from 'node:child_process';
19
19
  import fs from 'node:fs';
20
20
  import path from 'node:path';
21
21
  import { CURRENT_PROJECT_LAYOUT, LEGACY_PROJECT_LAYOUT } from '../project-layout.js';
22
- import { DEFAULT_BRANCH, LOCAL_CONTENT_API_ENV_KEYS, buildLocalRuntimeEnv, buildTenantApiUrl, isValidBranch, } from './branch-identity.js';
22
+ import { LOCAL_CONTENT_API_ENV_KEYS, buildLocalRuntimeEnv, buildTenantApiUrl, isValidBranch, } from './branch-identity.js';
23
23
  /**
24
24
  * Derive the local runtime env, or `null` when this directory is not a linked
25
- * Fimo project (or the link predates `tenantApiBaseUrl` — nothing safe to
26
- * derive, so nothing is).
25
+ * Fimo project, Git cannot name the current Branch, or the link predates
26
+ * `tenantApiBaseUrl`.
27
27
  */
28
28
  export function resolveLocalRuntimeEnv(options) {
29
29
  const root = findProjectRoot(options.cwd);
@@ -31,15 +31,17 @@ export function resolveLocalRuntimeEnv(options) {
31
31
  if (!root || !link) {
32
32
  return null;
33
33
  }
34
- const gitBranch = currentBranch(root);
35
- const branch = gitBranch ?? DEFAULT_BRANCH;
34
+ const branch = currentBranch(root);
35
+ if (!branch) {
36
+ return null;
37
+ }
36
38
  const tenantApiUrl = buildTenantApiUrl(link.projectId, branch, link.tenantApiBaseUrl);
37
39
  return {
38
40
  // `env` stays the field name: `resolveLocalRuntimeEnv` is a published
39
41
  // `fimo/config` export that framework adapters destructure.
40
42
  env: branch,
41
43
  tenantApiUrl,
42
- source: gitBranch ? 'branch' : 'fallback',
44
+ source: 'branch',
43
45
  values: buildLocalRuntimeEnv({ tenantApiUrl, branch }),
44
46
  link,
45
47
  };
@@ -125,12 +127,12 @@ export function readLocalEnvFiles(cwd) {
125
127
  */
126
128
  function currentBranch(root) {
127
129
  try {
128
- const branch = execFileSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], {
130
+ const branch = execFileSync('git', ['symbolic-ref', '--short', '-q', 'HEAD'], {
129
131
  cwd: root,
130
132
  stdio: ['ignore', 'pipe', 'ignore'],
131
133
  encoding: 'utf-8',
132
134
  }).trim();
133
- return branch && branch !== 'HEAD' && isValidBranch(branch) ? branch : null;
135
+ return branch && isValidBranch(branch) ? branch : null;
134
136
  }
135
137
  catch {
136
138
  return null;
@@ -162,7 +164,10 @@ function readProjectLink(root) {
162
164
  parsed.projectId.length > 0 &&
163
165
  typeof parsed.tenantApiBaseUrl === 'string' &&
164
166
  parsed.tenantApiBaseUrl.length > 0) {
165
- return { projectId: parsed.projectId, tenantApiBaseUrl: parsed.tenantApiBaseUrl };
167
+ return {
168
+ projectId: parsed.projectId,
169
+ tenantApiBaseUrl: parsed.tenantApiBaseUrl,
170
+ };
166
171
  }
167
172
  }
168
173
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo",
3
- "version": "2.2.0-staging.13",
3
+ "version": "2.2.0-staging.15",
4
4
  "description": "Fimo CLI - create, deploy, and manage Fimo projects",
5
5
  "keywords": [
6
6
  "astro-component"
@@ -184,17 +184,18 @@
184
184
  "change-case": "^5.4.4",
185
185
  "eta": "^3.5.0",
186
186
  "oxc-parser": "^0.118.0",
187
- "zod": "4.4.3"
187
+ "zod": "4.5.2"
188
188
  },
189
189
  "devDependencies": {
190
190
  "@clack/core": "^1.2.0",
191
191
  "@clack/prompts": "^1.2.0",
192
- "@fimo/agents-bundle": "2.2.0-staging.13",
193
- "@fimo/api-contracts": "2.2.0-staging.13",
194
- "@fimo/cli-kit": "2.2.0-staging.13",
195
- "@fimo/framework-detect": "2.2.0-staging.13",
196
- "@fimo/routes": "2.2.0-staging.13",
197
- "@fimo/tsconfig": "2.2.0-staging.13",
192
+ "@fimo/agents-bundle": "2.2.0-staging.15",
193
+ "@fimo/api-contracts": "2.2.0-staging.15",
194
+ "@fimo/cli-kit": "2.2.0-staging.15",
195
+ "@fimo/framework-detect": "2.2.0-staging.15",
196
+ "@fimo/routes": "2.2.0-staging.15",
197
+ "@fimo/sdk": "2.2.0-staging.15",
198
+ "@fimo/tsconfig": "2.2.0-staging.15",
198
199
  "@types/node": "22.18.6",
199
200
  "agent-install": "^0.0.5",
200
201
  "astro": "^7.1.6",
@@ -28,7 +28,7 @@ a code-only task, or use `npx fimo@latest` for project-local code generation and
28
28
 
29
29
  - **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
30
30
  - Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
31
- - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`. If no language is requested, keep `en` and state that choice. Astro reads this configuration directly, keeps the default locale unprefixed, and prefixes the others.
31
+ - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale. Load `fimo skills get fimo-cli --ref locales` and use `fimo locales` to configure the exact locale set and default. Never edit `i18n.defaultLocale` or `i18n.locales` directly. If no language is requested, keep `en` and state that choice. Astro reads the synchronized config, keeps the default locale unprefixed, and prefixes the others.
32
32
  - Preserve both the unprefixed default pages and the `[locale]` page tree. Astro has no optional single-segment file route, so the paired native pages keep one-locale URLs clean and allow another locale without changing the route shape. Use `Astro.currentLocale` for Fimo content reads, `getLabels`, and document language.
33
33
  - Keep `.fimo/config.json#routes` as Studio metadata aligned with Astro's page files. It does not configure Astro routing.
34
34
  - Astro owns routes, locale resolution, links, HTML language/direction, and SEO. Fimo connects to those decisions.
@@ -9,8 +9,8 @@
9
9
  "check": "astro sync && astro check"
10
10
  },
11
11
  "dependencies": {
12
- "fimo": "2.2.0-staging.13",
13
- "fimo-astro": "2.2.0-staging.13"
12
+ "fimo": "2.2.0-staging.15",
13
+ "fimo-astro": "2.2.0-staging.15"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@astrojs/check": "^0.9.10",
@@ -36,7 +36,7 @@ The scaffolded homepage is disposable. Replace it on the first real generation.
36
36
 
37
37
  - **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
38
38
  - Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
39
- - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`, with every requested locale in `i18n.locales`. If no language is requested, keep `en` and state that choice. That file is the only place to change: `src/locales.ts` reads it, so the served language and `<html lang>` follow. It does not create locale URLs; implement a URL strategy only when the product asks for one. Never introduce a default-locale environment variable.
39
+ - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale. Load `fimo skills get fimo-cli --ref locales` and use `fimo locales` to configure the exact locale set and default. Never edit `i18n.defaultLocale` or `i18n.locales` directly. If no language is requested, keep `en` and state that choice. `src/locales.ts` reads the synchronized config, so the served language and `<html lang>` follow. Locale configuration does not create locale URLs; implement a URL strategy only when the product asks for one. Never introduce a default-locale environment variable.
40
40
  - Next's `app` tree is the router and stays authoritative: the default shell is one ordinary root layout plus `/` as the homepage, and unknown paths get Next's native 404. When a product requires locale URLs, implement the framework-native strategy (`[locale]` segments, middleware, cookies, domains, or an i18n library), pass the resolved locale into Fimo server reads and `FimoProvider`, and load `fimo skills get fimo-code --ref frameworks/next/locales` first. Do not impose locale-prefixed URLs on a default-only project.
41
41
  - `FimoProvider` owns the optional Studio preview runtime. Do not add a preview bridge component, read Fimo preview environment variables, or inject Fimo scripts in application code.
42
42
  - Keep `.fimo/config.json#routes` as Studio metadata, not as the Next.js router. Describe only URLs the application actually serves; add a `:locale` segment to a route's metadata only after the application implements that locale routing. There, `params.locale.optional: true` means omit the configured default locale from the URL; use `optional: false` only when every locale, including the default, must be prefixed.
@@ -12,9 +12,9 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@tanstack/react-query": "^5.80.6",
15
- "fimo": "2.2.0-staging.13",
16
- "fimo-next": "2.2.0-staging.13",
17
- "fimo-react": "2.2.0-staging.13",
15
+ "fimo": "2.2.0-staging.15",
16
+ "fimo-next": "2.2.0-staging.15",
17
+ "fimo-react": "2.2.0-staging.15",
18
18
  "next": "^16.3.3",
19
19
  "react": "^19.2.7",
20
20
  "react-dom": "^19.2.7"
@@ -41,8 +41,8 @@ breaks that. Load `fimo-code` for the exact primitives, but the rule is:
41
41
 
42
42
  - **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
43
43
  - Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
44
- - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`. If no language is requested, keep `en` and state that choice.
45
- - Preserve the application-owned `:locale?` route boundary in `src/routes.ts` and pass its route parameter to `FimoProviders` in `LocaleLayout.tsx`. The missing parameter uses the configured default, so a one-locale site stays at `/`. Add locales in `.fimo/config.json` without rebuilding the route tree; use `:locale` without `?` only when every locale must be prefixed.
44
+ - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale. Load `fimo skills get fimo-cli --ref locales` and use `fimo locales` to configure the exact locale set and default. Never edit `i18n.defaultLocale` or `i18n.locales` directly. If no language is requested, keep `en` and state that choice.
45
+ - Preserve the application-owned `:locale?` route boundary in `src/routes.ts` and pass its route parameter to `FimoProviders` in `LocaleLayout.tsx`. The missing parameter uses the configured default, so a one-locale site stays at `/`. Configured locales use the same route tree; use `:locale` without `?` only when every locale must be prefixed.
46
46
  - Keep `.fimo/config.json#routes` aligned as Studio metadata, not as the React Router source of truth. Do not add a global locale-routing strategy, a Fimo route helper, or a Fimo-owned route tree.
47
47
  - Do not add a second deploy tool (Vercel, Netlify, etc.).
48
48
  - **Never edit `.fimo/project.json`** — it links this folder to the remote project.
@@ -21,10 +21,10 @@
21
21
  "cmdk": "^1.1.1",
22
22
  "date-fns": "^4.1.0",
23
23
  "embla-carousel-react": "^8.6.0",
24
- "fimo": "2.2.0-staging.13",
25
- "fimo-react": "2.2.0-staging.13",
26
- "fimo-react-router": "2.2.0-staging.13",
27
- "fimo-vite": "2.2.0-staging.13",
24
+ "fimo": "2.2.0-staging.15",
25
+ "fimo-react": "2.2.0-staging.15",
26
+ "fimo-react-router": "2.2.0-staging.15",
27
+ "fimo-vite": "2.2.0-staging.15",
28
28
  "input-otp": "^1.4.2",
29
29
  "isbot": "^5",
30
30
  "lucide-react": "^0.577.0",
@@ -28,7 +28,7 @@ a code-only task, or use `npx fimo@latest` for project-local code generation and
28
28
 
29
29
  - **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
30
30
  - Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
31
- - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`. If no language is requested, keep `en` and state that choice. `src/locales.ts` derives the default and prefixed locale set from that config.
31
+ - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale. Load `fimo skills get fimo-cli --ref locales` and use `fimo locales` to configure the exact locale set and default. Never edit `i18n.defaultLocale` or `i18n.locales` directly. If no language is requested, keep `en` and state that choice. `src/locales.ts` derives the default and prefixed locale set from the synchronized config.
32
32
  - Preserve the native `[[locale=locale]]` route boundary. The optional parameter keeps the default locale at `/`; the matcher prevents ordinary top-level routes from being mistaken for locales. The root server layout passes the tracked `event.params` through `resolveLocale`, then sends that locale to `getLabels` and `FimoProvider`. Remove the extra brackets only when every locale must be prefixed.
33
33
  - Keep the document language request-aware: `src/hooks.server.ts` renders the initial `<html lang>`, and the root layout updates it after client navigation.
34
34
  - Keep `.fimo/config.json#routes` as Studio metadata aligned with SvelteKit's route files. It does not configure SvelteKit routing.
@@ -11,8 +11,8 @@
11
11
  "prepare": "svelte-kit sync"
12
12
  },
13
13
  "dependencies": {
14
- "fimo": "2.2.0-staging.13",
15
- "fimo-sveltekit": "2.2.0-staging.13"
14
+ "fimo": "2.2.0-staging.15",
15
+ "fimo-sveltekit": "2.2.0-staging.15"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@sveltejs/kit": "^2.70.2",
@@ -28,8 +28,12 @@ fimo`, or `bunx --no-install fimo` when the project uses that package manager.
28
28
  - Use Fimo schemas and generated clients for content, labels for editable strings, Fimo primitives for media, and
29
29
  generated form helpers for submissions. Load `fimo-code` for their current APIs.
30
30
  - The scaffolded homepage is disposable. Replace it when building the requested site.
31
+ - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale.
32
+ Load `fimo skills get fimo-cli --ref locales` and use `fimo locales` to configure the exact locale set and default.
33
+ Never edit `i18n.defaultLocale` or `i18n.locales` directly. If no language is requested, keep `en` and state that
34
+ choice.
31
35
  - Preserve `BrowserRouter`. Keep the application-owned optional `:locale?` route and pass its parameter to
32
- `FimoProviders`. English is the default; adding configured locales must not require rebuilding the route tree.
36
+ `FimoProviders`. Configured locales use the same route tree.
33
37
  - Keep `.fimo/config.json#routes` aligned as Studio metadata. React Router remains the source of truth.
34
38
  - Keep the catch-all rewrite to `/index.html` so direct visits reach the browser router.
35
39
  - Keep `fimo-react-router/vite` composed with the React Vite plugin and `FimoProviders` inside the router context.
@@ -11,10 +11,10 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@tanstack/react-query": "^5.80.6",
14
- "fimo": "2.2.0-staging.13",
15
- "fimo-react": "2.2.0-staging.13",
16
- "fimo-react-router": "2.2.0-staging.13",
17
- "fimo-vite": "2.2.0-staging.13",
14
+ "fimo": "2.2.0-staging.15",
15
+ "fimo-react": "2.2.0-staging.15",
16
+ "fimo-react-router": "2.2.0-staging.15",
17
+ "fimo-vite": "2.2.0-staging.15",
18
18
  "react": "^19.2.7",
19
19
  "react-dom": "^19.2.7",
20
20
  "react-router": "^8.3.0"