pi-roundtable-web 0.7.3 → 0.7.5
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 +8 -0
- package/README.md +1 -1
- package/dist/{chunk-32sbjm56.js → chunk-mr32cg74.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/src/console-api.ts +1 -1
- package/src/features.ts +6 -0
- package/src/http.ts +2 -0
- package/src/skills-api.ts +15 -7
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Console</title>
|
|
7
7
|
|
|
8
|
-
<link rel="stylesheet" crossorigin href="./chunk-e8z9q554.css"><script type="module" crossorigin src="./chunk-
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./chunk-e8z9q554.css"><script type="module" crossorigin src="./chunk-mr32cg74.js"></script></head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-roundtable-web",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "An owner-only web console for pi-roundtable: conversations, transcripts, and memory notes, with live updates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/bun": "1.4.2",
|
|
48
48
|
"@types/react": "19.3.0",
|
|
49
49
|
"@types/react-dom": "19.3.0",
|
|
50
|
-
"pi-roundtable": "0.7.
|
|
50
|
+
"pi-roundtable": "0.7.5",
|
|
51
51
|
"react": "19.3.0",
|
|
52
52
|
"react-dom": "19.3.0",
|
|
53
53
|
"react-markdown": "10.1.0",
|
package/src/console-api.ts
CHANGED
|
@@ -108,7 +108,7 @@ export class ConsoleApi {
|
|
|
108
108
|
if (error instanceof HttpError)
|
|
109
109
|
return json(
|
|
110
110
|
{
|
|
111
|
-
error: message(this.#ports.presentation, error.message)
|
|
111
|
+
error: `${message(this.#ports.presentation, error.message)}${error.detail ?? ""}`,
|
|
112
112
|
} satisfies ApiError,
|
|
113
113
|
error.status,
|
|
114
114
|
);
|
package/src/features.ts
CHANGED
|
@@ -21,6 +21,12 @@ export interface ConsoleFeatures {
|
|
|
21
21
|
read(
|
|
22
22
|
name: string,
|
|
23
23
|
): Promise<{ frontmatter: Record<string, unknown>; body: string }>;
|
|
24
|
+
/**
|
|
25
|
+
* Show why a skill could not be read (the catalog's `missing` text, or the read error's
|
|
26
|
+
* message, cut at 300 characters) after the fixed message. Off by default: the reason may
|
|
27
|
+
* name a path.
|
|
28
|
+
*/
|
|
29
|
+
errorDetail?: boolean;
|
|
24
30
|
};
|
|
25
31
|
connectors?: {
|
|
26
32
|
gateways(): Promise<ConnectorsView["gateways"]>;
|
package/src/http.ts
CHANGED
package/src/skills-api.ts
CHANGED
|
@@ -25,14 +25,13 @@ export async function skillDetail(
|
|
|
25
25
|
): Promise<SkillDetailView> {
|
|
26
26
|
const entry = skills.catalog().find((s) => s.name === name);
|
|
27
27
|
if (!entry) throw new HttpError(404, "There is no such skill.");
|
|
28
|
-
if (entry.missing)
|
|
28
|
+
if (entry.missing)
|
|
29
|
+
throw skills.errorDetail
|
|
30
|
+
? new HttpError(404, "The skill file is missing: ", entry.missing)
|
|
31
|
+
: new HttpError(404, "The skill file is missing.");
|
|
29
32
|
try {
|
|
33
|
+
// The host's `read` enforces any size limit; the console shows what it returns.
|
|
30
34
|
const parsed = await skills.read(name);
|
|
31
|
-
if (
|
|
32
|
-
Buffer.byteLength(parsed.body) > 1024 * 1024 ||
|
|
33
|
-
Buffer.byteLength(JSON.stringify(parsed.frontmatter)) > 64 * 1024
|
|
34
|
-
)
|
|
35
|
-
throw new HttpError(413, "The skill file is too large.");
|
|
36
35
|
return {
|
|
37
36
|
name,
|
|
38
37
|
body: parsed.body,
|
|
@@ -40,7 +39,16 @@ export async function skillDetail(
|
|
|
40
39
|
};
|
|
41
40
|
} catch (error) {
|
|
42
41
|
if (error instanceof HttpError) throw error;
|
|
43
|
-
throw
|
|
42
|
+
throw skills.errorDetail
|
|
43
|
+
? new HttpError(
|
|
44
|
+
422,
|
|
45
|
+
"The skill frontmatter could not be read: ",
|
|
46
|
+
(error instanceof Error ? error.message : String(error)).slice(
|
|
47
|
+
0,
|
|
48
|
+
300,
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
: new HttpError(422, "The skill frontmatter could not be read.");
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
|