@blackbelt-technology/pi-dashboard-skill-atlas-plugin 0.9.0 → 0.11.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/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@blackbelt-technology/pi-dashboard-skill-atlas-plugin",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Dashboard plugin showing every skill pi loads in a folder or globally as a typed relation graph (references, same package, shared tool), rebuilt automatically when skills change.",
5
+ "keywords": [
6
+ "pi-dashboard-plugin"
7
+ ],
5
8
  "license": "MIT",
6
9
  "publishConfig": {
7
10
  "access": "public"
@@ -89,8 +92,8 @@
89
92
  "wouter": ">=3.0.0"
90
93
  },
91
94
  "dependencies": {
92
- "@blackbelt-technology/dashboard-plugin-runtime": "^0.9.0",
93
- "@blackbelt-technology/pi-dashboard-shared": "^0.9.0",
95
+ "@blackbelt-technology/dashboard-plugin-runtime": "^0.11.0",
96
+ "@blackbelt-technology/pi-dashboard-shared": "^0.11.0",
94
97
  "@fastify/rate-limit": "^11.2.0",
95
98
  "@mdi/js": "^7.4.47",
96
99
  "@mdi/react": "^1.6.1"
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * REST client + URL helpers for the skill atlas.
3
- * Folder paths use the shell's base64url `/folder/:encodedCwd` codec.
3
+ * Folder routes use the runtime `./sdk` codec (`folderRouteHref`).
4
4
  * See change: add-skill-atlas-screen.
5
5
  */
6
+ import { folderRouteHref } from "@blackbelt-technology/dashboard-plugin-runtime/sdk";
6
7
  import type { SkillAtlasScope, SkillGraphResponse } from "../shared/types.js";
7
8
 
8
9
  const GRAPH_URL = "/api/plugins/skill-atlas/graph";
@@ -33,26 +34,9 @@ export function piResourceViewerUrl(filePath: string, title: string): string {
33
34
  return `/pi-resource?${q.toString()}`;
34
35
  }
35
36
 
36
- function encodeFolderPath(cwd: string): string {
37
- const bytes = new TextEncoder().encode(cwd);
38
- let bin = "";
39
- for (const b of bytes) bin += String.fromCharCode(b);
40
- return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
41
- }
42
-
43
- export function decodeFolderPath(encoded: string): string | null {
44
- try {
45
- const padded = encoded.replace(/-/g, "+").replace(/_/g, "/");
46
- const bin = atob(padded + "=".repeat((4 - (padded.length % 4)) % 4));
47
- return new TextDecoder("utf-8", { fatal: true }).decode(Uint8Array.from(bin, (c) => c.charCodeAt(0)));
48
- } catch {
49
- return null;
50
- }
51
- }
52
-
53
37
  /** Atlas URL; `sel` + `hops` preselect a skill (most-connected chips). */
54
38
  export function atlasUrl(scope: SkillAtlasScope, cwd?: string, sel?: string, hops?: number): string {
55
- const base = scope === "project" && cwd ? `/folder/${encodeFolderPath(cwd)}/atlas` : "/atlas";
39
+ const base = scope === "project" && cwd ? folderRouteHref(cwd, "/atlas") : "/atlas";
56
40
  if (!sel) return base;
57
41
  const q = new URLSearchParams({ sel });
58
42
  if (hops) q.set("hops", String(hops));
@@ -17,7 +17,7 @@ import { mdiGraphOutline } from "@mdi/js";
17
17
  import type React from "react";
18
18
  import { lazy, Suspense, useMemo } from "react";
19
19
  import { useLocation } from "wouter";
20
- import { atlasUrl, decodeFolderPath } from "./atlas-api.js";
20
+ import { atlasUrl } from "./atlas-api.js";
21
21
 
22
22
  const SkillAtlasPage = lazy(() => import("./SkillAtlasPage.js"));
23
23
  const AtlasSummary = lazy(() => import("./AtlasSummary.js").then((m) => ({ default: m.AtlasSummary })));
@@ -66,9 +66,8 @@ function PageFallback(): React.ReactElement {
66
66
  );
67
67
  }
68
68
 
69
- export function ProjectAtlasClaim({ params, onBack }: { params: Record<string, string>; onBack: () => void }): React.ReactElement {
69
+ export function ProjectAtlasClaim({ cwd, onBack }: { params?: Record<string, string>; cwd?: string; onBack: () => void }): React.ReactElement {
70
70
  const t = useT();
71
- const cwd = decodeFolderPath(params.encodedCwd ?? "");
72
71
  if (!cwd) {
73
72
  return (
74
73
  <div role="alert" className="p-4 text-[12px] text-[var(--severity-error-fg)]">