@githolon/dsl 0.103.4 → 0.103.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/dart/CHANGELOG.md +8 -0
- package/dart/lib/src/runner/node-entry.mjs +333 -117
- package/dart/lib/src/runner/offline-install.mjs +173 -67
- package/dart/lib/src/session_bound.dart +111 -2
- package/dart/lib/src/test_harness.dart +51 -41
- package/dart/lib/src/webview_bridge.dart +714 -60
- package/dart/pubspec.lock +1 -1
- package/dart/pubspec.yaml +2 -2
- package/dart/test/acquire_session_test.dart +62 -5
- package/dart/test/cloud_bound_topology_test.dart +59 -38
- package/dart/test/session_bound_test.dart +25 -10
- package/dart/test/webview_bridge_test.dart +326 -7
- package/dart_types/CHANGELOG.md +5 -0
- package/dart_types/lib/nomos_types.dart +1 -0
- package/dart_types/lib/src/git_object_id.dart +37 -0
- package/dart_types/pubspec.yaml +1 -1
- package/package.json +1 -1
- package/runtime/generated-application-host.js +347 -113
- package/src/births.ts +16 -1
- package/src/business_birth.ts +55 -34
- package/src/codegen_dart.ts +68 -12
- package/src/codegen_dart_application.ts +114 -19
- package/src/codegen_dart_client.ts +149 -6
- package/src/codegen_proof.ts +16 -9
- package/src/codegen_provider_dart.ts +5 -0
- package/src/codegen_ts.ts +115 -19
- package/src/compile_package_main.ts +142 -40
- package/src/fields.ts +43 -0
- package/src/framework/domain_lifecycle.ts +108 -88
- package/src/framework/genesis.ts +2 -1
- package/src/framework/home.ts +6 -43
- package/src/framework/workspaces.ts +42 -25
- package/src/idof_lint.ts +65 -51
- package/src/index.ts +21 -1
- package/src/intent.ts +11 -1
- package/src/law_graph.ts +81 -11
- package/src/relation_schema.ts +18 -0
- package/src/shape_compat.ts +3 -0
- package/src/stable_ids_for_module.ts +7 -1
- package/src/value_object.ts +40 -0
package/src/codegen_ts.ts
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
OWNED_PREMINTED_RECORDS_PAYLOAD_FIELD,
|
|
44
44
|
type AggregateHandle,
|
|
45
45
|
} from "./aggregate.js";
|
|
46
|
-
import { isSha256DigestSchema, type Field, type ValueObjectDescriptor, type ValueObjectFieldDescriptor } from "./fields.js";
|
|
46
|
+
import { isGitObjectIdSchema, isSha256DigestSchema, type Field, type ValueObjectDescriptor, type ValueObjectFieldDescriptor } from "./fields.js";
|
|
47
47
|
import type { Directive } from "./directive.js";
|
|
48
48
|
import type { DomainModule } from "./codegen_dart.js";
|
|
49
49
|
import { OWNED_DEVICE_APPROVAL_DIRECTIVE, ownedRecordActionDirectiveId } from "./framework/owned_custody.js";
|
|
@@ -51,7 +51,7 @@ import { BUSINESS_CORRECTION_DIRECTIVE } from "./framework/business_corrections.
|
|
|
51
51
|
import { collectActivityDescriptors, type PackageActivityEntry } from "./codegen_dart.js";
|
|
52
52
|
import type { NomosCompat } from "./compat_manifest.js";
|
|
53
53
|
import type { QueryDecl } from "./query.js";
|
|
54
|
-
import { voMetaOf, collectPayloadValueObjectDescriptors, idOfMetaOf, idOfTargetKindOf, versionedRefOfMetaOf } from "./value_object.js";
|
|
54
|
+
import { voMetaOf, collectPayloadValueObjectDescriptors, idOfMetaOf, idOfTargetKindOf, refOfMetaOf, versionedRefOfMetaOf } from "./value_object.js";
|
|
55
55
|
import { recursiveTypeBaseName, zodUnwrapLazy } from "./zod_lazy.js";
|
|
56
56
|
import { finishCount } from "./count.js";
|
|
57
57
|
import { finishSum } from "./sum.js";
|
|
@@ -309,6 +309,14 @@ function tsTypeOfZod(
|
|
|
309
309
|
path = "",
|
|
310
310
|
): string {
|
|
311
311
|
if (isSha256DigestSchema(zt)) return "Sha256Digest";
|
|
312
|
+
if (isGitObjectIdSchema(zt)) return "GitObjectId";
|
|
313
|
+
const addressed = refOfMetaOf(zt);
|
|
314
|
+
if (addressed !== undefined) {
|
|
315
|
+
const target = addressed.targetKind === "contract"
|
|
316
|
+
? contractTypeName(addressed.aggregateType)
|
|
317
|
+
: addressed.aggregateType;
|
|
318
|
+
return `NomosRef<${target}>`;
|
|
319
|
+
}
|
|
312
320
|
const versioned = versionedRefOfMetaOf(zt);
|
|
313
321
|
if (versioned !== undefined) {
|
|
314
322
|
const target = versioned.targetKind === "contract"
|
|
@@ -544,7 +552,11 @@ function tsTypeOfField(field: Field): string {
|
|
|
544
552
|
function tsBaseTypeOfField(field: Field): string {
|
|
545
553
|
switch (field.kind) {
|
|
546
554
|
case "string":
|
|
547
|
-
return isSha256DigestSchema(field.zod as z.ZodTypeAny)
|
|
555
|
+
return isSha256DigestSchema(field.zod as z.ZodTypeAny)
|
|
556
|
+
? "Sha256Digest"
|
|
557
|
+
: isGitObjectIdSchema(field.zod as z.ZodTypeAny)
|
|
558
|
+
? "GitObjectId"
|
|
559
|
+
: "string";
|
|
548
560
|
case "int":
|
|
549
561
|
return "number";
|
|
550
562
|
// STRUCTURAL CRDT scalars (read-collapsed): a counter reads as its net number, a position as its
|
|
@@ -801,11 +813,11 @@ function emitTsActivityBlock(entries: readonly PackageActivityEntry[], describeM
|
|
|
801
813
|
`type NomosModelAdoption =`,
|
|
802
814
|
` | { status: "adopted"; summary: string; review: NomosModelReview }`,
|
|
803
815
|
` | { status: "needs-decision"; summary: string; review: NomosModelReview; accept(because: string): Promise<NomosModelAdoption> }`,
|
|
804
|
-
` | { status: "blocked"; summary: string; review: NomosModelReview };`,
|
|
816
|
+
` | { status: "blocked"; summary: string; error: string; review: NomosModelReview };`,
|
|
805
817
|
`type NomosModelRestoration =`,
|
|
806
818
|
` | { status: "restored"; summary: string; review: NomosModelReview }`,
|
|
807
819
|
` | { status: "needs-decision"; summary: string; review: NomosModelReview; accept(because: string): Promise<NomosModelRestoration> }`,
|
|
808
|
-
` | { status: "blocked"; summary: string; review: NomosModelReview };`,
|
|
820
|
+
` | { status: "blocked"; summary: string; error: string; review: NomosModelReview };`,
|
|
809
821
|
`interface __NomosModelReportWire {`,
|
|
810
822
|
` sourceVerified: boolean; complete: boolean; promotable: boolean;`,
|
|
811
823
|
` replayedIntents: number; candidateIntents: number; evolve: { ok: boolean };`,
|
|
@@ -813,7 +825,7 @@ function emitTsActivityBlock(entries: readonly PackageActivityEntry[], describeM
|
|
|
813
825
|
` divergences: { kind: string; domain?: string; directiveId?: string; admitted?: boolean }[];`,
|
|
814
826
|
`}`,
|
|
815
827
|
`interface __NomosModelAdoptionWire {`,
|
|
816
|
-
` ok: boolean; stage: "promoted" | "identity" | "preflight" | "acceptance" | "admission";`,
|
|
828
|
+
` ok: boolean; stage: "promoted" | "identity" | "staging-required" | "preflight" | "acceptance" | "admission";`,
|
|
817
829
|
` report?: __NomosModelReportWire; error?: string;`,
|
|
818
830
|
`}`,
|
|
819
831
|
`interface __NomosModelRestorationWire {`,
|
|
@@ -852,7 +864,8 @@ function emitTsActivityBlock(entries: readonly PackageActivityEntry[], describeM
|
|
|
852
864
|
` holon: NomosHolon, domain: string, candidateHash: string, because?: string,`,
|
|
853
865
|
`): Promise<NomosModelAdoption> {`,
|
|
854
866
|
` if (!holon.__nomosAdoptModel) {`,
|
|
855
|
-
`
|
|
867
|
+
` const error = "This device needs the current Nomos client before it can adopt a model.";`,
|
|
868
|
+
` return { status: "blocked", summary: error, error, review: _nomosModelReview() };`,
|
|
856
869
|
` }`,
|
|
857
870
|
` const raw = await holon.__nomosAdoptModel(domain, candidateHash, because === undefined ? {} : { because });`,
|
|
858
871
|
` const review = _nomosModelReview(raw.report);`,
|
|
@@ -880,13 +893,14 @@ function emitTsActivityBlock(entries: readonly PackageActivityEntry[], describeM
|
|
|
880
893
|
` : raw.report !== undefined && !raw.report.evolve.ok`,
|
|
881
894
|
` ? "This model cannot yet interpret every existing value. Nothing changed and the current model remains active."`,
|
|
882
895
|
` : "The workspace changed or refused this adoption. Nothing changed; ask Nomos to try again.";`,
|
|
883
|
-
` return { status: "blocked", summary, review };`,
|
|
896
|
+
` return { status: "blocked", summary, error: raw.error ?? summary, review };`,
|
|
884
897
|
`}`,
|
|
885
898
|
`async function _nomosRestorePreviousModel(`,
|
|
886
899
|
` holon: NomosHolon, domain: string, currentHash: string, because?: string,`,
|
|
887
900
|
`): Promise<NomosModelRestoration> {`,
|
|
888
901
|
` if (!holon.__nomosRestorePreviousModel) {`,
|
|
889
|
-
`
|
|
902
|
+
` const error = "This device needs the current Nomos client before it can restore a model.";`,
|
|
903
|
+
` return { status: "blocked", summary: error, error, review: _nomosModelReview() };`,
|
|
890
904
|
` }`,
|
|
891
905
|
` const raw = await holon.__nomosRestorePreviousModel(domain, currentHash, because === undefined ? {} : { because });`,
|
|
892
906
|
` const review = _nomosModelReview(raw.report);`,
|
|
@@ -918,7 +932,7 @@ function emitTsActivityBlock(entries: readonly PackageActivityEntry[], describeM
|
|
|
918
932
|
` : raw.report !== undefined && !raw.report.evolve.ok`,
|
|
919
933
|
` ? "The previous model cannot safely interpret every existing value. Nothing changed and the current model remains active."`,
|
|
920
934
|
` : "The workspace refused restoration. Nothing changed and the current model remains active.";`,
|
|
921
|
-
` return { status: "blocked", summary, review };`,
|
|
935
|
+
` return { status: "blocked", summary, error: raw.error ?? summary, review };`,
|
|
922
936
|
`}`,
|
|
923
937
|
``,
|
|
924
938
|
`// ── activity feed (architecture/activity_descriptors.md) — typed rows folded from the intent log ──`,
|
|
@@ -1086,6 +1100,35 @@ function zodUsesSha256Digest(schema: z.ZodTypeAny, seen = new Set<z.ZodTypeAny>(
|
|
|
1086
1100
|
}
|
|
1087
1101
|
}
|
|
1088
1102
|
|
|
1103
|
+
/** Whether a schema contains the framework Git object-id semantic string. */
|
|
1104
|
+
function zodUsesGitObjectId(schema: z.ZodTypeAny, seen = new Set<z.ZodTypeAny>()): boolean {
|
|
1105
|
+
if (seen.has(schema)) return false;
|
|
1106
|
+
seen.add(schema);
|
|
1107
|
+
if (isGitObjectIdSchema(schema)) return true;
|
|
1108
|
+
switch (zodKind(schema)) {
|
|
1109
|
+
case "optional":
|
|
1110
|
+
case "default":
|
|
1111
|
+
case "nullable": {
|
|
1112
|
+
const inner = zodDef(schema).innerType;
|
|
1113
|
+
return inner !== undefined && zodUsesGitObjectId(inner, seen);
|
|
1114
|
+
}
|
|
1115
|
+
case "array":
|
|
1116
|
+
return zodUsesGitObjectId(zodArrayElement(schema), seen);
|
|
1117
|
+
case "object":
|
|
1118
|
+
return Object.values(zodObjectShape(schema)).some((field) => zodUsesGitObjectId(field, seen));
|
|
1119
|
+
case "record": {
|
|
1120
|
+
const value = zodDef(schema).valueType;
|
|
1121
|
+
return value !== undefined && zodUsesGitObjectId(value, seen);
|
|
1122
|
+
}
|
|
1123
|
+
case "union":
|
|
1124
|
+
return (zodDef(schema).options ?? []).some((option) => zodUsesGitObjectId(option, seen));
|
|
1125
|
+
case "lazy":
|
|
1126
|
+
return zodUsesGitObjectId(zodUnwrapLazy(schema), seen);
|
|
1127
|
+
default:
|
|
1128
|
+
return false;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1089
1132
|
export function generateTsClient(modules: readonly DomainModule[], opts: TsClientOptions): string {
|
|
1090
1133
|
const topologyModules = modules;
|
|
1091
1134
|
// A public business birth can target a deliberately hidden root aggregate. Its private binder still
|
|
@@ -1219,6 +1262,17 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
1219
1262
|
return schema !== undefined && zodUsesSha256Digest(schema);
|
|
1220
1263
|
}),
|
|
1221
1264
|
);
|
|
1265
|
+
const hasGitObjectIds = modules.some((module) =>
|
|
1266
|
+
module.aggregates.some((aggregate) =>
|
|
1267
|
+
Object.values(aggregate.fields as Record<string, Field>).some((field) =>
|
|
1268
|
+
isGitObjectIdSchema(field.zod as z.ZodTypeAny),
|
|
1269
|
+
),
|
|
1270
|
+
) || (module.directives as Directive<unknown>[]).some((directive) => {
|
|
1271
|
+
const birth = (directive as { businessBirth?: { publicPayloadSchema?: z.ZodTypeAny } }).businessBirth;
|
|
1272
|
+
const schema = birth?.publicPayloadSchema ?? (directive as { payloadSchema?: z.ZodTypeAny }).payloadSchema;
|
|
1273
|
+
return schema !== undefined && zodUsesGitObjectId(schema);
|
|
1274
|
+
}),
|
|
1275
|
+
);
|
|
1222
1276
|
const hasConflictResolvers = modules.some(
|
|
1223
1277
|
(m) => ((m as { surfacedResolvers?: readonly unknown[] }).surfacedResolvers?.length ?? 0) > 0,
|
|
1224
1278
|
);
|
|
@@ -1279,6 +1333,20 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
1279
1333
|
``,
|
|
1280
1334
|
]
|
|
1281
1335
|
: []),
|
|
1336
|
+
...(hasGitObjectIds
|
|
1337
|
+
? [
|
|
1338
|
+
`/** A Git object address in the canonical gix custody spelling. */`,
|
|
1339
|
+
`export type GitObjectId = string & { readonly __nomosGitObjectId: unique symbol };`,
|
|
1340
|
+
`/** Validate and construct a GitObjectId before an offer is assembled. */`,
|
|
1341
|
+
`export const gitObjectId = (value: string): GitObjectId => {`,
|
|
1342
|
+
` if (!/^[0-9a-f]{40}$/.test(value)) {`,
|
|
1343
|
+
` throw new TypeError("expected a 40-character lowercase hexadecimal Git object id");`,
|
|
1344
|
+
` }`,
|
|
1345
|
+
` return value as GitObjectId;`,
|
|
1346
|
+
`};`,
|
|
1347
|
+
``,
|
|
1348
|
+
]
|
|
1349
|
+
: []),
|
|
1282
1350
|
`interface _NomosApplicationStatus {`,
|
|
1283
1351
|
` readonly phase: "opening" | "current" | "saving" | "receiving" | "catching-up" | "offline" | "attention";`,
|
|
1284
1352
|
` readonly localChanges: number;`,
|
|
@@ -1294,6 +1362,12 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
1294
1362
|
` currentStatus(): Promise<_NomosApplicationStatus>;`,
|
|
1295
1363
|
` watchStatus(listener: (status: _NomosApplicationStatus) => void): () => void;`,
|
|
1296
1364
|
`}`,
|
|
1365
|
+
`interface _NomosApplicationModelLifecycle {`,
|
|
1366
|
+
` readonly model: {`,
|
|
1367
|
+
` adopt(): Promise<NomosModelAdoption>;`,
|
|
1368
|
+
` restorePrevious(): Promise<NomosModelRestoration>;`,
|
|
1369
|
+
` };`,
|
|
1370
|
+
`}`,
|
|
1297
1371
|
...(hasInvitations
|
|
1298
1372
|
? [
|
|
1299
1373
|
`interface _NomosApplicationInvitations {`,
|
|
@@ -2290,6 +2364,17 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
2290
2364
|
` }`,
|
|
2291
2365
|
` return out as T;`,
|
|
2292
2366
|
`};`,
|
|
2367
|
+
`const _nmsWireAddressReferences = <T extends object>(payload: T, fields: Readonly<Record<string, string>>): T => {`,
|
|
2368
|
+
` const out = { ...payload } as Record<string, unknown>;`,
|
|
2369
|
+
` for (const [field, expectedType] of Object.entries(fields)) {`,
|
|
2370
|
+
` const value = out[field];`,
|
|
2371
|
+
` if (value === undefined) continue;`,
|
|
2372
|
+
` _nmsReferenceId(value, expectedType, "", field);`,
|
|
2373
|
+
` const ref = value as { workspace: string; type: string; id: string };`,
|
|
2374
|
+
` out[field] = { workspace: ref.workspace, type: ref.type, id: ref.id };`,
|
|
2375
|
+
` }`,
|
|
2376
|
+
` return out as T;`,
|
|
2377
|
+
`};`,
|
|
2293
2378
|
``,
|
|
2294
2379
|
);
|
|
2295
2380
|
}
|
|
@@ -2922,6 +3007,13 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
2922
3007
|
]),
|
|
2923
3008
|
)
|
|
2924
3009
|
: {};
|
|
3010
|
+
const addressReferencePayloadTypes = zodKind(schema) === "object"
|
|
3011
|
+
? Object.fromEntries(
|
|
3012
|
+
Object.entries(zodObjectShape(schema))
|
|
3013
|
+
.filter(([name, field]) => name !== mint?.field && refOfMetaOf(field) !== undefined)
|
|
3014
|
+
.map(([name, field]) => [name, refOfMetaOf(field)!.aggregateType]),
|
|
3015
|
+
)
|
|
3016
|
+
: {};
|
|
2925
3017
|
const recipientPayloadFields = zodKind(schema) === "object"
|
|
2926
3018
|
? Object.entries(zodObjectShape(schema))
|
|
2927
3019
|
.filter(([name, field]) => name !== mint?.field && recipientMetaOf(field) !== undefined)
|
|
@@ -2936,9 +3028,12 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
2936
3028
|
const references = referencePayloadFields.length === 0
|
|
2937
3029
|
? expr
|
|
2938
3030
|
: `_nmsWireReferences(${expr}, ${JSON.stringify(referencePayloadTypes)}, holon.workspace)`;
|
|
2939
|
-
const
|
|
3031
|
+
const addressed = Object.keys(addressReferencePayloadTypes).length === 0
|
|
2940
3032
|
? references
|
|
2941
|
-
: `
|
|
3033
|
+
: `_nmsWireAddressReferences(${references}, ${JSON.stringify(addressReferencePayloadTypes)})`;
|
|
3034
|
+
const versioned = versionedReferencePayloadFields.length === 0
|
|
3035
|
+
? addressed
|
|
3036
|
+
: `_nmsWireVersionedReferences(${addressed}, ${JSON.stringify(versionedReferencePayloadFields)})`;
|
|
2942
3037
|
return recipientPayloadFields.length === 0
|
|
2943
3038
|
? versioned
|
|
2944
3039
|
: `_nmsWireRecipients(${versioned}, ${JSON.stringify(recipientPayloadFields)})`;
|
|
@@ -3825,7 +3920,7 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
3825
3920
|
),
|
|
3826
3921
|
`type _${applicationName}Business = ${applicationType};`,
|
|
3827
3922
|
`export type ${applicationName}Status = _NomosApplicationStatus;`,
|
|
3828
|
-
`export type ${applicationName} = _${applicationName}Business & _NomosApplicationParticipant & _NomosApplicationLifecycle${hasInvitations ? " & _NomosApplicationInvitations" : ""};`,
|
|
3923
|
+
`export type ${applicationName} = _${applicationName}Business & _NomosApplicationParticipant & _NomosApplicationLifecycle & _NomosApplicationModelLifecycle${hasInvitations ? " & _NomosApplicationInvitations" : ""};`,
|
|
3829
3924
|
`export interface ${applicationName}OpenOptions {`,
|
|
3830
3925
|
` /** Nomos Cloud serving this deployed application. Configure it once at the app boundary. */`,
|
|
3831
3926
|
` readonly cloud: string;`,
|
|
@@ -3843,12 +3938,13 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
3843
3938
|
`function _nomosBind${applicationName}(`,
|
|
3844
3939
|
` holon: NomosHolon,`,
|
|
3845
3940
|
` user: { readonly identityId: string; readonly identityAddress: string },`,
|
|
3846
|
-
`): _${applicationName}Business & _NomosApplicationParticipant${hasInvitations ? " & _NomosApplicationInvitations" : ""} {`,
|
|
3941
|
+
`): _${applicationName}Business & _NomosApplicationParticipant & _NomosApplicationModelLifecycle${hasInvitations ? " & _NomosApplicationInvitations" : ""} {`,
|
|
3847
3942
|
...clientDomains.map((domain, index) =>
|
|
3848
3943
|
` const _nmsRoot${index} = ${tsClientFactoryName(domain)}(holon);`),
|
|
3849
3944
|
` const domains = [${clientDomains.map((_domain, index) => `_nmsRoot${index}`).join(", ")}] as const;`,
|
|
3850
3945
|
` const application: Record<string, unknown> = {};`,
|
|
3851
3946
|
` application.currentUser = { identity: { id: user.identityId, address: user.identityAddress } } as User;`,
|
|
3947
|
+
` application.model = _nmsRoot${clientDomains.indexOf(homeDomain)}.model;`,
|
|
3852
3948
|
...(hasInvitations
|
|
3853
3949
|
? [
|
|
3854
3950
|
` for (const reserved of ["recipient", "createInvitation", "redeemInvitation"] as const) {`,
|
|
@@ -3875,14 +3971,14 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
3875
3971
|
` const routedOwnedActions = new Map<string, Array<(...args: unknown[]) => Promise<unknown>>>();`,
|
|
3876
3972
|
` for (const domain of domains) for (const [name, value] of Object.entries(domain)) {`,
|
|
3877
3973
|
` if (privateMembers.has(name)) continue;`,
|
|
3878
|
-
` if (name === "past") { pasts.push(value as typeof pasts[number]); continue; }`,
|
|
3879
|
-
` if (name === "conflicts") { conflictSets.push(value as Record<string, unknown>); continue; }`,
|
|
3974
|
+
` if (name === "past") { pasts.push(value as unknown as typeof pasts[number]); continue; }`,
|
|
3975
|
+
` if (name === "conflicts") { conflictSets.push(value as unknown as Record<string, unknown>); continue; }`,
|
|
3880
3976
|
...(hasCorrections
|
|
3881
|
-
? [` if (name === "corrections") { correctionSets.push({ domain: String(domain.domain), value: value as typeof correctionSets[number]["value"] }); continue; }`]
|
|
3977
|
+
? [` if (name === "corrections") { correctionSets.push({ domain: String(domain.domain), value: value as unknown as typeof correctionSets[number]["value"] }); continue; }`]
|
|
3882
3978
|
: []),
|
|
3883
3979
|
` if (name === "share" || name === "unshare" || name === "transfer") {`,
|
|
3884
3980
|
` const candidates = routedOwnedActions.get(name) ?? [];`,
|
|
3885
|
-
` candidates.push(value as (...args: unknown[]) => Promise<unknown>); routedOwnedActions.set(name, candidates); continue;`,
|
|
3981
|
+
` candidates.push(value as unknown as (...args: unknown[]) => Promise<unknown>); routedOwnedActions.set(name, candidates); continue;`,
|
|
3886
3982
|
` }`,
|
|
3887
3983
|
` if (singletonMembers.has(name) && name in application) continue;`,
|
|
3888
3984
|
` if (name in application) throw new Error("Nomos application member collision: '" + name + "' is declared by more than one business domain; rename one of them");`,
|
|
@@ -3952,7 +4048,7 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
3952
4048
|
` }`,
|
|
3953
4049
|
` throw unsupported ?? new Error(name + " needs a generated owned record reference");`,
|
|
3954
4050
|
` };`,
|
|
3955
|
-
` return application as unknown as _${applicationName}Business & _NomosApplicationParticipant${hasInvitations ? " & _NomosApplicationInvitations" : ""};`,
|
|
4051
|
+
` return application as unknown as _${applicationName}Business & _NomosApplicationParticipant & _NomosApplicationModelLifecycle${hasInvitations ? " & _NomosApplicationInvitations" : ""};`,
|
|
3956
4052
|
`}`,
|
|
3957
4053
|
`/** Open the one durable, signed-in ${opts.packageName} business application.`,
|
|
3958
4054
|
` * Keep and pass this object down as application state; do not create a repository, runtime host`,
|