@feltdb/feltkit 0.2.0 → 0.3.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 (38) hide show
  1. package/dist/cli/deploy.js +9 -0
  2. package/dist/cli/deploy.js.map +1 -1
  3. package/dist/cli/main.js +128 -7
  4. package/dist/cli/main.js.map +1 -1
  5. package/dist/dashboard/assets/index-D9529PVz.js +15 -0
  6. package/dist/dashboard/index.html +1 -1
  7. package/dist/errors.d.ts +3 -1
  8. package/dist/errors.js +1 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/runtime/authority.d.ts +1 -0
  11. package/dist/runtime/authority.js +3 -0
  12. package/dist/runtime/authority.js.map +1 -1
  13. package/dist/runtime/credentials.d.ts +159 -27
  14. package/dist/runtime/credentials.js +389 -14
  15. package/dist/runtime/credentials.js.map +1 -1
  16. package/dist/runtime/decisions.d.ts +20 -5
  17. package/dist/runtime/decisions.js +91 -22
  18. package/dist/runtime/decisions.js.map +1 -1
  19. package/dist/runtime/integrations.d.ts +5 -0
  20. package/dist/runtime/integrations.js +20 -3
  21. package/dist/runtime/integrations.js.map +1 -1
  22. package/dist/runtime/readiness.js +3 -3
  23. package/dist/runtime/readiness.js.map +1 -1
  24. package/dist/runtime/runtime.d.ts +3 -0
  25. package/dist/runtime/runtime.js +27 -0
  26. package/dist/runtime/runtime.js.map +1 -1
  27. package/dist/runtime/services.d.ts +23 -4
  28. package/dist/runtime/services.js +60 -1
  29. package/dist/runtime/services.js.map +1 -1
  30. package/dist/server/admin.d.ts +56 -2
  31. package/dist/server/admin.js +176 -9
  32. package/dist/server/admin.js.map +1 -1
  33. package/package.json +3 -3
  34. package/skills/.claude-plugin/marketplace.json +1 -1
  35. package/skills/.claude-plugin/plugin.json +1 -1
  36. package/skills/feltkit-build/SKILL.md +14 -4
  37. package/skills/feltkit-services/SKILL.md +29 -7
  38. package/dist/dashboard/assets/index-Bm4qCYpv.js +0 -15
@@ -1,32 +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";
1
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;
2
36
  /** The environment variable that holds the value for a credential id. */
3
37
  export function credentialVariable(secretId) {
4
38
  return `FELTKIT_CREDENTIAL_${secretId.replace(/[^A-Za-z0-9]/g, "_").toUpperCase()}`;
5
39
  }
6
- export class EnvironmentCredentials {
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 {
7
237
  #env;
8
- constructor(env = process.env) {
9
- this.#env = 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";
10
252
  }
11
253
  async withSecret(input, use) {
12
254
  const id = input.reference.secretId;
13
255
  if (!ID.test(id))
14
- throw Object.assign(new Error(`Invalid credential id "${id}"`), { code: "INVALID_REQUEST" });
256
+ throw custodyError("INVALID_REQUEST", `Invalid credential id "${id}"`);
15
257
  const variable = credentialVariable(id);
16
- const value = this.#env[variable];
17
- if (!value) {
18
- // Names the variable, never a value.
19
- throw Object.assign(new Error(`Credential "${id}" is not set: define ${variable} in the environment.`), { code: "CREDENTIAL_UNAVAILABLE" });
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 } : {}) });
20
264
  }
