@howaboua/pi-agent-board 0.0.7 → 0.0.8
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 +4 -0
- package/dist/viewer/web/app.js +6 -6
- package/dist/viewer/web/render.js +2 -2
- package/package.json +69 -68
- package/src/board/activity.ts +1 -0
- package/src/board/delivery.ts +8 -6
- package/src/board/runtime/activation.ts +2 -3
- package/src/board/runtime/catchup.ts +1 -1
- package/src/board/viewer/web/app.js +6 -6
- package/src/board/viewer/web/render.js +2 -2
package/CHANGELOG.md
CHANGED
package/dist/viewer/web/app.js
CHANGED
|
@@ -22,25 +22,25 @@ const { refresh, moreThreads, moreReplies } = createUpdates(renderer);
|
|
|
22
22
|
|
|
23
23
|
$("boards").onchange = () => run(() => loadBoard($("boards").value));
|
|
24
24
|
$("author").onchange = () =>
|
|
25
|
-
run(async () => {
|
|
25
|
+
void run(async () => {
|
|
26
26
|
state.author = $("author").value;
|
|
27
27
|
await loadList();
|
|
28
28
|
});
|
|
29
29
|
$("search-form").onsubmit = (event) => {
|
|
30
30
|
event.preventDefault();
|
|
31
|
-
run(async () => {
|
|
31
|
+
void run(async () => {
|
|
32
32
|
state.query = $("search").value.trim();
|
|
33
33
|
state.searchFull = $("search-full").checked;
|
|
34
34
|
await loadList();
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
$("search-full").onchange = () =>
|
|
38
|
-
run(async () => {
|
|
38
|
+
void run(async () => {
|
|
39
39
|
state.searchFull = $("search-full").checked;
|
|
40
40
|
await loadList();
|
|
41
41
|
});
|
|
42
42
|
$("full-discussion").onchange = () =>
|
|
43
|
-
run(() => openThread(state.thread, $("full-discussion").checked));
|
|
43
|
+
void run(() => openThread(state.thread, $("full-discussion").checked));
|
|
44
44
|
$("refresh").onclick = () => run(() => refresh(true));
|
|
45
45
|
$("back").onclick = () => {
|
|
46
46
|
document.body.classList.remove("detail-open");
|
|
@@ -81,8 +81,8 @@ async function start() {
|
|
|
81
81
|
const requestedThread = fragment.get("thread");
|
|
82
82
|
if (requestedThread) await openThread(requestedThread);
|
|
83
83
|
}
|
|
84
|
-
run(start);
|
|
84
|
+
void run(start);
|
|
85
85
|
setInterval(() => {
|
|
86
86
|
if (!document.hidden && $("live").checked && state.board && !busy && !changed)
|
|
87
|
-
run(() => refresh());
|
|
87
|
+
void run(() => refresh());
|
|
88
88
|
}, 5000);
|
|
@@ -32,7 +32,7 @@ export function createBoardRenderer(loadList, openThread) {
|
|
|
32
32
|
if (channel.posts !== undefined)
|
|
33
33
|
button.append(node("small", "", String(channel.posts)));
|
|
34
34
|
button.onclick = () =>
|
|
35
|
-
run(async () => {
|
|
35
|
+
void run(async () => {
|
|
36
36
|
state.channel = channel.name;
|
|
37
37
|
await loadList();
|
|
38
38
|
renderBoard();
|
|
@@ -106,7 +106,7 @@ export function createBoardRenderer(loadList, openThread) {
|
|
|
106
106
|
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
107
107
|
return;
|
|
108
108
|
event.preventDefault();
|
|
109
|
-
run(() => openThread(thread.id));
|
|
109
|
+
void run(() => openThread(thread.id));
|
|
110
110
|
};
|
|
111
111
|
return link;
|
|
112
112
|
}),
|
package/package.json
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
2
|
+
"name": "@howaboua/pi-agent-board",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "Standalone agent message boards and a read-only browser viewer for Pi",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/IgorWarzocha/howaboua-pi-stuff.git",
|
|
10
|
+
"directory": "packages/pi-agent-board"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"index.ts",
|
|
14
|
+
"src",
|
|
15
|
+
"README.md",
|
|
16
|
+
"CHANGELOG.md",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"tsconfig.json",
|
|
19
|
+
"runtime.ts",
|
|
20
|
+
"dist",
|
|
21
|
+
"INTEGRATION.md",
|
|
22
|
+
"scripts",
|
|
23
|
+
"tsconfig.viewer.json"
|
|
24
|
+
],
|
|
25
|
+
"main": "index.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./index.ts",
|
|
28
|
+
"./runtime": "./runtime.ts",
|
|
29
|
+
"./integration": "./src/board/integration.ts"
|
|
30
|
+
},
|
|
31
|
+
"pi": {
|
|
32
|
+
"extensions": [
|
|
33
|
+
"./index.ts"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=22.19.0"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "node scripts/build-viewer.mjs",
|
|
41
|
+
"check": "bun run lint && bun run typecheck",
|
|
42
|
+
"lint": "bun run format:check && oxlint --type-aware",
|
|
43
|
+
"typecheck": "tsrs --noEmit",
|
|
44
|
+
"prepack": "bun run check && bun run build",
|
|
45
|
+
"pack:dry": "npm pack --dry-run",
|
|
46
|
+
"format:check": "oxfmt --check '**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx,json,jsonc,json5,css}'"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@earendil-works/pi-schema": "1.5.2",
|
|
50
|
+
"dompurify": "3.4.17",
|
|
51
|
+
"marked": "18.2.0",
|
|
52
|
+
"unicode-case-folding": "1.1.2"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@earendil-works/pi-ai": ">=1.1.0",
|
|
56
|
+
"@earendil-works/pi-coding-agent": ">=1.5.0",
|
|
57
|
+
"@earendil-works/pi-tui": ">=1.1.0",
|
|
58
|
+
"@howaboua/pi-codex-conversion": ">=5.0.1"
|
|
59
|
+
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"@howaboua/pi-codex-conversion": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@howaboua/pi-codex-conversion": "5.0.1"
|
|
70
|
+
}
|
|
70
71
|
}
|
package/src/board/activity.ts
CHANGED
|
@@ -102,6 +102,7 @@ function boardRow(entry: SessionEntry): BoardRow | undefined {
|
|
|
102
102
|
label: [label, channel]
|
|
103
103
|
.filter(Boolean)
|
|
104
104
|
.join(" · ")
|
|
105
|
+
// oxlint-disable-next-line no-control-regex -- Intentionally matches terminal controls or rejects control characters at the boundary.
|
|
105
106
|
.replace(/[\r\n\t\x00-\x1f\x7f]/g, " "),
|
|
106
107
|
detail: () => JSON.stringify(entry.data, null, 2) ?? "",
|
|
107
108
|
};
|
package/src/board/delivery.ts
CHANGED
|
@@ -10,12 +10,14 @@ type Delivery =
|
|
|
10
10
|
let optionalDelivery: Promise<Delivery | undefined> | undefined;
|
|
11
11
|
|
|
12
12
|
function loadDelivery() {
|
|
13
|
-
return (optionalDelivery ??=
|
|
14
|
-
"@howaboua/pi-codex-conversion/developer-messages"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
return (optionalDelivery ??=
|
|
14
|
+
import("@howaboua/pi-codex-conversion/developer-messages").catch(
|
|
15
|
+
(error) => {
|
|
16
|
+
if (isMissingOptionalModule(error, "developer-messages"))
|
|
17
|
+
return undefined;
|
|
18
|
+
throw error;
|
|
19
|
+
},
|
|
20
|
+
));
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export function isMissingOptionalModule(error: unknown, subpath: string) {
|
|
@@ -8,9 +8,8 @@ export async function activateBoard(pi: ExtensionAPI, runtime: BoardRuntime) {
|
|
|
8
8
|
const tool = createBoardTool(runtime);
|
|
9
9
|
pi.registerTool(tool);
|
|
10
10
|
try {
|
|
11
|
-
const { registerGptPromptMode, prepareGptPromptMode } =
|
|
12
|
-
"@howaboua/pi-codex-conversion/prompt-mode"
|
|
13
|
-
);
|
|
11
|
+
const { registerGptPromptMode, prepareGptPromptMode } =
|
|
12
|
+
await import("@howaboua/pi-codex-conversion/prompt-mode");
|
|
14
13
|
runtime.setPromptModePreparation((ctx) => prepareGptPromptMode(pi, ctx));
|
|
15
14
|
registerGptPromptMode(pi, (active) => {
|
|
16
15
|
runtime.gptPromptMode = active;
|
|
@@ -22,25 +22,25 @@ const { refresh, moreThreads, moreReplies } = createUpdates(renderer);
|
|
|
22
22
|
|
|
23
23
|
$("boards").onchange = () => run(() => loadBoard($("boards").value));
|
|
24
24
|
$("author").onchange = () =>
|
|
25
|
-
run(async () => {
|
|
25
|
+
void run(async () => {
|
|
26
26
|
state.author = $("author").value;
|
|
27
27
|
await loadList();
|
|
28
28
|
});
|
|
29
29
|
$("search-form").onsubmit = (event) => {
|
|
30
30
|
event.preventDefault();
|
|
31
|
-
run(async () => {
|
|
31
|
+
void run(async () => {
|
|
32
32
|
state.query = $("search").value.trim();
|
|
33
33
|
state.searchFull = $("search-full").checked;
|
|
34
34
|
await loadList();
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
$("search-full").onchange = () =>
|
|
38
|
-
run(async () => {
|
|
38
|
+
void run(async () => {
|
|
39
39
|
state.searchFull = $("search-full").checked;
|
|
40
40
|
await loadList();
|
|
41
41
|
});
|
|
42
42
|
$("full-discussion").onchange = () =>
|
|
43
|
-
run(() => openThread(state.thread, $("full-discussion").checked));
|
|
43
|
+
void run(() => openThread(state.thread, $("full-discussion").checked));
|
|
44
44
|
$("refresh").onclick = () => run(() => refresh(true));
|
|
45
45
|
$("back").onclick = () => {
|
|
46
46
|
document.body.classList.remove("detail-open");
|
|
@@ -81,8 +81,8 @@ async function start() {
|
|
|
81
81
|
const requestedThread = fragment.get("thread");
|
|
82
82
|
if (requestedThread) await openThread(requestedThread);
|
|
83
83
|
}
|
|
84
|
-
run(start);
|
|
84
|
+
void run(start);
|
|
85
85
|
setInterval(() => {
|
|
86
86
|
if (!document.hidden && $("live").checked && state.board && !busy && !changed)
|
|
87
|
-
run(() => refresh());
|
|
87
|
+
void run(() => refresh());
|
|
88
88
|
}, 5000);
|
|
@@ -32,7 +32,7 @@ export function createBoardRenderer(loadList, openThread) {
|
|
|
32
32
|
if (channel.posts !== undefined)
|
|
33
33
|
button.append(node("small", "", String(channel.posts)));
|
|
34
34
|
button.onclick = () =>
|
|
35
|
-
run(async () => {
|
|
35
|
+
void run(async () => {
|
|
36
36
|
state.channel = channel.name;
|
|
37
37
|
await loadList();
|
|
38
38
|
renderBoard();
|
|
@@ -106,7 +106,7 @@ export function createBoardRenderer(loadList, openThread) {
|
|
|
106
106
|
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
107
107
|
return;
|
|
108
108
|
event.preventDefault();
|
|
109
|
-
run(() => openThread(thread.id));
|
|
109
|
+
void run(() => openThread(thread.id));
|
|
110
110
|
};
|
|
111
111
|
return link;
|
|
112
112
|
}),
|