@griffin-app/griffin-cli 1.0.5 → 1.0.7

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 (51) hide show
  1. package/README.md +38 -38
  2. package/dist/cli.js +11 -11
  3. package/dist/commands/apply.js +7 -7
  4. package/dist/commands/deploy.js +1 -1
  5. package/dist/commands/hub/apply.d.ts +1 -1
  6. package/dist/commands/hub/apply.js +17 -17
  7. package/dist/commands/hub/login.js +14 -8
  8. package/dist/commands/hub/monitor.d.ts +8 -0
  9. package/dist/commands/hub/monitor.js +75 -0
  10. package/dist/commands/hub/plan.d.ts +2 -2
  11. package/dist/commands/hub/plan.js +16 -16
  12. package/dist/commands/hub/run.d.ts +2 -2
  13. package/dist/commands/hub/run.js +33 -33
  14. package/dist/commands/hub/runs.d.ts +1 -1
  15. package/dist/commands/hub/runs.js +4 -4
  16. package/dist/commands/init.js +28 -12
  17. package/dist/commands/local/run.d.ts +2 -2
  18. package/dist/commands/local/run.js +1 -1
  19. package/dist/commands/plan.d.ts +2 -2
  20. package/dist/commands/plan.js +7 -7
  21. package/dist/commands/run-remote.d.ts +1 -1
  22. package/dist/commands/run-remote.js +10 -10
  23. package/dist/commands/validate.d.ts +1 -1
  24. package/dist/commands/validate.js +12 -12
  25. package/dist/core/apply.d.ts +2 -2
  26. package/dist/core/apply.js +25 -25
  27. package/dist/core/apply.test.js +54 -54
  28. package/dist/core/diff.d.ts +14 -14
  29. package/dist/core/diff.js +42 -42
  30. package/dist/core/diff.test.js +34 -34
  31. package/dist/core/discovery.d.ts +6 -6
  32. package/dist/core/discovery.js +20 -20
  33. package/dist/core/monitor-diff.d.ts +41 -0
  34. package/dist/core/monitor-diff.js +257 -0
  35. package/dist/core/plan-diff.d.ts +7 -7
  36. package/dist/core/plan-diff.js +10 -10
  37. package/dist/core/state.js +2 -2
  38. package/dist/core/variables.d.ts +5 -5
  39. package/dist/core/variables.js +7 -7
  40. package/dist/index.d.ts +3 -3
  41. package/dist/index.js +2 -2
  42. package/dist/resolve.d.ts +3 -3
  43. package/dist/resolve.js +9 -4
  44. package/dist/schemas/payload.d.ts +3 -3
  45. package/dist/schemas/payload.js +3 -3
  46. package/dist/schemas/state.d.ts +1 -1
  47. package/dist/schemas/state.js +2 -2
  48. package/dist/test-runner.d.ts +1 -1
  49. package/dist/test-runner.js +13 -13
  50. package/dist/utils/sdk-error.js +1 -1
  51. package/package.json +4 -4
@@ -3,7 +3,7 @@ import { Type } from "typebox";
3
3
  * State file schema for tracking project configuration
4
4
  * Stored in .griffin/state.json
5
5
  *
6
- * Note: The hub is now the source of truth for plans.
6
+ * Note: The hub is now the source of truth for monitors.
7
7
  * This file only stores configuration (project, environments, runner connection).
8
8
  */
9
9
  export const EnvironmentConfigSchema = Type.Object({});
@@ -15,7 +15,7 @@ export const DiscoveryConfigSchema = Type.Object({
15
15
  pattern: Type.Optional(Type.String()),
16
16
  ignore: Type.Optional(Type.Array(Type.String())),
17
17
  });
