@feltdb/core 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/application-development.d.ts +76 -0
  2. package/dist/application-development.d.ts.map +1 -0
  3. package/dist/application-development.js +137 -0
  4. package/dist/application-manifest.d.ts +5 -1
  5. package/dist/application-manifest.d.ts.map +1 -1
  6. package/dist/application-manifest.js +10 -3
  7. package/dist/canonical-application.d.ts +26 -0
  8. package/dist/canonical-application.d.ts.map +1 -0
  9. package/dist/canonical-application.js +45 -0
  10. package/dist/cli/ai-model-config.js +97 -0
  11. package/dist/cli/commands.js +485 -30
  12. package/dist/cli/index.js +1 -1
  13. package/dist/cli/proposal-client.js +54 -0
  14. package/dist/cli/publish-engine.js +162 -0
  15. package/dist/cli/source-sync.js +139 -0
  16. package/dist/create/cli.js +1 -1
  17. package/dist/create/create.js +30 -6
  18. package/dist/create/managed-account.js +14 -7
  19. package/dist/create/package-versions.js +1 -1
  20. package/dist/create/server-source/crates/feltdb/src/application.rs +31 -1
  21. package/dist/create/server-source/crates/feltdb/src/authority_failover.rs +847 -0
  22. package/dist/create/server-source/crates/feltdb/src/bin/feltdb_node.rs +338 -29
  23. package/dist/create/server-source/crates/feltdb/src/distributed_transactions.rs +72 -34
  24. package/dist/create/server-source/crates/feltdb/src/lib.rs +1 -0
  25. package/dist/create/server-source/crates/feltdb-server/src/identity.rs +46 -3
  26. package/dist/create/server-source/crates/feltdb-server/src/main.rs +315 -16
  27. package/dist/create/server-source/crates/feltdb-server/src/tenancy.rs +20 -0
  28. package/dist/create/template/default-project/README.md +57 -0
  29. package/dist/create/template/default-project/agents/activity-assistant.ts +18 -0
  30. package/dist/create/template/default-project/agents/project-assistant.ts +19 -0
  31. package/dist/create/template/default-project/capabilities/activity-summary.ts +14 -0
  32. package/dist/create/template/default-project/capabilities/project-search.ts +16 -0
  33. package/dist/create/template/default-project/capabilities/project-summary.ts +15 -0
  34. package/dist/create/template/default-project/feltdb.flow +169 -0
  35. package/dist/create/template/default-project/src/App.tsx +20 -0
  36. package/dist/create/template/default-project/src/context/AuthContext.tsx +27 -0
  37. package/dist/create/template/default-project/src/feltdb.ts +87 -0
  38. package/dist/create/template/default-project/src/index.tsx +14 -0
  39. package/dist/create/template/default-project/src/pages/Activity.tsx +7 -0
  40. package/dist/create/template/default-project/src/pages/Agents.tsx +15 -0
  41. package/dist/create/template/default-project/src/pages/Dashboard.tsx +17 -0
  42. package/dist/create/template/default-project/src/pages/Invitations.tsx +11 -0
  43. package/dist/create/template/default-project/src/pages/Projects.tsx +11 -0
  44. package/dist/create/template/default-project/src/pages/SignIn.tsx +8 -0
  45. package/dist/create/template/default-project/src/pages/SignUp.tsx +8 -0
  46. package/dist/create/template/default-project/src/styles-application.css +21 -0
  47. package/dist/create/template/default-project/src/styles.css +1 -0
  48. package/dist/create/template/default-project/workflows/agent-assisted-summary.ts +1 -0
  49. package/dist/create/template/default-project/workflows/invitation.ts +30 -0
  50. package/dist/create/template/default-project/workflows/project-created.ts +2 -0
  51. package/dist/db.d.ts +49 -1
  52. package/dist/db.d.ts.map +1 -1
  53. package/dist/db.js +77 -0
  54. package/dist/error-codes.d.ts +20 -1
  55. package/dist/error-codes.d.ts.map +1 -1
  56. package/dist/error-codes.js +25 -0
  57. package/dist/flowspec.d.ts.map +1 -1
  58. package/dist/flowspec.js +27 -6
  59. package/dist/http-db.d.ts +15 -2
  60. package/dist/http-db.d.ts.map +1 -1
  61. package/dist/http-db.js +113 -5
  62. package/dist/index-core.d.ts +3 -0
  63. package/dist/index-core.d.ts.map +1 -1
  64. package/dist/index-core.js +3 -0
  65. package/dist/proposal.d.ts +85 -0
  66. package/dist/proposal.d.ts.map +1 -0
  67. package/dist/proposal.js +105 -0
  68. package/dist/studio/app.d.ts +5 -1
  69. package/dist/studio/app.d.ts.map +1 -1
  70. package/dist/studio/components/ApplicationDesigner.d.ts +10 -1
  71. package/dist/studio/components/ApplicationDesigner.d.ts.map +1 -1
  72. package/dist/studio/components/AskFeltDB.d.ts +20 -0
  73. package/dist/studio/components/AskFeltDB.d.ts.map +1 -0
  74. package/dist/studio/components/ProposalBrowser.d.ts +3 -0
  75. package/dist/studio/components/ProposalBrowser.d.ts.map +1 -0
  76. package/dist/studio/components/index.d.ts +2 -0
  77. package/dist/studio/components/index.d.ts.map +1 -1
  78. package/dist/studio/components/index.js +4 -4
  79. package/dist/studio/{components-C5p2TfIU.js → components-Bm4sjhcX.js} +531 -192
  80. package/dist/studio/index.js +184 -172
  81. package/dist/studio/studio.css +1 -1
  82. package/dist/studio-app/assets/dist-DA1MYSzp.js +1 -0
  83. package/dist/studio-app/assets/{feltdb_wasm-DVKsw75S.js → feltdb_wasm-B-Ccgccb.js} +1 -1
  84. package/dist/studio-app/assets/feltdb_wasm_bg-wH3enJIA.wasm +0 -0
  85. package/dist/studio-app/assets/{index-C1GWyazR.css → index-BRrmvaKw.css} +1 -1
  86. package/dist/studio-app/assets/index-CEIqowCh.js +42 -0
  87. package/dist/studio-app/assets/lib-B2_7fcn7.js +69 -0
  88. package/dist/studio-app/assets/worker-CARZ5g7K.js +69 -0
  89. package/dist/studio-app/index.html +2 -2
  90. package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
  91. package/dist/workspace/local-development-authority.d.ts +3 -0
  92. package/dist/workspace/local-development-authority.d.ts.map +1 -1
  93. package/dist/workspace/local-development-authority.js +62 -1
  94. package/package.json +1 -1
  95. package/dist/studio-app/assets/feltdb_wasm_bg-DNyNf0yy.wasm +0 -0
  96. package/dist/studio-app/assets/index-C71X92EK.js +0 -28
