@lssm/lib.contracts 0.0.0-canary-20251221114240 → 0.0.0-canary-20251221144710

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/_virtual/rolldown_runtime.js +37 -0
  2. package/dist/app-config/contracts.d.ts +56 -55
  3. package/dist/app-config/contracts.js +5 -4
  4. package/dist/app-config/docs/app-config.docblock.js +0 -1
  5. package/dist/app-config/events.d.ts +27 -27
  6. package/dist/app-config/lifecycle-contracts.d.ts +83 -82
  7. package/dist/app-config/lifecycle-contracts.js +2 -1
  8. package/dist/app-config/runtime.d.ts +4 -2
  9. package/dist/app-config/spec.d.ts +2 -1
  10. package/dist/app-config/validation.d.ts +4 -2
  11. package/dist/{capabilities.d.ts → capabilities/capabilities.d.ts} +3 -3
  12. package/dist/{capabilities.js → capabilities/capabilities.js} +1 -1
  13. package/dist/capabilities/docs/capabilities.docblock.js +0 -1
  14. package/dist/capabilities/index.d.ts +3 -0
  15. package/dist/capabilities/index.js +4 -0
  16. package/dist/capabilities/openbanking.d.ts +2 -1
  17. package/dist/client/react/feature-render.d.ts +3 -1
  18. package/dist/client/react/feature-render.js +2 -1
  19. package/dist/client/react/form-render.d.ts +1 -1
  20. package/dist/client/react/form-render.js +1 -1
  21. package/dist/{data-views.d.ts → data-views/data-views.d.ts} +15 -4
  22. package/dist/data-views/data-views.js +61 -0
  23. package/dist/data-views/docs/data-views.docblock.js +0 -1
  24. package/dist/data-views/index.d.ts +4 -0
  25. package/dist/data-views/index.js +5 -0
  26. package/dist/data-views/query-generator.d.ts +2 -1
  27. package/dist/data-views/runtime.d.ts +2 -1
  28. package/dist/docs/presentations.d.ts +3 -2
  29. package/dist/docs/registry.d.ts +3 -2
  30. package/dist/docs/tech/llm/llm-integration.docblock.js +2 -2
  31. package/dist/experiments/docs/experiments.docblock.js +0 -1
  32. package/dist/experiments/spec-resolver.d.ts +2 -1
  33. package/dist/features.d.ts +19 -5
  34. package/dist/features.js +26 -0
  35. package/dist/forms/docs/forms.docblock.js +0 -1
  36. package/dist/{forms.d.ts → forms/forms.d.ts} +13 -2
  37. package/dist/{forms.js → forms/forms.js} +27 -1
  38. package/dist/forms/index.d.ts +2 -0
  39. package/dist/forms/index.js +3 -0
  40. package/dist/index.d.ts +20 -13
  41. package/dist/index.js +24 -15
  42. package/dist/install.d.ts +3 -2
  43. package/dist/install.js +1 -1
  44. package/dist/integrations/docs/integrations.docblock.js +0 -1
  45. package/dist/integrations/openbanking/contracts/accounts.d.ts +69 -68
  46. package/dist/integrations/openbanking/contracts/accounts.js +2 -1
  47. package/dist/integrations/openbanking/contracts/balances.d.ts +37 -36
  48. package/dist/integrations/openbanking/contracts/balances.js +2 -1
  49. package/dist/integrations/openbanking/contracts/index.d.ts +1 -1
  50. package/dist/integrations/openbanking/contracts/transactions.d.ts +51 -50
  51. package/dist/integrations/openbanking/contracts/transactions.js +2 -1
  52. package/dist/integrations/openbanking/models.d.ts +55 -55
  53. package/dist/integrations/operations.d.ts +437 -0
  54. package/dist/integrations/{contracts.js → operations.js} +3 -2
  55. package/dist/integrations/spec.d.ts +2 -1
  56. package/dist/jsonschema.d.ts +5 -4
  57. package/dist/knowledge/docs/knowledge.docblock.js +0 -1
  58. package/dist/knowledge/{contracts.d.ts → operations.d.ts} +70 -69
  59. package/dist/knowledge/{contracts.js → operations.js} +3 -2
  60. package/dist/llm/exporters.d.ts +10 -8
  61. package/dist/llm/exporters.js +11 -10
  62. package/dist/llm/index.d.ts +2 -2
  63. package/dist/llm/index.js +2 -2
  64. package/dist/llm/prompts.d.ts +2 -1
  65. package/dist/llm/prompts.js +8 -8
  66. package/dist/llm/types.d.ts +3 -2
  67. package/dist/markdown.d.ts +5 -4
  68. package/dist/markdown.js +6 -5
  69. package/dist/onboarding-base.d.ts +31 -30
  70. package/dist/onboarding-base.js +2 -1
  71. package/dist/openapi.d.ts +1 -1
  72. package/dist/operations/index.d.ts +3 -0
  73. package/dist/operations/index.js +4 -0
  74. package/dist/{operation.d.ts → operations/operation.d.ts} +7 -7
  75. package/dist/{operation.js → operations/operation.js} +1 -1
  76. package/dist/{registry.d.ts → operations/registry.d.ts} +38 -6
  77. package/dist/{registry.js → operations/registry.js} +59 -4
  78. package/dist/policy/docs/policy.docblock.js +0 -1
  79. package/dist/presentations/docs/presentations-conventions.docblock.js +0 -1
  80. package/dist/presentations/index.d.ts +4 -0
  81. package/dist/presentations/index.js +4 -0
  82. package/dist/{presentations.d.ts → presentations/presentations.d.ts} +16 -5
  83. package/dist/{presentations.js → presentations/presentations.js} +26 -1
  84. package/dist/presentations/presentations.v2.d.ts +54 -0
  85. package/dist/{presentations.v2.d.ts → presentations/transform-engine.d.ts} +3 -51
  86. package/dist/{presentations.v2.js → presentations/transform-engine.js} +2 -2
  87. package/dist/regenerator/docs/regenerator.docblock.js +0 -1
  88. package/dist/registry-utils.d.ts +107 -0
  89. package/dist/registry-utils.js +122 -0
  90. package/dist/{contracts-adapter-hydration.d.ts → server/contracts-adapter-hydration.d.ts} +2 -2
  91. package/dist/{contracts-adapter-hydration.js → server/contracts-adapter-hydration.js} +1 -1
  92. package/dist/{contracts-adapter-input.d.ts → server/contracts-adapter-input.d.ts} +2 -3
  93. package/dist/{contracts-adapter-input.js → server/contracts-adapter-input.js} +2 -2
  94. package/dist/server/graphql-pothos.d.ts +1 -1
  95. package/dist/server/graphql-pothos.js +2 -2
  96. package/dist/server/mcp/createMcpServer.d.ts +1 -1
  97. package/dist/server/mcp/mcpTypes.d.ts +3 -2
  98. package/dist/server/mcp/registerPresentations.js +3 -2
  99. package/dist/server/mcp/registerTools.d.ts +1 -1
  100. package/dist/server/rest-elysia.d.ts +1 -1
  101. package/dist/server/rest-express.d.ts +1 -1
  102. package/dist/server/rest-generic.d.ts +1 -1
  103. package/dist/server/rest-next-app.d.ts +1 -1
  104. package/dist/server/rest-next-mcp.d.ts +1 -1
  105. package/dist/server/rest-next-pages.d.ts +1 -1
  106. package/dist/telemetry/docs/telemetry.docblock.js +0 -1
  107. package/dist/tests/runner.d.ts +1 -1
  108. package/dist/tests/spec.d.ts +1 -1
  109. package/dist/workflow/spec.d.ts +13 -2
  110. package/dist/workflow/spec.js +26 -0
  111. package/dist/workflow/validation.d.ts +2 -2
  112. package/dist/workspace-config/contractsrc-schema.d.ts +112 -2
  113. package/dist/workspace-config/contractsrc-schema.js +28 -3
  114. package/package.json +23 -19
  115. package/dist/data-views.js +0 -35
  116. package/dist/integrations/contracts.d.ts +0 -436
  117. package/dist/openbanking/docs/openbanking.docblock.d.ts +0 -6
  118. package/dist/openbanking/docs/openbanking.docblock.js +0 -22
  119. package/dist/presentations.backcompat.d.ts +0 -7
  120. package/dist/presentations.backcompat.js +0 -47
  121. package/dist/types/all.d.ts +0 -60
  122. /package/dist/{types/all.js → presentations/presentations.v2.js} +0 -0
