@elyracode/herd 0.9.56 → 0.9.58
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/extensions/index.ts +17 -9
- package/package.json +1 -1
package/extensions/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { basename, join } from "node:path";
|
|
4
|
-
import type { ExtensionAPI } from "@elyracode/coding-agent";
|
|
4
|
+
import type { AgentToolResult, ExtensionAPI } from "@elyracode/coding-agent";
|
|
5
5
|
import { Type } from "typebox";
|
|
6
6
|
|
|
7
7
|
export default function (elyra: ExtensionAPI): void {
|
|
8
|
-
|
|
9
8
|
// ── Tool: herd_status ──
|
|
10
9
|
elyra.registerTool({
|
|
11
10
|
name: "herd_status",
|
|
@@ -35,7 +34,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
35
34
|
try {
|
|
36
35
|
const nodeVersion = herd("node --version 2>/dev/null || echo 'unknown'").trim();
|
|
37
36
|
lines.push(`**Node.js**: ${nodeVersion}`);
|
|
38
|
-
} catch {
|
|
37
|
+
} catch {
|
|
38
|
+
/* skip */
|
|
39
|
+
}
|
|
39
40
|
|
|
40
41
|
lines.push("");
|
|
41
42
|
|
|
@@ -112,9 +113,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
112
113
|
description: "Log type to read (default: all)",
|
|
113
114
|
}),
|
|
114
115
|
),
|
|
115
|
-
lines: Type.Optional(
|
|
116
|
-
Type.Number({ description: "Number of lines to read (default: 50)" }),
|
|
117
|
-
),
|
|
116
|
+
lines: Type.Optional(Type.Number({ description: "Number of lines to read (default: 50)" })),
|
|
118
117
|
}),
|
|
119
118
|
execute: async (_toolCallId, params) => {
|
|
120
119
|
try {
|
|
@@ -159,6 +158,11 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
159
158
|
});
|
|
160
159
|
|
|
161
160
|
// ── Tool: herd_env_sync ──
|
|
161
|
+
interface EnvSyncDetails {
|
|
162
|
+
issues?: number;
|
|
163
|
+
ok?: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
162
166
|
elyra.registerTool({
|
|
163
167
|
name: "herd_env_sync",
|
|
164
168
|
label: "Herd .env Sync Check",
|
|
@@ -167,7 +171,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
167
171
|
"Verifies database host/port, Redis configuration, and service availability. " +
|
|
168
172
|
"Reports mismatches and suggests fixes.",
|
|
169
173
|
parameters: Type.Object({}),
|
|
170
|
-
execute: async (_toolCallId, _params) => {
|
|
174
|
+
execute: async (_toolCallId, _params): Promise<AgentToolResult<EnvSyncDetails>> => {
|
|
171
175
|
try {
|
|
172
176
|
const cwd = process.cwd();
|
|
173
177
|
const envPath = join(cwd, ".env");
|
|
@@ -219,7 +223,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
219
223
|
|
|
220
224
|
// Check common issues
|
|
221
225
|
if (env.APP_URL && !env.APP_URL.includes(".test")) {
|
|
222
|
-
issues.push(
|
|
226
|
+
issues.push(
|
|
227
|
+
`APP_URL is '${env.APP_URL}' -- Herd uses .test domains (e.g., http://${basename(cwd)}.test)`,
|
|
228
|
+
);
|
|
223
229
|
} else if (env.APP_URL) {
|
|
224
230
|
ok.push("APP_URL uses .test domain");
|
|
225
231
|
}
|
|
@@ -319,7 +325,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
319
325
|
elyra.registerCommand("herd", {
|
|
320
326
|
description: "Show Laravel Herd dashboard -- services, sites, PHP version",
|
|
321
327
|
handler: async (_args, _ctx) => {
|
|
322
|
-
elyra.sendUserMessage(
|
|
328
|
+
elyra.sendUserMessage(
|
|
329
|
+
"Show me the Laravel Herd status: PHP version, running services, linked sites, and current project info.",
|
|
330
|
+
);
|
|
323
331
|
},
|
|
324
332
|
});
|
|
325
333
|
|