@xynogen/pix-welcome 0.1.0 → 0.1.2
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/README.md +31 -0
- package/package.json +1 -1
- package/src/extension.ts +2 -1
- package/src/once.ts +16 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# pix-welcome
|
|
2
|
+
|
|
3
|
+
Pi extension — welcome banner with startup health checks.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Renders a coloured ASCII π logo above the editor on session start and runs startup health checks in parallel while the banner is visible. Checks include: Pi version, auth status (at least one provider configured), and gitignore hygiene (auto-adds `.ai` and `.pi-lens` to `.gitignore` in git repos). Each check updates the banner live as results arrive, showing ✓/✗ and a brief status. The banner auto-dismisses on the first user turn. No configuration required.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:@xynogen/pix-welcome
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> Also included in [`@xynogen/pix-core`](https://github.com/xynogen/pix-mono/tree/main/packages/pix-core):
|
|
16
|
+
>
|
|
17
|
+
> ```bash
|
|
18
|
+
> pi install npm:@xynogen/pix-core
|
|
19
|
+
> ```
|
|
20
|
+
|
|
21
|
+
## Full distro
|
|
22
|
+
|
|
23
|
+
To install the complete pix suite (all packages + Pi itself):
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
curl -fsSL https://raw.githubusercontent.com/xynogen/pix-mono/main/scripts/install.sh | sh
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT
|
package/package.json
CHANGED
package/src/extension.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { once } from "./once.ts";
|
|
2
3
|
import registerWelcome from "./welcome.ts";
|
|
3
4
|
|
|
4
5
|
export default function (pi: ExtensionAPI): void {
|
|
5
|
-
registerWelcome(pi);
|
|
6
|
+
once("pix-welcome", () => registerWelcome(pi));
|
|
6
7
|
}
|
package/src/once.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Idempotency guard for extension activation.
|
|
3
|
+
*
|
|
4
|
+
* pix-core (the meta-package) invokes this package's factory in addition to a
|
|
5
|
+
* possible direct install. Pi's loader uses jiti with `moduleCache: false`, so
|
|
6
|
+
* each load pass re-evaluates modules — a plain module-level flag would not be
|
|
7
|
+
* shared. The dedupe key therefore lives on `globalThis`, which persists for
|
|
8
|
+
* the lifetime of the process across all load passes.
|
|
9
|
+
*/
|
|
10
|
+
export function once(key: string, fn: () => void): void {
|
|
11
|
+
const g = globalThis as { __pixLoaded?: Set<string> };
|
|
12
|
+
const loaded = (g.__pixLoaded ??= new Set<string>());
|
|
13
|
+
if (loaded.has(key)) return;
|
|
14
|
+
loaded.add(key);
|
|
15
|
+
fn();
|
|
16
|
+
}
|