@paths.design/caws-cli 9.0.0 → 9.1.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/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/parallel.d.ts +7 -0
- package/dist/commands/parallel.d.ts.map +1 -0
- package/dist/commands/session.d.ts +7 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/specs.d.ts +6 -0
- package/dist/commands/specs.d.ts.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/tutorial.js +0 -2
- package/dist/commands/waivers.d.ts.map +1 -1
- package/dist/constants/spec-types.d.ts +52 -0
- package/dist/constants/spec-types.d.ts.map +1 -1
- package/dist/parallel/parallel-manager.d.ts +67 -0
- package/dist/parallel/parallel-manager.d.ts.map +1 -0
- package/dist/parallel/parallel-manager.js +1 -4
- package/dist/scaffold/claude-hooks.d.ts.map +1 -1
- package/dist/scaffold/claude-hooks.js +24 -1
- package/dist/scaffold/git-hooks.d.ts.map +1 -1
- package/dist/scaffold/git-hooks.js +49 -59
- package/dist/scaffold/index.d.ts.map +1 -1
- package/dist/session/session-manager.d.ts +94 -0
- package/dist/session/session-manager.d.ts.map +1 -0
- package/dist/templates/.claude/hooks/session-log.sh +528 -0
- package/dist/utils/gitignore-updater.d.ts +1 -1
- package/dist/utils/gitignore-updater.d.ts.map +1 -1
- package/dist/utils/gitignore-updater.js +3 -0
- package/dist/utils/ide-detection.d.ts +89 -0
- package/dist/utils/ide-detection.d.ts.map +1 -0
- package/dist/validation/spec-validation.d.ts.map +1 -1
- package/dist/worktree/worktree-manager.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/.claude/hooks/session-log.sh +528 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.js"],"names":[],"mappings":"AA8BA;;GAEG;AACH,2EAgrBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../src/commands/parallel.js"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,4CAHW,MAAM,gCAuBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/commands/session.js"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,2CAHW,MAAM,gCA2BhB"}
|
package/dist/commands/specs.d.ts
CHANGED
|
@@ -46,6 +46,12 @@ export function updateSpec(id: string, updates?: any): Promise<boolean>;
|
|
|
46
46
|
* @returns {Promise<boolean>} Success status
|
|
47
47
|
*/
|
|
48
48
|
export function deleteSpec(id: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Close a spec (sets status to 'closed', removing scope enforcement).
|
|
51
|
+
* @param {string} id - Spec identifier
|
|
52
|
+
* @returns {Promise<boolean>} Success status
|
|
53
|
+
*/
|
|
54
|
+
export function closeSpec(id: string): Promise<boolean>;
|
|
49
55
|
/**
|
|
50
56
|
* Display specs in a formatted table
|
|
51
57
|
* @param {Array} specs - Array of spec objects
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/commands/specs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/commands/specs.js"],"names":[],"mappings":"AAq2BA;;;;GAIG;AACH,qCAHW,MAAM,+BAiNhB;AAjiCD;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAqB3B;AAED;;;;GAIG;AACH,kDAFa,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;GAGG;AACH,iCAFa,OAAO,OAAO,CAmC1B;AAED;;;;;GAKG;AACH,+BAJW,MAAM,kBAEJ,OAAO,KAAQ,CAkO3B;AAED;;;;GAIG;AACH,6BAHW,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAiBhC;AAED;;;;;GAKG;AACH,+BAJW,MAAM,kBAEJ,OAAO,CAAC,OAAO,CAAC,CAuC5B;AAiID;;;;GAIG;AACH,+BAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAmB5B;AAED;;;;GAIG;AACH,8BAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAmB5B;AAED;;;GAGG;AACH,sDA2CC;AAED;;;GAGG;AACH,oDAoCC;AAuKD;;;GAGG;AACH,yCAFa,OAAO,CAAC,MAAM,CAAC,CAqC3B;AAl1BD;;GAEG;AACH,wBAAkB,aAAa,CAAC;AAChC,6BAAuB,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.js"],"names":[],"mappings":"AAo3BA;;;GAGG;AACH,2DA+IC;AAz/BD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAahC;AAgBD;;;GAGG;AACH,iCAFa,OAAO,KAAQ,CAgC3B;AAED;;;GAGG;AACH,uCAFa,OAAO,KAAQ,CA+B3B;AAED;;;GAGG;AACH,oCAFa,OAAO,KAAQ,CA0D3B;AAED;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAO3B;AA8HD;;;GAGG;AACH,+CAgGC;AAED;;;;;GAKG;AACH,4DAHW,MAAM,GACJ,MAAM,EAAE,CAoCpB"}
|
|
@@ -361,8 +361,6 @@ function displayTutorialStep(step, stepNumber, totalSteps) {
|
|
|
361
361
|
line.startsWith('')
|
|
362
362
|
) {
|
|
363
363
|
console.log(chalk.gray(line));
|
|
364
|
-
} else if (line.startsWith('') || line.startsWith('') || line.startsWith('')) {
|
|
365
|
-
console.log(line);
|
|
366
364
|
} else if (line.includes('`')) {
|
|
367
365
|
console.log(chalk.cyan(line));
|
|
368
366
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waivers.d.ts","sourceRoot":"","sources":["../../src/commands/waivers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"waivers.d.ts","sourceRoot":"","sources":["../../src/commands/waivers.js"],"names":[],"mappings":"AAsCA;;;;;GAKG;AACH,4CAHW,MAAM,YACN,MAAM,gBAyChB"}
|
|
@@ -37,5 +37,57 @@ export namespace SPEC_TYPES {
|
|
|
37
37
|
export { description_4 as description };
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
export namespace SPEC_STATUSES {
|
|
41
|
+
namespace draft {
|
|
42
|
+
export let label: string;
|
|
43
|
+
let color_5: chalk.Chalk;
|
|
44
|
+
export { color_5 as color };
|
|
45
|
+
export let terminal: boolean;
|
|
46
|
+
}
|
|
47
|
+
namespace active {
|
|
48
|
+
let label_1: string;
|
|
49
|
+
export { label_1 as label };
|
|
50
|
+
let color_6: chalk.Chalk;
|
|
51
|
+
export { color_6 as color };
|
|
52
|
+
let terminal_1: boolean;
|
|
53
|
+
export { terminal_1 as terminal };
|
|
54
|
+
}
|
|
55
|
+
namespace in_progress {
|
|
56
|
+
let label_2: string;
|
|
57
|
+
export { label_2 as label };
|
|
58
|
+
let color_7: chalk.Chalk;
|
|
59
|
+
export { color_7 as color };
|
|
60
|
+
let terminal_2: boolean;
|
|
61
|
+
export { terminal_2 as terminal };
|
|
62
|
+
}
|
|
63
|
+
namespace completed {
|
|
64
|
+
let label_3: string;
|
|
65
|
+
export { label_3 as label };
|
|
66
|
+
let color_8: chalk.Chalk;
|
|
67
|
+
export { color_8 as color };
|
|
68
|
+
let terminal_3: boolean;
|
|
69
|
+
export { terminal_3 as terminal };
|
|
70
|
+
}
|
|
71
|
+
namespace closed {
|
|
72
|
+
let label_4: string;
|
|
73
|
+
export { label_4 as label };
|
|
74
|
+
let color_9: chalk.Chalk;
|
|
75
|
+
export { color_9 as color };
|
|
76
|
+
let terminal_4: boolean;
|
|
77
|
+
export { terminal_4 as terminal };
|
|
78
|
+
}
|
|
79
|
+
namespace archived {
|
|
80
|
+
let label_5: string;
|
|
81
|
+
export { label_5 as label };
|
|
82
|
+
let color_10: chalk.Chalk;
|
|
83
|
+
export { color_10 as color };
|
|
84
|
+
let terminal_5: boolean;
|
|
85
|
+
export { terminal_5 as terminal };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Status keys that indicate a spec is done (scope no longer enforced).
|
|
90
|
+
*/
|
|
91
|
+
export const TERMINAL_STATUSES: string[];
|
|
40
92
|
import chalk = require("chalk");
|
|
41
93
|
//# sourceMappingURL=spec-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-types.d.ts","sourceRoot":"","sources":["../../src/constants/spec-types.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"spec-types.d.ts","sourceRoot":"","sources":["../../src/constants/spec-types.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA;;GAEG;AACH,yCAEmB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load and validate a parallel plan YAML file
|
|
3
|
+
* @param {string} filePath - Path to plan YAML file
|
|
4
|
+
* @returns {Object} Parsed and validated plan
|
|
5
|
+
*/
|
|
6
|
+
export function loadPlan(filePath: string): any;
|
|
7
|
+
/**
|
|
8
|
+
* Set up parallel worktrees from a plan
|
|
9
|
+
* @param {Object} plan - Validated plan from loadPlan
|
|
10
|
+
* @returns {Object[]} Array of created worktree entries
|
|
11
|
+
*/
|
|
12
|
+
export function setupParallel(plan: any): any[];
|
|
13
|
+
/**
|
|
14
|
+
* Get status of all parallel worktrees
|
|
15
|
+
* @returns {Object|null} Parallel status or null if no active run
|
|
16
|
+
*/
|
|
17
|
+
export function getParallelStatus(): any | null;
|
|
18
|
+
/**
|
|
19
|
+
* Merge all parallel branches back to base
|
|
20
|
+
* @param {Object} options - Merge options
|
|
21
|
+
* @param {string} [options.strategy] - Override merge strategy
|
|
22
|
+
* @param {boolean} [options.dryRun] - Preview without executing
|
|
23
|
+
* @param {boolean} [options.force] - Force merge even with conflicts
|
|
24
|
+
* @returns {Object} Merge results {merged, failed, conflicts}
|
|
25
|
+
*/
|
|
26
|
+
export function mergeParallel(options?: {
|
|
27
|
+
strategy?: string;
|
|
28
|
+
dryRun?: boolean;
|
|
29
|
+
force?: boolean;
|
|
30
|
+
}): any;
|
|
31
|
+
/**
|
|
32
|
+
* Tear down all parallel worktrees
|
|
33
|
+
* @param {Object} options - Teardown options
|
|
34
|
+
* @param {boolean} [options.deleteBranches] - Also delete branches
|
|
35
|
+
* @param {boolean} [options.force] - Force removal even if dirty
|
|
36
|
+
* @returns {Object} Teardown results {destroyed, failed}
|
|
37
|
+
*/
|
|
38
|
+
export function teardownParallel(options?: {
|
|
39
|
+
deleteBranches?: boolean;
|
|
40
|
+
force?: boolean;
|
|
41
|
+
}): any;
|
|
42
|
+
/**
|
|
43
|
+
* Detect file-level conflicts between agent branches
|
|
44
|
+
* @param {string} baseBranch - Base branch name
|
|
45
|
+
* @param {Object[]} agentStatuses - Agent status objects with branch field
|
|
46
|
+
* @returns {Object[]} Conflicts: [{file, agents: [name, name]}]
|
|
47
|
+
*/
|
|
48
|
+
export function detectFileConflicts(baseBranch: string, agentStatuses: any[]): any[];
|
|
49
|
+
/**
|
|
50
|
+
* Load the parallel registry
|
|
51
|
+
* @param {string} root - Repository root
|
|
52
|
+
* @returns {Object|null} Registry or null if not found
|
|
53
|
+
*/
|
|
54
|
+
export function loadParallelRegistry(root: string): any | null;
|
|
55
|
+
/**
|
|
56
|
+
* Save the parallel registry
|
|
57
|
+
* @param {string} root - Repository root
|
|
58
|
+
* @param {Object} data - Registry data
|
|
59
|
+
*/
|
|
60
|
+
export function saveParallelRegistry(root: string, data: any): void;
|
|
61
|
+
/**
|
|
62
|
+
* Remove the parallel registry
|
|
63
|
+
* @param {string} root - Repository root
|
|
64
|
+
*/
|
|
65
|
+
export function removeParallelRegistry(root: string): void;
|
|
66
|
+
export const PARALLEL_REGISTRY: ".caws/parallel.json";
|
|
67
|
+
//# sourceMappingURL=parallel-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-manager.d.ts","sourceRoot":"","sources":["../../src/parallel/parallel-manager.js"],"names":[],"mappings":"AA6EA;;;;GAIG;AACH,mCAHW,MAAM,OAoDhB;AAED;;;;GAIG;AACH,0CAFa,KAAQ,CAyCpB;AAED;;;GAGG;AACH,qCAFa,MAAO,IAAI,CA2DvB;AA2CD;;;;;;;GAOG;AACH,wCALG;IAAyB,QAAQ,GAAzB,MAAM;IACY,MAAM,GAAxB,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,OA2GF;AAED;;;;;;GAMG;AACH,2CAJG;IAA0B,cAAc,GAAhC,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,OA0BF;AA3LD;;;;;GAKG;AACH,gDAJW,MAAM,iBACN,KAAQ,GACN,KAAQ,CAmCpB;AAnPD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAO,IAAI,CAYvB;AAED;;;;GAIG;AACH,2CAHW,MAAM,mBAOhB;AAED;;;GAGG;AACH,6CAFW,MAAM,QAOhB;AAnDD,gCAA0B,qBAAqB,CAAC"}
|
|
@@ -17,10 +17,7 @@ const {
|
|
|
17
17
|
BRANCH_PREFIX,
|
|
18
18
|
} = require('../worktree/worktree-manager');
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
listSessions,
|
|
22
|
-
endSession,
|
|
23
|
-
} = require('../session/session-manager');
|
|
20
|
+
// session-manager available if needed: require('../session/session-manager')
|
|
24
21
|
|
|
25
22
|
const PARALLEL_REGISTRY = '.caws/parallel.json';
|
|
26
23
|
const VALID_STRATEGIES = ['merge', 'rebase', 'squash'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/claude-hooks.js"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,gDAHW,MAAM,WACN,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"claude-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/claude-hooks.js"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,gDAHW,MAAM,WACN,MAAM,EAAE,iBA0IlB;AAED;;;;;GAKG;AACH,+CAJW,MAAM,EAAE,2BAsNlB;AAED;;;;GAIG;AACH,2CAHW,MAAM,GACJ,OAAO,CAcnB;AAED;;;;GAIG;AACH,iDAHW,MAAM,OAehB"}
|
|
@@ -56,7 +56,7 @@ async function scaffoldClaudeHooks(projectDir, levels = ['safety', 'quality', 's
|
|
|
56
56
|
safety: ['block-dangerous.sh', 'scan-secrets.sh', 'worktree-guard.sh', 'worktree-write-guard.sh', 'stop-worktree-check.sh', 'session-caws-status.sh'],
|
|
57
57
|
quality: ['quality-check.sh', 'validate-spec.sh'],
|
|
58
58
|
scope: ['scope-guard.sh', 'naming-check.sh'],
|
|
59
|
-
audit: ['audit.sh'],
|
|
59
|
+
audit: ['audit.sh', 'session-log.sh'],
|
|
60
60
|
lite: ['block-dangerous.sh', 'scope-guard.sh', 'lite-sprawl-check.sh', 'simplification-guard.sh'],
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -87,6 +87,7 @@ async function scaffoldClaudeHooks(projectDir, levels = ['safety', 'quality', 's
|
|
|
87
87
|
'worktree-write-guard.sh',
|
|
88
88
|
'stop-worktree-check.sh',
|
|
89
89
|
'session-caws-status.sh',
|
|
90
|
+
'session-log.sh',
|
|
90
91
|
];
|
|
91
92
|
|
|
92
93
|
for (const script of allHookScripts) {
|
|
@@ -320,6 +321,11 @@ function generateClaudeSettings(levels, _enabledHooks) {
|
|
|
320
321
|
command: '"$CLAUDE_PROJECT_DIR"/.claude/hooks/audit.sh session-start',
|
|
321
322
|
timeout: 5,
|
|
322
323
|
},
|
|
324
|
+
{
|
|
325
|
+
type: 'command',
|
|
326
|
+
command: '"$CLAUDE_PROJECT_DIR"/.claude/hooks/session-log.sh',
|
|
327
|
+
timeout: 10,
|
|
328
|
+
},
|
|
323
329
|
],
|
|
324
330
|
});
|
|
325
331
|
|
|
@@ -331,6 +337,23 @@ function generateClaudeSettings(levels, _enabledHooks) {
|
|
|
331
337
|
command: '"$CLAUDE_PROJECT_DIR"/.claude/hooks/audit.sh stop',
|
|
332
338
|
timeout: 5,
|
|
333
339
|
},
|
|
340
|
+
{
|
|
341
|
+
type: 'command',
|
|
342
|
+
command: '"$CLAUDE_PROJECT_DIR"/.claude/hooks/session-log.sh',
|
|
343
|
+
timeout: 15,
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// Session transcript generation on context compaction
|
|
349
|
+
settings.hooks.PreCompact = settings.hooks.PreCompact || [];
|
|
350
|
+
settings.hooks.PreCompact.push({
|
|
351
|
+
hooks: [
|
|
352
|
+
{
|
|
353
|
+
type: 'command',
|
|
354
|
+
command: '"$CLAUDE_PROJECT_DIR"/.claude/hooks/session-log.sh',
|
|
355
|
+
timeout: 15,
|
|
356
|
+
},
|
|
334
357
|
],
|
|
335
358
|
});
|
|
336
359
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/git-hooks.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,6CAHW,MAAM;;;GAwGhB;
|
|
1
|
+
{"version":3,"file":"git-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/git-hooks.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,6CAHW,MAAM;;;GAwGhB;AAgvBD;;;GAGG;AACH,2CAFW,MAAM,iBAkChB;AAED;;;GAGG;AACH,gDAFW,MAAM,iBAgDhB;AAxYD;;;GAGG;AACH,8CA2MC;AA7oBD;;;GAGG;AACH,4DAgZC;AAED;;GAEG;AACH,iDAmCC;AAmND;;GAEG;AACH,gDA0FC"}
|
|
@@ -599,73 +599,63 @@ if [ ! -d ".caws" ]; then
|
|
|
599
599
|
exit 0
|
|
600
600
|
fi
|
|
601
601
|
|
|
602
|
-
# Run
|
|
602
|
+
# Run CAWS validation (supports multi-spec projects)
|
|
603
|
+
CAWS_VALIDATION_FAILED=false
|
|
603
604
|
if command -v caws >/dev/null 2>&1; then
|
|
604
|
-
echo "Running
|
|
605
|
-
|
|
606
|
-
#
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
echo ""
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
echo ""
|
|
605
|
+
echo "Running CAWS validation..."
|
|
606
|
+
|
|
607
|
+
# Multi-spec project: validate each open spec individually
|
|
608
|
+
if [ -d ".caws/specs" ] && command -v node >/dev/null 2>&1; then
|
|
609
|
+
OPEN_SPECS=$(node -e "
|
|
610
|
+
var fs = require('fs'), path = require('path'), dir = '.caws/specs';
|
|
611
|
+
try {
|
|
612
|
+
fs.readdirSync(dir).filter(function(f) { return f.endsWith('.yaml'); }).forEach(function(f) {
|
|
613
|
+
var content = fs.readFileSync(path.join(dir, f), 'utf8');
|
|
614
|
+
if (content.indexOf('status: closed') === -1) {
|
|
615
|
+
var match = content.match(/^id:\\s*(.+)$/m);
|
|
616
|
+
if (match) console.log(match[1].trim());
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
} catch(e) {}
|
|
620
|
+
" 2>/dev/null || echo "")
|
|
621
|
+
|
|
622
|
+
if [ -n "$OPEN_SPECS" ]; then
|
|
623
|
+
echo " Multi-spec project detected, validating open specs..."
|
|
624
|
+
while IFS= read -r spec_id; do
|
|
625
|
+
[ -z "$spec_id" ] && continue
|
|
626
|
+
echo " Validating spec: $spec_id"
|
|
627
|
+
if ! caws validate --spec-id "$spec_id" --quiet 2>&1; then
|
|
628
|
+
echo " Validation failed for spec: $spec_id"
|
|
629
|
+
CAWS_VALIDATION_FAILED=true
|
|
630
|
+
fi
|
|
631
|
+
done <<< "$OPEN_SPECS"
|
|
632
|
+
if [ "$CAWS_VALIDATION_FAILED" = false ]; then
|
|
633
|
+
echo "CAWS validation passed (all open specs)"
|
|
634
|
+
fi
|
|
635
|
+
else
|
|
636
|
+
echo " No open specs found, skipping CAWS validation"
|
|
636
637
|
fi
|
|
637
|
-
|
|
638
|
-
#
|
|
639
|
-
|
|
640
|
-
if
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
echo "$ACTIVE_WAIVERS" | head -5
|
|
644
|
-
echo ""
|
|
645
|
-
echo "Note: Waivers may not cover all validation failures"
|
|
646
|
-
echo " Review waiver coverage: caws waivers list --status=active"
|
|
638
|
+
else
|
|
639
|
+
# Single-spec project: validate working-spec directly
|
|
640
|
+
VALIDATION_OUTPUT=$(caws validate --quiet 2>&1)
|
|
641
|
+
if [ $? -ne 0 ]; then
|
|
642
|
+
echo "$VALIDATION_OUTPUT"
|
|
643
|
+
CAWS_VALIDATION_FAILED=true
|
|
647
644
|
else
|
|
648
|
-
echo "
|
|
649
|
-
echo ""
|
|
650
|
-
echo "If this is infrastructure/setup work, you can create a waiver:"
|
|
651
|
-
echo " caws waivers create \\\\"
|
|
652
|
-
echo " --title='Initial CAWS setup' \\\\"
|
|
653
|
-
echo " --reason=infrastructure_limitation \\\\"
|
|
654
|
-
echo " --gates=contracts \\\\"
|
|
655
|
-
echo " --expires-at='2024-12-31T23:59:59Z' \\\\"
|
|
656
|
-
echo " --approved-by='@your-team' \\\\"
|
|
657
|
-
echo " --impact-level=low \\\\"
|
|
658
|
-
echo " --mitigation-plan='Contracts will be added as features are developed'"
|
|
645
|
+
echo "CAWS validation passed"
|
|
659
646
|
fi
|
|
660
|
-
|
|
647
|
+
fi
|
|
648
|
+
|
|
649
|
+
if [ "$CAWS_VALIDATION_FAILED" = true ]; then
|
|
661
650
|
echo ""
|
|
662
651
|
echo "==================================================="
|
|
652
|
+
echo "CAWS validation failed"
|
|
653
|
+
echo "==================================================="
|
|
663
654
|
echo "Next Steps:"
|
|
664
655
|
echo " 1. Review errors above"
|
|
665
|
-
echo " 2. Fix issues in .caws/working-spec.yaml"
|
|
666
|
-
echo " 3. Run: caws validate
|
|
667
|
-
echo " 4.
|
|
668
|
-
echo " 5. Push again: git push"
|
|
656
|
+
echo " 2. Fix issues in .caws/working-spec.yaml or .caws/specs/"
|
|
657
|
+
echo " 3. Run: caws validate (to verify fixes)"
|
|
658
|
+
echo " 4. Push again: git push"
|
|
669
659
|
echo "==================================================="
|
|
670
660
|
exit 1
|
|
671
661
|
fi
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffold/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffold/index.js"],"names":[],"mappings":"AA4MA;;;GAGG;AACH,6DAikBC;AAxtBD;;;GAoIC;;AAMD;;;GAGG;AACH,yDAGC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start a new session, creating the initial capsule with baseline state
|
|
3
|
+
* @param {Object} options - Session options
|
|
4
|
+
* @param {string} [options.role] - Agent role (worker, integrator, qa)
|
|
5
|
+
* @param {string} [options.specId] - Associated feature spec ID
|
|
6
|
+
* @param {string[]} [options.allowedGlobs] - Allowed file patterns
|
|
7
|
+
* @param {string[]} [options.forbiddenGlobs] - Forbidden file patterns
|
|
8
|
+
* @param {string} [options.intent] - What this session intends to accomplish
|
|
9
|
+
* @returns {Object} Created capsule
|
|
10
|
+
*/
|
|
11
|
+
export function startSession(options?: {
|
|
12
|
+
role?: string;
|
|
13
|
+
specId?: string;
|
|
14
|
+
allowedGlobs?: string[];
|
|
15
|
+
forbiddenGlobs?: string[];
|
|
16
|
+
intent?: string;
|
|
17
|
+
}): any;
|
|
18
|
+
/**
|
|
19
|
+
* Add a checkpoint to the current (most recent active) session
|
|
20
|
+
* @param {Object} data - Checkpoint data
|
|
21
|
+
* @param {string} [data.sessionId] - Specific session ID (uses latest active if omitted)
|
|
22
|
+
* @param {string[]} [data.pathsTouched] - Files changed
|
|
23
|
+
* @param {string[]} [data.artifactsWritten] - Generated artifacts
|
|
24
|
+
* @param {Object[]} [data.testsRun] - Test results { name, status, evidence }
|
|
25
|
+
* @param {Object[]} [data.determinismChecks] - Determinism checks { name, status, total }
|
|
26
|
+
* @param {Object[]} [data.knownIssues] - Issues discovered { type, description }
|
|
27
|
+
* @param {string} [data.intent] - Updated intent description
|
|
28
|
+
* @returns {Object} Updated capsule
|
|
29
|
+
*/
|
|
30
|
+
export function checkpointSession(data?: {
|
|
31
|
+
sessionId?: string;
|
|
32
|
+
pathsTouched?: string[];
|
|
33
|
+
artifactsWritten?: string[];
|
|
34
|
+
testsRun?: any[];
|
|
35
|
+
determinismChecks?: any[];
|
|
36
|
+
knownIssues?: any[];
|
|
37
|
+
intent?: string;
|
|
38
|
+
}): any;
|
|
39
|
+
/**
|
|
40
|
+
* End a session, finalizing the capsule with handoff information
|
|
41
|
+
* @param {Object} data - End session data
|
|
42
|
+
* @param {string} [data.sessionId] - Specific session ID (uses latest active if omitted)
|
|
43
|
+
* @param {string[]} [data.nextActions] - What the next session should do
|
|
44
|
+
* @param {string[]} [data.riskNotes] - Risk notes for handoff
|
|
45
|
+
* @returns {Object} Finalized capsule
|
|
46
|
+
*/
|
|
47
|
+
export function endSession(data?: {
|
|
48
|
+
sessionId?: string;
|
|
49
|
+
nextActions?: string[];
|
|
50
|
+
riskNotes?: string[];
|
|
51
|
+
}): any;
|
|
52
|
+
/**
|
|
53
|
+
* List all sessions
|
|
54
|
+
* @param {Object} [options] - List options
|
|
55
|
+
* @param {string} [options.status] - Filter by status (active, completed)
|
|
56
|
+
* @param {number} [options.limit] - Max entries to return
|
|
57
|
+
* @returns {Object[]} Session entries
|
|
58
|
+
*/
|
|
59
|
+
export function listSessions(options?: {
|
|
60
|
+
status?: string;
|
|
61
|
+
limit?: number;
|
|
62
|
+
}): any[];
|
|
63
|
+
/**
|
|
64
|
+
* Show a specific session's full capsule
|
|
65
|
+
* @param {string} sessionId - Session ID (or "latest" for most recent)
|
|
66
|
+
* @returns {Object} Full capsule
|
|
67
|
+
*/
|
|
68
|
+
export function showSession(sessionId: string): any;
|
|
69
|
+
/**
|
|
70
|
+
* Briefing output for session start hooks - returns structured text
|
|
71
|
+
* @returns {string} Briefing text
|
|
72
|
+
*/
|
|
73
|
+
export function getBriefing(): string;
|
|
74
|
+
/**
|
|
75
|
+
* Load the session registry
|
|
76
|
+
* @param {string} root - Repository root
|
|
77
|
+
* @returns {Object} Registry object
|
|
78
|
+
*/
|
|
79
|
+
export function loadRegistry(root: string): any;
|
|
80
|
+
/**
|
|
81
|
+
* Get the git repository root
|
|
82
|
+
* @returns {string} Absolute path to repo root
|
|
83
|
+
*/
|
|
84
|
+
export function getRepoRoot(): string;
|
|
85
|
+
export const SESSIONS_DIR: ".caws/sessions";
|
|
86
|
+
export const REGISTRY_FILE: ".caws/sessions.json";
|
|
87
|
+
export const CAPSULE_SCHEMA_VERSION: "caws.capsule.v1";
|
|
88
|
+
/**
|
|
89
|
+
* Find all active sessions on a specific branch
|
|
90
|
+
* @param {string} branch - Branch name to search
|
|
91
|
+
* @returns {Object[]} Active sessions on that branch with id and metadata
|
|
92
|
+
*/
|
|
93
|
+
export function findActiveSessionsOnBranch(branch: string): any[];
|
|
94
|
+
//# sourceMappingURL=session-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/session/session-manager.js"],"names":[],"mappings":"AA4JA;;;;;;;;;GASG;AACH,uCAPG;IAAyB,IAAI,GAArB,MAAM;IACW,MAAM,GAAvB,MAAM;IACa,YAAY,GAA/B,MAAM,EAAE;IACW,cAAc,GAAjC,MAAM,EAAE;IACS,MAAM,GAAvB,MAAM;CACd,OAyFF;AAED;;;;;;;;;;;GAWG;AACH,yCATG;IAAsB,SAAS,GAAvB,MAAM;IACU,YAAY,GAA5B,MAAM,EAAE;IACQ,gBAAgB,GAAhC,MAAM,EAAE;IACQ,QAAQ,GAAxB,KAAQ;IACQ,iBAAiB,GAAjC,KAAQ;IACQ,WAAW,GAA3B,KAAQ;IACM,MAAM,GAApB,MAAM;CACd,OAwDF;AAED;;;;;;;GAOG;AACH,kCALG;IAAsB,SAAS,GAAvB,MAAM;IACU,WAAW,GAA3B,MAAM,EAAE;IACQ,SAAS,GAAzB,MAAM,EAAE;CAChB,OAgEF;AAED;;;;;;GAMG;AACH,uCAJG;IAAyB,MAAM,GAAvB,MAAM;IACW,KAAK,GAAtB,MAAM;CACd,GAAU,KAAQ,CAuBpB;AAED;;;;GAIG;AACH,uCAHW,MAAM,OA2BhB;AAED;;;GAGG;AACH,+BAFa,MAAM,CA8DlB;AAlZD;;;;GAIG;AACH,mCAHW,MAAM,OAahB;AApHD;;;GAGG;AACH,+BAFa,MAAM,CAMlB;AAZD,2BAAqB,gBAAgB,CAAC;AACtC,4BAAsB,qBAAqB,CAAC;AAC5C,qCAA+B,iBAAiB,CAAC;AAwgBjD;;;;GAIG;AACH,mDAHW,MAAM,GACJ,KAAQ,CAQpB"}
|