@shepai/cli 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -12
- package/dist/eslint.config.d.mts +3 -0
- package/dist/eslint.config.d.mts.map +1 -0
- package/dist/eslint.config.mjs +188 -0
- package/dist/src/application/ports/output/index.d.ts +8 -0
- package/dist/src/application/ports/output/index.d.ts.map +1 -0
- package/dist/src/application/ports/output/index.js +7 -0
- package/dist/src/application/ports/output/settings.repository.interface.d.ts +43 -0
- package/dist/src/application/ports/output/settings.repository.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/settings.repository.interface.js +11 -0
- package/dist/src/application/use-cases/settings/index.d.ts +9 -0
- package/dist/src/application/use-cases/settings/index.d.ts.map +1 -0
- package/dist/src/application/use-cases/settings/index.js +8 -0
- package/dist/src/application/use-cases/settings/initialize-settings.use-case.d.ts +33 -0
- package/dist/src/application/use-cases/settings/initialize-settings.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/settings/initialize-settings.use-case.js +63 -0
- package/dist/src/application/use-cases/settings/load-settings.use-case.d.ts +33 -0
- package/dist/src/application/use-cases/settings/load-settings.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/settings/load-settings.use-case.js +57 -0
- package/dist/src/application/use-cases/settings/update-settings.use-case.d.ts +33 -0
- package/dist/src/application/use-cases/settings/update-settings.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/settings/update-settings.use-case.js +56 -0
- package/dist/src/domain/factories/index.d.ts +7 -0
- package/dist/src/domain/factories/index.d.ts.map +1 -0
- package/dist/src/domain/factories/index.js +6 -0
- package/dist/src/domain/factories/settings-defaults.factory.d.ts +36 -0
- package/dist/src/domain/factories/settings-defaults.factory.d.ts.map +1 -0
- package/dist/src/domain/factories/settings-defaults.factory.js +81 -0
- package/dist/src/domain/generated/output.d.ts +717 -0
- package/dist/src/domain/generated/output.d.ts.map +1 -0
- package/dist/src/domain/generated/output.js +93 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/infrastructure/di/container.d.ts +27 -0
- package/dist/src/infrastructure/di/container.d.ts.map +1 -0
- package/dist/src/infrastructure/di/container.js +53 -0
- package/dist/src/infrastructure/persistence/sqlite/connection.d.ts +39 -0
- package/dist/src/infrastructure/persistence/sqlite/connection.d.ts.map +1 -0
- package/dist/src/infrastructure/persistence/sqlite/connection.js +76 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +50 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +80 -0
- package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts +31 -0
- package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -0
- package/dist/src/infrastructure/persistence/sqlite/migrations.js +66 -0
- package/dist/src/infrastructure/repositories/sqlite-settings.repository.d.ts +40 -0
- package/dist/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -0
- package/dist/src/infrastructure/repositories/sqlite-settings.repository.js +123 -0
- package/dist/src/infrastructure/services/filesystem/shep-directory.service.d.ts +41 -0
- package/dist/src/infrastructure/services/filesystem/shep-directory.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/filesystem/shep-directory.service.js +64 -0
- package/dist/src/infrastructure/services/settings.service.d.ts +50 -0
- package/dist/src/infrastructure/services/settings.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/settings.service.js +67 -0
- package/dist/src/infrastructure/services/version.service.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/version.command.d.ts.map +1 -0
- package/dist/{presentation → src/presentation}/cli/index.d.ts +1 -1
- package/dist/src/presentation/cli/index.d.ts.map +1 -0
- package/dist/src/presentation/cli/index.js +86 -0
- package/dist/src/presentation/cli/ui/colors.d.ts.map +1 -0
- package/dist/src/presentation/cli/ui/formatters.d.ts.map +1 -0
- package/dist/src/presentation/cli/ui/index.d.ts.map +1 -0
- package/dist/src/presentation/cli/ui/messages.d.ts.map +1 -0
- package/dist/src/presentation/cli/ui/symbols.d.ts.map +1 -0
- package/dist/src/presentation/web/app/layout.d.ts +7 -0
- package/dist/src/presentation/web/app/layout.d.ts.map +1 -0
- package/dist/src/presentation/web/app/layout.js +21 -0
- package/dist/src/presentation/web/app/not-found.d.ts +2 -0
- package/dist/src/presentation/web/app/not-found.d.ts.map +1 -0
- package/dist/src/presentation/web/app/not-found.js +4 -0
- package/dist/src/presentation/web/app/page.d.ts +2 -0
- package/dist/src/presentation/web/app/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/page.js +6 -0
- package/dist/src/presentation/web/app/version/page.d.ts +2 -0
- package/dist/src/presentation/web/app/version/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/version/page.js +16 -0
- package/dist/src/presentation/web/components/features/index.d.ts +2 -0
- package/dist/src/presentation/web/components/features/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/index.js +2 -0
- package/dist/src/presentation/web/components/features/theme-toggle/index.d.ts +2 -0
- package/dist/src/presentation/web/components/features/theme-toggle/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/theme-toggle/index.js +1 -0
- package/dist/src/presentation/web/components/features/theme-toggle/theme-toggle.d.ts +2 -0
- package/dist/src/presentation/web/components/features/theme-toggle/theme-toggle.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/theme-toggle/theme-toggle.js +19 -0
- package/dist/src/presentation/web/components/features/theme-toggle/theme-toggle.stories.d.ts +8 -0
- package/dist/src/presentation/web/components/features/theme-toggle/theme-toggle.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/theme-toggle/theme-toggle.stories.js +17 -0
- package/dist/src/presentation/web/components/ui/accordion.d.ts +8 -0
- package/dist/src/presentation/web/components/ui/accordion.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/accordion.js +14 -0
- package/dist/src/presentation/web/components/ui/accordion.stories.d.ts +29 -0
- package/dist/src/presentation/web/components/ui/accordion.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/accordion.stories.js +35 -0
- package/dist/src/presentation/web/components/ui/alert.d.ts +9 -0
- package/dist/src/presentation/web/components/ui/alert.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/alert.js +22 -0
- package/dist/src/presentation/web/components/ui/alert.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/alert.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/alert.stories.js +30 -0
- package/dist/src/presentation/web/components/ui/badge.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/badge.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/badge.js +20 -0
- package/dist/src/presentation/web/components/ui/badge.stories.d.ts +11 -0
- package/dist/src/presentation/web/components/ui/badge.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/badge.stories.js +44 -0
- package/dist/src/presentation/web/components/ui/button.d.ts +12 -0
- package/dist/src/presentation/web/components/ui/button.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/button.js +33 -0
- package/dist/src/presentation/web/components/ui/button.stories.d.ts +17 -0
- package/dist/src/presentation/web/components/ui/button.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/button.stories.js +84 -0
- package/dist/src/presentation/web/components/ui/card.d.ts +9 -0
- package/dist/src/presentation/web/components/ui/card.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/card.js +16 -0
- package/dist/src/presentation/web/components/ui/card.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/card.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/card.stories.js +24 -0
- package/dist/src/presentation/web/components/ui/dialog.d.ts +20 -0
- package/dist/src/presentation/web/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/dialog.js +23 -0
- package/dist/src/presentation/web/components/ui/dialog.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/ui/dialog.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/dialog.stories.js +23 -0
- package/dist/src/presentation/web/components/ui/index.d.ts +13 -0
- package/dist/src/presentation/web/components/ui/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/index.js +14 -0
- package/dist/src/presentation/web/components/ui/input.d.ts +4 -0
- package/dist/src/presentation/web/components/ui/input.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/input.js +8 -0
- package/dist/src/presentation/web/components/ui/input.stories.d.ts +13 -0
- package/dist/src/presentation/web/components/ui/input.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/input.stories.js +55 -0
- package/dist/src/presentation/web/components/ui/label.d.ts +6 -0
- package/dist/src/presentation/web/components/ui/label.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/label.js +10 -0
- package/dist/src/presentation/web/components/ui/label.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/ui/label.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/label.stories.js +23 -0
- package/dist/src/presentation/web/components/ui/popover.d.ts +8 -0
- package/dist/src/presentation/web/components/ui/popover.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/popover.js +11 -0
- package/dist/src/presentation/web/components/ui/popover.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/popover.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/popover.stories.js +26 -0
- package/dist/src/presentation/web/components/ui/select.d.ts +14 -0
- package/dist/src/presentation/web/components/ui/select.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/select.js +26 -0
- package/dist/src/presentation/web/components/ui/select.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/select.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/select.stories.js +23 -0
- package/dist/src/presentation/web/components/ui/sonner.d.ts +5 -0
- package/dist/src/presentation/web/components/ui/sonner.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/sonner.js +14 -0
- package/dist/src/presentation/web/components/ui/sonner.stories.d.ts +13 -0
- package/dist/src/presentation/web/components/ui/sonner.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/sonner.stories.js +51 -0
- package/dist/src/presentation/web/components/ui/tabs.d.ts +8 -0
- package/dist/src/presentation/web/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/tabs.js +13 -0
- package/dist/src/presentation/web/components/ui/tabs.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/ui/tabs.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/tabs.stories.js +23 -0
- package/dist/src/presentation/web/eslint.config.d.mts +3 -0
- package/dist/src/presentation/web/eslint.config.d.mts.map +1 -0
- package/dist/src/presentation/web/eslint.config.mjs +15 -0
- package/dist/src/presentation/web/hooks/useTheme.d.ts +12 -0
- package/dist/src/presentation/web/hooks/useTheme.d.ts.map +1 -0
- package/dist/src/presentation/web/hooks/useTheme.js +73 -0
- package/dist/src/presentation/web/lib/utils.d.ts +11 -0
- package/dist/src/presentation/web/lib/utils.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/utils.js +13 -0
- package/dist/src/presentation/web/next.config.d.ts +4 -0
- package/dist/src/presentation/web/next.config.d.ts.map +1 -0
- package/dist/src/presentation/web/next.config.js +9 -0
- package/dist/src/presentation/web/postcss.config.d.mts +4 -0
- package/dist/src/presentation/web/postcss.config.d.mts.map +1 -0
- package/dist/src/presentation/web/postcss.config.mjs +8 -0
- package/dist/src/presentation/web/types/theme.d.ts +12 -0
- package/dist/src/presentation/web/types/theme.d.ts.map +1 -0
- package/dist/src/presentation/web/types/theme.js +5 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +60 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/infrastructure/services/version.service.d.ts.map +0 -1
- package/dist/presentation/cli/commands/version.command.d.ts.map +0 -1
- package/dist/presentation/cli/index.d.ts.map +0 -1
- package/dist/presentation/cli/index.js +0 -48
- package/dist/presentation/cli/ui/colors.d.ts.map +0 -1
- package/dist/presentation/cli/ui/formatters.d.ts.map +0 -1
- package/dist/presentation/cli/ui/index.d.ts.map +0 -1
- package/dist/presentation/cli/ui/messages.d.ts.map +0 -1
- package/dist/presentation/cli/ui/symbols.d.ts.map +0 -1
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{infrastructure → src/infrastructure}/services/version.service.d.ts +0 -0
- /package/dist/{infrastructure → src/infrastructure}/services/version.service.js +0 -0
- /package/dist/{presentation → src/presentation}/cli/commands/version.command.d.ts +0 -0
- /package/dist/{presentation → src/presentation}/cli/commands/version.command.js +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/colors.d.ts +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/colors.js +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/formatters.d.ts +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/formatters.js +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/index.d.ts +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/index.js +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/messages.d.ts +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/messages.js +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/symbols.d.ts +0 -0
- /package/dist/{presentation → src/presentation}/cli/ui/symbols.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/domain/generated/output.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,EAAE,EAAE,IAAI,CAAC;IACT;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;IAC7C;;OA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G,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export var ArtifactCategory;
|
|
2
|
+
(function (ArtifactCategory) {
|
|
3
|
+
ArtifactCategory["PRD"] = "PRD";
|
|
4
|
+
ArtifactCategory["API"] = "API";
|
|
5
|
+
ArtifactCategory["Design"] = "Design";
|
|
6
|
+
ArtifactCategory["Other"] = "Other";
|
|
7
|
+
})(ArtifactCategory || (ArtifactCategory = {}));
|
|
8
|
+
export var ArtifactFormat;
|
|
9
|
+
(function (ArtifactFormat) {
|
|
10
|
+
ArtifactFormat["Markdown"] = "md";
|
|
11
|
+
ArtifactFormat["Text"] = "txt";
|
|
12
|
+
ArtifactFormat["Yaml"] = "yaml";
|
|
13
|
+
ArtifactFormat["Other"] = "Other";
|
|
14
|
+
})(ArtifactFormat || (ArtifactFormat = {}));
|
|
15
|
+
export var ArtifactState;
|
|
16
|
+
(function (ArtifactState) {
|
|
17
|
+
ArtifactState["Todo"] = "Todo";
|
|
18
|
+
ArtifactState["Elaborating"] = "Elaborating";
|
|
19
|
+
ArtifactState["Done"] = "Done";
|
|
20
|
+
})(ArtifactState || (ArtifactState = {}));
|
|
21
|
+
export var MessageRole;
|
|
22
|
+
(function (MessageRole) {
|
|
23
|
+
MessageRole["Assistant"] = "assistant";
|
|
24
|
+
MessageRole["User"] = "user";
|
|
25
|
+
})(MessageRole || (MessageRole = {}));
|
|
26
|
+
export var RequirementType;
|
|
27
|
+
(function (RequirementType) {
|
|
28
|
+
RequirementType["Functional"] = "Functional";
|
|
29
|
+
RequirementType["NonFunctional"] = "NonFunctional";
|
|
30
|
+
})(RequirementType || (RequirementType = {}));
|
|
31
|
+
export var ResearchState;
|
|
32
|
+
(function (ResearchState) {
|
|
33
|
+
ResearchState["NotStarted"] = "NotStarted";
|
|
34
|
+
ResearchState["Running"] = "Running";
|
|
35
|
+
ResearchState["Finished"] = "Finished";
|
|
36
|
+
})(ResearchState || (ResearchState = {}));
|
|
37
|
+
export var TaskState;
|
|
38
|
+
(function (TaskState) {
|
|
39
|
+
TaskState["Todo"] = "Todo";
|
|
40
|
+
TaskState["WIP"] = "Work in Progress";
|
|
41
|
+
TaskState["Done"] = "Done";
|
|
42
|
+
TaskState["Review"] = "Review";
|
|
43
|
+
})(TaskState || (TaskState = {}));
|
|
44
|
+
export var PlanState;
|
|
45
|
+
(function (PlanState) {
|
|
46
|
+
PlanState["Requirements"] = "Requirements";
|
|
47
|
+
PlanState["ClarificationRequired"] = "ClarificationRequired";
|
|
48
|
+
PlanState["Ready"] = "Ready";
|
|
49
|
+
})(PlanState || (PlanState = {}));
|
|
50
|
+
export var SdlcLifecycle;
|
|
51
|
+
(function (SdlcLifecycle) {
|
|
52
|
+
SdlcLifecycle["Requirements"] = "Requirements";
|
|
53
|
+
SdlcLifecycle["Research"] = "Research";
|
|
54
|
+
SdlcLifecycle["Implementation"] = "Implementation";
|
|
55
|
+
SdlcLifecycle["Review"] = "Review";
|
|
56
|
+
SdlcLifecycle["DeployAndQA"] = "Deploy & QA";
|
|
57
|
+
SdlcLifecycle["Maintain"] = "Maintain";
|
|
58
|
+
})(SdlcLifecycle || (SdlcLifecycle = {}));
|
|
59
|
+
export var AgentStatus;
|
|
60
|
+
(function (AgentStatus) {
|
|
61
|
+
AgentStatus["Idle"] = "Idle";
|
|
62
|
+
AgentStatus["Running"] = "Running";
|
|
63
|
+
AgentStatus["Paused"] = "Paused";
|
|
64
|
+
AgentStatus["Stopped"] = "Stopped";
|
|
65
|
+
})(AgentStatus || (AgentStatus = {}));
|
|
66
|
+
export var FeatureAgentState;
|
|
67
|
+
(function (FeatureAgentState) {
|
|
68
|
+
FeatureAgentState["GatheringRequirements"] = "GatheringRequirements";
|
|
69
|
+
FeatureAgentState["ClarificationsRequired"] = "ClarificationsRequired";
|
|
70
|
+
FeatureAgentState["DoingResearch"] = "DoingResearch";
|
|
71
|
+
FeatureAgentState["AwaitingReview"] = "AwaitingReview";
|
|
72
|
+
FeatureAgentState["ExecutingWorkPlan"] = "ExecutingWorkPlan";
|
|
73
|
+
FeatureAgentState["Ready"] = "Ready";
|
|
74
|
+
})(FeatureAgentState || (FeatureAgentState = {}));
|
|
75
|
+
export var PortProtocol;
|
|
76
|
+
(function (PortProtocol) {
|
|
77
|
+
PortProtocol["TCP"] = "TCP";
|
|
78
|
+
PortProtocol["UDP"] = "UDP";
|
|
79
|
+
})(PortProtocol || (PortProtocol = {}));
|
|
80
|
+
export var DeployMethod;
|
|
81
|
+
(function (DeployMethod) {
|
|
82
|
+
DeployMethod["DockerCompose"] = "DockerCompose";
|
|
83
|
+
DeployMethod["Docker"] = "Docker";
|
|
84
|
+
DeployMethod["Kubernetes"] = "Kubernetes";
|
|
85
|
+
DeployMethod["Script"] = "Script";
|
|
86
|
+
DeployMethod["Manual"] = "Manual";
|
|
87
|
+
})(DeployMethod || (DeployMethod = {}));
|
|
88
|
+
export var DeploymentState;
|
|
89
|
+
(function (DeploymentState) {
|
|
90
|
+
DeploymentState["Booting"] = "Booting";
|
|
91
|
+
DeploymentState["Ready"] = "Ready";
|
|
92
|
+
DeploymentState["Stopped"] = "Stopped";
|
|
93
|
+
})(DeploymentState || (DeploymentState = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency Injection Container
|
|
3
|
+
*
|
|
4
|
+
* Configures tsyringe DI container with all application dependencies.
|
|
5
|
+
* Registers repository implementations, use cases, and services.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { container } from './infrastructure/di/container.js';
|
|
10
|
+
* const useCase = container.resolve(InitializeSettingsUseCase);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
import 'reflect-metadata';
|
|
14
|
+
import { container } from 'tsyringe';
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the DI container with all dependencies.
|
|
17
|
+
* Must be called before resolving any dependencies.
|
|
18
|
+
*
|
|
19
|
+
* @returns Configured container instance
|
|
20
|
+
*/
|
|
21
|
+
export declare function initializeContainer(): Promise<typeof container>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the configured container instance.
|
|
24
|
+
* Container must be initialized first via initializeContainer().
|
|
25
|
+
*/
|
|
26
|
+
export { container };
|
|
27
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAgBrC;;;;;GAKG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CAwBrE;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency Injection Container
|
|
3
|
+
*
|
|
4
|
+
* Configures tsyringe DI container with all application dependencies.
|
|
5
|
+
* Registers repository implementations, use cases, and services.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { container } from './infrastructure/di/container.js';
|
|
10
|
+
* const useCase = container.resolve(InitializeSettingsUseCase);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
import 'reflect-metadata';
|
|
14
|
+
import { container } from 'tsyringe';
|
|
15
|
+
import { SQLiteSettingsRepository } from '../repositories/sqlite-settings.repository.js';
|
|
16
|
+
// Use cases
|
|
17
|
+
import { InitializeSettingsUseCase } from '../../application/use-cases/settings/initialize-settings.use-case.js';
|
|
18
|
+
import { LoadSettingsUseCase } from '../../application/use-cases/settings/load-settings.use-case.js';
|
|
19
|
+
import { UpdateSettingsUseCase } from '../../application/use-cases/settings/update-settings.use-case.js';
|
|
20
|
+
// Database connection
|
|
21
|
+
import { getSQLiteConnection } from '../persistence/sqlite/connection.js';
|
|
22
|
+
import { runSQLiteMigrations } from '../persistence/sqlite/migrations.js';
|
|
23
|
+
/**
|
|
24
|
+
* Initialize the DI container with all dependencies.
|
|
25
|
+
* Must be called before resolving any dependencies.
|
|
26
|
+
*
|
|
27
|
+
* @returns Configured container instance
|
|
28
|
+
*/
|
|
29
|
+
export async function initializeContainer() {
|
|
30
|
+
// Get database connection
|
|
31
|
+
const db = await getSQLiteConnection();
|
|
32
|
+
// Run migrations
|
|
33
|
+
await runSQLiteMigrations(db);
|
|
34
|
+
// Register database instance
|
|
35
|
+
container.registerInstance('Database', db);
|
|
36
|
+
// Register repositories
|
|
37
|
+
container.register('ISettingsRepository', {
|
|
38
|
+
useFactory: (c) => {
|
|
39
|
+
const database = c.resolve('Database');
|
|
40
|
+
return new SQLiteSettingsRepository(database);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
// Register use cases (singletons for performance)
|
|
44
|
+
container.registerSingleton(InitializeSettingsUseCase);
|
|
45
|
+
container.registerSingleton(LoadSettingsUseCase);
|
|
46
|
+
container.registerSingleton(UpdateSettingsUseCase);
|
|
47
|
+
return container;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the configured container instance.
|
|
51
|
+
* Container must be initialized first via initializeContainer().
|
|
52
|
+
*/
|
|
53
|
+
export { container };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Connection Module
|
|
3
|
+
*
|
|
4
|
+
* Provides singleton database connection to ~/.shep/data
|
|
5
|
+
* Configures pragmas for optimal performance and reliability.
|
|
6
|
+
*/
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
/**
|
|
9
|
+
* Gets or creates the SQLite database connection.
|
|
10
|
+
* Singleton pattern ensures only one connection exists.
|
|
11
|
+
*
|
|
12
|
+
* On first call:
|
|
13
|
+
* - Ensures ~/.shep/ directory exists
|
|
14
|
+
* - Creates database file at ~/.shep/data
|
|
15
|
+
* - Configures pragmas for performance and reliability
|
|
16
|
+
*
|
|
17
|
+
* @returns Database connection instance
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const db = await getSQLiteConnection();
|
|
22
|
+
* const settings = db.prepare('SELECT * FROM settings').get();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getSQLiteConnection(): Promise<Database.Database>;
|
|
26
|
+
/**
|
|
27
|
+
* Closes the database connection.
|
|
28
|
+
* Should be called when application exits.
|
|
29
|
+
* Safe to call multiple times.
|
|
30
|
+
*/
|
|
31
|
+
export declare function closeSQLiteConnection(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the current database instance without creating one.
|
|
34
|
+
* Returns null if connection hasn't been established yet.
|
|
35
|
+
*
|
|
36
|
+
* @returns Database instance or null
|
|
37
|
+
*/
|
|
38
|
+
export declare function getExistingConnection(): Database.Database | null;
|
|
39
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/persistence/sqlite/connection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAYtC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAkCtE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAEhE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Connection Module
|
|
3
|
+
*
|
|
4
|
+
* Provides singleton database connection to ~/.shep/data
|
|
5
|
+
* Configures pragmas for optimal performance and reliability.
|
|
6
|
+
*/
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
import { ensureShepDirectory, getShepDbPath, } from '../../services/filesystem/shep-directory.service.js';
|
|
9
|
+
/**
|
|
10
|
+
* Singleton database instance.
|
|
11
|
+
* Initialized on first call to getSQLiteConnection().
|
|
12
|
+
*/
|
|
13
|
+
let dbInstance = null;
|
|
14
|
+
/**
|
|
15
|
+
* Gets or creates the SQLite database connection.
|
|
16
|
+
* Singleton pattern ensures only one connection exists.
|
|
17
|
+
*
|
|
18
|
+
* On first call:
|
|
19
|
+
* - Ensures ~/.shep/ directory exists
|
|
20
|
+
* - Creates database file at ~/.shep/data
|
|
21
|
+
* - Configures pragmas for performance and reliability
|
|
22
|
+
*
|
|
23
|
+
* @returns Database connection instance
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const db = await getSQLiteConnection();
|
|
28
|
+
* const settings = db.prepare('SELECT * FROM settings').get();
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export async function getSQLiteConnection() {
|
|
32
|
+
if (dbInstance) {
|
|
33
|
+
return dbInstance;
|
|
34
|
+
}
|
|
35
|
+
// Ensure ~/.shep/ directory exists
|
|
36
|
+
await ensureShepDirectory();
|
|
37
|
+
// Get database path
|
|
38
|
+
const dbPath = getShepDbPath();
|
|
39
|
+
// Create database connection
|
|
40
|
+
dbInstance = new Database(dbPath, {
|
|
41
|
+
// eslint-disable-next-line no-console
|
|
42
|
+
verbose: process.env.DEBUG_SQL ? console.log : undefined,
|
|
43
|
+
});
|
|
44
|
+
// Configure pragmas for production use
|
|
45
|
+
// WAL mode: Better concurrency, write performance
|
|
46
|
+
dbInstance.pragma('journal_mode = WAL');
|
|
47
|
+
// NORMAL synchronous: Balance between safety and performance
|
|
48
|
+
dbInstance.pragma('synchronous = NORMAL');
|
|
49
|
+
// Enable foreign keys
|
|
50
|
+
dbInstance.pragma('foreign_keys = ON');
|
|
51
|
+
// Defensive mode: Additional safety checks
|
|
52
|
+
dbInstance.pragma('defensive = ON');
|
|
53
|
+
// Cache size: 2000 pages (~8MB with 4KB page size)
|
|
54
|
+
dbInstance.pragma('cache_size = -2000');
|
|
55
|
+
return dbInstance;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Closes the database connection.
|
|
59
|
+
* Should be called when application exits.
|
|
60
|
+
* Safe to call multiple times.
|
|
61
|
+
*/
|
|
62
|
+
export function closeSQLiteConnection() {
|
|
63
|
+
if (dbInstance) {
|
|
64
|
+
dbInstance.close();
|
|
65
|
+
dbInstance = null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Gets the current database instance without creating one.
|
|
70
|
+
* Returns null if connection hasn't been established yet.
|
|
71
|
+
*
|
|
72
|
+
* @returns Database instance or null
|
|
73
|
+
*/
|
|
74
|
+
export function getExistingConnection() {
|
|
75
|
+
return dbInstance;
|
|
76
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings Database Mapper
|
|
3
|
+
*
|
|
4
|
+
* Maps between Settings domain objects and SQLite database rows.
|
|
5
|
+
*
|
|
6
|
+
* Mapping Rules:
|
|
7
|
+
* - TypeScript objects (camelCase) ↔ SQL columns (snake_case)
|
|
8
|
+
* - Nested objects flattened to columns (e.g., models.analyze → model_analyze)
|
|
9
|
+
* - Booleans stored as INTEGER (0 = false, 1 = true)
|
|
10
|
+
* - Dates stored as ISO 8601 strings
|
|
11
|
+
* - Optional fields stored as NULL when missing
|
|
12
|
+
*/
|
|
13
|
+
import type { Settings } from '../../../../domain/generated/output.js';
|
|
14
|
+
/**
|
|
15
|
+
* Database row type matching the settings table schema.
|
|
16
|
+
* Uses snake_case column names with flattened nested objects.
|
|
17
|
+
*/
|
|
18
|
+
export interface SettingsRow {
|
|
19
|
+
id: string;
|
|
20
|
+
created_at: string;
|
|
21
|
+
updated_at: string;
|
|
22
|
+
model_analyze: string;
|
|
23
|
+
model_requirements: string;
|
|
24
|
+
model_plan: string;
|
|
25
|
+
model_implement: string;
|
|
26
|
+
user_name: string | null;
|
|
27
|
+
user_email: string | null;
|
|
28
|
+
user_github_username: string | null;
|
|
29
|
+
env_default_editor: string;
|
|
30
|
+
env_shell_preference: string;
|
|
31
|
+
sys_auto_update: number;
|
|
32
|
+
sys_log_level: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Maps Settings domain object to database row.
|
|
36
|
+
* Flattens nested objects and converts types for SQL storage.
|
|
37
|
+
*
|
|
38
|
+
* @param settings - Settings domain object
|
|
39
|
+
* @returns Database row object with snake_case columns
|
|
40
|
+
*/
|
|
41
|
+
export declare function toDatabase(settings: Settings): SettingsRow;
|
|
42
|
+
/**
|
|
43
|
+
* Maps database row to Settings domain object.
|
|
44
|
+
* Reconstructs nested objects and converts types from SQL.
|
|
45
|
+
*
|
|
46
|
+
* @param row - Database row with snake_case columns
|
|
47
|
+
* @returns Settings domain object with camelCase properties
|
|
48
|
+
*/
|
|
49
|
+
export declare function fromDatabase(row: SettingsRow): Settings;
|
|
50
|
+
//# sourceMappingURL=settings.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.mapper.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/persistence/sqlite/mappers/settings.mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAE1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IAGxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAG7B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CA4B1D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,QAAQ,CAkCvD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings Database Mapper
|
|
3
|
+
*
|
|
4
|
+
* Maps between Settings domain objects and SQLite database rows.
|
|
5
|
+
*
|
|
6
|
+
* Mapping Rules:
|
|
7
|
+
* - TypeScript objects (camelCase) ↔ SQL columns (snake_case)
|
|
8
|
+
* - Nested objects flattened to columns (e.g., models.analyze → model_analyze)
|
|
9
|
+
* - Booleans stored as INTEGER (0 = false, 1 = true)
|
|
10
|
+
* - Dates stored as ISO 8601 strings
|
|
11
|
+
* - Optional fields stored as NULL when missing
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Maps Settings domain object to database row.
|
|
15
|
+
* Flattens nested objects and converts types for SQL storage.
|
|
16
|
+
*
|
|
17
|
+
* @param settings - Settings domain object
|
|
18
|
+
* @returns Database row object with snake_case columns
|
|
19
|
+
*/
|
|
20
|
+
export function toDatabase(settings) {
|
|
21
|
+
return {
|
|
22
|
+
// Base entity
|
|
23
|
+
id: settings.id,
|
|
24
|
+
created_at: settings.createdAt instanceof Date ? settings.createdAt.toISOString() : settings.createdAt,
|
|
25
|
+
updated_at: settings.updatedAt instanceof Date ? settings.updatedAt.toISOString() : settings.updatedAt,
|
|
26
|
+
// ModelConfiguration
|
|
27
|
+
model_analyze: settings.models.analyze,
|
|
28
|
+
model_requirements: settings.models.requirements,
|
|
29
|
+
model_plan: settings.models.plan,
|
|
30
|
+
model_implement: settings.models.implement,
|
|
31
|
+
// UserProfile (optional fields → NULL)
|
|
32
|
+
user_name: settings.user.name ?? null,
|
|
33
|
+
user_email: settings.user.email ?? null,
|
|
34
|
+
user_github_username: settings.user.githubUsername ?? null,
|
|
35
|
+
// EnvironmentConfig
|
|
36
|
+
env_default_editor: settings.environment.defaultEditor,
|
|
37
|
+
env_shell_preference: settings.environment.shellPreference,
|
|
38
|
+
// SystemConfig
|
|
39
|
+
sys_auto_update: settings.system.autoUpdate ? 1 : 0,
|
|
40
|
+
sys_log_level: settings.system.logLevel,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Maps database row to Settings domain object.
|
|
45
|
+
* Reconstructs nested objects and converts types from SQL.
|
|
46
|
+
*
|
|
47
|
+
* @param row - Database row with snake_case columns
|
|
48
|
+
* @returns Settings domain object with camelCase properties
|
|
49
|
+
*/
|
|
50
|
+
export function fromDatabase(row) {
|
|
51
|
+
return {
|
|
52
|
+
// Base entity
|
|
53
|
+
id: row.id,
|
|
54
|
+
createdAt: new Date(row.created_at),
|
|
55
|
+
updatedAt: new Date(row.updated_at),
|
|
56
|
+
// ModelConfiguration
|
|
57
|
+
models: {
|
|
58
|
+
analyze: row.model_analyze,
|
|
59
|
+
requirements: row.model_requirements,
|
|
60
|
+
plan: row.model_plan,
|
|
61
|
+
implement: row.model_implement,
|
|
62
|
+
},
|
|
63
|
+
// UserProfile (NULL → undefined, exclude from object)
|
|
64
|
+
user: {
|
|
65
|
+
...(row.user_name !== null && { name: row.user_name }),
|
|
66
|
+
...(row.user_email !== null && { email: row.user_email }),
|
|
67
|
+
...(row.user_github_username !== null && { githubUsername: row.user_github_username }),
|
|
68
|
+
},
|
|
69
|
+
// EnvironmentConfig
|
|
70
|
+
environment: {
|
|
71
|
+
defaultEditor: row.env_default_editor,
|
|
72
|
+
shellPreference: row.env_shell_preference,
|
|
73
|
+
},
|
|
74
|
+
// SystemConfig (INTEGER → boolean)
|
|
75
|
+
system: {
|
|
76
|
+
autoUpdate: row.sys_auto_update === 1,
|
|
77
|
+
logLevel: row.sys_log_level,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Migrations Module
|
|
3
|
+
*
|
|
4
|
+
* Manages database schema migrations using a simple manual approach.
|
|
5
|
+
* Migrations are SQL files in migrations/ directory, numbered sequentially.
|
|
6
|
+
*
|
|
7
|
+
* Migration Files:
|
|
8
|
+
* - 001_create_settings_table.sql
|
|
9
|
+
* - 002_add_feature_table.sql
|
|
10
|
+
* - etc.
|
|
11
|
+
*
|
|
12
|
+
* Tracks applied migrations using user_version pragma.
|
|
13
|
+
*/
|
|
14
|
+
import type Database from 'better-sqlite3';
|
|
15
|
+
/**
|
|
16
|
+
* Runs all pending database migrations.
|
|
17
|
+
* Safe to call multiple times (idempotent).
|
|
18
|
+
*
|
|
19
|
+
* Migrations are loaded from migrations/ directory and applied in order.
|
|
20
|
+
* The user_version pragma tracks which migrations have been applied.
|
|
21
|
+
*
|
|
22
|
+
* @param db - Database instance to run migrations on
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const db = await getSQLiteConnection();
|
|
27
|
+
* await runSQLiteMigrations(db);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function runSQLiteMigrations(db: Database.Database): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/persistence/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AA2B3C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B9E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Migrations Module
|
|
3
|
+
*
|
|
4
|
+
* Manages database schema migrations using a simple manual approach.
|
|
5
|
+
* Migrations are SQL files in migrations/ directory, numbered sequentially.
|
|
6
|
+
*
|
|
7
|
+
* Migration Files:
|
|
8
|
+
* - 001_create_settings_table.sql
|
|
9
|
+
* - 002_add_feature_table.sql
|
|
10
|
+
* - etc.
|
|
11
|
+
*
|
|
12
|
+
* Tracks applied migrations using user_version pragma.
|
|
13
|
+
*/
|
|
14
|
+
import { readFileSync } from 'node:fs';
|
|
15
|
+
import { join, dirname } from 'node:path';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
// Get current directory for __dirname equivalent in ESM
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = dirname(__filename);
|
|
20
|
+
/**
|
|
21
|
+
* Directory containing migration SQL files.
|
|
22
|
+
*/
|
|
23
|
+
const MIGRATIONS_DIR = join(__dirname, 'migrations');
|
|
24
|
+
/**
|
|
25
|
+
* List of all migrations in order.
|
|
26
|
+
*/
|
|
27
|
+
const MIGRATIONS = [{ version: 1, filename: '001_create_settings_table.sql' }];
|
|
28
|
+
/**
|
|
29
|
+
* Runs all pending database migrations.
|
|
30
|
+
* Safe to call multiple times (idempotent).
|
|
31
|
+
*
|
|
32
|
+
* Migrations are loaded from migrations/ directory and applied in order.
|
|
33
|
+
* The user_version pragma tracks which migrations have been applied.
|
|
34
|
+
*
|
|
35
|
+
* @param db - Database instance to run migrations on
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const db = await getSQLiteConnection();
|
|
40
|
+
* await runSQLiteMigrations(db);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export async function runSQLiteMigrations(db) {
|
|
44
|
+
try {
|
|
45
|
+
// Get current schema version
|
|
46
|
+
const result = db.prepare('PRAGMA user_version').get();
|
|
47
|
+
const currentVersion = result.user_version;
|
|
48
|
+
// Run each pending migration
|
|
49
|
+
for (const migration of MIGRATIONS) {
|
|
50
|
+
if (migration.version > currentVersion) {
|
|
51
|
+
// Load migration SQL
|
|
52
|
+
const sql = readFileSync(join(MIGRATIONS_DIR, migration.filename), 'utf-8');
|
|
53
|
+
// Execute migration in a transaction
|
|
54
|
+
db.transaction(() => {
|
|
55
|
+
// Run migration SQL (using better-sqlite3's exec method, not child_process)
|
|
56
|
+
db.exec(sql);
|
|
57
|
+
// Update user_version
|
|
58
|
+
db.prepare(`PRAGMA user_version = ${migration.version}`).run();
|
|
59
|
+
})();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
throw new Error(`Failed to run database migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Settings Repository Implementation
|
|
3
|
+
*
|
|
4
|
+
* Implements ISettingsRepository using SQLite database.
|
|
5
|
+
* Enforces singleton pattern (only one Settings record allowed).
|
|
6
|
+
* Uses prepared statements to prevent SQL injection.
|
|
7
|
+
*/
|
|
8
|
+
import type Database from 'better-sqlite3';
|
|
9
|
+
import type { ISettingsRepository } from '../../application/ports/output/settings.repository.interface.js';
|
|
10
|
+
import type { Settings } from '../../domain/generated/output.js';
|
|
11
|
+
/**
|
|
12
|
+
* SQLite implementation of ISettingsRepository.
|
|
13
|
+
* Manages Settings persistence with singleton constraint.
|
|
14
|
+
*/
|
|
15
|
+
export declare class SQLiteSettingsRepository implements ISettingsRepository {
|
|
16
|
+
private readonly db;
|
|
17
|
+
constructor(db: Database.Database);
|
|
18
|
+
/**
|
|
19
|
+
* Initialize settings for the first time.
|
|
20
|
+
* Creates a new Settings record in the database.
|
|
21
|
+
*
|
|
22
|
+
* @param settings - The settings to initialize with
|
|
23
|
+
* @throws Error if settings already exist (singleton constraint)
|
|
24
|
+
*/
|
|
25
|
+
initialize(settings: Settings): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Load existing settings from the database.
|
|
28
|
+
*
|
|
29
|
+
* @returns The existing Settings or null if not initialized
|
|
30
|
+
*/
|
|
31
|
+
load(): Promise<Settings | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Update existing settings in the database.
|
|
34
|
+
*
|
|
35
|
+
* @param settings - The updated settings to persist
|
|
36
|
+
* @throws Error if settings don't exist (must initialize first)
|
|
37
|
+
*/
|
|
38
|
+
update(settings: Settings): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=sqlite-settings.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-settings.repository.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/sqlite-settings.repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAC;AAC3G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAOjE;;;GAGG;AACH,qBACa,wBAAyB,YAAW,mBAAmB;IACtD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ,CAAC,QAAQ;IAElD;;;;;;OAMG;IACG,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BnD;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAgBtC;;;;;OAKG;IACG,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAqChD"}
|