@happyvertical/smrt-cli 0.53.3 → 0.53.5
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.
- package/AGENTS.md +3 -0
- package/README.md +64 -0
- package/agents/app-commands.md +118 -0
- package/bin/smrt-web.mjs +19 -0
- package/bin/smrt.js +18 -12
- package/dist/{ApiKey-BZmbOTnL-DchyhIPA.js → ApiKey-BZmbOTnL-BbZupUZ3.js} +2 -2
- package/dist/ApiKeyCollection-Bfb_nw81-DYAZwx0O.js +87 -0
- package/dist/AuditLogCollection-B1YonCAP-Bkj2Ezon.js +193 -0
- package/dist/{NostrIdentity-n70E0vck-CLGPdJ1W.js → NostrIdentity-n70E0vck-Di3_eNCq.js} +4 -4
- package/dist/NostrIdentityCollection-Ca74dkaL-DvjOg9Xy.js +127 -0
- package/dist/{OidcIdentity-Cb1bxreM-DPBTZddF.js → OidcIdentity-Cb1bxreM-LXmC7uAf.js} +2 -2
- package/dist/OidcIdentityCollection-TV8VdK69-Cv1ZTeuk.js +86 -0
- package/dist/ProfileAssetCollection-B9hacUJa-CPuaWLk4.js +101 -0
- package/dist/{ProfileCollection-DuJT7Mum-BUYQQ9xZ.js → ProfileCollection-DuJT7Mum-nXbHrPpX.js} +31 -31
- package/dist/ProfileLinkCollection-4uNURz32-CbKZYmYm.js +233 -0
- package/dist/ProfileMetadataCollection-DQhbfEfa-_1rQCLTR.js +108 -0
- package/dist/ProfileMetafieldCollection-CoBuM_5G-CPjW3l5r.js +145 -0
- package/dist/ProfileRelationshipCollection-DUVgaIqf-RCDqYz6O.js +161 -0
- package/dist/ProfileRelationshipTermCollection-DtA9OM23-BoGhQBSQ.js +107 -0
- package/dist/{ProfileRelationshipType-BRiRka6t-xzRfZRFG.js → ProfileRelationshipType-BRiRka6t-Dezjv5jP.js} +1 -1
- package/dist/ProfileRelationshipTypeCollection-BdXwd7Kf-HoTmV1q-.js +57 -0
- package/dist/app/cli.d.ts +51 -0
- package/dist/app/cli.d.ts.map +1 -0
- package/dist/app/errors.d.ts +55 -0
- package/dist/app/errors.d.ts.map +1 -0
- package/dist/app/identity.d.ts +24 -0
- package/dist/app/identity.d.ts.map +1 -0
- package/dist/app/index.d.ts +20 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/launchers.d.ts +51 -0
- package/dist/app/launchers.d.ts.map +1 -0
- package/dist/app/operations.d.ts +30 -0
- package/dist/app/operations.d.ts.map +1 -0
- package/dist/app/portability-assets.d.ts +151 -0
- package/dist/app/portability-assets.d.ts.map +1 -0
- package/dist/app/portability.d.ts +117 -0
- package/dist/app/portability.d.ts.map +1 -0
- package/dist/app/process-record.d.ts +54 -0
- package/dist/app/process-record.d.ts.map +1 -0
- package/dist/app/runtime.d.ts +98 -0
- package/dist/app/runtime.d.ts.map +1 -0
- package/dist/app/tokens.d.ts +21 -0
- package/dist/app/tokens.d.ts.map +1 -0
- package/dist/app.d.ts +1 -0
- package/dist/app.js +4 -0
- package/dist/cli-OZsH5cdL.js +1602 -0
- package/dist/cli-generator.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/utilities.d.ts.map +1 -1
- package/dist/{commands-B8N38deG.js → commands-UXK2F_0j.js} +49 -336
- package/dist/database-environment-D_Gk1Brf.js +20 -0
- package/dist/database-environment.d.ts +43 -0
- package/dist/database-environment.d.ts.map +1 -0
- package/dist/dist-BVjJWjT-.js +20 -0
- package/dist/{dist-B62O-xH6.js → dist-C87Ib9Vx.js} +2 -2
- package/dist/{dist-CL9KGm1j.js → dist-DLw_E34G.js} +1654 -1748
- package/dist/{dist-BBQyIRsO.js → dist-GIaWaUho.js} +4 -4
- package/dist/{dist-C8BOgli4.js → dist-RSE5hCY4.js} +3 -3
- package/dist/index.js +19 -9
- package/dist/mcp-apps-packaging-CixRnxz_.js +286 -0
- package/dist/{oidcProvisioningPrimitives-D9OYu5-F-l8afZs4F.js → oidcProvisioningPrimitives-D9OYu5-F-T9KkkDCd.js} +5 -5
- package/dist/portability-CES1YC2m.js +859 -0
- package/dist/resolveIdentity-B-PK6RwU-C9ogf8YG.js +269 -0
- package/package.json +19 -14
- package/dist/ApiKeyCollection-Bfb_nw81-DR5XF_SZ.js +0 -2
- package/dist/AuditLogCollection-B1YonCAP-PbzALncL.js +0 -2
- package/dist/NostrIdentityCollection-Ca74dkaL-C2r-uDlC.js +0 -2
- package/dist/OidcIdentityCollection-TV8VdK69-2fZROnih.js +0 -2
- package/dist/ProfileAssetCollection-B9hacUJa-D33sifgF.js +0 -2
- package/dist/ProfileLinkCollection-4uNURz32-CHDTinax.js +0 -2
- package/dist/ProfileMetadataCollection-DQhbfEfa-BQTogfVX.js +0 -2
- package/dist/ProfileMetafieldCollection-CoBuM_5G-BXtoIP02.js +0 -2
- package/dist/ProfileRelationshipCollection-DUVgaIqf-CNMliUF3.js +0 -2
- package/dist/ProfileRelationshipTermCollection-DtA9OM23-DPOMtMr7.js +0 -2
- package/dist/ProfileRelationshipTypeCollection-BdXwd7Kf-Co3PdH01.js +0 -2
- package/dist/resolveIdentity-B-PK6RwU-B306Ch1I.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-generator.d.ts","sourceRoot":"","sources":["../src/cli-generator.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAiBH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AA2G9B,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,iBAAiB,CAAC;I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O,CAAC,IAAI,CAAC;IA8GrD;;OAEG;IACH,OAAO,CAAC,eAAe;IAiBvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAiCrB;;OAEG;YACW,MAAM;IAcpB;;OAEG;YACW,OAAO;IAKrB;;OAEG;YACW,UAAU;IA4CxB;;OAEG;YACW,SAAS;IAiCvB;;OAEG;YACW,YAAY;IA+C1B;;OAEG;YACW,YAAY;IA2D1B;;OAEG;YACW,YAAY;IAyC1B;;OAEG;YACW,kBAAkB;IA8HhC;;;OAGG;YACW,qBAAqB;IAyOnC;;;OAGG;YACW,aAAa;IA0D3B;;OAEG;YACW,eAAe;IAiC7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuBpB;;OAEG;IACH,OAAO,CAAC,YAAY;CAqBrB;AAGD,wBAAsB,IAAI,kBAuGzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA+
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA+StD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAkNnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/commands/utilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAiJtD,wBAAgB,uBAAuB,CAAC,OAAO,SAAgB,GAAG,MAAM,CAIvE;
|
|
1
|
+
{"version":3,"file":"util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|
|
|
1
1
|
import { t as resolveManifestEntryPackageName } from "./index.js";
|
|
2
2
|
import { t as DEFAULT_CLI_CONFIG } from "./config-hqNo4lzH.js";
|
|
3
|
+
import { addMcpAppsRuntime, assertMcpAppsPluginName, configureMcpAppsConsumerRegistry, mcpAppsCommands, scaffoldMcpAppsPackage, validateMcpAppsPackage } from "./mcp-apps-packaging-CixRnxz_.js";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
5
|
import * as fs from "node:fs";
|
|
5
|
-
import {
|
|
6
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
6
7
|
import * as path from "node:path";
|
|
7
8
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
8
9
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
10
|
import { ObjectRegistry, SchemaComparer, checkLiveSchemaParity, collectForeignKeyOrphanCounts, createQualifiedName, ensureDeferredSystemTableCompatibility, generateDDLForEngine, getClassName, isQualifiedName, isSmrtCollectionExtendsName, migratePostgresSystemTimestamps, parseQualifiedName, planForeignKeyCreation, planPostgresSystemTimestampMigrations } from "@happyvertical/smrt-core";
|
|
10
11
|
import { loadExternalManifestSync } from "@happyvertical/smrt-core/manifest";
|
|
12
|
+
import { execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
13
|
+
import { homedir, tmpdir } from "node:os";
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
11
15
|
import { access, cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
12
16
|
import { createLogger } from "@happyvertical/logger";
|
|
13
17
|
import glob from "fast-glob";
|
|
14
|
-
import { createHash } from "node:crypto";
|
|
15
18
|
import { getPackageConfig } from "@happyvertical/smrt-config";
|
|
16
19
|
import { toSnakeCase as toSnakeCase$1 } from "@happyvertical/smrt-core/utils";
|
|
17
20
|
import { checkKnowledgeGraphFreshness, discoverScopedPackageDirectories, readAgentModuleDocs, readPackageAgentDoc, resolveAgentModuleDocPaths } from "@happyvertical/smrt-core/knowledge";
|
|
18
21
|
import { MCPGenerator } from "@happyvertical/smrt-core/generators";
|
|
19
22
|
import { generateDeclarationsFromCLI } from "@happyvertical/smrt-core/prebuild";
|
|
20
|
-
import { execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
21
23
|
import https from "node:https";
|
|
22
|
-
import { homedir, tmpdir } from "node:os";
|
|
23
24
|
import { extract } from "tar";
|
|
24
|
-
import Ajv2020 from "ajv/dist/2020.js";
|
|
25
25
|
import { importWorkspaceModule } from "@happyvertical/smrt-core/utils/import-workspace-module";
|
|
26
26
|
import { renderForeignKeyAddStatements } from "@happyvertical/smrt-core/schema";
|
|
27
27
|
import { FRAMEWORK_BASE_TABLE_NAMES, backfillLegacyQualifiedNames, buildIntegerWidthTableStatements, collectIntegerWidthTargets, collectNullEqualIndexTargets, countLegacyQualifiedNameReferences, dropFrameworkBaseTables, migrateNullEqualIndexes, nullEqualIndexStatements, parsePostgresTimeoutMs, planFrameworkBaseTableDrop, preflightIntegerWidthWidening, preflightNullEqualIndexes, widenIntegerColumnsToBigInt } from "@happyvertical/smrt-core/migrations";
|
|
@@ -3076,7 +3076,7 @@ function isTextColumnType(type) {
|
|
|
3076
3076
|
const normalized = normalizeColumnType(type);
|
|
3077
3077
|
return normalized === "text" || normalized === "varchar" || normalized === "character varying";
|
|
3078
3078
|
}
|
|
3079
|
-
function isPostgresDatabase(dbType, dbUrl) {
|
|
3079
|
+
function isPostgresDatabase$1(dbType, dbUrl) {
|
|
3080
3080
|
return dbType === "postgres" || /^postgres/i.test(dbUrl);
|
|
3081
3081
|
}
|
|
3082
3082
|
function manifestDeclaresTenantIdUuid(manifestSchemas) {
|
|
@@ -3091,7 +3091,7 @@ async function countNonUuidTenantIds(db) {
|
|
|
3091
3091
|
}
|
|
3092
3092
|
async function checkTenantIdUuidPreconditions(input) {
|
|
3093
3093
|
const { db, dbType, dbUrl, manifestSchemas } = input;
|
|
3094
|
-
if (!isPostgresDatabase(dbType, dbUrl) || typeof db?.getTableSchema !== "function" || !manifestDeclaresTenantIdUuid(manifestSchemas)) return [];
|
|
3094
|
+
if (!isPostgresDatabase$1(dbType, dbUrl) || typeof db?.getTableSchema !== "function" || !manifestDeclaresTenantIdUuid(manifestSchemas)) return [];
|
|
3095
3095
|
const idColumn = getSchemaColumn(await db.getTableSchema("tenants"), "id");
|
|
3096
3096
|
if (!idColumn) return [];
|
|
3097
3097
|
if (normalizeColumnType(idColumn.type) === "uuid") return [{
|
|
@@ -6245,287 +6245,6 @@ async function processPlaceholders(outputDir, config, options) {
|
|
|
6245
6245
|
console.log(` Processed placeholders in ${replacedCount} files`);
|
|
6246
6246
|
}
|
|
6247
6247
|
//#endregion
|
|
6248
|
-
//#region src/commands/mcp-apps-packaging.ts
|
|
6249
|
-
/**
|
|
6250
|
-
* Portable MCP Apps plugin packaging helpers.
|
|
6251
|
-
*
|
|
6252
|
-
* These helpers intentionally validate distribution metadata only. Runtime
|
|
6253
|
-
* MCP extension metadata is owned by the v2 server adapter and is not an
|
|
6254
|
-
* install-plugin manifest.
|
|
6255
|
-
*/
|
|
6256
|
-
var requireSchema = createRequire(import.meta.url);
|
|
6257
|
-
var pluginSchema = requireSchema("@happyvertical/smrt-dev-mcp/schemas/agent-plugins-1.0.0/plugin.schema.json");
|
|
6258
|
-
var mcpSchema = requireSchema("@happyvertical/smrt-dev-mcp/schemas/agent-plugins-1.0.0/mcp.schema.json");
|
|
6259
|
-
var ajv = new Ajv2020({
|
|
6260
|
-
strict: true,
|
|
6261
|
-
allErrors: true
|
|
6262
|
-
});
|
|
6263
|
-
var validatePluginSchema = ajv.compile(pluginSchema);
|
|
6264
|
-
var validateMcpSchema = ajv.compile(mcpSchema);
|
|
6265
|
-
var PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
6266
|
-
var MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
6267
|
-
var CANONICAL_SCOPE_REGISTRY = "@happyvertical:registry=https://npm.happyvertical.com/";
|
|
6268
|
-
var SECRET_KEY = /(?:api[_-]?key|secret|token|password|authorization|credential)/i;
|
|
6269
|
-
var ENVIRONMENT_CREDENTIAL_FILE = /^\.env(?:\.|$)/;
|
|
6270
|
-
var PRIVATE_KEY_CARRIER = /^(?:id_(?:rsa|dsa|ecdsa|ed25519)|private(?:[._-]key)?|.*\.key)$/i;
|
|
6271
|
-
var PRIVATE_KEY_HEADER = /-----BEGIN(?: [A-Z0-9]+)* PRIVATE KEY-----/;
|
|
6272
|
-
function add(result, code, message) {
|
|
6273
|
-
result.findings.push({
|
|
6274
|
-
code,
|
|
6275
|
-
message
|
|
6276
|
-
});
|
|
6277
|
-
}
|
|
6278
|
-
function readJson$1(path, result) {
|
|
6279
|
-
try {
|
|
6280
|
-
return JSON.parse(readFileSync(path, "utf8"));
|
|
6281
|
-
} catch (error) {
|
|
6282
|
-
add(result, "json-malformed", `${relative(process.cwd(), path)} is not valid JSON`);
|
|
6283
|
-
return;
|
|
6284
|
-
}
|
|
6285
|
-
}
|
|
6286
|
-
function isObject(value) {
|
|
6287
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6288
|
-
}
|
|
6289
|
-
function safeRelativePath(value, field, root, result) {
|
|
6290
|
-
if (typeof value !== "string" || !value.startsWith("./") || value.includes("\\") || value.split("/").includes("..")) {
|
|
6291
|
-
add(result, "unsafe-path", `${field} must be a root-relative ./ path without parent segments`);
|
|
6292
|
-
return;
|
|
6293
|
-
}
|
|
6294
|
-
const target = resolve(root, value);
|
|
6295
|
-
if (!target.startsWith(`${root}${sep}`)) {
|
|
6296
|
-
add(result, "unsafe-path", `${field} resolves outside the plugin root`);
|
|
6297
|
-
return;
|
|
6298
|
-
}
|
|
6299
|
-
try {
|
|
6300
|
-
const stat = lstatSync(target);
|
|
6301
|
-
if (stat.isSymbolicLink() || !stat.isFile()) add(result, "invalid-resource", `${field} must name a regular file`);
|
|
6302
|
-
} catch {
|
|
6303
|
-
add(result, "missing-resource", `${field} does not exist`);
|
|
6304
|
-
}
|
|
6305
|
-
}
|
|
6306
|
-
function scanTree(root, current, result) {
|
|
6307
|
-
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
6308
|
-
const path = join(current, entry.name);
|
|
6309
|
-
const display = relative(root, path);
|
|
6310
|
-
const stat = lstatSync(path);
|
|
6311
|
-
if (stat.isSymbolicLink()) add(result, "symlink", `${display} is a symbolic link; plugin packages must contain regular files`);
|
|
6312
|
-
else if (stat.isDirectory()) scanTree(root, path, result);
|
|
6313
|
-
else if (stat.isFile()) if (ENVIRONMENT_CREDENTIAL_FILE.test(entry.name) || PRIVATE_KEY_CARRIER.test(entry.name)) add(result, "secret-artifact", `${display} is a credential carrier and cannot be packaged`);
|
|
6314
|
-
else try {
|
|
6315
|
-
if (PRIVATE_KEY_HEADER.test(readFileSync(path, "utf8"))) add(result, "secret-artifact", `${display} contains a private key and cannot be packaged`);
|
|
6316
|
-
} catch {
|
|
6317
|
-
add(result, "artifact-unreadable", `${display} could not be inspected and cannot be packaged`);
|
|
6318
|
-
}
|
|
6319
|
-
}
|
|
6320
|
-
}
|
|
6321
|
-
function scanSecrets(value, source, result) {
|
|
6322
|
-
if (Array.isArray(value)) {
|
|
6323
|
-
value.forEach((item) => {
|
|
6324
|
-
scanSecrets(item, source, result);
|
|
6325
|
-
});
|
|
6326
|
-
return;
|
|
6327
|
-
}
|
|
6328
|
-
if (!isObject(value)) return;
|
|
6329
|
-
for (const [key, child] of Object.entries(value)) {
|
|
6330
|
-
if (SECRET_KEY.test(key) && typeof child === "string" && child.trim()) add(result, "secret-artifact", `${source} contains a credential-shaped ${key} field`);
|
|
6331
|
-
scanSecrets(child, source, result);
|
|
6332
|
-
}
|
|
6333
|
-
}
|
|
6334
|
-
function validateServerUrl(value, name, result) {
|
|
6335
|
-
if (typeof value !== "string") return add(result, "server-url", `mcpServers.${name}.url must be a string`);
|
|
6336
|
-
try {
|
|
6337
|
-
const url = new URL(value);
|
|
6338
|
-
const isLoopback = url.hostname === "127.0.0.1" || url.hostname === "localhost" || url.hostname === "[::1]";
|
|
6339
|
-
if (url.username || url.password) add(result, "server-url", `mcpServers.${name}.url must not contain credentials`);
|
|
6340
|
-
if (url.protocol !== "https:" && !(url.protocol === "http:" && isLoopback)) add(result, "server-url", `mcpServers.${name}.url must use HTTPS, except loopback development URLs`);
|
|
6341
|
-
} catch {
|
|
6342
|
-
add(result, "server-url", `mcpServers.${name}.url is not a URL`);
|
|
6343
|
-
}
|
|
6344
|
-
}
|
|
6345
|
-
/** Validate portable plugin files and the optional OpenAI install extension. */
|
|
6346
|
-
function validateMcpAppsPackage(rootPath) {
|
|
6347
|
-
const root = resolve(rootPath);
|
|
6348
|
-
const result = {
|
|
6349
|
-
findings: [],
|
|
6350
|
-
valid: false
|
|
6351
|
-
};
|
|
6352
|
-
try {
|
|
6353
|
-
scanTree(root, root, result);
|
|
6354
|
-
} catch {
|
|
6355
|
-
add(result, "plugin-root", "Plugin root must be a readable directory");
|
|
6356
|
-
return result;
|
|
6357
|
-
}
|
|
6358
|
-
const pluginPath = join(root, "plugin.json");
|
|
6359
|
-
const mcpPath = join(root, "mcp.json");
|
|
6360
|
-
if (!lstatExists(pluginPath)) add(result, "plugin-missing", "plugin.json is required at the plugin root");
|
|
6361
|
-
if (!lstatExists(mcpPath)) add(result, "mcp-missing", "mcp.json is required at the plugin root");
|
|
6362
|
-
const plugin = lstatExists(pluginPath) ? readJson$1(pluginPath, result) : void 0;
|
|
6363
|
-
const mcp = lstatExists(mcpPath) ? readJson$1(mcpPath, result) : void 0;
|
|
6364
|
-
if (plugin !== void 0 && !isObject(plugin)) add(result, "plugin-object", "plugin.json must contain an object");
|
|
6365
|
-
if (mcp !== void 0 && !isObject(mcp)) add(result, "mcp-object", "mcp.json must contain an object");
|
|
6366
|
-
if (plugin !== void 0 && !validatePluginSchema(plugin)) add(result, "plugin-format", "plugin.json violates the pinned Agent Plugins 1.0.0 schema");
|
|
6367
|
-
if (mcp !== void 0 && !validateMcpSchema(mcp)) add(result, "mcp-format", "mcp.json violates the pinned Agent Plugins 1.0.0 schema");
|
|
6368
|
-
if (isObject(plugin)) {
|
|
6369
|
-
scanSecrets(plugin, "plugin.json", result);
|
|
6370
|
-
if (plugin.$schema !== PLUGIN_SCHEMA) add(result, "plugin-schema", `plugin.json.$schema must be ${PLUGIN_SCHEMA}`);
|
|
6371
|
-
if (plugin.extensions !== void 0 && !isObject(plugin.extensions)) add(result, "extensions", "plugin.json.extensions must be an object");
|
|
6372
|
-
const openai = (isObject(plugin.extensions) ? plugin.extensions : void 0)?.["com.openai"];
|
|
6373
|
-
if (openai !== void 0 && !isObject(openai)) add(result, "openai-extension", "extensions.com.openai must be an object");
|
|
6374
|
-
if (isObject(openai)) {
|
|
6375
|
-
if (openai.apps !== void 0) safeRelativePath(openai.apps, "extensions.com.openai.apps", root, result);
|
|
6376
|
-
const ui = openai.interface;
|
|
6377
|
-
if (ui !== void 0 && !isObject(ui)) add(result, "openai-interface", "extensions.com.openai.interface must be an object");
|
|
6378
|
-
if (isObject(ui)) {
|
|
6379
|
-
for (const key of ["composerIcon", "logo"]) if (ui[key] !== void 0) safeRelativePath(ui[key], `extensions.com.openai.interface.${key}`, root, result);
|
|
6380
|
-
if (ui.screenshots !== void 0) if (!Array.isArray(ui.screenshots) || ui.screenshots.some((path) => typeof path !== "string")) add(result, "openai-screenshots", "interface.screenshots must be an array of paths");
|
|
6381
|
-
else ui.screenshots.forEach((path, index) => {
|
|
6382
|
-
safeRelativePath(path, `extensions.com.openai.interface.screenshots[${index}]`, root, result);
|
|
6383
|
-
});
|
|
6384
|
-
}
|
|
6385
|
-
}
|
|
6386
|
-
}
|
|
6387
|
-
if (isObject(mcp)) {
|
|
6388
|
-
scanSecrets(mcp, "mcp.json", result);
|
|
6389
|
-
if (mcp.$schema !== MCP_SCHEMA) add(result, "mcp-schema", `mcp.json.$schema must be ${MCP_SCHEMA}`);
|
|
6390
|
-
if (!isObject(mcp.mcpServers) || Object.keys(mcp.mcpServers).length === 0) add(result, "mcp-servers", "mcp.json requires a non-empty mcpServers object");
|
|
6391
|
-
else for (const [name, server] of Object.entries(mcp.mcpServers)) {
|
|
6392
|
-
if (!name.trim() || !isObject(server)) {
|
|
6393
|
-
add(result, "mcp-server", `mcpServers.${name || "<empty>"} must be an object with a name`);
|
|
6394
|
-
continue;
|
|
6395
|
-
}
|
|
6396
|
-
if (server.type !== "streamable-http") add(result, "mcp-transport", `mcpServers.${name}.type must be streamable-http`);
|
|
6397
|
-
validateServerUrl(server.url, name, result);
|
|
6398
|
-
}
|
|
6399
|
-
}
|
|
6400
|
-
result.valid = result.findings.length === 0;
|
|
6401
|
-
return result;
|
|
6402
|
-
}
|
|
6403
|
-
function lstatExists(path) {
|
|
6404
|
-
try {
|
|
6405
|
-
return lstatSync(path).isFile();
|
|
6406
|
-
} catch {
|
|
6407
|
-
return false;
|
|
6408
|
-
}
|
|
6409
|
-
}
|
|
6410
|
-
/**
|
|
6411
|
-
* Add the public, credential-free SMRT package route to a generated app.
|
|
6412
|
-
* A pre-existing scope route is an explicit consumer decision and must not be
|
|
6413
|
-
* silently replaced.
|
|
6414
|
-
*/
|
|
6415
|
-
function configureMcpAppsConsumerRegistry(appRoot) {
|
|
6416
|
-
const npmrcPath = join(resolve(appRoot), ".npmrc");
|
|
6417
|
-
let existing = "";
|
|
6418
|
-
try {
|
|
6419
|
-
const stat = lstatSync(npmrcPath);
|
|
6420
|
-
if (stat.isSymbolicLink() || !stat.isFile()) throw new Error("Generated application .npmrc must be a regular file");
|
|
6421
|
-
existing = readFileSync(npmrcPath, "utf8");
|
|
6422
|
-
} catch (error) {
|
|
6423
|
-
if (error.code !== "ENOENT") throw error;
|
|
6424
|
-
}
|
|
6425
|
-
const scopeLines = existing.split(/\r?\n/).filter((line) => /^\s*@happyvertical:registry(?:\s|=|$)/.test(line));
|
|
6426
|
-
if (scopeLines.length > 0) {
|
|
6427
|
-
for (const line of scopeLines) {
|
|
6428
|
-
const match = /^\s*@happyvertical:registry\s*=\s*(\S+?)(?:\s+[;#].*)?\s*$/.exec(line);
|
|
6429
|
-
if (!match || match[1] !== "https://npm.happyvertical.com/") throw new Error("Generated application already declares a different or malformed @happyvertical registry; refusing to replace it");
|
|
6430
|
-
}
|
|
6431
|
-
return;
|
|
6432
|
-
}
|
|
6433
|
-
writeFileSync(npmrcPath, `${existing}${existing && !existing.endsWith("\n") ? "\n" : ""}${CANONICAL_SCOPE_REGISTRY}\n`);
|
|
6434
|
-
}
|
|
6435
|
-
/** Copy the opt-in app route/resources and merge only its declared dependencies. */
|
|
6436
|
-
function addMcpAppsRuntime(sourceRoot, appRoot) {
|
|
6437
|
-
const resolvedSource = resolve(sourceRoot);
|
|
6438
|
-
const source = join(lstatSync(resolvedSource).isFile() ? dirname(resolvedSource) : resolvedSource, "mcp-apps-template");
|
|
6439
|
-
const dependencies = JSON.parse(readFileSync(join(source, "package.dependencies.json"), "utf8"));
|
|
6440
|
-
cpSync(join(source, "src"), join(resolve(appRoot), "src"), {
|
|
6441
|
-
recursive: true,
|
|
6442
|
-
force: false,
|
|
6443
|
-
errorOnExist: true
|
|
6444
|
-
});
|
|
6445
|
-
const packagePath = join(resolve(appRoot), "package.json");
|
|
6446
|
-
const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
|
|
6447
|
-
packageJson.dependencies = {
|
|
6448
|
-
...packageJson.dependencies,
|
|
6449
|
-
...dependencies
|
|
6450
|
-
};
|
|
6451
|
-
writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);
|
|
6452
|
-
}
|
|
6453
|
-
function assertMcpAppsPluginName(name) {
|
|
6454
|
-
if (!validatePluginSchema({
|
|
6455
|
-
$schema: PLUGIN_SCHEMA,
|
|
6456
|
-
name
|
|
6457
|
-
})) throw new Error("Plugin name must satisfy Agent Plugins 1.0.0 (1–64 lowercase letters, digits, dots or hyphens; no repeated separators).");
|
|
6458
|
-
}
|
|
6459
|
-
/** Create the minimal local portable package. It intentionally has no .app.json: registered IDs are host-owned. */
|
|
6460
|
-
function scaffoldMcpAppsPackage(rootPath, name, version = "0.1.0") {
|
|
6461
|
-
assertMcpAppsPluginName(name);
|
|
6462
|
-
const root = resolve(rootPath);
|
|
6463
|
-
mkdirSync(root, { recursive: true });
|
|
6464
|
-
const pluginPath = join(root, "plugin.json");
|
|
6465
|
-
const mcpPath = join(root, "mcp.json");
|
|
6466
|
-
if (lstatExists(pluginPath) || lstatExists(mcpPath)) throw new Error("Refusing to overwrite existing MCP Apps package files");
|
|
6467
|
-
writeFileSync(pluginPath, `${JSON.stringify({
|
|
6468
|
-
$schema: PLUGIN_SCHEMA,
|
|
6469
|
-
name,
|
|
6470
|
-
version,
|
|
6471
|
-
description: "SMRT MCP Apps package",
|
|
6472
|
-
extensions: { "com.openai": { interface: {
|
|
6473
|
-
displayName: name,
|
|
6474
|
-
shortDescription: "SMRT MCP Apps package"
|
|
6475
|
-
} } }
|
|
6476
|
-
}, null, 2)}\n`);
|
|
6477
|
-
writeFileSync(mcpPath, `${JSON.stringify({
|
|
6478
|
-
$schema: MCP_SCHEMA,
|
|
6479
|
-
mcpServers: { smrt: {
|
|
6480
|
-
type: "streamable-http",
|
|
6481
|
-
url: "http://127.0.0.1:3000/api/mcp"
|
|
6482
|
-
} }
|
|
6483
|
-
}, null, 2)}\n`);
|
|
6484
|
-
}
|
|
6485
|
-
var mcpAppsCommands = {
|
|
6486
|
-
"mcp-apps scaffold": {
|
|
6487
|
-
name: "mcp-apps scaffold",
|
|
6488
|
-
description: "Create opt-in portable MCP Apps plugin metadata for a local SMRT app",
|
|
6489
|
-
options: {
|
|
6490
|
-
"output-dir": {
|
|
6491
|
-
type: "string",
|
|
6492
|
-
description: "Plugin directory (defaults to ./mcp-apps)"
|
|
6493
|
-
},
|
|
6494
|
-
name: {
|
|
6495
|
-
type: "string",
|
|
6496
|
-
description: "Portable plugin name",
|
|
6497
|
-
default: "smrt-app"
|
|
6498
|
-
},
|
|
6499
|
-
version: {
|
|
6500
|
-
type: "string",
|
|
6501
|
-
description: "Portable plugin version",
|
|
6502
|
-
default: "0.1.0"
|
|
6503
|
-
}
|
|
6504
|
-
},
|
|
6505
|
-
handler: async (_args, options) => {
|
|
6506
|
-
const root = typeof options["output-dir"] === "string" ? options["output-dir"] : "./mcp-apps";
|
|
6507
|
-
scaffoldMcpAppsPackage(root, typeof options.name === "string" ? options.name : "smrt-app", typeof options.version === "string" ? options.version : "0.1.0");
|
|
6508
|
-
console.log(`Created portable MCP Apps metadata in ${root}.`);
|
|
6509
|
-
console.log("Mount and authorize the native v2 /api/mcp endpoint before changing the loopback URL.");
|
|
6510
|
-
}
|
|
6511
|
-
},
|
|
6512
|
-
"mcp-apps validate": {
|
|
6513
|
-
name: "mcp-apps validate",
|
|
6514
|
-
description: "Fail closed when portable MCP Apps package metadata is unsafe or incomplete",
|
|
6515
|
-
options: { "output-dir": {
|
|
6516
|
-
type: "string",
|
|
6517
|
-
description: "Plugin directory (defaults to ./mcp-apps)"
|
|
6518
|
-
} },
|
|
6519
|
-
handler: async (_args, options) => {
|
|
6520
|
-
const root = typeof options["output-dir"] === "string" ? options["output-dir"] : "./mcp-apps";
|
|
6521
|
-
const result = validateMcpAppsPackage(root);
|
|
6522
|
-
for (const finding of result.findings) console.error(`${finding.code}: ${finding.message}`);
|
|
6523
|
-
if (!result.valid) throw new Error(`MCP Apps package validation failed with ${result.findings.length} finding(s)`);
|
|
6524
|
-
console.log(`MCP Apps package at ${root} is valid.`);
|
|
6525
|
-
}
|
|
6526
|
-
}
|
|
6527
|
-
};
|
|
6528
|
-
//#endregion
|
|
6529
6248
|
//#region src/commands/gnode.ts
|
|
6530
6249
|
/**
|
|
6531
6250
|
* Gnode CLI Commands
|
|
@@ -6774,68 +6493,52 @@ export default {
|
|
|
6774
6493
|
};
|
|
6775
6494
|
`;
|
|
6776
6495
|
/**
|
|
6777
|
-
* Template for src/lib/server/smrt.ts
|
|
6496
|
+
* Template for src/lib/server/smrt.ts: the `runtime` export generated routes
|
|
6497
|
+
* resolve collections through (core's `createGeneratedCollectionAccess`).
|
|
6498
|
+
* It deliberately exports no `getCollection`/`getSmrtConfig`, which are
|
|
6499
|
+
* deprecated (#3416, #3446).
|
|
6778
6500
|
*/
|
|
6779
6501
|
var SERVER_SMRT_TEMPLATE = `/**
|
|
6780
|
-
*
|
|
6502
|
+
* The application's SMRT runtime, as generated API routes consume it:
|
|
6503
|
+
* they call \`runtime.getCollection()\` / \`runtime.classOptions()\` on every
|
|
6504
|
+
* request. Call them per request in your own routes too.
|
|
6781
6505
|
*
|
|
6782
|
-
*
|
|
6783
|
-
*
|
|
6506
|
+
* For the full application runtime (profiles, owner bootstrap, sessions,
|
|
6507
|
+
* tenancy), replace this object with \`createSmrtSvelteKitRuntime()\` from
|
|
6508
|
+
* \`@happyvertical/smrt-app-runtime/sveltekit\` and mount its \`handle\` and
|
|
6509
|
+
* \`init\` in \`src/hooks.server.ts\`.
|
|
6784
6510
|
*/
|
|
6785
6511
|
|
|
6786
|
-
import {
|
|
6512
|
+
import {
|
|
6513
|
+
type GeneratedCollectionRuntime,
|
|
6514
|
+
ObjectRegistry,
|
|
6515
|
+
type SmrtClassOptions,
|
|
6516
|
+
type SmrtObject,
|
|
6517
|
+
} from '@happyvertical/smrt-core';
|
|
6787
6518
|
|
|
6788
6519
|
// Import all SMRT objects to register them
|
|
6789
6520
|
import '../objects/index.js';
|
|
6790
6521
|
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
* Use this to configure specific objects differently from defaults.
|
|
6795
|
-
* Example:
|
|
6796
|
-
* AuditLog: { db: { url: process.env.AUDIT_DB_URL!, type: 'postgres' } }
|
|
6797
|
-
*/
|
|
6798
|
-
const objectOverrides: Record<string, Partial<SmrtClassOptions>> = {
|
|
6799
|
-
// Add object-specific overrides here
|
|
6800
|
-
};
|
|
6522
|
+
// Per-object overrides, for example:
|
|
6523
|
+
// AuditLog: { db: { type: 'postgres', url: process.env.AUDIT_DB_URL! } }
|
|
6524
|
+
const classOverrides: Record<string, Partial<SmrtClassOptions>> = {};
|
|
6801
6525
|
|
|
6802
|
-
|
|
6803
|
-
* Get default configuration for SMRT objects
|
|
6804
|
-
*/
|
|
6805
|
-
function getDefaultConfig(): SmrtClassOptions {
|
|
6526
|
+
function classOptions(className: string): SmrtClassOptions {
|
|
6806
6527
|
return {
|
|
6807
6528
|
db: {
|
|
6808
6529
|
url: process.env.DATABASE_URL || './data/app.db',
|
|
6809
6530
|
type: (process.env.DATABASE_TYPE as 'sqlite' | 'postgres') || 'sqlite',
|
|
6810
6531
|
},
|
|
6811
|
-
|
|
6812
|
-
? {
|
|
6813
|
-
type: 'openai',
|
|
6814
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
6815
|
-
}
|
|
6816
|
-
: undefined,
|
|
6532
|
+
...classOverrides[className],
|
|
6817
6533
|
};
|
|
6818
6534
|
}
|
|
6819
6535
|
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
return override ? { ...defaults, ...override } : defaults;
|
|
6827
|
-
}
|
|
6828
|
-
|
|
6829
|
-
/**
|
|
6830
|
-
* Get a collection instance for a SMRT class
|
|
6831
|
-
*
|
|
6832
|
-
* Usage in routes:
|
|
6833
|
-
* const products = await getCollection<Product>('Product');
|
|
6834
|
-
* const items = await products.list();
|
|
6835
|
-
*/
|
|
6836
|
-
export async function getCollection<T>(className: string) {
|
|
6837
|
-
return await ObjectRegistry.getCollection<T>(className, getSmrtConfig(className));
|
|
6838
|
-
}
|
|
6536
|
+
export const runtime = {
|
|
6537
|
+
classOptions,
|
|
6538
|
+
getCollection<T extends SmrtObject = SmrtObject>(className: string) {
|
|
6539
|
+
return ObjectRegistry.getCollection<T>(className, classOptions(className));
|
|
6540
|
+
},
|
|
6541
|
+
} satisfies GeneratedCollectionRuntime;
|
|
6839
6542
|
`;
|
|
6840
6543
|
/**
|
|
6841
6544
|
* Template for src/lib/objects/index.ts
|
|
@@ -6974,7 +6677,7 @@ var initCommands = { init: {
|
|
|
6974
6677
|
return true;
|
|
6975
6678
|
};
|
|
6976
6679
|
writeFile("smrt.config.ts", SMRT_CONFIG_TEMPLATE.replace("{{DATABASE_TYPE}}", dbType).replace("{{DATABASE_URL}}", dbUrl), "SMRT configuration");
|
|
6977
|
-
writeFile("src/lib/server/smrt.ts", SERVER_SMRT_TEMPLATE, "
|
|
6680
|
+
writeFile("src/lib/server/smrt.ts", SERVER_SMRT_TEMPLATE, "SMRT runtime for generated routes");
|
|
6978
6681
|
writeFile("src/lib/objects/index.ts", OBJECTS_INDEX_TEMPLATE, "Objects index");
|
|
6979
6682
|
if (!options.skipExample) writeFile("src/lib/objects/Example.ts", EXAMPLE_OBJECT_TEMPLATE, "Example SMRT object");
|
|
6980
6683
|
writeFile(".env.example", ENV_EXAMPLE_TEMPLATE, "Environment example");
|
|
@@ -7409,7 +7112,7 @@ var dbMaterializeTenantHierarchyCommand = {
|
|
|
7409
7112
|
if (!config.database?.url || config.database.url === ":memory:") throw new Error("Database configuration required for db:materialize-tenant-hierarchy. Configure database.url in smrt.config.ts (or DATABASE_URL).");
|
|
7410
7113
|
const dbType = config.database.type || "sqlite";
|
|
7411
7114
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
7412
|
-
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-
|
|
7115
|
+
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-DLw_E34G.js");
|
|
7413
7116
|
db = await getDatabase({
|
|
7414
7117
|
type: dbType,
|
|
7415
7118
|
url: config.database.url
|
|
@@ -7618,7 +7321,7 @@ var dbMigrateLedgerAccountsCommand = {
|
|
|
7618
7321
|
if (dbType !== "postgres") throw new Error("db:migrate-ledger-accounts currently supports PostgreSQL only; no changes were made. See the smrt-ledgers README for SQLite.");
|
|
7619
7322
|
await autoDiscoverAndLoad();
|
|
7620
7323
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
7621
|
-
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-
|
|
7324
|
+
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-GIaWaUho.js");
|
|
7622
7325
|
db = await getDatabase({
|
|
7623
7326
|
type: dbType,
|
|
7624
7327
|
url: config.database.url
|
|
@@ -10013,6 +9716,16 @@ function renderAgentSurfaceReport(report) {
|
|
|
10013
9716
|
*/
|
|
10014
9717
|
var utilityCommands = {
|
|
10015
9718
|
...mcpAppsCommands,
|
|
9719
|
+
app: {
|
|
9720
|
+
name: "app",
|
|
9721
|
+
description: "Application operations: install, setup, recover, start, stop, doctor, open, backup, export, import, migrate, worker, dev, build (`smrt app help`)",
|
|
9722
|
+
args: ["[operation]", "[args...]"],
|
|
9723
|
+
handler: async (args) => {
|
|
9724
|
+
const { runAppCommand } = await import("./cli-OZsH5cdL.js").then((n) => n.r);
|
|
9725
|
+
const code = await runAppCommand(args);
|
|
9726
|
+
if (code !== 0) process.exitCode = code;
|
|
9727
|
+
}
|
|
9728
|
+
},
|
|
10016
9729
|
introspect: {
|
|
10017
9730
|
name: "introspect",
|
|
10018
9731
|
description: "Analyze project and discover SMRT objects",
|
|
@@ -10151,7 +9864,7 @@ export default testManifest;
|
|
|
10151
9864
|
console.log(` Unified: .smrt/manifest.json`);
|
|
10152
9865
|
console.log(` Legacy: ${jsonPath}`);
|
|
10153
9866
|
console.log(` TS: ${tsPath}\n`);
|
|
10154
|
-
if (!options.manifestOnly) {
|
|
9867
|
+
if (!(options["manifest-only"] ?? options.manifestOnly)) {
|
|
10155
9868
|
console.log("🧪 Running tests...\n");
|
|
10156
9869
|
const { spawn } = await import("node:child_process");
|
|
10157
9870
|
try {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/database-environment.ts
|
|
2
|
+
/**
|
|
3
|
+
* Apply `DATABASE_URL`/`DATABASE_TYPE` as the CLI database when no config
|
|
4
|
+
* layer declares `packages.cli.database.url`. Call after `loadConfig()`.
|
|
5
|
+
* The precedence itself is smrt-config's `resolveCliDatabaseConfig()`, which
|
|
6
|
+
* `smrt-dev-mcp` shares (#3446).
|
|
7
|
+
*
|
|
8
|
+
* @param env - Environment to read (defaults to `process.env`).
|
|
9
|
+
* @param warn - Sink for the one-line invalid-type warning.
|
|
10
|
+
* @returns Which source supplies the effective database.
|
|
11
|
+
*/
|
|
12
|
+
async function applyDatabaseEnvironment(env = process.env, warn = (message) => void process.stderr.write(`${message}\n`)) {
|
|
13
|
+
const { resolveCliDatabaseConfig, setConfig } = await import("@happyvertical/smrt-config");
|
|
14
|
+
const resolved = resolveCliDatabaseConfig(env);
|
|
15
|
+
if (resolved.source === "invalid-environment") warn(`⚠️ Ignoring DATABASE_URL: ${resolved.error} Configure packages.cli.database in smrt.config instead.`);
|
|
16
|
+
else if (resolved.source === "environment" && resolved.database) setConfig({ packages: { cli: { database: resolved.database } } });
|
|
17
|
+
return resolved.source;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { applyDatabaseEnvironment };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `DATABASE_URL` / `DATABASE_TYPE` as the CLI's database fallback (#3410).
|
|
3
|
+
*
|
|
4
|
+
* Every `smrt db:*` command reads `packages.cli.database` from smrt-config.
|
|
5
|
+
* `smrt app setup` / `smrt app migrate` hand a child `smrt db:migrate` the
|
|
6
|
+
* profile-owned database through the environment, so an application had to
|
|
7
|
+
* forward those variables in its own config. This module closes that gap
|
|
8
|
+
* once, before any command runs, with an explicit precedence:
|
|
9
|
+
*
|
|
10
|
+
* 1. `packages.cli.database.url` from any config layer (runtime `setConfig`,
|
|
11
|
+
* `smrt.config` `packages.cli`, or the global `smrt` section) — an explicit
|
|
12
|
+
* project setting always wins, so a stray shell `DATABASE_URL` can never
|
|
13
|
+
* retarget a project that names its database.
|
|
14
|
+
* 2. `DATABASE_URL`, with the engine from the config's `database.type`, else
|
|
15
|
+
* `DATABASE_TYPE` (`sqlite`, `postgres`, `postgresql`), else inferred from
|
|
16
|
+
* the URL scheme (`postgres://`/`postgresql://` → postgres, anything else
|
|
17
|
+
* sqlite — the same default the commands apply to a typeless config).
|
|
18
|
+
* 3. The built-in default (`:memory:`), which the schema commands refuse.
|
|
19
|
+
*
|
|
20
|
+
* The rule lives in smrt-config (`resolveCliDatabaseConfig`) so `smrt-dev-mcp`
|
|
21
|
+
* resolves the same database (#3446); this module applies it to the CLI.
|
|
22
|
+
*
|
|
23
|
+
* URL and engine travel as a pair: a configured URL never combines with an
|
|
24
|
+
* environment engine. An unrecognised `DATABASE_TYPE` disables the fallback
|
|
25
|
+
* (with a warning that names the variable, never its URL) rather than guess.
|
|
26
|
+
*/
|
|
27
|
+
import type { CliDatabaseSource, CliDatabaseType as ConfigCliDatabaseType } from '@happyvertical/smrt-config';
|
|
28
|
+
/** Database engines the CLI's `packages.cli.database.type` accepts. */
|
|
29
|
+
export type CliDatabaseType = ConfigCliDatabaseType;
|
|
30
|
+
/** Where {@link applyDatabaseEnvironment} found the effective database. */
|
|
31
|
+
export type DatabaseConfigSource = CliDatabaseSource;
|
|
32
|
+
/**
|
|
33
|
+
* Apply `DATABASE_URL`/`DATABASE_TYPE` as the CLI database when no config
|
|
34
|
+
* layer declares `packages.cli.database.url`. Call after `loadConfig()`.
|
|
35
|
+
* The precedence itself is smrt-config's `resolveCliDatabaseConfig()`, which
|
|
36
|
+
* `smrt-dev-mcp` shares (#3446).
|
|
37
|
+
*
|
|
38
|
+
* @param env - Environment to read (defaults to `process.env`).
|
|
39
|
+
* @param warn - Sink for the one-line invalid-type warning.
|
|
40
|
+
* @returns Which source supplies the effective database.
|
|
41
|
+
*/
|
|
42
|
+
export declare function applyDatabaseEnvironment(env?: NodeJS.ProcessEnv, warn?: (message: string) => void): Promise<DatabaseConfigSource>;
|
|
43
|
+
//# sourceMappingURL=database-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-environment.d.ts","sourceRoot":"","sources":["../src/database-environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,IAAI,qBAAqB,EACzC,MAAM,4BAA4B,CAAC;AAEpC,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAErD;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IACgB,GAC1C,OAAO,CAAC,oBAAoB,CAAC,CAa/B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./NostrIdentity-n70E0vck-Di3_eNCq.js";
|
|
2
|
+
import "./ApiKey-BZmbOTnL-BbZupUZ3.js";
|
|
3
|
+
import "./ApiKeyCollection-Bfb_nw81-DYAZwx0O.js";
|
|
4
|
+
import "./AuditLogCollection-B1YonCAP-Bkj2Ezon.js";
|
|
5
|
+
import "./NostrIdentityCollection-Ca74dkaL-DvjOg9Xy.js";
|
|
6
|
+
import "./OidcIdentity-Cb1bxreM-LXmC7uAf.js";
|
|
7
|
+
import "./OidcIdentityCollection-TV8VdK69-Cv1ZTeuk.js";
|
|
8
|
+
import "./ProfileAssetCollection-B9hacUJa-CPuaWLk4.js";
|
|
9
|
+
import { a as ProfileCollection } from "./ProfileCollection-DuJT7Mum-nXbHrPpX.js";
|
|
10
|
+
import "./ProfileLinkCollection-4uNURz32-CbKZYmYm.js";
|
|
11
|
+
import "./ProfileMetadataCollection-DQhbfEfa-_1rQCLTR.js";
|
|
12
|
+
import "./ProfileMetafieldCollection-CoBuM_5G-CPjW3l5r.js";
|
|
13
|
+
import "./ProfileRelationshipCollection-DUVgaIqf-RCDqYz6O.js";
|
|
14
|
+
import "./ProfileRelationshipTermCollection-DtA9OM23-BoGhQBSQ.js";
|
|
15
|
+
import "./ProfileRelationshipType-BRiRka6t-Dezjv5jP.js";
|
|
16
|
+
import "./ProfileRelationshipTypeCollection-BdXwd7Kf-HoTmV1q-.js";
|
|
17
|
+
import "./oidcProvisioningPrimitives-D9OYu5-F-T9KkkDCd.js";
|
|
18
|
+
import "./resolveIdentity-B-PK6RwU-C9ogf8YG.js";
|
|
19
|
+
import "./dist-DLw_E34G.js";
|
|
20
|
+
export { ProfileCollection };
|