@ankhorage/contracts 22.1.1 → 22.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhorage/contracts
2
2
 
3
+ ## 22.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - af50e7e: Publish generated structural evidence for canonical ScreenSpec metadata authoring.
8
+
9
+ ## 22.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - bc6d757: Make the structure runtime subpath loadable directly under Node ESM by emitting explicit JavaScript module specifiers.
14
+
3
15
  ## 22.1.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/contracts
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v22.1.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v22.2.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
9
9
 
@@ -20,9 +20,18 @@ export interface AnkhCommandProviderManifest {
20
20
  readonly capabilities: readonly AnkhCapabilityId[];
21
21
  readonly commands: readonly AnkhCommandDescriptor[];
22
22
  }
23
+ export interface AnkhStructureRootMetadata {
24
+ readonly source: string;
25
+ readonly export: string;
26
+ }
27
+ export interface AnkhStructureMetadata {
28
+ readonly output: string;
29
+ readonly roots: Readonly<Record<string, AnkhStructureRootMetadata>>;
30
+ }
23
31
  export interface AnkhPackageMetadata {
24
32
  readonly category: AnkhCommandCategory;
25
33
  readonly provider: AnkhProviderReference | null;
26
34
  readonly capabilities: readonly AnkhCapabilityId[];
35
+ readonly structure?: AnkhStructureMetadata;
27
36
  }
