@yeaft/webchat-agent 1.0.196 → 1.0.198
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/local-runtime/server/handlers/agent-output.js +27 -11
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +77 -77
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +1 -1
- package/package.json +1 -1
- package/yeaft/skills.js +36 -3
- package/yeaft/web-bridge.js +490 -146
|
Binary file
|
package/package.json
CHANGED
package/yeaft/skills.js
CHANGED
|
@@ -458,6 +458,9 @@ export class SkillManager {
|
|
|
458
458
|
/** @type {Map<string, { workspaceRoot: string, relativeRoot: string }>} */
|
|
459
459
|
#secureWorkspaceByDir;
|
|
460
460
|
|
|
461
|
+
/** Hash of the effective loaded skill set, including prompt content. */
|
|
462
|
+
#snapshotHash = '';
|
|
463
|
+
|
|
461
464
|
/**
|
|
462
465
|
* @param {string | string[]} dirs — single directory (back-compat) or array of
|
|
463
466
|
* directories in priority order (lowest → highest). Falsy entries are
|
|
@@ -526,14 +529,16 @@ export class SkillManager {
|
|
|
526
529
|
* tagged with `_tier` (from the constructor's `tierByDir` map, or the dir
|
|
527
530
|
* basename as fallback) so consumers can show provenance.
|
|
528
531
|
*
|
|
529
|
-
* @returns {{ loaded: number, errors: string[] }}
|
|
532
|
+
* @returns {{ loaded: number, errors: string[], changed: boolean }}
|
|
530
533
|
*/
|
|
531
534
|
load() {
|
|
535
|
+
const previousHash = this.#snapshotHash;
|
|
532
536
|
this.#skills.clear();
|
|
533
537
|
const allErrors = [];
|
|
534
538
|
|
|
535
539
|
if (this.#skillsDirs.length === 0) {
|
|
536
|
-
|
|
540
|
+
this.#snapshotHash = this.#computeSnapshotHash();
|
|
541
|
+
return { loaded: 0, errors: [], changed: this.#snapshotHash !== previousHash };
|
|
537
542
|
}
|
|
538
543
|
|
|
539
544
|
for (const dir of this.#skillsDirs) {
|
|
@@ -554,7 +559,33 @@ export class SkillManager {
|
|
|
554
559
|
allErrors.push(...errors);
|
|
555
560
|
}
|
|
556
561
|
|
|
557
|
-
|
|
562
|
+
this.#snapshotHash = this.#computeSnapshotHash();
|
|
563
|
+
return {
|
|
564
|
+
loaded: this.#skills.size,
|
|
565
|
+
errors: allErrors,
|
|
566
|
+
changed: this.#snapshotHash !== previousHash,
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
#computeSnapshotHash() {
|
|
571
|
+
const records = [...this.#skills.values()]
|
|
572
|
+
.sort((a, b) => String(a.name).localeCompare(String(b.name)))
|
|
573
|
+
.map(skill => ({
|
|
574
|
+
name: skill.name || '',
|
|
575
|
+
description: skill.description || '',
|
|
576
|
+
trigger: skill.trigger || '',
|
|
577
|
+
mode: skill.mode || 'both',
|
|
578
|
+
category: skill.category || '',
|
|
579
|
+
platforms: skill.platforms || [],
|
|
580
|
+
keywords: skill.keywords || [],
|
|
581
|
+
content: skill.content || '',
|
|
582
|
+
source: skill._source || '',
|
|
583
|
+
path: skill._path || '',
|
|
584
|
+
tier: skill._tier || '',
|
|
585
|
+
references: skill._references || [],
|
|
586
|
+
templates: skill._templates || [],
|
|
587
|
+
}));
|
|
588
|
+
return JSON.stringify(records);
|
|
558
589
|
}
|
|
559
590
|
|
|
560
591
|
/**
|
|
@@ -746,6 +777,7 @@ export class SkillManager {
|
|
|
746
777
|
_path: filePath,
|
|
747
778
|
_tier: userTier,
|
|
748
779
|
});
|
|
780
|
+
this.#snapshotHash = this.#computeSnapshotHash();
|
|
749
781
|
|
|
750
782
|
return filename;
|
|
751
783
|
}
|
|
@@ -783,6 +815,7 @@ export class SkillManager {
|
|
|
783
815
|
}
|
|
784
816
|
|
|
785
817
|
this.#skills.delete(name);
|
|
818
|
+
this.#snapshotHash = this.#computeSnapshotHash();
|
|
786
819
|
return true;
|
|
787
820
|
}
|
|
788
821
|
|