18
- // State schema (hub is source of truth for plans)
18
+ // State schema (hub is source of truth for monitors)
19
19
  export const StateFileSchema = Type.Object({
20
20
  stateVersion: Type.Literal(1),
21
21
  projectId: Type.String(),
@@ -1,6 +1,6 @@
1
1
  import "tsx";
2
2
  import { ExecutionResult } from "@griffin-app/griffin-plan-executor";
3
3
  /**
4
- * Runs a TypeScript test file and executes the resulting JSON plan.
4
+ * Runs a TypeScript test file and executes the resulting JSON monitor.
5
5
  */
6
6
  export declare function runTestFile(filePath: string, envName: string): Promise<ExecutionResult>;
@@ -1,34 +1,34 @@
1
1
  import "tsx";
2
2
  import { Value } from "typebox/value";
3
- import { executePlanV1, AxiosAdapter, EnvSecretProvider, SecretProviderRegistry, } from "@griffin-app/griffin-plan-executor";
4
- import { PlanDSLSchema } from "@griffin-app/griffin-ts/schema";
3
+ import { executeMonitorV1, AxiosAdapter, EnvSecretProvider, SecretProviderRegistry, } from "@griffin-app/griffin-plan-executor";
4
+ import { MonitorDSLSchema } from "@griffin-app/griffin-ts/schema";
5
5
  import { randomUUID } from "crypto";
6
6
  import { loadVariables } from "./core/variables.js";
7
7
  import { getProjectId } from "./core/state.js";
8
- import { resolvePlan } from "./resolve.js";
8
+ import { resolveMonitor } from "./resolve.js";
9
9
  import { terminal } from "./utils/terminal.js";
10
- function validateDsl(plan) {
11
- const errors = Value.Errors(PlanDSLSchema, plan);
10
+ function validateDsl(monitor) {
11
+ const errors = Value.Errors(MonitorDSLSchema, monitor);
12
12
  if (errors.length > 0) {
13
- throw new Error(`Invalid plan: ${JSON.stringify([...errors], null, 2)}`);
13
+ throw new Error(`Invalid monitor: ${JSON.stringify([...errors], null, 2)}`);
14
14
  }
15
- return plan;
15
+ return monitor;
16
16
  }
17
17
  /**
18
- * Runs a TypeScript test file and executes the resulting JSON plan.
18
+ * Runs a TypeScript test file and executes the resulting JSON monitor.
19
19
  */
20
20
  export async function runTestFile(filePath, envName) {
21
21
  const variables = await loadVariables(envName);
22
22
  const projectId = await getProjectId();
23
23
  const defaultExport = await import(filePath);
24
- const rawPlan = validateDsl(defaultExport.default);
24
+ const rawMonitor = validateDsl(defaultExport.default);
25
25
  terminal.dim(`Project ID: ${projectId}`);
26
- const resolvedPlan = resolvePlan(rawPlan, projectId, envName, variables);
26
+ const resolvedMonitor = resolveMonitor(rawMonitor, projectId, envName, variables);
27
27
  const secretRegistry = new SecretProviderRegistry();
28
28
  secretRegistry.register(new EnvSecretProvider());
29
29
  try {
30
- const result = await executePlanV1({
31
- ...resolvedPlan,
30
+ const result = await executeMonitorV1({
31
+ ...resolvedMonitor,
32
32
  id: randomUUID(),
33
33
  }, "default-org", {
34
34
  mode: "local",
@@ -38,7 +38,7 @@ export async function runTestFile(filePath, envName) {
38
38
  return result;
39
39
  }
40
40
  catch (error) {
41
- throw new Error(`Error executing plan: ${error instanceof Error ? error.message : String(error)}`);
41
+ throw new Error(`Error executing monitor: ${error instanceof Error ? error.message : String(error)}`);
42
42
  }
43
43
  }
44
44
  //function findWorkspaceRoot(): string {
@@ -37,7 +37,7 @@ export function handleSDKError(error, context) {
37
37
  case 404:
38
38
  terminal.error(`${contextMsg}Resource not found`);
39
39
  if (sdkError.url) {
40
- terminal.dim(`Endpoint: ${sdkError.url}`);
40
+ terminal.dim(`URL: ${sdkError.url}`);
41
41
  }
42
42
  terminal.dim("The requested resource may not exist on the hub.");
43
43
  return terminal.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@griffin-app/griffin-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "CLI tool for running and managing griffin API tests",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,9 +23,9 @@
23
23
  "author": "",
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "@griffin-app/griffin-hub-sdk": "1.0.3",
27
- "@griffin-app/griffin-plan-executor": "0.1.10",
28
- "@griffin-app/griffin-ts": "0.1.8",
26
+ "@griffin-app/griffin-hub-sdk": "1.0.7",
27
+ "@griffin-app/griffin-plan-executor": "0.1.14",
28
+ "@griffin-app/griffin-ts": "0.1.14",
29
29
  "better-auth": "^1.4.17",
30
30
  "cli-table3": "^0.6.5",
31
31
  "commander": "^12.1.0",