@mc1global/opencode-jarvis 0.4.0 → 0.7.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 (54) hide show
  1. package/QUICK-GUIDE.md +53 -0
  2. package/README.md +308 -89
  3. package/dist/application/bootstrap/healthcheck-use-cases.d.ts +68 -0
  4. package/dist/application/bootstrap/healthcheck-use-cases.d.ts.map +1 -0
  5. package/dist/application/bootstrap/healthcheck-use-cases.js +303 -0
  6. package/dist/application/bootstrap/healthcheck-use-cases.js.map +1 -0
  7. package/dist/application/bootstrap/index.d.ts +12 -0
  8. package/dist/application/bootstrap/index.d.ts.map +1 -0
  9. package/dist/application/bootstrap/index.js +9 -0
  10. package/dist/application/bootstrap/index.js.map +1 -0
  11. package/dist/application/bootstrap/terminal-commands-use-cases.d.ts +72 -0
  12. package/dist/application/bootstrap/terminal-commands-use-cases.d.ts.map +1 -0
  13. package/dist/application/bootstrap/terminal-commands-use-cases.js +132 -0
  14. package/dist/application/bootstrap/terminal-commands-use-cases.js.map +1 -0
  15. package/dist/application/bootstrap/use-cases.d.ts +55 -0
  16. package/dist/application/bootstrap/use-cases.d.ts.map +1 -0
  17. package/dist/application/bootstrap/use-cases.js +355 -0
  18. package/dist/application/bootstrap/use-cases.js.map +1 -0
  19. package/dist/application/rag/dtos.d.ts +6 -0
  20. package/dist/application/rag/dtos.d.ts.map +1 -1
  21. package/dist/application/rag/use-cases.d.ts +9 -1
  22. package/dist/application/rag/use-cases.d.ts.map +1 -1
  23. package/dist/application/rag/use-cases.js +121 -56
  24. package/dist/application/rag/use-cases.js.map +1 -1
  25. package/dist/domain/rag/repositories.d.ts +42 -0
  26. package/dist/domain/rag/repositories.d.ts.map +1 -1
  27. package/dist/domain/rag/services.d.ts +10 -0
  28. package/dist/domain/rag/services.d.ts.map +1 -1
  29. package/dist/domain/rag/services.js +38 -0
  30. package/dist/domain/rag/services.js.map +1 -1
  31. package/dist/hooks/first-run-guide.d.ts +33 -0
  32. package/dist/hooks/first-run-guide.d.ts.map +1 -0
  33. package/dist/hooks/first-run-guide.js +58 -0
  34. package/dist/hooks/first-run-guide.js.map +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +62 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/infrastructure/rag/file-discovery.d.ts.map +1 -1
  39. package/dist/infrastructure/rag/file-discovery.js +1 -0
  40. package/dist/infrastructure/rag/file-discovery.js.map +1 -1
  41. package/dist/infrastructure/rag/file-index-registry.d.ts +18 -0
  42. package/dist/infrastructure/rag/file-index-registry.d.ts.map +1 -0
  43. package/dist/infrastructure/rag/file-index-registry.js +67 -0
  44. package/dist/infrastructure/rag/file-index-registry.js.map +1 -0
  45. package/dist/mcp-server.js +41 -3
  46. package/dist/mcp-server.js.map +1 -1
  47. package/dist/tools/bootstrap-tools.d.ts +17 -0
  48. package/dist/tools/bootstrap-tools.d.ts.map +1 -0
  49. package/dist/tools/bootstrap-tools.js +171 -0
  50. package/dist/tools/bootstrap-tools.js.map +1 -0
  51. package/dist/tools/rag-tools.d.ts.map +1 -1
  52. package/dist/tools/rag-tools.js +9 -2
  53. package/dist/tools/rag-tools.js.map +1 -1
  54. package/package.json +3 -2
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Bootstrap Application — Healthcheck Use Cases
3
+ *
4
+ * Probes environment readiness by checking external dependencies
5
+ * (Ollama, Bun, Dagger, Azure CLI) and internal state (SQLite, config, RAG).
6
+ * All checks are non-destructive read-only probes with timeouts.
7
+ *
8
+ * SOLID: SRP — environment healthcheck orchestration only
9
+ * SOLID: OCP — new checks can be added without modifying existing ones
10
+ * SOLID: DIP — depends on port abstractions, not concrete implementations
11
+ */
12
+ import { execFile } from "node:child_process";
13
+ import { existsSync } from "node:fs";
14
+ import { platform } from "node:os";
15
+ // ── Healthcheck Use Cases ─────────────────────────────────────────────────────
16
+ /**
17
+ * Orchestrates non-destructive environment readiness probes.
18
+ */
19
+ export class HealthcheckUseCases {
20
+ deps;
21
+ constructor(deps) {
22
+ this.deps = deps;
23
+ }
24
+ /**
25
+ * Run all healthchecks and return aggregated results.
26
+ */
27
+ async runAll() {
28
+ const checks = await Promise.all([
29
+ this.checkBun(),
30
+ this.checkOllamaConnectivity(),
31
+ this.checkOllamaModel(),
32
+ this.checkSqlite(),
33
+ this.checkConfig(),
34
+ this.checkRagIndex(),
35
+ this.checkDagger(),
36
+ this.checkAzureCli(),
37
+ ]);
38
+ const pass = checks.filter((c) => c.status === "pass").length;
39
+ const warn = checks.filter((c) => c.status === "warn").length;
40
+ const fail = checks.filter((c) => c.status === "fail").length;
41
+ return {
42
+ checks,
43
+ summary: { pass, warn, fail, total: checks.length },
44
+ healthy: fail === 0,
45
+ };
46
+ }
47
+ // ── Individual Checks ───────────────────────────────────────────────
48
+ /** Check if Bun runtime is available on PATH. */
49
+ async checkBun() {
50
+ try {
51
+ const version = await execCommand("bun", ["--version"], 3000);
52
+ return {
53
+ name: "Bun Runtime",
54
+ status: "pass",
55
+ message: "Bun is available",
56
+ detail: `v${version.trim()}`,
57
+ };
58
+ }
59
+ catch {
60
+ return {
61
+ name: "Bun Runtime",
62
+ status: "fail",
63
+ message: "Bun is not installed or not on PATH. Required for SQLite and production runtime.",
64
+ detail: "Install: https://bun.sh",
65
+ fix: isMac()
66
+ ? "curl -fsSL https://bun.sh/install | bash"
67
+ : "curl -fsSL https://bun.sh/install | bash",
68
+ };
69
+ }
70
+ }
71
+ /** Check if Ollama is reachable at the configured URL. */
72
+ async checkOllamaConnectivity() {
73
+ try {
74
+ const controller = new AbortController();
75
+ const timeout = setTimeout(() => controller.abort(), 3000);
76
+ try {
77
+ const response = await fetch(`${this.deps.ollamaUrl}/api/tags`, {
78
+ signal: controller.signal,
79
+ });
80
+ if (response.ok) {
81
+ return {
82
+ name: "Ollama Connectivity",
83
+ status: "pass",
84
+ message: `Ollama is reachable at ${this.deps.ollamaUrl}`,
85
+ };
86
+ }
87
+ return {
88
+ name: "Ollama Connectivity",
89
+ status: "fail",
90
+ message: `Ollama responded with status ${String(response.status)} at ${this.deps.ollamaUrl}`,
91
+ };
92
+ }
93
+ finally {
94
+ clearTimeout(timeout);
95
+ }
96
+ }
97
+ catch {
98
+ const installCmd = isMac()
99
+ ? "brew install ollama && ollama serve"
100
+ : "curl -fsSL https://ollama.ai/install.sh | sh && ollama serve";
101
+ return {
102
+ name: "Ollama Connectivity",
103
+ status: "fail",
104
+ message: `Cannot reach Ollama at ${this.deps.ollamaUrl}. Is Ollama running?`,
105
+ detail: "Install: https://ollama.ai — then run: ollama serve",
106
+ fix: installCmd,
107
+ };
108
+ }
109
+ }
110
+ /** Check if the configured embedding model is available in Ollama. */
111
+ async checkOllamaModel() {
112
+ try {
113
+ const controller = new AbortController();
114
+ const timeout = setTimeout(() => controller.abort(), 3000);
115
+ try {
116
+ const response = await fetch(`${this.deps.ollamaUrl}/api/tags`, {
117
+ signal: controller.signal,
118
+ });
119
+ if (!response.ok) {
120
+ return {
121
+ name: "Embedding Model",
122
+ status: "fail",
123
+ message: "Cannot check models — Ollama not reachable",
124
+ };
125
+ }
126
+ const data = await response.json();
127
+ const models = data.models ?? [];
128
+ const modelNames = models.map((m) => {
129
+ const name = m.name ?? "";
130
+ // Ollama returns "model:tag", match against base name
131
+ return name.split(":")[0] ?? "";
132
+ });
133
+ if (modelNames.includes(this.deps.ollamaModel)) {
134
+ return {
135
+ name: "Embedding Model",
136
+ status: "pass",
137
+ message: `Model "${this.deps.ollamaModel}" is available`,
138
+ };
139
+ }
140
+ return {
141
+ name: "Embedding Model",
142
+ status: "fail",
143
+ message: `Model "${this.deps.ollamaModel}" not found in Ollama`,
144
+ detail: `Available models: ${modelNames.join(", ") || "(none)"}`,
145
+ fix: `ollama pull ${this.deps.ollamaModel}`,
146
+ };
147
+ }
148
+ finally {
149
+ clearTimeout(timeout);
150
+ }
151
+ }
152
+ catch {
153
+ return {
154
+ name: "Embedding Model",
155
+ status: "fail",
156
+ message: `Cannot check model "${this.deps.ollamaModel}" — Ollama not reachable`,
157
+ };
158
+ }
159
+ }
160
+ /** Check if the SQLite database file exists. */
161
+ async checkSqlite() {
162
+ if (existsSync(this.deps.dbPath)) {
163
+ return {
164
+ name: "SQLite Database",
165
+ status: "pass",
166
+ message: "Database file exists",
167
+ detail: this.deps.dbPath,
168
+ };
169
+ }
170
+ return {
171
+ name: "SQLite Database",
172
+ status: "warn",
173
+ message: "Database file not found — will be created on first use",
174
+ detail: this.deps.dbPath,
175
+ };
176
+ }
177
+ /** Check if config/jarvis.yaml exists. */
178
+ async checkConfig() {
179
+ if (existsSync(this.deps.configPath)) {
180
+ return {
181
+ name: "Configuration",
182
+ status: "pass",
183
+ message: "config/jarvis.yaml exists",
184
+ detail: this.deps.configPath,
185
+ };
186
+ }
187
+ return {
188
+ name: "Configuration",
189
+ status: "warn",
190
+ message: "config/jarvis.yaml not found — will be created by auto-bootstrap",
191
+ detail: this.deps.configPath,
192
+ };
193
+ }
194
+ /** Check RAG index status (document count). */
195
+ async checkRagIndex() {
196
+ try {
197
+ const status = await this.deps.getRagStatus(this.deps.workspace);
198
+ if (status === null) {
199
+ return {
200
+ name: "RAG Index",
201
+ status: "warn",
202
+ message: "RAG index not available — Ollama may be offline",
203
+ detail: `Workspace: ${this.deps.workspace}`,
204
+ };
205
+ }
206
+ if (status.documentCount === 0) {
207
+ return {
208
+ name: "RAG Index",
209
+ status: "warn",
210
+ message: "RAG index is empty — semantic code search will not return results",
211
+ detail: `Workspace: ${this.deps.workspace}`,
212
+ fix: "Use the rag-index tool to index the codebase, then rag-oracle-index with directory=\"obsidian-vault\" for documentation",
213
+ };
214
+ }
215
+ return {
216
+ name: "RAG Index",
217
+ status: "pass",
218
+ message: `RAG index contains ${String(status.documentCount)} documents`,
219
+ detail: `Workspace: ${this.deps.workspace}`,
220
+ };
221
+ }
222
+ catch {
223
+ return {
224
+ name: "RAG Index",
225
+ status: "warn",
226
+ message: "Could not check RAG index status",
227
+ detail: `Workspace: ${this.deps.workspace}`,
228
+ };
229
+ }
230
+ }
231
+ /** Check if Dagger CLI is available (optional). */
232
+ async checkDagger() {
233
+ try {
234
+ const version = await execCommand("dagger", ["version"], 3000);
235
+ return {
236
+ name: "Dagger CLI (optional)",
237
+ status: "pass",
238
+ message: "Dagger is available",
239
+ detail: version.trim(),
240
+ };
241
+ }
242
+ catch {
243
+ const installCmd = isMac()
244
+ ? "brew install dagger/tap/dagger"
245
+ : "curl -fsSL https://dl.dagger.io/dagger/install.sh | sh";
246
+ return {
247
+ name: "Dagger CLI (optional)",
248
+ status: "warn",
249
+ message: "Dagger is not installed — pipeline CI/CD features will be unavailable",
250
+ detail: "Install: https://docs.dagger.io/install",
251
+ fix: installCmd,
252
+ };
253
+ }
254
+ }
255
+ /** Check if Azure CLI is available (optional). */
256
+ async checkAzureCli() {
257
+ try {
258
+ const version = await execCommand("az", ["version", "--output", "tsv"], 3000);
259
+ const firstLine = version.split("\n")[0] ?? "";
260
+ return {
261
+ name: "Azure CLI (optional)",
262
+ status: "pass",
263
+ message: "Azure CLI is available",
264
+ detail: firstLine.trim(),
265
+ };
266
+ }
267
+ catch {
268
+ const installCmd = isMac()
269
+ ? "brew install azure-cli && az login"
270
+ : "curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash && az login";
271
+ return {
272
+ name: "Azure CLI (optional)",
273
+ status: "warn",
274
+ message: "Azure CLI is not installed — Azure DevOps sync will be unavailable",
275
+ detail: "Install: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli",
276
+ fix: installCmd,
277
+ };
278
+ }
279
+ }
280
+ }
281
+ // ── Platform Helper ───────────────────────────────────────────────────────────
282
+ /** Detect if running on macOS. */
283
+ function isMac() {
284
+ return platform() === "darwin";
285
+ }
286
+ // ── Shell Command Helper ──────────────────────────────────────────────────────
287
+ /**
288
+ * Execute a command with timeout. Returns stdout on success, throws on failure.
289
+ */
290
+ function execCommand(cmd, args, timeoutMs) {
291
+ return new Promise((resolve, reject) => {
292
+ const proc = execFile(cmd, [...args], { timeout: timeoutMs }, (error, stdout) => {
293
+ if (error) {
294
+ reject(error);
295
+ }
296
+ else {
297
+ resolve(stdout);
298
+ }
299
+ });
300
+ proc.on("error", reject);
301
+ });
302
+ }
303
+ //# sourceMappingURL=healthcheck-use-cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthcheck-use-cases.js","sourceRoot":"","sources":["../../../src/application/bootstrap/healthcheck-use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA8CnC,iFAAiF;AAEjF;;GAEG;AACH,MAAM,OAAO,mBAAmB;IACb,IAAI,CAAkB;IAEvC,YAAY,IAAqB;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC/B,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,aAAa,EAAE;SACrB,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;QAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;QAC9D,MAAM,IAAI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E,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC9E,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Bootstrap Application — Barrel Export
3
+ *
4
+ * Re-exports the bootstrap use cases, healthcheck, types, and template generator.
5
+ */
6
+ export { BootstrapUseCases, generateAgentsMd, } from "./use-cases.js";
7
+ export type { BootstrapConfig, BootstrapResult, } from "./use-cases.js";
8
+ export { HealthcheckUseCases } from "./healthcheck-use-cases.js";
9
+ export type { CheckStatus, CheckResult, HealthcheckResponse, HealthcheckDeps, } from "./healthcheck-use-cases.js";
10
+ export { TerminalCommandsUseCases } from "./terminal-commands-use-cases.js";
11
+ export type { TerminalCommand, TerminalCommandsResponse, TerminalCommandsRequest, TerminalCommandsUseCasesDeps, } from "./terminal-commands-use-cases.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/bootstrap/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,eAAe,EACf,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EACV,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,YAAY,EACV,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Bootstrap Application — Barrel Export
3
+ *
4
+ * Re-exports the bootstrap use cases, healthcheck, types, and template generator.
5
+ */
6
+ export { BootstrapUseCases, generateAgentsMd, } from "./use-cases.js";
7
+ export { HealthcheckUseCases } from "./healthcheck-use-cases.js";
8
+ export { TerminalCommandsUseCases } from "./terminal-commands-use-cases.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/bootstrap/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AASjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Terminal Commands Use Cases
3
+ *
4
+ * Generates context-aware terminal commands for long-running operations
5
+ * that cannot reliably run within the plugin tool timeout window.
6
+ * Users copy-paste these commands into a separate terminal session.
7
+ *
8
+ * Operations: RAG codebase index, ORACLE doc index, MCP server start.
9
+ *
10
+ * SOLID: SRP — terminal command generation only
11
+ * SOLID: OCP — new commands added via TerminalCommand entries
12
+ * DDD: Application Service pattern
13
+ */
14
+ /** A single terminal command entry with metadata. */
15
+ export interface TerminalCommand {
16
+ /** Short identifier (e.g. "rag-index") */
17
+ readonly id: string;
18
+ /** Human-readable name */
19
+ readonly name: string;
20
+ /** What this command does */
21
+ readonly description: string;
22
+ /** The exact command to run in a terminal */
23
+ readonly command: string;
24
+ /** Alternative command (e.g. script version) */
25
+ readonly scriptCommand?: string;
26
+ /** Prerequisites that must be met first */
27
+ readonly prerequisites: readonly string[];
28
+ /** Estimated duration hint (e.g. "1-5 minutes") */
29
+ readonly durationHint: string;
30
+ }
31
+ /** Response containing all available terminal commands. */
32
+ export interface TerminalCommandsResponse {
33
+ readonly commands: readonly TerminalCommand[];
34
+ readonly projectDirectory: string;
35
+ }
36
+ /** Filter options for listing commands. */
37
+ export interface TerminalCommandsRequest {
38
+ /** Filter by command ID (e.g. "rag-index"). Omit for all. */
39
+ readonly commandId?: string;
40
+ }
41
+ export interface TerminalCommandsUseCasesDeps {
42
+ /** Absolute path to the project directory */
43
+ readonly directory: string;
44
+ /** Whether the project has an obsidian-vault/ directory */
45
+ readonly hasVault: boolean;
46
+ /** Whether npm package is installed (vs local dev) */
47
+ readonly isNpmInstall: boolean;
48
+ }
49
+ /**
50
+ * Generates context-aware terminal commands for long-running JARVIS operations.
51
+ */
52
+ export declare class TerminalCommandsUseCases {
53
+ private readonly directory;
54
+ private readonly hasVault;
55
+ private readonly isNpmInstall;
56
+ constructor(deps: TerminalCommandsUseCasesDeps);
57
+ /**
58
+ * List available terminal commands, optionally filtered by ID.
59
+ */
60
+ list(request?: TerminalCommandsRequest): TerminalCommandsResponse;
61
+ private buildCommands;
62
+ /** RAG index: prefer bun script in dev, npx in npm install */
63
+ private ragIndexCommand;
64
+ private ragIndexScriptCommand;
65
+ /** ORACLE index */
66
+ private oracleIndexCommand;
67
+ private oracleIndexScriptCommand;
68
+ /** MCP server */
69
+ private mcpServerCommand;
70
+ private mcpServerScriptCommand;
71
+ }
72
+ //# sourceMappingURL=terminal-commands-use-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-commands-use-cases.d.ts","sourceRoot":"","sources":["../../../src/application/bootstrap/terminal-commands-use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAC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ACjB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,sBAAsB;CAM/B"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Terminal Commands Use Cases
3
+ *
4
+ * Generates context-aware terminal commands for long-running operations
5
+ * that cannot reliably run within the plugin tool timeout window.
6
+ * Users copy-paste these commands into a separate terminal session.
7
+ *
8
+ * Operations: RAG codebase index, ORACLE doc index, MCP server start.
9
+ *
10
+ * SOLID: SRP — terminal command generation only
11
+ * SOLID: OCP — new commands added via TerminalCommand entries
12
+ * DDD: Application Service pattern
13
+ */
14
+ // ── Use Cases ────────────────────────────────────────────────────────
15
+ /**
16
+ * Generates context-aware terminal commands for long-running JARVIS operations.
17
+ */
18
+ export class TerminalCommandsUseCases {
19
+ directory;
20
+ hasVault;
21
+ isNpmInstall;
22
+ constructor(deps) {
23
+ this.directory = deps.directory;
24
+ this.hasVault = deps.hasVault;
25
+ this.isNpmInstall = deps.isNpmInstall;
26
+ }
27
+ /**
28
+ * List available terminal commands, optionally filtered by ID.
29
+ */
30
+ list(request = {}) {
31
+ const all = this.buildCommands();
32
+ const commands = request.commandId !== undefined
33
+ ? all.filter((c) => c.id === request.commandId)
34
+ : all;
35
+ return {
36
+ commands,
37
+ projectDirectory: this.directory,
38
+ };
39
+ }
40
+ // ── Private ──────────────────────────────────────────────────────
41
+ buildCommands() {
42
+ const commands = [];
43
+ // RAG Codebase Index
44
+ commands.push({
45
+ id: "rag-index",
46
+ name: "RAG Codebase Index",
47
+ description: "Index the project codebase into the JARVIS RAG vector store " +
48
+ "for semantic code search. Run this after first setup or when " +
49
+ "the codebase has changed significantly.",
50
+ command: this.ragIndexCommand(),
51
+ scriptCommand: this.ragIndexScriptCommand(),
52
+ prerequisites: [
53
+ "Ollama running (ollama serve)",
54
+ "Embedding model available (ollama pull embeddinggemma)",
55
+ ],
56
+ durationHint: "1-10 minutes depending on codebase size",
57
+ });
58
+ // ORACLE Documentation Index
59
+ if (this.hasVault) {
60
+ commands.push({
61
+ id: "oracle-index",
62
+ name: "ORACLE Documentation Index",
63
+ description: "Index the Obsidian vault documentation into the ORACLE vector " +
64
+ "store for governance, workflow, and pattern semantic search. " +
65
+ "Run after updating vault documentation.",
66
+ command: this.oracleIndexCommand(),
67
+ scriptCommand: this.oracleIndexScriptCommand(),
68
+ prerequisites: [
69
+ "Ollama running (ollama serve)",
70
+ "Embedding model available (ollama pull embeddinggemma)",
71
+ "Obsidian vault exists (obsidian-vault/)",
72
+ ],
73
+ durationHint: "30 seconds to 2 minutes",
74
+ });
75
+ }
76
+ // MCP Server
77
+ commands.push({
78
+ id: "mcp-server",
79
+ name: "JARVIS MCP Server",
80
+ description: "Start the JARVIS MCP server (stdio transport) for use with " +
81
+ "Claude Desktop, Cursor, Windsurf, or other MCP-compatible " +
82
+ "clients. Exposes all JARVIS tools via MCP protocol.",
83
+ command: this.mcpServerCommand(),
84
+ scriptCommand: this.mcpServerScriptCommand(),
85
+ prerequisites: [
86
+ "Bun runtime installed (curl -fsSL https://bun.sh/install | bash)",
87
+ ],
88
+ durationHint: "Runs continuously (Ctrl+C to stop)",
89
+ });
90
+ return commands;
91
+ }
92
+ /** RAG index: prefer bun script in dev, npx in npm install */
93
+ ragIndexCommand() {
94
+ if (this.isNpmInstall) {
95
+ return `cd ${this.directory} && npx tsx node_modules/@mc1global/opencode-jarvis/scripts/rag-index.ts --clear`;
96
+ }
97
+ return `cd ${this.directory} && bun run scripts/rag-index.ts --clear`;
98
+ }
99
+ ragIndexScriptCommand() {
100
+ if (this.isNpmInstall) {
101
+ return `cd ${this.directory} && npx tsx node_modules/@mc1global/opencode-jarvis/scripts/rag-index.ts --clear`;
102
+ }
103
+ return `cd ${this.directory} && ./scripts/rag-index.sh --clear`;
104
+ }
105
+ /** ORACLE index */
106
+ oracleIndexCommand() {
107
+ if (this.isNpmInstall) {
108
+ return `cd ${this.directory} && npx tsx node_modules/@mc1global/opencode-jarvis/scripts/oracle-index.ts --clear`;
109
+ }
110
+ return `cd ${this.directory} && bun run scripts/oracle-index.ts --clear`;
111
+ }
112
+ oracleIndexScriptCommand() {
113
+ if (this.isNpmInstall) {
114
+ return `cd ${this.directory} && npx tsx node_modules/@mc1global/opencode-jarvis/scripts/oracle-index.ts --clear`;
115
+ }
116
+ return `cd ${this.directory} && ./scripts/oracle-index.sh --clear`;
117
+ }
118
+ /** MCP server */
119
+ mcpServerCommand() {
120
+ if (this.isNpmInstall) {
121
+ return `cd ${this.directory} && bunx jarvis-mcp --directory .`;
122
+ }
123
+ return `cd ${this.directory} && bun run src/mcp-server.ts --directory .`;
124
+ }
125
+ mcpServerScriptCommand() {
126
+ if (this.isNpmInstall) {
127
+ return `cd ${this.directory} && bunx jarvis-mcp --directory .`;
128
+ }
129
+ return `cd ${this.directory} && ./scripts/mcp-server.sh --directory .`;
130
+ }
131
+ }
132
+ //# sourceMappingURL=terminal-commands-use-cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-commands-use-cases.js","sourceRoot":"","sources":["../../../src/application/bootstrap/terminal-commands-use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA6CH,wEAAwE;AAExE;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAClB,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,YAAY,CAAU;IAEvC,YAAY,IAAkC;QAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,UAAmC,EAAE;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAEjC,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,KAAK,SAAS;YAC9C,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,E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CAAC;CACF"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Bootstrap Application — Use Cases
3
+ *
4
+ * Generates AGENTS.md with config-adaptive content and ensures
5
+ * the full JARVIS project structure exists (.jarvis/, config/, vault).
6
+ *
7
+ * SOLID: SRP — bootstrap orchestration only
8
+ * SOLID: OCP — new sections can be added without modifying existing ones
9
+ * SOLID: DIP — depends on ConfigService abstraction for config reading
10
+ */
11
+ import type { AzureSyncConfig } from "../../domain/config/value-objects.js";
12
+ /** Config snapshot used for adaptive template generation. */
13
+ export interface BootstrapConfig {
14
+ /** Whether azure-sync is configured (has org + project). */
15
+ readonly azureSyncEnabled: boolean;
16
+ /** Azure DevOps organization name (if configured). */
17
+ readonly azureOrg: string;
18
+ /** Azure DevOps project name (if configured). */
19
+ readonly azureProject: string;
20
+ /** Whether pipeline/dagger features are available. */
21
+ readonly pipelineEnabled: boolean;
22
+ /** Whether container-use environments are available. */
23
+ readonly containerUseEnabled: boolean;
24
+ }
25
+ /** Result of bootstrap operation. */
26
+ export interface BootstrapResult {
27
+ readonly agentsMdCreated: boolean;
28
+ readonly agentsMdPath: string;
29
+ readonly directoriesCreated: readonly string[];
30
+ readonly configCreated: boolean;
31
+ }
32
+ /**
33
+ * Orchestrates project bootstrap: AGENTS.md generation + directory structure.
34
+ */
35
+ export declare class BootstrapUseCases {
36
+ /**
37
+ * Bootstrap a project directory.
38
+ * Creates AGENTS.md (if missing), .jarvis/, config/jarvis.yaml, and vault skeleton.
39
+ *
40
+ * @param directory - Project root directory
41
+ * @param config - Config snapshot for adaptive content
42
+ * @param force - If true, regenerate AGENTS.md even if it exists
43
+ */
44
+ bootstrap(directory: string, config: BootstrapConfig, force?: boolean): BootstrapResult;
45
+ /**
46
+ * Build a BootstrapConfig from an AzureSyncConfig (or defaults).
47
+ */
48
+ buildConfig(azureSyncConfig?: AzureSyncConfig): BootstrapConfig;
49
+ }
50
+ /**
51
+ * Generate config-adaptive AGENTS.md content.
52
+ * Sections for Azure DevOps, Dagger, and container-use only appear when enabled.
53
+ */
54
+ export declare function generateAgentsMd(config: BootstrapConfig): string;
55
+ //# sourceMappingURL=use-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cases.d.ts","sourceRoot":"","sources":["../../../src/application/bootstrap/use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAI5E,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,wDAAwD;IACxD,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;CACvC;AAED,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AA8DD;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,UAAQ,GAAG,eAAe;IAiDrF;;OAEG;IACH,WAAW,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,eAAe;CAUhE;AAID;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA4BhE"}