28
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC,MAAM,MAAM,qBAAqB,GAAG,KAAK,MAAM,EAAE,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,QAAQ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AAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CAC5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"","sourcesContent":["export type AnkhCommandCategory = string;\n\nexport type AnkhProviderReference = `./${string}`;\n\nexport type AnkhCapabilityId = `${string}.${string}`;\n\nexport interface AnkhCommandDescriptor {\n /**\n * Command path relative to the provider category.\n *\n * An empty path declares the command at the category root.\n */\n readonly path: readonly string[];\n readonly summary: string;\n readonly capability: AnkhCapabilityId;\n readonly aliases?: readonly string[];\n readonly examples?: readonly string[];\n}\n\nexport interface AnkhCommandProviderManifest {\n readonly id: string;\n readonly category: AnkhCommandCategory;\n readonly version: string;\n readonly capabilities: readonly AnkhCapabilityId[];\n readonly commands: readonly AnkhCommandDescriptor[];\n}\n\nexport interface AnkhPackageMetadata {\n readonly category: AnkhCommandCategory;\n readonly provider: AnkhProviderReference | null;\n readonly capabilities: readonly AnkhCapabilityId[];\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"","sourcesContent":["export type AnkhCommandCategory = string;\n\nexport type AnkhProviderReference = `./${string}`;\n\nexport type AnkhCapabilityId = `${string}.${string}`;\n\nexport interface AnkhCommandDescriptor {\n /**\n * Command path relative to the provider category.\n *\n * An empty path declares the command at the category root.\n */\n readonly path: readonly string[];\n readonly summary: string;\n readonly capability: AnkhCapabilityId;\n readonly aliases?: readonly string[];\n readonly examples?: readonly string[];\n}\n\nexport interface AnkhCommandProviderManifest {\n readonly id: string;\n readonly category: AnkhCommandCategory;\n readonly version: string;\n readonly capabilities: readonly AnkhCapabilityId[];\n readonly commands: readonly AnkhCommandDescriptor[];\n}\n\nexport interface AnkhStructureRootMetadata {\n readonly source: string;\n readonly export: string;\n}\n\nexport interface AnkhStructureMetadata {\n readonly output: string;\n readonly roots: Readonly<Record<string, AnkhStructureRootMetadata>>;\n}\n\nexport interface AnkhPackageMetadata {\n readonly category: AnkhCommandCategory;\n readonly provider: AnkhProviderReference | null;\n readonly capabilities: readonly AnkhCapabilityId[];\n readonly structure?: AnkhStructureMetadata;\n}\n"]}
@@ -0,0 +1,47 @@
1
+ export declare const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = "6.0.3";
2
+ export declare const STRUCTURE_DESCRIPTOR_FINGERPRINT = "sha256:be044f4aeb00c3790561556c7688623084944d3d85d860daedc7989ab5989cf6";
3
+ export declare const STRUCTURE_DESCRIPTOR: {
4
+ readonly protocolVersion: 1;
5
+ readonly packageName: "@ankhorage/contracts";
6
+ readonly packageVersion: "22.1.2";
7
+ readonly roots: {
8
+ readonly "screen-metadata": "ScreenMetadataSpec";
9
+ };
10
+ readonly descriptors: {
11
+ readonly ScreenMetadataSpec: {
12
+ readonly id: "ScreenMetadataSpec";
13
+ readonly descriptor: {
14
+ readonly kind: "object";
15
+ readonly fields: {
16
+ readonly description: {
17
+ readonly value: {
18
+ readonly kind: "scalar";
19
+ readonly type: "string";
20
+ };
21
+ readonly optional: true;
22
+ };
23
+ readonly id: {
24
+ readonly value: {
25
+ readonly kind: "scalar";
26
+ readonly type: "string";
27
+ };
28
+ };
29
+ readonly name: {
30
+ readonly value: {
31
+ readonly kind: "scalar";
32
+ readonly type: "string";
33
+ };
34
+ };
35
+ readonly title: {
36
+ readonly value: {
37
+ readonly kind: "scalar";
38
+ readonly type: "string";
39
+ };
40
+ readonly optional: true;
41
+ };
42
+ };
43
+ };
44
+ };
45
+ };
46
+ };
47
+ //# sourceMappingURL=generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qCAAqC,UAAU,CAAC;AAC7D,eAAO,MAAM,gCAAgC,4EAA4E,CAAC;AAE1H,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Ce,CAAC"}
@@ -0,0 +1,47 @@
1
+ export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
2
+ export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:be044f4aeb00c3790561556c7688623084944d3d85d860daedc7989ab5989cf6';
3
+ export const STRUCTURE_DESCRIPTOR = {
4
+ "protocolVersion": 1,
5
+ "packageName": "@ankhorage/contracts",
6
+ "packageVersion": "22.1.2",
7
+ "roots": {
8
+ "screen-metadata": "ScreenMetadataSpec"
9
+ },
10
+ "descriptors": {
11
+ "ScreenMetadataSpec": {
12
+ "id": "ScreenMetadataSpec",
13
+ "descriptor": {
14
+ "kind": "object",
15
+ "fields": {
16
+ "description": {
17
+ "value": {
18
+ "kind": "scalar",
19
+ "type": "string"
20
+ },
21
+ "optional": true
22
+ },
23
+ "id": {
24
+ "value": {
25
+ "kind": "scalar",
26
+ "type": "string"
27
+ }
28
+ },
29
+ "name": {
30
+ "value": {
31
+ "kind": "scalar",
32
+ "type": "string"
33
+ }
34
+ },
35
+ "title": {
36
+ "value": {
37
+ "kind": "scalar",
38
+ "type": "string"
39
+ },
40
+ "optional": true
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ };
47
+ //# sourceMappingURL=generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated.js","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAO,CAAC;AAC7D,MAAM,CAAC,MAAM,gCAAgC,GAAG,yEAAyE,CAAC;AAE1H,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,sBAAsB;IACrC,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE;QACP,iBAAiB,EAAE,oBAAoB;KACxC;IACD,aAAa,EAAE;QACb,oBAAoB,EAAE;YACpB,IAAI,EAAE,oBAAoB;YAC1B,YAAY,EAAE;gBACZ,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE;oBACR,aAAa,EAAE;wBACb,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,IAAI,EAAE;wBACJ,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;qBACF;oBACD,MAAM,EAAE;wBACN,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;qBACF;oBACD,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;wBACD,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;KACF;CAC6C,CAAC","sourcesContent":["/* This file is generated by @ankhorage/devtools. Do not edit manually. */\nimport type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';\n\nexport const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';\nexport const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:be044f4aeb00c3790561556c7688623084944d3d85d860daedc7989ab5989cf6';\n\nexport const STRUCTURE_DESCRIPTOR = {\n \"protocolVersion\": 1,\n \"packageName\": \"@ankhorage/contracts\",\n \"packageVersion\": \"22.1.2\",\n \"roots\": {\n \"screen-metadata\": \"ScreenMetadataSpec\"\n },\n \"descriptors\": {\n \"ScreenMetadataSpec\": {\n \"id\": \"ScreenMetadataSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"description\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"id\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"name\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"title\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n }\n }\n} as const satisfies StructureDescriptorDocument;\n"]}
@@ -1,5 +1,6 @@
1
1
  export type { EntityRegistry, SerializableSet, ValueMap } from '../collections';
2
- export { isStructureDescriptor } from './isStructureDescriptor';
3
- export { isStructureDescriptorDocument } from './isStructureDescriptorDocument';
4
- export type { StructureDescriptor, StructureDescriptorDefinition, StructureDescriptorDocument, StructureDescriptorId, StructureDescriptorRegistry, StructureEntityRegistryDescriptor, StructureEnumDescriptor, StructureLiteralValue, StructureObjectDescriptor, StructureObjectField, StructureOrderedListDescriptor, StructureReferenceDescriptor, StructureScalarDescriptor, StructureScalarType, StructureSetDescriptor, StructureUnionDescriptor, StructureValueMapDescriptor, } from './types';
2
+ export { STRUCTURE_DESCRIPTOR, STRUCTURE_DESCRIPTOR_COMPILER_VERSION, STRUCTURE_DESCRIPTOR_FINGERPRINT, } from './generated.js';
3
+ export { isStructureDescriptor } from './isStructureDescriptor.js';
4
+ export { isStructureDescriptorDocument } from './isStructureDescriptorDocument.js';
5
+ export type { StructureDescriptor, StructureDescriptorDefinition, StructureDescriptorDocument, StructureDescriptorId, StructureDescriptorRegistry, StructureEntityRegistryDescriptor, StructureEnumDescriptor, StructureLiteralValue, StructureObjectDescriptor, StructureObjectField, StructureOrderedListDescriptor, StructureReferenceDescriptor, StructureScalarDescriptor, StructureScalarType, StructureSetDescriptor, StructureUnionDescriptor, StructureValueMapDescriptor, } from './types.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,oBAAoB,EACpB,qCAAqC,EACrC,gCAAgC,GACjC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
@@ -1,3 +1,4 @@
1
- export { isStructureDescriptor } from './isStructureDescriptor';
2
- export { isStructureDescriptorDocument } from './isStructureDescriptorDocument';
1
+ export { STRUCTURE_DESCRIPTOR, STRUCTURE_DESCRIPTOR_COMPILER_VERSION, STRUCTURE_DESCRIPTOR_FINGERPRINT, } from './generated.js';
2
+ export { isStructureDescriptor } from './isStructureDescriptor.js';
3
+ export { isStructureDescriptorDocument } from './isStructureDescriptorDocument.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export type { EntityRegistry, SerializableSet, ValueMap } from '../collections';\nexport { isStructureDescriptor } from './isStructureDescriptor';\nexport { isStructureDescriptorDocument } from './isStructureDescriptorDocument';\nexport type {\n StructureDescriptor,\n StructureDescriptorDefinition,\n StructureDescriptorDocument,\n StructureDescriptorId,\n StructureDescriptorRegistry,\n StructureEntityRegistryDescriptor,\n StructureEnumDescriptor,\n StructureLiteralValue,\n StructureObjectDescriptor,\n StructureObjectField,\n StructureOrderedListDescriptor,\n StructureReferenceDescriptor,\n StructureScalarDescriptor,\n StructureScalarType,\n StructureSetDescriptor,\n StructureUnionDescriptor,\n StructureValueMapDescriptor,\n} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qCAAqC,EACrC,gCAAgC,GACjC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export type { EntityRegistry, SerializableSet, ValueMap } from '../collections';\nexport {\n STRUCTURE_DESCRIPTOR,\n STRUCTURE_DESCRIPTOR_COMPILER_VERSION,\n STRUCTURE_DESCRIPTOR_FINGERPRINT,\n} from './generated.js';\nexport { isStructureDescriptor } from './isStructureDescriptor.js';\nexport { isStructureDescriptorDocument } from './isStructureDescriptorDocument.js';\nexport type {\n StructureDescriptor,\n StructureDescriptorDefinition,\n StructureDescriptorDocument,\n StructureDescriptorId,\n StructureDescriptorRegistry,\n StructureEntityRegistryDescriptor,\n StructureEnumDescriptor,\n StructureLiteralValue,\n StructureObjectDescriptor,\n StructureObjectField,\n StructureOrderedListDescriptor,\n StructureReferenceDescriptor,\n StructureScalarDescriptor,\n StructureScalarType,\n StructureSetDescriptor,\n StructureUnionDescriptor,\n StructureValueMapDescriptor,\n} from './types.js';\n"]}
@@ -1,4 +1,4 @@
1
- import type { StructureDescriptorDocument } from './types';
1
+ import type { StructureDescriptorDocument } from './types.js';
2
2
  /*** Validate a complete package structural-descriptor document and all resolvable references. */
3
3
  export declare function isStructureDescriptorDocument(value: unknown): value is StructureDescriptorDocument;
4
4
  //# sourceMappingURL=isStructureDescriptorDocument.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isStructureDescriptorDocument.d.ts","sourceRoot":"","sources":["../../src/structure/isStructureDescriptorDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,2BAA2B,EAG5B,MAAM,SAAS,CAAC;AAEjB,iGAAiG;AACjG,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,2BAA2B,CA2BtC"}
1
+ {"version":3,"file":"isStructureDescriptorDocument.d.ts","sourceRoot":"","sources":["../../src/structure/isStructureDescriptorDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,2BAA2B,EAG5B,MAAM,YAAY,CAAC;AAEpB,iGAAiG;AACjG,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,2BAA2B,CA2BtC"}
@@ -1,6 +1,6 @@
1
1
  import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';
2
2
  import { isNonEmptyString } from '@ankhorage/utility/string';
3
- import { isStructureDescriptor } from './isStructureDescriptor';
3
+ import { isStructureDescriptor } from './isStructureDescriptor.js';
4
4
  /*** Validate a complete package structural-descriptor document and all resolvable references. */
5
5
  export function isStructureDescriptorDocument(value) {
6
6
  if (!isRecord(value) ||
@@ -1 +1 @@
1
- {"version":3,"file":"isStructureDescriptorDocument.js","sourceRoot":"","sources":["../../src/structure/isStructureDescriptorDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAShE,iGAAiG;AACjG,MAAM,UAAU,6BAA6B,CAC3C,KAAc;IAEd,IACE,CAAC,QAAQ,CAAC,KAAK,CAAC;QAChB,CAAC,WAAW,CAAC,KAAK,EAAE;YAClB,iBAAiB;YACjB,aAAa;YACb,gBAAgB;YAChB,OAAO;YACP,aAAa;SACd,CAAC;QACF,KAAK,CAAC,eAAe,KAAK,CAAC;QAC3B,CAAC,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC;QACpC,CAAC,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC;QACvC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;QACvB,CAAC,oBAAoB,CAAC,KAAK,CAAC,WAAW,CAAC,EACxC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAgC;QAC5C,eAAe,EAAE,CAAC;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;IACF,OAAO,kBAAkB,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;AAC1E,CAAC;AAED,0DAA0D;AAC1D,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,CACL,QAAQ,CAAC,KAAK,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CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;IACvE,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAC3F,IAAI,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACpF,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAE9B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5B,OAAO,kBAAkB,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';\nimport { isNonEmptyString } from '@ankhorage/utility/string';\n\nimport { isStructureDescriptor } from './isStructureDescriptor';\nimport type {\n StructureDescriptor,\n StructureDescriptorDefinition,\n StructureDescriptorDocument,\n StructureDescriptorId,\n StructureDescriptorRegistry,\n} from './types';\n\n/*** Validate a complete package structural-descriptor document and all resolvable references. */\nexport function isStructureDescriptorDocument(\n value: unknown,\n): value is StructureDescriptorDocument {\n if (\n !isRecord(value) ||\n !hasOnlyKeys(value, [\n 'protocolVersion',\n 'packageName',\n 'packageVersion',\n 'roots',\n 'descriptors',\n ]) ||\n value.protocolVersion !== 1 ||\n !isNonEmptyString(value.packageName) ||\n !isNonEmptyString(value.packageVersion) ||\n !isRootMap(value.roots) ||\n !isDescriptorRegistry(value.descriptors)\n ) {\n return false;\n }\n\n const document: StructureDescriptorDocument = {\n protocolVersion: 1,\n packageName: value.packageName,\n packageVersion: value.packageVersion,\n roots: value.roots,\n descriptors: value.descriptors,\n };\n return hasResolvableRoots(document) && isDescriptorGraphValid(document);\n}\n\n/*** Validate the root-name to local-descriptor-ID map. */\nfunction isRootMap(value: unknown): value is Readonly<Record<string, StructureDescriptorId>> {\n return (\n isRecord(value) &&\n Object.keys(value).length > 0 &&\n Object.entries(value).every(\n ([name, descriptorId]) => isNonEmptyString(name) && isNonEmptyString(descriptorId),\n )\n );\n}\n\n/*** Validate descriptor definitions and enforce record-key to definition-ID identity. */\nfunction isDescriptorRegistry(value: unknown): value is StructureDescriptorRegistry {\n return (\n isRecord(value) &&\n Object.keys(value).length > 0 &&\n Object.entries(value).every(([descriptorId, definition]) =>\n isDefinition(definition, descriptorId),\n )\n );\n}\n\n/*** Validate one descriptor definition against its stable registry key. */\nfunction isDefinition(\n value: unknown,\n descriptorId: string,\n): value is StructureDescriptorDefinition {\n return (\n isRecord(value) &&\n hasOnlyKeys(value, ['id', 'descriptor']) &&\n value.id === descriptorId &&\n isNonEmptyString(value.id) &&\n isStructureDescriptor(value.descriptor)\n );\n}\n\n/*** Require every document root to resolve to one local descriptor definition. */\nfunction hasResolvableRoots(document: StructureDescriptorDocument): boolean {\n const descriptors = new Map(Object.entries(document.descriptors));\n return Object.values(document.roots).every((descriptorId) => descriptors.has(descriptorId));\n}\n\n/*** Validate local references, recursive graphs, and string-only collection key/member descriptors. */\nfunction isDescriptorGraphValid(document: StructureDescriptorDocument): boolean {\n const definitions = new Map(Object.entries(document.descriptors));\n return Array.from(definitions.values()).every((definition) =>\n validateGraphNode(definition.descriptor, document, new Set()),\n );\n}\n\n/*** Validate one graph node while treating revisited local refs as a valid recursive cycle. */\nfunction validateGraphNode(\n descriptor: StructureDescriptor,\n document: StructureDescriptorDocument,\n visitedRefs: Set<string>,\n): boolean {\n switch (descriptor.kind) {\n case 'object':\n return Object.values(descriptor.fields).every((field) =>\n validateGraphNode(field.value, document, new Set(visitedRefs)),\n );\n case 'entity-registry':\n case 'value-map':\n return (\n isStringCompatible(descriptor.key, document, new Set()) &&\n validateGraphNode(descriptor.value, document, new Set(visitedRefs))\n );\n case 'set':\n return isStringCompatible(descriptor.member, document, new Set());\n case 'ordered-list':\n return validateGraphNode(descriptor.item, document, new Set(visitedRefs));\n case 'union':\n return descriptor.variants.every((variant) =>\n validateGraphNode(variant, document, new Set(visitedRefs)),\n );\n case 'ref':\n return validateReference(descriptor, document, visitedRefs);\n default:\n return true;\n }\n}\n\n/*** Resolve and validate one local reference while deferring package-qualified refs to composition. */\nfunction validateReference(\n descriptor: Extract<StructureDescriptor, { readonly kind: 'ref' }>,\n document: StructureDescriptorDocument,\n visitedRefs: Set<string>,\n): boolean {\n if (descriptor.packageName && descriptor.packageName !== document.packageName) return true;\n if (visitedRefs.has(descriptor.id)) return true;\n\n const definition = new Map(Object.entries(document.descriptors)).get(descriptor.id);\n if (!definition) return false;\n\n const nextRefs = new Set(visitedRefs);\n nextRefs.add(descriptor.id);\n return validateGraphNode(definition.descriptor, document, nextRefs);\n}\n\n/*** Prove that a collection key/member descriptor is string-valued when locally resolvable. */\nfunction isStringCompatible(\n descriptor: StructureDescriptor,\n document: StructureDescriptorDocument,\n visitedRefs: Set<string>,\n): boolean {\n if (descriptor.kind === 'scalar') return descriptor.type === 'string';\n if (descriptor.kind === 'enum') {\n return descriptor.values.every((value) => typeof value === 'string');\n }\n if (descriptor.kind !== 'ref') return false;\n if (descriptor.packageName && descriptor.packageName !== document.packageName) return true;\n if (visitedRefs.has(descriptor.id)) return false;\n\n const definition = new Map(Object.entries(document.descriptors)).get(descriptor.id);\n if (!definition) return false;\n\n const nextRefs = new Set(visitedRefs);\n nextRefs.add(descriptor.id);\n return isStringCompatible(definition.descriptor, document, nextRefs);\n}\n"]}
1
+ {"version":3,"file":"isStructureD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AAI,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAC3F,IAAI,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACpF,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAE9B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5B,OAAO,kBAAkB,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';\nimport { isNonEmptyString } from '@ankhorage/utility/string';\n\nimport { isStructureDescriptor } from './isStructureDescriptor.js';\nimport type {\n StructureDescriptor,\n StructureDescriptorDefinition,\n StructureDescriptorDocument,\n StructureDescriptorId,\n StructureDescriptorRegistry,\n} from './types.js';\n\n/*** Validate a complete package structural-descriptor document and all resolvable references. */\nexport function isStructureDescriptorDocument(\n value: unknown,\n): value is StructureDescriptorDocument {\n if (\n !isRecord(value) ||\n !hasOnlyKeys(value, [\n 'protocolVersion',\n 'packageName',\n 'packageVersion',\n 'roots',\n 'descriptors',\n ]) ||\n value.protocolVersion !== 1 ||\n !isNonEmptyString(value.packageName) ||\n !isNonEmptyString(value.packageVersion) ||\n !isRootMap(value.roots) ||\n !isDescriptorRegistry(value.descriptors)\n ) {\n return false;\n }\n\n const document: StructureDescriptorDocument = {\n protocolVersion: 1,\n packageName: value.packageName,\n packageVersion: value.packageVersion,\n roots: value.roots,\n descriptors: value.descriptors,\n };\n return hasResolvableRoots(document) && isDescriptorGraphValid(document);\n}\n\n/*** Validate the root-name to local-descriptor-ID map. */\nfunction isRootMap(value: unknown): value is Readonly<Record<string, StructureDescriptorId>> {\n return (\n isRecord(value) &&\n Object.keys(value).length > 0 &&\n Object.entries(value).every(\n ([name, descriptorId]) => isNonEmptyString(name) && isNonEmptyString(descriptorId),\n )\n );\n}\n\n/*** Validate descriptor definitions and enforce record-key to definition-ID identity. */\nfunction isDescriptorRegistry(value: unknown): value is StructureDescriptorRegistry {\n return (\n isRecord(value) &&\n Object.keys(value).length > 0 &&\n Object.entries(value).every(([descriptorId, definition]) =>\n isDefinition(definition, descriptorId),\n )\n );\n}\n\n/*** Validate one descriptor definition against its stable registry key. */\nfunction isDefinition(\n value: unknown,\n descriptorId: string,\n): value is StructureDescriptorDefinition {\n return (\n isRecord(value) &&\n hasOnlyKeys(value, ['id', 'descriptor']) &&\n value.id === descriptorId &&\n isNonEmptyString(value.id) &&\n isStructureDescriptor(value.descriptor)\n );\n}\n\n/*** Require every document root to resolve to one local descriptor definition. */\nfunction hasResolvableRoots(document: StructureDescriptorDocument): boolean {\n const descriptors = new Map(Object.entries(document.descriptors));\n return Object.values(document.roots).every((descriptorId) => descriptors.has(descriptorId));\n}\n\n/*** Validate local references, recursive graphs, and string-only collection key/member descriptors. */\nfunction isDescriptorGraphValid(document: StructureDescriptorDocument): boolean {\n const definitions = new Map(Object.entries(document.descriptors));\n return Array.from(definitions.values()).every((definition) =>\n validateGraphNode(definition.descriptor, document, new Set()),\n );\n}\n\n/*** Validate one graph node while treating revisited local refs as a valid recursive cycle. */\nfunction validateGraphNode(\n descriptor: StructureDescriptor,\n document: StructureDescriptorDocument,\n visitedRefs: Set<string>,\n): boolean {\n switch (descriptor.kind) {\n case 'object':\n return Object.values(descriptor.fields).every((field) =>\n validateGraphNode(field.value, document, new Set(visitedRefs)),\n );\n case 'entity-registry':\n case 'value-map':\n return (\n isStringCompatible(descriptor.key, document, new Set()) &&\n validateGraphNode(descriptor.value, document, new Set(visitedRefs))\n );\n case 'set':\n return isStringCompatible(descriptor.member, document, new Set());\n case 'ordered-list':\n return validateGraphNode(descriptor.item, document, new Set(visitedRefs));\n case 'union':\n return descriptor.variants.every((variant) =>\n validateGraphNode(variant, document, new Set(visitedRefs)),\n );\n case 'ref':\n return validateReference(descriptor, document, visitedRefs);\n default:\n return true;\n }\n}\n\n/*** Resolve and validate one local reference while deferring package-qualified refs to composition. */\nfunction validateReference(\n descriptor: Extract<StructureDescriptor, { readonly kind: 'ref' }>,\n document: StructureDescriptorDocument,\n visitedRefs: Set<string>,\n): boolean {\n if (descriptor.packageName && descriptor.packageName !== document.packageName) return true;\n if (visitedRefs.has(descriptor.id)) return true;\n\n const definition = new Map(Object.entries(document.descriptors)).get(descriptor.id);\n if (!definition) return false;\n\n const nextRefs = new Set(visitedRefs);\n nextRefs.add(descriptor.id);\n return validateGraphNode(definition.descriptor, document, nextRefs);\n}\n\n/*** Prove that a collection key/member descriptor is string-valued when locally resolvable. */\nfunction isStringCompatible(\n descriptor: StructureDescriptor,\n document: StructureDescriptorDocument,\n visitedRefs: Set<string>,\n): boolean {\n if (descriptor.kind === 'scalar') return descriptor.type === 'string';\n if (descriptor.kind === 'enum') {\n return descriptor.values.every((value) => typeof value === 'string');\n }\n if (descriptor.kind !== 'ref') return false;\n if (descriptor.packageName && descriptor.packageName !== document.packageName) return true;\n if (visitedRefs.has(descriptor.id)) return false;\n\n const definition = new Map(Object.entries(document.descriptors)).get(descriptor.id);\n if (!definition) return false;\n\n const nextRefs = new Set(visitedRefs);\n nextRefs.add(descriptor.id);\n return isStringCompatible(definition.descriptor, document, nextRefs);\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -138,11 +138,13 @@ export interface UiNode {
138
138
  style?: Record<string, number | string>;
139
139
  repeat?: UiNodeRepeatSpec;
140
140
  }
141
- export interface ScreenSpec {
141
+ export interface ScreenMetadataSpec {
142
142
  id: string;
143
143
  name: string;
144
144
  title?: string;
145
145
  description?: string;
146
+ }
147
+ export interface ScreenSpec extends ScreenMetadataSpec {
146
148
  root: UiNode;
147
149
  dataLoaders?: readonly ScreenDataLoaderDefinition[];
148
150
  requires?: ScreenRequirements;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MA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CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,uFAAuF;IACvF,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yFAAyF;IACzF,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,oBAAoB,CAAC;IAChC,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,WAAW,CAAC;CACvB"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA6IA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { SplashScreenSpec } from './appManifest/splashScreen';\nimport type { AuthIdentifierKind, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { EntityRegistry } from './collections';\nimport type { DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { InfraManifest } from './infra';\nimport type { MediaAssetReference, MediaManifest } from './media';\nimport type { AppNavigatorManifest } from './navigator';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { SerializableValue } from './serializable';\nimport type { AppStateSpec } from './state';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport type ThemeId = string;\n\nexport interface ThemeConfig {\n id: ThemeId;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ThemeRegistry = EntityRegistry<ThemeId, ThemeConfig, 'id'>;\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue = SerializableValue;\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\ninterface IconPresentationSpec {\n size?: number | string;\n color?: string;\n}\n\nexport interface NamedIconSpec extends IconPresentationSpec {\n name: string;\n provider?: string;\n source?: never;\n}\n\nexport interface SvgIconSpec extends IconPresentationSpec {\n source: MediaAssetReference;\n name?: never;\n provider?: never;\n}\n\nexport type IconSpec = NamedIconSpec | SvgIconSpec;\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: ThemeId;\n created?: string;\n updated?: string;\n };\n themes: ThemeRegistry;\n activeThemeId: ThemeId;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state, separate from environment-specific infrastructure. */\n deploy?: AppDeployManifest;\n /** Application runtime state is not provisioned by Infra. */\n state?: AppStateSpec;\n infra: InfraManifest;\n navigator: AppNavigatorManifest;\n screens: EntityRegistry<string, ScreenSpec, 'id'>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA6IA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { SplashScreenSpec } from './appManifest/splashScreen';\nimport type { AuthIdentifierKind, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { EntityRegistry } from './collections';\nimport type { DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { InfraManifest } from './infra';\nimport type { MediaAssetReference, MediaManifest } from './media';\nimport type { AppNavigatorManifest } from './navigator';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { SerializableValue } from './serializable';\nimport type { AppStateSpec } from './state';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport type ThemeId = string;\n\nexport interface ThemeConfig {\n id: ThemeId;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ThemeRegistry = EntityRegistry<ThemeId, ThemeConfig, 'id'>;\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue = SerializableValue;\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\ninterface IconPresentationSpec {\n size?: number | string;\n color?: string;\n}\n\nexport interface NamedIconSpec extends IconPresentationSpec {\n name: string;\n provider?: string;\n source?: never;\n}\n\nexport interface SvgIconSpec extends IconPresentationSpec {\n source: MediaAssetReference;\n name?: never;\n provider?: never;\n}\n\nexport type IconSpec = NamedIconSpec | SvgIconSpec;\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenMetadataSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n}\n\nexport interface ScreenSpec extends ScreenMetadataSpec {\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: ThemeId;\n created?: string;\n updated?: string;\n };\n themes: ThemeRegistry;\n activeThemeId: ThemeId;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state, separate from environment-specific infrastructure. */\n deploy?: AppDeployManifest;\n /** Application runtime state is not provisioned by Infra. */\n state?: AppStateSpec;\n infra: InfraManifest;\n navigator: AppNavigatorManifest;\n screens: EntityRegistry<string, ScreenSpec, 'id'>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
package/package.json CHANGED
@@ -1,20 +1,29 @@
1
1
  {
2
2
  "name": "@ankhorage/contracts",
3
- "version": "22.1.1",
3
+ "version": "22.2.0",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
7
7
  "provider": null,
8
8
  "capabilities": [
9
9
  "contracts.cli"
10
- ]
10
+ ],
11
+ "structure": {
12
+ "output": "src/structure/generated.ts",
13
+ "roots": {
14
+ "screen-metadata": {
15
+ "source": "src/types.ts",
16
+ "export": "ScreenMetadataSpec"
17
+ }
18
+ }
19
+ }
11
20
  },
12
21
  "dependencies": {
13
22
  "@ankhorage/color-theory": "^0.3.1",
14
23
  "@ankhorage/utility": "^1.4.0"
15
24
  },
16
25
  "devDependencies": {
17
- "@ankhorage/devtools": "^1.17.2",
26
+ "@ankhorage/devtools": "^1.18.4",
18
27
  "@ankhorage/paradox": "^0.1.26",
19
28
  "@types/bun": "^1.4.1",
20
29
  "@types/node": "^25.2.3",
@@ -141,9 +150,10 @@
141
150
  "format": "ankhorage-prettier --write .",
142
151
  "format:check": "ankhorage-prettier --check .",
143
152
  "test": "bun test src",
144
- "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.infra-tests.json && bun run build && tsc --noEmit -p tsconfig.deploy-provider-consumer.json",
153
+ "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.infra-tests.json && bun run build && tsc --noEmit -p tsconfig.deploy-provider-consumer.json && bun run structure:check",
145
154
  "version-packages": "ankhorage-changeset version",
146
- "knip:check": "ankhorage-knip"
155
+ "knip:check": "ankhorage-knip",
156
+ "structure:check": "ankhorage-structure check ."
147
157
  },
148
158
  "sideEffects": false,
149
159
  "type": "module",
package/src/cli/index.ts CHANGED
@@ -25,8 +25,19 @@ export interface AnkhCommandProviderManifest {
25
25
  readonly commands: readonly AnkhCommandDescriptor[];
26
26
  }
27
27
 
28
+ export interface AnkhStructureRootMetadata {
29
+ readonly source: string;
30
+ readonly export: string;
31
+ }
32
+
33
+ export interface AnkhStructureMetadata {
34
+ readonly output: string;
35
+ readonly roots: Readonly<Record<string, AnkhStructureRootMetadata>>;
36
+ }
37
+
28
38
  export interface AnkhPackageMetadata {
29
39
  readonly category: AnkhCommandCategory;
30
40
  readonly provider: AnkhProviderReference | null;
31
41
  readonly capabilities: readonly AnkhCapabilityId[];
42
+ readonly structure?: AnkhStructureMetadata;
32
43
  }
@@ -59,6 +59,15 @@ describe('contracts', () => {
59
59
  category: 'contracts',
60
60
  provider: null,
61
61
  capabilities: ['contracts.cli'],
62
+ structure: {
63
+ output: 'src/structure/generated.ts',
64
+ roots: {
65
+ 'screen-metadata': {
66
+ source: 'src/types.ts',
67
+ export: 'ScreenMetadataSpec',
68
+ },
69
+ },
70
+ },
62
71
  } as const satisfies AnkhPackageMetadata;
63
72
 
64
73
  const packageJson = JSON.parse(await readFile(join(process.cwd(), 'package.json'), 'utf8')) as {
@@ -0,0 +1,50 @@
1
+ /* This file is generated by @ankhorage/devtools. Do not edit manually. */
2
+ import type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';
3
+
4
+ export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
5
+ export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:b0afb6c562efc3e866bcb65467aaa4ba673cd631f09fdbe9cb94f3324e852e66';
6
+
7
+ export const STRUCTURE_DESCRIPTOR = {
8
+ "protocolVersion": 1,
9
+ "packageName": "@ankhorage/contracts",
10
+ "packageVersion": "22.2.0",
11
+ "roots": {
12
+ "screen-metadata": "ScreenMetadataSpec"
13
+ },
14
+ "descriptors": {
15
+ "ScreenMetadataSpec": {
16
+ "id": "ScreenMetadataSpec",
17
+ "descriptor": {
18
+ "kind": "object",
19
+ "fields": {
20
+ "description": {
21
+ "value": {
22
+ "kind": "scalar",
23
+ "type": "string"
24
+ },
25
+ "optional": true
26
+ },
27
+ "id": {
28
+ "value": {
29
+ "kind": "scalar",
30
+ "type": "string"
31
+ }
32
+ },
33
+ "name": {
34
+ "value": {
35
+ "kind": "scalar",
36
+ "type": "string"
37
+ }
38
+ },
39
+ "title": {
40
+ "value": {
41
+ "kind": "scalar",
42
+ "type": "string"
43
+ },
44
+ "optional": true
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ } as const satisfies StructureDescriptorDocument;
@@ -1,6 +1,11 @@
1
1
  export type { EntityRegistry, SerializableSet, ValueMap } from '../collections';
2
- export { isStructureDescriptor } from './isStructureDescriptor';
3
- export { isStructureDescriptorDocument } from './isStructureDescriptorDocument';
2
+ export {
3
+ STRUCTURE_DESCRIPTOR,
4
+ STRUCTURE_DESCRIPTOR_COMPILER_VERSION,
5
+ STRUCTURE_DESCRIPTOR_FINGERPRINT,
6
+ } from './generated.js';
7
+ export { isStructureDescriptor } from './isStructureDescriptor.js';
8
+ export { isStructureDescriptorDocument } from './isStructureDescriptorDocument.js';
4
9
  export type {
5
10
  StructureDescriptor,
6
11
  StructureDescriptorDefinition,
@@ -19,4 +24,4 @@ export type {
19
24
  StructureSetDescriptor,
20
25
  StructureUnionDescriptor,
21
26
  StructureValueMapDescriptor,
22
- } from './types';
27
+ } from './types.js';
@@ -1,14 +1,14 @@
1
1
  import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';
2
2
  import { isNonEmptyString } from '@ankhorage/utility/string';
3
3
 
4
- import { isStructureDescriptor } from './isStructureDescriptor';
4
+ import { isStructureDescriptor } from './isStructureDescriptor.js';
5
5
  import type {
6
6
  StructureDescriptor,
7
7
  StructureDescriptorDefinition,
8
8
  StructureDescriptorDocument,
9
9
  StructureDescriptorId,
10
10
  StructureDescriptorRegistry,
11
- } from './types';
11
+ } from './types.js';
12
12
 
13
13
  /*** Validate a complete package structural-descriptor document and all resolvable references. */
14
14
  export function isStructureDescriptorDocument(
package/src/types.ts CHANGED
@@ -230,11 +230,14 @@ export interface UiNode {
230
230
  repeat?: UiNodeRepeatSpec;
231
231
  }
232
232
 
233
- export interface ScreenSpec {
233
+ export interface ScreenMetadataSpec {
234
234
  id: string;
235
235
  name: string;
236
236
  title?: string;
237
237
  description?: string;
238
+ }
239
+
240
+ export interface ScreenSpec extends ScreenMetadataSpec {
238
241
  root: UiNode;
239
242
  dataLoaders?: readonly ScreenDataLoaderDefinition[];
240
243
  requires?: ScreenRequirements;