pi-ext
bugabingas pi extensions
owned by bugabinga
lint: tighten biome rules
db01d3a4d2b7f7ca9065230acc2023c9a2e6cf10
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (5)
35 35 "useLiteralKeys":
"off" 38 - "noUnusedFunctionParameters":
"warn",
38 + "noUnusedFunctionParameters":
"error",
39 39 "noUnusedImports":
"error",
40 40 "noUnusedVariables":
"error",
41 41 "noVoidTypeReturn":
"error",
42 42 "useParseIntRadix":
"error" 45 - "noAccumulatingSpread":
"off" 45 + "noAccumulatingSpread":
"error" 48 48 "noDescendingSpecificity":
"off",
49 - "noNonNullAssertion":
"warn",
49 + "noNonNullAssertion":
"error",
50 50 "useNodejsImportProtocol":
"error",
51 51 "useTemplate":
"off" 55 55 "noControlCharactersInRegex":
"off",
56 56 "noExplicitAny":
"off",
57 57 "noGlobalIsNan":
"error",
58 - "noImplicitAnyLet":
"off",
58 + "noImplicitAnyLet":
"error",
59 59 "noTemplateCurlyInString":
"off",
60 60 "useIterableCallbackReturn":
"off" extensions/angel/index.ts
Modified190 190 function loadSettings(pi
: ExtensionAPI)
: Settings {
191 - const fromFiles
= [
192 - path.
join(
getAgentDir(),
"settings.json"),
193 - path.
join(
process.
cwd(),
".pi",
"settings.json"),
194 - path.
join(
process.
cwd(),
"settings.json"),
197 - .
reduce((acc, s)
=> ({
...acc,
...s }), {});
191 + const fromFiles
= Object.
assign(
194 + path.
join(
getAgentDir(),
"settings.json"),
195 + path.
join(
process.
cwd(),
".pi",
"settings.json"),
196 + path.
join(
process.
cwd(),
"settings.json"),
197 + ].
map(readSettings),
199 200 const allSettings
= (pi
as SettingsAPI).settingsManager?.
getSettings();
200 201 const runtime
= isPlainObject(allSettings?.angel)
extensions/cwd/index.ts
Modified 29 29 function assertDirectory(path
: string)
: string | undefined {
30 30 if (
!existsSync(path))
return `cwd not found: ${path}`;
33 - stats
= statSync(path);
32 + const stats
= statSync(path);
33 + if (
!stats.
isDirectory())
return `cwd is not a directory: ${path}`;
35 36 return `cannot stat cwd: ${error instanceof Error ? error.message : String(error)}`;
37 - if (
!stats.
isDirectory())
return `cwd is not a directory: ${path}`;
41 40 function sessionFileExists(ctx
: ExtensionCommandContext)
: string | undefined {
extensions/leaks/index.ts
Modified577 577 process.
env.PI_CODING_AGENT_DIR
|| 578 578 path.
join(
process.
env.HOME
|| "",
".pi",
"agent");
580 - path.
join(agentDir,
"settings.json"),
581 - path.
join(cwd,
".pi",
"settings.json"),
583 - .
map(readJsonObject)
584 - .
reduce((acc, item)
=> ({
...acc,
...item }), {});
579 + return Object.
assign(
582 + path.
join(agentDir,
"settings.json"),
583 + path.
join(cwd,
".pi",
"settings.json"),
584 + ].
map(readJsonObject),
587 588 function readJsonObject(file
: string)
: Record<
string,
unknown> {
extensions/superpowers/__tests__/harness.test.ts
Modified 63 63 return { ctx, entries, messages, widgets, notices };
66 -async function waitFor(
fn: ()
=> boolean) {
67 - for (
let i
= 0; i
< 80; i
++) {
66 +async function waitFor(
68 + { timeoutMs
= 8_000, message
= "condition" }
= {},
70 + const deadline
= Date.
now()
+ timeoutMs;
71 + while (
Date.
now()
< deadline) {
71 - expect(
fn()).
toBe(
true);
75 + throw new Error(
`timed out waiting for ${message}`);
74 78 describe(
"superpowers harness", ()
=> {