@codyswann/lisa 1.31.1 → 1.32.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.
|
@@ -9,6 +9,8 @@ Implement the requirements in $ARGUMENTS.
|
|
|
9
9
|
|
|
10
10
|
If no argument provided, search for plan files in the `plans/` directory and present them to the user for selection.
|
|
11
11
|
|
|
12
|
+
Critical: you must create an agent team to implement the plan. Do not try to skip this!
|
|
13
|
+
|
|
12
14
|
## Step 1: Parse Plan
|
|
13
15
|
|
|
14
16
|
1. **Read the plan file** specified in `$ARGUMENTS`
|
|
@@ -1,32 +1,56 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* @file fibonacci.ts
|
|
3
|
+
* @description BigInt Fibonacci utilities using a lazy generator pattern.
|
|
4
|
+
* Uses BigInt instead of Number to eliminate the precision ceiling at
|
|
5
|
+
* fibonacci(78) — BigInt supports arbitrarily large integers, so callers
|
|
6
|
+
* can compute fibonacci(1000) or beyond without silent corruption.
|
|
7
|
+
* The generator pattern enables lazy evaluation, letting consumers pull
|
|
8
|
+
* only the values they need without allocating the full sequence upfront.
|
|
8
9
|
* @module fibonacci
|
|
9
10
|
*/
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Infinite lazy generator yielding Fibonacci numbers as BigInt.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* @returns Generator that yields successive Fibonacci numbers (0n, 1n, 1n, 2n, 3n, ...)
|
|
15
|
+
* @remarks The generator never terminates — do not spread or collect without a length limit.
|
|
16
|
+
* Each call creates an independent generator instance — safe for concurrent iteration.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const gen = fibonacciGenerator();
|
|
20
|
+
* gen.next().value; // 0n
|
|
21
|
+
* gen.next().value; // 1n
|
|
15
22
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
23
|
+
* // Collect first 5 values:
|
|
24
|
+
* const first5 = Array.from({ length: 5 }, () => gen.next().value);
|
|
25
|
+
* ```
|
|
19
26
|
*/
|
|
20
|
-
export declare function
|
|
27
|
+
export declare function fibonacciGenerator(): Generator<bigint, never, unknown>;
|
|
21
28
|
/**
|
|
22
|
-
*
|
|
29
|
+
* Compute the nth Fibonacci number (0-indexed) using BigInt.
|
|
23
30
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
31
|
+
* @param n - Zero-based index in the Fibonacci sequence (must be a non-negative integer)
|
|
32
|
+
* @returns The nth Fibonacci number as a BigInt — compare with `===` against bigint literals (e.g. `55n`), not numbers
|
|
33
|
+
* @throws {RangeError} If n is negative, non-integer, NaN, or Infinity
|
|
34
|
+
* @remarks Delegates to fibonacciGenerator — O(n) time, consistent with the lazy generator approach
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* fibonacci(10); // 55n (bigint, not number)
|
|
38
|
+
* fibonacci(10) === 55n; // true
|
|
39
|
+
* fibonacci(10) === 55; // false — bigint !== number
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function fibonacci(n: number): bigint;
|
|
43
|
+
/**
|
|
44
|
+
* Generate the first `length` Fibonacci numbers as a readonly BigInt array.
|
|
26
45
|
*
|
|
27
|
-
* @param length - How many Fibonacci numbers to generate
|
|
28
|
-
* @returns A readonly array of Fibonacci numbers
|
|
29
|
-
* @throws {RangeError} If length is negative, non-integer, NaN,
|
|
46
|
+
* @param length - How many Fibonacci numbers to generate (must be a non-negative integer)
|
|
47
|
+
* @returns A readonly array of the first `length` Fibonacci numbers as BigInt
|
|
48
|
+
* @throws {RangeError} If length is negative, non-integer, NaN, or Infinity
|
|
49
|
+
* @remarks Wraps fibonacciGenerator so the sequence is computed once, not per-element
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* fibonacciSequence(5); // [0n, 1n, 1n, 2n, 3n]
|
|
53
|
+
* ```
|
|
30
54
|
*/
|
|
31
|
-
export declare function fibonacciSequence(length: number): readonly
|
|
55
|
+
export declare function fibonacciSequence(length: number): readonly bigint[];
|
|
32
56
|
//# sourceMappingURL=fibonacci.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAiB,kBAAkB,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CASvE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAY3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAUnE"}
|
package/dist/utils/fibonacci.js
CHANGED
|
@@ -1,56 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* @file fibonacci.ts
|
|
3
|
+
* @description BigInt Fibonacci utilities using a lazy generator pattern.
|
|
4
|
+
* Uses BigInt instead of Number to eliminate the precision ceiling at
|
|
5
|
+
* fibonacci(78) — BigInt supports arbitrarily large integers, so callers
|
|
6
|
+
* can compute fibonacci(1000) or beyond without silent corruption.
|
|
7
|
+
* The generator pattern enables lazy evaluation, letting consumers pull
|
|
8
|
+
* only the values they need without allocating the full sequence upfront.
|
|
8
9
|
* @module fibonacci
|
|
9
10
|
*/
|
|
10
|
-
/** Largest n for which fibonacci(n) fits in a safe JS integer. */
|
|
11
|
-
const MAX_SAFE_N = 78;
|
|
12
|
-
/** Largest sequence length where all elements remain safe JS integers. */
|
|
13
|
-
const MAX_SAFE_LENGTH = 79;
|
|
14
11
|
/**
|
|
15
|
-
*
|
|
12
|
+
* Infinite lazy generator yielding Fibonacci numbers as BigInt.
|
|
16
13
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* @returns Generator that yields successive Fibonacci numbers (0n, 1n, 1n, 2n, 3n, ...)
|
|
15
|
+
* @remarks The generator never terminates — do not spread or collect without a length limit.
|
|
16
|
+
* Each call creates an independent generator instance — safe for concurrent iteration.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const gen = fibonacciGenerator();
|
|
20
|
+
* gen.next().value; // 0n
|
|
21
|
+
* gen.next().value; // 1n
|
|
19
22
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
+
* // Collect first 5 values:
|
|
24
|
+
* const first5 = Array.from({ length: 5 }, () => gen.next().value);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function* fibonacciGenerator() {
|
|
28
|
+
/* eslint-disable functional/no-let -- generator requires mutable state for iterative Fibonacci computation */
|
|
29
|
+
let a = 0n;
|
|
30
|
+
let b = 1n;
|
|
31
|
+
/* eslint-enable functional/no-let -- re-enable after generator state declarations */
|
|
32
|
+
while (true) {
|
|
33
|
+
yield a;
|
|
34
|
+
[a, b] = [b, a + b];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Compute the nth Fibonacci number (0-indexed) using BigInt.
|
|
39
|
+
*
|
|
40
|
+
* @param n - Zero-based index in the Fibonacci sequence (must be a non-negative integer)
|
|
41
|
+
* @returns The nth Fibonacci number as a BigInt — compare with `===` against bigint literals (e.g. `55n`), not numbers
|
|
42
|
+
* @throws {RangeError} If n is negative, non-integer, NaN, or Infinity
|
|
43
|
+
* @remarks Delegates to fibonacciGenerator — O(n) time, consistent with the lazy generator approach
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* fibonacci(10); // 55n (bigint, not number)
|
|
47
|
+
* fibonacci(10) === 55n; // true
|
|
48
|
+
* fibonacci(10) === 55; // false — bigint !== number
|
|
49
|
+
* ```
|
|
23
50
|
*/
|
|
24
51
|
export function fibonacci(n) {
|
|
25
52
|
if (!Number.isInteger(n) || n < 0) {
|
|
26
53
|
throw new RangeError(`Expected a non-negative integer for n, got ${String(n)}`);
|
|
27
54
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (n <= 1) {
|
|
32
|
-
return n;
|
|
33
|
-
}
|
|
34
|
-
const [, result] = Array.from({ length: n - 1 }).reduce(([prev, curr]) => [curr, prev + curr], [0, 1]);
|
|
35
|
-
return result;
|
|
55
|
+
const gen = fibonacciGenerator();
|
|
56
|
+
Array.from({ length: n }, () => gen.next());
|
|
57
|
+
return gen.next().value;
|
|
36
58
|
}
|
|
37
59
|
/**
|
|
38
|
-
* Generate the first `length` Fibonacci numbers as a readonly array.
|
|
60
|
+
* Generate the first `length` Fibonacci numbers as a readonly BigInt array.
|
|
39
61
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
* @
|
|
45
|
-
*
|
|
62
|
+
* @param length - How many Fibonacci numbers to generate (must be a non-negative integer)
|
|
63
|
+
* @returns A readonly array of the first `length` Fibonacci numbers as BigInt
|
|
64
|
+
* @throws {RangeError} If length is negative, non-integer, NaN, or Infinity
|
|
65
|
+
* @remarks Wraps fibonacciGenerator so the sequence is computed once, not per-element
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* fibonacciSequence(5); // [0n, 1n, 1n, 2n, 3n]
|
|
69
|
+
* ```
|
|
46
70
|
*/
|
|
47
71
|
export function fibonacciSequence(length) {
|
|
48
72
|
if (!Number.isInteger(length) || length < 0) {
|
|
49
73
|
throw new RangeError(`Expected a non-negative integer for length, got ${String(length)}`);
|
|
50
74
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
return Array.from({ length }).reduce((acc, _, i) => [...acc, i < 2 ? i : (acc[i - 1] ?? 0) + (acc[i - 2] ?? 0)], []);
|
|
75
|
+
const gen = fibonacciGenerator();
|
|
76
|
+
return Array.from({ length }, () => gen.next().value);
|
|
55
77
|
}
|
|
56
78
|
//# sourceMappingURL=fibonacci.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,SAAS,CAAC,CAAC,kBAAkB;IACjC,8GAA8G;IAC9G,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,qFAAqF;IACrF,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,CAAC,CAAC;QACR,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAClB,8CAA8C,MAAM,CAAC,CAAC,CAAC,EAAE,CAC1D,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IAEjC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAE5C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,UAAU,CAClB,mDAAmD,MAAM,CAAC,MAAM,CAAC,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IAEjC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@isaacs/brace-expansion": "^5.0.1"
|
|
89
89
|
},
|
|
90
90
|
"name": "@codyswann/lisa",
|
|
91
|
-
"version": "1.
|
|
91
|
+
"version": "1.32.0",
|
|
92
92
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
93
93
|
"main": "dist/index.js",
|
|
94
94
|
"bin": {
|