edsger 0.69.0 → 0.70.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 (74) hide show
  1. package/dist/api/github.d.ts +1 -1
  2. package/dist/api/github.js +1 -1
  3. package/dist/commands/architecture-diagram/index.d.ts +8 -0
  4. package/dist/commands/architecture-diagram/index.js +10 -0
  5. package/dist/commands/class-diagram/index.d.ts +7 -0
  6. package/dist/commands/class-diagram/index.js +9 -0
  7. package/dist/commands/data-flow/index.d.ts +5 -5
  8. package/dist/commands/data-flow/index.js +8 -8
  9. package/dist/commands/diagram-shared/index.d.ts +21 -0
  10. package/dist/commands/diagram-shared/index.js +37 -0
  11. package/dist/commands/er-diagram/index.d.ts +19 -0
  12. package/dist/commands/er-diagram/index.js +55 -0
  13. package/dist/commands/flowchart/index.d.ts +8 -0
  14. package/dist/commands/flowchart/index.js +10 -0
  15. package/dist/commands/screen-flow/index.d.ts +5 -5
  16. package/dist/commands/screen-flow/index.js +8 -8
  17. package/dist/commands/sequence-diagram/index.d.ts +19 -0
  18. package/dist/commands/sequence-diagram/index.js +55 -0
  19. package/dist/commands/state-diagram/index.d.ts +7 -0
  20. package/dist/commands/state-diagram/index.js +9 -0
  21. package/dist/index.js +117 -5
  22. package/dist/phases/architecture-diagram/index.d.ts +15 -0
  23. package/dist/phases/architecture-diagram/index.js +51 -0
  24. package/dist/phases/class-diagram/index.d.ts +14 -0
  25. package/dist/phases/class-diagram/index.js +76 -0
  26. package/dist/phases/data-flow/index.d.ts +2 -2
  27. package/dist/phases/data-flow/index.js +36 -36
  28. package/dist/phases/data-flow/mcp-server.d.ts +1 -1
  29. package/dist/phases/data-flow/mcp-server.js +2 -2
  30. package/dist/phases/data-flow/types.d.ts +1 -1
  31. package/dist/phases/data-flow/types.js +1 -1
  32. package/dist/phases/diagram-shared/clone-repos.d.ts +63 -0
  33. package/dist/phases/diagram-shared/clone-repos.js +153 -0
  34. package/dist/phases/diagram-shared/generate.d.ts +42 -0
  35. package/dist/phases/diagram-shared/generate.js +162 -0
  36. package/dist/phases/diagram-shared/graph.d.ts +62 -0
  37. package/dist/phases/diagram-shared/graph.js +169 -0
  38. package/dist/phases/diagram-shared/mcp.d.ts +35 -0
  39. package/dist/phases/diagram-shared/mcp.js +68 -0
  40. package/dist/phases/diagram-shared/prompts.d.ts +23 -0
  41. package/dist/phases/diagram-shared/prompts.js +35 -0
  42. package/dist/phases/er-diagram/index.d.ts +28 -0
  43. package/dist/phases/er-diagram/index.js +290 -0
  44. package/dist/phases/er-diagram/mcp-server.d.ts +77 -0
  45. package/dist/phases/er-diagram/mcp-server.js +144 -0
  46. package/dist/phases/er-diagram/prompts.d.ts +14 -0
  47. package/dist/phases/er-diagram/prompts.js +36 -0
  48. package/dist/phases/er-diagram/types.d.ts +76 -0
  49. package/dist/phases/er-diagram/types.js +84 -0
  50. package/dist/phases/flowchart/index.d.ts +15 -0
  51. package/dist/phases/flowchart/index.js +50 -0
  52. package/dist/phases/output-contracts.js +178 -2
  53. package/dist/phases/screen-flow/index.d.ts +3 -3
  54. package/dist/phases/screen-flow/index.js +43 -43
  55. package/dist/phases/screen-flow/mcp-server.js +2 -2
  56. package/dist/phases/sequence-diagram/index.d.ts +30 -0
  57. package/dist/phases/sequence-diagram/index.js +290 -0
  58. package/dist/phases/sequence-diagram/mcp-server.d.ts +64 -0
  59. package/dist/phases/sequence-diagram/mcp-server.js +134 -0
  60. package/dist/phases/sequence-diagram/prompts.d.ts +14 -0
  61. package/dist/phases/sequence-diagram/prompts.js +36 -0
  62. package/dist/phases/sequence-diagram/types.d.ts +52 -0
  63. package/dist/phases/sequence-diagram/types.js +93 -0
  64. package/dist/phases/state-diagram/index.d.ts +15 -0
  65. package/dist/phases/state-diagram/index.js +53 -0
  66. package/dist/skills/phase/architecture-diagram/SKILL.md +41 -0
  67. package/dist/skills/phase/class-diagram/SKILL.md +44 -0
  68. package/dist/skills/phase/er-diagram/SKILL.md +71 -0
  69. package/dist/skills/phase/flowchart/SKILL.md +38 -0
  70. package/dist/skills/phase/sequence-diagram/SKILL.md +67 -0
  71. package/dist/skills/phase/state-diagram/SKILL.md +38 -0
  72. package/dist/workspace/session-workspace.d.ts +2 -2
  73. package/dist/workspace/session-workspace.js +2 -2
  74. package/package.json +1 -1
