@feltdb/feltkit 0.4.0 → 0.5.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.
Files changed (132) hide show
  1. package/dist/agent-engine.d.ts +93 -0
  2. package/dist/agent-engine.js +40 -0
  3. package/dist/agent-engine.js.map +1 -0
  4. package/dist/app.d.ts +153 -4
  5. package/dist/app.js +134 -25
  6. package/dist/app.js.map +1 -1
  7. package/dist/appboundry/build.d.ts +9 -1
  8. package/dist/appboundry/build.js +7 -7
  9. package/dist/appboundry/build.js.map +1 -1
  10. package/dist/appboundry/guest.js +82 -0
  11. package/dist/appboundry/guest.js.map +1 -1
  12. package/dist/appboundry/host.d.ts +21 -0
  13. package/dist/appboundry/host.js +83 -2
  14. package/dist/appboundry/host.js.map +1 -1
  15. package/dist/appboundry/runtime.js +2 -0
  16. package/dist/appboundry/runtime.js.map +1 -1
  17. package/dist/boards/index.d.ts +1258 -0
  18. package/dist/boards/index.js +1410 -0
  19. package/dist/boards/index.js.map +1 -0
  20. package/dist/boards/model.d.ts +177 -0
  21. package/dist/boards/model.js +177 -0
  22. package/dist/boards/model.js.map +1 -0
  23. package/dist/boards/react.d.ts +18 -0
  24. package/dist/boards/react.js +339 -0
  25. package/dist/boards/react.js.map +1 -0
  26. package/dist/cli/deploy-appboundry-self-hosted.js +2 -2
  27. package/dist/cli/deploy.js +19 -6
  28. package/dist/cli/deploy.js.map +1 -1
  29. package/dist/cli/main.js +70 -5
  30. package/dist/cli/main.js.map +1 -1
  31. package/dist/client/index.d.ts +265 -4
  32. package/dist/client/index.js +170 -3
  33. package/dist/client/index.js.map +1 -1
  34. package/dist/cron.d.ts +18 -0
  35. package/dist/cron.js +67 -0
  36. package/dist/cron.js.map +1 -0
  37. package/dist/dashboard/assets/index-CLzg0fuZ.js +14 -0
  38. package/dist/dashboard/assets/index-D2XOWzK9.css +1 -0
  39. package/dist/dashboard/index.html +2 -2
  40. package/dist/docs.d.ts +1 -1
  41. package/dist/docs.js +3 -0
  42. package/dist/docs.js.map +1 -1
  43. package/dist/eve/index.d.ts +77 -0
  44. package/dist/eve/index.js +128 -0
  45. package/dist/eve/index.js.map +1 -0
  46. package/dist/index.d.ts +7 -2
  47. package/dist/index.js +2 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/native/build.d.ts +112 -0
  50. package/dist/native/build.js +472 -0
  51. package/dist/native/build.js.map +1 -0
  52. package/dist/native/index.d.ts +67 -0
  53. package/dist/native/index.js +113 -0
  54. package/dist/native/index.js.map +1 -0
  55. package/dist/native/instance.d.ts +3 -0
  56. package/dist/native/instance.js +18 -0
  57. package/dist/native/instance.js.map +1 -0
  58. package/dist/react/agent-control.d.ts +2 -0
  59. package/dist/react/agent-control.js +1 -1
  60. package/dist/react/agent-control.js.map +1 -1
  61. package/dist/react/auth.d.ts +15 -1
  62. package/dist/react/auth.js +28 -5
  63. package/dist/react/auth.js.map +1 -1
  64. package/dist/react/hooks.d.ts +88 -0
  65. package/dist/react/hooks.js +188 -0
  66. package/dist/react/hooks.js.map +1 -0
  67. package/dist/react/index.d.ts +5 -88
  68. package/dist/react/index.js +3 -185
  69. package/dist/react/index.js.map +1 -1
  70. package/dist/runtime/agent-control.d.ts +10 -0
  71. package/dist/runtime/agent-control.js +9 -1
  72. package/dist/runtime/agent-control.js.map +1 -1
  73. package/dist/runtime/agent-run.d.ts +166 -0
  74. package/dist/runtime/agent-run.js +431 -0
  75. package/dist/runtime/agent-run.js.map +1 -0
  76. package/dist/runtime/agent.d.ts +158 -1
  77. package/dist/runtime/agent.js +329 -8
  78. package/dist/runtime/agent.js.map +1 -1
  79. package/dist/runtime/assemble.js +14 -1
  80. package/dist/runtime/assemble.js.map +1 -1
  81. package/dist/runtime/authority.d.ts +9 -0
  82. package/dist/runtime/authority.js.map +1 -1
  83. package/dist/runtime/context.d.ts +9 -0
  84. package/dist/runtime/required-capabilities.d.ts +73 -0
  85. package/dist/runtime/required-capabilities.js +69 -0
  86. package/dist/runtime/required-capabilities.js.map +1 -0
  87. package/dist/runtime/runtime.d.ts +70 -1
  88. package/dist/runtime/runtime.js +261 -9
  89. package/dist/runtime/runtime.js.map +1 -1
  90. package/dist/runtime/sessions.d.ts +1 -0
  91. package/dist/runtime/sessions.js +1 -1
  92. package/dist/runtime/sessions.js.map +1 -1
  93. package/dist/runtime/tenancy.d.ts +9 -1
  94. package/dist/runtime/tenancy.js +22 -0
  95. package/dist/runtime/tenancy.js.map +1 -1
  96. package/dist/runtime/transactions.d.ts +3 -1
  97. package/dist/runtime/transactions.js.map +1 -1
  98. package/dist/server/eve.d.ts +287 -0
  99. package/dist/server/eve.js +1071 -0
  100. package/dist/server/eve.js.map +1 -0
  101. package/dist/server/index.d.ts +2 -0
  102. package/dist/server/index.js +61 -4
  103. package/dist/server/index.js.map +1 -1
  104. package/dist/server/mcp.d.ts +7 -7
  105. package/dist/server/project.js +20 -3
  106. package/dist/server/project.js.map +1 -1
  107. package/dist/server/session-http.d.ts +7 -1
  108. package/dist/server/session-http.js +11 -1
  109. package/dist/server/session-http.js.map +1 -1
  110. package/dist/server/tenancy.d.ts +2 -0
  111. package/dist/server/tenancy.js +31 -1
  112. package/dist/server/tenancy.js.map +1 -1
  113. package/dist/testing/index.d.ts +1 -4
  114. package/dist/testing/index.js +2 -1
  115. package/dist/testing/index.js.map +1 -1
  116. package/docs/AGENT-CONTROL.md +36 -0
  117. package/docs/APPBOUNDRY.md +68 -2
  118. package/docs/AUTH.md +2 -0
  119. package/docs/EVE-COMPOSITION.md +75 -0
  120. package/docs/NATIVE-AGENTS.md +353 -0
  121. package/docs/NATIVE.md +137 -0
  122. package/docs/README.md +5 -2
  123. package/package.json +35 -9
  124. package/skills/.claude-plugin/marketplace.json +1 -1
  125. package/skills/.claude-plugin/plugin.json +1 -1
  126. package/skills/feltkit-agent/SKILL.md +1 -1
  127. package/skills/feltkit-build/SKILL.md +1 -1
  128. package/skills/feltkit-data/SKILL.md +1 -1
  129. package/skills/feltkit-operations/SKILL.md +1 -1
  130. package/skills/feltkit-services/SKILL.md +1 -1
  131. package/dist/dashboard/assets/index-BhxrvY37.js +0 -15
  132. package/dist/dashboard/assets/index-CSzYeCo_.css +0 -1