@@ -51,6 +51,9 @@ export * from './provider.js';
51
51
  export * from './identity.js';
52
52
  export * from './development-runtime-bridge.js';
53
53
  export * from './application-contract.js';
54
+ export * from './canonical-application.js';
55
+ export * from './application-development.js';
56
+ export * from './proposal.js';
54
57
  export { ProtocolHandler, } from './protocol.js';
55
58
  /**
56
59
  * Agent Runtime APIs
@@ -0,0 +1,85 @@
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_VERSION = 1;
5
+ export type ProposalStatus = 'proposed' | 'validated' | 'previewed' | 'approved' | 'applied' | 'rejected' | 'expired';
6
+ export interface ProposalSourceOperation {
7
+ path: string;
8
+ operation: 'add' | 'modify' | 'delete';
9
+ }
10
+ export interface FeltDBProposalRecord {
11
+ id: string;
12
+ application_id: string;
13
+ environment: string;
14
+ status: ProposalStatus;
15
+ proposal_version: 1;
16
+ base_contract_version: number;
17
+ base_contract_hash: string;
18
+ base_flow_hash: string;
19
+ proposed_flow: string;
20
+ contract_diff: string[];
21
+ source_plan: {
22
+ files: ProposalSourceOperation[];
23
+ };
24
+ summary: string;
25
+ warnings: string[];
26
+ created_by: string;
27
+ created_at: string | number;
28
+ approved_by?: string;
29
+ approved_at?: string | number;
30
+ applied_at?: string | number;
31
+ expires_at?: string | number;
32
+ metadata: Record<string, string>;
33
+ parent_proposal_id?: string;
34
+ }
35
+ export interface FeltDBProposalEvent {
36
+ id: string;
37
+ proposal_id: string;
38
+ from_status?: ProposalStatus;
39
+ to_status: ProposalStatus;
40
+ actor: string;
41
+ created_at: string | number;
42
+ metadata: Record<string, string>;
43
+ }
44
+ export interface ProposalStore {
45
+ get<T>(collection: string, id: string): Promise<T | undefined>;
46
+ list<T>(collection: string): Promise<T[]>;
47
+ create<T>(collection: string, id: string, value: T): Promise<void>;
48
+ replace<T>(collection: string, id: string, value: T): Promise<void>;
49
+ }
50
+ export interface ProposalContext {
51
+ source: string;
52
+ snapshot: FeltDBContractSnapshot;
53
+ }
54
+ export declare class FeltDBProposalService {
55
+ private store;
56
+ private context;
57
+ private repositoryAuthority?;
58
+ constructor(store: ProposalStore, context: () => Promise<ProposalContext>, repositoryAuthority?: string | undefined);
59
+ create(input: {
60
+ application_id: string;
61
+ environment: string;
62
+ base_contract_hash: string;
63
+ base_flow_hash: string;
64
+ proposed_flow: string;
65
+ summary: string;
66
+ warnings?: string[];
67
+ actor: string;
68
+ metadata?: Record<string, string>;
69
+ parent_proposal_id?: string;
70
+ expires_at?: string | number;
71
+ }): Promise<FeltDBProposalRecord>;
72
+ list(): Promise<FeltDBProposalRecord[]>;
73
+ get(id: string): Promise<FeltDBProposalRecord>;
74
+ history(id: string): Promise<FeltDBProposalEvent[]>;
75
+ validate(id: string, actor: string): Promise<FeltDBProposalRecord>;
76
+ preview(id: string, actor: string): Promise<{
77
+ proposal: FeltDBProposalRecord;
78
+ contract: FeltDBContractSnapshot;
79
+ }>;
80
+ transition(id: string, status: 'approved' | 'rejected' | 'expired' | 'applied', actor: string, authority?: string, approveAuthorization?: boolean): Promise<FeltDBProposalRecord>;
81
+ private assertMutable;
82
+ private move;
83
+ private event;
84
+ }
85
+ //# 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;AAEtC,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAC7D,eAAO,MAAM,gCAAgC,0BAA0B,CAAC;AACxE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AACtH,MAAM,WAAW,uBAAuB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE;AACjG,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MA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MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAInD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAelE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;IASjC,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;IAWrL,OAAO,CAAC,aAAa;YAIP,IAAI;YAKJ,KAAK;CAKpB"}
@@ -0,0 +1,105 @@
1
+ import { createContractSnapshot, flowSourceHash, validateFlowProposal, } from './application-development.js';
2
+ export const FELTDB_PROPOSAL_COLLECTION = '_feltdb.Proposal';
3
+ export const FELTDB_PROPOSAL_EVENT_COLLECTION = '_feltdb.ProposalEvent';
4
+ export const FELTDB_PROPOSAL_VERSION = 1;
5
+ const transitions = {
6
+ proposed: ['validated', 'rejected'], validated: ['previewed', 'rejected'], previewed: ['approved', 'rejected'],
7
+ approved: ['applied', 'expired'], applied: [], rejected: [], expired: [],
8
+ };
9
+ export class FeltDBProposalService {
10
+ store;
11
+ context;
12
+ repositoryAuthority;
13
+ constructor(store, context, repositoryAuthority) {
14
+ this.store = store;
15
+ this.context = context;
16
+ this.repositoryAuthority = repositoryAuthority;
17
+ }
18
+ async create(input) {
19
+ const current = await this.context();
20
+ if (input.application_id !== current.snapshot.application.application_id || input.environment !== current.snapshot.application.environment)
21
+ throw new Error('PROPOSAL_SCOPE_MISMATCH');
22
+ if (input.base_contract_hash !== current.snapshot.contract_hash || input.base_flow_hash !== await flowSourceHash(current.source))
23
+ throw new Error('STALE_PROPOSAL');
24
+ const id = `p_${crypto.randomUUID().replace(/-/g, '')}`;
25
+ const record = { id, application_id: input.application_id, environment: input.environment,
26
+ status: 'proposed', proposal_version: FELTDB_PROPOSAL_VERSION, base_contract_version: current.snapshot.contract_version,
27
+ base_contract_hash: input.base_contract_hash, base_flow_hash: input.base_flow_hash, proposed_flow: input.proposed_flow,
28
+ contract_diff: [], source_plan: { files: [] }, summary: input.summary, warnings: input.warnings ?? [], created_by: input.actor,
29
+ created_at: new Date().toISOString(), expires_at: input.expires_at, metadata: input.metadata ?? {}, parent_proposal_id: input.parent_proposal_id };
30
+ await this.store.create(FELTDB_PROPOSAL_COLLECTION, id, record);
31
+ await this.event(id, undefined, 'proposed', input.actor);
32
+ return record;
33
+ }
34
+ list() { return this.store.list(FELTDB_PROPOSAL_COLLECTION); }
35
+ async get(id) {
36
+ const value = await this.store.get(FELTDB_PROPOSAL_COLLECTION, id);
37
+ if (!value)
38
+ throw new Error('PROPOSAL_NOT_FOUND');
39
+ return value;
40
+ }
41
+ async history(id) {
42
+ return (await this.store.list(FELTDB_PROPOSAL_EVENT_COLLECTION)).filter(value => value.proposal_id === id);
43
+ }
44
+ async validate(id, actor) {
45
+ const record = await this.get(id);
46
+ this.assertMutable(record, 'proposed');
47
+ const current = await this.context();
48
+ const proposal = { baseContractHash: record.base_contract_hash, baseFlowHash: record.base_flow_hash,
49
+ proposedFlow: record.proposed_flow, summary: record.summary, changes: [], warnings: record.warnings };
50
+ const review = await validateFlowProposal({ proposal, currentFlow: current.source, snapshot: current.snapshot });
51
+ record.contract_diff = [
52
+ ...review.diff.added.map(value => `+ ${value}`), ...review.diff.changed.map(value => `~ ${value}`),
53
+ ...review.diff.removed.map(value => `- ${value}`),
54
+ ];
55
+ record.source_plan = { files: [{ path: 'feltdb.flow', operation: 'modify' }, { path: 'src/feltdb/generated-contract.ts', operation: 'modify' }] };
56
+ record.warnings = [...new Set([...record.warnings, ...review.authorizationChanges.map(value => `Authorization ${value.widening ? 'widened' : 'changed'}: ${value.policy}: ${(value.before ?? []).join(' | ')} -> ${(value.after ?? []).join(' | ')}`)])];
57
+ return this.move(record, 'validated', actor);
58
+ }
59
+ async preview(id, actor) {
60
+ const record = await this.get(id);
61
+ this.assertMutable(record, 'validated');
62
+ const current = await this.context();
63
+ const review = await validateFlowProposal({ proposal: { baseContractHash: record.base_contract_hash, baseFlowHash: record.base_flow_hash,
64
+ proposedFlow: record.proposed_flow, summary: record.summary, changes: [], warnings: record.warnings }, currentFlow: current.source, snapshot: current.snapshot });
65
+ await this.move(record, 'previewed', actor);
66
+ return { proposal: record, contract: createContractSnapshot(review.proposedContract, { environment: record.environment, contractVersion: record.base_contract_version + 1 }) };
67
+ }
68
+ async transition(id, status, actor, authority, approveAuthorization = false) {
69
+ const record = await this.get(id);
70
+ const expired = record.expires_at && (typeof record.expires_at === 'number' ? record.expires_at * 1000 : Date.parse(record.expires_at)) <= Date.now();
71
+ if (expired && status !== 'expired')
72
+ throw new Error('PROPOSAL_EXPIRED');
73
+ if (status === 'applied' && (!this.repositoryAuthority || authority !== this.repositoryAuthority))
74
+ throw new Error('REPOSITORY_AUTHORITY_REQUIRED');
75
+ if (status === 'approved' && record.warnings.some(value => value.startsWith('Authorization ')) && !approveAuthorization)
76
+ throw new Error('AUTHORIZATION_APPROVAL_REQUIRED');
77
+ if (status === 'approved') {
78
+ record.approved_by = actor;
79
+ record.approved_at = new Date().toISOString();
80
+ }
81
+ if (status === 'applied')
82
+ record.applied_at = new Date().toISOString();
83
+ return this.move(record, status, actor);
84
+ }
85
+ assertMutable(record, status) {
86
+ if (record.status !== status)
87
+ throw new Error(`INVALID_PROPOSAL_TRANSITION: ${record.status}`);
88
+ if (record.expires_at && (typeof record.expires_at === 'number' ? record.expires_at * 1000 : Date.parse(record.expires_at)) <= Date.now())
89
+ throw new Error('PROPOSAL_EXPIRED');
90
+ }
91
+ async move(record, status, actor) {
92
+ if (!transitions[record.status].includes(status))
93
+ throw new Error(`INVALID_PROPOSAL_TRANSITION: ${record.status} -> ${status}`);
94
+ const from = record.status;
95
+ record.status = status;
96
+ await this.store.replace(FELTDB_PROPOSAL_COLLECTION, record.id, record);
97
+ await this.event(record.id, from, status, actor);
98
+ return record;
99
+ }
100
+ async event(proposal, from, to, actor) {
101
+ const event = { id: `pe_${crypto.randomUUID().replace(/-/g, '')}`, proposal_id: proposal,
102
+ from_status: from, to_status: to, actor, created_at: new Date().toISOString(), metadata: {} };
103
+ await this.store.create(FELTDB_PROPOSAL_EVENT_COLLECTION, event.id, event);
104
+ }
105
+ }
@@ -1,4 +1,6 @@
1
1
  import { default as React } from 'react';
2
+ import { ManagedPublishConfiguration } from './components/ApplicationDesigner';
3
+ import { SourceSyncConfiguration } from './components/AskFeltDB';
2
4
  import { StateFirstDB } from '@feltdb/core';
3
5
  export interface StudioAppProps {
4
6
  db?: StateFirstDB;
@@ -8,8 +10,10 @@ export interface StudioAppProps {
8
10
  deploymentRuntime?: string;
9
11
  applicationUrl?: string;
10
12
  developmentSession?: Record<string, string>;
13
+ managedPublish?: ManagedPublishConfiguration;
14
+ sourceSync?: SourceSyncConfiguration;
11
15
  onConnect?: (url: string, token: string) => void;
12
16
  }
13
- export declare function StudioApp({ db, remoteUrl, token, namespace, deploymentRuntime, applicationUrl, developmentSession, onConnect }: StudioAppProps): React.JSX.Element;
17
+ export declare function StudioApp({ db, remoteUrl, token, namespace, deploymentRuntime, applicationUrl, developmentSession, managedPublish, sourceSync, onConnect }: StudioAppProps): React.JSX.Element;
14
18
  export default StudioApp;
15
19
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAmBnD,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,MAA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E,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,SAAc,EAAE,KAAU,EAAE,SAAqB,EAAE,iBAA6B,EAAE,cAAmB,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,cAAc,qBA+IjN;AAED,eAAe,SAAS,CAAC"}
@@ -1,11 +1,20 @@
1
1
  import { default as React } from 'react';
2
2
  import { StateFirstDB, FlowSpec } from '@feltdb/core';
3
+ export interface ManagedPublishConfiguration {
4
+ url: string;
5
+ namespace: string;
6
+ token?: string;
7
+ environment?: string;
8
+ applicationId?: string;
9
+ publishEndpoint?: string;
10
+ }
3
11
  export interface ApplicationDesignerProps {
4
12
  db?: StateFirstDB;
5
13
  namespace?: string;
6
14
  projectSpec?: FlowSpec | null;
15
+ managedPublish?: ManagedPublishConfiguration;
7
16
  onSpecChange?: (spec: FlowSpec) => void;
8
17
  }
9
- export declare function ApplicationDesigner({ db, namespace, projectSpec, onSpecChange }: ApplicationDesignerProps): React.JSX.Element;
18
+ export declare function ApplicationDesigner({ db, namespace, projectSpec, managedPublish, onSpecChange }: ApplicationDesignerProps): React.JSX.Element;
10
19
  export default ApplicationDesigner;
11
20
  //# sourceMappingURL=ApplicationDesigner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationDesigner.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationDesigner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAkB,MAAM,cAAc,CAAC;AAO3E,MAAM,WAAW,wBAAwB;IAAG,EAAE,CAAC,EAAE,YAAY,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;CAAE;AAE3J,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,EAAE,SAAqB,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,wBAAwB,qBAoHrH;AACD,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ApplicationDesigner.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationDesigner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAkB,MAAM,cAAc,CAAC;AAO3E,MAAM,WAAW,2BAA2B;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE;AACvK,MAAM,WAAW,wBAAwB;IAAG,EAAE,CAAC,EAAE,YAAY,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;CAAE;AAEzM,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,EAAE,SAAqB,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,EAAE,wBAAwB,qBA6HrI;AACD,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ export interface SourceSyncConfiguration {
3
+ enabled: boolean;
4
+ webllmEnabled: boolean;
5
+ previewOnly?: boolean;
6
+ token: string;
7
+ aiModel?: {
8
+ provider: 'local-webllm' | 'openai-compatible';
9
+ model: string;
10
+ baseUrl?: string;
11
+ local: boolean;
12
+ credentialRequired: boolean;
13
+ credentialConfigured: boolean;
14
+ };
15
+ }
16
+ export declare function AskFeltDB({ configuration, onApplied }: {
17
+ configuration?: SourceSyncConfiguration;
18
+ onApplied?: () => void;
19
+ }): React.JSX.Element;
20
+ //# sourceMappingURL=AskFeltDB.d.ts.map
@@ -0,0 +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,qBA0E1H"}
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare function ProposalBrowser(): React.JSX.Element;
3
+ //# sourceMappingURL=ProposalBrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProposalBrowser.d.ts","sourceRoot":"","sources":["../../src/components/ProposalBrowser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,wBAAgB,eAAe,sBAsB9B"}
@@ -19,6 +19,8 @@ export * from './HealthCenter';
19
19
  export * from './SettingsPanel';
20
20
  export * from './GlobalSearch';
21
21
  export * from './ApplicationDesigner';
22
+ export * from './AskFeltDB';
23
+ export * from './ProposalBrowser';
22
24
  export * from './ManagedInstancePanel';
23
25
  export * from './KeyManagementPanel';
24
26
  //# 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,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
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,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p, x as m } from "../components-C5p2TfIU.js";
2
- import { t as h } from "../KeyManagementPanel-DZuSeWBK.js";
3
- import { ManagedInstancePanel as g } from "./ManagedInstancePanel.js";
4
- export { c as AgentExplorer, f as ApplicationDesigner, p as CapabilityExplorer, t as ConflictExplorer, a as ExecutionViewer, s as GlobalSearch, i as HealthCenter, h as KeyManagementPanel, g as ManagedInstancePanel, r as OperationsExplorer, m as OverviewDashboard, n as PeerMap, e as ProvenanceViewer, l as ReferenceExplorer, u as SettingsPanel, o as StateExplorer, d as WorkflowVisualizer };
1
+ import { C as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "../components-Bm4sjhcX.js";
2
+ import { t as _ } from "../KeyManagementPanel-DZuSeWBK.js";
3
+ import { ManagedInstancePanel as v } from "./ManagedInstancePanel.js";
4
+ export { n as AgentExplorer, p as ApplicationDesigner, u as AskFeltDB, i as CapabilityExplorer, g as ConflictExplorer, r as ExecutionViewer, s as GlobalSearch, d as HealthCenter, _ as KeyManagementPanel, v as ManagedInstancePanel, l as OperationsExplorer, e as OverviewDashboard, f as PeerMap, h as ProposalBrowser, m as ProvenanceViewer, o as ReferenceExplorer, t as SettingsPanel, a as StateExplorer, c as WorkflowVisualizer };