@feltdb/feltkit 0.1.1 → 0.3.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 (99) hide show
  1. package/dist/app.d.ts +106 -10
  2. package/dist/app.js +51 -0
  3. package/dist/app.js.map +1 -1
  4. package/dist/cli/deploy.js +9 -0
  5. package/dist/cli/deploy.js.map +1 -1
  6. package/dist/cli/main.js +339 -2
  7. package/dist/cli/main.js.map +1 -1
  8. package/dist/cli/skills.d.ts +39 -0
  9. package/dist/cli/skills.js +125 -0
  10. package/dist/cli/skills.js.map +1 -0
  11. package/dist/dashboard/assets/{index-BLnBFDJs.css → index--1Tqbv_A.css} +1 -1
  12. package/dist/dashboard/assets/index-D9529PVz.js +15 -0
  13. package/dist/dashboard/index.html +2 -2
  14. package/dist/errors.d.ts +5 -1
  15. package/dist/errors.js +3 -0
  16. package/dist/errors.js.map +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/runtime/activity.d.ts +21 -8
  19. package/dist/runtime/activity.js +17 -3
  20. package/dist/runtime/activity.js.map +1 -1
  21. package/dist/runtime/agent.d.ts +353 -0
  22. package/dist/runtime/agent.js +1345 -0
  23. package/dist/runtime/agent.js.map +1 -0
  24. package/dist/runtime/authority.d.ts +24 -3
  25. package/dist/runtime/authority.js +72 -5
  26. package/dist/runtime/authority.js.map +1 -1
  27. package/dist/runtime/changes.d.ts +16 -8
  28. package/dist/runtime/changes.js.map +1 -1
  29. package/dist/runtime/content.d.ts +33 -0
  30. package/dist/runtime/content.js +46 -0
  31. package/dist/runtime/content.js.map +1 -0
  32. package/dist/runtime/context.d.ts +26 -1
  33. package/dist/runtime/credentials.d.ts +174 -0
  34. package/dist/runtime/credentials.js +407 -0
  35. package/dist/runtime/credentials.js.map +1 -0
  36. package/dist/runtime/data.d.ts +8 -2
  37. package/dist/runtime/data.js +74 -9
  38. package/dist/runtime/data.js.map +1 -1
  39. package/dist/runtime/decisions.d.ts +141 -0
  40. package/dist/runtime/decisions.js +330 -0
  41. package/dist/runtime/decisions.js.map +1 -0
  42. package/dist/runtime/environment.js +11 -0
  43. package/dist/runtime/environment.js.map +1 -1
  44. package/dist/runtime/idempotency.d.ts +37 -0
  45. package/dist/runtime/idempotency.js +88 -0
  46. package/dist/runtime/idempotency.js.map +1 -0
  47. package/dist/runtime/instance.d.ts +8 -3
  48. package/dist/runtime/instance.js +27 -4
  49. package/dist/runtime/instance.js.map +1 -1
  50. package/dist/runtime/integrations.d.ts +125 -0
  51. package/dist/runtime/integrations.js +429 -0
  52. package/dist/runtime/integrations.js.map +1 -0
  53. package/dist/runtime/loader.d.ts +5 -1
  54. package/dist/runtime/loader.js +35 -13
  55. package/dist/runtime/loader.js.map +1 -1
  56. package/dist/runtime/projects.d.ts +1 -0
  57. package/dist/runtime/projects.js +6 -4
  58. package/dist/runtime/projects.js.map +1 -1
  59. package/dist/runtime/readiness.d.ts +29 -0
  60. package/dist/runtime/readiness.js +154 -0
  61. package/dist/runtime/readiness.js.map +1 -0
  62. package/dist/runtime/runtime.d.ts +53 -1
  63. package/dist/runtime/runtime.js +252 -9
  64. package/dist/runtime/runtime.js.map +1 -1
  65. package/dist/runtime/services.d.ts +205 -36
  66. package/dist/runtime/services.js +479 -152
  67. package/dist/runtime/services.js.map +1 -1
  68. package/dist/runtime/sessions.d.ts +7 -18
  69. package/dist/runtime/sessions.js +7 -5
  70. package/dist/runtime/sessions.js.map +1 -1
  71. package/dist/server/admin.d.ts +80 -0
  72. package/dist/server/admin.js +677 -8
  73. package/dist/server/admin.js.map +1 -1
  74. package/dist/server/index.d.ts +2 -0
  75. package/dist/server/index.js +13 -4
  76. package/dist/server/index.js.map +1 -1
  77. package/dist/server/management.d.ts +12 -0
  78. package/dist/server/management.js +177 -0
  79. package/dist/server/management.js.map +1 -0
  80. package/dist/server/mcp.d.ts +202 -0
  81. package/dist/server/mcp.js +62 -4
  82. package/dist/server/mcp.js.map +1 -1
  83. package/dist/server/operators.d.ts +77 -0
  84. package/dist/server/operators.js +162 -0
  85. package/dist/server/operators.js.map +1 -0
  86. package/dist/server/project.js +17 -4
  87. package/dist/server/project.js.map +1 -1
  88. package/dist/testing/index.js +3 -2
  89. package/dist/testing/index.js.map +1 -1
  90. package/package.json +18 -11
  91. package/skills/.claude-plugin/marketplace.json +16 -0
  92. package/skills/.claude-plugin/plugin.json +24 -0
  93. package/skills/README.md +44 -0
  94. package/skills/feltkit-agent/SKILL.md +84 -0
  95. package/skills/feltkit-build/SKILL.md +153 -0
  96. package/skills/feltkit-data/SKILL.md +79 -0
  97. package/skills/feltkit-operations/SKILL.md +72 -0
  98. package/skills/feltkit-services/SKILL.md +124 -0
  99. package/dist/dashboard/assets/index-CxJGCspE.js +0 -15
