@feltdb/core 0.7.4 → 0.8.1
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 +10 -3
- package/dist/application-development.d.ts.map +1 -1
- package/dist/application-development.js +11 -1
- package/dist/application-manifest.d.ts +2 -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/canonical-application.d.ts +1 -0
- package/dist/canonical-application.d.ts.map +1 -1
- package/dist/canonical-application.js +3 -2
- package/dist/cli/ai-model-config.js +3 -3
- package/dist/cli/cli.js +1 -1
- package/dist/cli/commands.js +321 -45
- 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 +16 -3
- package/dist/cli/publish-engine.js +8 -5
- package/dist/cli/repository-evidence.js +55 -0
- package/dist/cli/source-sync.js +220 -61
- package/dist/convergence.d.ts +55 -0
- package/dist/convergence.d.ts.map +1 -0
- package/dist/convergence.js +63 -0
- package/dist/create/cli.js +10 -1
- package/dist/create/create.js +10 -12
- package/dist/create/managed-account.js +72 -7
- package/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/application.rs +14 -0
- 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/connections.rs +14 -0
- 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 +79 -14
- 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 +1929 -261
- 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 +191 -22
- 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/feltdb.flow +5 -0
- 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 +1 -0
- package/dist/flowspec.d.ts.map +1 -1
- package/dist/flowspec.js +51 -12
- package/dist/http-client.d.ts +166 -14
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +91 -31
- package/dist/http-db.d.ts +3 -0
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +28 -3
- 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/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 +51 -0
- package/dist/module-intent.d.ts.map +1 -0
- package/dist/module-intent.js +230 -0
- package/dist/module.d.ts +105 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +566 -0
- package/dist/proposal.d.ts +92 -4
- package/dist/proposal.d.ts.map +1 -1
- package/dist/proposal.js +150 -6
- package/dist/studio/app.d.ts +3 -1
- package/dist/studio/app.d.ts.map +1 -1
- package/dist/studio/components/AskFeltDB.d.ts +2 -1
- package/dist/studio/components/AskFeltDB.d.ts.map +1 -1
- 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 +10 -1
- package/dist/studio/components/ProposalBrowser.d.ts.map +1 -1
- 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 +2 -0
- package/dist/studio/components/index.d.ts.map +1 -1
- package/dist/studio/components/index.js +4 -4
- package/dist/studio/components-Duq2xQWt.js +2845 -0
- package/dist/studio/index.js +193 -147
- 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 +56 -0
- package/dist/studio/utils/proposal-api.d.ts.map +1 -0
- package/dist/studio/utils/proposal-api.js +94 -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/{feltdb_wasm-B-Ccgccb.js → feltdb_wasm-bIqcRzAr.js} +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-BE79okwX.wasm +0 -0
- package/dist/studio-app/assets/{index-BRrmvaKw.css → index-Cd_NPw14.css} +1 -1
- package/dist/studio-app/assets/index-XGYdlElN.js +29 -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 +2 -0
- package/dist/workspace/local-development-authority.d.ts.map +1 -1
- package/dist/workspace/local-development-authority.js +128 -4
- package/package.json +1 -1
- package/dist/studio/components-Bm4sjhcX.js +0 -2162
- package/dist/studio-app/assets/dist-DA1MYSzp.js +0 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-wH3enJIA.wasm +0 -0
- package/dist/studio-app/assets/index-CEIqowCh.js +0 -42
- package/dist/studio-app/assets/lib-B2_7fcn7.js +0 -69
- package/dist/studio-app/assets/worker-CARZ5g7K.js +0 -69
package/dist/proposal.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type FeltDBContractSnapshot } from './application-development.js';
|
|
2
|
+
import { type ApplicationUnderstanding, type ObservedEvidenceInput } from './application-understanding.js';
|
|
2
3
|
export declare const FELTDB_PROPOSAL_COLLECTION = "_feltdb.Proposal";
|
|
3
4
|
export declare const FELTDB_PROPOSAL_EVENT_COLLECTION = "_feltdb.ProposalEvent";
|
|
5
|
+
export declare const FELTDB_PROPOSAL_PREVIEW_COLLECTION = "_feltdb.ProposalPreview";
|
|
6
|
+
export declare const FELTDB_CONVERGENCE_COLLECTION = "_feltdb.Convergence";
|
|
4
7
|
export declare const FELTDB_PROPOSAL_VERSION = 1;
|
|
5
8
|
export type ProposalStatus = 'proposed' | 'validated' | 'previewed' | 'approved' | 'applied' | 'rejected' | 'expired';
|
|
6
9
|
export interface ProposalSourceOperation {
|
|
7
10
|
path: string;
|
|
8
11
|
operation: 'add' | 'modify' | 'delete';
|
|
12
|
+
role?: string;
|
|
9
13
|
}
|
|
10
14
|
export interface FeltDBProposalRecord {
|
|
11
15
|
id: string;
|
|
@@ -28,9 +32,36 @@ export interface FeltDBProposalRecord {
|
|
|
28
32
|
approved_by?: string;
|
|
29
33
|
approved_at?: string | number;
|
|
30
34
|
applied_at?: string | number;
|
|
35
|
+
preview_id?: string;
|
|
31
36
|
expires_at?: string | number;
|
|
32
37
|
metadata: Record<string, string>;
|
|
33
38
|
parent_proposal_id?: string;
|
|
39
|
+
module_versions: {
|
|
40
|
+
id: string;
|
|
41
|
+
provider: string;
|
|
42
|
+
version: string;
|
|
43
|
+
}[];
|
|
44
|
+
base_module_versions?: {
|
|
45
|
+
id: string;
|
|
46
|
+
provider: string;
|
|
47
|
+
version: string;
|
|
48
|
+
}[];
|
|
49
|
+
evidence_hash?: string;
|
|
50
|
+
understanding_hash?: string;
|
|
51
|
+
understanding?: ApplicationUnderstanding;
|
|
52
|
+
module_impact: {
|
|
53
|
+
modules: string[];
|
|
54
|
+
models: string[];
|
|
55
|
+
relationships: string[];
|
|
56
|
+
events: string[];
|
|
57
|
+
workflows: string[];
|
|
58
|
+
capabilities: string[];
|
|
59
|
+
authorization: string[];
|
|
60
|
+
configuration: string[];
|
|
61
|
+
secrets: string[];
|
|
62
|
+
ownership: Record<string, string>;
|
|
63
|
+
state_flow: string[];
|
|
64
|
+
};
|
|
34
65
|
}
|
|
35
66
|
export interface FeltDBProposalEvent {
|
|
36
67
|
id: string;
|
|
@@ -41,6 +72,58 @@ export interface FeltDBProposalEvent {
|
|
|
41
72
|
created_at: string | number;
|
|
42
73
|
metadata: Record<string, string>;
|
|
43
74
|
}
|
|
75
|
+
export interface ProposalReadiness {
|
|
76
|
+
status: ProposalStatus;
|
|
77
|
+
readiness: 'ready' | 'blocked';
|
|
78
|
+
blockers: ('contract_changed' | 'flow_changed' | 'module_versions_changed' | 'evidence_changed' | 'expired')[];
|
|
79
|
+
notes: string[];
|
|
80
|
+
current_contract_hash: string;
|
|
81
|
+
proposal_contract_hash: string;
|
|
82
|
+
current_flow_hash: string;
|
|
83
|
+
proposal_flow_hash: string;
|
|
84
|
+
stale: boolean;
|
|
85
|
+
expires_at?: string | number;
|
|
86
|
+
}
|
|
87
|
+
export interface FeltDBProposalPreviewArtifact {
|
|
88
|
+
preview_id: string;
|
|
89
|
+
proposal_id: string;
|
|
90
|
+
application_id: string;
|
|
91
|
+
environment: string;
|
|
92
|
+
proposal_hash: string;
|
|
93
|
+
created_at: string;
|
|
94
|
+
expires_at: string;
|
|
95
|
+
status: 'ready';
|
|
96
|
+
current: FeltDBContractSnapshot;
|
|
97
|
+
proposed: FeltDBContractSnapshot;
|
|
98
|
+
current_contract: FeltDBContractSnapshot;
|
|
99
|
+
proposed_contract: FeltDBContractSnapshot;
|
|
100
|
+
semantic_diff: string[];
|
|
101
|
+
state_flow: string[];
|
|
102
|
+
capabilities: unknown[];
|
|
103
|
+
workflows: unknown[];
|
|
104
|
+
authorization: unknown[];
|
|
105
|
+
configuration: string[];
|
|
106
|
+
secrets: string[];
|
|
107
|
+
modules: string[];
|
|
108
|
+
ownership: Record<string, string>;
|
|
109
|
+
relationships: string[];
|
|
110
|
+
events: string[];
|
|
111
|
+
seeded_records: {
|
|
112
|
+
collection: string;
|
|
113
|
+
id: string;
|
|
114
|
+
preview_data: true;
|
|
115
|
+
}[];
|
|
116
|
+
data_classification: 'synthetic_preview';
|
|
117
|
+
external_side_effects: 'simulated';
|
|
118
|
+
readiness: ProposalReadiness;
|
|
119
|
+
proposal: FeltDBProposalRecord;
|
|
120
|
+
}
|
|
121
|
+
/** Canonical human diagnostic used by CLI and Studio text surfaces. */
|
|
122
|
+
export declare function renderProposalDiagnostic(proposal: FeltDBProposalRecord, options?: {
|
|
123
|
+
readiness?: ProposalReadiness;
|
|
124
|
+
history?: FeltDBProposalEvent[];
|
|
125
|
+
preview?: FeltDBProposalPreviewArtifact;
|
|
126
|
+
}): string[];
|
|
44
127
|
export interface ProposalStore {
|
|
45
128
|
get<T>(collection: string, id: string): Promise<T | undefined>;
|
|
46
129
|
list<T>(collection: string): Promise<T[]>;
|
|
@@ -50,6 +133,7 @@ export interface ProposalStore {
|
|
|
50
133
|
export interface ProposalContext {
|
|
51
134
|
source: string;
|
|
52
135
|
snapshot: FeltDBContractSnapshot;
|
|
136
|
+
observations?: ObservedEvidenceInput[];
|
|
53
137
|
}
|
|
54
138
|
export declare class FeltDBProposalService {
|
|
55
139
|
private store;
|
|
@@ -68,15 +152,19 @@ export declare class FeltDBProposalService {
|
|
|
68
152
|
metadata?: Record<string, string>;
|
|
69
153
|
parent_proposal_id?: string;
|
|
70
154
|
expires_at?: string | number;
|
|
155
|
+
understanding?: ApplicationUnderstanding;
|
|
156
|
+
contract_diff?: string[];
|
|
157
|
+
source_plan?: {
|
|
158
|
+
files: ProposalSourceOperation[];
|
|
159
|
+
};
|
|
71
160
|
}): Promise<FeltDBProposalRecord>;
|
|
72
161
|
list(): Promise<FeltDBProposalRecord[]>;
|
|
73
162
|
get(id: string): Promise<FeltDBProposalRecord>;
|
|
74
163
|
history(id: string): Promise<FeltDBProposalEvent[]>;
|
|
164
|
+
readiness(id: string): Promise<ProposalReadiness>;
|
|
75
165
|
validate(id: string, actor: string): Promise<FeltDBProposalRecord>;
|
|
76
|
-
preview(id: string, actor: string): Promise<
|
|
77
|
-
|
|
78
|
-
contract: FeltDBContractSnapshot;
|
|
79
|
-
}>;
|
|
166
|
+
preview(id: string, actor: string): Promise<FeltDBProposalPreviewArtifact>;
|
|
167
|
+
getPreview(id: string): Promise<FeltDBProposalPreviewArtifact>;
|
|
80
168
|
transition(id: string, status: 'approved' | 'rejected' | 'expired' | 'applied', actor: string, authority?: string, approveAuthorization?: boolean): Promise<FeltDBProposalRecord>;
|
|
81
169
|
private assertMutable;
|
|
82
170
|
private move;
|
package/dist/proposal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposal.d.ts","sourceRoot":"","sources":["../src/proposal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,sBAAsB,EAE5B,MAAM,8BAA8B,CAAC;AAEtC,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAC7D,eAAO,MAAM,g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BAAoB,CAAC;IAI9C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAInD,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAoBjD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA+BlE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAqB1E,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAS9D,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,oBAAoB,UAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkBrL,OAAO,CAAC,aAAa;YAIP,IAAI;YAKJ,KAAK;CAKpB"}
|
package/dist/proposal.js
CHANGED
|
@@ -1,7 +1,57 @@
|
|
|
1
1
|
import { createContractSnapshot, flowSourceHash, validateFlowProposal, } from './application-development.js';
|
|
2
|
+
import { validateResolvedModules } from './module.js';
|
|
3
|
+
import { collectApplicationUnderstanding } from './application-understanding.js';
|
|
4
|
+
import { resolveModuleIntent } from './module-intent.js';
|
|
2
5
|
export const FELTDB_PROPOSAL_COLLECTION = '_feltdb.Proposal';
|
|
3
6
|
export const FELTDB_PROPOSAL_EVENT_COLLECTION = '_feltdb.ProposalEvent';
|
|
7
|
+
export const FELTDB_PROPOSAL_PREVIEW_COLLECTION = '_feltdb.ProposalPreview';
|
|
8
|
+
export const FELTDB_CONVERGENCE_COLLECTION = '_feltdb.Convergence';
|
|
4
9
|
export const FELTDB_PROPOSAL_VERSION = 1;
|
|
10
|
+
function redactProposalSecretValues(input) {
|
|
11
|
+
const visit = (value, key = '') => {
|
|
12
|
+
if (value === null || value === undefined)
|
|
13
|
+
return value;
|
|
14
|
+
if (typeof value === 'string')
|
|
15
|
+
return /(?:sk_(?:live|test)_|whsec_|-----BEGIN PRIVATE KEY-----)/.test(value) ? '[REDACTED]' : value;
|
|
16
|
+
if (Array.isArray(value))
|
|
17
|
+
return value.map(item => visit(item, key));
|
|
18
|
+
if (typeof value === 'object')
|
|
19
|
+
return Object.fromEntries(Object.entries(value).map(([name, child]) => [name, /secret|password|token|api_?key|credential|private_?key/i.test(name) && name !== 'secrets' ? '[REDACTED]' : visit(child, name)]));
|
|
20
|
+
return /secret|password|token|api_?key|credential|private_?key/i.test(key) ? '[REDACTED]' : value;
|
|
21
|
+
};
|
|
22
|
+
return visit(structuredClone(input));
|
|
23
|
+
}
|
|
24
|
+
/** Canonical human diagnostic used by CLI and Studio text surfaces. */
|
|
25
|
+
export function renderProposalDiagnostic(proposal, options = {}) {
|
|
26
|
+
const impact = proposal.module_impact;
|
|
27
|
+
const section = (name, values) => values.length ? [name, ...values.map(value => ` ${value}`)] : [];
|
|
28
|
+
const readiness = options.readiness;
|
|
29
|
+
return [
|
|
30
|
+
`Proposal: ${proposal.id}`,
|
|
31
|
+
proposal.summary,
|
|
32
|
+
`Status ${proposal.status.toUpperCase()}`,
|
|
33
|
+
`Application ${proposal.application_id}`,
|
|
34
|
+
`Environment ${proposal.environment}`,
|
|
35
|
+
`Contract v${proposal.base_contract_version} ${proposal.base_contract_hash}`,
|
|
36
|
+
`Flow ${proposal.base_flow_hash}`,
|
|
37
|
+
...(proposal.understanding ? ['UNDERSTANDING', ...proposal.understanding.inferences.map(value => ` ${Math.round(value.confidence * 100)}% ${value.claim} = ${String(value.value)} [${value.authority}]`), ...proposal.understanding.unknowns.map(value => ` ? ${value.claim} — ${value.reason}`)] : []),
|
|
38
|
+
...(proposal.parent_proposal_id ? [`Based on ${proposal.parent_proposal_id}`] : []),
|
|
39
|
+
...section('MODULES', proposal.module_versions.map(value => `+ ${value.id} (${value.provider}) ${value.version}`)),
|
|
40
|
+
...section('STATE', impact.models.map(value => `+ ${value}`)),
|
|
41
|
+
...section('RELATIONSHIPS', impact.relationships.map(value => `+ ${value}`)),
|
|
42
|
+
...section('WORKFLOWS', impact.workflows.map(value => `+ ${value}`)),
|
|
43
|
+
...section('EVENTS', impact.events.map(value => `+ ${value}`)),
|
|
44
|
+
...section('CAPABILITIES', impact.capabilities.map(value => `+ ${value}`)),
|
|
45
|
+
...section('AUTHORIZATION', impact.authorization.map(value => `+ ${value}`)),
|
|
46
|
+
...section('CONFIGURATION', [...impact.configuration.map(value => `${value} configuration`), ...impact.secrets.map(value => `${value} required / secret`)]),
|
|
47
|
+
...(readiness ? ['READINESS',
|
|
48
|
+
` ${readiness.stale ? '!' : '✓'} Contract and flow ${readiness.stale ? 'stale' : 'current'}`,
|
|
49
|
+
` ${readiness.blockers.length ? readiness.blockers.join(', ') : 'No blockers'}`] : []),
|
|
50
|
+
...(options.preview ? ['PREVIEW', ' Current → Proposed available', ` ${options.preview.preview_id}`] : []),
|
|
51
|
+
...section('HISTORY', (options.history ?? []).map(value => `✓ ${value.to_status}`)),
|
|
52
|
+
...section('WARNINGS', proposal.warnings.map(value => `! ${value}`)),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
5
55
|
const transitions = {
|
|
6
56
|
proposed: ['validated', 'rejected'], validated: ['previewed', 'rejected'], previewed: ['approved', 'rejected'],
|
|
7
57
|
approved: ['applied', 'expired'], applied: [], rejected: [], expired: [],
|
|
@@ -22,11 +72,17 @@ export class FeltDBProposalService {
|
|
|
22
72
|
if (input.base_contract_hash !== current.snapshot.contract_hash || input.base_flow_hash !== await flowSourceHash(current.source))
|
|
23
73
|
throw new Error('STALE_PROPOSAL');
|
|
24
74
|
const id = `p_${crypto.randomUUID().replace(/-/g, '')}`;
|
|
25
|
-
const
|
|
75
|
+
const safeInput = redactProposalSecretValues(input);
|
|
76
|
+
const record = { id, application_id: safeInput.application_id, environment: safeInput.environment,
|
|
26
77
|
status: 'proposed', proposal_version: FELTDB_PROPOSAL_VERSION, base_contract_version: current.snapshot.contract_version,
|
|
27
|
-
base_contract_hash:
|
|
28
|
-
contract_diff: [], source_plan: { files: [] }, summary:
|
|
29
|
-
created_at: new Date().toISOString(), expires_at:
|
|
78
|
+
base_contract_hash: safeInput.base_contract_hash, base_flow_hash: safeInput.base_flow_hash, proposed_flow: safeInput.proposed_flow,
|
|
79
|
+
contract_diff: safeInput.contract_diff ?? [], source_plan: safeInput.source_plan ?? { files: [] }, summary: safeInput.summary, warnings: safeInput.warnings ?? [], created_by: safeInput.actor,
|
|
80
|
+
created_at: new Date().toISOString(), expires_at: safeInput.expires_at, metadata: safeInput.metadata ?? {}, parent_proposal_id: safeInput.parent_proposal_id,
|
|
81
|
+
base_module_versions: current.snapshot.modules.map(value => ({ id: value.id, provider: value.provider, version: value.version })),
|
|
82
|
+
module_versions: current.snapshot.modules.map(value => ({ id: value.id, provider: value.provider, version: value.version })),
|
|
83
|
+
evidence_hash: safeInput.understanding?.evidence_hash, understanding_hash: safeInput.understanding?.understanding_hash,
|
|
84
|
+
understanding: safeInput.understanding,
|
|
85
|
+
module_impact: { modules: [], models: [], relationships: [], events: [], workflows: [], capabilities: [], authorization: [], configuration: [], secrets: [], ownership: {}, state_flow: [] } };
|
|
30
86
|
await this.store.create(FELTDB_PROPOSAL_COLLECTION, id, record);
|
|
31
87
|
await this.event(id, undefined, 'proposed', input.actor);
|
|
32
88
|
return record;
|
|
@@ -41,6 +97,35 @@ export class FeltDBProposalService {
|
|
|
41
97
|
async history(id) {
|
|
42
98
|
return (await this.store.list(FELTDB_PROPOSAL_EVENT_COLLECTION)).filter(value => value.proposal_id === id);
|
|
43
99
|
}
|
|
100
|
+
async readiness(id) {
|
|
101
|
+
const record = await this.get(id);
|
|
102
|
+
const current = await this.context();
|
|
103
|
+
const currentFlowHash = await flowSourceHash(current.source);
|
|
104
|
+
const currentModules = current.snapshot.modules.map(value => ({ id: value.id, provider: value.provider, version: value.version }));
|
|
105
|
+
const blockers = [];
|
|
106
|
+
if (record.base_contract_hash !== current.snapshot.contract_hash)
|
|
107
|
+
blockers.push('contract_changed');
|
|
108
|
+
if (record.base_flow_hash !== currentFlowHash)
|
|
109
|
+
blockers.push('flow_changed');
|
|
110
|
+
if (JSON.stringify(record.base_module_versions ?? []) !== JSON.stringify(currentModules))
|
|
111
|
+
blockers.push('module_versions_changed');
|
|
112
|
+
if (record.understanding) {
|
|
113
|
+
let moduleIntent;
|
|
114
|
+
try {
|
|
115
|
+
moduleIntent = resolveModuleIntent(record.understanding.intent);
|
|
116
|
+
}
|
|
117
|
+
catch { }
|
|
118
|
+
const currentUnderstanding = await collectApplicationUnderstanding({ intent: record.understanding.intent, snapshot: current.snapshot, currentFlow: current.source, moduleIntent, observations: current.observations, now: record.understanding.created_at });
|
|
119
|
+
if (currentUnderstanding.evidence_hash !== record.evidence_hash)
|
|
120
|
+
blockers.push('evidence_changed');
|
|
121
|
+
}
|
|
122
|
+
if (record.expires_at && (typeof record.expires_at === 'number' ? record.expires_at * 1000 : Date.parse(record.expires_at)) <= Date.now())
|
|
123
|
+
blockers.push('expired');
|
|
124
|
+
return { status: record.status, readiness: blockers.length ? 'blocked' : 'ready', blockers, notes: [],
|
|
125
|
+
current_contract_hash: current.snapshot.contract_hash, proposal_contract_hash: record.base_contract_hash,
|
|
126
|
+
current_flow_hash: currentFlowHash, proposal_flow_hash: record.base_flow_hash,
|
|
127
|
+
stale: blockers.some(value => value !== 'expired'), expires_at: record.expires_at };
|
|
128
|
+
}
|
|
44
129
|
async validate(id, actor) {
|
|
45
130
|
const record = await this.get(id);
|
|
46
131
|
this.assertMutable(record, 'proposed');
|
|
@@ -52,8 +137,25 @@ export class FeltDBProposalService {
|
|
|
52
137
|
...review.diff.added.map(value => `+ ${value}`), ...review.diff.changed.map(value => `~ ${value}`),
|
|
53
138
|
...review.diff.removed.map(value => `- ${value}`),
|
|
54
139
|
];
|
|
55
|
-
record.source_plan
|
|
140
|
+
if (!record.source_plan.files.length)
|
|
141
|
+
record.source_plan = { files: [{ path: 'feltdb.flow', operation: 'modify' }, { path: 'src/feltdb/generated-contract.ts', operation: 'modify' }] };
|
|
56
142
|
record.warnings = [...new Set([...record.warnings, ...review.authorizationChanges.map(value => `Authorization ${value.widening ? 'widened' : 'changed'}: ${value.policy}: ${(value.before ?? []).join(' | ')} -> ${(value.after ?? []).join(' | ')}`)])];
|
|
143
|
+
record.warnings = [...new Set([...record.warnings, ...validateResolvedModules(review.proposedContract.manifest.modules ?? [], record.environment)])];
|
|
144
|
+
record.module_versions = (review.proposedContract.manifest.modules ?? []).map(value => ({ id: value.id, provider: value.provider, version: value.version }));
|
|
145
|
+
const moduleIds = new Set((review.proposedContract.manifest.modules ?? []).map(value => value.id));
|
|
146
|
+
record.module_impact = {
|
|
147
|
+
modules: [...moduleIds],
|
|
148
|
+
models: review.proposedSpec.collections.flatMap(collection => collection.fields.map(field => field.type.startsWith('ref ') ? field.type.slice(4) : '').filter(value => value.includes('.') && moduleIds.has(value.split('.')[0]))),
|
|
149
|
+
relationships: review.proposedSpec.collections.flatMap(collection => collection.fields.filter(field => field.type.startsWith('ref ')).map(field => `${collection.name}.${field.name} -> ${field.type.slice(4)}`)),
|
|
150
|
+
events: review.proposedSpec.triggers.map(value => value.event).filter(value => moduleIds.has(value.split('.')[0])),
|
|
151
|
+
workflows: review.proposedSpec.workflows.map(value => value.name),
|
|
152
|
+
capabilities: review.proposedContract.manifest.capabilities.filter(value => value.provider && moduleIds.has(value.provider)).map(value => value.name),
|
|
153
|
+
authorization: review.proposedSpec.policies.flatMap(value => value.statements.map(statement => `${value.name}: ${statement}`)),
|
|
154
|
+
configuration: (review.proposedContract.manifest.modules ?? []).flatMap(value => value.configuration.map(item => item.name)),
|
|
155
|
+
secrets: (review.proposedContract.manifest.modules ?? []).flatMap(value => value.secrets.map(item => item.name)),
|
|
156
|
+
ownership: Object.fromEntries((review.proposedContract.manifest.modules ?? []).flatMap(value => value.models.map(model => [`${value.id}.${model.name}`, model.ownership]))),
|
|
157
|
+
state_flow: (review.proposedContract.manifest.modules ?? []).flatMap(value => value.reconciliation.map(item => `${item.event} -> ${item.workflow} -> ${item.writes.join(', ')}`)),
|
|
158
|
+
};
|
|
57
159
|
return this.move(record, 'validated', actor);
|
|
58
160
|
}
|
|
59
161
|
async preview(id, actor) {
|
|
@@ -62,8 +164,40 @@ export class FeltDBProposalService {
|
|
|
62
164
|
const current = await this.context();
|
|
63
165
|
const review = await validateFlowProposal({ proposal: { baseContractHash: record.base_contract_hash, baseFlowHash: record.base_flow_hash,
|
|
64
166
|
proposedFlow: record.proposed_flow, summary: record.summary, changes: [], warnings: record.warnings }, currentFlow: current.source, snapshot: current.snapshot });
|
|
167
|
+
const proposed = createContractSnapshot(review.proposedContract, { environment: record.environment, contractVersion: record.base_contract_version + 1 });
|
|
168
|
+
const readiness = await this.readiness(id);
|
|
169
|
+
const now = Date.now();
|
|
170
|
+
const previewId = `pv_${crypto.randomUUID().replace(/-/g, '')}`;
|
|
65
171
|
await this.move(record, 'previewed', actor);
|
|
66
|
-
|
|
172
|
+
record.preview_id = previewId;
|
|
173
|
+
await this.store.replace(FELTDB_PROPOSAL_COLLECTION, record.id, record);
|
|
174
|
+
const impact = record.module_impact;
|
|
175
|
+
const artifact = {
|
|
176
|
+
preview_id: previewId, proposal_id: id, application_id: record.application_id, environment: record.environment,
|
|
177
|
+
proposal_hash: record.base_contract_hash, created_at: new Date(now).toISOString(), expires_at: new Date(now + 60 * 60 * 1000).toISOString(), status: 'ready',
|
|
178
|
+
current: current.snapshot, proposed, current_contract: current.snapshot, proposed_contract: proposed,
|
|
179
|
+
semantic_diff: record.contract_diff, state_flow: impact.state_flow, capabilities: proposed.capabilities, workflows: proposed.workflows,
|
|
180
|
+
authorization: proposed.policies, configuration: impact.configuration, secrets: impact.secrets, modules: impact.modules,
|
|
181
|
+
ownership: impact.ownership, relationships: impact.relationships, events: impact.events,
|
|
182
|
+
seeded_records: proposed.schema.map(collection => ({ collection: collection.name, id: `preview_${collection.name.toLowerCase()}`, preview_data: true })),
|
|
183
|
+
data_classification: 'synthetic_preview', external_side_effects: 'simulated', readiness, proposal: record,
|
|
184
|
+
};
|
|
185
|
+
await this.store.create(FELTDB_PROPOSAL_PREVIEW_COLLECTION, previewId, artifact);
|
|
186
|
+
return artifact;
|
|
187
|
+
}
|
|
188
|
+
async getPreview(id) {
|
|
189
|
+
const artifact = await this.store.get(FELTDB_PROPOSAL_PREVIEW_COLLECTION, id);
|
|
190
|
+
if (!artifact)
|
|
191
|
+
throw new Error('PREVIEW_NOT_FOUND');
|
|
192
|
+
if (Date.parse(artifact.expires_at) <= Date.now())
|
|
193
|
+
throw new Error('PREVIEW_EXPIRED');
|
|
194
|
+
const proposal = await this.get(artifact.proposal_id);
|
|
195
|
+
if (proposal.preview_id !== id)
|
|
196
|
+
throw new Error('PREVIEW_INVALIDATED');
|
|
197
|
+
const readiness = await this.readiness(proposal.id);
|
|
198
|
+
if (readiness.stale)
|
|
199
|
+
throw new Error('PREVIEW_INVALIDATED');
|
|
200
|
+
return artifact;
|
|
67
201
|
}
|
|
68
202
|
async transition(id, status, actor, authority, approveAuthorization = false) {
|
|
69
203
|
const record = await this.get(id);
|
|
@@ -72,6 +206,16 @@ export class FeltDBProposalService {
|
|
|
72
206
|
throw new Error('PROPOSAL_EXPIRED');
|
|
73
207
|
if (status === 'applied' && (!this.repositoryAuthority || authority !== this.repositoryAuthority))
|
|
74
208
|
throw new Error('REPOSITORY_AUTHORITY_REQUIRED');
|
|
209
|
+
if (status === 'approved') {
|
|
210
|
+
if (!record.preview_id)
|
|
211
|
+
throw new Error('PREVIEW_REQUIRED');
|
|
212
|
+
await this.getPreview(record.preview_id);
|
|
213
|
+
const current = await this.context();
|
|
214
|
+
if (record.application_id !== current.snapshot.application.application_id || record.environment !== current.snapshot.application.environment)
|
|
215
|
+
throw new Error('PROPOSAL_SCOPE_MISMATCH');
|
|
216
|
+
if (record.base_contract_hash !== current.snapshot.contract_hash || record.base_flow_hash !== await flowSourceHash(current.source))
|
|
217
|
+
throw new Error('STALE_PROPOSAL');
|
|
218
|
+
}
|
|
75
219
|
if (status === 'approved' && record.warnings.some(value => value.startsWith('Authorization ')) && !approveAuthorization)
|
|
76
220
|
throw new Error('AUTHORIZATION_APPROVAL_REQUIRED');
|
|
77
221
|
if (status === 'approved') {
|
package/dist/studio/app.d.ts
CHANGED
|
@@ -9,11 +9,13 @@ export interface StudioAppProps {
|
|
|
9
9
|
namespace?: string;
|
|
10
10
|
deploymentRuntime?: string;
|
|
11
11
|
applicationUrl?: string;
|
|
12
|
+
applicationId?: string;
|
|
13
|
+
environment?: string;
|
|
12
14
|
developmentSession?: Record<string, string>;
|
|
13
15
|
managedPublish?: ManagedPublishConfiguration;
|
|
14
16
|
sourceSync?: SourceSyncConfiguration;
|
|
15
17
|
onConnect?: (url: string, token: string) => void;
|
|
16
18
|
}
|
|
17
|
-
export declare function StudioApp({ db, remoteUrl, token, namespace, deploymentRuntime, applicationUrl, developmentSession, managedPublish, sourceSync, onConnect }: StudioAppProps): React.JSX.Element;
|
|
19
|
+
export declare function StudioApp({ db, remoteUrl, token, namespace, deploymentRuntime, applicationUrl, applicationId, environment, developmentSession, managedPublish, sourceSync, onConnect }: StudioAppProps): React.JSX.Element;
|
|
18
20
|
export default StudioApp;
|
|
19
21
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/studio/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,OAA4B,EAAE,KAAK,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AACzG,OAAO,EAAa,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,OAA4B,EAAE,KAAK,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AACzG,OAAO,EAAa,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAMjF,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,WAAW,CAAC;AAEnB,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,SAAc,EAAE,KAAU,EAAE,SAAqB,EAAE,iBAA6B,EAAE,cAAmB,EAAE,aAAkB,EAAE,WAA0B,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,cAAc,qBAqJjQ;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -13,8 +13,9 @@ export interface SourceSyncConfiguration {
|
|
|
13
13
|
credentialConfigured: boolean;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export declare function AskFeltDB({ configuration, onApplied }: {
|
|
16
|
+
export declare function AskFeltDB({ configuration, onApplied, onProposalCreated }: {
|
|
17
17
|
configuration?: SourceSyncConfiguration;
|
|
18
18
|
onApplied?: () => void;
|
|
19
|
+
onProposalCreated?: (proposalId: string) => void;
|
|
19
20
|
}): React.JSX.Element;
|
|
20
21
|
//# sourceMappingURL=AskFeltDB.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskFeltDB.d.ts","sourceRoot":"","sources":["../../src/components/AskFeltDB.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,MAAM,WAAW,uBAAuB;IAAG,OAAO,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,EAAE,cAAc,GAAG,mBAAmB,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,OAAO,CAAC;QAAC,oBAAoB,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE;AAKtS,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE;IAAE,aAAa,CAAC,EAAE,uBAAuB,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"AskFeltDB.d.ts","sourceRoot":"","sources":["../../src/components/AskFeltDB.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,MAAM,WAAW,uBAAuB;IAAG,OAAO,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,EAAE,cAAc,GAAG,mBAAmB,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,OAAO,CAAC;QAAC,oBAAoB,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE;AAKtS,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE;IAAE,aAAa,CAAC,EAAE,uBAAuB,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,qBAwD/L"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FlowSpec } from '@feltdb/core';
|
|
3
|
+
export declare function ContractInspector({ model, section }: {
|
|
4
|
+
model: FlowSpec | null;
|
|
5
|
+
section: 'schema' | 'policies';
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=ContractInspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractInspector.d.ts","sourceRoot":"","sources":["../../src/components/ContractInspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,QAAQ,GAAC,UAAU,CAAA;CAAE,qBAM7G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedInstancePanel.d.ts","sourceRoot":"","sources":["../../src/components/ManagedInstancePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"ManagedInstancePanel.d.ts","sourceRoot":"","sources":["../../src/components/ManagedInstancePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAmRxC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -106,11 +106,7 @@ var i = () => {
|
|
|
106
106
|
if (!u) return;
|
|
107
107
|
let t = e.generateEnvContent({
|
|
108
108
|
url: `https://${i}-feltdb.fly.dev`,
|
|
109
|
-
token: u.secret
|
|
110
|
-
namespace: u.namespace,
|
|
111
|
-
applicationId: i,
|
|
112
|
-
revisionId: "v0.5-alpha",
|
|
113
|
-
environment: "staging"
|
|
109
|
+
token: u.secret
|
|
114
110
|
}), n = new Blob([t], { type: "text/plain" }), r = URL.createObjectURL(n), a = document.createElement("a");
|
|
115
111
|
a.href = r, a.download = ".env.local", document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(r);
|
|
116
112
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleExplorer.d.ts","sourceRoot":"","sources":["../../src/components/ModuleExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnE,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,qBAkBnE"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { SourceSyncConfiguration } from './AskFeltDB';
|
|
3
|
+
export interface ProposalBrowserProps {
|
|
4
|
+
serviceUrl?: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
applicationId: string;
|
|
7
|
+
environment: string;
|
|
8
|
+
applicationName?: string;
|
|
9
|
+
sourceSync?: SourceSyncConfiguration;
|
|
10
|
+
}
|
|
11
|
+
export declare function ProposalBrowser({ serviceUrl, token, applicationId, environment, applicationName, sourceSync, }: ProposalBrowserProps): React.JSX.Element;
|
|
3
12
|
//# sourceMappingURL=ProposalBrowser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProposalBrowser.d.ts","sourceRoot":"","sources":["../../src/components/ProposalBrowser.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProposalBrowser.d.ts","sourceRoot":"","sources":["../../src/components/ProposalBrowser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AASzE,OAAO,EAAa,KAAK,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAStE,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC;AA+QD,wBAAgB,eAAe,CAAC,EAC9B,UAAe,EACf,KAAU,EACV,aAAa,EACb,WAAW,EACX,eAAe,EACf,UAAU,GACX,EAAE,oBAAoB,qBAgetB"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { FlowSpec, StateFirstDB } from '@feltdb/core';
|
|
3
2
|
export interface StateExplorerProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
serviceUrl?: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
applicationId: string;
|
|
6
|
+
environment: string;
|
|
7
|
+
refreshIntervalMs?: number;
|
|
9
8
|
}
|
|
10
|
-
export declare function StateExplorer({
|
|
9
|
+
export declare function StateExplorer({ serviceUrl, token, applicationId, environment, refreshIntervalMs }: StateExplorerProps): React.JSX.Element;
|
|
11
10
|
export default StateExplorer;
|
|
12
11
|
//# sourceMappingURL=StateExplorer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateExplorer.d.ts","sourceRoot":"","sources":["../../src/components/StateExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"StateExplorer.d.ts","sourceRoot":"","sources":["../../src/components/StateExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,MAAM,WAAW,kBAAkB;IAAG,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE;AA+BnJ,wBAAgB,aAAa,CAAC,EAAE,UAAe,EAAE,KAAU,EAAE,aAAa,EAAE,WAAW,EAAE,iBAA0B,EAAE,EAAE,kBAAkB,qBA2BxI;AACD,eAAe,aAAa,CAAC"}
|
|
@@ -21,6 +21,8 @@ export * from './GlobalSearch';
|
|
|
21
21
|
export * from './ApplicationDesigner';
|
|
22
22
|
export * from './AskFeltDB';
|
|
23
23
|
export * from './ProposalBrowser';
|
|
24
|
+
export * from './ModuleExplorer';
|
|
25
|
+
export * from './ContractInspector';
|
|
24
26
|
export * from './ManagedInstancePanel';
|
|
25
27
|
export * from './KeyManagementPanel';
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,cAAc,qB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
|
1
|
-
import { C as e,
|
|
2
|
-
import { t as
|
|
3
|
-
import { ManagedInstancePanel as
|
|
4
|
-
export {
|
|
1
|
+
import { C as e, S as t, T as n, a as r, b as i, c as a, d as o, f as s, i as c, l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, w as _, x as v } from "../components-Duq2xQWt.js";
|
|
2
|
+
import { t as y } from "../KeyManagementPanel-DZuSeWBK.js";
|
|
3
|
+
import { ManagedInstancePanel as b } from "./ManagedInstancePanel.js";
|
|
4
|
+
export { g as AgentExplorer, r as ApplicationDesigner, c as AskFeltDB, i as CapabilityExplorer, s as ConflictExplorer, h as ContractInspector, f as ExecutionViewer, d as GlobalSearch, a as HealthCenter, y as KeyManagementPanel, b as ManagedInstancePanel, u as ModuleExplorer, t as OperationsExplorer, n as OverviewDashboard, v as PeerMap, p as ProposalBrowser, l as ProvenanceViewer, e as ReferenceExplorer, m as SettingsPanel, _ as StateExplorer, o as WorkflowVisualizer };
|