@@ -63,7 +63,7 @@ export interface RepositoryBasics {
63
63
  export declare function getRepositoryBasics(repositoryId: string): Promise<RepositoryBasics>;
64
64
  /**
65
65
  * Get GitHub config and token by repository ID (no product / issue required).
66
- * Used for repo-scoped analysis (quality-benchmark / recipes / flows running
66
+ * Used for repo-scoped analysis (quality-benchmark / recipes / diagrams running
67
67
  * against a single `repositories` row with no product context).
68
68
  */
69
69
  export declare function getGitHubConfigByRepository(repositoryId: string, verbose?: boolean): Promise<{
@@ -118,7 +118,7 @@ export async function getRepositoryBasics(repositoryId) {
118
118
  }
119
119
  /**
120
120
  * Get GitHub config and token by repository ID (no product / issue required).
121
- * Used for repo-scoped analysis (quality-benchmark / recipes / flows running
121
+ * Used for repo-scoped analysis (quality-benchmark / recipes / diagrams running
122
122
  * against a single `repositories` row with no product context).
123
123
  */
124
124
  export async function getGitHubConfigByRepository(repositoryId, verbose) {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command: edsger architecture-diagram <productId> --diagram-id <id>
3
+ * Maps a component/dependency diagram into the diagrams tables
4
+ * (type='architecture').
5
+ */
6
+ import { type DiagramCommandOptions } from '../diagram-shared/index.js';
7
+ export type ArchitectureDiagramCliOptions = DiagramCommandOptions;
8
+ export declare function runArchitectureDiagram(productId: string | undefined, options: ArchitectureDiagramCliOptions): Promise<void>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CLI command: edsger architecture-diagram <productId> --diagram-id <id>
3
+ * Maps a component/dependency diagram into the diagrams tables
4
+ * (type='architecture').
5
+ */
6
+ import { runArchitectureDiagramPhase } from '../../phases/architecture-diagram/index.js';
7
+ import { runDiagramCommand, } from '../diagram-shared/index.js';
8
+ export function runArchitectureDiagram(productId, options) {
9
+ return runDiagramCommand('architecture-diagram', productId, options, runArchitectureDiagramPhase);
10
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * CLI command: edsger class-diagram <productId> --diagram-id <id>
3
+ * Maps a UML class diagram into the diagrams tables (type='class').
4
+ */
5
+ import { type DiagramCommandOptions } from '../diagram-shared/index.js';
6
+ export type ClassDiagramCliOptions = DiagramCommandOptions;
7
+ export declare function runClassDiagram(productId: string | undefined, options: ClassDiagramCliOptions): Promise<void>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * CLI command: edsger class-diagram <productId> --diagram-id <id>
3
+ * Maps a UML class diagram into the diagrams tables (type='class').
4
+ */
5
+ import { runClassDiagramPhase } from '../../phases/class-diagram/index.js';
6
+ import { runDiagramCommand, } from '../diagram-shared/index.js';
7
+ export function runClassDiagram(productId, options) {
8
+ return runDiagramCommand('class-diagram', productId, options, runClassDiagramPhase);
9
+ }
@@ -1,16 +1,16 @@
1
1
  /**
2
- * CLI command: edsger data-flow <productId> --flow-id <id>
2
+ * CLI command: edsger data-flow <productId> --diagram-id <id>
3
3
  *
4
4
  * Maps the product's data nodes (source/dataset/transform/sink/queue/model)
5
5
  * and the connections between them into a structured flow stored in
6
- * flows / flow_nodes / flow_edges (rows tagged type='data').
6
+ * diagrams / diagram_nodes / diagram_edges (rows tagged type='data').
7
7
  *
8
- * The desktop UI creates a pending flows row first, then invokes the CLI
9
- * with --flow-id; the CLI flips status running → success/failed and
8
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
9
+ * with --diagram-id; the CLI flips status running → success/failed and
10
10
  * populates the nodes/edges tables.
11
11
  */
12
12
  export interface DataFlowCliOptions {
13
- flowId: string;
13
+ diagramId: string;
14
14
  /** Repo-only mode: generate against a single repositories row, no product. */
15
15
  repoId?: string;
16
16
  guidance?: string;
@@ -1,24 +1,24 @@
1
1
  /**
2
- * CLI command: edsger data-flow <productId> --flow-id <id>
2
+ * CLI command: edsger data-flow <productId> --diagram-id <id>
3
3
  *
4
4
  * Maps the product's data nodes (source/dataset/transform/sink/queue/model)
5
5
  * and the connections between them into a structured flow stored in
6
- * flows / flow_nodes / flow_edges (rows tagged type='data').
6
+ * diagrams / diagram_nodes / diagram_edges (rows tagged type='data').
7
7
  *
8
- * The desktop UI creates a pending flows row first, then invokes the CLI
9
- * with --flow-id; the CLI flips status running → success/failed and
8
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
9
+ * with --diagram-id; the CLI flips status running → success/failed and
10
10
  * populates the nodes/edges tables.
11
11
  */
12
12
  import { runDataFlowPhase } from '../../phases/data-flow/index.js';
13
13
  import { deregisterSession, registerSession, } from '../../system/session-manager.js';
14
14
  import { logError, logInfo, logSuccess } from '../../utils/logger.js';
15
15
  export async function runDataFlow(productId, options) {
16
- const { flowId, repoId, guidance, verbose } = options;
16
+ const { diagramId, repoId, guidance, verbose } = options;
17
17
  if (!productId && !repoId) {
18
18
  throw new Error('Either a product ID or --repo-id is required for data-flow');
19
19
  }
20
- if (!flowId) {
21
- throw new Error('--flow-id is required (the pending flows row id)');
20
+ if (!diagramId) {
21
+ throw new Error('--diagram-id is required (the pending diagrams row id)');
22
22
  }
23
23
  await registerSession({
24
24
  command: 'data-flow',
@@ -34,7 +34,7 @@ export async function runDataFlow(productId, options) {
34
34
  const result = await runDataFlowPhase({
35
35
  productId,
36
36
  repoId,
37
- flowId,
37
+ diagramId,
38
38
  guidance,
39
39
  verbose,
40
40
  });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Shared CLI command runner for graph diagram phases (state / class /
3
+ * architecture / flowchart). Handles session registration and the
4
+ * success/failure → exit-code mapping; each command just passes its phase
5
+ * runner.
6
+ */
7
+ import type { DiagramPhaseResult } from '../../phases/diagram-shared/generate.js';
8
+ export interface DiagramCommandOptions {
9
+ diagramId: string;
10
+ /** Repo-only mode: generate against a single repositories row, no product. */
11
+ repoId?: string;
12
+ guidance?: string;
13
+ verbose?: boolean;
14
+ }
15
+ export declare function runDiagramCommand(command: string, productId: string | undefined, options: DiagramCommandOptions, run: (args: {
16
+ productId?: string;
17
+ repoId?: string;
18
+ diagramId: string;
19
+ guidance?: string;
20
+ verbose?: boolean;
21
+ }) => Promise<DiagramPhaseResult>): Promise<void>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Shared CLI command runner for graph diagram phases (state / class /
3
+ * architecture / flowchart). Handles session registration and the
4
+ * success/failure → exit-code mapping; each command just passes its phase
5
+ * runner.
6
+ */
7
+ import { deregisterSession, registerSession, } from '../../system/session-manager.js';
8
+ import { logError, logInfo, logSuccess } from '../../utils/logger.js';
9
+ export async function runDiagramCommand(command, productId, options, run) {
10
+ const { diagramId, repoId, guidance, verbose } = options;
11
+ if (!productId && !repoId) {
12
+ throw new Error(`Either a product ID or --repo-id is required for ${command}`);
13
+ }
14
+ if (!diagramId) {
15
+ throw new Error('--diagram-id is required (the pending diagrams row id)');
16
+ }
17
+ await registerSession({ command, ...(productId ? { productId } : {}) });
18
+ logInfo(productId
19
+ ? `Starting ${command} for product ${productId}`
20
+ : `Starting ${command} for repository ${repoId}`);
21
+ try {
22
+ const result = await run({ productId, repoId, diagramId, guidance, verbose });
23
+ if (result.status === 'success') {
24
+ logSuccess(result.message);
25
+ if (result.summary) {
26
+ logInfo(`\nSummary: ${result.summary}`);
27
+ }
28
+ }
29
+ else {
30
+ logError(result.message);
31
+ process.exit(1);
32
+ }
33
+ }
34
+ finally {
35
+ await deregisterSession();
36
+ }
37
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * CLI command: edsger er-diagram <productId> --diagram-id <id>
3
+ *
4
+ * Maps the product's persistence entities (tables / views / enums / junction
5
+ * tables) and the relationships between them into a structured flow stored in
6
+ * diagrams / diagram_nodes / diagram_edges (rows tagged type='er').
7
+ *
8
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
9
+ * with --diagram-id; the CLI flips status running → success/failed and
10
+ * populates the nodes/edges tables.
11
+ */
12
+ export interface ErDiagramCliOptions {
13
+ diagramId: string;
14
+ /** Repo-only mode: generate against a single repositories row, no product. */
15
+ repoId?: string;
16
+ guidance?: string;
17
+ verbose?: boolean;
18
+ }
19
+ export declare function runErDiagram(productId: string | undefined, options: ErDiagramCliOptions): Promise<void>;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * CLI command: edsger er-diagram <productId> --diagram-id <id>
3
+ *
4
+ * Maps the product's persistence entities (tables / views / enums / junction
5
+ * tables) and the relationships between them into a structured flow stored in
6
+ * diagrams / diagram_nodes / diagram_edges (rows tagged type='er').
7
+ *
8
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
9
+ * with --diagram-id; the CLI flips status running → success/failed and
10
+ * populates the nodes/edges tables.
11
+ */
12
+ import { runErDiagramPhase } from '../../phases/er-diagram/index.js';
13
+ import { deregisterSession, registerSession, } from '../../system/session-manager.js';
14
+ import { logError, logInfo, logSuccess } from '../../utils/logger.js';
15
+ export async function runErDiagram(productId, options) {
16
+ const { diagramId, repoId, guidance, verbose } = options;
17
+ if (!productId && !repoId) {
18
+ throw new Error('Either a product ID or --repo-id is required for er-diagram');
19
+ }
20
+ if (!diagramId) {
21
+ throw new Error('--diagram-id is required (the pending diagrams row id)');
22
+ }
23
+ await registerSession({
24
+ command: 'er-diagram',
25
+ ...(productId ? { productId } : {}),
26
+ });
27
+ if (productId) {
28
+ logInfo(`Starting ER diagram generation for product ${productId}`);
29
+ }
30
+ else {
31
+ logInfo(`Starting ER diagram generation for repository ${repoId}`);
32
+ }
33
+ try {
34
+ const result = await runErDiagramPhase({
35
+ productId,
36
+ repoId,
37
+ diagramId,
38
+ guidance,
39
+ verbose,
40
+ });
41
+ if (result.status === 'success') {
42
+ logSuccess(result.message);
43
+ if (result.summary) {
44
+ logInfo(`\nSummary: ${result.summary}`);
45
+ }
46
+ }
47
+ else {
48
+ logError(result.message);
49
+ process.exit(1);
50
+ }
51
+ }
52
+ finally {
53
+ await deregisterSession();
54
+ }
55
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command: edsger flowchart <productId> --diagram-id <id>
3
+ * Maps a process/control-flow flowchart into the diagrams tables
4
+ * (type='flowchart').
5
+ */
6
+ import { type DiagramCommandOptions } from '../diagram-shared/index.js';
7
+ export type FlowchartCliOptions = DiagramCommandOptions;
8
+ export declare function runFlowchart(productId: string | undefined, options: FlowchartCliOptions): Promise<void>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CLI command: edsger flowchart <productId> --diagram-id <id>
3
+ * Maps a process/control-flow flowchart into the diagrams tables
4
+ * (type='flowchart').
5
+ */
6
+ import { runFlowchartPhase } from '../../phases/flowchart/index.js';
7
+ import { runDiagramCommand, } from '../diagram-shared/index.js';
8
+ export function runFlowchart(productId, options) {
9
+ return runDiagramCommand('flowchart', productId, options, runFlowchartPhase);
10
+ }
@@ -1,15 +1,15 @@
1
1
  /**
2
- * CLI command: edsger screen-flow <productId> --flow-id <id>
2
+ * CLI command: edsger screen-flow <productId> --diagram-id <id>
3
3
  *
4
4
  * Maps the product's user-facing screens and transitions into a structured
5
- * flow stored in flows / flow_nodes / flow_edges (rows tagged type='screen').
5
+ * flow stored in diagrams / diagram_nodes / diagram_edges (rows tagged type='screen').
6
6
  *
7
- * The desktop UI creates a pending flows row first, then invokes the CLI
8
- * with --flow-id; the CLI flips status running → success/failed and
7
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
8
+ * with --diagram-id; the CLI flips status running → success/failed and
9
9
  * populates the nodes/edges tables.
10
10
  */
11
11
  export interface ScreenFlowCliOptions {
12
- flowId: string;
12
+ diagramId: string;
13
13
  /** Repo-only mode: generate against a single repositories row, no product. */
14
14
  repoId?: string;
15
15
  guidance?: string;
@@ -1,23 +1,23 @@
1
1
  /**
2
- * CLI command: edsger screen-flow <productId> --flow-id <id>
2
+ * CLI command: edsger screen-flow <productId> --diagram-id <id>
3
3
  *
4
4
  * Maps the product's user-facing screens and transitions into a structured
5
- * flow stored in flows / flow_nodes / flow_edges (rows tagged type='screen').
5
+ * flow stored in diagrams / diagram_nodes / diagram_edges (rows tagged type='screen').
6
6
  *
7
- * The desktop UI creates a pending flows row first, then invokes the CLI
8
- * with --flow-id; the CLI flips status running → success/failed and
7
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
8
+ * with --diagram-id; the CLI flips status running → success/failed and
9
9
  * populates the nodes/edges tables.
10
10
  */
11
11
  import { runScreenFlowPhase } from '../../phases/screen-flow/index.js';
12
12
  import { deregisterSession, registerSession, } from '../../system/session-manager.js';
13
13
  import { logError, logInfo, logSuccess } from '../../utils/logger.js';
14
14
  export async function runScreenFlow(productId, options) {
15
- const { flowId, repoId, guidance, verbose } = options;
15
+ const { diagramId, repoId, guidance, verbose } = options;
16
16
  if (!productId && !repoId) {
17
17
  throw new Error('Either a product ID or --repo-id is required for screen-flow');
18
18
  }
19
- if (!flowId) {
20
- throw new Error('--flow-id is required (the pending flows row id)');
19
+ if (!diagramId) {
20
+ throw new Error('--diagram-id is required (the pending diagrams row id)');
21
21
  }
22
22
  await registerSession({
23
23
  command: 'screen-flow',
@@ -33,7 +33,7 @@ export async function runScreenFlow(productId, options) {
33
33
  const result = await runScreenFlowPhase({
34
34
  productId,
35
35
  repoId,
36
- flowId,
36
+ diagramId,
37
37
  guidance,
38
38
  verbose,
39
39
  });
@@ -0,0 +1,19 @@
1
+ /**
2
+ * CLI command: edsger sequence-diagram <productId> --diagram-id <id>
3
+ *
4
+ * Traces one scenario through the product's code and maps the participants
5
+ * and the ordered messages between them into a structured flow stored in
6
+ * diagrams / diagram_nodes / diagram_edges (rows tagged type='sequence').
7
+ *
8
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
9
+ * with --diagram-id; the CLI flips status running → success/failed and
10
+ * populates the nodes/edges tables.
11
+ */
12
+ export interface SequenceDiagramCliOptions {
13
+ diagramId: string;
14
+ /** Repo-only mode: generate against a single repositories row, no product. */
15
+ repoId?: string;
16
+ guidance?: string;
17
+ verbose?: boolean;
18
+ }
19
+ export declare function runSequenceDiagram(productId: string | undefined, options: SequenceDiagramCliOptions): Promise<void>;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * CLI command: edsger sequence-diagram <productId> --diagram-id <id>
3
+ *
4
+ * Traces one scenario through the product's code and maps the participants
5
+ * and the ordered messages between them into a structured flow stored in
6
+ * diagrams / diagram_nodes / diagram_edges (rows tagged type='sequence').
7
+ *
8
+ * The desktop UI creates a pending diagrams row first, then invokes the CLI
9
+ * with --diagram-id; the CLI flips status running → success/failed and
10
+ * populates the nodes/edges tables.
11
+ */
12
+ import { runSequenceDiagramPhase } from '../../phases/sequence-diagram/index.js';
13
+ import { deregisterSession, registerSession, } from '../../system/session-manager.js';
14
+ import { logError, logInfo, logSuccess } from '../../utils/logger.js';
15
+ export async function runSequenceDiagram(productId, options) {
16
+ const { diagramId, repoId, guidance, verbose } = options;
17
+ if (!productId && !repoId) {
18
+ throw new Error('Either a product ID or --repo-id is required for sequence-diagram');
19
+ }
20
+ if (!diagramId) {
21
+ throw new Error('--diagram-id is required (the pending diagrams row id)');
22
+ }
23
+ await registerSession({
24
+ command: 'sequence-diagram',
25
+ ...(productId ? { productId } : {}),
26
+ });
27
+ if (productId) {
28
+ logInfo(`Starting sequence diagram generation for product ${productId}`);
29
+ }
30
+ else {
31
+ logInfo(`Starting sequence diagram generation for repository ${repoId}`);
32
+ }
33
+ try {
34
+ const result = await runSequenceDiagramPhase({
35
+ productId,
36
+ repoId,
37
+ diagramId,
38
+ guidance,
39
+ verbose,
40
+ });
41
+ if (result.status === 'success') {
42
+ logSuccess(result.message);
43
+ if (result.summary) {
44
+ logInfo(`\nSummary: ${result.summary}`);
45
+ }
46
+ }
47
+ else {
48
+ logError(result.message);
49
+ process.exit(1);
50
+ }
51
+ }
52
+ finally {
53
+ await deregisterSession();
54
+ }
55
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * CLI command: edsger state-diagram <productId> --diagram-id <id>
3
+ * Maps a state machine into the diagrams tables (type='state').
4
+ */
5
+ import { type DiagramCommandOptions } from '../diagram-shared/index.js';
6
+ export type StateDiagramCliOptions = DiagramCommandOptions;
7
+ export declare function runStateDiagram(productId: string | undefined, options: StateDiagramCliOptions): Promise<void>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * CLI command: edsger state-diagram <productId> --diagram-id <id>
3
+ * Maps a state machine into the diagrams tables (type='state').
4
+ */
5
+ import { runStateDiagramPhase } from '../../phases/state-diagram/index.js';
6
+ import { runDiagramCommand, } from '../diagram-shared/index.js';
7
+ export function runStateDiagram(productId, options) {
8
+ return runDiagramCommand('state-diagram', productId, options, runStateDiagramPhase);
9
+ }
package/dist/index.js CHANGED
@@ -9,17 +9,21 @@ import { runLogin, runLogout, runStatus } from './auth/login.js';
9
9
  import { runAgentWorkflow } from './commands/agent-workflow/index.js';
10
10
  import { runAnalyzeLogs } from './commands/analyze-logs/index.js';
11
11
  import { runAppStoreGeneration } from './commands/app-store/index.js';
12
+ import { runArchitectureDiagram } from './commands/architecture-diagram/index.js';
12
13
  import { runBuild } from './commands/build/index.js';
13
14
  import { runChatServeCommand } from './commands/chat-serve/index.js';
14
15
  import { runChecklists } from './commands/checklists/index.js';
16
+ import { runClassDiagram } from './commands/class-diagram/index.js';
15
17
  import { runCodeReview } from './commands/code-review/index.js';
16
18
  import { runConfigGet, runConfigList, runConfigSet, runConfigUnset, } from './commands/config/index.js';
17
19
  import { runDataFlow } from './commands/data-flow/index.js';
20
+ import { runErDiagram } from './commands/er-diagram/index.js';
18
21
  import { runFinancingDeck } from './commands/financing-deck/index.js';
19
22
  import { runFindArchitecture } from './commands/find-architecture/index.js';
20
23
  import { runFindBugs } from './commands/find-bugs/index.js';
21
24
  import { runFindFeatures } from './commands/find-features/index.js';
22
25
  import { parseCategoriesOption, runFindSmells, } from './commands/find-smells/index.js';
26
+ import { runFlowchart } from './commands/flowchart/index.js';
23
27
  import { runGrowthAnalysis } from './commands/growth-analysis/index.js';
24
28
  import { runInit } from './commands/init/index.js';
25
29
  import { runIntelligence } from './commands/intelligence/index.js';
@@ -33,9 +37,11 @@ import { runRefactor } from './commands/refactor/refactor.js';
33
37
  import { runReleaseSyncCommand } from './commands/release-sync/index.js';
34
38
  import { runRunSheetCommand } from './commands/run-sheet/index.js';
35
39
  import { runScreenFlow } from './commands/screen-flow/index.js';
40
+ import { runSequenceDiagram } from './commands/sequence-diagram/index.js';
36
41
  import { runSessionServeCommand } from './commands/session-serve/index.js';
37
42
  import { runSessionTurnCommand } from './commands/session-turn/index.js';
38
43
  import { runSmokeTestCommand } from './commands/smoke-test/index.js';
44
+ import { runStateDiagram } from './commands/state-diagram/index.js';
39
45
  import { runSyncAws } from './commands/sync-aws/index.js';
40
46
  import { runSyncDatadog } from './commands/sync-datadog/index.js';
41
47
  import { runSyncGithubIssues } from './commands/sync-github-issues/index.js';
@@ -174,7 +180,7 @@ program
174
180
  program
175
181
  .command('screen-flow [productId]')
176
182
  .description('Generate a structured screen flow (screens + transitions) for a product (or standalone repository) from its source code')
177
- .requiredOption('--flow-id <id>', 'Pending flows row id to populate')
183
+ .requiredOption('--diagram-id <id>', 'Pending diagrams row id to populate')
178
184
  .option('--repo-id <id>', 'Run in repo-only mode against a single repositories row (no product context)')
179
185
  .option('-g, --guidance <text>', 'Human direction for the AI (focus areas, exclusions)')
180
186
  .option('-v, --verbose', 'Verbose output')
@@ -184,7 +190,7 @@ program
184
190
  throw new Error('Provide a productId or --repo-id (repo-only mode) for screen-flow');
185
191
  }
186
192
  await runScreenFlow(productId, {
187
- flowId: opts.flowId,
193
+ diagramId: opts.diagramId,
188
194
  repoId: opts.repoId,
189
195
  guidance: opts.guidance,
190
196
  verbose: opts.verbose,
@@ -201,7 +207,7 @@ program
201
207
  program
202
208
  .command('data-flow [productId]')
203
209
  .description('Generate a structured data flow (sources, datasets, transforms, sinks, queues, models) for a product (or standalone repository) from its source code')
204
- .requiredOption('--flow-id <id>', 'Pending flows row id to populate')
210
+ .requiredOption('--diagram-id <id>', 'Pending diagrams row id to populate')
205
211
  .option('--repo-id <id>', 'Run in repo-only mode against a single repositories row (no product context)')
206
212
  .option('-g, --guidance <text>', 'Human direction for the AI (focus areas, exclusions)')
207
213
  .option('-v, --verbose', 'Verbose output')
@@ -211,7 +217,7 @@ program
211
217
  throw new Error('Provide a productId or --repo-id (repo-only mode) for data-flow');
212
218
  }
213
219
  await runDataFlow(productId, {
214
- flowId: opts.flowId,
220
+ diagramId: opts.diagramId,
215
221
  repoId: opts.repoId,
216
222
  guidance: opts.guidance,
217
223
  verbose: opts.verbose,
@@ -223,6 +229,112 @@ program
223
229
  }
224
230
  });
225
231
  // ============================================================
232
+ // Subcommand: edsger er-diagram <productId>
233
+ // ============================================================
234
+ program
235
+ .command('er-diagram [productId]')
236
+ .description('Generate a structured entity-relationship diagram (tables, views, enums, junctions + their relationships) for a product (or standalone repository) from its schema source')
237
+ .requiredOption('--diagram-id <id>', 'Pending diagrams row id to populate')
238
+ .option('--repo-id <id>', 'Run in repo-only mode against a single repositories row (no product context)')
239
+ .option('-g, --guidance <text>', 'Human direction for the AI (focus areas, exclusions)')
240
+ .option('-v, --verbose', 'Verbose output')
241
+ .action(async (productId, opts) => {
242
+ try {
243
+ if (!productId && !opts.repoId) {
244
+ throw new Error('Provide a productId or --repo-id (repo-only mode) for er-diagram');
245
+ }
246
+ await runErDiagram(productId, {
247
+ diagramId: opts.diagramId,
248
+ repoId: opts.repoId,
249
+ guidance: opts.guidance,
250
+ verbose: opts.verbose,
251
+ });
252
+ }
253
+ catch (error) {
254
+ logError(error instanceof Error ? error.message : String(error));
255
+ process.exit(1);
256
+ }
257
+ });
258
+ // ============================================================
259
+ // Subcommand: edsger sequence-diagram <productId>
260
+ // ============================================================
261
+ program
262
+ .command('sequence-diagram [productId]')
263
+ .description('Generate a structured sequence diagram (participants + ordered messages for one scenario) for a product (or standalone repository) from its source code')
264
+ .requiredOption('--diagram-id <id>', 'Pending diagrams row id to populate')
265
+ .option('--repo-id <id>', 'Run in repo-only mode against a single repositories row (no product context)')
266
+ .option('-g, --guidance <text>', 'Human direction for the AI — the scenario to map (e.g. "user checkout")')
267
+ .option('-v, --verbose', 'Verbose output')
268
+ .action(async (productId, opts) => {
269
+ try {
270
+ if (!productId && !opts.repoId) {
271
+ throw new Error('Provide a productId or --repo-id (repo-only mode) for sequence-diagram');
272
+ }
273
+ await runSequenceDiagram(productId, {
274
+ diagramId: opts.diagramId,
275
+ repoId: opts.repoId,
276
+ guidance: opts.guidance,
277
+ verbose: opts.verbose,
278
+ });
279
+ }
280
+ catch (error) {
281
+ logError(error instanceof Error ? error.message : String(error));
282
+ process.exit(1);
283
+ }
284
+ });
285
+ const diagramSubcommands = [
286
+ {
287
+ name: 'state-diagram',
288
+ description: 'Generate a state diagram (states + transitions for one lifecycle) for a product (or standalone repository) from its source code',
289
+ guidance: 'Human direction for the AI — the lifecycle to map',
290
+ run: runStateDiagram,
291
+ },
292
+ {
293
+ name: 'class-diagram',
294
+ description: 'Generate a UML class diagram (types + relationships) for a product (or standalone repository) from its source code',
295
+ guidance: 'Human direction for the AI (focus areas, exclusions)',
296
+ run: runClassDiagram,
297
+ },
298
+ {
299
+ name: 'architecture-diagram',
300
+ description: 'Generate an architecture/component diagram (components + dependencies) for a product (or standalone repository) from its source code',
301
+ guidance: 'Human direction for the AI (focus areas, exclusions)',
302
+ run: runArchitectureDiagram,
303
+ },
304
+ {
305
+ name: 'flowchart',
306
+ description: 'Generate a flowchart (control flow of one process/function) for a product (or standalone repository) from its source code',
307
+ guidance: 'Human direction for the AI — the process to map',
308
+ run: runFlowchart,
309
+ },
310
+ ];
311
+ for (const sub of diagramSubcommands) {
312
+ program
313
+ .command(`${sub.name} [productId]`)
314
+ .description(sub.description)
315
+ .requiredOption('--diagram-id <id>', 'Pending diagrams row id to populate')
316
+ .option('--repo-id <id>', 'Run in repo-only mode against a single repositories row (no product context)')
317
+ .option('-g, --guidance <text>', sub.guidance)
318
+ .option('-v, --verbose', 'Verbose output')
319
+ .action(async (productId, opts) => {
320
+ try {
321
+ if (!productId && !opts.repoId) {
322
+ throw new Error(`Provide a productId or --repo-id (repo-only mode) for ${sub.name}`);
323
+ }
324
+ await sub.run(productId, {
325
+ diagramId: opts.diagramId,
326
+ repoId: opts.repoId,
327
+ guidance: opts.guidance,
328
+ verbose: opts.verbose,
329
+ });
330
+ }
331
+ catch (error) {
332
+ logError(error instanceof Error ? error.message : String(error));
333
+ process.exit(1);
334
+ }
335
+ });
336
+ }
337
+ // ============================================================
226
338
  // Subcommand: edsger user-psychology <productId>
227
339
  // ============================================================
228
340
  program
@@ -659,7 +771,7 @@ program
659
771
  .command('quality-benchmark [productId]')
660
772
  .description("Run an industrial-grade code quality benchmark against the product's (or a standalone repository's) GitHub repo")
661
773
  .option('--repo <path>', "Override the auto-clone with a local checkout (default: clone the product's repo into ~/edsger/quality-<owner>-<repo>)")
662
- .option('--repo-id <id>', "Benchmark a specific repository (id). With a productId, targets that linked repo; without a productId, runs in repo-only mode (no product)")
774
+ .option('--repo-id <id>', 'Benchmark a specific repository (id). With a productId, targets that linked repo; without a productId, runs in repo-only mode (no product)')
663
775
  .option('--branch <name>', 'Override the detected default branch on the report envelope')
664
776
  .option('--pkg-manager <name>', 'npm | pnpm | yarn (auto-detected if absent)')
665
777
  .option('--no-install', 'Refuse to install missing tools; mark them unmeasured')
@@ -0,0 +1,15 @@
1
+ /**
2
+ * architecture-diagram phase: map a component/dependency diagram (C4-ish) —
3
+ * the modules / services / packages / datastores / external systems that make
4
+ * up the product and how they depend on one another. Persisted to the
5
+ * diagrams tables with `type = 'architecture'`.
6
+ */
7
+ import { type DiagramPhaseResult } from '../diagram-shared/generate.js';
8
+ export interface ArchitectureDiagramPhaseOptions {
9
+ productId?: string;
10
+ repoId?: string;
11
+ diagramId: string;
12
+ guidance?: string;
13
+ verbose?: boolean;
14
+ }
15
+ export declare function runArchitectureDiagramPhase(options: ArchitectureDiagramPhaseOptions): Promise<DiagramPhaseResult>;