@narumitw/pi-herdr 0.3.0 → 0.3.1
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 +7 -2
- package/dist/chunks/herdr-menu-IUPFF5YK.ts +56 -0
- package/dist/chunks/herdr-menu-IUPFF5YK.ts.map +7 -0
- package/dist/index.ts +1587 -0
- package/dist/index.ts.map +7 -0
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -30,12 +30,15 @@ Try from npm without installing permanently:
|
|
|
30
30
|
pi -e npm:@narumitw/pi-herdr
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Build and load a local checkout from the repository root:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
+
npm --workspace @narumitw/pi-herdr run build
|
|
36
37
|
pi --no-extensions -e ./packages/pi-herdr
|
|
37
38
|
```
|
|
38
39
|
|
|
40
|
+
An unbuilt local checkout has no generated entrypoint and cannot be loaded by package directory.
|
|
41
|
+
|
|
39
42
|
Pi extensions and skills run with your user permissions.
|
|
40
43
|
Install only trusted packages, and review the source and bundled instructions before loading this package.
|
|
41
44
|
|
|
@@ -181,8 +184,10 @@ Command recipes, approval handling, and other operating safety rules come from t
|
|
|
181
184
|
```text
|
|
182
185
|
packages/pi-herdr/
|
|
183
186
|
├── src/ # Authoritative implementation and helpers
|
|
184
|
-
│ ├── index.ts # Thin
|
|
187
|
+
│ ├── index.ts # Thin repository entrypoint
|
|
185
188
|
│ └── herdr-agent-state.ts # Herdr lifecycle integration
|
|
189
|
+
├── dist/ # Generated TypeScript runtime loaded by Pi
|
|
190
|
+
├── scripts/ # Deterministic runtime builder
|
|
186
191
|
├── skills/herdr/ # Published bootstrap for CLI-owned guidance
|
|
187
192
|
└── test/ # Behavior and lifecycle coverage
|
|
188
193
|
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
+
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
+
|
|
4
|
+
// src/herdr-menu.ts
|
|
5
|
+
function createHerdrMenu(options) {
|
|
6
|
+
return {
|
|
7
|
+
start: "main",
|
|
8
|
+
screens: {
|
|
9
|
+
// One setting stays on the main menu, matching /tool rather than adding a submenu.
|
|
10
|
+
main: () => ({
|
|
11
|
+
kind: "actions",
|
|
12
|
+
title: "Herdr",
|
|
13
|
+
items: [
|
|
14
|
+
{
|
|
15
|
+
id: "widget",
|
|
16
|
+
label: `Agent widget: ${options.isEnabled() ? "On" : "Off"}`,
|
|
17
|
+
description: "Show or hide sibling agents above the editor",
|
|
18
|
+
action: "toggle"
|
|
19
|
+
},
|
|
20
|
+
{ id: "status", label: "Status", to: "status" },
|
|
21
|
+
{ id: "help", label: "Help", to: "help" },
|
|
22
|
+
{ id: "close", label: "Close", close: true }
|
|
23
|
+
],
|
|
24
|
+
hint: "close"
|
|
25
|
+
}),
|
|
26
|
+
status: () => ({
|
|
27
|
+
kind: "detail",
|
|
28
|
+
title: "Herdr Status",
|
|
29
|
+
lines: [
|
|
30
|
+
`Agent widget setting: ${options.isEnabled() ? "on" : "off"}`,
|
|
31
|
+
"The widget appears only in TUI mode with recognized sibling agents.",
|
|
32
|
+
"Lifecycle and metadata reporting are independent of this setting.",
|
|
33
|
+
`User settings file: ${options.settingsPath}`
|
|
34
|
+
],
|
|
35
|
+
hint: "back"
|
|
36
|
+
}),
|
|
37
|
+
help: () => ({
|
|
38
|
+
kind: "detail",
|
|
39
|
+
title: "Herdr Help",
|
|
40
|
+
lines: [
|
|
41
|
+
"Toggle Agent widget from /herdr. Changes are saved immediately; closing does not undo them.",
|
|
42
|
+
"Manual pi-herdr.json changes apply after /reload or the next session start.",
|
|
43
|
+
"The widget defaults to on. Project overrides are not read."
|
|
44
|
+
],
|
|
45
|
+
hint: "back"
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
actions: {
|
|
49
|
+
toggle: async ({ signal }) => await options.toggle(signal) ? { kind: "stay" } : { kind: "rejected" }
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
createHerdrMenu
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=herdr-menu-IUPFF5YK.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/herdr-menu.ts"],
|
|
4
|
+
"sourcesContent": ["import type { MenuDefinition } from \"@narumitw/pi-tui-kit\";\n\nexport function createHerdrMenu(options: {\n settingsPath: string;\n isEnabled(): boolean;\n toggle(signal: AbortSignal): Promise<boolean>;\n}): MenuDefinition<undefined, \"main\" | \"status\" | \"help\", \"toggle\"> {\n return {\n start: \"main\",\n screens: {\n // One setting stays on the main menu, matching /tool rather than adding a submenu.\n main: () => ({\n kind: \"actions\",\n title: \"Herdr\",\n items: [\n {\n id: \"widget\",\n label: `Agent widget: ${options.isEnabled() ? \"On\" : \"Off\"}`,\n description: \"Show or hide sibling agents above the editor\",\n action: \"toggle\",\n },\n { id: \"status\", label: \"Status\", to: \"status\" },\n { id: \"help\", label: \"Help\", to: \"help\" },\n { id: \"close\", label: \"Close\", close: true },\n ],\n hint: \"close\",\n }),\n status: () => ({\n kind: \"detail\",\n title: \"Herdr Status\",\n lines: [\n `Agent widget setting: ${options.isEnabled() ? \"on\" : \"off\"}`,\n \"The widget appears only in TUI mode with recognized sibling agents.\",\n \"Lifecycle and metadata reporting are independent of this setting.\",\n `User settings file: ${options.settingsPath}`,\n ],\n hint: \"back\",\n }),\n help: () => ({\n kind: \"detail\",\n title: \"Herdr Help\",\n lines: [\n \"Toggle Agent widget from /herdr. Changes are saved immediately; closing does not undo them.\",\n \"Manual pi-herdr.json changes apply after /reload or the next session start.\",\n \"The widget defaults to on. Project overrides are not read.\",\n ],\n hint: \"back\",\n }),\n },\n actions: {\n toggle: async ({ signal }) => ((await options.toggle(signal)) ? { kind: \"stay\" } : { kind: \"rejected\" }),\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAEO,SAAS,gBAAgB,SAIoC;AAClE,SAAO;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA;AAAA,MAEP,MAAM,OAAO;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO;AAAA,UACL;AAAA,YACE,IAAI;AAAA,YACJ,OAAO,iBAAiB,QAAQ,UAAU,IAAI,OAAO,KAAK;AAAA,YAC1D,aAAa;AAAA,YACb,QAAQ;AAAA,UACV;AAAA,UACA,EAAE,IAAI,UAAU,OAAO,UAAU,IAAI,SAAS;AAAA,UAC9C,EAAE,IAAI,QAAQ,OAAO,QAAQ,IAAI,OAAO;AAAA,UACxC,EAAE,IAAI,SAAS,OAAO,SAAS,OAAO,KAAK;AAAA,QAC7C;AAAA,QACA,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO;AAAA,QACb,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO;AAAA,UACL,yBAAyB,QAAQ,UAAU,IAAI,OAAO,KAAK;AAAA,UAC3D;AAAA,UACA;AAAA,UACA,uBAAuB,QAAQ,YAAY;AAAA,QAC7C;AAAA,QACA,MAAM;AAAA,MACR;AAAA,MACA,MAAM,OAAO;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,QAAQ,OAAO,EAAE,OAAO,MAAQ,MAAM,QAAQ,OAAO,MAAM,IAAK,EAAE,MAAM,OAAO,IAAI,EAAE,MAAM,WAAW;AAAA,IACxG;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|