nolo-cli 0.38.0-alpha.2 → 0.47.0-alpha.1
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/{_executeModel-2S6HNTBF.js → _executeModel-JWAASOOT.js} +43 -45
- package/{action-KMBZ3LCZ.js → action-FLLC2SIX.js} +7 -7
- package/{addContentAction-KQ44UT2U.js → addContentAction-SVSPUUK4.js} +6 -6
- package/{addDialogAgentAction-ILSDCMYL.js → addDialogAgentAction-W3JGU4F7.js} +5 -5
- package/{agentDeleteCommand-6XYC7JVL.js → agentDeleteCommand-QL7TF5F2.js} +26 -27
- package/{agentEmailCommands-NGL5B3UC.js → agentEmailCommands-AC3XQM53.js} +57 -59
- package/{agentListCommands-R7TKN3DL.js → agentListCommands-4YMFHDU6.js} +33 -31
- package/{agentMachineCommands-AXOO4OKN.js → agentMachineCommands-MFQKYUV4.js} +25 -26
- package/{agentPullCommand-TSWAJPS2.js → agentPullCommand-M552CYSI.js} +2 -2
- package/{agentRecordCommands-GJHH5GYI.js → agentRecordCommands-QG3YBSTQ.js} +53 -55
- package/{agentRunCommand-4MEMHFT5.js → agentRunCommand-B4PGT36L.js} +56 -58
- package/{agentRunControl-7MUPSYDQ.js → agentRunControl-LHXOP4IU.js} +43 -1
- package/{agentRuntimeLocal-CPEWDR3Z.js → agentRuntimeLocal-V2UKJPNE.js} +21 -22
- package/{agentSlice-LAILHBMM.js → agentSlice-B5O3RTRP.js} +6 -6
- package/{agentSuperviseCommands-MKWW3ICX.js → agentSuperviseCommands-IMRZ56RC.js} +2 -2
- package/{appDeleteCommands-6SYOAMTR.js → appDeleteCommands-BQCRRHOM.js} +25 -26
- package/{appDeployCommands-ZNMFUV2K.js → appDeployCommands-UMJ67TUR.js} +25 -26
- package/{appDeployStatusCommands-G5FIZT64.js → appDeployStatusCommands-KASPUR4V.js} +25 -26
- package/{appGetCommands-4RIFLLZZ.js → appGetCommands-FFT2LTGF.js} +25 -26
- package/{appListCommands-DK2JJ65T.js → appListCommands-TAVWFRZZ.js} +25 -26
- package/{authCommand-B2XRHNJH.js → authCommand-OY2E2VQK.js} +12 -12
- package/{authCommands-GWABTFMR.js → authCommands-SBQVTD6V.js} +5 -5
- package/{chatQueueReduxAdapter-DQWFZYNL.js → chatQueueReduxAdapter-OVDKLHLD.js} +20 -20
- package/chunk-25J3BB35.js +6041 -0
- package/chunk-2BWU4ORW.js +2574 -0
- package/{chunk-U6QQLXWI.js → chunk-2X5S4IBZ.js} +1 -1
- package/{chunk-MJWX4JQO.js → chunk-3EEK7T3D.js} +1 -1
- package/{chunk-UNHKVD2N.js → chunk-43CXXVJD.js} +1 -1
- package/{chunk-WRP5TTM6.js → chunk-4MXGXSYN.js} +83 -3
- package/{chunk-2KO5QQFV.js → chunk-5IQX2XPA.js} +2 -2
- package/{chunk-ARFXKWJH.js → chunk-5PFBRLJN.js} +157 -51
- package/{chunk-W445DPVT.js → chunk-5QRCPERU.js} +1 -1
- package/{chunk-GKHV4UH5.js → chunk-5UOBIU5G.js} +31 -3
- package/{chunk-BMB563Y6.js → chunk-6BYAXNH5.js} +3 -3
- package/{chunk-SMPAUSX5.js → chunk-6FGXGFAH.js} +2 -2
- package/{chunk-6XIE5ZGI.js → chunk-6HIGYUBQ.js} +1 -1
- package/{chunk-NT3QRCVS.js → chunk-7US2USK7.js} +7 -7
- package/{chunk-FTM4KUOZ.js → chunk-7XTC3KRG.js} +1 -1
- package/{chunk-IMHO5LC6.js → chunk-7XZ5GXSN.js} +1 -1
- package/{chunk-E2OQ5N2F.js → chunk-AEXP2UZT.js} +341 -16
- package/{chunk-MZZZYUZS.js → chunk-AV2CELZZ.js} +37 -12
- package/{chunk-JI2TIPLP.js → chunk-AYXSUBVC.js} +1 -1
- package/{chunk-KR74XLMV.js → chunk-BIMCW2CC.js} +3 -3
- package/{chunk-GEGSCLZZ.js → chunk-C5UWCCLI.js} +3 -3
- package/{chunk-J6WH4PYZ.js → chunk-CIF4X6ZM.js} +1 -1
- package/{chunk-LZZQTQPY.js → chunk-CTXR4SRT.js} +3 -3
- package/{chunk-GZRMWK5R.js → chunk-DQLYEGP7.js} +2 -2
- package/{chunk-45NBTCS2.js → chunk-DROE55W3.js} +216 -48
- package/{chunk-GUYMR3JL.js → chunk-E2QH2AYX.js} +69 -3
- package/{chunk-B6H5XCT2.js → chunk-EMEUU5IY.js} +3 -3
- package/{chunk-X6EN3KJX.js → chunk-ENYDQKOB.js} +319 -71
- package/{chunk-RCFIB45Q.js → chunk-EVBFYPDC.js} +2 -2
- package/{chunk-PV734VZX.js → chunk-EXLOROHG.js} +1 -1
- package/{chunk-KHCLMKZZ.js → chunk-EY7V7REW.js} +280 -6
- package/{chunk-WRN7L5CS.js → chunk-FA4SY4F5.js} +1 -1
- package/{chunk-IFS5CUEH.js → chunk-FJHLA6SX.js} +1 -1
- package/{chunk-D72M3G32.js → chunk-FM6ZGNMV.js} +12 -12
- package/{chunk-T2BZICLK.js → chunk-G46DB6KG.js} +49 -6
- package/{chunk-FGLKRJDI.js → chunk-GK74OOFT.js} +2 -2
- package/{chunk-LM6IYQ3F.js → chunk-GLKOYSRU.js} +8 -1
- package/{chunk-YNAGAUJT.js → chunk-GYSVYO35.js} +61 -49
- package/{chunk-JIADXJYU.js → chunk-H2G6JXTR.js} +1 -1
- package/{chunk-MGIHZ5CJ.js → chunk-HAPCUPEO.js} +2 -2
- package/{chunk-LD6Y6RJY.js → chunk-HGDOIDQ4.js} +2 -2
- package/{chunk-IZNJDUJ4.js → chunk-I4JISVWK.js} +1 -1
- package/{chunk-N4XRDM26.js → chunk-IA3A5373.js} +2 -2
- package/{chunk-X2K2JSO4.js → chunk-IWUMSAQF.js} +5 -1
- package/{chunk-GEPHJJW4.js → chunk-L7NG2M6H.js} +1 -1
- package/{chunk-XQES6LXQ.js → chunk-LFLWZX76.js} +2 -2
- package/{chunk-IIOHYLIG.js → chunk-LGUQHYAL.js} +1 -1
- package/{chunk-4AWH4LQA.js → chunk-LYGNQHUW.js} +3 -1
- package/{db-3H3JECGY.js → chunk-M5PVFLD4.js} +11 -158
- package/{chunk-WN5AJG5I.js → chunk-MKZRKDQM.js} +1 -1
- package/{chunk-V5GA74HI.js → chunk-MZXZJVVD.js} +20 -39
- package/{chunk-EJAL5LSG.js → chunk-NC3CSWVT.js} +2 -2
- package/{chunk-6XG52ZQ6.js → chunk-NI2BS6UD.js} +22 -3
- package/{chunk-FXZBSLFK.js → chunk-NSQNNYGW.js} +20 -51
- package/{chunk-VOXNBPLB.js → chunk-OFSVXPQS.js} +651 -43
- package/{chunk-ZBB3MZR3.js → chunk-OLNC7AWK.js} +7 -4
- package/{chunk-J5NMOM35.js → chunk-OYNDYVSE.js} +1 -1
- package/{chunk-C6ELZQ7H.js → chunk-OZVGA4SY.js} +1 -1
- package/{chunk-K4KIFRIN.js → chunk-Q24S4NDF.js} +1 -1
- package/{chunk-HRSIJO5A.js → chunk-RNNAJ34U.js} +1 -1
- package/{chunk-JK7UM3LT.js → chunk-SEIOEDBB.js} +110 -49
- package/{chunk-2WKUUY2E.js → chunk-SVEUG45B.js} +5 -3
- package/{chunk-IZCHPD7T.js → chunk-TNPCQNGQ.js} +11 -6
- package/{chunk-4DMPISV6.js → chunk-URBGEE42.js} +2 -2
- package/{chunk-23KKIMD5.js → chunk-WVGEBWA6.js} +4 -4
- package/{chunk-TH7ZZKPJ.js → chunk-XIRSTDYF.js} +275 -134
- package/{chunk-64KIQZA2.js → chunk-XO3G35OV.js} +1 -1
- package/{chunk-CVXDBLYH.js → chunk-XOFZEJGM.js} +5 -5
- package/{chunk-XT73C4VH.js → chunk-Z5NW3O7V.js} +1 -1
- package/{codingSkills-H6N5EKSX.js → codingSkills-QLDAXJRA.js} +3 -4
- package/{cooldownCommands-C2SZLEEO.js → cooldownCommands-GI5NNWGL.js} +5 -3
- package/{createAgentAutomationAction-767ZITQJ.js → createAgentAutomationAction-TQ7PYONU.js} +21 -21
- package/{createDialogAction-H75NDXYH.js → createDialogAction-EOQFCM3K.js} +24 -25
- package/{createPageAction-KYJYZPLC.js → createPageAction-ZG5PH6BI.js} +22 -23
- package/db-VQSAOWAO.js +162 -0
- package/{dbSlice-PIQGICNM.js → dbSlice-XWUM4QOF.js} +5 -5
- package/deleteFile-NPZ64DFN.js +1 -1
- package/{dialogCommands-SSQLOBRU.js → dialogCommands-DCGMVLBA.js} +29 -27
- package/{dialogSlice-YJV3AVFM.js → dialogSlice-YHGPDBAZ.js} +20 -20
- package/{docCreateCommands-WYP6MQ56.js → docCreateCommands-A2LVLROP.js} +26 -28
- package/{docDeleteCommands-6YNU4LZ7.js → docDeleteCommands-ENMROKH6.js} +27 -29
- package/{docReadCommands-PFJMIPYU.js → docReadCommands-XSRUV4EM.js} +26 -28
- package/{docStore-JOODSWDW.js → docStore-WIKRGVQJ.js} +22 -22
- package/{docUpdateCommands-KAP6JSGT.js → docUpdateCommands-5B5NBORA.js} +26 -28
- package/{fetchMessages-CUEFN4GQ.js → fetchMessages-KZQVBXKY.js} +3 -3
- package/{getPricing-P3E2WRIH.js → getPricing-X3HXP6VQ.js} +3 -3
- package/{handleSendMessageAction-DGL6H4E4.js → handleSendMessageAction-WT4FDMQS.js} +21 -21
- package/index.js +70 -70
- package/levelLazyShim-GZBKODGI.js +7 -0
- package/{localDialogRead-P7CHFMIC.js → localDialogRead-NQ33HBSI.js} +2 -2
- package/{localRuntimeAuthority-S77B5QVB.js → localRuntimeAuthority-KQDAE64E.js} +4 -4
- package/{localRuntimeDb-N3H3HQ7G.js → localRuntimeDb-PF7CFKDL.js} +2 -2
- package/{machineCommands-NAFWPMLI.js → machineCommands-BFLTBAK6.js} +51 -53
- package/{machineWsRunDispatch-EWA7J37I.js → machineWsRunDispatch-VCJB5LHO.js} +51 -53
- package/{models-L7S2EKPM.js → models-7LWATQFH.js} +2 -2
- package/package.json +1 -1
- package/{read-6C2XD3YZ.js → read-DQQ75VI3.js} +2 -2
- package/{readDocTool-Y7AB365O.js → readDocTool-HCQQFAZD.js} +1 -1
- package/{readlineWorkspace-BCQVDX4V.js → readlineWorkspace-VBJLMU6V.js} +5168 -5003
- package/{removeDialogAgentAction-KG5WMJRZ.js → removeDialogAgentAction-DNONRKST.js} +7 -7
- package/{runAgentClientLoop-B3TTKXIX.js → runAgentClientLoop-4QOEJOJP.js} +41 -42
- package/{runtimeDoctorCommands-HT4O2PXL.js → runtimeDoctorCommands-JKTTN723.js} +4 -4
- package/serverStoreFactory-YMXDF4NI.js +20 -0
- package/{setDialogExtraReferencesAction-O2NLXMSM.js → setDialogExtraReferencesAction-ERHUPT3F.js} +6 -6
- package/{setPrimaryDialogAgentAction-FYYUY7PB.js → setPrimaryDialogAgentAction-6C2HYNEC.js} +7 -7
- package/{settingSlice-GPLI6E3M.js → settingSlice-YVRJFKQX.js} +6 -6
- package/{skillDiscovery-COX56OBO.js → skillDiscovery-GPUDHDTZ.js} +1 -2
- package/{spaceCommands-VHOKUADK.js → spaceCommands-FBB7XSAW.js} +24 -25
- package/{spaceSlice-ZKUZSVYD.js → spaceSlice-YMDZ4G6H.js} +21 -21
- package/{streamAgentChatTurn-PLTB7RMV.js → streamAgentChatTurn-5NBWQHY6.js} +93 -52
- package/{switchDialogAgentAction-GH5P6Q3Z.js → switchDialogAgentAction-HP57XYFP.js} +5 -5
- package/{tools-KQXDW66A.js → tools-37H5A4OG.js} +34 -35
- package/{tuiSummaryLlmCaller-SHRB4RWM.js → tuiSummaryLlmCaller-NBTWT57U.js} +25 -14
- package/{updateDialogTitleAction-OTYEQJAK.js → updateDialogTitleAction-XAGMXHW5.js} +24 -23
- package/chunk-4APLX2RT.js +0 -1514
- package/chunk-AETZ7AD6.js +0 -274
- package/chunk-OFZPJ3NT.js +0 -114
- package/chunk-P66M7LSQ.js +0 -58
- package/{chunk-6WD3OOJS.js → chunk-UV6VISQJ.js} +0 -0
- package/{tableCommands-PQUJ55AS.js → tableCommands-P2TXJ3CF.js} +1 -1
package/chunk-AETZ7AD6.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dump,
|
|
3
|
-
load
|
|
4
|
-
} from "./chunk-KHCLMKZZ.js";
|
|
5
|
-
import {
|
|
6
|
-
asTrimmedNonEmptyStringArray
|
|
7
|
-
} from "./chunk-I42VC5KR.js";
|
|
8
|
-
import {
|
|
9
|
-
asOptionalTrimmedString
|
|
10
|
-
} from "./chunk-G3SUCT4W.js";
|
|
11
|
-
|
|
12
|
-
// packages/ai/skills/skillDocProtocol.ts
|
|
13
|
-
var SKILL_DOC_ENUMS = {
|
|
14
|
-
triggerMode: ["explicit", "required", "recommended"],
|
|
15
|
-
// budgetTier 只服务 WorkflowReferenceConfig;skill 侧已移除(零读点)。
|
|
16
|
-
budgetTier: ["low", "medium", "high"],
|
|
17
|
-
modality: ["text", "image", "video", "audio", "3d"],
|
|
18
|
-
docKind: ["knowledge", "instruction", "skill"]
|
|
19
|
-
};
|
|
20
|
-
var SKILL_CONFIG_BLOCK = "skill-config";
|
|
21
|
-
var EVAL_CONFIG_BLOCK = "eval-config";
|
|
22
|
-
var WORKFLOW_CONFIG_BLOCK = "workflow-config";
|
|
23
|
-
var normalizeStringArray = (value) => {
|
|
24
|
-
if (!Array.isArray(value)) return void 0;
|
|
25
|
-
const items = [...new Set(asTrimmedNonEmptyStringArray(value))];
|
|
26
|
-
return items.length > 0 ? items : void 0;
|
|
27
|
-
};
|
|
28
|
-
var normalizeSkillEnumValue = (key, value) => typeof value === "string" && SKILL_DOC_ENUMS[key].includes(value) ? value : void 0;
|
|
29
|
-
var normalizeSkillModalities = (value) => {
|
|
30
|
-
const raw = normalizeStringArray(value);
|
|
31
|
-
if (!raw) return void 0;
|
|
32
|
-
const filtered = raw.flatMap((item) => {
|
|
33
|
-
const modality = normalizeSkillEnumValue("modality", item);
|
|
34
|
-
return modality ? [modality] : [];
|
|
35
|
-
});
|
|
36
|
-
return filtered.length > 0 ? Array.from(new Set(filtered)) : void 0;
|
|
37
|
-
};
|
|
38
|
-
var normalizeSkillConfig = (value, fallbackTools) => {
|
|
39
|
-
if (!value || typeof value !== "object") return void 0;
|
|
40
|
-
const record = value;
|
|
41
|
-
const name = asOptionalTrimmedString(record.name) ?? "";
|
|
42
|
-
const description = asOptionalTrimmedString(record.description) ?? "";
|
|
43
|
-
if (!name || !description) return void 0;
|
|
44
|
-
const triggerMode = normalizeSkillEnumValue("triggerMode", record.triggerMode);
|
|
45
|
-
const modalities = normalizeSkillModalities(record.modalities);
|
|
46
|
-
const toolNames = normalizeStringArray(record.toolNames) ?? normalizeStringArray(fallbackTools) ?? void 0;
|
|
47
|
-
return {
|
|
48
|
-
version: "0.1",
|
|
49
|
-
kind: "skill",
|
|
50
|
-
id: asOptionalTrimmedString(record.id),
|
|
51
|
-
name,
|
|
52
|
-
description,
|
|
53
|
-
triggerMode,
|
|
54
|
-
toolNames,
|
|
55
|
-
modalities,
|
|
56
|
-
requiredSkills: normalizeStringArray(record.requiredSkills),
|
|
57
|
-
recommendedSkills: normalizeStringArray(record.recommendedSkills),
|
|
58
|
-
promptPatch: asOptionalTrimmedString(record.promptPatch)
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
var normalizeEvalConfig = (value) => {
|
|
62
|
-
if (!value || typeof value !== "object") return void 0;
|
|
63
|
-
const record = value;
|
|
64
|
-
if (!Array.isArray(record.cases)) return void 0;
|
|
65
|
-
const cases = [];
|
|
66
|
-
for (const item of record.cases) {
|
|
67
|
-
if (!item || typeof item !== "object") continue;
|
|
68
|
-
const testCase = item;
|
|
69
|
-
const input = asOptionalTrimmedString(testCase.input) ?? "";
|
|
70
|
-
if (!input) continue;
|
|
71
|
-
cases.push({
|
|
72
|
-
input,
|
|
73
|
-
expectedTools: normalizeStringArray(testCase.expectedTools),
|
|
74
|
-
expectedSignals: normalizeStringArray(testCase.expectedSignals),
|
|
75
|
-
forbiddenSignals: normalizeStringArray(testCase.forbiddenSignals)
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return cases.length > 0 ? {
|
|
79
|
-
version: "0.1",
|
|
80
|
-
cases
|
|
81
|
-
} : void 0;
|
|
82
|
-
};
|
|
83
|
-
var normalizeWorkflowConfig = (value) => {
|
|
84
|
-
if (!value || typeof value !== "object") return void 0;
|
|
85
|
-
const record = value;
|
|
86
|
-
const name = asOptionalTrimmedString(record.name) ?? "";
|
|
87
|
-
const description = asOptionalTrimmedString(record.description) ?? "";
|
|
88
|
-
if (!name || !description) return void 0;
|
|
89
|
-
const budgetTier = normalizeSkillEnumValue("budgetTier", record.budgetTier);
|
|
90
|
-
return {
|
|
91
|
-
version: "0.1",
|
|
92
|
-
kind: "workflow",
|
|
93
|
-
id: asOptionalTrimmedString(record.id),
|
|
94
|
-
name,
|
|
95
|
-
description,
|
|
96
|
-
defaultAgent: asOptionalTrimmedString(record.defaultAgent),
|
|
97
|
-
inputs: normalizeStringArray(record.inputs),
|
|
98
|
-
recommendedTools: normalizeStringArray(record.recommendedTools),
|
|
99
|
-
requiredTools: normalizeStringArray(record.requiredTools),
|
|
100
|
-
requiredOutputs: normalizeStringArray(record.requiredOutputs),
|
|
101
|
-
gates: normalizeStringArray(record.gates),
|
|
102
|
-
budgetTier,
|
|
103
|
-
contextStrategy: asOptionalTrimmedString(record.contextStrategy),
|
|
104
|
-
failureProtocol: asOptionalTrimmedString(record.failureProtocol)
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
var normalizePageSkillMetadata = (value, fallbackTools) => {
|
|
108
|
-
if (!value || typeof value !== "object") return void 0;
|
|
109
|
-
const record = value;
|
|
110
|
-
const kind = normalizeSkillEnumValue("docKind", record.kind);
|
|
111
|
-
const meta = {
|
|
112
|
-
kind,
|
|
113
|
-
requiredSkills: normalizeStringArray(record.requiredSkills),
|
|
114
|
-
recommendedSkills: normalizeStringArray(record.recommendedSkills),
|
|
115
|
-
skillConfig: normalizeSkillConfig(record.skillConfig, fallbackTools),
|
|
116
|
-
evalConfig: normalizeEvalConfig(record.evalConfig),
|
|
117
|
-
workflowConfig: normalizeWorkflowConfig(record.workflowConfig)
|
|
118
|
-
};
|
|
119
|
-
if (meta.skillConfig && !meta.kind) {
|
|
120
|
-
meta.kind = "skill";
|
|
121
|
-
}
|
|
122
|
-
if (meta.workflowConfig && !meta.kind) {
|
|
123
|
-
meta.kind = "instruction";
|
|
124
|
-
}
|
|
125
|
-
return meta.kind || meta.requiredSkills || meta.recommendedSkills || meta.skillConfig || meta.evalConfig || meta.workflowConfig ? meta : void 0;
|
|
126
|
-
};
|
|
127
|
-
var extractCommentBlock = (markdown, blockName) => {
|
|
128
|
-
if (!markdown) return void 0;
|
|
129
|
-
const matcher = new RegExp(
|
|
130
|
-
`<!--\\s*${blockName}\\s*\\n([\\s\\S]*?)-->`,
|
|
131
|
-
"i"
|
|
132
|
-
);
|
|
133
|
-
const match = markdown.match(matcher);
|
|
134
|
-
return asOptionalTrimmedString(match?.[1]);
|
|
135
|
-
};
|
|
136
|
-
var removeCommentBlock = (markdown, blockName) => markdown.replace(
|
|
137
|
-
new RegExp(`\\n?<!--\\s*${blockName}\\s*\\n[\\s\\S]*?-->\\s*`, "gi"),
|
|
138
|
-
"\n\n"
|
|
139
|
-
);
|
|
140
|
-
var parseYamlObject = (raw) => {
|
|
141
|
-
if (!raw) return void 0;
|
|
142
|
-
try {
|
|
143
|
-
const parsed = load(raw);
|
|
144
|
-
return parsed && typeof parsed === "object" ? parsed : void 0;
|
|
145
|
-
} catch {
|
|
146
|
-
return void 0;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
var parseSkillDocProtocol = (markdown, existingMeta, fallbackTools) => {
|
|
150
|
-
const source = typeof markdown === "string" ? markdown : "";
|
|
151
|
-
const skillBlock = parseYamlObject(extractCommentBlock(source, SKILL_CONFIG_BLOCK));
|
|
152
|
-
const evalBlock = parseYamlObject(extractCommentBlock(source, EVAL_CONFIG_BLOCK));
|
|
153
|
-
const workflowBlock = parseYamlObject(extractCommentBlock(source, WORKFLOW_CONFIG_BLOCK));
|
|
154
|
-
const cleanedContent = removeCommentBlock(
|
|
155
|
-
removeCommentBlock(
|
|
156
|
-
removeCommentBlock(source, SKILL_CONFIG_BLOCK),
|
|
157
|
-
EVAL_CONFIG_BLOCK
|
|
158
|
-
),
|
|
159
|
-
WORKFLOW_CONFIG_BLOCK
|
|
160
|
-
).replace(/\n{3,}/g, "\n\n").trim();
|
|
161
|
-
const parsedMeta = normalizePageSkillMetadata(
|
|
162
|
-
{
|
|
163
|
-
...existingMeta ?? {},
|
|
164
|
-
...skillBlock ? {
|
|
165
|
-
kind: existingMeta?.kind === "skill" || skillBlock.kind === "skill" ? "skill" : existingMeta?.kind,
|
|
166
|
-
requiredSkills: skillBlock.requiredSkills ?? existingMeta?.requiredSkills,
|
|
167
|
-
recommendedSkills: skillBlock.recommendedSkills ?? existingMeta?.recommendedSkills,
|
|
168
|
-
skillConfig: skillBlock
|
|
169
|
-
} : {},
|
|
170
|
-
...evalBlock ? { evalConfig: evalBlock } : {},
|
|
171
|
-
...workflowBlock ? { workflowConfig: workflowBlock } : {}
|
|
172
|
-
},
|
|
173
|
-
fallbackTools
|
|
174
|
-
);
|
|
175
|
-
return {
|
|
176
|
-
content: cleanedContent,
|
|
177
|
-
meta: parsedMeta
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
var resolvePageSkillMetadata = (page) => {
|
|
181
|
-
if (!page) return void 0;
|
|
182
|
-
const existingMeta = normalizePageSkillMetadata(page.meta, page.tools);
|
|
183
|
-
return parseSkillDocProtocol(page.content ?? "", existingMeta, page.tools).meta;
|
|
184
|
-
};
|
|
185
|
-
var yamlBlock = (value) => dump(value, { lineWidth: 120, noRefs: true }).trim();
|
|
186
|
-
var buildSkillConfigComment = (config) => {
|
|
187
|
-
const payload = {
|
|
188
|
-
version: config.version,
|
|
189
|
-
kind: config.kind,
|
|
190
|
-
...config.id ? { id: config.id } : {},
|
|
191
|
-
name: config.name,
|
|
192
|
-
description: config.description,
|
|
193
|
-
...config.triggerMode ? { triggerMode: config.triggerMode } : {},
|
|
194
|
-
...config.requiredSkills?.length ? { requiredSkills: config.requiredSkills } : {},
|
|
195
|
-
...config.recommendedSkills?.length ? { recommendedSkills: config.recommendedSkills } : {},
|
|
196
|
-
...config.toolNames?.length ? { toolNames: config.toolNames } : {},
|
|
197
|
-
...config.modalities?.length ? { modalities: config.modalities } : {},
|
|
198
|
-
...config.promptPatch ? { promptPatch: config.promptPatch } : {}
|
|
199
|
-
};
|
|
200
|
-
return `<!-- ${SKILL_CONFIG_BLOCK}
|
|
201
|
-
${yamlBlock(payload)}
|
|
202
|
-
-->`;
|
|
203
|
-
};
|
|
204
|
-
var buildEvalConfigComment = (config) => `<!-- ${EVAL_CONFIG_BLOCK}
|
|
205
|
-
${yamlBlock({
|
|
206
|
-
version: config.version,
|
|
207
|
-
cases: config.cases
|
|
208
|
-
})}
|
|
209
|
-
-->`;
|
|
210
|
-
var buildWorkflowConfigComment = (config) => `<!-- ${WORKFLOW_CONFIG_BLOCK}
|
|
211
|
-
${yamlBlock({
|
|
212
|
-
version: config.version,
|
|
213
|
-
kind: config.kind,
|
|
214
|
-
...config.id ? { id: config.id } : {},
|
|
215
|
-
name: config.name,
|
|
216
|
-
description: config.description,
|
|
217
|
-
...config.defaultAgent ? { defaultAgent: config.defaultAgent } : {},
|
|
218
|
-
...config.inputs?.length ? { inputs: config.inputs } : {},
|
|
219
|
-
...config.recommendedTools?.length ? { recommendedTools: config.recommendedTools } : {},
|
|
220
|
-
...config.requiredTools?.length ? { requiredTools: config.requiredTools } : {},
|
|
221
|
-
...config.requiredOutputs?.length ? { requiredOutputs: config.requiredOutputs } : {},
|
|
222
|
-
...config.gates?.length ? { gates: config.gates } : {},
|
|
223
|
-
...config.budgetTier ? { budgetTier: config.budgetTier } : {},
|
|
224
|
-
...config.contextStrategy ? { contextStrategy: config.contextStrategy } : {},
|
|
225
|
-
...config.failureProtocol ? { failureProtocol: config.failureProtocol } : {}
|
|
226
|
-
})}
|
|
227
|
-
-->`;
|
|
228
|
-
var buildSkillDocMarkdown = (options) => {
|
|
229
|
-
const sections = [
|
|
230
|
-
asOptionalTrimmedString(options.body) ?? "",
|
|
231
|
-
buildSkillConfigComment(options.skillConfig),
|
|
232
|
-
options.evalConfig ? buildEvalConfigComment(options.evalConfig) : "",
|
|
233
|
-
options.workflowConfig ? buildWorkflowConfigComment(options.workflowConfig) : ""
|
|
234
|
-
].filter(Boolean);
|
|
235
|
-
return sections.join("\n\n").trim();
|
|
236
|
-
};
|
|
237
|
-
var extractFrontmatter = (markdown) => {
|
|
238
|
-
const match = markdown.match(/^\s*---\s*\n([\s\S]*?)\n\s*---\s*\n?/);
|
|
239
|
-
if (!match) return { body: markdown.trim() };
|
|
240
|
-
const frontmatter = parseYamlObject(match[1]);
|
|
241
|
-
const body = markdown.slice(match[0].length).trim();
|
|
242
|
-
return { frontmatter, body };
|
|
243
|
-
};
|
|
244
|
-
var normalizeAllowedTools = (value) => {
|
|
245
|
-
if (Array.isArray(value)) {
|
|
246
|
-
return normalizeStringArray(value) ?? [];
|
|
247
|
-
}
|
|
248
|
-
if (typeof value === "string") {
|
|
249
|
-
return value.split(/\s+/).map((item) => item.trim()).filter(Boolean);
|
|
250
|
-
}
|
|
251
|
-
return [];
|
|
252
|
-
};
|
|
253
|
-
var parseExternalSkillMarkdown = (markdown) => {
|
|
254
|
-
const { frontmatter, body } = extractFrontmatter(markdown);
|
|
255
|
-
return {
|
|
256
|
-
name: asOptionalTrimmedString(frontmatter?.name),
|
|
257
|
-
description: asOptionalTrimmedString(frontmatter?.description),
|
|
258
|
-
compatibility: asOptionalTrimmedString(frontmatter?.compatibility),
|
|
259
|
-
allowedTools: normalizeAllowedTools(frontmatter?.["allowed-tools"]),
|
|
260
|
-
metadata: frontmatter?.metadata && typeof frontmatter.metadata === "object" ? Object.fromEntries(
|
|
261
|
-
Object.entries(frontmatter.metadata).filter(([, value]) => typeof value === "string").map(([key, value]) => [key, String(value)])
|
|
262
|
-
) : void 0,
|
|
263
|
-
body
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
export {
|
|
268
|
-
normalizeStringArray,
|
|
269
|
-
normalizeSkillModalities,
|
|
270
|
-
parseSkillDocProtocol,
|
|
271
|
-
resolvePageSkillMetadata,
|
|
272
|
-
buildSkillDocMarkdown,
|
|
273
|
-
parseExternalSkillMarkdown
|
|
274
|
-
};
|
package/chunk-OFZPJ3NT.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
load
|
|
3
|
-
} from "./chunk-KHCLMKZZ.js";
|
|
4
|
-
import {
|
|
5
|
-
buildSkillDiscoveryLayer
|
|
6
|
-
} from "./chunk-3AOLVADY.js";
|
|
7
|
-
|
|
8
|
-
// packages/agent-runtime/skillDiscovery.ts
|
|
9
|
-
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
|
-
import { join } from "node:path";
|
|
11
|
-
var SKILL_SCAN_DIRS = [".agents/skills"];
|
|
12
|
-
var MAX_DISCOVERED_SKILLS = 50;
|
|
13
|
-
var MAX_DISCOVERY_DESC_BUDGET = 4e3;
|
|
14
|
-
var MIN_DESC_LENGTH = 80;
|
|
15
|
-
function parseSkillFrontmatter(filePath) {
|
|
16
|
-
try {
|
|
17
|
-
const content = readFileSync(filePath, "utf8").slice(0, 2048);
|
|
18
|
-
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
19
|
-
if (!fmMatch) return {};
|
|
20
|
-
const fm = (() => {
|
|
21
|
-
try {
|
|
22
|
-
return load(fmMatch[1]);
|
|
23
|
-
} catch (err) {
|
|
24
|
-
console.warn(
|
|
25
|
-
`[skillDiscovery] failed to parse frontmatter: ${filePath}: ${err.message}`
|
|
26
|
-
);
|
|
27
|
-
throw err;
|
|
28
|
-
}
|
|
29
|
-
})();
|
|
30
|
-
if (!fm || typeof fm !== "object") return {};
|
|
31
|
-
const name = typeof fm.name === "string" ? fm.name : void 0;
|
|
32
|
-
const rawDesc = fm.description;
|
|
33
|
-
const description = typeof rawDesc === "string" ? rawDesc : rawDesc == null ? void 0 : String(rawDesc);
|
|
34
|
-
const sanitizeName = (s) => s?.trim().replace(/^["']|["']$/g, "").replace(/[\n\r]+/g, " ").slice(0, 200);
|
|
35
|
-
const sanitizeDesc = (s) => s?.trim().replace(/^["']|["']$/g, "").replace(/[\n\r]+/g, " ").slice(0, 200);
|
|
36
|
-
return { name: sanitizeName(name), description: sanitizeDesc(description) };
|
|
37
|
-
} catch {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function discoverSkills(cwd) {
|
|
42
|
-
const skills = [];
|
|
43
|
-
for (const dir of SKILL_SCAN_DIRS) {
|
|
44
|
-
if (skills.length >= MAX_DISCOVERED_SKILLS) break;
|
|
45
|
-
const absDir = join(cwd, dir);
|
|
46
|
-
if (!existsSync(absDir) || !statSync(absDir).isDirectory()) continue;
|
|
47
|
-
try {
|
|
48
|
-
for (const entry of readdirSync(absDir)) {
|
|
49
|
-
if (skills.length >= MAX_DISCOVERED_SKILLS) break;
|
|
50
|
-
const skillMdPath = join(absDir, entry, "SKILL.md");
|
|
51
|
-
if (existsSync(skillMdPath)) {
|
|
52
|
-
const { name, description } = parseSkillFrontmatter(skillMdPath);
|
|
53
|
-
skills.push({ name: name ?? entry, description: description ?? "", relativePath: join(dir, entry, "SKILL.md") });
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
} catch {
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const totalDescLen = skills.reduce((sum, s) => sum + s.description.length, 0);
|
|
61
|
-
if (totalDescLen > MAX_DISCOVERY_DESC_BUDGET && skills.length > 0) {
|
|
62
|
-
const scale = MAX_DISCOVERY_DESC_BUDGET / totalDescLen;
|
|
63
|
-
for (const s of skills) {
|
|
64
|
-
const targetLen = Math.max(MIN_DESC_LENGTH, Math.floor(s.description.length * scale));
|
|
65
|
-
if (s.description.length > targetLen) {
|
|
66
|
-
s.description = s.description.slice(0, targetLen).trimEnd();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return skills;
|
|
71
|
-
}
|
|
72
|
-
function resolveSkillByName(cwd, name) {
|
|
73
|
-
const trimmed = name.trim();
|
|
74
|
-
if (!trimmed || trimmed.includes("/") || trimmed.includes("\\") || trimmed.includes("..")) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
const agentsDir = join(cwd, ".agents", "skills", trimmed);
|
|
78
|
-
const agentsSkillMd = join(agentsDir, "SKILL.md");
|
|
79
|
-
if (existsSync(agentsSkillMd)) return agentsSkillMd;
|
|
80
|
-
const agentsParent = join(cwd, ".agents", "skills");
|
|
81
|
-
if (existsSync(agentsParent) && statSync(agentsParent).isDirectory()) {
|
|
82
|
-
try {
|
|
83
|
-
for (const entry of readdirSync(agentsParent)) {
|
|
84
|
-
const candidate = join(agentsParent, entry, "SKILL.md");
|
|
85
|
-
if (!existsSync(candidate)) continue;
|
|
86
|
-
try {
|
|
87
|
-
const { name: fmName } = parseSkillFrontmatter(candidate);
|
|
88
|
-
if (fmName && fmName === trimmed) return candidate;
|
|
89
|
-
} catch {
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
} catch {
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
function buildSkillDiscoveryContextLayer(cwd) {
|
|
98
|
-
try {
|
|
99
|
-
return buildSkillDiscoveryLayer(discoverSkills(cwd), cwd);
|
|
100
|
-
} catch {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function buildSkillDiscoveryContextBlock(cwd) {
|
|
105
|
-
return buildSkillDiscoveryContextLayer(cwd)?.content ?? null;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export {
|
|
109
|
-
parseSkillFrontmatter,
|
|
110
|
-
discoverSkills,
|
|
111
|
-
resolveSkillByName,
|
|
112
|
-
buildSkillDiscoveryContextLayer,
|
|
113
|
-
buildSkillDiscoveryContextBlock
|
|
114
|
-
};
|
package/chunk-P66M7LSQ.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// packages/agent-runtime/emptyAssistantRepair.ts
|
|
2
|
-
var EMPTY_ASSISTANT_REPAIR_PROMPT = "\u8BF7\u7ED9\u51FA\u660E\u786E\u7684\u6587\u5B57\u56DE\u7B54\u6216\u6267\u884C\u4E0B\u4E00\u6B65\uFF1A\u5982\u679C\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u8BF7\u76F4\u63A5\u603B\u7ED3\u7ED3\u679C\uFF1B\u5982\u679C\u9700\u8981\u8C03\u7528\u5DE5\u5177\uFF0C\u8BF7\u76F4\u63A5\u8F93\u51FA tool_calls\u3002\u8BF7\u5207\u52FF\u8FD4\u56DE\u7A7A\u5185\u5BB9\u3002";
|
|
3
|
-
var EMPTY_ASSISTANT_FALLBACK_MESSAGE = "\u6A21\u578B\u8FDE\u7EED\u8FD4\u56DE\u7A7A\u6D88\u606F\uFF0C\u5F53\u524D\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\uFF0C\u6216\u7ED9\u51FA\u66F4\u5177\u4F53\u7684\u4FEE\u6539\u8303\u56F4\u3002";
|
|
4
|
-
var LENGTH_TRUNCATED_FALLBACK_MESSAGE = "\u8F93\u51FA\u8FBE\u5230\u957F\u5EA6\u4E0A\u9650\u88AB\u622A\u65AD\uFF0C\u5EFA\u8BAE\u7F29\u77ED\u4EFB\u52A1\u6216\u63D0\u9AD8\u8F93\u51FA\u4E0A\u9650\u3002";
|
|
5
|
-
var STREAM_TRUNCATED_FALLBACK_MESSAGE = "\u4E0A\u6E38\u54CD\u5E94\u6D41\u5728\u6536\u5C3E\u524D\u88AB\u4E2D\u65AD\uFF08\u672A\u6536\u5230\u7ED3\u675F\u6807\u8BB0\uFF09\uFF0C\u672C\u8F6E\u8F93\u51FA\u4E0D\u5B8C\u6574\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\u3002";
|
|
6
|
-
var REPETITION_LOOP_FALLBACK_MESSAGE = "\u68C0\u6D4B\u5230\u6A21\u578B\u9677\u5165\u91CD\u590D\u8F93\u51FA\u6B7B\u5FAA\u73AF\uFF0C\u5DF2\u81EA\u52A8\u7194\u65AD\u7EC8\u6B62\u5F53\u524D\u4EFB\u52A1\u3002";
|
|
7
|
-
var STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE = "\u68C0\u6D4B\u5230\u8FDE\u7EED\u591A\u6B21\u76F8\u540C\u5DE5\u5177\u8C03\u7528\u4E14\u65E0\u5B9E\u8D28\u8FDB\u5C55\uFF0C\u5DF2\u81EA\u52A8\u7194\u65AD\u7EC8\u6B62\u5F53\u524D\u4EFB\u52A1\u3002";
|
|
8
|
-
var MAX_REASONING_ONLY_REPAIRS = 2;
|
|
9
|
-
function resolveEmptyAssistantOutcome(args) {
|
|
10
|
-
if (args.hasToolCalls || args.hasVisibleOutput) return { kind: "ok" };
|
|
11
|
-
if (args.finishReason === "length") return { kind: "fallback", reason: "length_truncated" };
|
|
12
|
-
if (!args.finishReason && !args.streamComplete) {
|
|
13
|
-
if (!args.repairUsed) return { kind: "repair" };
|
|
14
|
-
return { kind: "fallback", reason: "stream_truncated" };
|
|
15
|
-
}
|
|
16
|
-
if (args.hasReasoning && (args.reasoningRepairCount ?? 0) < MAX_REASONING_ONLY_REPAIRS) {
|
|
17
|
-
return { kind: "repair" };
|
|
18
|
-
}
|
|
19
|
-
if (!args.repairUsed) return { kind: "repair" };
|
|
20
|
-
return { kind: "fallback", reason: "empty_completion" };
|
|
21
|
-
}
|
|
22
|
-
function resolveEmptyAssistantFallbackMessage(reason) {
|
|
23
|
-
if (reason === "length_truncated") return LENGTH_TRUNCATED_FALLBACK_MESSAGE;
|
|
24
|
-
if (reason === "stream_truncated") return STREAM_TRUNCATED_FALLBACK_MESSAGE;
|
|
25
|
-
if (reason === "repetition_loop") return REPETITION_LOOP_FALLBACK_MESSAGE;
|
|
26
|
-
if (reason === "stagnant_tool_calls") return STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE;
|
|
27
|
-
return EMPTY_ASSISTANT_FALLBACK_MESSAGE;
|
|
28
|
-
}
|
|
29
|
-
function hasAssistantVisibleOutput(content) {
|
|
30
|
-
if (typeof content === "string") return content.trim().length > 0;
|
|
31
|
-
if (!Array.isArray(content)) return false;
|
|
32
|
-
return content.some((part) => {
|
|
33
|
-
if (part?.type === "text" && String(part.text ?? "").trim()) return true;
|
|
34
|
-
if (part?.type === "image_url") {
|
|
35
|
-
const url = part?.image_url?.url;
|
|
36
|
-
return typeof url === "string" && url.trim().length > 0;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
var LENGTH_TRUNCATED_REASONING_MARKER = "[length_truncated_reasoning_tail]";
|
|
42
|
-
var MAX_TRUNCATED_REASONING_CHARS = 2e3;
|
|
43
|
-
function formatLengthTruncatedReasoningTail(reasoning_content, maxChars = MAX_TRUNCATED_REASONING_CHARS) {
|
|
44
|
-
if (typeof reasoning_content !== "string") return null;
|
|
45
|
-
const trimmed = reasoning_content.trim();
|
|
46
|
-
if (trimmed.length === 0) return null;
|
|
47
|
-
const tail = trimmed.length > maxChars ? trimmed.slice(-maxChars) : trimmed;
|
|
48
|
-
return `[nolo] ${LENGTH_TRUNCATED_REASONING_MARKER}
|
|
49
|
-
${tail}`;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
EMPTY_ASSISTANT_REPAIR_PROMPT,
|
|
54
|
-
resolveEmptyAssistantOutcome,
|
|
55
|
-
resolveEmptyAssistantFallbackMessage,
|
|
56
|
-
hasAssistantVisibleOutput,
|
|
57
|
-
formatLengthTruncatedReasoningTail
|
|
58
|
-
};
|
|
File without changes
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
getAllServers
|
|
24
24
|
} from "./chunk-L3JWI7WX.js";
|
|
25
|
+
import "./chunk-OW765XBU.js";
|
|
25
26
|
import {
|
|
26
27
|
isRecord
|
|
27
28
|
} from "./chunk-KUG52IAP.js";
|
|
28
|
-
import "./chunk-OW765XBU.js";
|
|
29
29
|
import {
|
|
30
30
|
NOLO_CLUSTER_SERVERS
|
|
31
31
|
} from "./chunk-LCBAMY2M.js";
|