@xl0/pi-lovely-agents 0.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/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +184 -0
- package/extensions/lovely-agents/agent.ts +1374 -0
- package/extensions/lovely-agents/bash.ts +599 -0
- package/extensions/lovely-agents/child-session.ts +296 -0
- package/extensions/lovely-agents/config.ts +221 -0
- package/extensions/lovely-agents/coordinator.ts +506 -0
- package/extensions/lovely-agents/definitions.ts +380 -0
- package/extensions/lovely-agents/index.ts +400 -0
- package/extensions/lovely-agents/lifecycle.ts +251 -0
- package/extensions/lovely-agents/management.ts +638 -0
- package/extensions/lovely-agents/notifications.ts +220 -0
- package/extensions/lovely-agents/provider-limits.ts +13 -0
- package/extensions/lovely-agents/rendering.ts +90 -0
- package/extensions/lovely-agents/state.ts +1179 -0
- package/extensions/lovely-agents/task-panel.ts +192 -0
- package/extensions/lovely-agents/tools.ts +635 -0
- package/extensions/lovely-agents/updates.ts +45 -0
- package/node_modules/@xl0/pi-lovely-config/CHANGELOG.md +79 -0
- package/node_modules/@xl0/pi-lovely-config/LICENSE +21 -0
- package/node_modules/@xl0/pi-lovely-config/README.md +200 -0
- package/node_modules/@xl0/pi-lovely-config/package.json +59 -0
- package/node_modules/@xl0/pi-lovely-config/src/config.ts +399 -0
- package/node_modules/@xl0/pi-lovely-config/src/index.ts +3 -0
- package/node_modules/@xl0/pi-lovely-config/src/ui.ts +786 -0
- package/package.json +68 -0
- package/skills/agent/SKILL.md +21 -0
- package/skills/agent-creator/SKILL.md +35 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Historical release dates use npm publication dates (UTC).
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.1.3] - 2026-09-06
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Multi-enum fields with whole-array scope overrides and searchable TUI
|
|
12
|
+
checklists. Space toggles items, Enter saves, Esc discards; selected items
|
|
13
|
+
float to the top.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Releases now stage on npm through GitHub Actions with OIDC provenance,
|
|
18
|
+
then publish after manual 2FA approval.
|
|
19
|
+
|
|
20
|
+
## [0.1.2] - 2026-07-21
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Malformed JSON and non-object config files now load as empty patches with
|
|
25
|
+
scope/path warnings instead of throwing. Subsequent updates replace malformed
|
|
26
|
+
content with valid config.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- File-level warnings omit `key`; field-level warnings still include it.
|
|
31
|
+
- Expanded installation, field metadata, and TUI interaction documentation.
|
|
32
|
+
|
|
33
|
+
## [0.1.1] - 2026-07-08
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Searchable enum pickers via `search: true`, with inline fuzzy matching
|
|
38
|
+
against values and descriptions.
|
|
39
|
+
- `field.text()` for multiline strings, with an inline TUI editor:
|
|
40
|
+
Enter saves, Shift+Enter inserts a newline, Esc discards.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- Single-line string fields reject multiline defaults and values; use text
|
|
45
|
+
fields for multiline content.
|
|
46
|
+
|
|
47
|
+
## [0.1.0] - 2026-06-28
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- Replaced `defineScopedConfigSpec()` and `ScopedConfigState` with
|
|
52
|
+
`defineScopedConfig({ schema })` and typed `field` builders. Schema object
|
|
53
|
+
keys define config keys, and labels default to those keys.
|
|
54
|
+
- Unified loading, scoped patches, resolved values, warnings, key-level
|
|
55
|
+
updates, and scope resets on one stateful config object.
|
|
56
|
+
- Invalid known values now warn and are skipped during resolution;
|
|
57
|
+
`update()` rejects invalid values while preserving unrelated file contents.
|
|
58
|
+
- Simplified TUI editing controls and default/user/workspace source notes.
|
|
59
|
+
- Trimmed root type exports to `ConfigFromSchema`, `ConfigScope`, and
|
|
60
|
+
`ScopedConfig`.
|
|
61
|
+
|
|
62
|
+
### Removed
|
|
63
|
+
|
|
64
|
+
- TypeBox schema dependency; the library has no runtime dependencies.
|
|
65
|
+
|
|
66
|
+
## [0.0.1] - 2026-06-23
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- Initial scoped config library with user/workspace JSON storage, defaults,
|
|
71
|
+
fixed workspace precedence, and optional single-scope restriction.
|
|
72
|
+
- Enum, boolean, string, and number fields, including ranged numbers and
|
|
73
|
+
explicit numeric choices.
|
|
74
|
+
- Field validation, numeric range warnings, unknown-property preservation,
|
|
75
|
+
and deletion of empty config files.
|
|
76
|
+
- TUI editor with scope selection, include toggles, resets, descriptions,
|
|
77
|
+
conditional visibility, inline string/number editing, and live numeric
|
|
78
|
+
validation.
|
|
79
|
+
- Manual demo extension and usage documentation.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alexey Zaytsev <alexey.zaytsev@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# pi-lovely-config
|
|
2
|
+
|
|
3
|
+
Scoped config helpers for Pi extension packages.
|
|
4
|
+
|
|
5
|
+
Define a flat schema once. Get fixed user/workspace files, typed defaults,
|
|
6
|
+
merge semantics, validation warnings, key updates, and an optional TUI editor.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm i @xl0/pi-lovely-config
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
No extra runtime dependencies.
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import {
|
|
20
|
+
defineScopedConfig,
|
|
21
|
+
field
|
|
22
|
+
} from "@xl0/pi-lovely-config"
|
|
23
|
+
|
|
24
|
+
const config = defineScopedConfig({
|
|
25
|
+
fileName: "vibes.json",
|
|
26
|
+
schema: {
|
|
27
|
+
mood: field.enum(["calm", "spicy", "feral"], "calm"),
|
|
28
|
+
temperature: field.number(0.7, { min: 0, max: 2, step: 0.1 }),
|
|
29
|
+
signature: field.string("sent from pi"),
|
|
30
|
+
instructions: field.text("Keep replies concise.")
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
config.load(process.cwd())
|
|
35
|
+
console.log(config.value.mood, config.value.temperature)
|
|
36
|
+
|
|
37
|
+
config.update("workspace", "temperature", 1.1)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Model
|
|
41
|
+
|
|
42
|
+
Scopes are fixed:
|
|
43
|
+
|
|
44
|
+
| Scope | Path |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| User | `~/.pi/agent/<fileName>` |
|
|
47
|
+
| Workspace | `<cwd>/.pi/<fileName>` |
|
|
48
|
+
|
|
49
|
+
By default both scopes are active and workspace overrides user. Pass
|
|
50
|
+
`scope: "user"` or `scope: "workspace"` to `defineScopedConfig` for
|
|
51
|
+
single-scope configs.
|
|
52
|
+
|
|
53
|
+
Unknown keys are preserved in files but ignored by typed config resolution. This
|
|
54
|
+
lets newer config files survive older app versions.
|
|
55
|
+
|
|
56
|
+
Invalid known values, invalid JSON, and non-object config files are warnings and
|
|
57
|
+
are ignored while resolving. Writing a key replaces a malformed file with valid
|
|
58
|
+
config.
|
|
59
|
+
|
|
60
|
+
## Schema
|
|
61
|
+
|
|
62
|
+
Use field builders:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const config = defineScopedConfig({
|
|
66
|
+
fileName: "my-extension.json",
|
|
67
|
+
schema: {
|
|
68
|
+
theme: field.enum(["system", "light", "dark"], "system", {
|
|
69
|
+
label: "Theme",
|
|
70
|
+
description: "Preferred theme",
|
|
71
|
+
search: true
|
|
72
|
+
}),
|
|
73
|
+
compact: field.boolean(false),
|
|
74
|
+
signature: field.string("sent from pi"),
|
|
75
|
+
instructions: field.text("Keep replies concise.", {
|
|
76
|
+
label: "Instructions",
|
|
77
|
+
description: "Long multi-line text edited in the TUI editor"
|
|
78
|
+
}),
|
|
79
|
+
temperature: field.number(0.7, { min: 0, max: 2, step: 0.1 }),
|
|
80
|
+
retries: field.number(1, { values: [0, 1, 2, 3] }),
|
|
81
|
+
models: field.multiEnum(["gpt", "claude", "gemini"], ["claude"])
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Supported fields: enum, multiEnum, boolean, string, text, number. Multi-enum
|
|
87
|
+
fields resolve to a string array; scopes replace the whole array, no merging.
|
|
88
|
+
The TUI editor always opens a searchable checklist for them. String fields are
|
|
89
|
+
single-line. Text fields resolve to string values and use a multi-line TUI
|
|
90
|
+
editor. Number fields take either range mode (`min`/`max`/`step`) or an
|
|
91
|
+
explicit `values` list, never both.
|
|
92
|
+
|
|
93
|
+
UI-only metadata:
|
|
94
|
+
|
|
95
|
+
- `label` — display name; defaults to the key
|
|
96
|
+
- `description` — help text shown with the field
|
|
97
|
+
- `valueDescriptions` — per-value help, e.g. `{ dark: "Easy on the eyes" }`
|
|
98
|
+
- `search` — enum fields only; enables fuzzy picker in the TUI editor
|
|
99
|
+
- `depth` — indent level, for visually nesting fields under a parent
|
|
100
|
+
- `visibleWhen: ctx => boolean` — hide the field in the editor based on other
|
|
101
|
+
values (`ctx.get(key)`, `ctx.getScoped(key, scope?)`, `ctx.scope`). UI-only:
|
|
102
|
+
hidden saved values persist until cleared.
|
|
103
|
+
|
|
104
|
+
## Runtime API
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
config.load(ctx.cwd)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`config` now contains:
|
|
111
|
+
|
|
112
|
+
- `value` — defaults-filled merged config
|
|
113
|
+
- `scoped` — raw user/workspace patches, including unknown keys
|
|
114
|
+
- `warnings` — invalid field or malformed file warnings by scope/path; field warnings include `key`
|
|
115
|
+
|
|
116
|
+
Update one key:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
config.update("user", "theme", "dark")
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Unset one key:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
config.update("workspace", "theme", undefined)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Delete one scope config file:
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
config.resetScope("workspace")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Other useful properties/methods:
|
|
135
|
+
|
|
136
|
+
- `config.fields` — normalized field list for UI
|
|
137
|
+
- `config.defaults` — schema defaults as a plain object
|
|
138
|
+
- `config.path(scope)` — resolved file path for a scope
|
|
139
|
+
- `config.resolve(scoped)` — merge defaults + scope patches without file IO
|
|
140
|
+
|
|
141
|
+
## TUI editor
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
config.load(ctx.cwd)
|
|
145
|
+
|
|
146
|
+
await ctx.ui.custom<void>((tui, theme, _keys, done) => {
|
|
147
|
+
return new ScopedConfigEditor({
|
|
148
|
+
tui,
|
|
149
|
+
theme,
|
|
150
|
+
config,
|
|
151
|
+
onChange: config => {
|
|
152
|
+
ctx.ui.setStatus("vibes", `mood=${config.value.mood}`)
|
|
153
|
+
},
|
|
154
|
+
done
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Each row shows an include checkbox and a value, plus compact
|
|
160
|
+
default/user/workspace source notes. Left/right moves focus, Enter edits or
|
|
161
|
+
cycles values, Space toggles include, Esc discards uncommitted input.
|
|
162
|
+
|
|
163
|
+
Editor writes via `update()` / `resetScope()`, then reloads merged config.
|
|
164
|
+
|
|
165
|
+
## Releasing
|
|
166
|
+
|
|
167
|
+
Write entries under `CHANGELOG.md`'s `[Unreleased]`, then commit them.
|
|
168
|
+
From `master`, with Bun 1.3.13 and npm 12.0.2 (logged in):
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
bun run release [patch|minor|major|x.y.z] [--no-push]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The script checks the release, bumps the version, rolls the changelog, and
|
|
175
|
+
pauses for review before committing, tagging, and pushing. `--no-push`
|
|
176
|
+
stops after the local commit and tag.
|
|
177
|
+
|
|
178
|
+
The tag triggers `.github/workflows/publish.yml`: checks, npm staging with
|
|
179
|
+
OIDC provenance, then a GitHub Release. The script waits for staging and
|
|
180
|
+
asks for a 2FA code to approve publication; approval is also available on
|
|
181
|
+
npmjs.com.
|
|
182
|
+
|
|
183
|
+
Configure npm's GitHub Actions trusted publisher for `xl0/pi-lovely-config`,
|
|
184
|
+
workflow `publish.yml`, environment `npm`. The GitHub job uses that environment.
|
|
185
|
+
No npm token is needed in CI.
|
|
186
|
+
|
|
187
|
+
## Related projects
|
|
188
|
+
|
|
189
|
+
| | |
|
|
190
|
+
| --- | --- |
|
|
191
|
+
| [Pi Lovely Web](https://github.com/xl0/pi-lovely-web) | `web_search`, `web_fetch`, `web_image` tools |
|
|
192
|
+
| [Pi Lovely Dev Tools](https://github.com/xl0/pi-lovely-dev-tools) | `/tool`, `/show-sysprompt`, `/show-context`, `/llm-stats` |
|
|
193
|
+
| [Pi Lovely Codex](https://github.com/xl0/pi-lovely-codex) | GPT fast mode and Codex-style `apply_patch` |
|
|
194
|
+
| [Pi Lovely IDE](https://github.com/xl0/pi-lovely-ide) | Interactive IDE integration |
|
|
195
|
+
| [Pi Lovely Comment](https://github.com/xl0/agent-files/tree/master/pi/packages/pi-lovely-comment) | Open the last assistant message in your editor and sync edits back into the prompt |
|
|
196
|
+
| [Pi Lovely Rename](https://github.com/xl0/agent-files/tree/master/pi/packages/pi-lovely-rename) | Automatic and manual session naming |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
Like this work? [Hire me](https://alexey.work/cv?ref=pi-lovely-config)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xl0/pi-lovely-config",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Scoped config helpers for Pi extension packages",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publisher": "xl0",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Alexey Zaytsev",
|
|
10
|
+
"url": "https://github.com/xl0",
|
|
11
|
+
"email": "alexey.zaytsev@gmail.com"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/xl0/pi-lovely-config#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/xl0/pi-lovely-config/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/xl0/pi-lovely-config.git"
|
|
20
|
+
},
|
|
21
|
+
"packageManager": "bun@1.3.13",
|
|
22
|
+
"keywords": [
|
|
23
|
+
"pi",
|
|
24
|
+
"config",
|
|
25
|
+
"extensions",
|
|
26
|
+
"library"
|
|
27
|
+
],
|
|
28
|
+
"files": [
|
|
29
|
+
"src/",
|
|
30
|
+
"README.md",
|
|
31
|
+
"CHANGELOG.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./src/index.ts"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typecheck": "tsgo --noEmit",
|
|
39
|
+
"check": "bun run typecheck && bun run biome:check",
|
|
40
|
+
"prepublishOnly": "bun run check",
|
|
41
|
+
"release": "bun run scripts/release.ts",
|
|
42
|
+
"lint": "biome lint .",
|
|
43
|
+
"format": "biome format --write .",
|
|
44
|
+
"format:check": "biome format .",
|
|
45
|
+
"biome:check": "biome check ."
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@biomejs/biome": "^2.4.14",
|
|
49
|
+
"@earendil-works/pi-coding-agent": "^0.79.10",
|
|
50
|
+
"@earendil-works/pi-tui": "^0.79.10",
|
|
51
|
+
"@typescript/native-preview": "^7.0.0-dev.20260502.1",
|
|
52
|
+
"bun-types": "^1.3.13",
|
|
53
|
+
"typescript": "^6.0.3"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
57
|
+
"@earendil-works/pi-tui": "*"
|
|
58
|
+
}
|
|
59
|
+
}
|