nolo-cli 0.9.1 → 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/README.md +1 -1
- package/{_executeModel-UD44KGZ4.js → _executeModel-ZEDPX6OF.js} +50 -48
- package/{action-ZJWE3Y5S.js → action-AA4IJ5K2.js} +11 -11
- package/{addContentAction-TVDBNJM5.js → addContentAction-QYVO4SYP.js} +10 -10
- package/{addDialogAgentAction-EKH774VT.js → addDialogAgentAction-WVVKT5WQ.js} +12 -12
- package/{agentDeleteCommand-TCPEFJTF.js → agentDeleteCommand-RDPGYIWF.js} +25 -25
- package/{agentEmailCommands-CZ3UILZ4.js → agentEmailCommands-2HJJKS5F.js} +62 -59
- package/{agentListCommands-SJKO2FFB.js → agentListCommands-HFEVV3ZW.js} +30 -29
- package/{agentMachineCommands-PSNABISZ.js → agentMachineCommands-25ZOENJU.js} +29 -29
- package/{agentRecordCommands-MH2JKFHS.js → agentRecordCommands-GTCOAM3L.js} +53 -50
- package/{agentRunCommand-4KH6MIZR.js → agentRunCommand-YBS3JDLD.js} +62 -56
- package/{agentRuntimeLocal-SKHJUWSS.js → agentRuntimeLocal-UQBMQI2M.js} +12 -12
- package/{agentSlice-3WXXN4VK.js → agentSlice-6EKOBCCS.js} +11 -11
- package/{authCommand-PXFX6JDT.js → authCommand-O2OWACN4.js} +12 -12
- package/{authCommands-356AYWEK.js → authCommands-H7365TZP.js} +6 -6
- package/{chunk-MKMWT7SA.js → chunk-2W2VYVI5.js} +336 -92
- package/{chunk-TSS3XJY4.js → chunk-3NSIQZZ6.js} +5 -5
- package/{chunk-AUQ747NZ.js → chunk-4SOKXIW4.js} +70 -6
- package/{chunk-ZIG5LJ7X.js → chunk-5MOUAAMK.js} +106 -2342
- package/{chunk-6GANEXVO.js → chunk-5OIFWVX7.js} +1 -1
- package/{chunk-MGOJ5R6J.js → chunk-7D3JY6C2.js} +2 -2
- package/{chunk-7OOXPE3N.js → chunk-AEZAORLG.js} +4 -4
- package/chunk-AFON4QUU.js +112 -0
- package/{chunk-YBWOP46I.js → chunk-BX6U3ETE.js} +20 -13
- package/{chunk-2PUGVR6E.js → chunk-C2MDQQ4O.js} +1 -1
- package/{chunk-SL35K7AH.js → chunk-C4FTUXVF.js} +2 -82
- package/{chunk-GAKEBQD6.js → chunk-D6OQHXVG.js} +11 -7
- package/{chunk-WKM6FH35.js → chunk-DWGAEFJL.js} +1 -1
- package/{chunk-PG5PNA7Y.js → chunk-E4HNJSHC.js} +20 -20
- package/{chunk-SBR32ZZS.js → chunk-EVZKZF32.js} +73 -40
- package/{chunk-C3RUNRHT.js → chunk-FXXSGWAJ.js} +1 -1
- package/{chunk-KTVVPRJS.js → chunk-GBDSZATH.js} +4 -4
- package/{chunk-3TZDXYSF.js → chunk-HNW7IJSK.js} +1 -1
- package/{chunk-2EISRLRC.js → chunk-IPYUUY4E.js} +2 -2
- package/{chunk-2K2ECKSG.js → chunk-KJR5KAUQ.js} +2 -2
- package/{chunk-XE635NI4.js → chunk-KQQVGRA3.js} +24 -24
- package/{chunk-AVMKZHBC.js → chunk-L53FGHA4.js} +3 -2
- package/{chunk-GG4AJPSR.js → chunk-LAX2JSTX.js} +2 -2
- package/{chunk-5PJ3VWCS.js → chunk-LP65VRCI.js} +7 -13
- package/chunk-LTRXGFMS.js +83 -0
- package/{chunk-63SLEOLK.js → chunk-MQI77IRB.js} +4 -4
- package/{chunk-PCWC3JTN.js → chunk-MTU75CZ2.js} +1 -1
- package/{chunk-3WYQEUBI.js → chunk-NEM67FX7.js} +1 -1
- package/{chunk-COMXDWNM.js → chunk-O26GI2JP.js} +10 -10
- package/{chunk-SH2CFQOH.js → chunk-O4BU24WZ.js} +2 -181
- package/{chunk-EYEEHCU4.js → chunk-OOM6SJNR.js} +10 -10
- package/chunk-OOSFSFMA.js +271 -0
- package/{chunk-PAKN26FP.js → chunk-OUI3ZHYD.js} +1 -1
- package/{chunk-EXTIQUCI.js → chunk-PNEW2Z3T.js} +9 -9
- package/{chunk-CPB2YM4D.js → chunk-PXQN7IBQ.js} +2 -2
- package/{chunk-4IJYA27C.js → chunk-PXZAAB4L.js} +4 -4
- package/{chunk-4K2KKCSD.js → chunk-Q3UKJVU4.js} +12 -16
- package/{chunk-XKIMRZO2.js → chunk-QNMFBBZK.js} +1 -1
- package/{chunk-XS466O7S.js → chunk-S3GS2PRL.js} +65 -30
- package/{chunk-YYUCRDOK.js → chunk-SOTZ6RDN.js} +1 -1
- package/{chunk-G43KEVSC.js → chunk-SV5MWASH.js} +17 -17
- package/{chunk-7QRKCBOP.js → chunk-TACHTH5D.js} +15 -15
- package/chunk-VC6OZXO5.js +298 -0
- package/{chunk-ZQ2UM4KG.js → chunk-WZSRQNQG.js} +1 -292
- package/{chunk-LARL2V6G.js → chunk-X2S7JTIG.js} +298 -66
- package/{chunk-Q2YZULBH.js → chunk-XENYHRUE.js} +1 -1
- package/{chunk-ELRRLDWI.js → chunk-XFOLQLDN.js} +2 -2
- package/{chunk-UUJDGGAK.js → chunk-XYZA7S7V.js} +6 -6
- package/{chunk-KOCA5FCS.js → chunk-ZEYDOXHF.js} +185 -147
- package/{chunk-5KLGBAAR.js → chunk-ZPRK73XY.js} +1 -1
- package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
- package/{createAgentAutomationAction-63OIP6X5.js → createAgentAutomationAction-LTI5QU35.js} +25 -25
- package/{createDialogAction-ZLYZDYBB.js → createDialogAction-OJJ7L3L3.js} +26 -25
- package/{createPageAction-AL5FSDCK.js → createPageAction-5MXWVRGY.js} +30 -29
- package/{dbSlice-PR44QPXY.js → dbSlice-RQFQQVHT.js} +9 -9
- package/{deleteFile-4SKGPHOZ.js → deleteFile-7XP5BGC7.js} +6 -6
- package/{dialogCommands-F6YI5742.js → dialogCommands-JTJ3RPPW.js} +23 -23
- package/{dialogSlice-JSBNZRLR.js → dialogSlice-OWROKURJ.js} +22 -22
- package/{docCreateCommands-4CTO7ERT.js → docCreateCommands-WJBEW2V7.js} +23 -22
- package/{docDeleteCommands-VBWERDRG.js → docDeleteCommands-BVEHJOY5.js} +25 -24
- package/{docReadCommands-KNP4MFYB.js → docReadCommands-NEWOZIJV.js} +23 -22
- package/{docStore-ADP5VYY4.js → docStore-3DXRYBMD.js} +23 -23
- package/{docUpdateCommands-4BCBJQHA.js → docUpdateCommands-C7WHT7UU.js} +23 -22
- package/{fetchMessages-U6ZHN56A.js → fetchMessages-KTNM7QAR.js} +3 -3
- package/{handleSendMessageAction-IJDQ6ARA.js → handleSendMessageAction-B5PRR7BE.js} +27 -27
- package/index.js +58 -58
- package/{localDialogRead-Z5UTAJPU.js → localDialogRead-YSKFFRTT.js} +2 -2
- package/{machineCommands-EA3M4XTN.js → machineCommands-IIIREAEK.js} +67 -62
- package/{machineWsRunDispatch-NAPKE5ZA.js → machineWsRunDispatch-3SIU6ILW.js} +52 -49
- package/package.json +4 -2
- package/{read-RIJCIVKX.js → read-QJNKRROM.js} +6 -6
- package/{readDocTool-GZD2N3LO.js → readDocTool-H6X6KO6X.js} +1 -1
- package/{readlineWorkspace-KMWT4T4S.js → readlineWorkspace-HGP3I3OC.js} +97 -79
- package/{removeDialogAgentAction-GJQJNDW6.js → removeDialogAgentAction-TCT35SOF.js} +14 -14
- package/{runAgentClientLoop-U5Q6NDTJ.js → runAgentClientLoop-EFM4PTVI.js} +46 -44
- package/{setDialogExtraReferencesAction-M7OQG54N.js → setDialogExtraReferencesAction-CGYLZMFH.js} +12 -12
- package/{setPrimaryDialogAgentAction-46UNFJDL.js → setPrimaryDialogAgentAction-F6BFQDJU.js} +14 -14
- package/{settingSlice-FVUUH4JA.js → settingSlice-2I5HMG47.js} +10 -10
- package/skillDiscovery-UGSQGX2U.js +16 -0
- package/{spaceCommands-E2CFRPZJ.js → spaceCommands-MT7BWCIL.js} +32 -36
- package/{spaceSlice-L3R6IMXE.js → spaceSlice-BS5TSW3W.js} +22 -22
- package/{streamAgentChatTurn-UBDAOQWE.js → streamAgentChatTurn-I3VBFNR3.js} +85 -81
- package/{tableCommands-GOFP7QKA.js → tableCommands-M3DJUETS.js} +11 -11
- package/{toolApiClient-QI3YBNWB.js → toolApiClient-C7P7YSE4.js} +2 -2
- package/{tools-TMJXZTCA.js → tools-XSD2BOEN.js} +34 -32
- package/{tuiSummaryLlmCaller-RV3THLZF.js → tuiSummaryLlmCaller-32NRHTT2.js} +3 -3
- package/{understanding-GQKNDDWM.js → understanding-ZOESBLF3.js} +5 -5
- package/{updateDialogTitleAction-ZTWRDXI2.js → updateDialogTitleAction-7FYNJOGP.js} +25 -25
- package/chunk-QYXLLLGL.js +0 -4519
- package/{agentPullCommand-O2MTUAFR.js → agentPullCommand-GOL2S4W2.js} +1 -1
- package/{chunk-DZ3XJVET.js → chunk-3QAF2LTL.js} +3 -3
- package/{chunk-EHLHSX7R.js → chunk-5MMZUWSG.js} +3 -3
- package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
- package/{chunk-4CQLVGRV.js → chunk-ID4G2MAR.js} +3 -3
- package/{chunk-5MIDPSSK.js → chunk-JK7VW2FN.js} +3 -3
- package/{chunk-TILFE6LV.js → chunk-YOCHZD7D.js} +3 -3
- package/{chunk-JRKKFRAV.js → chunk-YTBMA7NO.js} +3 -3
- package/{db-HCJ5PRB5.js → db-6QED3ZVO.js} +3 -3
- package/{runtimeDoctorCommands-LRHLPDRC.js → runtimeDoctorCommands-ID43Z7VX.js} +3 -3
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
asTrimmedNonEmptyStringArray
|
|
3
|
-
} from "./chunk-I42VC5KR.js";
|
|
4
|
-
import {
|
|
5
|
-
asOptionalTrimmedString
|
|
6
|
-
} from "./chunk-G3SUCT4W.js";
|
|
7
|
-
|
|
8
1
|
// node_modules/js-yaml/dist/js-yaml.mjs
|
|
9
2
|
function isNothing(subject) {
|
|
10
3
|
return typeof subject === "undefined" || subject === null;
|
|
@@ -2588,291 +2581,7 @@ var safeLoad = renamed("safeLoad", "load");
|
|
|
2588
2581
|
var safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
2589
2582
|
var safeDump = renamed("safeDump", "dump");
|
|
2590
2583
|
|
|
2591
|
-
// packages/ai/skills/skillDocProtocol.ts
|
|
2592
|
-
var SKILL_DOC_ENUMS = {
|
|
2593
|
-
triggerMode: ["explicit", "required", "recommended"],
|
|
2594
|
-
budgetTier: ["low", "medium", "high"],
|
|
2595
|
-
modality: ["text", "image", "video", "audio", "3d"],
|
|
2596
|
-
docKind: ["knowledge", "instruction", "skill"]
|
|
2597
|
-
};
|
|
2598
|
-
var SKILL_CONFIG_BLOCK = "skill-config";
|
|
2599
|
-
var EVAL_CONFIG_BLOCK = "eval-config";
|
|
2600
|
-
var WORKFLOW_CONFIG_BLOCK = "workflow-config";
|
|
2601
|
-
var normalizeStringArray = (value) => {
|
|
2602
|
-
if (!Array.isArray(value)) return void 0;
|
|
2603
|
-
const items = [...new Set(asTrimmedNonEmptyStringArray(value))];
|
|
2604
|
-
return items.length > 0 ? items : void 0;
|
|
2605
|
-
};
|
|
2606
|
-
var normalizeBoolean = (value) => typeof value === "boolean" ? value : void 0;
|
|
2607
|
-
var normalizeSkillEnumValue = (key, value) => typeof value === "string" && SKILL_DOC_ENUMS[key].includes(value) ? value : void 0;
|
|
2608
|
-
var normalizeSkillBudgetTier = (value) => normalizeSkillEnumValue("budgetTier", value);
|
|
2609
|
-
var normalizeSkillModalities = (value) => {
|
|
2610
|
-
const raw = normalizeStringArray(value);
|
|
2611
|
-
if (!raw) return void 0;
|
|
2612
|
-
const filtered = raw.flatMap((item) => {
|
|
2613
|
-
const modality = normalizeSkillEnumValue("modality", item);
|
|
2614
|
-
return modality ? [modality] : [];
|
|
2615
|
-
});
|
|
2616
|
-
return filtered.length > 0 ? Array.from(new Set(filtered)) : void 0;
|
|
2617
|
-
};
|
|
2618
|
-
var normalizeSkillConfig = (value, fallbackTools) => {
|
|
2619
|
-
if (!value || typeof value !== "object") return void 0;
|
|
2620
|
-
const record = value;
|
|
2621
|
-
const name = asOptionalTrimmedString(record.name) ?? "";
|
|
2622
|
-
const description = asOptionalTrimmedString(record.description) ?? "";
|
|
2623
|
-
if (!name || !description) return void 0;
|
|
2624
|
-
const triggerMode = normalizeSkillEnumValue("triggerMode", record.triggerMode);
|
|
2625
|
-
const budgetTier = normalizeSkillEnumValue("budgetTier", record.budgetTier);
|
|
2626
|
-
const modalities = normalizeSkillModalities(record.modalities);
|
|
2627
|
-
const toolNames = normalizeStringArray(record.toolNames) ?? normalizeStringArray(fallbackTools) ?? void 0;
|
|
2628
|
-
const discover = record.discover && typeof record.discover === "object" ? {
|
|
2629
|
-
keywords: normalizeStringArray(
|
|
2630
|
-
record.discover.keywords
|
|
2631
|
-
),
|
|
2632
|
-
examples: normalizeStringArray(
|
|
2633
|
-
record.discover.examples
|
|
2634
|
-
)
|
|
2635
|
-
} : void 0;
|
|
2636
|
-
return {
|
|
2637
|
-
version: "0.1",
|
|
2638
|
-
kind: "skill",
|
|
2639
|
-
id: asOptionalTrimmedString(record.id),
|
|
2640
|
-
name,
|
|
2641
|
-
description,
|
|
2642
|
-
triggerMode,
|
|
2643
|
-
toolNames,
|
|
2644
|
-
preferredAgents: normalizeStringArray(record.preferredAgents),
|
|
2645
|
-
budgetTier,
|
|
2646
|
-
dispatchPreferred: normalizeBoolean(record.dispatchPreferred),
|
|
2647
|
-
modalities,
|
|
2648
|
-
requiredSkills: normalizeStringArray(record.requiredSkills),
|
|
2649
|
-
recommendedSkills: normalizeStringArray(record.recommendedSkills),
|
|
2650
|
-
promptPatch: asOptionalTrimmedString(record.promptPatch),
|
|
2651
|
-
discover: discover?.keywords || discover?.examples ? discover : void 0
|
|
2652
|
-
};
|
|
2653
|
-
};
|
|
2654
|
-
var normalizeEvalConfig = (value) => {
|
|
2655
|
-
if (!value || typeof value !== "object") return void 0;
|
|
2656
|
-
const record = value;
|
|
2657
|
-
if (!Array.isArray(record.cases)) return void 0;
|
|
2658
|
-
const cases = [];
|
|
2659
|
-
for (const item of record.cases) {
|
|
2660
|
-
if (!item || typeof item !== "object") continue;
|
|
2661
|
-
const testCase = item;
|
|
2662
|
-
const input = asOptionalTrimmedString(testCase.input) ?? "";
|
|
2663
|
-
if (!input) continue;
|
|
2664
|
-
cases.push({
|
|
2665
|
-
input,
|
|
2666
|
-
expectedTools: normalizeStringArray(testCase.expectedTools),
|
|
2667
|
-
expectedSignals: normalizeStringArray(testCase.expectedSignals),
|
|
2668
|
-
forbiddenSignals: normalizeStringArray(testCase.forbiddenSignals)
|
|
2669
|
-
});
|
|
2670
|
-
}
|
|
2671
|
-
return cases.length > 0 ? {
|
|
2672
|
-
version: "0.1",
|
|
2673
|
-
cases
|
|
2674
|
-
} : void 0;
|
|
2675
|
-
};
|
|
2676
|
-
var normalizeWorkflowConfig = (value) => {
|
|
2677
|
-
if (!value || typeof value !== "object") return void 0;
|
|
2678
|
-
const record = value;
|
|
2679
|
-
const name = asOptionalTrimmedString(record.name) ?? "";
|
|
2680
|
-
const description = asOptionalTrimmedString(record.description) ?? "";
|
|
2681
|
-
if (!name || !description) return void 0;
|
|
2682
|
-
const budgetTier = normalizeSkillEnumValue("budgetTier", record.budgetTier);
|
|
2683
|
-
return {
|
|
2684
|
-
version: "0.1",
|
|
2685
|
-
kind: "workflow",
|
|
2686
|
-
id: asOptionalTrimmedString(record.id),
|
|
2687
|
-
name,
|
|
2688
|
-
description,
|
|
2689
|
-
defaultAgent: asOptionalTrimmedString(record.defaultAgent),
|
|
2690
|
-
inputs: normalizeStringArray(record.inputs),
|
|
2691
|
-
recommendedTools: normalizeStringArray(record.recommendedTools),
|
|
2692
|
-
requiredTools: normalizeStringArray(record.requiredTools),
|
|
2693
|
-
requiredOutputs: normalizeStringArray(record.requiredOutputs),
|
|
2694
|
-
gates: normalizeStringArray(record.gates),
|
|
2695
|
-
budgetTier,
|
|
2696
|
-
contextStrategy: asOptionalTrimmedString(record.contextStrategy),
|
|
2697
|
-
failureProtocol: asOptionalTrimmedString(record.failureProtocol)
|
|
2698
|
-
};
|
|
2699
|
-
};
|
|
2700
|
-
var normalizePageSkillMetadata = (value, fallbackTools) => {
|
|
2701
|
-
if (!value || typeof value !== "object") return void 0;
|
|
2702
|
-
const record = value;
|
|
2703
|
-
const kind = normalizeSkillEnumValue("docKind", record.kind);
|
|
2704
|
-
const meta = {
|
|
2705
|
-
kind,
|
|
2706
|
-
requiredSkills: normalizeStringArray(record.requiredSkills),
|
|
2707
|
-
recommendedSkills: normalizeStringArray(record.recommendedSkills),
|
|
2708
|
-
skillConfig: normalizeSkillConfig(record.skillConfig, fallbackTools),
|
|
2709
|
-
evalConfig: normalizeEvalConfig(record.evalConfig),
|
|
2710
|
-
workflowConfig: normalizeWorkflowConfig(record.workflowConfig)
|
|
2711
|
-
};
|
|
2712
|
-
if (meta.skillConfig && !meta.kind) {
|
|
2713
|
-
meta.kind = "skill";
|
|
2714
|
-
}
|
|
2715
|
-
if (meta.workflowConfig && !meta.kind) {
|
|
2716
|
-
meta.kind = "instruction";
|
|
2717
|
-
}
|
|
2718
|
-
return meta.kind || meta.requiredSkills || meta.recommendedSkills || meta.skillConfig || meta.evalConfig || meta.workflowConfig ? meta : void 0;
|
|
2719
|
-
};
|
|
2720
|
-
var extractCommentBlock = (markdown, blockName) => {
|
|
2721
|
-
if (!markdown) return void 0;
|
|
2722
|
-
const matcher = new RegExp(
|
|
2723
|
-
`<!--\\s*${blockName}\\s*\\n([\\s\\S]*?)-->`,
|
|
2724
|
-
"i"
|
|
2725
|
-
);
|
|
2726
|
-
const match = markdown.match(matcher);
|
|
2727
|
-
return asOptionalTrimmedString(match?.[1]);
|
|
2728
|
-
};
|
|
2729
|
-
var removeCommentBlock = (markdown, blockName) => markdown.replace(
|
|
2730
|
-
new RegExp(`\\n?<!--\\s*${blockName}\\s*\\n[\\s\\S]*?-->\\s*`, "gi"),
|
|
2731
|
-
"\n\n"
|
|
2732
|
-
);
|
|
2733
|
-
var parseYamlObject = (raw) => {
|
|
2734
|
-
if (!raw) return void 0;
|
|
2735
|
-
try {
|
|
2736
|
-
const parsed = load(raw);
|
|
2737
|
-
return parsed && typeof parsed === "object" ? parsed : void 0;
|
|
2738
|
-
} catch {
|
|
2739
|
-
return void 0;
|
|
2740
|
-
}
|
|
2741
|
-
};
|
|
2742
|
-
var parseSkillDocProtocol = (markdown, existingMeta, fallbackTools) => {
|
|
2743
|
-
const source = typeof markdown === "string" ? markdown : "";
|
|
2744
|
-
const skillBlock = parseYamlObject(extractCommentBlock(source, SKILL_CONFIG_BLOCK));
|
|
2745
|
-
const evalBlock = parseYamlObject(extractCommentBlock(source, EVAL_CONFIG_BLOCK));
|
|
2746
|
-
const workflowBlock = parseYamlObject(extractCommentBlock(source, WORKFLOW_CONFIG_BLOCK));
|
|
2747
|
-
const cleanedContent = removeCommentBlock(
|
|
2748
|
-
removeCommentBlock(
|
|
2749
|
-
removeCommentBlock(source, SKILL_CONFIG_BLOCK),
|
|
2750
|
-
EVAL_CONFIG_BLOCK
|
|
2751
|
-
),
|
|
2752
|
-
WORKFLOW_CONFIG_BLOCK
|
|
2753
|
-
).replace(/\n{3,}/g, "\n\n").trim();
|
|
2754
|
-
const parsedMeta = normalizePageSkillMetadata(
|
|
2755
|
-
{
|
|
2756
|
-
...existingMeta ?? {},
|
|
2757
|
-
...skillBlock ? {
|
|
2758
|
-
kind: existingMeta?.kind === "skill" || skillBlock.kind === "skill" ? "skill" : existingMeta?.kind,
|
|
2759
|
-
requiredSkills: skillBlock.requiredSkills ?? existingMeta?.requiredSkills,
|
|
2760
|
-
recommendedSkills: skillBlock.recommendedSkills ?? existingMeta?.recommendedSkills,
|
|
2761
|
-
skillConfig: skillBlock
|
|
2762
|
-
} : {},
|
|
2763
|
-
...evalBlock ? { evalConfig: evalBlock } : {},
|
|
2764
|
-
...workflowBlock ? { workflowConfig: workflowBlock } : {}
|
|
2765
|
-
},
|
|
2766
|
-
fallbackTools
|
|
2767
|
-
);
|
|
2768
|
-
return {
|
|
2769
|
-
content: cleanedContent,
|
|
2770
|
-
meta: parsedMeta
|
|
2771
|
-
};
|
|
2772
|
-
};
|
|
2773
|
-
var resolvePageSkillMetadata = (page) => {
|
|
2774
|
-
if (!page) return void 0;
|
|
2775
|
-
const existingMeta = normalizePageSkillMetadata(page.meta, page.tools);
|
|
2776
|
-
return parseSkillDocProtocol(page.content ?? "", existingMeta, page.tools).meta;
|
|
2777
|
-
};
|
|
2778
|
-
var yamlBlock = (value) => dump(value, { lineWidth: 120, noRefs: true }).trim();
|
|
2779
|
-
var buildSkillConfigComment = (config) => {
|
|
2780
|
-
const payload = {
|
|
2781
|
-
version: config.version,
|
|
2782
|
-
kind: config.kind,
|
|
2783
|
-
...config.id ? { id: config.id } : {},
|
|
2784
|
-
name: config.name,
|
|
2785
|
-
description: config.description,
|
|
2786
|
-
...config.triggerMode ? { triggerMode: config.triggerMode } : {},
|
|
2787
|
-
...config.requiredSkills?.length ? { requiredSkills: config.requiredSkills } : {},
|
|
2788
|
-
...config.recommendedSkills?.length ? { recommendedSkills: config.recommendedSkills } : {},
|
|
2789
|
-
...config.toolNames?.length ? { toolNames: config.toolNames } : {},
|
|
2790
|
-
...config.preferredAgents?.length ? { preferredAgents: config.preferredAgents } : {},
|
|
2791
|
-
...config.budgetTier ? { budgetTier: config.budgetTier } : {},
|
|
2792
|
-
...typeof config.dispatchPreferred === "boolean" ? { dispatchPreferred: config.dispatchPreferred } : {},
|
|
2793
|
-
...config.modalities?.length ? { modalities: config.modalities } : {},
|
|
2794
|
-
...config.discover?.keywords?.length || config.discover?.examples?.length ? {
|
|
2795
|
-
discover: {
|
|
2796
|
-
...config.discover?.keywords?.length ? { keywords: config.discover.keywords } : {},
|
|
2797
|
-
...config.discover?.examples?.length ? { examples: config.discover.examples } : {}
|
|
2798
|
-
}
|
|
2799
|
-
} : {},
|
|
2800
|
-
...config.promptPatch ? { promptPatch: config.promptPatch } : {}
|
|
2801
|
-
};
|
|
2802
|
-
return `<!-- ${SKILL_CONFIG_BLOCK}
|
|
2803
|
-
${yamlBlock(payload)}
|
|
2804
|
-
-->`;
|
|
2805
|
-
};
|
|
2806
|
-
var buildEvalConfigComment = (config) => `<!-- ${EVAL_CONFIG_BLOCK}
|
|
2807
|
-
${yamlBlock({
|
|
2808
|
-
version: config.version,
|
|
2809
|
-
cases: config.cases
|
|
2810
|
-
})}
|
|
2811
|
-
-->`;
|
|
2812
|
-
var buildWorkflowConfigComment = (config) => `<!-- ${WORKFLOW_CONFIG_BLOCK}
|
|
2813
|
-
${yamlBlock({
|
|
2814
|
-
version: config.version,
|
|
2815
|
-
kind: config.kind,
|
|
2816
|
-
...config.id ? { id: config.id } : {},
|
|
2817
|
-
name: config.name,
|
|
2818
|
-
description: config.description,
|
|
2819
|
-
...config.defaultAgent ? { defaultAgent: config.defaultAgent } : {},
|
|
2820
|
-
...config.inputs?.length ? { inputs: config.inputs } : {},
|
|
2821
|
-
...config.recommendedTools?.length ? { recommendedTools: config.recommendedTools } : {},
|
|
2822
|
-
...config.requiredTools?.length ? { requiredTools: config.requiredTools } : {},
|
|
2823
|
-
...config.requiredOutputs?.length ? { requiredOutputs: config.requiredOutputs } : {},
|
|
2824
|
-
...config.gates?.length ? { gates: config.gates } : {},
|
|
2825
|
-
...config.budgetTier ? { budgetTier: config.budgetTier } : {},
|
|
2826
|
-
...config.contextStrategy ? { contextStrategy: config.contextStrategy } : {},
|
|
2827
|
-
...config.failureProtocol ? { failureProtocol: config.failureProtocol } : {}
|
|
2828
|
-
})}
|
|
2829
|
-
-->`;
|
|
2830
|
-
var buildSkillDocMarkdown = (options) => {
|
|
2831
|
-
const sections = [
|
|
2832
|
-
asOptionalTrimmedString(options.body) ?? "",
|
|
2833
|
-
buildSkillConfigComment(options.skillConfig),
|
|
2834
|
-
options.evalConfig ? buildEvalConfigComment(options.evalConfig) : "",
|
|
2835
|
-
options.workflowConfig ? buildWorkflowConfigComment(options.workflowConfig) : ""
|
|
2836
|
-
].filter(Boolean);
|
|
2837
|
-
return sections.join("\n\n").trim();
|
|
2838
|
-
};
|
|
2839
|
-
var extractFrontmatter = (markdown) => {
|
|
2840
|
-
const match = markdown.match(/^\s*---\s*\n([\s\S]*?)\n\s*---\s*\n?/);
|
|
2841
|
-
if (!match) return { body: markdown.trim() };
|
|
2842
|
-
const frontmatter = parseYamlObject(match[1]);
|
|
2843
|
-
const body = markdown.slice(match[0].length).trim();
|
|
2844
|
-
return { frontmatter, body };
|
|
2845
|
-
};
|
|
2846
|
-
var normalizeAllowedTools = (value) => {
|
|
2847
|
-
if (Array.isArray(value)) {
|
|
2848
|
-
return normalizeStringArray(value) ?? [];
|
|
2849
|
-
}
|
|
2850
|
-
if (typeof value === "string") {
|
|
2851
|
-
return value.split(/\s+/).map((item) => item.trim()).filter(Boolean);
|
|
2852
|
-
}
|
|
2853
|
-
return [];
|
|
2854
|
-
};
|
|
2855
|
-
var parseExternalSkillMarkdown = (markdown) => {
|
|
2856
|
-
const { frontmatter, body } = extractFrontmatter(markdown);
|
|
2857
|
-
return {
|
|
2858
|
-
name: asOptionalTrimmedString(frontmatter?.name),
|
|
2859
|
-
description: asOptionalTrimmedString(frontmatter?.description),
|
|
2860
|
-
compatibility: asOptionalTrimmedString(frontmatter?.compatibility),
|
|
2861
|
-
allowedTools: normalizeAllowedTools(frontmatter?.["allowed-tools"]),
|
|
2862
|
-
metadata: frontmatter?.metadata && typeof frontmatter.metadata === "object" ? Object.fromEntries(
|
|
2863
|
-
Object.entries(frontmatter.metadata).filter(([, value]) => typeof value === "string").map(([key, value]) => [key, String(value)])
|
|
2864
|
-
) : void 0,
|
|
2865
|
-
body
|
|
2866
|
-
};
|
|
2867
|
-
};
|
|
2868
|
-
|
|
2869
2584
|
export {
|
|
2870
2585
|
load,
|
|
2871
|
-
|
|
2872
|
-
normalizeSkillBudgetTier,
|
|
2873
|
-
normalizeSkillModalities,
|
|
2874
|
-
parseSkillDocProtocol,
|
|
2875
|
-
resolvePageSkillMetadata,
|
|
2876
|
-
buildSkillDocMarkdown,
|
|
2877
|
-
parseExternalSkillMarkdown
|
|
2586
|
+
dump
|
|
2878
2587
|
};
|