@adeildo/pi-kit 4.0.0 → 4.1.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/LICENSE +1 -1
- package/README.md +8 -5
- package/package.json +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
# @adeildo/pi-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@adeildo/pi-kit)
|
|
4
|
+
|
|
5
|
+
What [`@adeildo/pi-ask-permission`](../ask-permission) and [`@adeildo/pi-harness`](../harness) are built on. It's a library, not a Pi package, so installing it adds nothing to Pi. It's on npm because both packages need it at runtime, and its API follows what they need, with no promise to anyone else.
|
|
4
6
|
|
|
5
7
|
## An app, and features in it
|
|
6
8
|
|
|
7
9
|
```ts
|
|
8
10
|
import { createApp, defineFeature, matching, setting } from "@adeildo/pi-kit";
|
|
11
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
12
|
|
|
10
13
|
export const version = setting({
|
|
11
14
|
id: "subscription.claudeCodeVersion",
|
|
@@ -25,11 +28,11 @@ export const subscription = defineFeature({
|
|
|
25
28
|
});
|
|
26
29
|
|
|
27
30
|
export default function (pi: ExtensionAPI): void {
|
|
28
|
-
createApp(pi, { name: "pi-
|
|
31
|
+
createApp(pi, { name: "pi-harness" }).use(subscription).build();
|
|
29
32
|
}
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
Each extension a package declares is one app with one or more features. The app's `name` goes in front of every warning. The harness declares one extension per feature, so `pi config` turns each off on its own, and all of them share the settings file below.
|
|
33
36
|
|
|
34
37
|
## What a feature gets
|
|
35
38
|
|
|
@@ -44,7 +47,7 @@ A package is one app. The harness will be one app with every feature in it, and
|
|
|
44
47
|
| `scope.warn` | Shows a notification when there's a UI and writes to stderr when there isn't. Messages sent before a session starts are held until it does. |
|
|
45
48
|
| everything else | The scope **is** the extension API, so `scope.registerTool`, `scope.appendEntry`, `scope.events` and the rest work as they always did. |
|
|
46
49
|
|
|
47
|
-
A feature whose `setup` throws turns into a warning, and the other features still mount. If the same feature
|
|
50
|
+
A feature whose `setup` throws turns into a warning, and the other features still mount. If the same feature id is mounted by two apps in one Pi process, say from two copies of a package, the first app runs it and the second one logs who has it.
|
|
48
51
|
|
|
49
52
|
## Settings
|
|
50
53
|
|
|
@@ -77,7 +80,7 @@ These rules hold for every event that crosses packages:
|
|
|
77
80
|
|
|
78
81
|
## Testing
|
|
79
82
|
|
|
80
|
-
`@adeildo/pi-kit/testing` has `fakePi()` and `fakeContext()`. Two fakes built on one `createEventBus()` behave like two extensions in the same Pi process. `fire` runs the handlers in order and returns what each one returned.
|
|
83
|
+
`@adeildo/pi-kit/testing` has `fakePi()`, `fakeScope()` and `fakeContext()`. Two fakes built on one `createEventBus()` behave like two extensions in the same Pi process. `fire` runs the handlers in order and returns what each one returned.
|
|
81
84
|
|
|
82
85
|
## License
|
|
83
86
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adeildo/pi-kit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "The app builder, settings and events that pi-harness packages are built on.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
|
-
"name": "
|
|
7
|
+
"name": "adeildo",
|
|
8
8
|
"email": "contato@felipeadeildo.com",
|
|
9
9
|
"url": "https://github.com/felipeadeildo"
|
|
10
10
|
},
|