@glubean/cli 0.1.27 → 0.1.29

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.
@@ -1,252 +0,0 @@
1
- /**
2
- * Sync command - packages and uploads test files to the Glubean cloud registry.
3
- */
4
- import { join, relative, resolve } from "node:path";
5
- import { readdir, readFile, stat, rm } from "node:fs/promises";
6
- import archiver from "archiver";
7
- import { createWriteStream } from "node:fs";
8
- import { scan } from "@glubean/scanner";
9
- import { buildMetadata } from "../metadata.js";
10
- import { CLI_VERSION } from "../version.js";
11
- import { resolveApiUrl, resolveProjectId, resolveToken } from "../lib/auth.js";
12
- import { loadConfig } from "../lib/config.js";
13
- import { loadProjectEnv } from "../lib/env.js";
14
- const colors = {
15
- reset: "\x1b[0m",
16
- bold: "\x1b[1m",
17
- dim: "\x1b[2m",
18
- green: "\x1b[32m",
19
- yellow: "\x1b[33m",
20
- blue: "\x1b[34m",
21
- red: "\x1b[31m",
22
- cyan: "\x1b[36m",
23
- };
24
- const DEFAULT_SKIP_DIRS = [
25
- "node_modules",
26
- ".git",
27
- ".glubean",
28
- "dist",
29
- "build",
30
- ];
31
- function parseIgnorePatterns(content) {
32
- const patterns = [];
33
- for (const raw of content.split("\n")) {
34
- const line = raw.trim();
35
- if (!line || line.startsWith("#"))
36
- continue;
37
- let pattern = line;
38
- if (pattern.startsWith("/"))
39
- pattern = pattern.slice(1);
40
- if (pattern.endsWith("/"))
41
- pattern = pattern.slice(0, -1);
42
- pattern = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&");
43
- pattern = pattern
44
- .replace(/\*\*/g, "{{GLOBSTAR}}")
45
- .replace(/\*/g, "[^/]*")
46
- .replace(/\?/g, "[^/]")
47
- .replace(/\{\{GLOBSTAR\}\}/g, ".*");
48
- patterns.push(new RegExp(`(^|/)${pattern}(/|$)`));
49
- }
50
- return patterns;
51
- }
52
- async function walkForFiles(dir, skipPatterns) {
53
- const files = [];
54
- const entries = await readdir(dir, { withFileTypes: true });
55
- for (const entry of entries) {
56
- if (entry.name.startsWith(".") && entry.name !== ".env" && entry.name !== ".glubeanignore") {
57
- // Skip hidden files except .env and .glubeanignore
58
- }
59
- const full = join(dir, entry.name);
60
- if (entry.isDirectory()) {
61
- if (DEFAULT_SKIP_DIRS.includes(entry.name))
62
- continue;
63
- files.push(...await walkForFiles(full, skipPatterns));
64
- }
65
- else if (entry.isFile()) {
66
- files.push(full);
67
- }
68
- }
69
- return files;
70
- }
71
- async function collectBundleFiles(dir) {
72
- const skipPatterns = DEFAULT_SKIP_DIRS.map((d) => new RegExp(`(^|/)${d}(/|$)`));
73
- const ignorePath = join(dir, ".glubeanignore");
74
- try {
75
- const content = await readFile(ignorePath, "utf-8");
76
- skipPatterns.push(...parseIgnorePatterns(content));
77
- }
78
- catch {
79
- // No .glubeanignore
80
- }
81
- const allFiles = await walkForFiles(dir, skipPatterns);
82
- const files = [];
83
- for (const file of allFiles) {
84
- const rel = relative(dir, file);
85
- if (rel.startsWith(".glubean-bundle-"))
86
- continue;
87
- // Apply skip patterns
88
- if (skipPatterns.some((p) => p.test(rel)))
89
- continue;
90
- files.push(rel);
91
- }
92
- return files.sort();
93
- }
94
- async function createBundleTar(dir, metadata, outputPath) {
95
- const bundleFiles = await collectBundleFiles(dir);
96
- return new Promise((resolve, reject) => {
97
- const output = createWriteStream(outputPath);
98
- const archive = archiver("tar");
99
- output.on("close", () => resolve(bundleFiles.length));
100
- archive.on("error", (err) => reject(err));
101
- archive.pipe(output);
102
- // Add metadata.json
103
- const metadataContent = JSON.stringify(metadata, null, 2);
104
- archive.append(metadataContent, { name: "metadata.json" });
105
- // Add all project files
106
- for (const filePath of bundleFiles) {
107
- const srcPath = join(dir, filePath);
108
- archive.file(srcPath, { name: filePath });
109
- }
110
- archive.finalize();
111
- });
112
- }
113
- async function initSync(projectId, version, apiUrl, token) {
114
- const headers = {
115
- "Content-Type": "application/json",
116
- };
117
- if (token)
118
- headers["Authorization"] = `Bearer ${token}`;
119
- const response = await fetch(`${apiUrl}/projects/${projectId}/bundles/sync/init`, {
120
- method: "POST",
121
- headers,
122
- body: JSON.stringify({ version }),
123
- });
124
- if (!response.ok) {
125
- const error = await response.text();
126
- throw new Error(`Init sync failed: ${response.status} - ${error}`);
127
- }
128
- return response.json();
129
- }
130
- async function uploadToS3(tarPath, uploadUrl) {
131
- const tarContent = await readFile(tarPath);
132
- const response = await fetch(uploadUrl, {
133
- method: "PUT",
134
- headers: { "Content-Type": "application/x-tar" },
135
- body: tarContent,
136
- });
137
- if (!response.ok) {
138
- const error = await response.text();
139
- throw new Error(`S3 upload failed: ${response.status} - ${error}`);
140
- }
141
- }
142
- async function completeSync(projectId, bundleId, timestamp, files, apiUrl, token) {
143
- const headers = {
144
- "Content-Type": "application/json",
145
- };
146
- if (token)
147
- headers["Authorization"] = `Bearer ${token}`;
148
- const response = await fetch(`${apiUrl}/projects/${projectId}/bundles/sync/complete`, {
149
- method: "POST",
150
- headers,
151
- body: JSON.stringify({ bundleId, timestamp, files }),
152
- });
153
- if (!response.ok) {
154
- const error = await response.text();
155
- throw new Error(`Complete sync failed: ${response.status} - ${error}`);
156
- }
157
- return response.json();
158
- }
159
- export async function syncCommand(options = {}) {
160
- console.log(`\n${colors.bold}${colors.blue}☁️ Glubean Sync${colors.reset}\n`);
161
- const dir = options.dir ? resolve(options.dir) : process.cwd();
162
- const config = await loadConfig(dir);
163
- const envFileVars = await loadProjectEnv(dir, config.run.envFile);
164
- const sources = { envFileVars, cloudConfig: config.cloud };
165
- const authOpts = {
166
- token: options.token,
167
- project: options.project,
168
- apiUrl: options.apiUrl,
169
- };
170
- const projectId = await resolveProjectId(authOpts, sources);
171
- if (!projectId) {
172
- console.log(`${colors.red}✗ Error: No project ID found.${colors.reset}`);
173
- console.log(`${colors.dim} Use --project, set GLUBEAN_PROJECT_ID, add to .env, or configure in package.json glubean.cloud.${colors.reset}\n`);
174
- process.exit(1);
175
- }
176
- const version = options.version ||
177
- new Date().toISOString().replace(/[:.]/g, "-");
178
- const apiUrl = (await resolveApiUrl(authOpts, sources)).replace(/\/$/, "");
179
- const token = await resolveToken(authOpts, sources);
180
- console.log(`${colors.dim}Project: ${colors.reset}${projectId}`);
181
- console.log(`${colors.dim}Version: ${colors.reset}${version}`);
182
- console.log(`${colors.dim}Directory: ${colors.reset}${dir}`);
183
- console.log();
184
- console.log(`${colors.cyan}→ Scanning test files...${colors.reset}`);
185
- const scanResult = await scan(dir);
186
- if (scanResult.fileCount === 0) {
187
- console.log(`${colors.yellow}⚠️ No test files found.${colors.reset}`);
188
- console.log(`${colors.dim} Make sure your test files import from @glubean/sdk and export test().${colors.reset}\n`);
189
- return;
190
- }
191
- const metadata = await buildMetadata(scanResult, {
192
- generatedBy: `@glubean/cli@${CLI_VERSION}`,
193
- projectId,
194
- version,
195
- });
196
- const files = metadata.files;
197
- const testCount = metadata.testCount;
198
- const fileCount = metadata.fileCount;
199
- console.log(`${colors.green}✓ Found ${testCount} test(s) in ${fileCount} file(s)${colors.reset}`);
200
- for (const [path, meta] of Object.entries(files)) {
201
- console.log(`${colors.dim} • ${path}${colors.reset}`);
202
- for (const exp of meta.exports) {
203
- const tagStr = exp.tags ? ` [${exp.tags.join(", ")}]` : "";
204
- console.log(`${colors.dim} - ${exp.id}${tagStr}${colors.reset}`);
205
- }
206
- }
207
- console.log();
208
- console.log(`${colors.cyan}→ Generating metadata.json...${colors.reset}`);
209
- console.log(`${colors.green}✓ Metadata generated${colors.reset}\n`);
210
- const syncTimestamp = Date.now();
211
- const tarPath = join(process.cwd(), `.glubean-bundle-${version}.tar`);
212
- console.log(`${colors.cyan}→ Bundling project files...${colors.reset}`);
213
- const bundledFileCount = await createBundleTar(dir, metadata, tarPath);
214
- const tarStat = await stat(tarPath);
215
- const sizeKB = (tarStat.size / 1024).toFixed(2);
216
- const dataFileCount = bundledFileCount - fileCount;
217
- const breakdown = dataFileCount > 0 ? ` (${fileCount} test + ${dataFileCount} data/support)` : "";
218
- console.log(`${colors.green}✓ Bundle created: ${bundledFileCount} files${breakdown}, ${sizeKB} KB${colors.reset}\n`);
219
- if (options.dryRun) {
220
- console.log(`${colors.yellow}🔍 Dry run - skipping upload${colors.reset}`);
221
- console.log(`${colors.dim} Bundle saved to: ${tarPath}${colors.reset}`);
222
- console.log(`${colors.dim} Metadata:${colors.reset}`);
223
- console.log(JSON.stringify(metadata, null, 2));
224
- console.log(`\n${colors.green}${colors.bold}✓ Sync complete (dry run)!${colors.reset}\n`);
225
- return;
226
- }
227
- try {
228
- console.log(`${colors.cyan}→ Initializing sync...${colors.reset}`);
229
- const initResult = await initSync(projectId, version, apiUrl, token ?? undefined);
230
- console.log(`${colors.green}✓ Bundle ID: ${initResult.bundleId}${colors.reset}`);
231
- console.log(`${colors.cyan}→ Uploading to cloud storage...${colors.reset}`);
232
- await uploadToS3(tarPath, initResult.uploadUrl);
233
- console.log(`${colors.green}✓ Upload complete${colors.reset}`);
234
- console.log(`${colors.cyan}→ Finalizing sync...${colors.reset}`);
235
- const completeResult = await completeSync(projectId, initResult.bundleId, syncTimestamp, metadata.files, apiUrl, token ?? undefined);
236
- console.log(`${colors.green}✓ Sync finalized${colors.reset}`);
237
- console.log();
238
- console.log(`${colors.bold}Bundle Summary:${colors.reset}`);
239
- console.log(`${colors.dim} ID: ${colors.reset}${completeResult.bundleId}`);
240
- console.log(`${colors.dim} Version: ${colors.reset}${completeResult.version}`);
241
- console.log(`${colors.dim} Tests: ${colors.reset}${completeResult.testCount}`);
242
- console.log(`${colors.dim} Files: ${colors.reset}${completeResult.fileCount}`);
243
- await rm(tarPath).catch(() => { });
244
- }
245
- catch (error) {
246
- console.log(`${colors.red}✗ Sync failed: ${error instanceof Error ? error.message : error}${colors.reset}`);
247
- console.log(`${colors.dim} Bundle saved locally: ${tarPath}${colors.reset}`);
248
- process.exit(1);
249
- }
250
- console.log(`\n${colors.green}${colors.bold}✓ Sync complete!${colors.reset}\n`);
251
- }
252
- //# sourceMappingURL=sync.js.map
@@ -1 +0,0 @@
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AG,4BAA4B,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,CAClE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,CACT,KAAK,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,mBAAmB,MAAM,CAAC,KAAK,IAAI,CACnE,CAAC;AACJ,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Trigger command - triggers a remote run on Glubean Cloud.
3
- */
4
- export interface TriggerOptions {
5
- project?: string;
6
- bundle?: string;
7
- job?: string;
8
- apiUrl?: string;
9
- token?: string;
10
- follow?: boolean;
11
- }
12
- export declare function triggerCommand(options?: TriggerOptions): Promise<void>;
13
- //# sourceMappingURL=trigger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/commands/trigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA8LD,wBAAsB,cAAc,CAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAkHf"}
@@ -1,213 +0,0 @@
1
- /**
2
- * Trigger command - triggers a remote run on Glubean Cloud.
3
- */
4
- import { resolveApiUrl, resolveProjectId, resolveToken } from "../lib/auth.js";
5
- import { loadConfig } from "../lib/config.js";
6
- import { loadProjectEnv } from "../lib/env.js";
7
- const colors = {
8
- reset: "\x1b[0m",
9
- bold: "\x1b[1m",
10
- dim: "\x1b[2m",
11
- green: "\x1b[32m",
12
- yellow: "\x1b[33m",
13
- blue: "\x1b[34m",
14
- red: "\x1b[31m",
15
- cyan: "\x1b[36m",
16
- };
17
- async function createRun(projectId, apiUrl, token, bundleId, jobId) {
18
- const headers = {
19
- "Content-Type": "application/json",
20
- };
21
- if (token)
22
- headers["Authorization"] = `Bearer ${token}`;
23
- const body = { projectId };
24
- if (bundleId)
25
- body.bundleId = bundleId;
26
- if (jobId)
27
- body.jobId = jobId;
28
- const response = await fetch(`${apiUrl}/data-plane/runs`, {
29
- method: "POST",
30
- headers,
31
- body: JSON.stringify(body),
32
- });
33
- if (!response.ok) {
34
- const error = await response.text();
35
- throw new Error(`Failed to create run: ${response.status} - ${error}`);
36
- }
37
- return response.json();
38
- }
39
- async function getRunStatus(runId, apiUrl, token) {
40
- const headers = {};
41
- if (token)
42
- headers["Authorization"] = `Bearer ${token}`;
43
- const response = await fetch(`${apiUrl}/data-plane/runs/${runId}`, {
44
- method: "GET",
45
- headers,
46
- });
47
- if (!response.ok) {
48
- const error = await response.text();
49
- throw new Error(`Failed to get run status: ${response.status} - ${error}`);
50
- }
51
- return response.json();
52
- }
53
- async function getRunEvents(runId, apiUrl, token, afterSeq) {
54
- const headers = {};
55
- if (token)
56
- headers["Authorization"] = `Bearer ${token}`;
57
- const params = new URLSearchParams();
58
- if (afterSeq !== undefined)
59
- params.set("afterSeq", String(afterSeq));
60
- params.set("limit", "100");
61
- const url = `${apiUrl}/data-plane/runs/${runId}/events?${params.toString()}`;
62
- const response = await fetch(url, { method: "GET", headers });
63
- if (!response.ok) {
64
- const error = await response.text();
65
- throw new Error(`Failed to get run events: ${response.status} - ${error}`);
66
- }
67
- return response.json();
68
- }
69
- function formatEvent(event) {
70
- switch (event.type) {
71
- case "log":
72
- return `${colors.dim}${event.message}${colors.reset}`;
73
- case "assertion": {
74
- const icon = event.passed ? `${colors.green}✓${colors.reset}` : `${colors.red}✗${colors.reset}`;
75
- let line = `${icon} ${event.message}`;
76
- if (!event.passed &&
77
- (event.expected !== undefined || event.actual !== undefined)) {
78
- if (event.expected !== undefined) {
79
- line += `\n ${colors.dim}Expected: ${JSON.stringify(event.expected)}${colors.reset}`;
80
- }
81
- if (event.actual !== undefined) {
82
- line += `\n ${colors.dim}Actual: ${JSON.stringify(event.actual)}${colors.reset}`;
83
- }
84
- }
85
- return line;
86
- }
87
- case "trace": {
88
- const data = event.data;
89
- if (data) {
90
- return `${colors.cyan}→ ${data.method} ${data.url} → ${data.status} (${data.duration}ms)${colors.reset}`;
91
- }
92
- return null;
93
- }
94
- case "step_start":
95
- return `${colors.blue}▶ ${event.message || "Step started"}${colors.reset}`;
96
- case "step_end":
97
- return `${colors.blue}◼ ${event.message || "Step ended"}${colors.reset}`;
98
- case "error":
99
- return `${colors.red}✗ Error: ${event.message}${colors.reset}`;
100
- default:
101
- return null;
102
- }
103
- }
104
- async function tailEvents(runId, apiUrl, token) {
105
- let cursor = undefined;
106
- const terminalStatuses = ["passed", "failed", "cancelled", "exhausted"];
107
- while (true) {
108
- try {
109
- const { events, nextCursor } = await getRunEvents(runId, apiUrl, token, cursor);
110
- for (const event of events) {
111
- const formatted = formatEvent(event);
112
- if (formatted) {
113
- console.log(` ${formatted}`);
114
- }
115
- }
116
- if (nextCursor !== undefined) {
117
- cursor = nextCursor;
118
- }
119
- }
120
- catch {
121
- console.log(`${colors.dim} (polling...)${colors.reset}`);
122
- }
123
- const status = await getRunStatus(runId, apiUrl, token);
124
- if (terminalStatuses.includes(status.status)) {
125
- return status;
126
- }
127
- await new Promise((resolve) => setTimeout(resolve, 2000));
128
- }
129
- }
130
- export async function triggerCommand(options = {}) {
131
- console.log(`\n${colors.bold}${colors.blue}🚀 Glubean Trigger${colors.reset}\n`);
132
- const rootDir = process.cwd();
133
- const config = await loadConfig(rootDir);
134
- const envFileVars = await loadProjectEnv(rootDir, config.run.envFile);
135
- const sources = { envFileVars, cloudConfig: config.cloud };
136
- const authOpts = {
137
- token: options.token,
138
- project: options.project,
139
- apiUrl: options.apiUrl,
140
- };
141
- const projectId = await resolveProjectId(authOpts, sources);
142
- if (!projectId) {
143
- console.log(`${colors.red}✗ Error: No project ID found.${colors.reset}`);
144
- console.log(`${colors.dim} Use --project, set GLUBEAN_PROJECT_ID, add to .env, or configure in package.json glubean.cloud.${colors.reset}\n`);
145
- process.exit(1);
146
- }
147
- const apiUrl = (await resolveApiUrl(authOpts, sources)).replace(/\/$/, "");
148
- const appUrl = apiUrl.replace("api.", "app.").replace(/\/$/, "");
149
- const token = await resolveToken(authOpts, sources);
150
- console.log(`${colors.dim}Project: ${colors.reset}${projectId}`);
151
- if (options.bundle) {
152
- console.log(`${colors.dim}Bundle: ${colors.reset}${options.bundle}`);
153
- }
154
- else {
155
- console.log(`${colors.dim}Bundle: ${colors.reset}(latest)`);
156
- }
157
- if (options.job) {
158
- console.log(`${colors.dim}Job: ${colors.reset}${options.job}`);
159
- }
160
- console.log();
161
- try {
162
- console.log(`${colors.cyan}→ Creating run...${colors.reset}`);
163
- const result = await createRun(projectId, apiUrl, token ?? undefined, options.bundle, options.job);
164
- console.log(`${colors.green}✓ Run created${colors.reset}`);
165
- console.log(`${colors.dim} Run ID: ${colors.reset}${result.runId}`);
166
- console.log(`${colors.dim} Bundle ID: ${colors.reset}${result.bundleId}`);
167
- console.log();
168
- const runUrl = `${appUrl}/runs/${result.runId}`;
169
- console.log(`${colors.bold}View in browser:${colors.reset}`);
170
- console.log(` ${colors.cyan}${runUrl}${colors.reset}`);
171
- console.log();
172
- if (options.follow) {
173
- console.log(`${colors.bold}Live output:${colors.reset}`);
174
- console.log(`${colors.dim}─────────────────────────────────────${colors.reset}`);
175
- const finalStatus = await tailEvents(result.runId, apiUrl, token ?? undefined);
176
- console.log(`${colors.dim}─────────────────────────────────────${colors.reset}`);
177
- console.log();
178
- const statusColor = finalStatus.status === "passed" ? colors.green : colors.red;
179
- console.log(`${colors.bold}Result:${colors.reset} ${statusColor}${finalStatus.status.toUpperCase()}${colors.reset}`);
180
- if (finalStatus.summary) {
181
- const s = finalStatus.summary;
182
- const parts = [];
183
- if (s.passed !== undefined) {
184
- parts.push(`${colors.green}${s.passed} passed${colors.reset}`);
185
- }
186
- if (s.failed !== undefined) {
187
- parts.push(`${colors.red}${s.failed} failed${colors.reset}`);
188
- }
189
- if (s.skipped !== undefined) {
190
- parts.push(`${colors.yellow}${s.skipped} skipped${colors.reset}`);
191
- }
192
- if (parts.length > 0) {
193
- console.log(`${colors.bold}Tests:${colors.reset} ${parts.join(", ")}`);
194
- }
195
- if (s.durationMs !== undefined) {
196
- console.log(`${colors.bold}Time:${colors.reset} ${s.durationMs}ms`);
197
- }
198
- }
199
- console.log();
200
- if (finalStatus.status !== "passed") {
201
- process.exit(1);
202
- }
203
- }
204
- else {
205
- console.log(`${colors.dim}Tip: Use --follow to tail logs in real-time${colors.reset}\n`);
206
- }
207
- }
208
- catch (error) {
209
- console.log(`${colors.red}✗ ${error instanceof Error ? error.message : error}${colors.reset}`);
210
- process.exit(1);
211
- }
212
- }
213
- //# sourceMappingURL=trigger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../src/commands/trigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;CACjB,CAAC;AAgDF,KAAK,UAAU,SAAS,CACtB,SAAiB,EACjB,MAAc,EACd,KAAc,EACd,QAAiB,EACjB,KAAc;IAEd,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;KACnC,CAAC;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;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;YAEd,IAAI,WAAW,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CACT,GAAG,MAAM,CAAC,GAAG,8CAA8C,MAAM,CAAC,KAAK,IAAI,CAC5E,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CACT,GAAG,MAAM,CAAC,GAAG,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAClF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Worker command — self-hosted worker management.
3
- * Stub: full implementation deferred to future work.
4
- */
5
- export interface WorkerOptions {
6
- instances?: number | "auto";
7
- config?: string;
8
- apiUrl?: string;
9
- token?: string;
10
- logLevel?: string;
11
- workerId?: string;
12
- }
13
- export declare function workerCommand(subcommand: string, _options?: WorkerOptions): Promise<void>;
14
- //# sourceMappingURL=worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/commands/worker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,aAAkB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Worker command — self-hosted worker management.
3
- * Stub: full implementation deferred to future work.
4
- */
5
- export async function workerCommand(subcommand, _options = {}) {
6
- console.error(`Worker command "${subcommand}" is not yet implemented in the Node.js CLI.\n` +
7
- "Self-hosted worker support is coming in a future release.");
8
- process.exit(1);
9
- }
10
- //# sourceMappingURL=worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/commands/worker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAAkB,EAClB,WAA0B,EAAE;IAE5B,OAAO,CAAC,KAAK,CACX,mBAAmB,UAAU,gDAAgD;QAC3E,2DAA2D,CAC9D,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -1,93 +0,0 @@
1
- ---
2
- name: glubean
3
- description: Generate, run, and fix Glubean API/browser tests. Uses MCP for AI-optimized execution (schema inference + truncation) and lens docs for SDK patterns.
4
- context: fork
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Glob
10
- - Grep
11
- - Bash
12
- - mcp__glubean__glubean_run_local_file
13
- - mcp__glubean__glubean_discover_tests
14
- - mcp__glubean__glubean_list_test_files
15
- - mcp__glubean__glubean_diagnose_config
16
- - mcp__glubean__glubean_get_last_run_summary
17
- - mcp__glubean__glubean_get_local_events
18
- ---
19
-
20
- # Glubean Test Generator
21
-
22
- You are a Glubean test expert. Generate, run, and fix tests using `@glubean/sdk`.
23
-
24
- ## Rules (always follow)
25
-
26
- 1. **Secrets → `.env.secrets`**, public vars → `.env`. NEVER inline as `const`.
27
- 2. **Use `configure()`** for HTTP clients — never raw `fetch()`.
28
- 3. **All values use `{{KEY}}`** for env references, bare strings for literals.
29
- 4. **Tags on every test** — `["smoke"]`, `["api"]`, `["e2e"]`, etc.
30
- 5. **Teardown** any test that creates resources.
31
- 6. **IDs**: kebab-case, unique across project.
32
- 7. **Type responses**: `.json<{ id: string }>()`, never `.json<any>()`.
33
- 8. **One export per behavior**: each `export const` is one test case.
34
-
35
- ## Workflow
36
-
37
- 1. **Load lens docs** — check `~/.glubean/docs/index.md` exists and is fresh.
38
- - Missing → run `npx glubean docs pull` via Bash, then continue.
39
- - Stale (`~/.glubean/docs/.pulled_at` is older than 1 day) → run `npx glubean docs pull` to update.
40
- - Read `~/.glubean/docs/index.md` to see all available patterns, plugins, and SDK capabilities.
41
-
42
- 2. **Read relevant patterns** — based on the user's request, read 1-3 pattern files from `~/.glubean/docs/patterns/`.
43
- For example: `configure.md` + `crud.md` for a CRUD test, or `auth.md` for API key setup.
44
- Also read `~/.glubean/docs/sdk-reference.md` if you need the full API surface.
45
-
46
- 3. **Explore the API** — use MCP tool `glubean_run_local_file` with `includeTraces: true` on an existing
47
- test file (or a quick smoke test) to see response schemas. Each trace includes:
48
- - `responseSchema` — inferred JSON Schema (field names, types, array sizes)
49
- - `responseBody` — truncated preview (arrays capped at 3 items, strings at 80 chars)
50
- Use `responseSchema` to understand the API structure before writing assertions.
51
-
52
- 4. **Read the API spec** — check `context/*-endpoints/_index.md` (pre-split specs). If found, read the index
53
- and only open the specific endpoint file you need. If no split specs, search `context/` for OpenAPI specs
54
- (`.json`, `.yaml`). If no spec found, ask the user for endpoint details.
55
-
56
- 5. **Read existing tests** — check `tests/`, `explore/`, and `config/` for patterns, configure files, and
57
- naming conventions already in use. Follow the project's existing style.
58
-
59
- 6. **Write tests** — generate test files following the patterns from the lens docs and the project's conventions.
60
-
61
- 7. **Run tests** — prefer MCP, fall back to CLI:
62
- - **MCP** (preferred): `glubean_run_local_file` — structured results with schema-enriched traces.
63
- - **CLI** (fallback): `npx glubean run <file> --verbose`
64
-
65
- 8. **Fix failures** — read the structured failure output, fix the test code, and rerun. Repeat until green.
66
-
67
- If $ARGUMENTS is provided, treat it as the target: an endpoint path, a tag, a file to test, or a natural
68
- language description.
69
-
70
- ## Project structure
71
-
72
- ```
73
- config/ # Shared HTTP clients, browser fixtures, plugin configs
74
- tests/ # Permanent test files (*.test.ts)
75
- explore/ # Exploratory tests (same format, for iteration)
76
- data/ # Test data files (JSON, CSV, YAML)
77
- context/ # OpenAPI specs and reference docs
78
- .env # Public variables (BASE_URL)
79
- .env.secrets # Credentials — gitignored
80
- ~/.glubean/docs/ # SDK lens docs (auto-pulled, gitignored)
81
- package.json # Runtime config, dependencies
82
- ```
83
-
84
- ## Coverage expectations
85
-
86
- For each endpoint, consider:
87
-
88
- - Success path (200/201)
89
- - Auth boundary (401/403) — missing or invalid credentials
90
- - Validation boundary (400/422) — invalid input
91
- - Not-found boundary (404) — nonexistent resource
92
-
93
- Cover all applicable boundaries unless the user asks for a narrower scope.