@feltdb/feltkit 0.0.0-stage → 0.2.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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -2
  3. package/bin/feltkit.js +3 -0
  4. package/dist/app.d.ts +247 -0
  5. package/dist/app.js +181 -0
  6. package/dist/app.js.map +1 -0
  7. package/dist/cli/deploy.d.ts +8 -0
  8. package/dist/cli/deploy.js +125 -0
  9. package/dist/cli/deploy.js.map +1 -0
  10. package/dist/cli/main.d.ts +9 -0
  11. package/dist/cli/main.js +581 -0
  12. package/dist/cli/main.js.map +1 -0
  13. package/dist/cli/output.d.ts +18 -0
  14. package/dist/cli/output.js +87 -0
  15. package/dist/cli/output.js.map +1 -0
  16. package/dist/cli/skills.d.ts +39 -0
  17. package/dist/cli/skills.js +125 -0
  18. package/dist/cli/skills.js.map +1 -0
  19. package/dist/client/index.d.ts +125 -0
  20. package/dist/client/index.js +306 -0
  21. package/dist/client/index.js.map +1 -0
  22. package/dist/dashboard/assets/index--1Tqbv_A.css +1 -0
  23. package/dist/dashboard/assets/index-Bm4qCYpv.js +15 -0
  24. package/dist/dashboard/index.html +16 -0
  25. package/dist/errors.d.ts +33 -0
  26. package/dist/errors.js +56 -0
  27. package/dist/errors.js.map +1 -0
  28. package/dist/index.d.ts +18 -0
  29. package/dist/index.js +12 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/react/index.d.ts +40 -0
  32. package/dist/react/index.js +85 -0
  33. package/dist/react/index.js.map +1 -0
  34. package/dist/runtime/activity.d.ts +110 -0
  35. package/dist/runtime/activity.js +113 -0
  36. package/dist/runtime/activity.js.map +1 -0
  37. package/dist/runtime/agent.d.ts +353 -0
  38. package/dist/runtime/agent.js +1345 -0
  39. package/dist/runtime/agent.js.map +1 -0
  40. package/dist/runtime/authority.d.ts +98 -0
  41. package/dist/runtime/authority.js +240 -0
  42. package/dist/runtime/authority.js.map +1 -0
  43. package/dist/runtime/changes.d.ts +42 -0
  44. package/dist/runtime/changes.js +85 -0
  45. package/dist/runtime/changes.js.map +1 -0
  46. package/dist/runtime/content.d.ts +33 -0
  47. package/dist/runtime/content.js +46 -0
  48. package/dist/runtime/content.js.map +1 -0
  49. package/dist/runtime/context.d.ts +76 -0
  50. package/dist/runtime/context.js +2 -0
  51. package/dist/runtime/context.js.map +1 -0
  52. package/dist/runtime/credentials.d.ts +42 -0
  53. package/dist/runtime/credentials.js +32 -0
  54. package/dist/runtime/credentials.js.map +1 -0
  55. package/dist/runtime/data.d.ts +145 -0
  56. package/dist/runtime/data.js +439 -0
  57. package/dist/runtime/data.js.map +1 -0
  58. package/dist/runtime/decisions.d.ts +131 -0
  59. package/dist/runtime/decisions.js +301 -0
  60. package/dist/runtime/decisions.js.map +1 -0
  61. package/dist/runtime/environment.d.ts +36 -0
  62. package/dist/runtime/environment.js +73 -0
  63. package/dist/runtime/environment.js.map +1 -0
  64. package/dist/runtime/idempotency.d.ts +37 -0
  65. package/dist/runtime/idempotency.js +88 -0
  66. package/dist/runtime/idempotency.js.map +1 -0
  67. package/dist/runtime/instance.d.ts +82 -0
  68. package/dist/runtime/instance.js +253 -0
  69. package/dist/runtime/instance.js.map +1 -0
  70. package/dist/runtime/integrations.d.ts +120 -0
  71. package/dist/runtime/integrations.js +412 -0
  72. package/dist/runtime/integrations.js.map +1 -0
  73. package/dist/runtime/loader.d.ts +15 -0
  74. package/dist/runtime/loader.js +121 -0
  75. package/dist/runtime/loader.js.map +1 -0
  76. package/dist/runtime/projects.d.ts +52 -0
  77. package/dist/runtime/projects.js +141 -0
  78. package/dist/runtime/projects.js.map +1 -0
  79. package/dist/runtime/readiness.d.ts +29 -0
  80. package/dist/runtime/readiness.js +154 -0
  81. package/dist/runtime/readiness.js.map +1 -0
  82. package/dist/runtime/runtime.d.ts +227 -0
  83. package/dist/runtime/runtime.js +664 -0
  84. package/dist/runtime/runtime.js.map +1 -0
  85. package/dist/runtime/services.d.ts +327 -0
  86. package/dist/runtime/services.js +686 -0
  87. package/dist/runtime/services.js.map +1 -0
  88. package/dist/runtime/sessions.d.ts +44 -0
  89. package/dist/runtime/sessions.js +109 -0
  90. package/dist/runtime/sessions.js.map +1 -0
  91. package/dist/schema.d.ts +56 -0
  92. package/dist/schema.js +44 -0
  93. package/dist/schema.js.map +1 -0
  94. package/dist/server/admin.d.ts +141 -0
  95. package/dist/server/admin.js +828 -0
  96. package/dist/server/admin.js.map +1 -0
  97. package/dist/server/http.d.ts +19 -0
  98. package/dist/server/http.js +99 -0
  99. package/dist/server/http.js.map +1 -0
  100. package/dist/server/index.d.ts +54 -0
  101. package/dist/server/index.js +305 -0
  102. package/dist/server/index.js.map +1 -0
  103. package/dist/server/management.d.ts +12 -0
  104. package/dist/server/management.js +177 -0
  105. package/dist/server/management.js.map +1 -0
  106. package/dist/server/mcp.d.ts +214 -0
  107. package/dist/server/mcp.js +135 -0
  108. package/dist/server/mcp.js.map +1 -0
  109. package/dist/server/operators.d.ts +77 -0
  110. package/dist/server/operators.js +162 -0
  111. package/dist/server/operators.js.map +1 -0
  112. package/dist/server/project.d.ts +60 -0
  113. package/dist/server/project.js +344 -0
  114. package/dist/server/project.js.map +1 -0
  115. package/dist/server/public.d.ts +14 -0
  116. package/dist/server/public.js +15 -0
  117. package/dist/server/public.js.map +1 -0
  118. package/dist/testing/index.d.ts +20 -0
  119. package/dist/testing/index.js +65 -0
  120. package/dist/testing/index.js.map +1 -0
  121. package/package.json +91 -4
  122. package/skills/.claude-plugin/marketplace.json +16 -0
  123. package/skills/.claude-plugin/plugin.json +24 -0
  124. package/skills/README.md +44 -0
  125. package/skills/feltkit-agent/SKILL.md +84 -0
  126. package/skills/feltkit-build/SKILL.md +143 -0
  127. package/skills/feltkit-data/SKILL.md +79 -0
  128. package/skills/feltkit-operations/SKILL.md +72 -0
  129. package/skills/feltkit-services/SKILL.md +102 -0