@@ -0,0 +1,174 @@
1
+ /** The environment variable that holds the value for a credential id. */
2
+ export declare function credentialVariable(secretId: string): string;
3
+ /** `credential-ref:<id>` or a bare id → the id, or null when it is not a valid reference. */
4
+ export declare function credentialId(ref: string): string | null;
5
+ /** A provider name or reference → the reference (`anthropic` → `credential-ref:anthropic`). */
6
+ export declare function toCredentialRef(refOrProvider: string): string;
7
+ /**
8
+ * Whether text looks like secret material rather than a reference: a known key prefix,
9
+ * or a long, high-entropy token. Used to keep a pasted key out of reference fields.
10
+ */
11
+ export declare function looksLikeSecret(text: string): boolean;
12
+ /** Remove every occurrence of `secret` (and obvious key shapes) from text. */
13
+ export declare function redactSecret(text: string, secret?: string): string;
14
+ export type CustodyErrorCode = "CUSTODY_READ_ONLY" | "CREDENTIAL_UNAVAILABLE" | "INVALID_REQUEST" | "CUSTODY_UNAVAILABLE";
15
+ export declare function isCustodyError(error: unknown): error is Error & {
16
+ code: CustodyErrorCode;
17
+ };
18
+ interface VaultEntry {
19
+ value: string;
20
+ version: number;
21
+ state: "active" | "revoked";
22
+ storedAt: string;
23
+ updatedAt: string;
24
+ provider?: string;
25
+ kind?: string;
26
+ /** Version numbers and times only; earlier values are not kept. */
27
+ history: Array<{
28
+ version: number;
29
+ storedAt: string;
30
+ }>;
31
+ }
32
+ interface VaultDocument {
33
+ entries: Record<string, VaultEntry>;
34
+ }
35
+ export interface VaultOptions {
36
+ /** Directory holding credentials.vault (and credentials.key unless `key` is given). */
37
+ dir: string;
38
+ /** A host-supplied key (production opt-in). When absent, credentials.key is used/created. */
39
+ key?: Buffer;
40
+ /** Binds the ciphertext to one application and environment (AES-GCM associated data). */
41
+ scope: string;
42
+ }
43
+ /**
44
+ * One environment's vault. Every read decrypts the file (so a value stored by the CLI is
45
+ * visible to a running server at once); every write is read-modify-write under a lock
46
+ * file, to a temporary 0600 file that is fsynced and renamed over the vault.
47
+ */
48
+ export declare class CredentialVault {
49
+ #private;
50
+ readonly file: string;
51
+ readonly keyFile: string | null;
52
+ constructor(options: VaultOptions);
53
+ read(): VaultDocument;
54
+ get(id: string): VaultEntry | null;
55
+ /** Apply `change` to the current document under the lock and write it back. */
56
+ update<T>(change: (doc: VaultDocument) => T): T;
57
+ }
58
+ export interface CredentialReference {
59
+ secretId: string;
60
+ tenantId: string;
61
+ provider?: string;
62
+ kind?: string;
63
+ }
64
+ export interface CredentialAccessContext {
65
+ tenantId?: string;
66
+ principalId?: string;
67
+ purpose?: string;
68
+ authorizationRef?: string;
69
+ }
70
+ export interface CustodyStatus {
71
+ state: "set" | "missing" | "revoked";
72
+ version?: number;
73
+ updatedAt?: string;
74
+ /** For display only. */
75
+ location?: string;
76
+ writable: boolean;
77
+ }
78
+ /** What Studio, readiness, and the CLI show about one reference. Never the value. */
79
+ export interface CredentialDescription {
80
+ ref: string;
81
+ /** The environment variable that would override it (null for an invalid reference). */
82
+ variable: string | null;
83
+ present: boolean;
84
+ source: "environment" | "vault" | null;
85
+ state: CustodyStatus["state"];
86
+ location: string | null;
87
+ writable: boolean;
88
+ version?: number;
89
+ updatedAt?: string;
90
+ }
91
+ export interface HostCredentialsOptions {
92
+ env?: NodeJS.ProcessEnv;
93
+ /** The writable vault, when this environment has one. */
94
+ vault?: CredentialVault | null;
95
+ /** Why there is no vault (shown with CUSTODY_READ_ONLY). */
96
+ readOnlyReason?: string;
97
+ }
98
+ /**
99
+ * FeltKit's credential custody: environment variables first, then the environment's
100
+ * encrypted vault. Implements AppPort Services' `SecretCustody` (withSecret, store,
101
+ * status, remove).
102
+ */
103
+ export declare class HostCredentials {
104
+ #private;
105
+ constructor(options?: HostCredentialsOptions);
106
+ /** Whether this custody can store values (some reference may still be env-pinned). */
107
+ get writable(): boolean;
108
+ /** Where stored values go, for display. */
109
+ get location(): string;
110
+ withSecret<T>(input: {
111
+ reference: {
112
+ secretId: string;
113
+ tenantId?: string;
114
+ };
115
+ context?: {
116
+ purpose?: string;
117
+ };
118
+ }, use: (secret: {
119
+ value: string;
120
+ secretId: string;
121
+ version: number;
122
+ kind?: string;
123
+ provider?: string;
124
+ }) => T | Promise<T>): Promise<T>;
125
+ /** Store a new version. Never returns or echoes the value. */
126
+ store(input: {
127
+ reference: CredentialReference;
128
+ value: unknown;
129
+ context?: CredentialAccessContext;
130
+ }): Promise<{
131
+ version: number;
132
+ storedAt: string;
133
+ }>;
134
+ status(input: {
135
+ reference: {
136
+ secretId: string;
137
+ };
138
+ context?: CredentialAccessContext;
139
+ }): Promise<CustodyStatus>;
140
+ /** Why a value cannot be stored for this reference here, naming what to set instead; null when it can. */
141
+ readOnlyReason(ref: string): string | null;
142
+ /** Revoke: the stored value is erased; the reference reports "revoked". */
143
+ remove(input: {
144
+ reference: {
145
+ secretId: string;
146
+ };
147
+ context?: CredentialAccessContext;
148
+ }): Promise<void>;
149
+ /** Every reference the vault holds material or history for. */
150
+ stored(): string[];
151
+ /** Whether a reference resolves, from where, and its version. Never returns the value. */
152
+ describe(ref: string): CredentialDescription;
153
+ }
154
+ /** Environment-variable custody only (no vault): what production uses without the opt-in. */
155
+ export declare class EnvironmentCredentials extends HostCredentials {
156
+ constructor(env?: NodeJS.ProcessEnv, readOnlyReason?: string);
157
+ }
158
+ /**
159
+ * The custody for one environment.
160
+ *
161
+ * development, test vault in `dir` (key in dir/credentials.key)
162
+ * production environment variables only, unless FELTKIT_CREDENTIAL_VAULT=1 with
163
+ * FELTKIT_CREDENTIAL_VAULT_KEY (the vault lives in
164
+ * FELTKIT_CREDENTIAL_VAULT_DIR, else `dir`)
165
+ * other (staging…) the same rule as production
166
+ */
167
+ export declare function credentialsFor(options: {
168
+ environment: string;
169
+ development: boolean;
170
+ dir: string;
171
+ scope: string;
172
+ env?: NodeJS.ProcessEnv;
173
+ }): HostCredentials;
174
+ export {};
@@ -0,0 +1,407 @@
1
+ /**
2
+ * Credential custody for AppPort Services.
3
+ *
4
+ * AppPort Services stores only references (`credential-ref:<id>`). It asks the host's
5
+ * custody for the value inside the one effect that needs it (signing a webhook, calling
6
+ * a model provider), and, from 0.8.0, hands the host a value to keep (`credential.store`)
7
+ * without ever persisting it itself. AppPort Services contains no secret store; this
8
+ * module is FeltKit's, the host side of that contract (`SecretCustody`):
9
+ *
10
+ * 1. The environment variable wins:
11
+ * credential-ref:stripe-signing → FELTKIT_CREDENTIAL_STRIPE_SIGNING
12
+ * When it is set the reference is read-only here (status `writable: false`): the
13
+ * value belongs to whoever runs the process (a secret manager, a .env they control).
14
+ * 2. Otherwise the local encrypted vault, in development and test:
15
+ * .feltkit/<env>/credentials.vault AES-256-GCM, whole document encrypted
16
+ * .feltkit/<env>/credentials.key one random 32-byte key
17
+ * Both files are 0600 and written atomically under a lock file; `.feltkit/` is
18
+ * gitignored and never part of `feltkit build`/`deploy` output. The vault keeps the
19
+ * current value of each reference and its version history (numbers and times only).
20
+ * 3. Production: environment variables only, unless the operator explicitly opts in to
21
+ * a vault with FELTKIT_CREDENTIAL_VAULT=1 and FELTKIT_CREDENTIAL_VAULT_KEY (32 bytes,
22
+ * base64/base64url, from the host's secret manager; never written to disk by FeltKit).
23
+ * Without the opt-in `store` refuses with CUSTODY_READ_ONLY and says what to set.
24
+ *
25
+ * Values never reach FeltDB, the activity log, evidence, an API response, an error
26
+ * message, a log line, or agent context. `describe`/`status` report whether a reference
27
+ * resolves, from where, and its version, never the value.
28
+ */
29
+ import { closeSync, chmodSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, statSync, unlinkSync, writeSync } from "node:fs";
30
+ import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
31
+ import { join } from "node:path";
32
+ const ID = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/;
33
+ const PREFIX = "credential-ref:";
34
+ const VAULT_FORMAT = "feltkit.credential-vault/1";
35
+ const MAX_VALUE_BYTES = 16 * 1024;
36
+ /** The environment variable that holds the value for a credential id. */
37
+ export function credentialVariable(secretId) {
38
+ return `FELTKIT_CREDENTIAL_${secretId.replace(/[^A-Za-z0-9]/g, "_").toUpperCase()}`;
39
+ }
40
+ /** `credential-ref:<id>` or a bare id → the id, or null when it is not a valid reference. */
41
+ export function credentialId(ref) {
42
+ const id = ref.startsWith(PREFIX) ? ref.slice(PREFIX.length) : ref;
43
+ return ID.test(id) ? id : null;
44
+ }
45
+ /** A provider name or reference → the reference (`anthropic` → `credential-ref:anthropic`). */
46
+ export function toCredentialRef(refOrProvider) {
47
+ const id = credentialId(refOrProvider.trim());
48
+ if (!id)
49
+ throw custodyError("INVALID_REQUEST", "A credential reference is credential-ref:<id> (letters, digits, . _ : -).");
50
+ return `${PREFIX}${id}`;
51
+ }
52
+ /**
53
+ * Whether text looks like secret material rather than a reference: a known key prefix,
54
+ * or a long, high-entropy token. Used to keep a pasted key out of reference fields.
55
+ */
56
+ export function looksLikeSecret(text) {
57
+ const value = text.trim();
58
+ if (!value || value.startsWith(PREFIX))
59
+ return false;
60
+ if (/^(sk-|sk-ant-|sk_live_|sk_test_|rk_live_|xai-|AIza|ghp_|gho_|github_pat_|gsk_|glpat-|xox[abpr]-|hf_|pk_live_)/.test(value))
61
+ return true;
62
+ if (value.length < 32 || /\s/.test(value) || !/[0-9]/.test(value) || !/[A-Za-z]/.test(value))
63
+ return false;
64
+ const counts = new Map();
65
+ for (const ch of value)
66
+ counts.set(ch, (counts.get(ch) ?? 0) + 1);
67
+ let entropy = 0;
68
+ for (const n of counts.values())
69
+ entropy -= (n / value.length) * Math.log2(n / value.length);
70
+ return entropy >= 4;
71
+ }
72
+ /** Remove every occurrence of `secret` (and obvious key shapes) from text. */
73
+ export function redactSecret(text, secret) {
74
+ let out = String(text);
75
+ if (secret && secret.length >= 4)
76
+ out = out.split(secret).join("[redacted]");
77
+ return out.replace(/\b(sk|key|xai|gsk|ghp)[-_][A-Za-z0-9_-]{12,}/g, "[redacted]");
78
+ }
79
+ function custodyError(code, message) {
80
+ return Object.assign(new Error(message), { code, name: "CredentialCustodyError" });
81
+ }
82
+ export function isCustodyError(error) {
83
+ return error?.name === "CredentialCustodyError";
84
+ }
85
+ /**
86
+ * One environment's vault. Every read decrypts the file (so a value stored by the CLI is
87
+ * visible to a running server at once); every write is read-modify-write under a lock
88
+ * file, to a temporary 0600 file that is fsynced and renamed over the vault.
89
+ */
90
+ export class CredentialVault {
91
+ file;
92
+ keyFile;
93
+ #dir;
94
+ #key;
95
+ #aad;
96
+ #cache = null;
97
+ constructor(options) {
98
+ this.#dir = options.dir;
99
+ this.file = join(options.dir, "credentials.vault");
100
+ this.keyFile = options.key ? null : join(options.dir, "credentials.key");
101
+ if (options.key && options.key.length !== 32)
102
+ throw custodyError("CUSTODY_UNAVAILABLE", "The credential vault key must be exactly 32 bytes.");
103
+ this.#key = options.key;
104
+ this.#aad = Buffer.from(`${VAULT_FORMAT}:${options.scope}`);
105
+ }
106
+ #readKey(create) {
107
+ if (this.#key)
108
+ return this.#key;
109
+ const file = this.keyFile;
110
+ if (existsSync(file)) {
111
+ const key = Buffer.from(readFileSync(file, "utf8").trim(), "base64url");
112
+ if (key.length !== 32)
113
+ throw custodyError("CUSTODY_UNAVAILABLE", `${file} is not a 32-byte vault key. Move it aside to start an empty vault (stored values are then lost).`);
114
+ return key;
115
+ }
116
+ if (!create)
117
+ return null;
118
+ mkdirSync(this.#dir, { recursive: true, mode: 0o700 });
119
+ const key = randomBytes(32);
120
+ writeAtomic(file, `${key.toString("base64url")}\n`);
121
+ return key;
122
+ }
123
+ read() {
124
+ if (!existsSync(this.file))
125
+ return { entries: {} };
126
+ const stat = statSync(this.file);
127
+ if (this.#cache && this.#cache.mtimeMs === stat.mtimeMs && this.#cache.size === stat.size)
128
+ return this.#cache.doc;
129
+ const key = this.#readKey(false);
130
+ if (!key)
131
+ throw custodyError("CUSTODY_UNAVAILABLE", `The credential vault ${this.file} exists but its key does not. Restore the key, or move the vault aside (stored values are then lost).`);
132
+ let doc;
133
+ try {
134
+ const envelope = JSON.parse(readFileSync(this.file, "utf8"));
135
+ if (envelope.format !== VAULT_FORMAT)
136
+ throw new Error("format");
137
+ const decipher = createDecipheriv("aes-256-gcm", key, Buffer.from(envelope.iv, "base64"));
138
+ decipher.setAAD(this.#aad);
139
+ decipher.setAuthTag(Buffer.from(envelope.tag, "base64"));
140
+ const plain = Buffer.concat([decipher.update(Buffer.from(envelope.data, "base64")), decipher.final()]);
141
+ doc = JSON.parse(plain.toString("utf8"));
142
+ plain.fill(0);
143
+ }
144
+ catch {
145
+ // Never echo file contents.
146
+ throw custodyError("CUSTODY_UNAVAILABLE", `The credential vault ${this.file} could not be decrypted with its key (wrong key, another environment's vault, or a modified file).`);
147
+ }
148
+ if (!doc || typeof doc.entries !== "object")
149
+ doc = { entries: {} };
150
+ this.#cache = { mtimeMs: stat.mtimeMs, size: stat.size, doc };
151
+ return doc;
152
+ }
153
+ get(id) {
154
+ return this.read().entries[id] ?? null;
155
+ }
156
+ /** Apply `change` to the current document under the lock and write it back. */
157
+ update(change) {
158
+ mkdirSync(this.#dir, { recursive: true, mode: 0o700 });
159
+ const release = lock(`${this.file}.lock`);
160
+ try {
161
+ this.#cache = null;
162
+ const doc = structuredClone(this.read());
163
+ const result = change(doc);
164
+ const key = this.#readKey(true);
165
+ const iv = randomBytes(12);
166
+ const cipher = createCipheriv("aes-256-gcm", key, iv);
167
+ cipher.setAAD(this.#aad);
168
+ const plain = Buffer.from(JSON.stringify(doc), "utf8");
169
+ const data = Buffer.concat([cipher.update(plain), cipher.final()]);
170
+ plain.fill(0);
171
+ const envelope = { format: VAULT_FORMAT, alg: "AES-256-GCM", iv: iv.toString("base64"), tag: cipher.getAuthTag().toString("base64"), data: data.toString("base64") };
172
+ writeAtomic(this.file, `${JSON.stringify(envelope)}\n`);
173
+ this.#cache = null;
174
+ return result;
175
+ }
176
+ finally {
177
+ release();
178
+ }
179
+ }
180
+ }
181
+ /** Write to a 0600 temporary file in the same directory, fsync, rename over `path`. */
182
+ function writeAtomic(path, content) {
183
+ const temp = `${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
184
+ const fd = openSync(temp, "wx", 0o600);
185
+ try {
186
+ writeSync(fd, content);
187
+ fsyncSync(fd);
188
+ }
189
+ finally {
190
+ closeSync(fd);
191
+ }
192
+ chmodSync(temp, 0o600);
193
+ renameSync(temp, path);
194
+ chmodSync(path, 0o600);
195
+ }
196
+ const sleep = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
197
+ /** An exclusive lock file shared by every process using the vault (the dev server, the CLI). */
198
+ function lock(file) {
199
+ const deadline = Date.now() + 5000;
200
+ for (;;) {
201
+ try {
202
+ const fd = openSync(file, "wx", 0o600);
203
+ writeSync(fd, String(process.pid));
204
+ closeSync(fd);
205
+ return () => {
206
+ try {
207
+ unlinkSync(file);
208
+ }
209
+ catch {
210
+ /* already gone */
211
+ }
212
+ };
213
+ }
214
+ catch (error) {
215
+ if (error.code !== "EEXIST")
216
+ throw error;
217
+ try {
218
+ // A lock older than 10 s belongs to a process that died mid-write.
219
+ if (Date.now() - statSync(file).mtimeMs > 10_000)
220
+ unlinkSync(file);
221
+ }
222
+ catch {
223
+ /* raced with its owner */
224
+ }
225
+ if (Date.now() > deadline)
226
+ throw custodyError("CUSTODY_UNAVAILABLE", `The credential vault is locked by another process (${file}).`);
227
+ sleep(25);
228
+ }
229
+ }
230
+ }
231
+ /**
232
+ * FeltKit's credential custody: environment variables first, then the environment's
233
+ * encrypted vault. Implements AppPort Services' `SecretCustody` (withSecret, store,
234
+ * status, remove).
235
+ */
236
+ export class HostCredentials {
237
+ #env;
238
+ #vault;
239
+ #readOnlyReason;
240
+ constructor(options = {}) {
241
+ this.#env = options.env ?? process.env;
242
+ this.#vault = options.vault ?? null;
243
+ this.#readOnlyReason = options.readOnlyReason ?? "This environment keeps credentials in the host's environment only.";
244
+ }
245
+ /** Whether this custody can store values (some reference may still be env-pinned). */
246
+ get writable() {
247
+ return this.#vault !== null;
248
+ }
249
+ /** Where stored values go, for display. */
250
+ get location() {
251
+ return this.#vault ? "local encrypted vault" : "environment variables";
252
+ }
253
+ async withSecret(input, use) {
254
+ const id = input.reference.secretId;
255
+ if (!ID.test(id))
256
+ throw custodyError("INVALID_REQUEST", `Invalid credential id "${id}"`);
257
+ const variable = credentialVariable(id);
258
+ const fromEnv = this.#env[variable];
259
+ if (fromEnv)
260
+ return use({ value: fromEnv, secretId: id, version: 1, kind: "environment" });
261
+ const entry = this.#vault?.get(id);
262
+ if (entry && entry.state === "active" && entry.value) {
263
+ return use({ value: entry.value, secretId: id, version: entry.version, ...(entry.kind ? { kind: entry.kind } : {}), ...(entry.provider ? { provider: entry.provider } : {}) });
264
+ }
265
+ // Names the variable, never a value.
266
+ throw custodyError("CREDENTIAL_UNAVAILABLE", this.#vault
267
+ ? `Credential "${id}" is not set: enter it in Studio (Models, Integrations, or Services → Credentials), run \`feltkit credential set ${PREFIX}${id}\`, or define ${variable}.`
268
+ : `Credential "${id}" is not set: define ${variable} in the environment.`);
269
+ }
270
+ /** Store a new version. Never returns or echoes the value. */
271
+ async store(input) {
272
+ const id = input.reference.secretId;
273
+ if (!ID.test(id))
274
+ throw custodyError("INVALID_REQUEST", "Invalid credential id.");
275
+ const value = input.value;
276
+ if (typeof value !== "string" || !value.trim())
277
+ throw custodyError("INVALID_REQUEST", "A credential value must be a non-empty string.");
278
+ if (value.trim().startsWith(PREFIX))
279
+ throw custodyError("INVALID_REQUEST", "That is a credential reference, not a value. Enter the key itself.");
280
+ if (Buffer.byteLength(value) > MAX_VALUE_BYTES)
281
+ throw custodyError("INVALID_REQUEST", `A credential value is limited to ${MAX_VALUE_BYTES} bytes.`);
282
+ const readOnly = this.readOnlyReason(id);
283
+ if (readOnly || !this.#vault)
284
+ throw custodyError("CUSTODY_READ_ONLY", readOnly ?? this.#readOnlyReason);
285
+ const vault = this.#vault;
286
+ const material = value.trim();
287
+ const storedAt = new Date().toISOString();
288
+ const version = vault.update((doc) => {
289
+ const previous = doc.entries[id];
290
+ const next = (previous?.version ?? 0) + 1;
291
+ doc.entries[id] = {
292
+ value: material,
293
+ version: next,
294
+ state: "active",
295
+ storedAt,
296
+ updatedAt: storedAt,
297
+ ...(input.reference.provider ? { provider: input.reference.provider } : {}),
298
+ ...(input.reference.kind ? { kind: input.reference.kind } : {}),
299
+ history: [...(previous?.history ?? []), { version: next, storedAt }].slice(-50),
300
+ };
301
+ return next;
302
+ });
303
+ return { version, storedAt };
304
+ }
305
+ async status(input) {
306
+ const d = this.describe(input.reference.secretId);
307
+ return { state: d.state, writable: d.writable, ...(d.version !== undefined ? { version: d.version } : {}), ...(d.updatedAt ? { updatedAt: d.updatedAt } : {}), ...(d.location ? { location: d.location } : {}) };
308
+ }
309
+ /** Why a value cannot be stored for this reference here, naming what to set instead; null when it can. */
310
+ readOnlyReason(ref) {
311
+ const id = credentialId(ref);
312
+ if (!id)
313
+ return null;
314
+ const variable = credentialVariable(id);
315
+ if (this.#env[variable])
316
+ return `This environment's credential ${PREFIX}${id} comes from the host (${variable}); change it there. A stored value would never be used while the variable is set.`;
317
+ if (!this.#vault)
318
+ return `${this.#readOnlyReason} Set ${variable} on the host.`;
319
+ return null;
320
+ }
321
+ /** Revoke: the stored value is erased; the reference reports "revoked". */
322
+ async remove(input) {
323
+ const id = input.reference.secretId;
324
+ if (!ID.test(id))
325
+ throw custodyError("INVALID_REQUEST", "Invalid credential id.");
326
+ const variable = credentialVariable(id);
327
+ if (this.#env[variable])
328
+ throw custodyError("CUSTODY_READ_ONLY", `${PREFIX}${id} comes from the host (${variable}); unset it there.`);
329
+ if (!this.#vault)
330
+ throw custodyError("CUSTODY_READ_ONLY", `${this.#readOnlyReason} Unset ${variable} on the host.`);
331
+ this.#vault.update((doc) => {
332
+ const entry = doc.entries[id];
333
+ if (!entry)
334
+ return;
335
+ const at = new Date().toISOString();
336
+ doc.entries[id] = { ...entry, value: "", state: "revoked", updatedAt: at };
337
+ });
338
+ }
339
+ /** Every reference the vault holds material or history for. */
340
+ stored() {
341
+ if (!this.#vault)
342
+ return [];
343
+ try {
344
+ return Object.keys(this.#vault.read().entries).map((id) => `${PREFIX}${id}`);
345
+ }
346
+ catch {
347
+ return [];
348
+ }
349
+ }
350
+ /** Whether a reference resolves, from where, and its version. Never returns the value. */
351
+ describe(ref) {
352
+ const id = credentialId(ref);
353
+ const shown = ref.startsWith(PREFIX) ? ref : id ? `${PREFIX}${id}` : ref;
354
+ if (!id)
355
+ return { ref: shown, variable: null, present: false, source: null, state: "missing", location: null, writable: false };
356
+ const variable = credentialVariable(id);
357
+ if (this.#env[variable])
358
+ return { ref: shown, variable, present: true, source: "environment", state: "set", location: `environment variable ${variable}`, writable: false };
359
+ let entry = null;
360
+ try {
361
+ entry = this.#vault?.get(id) ?? null;
362
+ }
363
+ catch {
364
+ entry = null;
365
+ }
366
+ const writable = this.#vault !== null;
367
+ const location = this.#vault ? "local encrypted vault" : `environment variable ${variable}`;
368
+ if (!entry)
369
+ return { ref: shown, variable, present: false, source: null, state: "missing", location, writable };
370
+ const state = entry.state === "revoked" ? "revoked" : "set";
371
+ return { ref: shown, variable, present: state === "set", source: "vault", state, location, writable, version: entry.version, updatedAt: entry.updatedAt };
372
+ }
373
+ }
374
+ /** Environment-variable custody only (no vault): what production uses without the opt-in. */
375
+ export class EnvironmentCredentials extends HostCredentials {
376
+ constructor(env = process.env, readOnlyReason) {
377
+ super({ env, ...(readOnlyReason ? { readOnlyReason } : {}) });
378
+ }
379
+ }
380
+ /**
381
+ * The custody for one environment.
382
+ *
383
+ * development, test vault in `dir` (key in dir/credentials.key)
384
+ * production environment variables only, unless FELTKIT_CREDENTIAL_VAULT=1 with
385
+ * FELTKIT_CREDENTIAL_VAULT_KEY (the vault lives in
386
+ * FELTKIT_CREDENTIAL_VAULT_DIR, else `dir`)
387
+ * other (staging…) the same rule as production
388
+ */
389
+ export function credentialsFor(options) {
390
+ const env = options.env ?? process.env;
391
+ if (options.development)
392
+ return new HostCredentials({ env, vault: new CredentialVault({ dir: options.dir, scope: options.scope }) });
393
+ const optIn = env.FELTKIT_CREDENTIAL_VAULT === "1" || env.FELTKIT_CREDENTIAL_VAULT === "true";
394
+ if (!optIn) {
395
+ return new HostCredentials({
396
+ env,
397
+ readOnlyReason: `The ${options.environment} environment's credentials come from the host's environment variables (opt in to a vault with FELTKIT_CREDENTIAL_VAULT=1 and FELTKIT_CREDENTIAL_VAULT_KEY).`,
398
+ });
399
+ }
400
+ const raw = env.FELTKIT_CREDENTIAL_VAULT_KEY;
401
+ const key = raw ? Buffer.from(raw.trim(), /[+/=]/.test(raw) ? "base64" : "base64url") : null;
402
+ if (!key || key.length !== 32) {
403
+ throw custodyError("CUSTODY_UNAVAILABLE", "FELTKIT_CREDENTIAL_VAULT=1 needs FELTKIT_CREDENTIAL_VAULT_KEY: exactly 32 random bytes, base64-encoded, from the host's secret manager.");
404
+ }
405
+ return new HostCredentials({ env, vault: new CredentialVault({ dir: env.FELTKIT_CREDENTIAL_VAULT_DIR || options.dir, key, scope: options.scope }) });
406
+ }
407
+ //# sourceMappingURL=credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/runtime/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,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,OAAO,OAAO,CAAC,WAAW,6JAA6J;SACxM,CAAC,CAAC;IACL,CAAC;IACD,MAAM,GAAG,GAAG,GAAG,CAAC,4BAA4B,CAAC;IAC7C,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7F,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAC9B,MAAM,YAAY,CAAC,qBAAqB,EAAE,yIAAyI,CAAC,CAAC;IACvL,CAAC;IACD,OAAO,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,4BAA4B,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACvJ,CAAC"}
@@ -28,7 +28,7 @@
28
28
  * Not provided: a consistent snapshot across reads within one call. A mutation that
29
29
  * only reads commits nothing, so nothing is checked; queries are not fenced.
30
30
  */
31
- import type { StateFirstDB } from "@feltdb/core";
31
+ import { type StateFirstDB } from "@feltdb/core";
32
32
  import type { CollectionDefinition } from "../app.js";
33
33
  import { type Doc, type InferShape, type ShapeInput, type Simplify } from "../schema.js";
34
34
  type AnyDoc = Record<string, unknown> & {
@@ -134,6 +134,12 @@ export declare class Writer extends Reader implements DatabaseWriter {
134
134
  replace(ref: CollectionRef, id: string, value: Record<string, unknown>): Promise<any>;
135
135
  delete(ref: CollectionRef, id: string): Promise<void>;
136
136
  /** Commit every pending write in one FeltDB transaction. */
137
- commit(transactionId: string): Promise<CommitResult>;
137
+ /**
138
+ * `keyed`: the transaction id was derived from the caller's idempotency key, so FeltDB's
139
+ * IDEMPOTENCY_CONFLICT means an earlier attempt under that key already committed.
140
+ */
141
+ commit(transactionId: string, options?: {
142
+ keyed?: boolean;
143
+ }): Promise<CommitResult>;
138
144
  }
139
145
  export {};