@codyswann/lisa 1.31.1 → 1.33.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/all/copy-overwrite/.claude/skills/plan-create/SKILL.md +1 -1
- package/all/copy-overwrite/.claude/skills/plan-implement/SKILL.md +2 -0
- package/dist/utils/fibonacci.d.ts +44 -25
- package/dist/utils/fibonacci.d.ts.map +1 -1
- package/dist/utils/fibonacci.js +58 -41
- package/dist/utils/fibonacci.js.map +1 -1
- package/package.json +1 -1
|
@@ -185,7 +185,7 @@ Include all required tasks defined in `@.claude/rules/plan-governance.md` (Requi
|
|
|
185
185
|
|
|
186
186
|
## Step 10: Implementation Team Instructions
|
|
187
187
|
|
|
188
|
-
The plan must include explict instructions to "Create an agent team" for implementation. Recommend these specialized agents:
|
|
188
|
+
The plan must include explict instructions to "Create an agent team" for implementation and run the /plan-implement skill. Recommend these specialized agents:
|
|
189
189
|
|
|
190
190
|
| Agent | Use For |
|
|
191
191
|
|-------|---------|
|
|
@@ -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,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @module fibonacci
|
|
2
|
+
* @file fibonacci.ts
|
|
3
|
+
* @description BigInt Fibonacci utilities built on a lazy infinite generator.
|
|
4
|
+
* Every public function delegates to `fibonacciGenerator` so the core
|
|
5
|
+
* recurrence relation lives in exactly one place (DRY). BigInt eliminates
|
|
6
|
+
* the precision ceiling that Number hits at fibonacci(78).
|
|
7
|
+
* @module utils
|
|
9
8
|
*/
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
10
|
+
* Infinite generator that lazily yields the Fibonacci sequence as BigInts
|
|
11
|
+
* @yields {bigint} The next Fibonacci number in the sequence (0n, 1n, 1n, 2n, 3n, …)
|
|
12
|
+
* @remarks Each call creates an independent iterator with its own state, so
|
|
13
|
+
* multiple consumers can advance through the sequence without interference.
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const gen = fibonacciGenerator();
|
|
17
|
+
* gen.next().value; // 0n
|
|
18
|
+
* gen.next().value; // 1n
|
|
19
|
+
* gen.next().value; // 1n
|
|
20
|
+
* ```
|
|
19
21
|
*/
|
|
20
|
-
export declare function
|
|
22
|
+
export declare function fibonacciGenerator(): Generator<bigint, never, unknown>;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* Returns the nth Fibonacci number as a BigInt
|
|
25
|
+
* @param n - Zero-based index into the Fibonacci sequence (must be a non-negative integer)
|
|
26
|
+
* @returns The nth Fibonacci number (e.g. fibonacci(5) → 5n)
|
|
27
|
+
* @throws {RangeError} When n is negative, non-integer, NaN, or Infinity
|
|
28
|
+
* @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* fibonacci(0); // 0n
|
|
32
|
+
* fibonacci(10); // 55n
|
|
33
|
+
* fibonacci(78); // 8944394323791464n — beyond Number.MAX_SAFE_INTEGER
|
|
34
|
+
* ```
|
|
30
35
|
*/
|
|
31
|
-
export declare function
|
|
36
|
+
export declare function fibonacci(n: number): bigint;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the first `length` Fibonacci numbers as a readonly BigInt array
|
|
39
|
+
* @param length - How many Fibonacci numbers to return (must be a non-negative integer)
|
|
40
|
+
* @returns A new array containing the first `length` Fibonacci numbers
|
|
41
|
+
* @throws {RangeError} When length is negative, non-integer, NaN, or Infinity
|
|
42
|
+
* @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
|
|
43
|
+
* Returns a fresh array on every call — callers can safely mutate the result.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* fibonacciSequence(0); // []
|
|
47
|
+
* fibonacciSequence(5); // [0n, 1n, 1n, 2n, 3n]
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function fibonacciSequence(length: number): readonly bigint[];
|
|
32
51
|
//# 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;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAiB,kBAAkB,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAUvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAU3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CASnE"}
|
package/dist/utils/fibonacci.js
CHANGED
|
@@ -1,56 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @module fibonacci
|
|
2
|
+
* @file fibonacci.ts
|
|
3
|
+
* @description BigInt Fibonacci utilities built on a lazy infinite generator.
|
|
4
|
+
* Every public function delegates to `fibonacciGenerator` so the core
|
|
5
|
+
* recurrence relation lives in exactly one place (DRY). BigInt eliminates
|
|
6
|
+
* the precision ceiling that Number hits at fibonacci(78).
|
|
7
|
+
* @module utils
|
|
9
8
|
*/
|
|
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
9
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
10
|
+
* Infinite generator that lazily yields the Fibonacci sequence as BigInts
|
|
11
|
+
* @yields {bigint} The next Fibonacci number in the sequence (0n, 1n, 1n, 2n, 3n, …)
|
|
12
|
+
* @remarks Each call creates an independent iterator with its own state, so
|
|
13
|
+
* multiple consumers can advance through the sequence without interference.
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const gen = fibonacciGenerator();
|
|
17
|
+
* gen.next().value; // 0n
|
|
18
|
+
* gen.next().value; // 1n
|
|
19
|
+
* gen.next().value; // 1n
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function* fibonacciGenerator() {
|
|
23
|
+
/* eslint-disable functional/no-let -- generator requires mutable state for iterative Fibonacci computation */
|
|
24
|
+
let a = 0n;
|
|
25
|
+
let b = 1n;
|
|
26
|
+
/* eslint-enable functional/no-let -- re-enable after generator state declarations */
|
|
27
|
+
while (true) {
|
|
28
|
+
yield a;
|
|
29
|
+
[a, b] = [b, a + b];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns the nth Fibonacci number as a BigInt
|
|
34
|
+
* @param n - Zero-based index into the Fibonacci sequence (must be a non-negative integer)
|
|
35
|
+
* @returns The nth Fibonacci number (e.g. fibonacci(5) → 5n)
|
|
36
|
+
* @throws {RangeError} When n is negative, non-integer, NaN, or Infinity
|
|
37
|
+
* @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* fibonacci(0); // 0n
|
|
41
|
+
* fibonacci(10); // 55n
|
|
42
|
+
* fibonacci(78); // 8944394323791464n — beyond Number.MAX_SAFE_INTEGER
|
|
43
|
+
* ```
|
|
23
44
|
*/
|
|
24
45
|
export function fibonacci(n) {
|
|
25
|
-
if (!Number.isInteger(n) || n < 0) {
|
|
46
|
+
if (!Number.isFinite(n) || !Number.isInteger(n) || n < 0) {
|
|
26
47
|
throw new RangeError(`Expected a non-negative integer for n, got ${String(n)}`);
|
|
27
48
|
}
|
|
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;
|
|
49
|
+
const gen = fibonacciGenerator();
|
|
50
|
+
Array.from({ length: n }, () => gen.next());
|
|
51
|
+
return gen.next().value;
|
|
36
52
|
}
|
|
37
53
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @
|
|
45
|
-
*
|
|
54
|
+
* Returns the first `length` Fibonacci numbers as a readonly BigInt array
|
|
55
|
+
* @param length - How many Fibonacci numbers to return (must be a non-negative integer)
|
|
56
|
+
* @returns A new array containing the first `length` Fibonacci numbers
|
|
57
|
+
* @throws {RangeError} When length is negative, non-integer, NaN, or Infinity
|
|
58
|
+
* @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
|
|
59
|
+
* Returns a fresh array on every call — callers can safely mutate the result.
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* fibonacciSequence(0); // []
|
|
63
|
+
* fibonacciSequence(5); // [0n, 1n, 1n, 2n, 3n]
|
|
64
|
+
* ```
|
|
46
65
|
*/
|
|
47
66
|
export function fibonacciSequence(length) {
|
|
48
|
-
if (!Number.isInteger(length) || length < 0) {
|
|
67
|
+
if (!Number.isFinite(length) || !Number.isInteger(length) || length < 0) {
|
|
49
68
|
throw new RangeError(`Expected a non-negative integer for length, got ${String(length)}`);
|
|
50
69
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
return Array.from({ length }).reduce((acc, _, i) => [...acc, i < 2 ? i : (acc[i - 1] ?? 0) + (acc[i - 2] ?? 0)], []);
|
|
70
|
+
const gen = fibonacciGenerator();
|
|
71
|
+
return Array.from({ length }, () => gen.next().value);
|
|
55
72
|
}
|
|
56
73
|
//# 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;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,SAAS,CAAC,CAAC,kBAAkB;IACjC,8GAA8G;IAC9G,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,qFAAqF;IAErF,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;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,UAAU,CAClB,8CAA8C,MAAM,CAAC,CAAC,CAAC,EAAE,CAC1D,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,UAAU,CAClB,mDAAmD,MAAM,CAAC,MAAM,CAAC,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,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.33.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": {
|