@blackbelt-technology/pi-dashboard-team-plugin 0.9.0 → 0.10.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/README.md +18 -1
- package/dist/app/assets/{InlineTerminalCard-BRjmM13k.js → InlineTerminalCard-DW7qFTuI.js} +1 -1
- package/dist/app/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/app/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/app/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/app/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/app/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/app/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/app/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/app/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/app/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/app/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/app/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/app/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/app/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/app/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/app/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/app/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/app/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/app/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/app/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/app/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/app/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/app/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/app/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/app/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/app/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/app/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/app/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/app/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/app/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/app/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/app/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/app/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/app/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/app/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/app/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/app/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/app/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/app/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/app/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/app/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/app/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/app/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/app/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/app/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/app/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/app/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/app/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/app/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/app/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/app/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/app/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/app/assets/{PdfPreview-CCfKQhLL.js → PdfPreview-DQKr3Ptp.js} +1 -1
- package/dist/app/assets/{RichDiff-zrt7rxm3.js → RichDiff-FlSFtgaa.js} +7 -7
- package/dist/app/assets/abnfDiagram-VCTEODGH-DzBPGdfj.js +1 -0
- package/dist/app/assets/arc-Db5WL6r9.js +1 -0
- package/dist/app/assets/architectureDiagram-5GKGNRK7-BQpe2TNK.js +36 -0
- package/dist/app/assets/{blockDiagram-I7D4REHJ-M5oRqDla.js → blockDiagram-I7D4REHJ-BgCmLaKA.js} +2 -2
- package/dist/app/assets/{c4Diagram-7LVT6UL2-C6v6KvuZ.js → c4Diagram-7LVT6UL2-_PhalThw.js} +2 -2
- package/dist/app/assets/channel-B49F0XQ7.js +1 -0
- package/dist/app/assets/{chunk-2Q5K7J3B-BrSnR-LD.js → chunk-2Q5K7J3B-BTPmsvl_.js} +1 -1
- package/dist/app/assets/{chunk-5VM5RSS4-BAqdD3be.js → chunk-5VM5RSS4-CVAIVX2p.js} +1 -1
- package/dist/app/assets/{chunk-F27PBJKO-DNLocP_Z.js → chunk-F27PBJKO-D3CtqJt1.js} +1 -1
- package/dist/app/assets/{chunk-IMKFNOWR-DwFLWoAj.js → chunk-IMKFNOWR-BqUz3ypv.js} +4 -4
- package/dist/app/assets/{chunk-JWPE2WC7-DwOQUkPK.js → chunk-JWPE2WC7-DUZ7N-GF.js} +1 -1
- package/dist/app/assets/{chunk-POPQ4Y6H-CN6vxbUi.js → chunk-POPQ4Y6H-07WqhpWx.js} +1 -1
- package/dist/app/assets/{chunk-SVP7TREG-mfOuPsxp.js → chunk-SVP7TREG-Cm2L9T4G.js} +1 -1
- package/dist/app/assets/{chunk-TICWLB2K-R4JNWs6J.js → chunk-TICWLB2K-eq77BKkc.js} +3 -3
- package/dist/app/assets/{chunk-XXDRQBXY-Bwj8o9dr.js → chunk-XXDRQBXY-C7MtNMWW.js} +1 -1
- package/dist/app/assets/classDiagram-ZZMXUADV-BRJiKHXN.js +1 -0
- package/dist/app/assets/classDiagram-v2-VYDZK3BY-BRJiKHXN.js +1 -0
- package/dist/app/assets/cose-bilkent-JH36ORCC-DzKOasFS.js +1 -0
- package/dist/app/assets/{cynefin-OW5HDTMX-CNttFTW2.js → cynefin-OW5HDTMX-CfwDMx4l.js} +1 -1
- package/dist/app/assets/cynefinDiagram-5FMLGOSQ-B49YEFaN.js +62 -0
- package/dist/app/assets/{dagre-GXQ25YYZ-D-VD0Tcu.js → dagre-GXQ25YYZ-DUM8H3yt.js} +2 -2
- package/dist/app/assets/{diagram-S7CK7UJ4-CQReIUYr.js → diagram-S7CK7UJ4-BikoIImA.js} +4 -4
- package/dist/app/assets/diagram-UQ7AKVKN-C9xJpyKN.js +41 -0
- package/dist/app/assets/diagram-VSXAHHWV-DMZrJWN1.js +3 -0
- package/dist/app/assets/diagram-VX7I27RA-BgpgslRO.js +24 -0
- package/dist/app/assets/diagram-Z3DM3KII-jn5qnmcy.js +24 -0
- package/dist/app/assets/ebnfDiagram-PWID7BFC-CH3Fj_if.js +1 -0
- package/dist/app/assets/{erDiagram-RLTQ6QDP-DKoQjGux.js → erDiagram-RLTQ6QDP-DMjJBUCG.js} +2 -2
- package/dist/app/assets/{flowDiagram-HODETNUW-gq74Q1SF.js → flowDiagram-HODETNUW-oNU24Ye_.js} +4 -4
- package/dist/app/assets/ganttDiagram-EL5Y4UJY-C2zwi0FT.js +292 -0
- package/dist/app/assets/gitGraphDiagram-WWUBYQGX-BYCKF4kO.js +106 -0
- package/dist/app/assets/index-9KN5q5uZ.js +287 -0
- package/dist/app/assets/index-B2G_sUzr.js +3 -0
- package/dist/app/assets/index-B_GqR51t.css +1 -0
- package/dist/app/assets/infoDiagram-27XIBGKW-CrCN2toE.js +2 -0
- package/dist/app/assets/{ishikawaDiagram-5VMMS53U-DArpl74K.js → ishikawaDiagram-5VMMS53U-0iJj74kM.js} +2 -2
- package/dist/app/assets/{journeyDiagram-3NMN7TZE-B2sUGe5l.js → journeyDiagram-3NMN7TZE-DgMxPj39.js} +2 -2
- package/dist/app/assets/{kanban-definition-UXKFOSKX-Cx6oCBKM.js → kanban-definition-UXKFOSKX-DZIb7tVw.js} +7 -7
- package/dist/app/assets/katex-C5jXJg4s.js +257 -0
- package/dist/app/assets/katex-Ce-tjK1g.css +1 -0
- package/dist/app/assets/{layout-BjHuHx4m.js → layout-DQIvBakv.js} +1 -1
- package/dist/app/assets/{linear-CgCYMSPy.js → linear-sjXL1SLi.js} +1 -1
- package/dist/app/assets/{mdi-DoP81khn.js → mdi-BExM2XdQ.js} +1 -1
- package/dist/app/assets/mermaid-block-locator-CurhUNEi.js +5 -0
- package/dist/app/assets/mermaid-repair-C9fy3MS0.js +10 -0
- package/dist/app/assets/mermaid-repair-api-CO6VbH78.js +1 -0
- package/dist/app/assets/mermaid.core-C1pLMwEV.js +310 -0
- package/dist/app/assets/{mindmap-definition-YA3MSWOX-DP2Penfk.js → mindmap-definition-YA3MSWOX-Ccil60ZG.js} +3 -3
- package/dist/app/assets/pegDiagram-XKGWAZYB-BrI6zt95.js +1 -0
- package/dist/app/assets/{pieDiagram-E7YTZNPT-BHJIw8Ie.js → pieDiagram-E7YTZNPT-Cjxxn_Dn.js} +3 -3
- package/dist/app/assets/purify.es-CYR4BTuT.js +3 -0
- package/dist/app/assets/{quadrantDiagram-AXDQQJYC-CKJDe9v8.js → quadrantDiagram-AXDQQJYC-DZIHLR6S.js} +4 -4
- package/dist/app/assets/railroadDiagram-O6MQD6OU-BCBEYQn3.js +1 -0
- package/dist/app/assets/{requirementDiagram-BXWQKSXE-CbgXwlu-.js → requirementDiagram-BXWQKSXE-wpVC9c8i.js} +2 -2
- package/dist/app/assets/{sankeyDiagram-P5KCCOFB-xTHr7bNV.js → sankeyDiagram-P5KCCOFB-C2BXPZ46.js} +3 -3
- package/dist/app/assets/{sequenceDiagram-WJ2MYXX4-BJO_VejT.js → sequenceDiagram-WJ2MYXX4-aXfCHnZ_.js} +2 -2
- package/dist/app/assets/sizeCapture-INFHLROL-CkTnQSJD.js +1 -0
- package/dist/app/assets/stateDiagram-D77RDMKH-B2MyGf8l.js +1 -0
- package/dist/app/assets/stateDiagram-v2-MP3YSRHH-Co0nC0rh.js +1 -0
- package/dist/app/assets/swimlanes-42K2YHIH-sOcGW-Ud.js +1 -0
- package/dist/app/assets/swimlanesDiagram-VR7AAH4N-xtUfpzrL.js +8 -0
- package/dist/app/assets/{timeline-definition-24CTP7MA-BaspCbTG.js → timeline-definition-24CTP7MA-C_9MbuiH.js} +4 -4
- package/dist/app/assets/vennDiagram-4TSXK5OY-BWHdyrio.js +34 -0
- package/dist/app/assets/{wardleyDiagram-VM6X3IG4-7u6IS5Iz.js → wardleyDiagram-VM6X3IG4-B22lSp2F.js} +2 -2
- package/dist/app/assets/{xychartDiagram-S5SC5T6Z-D-TnlcEC.js → xychartDiagram-S5SC5T6Z-CznBdNTF.js} +2 -2
- package/dist/app/index.html +2 -2
- package/package.json +4 -4
- package/src/client/FolderTeamSection.tsx +2 -2
- package/src/configSchema.json +63 -2
- package/src/extension/guard.ts +86 -5
- package/src/extension/index.ts +28 -2
- package/src/server/conversations.ts +257 -16
- package/src/server/index.ts +9 -2
- package/src/server/paths.ts +8 -2
- package/src/server/persona.ts +23 -4
- package/src/server/personas-service.ts +15 -3
- package/src/server/projects.ts +7 -3
- package/src/server/records.ts +23 -3
- package/src/server/routes.ts +42 -3
- package/src/server/skills-service.ts +681 -0
- package/src/server/store.ts +28 -4
- package/src/server/team.ts +39 -3
- package/src/server/types.ts +26 -4
- package/src/server/users.ts +9 -3
- package/dist/app/assets/abnfDiagram-VCTEODGH-BNRJZIa7.js +0 -1
- package/dist/app/assets/arc-Ccw1WVCw.js +0 -1
- package/dist/app/assets/architectureDiagram-5GKGNRK7-CmpCS5s2.js +0 -36
- package/dist/app/assets/channel-1wFLoesq.js +0 -1
- package/dist/app/assets/classDiagram-ZZMXUADV-DeqkIaZ-.js +0 -1
- package/dist/app/assets/classDiagram-v2-VYDZK3BY-DeqkIaZ-.js +0 -1
- package/dist/app/assets/cose-bilkent-JH36ORCC-qCY2WMN8.js +0 -1
- package/dist/app/assets/cynefinDiagram-5FMLGOSQ-CBX-RJXy.js +0 -62
- package/dist/app/assets/diagram-UQ7AKVKN-DyEU0WYX.js +0 -41
- package/dist/app/assets/diagram-VSXAHHWV-NLLDj0k8.js +0 -3
- package/dist/app/assets/diagram-VX7I27RA-Daf-u6xI.js +0 -24
- package/dist/app/assets/diagram-Z3DM3KII-B0O71sZp.js +0 -24
- package/dist/app/assets/ebnfDiagram-PWID7BFC-BSRAXWwk.js +0 -1
- package/dist/app/assets/ganttDiagram-EL5Y4UJY-BIAOolFj.js +0 -292
- package/dist/app/assets/gitGraphDiagram-WWUBYQGX-BvZquV67.js +0 -106
- package/dist/app/assets/index-BTj-g2DX.js +0 -559
- package/dist/app/assets/index-owClP-R3.css +0 -1
- package/dist/app/assets/infoDiagram-27XIBGKW-dMwJRmit.js +0 -2
- package/dist/app/assets/mermaid.core-DiBBwf02.js +0 -312
- package/dist/app/assets/pegDiagram-XKGWAZYB-DuPy_Jk1.js +0 -1
- package/dist/app/assets/railroadDiagram-O6MQD6OU-CPmw2XqA.js +0 -1
- package/dist/app/assets/sizeCapture-INFHLROL-BOIqspBs.js +0 -1
- package/dist/app/assets/stateDiagram-D77RDMKH-B1M9C9C6.js +0 -1
- package/dist/app/assets/stateDiagram-v2-MP3YSRHH-BWPtAAkO.js +0 -1
- package/dist/app/assets/swimlanes-42K2YHIH-BtpfWryU.js +0 -1
- package/dist/app/assets/swimlanesDiagram-VR7AAH4N-CRZvPlTl.js +0 -8
- package/dist/app/assets/vennDiagram-4TSXK5OY-Rzs4n1uC.js +0 -34
package/src/server/projects.ts
CHANGED
|
@@ -69,12 +69,14 @@ function slugify(base: string): string {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export class ProjectRegistry {
|
|
72
|
+
private readonly deps: ProjectDeps;
|
|
72
73
|
private readonly ops: FsOps;
|
|
73
74
|
private accepted = new Set<string>();
|
|
74
75
|
private acceptedFor = "";
|
|
75
76
|
private readonly warned = new Set<string>();
|
|
76
77
|
|
|
77
|
-
constructor(
|
|
78
|
+
constructor(deps: ProjectDeps) {
|
|
79
|
+
this.deps = deps;
|
|
78
80
|
this.ops = deps.ops ?? realFs;
|
|
79
81
|
this.activate();
|
|
80
82
|
}
|
|
@@ -85,7 +87,9 @@ export class ProjectRegistry {
|
|
|
85
87
|
if (!path.isAbsolute(p)) return { ok: false, reason: "not_absolute" };
|
|
86
88
|
let real: string;
|
|
87
89
|
try {
|
|
88
|
-
|
|
90
|
+
// Native realpath: on-disk case, so stored project roots compare correctly against
|
|
91
|
+
// canonicalised skill candidates on a case-insensitive filesystem (audit F1).
|
|
92
|
+
real = fs.realpathSync.native(p);
|
|
89
93
|
} catch {
|
|
90
94
|
return { ok: false, reason: "missing" };
|
|
91
95
|
}
|
|
@@ -209,7 +213,7 @@ export class ProjectRegistry {
|
|
|
209
213
|
if (typeof cwd !== "string" || !path.isAbsolute(cwd)) return null;
|
|
210
214
|
let real: string;
|
|
211
215
|
try {
|
|
212
|
-
real = fs.realpathSync(cwd);
|
|
216
|
+
real = fs.realpathSync.native(cwd);
|
|
213
217
|
} catch {
|
|
214
218
|
return null;
|
|
215
219
|
}
|
package/src/server/records.ts
CHANGED
|
@@ -21,6 +21,21 @@ export interface LocatedRecord extends Locator {
|
|
|
21
21
|
record: ConversationRecord;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Skill names the record's session was spawned with (audit F4): revocation is judged against
|
|
26
|
+
* this set, not the persona's current list. `null` when the record carries no usable spawned
|
|
27
|
+
* set (predates audit F4, or a broken shape) — callers fall back to `persona.skills`.
|
|
28
|
+
*/
|
|
29
|
+
export function spawnedSkillNames(rec: ConversationRecord): string[] | null {
|
|
30
|
+
if (!Array.isArray(rec.skills)) return null;
|
|
31
|
+
const out: string[] = [];
|
|
32
|
+
for (const s of rec.skills) {
|
|
33
|
+
if (!s || typeof s.name !== "string" || !s.name || typeof s.root !== "string" || !path.isAbsolute(s.root)) return null;
|
|
34
|
+
out.push(s.name);
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
function personaKeyFromDir(name: string): string | null {
|
|
25
40
|
if (name.startsWith("shared-")) return `shared:${name.slice(7)}`;
|
|
26
41
|
if (name.startsWith("private-")) return `private:${name.slice(8)}`;
|
|
@@ -28,12 +43,17 @@ function personaKeyFromDir(name: string): string | null {
|
|
|
28
43
|
}
|
|
29
44
|
|
|
30
45
|
export class RecordStore {
|
|
46
|
+
private readonly paths: TeamPaths;
|
|
47
|
+
private readonly ops: FsOps;
|
|
31
48
|
private index = new Map<string, Locator>();
|
|
32
49
|
|
|
33
50
|
constructor(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
) {
|
|
51
|
+
paths: TeamPaths,
|
|
52
|
+
ops: FsOps = realFs,
|
|
53
|
+
) {
|
|
54
|
+
this.paths = paths;
|
|
55
|
+
this.ops = ops;
|
|
56
|
+
}
|
|
37
57
|
|
|
38
58
|
private file(l: Locator): string {
|
|
39
59
|
if (!CONVERSATION_ID_RE.test(l.c)) throw new TeamError(404, "conversation_not_found");
|
package/src/server/routes.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { ConversationService } from "./conversations.js";
|
|
|
9
9
|
import { isTargetId } from "./paths.js";
|
|
10
10
|
import type { PersonaService } from "./personas-service.js";
|
|
11
11
|
import type { ProjectRegistry } from "./projects.js";
|
|
12
|
+
import type { SkillsService } from "./skills-service.js";
|
|
12
13
|
import { type Caller, TeamError, WORKSPACE_TARGET } from "./types.js";
|
|
13
14
|
import type { UsersStore } from "./users.js";
|
|
14
15
|
|
|
@@ -20,8 +21,8 @@ export interface RouteDeps {
|
|
|
20
21
|
projects: ProjectRegistry;
|
|
21
22
|
conversations: ConversationService;
|
|
22
23
|
users: UsersStore;
|
|
23
|
-
/**
|
|
24
|
-
skills:
|
|
24
|
+
/** Skill catalog: listings, managed CRUD, impact preview, available (D2/D14). */
|
|
25
|
+
skills: SkillsService;
|
|
25
26
|
logger: { warn(msg: string): void; error(msg: string): void };
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -89,6 +90,7 @@ export async function mountTeamRoutes(fastify: FastifyInstance, d: RouteDeps): P
|
|
|
89
90
|
return t;
|
|
90
91
|
};
|
|
91
92
|
const P = (path: string) => `${API_PREFIX}${path}`;
|
|
93
|
+
const usable = (c: Caller): string[] => [WORKSPACE_TARGET, ...d.projects.usableBy(c, d.access.mode()).map((p) => p.id)];
|
|
92
94
|
const wrap =
|
|
93
95
|
(fn: (req: FastifyRequest, reply: FastifyReply, c: Caller) => unknown) =>
|
|
94
96
|
async (req: FastifyRequest, reply: FastifyReply) =>
|
|
@@ -99,7 +101,7 @@ export async function mountTeamRoutes(fastify: FastifyInstance, d: RouteDeps): P
|
|
|
99
101
|
P("/me"),
|
|
100
102
|
wrap((_req, _reply, c) => {
|
|
101
103
|
if (d.access.mode() === "multi") d.users.record(c);
|
|
102
|
-
return { uk: c.uk, iss: c.iss, sub: c.sub, admin: c.admin, mode: d.access.mode(), maxConversations: d.conversations.limit(), skills: d.skills() };
|
|
104
|
+
return { uk: c.uk, iss: c.iss, sub: c.sub, admin: c.admin, mode: d.access.mode(), maxConversations: d.conversations.limit(), skills: d.skills.visibleNames(c, usable(c)) };
|
|
103
105
|
}),
|
|
104
106
|
);
|
|
105
107
|
|
|
@@ -159,6 +161,35 @@ export async function mountTeamRoutes(fastify: FastifyInstance, d: RouteDeps): P
|
|
|
159
161
|
}),
|
|
160
162
|
);
|
|
161
163
|
|
|
164
|
+
// ── skill catalog ─────────────────────────────────────────────────────
|
|
165
|
+
scope.get(
|
|
166
|
+
P("/skills/available"),
|
|
167
|
+
wrap(async (_req, _reply, c) => {
|
|
168
|
+
if (!c.admin) throw new TeamError(403, "admin_required");
|
|
169
|
+
return { skills: await d.skills.available() };
|
|
170
|
+
}),
|
|
171
|
+
);
|
|
172
|
+
scope.get(
|
|
173
|
+
P("/skills"),
|
|
174
|
+
wrap((_req, _reply, c) => (c.admin ? d.skills.adminList() : d.skills.callerList(c, usable(c)))),
|
|
175
|
+
);
|
|
176
|
+
scope.post(
|
|
177
|
+
P("/skills"),
|
|
178
|
+
wrap(async (req, reply, c) => reply.code(201).send(await d.skills.create(c, req.body))),
|
|
179
|
+
);
|
|
180
|
+
scope.post(
|
|
181
|
+
P("/skills/:name/impact"),
|
|
182
|
+
wrap(async (req, _reply, c) => d.skills.impact(c, (req.params as { name: string }).name, req.body)),
|
|
183
|
+
);
|
|
184
|
+
scope.patch(
|
|
185
|
+
P("/skills/:name"),
|
|
186
|
+
wrap(async (req, _reply, c) => d.skills.update(c, (req.params as { name: string }).name, req.body)),
|
|
187
|
+
);
|
|
188
|
+
scope.delete(P("/skills/:name"), wrap(async (req, _reply, c) => {
|
|
189
|
+
await d.skills.remove(c, (req.params as { name: string }).name);
|
|
190
|
+
return { ok: true };
|
|
191
|
+
}));
|
|
192
|
+
|
|
162
193
|
// ── personas ────────────────────────────────────────────────────────────
|
|
163
194
|
scope.get(P("/personas"), wrap((_req, _reply, c) => ({ personas: d.personas.list(c) })));
|
|
164
195
|
scope.post(
|
|
@@ -209,6 +240,14 @@ export async function mountTeamRoutes(fastify: FastifyInstance, d: RouteDeps): P
|
|
|
209
240
|
return d.conversations.ensureConversation(c, p.key, t, p.c);
|
|
210
241
|
}),
|
|
211
242
|
);
|
|
243
|
+
scope.get(
|
|
244
|
+
P("/agents/:key/conversations/:c/history"),
|
|
245
|
+
wrap(async (req, _reply, c) => {
|
|
246
|
+
const t = target(req, c);
|
|
247
|
+
const p = req.params as { key: string; c: string };
|
|
248
|
+
return d.conversations.historyHandle(c, p.key, t, p.c);
|
|
249
|
+
}),
|
|
250
|
+
);
|
|
212
251
|
scope.patch(
|
|
213
252
|
P("/agents/:key/conversations/:c"),
|
|
214
253
|
wrap(async (req, _reply, c) => {
|