@claudetree/shared 0.3.0 → 0.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.
@@ -5,4 +5,5 @@ export * from './event.js';
5
5
  export * from './tool-approval.js';
6
6
  export * from './code-review.js';
7
7
  export * from './template.js';
8
+ export * from './tdd.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -5,4 +5,5 @@ export * from './event.js';
5
5
  export * from './tool-approval.js';
6
6
  export * from './code-review.js';
7
7
  export * from './template.js';
8
+ export * from './tdd.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * TDD Session Configuration
3
+ */
4
+ export interface TDDConfig {
5
+ /** Total session timeout in milliseconds */
6
+ timeout: number;
7
+ /** Idle timeout (no output) in milliseconds */
8
+ idleTimeout: number;
9
+ /** Maximum TDD iterations (test-implement cycles) */
10
+ maxIterations: number;
11
+ /** Maximum retries per validation gate */
12
+ maxRetries: number;
13
+ /** Validation gates to run */
14
+ gates: ValidationGate[];
15
+ }
16
+ /**
17
+ * Validation Gate Configuration
18
+ */
19
+ export interface ValidationGate {
20
+ /** Gate name (e.g., 'test', 'type', 'lint') */
21
+ name: string;
22
+ /** Command to execute */
23
+ command: string;
24
+ /** Whether this gate is required to pass */
25
+ required: boolean;
26
+ }
27
+ /**
28
+ * Result of running a validation gate
29
+ */
30
+ export interface GateResult {
31
+ /** Gate name */
32
+ gateName: string;
33
+ /** Whether the gate passed */
34
+ passed: boolean;
35
+ /** Number of attempts made */
36
+ attempts: number;
37
+ /** Command output (truncated) */
38
+ output?: string;
39
+ /** When the gate completed */
40
+ completedAt: Date;
41
+ }
42
+ /**
43
+ * TDD Phase
44
+ */
45
+ export type TDDPhase = 'initializing' | 'writing_test' | 'running_test_red' | 'implementing' | 'running_test_green' | 'validating' | 'completed' | 'failed';
46
+ /**
47
+ * TDD Session State (extends Session)
48
+ */
49
+ export interface TDDSessionState {
50
+ /** Current TDD phase */
51
+ phase: TDDPhase;
52
+ /** Current iteration number (1-based) */
53
+ currentIteration: number;
54
+ /** Gate results for current iteration */
55
+ gateResults: GateResult[];
56
+ /** Number of consecutive failures */
57
+ failureCount: number;
58
+ /** Last activity timestamp */
59
+ lastActivity: Date;
60
+ /** TDD configuration */
61
+ config: TDDConfig;
62
+ }
63
+ /**
64
+ * Default TDD configuration
65
+ */
66
+ export declare const DEFAULT_TDD_CONFIG: TDDConfig;
67
+ //# sourceMappingURL=tdd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tdd.d.ts","sourceRoot":"","sources":["../../src/types/tdd.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,EAAE,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,oBAAoB,GACpB,YAAY,GACZ,WAAW,GACX,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,KAAK,EAAE,QAAQ,CAAC;IAChB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,YAAY,EAAE,IAAI,CAAC;IACnB,wBAAwB;IACxB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAUhC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Default TDD configuration
3
+ */
4
+ export const DEFAULT_TDD_CONFIG = {
5
+ timeout: 2 * 60 * 60 * 1000, // 2 hours
6
+ idleTimeout: 10 * 60 * 1000, // 10 minutes
7
+ maxIterations: 10,
8
+ maxRetries: 3,
9
+ gates: [
10
+ { name: 'test', command: 'pnpm test', required: true },
11
+ { name: 'type', command: 'pnpm tsc --noEmit', required: true },
12
+ { name: 'lint', command: 'pnpm lint', required: false },
13
+ ],
14
+ };
15
+ //# sourceMappingURL=tdd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tdd.js","sourceRoot":"","sources":["../../src/types/tdd.ts"],"names":[],"mappings":"AA2EA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAc;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAM,UAAU;IAC3C,WAAW,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAM,aAAa;IAC9C,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,CAAC;IACb,KAAK,EAAE;QACL,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9D,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;KACxD;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudetree/shared",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Shared types and utilities for claudetree",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",