specweave 0.17.15 → 0.18.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/CLAUDE.md +405 -2495
- package/README.md +92 -2
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +188 -36
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts +54 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js +86 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts +139 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js +389 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +26 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +249 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client.js +25 -13
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +83 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js +451 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts +43 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js +82 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts +5 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +38 -2
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts +66 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js +274 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts +56 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js +93 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +48 -3
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts +142 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js +453 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -0
- package/dist/src/core/living-docs/index.d.ts +10 -84
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +10 -164
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/spec-distributor.d.ts +106 -0
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/spec-distributor.js +823 -0
- package/dist/src/core/living-docs/spec-distributor.js.map +1 -0
- package/dist/src/core/living-docs/types.d.ts +201 -0
- package/dist/src/core/living-docs/types.d.ts.map +1 -0
- package/dist/src/core/living-docs/types.js +15 -0
- package/dist/src/core/living-docs/types.js.map +1 -0
- package/dist/src/core/logging/prompt-logger.d.ts +70 -0
- package/dist/src/core/logging/prompt-logger.d.ts.map +1 -0
- package/dist/src/core/logging/prompt-logger.js +247 -0
- package/dist/src/core/logging/prompt-logger.js.map +1 -0
- package/dist/src/core/status-line/status-line-manager.d.ts +15 -24
- package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.js +33 -70
- package/dist/src/core/status-line/status-line-manager.js.map +1 -1
- package/dist/src/core/status-line/types.d.ts +19 -31
- package/dist/src/core/status-line/types.d.ts.map +1 -1
- package/dist/src/core/status-line/types.js +5 -9
- package/dist/src/core/status-line/types.js.map +1 -1
- package/dist/src/core/sync/conflict-resolver.d.ts +66 -0
- package/dist/src/core/sync/conflict-resolver.d.ts.map +1 -0
- package/dist/src/core/sync/conflict-resolver.js +108 -0
- package/dist/src/core/sync/conflict-resolver.js.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts +77 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.js +199 -0
- package/dist/src/core/sync/enhanced-content-builder.js.map +1 -0
- package/dist/src/core/sync/label-detector.d.ts +66 -0
- package/dist/src/core/sync/label-detector.d.ts.map +1 -0
- package/dist/src/core/sync/label-detector.js +211 -0
- package/dist/src/core/sync/label-detector.js.map +1 -0
- package/dist/src/core/sync/retry-logic.d.ts +64 -0
- package/dist/src/core/sync/retry-logic.d.ts.map +1 -0
- package/dist/src/core/sync/retry-logic.js +165 -0
- package/dist/src/core/sync/retry-logic.js.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts +100 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.js +424 -0
- package/dist/src/core/sync/spec-increment-mapper.js.map +1 -0
- package/dist/src/core/sync/status-cache.d.ts +91 -0
- package/dist/src/core/sync/status-cache.d.ts.map +1 -0
- package/dist/src/core/sync/status-cache.js +140 -0
- package/dist/src/core/sync/status-cache.js.map +1 -0
- package/dist/src/core/sync/status-mapper.d.ts +69 -0
- package/dist/src/core/sync/status-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/status-mapper.js +90 -0
- package/dist/src/core/sync/status-mapper.js.map +1 -0
- package/dist/src/core/sync/status-sync-engine.d.ts +162 -0
- package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -0
- package/dist/src/core/sync/status-sync-engine.js +347 -0
- package/dist/src/core/sync/status-sync-engine.js.map +1 -0
- package/dist/src/core/sync/sync-event-logger.d.ts +99 -0
- package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -0
- package/dist/src/core/sync/sync-event-logger.js +103 -0
- package/dist/src/core/sync/sync-event-logger.js.map +1 -0
- package/dist/src/core/sync/workflow-detector.d.ts +95 -0
- package/dist/src/core/sync/workflow-detector.d.ts.map +1 -0
- package/dist/src/core/sync/workflow-detector.js +175 -0
- package/dist/src/core/sync/workflow-detector.js.map +1 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +31 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/utils/github-url.d.ts +53 -0
- package/dist/src/utils/github-url.d.ts.map +1 -0
- package/dist/src/utils/github-url.js +90 -0
- package/dist/src/utils/github-url.js.map +1 -0
- package/dist/src/utils/plugin-validator.d.ts +9 -0
- package/dist/src/utils/plugin-validator.d.ts.map +1 -1
- package/dist/src/utils/plugin-validator.js +86 -19
- package/dist/src/utils/plugin-validator.js.map +1 -1
- package/dist/src/utils/spec-parser.d.ts +145 -0
- package/dist/src/utils/spec-parser.d.ts.map +1 -0
- package/dist/src/utils/spec-parser.js +640 -0
- package/dist/src/utils/spec-parser.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/agents/pm/AGENT.md +1 -1
- package/plugins/specweave/agents/pm/templates/increment-spec.md +158 -0
- package/plugins/specweave/agents/pm/templates/living-docs-spec.md +113 -0
- package/plugins/specweave/commands/specweave-done.md +163 -0
- package/plugins/specweave/hooks/lib/update-status-line.sh +79 -111
- package/plugins/specweave/hooks/post-increment-planning.sh +107 -35
- package/plugins/specweave/lib/hooks/sync-living-docs.js +139 -34
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +234 -38
- package/plugins/specweave/skills/SKILLS-INDEX.md +4 -24
- package/plugins/specweave/skills/increment-planner/SKILL.md +94 -0
- package/plugins/specweave/skills/increment-work-router/SKILL.md +466 -0
- package/plugins/specweave/skills/plugin-validator/SKILL.md +16 -13
- package/plugins/specweave-ado/lib/ado-status-sync.js +80 -0
- package/plugins/specweave-ado/lib/ado-status-sync.ts +121 -0
- package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +205 -0
- package/plugins/specweave-github/commands/specweave-github-sync-epic.md +248 -0
- package/plugins/specweave-github/lib/duplicate-detector.js +370 -0
- package/plugins/specweave-github/lib/duplicate-detector.ts +525 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +322 -0
- package/plugins/specweave-github/lib/github-client.js +21 -10
- package/plugins/specweave-github/lib/github-client.ts +27 -16
- package/plugins/specweave-github/lib/github-epic-sync.js +489 -0
- package/plugins/specweave-github/lib/github-epic-sync.ts +690 -0
- package/plugins/specweave-github/lib/github-status-sync.js +71 -0
- package/plugins/specweave-github/lib/github-status-sync.ts +107 -0
- package/plugins/specweave-github/lib/task-sync.js +33 -2
- package/plugins/specweave-github/lib/task-sync.ts +44 -2
- package/plugins/specweave-jira/commands/specweave-jira-sync-epic.md +267 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.ts.disabled +222 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.js +304 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.ts +459 -0
- package/plugins/specweave-jira/lib/jira-status-sync.js +79 -0
- package/plugins/specweave-jira/lib/jira-status-sync.ts +139 -0
- package/src/templates/AGENTS.md.template +88 -1
- package/src/templates/CLAUDE.md.template +49 -0
- package/plugins/specweave/skills/increment-quality-judge/SKILL.md +0 -524
- package/plugins/specweave/skills/plugin-installer/SKILL.md +0 -353
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Status Line Manager
|
|
2
|
+
* Status Line Manager (Simplified)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Simple, reliable status line rendering.
|
|
5
|
+
* Shows: [increment-name] ████░░░░ X/Y tasks (Z open)
|
|
6
6
|
*
|
|
7
7
|
* Architecture:
|
|
8
|
-
* - Hook
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
8
|
+
* - Hook updates cache with current increment + open count
|
|
9
|
+
* - Manager reads cache and formats output
|
|
10
|
+
* - Simple age-based validation (no complex mtime checks)
|
|
11
11
|
*/
|
|
12
12
|
import { StatusLineCache, StatusLineConfig } from './types.js';
|
|
13
13
|
export declare class StatusLineManager {
|
|
@@ -16,38 +16,29 @@ export declare class StatusLineManager {
|
|
|
16
16
|
private config;
|
|
17
17
|
constructor(rootDir?: string, config?: Partial<StatusLineConfig>);
|
|
18
18
|
/**
|
|
19
|
-
* Render status line
|
|
19
|
+
* Render status line
|
|
20
20
|
*
|
|
21
|
-
* Returns formatted
|
|
21
|
+
* Returns formatted string or null if no active increment.
|
|
22
22
|
*/
|
|
23
23
|
render(): string | null;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Read cache from disk
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
* - Cache file missing
|
|
29
|
-
* - Cache too old (>maxCacheAge)
|
|
30
|
-
* - tasks.md modified since cache update
|
|
27
|
+
* Simple read with basic validation.
|
|
31
28
|
*/
|
|
32
|
-
private
|
|
29
|
+
private readCache;
|
|
33
30
|
/**
|
|
34
|
-
*
|
|
31
|
+
* Format status line
|
|
35
32
|
*
|
|
36
|
-
*
|
|
37
|
-
* 1. Age check (ultra-fast, no I/O)
|
|
38
|
-
* 2. mtime check (fast, single stat() call)
|
|
39
|
-
*/
|
|
40
|
-
private isCacheFresh;
|
|
41
|
-
/**
|
|
42
|
-
* Format status line from cache (0.1ms)
|
|
33
|
+
* Format: [increment-name] ████░░░░ X/Y tasks (Z open)
|
|
43
34
|
*/
|
|
44
35
|
private formatStatusLine;
|
|
45
36
|
/**
|
|
46
|
-
* Render ASCII progress bar
|
|
37
|
+
* Render ASCII progress bar
|
|
47
38
|
*/
|
|
48
39
|
private renderProgressBar;
|
|
49
40
|
/**
|
|
50
|
-
* Truncate string with ellipsis
|
|
41
|
+
* Truncate string with ellipsis
|
|
51
42
|
*/
|
|
52
43
|
private truncate;
|
|
53
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-line-manager.d.ts","sourceRoot":"","sources":["../../../../src/core/status-line/status-line-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,eAAe,EACf,gBAAgB,EAEjB,MAAM,YAAY,CAAC;AAEpB,qBAAa,iBAAiB;IAK1B,OAAO,CAAC,OAAO;IAJjB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAmB;gBAGvB,OAAO,GAAE,MAAsB,EACvC,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAMxC;;;;OAIG;IACI,MAAM,IAAI,MAAM,GAAG,IAAI;IAa9B
|
|
1
|
+
{"version":3,"file":"status-line-manager.d.ts","sourceRoot":"","sources":["../../../../src/core/status-line/status-line-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,eAAe,EACf,gBAAgB,EAEjB,MAAM,YAAY,CAAC;AAEpB,qBAAa,iBAAiB;IAK1B,OAAO,CAAC,OAAO;IAJjB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAmB;gBAGvB,OAAO,GAAE,MAAsB,EACvC,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAMxC;;;;OAIG;IACI,MAAM,IAAI,MAAM,GAAG,IAAI;IAa9B;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAsBjB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAOhB;;OAEG;IACI,YAAY,IAAI,eAAe,GAAG,IAAI;IAY7C;;OAEG;IACI,UAAU,IAAI,IAAI;CAS1B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Status Line Manager
|
|
2
|
+
* Status Line Manager (Simplified)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Simple, reliable status line rendering.
|
|
5
|
+
* Shows: [increment-name] ████░░░░ X/Y tasks (Z open)
|
|
6
6
|
*
|
|
7
7
|
* Architecture:
|
|
8
|
-
* - Hook
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
8
|
+
* - Hook updates cache with current increment + open count
|
|
9
|
+
* - Manager reads cache and formats output
|
|
10
|
+
* - Simple age-based validation (no complex mtime checks)
|
|
11
11
|
*/
|
|
12
12
|
import * as fs from 'fs';
|
|
13
13
|
import * as path from 'path';
|
|
@@ -19,105 +19,68 @@ export class StatusLineManager {
|
|
|
19
19
|
this.config = { ...DEFAULT_STATUS_LINE_CONFIG, ...config };
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Render status line
|
|
22
|
+
* Render status line
|
|
23
23
|
*
|
|
24
|
-
* Returns formatted
|
|
24
|
+
* Returns formatted string or null if no active increment.
|
|
25
25
|
*/
|
|
26
26
|
render() {
|
|
27
27
|
if (!this.config.enabled) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
const cache = this.
|
|
31
|
-
if (!cache) {
|
|
32
|
-
return
|
|
30
|
+
const cache = this.readCache();
|
|
31
|
+
if (!cache || !cache.current) {
|
|
32
|
+
return 'No active increment';
|
|
33
33
|
}
|
|
34
34
|
return this.formatStatusLine(cache);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Read cache from disk
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
* - Cache file missing
|
|
41
|
-
* - Cache too old (>maxCacheAge)
|
|
42
|
-
* - tasks.md modified since cache update
|
|
39
|
+
* Simple read with basic validation.
|
|
43
40
|
*/
|
|
44
|
-
|
|
41
|
+
readCache() {
|
|
45
42
|
try {
|
|
46
|
-
// Step 1: Read cache file (0.3ms)
|
|
47
43
|
if (!fs.existsSync(this.cacheFile)) {
|
|
48
44
|
return null;
|
|
49
45
|
}
|
|
50
46
|
const content = fs.readFileSync(this.cacheFile, 'utf8');
|
|
51
47
|
const cache = JSON.parse(content);
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (!this.isCacheFresh(cache)) {
|
|
58
|
-
return null;
|
|
48
|
+
// Simple age check (warn if stale but still show)
|
|
49
|
+
const age = Date.now() - new Date(cache.lastUpdate).getTime();
|
|
50
|
+
if (age > this.config.maxCacheAge) {
|
|
51
|
+
// Stale but we still show it (better than nothing)
|
|
52
|
+
// Hook will update it soon
|
|
59
53
|
}
|
|
60
54
|
return cache;
|
|
61
55
|
}
|
|
62
|
-
catch
|
|
63
|
-
// Cache read/parse error = treat as cache miss
|
|
56
|
+
catch {
|
|
64
57
|
return null;
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
60
|
/**
|
|
68
|
-
*
|
|
61
|
+
* Format status line
|
|
69
62
|
*
|
|
70
|
-
*
|
|
71
|
-
* 1. Age check (ultra-fast, no I/O)
|
|
72
|
-
* 2. mtime check (fast, single stat() call)
|
|
73
|
-
*/
|
|
74
|
-
isCacheFresh(cache) {
|
|
75
|
-
// Check 1: Recent update? (no I/O, ultra-fast)
|
|
76
|
-
const age = Date.now() - new Date(cache.lastUpdate).getTime();
|
|
77
|
-
if (age < this.config.maxCacheAge) {
|
|
78
|
-
return true; // Cache is fresh (<5s old)
|
|
79
|
-
}
|
|
80
|
-
// Check 2: Has tasks.md changed? (single stat() call)
|
|
81
|
-
try {
|
|
82
|
-
const tasksFile = path.join(this.rootDir, '.specweave/increments', cache.incrementId, 'tasks.md');
|
|
83
|
-
const stats = fs.statSync(tasksFile);
|
|
84
|
-
const currentMtime = Math.floor(stats.mtimeMs / 1000);
|
|
85
|
-
return currentMtime === cache.lastModified;
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
// File missing or stat() failed = invalidate cache
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Format status line from cache (0.1ms)
|
|
63
|
+
* Format: [increment-name] ████░░░░ X/Y tasks (Z open)
|
|
94
64
|
*/
|
|
95
65
|
formatStatusLine(cache) {
|
|
66
|
+
const current = cache.current;
|
|
96
67
|
const parts = [];
|
|
97
68
|
// Increment name (truncated)
|
|
98
|
-
const name = this.truncate(
|
|
69
|
+
const name = this.truncate(current.name, this.config.maxNameLength);
|
|
99
70
|
parts.push(`[${name}]`);
|
|
100
71
|
// Progress bar
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
//
|
|
106
|
-
if (
|
|
107
|
-
parts.push(
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
parts.push(`${cache.completedTasks}/${cache.totalTasks}`);
|
|
111
|
-
}
|
|
112
|
-
// Current task
|
|
113
|
-
if (this.config.showCurrentTask && cache.currentTask) {
|
|
114
|
-
const taskTitle = this.truncate(cache.currentTask.title, this.config.maxTaskTitleLength);
|
|
115
|
-
parts.push(`• ${cache.currentTask.id}: ${taskTitle}`);
|
|
72
|
+
const bar = this.renderProgressBar(current.completed, current.total);
|
|
73
|
+
parts.push(bar);
|
|
74
|
+
// Tasks count
|
|
75
|
+
parts.push(`${current.completed}/${current.total}`);
|
|
76
|
+
// Open count (if more than 1)
|
|
77
|
+
if (cache.openCount > 1) {
|
|
78
|
+
parts.push(`(${cache.openCount} open)`);
|
|
116
79
|
}
|
|
117
80
|
return parts.join(' ');
|
|
118
81
|
}
|
|
119
82
|
/**
|
|
120
|
-
* Render ASCII progress bar
|
|
83
|
+
* Render ASCII progress bar
|
|
121
84
|
*/
|
|
122
85
|
renderProgressBar(completed, total) {
|
|
123
86
|
if (total === 0) {
|
|
@@ -129,7 +92,7 @@ export class StatusLineManager {
|
|
|
129
92
|
return '█'.repeat(filled) + '░'.repeat(empty);
|
|
130
93
|
}
|
|
131
94
|
/**
|
|
132
|
-
* Truncate string with ellipsis
|
|
95
|
+
* Truncate string with ellipsis
|
|
133
96
|
*/
|
|
134
97
|
truncate(str, maxLength) {
|
|
135
98
|
if (str.length <= maxLength) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-line-manager.js","sourceRoot":"","sources":["../../../../src/core/status-line/status-line-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAGL,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAEpB,MAAM,OAAO,iBAAiB;IAI5B,YACU,UAAkB,OAAO,CAAC,GAAG,EAAE,EACvC,SAAoC,EAAE;QAD9B,YAAO,GAAP,OAAO,CAAwB;QAGvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,0BAA0B,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACI,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"status-line-manager.js","sourceRoot":"","sources":["../../../../src/core/status-line/status-line-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAGL,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAEpB,MAAM,OAAO,iBAAiB;IAI5B,YACU,UAAkB,OAAO,CAAC,GAAG,EAAE,EACvC,SAAoC,EAAE;QAD9B,YAAO,GAAP,OAAO,CAAwB;QAGvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,0BAA0B,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACI,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO,qBAAqB,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACK,SAAS;QACf,IAAI,CAAC;YACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACxD,MAAM,KAAK,GAA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,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB;QAClB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,50 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Status Line Types
|
|
2
|
+
* Status Line Types (Simplified)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Ultra-simple status line with cached progress.
|
|
5
|
+
* Shows: [increment-name] ████░░░░ X/Y tasks (Z open)
|
|
6
6
|
*/
|
|
7
7
|
export interface StatusLineCache {
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/** Total number of tasks in tasks.md */
|
|
13
|
-
totalTasks: number;
|
|
14
|
-
/** Number of completed tasks ([x]) */
|
|
15
|
-
completedTasks: number;
|
|
16
|
-
/** Completion percentage (0-100) */
|
|
17
|
-
percentage: number;
|
|
18
|
-
/** Current task being worked on */
|
|
19
|
-
currentTask: TaskInfo | null;
|
|
8
|
+
/** Current active/in-progress increment (null if none) */
|
|
9
|
+
current: CurrentIncrement | null;
|
|
10
|
+
/** Total number of open increments (active/in-progress/planning) */
|
|
11
|
+
openCount: number;
|
|
20
12
|
/** ISO timestamp of last cache update */
|
|
21
13
|
lastUpdate: string;
|
|
22
|
-
/** Unix timestamp of tasks.md mtime (for invalidation) */
|
|
23
|
-
lastModified: number;
|
|
24
14
|
}
|
|
25
|
-
export interface
|
|
26
|
-
/**
|
|
15
|
+
export interface CurrentIncrement {
|
|
16
|
+
/** Increment ID (e.g., "0031-external-tool-status-sync") */
|
|
27
17
|
id: string;
|
|
28
|
-
/**
|
|
29
|
-
|
|
18
|
+
/** Short name (e.g., "external-tool-status-sync") */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Number of completed tasks */
|
|
21
|
+
completed: number;
|
|
22
|
+
/** Total number of tasks */
|
|
23
|
+
total: number;
|
|
24
|
+
/** Completion percentage (0-100) */
|
|
25
|
+
percentage: number;
|
|
30
26
|
}
|
|
31
27
|
export interface StatusLineConfig {
|
|
32
28
|
/** Enable status line rendering */
|
|
33
29
|
enabled: boolean;
|
|
34
|
-
/** Maximum age of cache before
|
|
30
|
+
/** Maximum age of cache before showing stale warning (ms) */
|
|
35
31
|
maxCacheAge: number;
|
|
36
32
|
/** Width of progress bar (characters) */
|
|
37
33
|
progressBarWidth: number;
|
|
38
34
|
/** Maximum length for increment name */
|
|
39
|
-
|
|
40
|
-
/** Maximum length for task title */
|
|
41
|
-
maxTaskTitleLength: number;
|
|
42
|
-
/** Show progress bar */
|
|
43
|
-
showProgressBar: boolean;
|
|
44
|
-
/** Show percentage */
|
|
45
|
-
showPercentage: boolean;
|
|
46
|
-
/** Show current task */
|
|
47
|
-
showCurrentTask: boolean;
|
|
35
|
+
maxNameLength: number;
|
|
48
36
|
}
|
|
49
37
|
export declare const DEFAULT_STATUS_LINE_CONFIG: StatusLineConfig;
|
|
50
38
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/status-line/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/status-line/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAEjC,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAElB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IAEX,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAElB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IAEd,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IAEjB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IAEpB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,EAAE,gBAKxC,CAAC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Status Line Types
|
|
2
|
+
* Status Line Types (Simplified)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Ultra-simple status line with cached progress.
|
|
5
|
+
* Shows: [increment-name] ████░░░░ X/Y tasks (Z open)
|
|
6
6
|
*/
|
|
7
7
|
export const DEFAULT_STATUS_LINE_CONFIG = {
|
|
8
8
|
enabled: true,
|
|
9
|
-
maxCacheAge:
|
|
9
|
+
maxCacheAge: 30000, // 30 seconds (much longer, simpler)
|
|
10
10
|
progressBarWidth: 8,
|
|
11
|
-
|
|
12
|
-
maxTaskTitleLength: 30,
|
|
13
|
-
showProgressBar: true,
|
|
14
|
-
showPercentage: true,
|
|
15
|
-
showCurrentTask: true,
|
|
11
|
+
maxNameLength: 30,
|
|
16
12
|
};
|
|
17
13
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/core/status-line/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/core/status-line/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4CH,MAAM,CAAC,MAAM,0BAA0B,GAAqB;IAC1D,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,KAAK,EAAE,oCAAoC;IACxD,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,EAAE;CAClB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict Resolver
|
|
3
|
+
*
|
|
4
|
+
* Detects and resolves status conflicts between SpecWeave increments
|
|
5
|
+
* and external tools (GitHub, JIRA, Azure DevOps).
|
|
6
|
+
*
|
|
7
|
+
* Supports four resolution strategies:
|
|
8
|
+
* - prompt: Requires user interaction (UI)
|
|
9
|
+
* - last-write-wins: Uses most recent timestamp
|
|
10
|
+
* - specweave-wins: Always uses local SpecWeave status
|
|
11
|
+
* - external-wins: Always uses external tool status
|
|
12
|
+
*/
|
|
13
|
+
export type ConflictResolutionStrategy = 'prompt' | 'last-write-wins' | 'specweave-wins' | 'external-wins';
|
|
14
|
+
export interface StatusConflict {
|
|
15
|
+
incrementId: string;
|
|
16
|
+
tool: string;
|
|
17
|
+
localStatus: string;
|
|
18
|
+
remoteStatus: string;
|
|
19
|
+
localTimestamp: string;
|
|
20
|
+
remoteTimestamp: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ConflictResolution {
|
|
23
|
+
action: 'use-local' | 'use-remote';
|
|
24
|
+
resolvedStatus: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ConflictDetectionInput {
|
|
27
|
+
incrementId: string;
|
|
28
|
+
local: string;
|
|
29
|
+
remote: string;
|
|
30
|
+
tool: string;
|
|
31
|
+
localTimestamp: string;
|
|
32
|
+
remoteTimestamp: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class ConflictResolver {
|
|
35
|
+
/**
|
|
36
|
+
* Detect status conflicts between local and remote
|
|
37
|
+
*
|
|
38
|
+
* @param input - Detection input with local/remote statuses and timestamps
|
|
39
|
+
* @returns StatusConflict if conflict exists, null if statuses match
|
|
40
|
+
*/
|
|
41
|
+
detect(input: ConflictDetectionInput): Promise<StatusConflict | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Resolve status conflict using specified strategy
|
|
44
|
+
*
|
|
45
|
+
* @param conflict - The status conflict to resolve
|
|
46
|
+
* @param strategy - Resolution strategy to use
|
|
47
|
+
* @returns Resolution with action and resolved status
|
|
48
|
+
* @throws Error if strategy is unknown or requires user interaction
|
|
49
|
+
*/
|
|
50
|
+
resolve(conflict: StatusConflict, strategy: ConflictResolutionStrategy): Promise<ConflictResolution>;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve conflict by comparing timestamps (last-write-wins)
|
|
53
|
+
*
|
|
54
|
+
* @param conflict - The status conflict to resolve
|
|
55
|
+
* @returns Resolution based on most recent timestamp
|
|
56
|
+
*/
|
|
57
|
+
private resolveByTimestamp;
|
|
58
|
+
/**
|
|
59
|
+
* Format conflict details for display to user
|
|
60
|
+
*
|
|
61
|
+
* @param conflict - The status conflict to format
|
|
62
|
+
* @returns Human-readable conflict message
|
|
63
|
+
*/
|
|
64
|
+
formatConflictMessage(conflict: StatusConflict): string;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=conflict-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-resolver.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/conflict-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,0BAA0B,GAClC,QAAQ,GACR,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,GAAG,YAAY,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,gBAAgB;IAC3B;;;;;OAKG;IACU,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAiBlF;;;;;;;OAOG;IACU,OAAO,CAClB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,0BAA0B,GACnC,OAAO,CAAC,kBAAkB,CAAC;IAyB9B;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAkB1B;;;;;OAKG;IACI,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;CAiB/D"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict Resolver
|
|
3
|
+
*
|
|
4
|
+
* Detects and resolves status conflicts between SpecWeave increments
|
|
5
|
+
* and external tools (GitHub, JIRA, Azure DevOps).
|
|
6
|
+
*
|
|
7
|
+
* Supports four resolution strategies:
|
|
8
|
+
* - prompt: Requires user interaction (UI)
|
|
9
|
+
* - last-write-wins: Uses most recent timestamp
|
|
10
|
+
* - specweave-wins: Always uses local SpecWeave status
|
|
11
|
+
* - external-wins: Always uses external tool status
|
|
12
|
+
*/
|
|
13
|
+
export class ConflictResolver {
|
|
14
|
+
/**
|
|
15
|
+
* Detect status conflicts between local and remote
|
|
16
|
+
*
|
|
17
|
+
* @param input - Detection input with local/remote statuses and timestamps
|
|
18
|
+
* @returns StatusConflict if conflict exists, null if statuses match
|
|
19
|
+
*/
|
|
20
|
+
async detect(input) {
|
|
21
|
+
// No conflict if statuses match
|
|
22
|
+
if (input.local === input.remote) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
// Conflict detected - return conflict object
|
|
26
|
+
return {
|
|
27
|
+
incrementId: input.incrementId,
|
|
28
|
+
tool: input.tool,
|
|
29
|
+
localStatus: input.local,
|
|
30
|
+
remoteStatus: input.remote,
|
|
31
|
+
localTimestamp: input.localTimestamp,
|
|
32
|
+
remoteTimestamp: input.remoteTimestamp
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve status conflict using specified strategy
|
|
37
|
+
*
|
|
38
|
+
* @param conflict - The status conflict to resolve
|
|
39
|
+
* @param strategy - Resolution strategy to use
|
|
40
|
+
* @returns Resolution with action and resolved status
|
|
41
|
+
* @throws Error if strategy is unknown or requires user interaction
|
|
42
|
+
*/
|
|
43
|
+
async resolve(conflict, strategy) {
|
|
44
|
+
switch (strategy) {
|
|
45
|
+
case 'specweave-wins':
|
|
46
|
+
return {
|
|
47
|
+
action: 'use-local',
|
|
48
|
+
resolvedStatus: conflict.localStatus
|
|
49
|
+
};
|
|
50
|
+
case 'external-wins':
|
|
51
|
+
return {
|
|
52
|
+
action: 'use-remote',
|
|
53
|
+
resolvedStatus: conflict.remoteStatus
|
|
54
|
+
};
|
|
55
|
+
case 'last-write-wins':
|
|
56
|
+
return this.resolveByTimestamp(conflict);
|
|
57
|
+
case 'prompt':
|
|
58
|
+
throw new Error('Prompt strategy requires user interaction');
|
|
59
|
+
default:
|
|
60
|
+
throw new Error(`Unknown conflict resolution strategy: ${strategy}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve conflict by comparing timestamps (last-write-wins)
|
|
65
|
+
*
|
|
66
|
+
* @param conflict - The status conflict to resolve
|
|
67
|
+
* @returns Resolution based on most recent timestamp
|
|
68
|
+
*/
|
|
69
|
+
resolveByTimestamp(conflict) {
|
|
70
|
+
const localTime = new Date(conflict.localTimestamp).getTime();
|
|
71
|
+
const remoteTime = new Date(conflict.remoteTimestamp).getTime();
|
|
72
|
+
// If timestamps equal, tie-break favors local (SpecWeave is source of truth)
|
|
73
|
+
if (localTime >= remoteTime) {
|
|
74
|
+
return {
|
|
75
|
+
action: 'use-local',
|
|
76
|
+
resolvedStatus: conflict.localStatus
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
action: 'use-remote',
|
|
81
|
+
resolvedStatus: conflict.remoteStatus
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Format conflict details for display to user
|
|
86
|
+
*
|
|
87
|
+
* @param conflict - The status conflict to format
|
|
88
|
+
* @returns Human-readable conflict message
|
|
89
|
+
*/
|
|
90
|
+
formatConflictMessage(conflict) {
|
|
91
|
+
return `
|
|
92
|
+
Status Conflict Detected for Increment ${conflict.incrementId}
|
|
93
|
+
|
|
94
|
+
Tool: ${conflict.tool}
|
|
95
|
+
|
|
96
|
+
Local (SpecWeave):
|
|
97
|
+
Status: ${conflict.localStatus}
|
|
98
|
+
Last Updated: ${conflict.localTimestamp}
|
|
99
|
+
|
|
100
|
+
Remote (${conflict.tool}):
|
|
101
|
+
Status: ${conflict.remoteStatus}
|
|
102
|
+
Last Updated: ${conflict.remoteTimestamp}
|
|
103
|
+
|
|
104
|
+
Conflict: Local and remote statuses differ.
|
|
105
|
+
`.trim();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=conflict-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-resolver.js","sourceRoot":"","sources":["../../../../src/core/sync/conflict-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA+BH,MAAM,OAAO,gBAAgB;IAC3B;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,KAA6B;QAC/C,gCAAgC;QAChC,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,6CAA6C;QAC7C,OAAO;YACL,WAAW,EAAE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,CAAC,YAAY;SACtC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,qBAAqB,CAAC,QAAwB;QACnD,OAAO;yCAC8B,QAAQ,CAAC,WAAW;;QAErD,QAAQ,CAAC,IAAI;;;YAGT,QAAQ,CAAC,WAAW;kBACd,QAAQ,CAAC,cAAc;;UAE/B,QAAQ,CAAC,IAAI;YACX,QAAQ,CAAC,YAAY;kBACf,QAAQ,CAAC,eAAe;;;KAGrC,CAAC,IAAI,EAAE,CAAC;IACX,CAAC;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Content Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds rich external issue descriptions with full spec content including:
|
|
5
|
+
* - Executive summary
|
|
6
|
+
* - User stories with collapsible sections
|
|
7
|
+
* - Acceptance criteria
|
|
8
|
+
* - Task links with GitHub issue numbers
|
|
9
|
+
* - Architecture references
|
|
10
|
+
* - Source links
|
|
11
|
+
*/
|
|
12
|
+
import { SpecContent, SpecUserStory } from '../spec-content-sync.js';
|
|
13
|
+
export interface TaskMapping {
|
|
14
|
+
incrementId: string;
|
|
15
|
+
tasks: Task[];
|
|
16
|
+
tasksUrl: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Task {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
userStories: string[];
|
|
22
|
+
githubIssue?: number;
|
|
23
|
+
jiraIssue?: string;
|
|
24
|
+
adoWorkItem?: number;
|
|
25
|
+
completed?: boolean;
|
|
26
|
+
status?: 'pending' | 'in-progress' | 'completed';
|
|
27
|
+
}
|
|
28
|
+
export interface ArchitectureDoc {
|
|
29
|
+
type: 'adr' | 'hld' | 'diagram';
|
|
30
|
+
path: string;
|
|
31
|
+
title: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SourceLinks {
|
|
34
|
+
spec?: string;
|
|
35
|
+
plan?: string;
|
|
36
|
+
tasks?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface EnhancedSpecContent extends SpecContent {
|
|
39
|
+
summary?: string;
|
|
40
|
+
taskMapping?: TaskMapping;
|
|
41
|
+
architectureDocs?: ArchitectureDoc[];
|
|
42
|
+
sourceLinks?: SourceLinks;
|
|
43
|
+
}
|
|
44
|
+
export declare class EnhancedContentBuilder {
|
|
45
|
+
/**
|
|
46
|
+
* Build complete external issue description with all spec content
|
|
47
|
+
*/
|
|
48
|
+
buildExternalDescription(spec: EnhancedSpecContent): string;
|
|
49
|
+
/**
|
|
50
|
+
* Build summary section with executive overview
|
|
51
|
+
*/
|
|
52
|
+
buildSummarySection(spec: EnhancedSpecContent): string;
|
|
53
|
+
/**
|
|
54
|
+
* Build user stories section with collapsible GitHub sections
|
|
55
|
+
*/
|
|
56
|
+
buildUserStoriesSection(userStories: SpecUserStory[]): string;
|
|
57
|
+
/**
|
|
58
|
+
* Build tasks section with checkboxes (GitHub/Jira/ADO compatible)
|
|
59
|
+
*
|
|
60
|
+
* NEW: Shows tasks as checkboxes with completion status
|
|
61
|
+
*/
|
|
62
|
+
buildTasksSection(taskMapping: TaskMapping, options?: {
|
|
63
|
+
showCheckboxes?: boolean;
|
|
64
|
+
showProgressBar?: boolean;
|
|
65
|
+
showCompletionStatus?: boolean;
|
|
66
|
+
provider?: 'github' | 'jira' | 'ado';
|
|
67
|
+
}): string;
|
|
68
|
+
/**
|
|
69
|
+
* Build architecture references section
|
|
70
|
+
*/
|
|
71
|
+
buildArchitectureSection(architectureDocs: ArchitectureDoc[]): string;
|
|
72
|
+
/**
|
|
73
|
+
* Build source links section
|
|
74
|
+
*/
|
|
75
|
+
buildSourceLinksSection(sourceLinks: SourceLinks): string;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=enhanced-content-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhanced-content-builder.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/enhanced-content-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAU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