db4ai 0.1.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.
Files changed (79) hide show
  1. package/README.md +438 -0
  2. package/dist/cli/bin.d.ts +50 -0
  3. package/dist/cli/bin.d.ts.map +1 -0
  4. package/dist/cli/bin.js +418 -0
  5. package/dist/cli/bin.js.map +1 -0
  6. package/dist/cli/dashboard/App.d.ts +16 -0
  7. package/dist/cli/dashboard/App.d.ts.map +1 -0
  8. package/dist/cli/dashboard/App.js +116 -0
  9. package/dist/cli/dashboard/App.js.map +1 -0
  10. package/dist/cli/dashboard/components/index.d.ts +70 -0
  11. package/dist/cli/dashboard/components/index.d.ts.map +1 -0
  12. package/dist/cli/dashboard/components/index.js +192 -0
  13. package/dist/cli/dashboard/components/index.js.map +1 -0
  14. package/dist/cli/dashboard/hooks/index.d.ts +76 -0
  15. package/dist/cli/dashboard/hooks/index.d.ts.map +1 -0
  16. package/dist/cli/dashboard/hooks/index.js +201 -0
  17. package/dist/cli/dashboard/hooks/index.js.map +1 -0
  18. package/dist/cli/dashboard/index.d.ts +17 -0
  19. package/dist/cli/dashboard/index.d.ts.map +1 -0
  20. package/dist/cli/dashboard/index.js +16 -0
  21. package/dist/cli/dashboard/index.js.map +1 -0
  22. package/dist/cli/dashboard/types.d.ts +84 -0
  23. package/dist/cli/dashboard/types.d.ts.map +1 -0
  24. package/dist/cli/dashboard/types.js +5 -0
  25. package/dist/cli/dashboard/types.js.map +1 -0
  26. package/dist/cli/dashboard/views/index.d.ts +51 -0
  27. package/dist/cli/dashboard/views/index.d.ts.map +1 -0
  28. package/dist/cli/dashboard/views/index.js +72 -0
  29. package/dist/cli/dashboard/views/index.js.map +1 -0
  30. package/dist/cli/index.d.ts +16 -0
  31. package/dist/cli/index.d.ts.map +1 -0
  32. package/dist/cli/index.js +48 -0
  33. package/dist/cli/index.js.map +1 -0
  34. package/dist/cli/runtime/index.d.ts +236 -0
  35. package/dist/cli/runtime/index.d.ts.map +1 -0
  36. package/dist/cli/runtime/index.js +705 -0
  37. package/dist/cli/runtime/index.js.map +1 -0
  38. package/dist/cli/scanner/index.d.ts +90 -0
  39. package/dist/cli/scanner/index.d.ts.map +1 -0
  40. package/dist/cli/scanner/index.js +640 -0
  41. package/dist/cli/scanner/index.js.map +1 -0
  42. package/dist/cli/seed/index.d.ts +160 -0
  43. package/dist/cli/seed/index.d.ts.map +1 -0
  44. package/dist/cli/seed/index.js +774 -0
  45. package/dist/cli/seed/index.js.map +1 -0
  46. package/dist/cli/sync/index.d.ts +197 -0
  47. package/dist/cli/sync/index.d.ts.map +1 -0
  48. package/dist/cli/sync/index.js +706 -0
  49. package/dist/cli/sync/index.js.map +1 -0
  50. package/dist/cli/terminal.d.ts +60 -0
  51. package/dist/cli/terminal.d.ts.map +1 -0
  52. package/dist/cli/terminal.js +210 -0
  53. package/dist/cli/terminal.js.map +1 -0
  54. package/dist/cli/workflow/index.d.ts +152 -0
  55. package/dist/cli/workflow/index.d.ts.map +1 -0
  56. package/dist/cli/workflow/index.js +308 -0
  57. package/dist/cli/workflow/index.js.map +1 -0
  58. package/dist/errors.d.ts +43 -0
  59. package/dist/errors.d.ts.map +1 -0
  60. package/dist/errors.js +47 -0
  61. package/dist/errors.js.map +1 -0
  62. package/dist/handlers.d.ts +147 -0
  63. package/dist/handlers.d.ts.map +1 -0
  64. package/dist/handlers.js +39 -0
  65. package/dist/handlers.js.map +1 -0
  66. package/dist/index.d.ts +1281 -0
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.js +3164 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/types.d.ts +215 -0
  71. package/dist/types.d.ts.map +1 -0
  72. package/dist/types.js +12 -0
  73. package/dist/types.js.map +1 -0
  74. package/docs/api-reference.mdx +3 -0
  75. package/docs/examples.mdx +3 -0
  76. package/docs/getting-started.mdx +3 -0
  77. package/docs/index.mdx +3 -0
  78. package/docs/schema-dsl.mdx +3 -0
  79. package/package.json +121 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../cli/dashboard/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Module 17: React Ink Dashboard - Views
