@amaster.ai/employee-runtime-connector 0.1.1-beta.64 → 0.1.1-beta.65
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.
|
@@ -2779,7 +2779,7 @@ export default function amasterEffectiveToolsAttestor(pi) {
|
|
|
2779
2779
|
// src/amaster-runtime-daemon/pi-role-skills-visibility.mjs
|
|
2780
2780
|
var MANAGED_PI_ROLE_SKILLS_VISIBILITY_FILENAME = "amaster-role-skills-visibility.js";
|
|
2781
2781
|
function managedPiRoleSkillsVisibilityExtensionSource(expectedSkills) {
|
|
2782
|
-
return String.raw`import { realpathSync } from "node:fs";
|
|
2782
|
+
return String.raw`import { readFileSync, realpathSync } from "node:fs";
|
|
2783
2783
|
|
|
2784
2784
|
const EXPECTED_SKILLS = ${JSON.stringify(expectedSkills)};
|
|
2785
2785
|
|
|
@@ -2802,6 +2802,55 @@ function skillXml(skill) {
|
|
|
2802
2802
|
].join("\n");
|
|
2803
2803
|
}
|
|
2804
2804
|
|
|
2805
|
+
function yamlString(value) {
|
|
2806
|
+
const trimmed = value.trim();
|
|
2807
|
+
if (trimmed.startsWith("\"") && trimmed.endsWith("\"")) {
|
|
2808
|
+
try {
|
|
2809
|
+
return JSON.parse(trimmed);
|
|
2810
|
+
} catch {}
|
|
2811
|
+
}
|
|
2812
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
2813
|
+
return trimmed.slice(1, -1).replace(/''/g, "'");
|
|
2814
|
+
}
|
|
2815
|
+
return trimmed;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
function frontmatterField(frontmatter, field) {
|
|
2819
|
+
const lines = frontmatter.split(/\r?\n/);
|
|
2820
|
+
const prefix = field + ":";
|
|
2821
|
+
const index = lines.findIndex((line) => line.startsWith(prefix));
|
|
2822
|
+
if (index < 0) return null;
|
|
2823
|
+
const value = lines[index].slice(prefix.length).trim();
|
|
2824
|
+
if (value !== ">" && value !== "|" && value !== ">-" && value !== "|-") {
|
|
2825
|
+
return yamlString(value);
|
|
2826
|
+
}
|
|
2827
|
+
const block = [];
|
|
2828
|
+
for (let lineIndex = index + 1; lineIndex < lines.length; lineIndex += 1) {
|
|
2829
|
+
const line = lines[lineIndex];
|
|
2830
|
+
if (line && !/^\s/.test(line)) break;
|
|
2831
|
+
block.push(line.trim());
|
|
2832
|
+
}
|
|
2833
|
+
return value.startsWith(">") ? block.join(" ").trim() : block.join("\n").trim();
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
function readRoleSkill(expected) {
|
|
2837
|
+
const filePath = realpathSync(expected.filePath);
|
|
2838
|
+
const source = readFileSync(filePath, "utf8");
|
|
2839
|
+
const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
2840
|
+
if (!match) throw new Error("role skill frontmatter missing: " + expected.name);
|
|
2841
|
+
const name = frontmatterField(match[1], "name");
|
|
2842
|
+
const description = frontmatterField(match[1], "description");
|
|
2843
|
+
const hidden = frontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true";
|
|
2844
|
+
if (name !== expected.name || !description || !hidden) {
|
|
2845
|
+
throw new Error("role skill metadata mismatch: " + expected.name);
|
|
2846
|
+
}
|
|
2847
|
+
return {
|
|
2848
|
+
name,
|
|
2849
|
+
description,
|
|
2850
|
+
filePath,
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2805
2854
|
function appendPromotedSkills(systemPrompt, skills) {
|
|
2806
2855
|
if (skills.length === 0) return systemPrompt;
|
|
2807
2856
|
const entries = skills.map(skillXml).join("\n");
|
|
@@ -2830,24 +2879,9 @@ export default function amasterRoleSkillsVisibility(pi) {
|
|
|
2830
2879
|
|| !event.systemPromptOptions.selectedTools.includes("read")) {
|
|
2831
2880
|
throw new Error("role skills require the read tool");
|
|
2832
2881
|
}
|
|
2833
|
-
const loadedSkills = Array.isArray(event.systemPromptOptions?.skills)
|
|
2834
|
-
? event.systemPromptOptions.skills
|
|
2835
|
-
: [];
|
|
2836
2882
|
const promotedSkills = [];
|
|
2837
2883
|
for (const expected of EXPECTED_SKILLS) {
|
|
2838
|
-
|
|
2839
|
-
const matches = loadedSkills.filter((skill) => {
|
|
2840
|
-
if (skill?.name !== expected.name || typeof skill.filePath !== "string") return false;
|
|
2841
|
-
try {
|
|
2842
|
-
return realpathSync(skill.filePath) === expectedPath;
|
|
2843
|
-
} catch {
|
|
2844
|
-
return false;
|
|
2845
|
-
}
|
|
2846
|
-
});
|
|
2847
|
-
if (matches.length !== 1) {
|
|
2848
|
-
throw new Error("role skill binding mismatch: " + expected.name);
|
|
2849
|
-
}
|
|
2850
|
-
if (matches[0].disableModelInvocation === true) promotedSkills.push(matches[0]);
|
|
2884
|
+
promotedSkills.push(readRoleSkill(expected));
|
|
2851
2885
|
}
|
|
2852
2886
|
const systemPrompt = appendPromotedSkills(event.systemPrompt, promotedSkills);
|
|
2853
2887
|
return systemPrompt === event.systemPrompt ? undefined : { systemPrompt };
|
|
@@ -10501,7 +10535,7 @@ var source_acquisition_compatibility_default = {
|
|
|
10501
10535
|
};
|
|
10502
10536
|
|
|
10503
10537
|
// src/amaster-runtime-daemon.mjs
|
|
10504
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
10538
|
+
var CONNECTOR_VERSION = "0.1.1-beta.65";
|
|
10505
10539
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
10506
10540
|
var SOURCE_ACQUISITION_CAPABILITY = source_acquisition_compatibility_default.profileVersion;
|
|
10507
10541
|
var SOURCE_ACQUISITION_PROFILE_VERSION = source_acquisition_compatibility_default.profileVersion;
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
6
6
|
import { homedir, hostname } from "node:os";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
|
|
9
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
9
|
+
const CONNECTOR_VERSION = "0.1.1-beta.65";
|
|
10
10
|
|
|
11
11
|
const CAPABILITIES = [
|
|
12
12
|
"remote_registration",
|