@feltdb/core 0.8.0 → 0.8.2
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/application-development.d.ts +7 -2
- package/dist/application-development.d.ts.map +1 -1
- package/dist/application-development.js +7 -13
- package/dist/application-manifest.d.ts +1 -0
- package/dist/application-manifest.d.ts.map +1 -1
- package/dist/application-manifest.js +1 -1
- package/dist/application-understanding.d.ts +76 -0
- package/dist/application-understanding.d.ts.map +1 -0
- package/dist/application-understanding.js +282 -0
- package/dist/cli/ai-model-config.js +3 -3
- package/dist/cli/commands.js +131 -38
- package/dist/cli/proposal-client.js +5 -1
- package/dist/cli/publish-engine.js +1 -1
- package/dist/cli/repository-evidence.js +55 -0
- package/dist/cli/source-sync.js +190 -75
- package/dist/convergence.d.ts +55 -0
- package/dist/convergence.d.ts.map +1 -0
- package/dist/convergence.js +63 -0
- package/dist/create/managed-account.js +1 -0
- package/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/application.rs +23 -0
- package/dist/create/server-source/crates/feltdb/src/authority.rs +349 -0
- package/dist/create/server-source/crates/feltdb/src/bin/feltdb-authority-client.rs +32 -0
- package/dist/create/server-source/crates/feltdb/src/bin/feltdb-authority.rs +19 -0
- package/dist/create/server-source/crates/feltdb/src/lib.rs +444 -189
- package/dist/create/server-source/crates/feltdb/src/state_contract.rs +244 -51
- package/dist/create/server-source/crates/feltdb/tests/authority_process.rs +297 -0
- package/dist/create/server-source/crates/feltdb-server/src/auth.rs +41 -11
- package/dist/create/server-source/crates/feltdb-server/src/connections.rs +14 -0
- package/dist/create/server-source/crates/feltdb-server/src/key_management.rs +8 -3
- package/dist/create/server-source/crates/feltdb-server/src/main.rs +1262 -173
- package/dist/create/server-source/crates/feltdb-server/src/tenancy.rs +142 -1
- package/dist/create/template/default-project/src/context/AuthContext.tsx +9 -1
- package/dist/create/template/default-project/src/pages/SignUp.tsx +1 -1
- package/dist/flowspec.d.ts.map +1 -1
- package/dist/flowspec.js +6 -1
- package/dist/http-client.d.ts +32 -1
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +14 -2
- package/dist/http-db.d.ts +6 -0
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +30 -4
- package/dist/index-core.d.ts +3 -0
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +3 -0
- package/dist/intent.d.ts +98 -0
- package/dist/intent.d.ts.map +1 -0
- package/dist/intent.js +343 -0
- package/dist/module-intent.d.ts +19 -5
- package/dist/module-intent.d.ts.map +1 -1
- package/dist/module-intent.js +211 -62
- package/dist/module.d.ts +41 -12
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +543 -38
- package/dist/proposal.d.ts +13 -1
- package/dist/proposal.d.ts.map +1 -1
- package/dist/proposal.js +21 -4
- package/dist/state-contract.d.ts +4 -1
- package/dist/state-contract.d.ts.map +1 -1
- package/dist/state-contract.js +1 -1
- package/dist/studio/components/AskFeltDB.d.ts.map +1 -1
- package/dist/studio/components/ProposalBrowser.d.ts +1 -1
- package/dist/studio/components/ProposalBrowser.d.ts.map +1 -1
- package/dist/studio/components/index.js +1 -1
- package/dist/studio/{components-CNSNrmA9.js → components-Duq2xQWt.js} +251 -193
- package/dist/studio/index.js +1 -1
- package/dist/studio/studio.css +1 -1
- package/dist/studio/utils/proposal-api.d.ts +4 -1
- package/dist/studio/utils/proposal-api.d.ts.map +1 -1
- package/dist/studio/utils/proposal-api.js +3 -0
- package/dist/studio-app/assets/{feltdb_wasm-CSB6KVgw.js → feltdb_wasm-DB8cX151.js} +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-ClhDHp0S.wasm +0 -0
- package/dist/studio-app/assets/index-B0k4UAlI.js +29 -0
- package/dist/studio-app/assets/{index-yazaWMUN.css → index-Cd_NPw14.css} +1 -1
- package/dist/studio-app/index.html +2 -2
- package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
- package/dist/workspace/local-development-authority.d.ts +2 -0
- package/dist/workspace/local-development-authority.d.ts.map +1 -1
- package/dist/workspace/local-development-authority.js +65 -2
- package/package.json +1 -1
- package/dist/studio-app/assets/dist-CCOk39Uc.js +0 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-Dd1fnO9U.wasm +0 -0
- package/dist/studio-app/assets/index-Bncji3aN.js +0 -43
- package/dist/studio-app/assets/lib-B2_7fcn7.js +0 -69
- package/dist/studio-app/assets/worker-CARZ5g7K.js +0 -69
package/dist/module-intent.js
CHANGED
|
@@ -1,81 +1,230 @@
|
|
|
1
|
-
import { formatFlowSpec, parseFlowSpec } from
|
|
2
|
-
import { findFeltDBModules, listFeltDBModules, resolveFeltDBModule } from
|
|
1
|
+
import { formatFlowSpec, parseFlowSpec, } from "./flowspec.js";
|
|
2
|
+
import { findFeltDBModules, listFeltDBModules, resolveFeltDBModule, } from "./module.js";
|
|
3
|
+
import { collectApplicationUnderstanding, understandingOwner, } from "./application-understanding.js";
|
|
3
4
|
async function sourceHash(source) {
|
|
4
|
-
const digest = await crypto.subtle.digest(
|
|
5
|
-
return `sha256:${Array.from(new Uint8Array(digest), byte => byte.toString(16).padStart(2,
|
|
5
|
+
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(source.replace(/\r\n/g, "\n")));
|
|
6
|
+
return `sha256:${Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
6
7
|
}
|
|
7
8
|
export function resolveModuleIntent(value) {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const requested =
|
|
13
|
-
|
|
9
|
+
const implement = /^\s*implement\s+([a-z0-9][a-z0-9-]*)\s*[.!]?\s*$/i.exec(value);
|
|
10
|
+
const finish = /^\s*finish(?:\s+the)?\s+([a-z0-9][a-z0-9-]*)\s+implementation\s*[.!]?\s*$/i.exec(value);
|
|
11
|
+
let matches = [];
|
|
12
|
+
let action = "implement";
|
|
13
|
+
const requested = (implement?.[1] || finish?.[1])?.toLowerCase();
|
|
14
|
+
if (requested)
|
|
15
|
+
matches = findFeltDBModules(requested);
|
|
16
|
+
else {
|
|
17
|
+
const words = new Set(value.toLowerCase().match(/[a-z0-9-]+/g) ?? []);
|
|
18
|
+
matches = listFeltDBModules().filter((module) => module.intent_keywords.some((keyword) => words.has(keyword)));
|
|
19
|
+
action = "extend";
|
|
20
|
+
if (!matches.length)
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
14
23
|
if (!matches.length)
|
|
15
|
-
throw new Error(`MODULE_NOT_AVAILABLE: ${requested}. No proposal created. Available modules: ${listFeltDBModules()
|
|
24
|
+
throw new Error(`MODULE_NOT_AVAILABLE: ${requested}. No proposal created. Available modules: ${listFeltDBModules()
|
|
25
|
+
.map((module) => module.id)
|
|
26
|
+
.join(", ")}`);
|
|
16
27
|
if (matches.length > 1)
|
|
17
|
-
throw new Error(`AMBIGUOUS_MODULE_INTENT: ${requested}.
|
|
28
|
+
throw new Error(`AMBIGUOUS_MODULE_INTENT: ${requested ?? value}. Candidates: ${matches.map((module) => module.id).join(", ")}`);
|
|
18
29
|
const module = matches[0];
|
|
19
|
-
return {
|
|
30
|
+
return {
|
|
31
|
+
action,
|
|
32
|
+
module: module.id,
|
|
33
|
+
provider: module.provider,
|
|
34
|
+
version: module.version,
|
|
35
|
+
original: value,
|
|
36
|
+
};
|
|
20
37
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
function applicationAuthorization(module, owner, snapshot) {
|
|
39
|
+
const ownerPolicy = snapshot.policies.find((value) => value.resource === owner ||
|
|
40
|
+
value.name === owner ||
|
|
41
|
+
value.resource === module.placement.primary_application_model);
|
|
42
|
+
const vocabulary = [ownerPolicy?.write, ownerPolicy?.read].filter((value) => Boolean(value));
|
|
43
|
+
const management = vocabulary.find((value) => /admin|owner/i.test(value));
|
|
44
|
+
if (!management && vocabulary.length)
|
|
45
|
+
throw new Error(`CLARIFICATION_REQUIRED: no compatible ${module.id} management policy for ${owner}`);
|
|
46
|
+
const subject = management ?? "owner";
|
|
47
|
+
return module.authorization.map((requirement) => requirement.subject === "owner"
|
|
48
|
+
? {
|
|
49
|
+
...requirement,
|
|
50
|
+
subject,
|
|
51
|
+
implication: `${subject} (${module.placement.primary_application_model}.${module.placement.owner_field} -> ${owner}) may manage ${module.name}`,
|
|
52
|
+
}
|
|
53
|
+
: requirement);
|
|
28
54
|
}
|
|
29
|
-
|
|
30
|
-
const
|
|
55
|
+
function dependencyStatus(module, snapshot) {
|
|
56
|
+
const collections = new Set(snapshot.schema.map((value) => value.name));
|
|
57
|
+
const capabilities = new Set(snapshot.capabilities.map((value) => value.name));
|
|
58
|
+
return module.dependencies.map((dependency) => {
|
|
59
|
+
const collection = dependency.any_collections?.find((value) => collections.has(value));
|
|
60
|
+
const capability = dependency.any_capabilities?.find((value) => capabilities.has(value));
|
|
61
|
+
const policy = dependency.name === "authentication"
|
|
62
|
+
? snapshot.policies.find((value) => [value.read, value.write].some((subject) => subject === "authenticated" || subject?.includes("member")))
|
|
63
|
+
: undefined;
|
|
64
|
+
return {
|
|
65
|
+
name: dependency.name,
|
|
66
|
+
status: (collection || capability || policy ? "satisfied" : "missing"),
|
|
67
|
+
evidence: [
|
|
68
|
+
...(collection ? [`collection:${collection}`] : []),
|
|
69
|
+
...(capability ? [`capability:${capability}`] : []),
|
|
70
|
+
...(policy ? [`policy:${policy.name}`] : []),
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function substitute(type, module, owner, snapshot) {
|
|
76
|
+
if (type === "$project" || type === "ref $project") {
|
|
77
|
+
const project = snapshot.schema.find((value) => value.name === "Project")?.name;
|
|
78
|
+
return project ? type.replace("$project", project) : undefined;
|
|
79
|
+
}
|
|
80
|
+
return type.replaceAll("$owner", owner).replaceAll("$module", module.id);
|
|
81
|
+
}
|
|
82
|
+
export function planModuleImplementation(intent, snapshot, currentFlow, understanding) {
|
|
83
|
+
const module = resolveFeltDBModule({
|
|
84
|
+
name: intent.module,
|
|
85
|
+
provider: intent.provider,
|
|
86
|
+
version: intent.version,
|
|
87
|
+
});
|
|
31
88
|
const spec = parseFlowSpec(currentFlow);
|
|
32
|
-
const owner =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
89
|
+
const owner = understandingOwner(understanding, module);
|
|
90
|
+
if (!owner)
|
|
91
|
+
throw new Error(`CLARIFICATION_REQUIRED: ${module.placement.owner_claim}`);
|
|
92
|
+
const alreadyInstalled = Boolean(spec.modules?.some((value) => value.name === module.id));
|
|
93
|
+
const pattern = module.patterns.find((value) => value.owner_candidates.includes(owner));
|
|
94
|
+
if (!pattern)
|
|
95
|
+
throw new Error(`CLARIFICATION_REQUIRED: ${module.placement.owner_claim}=${owner} is unsupported by ${module.id}`);
|
|
96
|
+
const applicationModels = (intent.action === "extend" && module.extension_application_models?.length
|
|
97
|
+
? module.extension_application_models
|
|
98
|
+
: pattern.application_models).map((value) => ({
|
|
99
|
+
...value,
|
|
100
|
+
fields: value.fields
|
|
101
|
+
.map((field) => ({
|
|
102
|
+
...field,
|
|
103
|
+
type: substitute(field.type, module, owner, snapshot),
|
|
104
|
+
}))
|
|
105
|
+
.filter((field) => Boolean(field.type)),
|
|
106
|
+
}));
|
|
107
|
+
const relationships = applicationModels.flatMap((model) => model.fields
|
|
108
|
+
.filter((field) => field.type.startsWith("ref "))
|
|
109
|
+
.map((field) => `${model.name}.${field.name} -> ${field.type.slice(4)}`));
|
|
110
|
+
const implementedEvents = new Set(spec.triggers.map((value) => value.event));
|
|
111
|
+
const implementedWorkflows = new Set(spec.workflows.map((value) => value.name));
|
|
112
|
+
const dependencies = dependencyStatus(module, snapshot);
|
|
113
|
+
const missing = dependencies.filter((value) => value.status === "missing");
|
|
114
|
+
if (missing.length)
|
|
115
|
+
throw new Error(`MISSING_MODULE_DEPENDENCY: ${missing.map((value) => value.name).join(", ")}`);
|
|
116
|
+
return {
|
|
117
|
+
intent,
|
|
118
|
+
module,
|
|
119
|
+
alreadyInstalled,
|
|
120
|
+
owner,
|
|
121
|
+
ownerClaim: module.placement.owner_claim,
|
|
122
|
+
primaryApplicationModel: module.placement.primary_application_model,
|
|
123
|
+
applicationModels,
|
|
124
|
+
relationships,
|
|
125
|
+
events: module.reconciliation
|
|
126
|
+
.map((value) => value.event)
|
|
127
|
+
.filter((value) => !implementedEvents.has(value)),
|
|
128
|
+
workflows: module.reconciliation
|
|
129
|
+
.map((value) => value.workflow)
|
|
130
|
+
.filter((value) => !implementedWorkflows.has(value)),
|
|
131
|
+
capabilities: [...module.capabilities],
|
|
132
|
+
authorization: applicationAuthorization(module, owner, snapshot),
|
|
133
|
+
configuration: module.configuration.map((value) => value.name),
|
|
134
|
+
secrets: module.secrets.map((value) => value.name),
|
|
135
|
+
dependencies,
|
|
136
|
+
stateFlow: module.reconciliation[0]
|
|
137
|
+
? [
|
|
138
|
+
module.reconciliation[0].event,
|
|
139
|
+
module.reconciliation[0].workflow,
|
|
140
|
+
...module.reconciliation[0].writes,
|
|
141
|
+
]
|
|
142
|
+
: [],
|
|
143
|
+
warnings: module.validation.map((value) => `Required: ${value}`),
|
|
45
144
|
};
|
|
46
145
|
}
|
|
47
|
-
function addCollection(spec, collection) {
|
|
48
|
-
spec.collections.
|
|
146
|
+
function addCollection(spec, collection) {
|
|
147
|
+
if (!spec.collections.some((value) => value.name === collection.name))
|
|
148
|
+
spec.collections.push(collection);
|
|
149
|
+
}
|
|
49
150
|
export async function createModuleImplementationProposal(input) {
|
|
50
151
|
const resolved = resolveModuleIntent(input.intent);
|
|
51
152
|
if (!resolved)
|
|
52
|
-
throw new Error(
|
|
53
|
-
const
|
|
153
|
+
throw new Error("NOT_A_MODULE_INTENT");
|
|
154
|
+
const understanding = await collectApplicationUnderstanding({
|
|
155
|
+
intent: input.intent,
|
|
156
|
+
snapshot: input.snapshot,
|
|
157
|
+
currentFlow: input.currentFlow,
|
|
158
|
+
moduleIntent: resolved,
|
|
159
|
+
observations: input.observations,
|
|
160
|
+
});
|
|
161
|
+
const plan = planModuleImplementation(resolved, input.snapshot, input.currentFlow, understanding);
|
|
54
162
|
const spec = parseFlowSpec(input.currentFlow);
|
|
55
|
-
if (resolved.action ===
|
|
163
|
+
if (resolved.action === "extend" && !plan.alreadyInstalled)
|
|
56
164
|
throw new Error(`MODULE_NOT_INSTALLED: ${plan.module.id}. Run implement ${plan.module.id} first.`);
|
|
57
|
-
if (!spec.modules?.some(value => value.name === plan.module.id))
|
|
58
|
-
spec.modules.push({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
165
|
+
if (!spec.modules?.some((value) => value.name === plan.module.id))
|
|
166
|
+
spec.modules.push({
|
|
167
|
+
name: plan.module.id,
|
|
168
|
+
provider: plan.module.provider,
|
|
169
|
+
version: plan.module.version,
|
|
170
|
+
});
|
|
171
|
+
for (const model of plan.applicationModels)
|
|
172
|
+
addCollection(spec, {
|
|
173
|
+
name: model.name,
|
|
174
|
+
fields: model.fields.map((field) => ({
|
|
175
|
+
name: field.name,
|
|
176
|
+
type: field.type,
|
|
177
|
+
optional: Boolean(field.optional),
|
|
178
|
+
})),
|
|
179
|
+
indexes: [],
|
|
180
|
+
});
|
|
69
181
|
for (const reconciliation of plan.module.reconciliation) {
|
|
70
|
-
if (!spec.workflows.some(value => value.name === reconciliation.workflow))
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
182
|
+
if (!spec.workflows.some((value) => value.name === reconciliation.workflow)) {
|
|
183
|
+
const readCapability = plan.module.capabilities.find((value) => value.endsWith(".read"));
|
|
184
|
+
spec.workflows.push({
|
|
185
|
+
name: reconciliation.workflow,
|
|
186
|
+
parameters: "",
|
|
187
|
+
steps: [
|
|
188
|
+
{
|
|
189
|
+
name: "reconcile",
|
|
190
|
+
statements: [
|
|
191
|
+
...reconciliation.reads.map((value) => `read ${value}`),
|
|
192
|
+
...reconciliation.writes.map((value) => `write ${value}`),
|
|
193
|
+
...(readCapability ? [`capability ${readCapability}`] : []),
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (!spec.triggers.some((value) => value.event === reconciliation.event))
|
|
200
|
+
spec.triggers.push({
|
|
201
|
+
event: reconciliation.event,
|
|
202
|
+
statements: [`run ${reconciliation.workflow}`],
|
|
203
|
+
});
|
|
74
204
|
}
|
|
75
|
-
if (!spec.policies.some(value => value.name ===
|
|
76
|
-
spec.policies.push({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
205
|
+
if (!spec.policies.some((value) => value.name === plan.primaryApplicationModel))
|
|
206
|
+
spec.policies.push({
|
|
207
|
+
name: plan.primaryApplicationModel,
|
|
208
|
+
statements: ["read: owner", "write: owner"],
|
|
209
|
+
});
|
|
210
|
+
const prefix = resolved.action === "extend"
|
|
211
|
+
? "Extend"
|
|
212
|
+
: plan.alreadyInstalled
|
|
213
|
+
? "Complete"
|
|
214
|
+
: "Implement";
|
|
215
|
+
return {
|
|
216
|
+
baseContractHash: input.snapshot.contract_hash,
|
|
217
|
+
baseFlowHash: await sourceHash(input.currentFlow),
|
|
218
|
+
proposedFlow: formatFlowSpec(spec),
|
|
219
|
+
summary: `${prefix} ${plan.module.name}`,
|
|
220
|
+
changes: [
|
|
221
|
+
...plan.applicationModels.map((value) => `${value.name} (${value.ownership})`),
|
|
222
|
+
...plan.relationships,
|
|
223
|
+
...plan.workflows,
|
|
224
|
+
...plan.capabilities,
|
|
225
|
+
],
|
|
226
|
+
warnings: plan.warnings,
|
|
227
|
+
implementation: plan,
|
|
228
|
+
understanding,
|
|
229
|
+
};
|
|
81
230
|
}
|
package/dist/module.d.ts
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
export type FeltDBModuleOwnership =
|
|
1
|
+
export type FeltDBModuleOwnership = "external-authoritative" | "application-authoritative" | "derived" | "synchronized";
|
|
2
|
+
export interface FeltDBModuleField {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
optional?: boolean;
|
|
6
|
+
immutable?: boolean;
|
|
7
|
+
externally_owned?: boolean;
|
|
8
|
+
application_readable?: boolean;
|
|
9
|
+
}
|
|
2
10
|
export interface FeltDBModuleModel {
|
|
3
11
|
name: string;
|
|
4
|
-
authority:
|
|
12
|
+
authority: "external" | "application";
|
|
5
13
|
ownership: FeltDBModuleOwnership;
|
|
6
|
-
fields:
|
|
7
|
-
name: string;
|
|
8
|
-
type: string;
|
|
9
|
-
optional?: boolean;
|
|
10
|
-
immutable?: boolean;
|
|
11
|
-
externally_owned?: boolean;
|
|
12
|
-
application_readable?: boolean;
|
|
13
|
-
}[];
|
|
14
|
+
fields: FeltDBModuleField[];
|
|
14
15
|
}
|
|
15
16
|
export interface FeltDBModuleRelationship {
|
|
16
17
|
from: string;
|
|
17
18
|
to: string;
|
|
18
|
-
kind:
|
|
19
|
+
kind: "one" | "many";
|
|
19
20
|
}
|
|
20
21
|
export interface FeltDBModuleRequirement {
|
|
21
22
|
name: string;
|
|
22
23
|
required: boolean;
|
|
23
24
|
environments?: string[];
|
|
24
25
|
description: string;
|
|
26
|
+
visibility?: "server" | "browser";
|
|
27
|
+
}
|
|
28
|
+
export interface FeltDBModuleApplicationField {
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
optional?: boolean;
|
|
25
32
|
}
|
|
26
33
|
export interface FeltDBModulePattern {
|
|
27
34
|
name: string;
|
|
@@ -31,6 +38,7 @@ export interface FeltDBModulePattern {
|
|
|
31
38
|
name: string;
|
|
32
39
|
ownership: FeltDBModuleOwnership;
|
|
33
40
|
purpose: string;
|
|
41
|
+
fields: FeltDBModuleApplicationField[];
|
|
34
42
|
}>;
|
|
35
43
|
}
|
|
36
44
|
export interface FeltDBModuleReconciliation {
|
|
@@ -40,12 +48,24 @@ export interface FeltDBModuleReconciliation {
|
|
|
40
48
|
writes: string[];
|
|
41
49
|
outcome: string;
|
|
42
50
|
}
|
|
51
|
+
export interface FeltDBModuleDependency {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
any_collections?: string[];
|
|
55
|
+
any_capabilities?: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface FeltDBModuleSourceArtifact {
|
|
58
|
+
path: string;
|
|
59
|
+
role: string;
|
|
60
|
+
purpose: string;
|
|
61
|
+
}
|
|
43
62
|
export interface FeltDBModuleDefinition {
|
|
44
63
|
id: string;
|
|
45
64
|
name: string;
|
|
46
65
|
version: string;
|
|
47
66
|
provider: string;
|
|
48
67
|
compatibility: string[];
|
|
68
|
+
intent_keywords: string[];
|
|
49
69
|
models: FeltDBModuleModel[];
|
|
50
70
|
relationships: FeltDBModuleRelationship[];
|
|
51
71
|
events: string[];
|
|
@@ -54,7 +74,7 @@ export interface FeltDBModuleDefinition {
|
|
|
54
74
|
configuration: FeltDBModuleRequirement[];
|
|
55
75
|
secrets: FeltDBModuleRequirement[];
|
|
56
76
|
validation: string[];
|
|
57
|
-
dependencies:
|
|
77
|
+
dependencies: FeltDBModuleDependency[];
|
|
58
78
|
authorization: Array<{
|
|
59
79
|
capability: string;
|
|
60
80
|
subject: string;
|
|
@@ -62,12 +82,21 @@ export interface FeltDBModuleDefinition {
|
|
|
62
82
|
}>;
|
|
63
83
|
patterns: FeltDBModulePattern[];
|
|
64
84
|
reconciliation: FeltDBModuleReconciliation[];
|
|
85
|
+
placement: {
|
|
86
|
+
owner_claim: string;
|
|
87
|
+
primary_application_model: string;
|
|
88
|
+
owner_field: string;
|
|
89
|
+
};
|
|
90
|
+
source_artifacts: FeltDBModuleSourceArtifact[];
|
|
91
|
+
extension_application_models?: FeltDBModulePattern["application_models"];
|
|
65
92
|
}
|
|
66
93
|
export interface FlowModuleDeclaration {
|
|
67
94
|
name: string;
|
|
68
95
|
provider: string;
|
|
69
96
|
version?: string;
|
|
70
97
|
}
|
|
98
|
+
export declare function validateFeltDBModule(module: FeltDBModuleDefinition): string[];
|
|
99
|
+
export declare function registerFeltDBModule(module: FeltDBModuleDefinition): () => void;
|
|
71
100
|
export declare function listFeltDBModules(): FeltDBModuleDefinition[];
|
|
72
101
|
export declare function resolveFeltDBModule(declaration: FlowModuleDeclaration): FeltDBModuleDefinition;
|
|
73
102
|
export declare function findFeltDBModules(query: string): FeltDBModuleDefinition[];
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,wBAAwB,GACxB,2BAA2B,GAC3B,SAAS,GACT,cAAc,CAAC;AACnB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AACD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,UAAU,GAAG,aAAa,CAAC;IACtC,SAAS,EAAE,qBAAqB,CAAC;IACjC,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AACD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,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