@@ -0,0 +1,52 @@
1
+ import type { InstanceIdentity } from "./instance.js";
2
+ import type { FeltKitRuntime } from "./runtime.js";
3
+ export interface RuntimeRecord {
4
+ pid: number;
5
+ url: string;
6
+ environment: string;
7
+ application: string;
8
+ startedAt: string;
9
+ instance: InstanceIdentity;
10
+ }
11
+ export declare function writeAtomic(path: string, content: string, mode?: number): void;
12
+ export declare function adminToken(runtimeDir: string): string;
13
+ export declare function readAdminToken(runtimeDir: string): string | null;
14
+ export declare function isAlive(pid: number): boolean;
15
+ /** The live owner of an environment, or null. Stale records (dead pid) are ignored. */
16
+ export declare function readRuntimeRecord(runtimeDir: string): RuntimeRecord | null;
17
+ export declare function writeRuntimeRecord(runtimeDir: string, record: RuntimeRecord): void;
18
+ export declare function clearRuntimeRecord(runtimeDir: string): void;
19
+ export interface ProjectEntry {
20
+ name: string;
21
+ path: string;
22
+ lastRunAt: string;
23
+ lastEnvironment: string;
24
+ lastUrl?: string;
25
+ }
26
+ export declare function listProjects(): Array<ProjectEntry & {
27
+ running: boolean;
28
+ url?: string;
29
+ exists: boolean;
30
+ }>;
31
+ export declare function registerProject(entry: ProjectEntry): void;
32
+ /** How each environment is configured from here. Credentials are never included. */
33
+ export declare function describeEnvironments(projectDir: string, runtime: FeltKitRuntime): {
34
+ active: import("./environment.js").EnvironmentName;
35
+ environments: ({
36
+ name: "development" | "production" | "test";
37
+ active: boolean;
38
+ storage: string;
39
+ location: string;
40
+ durable: boolean;
41
+ instanceId: string;
42
+ development: boolean;
43
+ } | {
44
+ name: string;
45
+ active: boolean;
46
+ storage: string;
47
+ location: string;
48
+ durable: boolean;
49
+ instanceId: null;
50
+ development: boolean;
51
+ })[];
52
+ };
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Local bookkeeping outside application state:
3
+ *
4
+ * .feltkit/<env>/admin-token random admin credential for the dashboard (0600)
5
+ * .feltkit/<env>/runtime.json the running server for an environment (pid, URL), for discovery
6
+ * ~/.feltkit/projects.json projects this machine has run (for the Projects screen)
7
+ *
8
+ * None of this is application data, so none of it lives in FeltDB. The runtime record
9
+ * is how the CLI finds a running server and talks to it instead of opening the state
10
+ * itself. It is not the guard: FeltDB's owner lock refuses a second process on local
11
+ * state (see runtime/instance.ts).
12
+ */
13
+ import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
14
+ import { randomBytes } from "node:crypto";
15
+ import { homedir } from "node:os";
16
+ import { join, resolve } from "node:path";
17
+ import { describeStorage, resolveEnvironment } from "./environment.js";
18
+ export function writeAtomic(path, content, mode) {
19
+ const temp = `${path}.${process.pid}.tmp`;
20
+ writeFileSync(temp, content, mode === undefined ? undefined : { mode });
21
+ renameSync(temp, path);
22
+ if (mode !== undefined)
23
+ chmodSync(path, mode);
24
+ }
25
+ export function adminToken(runtimeDir) {
26
+ mkdirSync(runtimeDir, { recursive: true });
27
+ const file = join(runtimeDir, "admin-token");
28
+ if (existsSync(file)) {
29
+ const token = readFileSync(file, "utf8").trim();
30
+ if (/^fka_[A-Za-z0-9_-]{40,}$/.test(token))
31
+ return token;
32
+ }
33
+ const token = `fka_${randomBytes(32).toString("base64url")}`;
34
+ writeAtomic(file, `${token}\n`, 0o600);
35
+ return token;
36
+ }
37
+ export function readAdminToken(runtimeDir) {
38
+ const file = join(runtimeDir, "admin-token");
39
+ return existsSync(file) ? readFileSync(file, "utf8").trim() : null;
40
+ }
41
+ export function isAlive(pid) {
42
+ try {
43
+ process.kill(pid, 0);
44
+ return true;
45
+ }
46
+ catch (error) {
47
+ return error.code === "EPERM";
48
+ }
49
+ }
50
+ /** The live owner of an environment, or null. Stale records (dead pid) are ignored. */
51
+ export function readRuntimeRecord(runtimeDir) {
52
+ const file = join(runtimeDir, "runtime.json");
53
+ if (!existsSync(file))
54
+ return null;
55
+ try {
56
+ const record = JSON.parse(readFileSync(file, "utf8"));
57
+ return isAlive(record.pid) ? record : null;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ export function writeRuntimeRecord(runtimeDir, record) {
64
+ mkdirSync(runtimeDir, { recursive: true });
65
+ writeAtomic(join(runtimeDir, "runtime.json"), JSON.stringify(record, null, 2));
66
+ }
67
+ export function clearRuntimeRecord(runtimeDir) {
68
+ const file = join(runtimeDir, "runtime.json");
69
+ try {
70
+ const record = JSON.parse(readFileSync(file, "utf8"));
71
+ if (record.pid === process.pid)
72
+ rmSync(file, { force: true });
73
+ }
74
+ catch {
75
+ /* nothing to clear */
76
+ }
77
+ }
78
+ function home() {
79
+ return process.env.FELTKIT_HOME ?? join(homedir(), ".feltkit");
80
+ }
81
+ export function listProjects() {
82
+ let entries = [];
83
+ try {
84
+ entries = JSON.parse(readFileSync(join(home(), "projects.json"), "utf8")).projects ?? [];
85
+ }
86
+ catch {
87
+ entries = [];
88
+ }
89
+ return entries
90
+ .map((entry) => {
91
+ const record = readRuntimeRecord(join(entry.path, ".feltkit", "development"));
92
+ return { ...entry, exists: existsSync(entry.path), running: Boolean(record), ...(record ? { url: record.url } : {}) };
93
+ })
94
+ .sort((a, b) => b.lastRunAt.localeCompare(a.lastRunAt));
95
+ }
96
+ export function registerProject(entry) {
97
+ if (process.env.FELTKIT_NO_REGISTRY === "1")
98
+ return;
99
+ try {
100
+ mkdirSync(home(), { recursive: true });
101
+ const file = join(home(), "projects.json");
102
+ let projects = [];
103
+ try {
104
+ projects = JSON.parse(readFileSync(file, "utf8")).projects ?? [];
105
+ }
106
+ catch {
107
+ projects = [];
108
+ }
109
+ const path = resolve(entry.path);
110
+ projects = [{ ...entry, path }, ...projects.filter((p) => p.path !== path)].slice(0, 50);
111
+ writeAtomic(file, JSON.stringify({ projects }, null, 2));
112
+ }
113
+ catch {
114
+ /* the registry is a convenience; failing to write it never blocks a run */
115
+ }
116
+ }
117
+ /** How each environment is configured from here. Credentials are never included. */
118
+ export function describeEnvironments(projectDir, runtime) {
119
+ const names = ["development", "test", "production"];
120
+ return {
121
+ active: runtime.environment.name,
122
+ environments: names.map((name) => {
123
+ if (name === runtime.environment.name) {
124
+ const storage = describeStorage(runtime.environment.storage);
125
+ return { name, active: true, storage: storage.kind, location: storage.location, durable: storage.durable, instanceId: runtime.instance.identity.instanceId, development: runtime.environment.development };
126
+ }
127
+ if (name === "test") {
128
+ return { name, active: false, storage: "local", location: "A new temporary directory for each test runtime", durable: true, instanceId: null, development: true };
129
+ }
130
+ try {
131
+ const env = resolveEnvironment({ projectDir, appName: runtime.app.name, name, env: process.env });
132
+ const storage = describeStorage(env.storage);
133
+ return { name, active: false, storage: storage.kind, location: storage.location, durable: storage.durable, instanceId: null, development: env.development };
134
+ }
135
+ catch (error) {
136
+ return { name, active: false, storage: "unconfigured", location: error.message, durable: false, instanceId: null, development: false };
137
+ }
138
+ }),
139
+ };
140
+ }
141
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/runtime/projects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAavE,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,OAAe,EAAE,IAAa;IACtE,MAAM,IAAI,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC;IAC1C,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACxE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,KAAK,SA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
4
+ id: string;
5
+ area: "persistence" | "secrets" | "identity" | "authority" | "model" | "integrations" | "recovery" | "background" | "deployment" | "operations";
6
+ title: string;
7
+ status: CheckStatus;
8
+ detail: string;
9
+ fix?: string;
10
+ }
11
+ export interface ReadinessReport {
12
+ application: string;
13
+ environment: {
14
+ name: string;
15
+ production: boolean;
16
+ };
17
+ checkedAt: string;
18
+ counts: Record<CheckStatus, number>;
19
+ /** A sentence that never overstates: failures first, then what is left unverified. */
20
+ summary: string;
21
+ checks: ReadinessCheck[];
22
+ }
23
+ export interface ReadinessOptions {
24
+ /** The project directory, when known (CLI): enables the build check. */
25
+ projectDir?: string;
26
+ /** Whether Studio is served in this deployment (FELTKIT_DASHBOARD=1 in production). */
27
+ dashboard?: boolean;
28
+ }
29
+ export declare function assessReadiness(runtime: FeltKitRuntime, options?: ReadinessOptions): Promise<ReadinessReport>;
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Readiness: what this environment has, what it lacks, and what FeltKit cannot know.
3
+ *
4
+ * Every check is computed from the running environment (its FeltDB instance, services,
5
+ * model selection, integrations, roles, process environment, and open work). Each result
6
+ * is one of:
7
+ *
8
+ * pass verified here, now
9
+ * fail verified to be wrong, with the fix
10
+ * warn works, with a risk a person should accept or fix
11
+ * external an operational requirement FeltKit does not provide and cannot verify
12
+ * (TLS, backups, monitoring, rate limiting, …)
13
+ *
14
+ * No result says an application is "production-ready": passing checks mean the checked
15
+ * things are in place, not that the external requirements are met.
16
+ */
17
+ import { existsSync } from "node:fs";
18
+ import { join } from "node:path";
19
+ import { lintIntegration } from "@appport/protocol";
20
+ import { describeStorage } from "./environment.js";
21
+ const GUIDE = "docs/PATH-TO-PRODUCTION.md";
22
+ export async function assessReadiness(runtime, options = {}) {
23
+ const checks = [];
24
+ const add = (check) => checks.push(check);
25
+ const production = runtime.environment.production;
26
+ const env = runtime.environment.name;
27
+ // Persistence and recovery of state.
28
+ const storage = describeStorage(runtime.environment.storage);
29
+ add(storage.kind === "memory"
30
+ ? { id: "persistence.storage", area: "persistence", title: "Durable storage", status: "fail", detail: "State is in memory and is lost when the process stops.", fix: "Use a local state directory (FELTKIT_STATE_DIR) or a FeltDB server (FELTDB_URL + FELTDB_TOKEN)." }
31
+ : { id: "persistence.storage", area: "persistence", title: "Durable storage", status: "pass", detail: `FeltDB ${storage.kind} storage at ${storage.location}; the instance answered when this runtime opened it.${storage.kind === "local" ? " Local state lives on one host." : ""}` });
32
+ add({ id: "persistence.idempotency", area: "persistence", title: "Duplicate-request protection", status: "pass", detail: "Every mutation capability declares AppPort idempotency; replay records are kept in FeltDB and survive restarts." });
33
+ // Secrets: every credential reference the environment uses resolves.
34
+ const refs = new Map();
35
+ for (const r of await runtime.services.credentialReferences())
36
+ refs.set(r.ref, r.usedBy);
37
+ const model = await runtime.models.status();
38
+ if (model.credential.ref)
39
+ refs.set(model.credential.ref, [...(refs.get(model.credential.ref) ?? []), `model ${model.provider}`]);
40
+ for (const integration of runtime.integrations.definitions()) {
41
+ const s = runtime.integrations.status(integration);
42
+ if (s.credential)
43
+ refs.set(s.credential.ref, [...(refs.get(s.credential.ref) ?? []), `integration ${integration.name}`]);
44
+ }
45
+ if (!refs.size)
46
+ add({ id: "secrets.credentials", area: "secrets", title: "Credential references", status: "pass", detail: "No credential references are in use." });
47
+ for (const [ref, usedBy] of refs) {
48
+ const d = runtime.services.credentials.describe(ref);
49
+ add(d.present
50
+ ? { id: `secrets.${ref}`, area: "secrets", title: `Credential ${ref}`, status: "pass", detail: `Resolves from ${d.variable} (used by ${usedBy.join(", ")}). The value is never read here.` }
51
+ : { id: `secrets.${ref}`, area: "secrets", title: `Credential ${ref}`, status: "fail", detail: `Does not resolve (used by ${usedBy.join(", ")}).`, fix: `Set ${d.variable} in the ${env} process environment from your secret manager.` });
52
+ }
53
+ if (runtime.app.options.services?.apiKeys) {
54
+ add(production
55
+ ? { id: "secrets.api-key-verifier", area: "secrets", title: "API key verifier key", status: "pass", detail: "FELTKIT_API_KEY_VERIFIER_KEY is set (production does not start without it)." }
56
+ : { id: "secrets.api-key-verifier", area: "secrets", title: "API key verifier key", status: "pass", detail: "Development uses a generated key file; production requires FELTKIT_API_KEY_VERIFIER_KEY." });
57
+ }
58
+ // Identity and authority.
59
+ const hasHook = Boolean(runtime.app.options.auth?.authenticate);
60
+ const needsSignIn = [...runtime.project.functions.values()].some((f) => f.access !== "public");
61
+ if (production && needsSignIn && !hasHook) {
62
+ add({ id: "identity.end-users", area: "identity", title: "How end users sign in", status: "warn", detail: "No auth.authenticate hook: in production only sessions issued with `feltkit session create` and API keys can call non-public functions.", fix: "Verify your identity provider's token in feltkit({ auth: { authenticate } })." });
63
+ }
64
+ else {
65
+ add({ id: "identity.end-users", area: "identity", title: "How end users sign in", status: "pass", detail: hasHook ? "auth.authenticate verifies requests with the application's identity provider." : production ? "Every function is public." : "Development sign-in as declared dev users (never available in production)." });
66
+ }
67
+ add({ id: "identity.dev-users", area: "identity", title: "Development identities", status: "pass", detail: production ? "Declared dev users are ignored: development sign-in, `as`, and the admin token grant nothing in production." : "Dev users act only in development and test." });
68
+ const wildcard = Object.entries(runtime.authority.roles).filter(([, perms]) => perms.includes("*"));
69
+ add(wildcard.length
70
+ ? { id: "authority.wildcards", area: "authority", title: "Roles with every permission", status: "warn", detail: `${wildcard.map(([r]) => r).join(", ")} grant "*": every capability, including consequential ones and Studio operations.`, fix: "Grant the specific permissions each role needs; keep \"*\" for break-glass roles nobody uses day to day." }
71
+ : { id: "authority.wildcards", area: "authority", title: "Roles with every permission", status: "pass", detail: "No role grants \"*\"." });
72
+ if (production && options.dashboard) {
73
+ const operators = Object.entries(runtime.authority.roles).filter(([, perms]) => perms.some((p) => ["*", "feltkit.*", "feltkit.operations.*", "feltkit.operations.write", "feltkit.operations.read"].includes(p)));
74
+ add(operators.length
75
+ ? { id: "authority.operators", area: "authority", title: "Studio operators", status: "pass", detail: `Roles that may use production Studio: ${operators.map(([r]) => r).join(", ")}. Operators sign in with a one-time grant (feltkit operator grant).` }
76
+ : { id: "authority.operators", area: "authority", title: "Studio operators", status: "fail", detail: "Studio is served, but no role holds feltkit.operations.read or .write, so nobody can use it.", fix: "Add an operator role, e.g. ops: [\"feltkit.operations.*\", \"feltkit.agent.*\", …]." });
77
+ }
78
+ // The model.
79
+ if (model.ready) {
80
+ add({ id: "model.configured", area: "model", title: "Decision model", status: "pass", detail: `${model.source === "application" ? "Application-supplied runtime" : `${model.provider} (${model.protocol})`}${model.model ? `, model ${model.model}` : ""}${model.endpoint ? ` at ${new URL(model.endpoint).origin}` : ""}. Capabilities: ${model.runtime ? Object.entries(model.runtime.capabilities).filter(([, v]) => v === true).map(([k]) => k).join(", ") : "unknown"}. Configured, not called: use Studio → Models → Test to call it.` });
81
+ if (production && model.endpoint && /^http:\/\/(localhost|127\.)/.test(model.endpoint))
82
+ add({ id: "model.endpoint", area: "model", title: "Model endpoint", status: "warn", detail: `Production decisions go to ${new URL(model.endpoint).origin} on this host.`, fix: "Confirm a model server runs beside the application in production, or select a hosted provider." });
83
+ }
84
+ else {
85
+ const usesModel = Boolean(runtime.app.options.services?.intelligence) || Boolean(runtime.app.options.agent?.decisions);
86
+ for (const p of model.problems)
87
+ add({ id: `model.${p.problem}`, area: "model", title: "Decision model", status: usesModel ? "fail" : "warn", detail: `${p.message}${usesModel ? "" : " Decision tasks will block until one is configured."}`, fix: p.fix });
88
+ }
89
+ // Integrations.
90
+ const lint = lintIntegration(runtime.appport.manifest());
91
+ for (const issue of lint.filter((i) => i.severity === "error"))
92
+ add({ id: `integrations.lint.${issue.path ?? "contract"}`, area: "integrations", title: "Published integration contract", status: "fail", detail: `${issue.path ? `${issue.path}: ` : ""}${issue.message}`, fix: "Correct the declaration in app.integration(...)." });
93
+ for (const integration of runtime.integrations.definitions()) {
94
+ const s = runtime.integrations.status(integration);
95
+ add(s.problems.length
96
+ ? { id: `integrations.${integration.name}.config`, area: "integrations", title: `${integration.name}: configuration`, status: "fail", detail: s.problems.map((p) => p.message).join(" "), fix: s.problems.map((p) => p.fix).join(" ") }
97
+ : { id: `integrations.${integration.name}.config`, area: "integrations", title: `${integration.name}: configuration`, status: "pass", detail: `${s.baseUrl.value ? new URL(s.baseUrl.value).origin : ""} (${s.baseUrl.source}${s.baseUrl.variable ? ` ${s.baseUrl.variable}` : ""})${s.credential ? `, credential ${s.credential.ref}` : ""}. Configured, not called: use Studio → Integrations → Check.` });
98
+ for (const op of s.operations.filter((o) => o.effect === "consequential")) {
99
+ add(op.verifiable
100
+ ? { id: `integrations.${op.capability}.uncertainty`, area: "integrations", title: `${op.capability}: uncertain outcomes`, status: "pass", detail: `Settled by verification (${integration.operations[op.name].verify.operation})${op.idempotent ? "; the API also deduplicates repeated requests" : ""}.` }
101
+ : op.idempotent
102
+ ? { id: `integrations.${op.capability}.uncertainty`, area: "integrations", title: `${op.capability}: uncertain outcomes`, status: "warn", detail: "The API deduplicates repeated requests, but no verification is declared: an unknown outcome needs a person to settle it.", fix: "Declare verify: an observation that reads the effect back." }
103
+ : { id: `integrations.${op.capability}.uncertainty`, area: "integrations", title: `${op.capability}: uncertain outcomes`, status: "warn", detail: "Neither idempotency nor verification is declared: a timeout leaves an outcome only a person can settle, and repeating it may duplicate the effect.", fix: "Declare idempotencyHeader if the API supports it, and verify." });
104
+ }
105
+ }
106
+ // Open uncertainty and failed work.
107
+ const unknownCalls = (await runtime.integrations.calls({ limit: 500 })).filter((c) => c.state === "unknown" || c.state === "started");
108
+ const interrupted = (await runtime.agent.list("admin", 200)).length ? (await Promise.all((await runtime.agent.list("admin", 200)).map(async (t) => (await runtime.agent.get(t.task.task_id, "admin")).actions.filter((a) => a.state === "interrupted").length))).reduce((a, b) => a + b, 0) : 0;
109
+ add({ id: "recovery.restart", area: "recovery", title: "Restart recovery", status: "pass", detail: "On start, open agent actions are reconciled from evidence (AppPort idempotency records, activity, service evidence, integration verification); nothing is re-executed." });
110
+ add(unknownCalls.length || interrupted
111
+ ? { id: "recovery.open", area: "recovery", title: "Outcomes still unknown", status: "warn", detail: `${interrupted} agent action(s) and ${unknownCalls.length} integration call(s) have unknown outcomes.`, fix: "Verify them in Studio (Agent, Integrations), or settle them with a stated reason." }
112
+ : { id: "recovery.open", area: "recovery", title: "Outcomes still unknown", status: "pass", detail: "None." });
113
+ const durable = runtime.services.jobs || runtime.services.webhooks || runtime.services.schedules;
114
+ if (durable) {
115
+ add(runtime.workerRunning
116
+ ? { id: "background.worker", area: "background", title: "Background worker", status: "pass", detail: "This process runs jobs, schedules, and webhook deliveries (one worker per environment; work re-authorizes as its creator)." }
117
+ : { id: "background.worker", area: "background", title: "Background worker", status: "warn", detail: "No worker runs in this process, so jobs, schedules, and deliveries wait.", fix: "Serve the application with `feltkit start` (the worker runs in the server process)." });
118
+ }
119
+ // AppPort Services' own health() for every enabled service (failed jobs, deliveries, and
120
+ // notifications; endpoints that cannot sign), not a FeltKit reconstruction of it.
121
+ const enabled = (await runtime.services.status(runtime.state === "ready")).filter((s) => s.state !== "available" && s.state !== "unavailable");
122
+ if (enabled.length) {
123
+ const unhealthy = enabled.filter((s) => s.state === "unhealthy");
124
+ add(unhealthy.length
125
+ ? { id: "background.health", area: "background", title: "Service health", status: "warn", detail: unhealthy.map((s) => `${s.name}: ${s.detail}`).join(" "), fix: "Open Studio → Services for each failure." }
126
+ : { id: "background.health", area: "background", title: "Service health", status: "pass", detail: `AppPort Services health() reports nothing needing attention for ${enabled.map((s) => s.name).join(", ")}.` });
127
+ }
128
+ // Deployment.
129
+ if (options.projectDir) {
130
+ const built = existsSync(join(options.projectDir, ".feltkit", "build", "functions.mjs"));
131
+ add(built ? { id: "deployment.build", area: "deployment", title: "Production build", status: "pass", detail: "A build exists (.feltkit/build). `feltkit deploy` writes a verified artifact from it." } : { id: "deployment.build", area: "deployment", title: "Production build", status: "fail", detail: "No production build.", fix: "Run `feltkit build`, then `feltkit deploy`." });
132
+ }
133
+ if (production && options.dashboard)
134
+ add({ id: "deployment.operator-key", area: "deployment", title: "Operator sign-in key", status: process.env.FELTKIT_OPERATOR_KEY || existsSync(join(runtime.environment.runtimeDir, "operator-key")) ? "pass" : "warn", detail: "Studio sign-ins are granted with this environment's operator key.", fix: "Set FELTKIT_OPERATOR_KEY (32+ bytes, base64url) from your secret manager, or run `feltkit operator grant` on the host once." });
135
+ // What FeltKit does not provide and cannot check.
136
+ const external = [
137
+ ["operations.tls", "TLS and a reverse proxy", "FeltKit serves plain HTTP. Terminate TLS in front of it; production Studio's cookie is Secure."],
138
+ ["operations.rate-limits", "Rate limiting", "FeltKit has no rate limiting. Apply it in the proxy or platform."],
139
+ ["operations.backups", "Backups and restore", `FeltKit does not back up FeltDB state. Back up ${storage.kind === "local" ? `the state directory (${storage.location})` : "the FeltDB server"} and test a restore.`],
140
+ ["operations.monitoring", "Monitoring and alerting", "FeltKit offers /_feltkit/health, stdout logs, and the activity log; no metrics or alerts."],
141
+ ["operations.secrets", "Secret provisioning", "Credentials come from the process environment (FELTKIT_CREDENTIAL_<ID>, FELTDB_TOKEN, …); provide them from a secret manager."],
142
+ ["operations.access", "Network access to Studio", "Decide who can reach /_feltkit/ at all (allow-list or proxy), in addition to operator sign-in."],
143
+ ];
144
+ for (const [id, title, detail] of external)
145
+ add({ id, area: "operations", title, status: "external", detail, fix: `See ${GUIDE}.` });
146
+ const counts = { pass: 0, fail: 0, warn: 0, external: 0 };
147
+ for (const c of checks)
148
+ counts[c.status] += 1;
149
+ const summary = counts.fail > 0
150
+ ? `${counts.fail} check(s) fail in ${env}. Fix them before deploying; ${counts.external} operational requirement(s) are outside FeltKit.`
151
+ : `No failing checks in ${env}${counts.warn ? `; ${counts.warn} warning(s) to review` : ""}. ${counts.external} operational requirement(s) are outside FeltKit and not verified here.`;
152
+ return { application: runtime.app.name, environment: { name: env, production }, checkedAt: new Date().toISOString(), counts, summary, checks };
153
+ }
154
+ //# sourceMappingURL=readiness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readiness.js","sourceRoot":"","sources":["../../src/runtime/readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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