@happyvertical/smrt-cli 0.57.34 → 0.57.35
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/cookbook-apply.md +4 -0
- package/dist/{AuditLogCollection-BBbvr8Qc-C9rh5Bnq.js → AuditLogCollection-BBbvr8Qc-CjFr0idO.js} +1 -1
- package/dist/{OidcIdentity-MVVO3MfG-CrJ6TKIo.js → OidcIdentity-MVVO3MfG-B4pDxYl1.js} +2 -2
- package/dist/{OidcIdentityCollection-s4mp3n62-CQmuAddQ.js → OidcIdentityCollection-s4mp3n62-DjEyQuRJ.js} +1 -1
- package/dist/{PasswordCredentialService-DA2Y6H2X-B0tNMDWQ.js → PasswordCredentialService-DA2Y6H2X-DsZpTPKo.js} +14 -14
- package/dist/{ProfileAssetCollection-BuVAdOiv-BXzD6rfR.js → ProfileAssetCollection-BuVAdOiv-BL42KBF2.js} +3 -3
- package/dist/{ProfileCollection-CMS9dFc0-BCWVwq2Z.js → ProfileCollection-CMS9dFc0-Dns5xTee.js} +17 -17
- package/dist/{ProfileLinkCollection-ChK9iEBp-bPqQu6Ik.js → ProfileLinkCollection-ChK9iEBp-BmmP4FbO.js} +2 -2
- package/dist/{ProfileMetadataCollection-CAgJyjze-Bs-f2gpY.js → ProfileMetadataCollection-CAgJyjze-DcZ6nrQw.js} +1 -1
- package/dist/{ProfileMetafieldCollection-19ae6Lpf-CULYYG5_.js → ProfileMetafieldCollection-19ae6Lpf-BRLUdeVY.js} +1 -1
- package/dist/{ProfileRelationshipCollection-BFSlTQ7J-BoaZirbE.js → ProfileRelationshipCollection-BFSlTQ7J-C35cPV5c.js} +1 -1
- package/dist/{ProfileTypeCollection-B7m698Bl-4HCt4RyO.js → ProfileTypeCollection-B7m698Bl-Ce4AaaoE.js} +2 -2
- package/dist/{apply-C7kqOLl6.js → apply-D8dV3HUh.js} +22 -3
- package/dist/commands/cookbook/apply.d.ts +2 -0
- package/dist/commands/cookbook/apply.d.ts.map +1 -1
- package/dist/commands/cookbook/shared.d.ts.map +1 -1
- package/dist/{commands-DCI5b9aZ.js → commands-CwBFXtgx.js} +5 -5
- package/dist/{dist-B5Sc_4gt.js → dist-BdEB0RqQ.js} +4 -4
- package/dist/{dist-ChjdBCfz.js → dist-BxDpuCty.js} +3 -3
- package/dist/{dist-tYOaRDZB.js → dist-CkYHSCr7.js} +2 -2
- package/dist/{dist-DT24mzvY.js → dist-SezcdZuU.js} +5 -5
- package/dist/index.js +11 -11
- package/dist/{oidcProvisioningPrimitives-Dl9qIcYS-CnLvtTJk.js → oidcProvisioningPrimitives-Dl9qIcYS-v8sC3E8L.js} +3 -3
- package/dist/{operator-WT5To5kM.js → operator-DQwfV3MU.js} +2 -2
- package/dist/{resolveIdentity-CR5p_g7K-JYvmLdOe.js → resolveIdentity-CR5p_g7K-ZnOfbtXX.js} +14 -14
- package/dist/{server-CVEdVgJg.js → server-DEBTDsmH.js} +1 -1
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
|
-
import { a as getOwnedAssetsFromCollection, o as removeOwnedAssetFromCollection, t as addOwnedAssetFromCollection } from "./dist-
|
|
4
|
+
import { a as getOwnedAssetsFromCollection, o as removeOwnedAssetFromCollection, t as addOwnedAssetFromCollection } from "./dist-BxDpuCty.js";
|
|
5
5
|
import { SmrtJunction, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
6
6
|
//#region ../profiles/dist/chunks/ProfileAssetCollection-BuVAdOiv.js
|
|
7
7
|
var ProfileAssetCollection_BuVAdOiv_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -84,7 +84,7 @@ var ProfileAssetCollection = class extends SmrtJunction {
|
|
|
84
84
|
profileCollectionPromise = null;
|
|
85
85
|
async getProfileCollection() {
|
|
86
86
|
if (!this.profileCollectionPromise) {
|
|
87
|
-
const { ProfileCollection } = await import("./ProfileCollection-CMS9dFc0-
|
|
87
|
+
const { ProfileCollection } = await import("./ProfileCollection-CMS9dFc0-Dns5xTee.js").then((n) => n.r).then((n) => n.r);
|
|
88
88
|
this.profileCollectionPromise = ProfileCollection.create({ db: this.db });
|
|
89
89
|
}
|
|
90
90
|
return this.profileCollectionPromise;
|
package/dist/{ProfileCollection-CMS9dFc0-BCWVwq2Z.js → ProfileCollection-CMS9dFc0-Dns5xTee.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { d as getTenantId, i as tenantId, m as withSystemContext, n as resolvePrompt, o as queryGlobal, r as TenantScoped, s as queryWithGlobals, t as definePrompt } from "./dist-
|
|
2
|
+
import { d as getTenantId, i as tenantId, m as withSystemContext, n as resolvePrompt, o as queryGlobal, r as TenantScoped, s as queryWithGlobals, t as definePrompt } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
|
-
import { a as getOwnedAssetsFromCollection, i as assertValidOwnedAssetSortOrder, n as assertAssetLinkable, o as removeOwnedAssetFromCollection, r as assertValidOwnedAssetRelationship, s as resolveOwnedAssetsById, t as addOwnedAssetFromCollection } from "./dist-
|
|
4
|
+
import { a as getOwnedAssetsFromCollection, i as assertValidOwnedAssetSortOrder, n as assertAssetLinkable, o as removeOwnedAssetFromCollection, r as assertValidOwnedAssetRelationship, s as resolveOwnedAssetsById, t as addOwnedAssetFromCollection } from "./dist-BxDpuCty.js";
|
|
5
5
|
import { RuntimeError, SmrtCollection, SmrtObject, ValidationError, field, foreignKey, isAbortedTransactionError, oneToMany, smrt } from "@happyvertical/smrt-core";
|
|
6
6
|
import { BackfillTableUnavailableError, BackfillTracker } from "@happyvertical/smrt-core/migrations";
|
|
7
7
|
//#region ../profiles/dist/chunks/ProfileCollection-CMS9dFc0.js
|
|
@@ -435,7 +435,7 @@ var Profile = class extends SmrtObject {
|
|
|
435
435
|
async getTypeSlug() {
|
|
436
436
|
const tenantId2 = this.tenantId || getTenantId();
|
|
437
437
|
if (this.typeId && tenantId2) {
|
|
438
|
-
const { ProfileTypeCollection } = await import("./ProfileTypeCollection-B7m698Bl-
|
|
438
|
+
const { ProfileTypeCollection } = await import("./ProfileTypeCollection-B7m698Bl-Ce4AaaoE.js").then((n) => n.n).then((n) => n.n);
|
|
439
439
|
return (await (await ProfileTypeCollection.create(this.options)).getAvailableById(this.typeId, tenantId2))?.slug ?? "";
|
|
440
440
|
}
|
|
441
441
|
return (await this.loadRelated("typeId"))?.slug || "";
|
|
@@ -458,8 +458,8 @@ var Profile = class extends SmrtObject {
|
|
|
458
458
|
* @param value - The value to set
|
|
459
459
|
*/
|
|
460
460
|
async addMetadata(metafieldSlug, value) {
|
|
461
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-19ae6Lpf-
|
|
462
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-CAgJyjze-
|
|
461
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-19ae6Lpf-BRLUdeVY.js").then((n) => n.t).then((n) => n.n);
|
|
462
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-CAgJyjze-DcZ6nrQw.js").then((n) => n.t).then((n) => n.n);
|
|
463
463
|
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
464
464
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
465
465
|
await metafield.validateValue(value);
|
|
@@ -492,7 +492,7 @@ var Profile = class extends SmrtObject {
|
|
|
492
492
|
* @returns Object with metafield slugs as keys
|
|
493
493
|
*/
|
|
494
494
|
async getMetadata() {
|
|
495
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-CAgJyjze-
|
|
495
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-CAgJyjze-DcZ6nrQw.js").then((n) => n.t).then((n) => n.n);
|
|
496
496
|
return await (await ProfileMetadataCollection.create(this.options)).getMetadataObject(this.id);
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
@@ -509,8 +509,8 @@ var Profile = class extends SmrtObject {
|
|
|
509
509
|
* @param metafieldSlug - The slug of the metafield to remove
|
|
510
510
|
*/
|
|
511
511
|
async removeMetadata(metafieldSlug) {
|
|
512
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-19ae6Lpf-
|
|
513
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-CAgJyjze-
|
|
512
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-19ae6Lpf-BRLUdeVY.js").then((n) => n.t).then((n) => n.n);
|
|
513
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-CAgJyjze-DcZ6nrQw.js").then((n) => n.t).then((n) => n.n);
|
|
514
514
|
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
515
515
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
516
516
|
const existing = await (await ProfileMetadataCollection.create(this.options)).list({
|
|
@@ -535,7 +535,7 @@ var Profile = class extends SmrtObject {
|
|
|
535
535
|
return candidates.find((candidate) => ownerTenantId && candidate.tenantId === ownerTenantId) ?? candidates.find((candidate) => !candidate.tenantId) ?? null;
|
|
536
536
|
}
|
|
537
537
|
async getProfileLinkCollection() {
|
|
538
|
-
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-ChK9iEBp-
|
|
538
|
+
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-ChK9iEBp-BmmP4FbO.js").then((n) => n.t).then((n) => n.r);
|
|
539
539
|
return ProfileLinkCollection.create({ db: this.db });
|
|
540
540
|
}
|
|
541
541
|
/** This profile's web links in display order. */
|
|
@@ -552,7 +552,7 @@ var Profile = class extends SmrtObject {
|
|
|
552
552
|
return (await this.getProfileLinkCollection()).replaceForProfile(this.id, links);
|
|
553
553
|
}
|
|
554
554
|
async getProfileAssetCollection() {
|
|
555
|
-
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-BuVAdOiv-
|
|
555
|
+
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-BuVAdOiv-BL42KBF2.js").then((n) => n.t).then((n) => n.n);
|
|
556
556
|
return ProfileAssetCollection.create({ db: this.db });
|
|
557
557
|
}
|
|
558
558
|
async getAssets(relationship) {
|
|
@@ -584,7 +584,7 @@ var Profile = class extends SmrtObject {
|
|
|
584
584
|
*/
|
|
585
585
|
async addRelationship(toProfile, relationshipSlug, contextProfile) {
|
|
586
586
|
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BRBpX00F-D78l9V1y.js").then((n) => n.t).then((n) => n.n);
|
|
587
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-BFSlTQ7J-
|
|
587
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-BFSlTQ7J-C35cPV5c.js").then((n) => n.t).then((n) => n.n);
|
|
588
588
|
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-Cevy-vaF-G82Gg40q.js").then((n) => n.n).then((n) => n.n);
|
|
589
589
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
590
590
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
@@ -609,7 +609,7 @@ var Profile = class extends SmrtObject {
|
|
|
609
609
|
* @returns Array of ProfileRelationship instances
|
|
610
610
|
*/
|
|
611
611
|
async getRelationships(options) {
|
|
612
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-BFSlTQ7J-
|
|
612
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-BFSlTQ7J-C35cPV5c.js").then((n) => n.t).then((n) => n.n);
|
|
613
613
|
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BRBpX00F-D78l9V1y.js").then((n) => n.t).then((n) => n.n);
|
|
614
614
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
615
615
|
const direction = options?.direction || "all";
|
|
@@ -654,7 +654,7 @@ var Profile = class extends SmrtObject {
|
|
|
654
654
|
*/
|
|
655
655
|
async removeRelationship(toProfile, relationshipSlug) {
|
|
656
656
|
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BRBpX00F-D78l9V1y.js").then((n) => n.t).then((n) => n.n);
|
|
657
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-BFSlTQ7J-
|
|
657
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-BFSlTQ7J-C35cPV5c.js").then((n) => n.t).then((n) => n.n);
|
|
658
658
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
659
659
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
660
660
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -778,7 +778,7 @@ var Profile = class extends SmrtObject {
|
|
|
778
778
|
* @returns Array of OIDC identity records
|
|
779
779
|
*/
|
|
780
780
|
async getOidcIdentities() {
|
|
781
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-s4mp3n62-
|
|
781
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-s4mp3n62-DjEyQuRJ.js").then((n) => n.r).then((n) => n.r);
|
|
782
782
|
return await (await OidcIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
783
783
|
}
|
|
784
784
|
/**
|
|
@@ -791,7 +791,7 @@ var Profile = class extends SmrtObject {
|
|
|
791
791
|
* type, but refuses to create or rebind authority.
|
|
792
792
|
*/
|
|
793
793
|
async linkOidcIdentity(oidcData) {
|
|
794
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-s4mp3n62-
|
|
794
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-s4mp3n62-DjEyQuRJ.js").then((n) => n.r).then((n) => n.r);
|
|
795
795
|
return await (await OidcIdentityCollection.create(this.options)).linkToProfile(this, oidcData);
|
|
796
796
|
}
|
|
797
797
|
/**
|
|
@@ -820,7 +820,7 @@ var Profile = class extends SmrtObject {
|
|
|
820
820
|
* @returns Array of audit log entries
|
|
821
821
|
*/
|
|
822
822
|
async getAuditLogs(limit = 50) {
|
|
823
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-BBbvr8Qc-
|
|
823
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-BBbvr8Qc-CjFr0idO.js").then((n) => n.t).then((n) => n.n);
|
|
824
824
|
return await (await AuditLogCollection.create(this.options)).getRecentActivity(this.id, limit);
|
|
825
825
|
}
|
|
826
826
|
/**
|
|
@@ -830,7 +830,7 @@ var Profile = class extends SmrtObject {
|
|
|
830
830
|
* @returns The created audit log entry
|
|
831
831
|
*/
|
|
832
832
|
async recordAction(options) {
|
|
833
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-BBbvr8Qc-
|
|
833
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-BBbvr8Qc-CjFr0idO.js").then((n) => n.t).then((n) => n.n);
|
|
834
834
|
return await (await AuditLogCollection.create(this.options)).record({
|
|
835
835
|
profile: this,
|
|
836
836
|
...options
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, foreignKey, isEmbeddedDatabase, smrt, withEmbeddedWriteTransaction } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileLinkCollection-ChK9iEBp.js
|
|
@@ -203,7 +203,7 @@ var ProfileLinkCollection = class ProfileLinkCollection extends SmrtCollection {
|
|
|
203
203
|
/** The profile's tenant; throws when the profile is not visible here. */
|
|
204
204
|
async requireProfileTenant(profileId) {
|
|
205
205
|
if (!profileId) throw new Error("A profile link needs a profile");
|
|
206
|
-
const { ProfileCollection } = await import("./ProfileCollection-CMS9dFc0-
|
|
206
|
+
const { ProfileCollection } = await import("./ProfileCollection-CMS9dFc0-Dns5xTee.js").then((n) => n.r).then((n) => n.r);
|
|
207
207
|
const profile = await (await ProfileCollection.create({ db: this.db })).get({ id: profileId });
|
|
208
208
|
if (!profile) throw new Error(`Profile '${profileId}' not found`);
|
|
209
209
|
return profile.tenantId ?? null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileMetadataCollection-CAgJyjze.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileMetafieldCollection-19ae6Lpf.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, foreignKey, oneToMany, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileRelationshipCollection-BFSlTQ7J.js
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { l as withTenantGlobalRead, p as isSystemContext } from "./dist-
|
|
2
|
+
import { l as withTenantGlobalRead, p as isSystemContext } from "./dist-CkYHSCr7.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-RJaATTCt-BbRHWyee.js";
|
|
4
|
-
import { i as ProfileType } from "./ProfileCollection-CMS9dFc0-
|
|
4
|
+
import { i as ProfileType } from "./ProfileCollection-CMS9dFc0-Dns5xTee.js";
|
|
5
5
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
6
6
|
//#region ../profiles/dist/chunks/ProfileTypeCollection-B7m698Bl.js
|
|
7
7
|
var ProfileTypeCollection_B7m698Bl_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
2
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
5
5
|
import { homedir, tmpdir } from "node:os";
|
|
@@ -37,6 +37,19 @@ var LOCKFILES = [
|
|
|
37
37
|
"bun.lock",
|
|
38
38
|
"bun.lockb"
|
|
39
39
|
];
|
|
40
|
+
/**
|
|
41
|
+
* The template repository's own metadata, at its root (#4239). It names the
|
|
42
|
+
* template's tracker, forge, memory bank and CI, so a coding agent in the new
|
|
43
|
+
* project would file and claim work against the template repository.
|
|
44
|
+
*/
|
|
45
|
+
var TEMPLATE_REPOSITORY_FILES = [
|
|
46
|
+
".agents",
|
|
47
|
+
".github",
|
|
48
|
+
"AGENTS.md",
|
|
49
|
+
"CLAUDE.md",
|
|
50
|
+
"renovate.json"
|
|
51
|
+
];
|
|
52
|
+
var isTemplateRepositoryFile = (path) => TEMPLATE_REPOSITORY_FILES.includes(path.split("/")[0]);
|
|
40
53
|
var ApplyError = class extends Error {};
|
|
41
54
|
function detectIndent(text) {
|
|
42
55
|
return /^( +|\t)"/m.exec(text)?.[1] ?? 2;
|
|
@@ -291,12 +304,12 @@ function copyTemplate(template, targetDir) {
|
|
|
291
304
|
if (!template.files) {
|
|
292
305
|
cpSync(template.root, targetDir, {
|
|
293
306
|
recursive: true,
|
|
294
|
-
filter: (src) => !skip(basename(src)) && refuseLink(src)
|
|
307
|
+
filter: (src) => !skip(basename(src)) && !isTemplateRepositoryFile(relative(template.root, src).split(sep).join("/")) && refuseLink(src)
|
|
295
308
|
});
|
|
296
309
|
return;
|
|
297
310
|
}
|
|
298
311
|
for (const file of template.files) {
|
|
299
|
-
if (file.split("/").some(skip)) continue;
|
|
312
|
+
if (file.split("/").some(skip) || isTemplateRepositoryFile(file)) continue;
|
|
300
313
|
const from = join(template.root, file);
|
|
301
314
|
refuseLink(from);
|
|
302
315
|
const to = join(targetDir, file);
|
|
@@ -338,6 +351,10 @@ function applyCookbook(options) {
|
|
|
338
351
|
if (mode === "new" && !smrtVersion) warnings.push(`this CLI's version (${options.cliVersion}) is not a published release, so the project keeps the template's @happyvertical/smrt-* ranges; pin them to a released smrt version before relying on the app`);
|
|
339
352
|
let repinnedDependencies = {};
|
|
340
353
|
if (smrtVersion) ({json: baseJson, changes: repinnedDependencies} = pinSmrtDependencies(baseJson, smrtVersion));
|
|
354
|
+
const skippedTemplateFiles = mode === "new" ? TEMPLATE_REPOSITORY_FILES.filter((name) => {
|
|
355
|
+
const { root, files } = template;
|
|
356
|
+
return files ? files.some((file) => file.split("/")[0] === name) : existsSync(join(root, name));
|
|
357
|
+
}) : [];
|
|
341
358
|
const copied = (file) => {
|
|
342
359
|
const { root, files } = template;
|
|
343
360
|
return files ? files.includes(file) : existsSync(join(root, file));
|
|
@@ -368,6 +385,7 @@ function applyCookbook(options) {
|
|
|
368
385
|
smrtVersion,
|
|
369
386
|
repinnedDependencies,
|
|
370
387
|
removedLockfiles,
|
|
388
|
+
skippedTemplateFiles,
|
|
371
389
|
config
|
|
372
390
|
};
|
|
373
391
|
const nextJson = { ...baseJson };
|
|
@@ -964,6 +982,7 @@ function printApplyResult(result, warnings, log = console.log, warn = console.wa
|
|
|
964
982
|
if (plan.smrtVersion) log(` smrt packages pinned to ${plan.smrtVersion} (this CLI's release)`);
|
|
965
983
|
for (const [name, { from, to }] of Object.entries(plan.repinnedDependencies)) log(` ~ ${name}@${to} (template had ${from})`);
|
|
966
984
|
for (const file of plan.removedLockfiles) log(` - ${file} (resolved the template's pins; the install re-resolves)`);
|
|
985
|
+
for (const file of plan.skippedTemplateFiles) log(` - ${file} (the template repository's own metadata, not copied)`);
|
|
967
986
|
for (const [name, range] of Object.entries(plan.addDependencies)) log(` + ${name}@${range}`);
|
|
968
987
|
for (const [name, range] of Object.entries(plan.keptDependencies)) log(` = ${name}@${range} (already declared)`);
|
|
969
988
|
log(` smrt.cookbook.json: ${plan.config}`);
|
|
@@ -60,6 +60,8 @@ export interface ApplyPlan {
|
|
|
60
60
|
}>;
|
|
61
61
|
/** Template lockfiles dropped because they resolve the replaced pins. */
|
|
62
62
|
removedLockfiles: string[];
|
|
63
|
+
/** Template repository metadata not copied into the new project (#4239). */
|
|
64
|
+
skippedTemplateFiles: string[];
|
|
63
65
|
config: 'create' | 'update' | 'unchanged';
|
|
64
66
|
}
|
|
65
67
|
export interface ApplyResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/apply.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,gBAAgB,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/apply.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,gBAAgB,oCAAoC,CAAC;AA8ClE,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACrC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG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B,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,MAAM,EACX,EAAE,GAAE,MAA4B,GAC/B,MAAM,EAAE,CAeV;AAuCD,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAuNhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,wBAAgB,UAAU,IAAI,MAAM,CAiBnC;AAKD,wDAAwD;AACxD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBxE;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,KAAG,MAAM,EACD,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iFAAiF;AACjF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAWzB;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkB,EACzC,IAAI,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAmB,GAC1C,IAAI,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/cookbook/shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,wBAAgB,UAAU,IAAI,MAAM,CAiBnC;AAKD,wDAAwD;AACxD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBxE;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,KAAG,MAAM,EACD,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iFAAiF;AACjF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAWzB;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkB,EACzC,IAAI,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAmB,GAC1C,IAAI,CAqCN"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as resolveManifestEntryPackageName } from "./index.js";
|
|
2
2
|
import { a as redactDatabaseUrlsInText, i as quoteIdentifier, r as formatDatabaseDisplayUrl, t as closeDatabaseConnection } from "./db-command-utils-Cn8tjy7N.js";
|
|
3
|
-
import { a as readCookbookSource, d as downloadPackage, f as extractTarball, g as applyCookbook, h as COOKBOOK_CONFIG_FILE, i as printApplyResult, m as ApplyError, n as asList, o as validateCookbookSource, p as lookupPackage, r as cliVersion, t as createCookbookApplier } from "./apply-
|
|
3
|
+
import { a as readCookbookSource, d as downloadPackage, f as extractTarball, g as applyCookbook, h as COOKBOOK_CONFIG_FILE, i as printApplyResult, m as ApplyError, n as asList, o as validateCookbookSource, p as lookupPackage, r as cliVersion, t as createCookbookApplier } from "./apply-D8dV3HUh.js";
|
|
4
4
|
import { t as DEFAULT_CLI_CONFIG } from "./config-CdJRSMRi.js";
|
|
5
5
|
import { addMcpAppsRuntime, assertMcpAppsPluginName, configureMcpAppsConsumerRegistry, mcpAppsCommands, scaffoldMcpAppsPackage, validateMcpAppsPackage } from "./mcp-apps-packaging-CixRnxz_.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -7723,7 +7723,7 @@ var kitchenCommands = {
|
|
|
7723
7723
|
}
|
|
7724
7724
|
},
|
|
7725
7725
|
handler: async (_args, options) => {
|
|
7726
|
-
const { runKitchenMcp } = await import("./server-
|
|
7726
|
+
const { runKitchenMcp } = await import("./server-DEBTDsmH.js");
|
|
7727
7727
|
await runKitchenMcp({
|
|
7728
7728
|
uiSmoke: options["ui-smoke"],
|
|
7729
7729
|
plannerUi: options["planner-ui"],
|
|
@@ -8413,7 +8413,7 @@ var dbMaterializeTenantHierarchyCommand = {
|
|
|
8413
8413
|
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).");
|
|
8414
8414
|
const dbType = config.database.type || "sqlite";
|
|
8415
8415
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
8416
|
-
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-
|
|
8416
|
+
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-BdEB0RqQ.js");
|
|
8417
8417
|
db = await getDatabase({
|
|
8418
8418
|
type: dbType,
|
|
8419
8419
|
url: config.database.url
|
|
@@ -8622,7 +8622,7 @@ var dbMigrateLedgerAccountsCommand = {
|
|
|
8622
8622
|
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.");
|
|
8623
8623
|
await autoDiscoverAndLoad();
|
|
8624
8624
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
8625
|
-
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-
|
|
8625
|
+
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-SezcdZuU.js");
|
|
8626
8626
|
db = await getDatabase({
|
|
8627
8627
|
type: dbType,
|
|
8628
8628
|
url: config.database.url
|
|
@@ -10797,7 +10797,7 @@ var usersProvisionOwnerCommand = {
|
|
|
10797
10797
|
const config = getPackageConfig("cli", DEFAULT_CLI_CONFIG);
|
|
10798
10798
|
if (config.database?.type !== "postgres" || !config.database.url) throw new Error(FAILURE);
|
|
10799
10799
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
10800
|
-
const { provisionPasswordOwner } = await import("./operator-
|
|
10800
|
+
const { provisionPasswordOwner } = await import("./operator-DQwfV3MU.js");
|
|
10801
10801
|
db = await getDatabase({
|
|
10802
10802
|
type: "postgres",
|
|
10803
10803
|
url: config.database.url
|