package/dist/markdown.js CHANGED
@@ -1,13 +1,14 @@
1
- import { isEmitDeclRef } from "./operation.js";
1
+ import { isEmitDeclRef } from "./operations/operation.js";
2
+ import "./operations/index.js";
2
3
 
3
4
  //#region src/markdown.ts
4
5
  /**
5
6
  * Render simple Markdown docs for each spec.
6
7
  * Useful for dev portals and repo docs generation.
7
8
  */
8
- function specsToMarkdown(reg, _extras) {
9
+ function operationsToMarkdown(registry, _extras) {
9
10
  const lines = [];
10
- for (const spec of reg.listSpecs()) {
11
+ for (const spec of registry.listSpecs()) {
11
12
  const m = spec.meta;
12
13
  lines.push(`# ${m.name}.v${m.version}`);
13
14
  lines.push("");
@@ -72,7 +73,7 @@ function specsToMarkdown(reg, _extras) {
72
73
  /** Render presentations and features as additional sections. */
73
74
  function docsToMarkdown(reg, extras) {
74
75
  const parts = [];
75
- parts.push(specsToMarkdown(reg, extras));
76
+ parts.push(operationsToMarkdown(reg, extras));
76
77
  if (extras.presentations) {
77
78
  parts.push("# Presentations");
78
79
  parts.push("");
@@ -113,4 +114,4 @@ function docsToMarkdown(reg, extras) {
113
114
  }
114
115
 
115
116
  //#endregion
116
- export { docsToMarkdown, specsToMarkdown };
117
+ export { docsToMarkdown, operationsToMarkdown };
@@ -1,135 +1,136 @@
1
- import { OperationSpec } from "./operation.js";
2
- import * as _lssm_lib_schema61 from "@lssm/lib.schema";
1
+ import { OperationSpec } from "./operations/operation.js";
2
+ import "./index.js";
3
+ import * as _lssm_lib_schema7 from "@lssm/lib.schema";
3
4
  import { SchemaModel } from "@lssm/lib.schema";
4
5
 
5
6
  //#region src/onboarding-base.d.ts
6
7
  /** Save/update onboarding draft (auto-save during flow) */
7
8
  declare const SaveOnboardingDraftInput: SchemaModel<{
8
9
  data: {
9
- type: _lssm_lib_schema61.FieldType<unknown, unknown>;
10
+ type: _lssm_lib_schema7.FieldType<unknown, unknown>;
10
11
  isOptional: false;
11
12
  };
12
13
  }>;
13
14
  declare const SaveOnboardingDraftOutput: SchemaModel<{
14
15
  id: {
15
- type: _lssm_lib_schema61.FieldType<string, string>;
16
+ type: _lssm_lib_schema7.FieldType<string, string>;
16
17
  isOptional: false;
17
18
  };
18
19
  organizationId: {
19
- type: _lssm_lib_schema61.FieldType<string, string>;
20
+ type: _lssm_lib_schema7.FieldType<string, string>;
20
21
  isOptional: false;
21
22
  };
22
23
  }>;
23
24
  declare const SaveOnboardingDraftBaseSpec: OperationSpec<SchemaModel<{
24
25
  data: {
25
- type: _lssm_lib_schema61.FieldType<unknown, unknown>;
26
+ type: _lssm_lib_schema7.FieldType<unknown, unknown>;
26
27
  isOptional: false;
27
28
  };
28
29
  }>, SchemaModel<{
29
30
  id: {
30
- type: _lssm_lib_schema61.FieldType<string, string>;
31
+ type: _lssm_lib_schema7.FieldType<string, string>;
31
32
  isOptional: false;
32
33
  };
33
34
  organizationId: {
34
- type: _lssm_lib_schema61.FieldType<string, string>;
35
+ type: _lssm_lib_schema7.FieldType<string, string>;
35
36
  isOptional: false;
36
37
  };
37
38
  }>, undefined>;
38
39
  /** Get current onboarding draft (on mount/restore) */
39
40
  declare const GetOnboardingDraftOutput: SchemaModel<{
40
41
  id: {
41
- type: _lssm_lib_schema61.FieldType<string, string>;
42
+ type: _lssm_lib_schema7.FieldType<string, string>;
42
43
  isOptional: true;
43
44
  };
44
45
  organizationId: {
45
- type: _lssm_lib_schema61.FieldType<string, string>;
46
+ type: _lssm_lib_schema7.FieldType<string, string>;
46
47
  isOptional: true;
47
48
  };
48
49
  data: {
49
- type: _lssm_lib_schema61.FieldType<unknown, unknown>;
50
+ type: _lssm_lib_schema7.FieldType<unknown, unknown>;
50
51
  isOptional: true;
51
52
  };
52
53
  createdAt: {
53
- type: _lssm_lib_schema61.FieldType<Date, string>;
54
+ type: _lssm_lib_schema7.FieldType<Date, string>;
54
55
  isOptional: true;
55
56
  };
56
57
  updatedAt: {
57
- type: _lssm_lib_schema61.FieldType<Date, string>;
58
+ type: _lssm_lib_schema7.FieldType<Date, string>;
58
59
  isOptional: true;
59
60
  };
60
61
  }>;
61
- declare const GetOnboardingDraftBaseSpec: OperationSpec<_lssm_lib_schema61.AnySchemaModel, SchemaModel<{
62
+ declare const GetOnboardingDraftBaseSpec: OperationSpec<_lssm_lib_schema7.AnySchemaModel, SchemaModel<{
62
63
  id: {
63
- type: _lssm_lib_schema61.FieldType<string, string>;
64
+ type: _lssm_lib_schema7.FieldType<string, string>;
64
65
  isOptional: true;
65
66
  };
66
67
  organizationId: {
67
- type: _lssm_lib_schema61.FieldType<string, string>;
68
+ type: _lssm_lib_schema7.FieldType<string, string>;
68
69
  isOptional: true;
69
70
  };
70
71
  data: {
71
- type: _lssm_lib_schema61.FieldType<unknown, unknown>;
72
+ type: _lssm_lib_schema7.FieldType<unknown, unknown>;
72
73
  isOptional: true;
73
74
  };
74
75
  createdAt: {
75
- type: _lssm_lib_schema61.FieldType<Date, string>;
76
+ type: _lssm_lib_schema7.FieldType<Date, string>;
76
77
  isOptional: true;
77
78
  };
78
79
  updatedAt: {
79
- type: _lssm_lib_schema61.FieldType<Date, string>;
80
+ type: _lssm_lib_schema7.FieldType<Date, string>;
80
81
  isOptional: true;
81
82
  };
82
83
  }>, undefined>;
83
84
  /** Delete onboarding draft (cleanup after completion or cancel) */
84
85
  declare const DeleteOnboardingDraftOutput: SchemaModel<{
85
86
  ok: {
86
- type: _lssm_lib_schema61.FieldType<boolean, boolean>;
87
+ type: _lssm_lib_schema7.FieldType<boolean, boolean>;
87
88
  isOptional: false;
88
89
  };
89
90
  }>;
90
- declare const DeleteOnboardingDraftBaseSpec: OperationSpec<_lssm_lib_schema61.AnySchemaModel, SchemaModel<{
91
+ declare const DeleteOnboardingDraftBaseSpec: OperationSpec<_lssm_lib_schema7.AnySchemaModel, SchemaModel<{
91
92
  ok: {
92
- type: _lssm_lib_schema61.FieldType<boolean, boolean>;
93
+ type: _lssm_lib_schema7.FieldType<boolean, boolean>;
93
94
  isOptional: false;
94
95
  };
95
96
  }>, undefined>;
96
97
  /** Complete onboarding (final submit, creates entities) */
97
98
  declare const CompleteOnboardingBaseInput: SchemaModel<{
98
99
  data: {
99
- type: _lssm_lib_schema61.FieldType<unknown, unknown>;
100
+ type: _lssm_lib_schema7.FieldType<unknown, unknown>;
100
101
  isOptional: false;
101
102
  };
102
103
  }>;
103
104
  declare const CompleteOnboardingBaseOutput: SchemaModel<{
104
105
  success: {
105
- type: _lssm_lib_schema61.FieldType<boolean, boolean>;
106
+ type: _lssm_lib_schema7.FieldType<boolean, boolean>;
106
107
  isOptional: false;
107
108
  };
108
109
  userId: {
109
- type: _lssm_lib_schema61.FieldType<string, string>;
110
+ type: _lssm_lib_schema7.FieldType<string, string>;
110
111
  isOptional: true;
111
112
  };
112
113
  organizationId: {
113
- type: _lssm_lib_schema61.FieldType<string, string>;
114
+ type: _lssm_lib_schema7.FieldType<string, string>;
114
115
  isOptional: true;
115
116
  };
116
117
  }>;
117
118
  declare const CompleteOnboardingBaseSpec: OperationSpec<SchemaModel<{
118
119
  data: {
119
- type: _lssm_lib_schema61.FieldType<unknown, unknown>;
120
+ type: _lssm_lib_schema7.FieldType<unknown, unknown>;
120
121
  isOptional: false;
121
122
  };
122
123
  }>, SchemaModel<{
123
124
  success: {
124
- type: _lssm_lib_schema61.FieldType<boolean, boolean>;
125
+ type: _lssm_lib_schema7.FieldType<boolean, boolean>;
125
126
  isOptional: false;
126
127
  };
127
128
  userId: {
128
- type: _lssm_lib_schema61.FieldType<string, string>;
129
+ type: _lssm_lib_schema7.FieldType<string, string>;
129
130
  isOptional: true;
130
131
  };
131
132
  organizationId: {
132
- type: _lssm_lib_schema61.FieldType<string, string>;
133
+ type: _lssm_lib_schema7.FieldType<string, string>;
133
134
  isOptional: true;
134
135
  };
135
136
  }>, undefined>;
@@ -1,6 +1,7 @@
1
1
  import { E5, x8 } from "./schema/dist/index.js";
2
- import { defineCommand, defineQuery } from "./operation.js";
3
2
  import { OwnersEnum, StabilityEnum } from "./ownership.js";
3
+ import { defineCommand, defineQuery } from "./operations/operation.js";
4
+ import "./operations/index.js";
4
5
 
5
6
  //#region src/onboarding-base.ts
6
7
  /**
package/dist/openapi.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { OperationSpecRegistry } from "./registry.js";
1
+ import { OperationSpecRegistry } from "./operations/registry.js";
2
2
 
3
3
  //#region src/openapi.d.ts
4
4
 
@@ -0,0 +1,3 @@
1
+ import { AnyOperationSpec, EmitDecl, EmitDeclInline, EmitDeclRef, ImplementationRef, ImplementationType, OpKind, OperationSpec, TelemetryTrigger, defineCommand, defineQuery, isEmitDeclRef } from "./operation.js";
2
+ import { OperationKey, OperationSpecRegistry, opKey } from "./registry.js";
3
+ export { AnyOperationSpec, EmitDecl, EmitDeclInline, EmitDeclRef, ImplementationRef, ImplementationType, OpKind, OperationKey, OperationSpec, OperationSpecRegistry, TelemetryTrigger, defineCommand, defineQuery, isEmitDeclRef, opKey };
@@ -0,0 +1,4 @@
1
+ import { defineCommand, defineQuery, isEmitDeclRef } from "./operation.js";
2
+ import { OperationSpecRegistry, opKey } from "./registry.js";
3
+
4
+ export { OperationSpecRegistry, defineCommand, defineQuery, isEmitDeclRef, opKey };
@@ -1,12 +1,12 @@
1
- import { Owner, Stability, Tag } from "./ownership.js";
2
- import { DocId } from "./docs/registry.js";
3
- import { EventSpec } from "./events.js";
4
- import { ResourceRefDescriptor } from "./resources.js";
5
- import { PolicyRef } from "./policy/spec.js";
6
- import { TestSpecRef } from "./tests/spec.js";
1
+ import { Owner, Stability, Tag } from "../ownership.js";
2
+ import { DocId } from "../docs/registry.js";
3
+ import { EventSpec } from "../events.js";
4
+ import { ResourceRefDescriptor } from "../resources.js";
5
+ import { PolicyRef } from "../policy/spec.js";
6
+ import { TestSpecRef } from "../tests/spec.js";
7
7
  import { AnySchemaModel } from "@lssm/lib.schema";
8
8
 
9
- //#region src/operation.d.ts
9
+ //#region src/operations/operation.d.ts
10
10
 
11
11
  /**
12
12
  * Distinguishes between state-changing operations (command) and read-only operations (query).
@@ -1,4 +1,4 @@
1
- //#region src/operation.ts
1
+ //#region src/operations/operation.ts
2
2
  const isEmitDeclRef = (e) => "ref" in e;
3
3
  /**
4
4
  * Helper to define a Command (write operation).
@@ -1,11 +1,11 @@
1
- import { defaultDocRegistry, docId, registerDocBlocks } from "./docs/registry.js";
2
- import { ResourceRefDescriptor } from "./resources.js";
1
+ import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
2
+ import { ResourceRefDescriptor } from "../resources.js";
3
3
  import { AnyOperationSpec, OperationSpec } from "./operation.js";
4
- import { HandlerCtx } from "./types.js";
5
- import { HandlerForOperationSpec } from "./install.js";
4
+ import { HandlerCtx } from "../types.js";
5
+ import { HandlerForOperationSpec } from "../install.js";
6
6
  import { AnySchemaModel } from "@lssm/lib.schema";
7
7
 
8
- //#region src/registry.d.ts
8
+ //#region src/operations/registry.d.ts
9
9
 
10
10
  type OperationKey = `${string}.v${number}`;
11
11
  declare function opKey(name: string, version: number): OperationKey;
@@ -53,6 +53,38 @@ declare class OperationSpecRegistry {
53
53
  spec: AnyOperationSpec;
54
54
  handler: AnyOperationHandler;
55
55
  }[];
56
+ /**
57
+ * Filter specs by criteria.
58
+ */
59
+ filter(criteria: RegistryFilter): AnyOperationSpec[];
60
+ /**
61
+ * List specs with specific tag.
62
+ */
63
+ listByTag(tag: string): AnyOperationSpec[];
64
+ /**
65
+ * List specs by owner.
66
+ */
67
+ listByOwner(owner: string): AnyOperationSpec[];
68
+ /**
69
+ * Group specs by key function.
70
+ */
71
+ groupBy(keyFn: GroupKeyFn<AnyOperationSpec>): Map<string, AnyOperationSpec[]>;
72
+ /**
73
+ * Group by domain (first segment of name).
74
+ */
75
+ groupByDomain(): Map<string, AnyOperationSpec[]>;
76
+ /**
77
+ * Group by tag.
78
+ */
79
+ groupByTag(): Map<string, AnyOperationSpec[]>;
80
+ /**
81
+ * Get unique tags from all specs.
82
+ */
83
+ getUniqueTags(): string[];
84
+ /**
85
+ * Get unique owners from all specs.
86
+ */
87
+ getUniqueOwners(): string[];
56
88
  /**
57
89
  * Execute an operation by name/version with full runtime protections:
58
90
  * 1. Validates input against Zod schema.
@@ -69,4 +101,4 @@ declare class OperationSpecRegistry {
69
101
  execute(name: string, version: number | undefined, rawInput: unknown, ctx: HandlerCtx): Promise<unknown>;
70
102
  }
71
103
  //#endregion
72
- export { OperationKey, OperationSpecRegistry, defaultDocRegistry, docId, opKey, registerDocBlocks };
104
+ export { OperationKey, OperationSpecRegistry, opKey };
@@ -1,8 +1,9 @@
1
- import { eventKey } from "./events.js";
1
+ import { __toCommonJS } from "../_virtual/rolldown_runtime.js";
2
+ import { eventKey } from "../events.js";
3
+ import { init_registry_utils, registry_utils_exports } from "../registry-utils.js";
2
4
  import { isEmitDeclRef } from "./operation.js";
3
- import { defaultDocRegistry, docId, registerDocBlocks } from "./docs/registry.js";
4
5
 
5
- //#region src/registry.ts
6
+ //#region src/operations/registry.ts
6
7
  /**
7
8
  * OperationSpecRegistry:
8
9
  * - Registers ContractSpecs (unique by name+version)
@@ -94,6 +95,60 @@ var OperationSpecRegistry = class {
94
95
  return out;
95
96
  }
96
97
  /**
98
+ * Filter specs by criteria.
99
+ */
100
+ filter(criteria) {
101
+ const { filterBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
102
+ return filterBy(this.listSpecs(), criteria);
103
+ }
104
+ /**
105
+ * List specs with specific tag.
106
+ */
107
+ listByTag(tag) {
108
+ return this.listSpecs().filter((s) => s.meta.tags?.includes(tag));
109
+ }
110
+ /**
111
+ * List specs by owner.
112
+ */
113
+ listByOwner(owner) {
114
+ return this.listSpecs().filter((s) => s.meta.owners?.includes(owner));
115
+ }
116
+ /**
117
+ * Group specs by key function.
118
+ */
119
+ groupBy(keyFn) {
120
+ const { groupBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
121
+ return groupBy(this.listSpecs(), keyFn);
122
+ }
123
+ /**
124
+ * Group by domain (first segment of name).
125
+ */
126
+ groupByDomain() {
127
+ const { GroupingStrategies } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
128
+ return this.groupBy(GroupingStrategies.byDomain);
129
+ }
130
+ /**
131
+ * Group by tag.
132
+ */
133
+ groupByTag() {
134
+ const { GroupingStrategies } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
135
+ return this.groupBy(GroupingStrategies.byTag);
136
+ }
137
+ /**
138
+ * Get unique tags from all specs.
139
+ */
140
+ getUniqueTags() {
141
+ const { getUniqueTags } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
142
+ return getUniqueTags(this.listSpecs());
143
+ }
144
+ /**
145
+ * Get unique owners from all specs.
146
+ */
147
+ getUniqueOwners() {
148
+ const { getUniqueOwners } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
149
+ return getUniqueOwners(this.listSpecs());
150
+ }
151
+ /**
97
152
  * Execute an operation by name/version with full runtime protections:
98
153
  * 1. Validates input against Zod schema.
99
154
  * 2. Enforces policy (Auth, RBAC, Rate Limits) via PDP.
@@ -206,4 +261,4 @@ var OperationSpecRegistry = class {
206
261
  };
207
262
 
208
263
  //#endregion
209
- export { OperationSpecRegistry, defaultDocRegistry, docId, opKey, registerDocBlocks };
264
+ export { OperationSpecRegistry, opKey };
@@ -1,5 +1,4 @@
1
1
  import { registerDocBlocks } from "../../docs/registry.js";
2
- import "../../registry.js";
3
2
 
4
3
  //#region src/policy/docs/policy.docblock.ts
5
4
  const tech_contracts_policy_DocBlocks = [{
@@ -1,5 +1,4 @@
1
1
  import { registerDocBlocks } from "../../docs/registry.js";
2
- import "../../registry.js";
3
2
 
4
3
  //#region src/presentations/docs/presentations-conventions.docblock.ts
5
4
  const tech_contracts_presentations_conventions_DocBlocks = [{
@@ -0,0 +1,4 @@
1
+ import { PresentationDescriptorV2, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationTarget, PresentationV2Meta } from "./presentations.v2.js";
2
+ import { ComponentMap, PresentationRenderer, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer } from "./transform-engine.js";
3
+ import { DataPresentation, MarkdownPresentation, PresentationContent, PresentationKind, PresentationMeta, PresentationPolicy, PresentationRegistry, PresentationSpec, WebComponentPresentation, jsonSchemaForPresentation } from "./presentations.js";
4
+ export { ComponentMap, DataPresentation, MarkdownPresentation, PresentationContent, PresentationDescriptorV2, PresentationKind, PresentationMeta, PresentationPolicy, PresentationRegistry, PresentationRenderer, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationSpec, PresentationTarget, PresentationV2Meta, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, WebComponentPresentation, createDefaultTransformEngine, jsonSchemaForPresentation, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
@@ -0,0 +1,4 @@
1
+ import { TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer } from "./transform-engine.js";
2
+ import { PresentationRegistry, jsonSchemaForPresentation } from "./presentations.js";
3
+
4
+ export { PresentationRegistry, TransformEngine, createDefaultTransformEngine, jsonSchemaForPresentation, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
@@ -1,9 +1,10 @@
1
- import { Stability } from "./ownership.js";
1
+ import { Stability } from "../ownership.js";
2
+ import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
2
3
  import z from "zod";
3
- import * as _lssm_lib_schema234 from "@lssm/lib.schema";
4
+ import * as _lssm_lib_schema154 from "@lssm/lib.schema";
4
5
  import { AnySchemaModel } from "@lssm/lib.schema";
5
6
 
6
- //#region src/presentations.d.ts
7
+ //#region src/presentations/presentations.d.ts
7
8
  /** V1 presentation kinds (back-compat). Prefer V2 descriptors for new work. */
8
9
  type PresentationKind = 'web_component' | 'markdown' | 'data';
9
10
  /** Minimal metadata for presentations (V1). */
@@ -58,11 +59,21 @@ declare class PresentationRegistry {
58
59
  register(p: PresentationSpec): this;
59
60
  list(): PresentationSpec[];
60
61
  get(name: string, version?: number): PresentationSpec | undefined;
62
+ /** Filter presentations by criteria. */
63
+ filter(criteria: RegistryFilter): PresentationSpec[];
64
+ /** List presentations with specific tag. */
65
+ listByTag(tag: string): PresentationSpec[];
66
+ /** List presentations by owner. */
67
+ listByOwner(owner: string): PresentationSpec[];
68
+ /** Group presentations by key function. */
69
+ groupBy(keyFn: GroupKeyFn<PresentationSpec>): Map<string, PresentationSpec[]>;
70
+ /** Get unique tags from all presentations. */
71
+ getUniqueTags(): string[];
61
72
  }
62
73
  declare function jsonSchemaForPresentation(p: PresentationSpec): {
63
74
  framework: "react";
64
75
  componentKey: string;
65
- props: z.core.ZodStandardJSONSchemaPayload<_lssm_lib_schema234.TopLevelZodFromModel<_lssm_lib_schema234.SchemaModelFieldsAnyConfig<AnySchemaModel | _lssm_lib_schema234.AnyFieldType | _lssm_lib_schema234.AnyEnumType>>>;
76
+ props: z.core.ZodStandardJSONSchemaPayload<_lssm_lib_schema154.TopLevelZodFromModel<_lssm_lib_schema154.SchemaModelFieldsAnyConfig<AnySchemaModel | _lssm_lib_schema154.AnyFieldType | _lssm_lib_schema154.AnyEnumType>>>;
66
77
  meta: {
67
78
  readonly name: string;
68
79
  readonly version: number;
@@ -84,7 +95,7 @@ declare function jsonSchemaForPresentation(p: PresentationSpec): {
84
95
  kind: PresentationKind;
85
96
  } | {
86
97
  mimeType: string;
87
- model: z.core.ZodStandardJSONSchemaPayload<_lssm_lib_schema234.TopLevelZodFromModel<_lssm_lib_schema234.SchemaModelFieldsAnyConfig<AnySchemaModel | _lssm_lib_schema234.AnyFieldType | _lssm_lib_schema234.AnyEnumType>>>;
98
+ model: z.core.ZodStandardJSONSchemaPayload<_lssm_lib_schema154.TopLevelZodFromModel<_lssm_lib_schema154.SchemaModelFieldsAnyConfig<AnySchemaModel | _lssm_lib_schema154.AnyFieldType | _lssm_lib_schema154.AnyEnumType>>>;
88
99
  meta: {
89
100
  readonly name: string;
90
101
  readonly version: number;
@@ -1,6 +1,8 @@
1
+ import { __toCommonJS } from "../_virtual/rolldown_runtime.js";
2
+ import { init_registry_utils, registry_utils_exports } from "../registry-utils.js";
1
3
  import z from "zod";
2
4
 
3
- //#region src/presentations.ts
5
+ //#region src/presentations/presentations.ts
4
6
  function keyOf(p) {
5
7
  return `${p.meta.name}.v${p.meta.version}`;
6
8
  }
@@ -32,6 +34,29 @@ var PresentationRegistry = class {
32
34
  }
33
35
  return candidate;
34
36
  }
37
+ /** Filter presentations by criteria. */
38
+ filter(criteria) {
39
+ const { filterBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
40
+ return filterBy(this.list(), criteria);
41
+ }
42
+ /** List presentations with specific tag. */
43
+ listByTag(tag) {
44
+ return this.list().filter((p) => p.meta.tags?.includes(tag));
45
+ }
46
+ /** List presentations by owner. */
47
+ listByOwner(owner) {
48
+ return this.list().filter((p) => p.meta.owners?.includes(owner));
49
+ }
50
+ /** Group presentations by key function. */
51
+ groupBy(keyFn) {
52
+ const { groupBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
53
+ return groupBy(this.list(), keyFn);
54
+ }
55
+ /** Get unique tags from all presentations. */
56
+ getUniqueTags() {
57
+ const { getUniqueTags } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
58
+ return getUniqueTags(this.list());
59
+ }
35
60
  };
36
61
  function jsonSchemaForPresentation(p) {
37
62
  const base = {
@@ -0,0 +1,54 @@
1
+ import { OwnerShipMeta } from "../ownership.js";
2
+ import { DocId } from "../docs/registry.js";
3
+ import { AnySchemaModel } from "@lssm/lib.schema";
4
+ import { BlockConfig } from "@blocknote/core";
5
+
6
+ //#region src/presentations/presentations.v2.d.ts
7
+ /** Supported render targets for the transform engine and descriptors. */
8
+ type PresentationTarget = 'react' | 'markdown' | 'application/json' | 'application/xml';
9
+ interface PresentationV2Meta extends Partial<OwnerShipMeta> {
10
+ /** Fully-qualified presentation name (e.g., "sigil.auth.webauth_tabs_v2"). */
11
+ name: string;
12
+ /** Version of this descriptor. Increment on breaking changes. */
13
+ version: number;
14
+ /** Human-readable description for docs/a11y. Required by validators. */
15
+ description?: string;
16
+ /** Optional doc block id for this presentation. */
17
+ docId?: DocId;
18
+ }
19
+ /** React component presentation source. */
20
+ interface PresentationSourceComponentReact {
21
+ /** Source marker for React component presentations. */
22
+ type: 'component';
23
+ /** Framework for the component source (currently only 'react'). */
24
+ framework: 'react';
25
+ /** Component key resolved by host `componentMap`. */
26
+ componentKey: string;
27
+ /** Optional props schema to validate against. */
28
+ props?: AnySchemaModel;
29
+ }
30
+ /** BlockNoteJS document presentation source. */
31
+ interface PresentationSourceBlocknotejs {
32
+ /** Source marker for BlockNoteJS document presentations. */
33
+ type: 'blocknotejs';
34
+ /** BlockNoteJS JSON document. */
35
+ docJson: unknown;
36
+ /** Optional BlockNote config to guide rendering. */
37
+ blockConfig?: BlockConfig;
38
+ }
39
+ type PresentationSource = PresentationSourceComponentReact | PresentationSourceBlocknotejs;
40
+ /**
41
+ * Normalized presentation descriptor decoupled from framework/adapters.
42
+ * Renderers and validators are provided via TransformEngine.
43
+ */
44
+ interface PresentationDescriptorV2 {
45
+ meta: PresentationV2Meta;
46
+ policy?: {
47
+ flags?: string[];
48
+ pii?: string[];
49
+ };
50
+ source: PresentationSource;
51
+ targets: PresentationTarget[];
52
+ }
53
+ //#endregion
54
+ export { PresentationDescriptorV2, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationTarget, PresentationV2Meta };
@@ -1,56 +1,8 @@
1
- import { OwnerShipMeta } from "./ownership.js";
2
- import { DocId } from "./docs/registry.js";
1
+ import { PresentationDescriptorV2, PresentationTarget } from "./presentations.v2.js";
3
2
  import React from "react";
4
- import { AnySchemaModel } from "@lssm/lib.schema";
5
3
  import { BlockConfig } from "@blocknote/core";
6
4
 
7
- //#region src/presentations.v2.d.ts
8
- /** Supported render targets for the transform engine and descriptors. */
9
- type PresentationTarget = 'react' | 'markdown' | 'application/json' | 'application/xml';
10
- interface PresentationV2Meta extends Partial<OwnerShipMeta> {
11
- /** Fully-qualified presentation name (e.g., "sigil.auth.webauth_tabs_v2"). */
12
- name: string;
13
- /** Version of this descriptor. Increment on breaking changes. */
14
- version: number;
15
- /** Human-readable description for docs/a11y. Required by validators. */
16
- description?: string;
17
- /** Optional doc block id for this presentation. */
18
- docId?: DocId;
19
- }
20
- /** React component presentation source. */
21
- interface PresentationSourceComponentReact {
22
- /** Source marker for React component presentations. */
23
- type: 'component';
24
- /** Framework for the component source (currently only 'react'). */
25
- framework: 'react';
26
- /** Component key resolved by host `componentMap`. */
27
- componentKey: string;
28
- /** Optional props schema to validate against. */
29
- props?: AnySchemaModel;
30
- }
31
- /** BlockNoteJS document presentation source. */
32
- interface PresentationSourceBlocknotejs {
33
- /** Source marker for BlockNoteJS document presentations. */
34
- type: 'blocknotejs';
35
- /** BlockNoteJS JSON document. */
36
- docJson: unknown;
37
- /** Optional BlockNote config to guide rendering. */
38
- blockConfig?: BlockConfig;
39
- }
40
- type PresentationSource = PresentationSourceComponentReact | PresentationSourceBlocknotejs;
41
- /**
42
- * Normalized presentation descriptor decoupled from framework/adapters.
43
- * Renderers and validators are provided via TransformEngine.
44
- */
45
- interface PresentationDescriptorV2 {
46
- meta: PresentationV2Meta;
47
- policy?: {
48
- flags?: string[];
49
- pii?: string[];
50
- };
51
- source: PresentationSource;
52
- targets: PresentationTarget[];
53
- }
5
+ //#region src/presentations/transform-engine.d.ts
54
6
  interface RenderContext {
55
7
  /** Optional locale hint (i18n). */
56
8
  locale?: string;
@@ -111,4 +63,4 @@ type ComponentMap = Record<string, React.ComponentType<any>>;
111
63
  */
112
64
  declare function registerReactToMarkdownRenderer(engine: TransformEngine, componentMap: ComponentMap): TransformEngine;
113
65
  //#endregion
114
- export { ComponentMap, PresentationDescriptorV2, PresentationRenderer, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationTarget, PresentationV2Meta, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
66
+ export { ComponentMap, PresentationRenderer, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
@@ -1,8 +1,8 @@
1
- import { schemaToMarkdown } from "./schema-to-markdown.js";
1
+ import { schemaToMarkdown } from "../schema-to-markdown.js";
2
2
  import React from "react";
3
3
  import TurndownService from "turndown";
4
4
 
5
- //#region src/presentations.v2.ts
5
+ //#region src/presentations/transform-engine.ts
6
6
  /**
7
7
  * Pluggable transform engine that renders descriptors to various targets
8
8
  * and runs validators (e.g., basic metadata checks, PII redaction policies).
@@ -1,5 +1,4 @@
1
1
  import { registerDocBlocks } from "../../docs/registry.js";
2
- import "../../registry.js";
3
2
 
4
3
  //#region src/regenerator/docs/regenerator.docblock.ts
5
4
  const tech_contracts_regenerator_DocBlocks = [{