3
+ */
4
+ import React from 'react';
5
+ import type { DashboardStats, TypeInfo, ActivityEvent, CascadeNode, WorkflowStatus, DbConfig, LogEntry, SearchResult } from '../types';
6
+ export interface MainViewProps {
7
+ stats: DashboardStats;
8
+ types: TypeInfo[];
9
+ activity: ActivityEvent[];
10
+ }
11
+ export declare function MainView({ stats, types, activity }: MainViewProps): React.ReactElement;
12
+ export interface GenerateViewProps {
13
+ types: TypeInfo[];
14
+ onGenerate: (type: string, options?: {
15
+ count?: number;
16
+ }) => void;
17
+ showCountInput?: boolean;
18
+ generating?: boolean;
19
+ }
20
+ export declare function GenerateView({ types, onGenerate, showCountInput, generating, }: GenerateViewProps): React.ReactElement;
21
+ export interface CascadeViewProps {
22
+ nodes: CascadeNode[];
23
+ onNodeSelect?: (node: CascadeNode) => void;
24
+ }
25
+ export declare function CascadeView({ nodes, onNodeSelect }: CascadeViewProps): React.ReactElement;
26
+ export interface SeedViewProps {
27
+ seedFiles: string[];
28
+ onSeed: (file: string) => void;
29
+ progress?: {
30
+ current: number;
31
+ total: number;
32
+ };
33
+ }
34
+ export declare function SeedView({ seedFiles, onSeed, progress }: SeedViewProps): React.ReactElement;
35
+ export interface WorkflowViewProps {
36
+ workflow: WorkflowStatus | null;
37
+ }
38
+ export declare function WorkflowView({ workflow }: WorkflowViewProps): React.ReactElement;
39
+ export interface QueryViewProps {
40
+ db: DbConfig;
41
+ results?: SearchResult[];
42
+ searching?: boolean;
43
+ }
44
+ export declare function QueryView({ db, results, searching }: QueryViewProps): React.ReactElement;
45
+ export interface LogsViewProps {
46
+ logs: LogEntry[];
47
+ filter?: string;
48
+ autoScroll?: boolean;
49
+ }
50
+ export declare function LogsView({ logs, filter, autoScroll }: LogsViewProps): React.ReactElement;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AAM,EAAE,CAAA;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAkB3F;AAMD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;CAChC;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAoDhF;AAMD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,QAAQ,CAAA;IACZ,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAqBxF;AAMD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CA+CxF"}
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ import { Stats, TypeList, ActivityFeed, ProgressBar, CascadeTree, } from '../components';
4
+ export function MainView({ stats, types, activity }) {
5
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Stats, { stats: stats }), _jsxs(Box, { gap: 4, children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Types" }), types.length > 0 ? (_jsx(TypeList, { types: types })) : (_jsx(Text, { color: "gray", children: "No types" }))] }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Activity" }), activity.length > 0 ? (_jsx(ActivityFeed, { events: activity })) : (_jsx(Text, { color: "gray", children: "No activity" }))] })] })] }));
6
+ }
7
+ export function GenerateView({ types, onGenerate, showCountInput, generating, }) {
8
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, children: "Generate" }), generating ? (_jsx(Text, { color: "yellow", children: "Generating..." })) : (_jsxs(_Fragment, { children: [_jsx(TypeList, { types: types, onSelect: t => onGenerate(t.name) }), showCountInput && _jsx(Text, { color: "gray", children: "Enter count..." })] }))] }));
9
+ }
10
+ export function CascadeView({ nodes, onNodeSelect }) {
11
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, children: "Cascade" }), _jsx(CascadeTree, { nodes: nodes, onNodeSelect: onNodeSelect })] }));
12
+ }
13
+ export function SeedView({ seedFiles, onSeed, progress }) {
14
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, children: "Seeds" }), progress && (_jsx(ProgressBar, { current: progress.current, total: progress.total, showCount: true })), seedFiles.length > 0 ? (_jsx(Box, { flexDirection: "column", children: seedFiles.map(file => (_jsx(Text, { children: file }, file))) })) : (_jsx(Text, { color: "gray", children: "No seed files" }))] }));
15
+ }
16
+ export function WorkflowView({ workflow }) {
17
+ if (!workflow) {
18
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Workflow" }), _jsx(Text, { color: "gray", children: "No active workflow" })] }));
19
+ }
20
+ const getStepIcon = (status) => {
21
+ switch (status) {
22
+ case 'completed':
23
+ return '✓';
24
+ case 'running':
25
+ return '◐';
26
+ default:
27
+ return '○';
28
+ }
29
+ };
30
+ const getStepColor = (status) => {
31
+ switch (status) {
32
+ case 'completed':
33
+ return 'green';
34
+ case 'running':
35
+ return 'yellow';
36
+ default:
37
+ return 'gray';
38
+ }
39
+ };
40
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Text, { bold: true, children: ["Workflow: ", workflow.name] }), _jsx(ProgressBar, { current: workflow.currentStep, total: workflow.totalSteps, showCount: true }), _jsx(Box, { flexDirection: "column", children: workflow.steps.map((step, index) => (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: getStepColor(step.status), children: getStepIcon(step.status) }), _jsx(Text, { children: step.name })] }, index))) })] }));
41
+ }
42
+ export function QueryView({ db, results, searching }) {
43
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, children: "Query" }), _jsxs(Text, { color: "gray", children: ["Search ", db.namespace, "..."] }), searching && _jsx(Text, { color: "yellow", children: "Searching..." }), results !== undefined && results.length === 0 && (_jsx(Text, { color: "gray", children: "No results found" })), results && results.length > 0 && (_jsx(Box, { flexDirection: "column", children: results.map(result => (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: "cyan", children: result.type }), _jsx(Text, { children: result.name })] }, result.id))) }))] }));
44
+ }
45
+ export function LogsView({ logs, filter, autoScroll }) {
46
+ let filtered = logs;
47
+ if (filter) {
48
+ filtered = logs.filter(log => log.level === filter);
49
+ }
50
+ const getLevelColor = (level) => {
51
+ switch (level) {
52
+ case 'error':
53
+ return 'red';
54
+ case 'warn':
55
+ return 'yellow';
56
+ case 'info':
57
+ return 'blue';
58
+ default:
59
+ return 'gray';
60
+ }
61
+ };
62
+ if (filtered.length === 0) {
63
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Logs" }), _jsx(Text, { color: "gray", children: "No logs" })] }));
64
+ }
65
+ return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, children: "Logs" }), filtered.map((log, index) => (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: "gray", children: log.timestamp.toLocaleTimeString('en-US', {
66
+ hour: '2-digit',
67
+ minute: '2-digit',
68
+ second: '2-digit',
69
+ hour12: false,
70
+ }) }), _jsxs(Text, { color: getLevelColor(log.level), children: ["[", log.level.toUpperCase(), "]"] }), _jsx(Text, { children: log.message })] }, index)))] }));
71
+ }
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../cli/dashboard/views/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAW/B,OAAO,EACL,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,eAAe,CAAA;AAYtB,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAiB;IAChE,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,aAChC,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,GAAI,EACvB,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACT,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,IAAI,4BAAa,EACtB,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAClB,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,GAAI,CAC3B,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,yBAAgB,CACnC,IACG,EACN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,IAAI,+BAAgB,EACzB,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrB,KAAC,YAAY,IAAC,MAAM,EAAE,QAAQ,GAAI,CACnC,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAA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P,MAAC,IAAI,IAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,kBAAI,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,SAAS,EACzE,KAAC,IAAI,cAAE,GAAG,CAAC,OAAO,GAAQ,KAVlB,KAAK,CAWT,CACP,CAAC,IACE,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * db4ai CLI - Entry point
3
+ *
4
+ * Re-exports all modules for the CLI package.
5
+ *
6
+ * Note: Some modules export types with the same names but different definitions.
7
+ * To avoid conflicts, use module-specific prefixes or import directly from the modules.
8
+ */
9
+ export { type ScannerConfig, type ProjectConfig, type SchemaFile, type SeedConfig as ScannerSeedConfig, type SeedFile, type WorkflowConfig as ScannerWorkflowConfig, type WorkflowFile, type ScanResult, type ScanError, type ScanOptions, type Scanner, createScanner, } from './scanner';
10
+ export { type Thing, type UpsertResult, type UpsertParams, type GetParams, type ListParams, type Relationship as RuntimeRelationship, type CreateRelationshipParams, type TraverseParams, type IncomingParams, type TraverseMultiHopParams, type TraverseMultiHopResult, type Action, type CreateActionParams, type CompleteActionParams, type FailActionParams, type DBEvent, type EmitEventParams, type ListEventsParams, LocalDB, } from './runtime';
11
+ export { type SeedProgress, type SeedResult, type SeedErrorInfo, type SeedConfig, type GenerateConfig, type SeedRunner, SeedError, Seed, Generate, createSeedRunner, } from './seed';
12
+ export { type WorkflowTrigger, type WorkflowContext, type WorkflowConfig, type RunOptions, type WorkflowExecution, type WorkflowStats, type WorkflowRunner, createWorkflowRunner, } from './workflow';
13
+ export { type ProgressUpdate, type LogEntry as TerminalLogEntry, type DashboardStats as TerminalDashboardStats, type WorkflowStatus as TerminalWorkflowStatus, type DashboardOptions, type Dashboard, createDashboard, } from './terminal';
14
+ export { type EntityRef, type Relationship as SyncRelationship, type UpsertOptions, type LocalDb, type Conflict, type ConflictResolution, type PushResult, type PullResult, type SyncResult, type Progress, type PushOptions, type PullOptions, type SyncOptions, type SyncClientConfig, type MockRemote, type DeployConfig, type GenerateConfigOptions, type DeployOptions, type PreviewOptions, type DeployResult, type PreviewResult, type Deployer, SyncClient, createLocalDb, createMockRemote, createSyncClient, createDeployer, } from './sync';
15
+ export { type DbConfig, type DashboardStats, type TypeInfo, type ActivityEvent, type CascadeNode, type WorkflowStep, type WorkflowStatus, type GenerationState, type KeyboardHandlers, type LogEntry, type SearchResult, Layout, Header, Stats, TypeList, ActivityFeed, ProgressBar, CascadeTree, Table, Input, HelpOverlay, type LayoutProps, type HeaderProps, type StatsProps, type TypeListProps, type ActivityFeedProps, type ProgressBarProps, type CascadeTreeProps, type TableProps, type InputProps, type HelpOverlayProps, useDb, useStats, useActivity, useGeneration, useKeyboard, useCascade, useWorkflow, useLogs, type UseDbResult, type UseStatsOptions, type UseStatsResult, type UseActivityOptions, type UseActivityResult, type UseGenerationResult, type UseKeyboardOptions, type UseKeyboardResult, type UseCascadeResult, type UseWorkflowResult, type UseLogsOptions, type UseLogsResult, MainView, GenerateView, CascadeView, SeedView, WorkflowView, QueryView, LogsView, type MainViewProps, type GenerateViewProps, type CascadeViewProps, type SeedViewProps, type WorkflowViewProps, type QueryViewProps, type LogsViewProps, App, type AppProps, } from './dashboard';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,IAAI,iBAAiB,EACpC,KAAK,QAAQ,EACb,KAAK,cAAc,IAAI,qBAAqB,EAC5C,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,OAAO,EAEZ,aAAa,GACd,MAAM,WAAW,CAAA;AAGlB,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB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KAAK,aAAa,EAElB,GAAG,EACH,KAAK,QAAQ,GACd,MAAM,aAAa,CAAA"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * db4ai CLI - Entry point
3
+ *
4
+ * Re-exports all modules for the CLI package.
5
+ *
6
+ * Note: Some modules export types with the same names but different definitions.
7
+ * To avoid conflicts, use module-specific prefixes or import directly from the modules.
8
+ */
9
+ // Scanner module (project scanning)
10
+ export {
11
+ // Functions
12
+ createScanner, } from './scanner';
13
+ // Runtime module (local SQLite runtime)
14
+ export {
15
+ // Classes
16
+ LocalDB, } from './runtime';
17
+ // Seed module (seed runner)
18
+ export {
19
+ // Classes
20
+ SeedError,
21
+ // Functions
22
+ Seed, Generate, createSeedRunner, } from './seed';
23
+ // Workflow module (workflow runner)
24
+ export {
25
+ // Functions
26
+ createWorkflowRunner, } from './workflow';
27
+ // Terminal module (terminal dashboard)
28
+ export {
29
+ // Functions
30
+ createDashboard, } from './terminal';
31
+ // Sync module (data synchronization)
32
+ export {
33
+ // Symbols
34
+ SyncClient,
35
+ // Functions
36
+ createLocalDb, createMockRemote, createSyncClient, createDeployer, } from './sync';
37
+ // Dashboard module (React Ink dashboard)
38
+ // Note: Dashboard types have different structure than terminal types
39
+ export {
40
+ // Components
41
+ Layout, Header, Stats, TypeList, ActivityFeed, ProgressBar, CascadeTree, Table, Input, HelpOverlay,
42
+ // Hooks
43
+ useDb, useStats, useActivity, useGeneration, useKeyboard, useCascade, useWorkflow, useLogs,
44
+ // Views
45
+ MainView, GenerateView, CascadeView, SeedView, WorkflowView, QueryView, LogsView,
46
+ // App
47
+ App, } from './dashboard';
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oCAAoC;AACpC,OAAO;AAaL,YAAY;AACZ,aAAa,GACd,MAAM,WAAW,CAAA;AAElB,wCAAwC;AACxC,OAAO;AAoBL,UAAU;AACV,OAAO,GACR,MAAM,WAAW,CAAA;AAElB,4BAA4B;AAC5B,OAAO;AAQL,UAAU;AACV,SAAS;AACT,YAAY;AACZ,IAAI,EACJ,QAAQ,EACR,gBAAgB,GACjB,MAAM,QAAQ,CAAA;AAEf,oCAAoC;AACpC,OAAO;AASL,YAAY;AACZ,oBAAoB,GACrB,MAAM,YAAY,CAAA;AAEnB,uCAAuC;AACvC,OAAO;AAQL,YAAY;AACZ,eAAe,GAChB,MAAM,YAAY,CAAA;AAEnB,qCAAqC;AACrC,OAAO;AAwBL,UAAU;AACV,UAAU;AACV,YAAY;AACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,QAAQ,CAAA;AAEf,yCAAyC;AACzC,qEAAqE;AACrE,OAAO;AAaL,aAAa;AACb,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,KAAK,EACL,KAAK,EACL,WAAW;AAWX,QAAQ;AACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO;AAaP,QAAQ;AACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ;AAQR,MAAM;AACN,GAAG,GAEJ,MAAM,aAAa,CAAA"}
@@ -0,0 +1,236 @@
1
+ /**
2
+ * Module 14: Local Runtime
3
+ *
4
+ * SQLite-based local database runtime for offline-first development.
5
+ * Provides the same interface as the Cloudflare Durable Object for
6
+ * seamless local development and testing.
7
+ */
8
+ import Database from 'better-sqlite3';
9
+ export interface Thing {
10
+ rowid: number;
11
+ type: string;
12
+ id: string;
13
+ data: Record<string, unknown>;
14
+ content_hash: string;
15
+ created_at: number;
16
+ created_by_action?: number;
17
+ }
18
+ export interface UpsertResult {
19
+ rowid: number;
20
+ created: boolean;
21
+ }
22
+ export interface UpsertParams {
23
+ type: string;
24
+ id: string;
25
+ data: Record<string, unknown>;
26
+ created_by_action?: number;
27
+ }
28
+ export interface GetParams {
29
+ type: string;
30
+ id: string;
31
+ }
32
+ export interface ListParams {
33
+ type?: string;
34
+ limit?: number;
35
+ offset?: number;
36
+ where?: Record<string, unknown>;
37
+ order?: 'asc' | 'desc';
38
+ }
39
+ export interface Relationship {
40
+ rowid: number;
41
+ from_rowid: number;
42
+ to_rowid: number;
43
+ type: string;
44
+ path: string;
45
+ label: string;
46
+ created_at: number;
47
+ created_by_action?: number;
48
+ }
49
+ export interface CreateRelationshipParams {
50
+ from_rowid: number;
51
+ to_rowid: number;
52
+ type: string;
53
+ path: string;
54
+ label: string;
55
+ created_by_action?: number;
56
+ }
57
+ export interface TraverseParams {
58
+ from_rowid: number;
59
+ type?: string;
60
+ }
61
+ export interface IncomingParams {
62
+ to_rowid: number;
63
+ type?: string;
64
+ }
65
+ export interface TraverseMultiHopParams {
66
+ from_rowid: number;
67
+ depth: number;
68
+ type?: string;
69
+ }
70
+ export interface TraverseMultiHopResult {
71
+ to_rowid: number;
72
+ depth: number;
73
+ }
74
+ export interface Action {
75
+ rowid: number;
76
+ type: 'mutation' | 'generation' | 'resolution' | 'function' | 'evaluate';
77
+ input_hash: string;
78
+ input: Record<string, unknown>;
79
+ output?: Record<string, unknown>;
80
+ model?: string;
81
+ status: 'pending' | 'complete' | 'error';
82
+ error?: string;
83
+ duration_ms?: number;
84
+ cost_tokens?: number;
85
+ created_at: number;
86
+ }
87
+ export interface CreateActionParams {
88
+ type: 'mutation' | 'generation' | 'resolution' | 'function' | 'evaluate';
89
+ input: Record<string, unknown>;
90
+ model?: string;
91
+ }
92
+ export interface CompleteActionParams {
93
+ rowid: number;
94
+ output: Record<string, unknown>;
95
+ duration_ms?: number;
96
+ cost_tokens?: number;
97
+ }
98
+ export interface FailActionParams {
99
+ rowid: number;
100
+ error: string;
101
+ }
102
+ export interface DBEvent {
103
+ rowid: number;
104
+ type: string;
105
+ action: 'created' | 'updated' | 'deleted' | 'generated';
106
+ entity_type: string;
107
+ entity_id: string;
108
+ entity_rowid: number;
109
+ data: Record<string, unknown>;
110
+ changes?: Record<string, unknown>;
111
+ timestamp: number;
112
+ action_id?: number;
113
+ correlation_id?: string;
114
+ }
115
+ export interface EmitEventParams {
116
+ type: string;
117
+ action: 'created' | 'updated' | 'deleted' | 'generated';
118
+ entity_type: string;
119
+ entity_id: string;
120
+ entity_rowid: number;
121
+ data: Record<string, unknown>;
122
+ changes?: Record<string, unknown>;
123
+ action_id?: number;
124
+ correlation_id?: string;
125
+ }
126
+ export interface ListEventsParams {
127
+ type?: string;
128
+ action?: 'created' | 'updated' | 'deleted' | 'generated';
129
+ since?: number;
130
+ correlation_id?: string;
131
+ limit?: number;
132
+ }
133
+ export declare class LocalDB {
134
+ private db;
135
+ readonly path: string;
136
+ readonly version: number;
137
+ readonly things: ThingsAPI;
138
+ readonly relationships: RelationshipsAPI;
139
+ readonly actions: ActionsAPI;
140
+ readonly events: EventsAPI;
141
+ constructor(dbPath?: string);
142
+ private initSchema;
143
+ /**
144
+ * Closes the database connection.
145
+ */
146
+ close(): void;
147
+ /**
148
+ * Runs VACUUM to reclaim disk space.
149
+ */
150
+ vacuum(): Promise<void>;
151
+ }
152
+ declare class ThingsAPI {
153
+ private db;
154
+ constructor(db: Database.Database);
155
+ /**
156
+ * Upsert a thing. Returns existing rowid if content_hash matches,
157
+ * otherwise creates a new version.
158
+ */
159
+ upsert(params: UpsertParams): Promise<UpsertResult>;
160
+ /**
161
+ * Get the latest version of a thing by type and id.
162
+ */
163
+ get(params: GetParams): Promise<Thing | null>;
164
+ /**
165
+ * Get a specific version by rowid.
166
+ */
167
+ getByRowid(rowid: number): Promise<Thing | null>;
168
+ /**
169
+ * List things with optional filters.
170
+ */
171
+ list(params?: ListParams): Promise<Thing[]>;
172
+ /**
173
+ * Delete a thing by rowid.
174
+ */
175
+ delete(rowid: number): Promise<void>;
176
+ }
177
+ declare class RelationshipsAPI {
178
+ private db;
179
+ constructor(db: Database.Database);
180
+ /**
181
+ * Create or update a relationship edge.
182
+ * If (from_rowid, to_rowid, path) already exists, updates it.
183
+ */
184
+ create(params: CreateRelationshipParams): Promise<Relationship>;
185
+ /**
186
+ * List all relationships.
187
+ */
188
+ list(): Promise<Relationship[]>;
189
+ /**
190
+ * Traverse forward from an entity.
191
+ */
192
+ traverse(params: TraverseParams): Promise<Relationship[]>;
193
+ /**
194
+ * Find incoming edges to an entity.
195
+ */
196
+ incoming(params: IncomingParams): Promise<Relationship[]>;
197
+ /**
198
+ * Traverse multiple hops from an entity (BFS).
199
+ */
200
+ traverseMultiHop(params: TraverseMultiHopParams): Promise<TraverseMultiHopResult[]>;
201
+ }
202
+ declare class ActionsAPI {
203
+ private db;
204
+ constructor(db: Database.Database);
205
+ /**
206
+ * Create a new action in pending status.
207
+ */
208
+ create(params: CreateActionParams): Promise<Action>;
209
+ /**
210
+ * Find a completed action by input hash (cache lookup).
211
+ * Only returns actions with status='complete'.
212
+ */
213
+ findByHash(input_hash: string): Promise<Action | null>;
214
+ /**
215
+ * Complete an action with output.
216
+ */
217
+ complete(params: CompleteActionParams): Promise<Action>;
218
+ /**
219
+ * Mark an action as failed.
220
+ */
221
+ fail(params: FailActionParams): Promise<Action>;
222
+ }
223
+ declare class EventsAPI {
224
+ private db;
225
+ constructor(db: Database.Database);
226
+ /**
227
+ * Emit an event.
228
+ */
229
+ emit(params: EmitEventParams): Promise<DBEvent>;
230
+ /**
231
+ * List events with optional filters.
232
+ */
233
+ list(params?: ListEventsParams): Promise<DBEvent[]>;
234
+ }
235
+ export default LocalDB;
236
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../cli/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AASrC,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,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