21
- return use({ value, secretId: id, version: 1, kind: "environment" });
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.`);
22
269
  }
23
- /** Whether a reference resolves, and from which variable. Never returns the value. */
24
- describe(ref) {
25
- const id = ref.startsWith("credential-ref:") ? ref.slice("credential-ref:".length) : ref;
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;
26
324
  if (!ID.test(id))
27
- return { ref, variable: null, present: false };
325
+ throw custodyError("INVALID_REQUEST", "Invalid credential id.");
28
326
  const variable = credentialVariable(id);
29
- return { ref, variable, present: Boolean(this.#env[variable]) };
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.");
30
404
  }
405
+ return new HostCredentials({ env, vault: new CredentialVault({ dir: env.FELTKIT_CREDENTIAL_VAULT_DIR || options.dir, key, scope: options.scope }) });
31
406
  }
32
407
  //# sourceMappingURL=credentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/runtime/credentials.ts"],"names":[],"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,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACvJ,CAAC"}
@@ -12,8 +12,8 @@
12
12
  * - Otherwise the environment's Intelligence selection picks a server-side runtime by
13
13
  * protocol: OpenAI chat completions (`openai`, `openai-compatible`, which covers
14
14
  * local servers such as Ollama, vLLM, and llama.cpp) or Anthropic Messages.
15
- * - Credentials are resolved from FeltKit's custody (FELTKIT_CREDENTIAL_<ID>) inside the
16
- * call and never leave the server: not in configuration views, errors, logs, or
15
+ * - Credentials are resolved from FeltKit's custody (FELTKIT_CREDENTIAL_<ID>, else the
16
+ * environment's encrypted vault; runtime/credentials.ts) inside the call and never leave the server: not in configuration views, errors, logs, or
17
17
  * records.
18
18
  * - Nothing falls back silently. A missing selection, missing credential, timeout,
19
19
  * refused credential, provider error, malformed answer, or unsupported decision kind
@@ -25,6 +25,7 @@
25
25
  */
26
26
  import type { DecisionBatch, DecisionBatchEvaluation, DecisionRequest, DecisionResult, DecisionRuntime, DecisionRuntimeCapabilities, DecisionRuntimeMetadata } from "@feltdb/core";
27
27
  import { FeltKitError } from "../errors.js";
28
+ import { type Principal } from "./authority.js";
28
29
  import type { FeltKitRuntime } from "./runtime.js";
29
30
  export type { DecisionRuntime, DecisionRequest, DecisionResult, DecisionRuntimeCapabilities, DecisionRuntimeMetadata } from "@feltdb/core";
30
31
  export type ModelProblem = "not_configured" | "intelligence_disabled" | "unknown_protocol" | "credential_missing" | "timeout" | "unavailable" | "credential_refused" | "provider_error" | "malformed" | "unsupported";
@@ -61,7 +62,12 @@ export declare class OpenAIChatDecisionRuntime extends HttpDecisionRuntime {
61
62
  capabilities(): DecisionRuntimeCapabilities;
62
63
  execute(request: DecisionRequest): Promise<DecisionResult>;
63
64
  }
64
- /** Anthropic Messages, with the answer forced through a tool whose input is one of the labels. */
65
+ /**
66
+ * Anthropic Messages. The answer is constrained by structured outputs (`output_config.format`, a JSON schema whose
67
+ * one field is an enum of the labels), which every current Claude model supports; forced tool use
68
+ * (`tool_choice: {type: "tool"}`) is refused by Claude Fable 5.1, Opus 5.5 and Sonnet 5.5. A model that refuses
69
+ * structured outputs (older models) gets the forced `decide` tool instead, once, in the same call.
70
+ */
65
71
  export declare class AnthropicDecisionRuntime extends HttpDecisionRuntime {
66
72
  metadata(): DecisionRuntimeMetadata;
67
73
  capabilities(): DecisionRuntimeCapabilities;
@@ -82,6 +88,14 @@ export interface ModelStatus {
82
88
  ref: string | null;
83
89
  variable: string | null;
84
90
  present: boolean;
91
+ /** Where the value is kept ("environment variable FELTKIT_CREDENTIAL_X", "local encrypted vault"). Never the value. */
92
+ location?: string | null;
93
+ source?: "environment" | "vault" | null;
94
+ state?: "set" | "missing" | "revoked";
95
+ version?: number;
96
+ updatedAt?: string;
97
+ /** Whether a value can be stored for it here (Studio, `feltkit credential set`). */
98
+ writable?: boolean;
85
99
  };
86
100
  runtime: {
87
101
  metadata: DecisionRuntimeMetadata;
@@ -114,14 +128,15 @@ export declare class ModelHost {
114
128
  /**
115
129
  * Select this environment's provider and model in AppPort Services Intelligence. Host
116
130
  * code only (the CLI, tests, development Studio): production Studio does not expose it.
117
- * The credential is a reference; its value lives in FELTKIT_CREDENTIAL_<ID>.
131
+ * The credential is a reference; its value is kept by FeltKit's custody (an environment
132
+ * variable FELTKIT_CREDENTIAL_<ID>, or the environment's encrypted vault), never here.
118
133
  */
119
134
  select(input: {
120
135
  provider: string;
121
136
  model: string;
122
137
  endpoint?: string | null;
123
138
  credentialRef?: string;
124
- }): Promise<ModelStatus>;
139
+ }, as?: Principal): Promise<ModelStatus>;
125
140
  status(): Promise<ModelStatus>;
126
141
  /**
127
142
  * Ask the environment's model. Supported kinds only; the answer must be one of the