@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.
- package/dist/_virtual/rolldown_runtime.js +37 -0
- package/dist/app-config/contracts.d.ts +56 -55
- package/dist/app-config/contracts.js +5 -4
- package/dist/app-config/docs/app-config.docblock.js +0 -1
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/lifecycle-contracts.d.ts +83 -82
- package/dist/app-config/lifecycle-contracts.js +2 -1
- package/dist/app-config/runtime.d.ts +4 -2
- package/dist/app-config/spec.d.ts +2 -1
- package/dist/app-config/validation.d.ts +4 -2
- package/dist/{capabilities.d.ts → capabilities/capabilities.d.ts} +3 -3
- package/dist/{capabilities.js → capabilities/capabilities.js} +1 -1
- package/dist/capabilities/docs/capabilities.docblock.js +0 -1
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.js +4 -0
- package/dist/capabilities/openbanking.d.ts +2 -1
- package/dist/client/react/feature-render.d.ts +3 -1
- package/dist/client/react/feature-render.js +2 -1
- package/dist/client/react/form-render.d.ts +1 -1
- package/dist/client/react/form-render.js +1 -1
- package/dist/{data-views.d.ts → data-views/data-views.d.ts} +15 -4
- package/dist/data-views/data-views.js +61 -0
- package/dist/data-views/docs/data-views.docblock.js +0 -1
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +5 -0
- package/dist/data-views/query-generator.d.ts +2 -1
- package/dist/data-views/runtime.d.ts +2 -1
- package/dist/docs/presentations.d.ts +3 -2
- package/dist/docs/registry.d.ts +3 -2
- package/dist/docs/tech/llm/llm-integration.docblock.js +2 -2
- package/dist/experiments/docs/experiments.docblock.js +0 -1
- package/dist/experiments/spec-resolver.d.ts +2 -1
- package/dist/features.d.ts +19 -5
- package/dist/features.js +26 -0
- package/dist/forms/docs/forms.docblock.js +0 -1
- package/dist/{forms.d.ts → forms/forms.d.ts} +13 -2
- package/dist/{forms.js → forms/forms.js} +27 -1
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.js +3 -0
- package/dist/index.d.ts +20 -13
- package/dist/index.js +24 -15
- package/dist/install.d.ts +3 -2
- package/dist/install.js +1 -1
- package/dist/integrations/docs/integrations.docblock.js +0 -1
- package/dist/integrations/openbanking/contracts/accounts.d.ts +69 -68
- package/dist/integrations/openbanking/contracts/accounts.js +2 -1
- package/dist/integrations/openbanking/contracts/balances.d.ts +37 -36
- package/dist/integrations/openbanking/contracts/balances.js +2 -1
- package/dist/integrations/openbanking/contracts/index.d.ts +1 -1
- package/dist/integrations/openbanking/contracts/transactions.d.ts +51 -50
- package/dist/integrations/openbanking/contracts/transactions.js +2 -1
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/operations.d.ts +437 -0
- package/dist/integrations/{contracts.js → operations.js} +3 -2
- package/dist/integrations/spec.d.ts +2 -1
- package/dist/jsonschema.d.ts +5 -4
- package/dist/knowledge/docs/knowledge.docblock.js +0 -1
- package/dist/knowledge/{contracts.d.ts → operations.d.ts} +70 -69
- package/dist/knowledge/{contracts.js → operations.js} +3 -2
- package/dist/llm/exporters.d.ts +10 -8
- package/dist/llm/exporters.js +11 -10
- package/dist/llm/index.d.ts +2 -2
- package/dist/llm/index.js +2 -2
- package/dist/llm/prompts.d.ts +2 -1
- package/dist/llm/prompts.js +8 -8
- package/dist/llm/types.d.ts +3 -2
- package/dist/markdown.d.ts +5 -4
- package/dist/markdown.js +6 -5
- package/dist/onboarding-base.d.ts +31 -30
- package/dist/onboarding-base.js +2 -1
- package/dist/openapi.d.ts +1 -1
- package/dist/operations/index.d.ts +3 -0
- package/dist/operations/index.js +4 -0
- package/dist/{operation.d.ts → operations/operation.d.ts} +7 -7
- package/dist/{operation.js → operations/operation.js} +1 -1
- package/dist/{registry.d.ts → operations/registry.d.ts} +38 -6
- package/dist/{registry.js → operations/registry.js} +59 -4
- package/dist/policy/docs/policy.docblock.js +0 -1
- package/dist/presentations/docs/presentations-conventions.docblock.js +0 -1
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +4 -0
- package/dist/{presentations.d.ts → presentations/presentations.d.ts} +16 -5
- package/dist/{presentations.js → presentations/presentations.js} +26 -1
- package/dist/presentations/presentations.v2.d.ts +54 -0
- package/dist/{presentations.v2.d.ts → presentations/transform-engine.d.ts} +3 -51
- package/dist/{presentations.v2.js → presentations/transform-engine.js} +2 -2
- package/dist/regenerator/docs/regenerator.docblock.js +0 -1
- package/dist/registry-utils.d.ts +107 -0
- package/dist/registry-utils.js +122 -0
- package/dist/{contracts-adapter-hydration.d.ts → server/contracts-adapter-hydration.d.ts} +2 -2
- package/dist/{contracts-adapter-hydration.js → server/contracts-adapter-hydration.js} +1 -1
- package/dist/{contracts-adapter-input.d.ts → server/contracts-adapter-input.d.ts} +2 -3
- package/dist/{contracts-adapter-input.js → server/contracts-adapter-input.js} +2 -2
- package/dist/server/graphql-pothos.d.ts +1 -1
- package/dist/server/graphql-pothos.js +2 -2
- package/dist/server/mcp/createMcpServer.d.ts +1 -1
- package/dist/server/mcp/mcpTypes.d.ts +3 -2
- package/dist/server/mcp/registerPresentations.js +3 -2
- package/dist/server/mcp/registerTools.d.ts +1 -1
- package/dist/server/rest-elysia.d.ts +1 -1
- package/dist/server/rest-express.d.ts +1 -1
- package/dist/server/rest-generic.d.ts +1 -1
- package/dist/server/rest-next-app.d.ts +1 -1
- package/dist/server/rest-next-mcp.d.ts +1 -1
- package/dist/server/rest-next-pages.d.ts +1 -1
- package/dist/telemetry/docs/telemetry.docblock.js +0 -1
- package/dist/tests/runner.d.ts +1 -1
- package/dist/tests/spec.d.ts +1 -1
- package/dist/workflow/spec.d.ts +13 -2
- package/dist/workflow/spec.js +26 -0
- package/dist/workflow/validation.d.ts +2 -2
- package/dist/workspace-config/contractsrc-schema.d.ts +112 -2
- package/dist/workspace-config/contractsrc-schema.js +28 -3
- package/package.json +23 -19
- package/dist/data-views.js +0 -35
- package/dist/integrations/contracts.d.ts +0 -436
- package/dist/openbanking/docs/openbanking.docblock.d.ts +0 -6
- package/dist/openbanking/docs/openbanking.docblock.js +0 -22
- package/dist/presentations.backcompat.d.ts +0 -7
- package/dist/presentations.backcompat.js +0 -47
- package/dist/types/all.d.ts +0 -60
- /package/dist/{types/all.js → presentations/presentations.v2.js} +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Stability } from "./ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/registry-utils.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Filter criteria for registry items.
|
|
7
|
+
* All criteria are optional and combined with AND logic.
|
|
8
|
+
*/
|
|
9
|
+
interface RegistryFilter {
|
|
10
|
+
/** Filter by tags (item must have at least one matching tag) */
|
|
11
|
+
tags?: string[];
|
|
12
|
+
/** Filter by owners (item must have at least one matching owner) */
|
|
13
|
+
owners?: string[];
|
|
14
|
+
/** Filter by stability levels */
|
|
15
|
+
stability?: Stability[];
|
|
16
|
+
/** Filter by domain (first segment of name) */
|
|
17
|
+
domain?: string;
|
|
18
|
+
/** Filter by name pattern (glob or regex) */
|
|
19
|
+
namePattern?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Item with standard metadata for filtering.
|
|
23
|
+
*/
|
|
24
|
+
interface FilterableItem {
|
|
25
|
+
meta: {
|
|
26
|
+
name?: string;
|
|
27
|
+
key?: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
owners?: string[];
|
|
30
|
+
stability?: Stability;
|
|
31
|
+
domain?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Grouping key function type.
|
|
36
|
+
*/
|
|
37
|
+
type GroupKeyFn<T> = (item: T) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Grouped items result.
|
|
40
|
+
*/
|
|
41
|
+
interface GroupedItems<T> {
|
|
42
|
+
key: string;
|
|
43
|
+
items: T[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Pre-built grouping strategies for common use cases.
|
|
47
|
+
*/
|
|
48
|
+
declare const GroupingStrategies: {
|
|
49
|
+
/**
|
|
50
|
+
* Group by first tag.
|
|
51
|
+
*/
|
|
52
|
+
byTag: <T extends FilterableItem>(item: T) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Group by all tags (item appears in multiple groups).
|
|
55
|
+
*/
|
|
56
|
+
byAllTags: <T extends FilterableItem>(item: T) => string[];
|
|
57
|
+
/**
|
|
58
|
+
* Group by first owner.
|
|
59
|
+
*/
|
|
60
|
+
byOwner: <T extends FilterableItem>(item: T) => string;
|
|
61
|
+
/**
|
|
62
|
+
* Group by domain (first segment of name).
|
|
63
|
+
*/
|
|
64
|
+
byDomain: <T extends FilterableItem>(item: T) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Group by stability level.
|
|
67
|
+
*/
|
|
68
|
+
byStability: <T extends FilterableItem>(item: T) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Create URL path grouping strategy with configurable depth.
|
|
71
|
+
*/
|
|
72
|
+
byUrlPath: (level: number) => (item: {
|
|
73
|
+
path?: string;
|
|
74
|
+
}) => string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Filter items by criteria.
|
|
78
|
+
* All criteria are combined with AND logic.
|
|
79
|
+
*/
|
|
80
|
+
declare function filterBy<T extends FilterableItem>(items: T[], filter: RegistryFilter): T[];
|
|
81
|
+
/**
|
|
82
|
+
* Group items by key function.
|
|
83
|
+
*/
|
|
84
|
+
declare function groupBy<T>(items: T[], keyFn: GroupKeyFn<T>): Map<string, T[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Group items by key function, returning array format.
|
|
87
|
+
*/
|
|
88
|
+
declare function groupByToArray<T>(items: T[], keyFn: GroupKeyFn<T>): GroupedItems<T>[];
|
|
89
|
+
/**
|
|
90
|
+
* Group items where one item can belong to multiple groups.
|
|
91
|
+
* Useful for byAllTags grouping.
|
|
92
|
+
*/
|
|
93
|
+
declare function groupByMultiple<T>(items: T[], keysFn: (item: T) => string[]): Map<string, T[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Get unique tags from a collection of items.
|
|
96
|
+
*/
|
|
97
|
+
declare function getUniqueTags<T extends FilterableItem>(items: T[]): string[];
|
|
98
|
+
/**
|
|
99
|
+
* Get unique owners from a collection of items.
|
|
100
|
+
*/
|
|
101
|
+
declare function getUniqueOwners<T extends FilterableItem>(items: T[]): string[];
|
|
102
|
+
/**
|
|
103
|
+
* Get unique domains from a collection of items.
|
|
104
|
+
*/
|
|
105
|
+
declare function getUniqueDomains<T extends FilterableItem>(items: T[]): string[];
|
|
106
|
+
//#endregion
|
|
107
|
+
export { FilterableItem, GroupKeyFn, GroupedItems, GroupingStrategies, RegistryFilter, filterBy, getUniqueDomains, getUniqueOwners, getUniqueTags, groupBy, groupByMultiple, groupByToArray };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { __esmMin, __export } from "./_virtual/rolldown_runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region src/registry-utils.ts
|
|
4
|
+
var registry_utils_exports = /* @__PURE__ */ __export({
|
|
5
|
+
GroupingStrategies: () => GroupingStrategies,
|
|
6
|
+
filterBy: () => filterBy,
|
|
7
|
+
getUniqueDomains: () => getUniqueDomains,
|
|
8
|
+
getUniqueOwners: () => getUniqueOwners,
|
|
9
|
+
getUniqueTags: () => getUniqueTags,
|
|
10
|
+
groupBy: () => groupBy,
|
|
11
|
+
groupByMultiple: () => groupByMultiple,
|
|
12
|
+
groupByToArray: () => groupByToArray
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Filter items by criteria.
|
|
16
|
+
* All criteria are combined with AND logic.
|
|
17
|
+
*/
|
|
18
|
+
function filterBy(items, filter) {
|
|
19
|
+
return items.filter((item) => {
|
|
20
|
+
if (filter.tags?.length) {
|
|
21
|
+
if (!filter.tags.some((tag) => item.meta.tags?.includes(tag))) return false;
|
|
22
|
+
}
|
|
23
|
+
if (filter.owners?.length) {
|
|
24
|
+
if (!filter.owners.some((owner) => item.meta.owners?.includes(owner))) return false;
|
|
25
|
+
}
|
|
26
|
+
if (filter.stability?.length) {
|
|
27
|
+
if (!filter.stability.includes(item.meta.stability ?? "stable")) return false;
|
|
28
|
+
}
|
|
29
|
+
if (filter.domain) {
|
|
30
|
+
if (GroupingStrategies.byDomain(item) !== filter.domain) return false;
|
|
31
|
+
}
|
|
32
|
+
if (filter.namePattern) {
|
|
33
|
+
const name = item.meta.name ?? item.meta.key ?? "";
|
|
34
|
+
const pattern = filter.namePattern.replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
35
|
+
if (!new RegExp(`^${pattern}$`, "i").test(name)) return false;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Group items by key function.
|
|
42
|
+
*/
|
|
43
|
+
function groupBy(items, keyFn) {
|
|
44
|
+
const groups = /* @__PURE__ */ new Map();
|
|
45
|
+
for (const item of items) {
|
|
46
|
+
const key = keyFn(item);
|
|
47
|
+
const existing = groups.get(key);
|
|
48
|
+
if (existing) existing.push(item);
|
|
49
|
+
else groups.set(key, [item]);
|
|
50
|
+
}
|
|
51
|
+
return groups;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Group items by key function, returning array format.
|
|
55
|
+
*/
|
|
56
|
+
function groupByToArray(items, keyFn) {
|
|
57
|
+
const map = groupBy(items, keyFn);
|
|
58
|
+
return Array.from(map.entries()).map(([key, items$1]) => ({
|
|
59
|
+
key,
|
|
60
|
+
items: items$1
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Group items where one item can belong to multiple groups.
|
|
65
|
+
* Useful for byAllTags grouping.
|
|
66
|
+
*/
|
|
67
|
+
function groupByMultiple(items, keysFn) {
|
|
68
|
+
const groups = /* @__PURE__ */ new Map();
|
|
69
|
+
for (const item of items) {
|
|
70
|
+
const keys = keysFn(item);
|
|
71
|
+
for (const key of keys) {
|
|
72
|
+
const existing = groups.get(key);
|
|
73
|
+
if (existing) existing.push(item);
|
|
74
|
+
else groups.set(key, [item]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return groups;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get unique tags from a collection of items.
|
|
81
|
+
*/
|
|
82
|
+
function getUniqueTags(items) {
|
|
83
|
+
const tags = /* @__PURE__ */ new Set();
|
|
84
|
+
for (const item of items) for (const tag of item.meta.tags ?? []) tags.add(tag);
|
|
85
|
+
return Array.from(tags).sort();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get unique owners from a collection of items.
|
|
89
|
+
*/
|
|
90
|
+
function getUniqueOwners(items) {
|
|
91
|
+
const owners = /* @__PURE__ */ new Set();
|
|
92
|
+
for (const item of items) for (const owner of item.meta.owners ?? []) owners.add(owner);
|
|
93
|
+
return Array.from(owners).sort();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get unique domains from a collection of items.
|
|
97
|
+
*/
|
|
98
|
+
function getUniqueDomains(items) {
|
|
99
|
+
const domains = /* @__PURE__ */ new Set();
|
|
100
|
+
for (const item of items) domains.add(GroupingStrategies.byDomain(item));
|
|
101
|
+
return Array.from(domains).sort();
|
|
102
|
+
}
|
|
103
|
+
var GroupingStrategies;
|
|
104
|
+
var init_registry_utils = __esmMin(() => {
|
|
105
|
+
GroupingStrategies = {
|
|
106
|
+
byTag: (item) => item.meta.tags?.[0] ?? "untagged",
|
|
107
|
+
byAllTags: (item) => item.meta.tags?.length ? item.meta.tags : ["untagged"],
|
|
108
|
+
byOwner: (item) => item.meta.owners?.[0] ?? "unowned",
|
|
109
|
+
byDomain: (item) => {
|
|
110
|
+
return (item.meta.name ?? item.meta.key ?? "").split(".")[0] ?? "default";
|
|
111
|
+
},
|
|
112
|
+
byStability: (item) => item.meta.stability ?? "stable",
|
|
113
|
+
byUrlPath: (level) => (item) => {
|
|
114
|
+
if (!item.path) return "root";
|
|
115
|
+
return item.path.split("/").filter(Boolean).slice(0, level).join("/") || "root";
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
init_registry_utils();
|
|
122
|
+
export { GroupingStrategies, filterBy, getUniqueDomains, getUniqueOwners, getUniqueTags, groupBy, groupByMultiple, groupByToArray, init_registry_utils, registry_utils_exports };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ResourceRegistry } from "
|
|
1
|
+
import { ResourceRegistry } from "../resources.js";
|
|
2
2
|
|
|
3
|
-
//#region src/contracts-adapter-hydration.d.ts
|
|
3
|
+
//#region src/server/contracts-adapter-hydration.d.ts
|
|
4
4
|
interface ReturnsDecl {
|
|
5
5
|
isList: boolean;
|
|
6
6
|
inner: string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
2
2
|
import { SchemaTypes } from "@pothos/core";
|
|
3
3
|
|
|
4
|
-
//#region src/contracts-adapter-input.d.ts
|
|
5
|
-
declare function isSchemaModel(x: unknown): x is AnySchemaModel;
|
|
4
|
+
//#region src/server/contracts-adapter-input.d.ts
|
|
6
5
|
declare function createInputTypeBuilder<T extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<T>): {
|
|
7
6
|
buildInputFieldArgs: (model: AnySchemaModel | null) => null;
|
|
8
7
|
};
|
|
9
8
|
//#endregion
|
|
10
|
-
export { createInputTypeBuilder
|
|
9
|
+
export { createInputTypeBuilder };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/contracts-adapter-input.ts
|
|
1
|
+
//#region src/server/contracts-adapter-input.ts
|
|
2
2
|
function isSchemaModel(x) {
|
|
3
3
|
return typeof x?.getPothosInput === "function" && typeof x?.getZod === "function";
|
|
4
4
|
}
|
|
@@ -74,4 +74,4 @@ function createInputTypeBuilder(builder) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
//#endregion
|
|
77
|
-
export { createInputTypeBuilder
|
|
77
|
+
export { createInputTypeBuilder };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResourceRegistry } from "../resources.js";
|
|
2
|
-
import { OperationSpecRegistry } from "../registry.js";
|
|
2
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
3
3
|
import "@pothos/plugin-prisma";
|
|
4
4
|
import "@pothos/plugin-complexity";
|
|
5
5
|
import "@pothos/plugin-relay";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { hydrateResourceIfNeeded, parseReturns } from "../contracts-adapter-hydration.js";
|
|
2
|
-
import { createInputTypeBuilder } from "../contracts-adapter-input.js";
|
|
3
1
|
import { defaultGqlField } from "../jsonschema.js";
|
|
2
|
+
import { createInputTypeBuilder } from "./contracts-adapter-input.js";
|
|
3
|
+
import { hydrateResourceIfNeeded, parseReturns } from "./contracts-adapter-hydration.js";
|
|
4
4
|
import "@pothos/plugin-prisma";
|
|
5
5
|
import "@pothos/plugin-complexity";
|
|
6
6
|
import "@pothos/plugin-relay";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResourceRegistry } from "../../resources.js";
|
|
2
|
-
import { OperationSpecRegistry } from "../../registry.js";
|
|
2
|
+
import { OperationSpecRegistry } from "../../operations/registry.js";
|
|
3
3
|
import { PromptRegistry } from "../../promptRegistry.js";
|
|
4
4
|
import { McpCtxFactories } from "./mcpTypes.js";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PresentationDescriptorV2 } from "../../presentations.v2.js";
|
|
2
|
-
import { PresentationRegistry } from "../../presentations.js";
|
|
1
|
+
import { PresentationDescriptorV2 } from "../../presentations/presentations.v2.js";
|
|
2
|
+
import { PresentationRegistry } from "../../presentations/presentations.js";
|
|
3
|
+
import "../../presentations/index.js";
|
|
3
4
|
import { HandlerCtx } from "../../types.js";
|
|
4
5
|
import { Logger } from "@lssm/lib.logger";
|
|
5
6
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer } from "../../presentations.
|
|
2
|
-
import { jsonSchemaForPresentation } from "../../presentations.js";
|
|
1
|
+
import { createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer } from "../../presentations/transform-engine.js";
|
|
2
|
+
import { jsonSchemaForPresentation } from "../../presentations/presentations.js";
|
|
3
|
+
import "../../presentations/index.js";
|
|
3
4
|
|
|
4
5
|
//#region src/server/mcp/registerPresentations.ts
|
|
5
6
|
function isEngineRenderOutput(x) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HandlerCtx } from "../types.js";
|
|
2
|
-
import { OperationSpecRegistry } from "../registry.js";
|
|
2
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
3
3
|
|
|
4
4
|
//#region src/server/rest-next-mcp.d.ts
|
|
5
5
|
declare function makeNextMcpServerFromRegistry(reg: OperationSpecRegistry, ctxFactory: () => HandlerCtx): {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HandlerCtx } from "../types.js";
|
|
2
|
-
import { OperationSpecRegistry } from "../registry.js";
|
|
2
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
3
3
|
import { RestOptions } from "./rest-generic.js";
|
|
4
4
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
5
5
|
|
package/dist/tests/runner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Assertion, TestScenario, TestSpec } from "./spec.js";
|
|
2
2
|
import { HandlerCtx } from "../types.js";
|
|
3
|
-
import { OperationSpecRegistry } from "../registry.js";
|
|
3
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
4
4
|
import "../index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/tests/runner.d.ts
|
package/dist/tests/spec.d.ts
CHANGED
package/dist/workflow/spec.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { OwnerShipMeta } from "../ownership.js";
|
|
2
|
-
import {
|
|
2
|
+
import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
|
|
3
|
+
import { CapabilityRef } from "../capabilities/capabilities.js";
|
|
4
|
+
import "../capabilities/index.js";
|
|
3
5
|
import { ExperimentRef } from "../experiments/spec.js";
|
|
4
6
|
import { OpRef } from "../features.js";
|
|
5
7
|
|
|
6
8
|
//#region src/workflow/spec.d.ts
|
|
7
|
-
|
|
8
9
|
/**
|
|
9
10
|
* Reference to a form spec declared in {@link FormRegistry}.
|
|
10
11
|
*/
|
|
@@ -94,6 +95,16 @@ declare class WorkflowRegistry {
|
|
|
94
95
|
register(spec: WorkflowSpec): this;
|
|
95
96
|
list(): WorkflowSpec[];
|
|
96
97
|
get(name: string, version?: number): WorkflowSpec | undefined;
|
|
98
|
+
/** Filter workflows by criteria. */
|
|
99
|
+
filter(criteria: RegistryFilter): WorkflowSpec[];
|
|
100
|
+
/** List workflows with specific tag. */
|
|
101
|
+
listByTag(tag: string): WorkflowSpec[];
|
|
102
|
+
/** List workflows by owner. */
|
|
103
|
+
listByOwner(owner: string): WorkflowSpec[];
|
|
104
|
+
/** Group workflows by key function. */
|
|
105
|
+
groupBy(keyFn: GroupKeyFn<WorkflowSpec>): Map<string, WorkflowSpec[]>;
|
|
106
|
+
/** Get unique tags from all workflows. */
|
|
107
|
+
getUniqueTags(): string[];
|
|
97
108
|
}
|
|
98
109
|
//#endregion
|
|
99
110
|
export { CompensationStep, CompensationStrategy, FormRef, GuardCondition, GuardConditionKind, RetryPolicy, SLA, Step, StepAction, StepType, Transition, WorkflowDefinition, WorkflowMeta, WorkflowRegistry, WorkflowSpec, WorkflowStatus };
|
package/dist/workflow/spec.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { __toCommonJS } from "../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { init_registry_utils, registry_utils_exports } from "../registry-utils.js";
|
|
3
|
+
|
|
1
4
|
//#region src/workflow/spec.ts
|
|
2
5
|
function workflowKey(meta) {
|
|
3
6
|
return `${meta.name}.v${meta.version}`;
|
|
@@ -26,6 +29,29 @@ var WorkflowRegistry = class {
|
|
|
26
29
|
}
|
|
27
30
|
return candidate;
|
|
28
31
|
}
|
|
32
|
+
/** Filter workflows by criteria. */
|
|
33
|
+
filter(criteria) {
|
|
34
|
+
const { filterBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
35
|
+
return filterBy(this.list(), criteria);
|
|
36
|
+
}
|
|
37
|
+
/** List workflows with specific tag. */
|
|
38
|
+
listByTag(tag) {
|
|
39
|
+
return this.list().filter((w) => w.meta.tags?.includes(tag));
|
|
40
|
+
}
|
|
41
|
+
/** List workflows by owner. */
|
|
42
|
+
listByOwner(owner) {
|
|
43
|
+
return this.list().filter((w) => w.meta.owners?.includes(owner));
|
|
44
|
+
}
|
|
45
|
+
/** Group workflows by key function. */
|
|
46
|
+
groupBy(keyFn) {
|
|
47
|
+
const { groupBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
48
|
+
return groupBy(this.list(), keyFn);
|
|
49
|
+
}
|
|
50
|
+
/** Get unique tags from all workflows. */
|
|
51
|
+
getUniqueTags() {
|
|
52
|
+
const { getUniqueTags } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
53
|
+
return getUniqueTags(this.list());
|
|
54
|
+
}
|
|
29
55
|
};
|
|
30
56
|
|
|
31
57
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkflowSpec } from "./spec.js";
|
|
2
|
-
import { OperationSpecRegistry } from "../registry.js";
|
|
3
|
-
import { FormRegistry } from "../forms.js";
|
|
2
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
3
|
+
import { FormRegistry } from "../forms/forms.js";
|
|
4
4
|
|
|
5
5
|
//#region src/workflow/validation.d.ts
|
|
6
6
|
type WorkflowValidationLevel = 'error' | 'warning';
|
|
@@ -90,6 +90,34 @@ declare const OpenApiConfigSchema: z$1.ZodObject<{
|
|
|
90
90
|
}, z$1.core.$strip>>>;
|
|
91
91
|
}, z$1.core.$strip>>;
|
|
92
92
|
}, z$1.core.$strip>;
|
|
93
|
+
/**
|
|
94
|
+
* Grouping strategy for organizing specs.
|
|
95
|
+
*/
|
|
96
|
+
declare const GroupingStrategySchema: z$1.ZodEnum<{
|
|
97
|
+
"by-tag": "by-tag";
|
|
98
|
+
"by-owner": "by-owner";
|
|
99
|
+
"by-domain": "by-domain";
|
|
100
|
+
"by-url-path-single": "by-url-path-single";
|
|
101
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
102
|
+
"by-feature": "by-feature";
|
|
103
|
+
none: "none";
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Grouping rule configuration.
|
|
107
|
+
*/
|
|
108
|
+
declare const GroupingRuleSchema: z$1.ZodObject<{
|
|
109
|
+
strategy: z$1.ZodEnum<{
|
|
110
|
+
"by-tag": "by-tag";
|
|
111
|
+
"by-owner": "by-owner";
|
|
112
|
+
"by-domain": "by-domain";
|
|
113
|
+
"by-url-path-single": "by-url-path-single";
|
|
114
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
115
|
+
"by-feature": "by-feature";
|
|
116
|
+
none: "none";
|
|
117
|
+
}>;
|
|
118
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
119
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
120
|
+
}, z$1.core.$strip>;
|
|
93
121
|
/**
|
|
94
122
|
* Output directory conventions for generated specs.
|
|
95
123
|
*/
|
|
@@ -99,6 +127,46 @@ declare const FolderConventionsSchema: z$1.ZodObject<{
|
|
|
99
127
|
events: z$1.ZodDefault<z$1.ZodString>;
|
|
100
128
|
presentations: z$1.ZodDefault<z$1.ZodString>;
|
|
101
129
|
forms: z$1.ZodDefault<z$1.ZodString>;
|
|
130
|
+
groupByFeature: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
131
|
+
operationsGrouping: z$1.ZodOptional<z$1.ZodObject<{
|
|
132
|
+
strategy: z$1.ZodEnum<{
|
|
133
|
+
"by-tag": "by-tag";
|
|
134
|
+
"by-owner": "by-owner";
|
|
135
|
+
"by-domain": "by-domain";
|
|
136
|
+
"by-url-path-single": "by-url-path-single";
|
|
137
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
138
|
+
"by-feature": "by-feature";
|
|
139
|
+
none: "none";
|
|
140
|
+
}>;
|
|
141
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
142
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
143
|
+
}, z$1.core.$strip>>;
|
|
144
|
+
modelsGrouping: z$1.ZodOptional<z$1.ZodObject<{
|
|
145
|
+
strategy: z$1.ZodEnum<{
|
|
146
|
+
"by-tag": "by-tag";
|
|
147
|
+
"by-owner": "by-owner";
|
|
148
|
+
"by-domain": "by-domain";
|
|
149
|
+
"by-url-path-single": "by-url-path-single";
|
|
150
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
151
|
+
"by-feature": "by-feature";
|
|
152
|
+
none: "none";
|
|
153
|
+
}>;
|
|
154
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
155
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
156
|
+
}, z$1.core.$strip>>;
|
|
157
|
+
eventsGrouping: z$1.ZodOptional<z$1.ZodObject<{
|
|
158
|
+
strategy: z$1.ZodEnum<{
|
|
159
|
+
"by-tag": "by-tag";
|
|
160
|
+
"by-owner": "by-owner";
|
|
161
|
+
"by-domain": "by-domain";
|
|
162
|
+
"by-url-path-single": "by-url-path-single";
|
|
163
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
164
|
+
"by-feature": "by-feature";
|
|
165
|
+
none: "none";
|
|
166
|
+
}>;
|
|
167
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
168
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
169
|
+
}, z$1.core.$strip>>;
|
|
102
170
|
}, z$1.core.$strip>;
|
|
103
171
|
/**
|
|
104
172
|
* Full ContractSpec configuration schema (.contractsrc.json).
|
|
@@ -112,9 +180,9 @@ declare const ContractsrcSchema: z$1.ZodObject<{
|
|
|
112
180
|
}>>;
|
|
113
181
|
aiModel: z$1.ZodOptional<z$1.ZodString>;
|
|
114
182
|
agentMode: z$1.ZodDefault<z$1.ZodEnum<{
|
|
115
|
-
cursor: "cursor";
|
|
116
183
|
"claude-code": "claude-code";
|
|
117
184
|
simple: "simple";
|
|
185
|
+
cursor: "cursor";
|
|
118
186
|
"openai-codex": "openai-codex";
|
|
119
187
|
}>>;
|
|
120
188
|
customEndpoint: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodURL>>;
|
|
@@ -126,6 +194,46 @@ declare const ContractsrcSchema: z$1.ZodObject<{
|
|
|
126
194
|
events: z$1.ZodDefault<z$1.ZodString>;
|
|
127
195
|
presentations: z$1.ZodDefault<z$1.ZodString>;
|
|
128
196
|
forms: z$1.ZodDefault<z$1.ZodString>;
|
|
197
|
+
groupByFeature: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
198
|
+
operationsGrouping: z$1.ZodOptional<z$1.ZodObject<{
|
|
199
|
+
strategy: z$1.ZodEnum<{
|
|
200
|
+
"by-tag": "by-tag";
|
|
201
|
+
"by-owner": "by-owner";
|
|
202
|
+
"by-domain": "by-domain";
|
|
203
|
+
"by-url-path-single": "by-url-path-single";
|
|
204
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
205
|
+
"by-feature": "by-feature";
|
|
206
|
+
none: "none";
|
|
207
|
+
}>;
|
|
208
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
209
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
210
|
+
}, z$1.core.$strip>>;
|
|
211
|
+
modelsGrouping: z$1.ZodOptional<z$1.ZodObject<{
|
|
212
|
+
strategy: z$1.ZodEnum<{
|
|
213
|
+
"by-tag": "by-tag";
|
|
214
|
+
"by-owner": "by-owner";
|
|
215
|
+
"by-domain": "by-domain";
|
|
216
|
+
"by-url-path-single": "by-url-path-single";
|
|
217
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
218
|
+
"by-feature": "by-feature";
|
|
219
|
+
none: "none";
|
|
220
|
+
}>;
|
|
221
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
222
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
223
|
+
}, z$1.core.$strip>>;
|
|
224
|
+
eventsGrouping: z$1.ZodOptional<z$1.ZodObject<{
|
|
225
|
+
strategy: z$1.ZodEnum<{
|
|
226
|
+
"by-tag": "by-tag";
|
|
227
|
+
"by-owner": "by-owner";
|
|
228
|
+
"by-domain": "by-domain";
|
|
229
|
+
"by-url-path-single": "by-url-path-single";
|
|
230
|
+
"by-url-path-multi": "by-url-path-multi";
|
|
231
|
+
"by-feature": "by-feature";
|
|
232
|
+
none: "none";
|
|
233
|
+
}>;
|
|
234
|
+
urlPathLevel: z$1.ZodOptional<z$1.ZodNumber>;
|
|
235
|
+
pattern: z$1.ZodOptional<z$1.ZodString>;
|
|
236
|
+
}, z$1.core.$strip>>;
|
|
129
237
|
}, z$1.core.$strip>;
|
|
130
238
|
defaultOwners: z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>;
|
|
131
239
|
defaultTags: z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>;
|
|
@@ -180,9 +288,11 @@ type OpenApiExportConfig = z$1.infer<typeof OpenApiExportConfigSchema>;
|
|
|
180
288
|
type OpenApiConfig = z$1.infer<typeof OpenApiConfigSchema>;
|
|
181
289
|
type FolderConventions = z$1.infer<typeof FolderConventionsSchema>;
|
|
182
290
|
type ContractsrcConfig = z$1.infer<typeof ContractsrcSchema>;
|
|
291
|
+
type GroupingStrategy = z$1.infer<typeof GroupingStrategySchema>;
|
|
292
|
+
type GroupingRule = z$1.infer<typeof GroupingRuleSchema>;
|
|
183
293
|
/**
|
|
184
294
|
* Default configuration values.
|
|
185
295
|
*/
|
|
186
296
|
declare const DEFAULT_CONTRACTSRC: ContractsrcConfig;
|
|
187
297
|
//#endregion
|
|
188
|
-
export { ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventions, FolderConventionsSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema };
|
|
298
|
+
export { ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventions, FolderConventionsSchema, GroupingRule, GroupingRuleSchema, GroupingStrategy, GroupingStrategySchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema };
|