@feltdb/core 0.7.3 → 0.8.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/README.md +25 -0
- package/dist/application-development.d.ts +78 -0
- package/dist/application-development.d.ts.map +1 -0
- package/dist/application-development.js +153 -0
- package/dist/application-manifest.d.ts +6 -1
- package/dist/application-manifest.d.ts.map +1 -1
- package/dist/application-manifest.js +10 -3
- package/dist/canonical-application.d.ts +27 -0
- package/dist/canonical-application.d.ts.map +1 -0
- package/dist/canonical-application.js +46 -0
- package/dist/cli/ai-model-config.js +97 -0
- package/dist/cli/cli.js +1 -1
- package/dist/cli/commands.js +664 -120
- package/dist/cli/index.js +1 -1
- package/dist/cli/managed-environment.js +6 -0
- package/dist/cli/managed-project.js +6 -0
- package/dist/cli/proposal-client.js +63 -0
- package/dist/cli/publish-engine.js +165 -0
- package/dist/cli/source-sync.js +183 -0
- package/dist/create/cli.js +11 -2
- package/dist/create/create.js +38 -16
- package/dist/create/managed-account.js +82 -11
- package/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/application.rs +41 -1
- package/dist/create/server-source/crates/feltdb/src/authority_failover.rs +84 -6
- package/dist/create/server-source/crates/feltdb/src/bin/feltdb_node.rs +126 -38
- package/dist/create/server-source/crates/feltdb/src/distributed_transactions.rs +72 -34
- package/dist/create/server-source/crates/feltdb/src/lib.rs +20 -2
- package/dist/create/server-source/crates/feltdb-server/src/app_state.rs +12 -24
- package/dist/create/server-source/crates/feltdb-server/src/application_contract.rs +11 -3
- package/dist/create/server-source/crates/feltdb-server/src/authenticated_principal.rs +0 -1
- package/dist/create/server-source/crates/feltdb-server/src/certification_harness.rs +23 -22
- package/dist/create/server-source/crates/feltdb-server/src/delegation_token.rs +5 -15
- package/dist/create/server-source/crates/feltdb-server/src/durable_operations.rs +13 -28
- package/dist/create/server-source/crates/feltdb-server/src/identity.rs +111 -3
- package/dist/create/server-source/crates/feltdb-server/src/key_management.rs +28 -7
- package/dist/create/server-source/crates/feltdb-server/src/lib.rs +5 -5
- package/dist/create/server-source/crates/feltdb-server/src/main.rs +1960 -143
- package/dist/create/server-source/crates/feltdb-server/src/managed_diagnostics.rs +10 -30
- package/dist/create/server-source/crates/feltdb-server/src/membership_policy.rs +12 -4
- package/dist/create/server-source/crates/feltdb-server/src/request_telemetry.rs +8 -6
- package/dist/create/server-source/crates/feltdb-server/src/snapshot_cursor.rs +10 -14
- package/dist/create/server-source/crates/feltdb-server/src/tenancy.rs +195 -13
- package/dist/create/server-source/crates/feltdb-server/src/tenant_policies.rs +9 -21
- package/dist/create/server-source/crates/feltdb-server/src/transaction_idempotency.rs +5 -3
- package/dist/create/server-source/crates/feltdb-server/src/transaction_recovery.rs +9 -8
- package/dist/create/server-source/crates/feltdb-server/tests/revision_recovery_integration_test.rs +1 -4
- package/dist/create/template/default-project/README.md +57 -0
- package/dist/create/template/default-project/agents/activity-assistant.ts +18 -0
- package/dist/create/template/default-project/agents/project-assistant.ts +19 -0
- package/dist/create/template/default-project/capabilities/activity-summary.ts +14 -0
- package/dist/create/template/default-project/capabilities/project-search.ts +16 -0
- package/dist/create/template/default-project/capabilities/project-summary.ts +15 -0
- package/dist/create/template/default-project/feltdb.flow +174 -0
- package/dist/create/template/default-project/src/App.tsx +20 -0
- package/dist/create/template/default-project/src/context/AuthContext.tsx +27 -0
- package/dist/create/template/default-project/src/feltdb.ts +87 -0
- package/dist/create/template/default-project/src/index.tsx +14 -0
- package/dist/create/template/default-project/src/pages/Activity.tsx +7 -0
- package/dist/create/template/default-project/src/pages/Agents.tsx +15 -0
- package/dist/create/template/default-project/src/pages/Dashboard.tsx +17 -0
- package/dist/create/template/default-project/src/pages/Invitations.tsx +11 -0
- package/dist/create/template/default-project/src/pages/Projects.tsx +11 -0
- package/dist/create/template/default-project/src/pages/SignIn.tsx +8 -0
- package/dist/create/template/default-project/src/pages/SignUp.tsx +8 -0
- package/dist/create/template/default-project/src/styles-application.css +21 -0
- package/dist/create/template/default-project/src/styles.css +1 -0
- package/dist/create/template/default-project/workflows/agent-assisted-summary.ts +1 -0
- package/dist/create/template/default-project/workflows/invitation.ts +30 -0
- package/dist/create/template/default-project/workflows/project-created.ts +2 -0
- package/dist/db.d.ts +49 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +77 -0
- package/dist/error-codes.d.ts +20 -1
- package/dist/error-codes.d.ts.map +1 -1
- package/dist/error-codes.js +25 -0
- package/dist/flowspec.d.ts +1 -0
- package/dist/flowspec.d.ts.map +1 -1
- package/dist/flowspec.js +66 -11
- package/dist/http-client.d.ts +135 -14
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +79 -31
- package/dist/http-db.d.ts +15 -2
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +113 -5
- package/dist/index-core.d.ts +5 -0
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +5 -0
- package/dist/module-intent.d.ts +37 -0
- package/dist/module-intent.d.ts.map +1 -0
- package/dist/module-intent.js +81 -0
- package/dist/module.d.ts +76 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +61 -0
- package/dist/proposal.d.ts +161 -0
- package/dist/proposal.d.ts.map +1 -0
- package/dist/proposal.js +232 -0
- package/dist/studio/app.d.ts +5 -1
- package/dist/studio/app.d.ts.map +1 -1
- package/dist/studio/components/ApplicationDesigner.d.ts +2 -1
- package/dist/studio/components/ApplicationDesigner.d.ts.map +1 -1
- package/dist/studio/components/AskFeltDB.d.ts +21 -0
- package/dist/studio/components/AskFeltDB.d.ts.map +1 -0
- package/dist/studio/components/ContractInspector.d.ts +7 -0
- package/dist/studio/components/ContractInspector.d.ts.map +1 -0
- package/dist/studio/components/ManagedInstancePanel.d.ts.map +1 -1
- package/dist/studio/components/ManagedInstancePanel.js +1 -5
- package/dist/studio/components/ModuleExplorer.d.ts +6 -0
- package/dist/studio/components/ModuleExplorer.d.ts.map +1 -0
- package/dist/studio/components/ProposalBrowser.d.ts +12 -0
- package/dist/studio/components/ProposalBrowser.d.ts.map +1 -0
- package/dist/studio/components/StateExplorer.d.ts +6 -7
- package/dist/studio/components/StateExplorer.d.ts.map +1 -1
- package/dist/studio/components/index.d.ts +4 -0
- package/dist/studio/components/index.d.ts.map +1 -1
- package/dist/studio/components/index.js +4 -4
- package/dist/studio/components-CNSNrmA9.js +2787 -0
- package/dist/studio/index.js +214 -157
- package/dist/studio/studio.css +1 -1
- package/dist/studio/utils/index.d.ts +2 -0
- package/dist/studio/utils/index.d.ts.map +1 -1
- package/dist/studio/utils/index.js +14 -12
- package/dist/studio/utils/managed-instance.d.ts +0 -4
- package/dist/studio/utils/managed-instance.d.ts.map +1 -1
- package/dist/studio/utils/managed-instance.js +0 -4
- package/dist/studio/utils/proposal-api.d.ts +53 -0
- package/dist/studio/utils/proposal-api.d.ts.map +1 -0
- package/dist/studio/utils/proposal-api.js +91 -0
- package/dist/studio/utils/service-api.d.ts +81 -0
- package/dist/studio/utils/service-api.d.ts.map +1 -0
- package/dist/studio/utils/service-api.js +51 -0
- package/dist/studio-app/assets/dist-CCOk39Uc.js +1 -0
- package/dist/studio-app/assets/{feltdb_wasm-DVKsw75S.js → feltdb_wasm-CSB6KVgw.js} +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-Dd1fnO9U.wasm +0 -0
- package/dist/studio-app/assets/index-Bncji3aN.js +43 -0
- package/dist/studio-app/assets/{index-C1GWyazR.css → index-yazaWMUN.css} +1 -1
- package/dist/studio-app/assets/lib-B2_7fcn7.js +69 -0
- package/dist/studio-app/assets/worker-CARZ5g7K.js +69 -0
- 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 +3 -0
- package/dist/workspace/local-development-authority.d.ts.map +1 -1
- package/dist/workspace/local-development-authority.js +124 -2
- package/package.json +1 -1
- package/dist/studio/components-Dxuhrv8_.js +0 -1832
- package/dist/studio-app/assets/feltdb_wasm_bg-DNyNf0yy.wasm +0 -0
- package/dist/studio-app/assets/index-B5tnmvSD.js +0 -28
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FeltDBContractSnapshot, FeltDBFlowProposal } from './application-development.js';
|
|
2
|
+
import { type FeltDBModuleDefinition, type FeltDBModuleOwnership } from './module.js';
|
|
3
|
+
export interface ModuleIntent {
|
|
4
|
+
action: 'implement' | 'extend';
|
|
5
|
+
module: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
version: string;
|
|
8
|
+
original: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ModuleImplementationPlan {
|
|
11
|
+
intent: ModuleIntent;
|
|
12
|
+
module: FeltDBModuleDefinition;
|
|
13
|
+
alreadyInstalled: boolean;
|
|
14
|
+
owner: string;
|
|
15
|
+
applicationModels: Array<{
|
|
16
|
+
name: string;
|
|
17
|
+
ownership: FeltDBModuleOwnership;
|
|
18
|
+
purpose: string;
|
|
19
|
+
}>;
|
|
20
|
+
relationships: string[];
|
|
21
|
+
events: string[];
|
|
22
|
+
workflows: string[];
|
|
23
|
+
capabilities: string[];
|
|
24
|
+
authorization: FeltDBModuleDefinition['authorization'];
|
|
25
|
+
configuration: string[];
|
|
26
|
+
secrets: string[];
|
|
27
|
+
stateFlow: string[];
|
|
28
|
+
warnings: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare function resolveModuleIntent(value: string): ModuleIntent | undefined;
|
|
31
|
+
export declare function planModuleImplementation(intent: ModuleIntent, snapshot: FeltDBContractSnapshot, currentFlow: string): ModuleImplementationPlan;
|
|
32
|
+
export declare function createModuleImplementationProposal(input: {
|
|
33
|
+
intent: string;
|
|
34
|
+
snapshot: FeltDBContractSnapshot;
|
|
35
|
+
currentFlow: string;
|
|
36
|
+
}): Promise<FeltDBFlowProposal>;
|
|
37
|
+
//# sourceMappingURL=module-intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-intent.d.ts","sourceRoot":"","sources":["../src/module-intent.ts"],"names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C,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAuBtK"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { formatFlowSpec, parseFlowSpec } from './flowspec.js';
|
|
2
|
+
import { findFeltDBModules, listFeltDBModules, resolveFeltDBModule } from './module.js';
|
|
3
|
+
async function sourceHash(source) {
|
|
4
|
+
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(source.replace(/\r\n/g, '\n')));
|
|
5
|
+
return `sha256:${Array.from(new Uint8Array(digest), byte => byte.toString(16).padStart(2, '0')).join('')}`;
|
|
6
|
+
}
|
|
7
|
+
export function resolveModuleIntent(value) {
|
|
8
|
+
const match = /^\s*implement\s+([a-z0-9][a-z0-9-]*)\s*[.!]?\s*$/i.exec(value);
|
|
9
|
+
const incrementalBilling = /^\s*(?:add|support|enable)\b.+\b(?:billing|plan|subscription)\b.*$/i.test(value);
|
|
10
|
+
if (!match && !incrementalBilling)
|
|
11
|
+
return undefined;
|
|
12
|
+
const requested = match ? match[1].toLowerCase() : 'billing';
|
|
13
|
+
const matches = findFeltDBModules(requested);
|
|
14
|
+
if (!matches.length)
|
|
15
|
+
throw new Error(`MODULE_NOT_AVAILABLE: ${requested}. No proposal created. Available modules: ${listFeltDBModules().map(module => module.id).join(', ')}`);
|
|
16
|
+
if (matches.length > 1)
|
|
17
|
+
throw new Error(`AMBIGUOUS_MODULE_INTENT: ${requested}. Available providers: ${matches.map(module => module.provider).join(', ')}`);
|
|
18
|
+
const module = matches[0];
|
|
19
|
+
return { action: match ? 'implement' : 'extend', module: module.id, provider: module.provider, version: module.version, original: value };
|
|
20
|
+
}
|
|
21
|
+
function billingOwner(spec, module) {
|
|
22
|
+
const names = new Set(spec.collections.map(collection => collection.name));
|
|
23
|
+
for (const pattern of module.patterns)
|
|
24
|
+
for (const candidate of pattern.owner_candidates)
|
|
25
|
+
if (names.has(candidate))
|
|
26
|
+
return candidate;
|
|
27
|
+
return spec.collections.find(collection => /user|account|member/i.test(collection.name))?.name ?? spec.collections[0]?.name ?? 'User';
|
|
28
|
+
}
|
|
29
|
+
export function planModuleImplementation(intent, snapshot, currentFlow) {
|
|
30
|
+
const module = resolveFeltDBModule({ name: intent.module, provider: intent.provider, version: intent.version });
|
|
31
|
+
const spec = parseFlowSpec(currentFlow);
|
|
32
|
+
const owner = billingOwner(spec, module);
|
|
33
|
+
const alreadyInstalled = Boolean(spec.modules?.some(value => value.name === module.id));
|
|
34
|
+
const pattern = module.patterns.find(value => value.owner_candidates.includes(owner)) ?? module.patterns[0];
|
|
35
|
+
const implementedEvents = new Set(spec.triggers.map(value => value.event));
|
|
36
|
+
const implementedWorkflows = new Set(spec.workflows.map(value => value.name));
|
|
37
|
+
return { intent, module, alreadyInstalled, owner, applicationModels: pattern.application_models,
|
|
38
|
+
relationships: [`BillingAccount.owner -> ${owner}`, `BillingAccount.customer -> ${module.id}.Customer`, `BillingAccount.subscription -> ${module.id}.Subscription`, `Entitlement.billing_account -> BillingAccount`],
|
|
39
|
+
events: module.reconciliation.map(value => value.event).filter(value => !implementedEvents.has(value)),
|
|
40
|
+
workflows: module.reconciliation.map(value => value.workflow).filter(value => !implementedWorkflows.has(value)),
|
|
41
|
+
capabilities: ['stripe.checkout.create', 'stripe.subscription.read', 'stripe.subscription.cancel'].filter(value => module.capabilities.includes(value)),
|
|
42
|
+
authorization: module.authorization, configuration: module.configuration.map(value => value.name), secrets: module.secrets.map(value => value.name),
|
|
43
|
+
stateFlow: [`${module.id}.subscription.updated`, `ReconcileSubscription`, `BillingAccount`, `Entitlement`],
|
|
44
|
+
warnings: ['Production webhook configuration and signature verification required'],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function addCollection(spec, collection) { if (!spec.collections.some(value => value.name === collection.name))
|
|
48
|
+
spec.collections.push(collection); }
|
|
49
|
+
export async function createModuleImplementationProposal(input) {
|
|
50
|
+
const resolved = resolveModuleIntent(input.intent);
|
|
51
|
+
if (!resolved)
|
|
52
|
+
throw new Error('NOT_A_MODULE_INTENT');
|
|
53
|
+
const plan = planModuleImplementation(resolved, input.snapshot, input.currentFlow);
|
|
54
|
+
const spec = parseFlowSpec(input.currentFlow);
|
|
55
|
+
if (resolved.action === 'extend' && !plan.alreadyInstalled)
|
|
56
|
+
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({ name: plan.module.id, provider: plan.module.provider, version: plan.module.version });
|
|
59
|
+
addCollection(spec, { name: 'BillingAccount', fields: [
|
|
60
|
+
{ name: 'owner', type: `ref ${plan.owner}`, optional: false }, { name: 'customer', type: `ref ${plan.module.id}.Customer`, optional: false },
|
|
61
|
+
{ name: 'subscription', type: `ref ${plan.module.id}.Subscription`, optional: true }, { name: 'status', type: 'text', optional: false },
|
|
62
|
+
], indexes: [] });
|
|
63
|
+
addCollection(spec, { name: 'Entitlement', fields: [{ name: 'billing_account', type: 'ref BillingAccount', optional: false }, { name: 'key', type: 'text', optional: false }, { name: 'active', type: 'boolean', optional: false }], indexes: [] });
|
|
64
|
+
if (resolved.action === 'extend')
|
|
65
|
+
addCollection(spec, { name: 'BillingPlan', fields: [
|
|
66
|
+
{ name: 'code', type: 'text', optional: false }, { name: 'interval', type: 'enum(monthly,annual)', optional: false },
|
|
67
|
+
{ name: 'price', type: `ref ${plan.module.id}.Price`, optional: false }, { name: 'active', type: 'boolean', optional: false },
|
|
68
|
+
], indexes: [] });
|
|
69
|
+
for (const reconciliation of plan.module.reconciliation) {
|
|
70
|
+
if (!spec.workflows.some(value => value.name === reconciliation.workflow))
|
|
71
|
+
spec.workflows.push({ name: reconciliation.workflow, parameters: '', steps: [{ name: 'reconcile', statements: ['read BillingAccount', 'write BillingAccount', 'write Entitlement', `capability ${plan.module.id}.subscription.read`] }] });
|
|
72
|
+
if (!spec.triggers.some(value => value.event === reconciliation.event))
|
|
73
|
+
spec.triggers.push({ event: reconciliation.event, statements: [`run ${reconciliation.workflow}`] });
|
|
74
|
+
}
|
|
75
|
+
if (!spec.policies.some(value => value.name === 'BillingAccount'))
|
|
76
|
+
spec.policies.push({ name: 'BillingAccount', statements: ['read: owner', 'write: owner'] });
|
|
77
|
+
const prefix = resolved.action === 'extend' ? 'Extend' : plan.alreadyInstalled ? 'Complete' : 'Implement';
|
|
78
|
+
return { baseContractHash: input.snapshot.contract_hash, baseFlowHash: await sourceHash(input.currentFlow), proposedFlow: formatFlowSpec(spec),
|
|
79
|
+
summary: `${prefix} ${plan.module.name}`, changes: [...(resolved.action === 'extend' ? ['BillingPlan (application-authoritative)', 'BillingPlan.price -> stripe.Price'] : plan.applicationModels.map(value => `${value.name} (${value.ownership})`)), ...plan.relationships, ...plan.workflows, ...plan.capabilities],
|
|
80
|
+
warnings: [...plan.warnings, ...(resolved.action === 'extend' ? ['Plan and price records must be configured through application data; no provider values were invented'] : [])], implementation: plan };
|
|
81
|
+
}
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type FeltDBModuleOwnership = 'external-authoritative' | 'application-authoritative' | 'derived' | 'synchronized';
|
|
2
|
+
export interface FeltDBModuleModel {
|
|
3
|
+
name: string;
|
|
4
|
+
authority: 'external';
|
|
5
|
+
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
|
+
}
|
|
15
|
+
export interface FeltDBModuleRelationship {
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
kind: 'one' | 'many';
|
|
19
|
+
}
|
|
20
|
+
export interface FeltDBModuleRequirement {
|
|
21
|
+
name: string;
|
|
22
|
+
required: boolean;
|
|
23
|
+
environments?: string[];
|
|
24
|
+
description: string;
|
|
25
|
+
}
|
|
26
|
+
export interface FeltDBModulePattern {
|
|
27
|
+
name: string;
|
|
28
|
+
when: string;
|
|
29
|
+
owner_candidates: string[];
|
|
30
|
+
application_models: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
ownership: FeltDBModuleOwnership;
|
|
33
|
+
purpose: string;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export interface FeltDBModuleReconciliation {
|
|
37
|
+
event: string;
|
|
38
|
+
workflow: string;
|
|
39
|
+
reads: string[];
|
|
40
|
+
writes: string[];
|
|
41
|
+
outcome: string;
|
|
42
|
+
}
|
|
43
|
+
export interface FeltDBModuleDefinition {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
version: string;
|
|
47
|
+
provider: string;
|
|
48
|
+
compatibility: string[];
|
|
49
|
+
models: FeltDBModuleModel[];
|
|
50
|
+
relationships: FeltDBModuleRelationship[];
|
|
51
|
+
events: string[];
|
|
52
|
+
capabilities: string[];
|
|
53
|
+
workflows: string[];
|
|
54
|
+
configuration: FeltDBModuleRequirement[];
|
|
55
|
+
secrets: FeltDBModuleRequirement[];
|
|
56
|
+
validation: string[];
|
|
57
|
+
dependencies: string[];
|
|
58
|
+
authorization: Array<{
|
|
59
|
+
capability: string;
|
|
60
|
+
subject: string;
|
|
61
|
+
implication: string;
|
|
62
|
+
}>;
|
|
63
|
+
patterns: FeltDBModulePattern[];
|
|
64
|
+
reconciliation: FeltDBModuleReconciliation[];
|
|
65
|
+
}
|
|
66
|
+
export interface FlowModuleDeclaration {
|
|
67
|
+
name: string;
|
|
68
|
+
provider: string;
|
|
69
|
+
version?: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function listFeltDBModules(): FeltDBModuleDefinition[];
|
|
72
|
+
export declare function resolveFeltDBModule(declaration: FlowModuleDeclaration): FeltDBModuleDefinition;
|
|
73
|
+
export declare function findFeltDBModules(query: string): FeltDBModuleDefinition[];
|
|
74
|
+
export declare function resolveFeltDBModules(declarations?: FlowModuleDeclaration[]): FeltDBModuleDefinition[];
|
|
75
|
+
export declare function validateResolvedModules(modules: FeltDBModuleDefinition[], environment?: string): string[];
|
|
76
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,GAAG,2BAA2B,GAAG,SAAS,GAAG,cAAc,CAAC;AACxH,MAAM,WAAW,iBAAiB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,qBAAqB,CAAC;IAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAAE;AAC3P,MAAM,WAAW,wBAAwB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE;AAC5F,MAAM,WAAW,uBAAuB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;AAC1H,MAAM,WAAW,mBAAmB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAAC,kBAAkB,EAAE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AAsB,EAAE,CAA2E;AACxI,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,qBAAqB,GAAG,sBAAsB,CAM9F;AACD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAGzE;AACD,wBAAgB,oBAAoB,CAAC,YAAY,GAAE,qBAAqB,EAAO,GAAG,sBAAsB,EAAE,CAA0F;AACpM,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,WAAW,SAAgB,GAAG,MAAM,EAAE,CAEhH"}
|
package/dist/module.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const stripe = {
|
|
2
|
+
id: 'stripe', name: 'Stripe-compatible billing', version: '1.0.0', provider: 'stripe-compatible',
|
|
3
|
+
compatibility: ['stripe', 'stripe-compatible'],
|
|
4
|
+
models: ['Customer', 'Product', 'Price', 'Subscription', 'SubscriptionItem', 'Invoice', 'PaymentIntent', 'CheckoutSession', 'PaymentMethod', 'Refund', 'WebhookEvent']
|
|
5
|
+
.map(name => ({ name, authority: 'external', ownership: 'external-authoritative', fields: [
|
|
6
|
+
{ name: 'id', type: 'text', immutable: true, externally_owned: true, application_readable: true },
|
|
7
|
+
{ name: 'status', type: 'text', optional: true, externally_owned: true, application_readable: true },
|
|
8
|
+
{ name: 'created_at', type: 'datetime', externally_owned: true, application_readable: true },
|
|
9
|
+
{ name: 'metadata', type: 'json', optional: true, externally_owned: true, application_readable: true },
|
|
10
|
+
] })),
|
|
11
|
+
relationships: [
|
|
12
|
+
{ from: 'Customer', to: 'Subscription', kind: 'many' }, { from: 'Subscription', to: 'SubscriptionItem', kind: 'many' },
|
|
13
|
+
{ from: 'SubscriptionItem', to: 'Price', kind: 'one' }, { from: 'Price', to: 'Product', kind: 'one' },
|
|
14
|
+
{ from: 'Customer', to: 'Invoice', kind: 'many' }, { from: 'Invoice', to: 'PaymentIntent', kind: 'one' },
|
|
15
|
+
],
|
|
16
|
+
events: ['stripe.customer.created', 'stripe.customer.updated', 'stripe.subscription.created', 'stripe.subscription.updated', 'stripe.subscription.deleted', 'stripe.invoice.paid', 'stripe.invoice.payment_failed', 'stripe.checkout.session.completed'],
|
|
17
|
+
capabilities: ['stripe.customer.read', 'stripe.customer.create', 'stripe.checkout.create', 'stripe.subscription.read', 'stripe.subscription.create', 'stripe.subscription.cancel', 'stripe.invoice.read', 'stripe.webhooks.receive'],
|
|
18
|
+
workflows: ['ReconcileSubscription', 'ReconcileFailedPayment'],
|
|
19
|
+
configuration: [{ name: 'STRIPE_PUBLISHABLE_KEY', required: false, description: 'Browser-safe publishable provider key' }],
|
|
20
|
+
secrets: [{ name: 'STRIPE_SECRET_KEY', required: true, description: 'Server-side provider credential' }, { name: 'STRIPE_WEBHOOK_SECRET', required: true, environments: ['production'], description: 'Webhook signature verification secret' }],
|
|
21
|
+
validation: ['Webhook receivers must verify signatures', 'Checkout creation requires authenticated authorization'],
|
|
22
|
+
dependencies: [],
|
|
23
|
+
authorization: [
|
|
24
|
+
{ capability: 'stripe.checkout.create', subject: 'authenticated', implication: 'A signed-in billing owner may create a hosted checkout session' },
|
|
25
|
+
{ capability: 'stripe.subscription.cancel', subject: 'owner', implication: 'Only the billing owner may cancel a subscription' },
|
|
26
|
+
],
|
|
27
|
+
patterns: [
|
|
28
|
+
{ name: 'organization billing', when: 'The application contains Organization or Workspace state', owner_candidates: ['Organization', 'Workspace'], application_models: [
|
|
29
|
+
{ name: 'BillingAccount', ownership: 'application-authoritative', purpose: 'Connect the application billing owner to provider state' },
|
|
30
|
+
{ name: 'Entitlement', ownership: 'derived', purpose: 'Materialize product access from reconciled subscription state' },
|
|
31
|
+
] },
|
|
32
|
+
{ name: 'user billing', when: 'The application is user-centric and has no organizational owner', owner_candidates: ['User', 'Account'], application_models: [
|
|
33
|
+
{ name: 'BillingAccount', ownership: 'application-authoritative', purpose: 'Connect the user to provider state' },
|
|
34
|
+
{ name: 'Entitlement', ownership: 'derived', purpose: 'Materialize product access from reconciled subscription state' },
|
|
35
|
+
] },
|
|
36
|
+
],
|
|
37
|
+
reconciliation: [
|
|
38
|
+
{ event: 'stripe.subscription.updated', workflow: 'ReconcileSubscription', reads: ['stripe.Subscription', 'BillingAccount'], writes: ['BillingAccount', 'Entitlement'], outcome: 'Subscription changes become application entitlements' },
|
|
39
|
+
{ event: 'stripe.invoice.payment_failed', workflow: 'ReconcileFailedPayment', reads: ['stripe.Invoice', 'BillingAccount'], writes: ['BillingAccount', 'Entitlement'], outcome: 'Failed payment state restricts derived entitlements' },
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
const definitions = new Map([[stripe.id, stripe]]);
|
|
43
|
+
export function listFeltDBModules() { return [...definitions.values()].map(value => structuredClone(value)); }
|
|
44
|
+
export function resolveFeltDBModule(declaration) {
|
|
45
|
+
const definition = definitions.get(declaration.name);
|
|
46
|
+
if (!definition)
|
|
47
|
+
throw new Error(`UNKNOWN_MODULE: ${declaration.name}`);
|
|
48
|
+
if (!definition.compatibility.includes(declaration.provider))
|
|
49
|
+
throw new Error(`INCOMPATIBLE_MODULE_PROVIDER: ${declaration.name} does not support ${declaration.provider}`);
|
|
50
|
+
if (declaration.version && declaration.version !== definition.version)
|
|
51
|
+
throw new Error(`INCOMPATIBLE_MODULE_VERSION: ${declaration.name}@${declaration.version}; available ${definition.version}`);
|
|
52
|
+
return { ...structuredClone(definition), provider: declaration.provider };
|
|
53
|
+
}
|
|
54
|
+
export function findFeltDBModules(query) {
|
|
55
|
+
const normalized = query.trim().toLowerCase();
|
|
56
|
+
return listFeltDBModules().filter(module => module.id === normalized || module.name.toLowerCase().includes(normalized) || module.compatibility.some(value => value.includes(normalized)));
|
|
57
|
+
}
|
|
58
|
+
export function resolveFeltDBModules(declarations = []) { return declarations.map(resolveFeltDBModule).sort((a, b) => a.id.localeCompare(b.id)); }
|
|
59
|
+
export function validateResolvedModules(modules, environment = 'development') {
|
|
60
|
+
return modules.flatMap(module => [...module.secrets.filter(value => value.required && (!value.environments || value.environments.includes(environment))).map(value => `${value.name} is required in ${environment} runtime configuration`), ...module.capabilities.filter(value => value.endsWith('.create')).map(value => `${value} requires an explicit authorization policy`)]);
|
|
61
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type FeltDBContractSnapshot } from './application-development.js';
|
|
2
|
+
export declare const FELTDB_PROPOSAL_COLLECTION = "_feltdb.Proposal";
|
|
3
|
+
export declare const FELTDB_PROPOSAL_EVENT_COLLECTION = "_feltdb.ProposalEvent";
|
|
4
|
+
export declare const FELTDB_PROPOSAL_PREVIEW_COLLECTION = "_feltdb.ProposalPreview";
|
|
5
|
+
export declare const FELTDB_PROPOSAL_VERSION = 1;
|
|
6
|
+
export type ProposalStatus = 'proposed' | 'validated' | 'previewed' | 'approved' | 'applied' | 'rejected' | 'expired';
|
|
7
|
+
export interface ProposalSourceOperation {
|
|
8
|
+
path: string;
|
|
9
|
+
operation: 'add' | 'modify' | 'delete';
|
|
10
|
+
}
|
|
11
|
+
export interface FeltDBProposalRecord {
|
|
12
|
+
id: string;
|
|
13
|
+
application_id: string;
|
|
14
|
+
environment: string;
|
|
15
|
+
status: ProposalStatus;
|
|
16
|
+
proposal_version: 1;
|
|
17
|
+
base_contract_version: number;
|
|
18
|
+
base_contract_hash: string;
|
|
19
|
+
base_flow_hash: string;
|
|
20
|
+
proposed_flow: string;
|
|
21
|
+
contract_diff: string[];
|
|
22
|
+
source_plan: {
|
|
23
|
+
files: ProposalSourceOperation[];
|
|
24
|
+
};
|
|
25
|
+
summary: string;
|
|
26
|
+
warnings: string[];
|
|
27
|
+
created_by: string;
|
|
28
|
+
created_at: string | number;
|
|
29
|
+
approved_by?: string;
|
|
30
|
+
approved_at?: string | number;
|
|
31
|
+
applied_at?: string | number;
|
|
32
|
+
preview_id?: string;
|
|
33
|
+
expires_at?: string | number;
|
|
34
|
+
metadata: Record<string, string>;
|
|
35
|
+
parent_proposal_id?: string;
|
|
36
|
+
module_versions: {
|
|
37
|
+
id: string;
|
|
38
|
+
provider: string;
|
|
39
|
+
version: string;
|
|
40
|
+
}[];
|
|
41
|
+
base_module_versions?: {
|
|
42
|
+
id: string;
|
|
43
|
+
provider: string;
|
|
44
|
+
version: string;
|
|
45
|
+
}[];
|
|
46
|
+
module_impact: {
|
|
47
|
+
modules: string[];
|
|
48
|
+
models: string[];
|
|
49
|
+
relationships: string[];
|
|
50
|
+
events: string[];
|
|
51
|
+
workflows: string[];
|
|
52
|
+
capabilities: string[];
|
|
53
|
+
authorization: string[];
|
|
54
|
+
configuration: string[];
|
|
55
|
+
secrets: string[];
|
|
56
|
+
ownership: Record<string, string>;
|
|
57
|
+
state_flow: string[];
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface FeltDBProposalEvent {
|
|
61
|
+
id: string;
|
|
62
|
+
proposal_id: string;
|
|
63
|
+
from_status?: ProposalStatus;
|
|
64
|
+
to_status: ProposalStatus;
|
|
65
|
+
actor: string;
|
|
66
|
+
created_at: string | number;
|
|
67
|
+
metadata: Record<string, string>;
|
|
68
|
+
}
|
|
69
|
+
export interface ProposalReadiness {
|
|
70
|
+
status: ProposalStatus;
|
|
71
|
+
readiness: 'ready' | 'blocked';
|
|
72
|
+
blockers: ('contract_changed' | 'flow_changed' | 'module_versions_changed' | 'expired')[];
|
|
73
|
+
notes: string[];
|
|
74
|
+
current_contract_hash: string;
|
|
75
|
+
proposal_contract_hash: string;
|
|
76
|
+
current_flow_hash: string;
|
|
77
|
+
proposal_flow_hash: string;
|
|
78
|
+
stale: boolean;
|
|
79
|
+
expires_at?: string | number;
|
|
80
|
+
}
|
|
81
|
+
export interface FeltDBProposalPreviewArtifact {
|
|
82
|
+
preview_id: string;
|
|
83
|
+
proposal_id: string;
|
|
84
|
+
application_id: string;
|
|
85
|
+
environment: string;
|
|
86
|
+
proposal_hash: string;
|
|
87
|
+
created_at: string;
|
|
88
|
+
expires_at: string;
|
|
89
|
+
status: 'ready';
|
|
90
|
+
current: FeltDBContractSnapshot;
|
|
91
|
+
proposed: FeltDBContractSnapshot;
|
|
92
|
+
current_contract: FeltDBContractSnapshot;
|
|
93
|
+
proposed_contract: FeltDBContractSnapshot;
|
|
94
|
+
semantic_diff: string[];
|
|
95
|
+
state_flow: string[];
|
|
96
|
+
capabilities: unknown[];
|
|
97
|
+
workflows: unknown[];
|
|
98
|
+
authorization: unknown[];
|
|
99
|
+
configuration: string[];
|
|
100
|
+
secrets: string[];
|
|
101
|
+
modules: string[];
|
|
102
|
+
ownership: Record<string, string>;
|
|
103
|
+
relationships: string[];
|
|
104
|
+
events: string[];
|
|
105
|
+
seeded_records: {
|
|
106
|
+
collection: string;
|
|
107
|
+
id: string;
|
|
108
|
+
preview_data: true;
|
|
109
|
+
}[];
|
|
110
|
+
data_classification: 'synthetic_preview';
|
|
111
|
+
external_side_effects: 'simulated';
|
|
112
|
+
readiness: ProposalReadiness;
|
|
113
|
+
proposal: FeltDBProposalRecord;
|
|
114
|
+
}
|
|
115
|
+
/** Canonical human diagnostic used by CLI and Studio text surfaces. */
|
|
116
|
+
export declare function renderProposalDiagnostic(proposal: FeltDBProposalRecord, options?: {
|
|
117
|
+
readiness?: ProposalReadiness;
|
|
118
|
+
history?: FeltDBProposalEvent[];
|
|
119
|
+
preview?: FeltDBProposalPreviewArtifact;
|
|
120
|
+
}): string[];
|
|
121
|
+
export interface ProposalStore {
|
|
122
|
+
get<T>(collection: string, id: string): Promise<T | undefined>;
|
|
123
|
+
list<T>(collection: string): Promise<T[]>;
|
|
124
|
+
create<T>(collection: string, id: string, value: T): Promise<void>;
|
|
125
|
+
replace<T>(collection: string, id: string, value: T): Promise<void>;
|
|
126
|
+
}
|
|
127
|
+
export interface ProposalContext {
|
|
128
|
+
source: string;
|
|
129
|
+
snapshot: FeltDBContractSnapshot;
|
|
130
|
+
}
|
|
131
|
+
export declare class FeltDBProposalService {
|
|
132
|
+
private store;
|
|
133
|
+
private context;
|
|
134
|
+
private repositoryAuthority?;
|
|
135
|
+
constructor(store: ProposalStore, context: () => Promise<ProposalContext>, repositoryAuthority?: string | undefined);
|
|
136
|
+
create(input: {
|
|
137
|
+
application_id: string;
|
|
138
|
+
environment: string;
|
|
139
|
+
base_contract_hash: string;
|
|
140
|
+
base_flow_hash: string;
|
|
141
|
+
proposed_flow: string;
|
|
142
|
+
summary: string;
|
|
143
|
+
warnings?: string[];
|
|
144
|
+
actor: string;
|
|
145
|
+
metadata?: Record<string, string>;
|
|
146
|
+
parent_proposal_id?: string;
|
|
147
|
+
expires_at?: string | number;
|
|
148
|
+
}): Promise<FeltDBProposalRecord>;
|
|
149
|
+
list(): Promise<FeltDBProposalRecord[]>;
|
|
150
|
+
get(id: string): Promise<FeltDBProposalRecord>;
|
|
151
|
+
history(id: string): Promise<FeltDBProposalEvent[]>;
|
|
152
|
+
readiness(id: string): Promise<ProposalReadiness>;
|
|
153
|
+
validate(id: string, actor: string): Promise<FeltDBProposalRecord>;
|
|
154
|
+
preview(id: string, actor: string): Promise<FeltDBProposalPreviewArtifact>;
|
|
155
|
+
getPreview(id: string): Promise<FeltDBProposalPreviewArtifact>;
|
|
156
|
+
transition(id: string, status: 'approved' | 'rejected' | 'expired' | 'applied', actor: string, authority?: string, approveAuthorization?: boolean): Promise<FeltDBProposalRecord>;
|
|
157
|
+
private assertMutable;
|
|
158
|
+
private move;
|
|
159
|
+
private event;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=proposal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposal.d.ts","sourceRoot":"","sources":["../src/proposal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,sBAAsB,EAE5B,MAAM,8BAA8B,CAAC;AAGtC,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAC7D,eAAO,MAAM,gCAAgC,0BAA0B,CAAC;AACxE,eAAO,MAAM,kCAAkC,4BAA4B,CAAC;AAC5E,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAazC,MAAM,MAAM,cAAc,GAAG,UAA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