@@ -0,0 +1,112 @@
1
+ export type NativePlatform = "ios" | "android";
2
+ export declare const NATIVE_PLATFORMS: readonly NativePlatform[];
3
+ export type NativeKind = "project" | "bundle" | "native";
4
+ /**
5
+ * The one place native dependency versions are decided: Expo SDK 58's own set (what `npx expo install` resolves for it).
6
+ * A generated project depends on exactly these, so two builds of one project resolve the same native modules.
7
+ */
8
+ export declare const NATIVE_PINS: Readonly<Record<string, string>>;
9
+ /** `native/native.json`: what only the native app has (everything else comes from the project). */
10
+ export interface NativeConfig {
11
+ /** Name under the app's icon (default: the application's name, capitalised). */
12
+ name?: string;
13
+ /** iOS bundle identifier (default dev.feltkit.<application>: set your own before distributing). */
14
+ bundleIdentifier?: string;
15
+ /** Android application id (default: the bundle identifier). */
16
+ package?: string;
17
+ /** The URL scheme that opens the app (default: the application's name). */
18
+ scheme?: string;
19
+ /** The instance this app talks to. `--instance` and FELTKIT_URL win. */
20
+ instance?: string;
21
+ /** Extra native modules this app's own screens use, as { name: exact version }. */
22
+ dependencies?: Record<string, string>;
23
+ }
24
+ export interface NativeBuildOptions {
25
+ projectDir: string;
26
+ platform: NativePlatform;
27
+ /** Compile the native project (iOS Simulator / Android) after generating it. Default: stop at the JavaScript bundle. */
28
+ compile?: boolean;
29
+ /** Release configuration: the bundle is embedded and https is required. Default: Debug. */
30
+ release?: boolean;
31
+ /** Generate only: no install, no bundle. */
32
+ prepareOnly?: boolean;
33
+ /** Typecheck native/ with the Expo project's TypeScript before bundling (default true). */
34
+ typecheck?: boolean;
35
+ /** Skip `npm install` (the generated project must already have its node_modules). */
36
+ install?: boolean;
37
+ instance?: string;
38
+ /** Streams a tool's output while it runs. */
39
+ onOutput?: (text: string) => void;
40
+ }
41
+ export interface NativeBuildResult {
42
+ kind: NativeKind;
43
+ platform: NativePlatform;
44
+ application: string;
45
+ dir: string;
46
+ /** Per step: what ran and how long. */
47
+ steps: Array<{
48
+ name: string;
49
+ ms: number;
50
+ log?: string;
51
+ }>;
52
+ /** What was produced, as paths from the project. */
53
+ outputs: Array<{
54
+ what: string;
55
+ path: string;
56
+ bytes?: number;
57
+ }>;
58
+ identity: {
59
+ name: string;
60
+ id: string;
61
+ scheme: string;
62
+ version: string;
63
+ build: string;
64
+ };
65
+ instance: {
66
+ url: string;
67
+ source: string;
68
+ };
69
+ mode: "Debug" | "Release";
70
+ /** Sha-256 of everything generated and its inputs: equal inputs give an equal digest. */
71
+ digest: string;
72
+ warnings: string[];
73
+ /** What this build is not, in words a reader cannot mistake. */
74
+ notes: string[];
75
+ }
76
+ export declare function nativeDir(projectDir: string): string;
77
+ export declare function readNativeConfig(projectDir: string): NativeConfig;
78
+ /** A version the stores accept: 1 to 3 integers. The project's own version, which must be one. */
79
+ export declare function nativeVersion(version: unknown): string;
80
+ /** An integer build number from the version (1.2.3 → 10203): rises with the version, so a store accepts the upload. */
81
+ export declare function nativeBuildNumber(version: string): number;
82
+ export interface Toolchain {
83
+ ok: boolean;
84
+ problems: string[];
85
+ }
86
+ /**
87
+ * CocoaPods is a Ruby program, and a Ruby version manager's GEM_HOME / GEM_PATH (chruby, rbenv, rvm) point it at gems for a
88
+ * different Ruby: Homebrew's `pod` then fails with "Could not find 'nkf'". `pod` brings its own gems, so it runs without them.
89
+ */
90
+ export declare function podEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
91
+ /** What this machine needs to compile the platform's native project: named precisely, so a blocker is actionable. */
92
+ export declare function toolchainProblems(platform: NativePlatform, env?: NodeJS.ProcessEnv): string[];
93
+ /** The files of the application the native app is built from, hashed: what makes two builds "the same app". */
94
+ export declare function sourceDigest(projectDir: string): string;
95
+ interface Generated {
96
+ files: Record<string, string>;
97
+ digest: string;
98
+ }
99
+ /** The generated project's files as text: pure of the file system apart from what it is given, so tests can read it. */
100
+ export declare function generateFiles(input: {
101
+ application: string;
102
+ config: NativeConfig;
103
+ version: string;
104
+ platform: NativePlatform;
105
+ projectDir: string;
106
+ sdkDir: string;
107
+ instance: string;
108
+ source: string;
109
+ release: boolean;
110
+ }): Generated;
111
+ export declare function buildNative(options: NativeBuildOptions): Promise<NativeBuildResult>;
112
+ export {};
@@ -0,0 +1,472 @@
1
+ /**
2
+ * `feltkit build ios|android`: the application's native host, an Expo / React Native project generated from the
3
+ * project as it is (docs/NATIVE.md).
4
+ *
5
+ * What is the unit. The application is the project: `feltkit/` (functions, collections, capabilities, authorization),
6
+ * its generated `api`, any module the screens share, and `native/` (the native screens: `native/App.tsx`, and an
7
+ * optional `native/native.json` for identity). The Expo project under `.feltkit/native/` is derived from that and is
8
+ * thrown away freely, like `.feltkit/build/`. The backend does not move: a native app is a client of an instance, as
9
+ * the web app and the browser extension are.
10
+ *
11
+ * What the build says it produced, exactly one of (`kind`), never more than it did:
12
+ * project the Expo project was generated (nothing was compiled)
13
+ * bundle + dependencies installed and the JavaScript compiled to Hermes bytecode (`expo export`): proves the app
14
+ * and the FeltKit client bundle for that platform; not an installable app
15
+ * native + the native project (`expo prebuild`) was compiled for the iOS Simulator / an Android build
16
+ * (Debug needs Metro; --release embeds the bundle). Never signed for a store.
17
+ * Store builds (signing, provisioning, Play upload) are EAS's or Xcode's / Gradle's job: the build writes `eas.json`
18
+ * for them and does not run them.
19
+ */
20
+ import { spawn, spawnSync } from "node:child_process";
21
+ import { createHash } from "node:crypto";
22
+ import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
23
+ import { createRequire } from "node:module";
24
+ import { join, relative } from "node:path";
25
+ import { FeltKitError } from "../errors.js";
26
+ import { loadSources } from "../runtime/loader.js";
27
+ import { codegen, readPackageJson, SDK_VERSION } from "../server/project.js";
28
+ import { checkInstanceUrl } from "./instance.js";
29
+ export const NATIVE_PLATFORMS = ["ios", "android"];
30
+ /**
31
+ * The one place native dependency versions are decided: Expo SDK 58's own set (what `npx expo install` resolves for it).
32
+ * A generated project depends on exactly these, so two builds of one project resolve the same native modules.
33
+ */
34
+ export const NATIVE_PINS = {
35
+ expo: "58.0.26",
36
+ "expo-linking": "58.0.17",
37
+ "expo-secure-store": "58.0.3",
38
+ "expo-status-bar": "58.0.5",
39
+ react: "19.3.0",
40
+ "react-native": "0.88.1",
41
+ };
42
+ const DEV_PINS = { "@types/react": "19.3.0", typescript: "6.0.3" };
43
+ const GENERATED = join(".feltkit", "native");
44
+ const titleCase = (name) => name.replace(/[-_.]+/g, " ").replace(/\b\w/g, (m) => m.toUpperCase());
45
+ const slug = (name) => name.toLowerCase().replace(/[^a-z0-9]+/g, "");
46
+ export function nativeDir(projectDir) {
47
+ return join(projectDir, GENERATED);
48
+ }
49
+ export function readNativeConfig(projectDir) {
50
+ const file = join(projectDir, "native", "native.json");
51
+ if (!existsSync(file))
52
+ return {};
53
+ let value;
54
+ try {
55
+ value = JSON.parse(readFileSync(file, "utf8"));
56
+ }
57
+ catch (error) {
58
+ throw new FeltKitError("CONFIGURATION", `native/native.json is not valid JSON: ${error.message}`);
59
+ }
60
+ if (!value || typeof value !== "object" || Array.isArray(value))
61
+ throw new FeltKitError("CONFIGURATION", "native/native.json must be an object.");
62
+ const config = value;
63
+ const known = new Set(["name", "bundleIdentifier", "package", "scheme", "instance", "dependencies"]);
64
+ for (const key of Object.keys(config))
65
+ if (!known.has(key))
66
+ throw new FeltKitError("CONFIGURATION", `native/native.json: unknown key "${key}".`, { hint: `Known keys: ${[...known].join(", ")}.` });
67
+ for (const key of ["name", "bundleIdentifier", "package", "scheme", "instance"])
68
+ if (config[key] !== undefined && typeof config[key] !== "string")
69
+ throw new FeltKitError("CONFIGURATION", `native/native.json: "${key}" must be a string.`);
70
+ if (config.dependencies !== undefined) {
71
+ const d = config.dependencies;
72
+ if (!d || typeof d !== "object" || Array.isArray(d) || Object.values(d).some((v) => typeof v !== "string" || !/^\d+\.\d+\.\d+/.test(v))) {
73
+ throw new FeltKitError("CONFIGURATION", 'native/native.json: "dependencies" must map a package to an exact version (e.g. { "expo-image-picker": "58.0.2" }): builds are reproducible only with exact versions.');
74
+ }
75
+ for (const name of Object.keys(d))
76
+ if (name in NATIVE_PINS)
77
+ throw new FeltKitError("CONFIGURATION", `native/native.json: "${name}" is already pinned by FeltKit (${NATIVE_PINS[name]}).`);
78
+ }
79
+ return config;
80
+ }
81
+ const IDENTIFIER = /^[A-Za-z][A-Za-z0-9-]*(\.[A-Za-z][A-Za-z0-9-]*)+$/;
82
+ const ANDROID_ID = /^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)+$/;
83
+ const SCHEME = /^[a-z][a-z0-9+.-]*$/;
84
+ /** A version the stores accept: 1 to 3 integers. The project's own version, which must be one. */
85
+ export function nativeVersion(version) {
86
+ const text = typeof version === "string" ? version : "";
87
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(text);
88
+ if (!match)
89
+ throw new FeltKitError("CONFIGURATION", `package.json version "${text}" cannot be an app version.`, { hint: 'Set "version": "1.2.3" in package.json.' });
90
+ return `${match[1]}.${match[2]}.${match[3]}`;
91
+ }
92
+ /** An integer build number from the version (1.2.3 → 10203): rises with the version, so a store accepts the upload. */
93
+ export function nativeBuildNumber(version) {
94
+ const [major, minor, patch] = version.split(".").map(Number);
95
+ return major * 10000 + minor * 100 + patch;
96
+ }
97
+ /**
98
+ * CocoaPods is a Ruby program, and a Ruby version manager's GEM_HOME / GEM_PATH (chruby, rbenv, rvm) point it at gems for a
99
+ * different Ruby: Homebrew's `pod` then fails with "Could not find 'nkf'". `pod` brings its own gems, so it runs without them.
100
+ */
101
+ export function podEnv(env = process.env) {
102
+ const clean = { ...env, LANG: env.LANG ?? "en_US.UTF-8" };
103
+ for (const key of ["GEM_HOME", "GEM_PATH", "GEM_ROOT", "RUBYOPT", "RUBYLIB", "BUNDLE_GEMFILE"])
104
+ delete clean[key];
105
+ return clean;
106
+ }
107
+ /** Whether a tool runs: "missing" when it is not found, else the first line of why it failed. */
108
+ function probe(command, args, env) {
109
+ const result = spawnSync(command, args, { encoding: "utf8", env });
110
+ if (result.error?.code === "ENOENT")
111
+ return "missing";
112
+ if (result.status === 0)
113
+ return "ok";
114
+ return (result.stderr || result.stdout || `exit ${result.status}`).trim().split("\n")[0].slice(0, 200);
115
+ }
116
+ /** What this machine needs to compile the platform's native project: named precisely, so a blocker is actionable. */
117
+ export function toolchainProblems(platform, env = process.env) {
118
+ const problems = [];
119
+ const check = (what, command, args, install, withEnv = env) => {
120
+ const state = probe(command, args, withEnv);
121
+ if (state === "missing")
122
+ problems.push(`${what} is not installed: ${install}`);
123
+ else if (state !== "ok")
124
+ problems.push(`${what} is installed but does not run (\`${command} ${args.join(" ")}\`: ${state}).`);
125
+ };
126
+ if (platform === "ios") {
127
+ if (process.platform !== "darwin")
128
+ problems.push(`iOS builds need macOS with Xcode (this machine is ${process.platform}). Build in the cloud with EAS instead: \`cd .feltkit/native && npx eas-cli build -p ios\`.`);
129
+ else {
130
+ check("Xcode (xcodebuild)", "xcodebuild", ["-version"], "install Xcode and run `sudo xcode-select -s /Applications/Xcode.app`.");
131
+ check("CocoaPods", "pod", ["--version"], "`brew install cocoapods` (the iOS project's native modules are installed with it).", podEnv(env));
132
+ }
133
+ }
134
+ else {
135
+ const sdk = env.ANDROID_HOME ?? env.ANDROID_SDK_ROOT;
136
+ if (!sdk || !existsSync(sdk))
137
+ problems.push("The Android SDK is not set up: install Android Studio (or the command-line tools) and set ANDROID_HOME to the SDK directory.");
138
+ check("A JDK", "java", ["-version"], "Gradle needs JDK 17 (`brew install openjdk@17`).");
139
+ }
140
+ return problems;
141
+ }
142
+ function sha256(text) {
143
+ return createHash("sha256").update(text).digest("hex");
144
+ }
145
+ function walk(dir, skip = new Set(["node_modules", ".feltkit", "ios", "android", "dist"])) {
146
+ if (!existsSync(dir))
147
+ return [];
148
+ return readdirSync(dir, { withFileTypes: true }).flatMap((e) => (skip.has(e.name) ? [] : e.isDirectory() ? walk(join(dir, e.name), skip) : [join(dir, e.name)]));
149
+ }
150
+ /** The files of the application the native app is built from, hashed: what makes two builds "the same app". */
151
+ export function sourceDigest(projectDir) {
152
+ const files = [...walk(join(projectDir, "native")), ...walk(join(projectDir, "feltkit")), ...walk(join(projectDir, "shared"))].sort();
153
+ const hash = createHash("sha256");
154
+ for (const file of files)
155
+ hash.update(relative(projectDir, file)).update("\0").update(readFileSync(file)).update("\0");
156
+ return hash.digest("hex");
157
+ }
158
+ /** The generated project's files as text: pure of the file system apart from what it is given, so tests can read it. */
159
+ export function generateFiles(input) {
160
+ const { application, config, version, projectDir, sdkDir } = input;
161
+ const name = config.name ?? titleCase(application);
162
+ const bundleId = config.bundleIdentifier ?? `dev.feltkit.${slug(application) || "app"}`;
163
+ const androidId = config.package ?? bundleId.replace(/-/g, "_");
164
+ const scheme = config.scheme ?? (slug(application) || "app");
165
+ const rel = (p) => relative(join(projectDir, GENERATED), p).split("\\").join("/");
166
+ const dependencies = { ...NATIVE_PINS, ...(config.dependencies ?? {}), "@feltdb/feltkit": `file:${rel(sdkDir)}` };
167
+ const files = {};
168
+ files["package.json"] = JSON.stringify({ name: `${application}-native`, version, private: true, main: "index.ts", dependencies: sorted(dependencies), devDependencies: sorted(DEV_PINS) }, null, 2) + "\n";
169
+ files["app.json"] =
170
+ JSON.stringify({
171
+ expo: {
172
+ name,
173
+ slug: application,
174
+ version,
175
+ scheme,
176
+ orientation: "default",
177
+ userInterfaceStyle: "automatic",
178
+ newArchEnabled: true,
179
+ ios: { bundleIdentifier: bundleId, buildNumber: String(nativeBuildNumber(version)), supportsTablet: true, infoPlist: { ITSAppUsesNonExemptEncryption: false, ...(input.release ? {} : { NSAppTransportSecurity: { NSAllowsLocalNetworking: true } }) } },
180
+ android: { package: androidId, versionCode: nativeBuildNumber(version) },
181
+ plugins: ["expo-secure-store"],
182
+ },
183
+ }, null, 2) + "\n";
184
+ files["eas.json"] = JSON.stringify({ cli: { appVersionSource: "local" }, build: { development: { developmentClient: true, distribution: "internal" }, preview: { distribution: "internal" }, production: {} } }, null, 2) + "\n";
185
+ files[".env"] = `EXPO_PUBLIC_FELTKIT_URL=${input.instance}\nEXPO_PUBLIC_FELTKIT_APP=${application}\n`;
186
+ const screens = [rel(join(projectDir, "native")) + "/**/*", rel(join(projectDir, "shared")) + "/**/*", rel(join(projectDir, "feltkit", "_generated")) + "/**/*"];
187
+ // tsconfig.json is also read by Metro (Expo applies its `paths`), so it carries none. The screens live outside this project, so
188
+ // the typecheck (tsconfig.check.json) points their imports at its modules.
189
+ files["tsconfig.json"] = JSON.stringify({ extends: "expo/tsconfig.base", compilerOptions: { strict: true, noEmit: true, skipLibCheck: true, jsx: "react-jsx" }, include: ["*.ts", "*.tsx", ...screens] }, null, 2) + "\n";
190
+ files["tsconfig.check.json"] = JSON.stringify({ extends: "./tsconfig.json", compilerOptions: { paths: { react: ["./node_modules/@types/react"], "react/*": ["./node_modules/@types/react/*"], "react-native": ["./node_modules/react-native/types_generated/index.d.ts"], "expo*": ["./node_modules/expo*"] } } }, null, 2) + "\n";
191
+ files["metro.config.js"] = METRO(rel(projectDir), rel(sdkDir));
192
+ files["index.ts"] = `import { registerRootComponent } from "expo";\nimport { Host } from "./host";\nregisterRootComponent(Host);\n`;
193
+ files["host.tsx"] = HOST(rel(join(projectDir, "native", "App")));
194
+ const digest = sha256(JSON.stringify({ files, sdk: SDK_VERSION, pins: NATIVE_PINS, source: input.source }));
195
+ files["feltkit-native.json"] = JSON.stringify({ generatedBy: `@feltdb/feltkit ${SDK_VERSION}`, application, platform: input.platform, expo: NATIVE_PINS.expo, sourceDigest: input.source, digest }, null, 2) + "\n";
196
+ return { files, digest };
197
+ }
198
+ const sorted = (o) => Object.fromEntries(Object.entries(o).sort(([a], [b]) => a.localeCompare(b)));
199
+ const METRO = (projectRel, sdkRel) => `// Generated by feltkit build. The Expo project lives in .feltkit/native; the screens, the shared modules and feltkit/ are
200
+ // read from the project itself, so there is one copy of them. React and React Native are resolved from this project only:
201
+ // a second copy (the web app's React, the SDK's own) would break hooks.
202
+ const path = require("path");
203
+ const { getDefaultConfig } = require("expo/metro-config");
204
+ const config = getDefaultConfig(__dirname);
205
+ const project = path.resolve(__dirname, ${JSON.stringify(projectRel)});
206
+ const sdk = require("fs").realpathSync(path.resolve(__dirname, ${JSON.stringify(sdkRel)}));
207
+ config.watchFolders = [...(config.watchFolders || []), project, sdk];
208
+ config.resolver.nodeModulesPaths = [path.join(__dirname, "node_modules")];
209
+ config.resolver.disableHierarchicalLookup = true;
210
+ config.resolver.unstable_enablePackageExports = true;
211
+ const pinned = (name) => /^(react|react-native|expo|@expo\\/|expo-)/.test(name) || name === "react" || name.startsWith("react/") || name.startsWith("react-native/");
212
+ config.resolver.resolveRequest = (context, name, platform) => {
213
+ if (!name.startsWith(".") && !path.isAbsolute(name) && pinned(name)) return context.resolveRequest({ ...context, originModulePath: path.join(__dirname, "index.ts") }, name, platform);
214
+ return context.resolveRequest(context, name, platform);
215
+ };
216
+ module.exports = config;
217
+ `;
218
+ const HOST = (appRel) => `// Generated by feltkit build: the native host. It connects to the instance, holds the session in the Keychain / Keystore,
219
+ // reconnects live queries when the app returns to the foreground, hands e-mail links to the app, and shows loading and
220
+ // failure states. The screens are the project's own: native/App.tsx.
221
+ import { useCallback, useEffect, useState } from "react";
222
+ import { ActivityIndicator, AppState, Button, Platform, StyleSheet, Text, View } from "react-native";
223
+ import * as Linking from "expo-linking";
224
+ import * as SecureStore from "expo-secure-store";
225
+ import { StatusBar } from "expo-status-bar";
226
+ import { fetch as streamingFetch } from "expo/fetch";
227
+ import { createNativeClient, FeltKitProvider, handleDeepLink, type AuthRedirect, type FeltKitClient } from "@feltdb/feltkit/native";
228
+ import App from ${JSON.stringify(appRel)};
229
+
230
+ const application = process.env.EXPO_PUBLIC_FELTKIT_APP ?? "";
231
+ // A local \`feltkit dev\`: the iOS Simulator reaches this machine as localhost, an Android emulator as 10.0.2.2.
232
+ const instance = process.env.EXPO_PUBLIC_FELTKIT_URL || \`http://\${Platform.OS === "android" ? "10.0.2.2" : "localhost"}:3000\`;
233
+
234
+ let created: { client: FeltKitClient } | { error: string } | undefined;
235
+ function connection() {
236
+ if (!created) {
237
+ try {
238
+ created = { client: createNativeClient({ url: instance, secureStore: SecureStore, fetch: streamingFetch as unknown as typeof fetch, appState: AppState }) };
239
+ } catch (error) {
240
+ created = { error: error instanceof Error ? error.message : String(error) };
241
+ }
242
+ }
243
+ return created;
244
+ }
245
+
246
+ type State = { phase: "connecting" } | { phase: "ready" } | { phase: "failed"; message: string };
247
+
248
+ export function Host() {
249
+ const made = connection();
250
+ const [state, setState] = useState<State>({ phase: "connecting" });
251
+ const [link, setLink] = useState<AuthRedirect | null>(null);
252
+
253
+ const connect = useCallback(async () => {
254
+ if (!("client" in made)) return setState({ phase: "failed", message: made.error });
255
+ setState({ phase: "connecting" });
256
+ try {
257
+ const session = await made.client.session();
258
+ if (application && session.application !== application) setState({ phase: "failed", message: \`\${instance} serves "\${session.application}", not "\${application}".\` });
259
+ else setState({ phase: "ready" });
260
+ } catch (error) {
261
+ setState({ phase: "failed", message: \`Cannot reach \${instance}: \${error instanceof Error ? error.message : String(error)}\` });
262
+ }
263
+ }, [made]);
264
+
265
+ useEffect(() => {
266
+ void connect();
267
+ }, [connect]);
268
+
269
+ useEffect(() => {
270
+ if (!("client" in made)) return;
271
+ const open = (url: string | null) => {
272
+ if (url) void handleDeepLink(made.client, url).then((result) => result && setLink(result));
273
+ };
274
+ void Linking.getInitialURL().then(open);
275
+ const subscription = Linking.addEventListener("url", (event) => open(event.url));
276
+ return () => subscription.remove();
277
+ }, [made]);
278
+
279
+ if (state.phase === "connecting") {
280
+ return (
281
+ <View style={styles.center} accessibilityRole="progressbar" accessibilityLabel="Connecting">
282
+ <ActivityIndicator size="large" />
283
+ <Text style={styles.muted}>Connecting…</Text>
284
+ </View>
285
+ );
286
+ }
287
+ if (state.phase === "failed" || !("client" in made)) {
288
+ return (
289
+ <View style={styles.center} accessibilityRole="alert">
290
+ <Text style={styles.title}>Cannot start</Text>
291
+ <Text style={styles.muted}>{state.phase === "failed" ? state.message : ""}</Text>
292
+ <Button title="Try again" onPress={() => void connect()} />
293
+ </View>
294
+ );
295
+ }
296
+ return (
297
+ <FeltKitProvider client={made.client}>
298
+ <StatusBar style="auto" />
299
+ <App link={link} onLinkHandled={() => setLink(null)} />
300
+ </FeltKitProvider>
301
+ );
302
+ }
303
+
304
+ const styles = StyleSheet.create({
305
+ center: { flex: 1, alignItems: "center", justifyContent: "center", padding: 24, gap: 12 },
306
+ title: { fontSize: 20, fontWeight: "600" },
307
+ muted: { opacity: 0.6, textAlign: "center" },
308
+ });
309
+ `;
310
+ async function run(command, args, options) {
311
+ mkdirSync(join(options.cwd, "logs"), { recursive: true });
312
+ const chunks = [];
313
+ const code = await new Promise((done, fail) => {
314
+ const child = spawn(command, args, { cwd: options.cwd, env: { ...(options.env ?? process.env), CI: "1", EXPO_NO_TELEMETRY: "1" }, stdio: ["ignore", "pipe", "pipe"] });
315
+ const take = (data) => {
316
+ const text = data.toString();
317
+ chunks.push(text);
318
+ options.onOutput?.(text);
319
+ };
320
+ child.stdout.on("data", take);
321
+ child.stderr.on("data", take);
322
+ child.on("error", fail);
323
+ child.on("close", (status) => done(status ?? 1));
324
+ });
325
+ writeFileSync(options.log, chunks.join(""));
326
+ if (code !== 0) {
327
+ const tail = chunks.join("").trim().split("\n").slice(-25).join("\n");
328
+ throw new FeltKitError("CONFIGURATION", `\`${command} ${args.join(" ")}\` failed (exit ${code}).\n${tail}`, { hint: `The full output is in ${relative(process.cwd(), options.log)}.` });
329
+ }
330
+ }
331
+ function writeIfChanged(file, content) {
332
+ if (existsSync(file) && readFileSync(file, "utf8") === content)
333
+ return false;
334
+ mkdirSync(join(file, ".."), { recursive: true });
335
+ writeFileSync(file, content);
336
+ return true;
337
+ }
338
+ function sdkRoot(projectDir) {
339
+ // The SDK this CLI is: the project's installed copy when there is one (what its screens import), else the running one.
340
+ try {
341
+ const require = createRequire(join(projectDir, "package.json"));
342
+ return realpathSync(join(require.resolve("@feltdb/feltkit/package.json"), ".."));
343
+ }
344
+ catch {
345
+ return realpathSync(join(new URL("../..", import.meta.url).pathname));
346
+ }
347
+ }
348
+ export async function buildNative(options) {
349
+ const { projectDir, platform } = options;
350
+ const warnings = [];
351
+ const steps = [];
352
+ const timed = async (name, work, log) => {
353
+ const start = Date.now();
354
+ const value = await work();
355
+ steps.push({ name, ms: Date.now() - start, ...(log ? { log } : {}) });
356
+ return value;
357
+ };
358
+ // 1. The application.
359
+ const pkg = readPackageJson(projectDir);
360
+ if (!existsSync(join(projectDir, "feltkit", "app.ts")))
361
+ throw new FeltKitError("CONFIGURATION", "This is not a FeltKit application: there is no feltkit/app.ts.", { hint: "Run from the project's root, or create one with `npm create feltkit`." });
362
+ if (!existsSync(join(projectDir, "native", "App.tsx"))) {
363
+ throw new FeltKitError("CONFIGURATION", `${platform} builds need the application's native screens: native/App.tsx.`, { hint: "Default-export a component from native/App.tsx (it receives NativeAppProps). See docs/NATIVE.md, or examples/tasks/native." });
364
+ }
365
+ const config = readNativeConfig(projectDir);
366
+ codegen(projectDir);
367
+ const loaded = await loadSources(projectDir);
368
+ const application = loaded.app.name;
369
+ const version = nativeVersion(pkg.version);
370
+ const release = options.release === true;
371
+ // 2. Identity and environment: validated before anything is written.
372
+ const name = config.name ?? titleCase(application);
373
+ const bundleId = config.bundleIdentifier ?? `dev.feltkit.${slug(application) || "app"}`;
374
+ const androidId = config.package ?? bundleId.replace(/-/g, "_");
375
+ const scheme = config.scheme ?? (slug(application) || "app");
376
+ if (!IDENTIFIER.test(bundleId))
377
+ throw new FeltKitError("CONFIGURATION", `bundleIdentifier "${bundleId}" is not a reverse-DNS identifier (com.example.app).`);
378
+ if (!ANDROID_ID.test(androidId))
379
+ throw new FeltKitError("CONFIGURATION", `Android package "${androidId}" is not valid (letters, digits and underscores in dot-separated segments, such as com.example.app).`);
380
+ if (!SCHEME.test(scheme))
381
+ throw new FeltKitError("CONFIGURATION", `scheme "${scheme}" must be lowercase letters, digits, "+", "." or "-", starting with a letter.`);
382
+ if (!config.bundleIdentifier)
383
+ warnings.push(`No bundleIdentifier in native/native.json: using ${bundleId}. Set your own before you distribute.`);
384
+ let instance = null;
385
+ const fromOption = options.instance ?? process.env.FELTKIT_URL;
386
+ const candidate = fromOption ?? config.instance;
387
+ if (candidate) {
388
+ try {
389
+ instance = { url: checkInstanceUrl(candidate), source: options.instance ? "--instance" : process.env.FELTKIT_URL ? "FELTKIT_URL" : "native/native.json" };
390
+ }
391
+ catch (error) {
392
+ throw new FeltKitError("CONFIGURATION", error.message, { hint: "feltkit build ios --instance https://your-app.example.com" });
393
+ }
394
+ }
395
+ if (release && (!instance || !instance.url.startsWith("https://")))
396
+ throw new FeltKitError("CONFIGURATION", "A release build must name its instance, over https.", { hint: "feltkit build ios --release --instance https://your-app.example.com" });
397
+ const resolvedInstance = instance ?? { url: "", source: "development default (localhost, or 10.0.2.2 on an Android emulator)" };
398
+ // 3. The generated Expo project.
399
+ const dir = nativeDir(projectDir);
400
+ const sdkDir = sdkRoot(projectDir);
401
+ const generated = generateFiles({ application, config, version, platform, projectDir, sdkDir, instance: resolvedInstance.url, source: sourceDigest(projectDir), release });
402
+ await timed("generate Expo project", () => {
403
+ mkdirSync(dir, { recursive: true });
404
+ let any = false;
405
+ for (const [file, content] of Object.entries(generated.files))
406
+ any = writeIfChanged(join(dir, file), content) || any;
407
+ return any;
408
+ });
409
+ const outputs = [{ what: "Expo project", path: relative(projectDir, dir) }];
410
+ const mode = release ? "Release" : "Debug";
411
+ const base = { platform, application, dir, steps, outputs, identity: { name, id: platform === "ios" ? bundleId : androidId, scheme, version, build: String(nativeBuildNumber(version)) }, instance: resolvedInstance, mode, digest: generated.digest, warnings };
412
+ if (options.prepareOnly)
413
+ return { ...base, kind: "project", notes: ["The Expo project was generated. Nothing was installed or compiled."] };
414
+ // 4. Dependencies, then the JavaScript bundle.
415
+ const logs = join(dir, "logs");
416
+ if (options.install !== false) {
417
+ const lock = join(dir, "node_modules", ".package-lock.json");
418
+ const stale = !existsSync(lock) || statSync(lock).mtimeMs < statSync(join(dir, "package.json")).mtimeMs;
419
+ if (stale)
420
+ await timed("install dependencies", () => run("npm", ["install", "--no-audit", "--no-fund", "--legacy-peer-deps"], { cwd: dir, log: join(logs, "install.log"), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/install.log");
421
+ }
422
+ if (!existsSync(join(dir, "node_modules", ".bin", "expo")))
423
+ throw new FeltKitError("CONFIGURATION", "The Expo project has no dependencies installed.", { hint: `cd ${relative(process.cwd(), dir) || "."} && npm install` });
424
+ // Metro does not typecheck. The screens live outside the Expo project, so their imports are pointed at its modules.
425
+ if (options.typecheck !== false)
426
+ await timed("typecheck native screens", () => run(join(dir, "node_modules", ".bin", "tsc"), ["--noEmit", "-p", "tsconfig.check.json"], { cwd: dir, log: join(logs, "typecheck.log"), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/typecheck.log");
427
+ const dist = join(dir, "dist", platform);
428
+ rmSync(dist, { recursive: true, force: true });
429
+ await timed("compile JavaScript (Hermes bytecode)", () => run(join(dir, "node_modules", ".bin", "expo"), ["export", "--platform", platform, "--output-dir", dist], { cwd: dir, log: join(logs, "export.log"), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/export.log");
430
+ const bundle = walk(dist, new Set()).find((f) => f.endsWith(".hbc"));
431
+ if (!bundle)
432
+ throw new FeltKitError("CONFIGURATION", "expo export produced no Hermes bundle.", { hint: `See ${relative(process.cwd(), join(logs, "export.log"))}.` });
433
+ outputs.push({ what: "Hermes bundle", path: relative(projectDir, bundle), bytes: statSync(bundle).size });
434
+ if (!options.compile)
435
+ return { ...base, kind: "bundle", notes: ["A JavaScript bundle for the platform was compiled (the app and the FeltKit client bundle). It is not an installable app: add --compile."] };
436
+ const notes = [];
437
+ // 5. The native project, compiled.
438
+ const problems = toolchainProblems(platform);
439
+ if (problems.length)
440
+ throw new FeltKitError("CONFIGURATION", `Cannot compile for ${platform} on this machine:\n - ${problems.join("\n - ")}`, { hint: "The JavaScript bundle above was built; the native compile needs this toolchain." });
441
+ await timed("generate native project (expo prebuild)", () => run(join(dir, "node_modules", ".bin", "expo"), ["prebuild", "--platform", platform, "--no-install"], { cwd: dir, log: join(logs, "prebuild.log"), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/prebuild.log");
442
+ if (platform === "ios") {
443
+ await timed("install pods", () => run("pod", ["install"], { cwd: join(dir, "ios"), log: join(logs, "pods.log"), env: podEnv(), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/pods.log");
444
+ const workspace = readdirSync(join(dir, "ios")).find((f) => f.endsWith(".xcworkspace"));
445
+ if (!workspace)
446
+ throw new FeltKitError("CONFIGURATION", "expo prebuild made no Xcode workspace.");
447
+ const scheme = workspace.replace(/\.xcworkspace$/, "");
448
+ const derived = join(dir, "build", "ios");
449
+ await timed(`xcodebuild (iOS Simulator, ${mode})`, () => run("xcodebuild", ["-workspace", join("ios", workspace), "-scheme", scheme, "-configuration", mode, "-sdk", "iphonesimulator", "-destination", "generic/platform=iOS Simulator", "-derivedDataPath", derived, "CODE_SIGNING_ALLOWED=NO", "build"], { cwd: dir, log: join(logs, "xcodebuild.log"), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/xcodebuild.log");
450
+ const app = join(derived, "Build", "Products", `${mode}-iphonesimulator`, `${scheme}.app`);
451
+ if (!existsSync(app))
452
+ throw new FeltKitError("CONFIGURATION", `xcodebuild finished but ${relative(process.cwd(), app)} does not exist.`);
453
+ outputs.push({ what: `iOS Simulator app (${mode}, unsigned)`, path: relative(projectDir, app) });
454
+ notes.push(`An iOS Simulator app (${mode}) was compiled. It runs on the Simulator only: it is not signed, and cannot be installed on a device or submitted to the App Store.`);
455
+ if (!release)
456
+ notes.push("A Debug app loads its JavaScript from Metro: start it with `npx expo start` in the Expo project.");
457
+ }
458
+ else {
459
+ const gradle = join(dir, "android", process.platform === "win32" ? "gradlew.bat" : "gradlew");
460
+ await timed(`gradle assemble${mode} (Android)`, () => run(gradle, [`assemble${mode}`], { cwd: join(dir, "android"), log: join(logs, "gradle.log"), ...(options.onOutput ? { onOutput: options.onOutput } : {}) }), "logs/gradle.log");
461
+ const apk = walk(join(dir, "android", "app", "build", "outputs", "apk"), new Set()).find((f) => f.endsWith(".apk"));
462
+ if (!apk)
463
+ throw new FeltKitError("CONFIGURATION", "Gradle finished but produced no APK.");
464
+ outputs.push({ what: `Android APK (${mode}, debug-signed)`, path: relative(projectDir, apk), bytes: statSync(apk).size });
465
+ notes.push(`An Android ${mode} APK was compiled with the debug signing key. It installs on an emulator or a device with developer mode: it cannot be uploaded to Google Play.`);
466
+ if (!release)
467
+ notes.push("A Debug APK loads its JavaScript from Metro: start it with `npx expo start` in the Expo project.");
468
+ }
469
+ notes.push("Distribution (signing, App Store Connect, Google Play) is not done by FeltKit: eas.json is in the Expo project for `npx eas-cli build`.");
470
+ return { ...base, kind: "native", notes };
471
+ }
472
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/native/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1H,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,s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