@mytechtoday/augment-extensions 1.3.0 → 1.4.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.
- package/LICENSE +22 -22
- package/README.md +105 -6
- package/augment-extensions/domain-rules/software-architecture/README.md +143 -143
- package/augment-extensions/domain-rules/software-architecture/examples/banking-layered.md +961 -961
- package/augment-extensions/domain-rules/software-architecture/examples/ecommerce-microservices.md +990 -990
- package/augment-extensions/domain-rules/software-architecture/examples/iot-eventdriven.md +882 -882
- package/augment-extensions/domain-rules/software-architecture/examples/monolith-to-microservices-migration.md +703 -703
- package/augment-extensions/domain-rules/software-architecture/examples/serverless-imageprocessing.md +957 -957
- package/augment-extensions/domain-rules/software-architecture/examples/trading-eventdriven.md +747 -747
- package/augment-extensions/domain-rules/software-architecture/module.json +119 -119
- package/augment-extensions/domain-rules/software-architecture/rules/challenges-solutions.md +763 -763
- package/augment-extensions/domain-rules/software-architecture/rules/definitions-terminology.md +409 -409
- package/augment-extensions/domain-rules/software-architecture/rules/design-principles.md +684 -684
- package/augment-extensions/domain-rules/software-architecture/rules/evaluation-testing.md +1381 -1381
- package/augment-extensions/domain-rules/software-architecture/rules/event-driven-architecture.md +616 -616
- package/augment-extensions/domain-rules/software-architecture/rules/fundamentals.md +306 -306
- package/augment-extensions/domain-rules/software-architecture/rules/industry-architectures.md +554 -554
- package/augment-extensions/domain-rules/software-architecture/rules/layered-architecture.md +776 -776
- package/augment-extensions/domain-rules/software-architecture/rules/microservices-architecture.md +503 -503
- package/augment-extensions/domain-rules/software-architecture/rules/modeling-documentation.md +1199 -1199
- package/augment-extensions/domain-rules/software-architecture/rules/monolithic-architecture.md +351 -351
- package/augment-extensions/domain-rules/software-architecture/rules/principles.md +556 -556
- package/augment-extensions/domain-rules/software-architecture/rules/quality-attributes.md +797 -797
- package/augment-extensions/domain-rules/software-architecture/rules/scalability-performance.md +1345 -1345
- package/augment-extensions/domain-rules/software-architecture/rules/security-architecture.md +1039 -1039
- package/augment-extensions/domain-rules/software-architecture/rules/serverless-architecture.md +711 -711
- package/augment-extensions/domain-rules/software-architecture/rules/skills-development.md +568 -568
- package/augment-extensions/domain-rules/software-architecture/rules/tools-methodologies.md +961 -961
- package/augment-extensions/visual-design/CHANGELOG.md +132 -132
- package/augment-extensions/visual-design/README.md +255 -255
- package/augment-extensions/visual-design/__tests__/README.md +119 -119
- package/augment-extensions/visual-design/__tests__/style-selector.test.ts +172 -172
- package/augment-extensions/visual-design/__tests__/vendor-styles.test.ts +214 -214
- package/augment-extensions/visual-design/domains/other/ai-prompt-helper.ts +157 -157
- package/augment-extensions/visual-design/domains/other/dotnet-application.ts +156 -156
- package/augment-extensions/visual-design/domains/other/linux-platform.ts +156 -156
- package/augment-extensions/visual-design/domains/other/mobile-application.ts +157 -157
- package/augment-extensions/visual-design/domains/other/motion-picture.ts +156 -156
- package/augment-extensions/visual-design/domains/other/os-application.ts +156 -156
- package/augment-extensions/visual-design/domains/other/print-campaigns.ts +158 -158
- package/augment-extensions/visual-design/domains/other/web-app.ts +157 -157
- package/augment-extensions/visual-design/domains/other/website.ts +161 -161
- package/augment-extensions/visual-design/domains/other/windows-platform.ts +156 -156
- package/augment-extensions/visual-design/domains/web-page-styles/amazon-cloudscape.ts +506 -506
- package/augment-extensions/visual-design/domains/web-page-styles/google-modern.ts +615 -615
- package/augment-extensions/visual-design/domains/web-page-styles/microsoft-fluent.ts +531 -531
- package/augment-extensions/visual-design/examples/README.md +97 -97
- package/augment-extensions/visual-design/examples/ai-prompt-generation.md +233 -233
- package/augment-extensions/visual-design/examples/basic-usage.md +216 -216
- package/augment-extensions/visual-design/examples/domain-workflows.md +257 -257
- package/augment-extensions/visual-design/examples/vendor-comparison.md +247 -247
- package/augment-extensions/visual-design/module.json +78 -78
- package/augment-extensions/visual-design/style-selector.ts +177 -177
- package/augment-extensions/visual-design/types.ts +302 -302
- package/augment-extensions/visual-design/visual-design-core.ts +469 -469
- package/augment-extensions/workflows/adr-support/README.md +227 -227
- package/augment-extensions/workflows/adr-support/__tests__/adr-validator.test.ts +203 -203
- package/augment-extensions/workflows/adr-support/adr-validator.ts +162 -162
- package/augment-extensions/workflows/adr-support/examples/complete-lifecycle-example.md +449 -449
- package/augment-extensions/workflows/adr-support/examples/integration-example.md +580 -580
- package/augment-extensions/workflows/adr-support/examples/superseding-example.md +436 -436
- package/augment-extensions/workflows/adr-support/module.json +112 -112
- package/augment-extensions/workflows/adr-support/rules/adr-creation.md +372 -372
- package/augment-extensions/workflows/adr-support/rules/beads-integration.md +443 -443
- package/augment-extensions/workflows/adr-support/rules/conflict-detection.md +486 -486
- package/augment-extensions/workflows/adr-support/rules/decision-detection.md +362 -362
- package/augment-extensions/workflows/adr-support/rules/lifecycle-management.md +427 -427
- package/augment-extensions/workflows/adr-support/rules/openspec-integration.md +465 -465
- package/augment-extensions/workflows/adr-support/rules/template-selection.md +405 -405
- package/augment-extensions/workflows/adr-support/rules/validation-rules.md +543 -543
- package/augment-extensions/workflows/adr-support/schemas/adr-config.json +191 -191
- package/augment-extensions/workflows/adr-support/schemas/adr-metadata.json +172 -172
- package/augment-extensions/workflows/adr-support/templates/business-case.md +235 -235
- package/augment-extensions/workflows/adr-support/templates/madr-elaborate.md +197 -197
- package/augment-extensions/workflows/adr-support/templates/madr-simple.md +68 -68
- package/augment-extensions/workflows/adr-support/templates/nygard.md +84 -84
- package/augment-extensions/writing-standards/screenplay/rules/file-organization.md +213 -213
- package/augment-extensions/writing-standards/screenplay/utils/__tests__/file-organization.test.ts +169 -169
- package/augment-extensions/writing-standards/screenplay/utils/file-organization.ts +165 -165
- package/cli/dist/commands/agent.d.ts +37 -0
- package/cli/dist/commands/agent.d.ts.map +1 -0
- package/cli/dist/commands/agent.js +222 -0
- package/cli/dist/commands/agent.js.map +1 -0
- package/cli/dist/commands/beads.d.ts +64 -0
- package/cli/dist/commands/beads.d.ts.map +1 -0
- package/cli/dist/commands/beads.js +377 -0
- package/cli/dist/commands/beads.js.map +1 -0
- package/cli/dist/commands/change.d.ts +54 -0
- package/cli/dist/commands/change.d.ts.map +1 -0
- package/cli/dist/commands/change.js +243 -0
- package/cli/dist/commands/change.js.map +1 -0
- package/cli/dist/commands/clean.d.ts +15 -0
- package/cli/dist/commands/clean.d.ts.map +1 -0
- package/cli/dist/commands/clean.js +63 -0
- package/cli/dist/commands/clean.js.map +1 -0
- package/cli/dist/commands/clone.d.ts +15 -0
- package/cli/dist/commands/clone.d.ts.map +1 -0
- package/cli/dist/commands/clone.js +49 -0
- package/cli/dist/commands/clone.js.map +1 -0
- package/cli/dist/commands/config.d.ts +33 -0
- package/cli/dist/commands/config.d.ts.map +1 -0
- package/cli/dist/commands/config.js +166 -0
- package/cli/dist/commands/config.js.map +1 -0
- package/cli/dist/commands/context.d.ts +38 -0
- package/cli/dist/commands/context.d.ts.map +1 -0
- package/cli/dist/commands/context.js +205 -0
- package/cli/dist/commands/context.js.map +1 -0
- package/cli/dist/commands/create.d.ts +18 -0
- package/cli/dist/commands/create.d.ts.map +1 -0
- package/cli/dist/commands/create.js +178 -0
- package/cli/dist/commands/create.js.map +1 -0
- package/cli/dist/commands/diff.d.ts +19 -0
- package/cli/dist/commands/diff.d.ts.map +1 -0
- package/cli/dist/commands/diff.js +104 -0
- package/cli/dist/commands/diff.js.map +1 -0
- package/cli/dist/commands/doctor.d.ts +14 -0
- package/cli/dist/commands/doctor.d.ts.map +1 -0
- package/cli/dist/commands/doctor.js +62 -0
- package/cli/dist/commands/doctor.js.map +1 -0
- package/cli/dist/commands/export.d.ts +28 -0
- package/cli/dist/commands/export.d.ts.map +1 -0
- package/cli/dist/commands/export.js +135 -0
- package/cli/dist/commands/export.js.map +1 -0
- package/cli/dist/commands/import.d.ts +23 -0
- package/cli/dist/commands/import.d.ts.map +1 -0
- package/cli/dist/commands/import.js +118 -0
- package/cli/dist/commands/import.js.map +1 -0
- package/cli/dist/commands/prompt.d.ts +45 -0
- package/cli/dist/commands/prompt.d.ts.map +1 -0
- package/cli/dist/commands/prompt.js +223 -0
- package/cli/dist/commands/prompt.js.map +1 -0
- package/cli/dist/commands/spec.d.ts +57 -0
- package/cli/dist/commands/spec.d.ts.map +1 -0
- package/cli/dist/commands/spec.js +279 -0
- package/cli/dist/commands/spec.js.map +1 -0
- package/cli/dist/commands/stats.d.ts +18 -0
- package/cli/dist/commands/stats.d.ts.map +1 -0
- package/cli/dist/commands/stats.js +85 -0
- package/cli/dist/commands/stats.js.map +1 -0
- package/cli/dist/commands/task.d.ts +65 -0
- package/cli/dist/commands/task.d.ts.map +1 -0
- package/cli/dist/commands/task.js +282 -0
- package/cli/dist/commands/task.js.map +1 -0
- package/cli/dist/commands/template.d.ts +17 -0
- package/cli/dist/commands/template.d.ts.map +1 -0
- package/cli/dist/commands/template.js +55 -0
- package/cli/dist/commands/template.js.map +1 -0
- package/cli/dist/utils/agent-config.d.ts +129 -0
- package/cli/dist/utils/agent-config.d.ts.map +1 -0
- package/cli/dist/utils/agent-config.js +297 -0
- package/cli/dist/utils/agent-config.js.map +1 -0
- package/cli/dist/utils/auto-sync.js +19 -19
- package/cli/dist/utils/beads-graph.d.ts +17 -0
- package/cli/dist/utils/beads-graph.d.ts.map +1 -0
- package/cli/dist/utils/beads-graph.js +150 -0
- package/cli/dist/utils/beads-graph.js.map +1 -0
- package/cli/dist/utils/beads-integration.d.ts +112 -0
- package/cli/dist/utils/beads-integration.d.ts.map +1 -0
- package/cli/dist/utils/beads-integration.js +312 -0
- package/cli/dist/utils/beads-integration.js.map +1 -0
- package/cli/dist/utils/beads-reporter.d.ts +17 -0
- package/cli/dist/utils/beads-reporter.d.ts.map +1 -0
- package/cli/dist/utils/beads-reporter.js +160 -0
- package/cli/dist/utils/beads-reporter.js.map +1 -0
- package/cli/dist/utils/cache-manager.d.ts +55 -0
- package/cli/dist/utils/cache-manager.d.ts.map +1 -0
- package/cli/dist/utils/cache-manager.js +150 -0
- package/cli/dist/utils/cache-manager.js.map +1 -0
- package/cli/dist/utils/change-manager.d.ts +70 -0
- package/cli/dist/utils/change-manager.d.ts.map +1 -0
- package/cli/dist/utils/change-manager.js +412 -0
- package/cli/dist/utils/change-manager.js.map +1 -0
- package/cli/dist/utils/config-manager-enhanced.d.ts +66 -0
- package/cli/dist/utils/config-manager-enhanced.d.ts.map +1 -0
- package/cli/dist/utils/config-manager-enhanced.js +77 -0
- package/cli/dist/utils/config-manager-enhanced.js.map +1 -0
- package/cli/dist/utils/context-manager.d.ts +96 -0
- package/cli/dist/utils/context-manager.d.ts.map +1 -0
- package/cli/dist/utils/context-manager.js +258 -0
- package/cli/dist/utils/context-manager.js.map +1 -0
- package/cli/dist/utils/diff-engine.d.ts +78 -0
- package/cli/dist/utils/diff-engine.d.ts.map +1 -0
- package/cli/dist/utils/diff-engine.js +233 -0
- package/cli/dist/utils/diff-engine.js.map +1 -0
- package/cli/dist/utils/export-system.d.ts +101 -0
- package/cli/dist/utils/export-system.d.ts.map +1 -0
- package/cli/dist/utils/export-system.js +289 -0
- package/cli/dist/utils/export-system.js.map +1 -0
- package/cli/dist/utils/health-checker.d.ts +66 -0
- package/cli/dist/utils/health-checker.d.ts.map +1 -0
- package/cli/dist/utils/health-checker.js +285 -0
- package/cli/dist/utils/health-checker.js.map +1 -0
- package/cli/dist/utils/import-system.d.ts +74 -0
- package/cli/dist/utils/import-system.d.ts.map +1 -0
- package/cli/dist/utils/import-system.js +317 -0
- package/cli/dist/utils/import-system.js.map +1 -0
- package/cli/dist/utils/module-cloner.d.ts +40 -0
- package/cli/dist/utils/module-cloner.d.ts.map +1 -0
- package/cli/dist/utils/module-cloner.js +136 -0
- package/cli/dist/utils/module-cloner.js.map +1 -0
- package/cli/dist/utils/prompt-manager.d.ts +90 -0
- package/cli/dist/utils/prompt-manager.d.ts.map +1 -0
- package/cli/dist/utils/prompt-manager.js +302 -0
- package/cli/dist/utils/prompt-manager.js.map +1 -0
- package/cli/dist/utils/spec-manager.d.ts +65 -0
- package/cli/dist/utils/spec-manager.d.ts.map +1 -0
- package/cli/dist/utils/spec-manager.js +329 -0
- package/cli/dist/utils/spec-manager.js.map +1 -0
- package/cli/dist/utils/stats-collector.d.ts +74 -0
- package/cli/dist/utils/stats-collector.d.ts.map +1 -0
- package/cli/dist/utils/stats-collector.js +164 -0
- package/cli/dist/utils/stats-collector.js.map +1 -0
- package/cli/dist/utils/template-engine.d.ts +47 -0
- package/cli/dist/utils/template-engine.d.ts.map +1 -0
- package/cli/dist/utils/template-engine.js +204 -0
- package/cli/dist/utils/template-engine.js.map +1 -0
- package/package.json +12 -3
- package/augment-extensions/workflows/openspec/README.md +0 -96
- package/augment-extensions/workflows/openspec/examples/complete-change-example.md +0 -244
- package/augment-extensions/workflows/openspec/module.json +0 -54
- package/augment-extensions/workflows/openspec/rules/best-practices.md +0 -272
- package/augment-extensions/workflows/openspec/rules/manual-setup.md +0 -231
- package/augment-extensions/workflows/openspec/rules/spec-format.md +0 -236
- package/augment-extensions/workflows/openspec/rules/workflow.md +0 -214
- package/cli/dist/utils/__tests__/adr-validator.example.d.ts +0 -6
- package/cli/dist/utils/__tests__/adr-validator.example.d.ts.map +0 -1
- package/cli/dist/utils/__tests__/adr-validator.example.js +0 -148
- package/cli/dist/utils/__tests__/adr-validator.example.js.map +0 -1
- package/cli/dist/utils/adr-validator.d.ts +0 -65
- package/cli/dist/utils/adr-validator.d.ts.map +0 -1
- package/cli/dist/utils/adr-validator.js +0 -203
- package/cli/dist/utils/adr-validator.js.map +0 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beads Integration Utility
|
|
3
|
+
*
|
|
4
|
+
* Core Beads integration utility for task tracking and management.
|
|
5
|
+
* Provides functions for reading, validating, filtering, and managing Beads tasks.
|
|
6
|
+
*/
|
|
7
|
+
export interface BeadsTask {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
status: 'open' | 'in_progress' | 'blocked' | 'closed';
|
|
12
|
+
priority?: number;
|
|
13
|
+
issue_type?: string;
|
|
14
|
+
owner?: string;
|
|
15
|
+
created_at?: string;
|
|
16
|
+
created_by?: string;
|
|
17
|
+
updated_at?: string;
|
|
18
|
+
closed_at?: string;
|
|
19
|
+
close_reason?: string;
|
|
20
|
+
labels?: string[];
|
|
21
|
+
dependencies?: Array<{
|
|
22
|
+
issue_id: string;
|
|
23
|
+
depends_on_id: string;
|
|
24
|
+
type: string;
|
|
25
|
+
created_at?: string;
|
|
26
|
+
created_by?: string;
|
|
27
|
+
}>;
|
|
28
|
+
blocks?: string[];
|
|
29
|
+
blocked_by?: string[];
|
|
30
|
+
comments?: Array<{
|
|
31
|
+
id: number;
|
|
32
|
+
issue_id: string;
|
|
33
|
+
author: string;
|
|
34
|
+
text: string;
|
|
35
|
+
created_at: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export interface BeadsStats {
|
|
39
|
+
total: number;
|
|
40
|
+
open: number;
|
|
41
|
+
in_progress: number;
|
|
42
|
+
blocked: number;
|
|
43
|
+
closed: number;
|
|
44
|
+
by_priority: Record<number, number>;
|
|
45
|
+
by_type: Record<string, number>;
|
|
46
|
+
by_owner: Record<string, number>;
|
|
47
|
+
avg_time_to_close?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Read all tasks from .beads/issues.jsonl
|
|
51
|
+
*/
|
|
52
|
+
export declare function readBeadsTasks(beadsPath?: string): BeadsTask[];
|
|
53
|
+
/**
|
|
54
|
+
* Get a single task by ID
|
|
55
|
+
*/
|
|
56
|
+
export declare function getTask(taskId: string, beadsPath?: string): BeadsTask | null;
|
|
57
|
+
/**
|
|
58
|
+
* Filter tasks by status
|
|
59
|
+
*/
|
|
60
|
+
export declare function filterByStatus(tasks: BeadsTask[], status: string | string[]): BeadsTask[];
|
|
61
|
+
/**
|
|
62
|
+
* Filter tasks by priority
|
|
63
|
+
*/
|
|
64
|
+
export declare function filterByPriority(tasks: BeadsTask[], priority: number | number[]): BeadsTask[];
|
|
65
|
+
/**
|
|
66
|
+
* Filter tasks by labels/tags
|
|
67
|
+
*/
|
|
68
|
+
export declare function filterByLabels(tasks: BeadsTask[], labels: string | string[]): BeadsTask[];
|
|
69
|
+
/**
|
|
70
|
+
* Filter tasks by owner
|
|
71
|
+
*/
|
|
72
|
+
export declare function filterByOwner(tasks: BeadsTask[], owner: string): BeadsTask[];
|
|
73
|
+
/**
|
|
74
|
+
* Get tasks that are ready to work on (open and not blocked)
|
|
75
|
+
*/
|
|
76
|
+
export declare function getReadyTasks(tasks: BeadsTask[]): BeadsTask[];
|
|
77
|
+
/**
|
|
78
|
+
* Calculate statistics for tasks
|
|
79
|
+
*/
|
|
80
|
+
export declare function calculateStats(tasks: BeadsTask[]): BeadsStats;
|
|
81
|
+
/**
|
|
82
|
+
* Validate task ID format
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateTaskId(taskId: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Validate task structure
|
|
87
|
+
*/
|
|
88
|
+
export declare function validateTask(task: any): {
|
|
89
|
+
valid: boolean;
|
|
90
|
+
errors: string[];
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Sort tasks by field
|
|
94
|
+
*/
|
|
95
|
+
export declare function sortTasks(tasks: BeadsTask[], field: 'priority' | 'created' | 'updated' | 'title', order?: 'asc' | 'desc'): BeadsTask[];
|
|
96
|
+
/**
|
|
97
|
+
* Search tasks by text
|
|
98
|
+
*/
|
|
99
|
+
export declare function searchTasks(tasks: BeadsTask[], query: string): BeadsTask[];
|
|
100
|
+
/**
|
|
101
|
+
* Get dependency chain for a task
|
|
102
|
+
*/
|
|
103
|
+
export declare function getDependencyChain(taskId: string, tasks: BeadsTask[]): string[];
|
|
104
|
+
/**
|
|
105
|
+
* Append a task to issues.jsonl
|
|
106
|
+
*/
|
|
107
|
+
export declare function appendTask(task: BeadsTask, beadsPath?: string): void;
|
|
108
|
+
/**
|
|
109
|
+
* Update a task (appends update to JSONL)
|
|
110
|
+
*/
|
|
111
|
+
export declare function updateTask(taskId: string, updates: Partial<BeadsTask>, beadsPath?: string): void;
|
|
112
|
+
//# sourceMappingURL=beads-integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-integration.d.ts","sourceRoot":"","sources":["../../src/utils/beads-integration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAA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AK,EAAE,SAAS,EAAE,GAAG,UAAU,CAmD7D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAuB5E;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,EAAE,EAClB,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,EACnD,KAAK,GAAE,KAAK,GAAG,MAAc,GAC5B,SAAS,EAAE,CA8Bb;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAO1E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAsB/E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,GAAE,MAAiD,GAAG,IAAI,CAQ9G;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAchG"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Beads Integration Utility
|
|
4
|
+
*
|
|
5
|
+
* Core Beads integration utility for task tracking and management.
|
|
6
|
+
* Provides functions for reading, validating, filtering, and managing Beads tasks.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.readBeadsTasks = readBeadsTasks;
|
|
43
|
+
exports.getTask = getTask;
|
|
44
|
+
exports.filterByStatus = filterByStatus;
|
|
45
|
+
exports.filterByPriority = filterByPriority;
|
|
46
|
+
exports.filterByLabels = filterByLabels;
|
|
47
|
+
exports.filterByOwner = filterByOwner;
|
|
48
|
+
exports.getReadyTasks = getReadyTasks;
|
|
49
|
+
exports.calculateStats = calculateStats;
|
|
50
|
+
exports.validateTaskId = validateTaskId;
|
|
51
|
+
exports.validateTask = validateTask;
|
|
52
|
+
exports.sortTasks = sortTasks;
|
|
53
|
+
exports.searchTasks = searchTasks;
|
|
54
|
+
exports.getDependencyChain = getDependencyChain;
|
|
55
|
+
exports.appendTask = appendTask;
|
|
56
|
+
exports.updateTask = updateTask;
|
|
57
|
+
const fs = __importStar(require("fs"));
|
|
58
|
+
/**
|
|
59
|
+
* Read all tasks from .beads/issues.jsonl
|
|
60
|
+
*/
|
|
61
|
+
function readBeadsTasks(beadsPath = 'augment-extensions/.beads/issues.jsonl') {
|
|
62
|
+
if (!fs.existsSync(beadsPath)) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
const content = fs.readFileSync(beadsPath, 'utf-8');
|
|
66
|
+
const lines = content.split('\n').filter(line => line.trim());
|
|
67
|
+
const tasksMap = new Map();
|
|
68
|
+
for (const line of lines) {
|
|
69
|
+
try {
|
|
70
|
+
const entry = JSON.parse(line);
|
|
71
|
+
if (entry.id) {
|
|
72
|
+
// Merge updates into existing task
|
|
73
|
+
if (tasksMap.has(entry.id)) {
|
|
74
|
+
const existing = tasksMap.get(entry.id);
|
|
75
|
+
tasksMap.set(entry.id, { ...existing, ...entry });
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
tasksMap.set(entry.id, entry);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.error(`Failed to parse line: ${line}`, error);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return Array.from(tasksMap.values());
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get a single task by ID
|
|
90
|
+
*/
|
|
91
|
+
function getTask(taskId, beadsPath) {
|
|
92
|
+
const tasks = readBeadsTasks(beadsPath);
|
|
93
|
+
return tasks.find(t => t.id === taskId) || null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Filter tasks by status
|
|
97
|
+
*/
|
|
98
|
+
function filterByStatus(tasks, status) {
|
|
99
|
+
const statuses = Array.isArray(status) ? status : [status];
|
|
100
|
+
return tasks.filter(t => statuses.includes(t.status));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Filter tasks by priority
|
|
104
|
+
*/
|
|
105
|
+
function filterByPriority(tasks, priority) {
|
|
106
|
+
const priorities = Array.isArray(priority) ? priority : [priority];
|
|
107
|
+
return tasks.filter(t => t.priority !== undefined && priorities.includes(t.priority));
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Filter tasks by labels/tags
|
|
111
|
+
*/
|
|
112
|
+
function filterByLabels(tasks, labels) {
|
|
113
|
+
const labelList = Array.isArray(labels) ? labels : [labels];
|
|
114
|
+
return tasks.filter(t => t.labels && t.labels.some(label => labelList.includes(label)));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Filter tasks by owner
|
|
118
|
+
*/
|
|
119
|
+
function filterByOwner(tasks, owner) {
|
|
120
|
+
return tasks.filter(t => t.owner === owner);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get tasks that are ready to work on (open and not blocked)
|
|
124
|
+
*/
|
|
125
|
+
function getReadyTasks(tasks) {
|
|
126
|
+
return tasks.filter(t => {
|
|
127
|
+
if (t.status !== 'open')
|
|
128
|
+
return false;
|
|
129
|
+
if (!t.blocked_by || t.blocked_by.length === 0)
|
|
130
|
+
return true;
|
|
131
|
+
// Check if all blockers are closed
|
|
132
|
+
const blockerIds = t.blocked_by;
|
|
133
|
+
const blockers = tasks.filter(task => blockerIds.includes(task.id));
|
|
134
|
+
return blockers.every(blocker => blocker.status === 'closed');
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Calculate statistics for tasks
|
|
139
|
+
*/
|
|
140
|
+
function calculateStats(tasks) {
|
|
141
|
+
const stats = {
|
|
142
|
+
total: tasks.length,
|
|
143
|
+
open: 0,
|
|
144
|
+
in_progress: 0,
|
|
145
|
+
blocked: 0,
|
|
146
|
+
closed: 0,
|
|
147
|
+
by_priority: {},
|
|
148
|
+
by_type: {},
|
|
149
|
+
by_owner: {}
|
|
150
|
+
};
|
|
151
|
+
let totalTimeToClose = 0;
|
|
152
|
+
let closedCount = 0;
|
|
153
|
+
for (const task of tasks) {
|
|
154
|
+
// Count by status
|
|
155
|
+
if (task.status === 'open')
|
|
156
|
+
stats.open++;
|
|
157
|
+
else if (task.status === 'in_progress')
|
|
158
|
+
stats.in_progress++;
|
|
159
|
+
else if (task.status === 'blocked')
|
|
160
|
+
stats.blocked++;
|
|
161
|
+
else if (task.status === 'closed')
|
|
162
|
+
stats.closed++;
|
|
163
|
+
// Count by priority
|
|
164
|
+
if (task.priority !== undefined) {
|
|
165
|
+
stats.by_priority[task.priority] = (stats.by_priority[task.priority] || 0) + 1;
|
|
166
|
+
}
|
|
167
|
+
// Count by type
|
|
168
|
+
if (task.issue_type) {
|
|
169
|
+
stats.by_type[task.issue_type] = (stats.by_type[task.issue_type] || 0) + 1;
|
|
170
|
+
}
|
|
171
|
+
// Count by owner
|
|
172
|
+
if (task.owner) {
|
|
173
|
+
stats.by_owner[task.owner] = (stats.by_owner[task.owner] || 0) + 1;
|
|
174
|
+
}
|
|
175
|
+
// Calculate average time to close
|
|
176
|
+
if (task.status === 'closed' && task.created_at && task.closed_at) {
|
|
177
|
+
const created = new Date(task.created_at).getTime();
|
|
178
|
+
const closed = new Date(task.closed_at).getTime();
|
|
179
|
+
totalTimeToClose += (closed - created);
|
|
180
|
+
closedCount++;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (closedCount > 0) {
|
|
184
|
+
stats.avg_time_to_close = totalTimeToClose / closedCount;
|
|
185
|
+
}
|
|
186
|
+
return stats;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Validate task ID format
|
|
190
|
+
*/
|
|
191
|
+
function validateTaskId(taskId) {
|
|
192
|
+
const pattern = /^bd-[a-z0-9]+([.-][a-z0-9]+)*$/;
|
|
193
|
+
return pattern.test(taskId);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Validate task structure
|
|
197
|
+
*/
|
|
198
|
+
function validateTask(task) {
|
|
199
|
+
const errors = [];
|
|
200
|
+
if (!task.id) {
|
|
201
|
+
errors.push('Missing required field: id');
|
|
202
|
+
}
|
|
203
|
+
else if (!validateTaskId(task.id)) {
|
|
204
|
+
errors.push(`Invalid task ID format: ${task.id}`);
|
|
205
|
+
}
|
|
206
|
+
if (!task.title) {
|
|
207
|
+
errors.push('Missing required field: title');
|
|
208
|
+
}
|
|
209
|
+
if (!task.status) {
|
|
210
|
+
errors.push('Missing required field: status');
|
|
211
|
+
}
|
|
212
|
+
else if (!['open', 'in_progress', 'blocked', 'closed'].includes(task.status)) {
|
|
213
|
+
errors.push(`Invalid status: ${task.status}`);
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
valid: errors.length === 0,
|
|
217
|
+
errors
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Sort tasks by field
|
|
222
|
+
*/
|
|
223
|
+
function sortTasks(tasks, field, order = 'asc') {
|
|
224
|
+
const sorted = [...tasks].sort((a, b) => {
|
|
225
|
+
let aVal;
|
|
226
|
+
let bVal;
|
|
227
|
+
switch (field) {
|
|
228
|
+
case 'priority':
|
|
229
|
+
aVal = a.priority ?? 999;
|
|
230
|
+
bVal = b.priority ?? 999;
|
|
231
|
+
break;
|
|
232
|
+
case 'created':
|
|
233
|
+
aVal = a.created_at ? new Date(a.created_at).getTime() : 0;
|
|
234
|
+
bVal = b.created_at ? new Date(b.created_at).getTime() : 0;
|
|
235
|
+
break;
|
|
236
|
+
case 'updated':
|
|
237
|
+
aVal = a.updated_at ? new Date(a.updated_at).getTime() : 0;
|
|
238
|
+
bVal = b.updated_at ? new Date(b.updated_at).getTime() : 0;
|
|
239
|
+
break;
|
|
240
|
+
case 'title':
|
|
241
|
+
aVal = a.title.toLowerCase();
|
|
242
|
+
bVal = b.title.toLowerCase();
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
if (aVal < bVal)
|
|
246
|
+
return order === 'asc' ? -1 : 1;
|
|
247
|
+
if (aVal > bVal)
|
|
248
|
+
return order === 'asc' ? 1 : -1;
|
|
249
|
+
return 0;
|
|
250
|
+
});
|
|
251
|
+
return sorted;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Search tasks by text
|
|
255
|
+
*/
|
|
256
|
+
function searchTasks(tasks, query) {
|
|
257
|
+
const lowerQuery = query.toLowerCase();
|
|
258
|
+
return tasks.filter(t => t.id.toLowerCase().includes(lowerQuery) ||
|
|
259
|
+
t.title.toLowerCase().includes(lowerQuery) ||
|
|
260
|
+
(t.description && t.description.toLowerCase().includes(lowerQuery)));
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Get dependency chain for a task
|
|
264
|
+
*/
|
|
265
|
+
function getDependencyChain(taskId, tasks) {
|
|
266
|
+
const chain = [];
|
|
267
|
+
const visited = new Set();
|
|
268
|
+
function traverse(id) {
|
|
269
|
+
if (visited.has(id))
|
|
270
|
+
return;
|
|
271
|
+
visited.add(id);
|
|
272
|
+
const task = tasks.find(t => t.id === id);
|
|
273
|
+
if (!task)
|
|
274
|
+
return;
|
|
275
|
+
chain.push(id);
|
|
276
|
+
if (task.blocked_by) {
|
|
277
|
+
for (const blockerId of task.blocked_by) {
|
|
278
|
+
traverse(blockerId);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
traverse(taskId);
|
|
283
|
+
return chain;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Append a task to issues.jsonl
|
|
287
|
+
*/
|
|
288
|
+
function appendTask(task, beadsPath = 'augment-extensions/.beads/issues.jsonl') {
|
|
289
|
+
const validation = validateTask(task);
|
|
290
|
+
if (!validation.valid) {
|
|
291
|
+
throw new Error(`Invalid task: ${validation.errors.join(', ')}`);
|
|
292
|
+
}
|
|
293
|
+
const line = JSON.stringify(task) + '\n';
|
|
294
|
+
fs.appendFileSync(beadsPath, line, 'utf-8');
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Update a task (appends update to JSONL)
|
|
298
|
+
*/
|
|
299
|
+
function updateTask(taskId, updates, beadsPath) {
|
|
300
|
+
const task = getTask(taskId, beadsPath);
|
|
301
|
+
if (!task) {
|
|
302
|
+
throw new Error(`Task not found: ${taskId}`);
|
|
303
|
+
}
|
|
304
|
+
const updatedTask = {
|
|
305
|
+
...task,
|
|
306
|
+
...updates,
|
|
307
|
+
id: taskId, // Ensure ID doesn't change
|
|
308
|
+
updated_at: new Date().toISOString()
|
|
309
|
+
};
|
|
310
|
+
appendTask(updatedTask, beadsPath);
|
|
311
|
+
}
|
|
312
|
+
//# sourceMappingURL=beads-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-integration.js","sourceRoot":"","sources":["../../src/utils/beads-integration.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDH,wCA4BC;AAKD,0BAGC;AAKD,wCAGC;AAKD,4CAGC;AAKD,wCAKC;AAKD,sCAEC;AAKD,sCAUC;AAKD,wCAmDC;AAKD,wCAGC;AAKD,oCAuBC;AAKD,8BAkCC;AAKD,kCAOC;AAKD,gDAsBC;AAKD,gCAQC;AAKD,gCAcC;AAhVD,uCAAyB;AA+CzB;;GAEG;AACH,SAAgB,cAAc,CAAC,YAAoB,wCAAwC;IACzF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,OAAO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CAAC,SAAS,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,IAAe,EAAE,YAAoB,wCAAwC;IACtG,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,iBAAiB,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACzC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,MAAc,EAAE,OAA2B,EAAE,SAAkB;IACxF,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,WAAW,GAAG;QAClB,GAAG,IAAI;QACP,GAAG,OAAO;QACV,EAAE,EAAE,MAAM,EAAE,2BAA2B;QACvC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACrC,CAAC;IAEF,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beads Reporter Utility
|
|
3
|
+
*
|
|
4
|
+
* Generates reports, statistics, and analytics for Beads tasks.
|
|
5
|
+
*/
|
|
6
|
+
import { BeadsTask } from './beads-integration';
|
|
7
|
+
export interface ReportOptions {
|
|
8
|
+
format?: 'markdown' | 'html' | 'json' | 'csv';
|
|
9
|
+
period?: 'day' | 'week' | 'month' | 'all';
|
|
10
|
+
includeSections?: string[];
|
|
11
|
+
outputPath?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Generate a comprehensive report
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateReport(tasks: BeadsTask[], options?: ReportOptions): string;
|
|
17
|
+
//# sourceMappingURL=beads-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-reporter.d.ts","sourceRoot":"","sources":["../../src/utils/beads-reporter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAA8D,MAAM,qBAAqB,CAAC;AAE5G,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IAC9C,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAgBtF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Beads Reporter Utility
|
|
4
|
+
*
|
|
5
|
+
* Generates reports, statistics, and analytics for Beads tasks.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.generateReport = generateReport;
|
|
9
|
+
const beads_integration_1 = require("./beads-integration");
|
|
10
|
+
/**
|
|
11
|
+
* Generate a comprehensive report
|
|
12
|
+
*/
|
|
13
|
+
function generateReport(tasks, options = {}) {
|
|
14
|
+
const format = options.format || 'markdown';
|
|
15
|
+
const sections = options.includeSections || ['summary', 'stats', 'timeline'];
|
|
16
|
+
switch (format) {
|
|
17
|
+
case 'markdown':
|
|
18
|
+
return generateMarkdownReport(tasks, sections);
|
|
19
|
+
case 'html':
|
|
20
|
+
return generateHTMLReport(tasks, sections);
|
|
21
|
+
case 'json':
|
|
22
|
+
return generateJSONReport(tasks, sections);
|
|
23
|
+
case 'csv':
|
|
24
|
+
return generateCSVReport(tasks);
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Unsupported format: ${format}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Generate Markdown report
|
|
31
|
+
*/
|
|
32
|
+
function generateMarkdownReport(tasks, sections) {
|
|
33
|
+
const stats = (0, beads_integration_1.calculateStats)(tasks);
|
|
34
|
+
let report = '# Beads Task Report\n\n';
|
|
35
|
+
report += `Generated: ${new Date().toISOString()}\n\n`;
|
|
36
|
+
if (sections.includes('summary')) {
|
|
37
|
+
report += '## Summary\n\n';
|
|
38
|
+
report += `- **Total Tasks:** ${stats.total}\n`;
|
|
39
|
+
report += `- **Open:** ${stats.open}\n`;
|
|
40
|
+
report += `- **In Progress:** ${stats.in_progress}\n`;
|
|
41
|
+
report += `- **Blocked:** ${stats.blocked}\n`;
|
|
42
|
+
report += `- **Closed:** ${stats.closed}\n`;
|
|
43
|
+
report += `- **Completion Rate:** ${((stats.closed / stats.total) * 100).toFixed(1)}%\n\n`;
|
|
44
|
+
}
|
|
45
|
+
if (sections.includes('stats')) {
|
|
46
|
+
report += '## Statistics\n\n';
|
|
47
|
+
report += '### By Priority\n\n';
|
|
48
|
+
report += '| Priority | Count |\n';
|
|
49
|
+
report += '|----------|-------|\n';
|
|
50
|
+
for (const [priority, count] of Object.entries(stats.by_priority).sort()) {
|
|
51
|
+
report += `| ${priority} | ${count} |\n`;
|
|
52
|
+
}
|
|
53
|
+
report += '\n';
|
|
54
|
+
report += '### By Type\n\n';
|
|
55
|
+
report += '| Type | Count |\n';
|
|
56
|
+
report += '|------|-------|\n';
|
|
57
|
+
for (const [type, count] of Object.entries(stats.by_type).sort()) {
|
|
58
|
+
report += `| ${type} | ${count} |\n`;
|
|
59
|
+
}
|
|
60
|
+
report += '\n';
|
|
61
|
+
if (stats.avg_time_to_close) {
|
|
62
|
+
const days = Math.round(stats.avg_time_to_close / (1000 * 60 * 60 * 24));
|
|
63
|
+
report += `### Average Time to Close\n\n${days} days\n\n`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (sections.includes('timeline')) {
|
|
67
|
+
report += '## Recent Activity\n\n';
|
|
68
|
+
const recentTasks = tasks
|
|
69
|
+
.filter(t => t.updated_at)
|
|
70
|
+
.sort((a, b) => {
|
|
71
|
+
const aTime = new Date(a.updated_at).getTime();
|
|
72
|
+
const bTime = new Date(b.updated_at).getTime();
|
|
73
|
+
return bTime - aTime;
|
|
74
|
+
})
|
|
75
|
+
.slice(0, 10);
|
|
76
|
+
for (const task of recentTasks) {
|
|
77
|
+
const date = new Date(task.updated_at).toLocaleDateString();
|
|
78
|
+
report += `- **${task.id}**: ${task.title} (${task.status}) - ${date}\n`;
|
|
79
|
+
}
|
|
80
|
+
report += '\n';
|
|
81
|
+
}
|
|
82
|
+
return report;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Generate HTML report
|
|
86
|
+
*/
|
|
87
|
+
function generateHTMLReport(tasks, sections) {
|
|
88
|
+
const stats = (0, beads_integration_1.calculateStats)(tasks);
|
|
89
|
+
let html = '<!DOCTYPE html>\n<html>\n<head>\n';
|
|
90
|
+
html += '<title>Beads Task Report</title>\n';
|
|
91
|
+
html += '<style>\n';
|
|
92
|
+
html += 'body { font-family: Arial, sans-serif; margin: 20px; }\n';
|
|
93
|
+
html += 'table { border-collapse: collapse; width: 100%; margin: 20px 0; }\n';
|
|
94
|
+
html += 'th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }\n';
|
|
95
|
+
html += 'th { background-color: #4CAF50; color: white; }\n';
|
|
96
|
+
html += '.stat { display: inline-block; margin: 10px; padding: 15px; background: #f0f0f0; border-radius: 5px; }\n';
|
|
97
|
+
html += '</style>\n</head>\n<body>\n';
|
|
98
|
+
html += '<h1>Beads Task Report</h1>\n';
|
|
99
|
+
html += `<p>Generated: ${new Date().toISOString()}</p>\n`;
|
|
100
|
+
if (sections.includes('summary')) {
|
|
101
|
+
html += '<h2>Summary</h2>\n';
|
|
102
|
+
html += `<div class="stat"><strong>Total:</strong> ${stats.total}</div>\n`;
|
|
103
|
+
html += `<div class="stat"><strong>Open:</strong> ${stats.open}</div>\n`;
|
|
104
|
+
html += `<div class="stat"><strong>In Progress:</strong> ${stats.in_progress}</div>\n`;
|
|
105
|
+
html += `<div class="stat"><strong>Blocked:</strong> ${stats.blocked}</div>\n`;
|
|
106
|
+
html += `<div class="stat"><strong>Closed:</strong> ${stats.closed}</div>\n`;
|
|
107
|
+
html += `<div class="stat"><strong>Completion:</strong> ${((stats.closed / stats.total) * 100).toFixed(1)}%</div>\n`;
|
|
108
|
+
}
|
|
109
|
+
if (sections.includes('stats')) {
|
|
110
|
+
html += '<h2>Statistics</h2>\n';
|
|
111
|
+
html += '<h3>By Priority</h3>\n<table>\n<tr><th>Priority</th><th>Count</th></tr>\n';
|
|
112
|
+
for (const [priority, count] of Object.entries(stats.by_priority).sort()) {
|
|
113
|
+
html += `<tr><td>${priority}</td><td>${count}</td></tr>\n`;
|
|
114
|
+
}
|
|
115
|
+
html += '</table>\n';
|
|
116
|
+
}
|
|
117
|
+
html += '</body>\n</html>';
|
|
118
|
+
return html;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Generate JSON report
|
|
122
|
+
*/
|
|
123
|
+
function generateJSONReport(tasks, sections) {
|
|
124
|
+
const stats = (0, beads_integration_1.calculateStats)(tasks);
|
|
125
|
+
const report = {
|
|
126
|
+
generated: new Date().toISOString(),
|
|
127
|
+
stats,
|
|
128
|
+
tasks: tasks.map(t => ({
|
|
129
|
+
id: t.id,
|
|
130
|
+
title: t.title,
|
|
131
|
+
status: t.status,
|
|
132
|
+
priority: t.priority,
|
|
133
|
+
created_at: t.created_at,
|
|
134
|
+
updated_at: t.updated_at
|
|
135
|
+
}))
|
|
136
|
+
};
|
|
137
|
+
return JSON.stringify(report, null, 2);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Generate CSV report
|
|
141
|
+
*/
|
|
142
|
+
function generateCSVReport(tasks) {
|
|
143
|
+
let csv = 'ID,Title,Status,Priority,Type,Owner,Created,Updated,Closed\n';
|
|
144
|
+
for (const task of tasks) {
|
|
145
|
+
const row = [
|
|
146
|
+
task.id,
|
|
147
|
+
`"${task.title.replace(/"/g, '""')}"`,
|
|
148
|
+
task.status,
|
|
149
|
+
task.priority || '',
|
|
150
|
+
task.issue_type || '',
|
|
151
|
+
task.owner || '',
|
|
152
|
+
task.created_at || '',
|
|
153
|
+
task.updated_at || '',
|
|
154
|
+
task.closed_at || ''
|
|
155
|
+
];
|
|
156
|
+
csv += row.join(',') + '\n';
|
|
157
|
+
}
|
|
158
|
+
return csv;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=beads-reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-reporter.js","sourceRoot":"","sources":["../../src/utils/beads-reporter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAeH,wCAgBC;AA5BD,2DAA4G;AAS5G;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAkB,EAAE,UAAyB,EAAE;IAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAE7E,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,UAAU;YACb,OAAO,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACj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