nolo-cli 0.12.0-alpha.1 → 0.12.0-alpha.10
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-MWAY74HA.js → _executeModel-4F7VZR5U.js} +24 -23
- package/{action-RAXNQQKC.js → action-OTOWUMPW.js} +3 -3
- package/{addContentAction-ZHI7TVV3.js → addContentAction-JGBUVR7K.js} +2 -2
- package/{addDialogAgentAction-JWXPKXNC.js → addDialogAgentAction-V6CL2UCF.js} +1 -1
- package/{agentDeleteCommand-LXR5A5FV.js → agentDeleteCommand-MMRSG6AB.js} +15 -14
- package/{agentEmailCommands-DXRAP7BB.js → agentEmailCommands-YFVKOGM7.js} +28 -27
- package/{agentListCommands-ZFMS5ZLY.js → agentListCommands-2PZHIQ3I.js} +16 -15
- package/{agentMachineCommands-ZJLYVV52.js → agentMachineCommands-55UUZNHF.js} +17 -16
- package/{agentRecordCommands-DFS626TB.js → agentRecordCommands-BTP3OAPL.js} +28 -27
- package/{agentRunCommand-GWBIE2TS.js → agentRunCommand-AA4QLRQZ.js} +29 -28
- package/{agentRuntimeLocal-YNZSHMZC.js → agentRuntimeLocal-QDJCBXM2.js} +12 -11
- package/{agentSlice-T2PXOEPQ.js → agentSlice-6JAJOU3X.js} +2 -2
- package/{chunk-G3B356GF.js → chunk-2BVGERJ2.js} +67 -3
- package/{chunk-WWU275LU.js → chunk-3MI5LDDU.js} +2 -2
- package/{chunk-OPZYGHUC.js → chunk-3WGLLTK4.js} +59 -1
- package/{chunk-EBH7G34M.js → chunk-3XF6LCCN.js} +2 -2
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-ZR4VHQ5D.js → chunk-5S4SWV5G.js} +38 -26
- package/{chunk-JUN3HFMN.js → chunk-5V524MHX.js} +25 -15
- package/{chunk-JZDIW766.js → chunk-ARSC56DC.js} +1 -1
- package/{chunk-3QKO4EHV.js → chunk-AS3ZQ3O2.js} +16 -25
- package/{chunk-43UD5ZP7.js → chunk-B4KT7RN2.js} +4 -4
- package/{chunk-YTQLJYLB.js → chunk-C3BFP57W.js} +95 -2
- package/{chunk-QCA3EPYK.js → chunk-CGDQDXKZ.js} +1 -1
- package/{chunk-7MYHLZ3F.js → chunk-DPFWKRHG.js} +1 -1
- package/{chunk-LHSJMY5V.js → chunk-EIMX5ER5.js} +3 -3
- package/{chunk-AM53Q2SD.js → chunk-FSUZIGIG.js} +28 -39
- package/{chunk-4GBNEA5B.js → chunk-H5Y2H2N6.js} +1 -1
- package/{chunk-S73OEOHH.js → chunk-JFANOO7I.js} +3 -15
- package/{chunk-OCDEWRE2.js → chunk-JKWWVF2I.js} +1 -1
- package/{chunk-WTYKCU4W.js → chunk-JU7J7EAV.js} +37 -37
- package/{chunk-5ITRDSHY.js → chunk-KWBH4RAL.js} +57 -18
- package/{chunk-6OVCRC72.js → chunk-LUKQQJFL.js} +39 -2
- package/{chunk-DRMGJFGQ.js → chunk-MG6BVV3T.js} +31 -17
- package/{chunk-RSEUHW6T.js → chunk-MQRZ5QUH.js} +1 -1
- package/{chunk-RZ735TLX.js → chunk-MZHSAPZP.js} +167 -20
- package/{chunk-OPKKB25T.js → chunk-O4FOPRCP.js} +1 -1
- package/{chunk-S3UTETIC.js → chunk-OGGHETUE.js} +19 -4
- package/{chunk-4EH7AR52.js → chunk-OPM2DE2J.js} +1 -1
- package/{chunk-UG3WOFU6.js → chunk-QJSTNKJY.js} +1 -1
- package/{chunk-DE5BA4O6.js → chunk-QUHUVG6Y.js} +2 -2
- package/{chunk-YDCZVUFP.js → chunk-RQSOAMPJ.js} +16 -0
- package/{chunk-ZPFRLGIZ.js → chunk-RUGEW4P7.js} +70 -37
- package/{chunk-6LMFFG3K.js → chunk-RWO5DGXI.js} +2 -2
- package/{chunk-4BTHUYMY.js → chunk-TA7VKOHU.js} +23 -9
- package/{chunk-MEVCDATU.js → chunk-TQYYGE6G.js} +3 -3
- package/{chunk-TSKWE74T.js → chunk-TYPHUVK5.js} +13 -1
- package/{chunk-RNQ5BLR2.js → chunk-VBSWHE5W.js} +1 -1
- package/{chunk-NITP2JDG.js → chunk-VKG4HXYV.js} +1 -1
- package/{chunk-3HHTVM6G.js → chunk-WVTBAALN.js} +1 -1
- package/{chunk-GPZM7QH6.js → chunk-Y5P3ZRGC.js} +4 -4
- package/{chunk-GDBCUWQ3.js → chunk-YUMYYXPI.js} +31 -167
- package/{createAgentAutomationAction-G32GKDGV.js → createAgentAutomationAction-4NY4JLOK.js} +9 -8
- package/{createDialogAction-TISANRZK.js → createDialogAction-I5WUWFJ6.js} +10 -9
- package/{createPageAction-O7KOYNV4.js → createPageAction-HFTIQ7TW.js} +9 -8
- package/{dbSlice-WDP2ZZHK.js → dbSlice-J4PUZ6Y5.js} +1 -1
- package/{dialogCommands-6JPB3YQY.js → dialogCommands-SVXRJFZS.js} +16 -15
- package/{dialogSlice-PRHHYSP5.js → dialogSlice-35LA3ZRG.js} +9 -8
- package/{docCreateCommands-75E6TZNN.js → docCreateCommands-Z7RIAYKQ.js} +15 -14
- package/{docDeleteCommands-EJHLN7LW.js → docDeleteCommands-NEYHUVZF.js} +16 -15
- package/{docReadCommands-RJYBC4FS.js → docReadCommands-I4US2SDE.js} +15 -14
- package/{docStore-H5VWKT5D.js → docStore-3CP2IO6M.js} +10 -9
- package/{docUpdateCommands-MG4CNISV.js → docUpdateCommands-UU5HQBRP.js} +15 -14
- package/{getPricing-6TOZXPAU.js → getPricing-UGDJHI7M.js} +2 -2
- package/{handleSendMessageAction-QTUGICSZ.js → handleSendMessageAction-FWTLQGOZ.js} +9 -8
- package/index.js +36 -36
- package/{machineCommands-MAV7M3TK.js → machineCommands-STHZKBDJ.js} +28 -27
- package/{machineWsRunDispatch-ZOEGTKHC.js → machineWsRunDispatch-7YHT4TPT.js} +27 -26
- package/package.json +1 -1
- package/{readlineWorkspace-SWQKC7ZS.js → readlineWorkspace-OMRWYMB6.js} +203 -75
- package/{removeDialogAgentAction-GTX5AN54.js → removeDialogAgentAction-XUZYQBV4.js} +3 -3
- package/{runAgentClientLoop-P25HACXX.js → runAgentClientLoop-FP2K33ZO.js} +20 -19
- package/{setDialogExtraReferencesAction-WFQ63KYO.js → setDialogExtraReferencesAction-PTAIFKGM.js} +1 -1
- package/{setPrimaryDialogAgentAction-P57FXTSU.js → setPrimaryDialogAgentAction-HRFTDB44.js} +3 -3
- package/{settingSlice-CK5YZGNI.js → settingSlice-VGRJUSE5.js} +2 -2
- package/{skillDiscovery-ZYHSX7VD.js → skillDiscovery-6M2BZUFN.js} +1 -1
- package/{spaceCommands-6O5EFEM5.js → spaceCommands-GN73BCOB.js} +15 -14
- package/{spaceSlice-4EXTYXS4.js → spaceSlice-WTFNKOVA.js} +11 -8
- package/{streamAgentChatTurn-Q3FJAHG2.js → streamAgentChatTurn-HBAQQVNK.js} +244 -26
- package/{tools-AHNQE4GP.js → tools-TPQYTLQZ.js} +15 -14
- package/{tuiSummaryLlmCaller-TXLF4MEI.js → tuiSummaryLlmCaller-XDC7WG4K.js} +6 -4
- package/{updateDialogTitleAction-XZDVLKVX.js → updateDialogTitleAction-AWXNPUQJ.js} +9 -8
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveOpenAiCompatibleProviderConfig,
|
|
19
19
|
shouldCacheHybridRemoteRecord,
|
|
20
20
|
shouldFetchAgentRuntimeRecordRemotely
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MG6BVV3T.js";
|
|
22
22
|
import "./chunk-ZNFJWEN4.js";
|
|
23
23
|
import {
|
|
24
24
|
buildPlatformChatCompletionRequest,
|
|
@@ -29,23 +29,24 @@ import {
|
|
|
29
29
|
resolveLegacyDeepSeekProxyChatFallback,
|
|
30
30
|
resolvePlatformChatProviderConfig,
|
|
31
31
|
shouldUsePlatformChatProvider
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5S4SWV5G.js";
|
|
33
33
|
import {
|
|
34
34
|
resolveAgentRuntimeConfigFromRecord
|
|
35
35
|
} from "./chunk-NCGFB7NN.js";
|
|
36
36
|
import {
|
|
37
37
|
runLocalAgentTurn
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-TA7VKOHU.js";
|
|
39
|
+
import "./chunk-3WGLLTK4.js";
|
|
40
|
+
import "./chunk-LUKQQJFL.js";
|
|
41
41
|
import {
|
|
42
42
|
pickAgentRuntimeInferenceOptions
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-TYPHUVK5.js";
|
|
44
44
|
import {
|
|
45
45
|
resolveRuntimeToolSurfaceForAgent
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-B4KT7RN2.js";
|
|
47
|
+
import "./chunk-JFANOO7I.js";
|
|
48
|
+
import "./chunk-5MMAK75Q.js";
|
|
49
|
+
import "./chunk-OGGHETUE.js";
|
|
49
50
|
import {
|
|
50
51
|
resolveCurrentRunRuntimeToolPolicy,
|
|
51
52
|
resolveLocalRuntimeEnvFromPolicy,
|
|
@@ -61,8 +62,8 @@ import "./chunk-DWLEOOGR.js";
|
|
|
61
62
|
import "./chunk-IKXL2HZ3.js";
|
|
62
63
|
import "./chunk-524BDL33.js";
|
|
63
64
|
import "./chunk-KX6YBIHG.js";
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
65
|
+
import "./chunk-WVTBAALN.js";
|
|
66
|
+
import "./chunk-VKG4HXYV.js";
|
|
66
67
|
import "./chunk-WPHL6ALY.js";
|
|
67
68
|
import "./chunk-O4BU24WZ.js";
|
|
68
69
|
import "./chunk-I42VC5KR.js";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
slice,
|
|
8
8
|
streamAgentChatTurn,
|
|
9
9
|
updateAgent
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Y5P3ZRGC.js";
|
|
11
11
|
import "./chunk-PDL2AV3E.js";
|
|
12
12
|
import "./chunk-JZPBVBIY.js";
|
|
13
13
|
import "./chunk-KX6YBIHG.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-VKG4HXYV.js";
|
|
15
15
|
import "./chunk-WPHL6ALY.js";
|
|
16
16
|
import "./chunk-O4BU24WZ.js";
|
|
17
17
|
import "./chunk-I42VC5KR.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
prepareAndPersistMessage,
|
|
4
4
|
uiAskChoiceFunc,
|
|
5
5
|
uiAskChoiceFunctionSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FSUZIGIG.js";
|
|
7
7
|
import {
|
|
8
8
|
require_date_fns
|
|
9
9
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
removeCachedEntity,
|
|
26
26
|
upsertSSREntity,
|
|
27
27
|
write
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-VKG4HXYV.js";
|
|
29
29
|
import {
|
|
30
30
|
createAgentKey,
|
|
31
31
|
createDialogKey,
|
|
@@ -60,7 +60,8 @@ var BUILTIN_OBJECT_SKILL_IDS = {
|
|
|
60
60
|
doc: "builtin-doc-skill-v1",
|
|
61
61
|
code: "builtin-code-skill-v1",
|
|
62
62
|
image: "builtin-image-skill-v1",
|
|
63
|
-
file: "builtin-file-skill-v1"
|
|
63
|
+
file: "builtin-file-skill-v1",
|
|
64
|
+
pagebuilder: "builtin-pagebuilder-skill-v1"
|
|
64
65
|
};
|
|
65
66
|
var SKILL_DEFS = {
|
|
66
67
|
doc: {
|
|
@@ -134,6 +135,69 @@ var SKILL_DEFS = {
|
|
|
134
135
|
"2. \u4E0D\u8981\u5047\u88C5\u5DF2\u7ECF\u5B8C\u6210\u6587\u4EF6\u5185\u5BB9\u89E3\u6790\uFF1B\u5FC5\u8981\u65F6\u660E\u786E\u544A\u8BC9\u7528\u6237\u5F53\u524D\u66F4\u591A\u662F\u5360\u4F4D\u578B\u5DE5\u4F5C\u6D41\u5165\u53E3\uFF0C\u7B49\u5F85\u540E\u7EED\u63A5\u5165\u66F4\u5B8C\u6574\u7684\u6587\u4EF6\u5904\u7406\u80FD\u529B\u3002"
|
|
135
136
|
].join("\n"),
|
|
136
137
|
keywords: ["\u6587\u4EF6", "\u89E3\u6790", "\u63D0\u53D6", "\u6574\u7406", "\u5904\u7406", "file", "document", "pdf"]
|
|
138
|
+
},
|
|
139
|
+
pagebuilder: {
|
|
140
|
+
id: BUILTIN_OBJECT_SKILL_IDS.pagebuilder,
|
|
141
|
+
name: "\u52A8\u6001\u4EA4\u4E92\u7EC4\u4EF6\u751F\u6210\u6280\u80FD",
|
|
142
|
+
description: "\u628A\u4E00\u53E5\u8BDD\u9700\u6C42\u53D8\u6210\u53EF\u770B\u7684\u4EA4\u4E92\u9875\u9762\u3001\u62A5\u544A\u3001\u770B\u677F\u3001\u4E3B\u9875\u3001\u6559\u7A0B\u3001\u5BF9\u6BD4\u9875\u6216\u8BA1\u5212\u9875\u3002\u4EFB\u4F55 agent \u5728\u9700\u8981\u8F93\u51FA\u53EF\u4EA4\u4E92\u53EF\u89C6\u5316\u6D88\u606F\u65F6\u6309\u9700\u52A0\u8F7D\u3002",
|
|
143
|
+
toolNames: [],
|
|
144
|
+
promptPatch: [
|
|
145
|
+
"\u52A8\u6001\u4EA4\u4E92\u7EC4\u4EF6\u751F\u6210\u89C4\u5219\uFF1A",
|
|
146
|
+
"\u4F60\u73B0\u5728\u7684\u4EFB\u52A1\u662F\u628A\u7528\u6237\u9700\u6C42\u53D8\u6210\u4E00\u4E2A\u53EF\u770B\u7684\u4EA4\u4E92\u9875\u9762/\u62A5\u544A/\u770B\u677F/\u4E3B\u9875/\u6559\u7A0B/\u5BF9\u6BD4\u9875/\u8BA1\u5212\u9875\u3002\u7528\u6237\u770B\u4E0D\u5230\u6E90\u7801\uFF0C\u53EA\u4F1A\u770B\u5230\u9875\u9762\u7ED3\u679C\u3002",
|
|
147
|
+
"",
|
|
148
|
+
"\u7EDD\u5BF9\u89C4\u5219\uFF1A",
|
|
149
|
+
"1. \u53EA\u8F93\u51FA\u4E00\u4E2A Markdown \u4EE3\u7801\u5757\uFF0C\u4EE3\u7801\u5757\u8BED\u8A00\u5FC5\u987B\u662F tsx preview\u3002",
|
|
150
|
+
"2. \u4EE3\u7801\u5757\u5916\u4E0D\u8981\u8F93\u51FA\u89E3\u91CA\u3001\u524D\u8A00\u3001\u7ED3\u5C3E\u3001\u6E05\u5355\u6216\u601D\u8003\u8FC7\u7A0B\u3002",
|
|
151
|
+
"3. \u4EE3\u7801\u5FC5\u987B\u5B9A\u4E49\u9876\u5C42 function Example()\uFF0C\u4E0D\u8981\u8C03\u7528 render()\uFF0C\u4E0D\u8981 export default\u3002",
|
|
152
|
+
"4. \u4E0D\u8981\u5199 import\u3002\u8FD0\u884C\u73AF\u5883\u5DF2\u7ECF\u63D0\u4F9B React\u3001useState\u3001useEffect\u3001useMemo\u3001useCallback\u3001useRef\u3001ReactECharts\u3001react-icons/lu \u7684\u56FE\u6807\u7EC4\u4EF6\u3002",
|
|
153
|
+
"5. \u6240\u6709\u4EA4\u4E92\u5FC5\u987B\u5728 Example \u5185\u7528 React state \u5B9E\u73B0\uFF0C\u6309\u94AE\u3001Tab\u3001FAQ\u3001\u6B65\u9AA4\u5207\u6362\u3001\u7B5B\u9009\u90FD\u8981\u771F\u7684\u53EF\u70B9\u51FB\u3002",
|
|
154
|
+
"6. \u4E3A\u4E3B\u8981\u533A\u5757\u52A0 data-artifact-section \u5C5E\u6027\u3002",
|
|
155
|
+
"7. \u751F\u6210\u7ED3\u679C\u4F18\u5148\u662F\u4E00\u9875\u5B8C\u6574\u53EF\u7528\u7684\u9875\u9762\uFF0C\u4E0D\u8981\u53EA\u505A\u5B64\u7ACB\u5361\u7247\u6216\u4E00\u4E2A\u56FE\u3002",
|
|
156
|
+
"8. \u5982\u679C\u7528\u6237\u6CA1\u6709\u7ED9\u5177\u4F53\u6570\u636E\uFF0C\u53EF\u4EE5\u751F\u6210\u5408\u7406\u7684\u793A\u4F8B\u6570\u636E\uFF0C\u4F46\u8981\u4FDD\u6301\u4E1A\u52A1\u53EF\u4FE1\u3002",
|
|
157
|
+
"",
|
|
158
|
+
"\u5404\u7C7B\u9875\u9762\u9ED8\u8BA4\u7ED3\u6784\uFF1A",
|
|
159
|
+
"- \u4FE1\u606F\u5C55\u793A\u7C7B\uFF08\u4E3B\u9875\u3001\u4EA7\u54C1\u4ECB\u7ECD\u3001\u670D\u52A1\u9875\u3001\u4F5C\u54C1\u96C6\u3001\u6D3B\u52A8\u9875\uFF09\uFF1A\u9996\u5C4F\u5B9A\u4F4D\u3001\u670D\u52A1/\u80FD\u529B\u5361\u7247\u3001\u4EE3\u8868\u6210\u679C\u5361\u7247\u3001\u53EF\u4FE1\u80CC\u4E66\u3001\u8054\u7CFB\u6216\u884C\u52A8\u6309\u94AE\u3002",
|
|
160
|
+
"- \u6570\u636E\u5206\u6790\u7C7B\uFF08\u65E5\u62A5\u3001\u5468\u62A5\u3001\u770B\u677F\u3001\u8D28\u68C0\u3001\u9500\u552E\u6F0F\u6597\u3001\u53CD\u9988\u5206\u6790\uFF09\uFF1A\u9876\u90E8\u6458\u8981\u3001\u6838\u5FC3\u6307\u6807\u3001\u8D8B\u52BF\u56FE\u3001\u660E\u7EC6\u8868\u683C\u6216\u5F02\u5E38\u5217\u8868\u3001\u4E0B\u4E00\u6B65\u5EFA\u8BAE\u3002",
|
|
161
|
+
"- \u6D41\u7A0B\u8BF4\u660E\u7C7B\uFF08\u6559\u7A0B\u3001SOP\u3001onboarding\u3001\u64CD\u4F5C\u6307\u5357\u3001\u8BFE\u7A0B\u6B65\u9AA4\uFF09\uFF1A\u5B66\u4E60\u76EE\u6807\u3001\u6B65\u9AA4\u5361\u7247\u3001\u793A\u4F8B/\u7EC3\u4E60\u3001\u68C0\u67E5\u6E05\u5355\u6216\u4E0B\u4E00\u6B65\u6309\u94AE\u3002",
|
|
162
|
+
"- \u51B3\u7B56\u6BD4\u8F83\u7C7B\uFF08\u65B9\u6848\u5BF9\u6BD4\u3001\u4EA7\u54C1\u9009\u578B\u3001\u7ADE\u54C1\u5206\u6790\u3001\u91C7\u8D2D\u5EFA\u8BAE\uFF09\uFF1A\u5BF9\u6BD4\u7EF4\u5EA6\u8868\u683C\u3001\u4F18\u7F3A\u70B9\u5361\u7247\u3001\u8BC4\u5206\u6216\u9002\u914D\u5EA6\u3001\u63A8\u8350\u7ED3\u8BBA\u3002",
|
|
163
|
+
"- \u8BA1\u5212\u6392\u5E03\u7C7B\uFF08\u9879\u76EE\u8BA1\u5212\u3001\u5B66\u4E60\u8BA1\u5212\u3001\u5185\u5BB9\u65E5\u5386\u3001\u53D1\u5E03\u8282\u594F\uFF09\uFF1A\u9636\u6BB5\u76EE\u6807\u3001\u4EFB\u52A1\u5217\u8868\u3001\u4F18\u5148\u7EA7\u3001\u91CC\u7A0B\u7891\u5361\u7247\u3001\u98CE\u9669\u63D0\u9192\u3002",
|
|
164
|
+
"- \u6DF7\u5408\u6C47\u62A5\u7C7B\uFF08\u878D\u8D44\u9875\u3001\u9879\u76EE\u6982\u89C8\u3001\u590D\u6742\u6C47\u62A5\uFF09\uFF1A\u81F3\u5C11\u5305\u542B MetricCard\u3001Chart\u3001Table \u548C Section\uFF0C\u4E0D\u8981\u53EA\u505A\u5355\u4E00\u5217\u8868\u3002",
|
|
165
|
+
"- \u6559\u7A0B/\u6B65\u9AA4/FAQ/Tab/\u7B5B\u9009/\u9875\u9762\u5185\u8DF3\u8F6C\u5FC5\u987B\u505A\u6210\u771F\u5B9E\u53EF\u70B9\u51FB\u4EA4\u4E92\u3002",
|
|
166
|
+
"",
|
|
167
|
+
"\u4EE3\u7801\u98CE\u683C\uFF1A",
|
|
168
|
+
"1. \u4F7F\u7528\u5185\u8054 style \u6216\u7EC4\u4EF6\u5185 <style>\uFF0C\u4E0D\u8981\u4F9D\u8D56 Tailwind \u6216\u5916\u90E8 CSS\u3002",
|
|
169
|
+
"2. \u9875\u9762\u5BBD\u5EA6\u3001\u95F4\u8DDD\u3001\u5B57\u53F7\u8981\u9002\u5408\u6D88\u606F\u5185\u9884\u89C8\uFF1B\u4E0D\u8981\u7528\u8FC7\u5927\u7684\u843D\u5730\u9875 hero\u3002",
|
|
170
|
+
"3. \u989C\u8272\u8981\u514B\u5236\uFF0C\u6709\u5C42\u6B21\uFF1B\u907F\u514D\u6574\u9875\u5355\u4E00\u84DD\u7D2B\u6E10\u53D8\u3002",
|
|
171
|
+
"4. \u8868\u683C\u3001\u56FE\u8868\u3001\u5361\u7247\u3001\u6309\u94AE\u90FD\u8981\u6709 hover/active/focus \u7684\u7EC6\u8282\u3002",
|
|
172
|
+
"5. \u5FC5\u8981\u65F6\u4F7F\u7528 ReactECharts \u753B\u56FE\uFF1B\u7B80\u5355\u67F1\u72B6\u56FE\u4E5F\u53EF\u4EE5\u7528 div \u5B9E\u73B0\uFF0C\u4FDD\u8BC1\u7A33\u5B9A\u3002",
|
|
173
|
+
"6. \u4EE3\u7801\u5C3D\u91CF\u77ED\u800C\u5B8C\u6574\uFF0C\u9ED8\u8BA4 150-260 \u884C\u4EE5\u5185\u3002",
|
|
174
|
+
"",
|
|
175
|
+
"\u8F93\u51FA\u683C\u5F0F\u793A\u4F8B\uFF1A",
|
|
176
|
+
"```tsx preview",
|
|
177
|
+
"function Example() {",
|
|
178
|
+
" const [tab, setTab] = useState('overview');",
|
|
179
|
+
" return <main><section data-artifact-section>...</section></main>;",
|
|
180
|
+
"}",
|
|
181
|
+
"```"
|
|
182
|
+
].join("\n"),
|
|
183
|
+
keywords: [
|
|
184
|
+
"\u9875\u9762",
|
|
185
|
+
"\u62A5\u8868",
|
|
186
|
+
"\u770B\u677F",
|
|
187
|
+
"\u65E5\u62A5",
|
|
188
|
+
"\u5468\u62A5",
|
|
189
|
+
"\u4E3B\u9875",
|
|
190
|
+
"\u6559\u7A0B",
|
|
191
|
+
"\u5BF9\u6BD4\u9875",
|
|
192
|
+
"\u8BA1\u5212\u9875",
|
|
193
|
+
"\u53EF\u89C6\u5316",
|
|
194
|
+
"\u4EA4\u4E92\u9875\u9762",
|
|
195
|
+
"\u4EEA\u8868\u76D8",
|
|
196
|
+
"dashboard",
|
|
197
|
+
"report",
|
|
198
|
+
"page",
|
|
199
|
+
"landing"
|
|
200
|
+
]
|
|
137
201
|
}
|
|
138
202
|
};
|
|
139
203
|
function buildBuiltinObjectSkillDbKey(kind, userId) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readDbRecord,
|
|
3
3
|
writeAgentRecord
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CGDQDXKZ.js";
|
|
5
5
|
import {
|
|
6
6
|
buildSkillSummaryMarker
|
|
7
7
|
} from "./chunk-VF4K2QE6.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-VC6OZXO5.js";
|
|
11
11
|
import {
|
|
12
12
|
createSpaceKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WVTBAALN.js";
|
|
14
14
|
import {
|
|
15
15
|
asTrimmedLowercaseString
|
|
16
16
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -81,9 +81,67 @@ function flushThinkParser(state) {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
// packages/agent-runtime/toolCallAccumulator.ts
|
|
85
|
+
function createToolCallAccumulator() {
|
|
86
|
+
return { slots: [] };
|
|
87
|
+
}
|
|
88
|
+
function resolveSlot(accumulator, deltaId, wireIndex) {
|
|
89
|
+
const { slots } = accumulator;
|
|
90
|
+
if (deltaId) {
|
|
91
|
+
const existing = slots.findIndex((slot) => slot.id === deltaId);
|
|
92
|
+
if (existing !== -1) return existing;
|
|
93
|
+
} else if (wireIndex !== void 0) {
|
|
94
|
+
const sameIndex = slots.findLastIndex((slot) => slot.wireIndex === wireIndex);
|
|
95
|
+
if (sameIndex !== -1) return sameIndex;
|
|
96
|
+
} else if (slots.length > 0) {
|
|
97
|
+
return slots.length - 1;
|
|
98
|
+
}
|
|
99
|
+
slots.push({
|
|
100
|
+
id: deltaId,
|
|
101
|
+
type: "function",
|
|
102
|
+
function: { name: "", arguments: "" },
|
|
103
|
+
wireIndex: wireIndex ?? slots.length
|
|
104
|
+
});
|
|
105
|
+
return slots.length - 1;
|
|
106
|
+
}
|
|
107
|
+
function accumulateToolCallDelta(accumulator, deltas) {
|
|
108
|
+
for (const delta of deltas) {
|
|
109
|
+
const deltaId = typeof delta.id === "string" && delta.id ? delta.id : "";
|
|
110
|
+
const wireIndex = typeof delta.index === "number" ? delta.index : void 0;
|
|
111
|
+
const current = accumulator.slots[resolveSlot(accumulator, deltaId, wireIndex)];
|
|
112
|
+
const fn = delta.function;
|
|
113
|
+
if (fn && typeof fn === "object") {
|
|
114
|
+
const functionDelta = fn;
|
|
115
|
+
if (typeof functionDelta.name === "string" && functionDelta.name) {
|
|
116
|
+
current.function.name += functionDelta.name;
|
|
117
|
+
}
|
|
118
|
+
const argumentsDelta = functionDelta.arguments;
|
|
119
|
+
if (typeof argumentsDelta === "string" && argumentsDelta) {
|
|
120
|
+
const soFar = typeof current.function.arguments === "string" ? current.function.arguments : "";
|
|
121
|
+
current.function.arguments = soFar + argumentsDelta;
|
|
122
|
+
} else if (argumentsDelta && typeof argumentsDelta === "object") {
|
|
123
|
+
current.function.arguments = argumentsDelta;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function finalizeAccumulatedToolCalls(accumulator) {
|
|
129
|
+
return accumulator.slots.filter((slot) => slot.function.name).map(({ id, type, function: fn }) => ({
|
|
130
|
+
id,
|
|
131
|
+
type,
|
|
132
|
+
function: {
|
|
133
|
+
name: fn.name,
|
|
134
|
+
arguments: typeof fn.arguments === "string" ? fn.arguments : JSON.stringify(fn.arguments ?? {})
|
|
135
|
+
}
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
|
|
84
139
|
export {
|
|
85
140
|
extractThinkContent,
|
|
86
141
|
createThinkParserState,
|
|
87
142
|
processThinkChunk,
|
|
88
|
-
flushThinkParser
|
|
143
|
+
flushThinkParser,
|
|
144
|
+
createToolCallAccumulator,
|
|
145
|
+
accumulateToolCallDelta,
|
|
146
|
+
finalizeAccumulatedToolCalls
|
|
89
147
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KWBH4RAL.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
6
|
} from "./chunk-W4NVOSFF.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveAgentRecordFromHybridStore,
|
|
13
13
|
sanitizeAgentRecordForCliOutput,
|
|
14
14
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CGDQDXKZ.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
18
|
} from "./chunk-VHBWHNVT.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compactWhitespace
|
|
3
|
+
} from "./chunk-DWLEOOGR.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/clipCompactText.ts
|
|
6
|
+
function clipCompactText(value, max, ellipsis = "...") {
|
|
7
|
+
const compact = compactWhitespace(value);
|
|
8
|
+
if (compact.length <= max) return compact;
|
|
9
|
+
if (max <= ellipsis.length) return compact.slice(0, max);
|
|
10
|
+
return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
clipCompactText
|
|
15
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
accumulateToolCallDelta,
|
|
2
3
|
extractThinkContent,
|
|
3
4
|
flushThinkParser,
|
|
4
5
|
processThinkChunk
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3WGLLTK4.js";
|
|
6
7
|
import {
|
|
7
8
|
buildProviderExecutionPlan,
|
|
8
9
|
canUsePlatformChatProvider,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
extractTextFromResponseOutput,
|
|
11
12
|
extractToolCallsFromResponseOutput,
|
|
12
13
|
hasDirectOpenAiCompatibleProvider,
|
|
14
|
+
hasImageParts,
|
|
13
15
|
resolveAgentRuntimeLocation,
|
|
14
16
|
resolvePlatformAuthToken,
|
|
15
17
|
resolvePlatformChatCompletionsEndpoint,
|
|
@@ -17,33 +19,40 @@ import {
|
|
|
17
19
|
resolveProviderTransportDecision,
|
|
18
20
|
toOpenAiCompatibleMessages,
|
|
19
21
|
toResponsesTools
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TYPHUVK5.js";
|
|
23
|
+
import {
|
|
24
|
+
clipCompactText
|
|
25
|
+
} from "./chunk-5MMAK75Q.js";
|
|
26
|
+
import {
|
|
27
|
+
isRecord
|
|
28
|
+
} from "./chunk-KUG52IAP.js";
|
|
21
29
|
|
|
22
|
-
// packages/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (fn && typeof fn === "object") {
|
|
34
|
-
const functionDelta = fn;
|
|
35
|
-
if (typeof functionDelta.name === "string" && functionDelta.name) {
|
|
36
|
-
current.function.name += functionDelta.name;
|
|
37
|
-
}
|
|
38
|
-
if (typeof functionDelta.arguments === "string" && functionDelta.arguments) {
|
|
39
|
-
current.function.arguments += functionDelta.arguments;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
accumulated[index] = current;
|
|
30
|
+
// packages/core/chat/providerFailureMessage.ts
|
|
31
|
+
var RAW_BODY_CLIP = 400;
|
|
32
|
+
function describeProviderFailure(args) {
|
|
33
|
+
const clipped = clipCompactText(JSON.stringify(args.body) ?? "", RAW_BODY_CLIP, "\u2026");
|
|
34
|
+
const error = isRecord(args.body) ? args.body.error : void 0;
|
|
35
|
+
const message = isRecord(error) ? error.message : void 0;
|
|
36
|
+
if (typeof message === "string" && message) return `${message} | ${clipped}`;
|
|
37
|
+
const looksLikeCompletion = isRecord(args.body) && Array.isArray(args.body.choices) && error === void 0;
|
|
38
|
+
if (looksLikeCompletion) {
|
|
39
|
+
const imageHint = args.hadImageParts ? "\uFF1B\u8BE5\u8BF7\u6C42\u5E26\u4E86\u56FE\u7247\uFF0C\u591A\u534A\u662F\u8FD9\u4E2A\u6A21\u578B\u6216\u8FD9\u6761\u7F51\u5173\u8DEF\u7531\u4E0D\u63A5\u53D7\u56FE\u7247\u8F93\u5165" : "";
|
|
40
|
+
return `\u4E0A\u6E38\u62D2\u7EDD\u4E86\u8BF7\u6C42\u4F46\u6CA1\u7ED9\u9519\u8BEF\u4FE1\u606F\uFF08\u54CD\u5E94\u4F53\u662F\u4E00\u4E2A\u7A7A\u7684 chat.completion\uFF09${imageHint} | ${clipped}`;
|
|
43
41
|
}
|
|
42
|
+
return clipped;
|
|
44
43
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
44
|
+
function providerHttpFailure(args) {
|
|
45
|
+
let body = args.raw;
|
|
46
|
+
try {
|
|
47
|
+
body = JSON.parse(args.raw);
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
return new Error(
|
|
51
|
+
`${args.label} failed: HTTP ${args.status} ${describeProviderFailure({
|
|
52
|
+
body,
|
|
53
|
+
hadImageParts: hasImageParts(args.messages)
|
|
54
|
+
})}`
|
|
55
|
+
);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
// packages/agent-runtime/processChatCompletionDelta.ts
|
|
@@ -328,6 +337,7 @@ function parsePlatformChatCompletionResponse(args) {
|
|
|
328
337
|
model: args.providerConfig.model,
|
|
329
338
|
provider: args.providerConfig.provider,
|
|
330
339
|
...tool_calls.length > 0 ? { tool_calls } : {},
|
|
340
|
+
stream_complete: true,
|
|
331
341
|
usage: args.data?.usage,
|
|
332
342
|
trace: args.trace
|
|
333
343
|
};
|
|
@@ -341,6 +351,8 @@ function parsePlatformChatCompletionResponse(args) {
|
|
|
341
351
|
provider: args.providerConfig.provider,
|
|
342
352
|
...Array.isArray(choiceMessage?.tool_calls) ? { tool_calls: choiceMessage.tool_calls } : {},
|
|
343
353
|
...reasoning ? { reasoning_content: reasoning } : typeof choiceMessage?.reasoning_content === "string" && choiceMessage.reasoning_content ? { reasoning_content: choiceMessage.reasoning_content } : {},
|
|
354
|
+
// 非流式:完整的 200 JSON body 即证明调用走完,见 AgentRuntimeResult。
|
|
355
|
+
stream_complete: true,
|
|
344
356
|
usage: args.data?.usage,
|
|
345
357
|
trace: args.trace
|
|
346
358
|
};
|
|
@@ -370,10 +382,10 @@ function shouldUsePlatformChatProvider(env, agentConfig) {
|
|
|
370
382
|
}
|
|
371
383
|
|
|
372
384
|
export {
|
|
373
|
-
finalizeAccumulatedToolCalls,
|
|
374
385
|
throwIfChatCompletionStreamFailed,
|
|
375
386
|
applyChatCompletionDelta,
|
|
376
387
|
flushChatCompletionStream,
|
|
388
|
+
providerHttpFailure,
|
|
377
389
|
readSseFrames,
|
|
378
390
|
readSseDataValues,
|
|
379
391
|
resolvePlatformChatProviderConfig,
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
3
3
|
isAntigravityOAuthAgent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H5Y2H2N6.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText,
|
|
7
7
|
fetchAndSerializeTable,
|
|
8
8
|
waitForAbortableDelay
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MZHSAPZP.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
createDrainExhaustedResponse,
|
|
12
|
+
isCoreDrainingBody,
|
|
12
13
|
isGatewayHttpStatus,
|
|
13
14
|
normalizeNonNegativeMs,
|
|
14
15
|
parseRetryAfterHeaderMs
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RQSOAMPJ.js";
|
|
16
17
|
import {
|
|
17
18
|
slateToSimplifiedMarkdown
|
|
18
19
|
} from "./chunk-IVAOVLM7.js";
|
|
@@ -25,15 +26,17 @@ import {
|
|
|
25
26
|
import {
|
|
26
27
|
fetchAndCacheMessages,
|
|
27
28
|
shouldUseServerProxy
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-FSUZIGIG.js";
|
|
29
30
|
import {
|
|
30
31
|
fetchServerSyncedCredential
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-Y5P3ZRGC.js";
|
|
32
33
|
import {
|
|
33
34
|
buildCurrentTimeBlock,
|
|
34
35
|
buildIdentityBlock,
|
|
35
|
-
buildRuntimeGuidanceBlocks
|
|
36
|
-
|
|
36
|
+
buildRuntimeGuidanceBlocks,
|
|
37
|
+
requiresBareImageUrl,
|
|
38
|
+
toBareImageUrlMessages
|
|
39
|
+
} from "./chunk-LUKQQJFL.js";
|
|
37
40
|
import {
|
|
38
41
|
buildProviderAuthHeaders,
|
|
39
42
|
convertMessagesToResponsesInput,
|
|
@@ -41,18 +44,18 @@ import {
|
|
|
41
44
|
preserveAgentStateFields,
|
|
42
45
|
resolvePlatformChatCompletionsEndpoint,
|
|
43
46
|
resolvePlatformResponsesEndpoint
|
|
44
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-TYPHUVK5.js";
|
|
45
48
|
import {
|
|
46
49
|
canonicalizeToolNames
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-B4KT7RN2.js";
|
|
48
51
|
import {
|
|
49
52
|
estimateTokenCount
|
|
50
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-JFANOO7I.js";
|
|
51
54
|
import {
|
|
52
55
|
clampReasoningEffort,
|
|
53
56
|
getModelConfig,
|
|
54
57
|
isModelSupportReasoningEffort
|
|
55
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-OGGHETUE.js";
|
|
56
59
|
import {
|
|
57
60
|
createFileCredentialBroker
|
|
58
61
|
} from "./chunk-PDL2AV3E.js";
|
|
@@ -73,10 +76,10 @@ import {
|
|
|
73
76
|
} from "./chunk-524BDL33.js";
|
|
74
77
|
import {
|
|
75
78
|
createSpaceKey
|
|
76
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-WVTBAALN.js";
|
|
77
80
|
import {
|
|
78
81
|
read
|
|
79
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-VKG4HXYV.js";
|
|
80
83
|
import {
|
|
81
84
|
asNonEmptyStringArray
|
|
82
85
|
} from "./chunk-I42VC5KR.js";
|
|
@@ -1123,6 +1126,9 @@ var normalizeChatCompletionsBodyForProvider = ({
|
|
|
1123
1126
|
delete nextBody.max_tokens;
|
|
1124
1127
|
}
|
|
1125
1128
|
}
|
|
1129
|
+
if (Array.isArray(nextBody.messages) && requiresBareImageUrl({ provider, model })) {
|
|
1130
|
+
nextBody.messages = toBareImageUrlMessages(nextBody.messages);
|
|
1131
|
+
}
|
|
1126
1132
|
return nextBody;
|
|
1127
1133
|
};
|
|
1128
1134
|
|
|
@@ -1521,7 +1527,7 @@ var performServerProxyFetchWithRetry = async ({
|
|
|
1521
1527
|
try {
|
|
1522
1528
|
const response = await execute();
|
|
1523
1529
|
const responseBody = response.status === 503 ? await readRetryableResponseBody(response) : null;
|
|
1524
|
-
const isCoreDraining = response.status === 503 && responseBody
|
|
1530
|
+
const isCoreDraining = response.status === 503 && isCoreDrainingBody(responseBody);
|
|
1525
1531
|
const maxStatusRetries = isCoreDraining ? MAX_SERVER_DRAIN_STATUS_RETRIES : MAX_STATUS_RETRIES;
|
|
1526
1532
|
if (statusRetries < maxStatusRetries && isGatewayHttpStatus(response.status)) {
|
|
1527
1533
|
statusRetries += 1;
|
|
@@ -1535,6 +1541,10 @@ var performServerProxyFetchWithRetry = async ({
|
|
|
1535
1541
|
await waitForServerProxyRetry(retryAfterMs, signal);
|
|
1536
1542
|
continue;
|
|
1537
1543
|
}
|
|
1544
|
+
if (isCoreDraining) {
|
|
1545
|
+
console.warn(`${logPrefix} core_draining \u91CD\u8BD5\u8017\u5C3D\uFF0C\u8FD4\u56DE\u53CB\u597D\u63D0\u793A`);
|
|
1546
|
+
return createDrainExhaustedResponse(response);
|
|
1547
|
+
}
|
|
1538
1548
|
return response;
|
|
1539
1549
|
} catch (error) {
|
|
1540
1550
|
if (networkRetries < MAX_SERVER_PROXY_RETRIES && isRetryableServerProxyFetchError(error)) {
|
|
@@ -8,8 +8,10 @@ import {
|
|
|
8
8
|
// packages/agent-runtime/skillDiscovery.ts
|
|
9
9
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
10
|
import { join } from "node:path";
|
|
11
|
-
var SKILL_SCAN_DIRS = [".agents/skills"
|
|
11
|
+
var SKILL_SCAN_DIRS = [".agents/skills"];
|
|
12
12
|
var MAX_DISCOVERED_SKILLS = 50;
|
|
13
|
+
var MAX_DISCOVERY_DESC_BUDGET = 4e3;
|
|
14
|
+
var MIN_DESC_LENGTH = 80;
|
|
13
15
|
function parseSkillFrontmatter(filePath) {
|
|
14
16
|
try {
|
|
15
17
|
const content = readFileSync(filePath, "utf8").slice(0, 2048);
|
|
@@ -20,8 +22,9 @@ function parseSkillFrontmatter(filePath) {
|
|
|
20
22
|
const name = typeof fm.name === "string" ? fm.name : void 0;
|
|
21
23
|
const rawDesc = fm.description;
|
|
22
24
|
const description = typeof rawDesc === "string" ? rawDesc : rawDesc == null ? void 0 : String(rawDesc);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
+
const sanitizeName = (s) => s?.trim().replace(/^["']|["']$/g, "").replace(/[\n\r]+/g, " ").slice(0, 200);
|
|
26
|
+
const sanitizeDesc = (s) => s?.trim().replace(/^["']|["']$/g, "").replace(/[\n\r]+/g, " ").slice(0, 200);
|
|
27
|
+
return { name: sanitizeName(name), description: sanitizeDesc(description) };
|
|
25
28
|
} catch {
|
|
26
29
|
return {};
|
|
27
30
|
}
|
|
@@ -41,15 +44,20 @@ function discoverSkills(cwd) {
|
|
|
41
44
|
skills.push({ name: name ?? entry, description: description ?? "", relativePath: join(dir, entry, "SKILL.md") });
|
|
42
45
|
continue;
|
|
43
46
|
}
|
|
44
|
-
if (dir === "docs/skills" && entry.endsWith(".md")) {
|
|
45
|
-
const flatPath = join(absDir, entry);
|
|
46
|
-
const { name, description } = parseSkillFrontmatter(flatPath);
|
|
47
|
-
skills.push({ name: name ?? entry.replace(/\.md$/, ""), description: description ?? "", relativePath: join(dir, entry) });
|
|
48
|
-
}
|
|
49
47
|
}
|
|
50
48
|
} catch {
|
|
51
49
|
}
|
|
52
50
|
}
|
|
51
|
+
const totalDescLen = skills.reduce((sum, s) => sum + s.description.length, 0);
|
|
52
|
+
if (totalDescLen > MAX_DISCOVERY_DESC_BUDGET && skills.length > 0) {
|
|
53
|
+
const scale = MAX_DISCOVERY_DESC_BUDGET / totalDescLen;
|
|
54
|
+
for (const s of skills) {
|
|
55
|
+
const targetLen = Math.max(MIN_DESC_LENGTH, Math.floor(s.description.length * scale));
|
|
56
|
+
if (s.description.length > targetLen) {
|
|
57
|
+
s.description = s.description.slice(0, targetLen).trimEnd();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
53
61
|
return skills;
|
|
54
62
|
}
|
|
55
63
|
function resolveSkillByName(cwd, name) {
|
|
@@ -75,23 +83,6 @@ function resolveSkillByName(cwd, name) {
|
|
|
75
83
|
} catch {
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
|
-
const docsFlat = join(cwd, "docs", "skills", `${trimmed}.md`);
|
|
79
|
-
if (existsSync(docsFlat)) return docsFlat;
|
|
80
|
-
const docsDir = join(cwd, "docs", "skills");
|
|
81
|
-
if (existsSync(docsDir) && statSync(docsDir).isDirectory()) {
|
|
82
|
-
try {
|
|
83
|
-
for (const entry of readdirSync(docsDir)) {
|
|
84
|
-
if (!entry.endsWith(".md")) continue;
|
|
85
|
-
const candidate = join(docsDir, entry);
|
|
86
|
-
try {
|
|
87
|
-
const { name: fmName } = parseSkillFrontmatter(candidate);
|
|
88
|
-
if (fmName && fmName === trimmed) return candidate;
|
|
89
|
-
} catch {
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
} catch {
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
86
|
return null;
|
|
96
87
|
}
|
|
97
88
|
function buildSkillDiscoveryContextBlock(cwd) {
|
|
@@ -477,7 +477,7 @@ function buildNoloWorkspaceOpenAiTools(args) {
|
|
|
477
477
|
add("readSkillDoc", "Read one skill doc in the Nolo workspace.", {
|
|
478
478
|
doc: stringToolParam("Skill doc/page key.")
|
|
479
479
|
}, ["doc"]);
|
|
480
|
-
add("loadSkill", "Load a Skill by name from the workspace skill
|
|
480
|
+
add("loadSkill", "Load a Skill by name from the workspace skill directory (.agents/skills/<name>/SKILL.md) and return its full SKILL.md content inline so you can follow its instructions. Use this instead of readFile when you want to activate a skill. On an unknown name the tool returns a plain text list of available skill names rather than failing.", {
|
|
481
481
|
name: stringToolParam("Skill name (the name advertised in the skill-discovery layer).")
|
|
482
482
|
}, ["name"]);
|
|
483
483
|
add("listTables", "List tables in the current user scope or an optional space scope.", {
|
|
@@ -892,7 +892,7 @@ function buildLoadSkillExecutor(args) {
|
|
|
892
892
|
metadata: { loadSkill: true, resolved: false }
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
|
-
const { resolveSkillByName } = await import("./skillDiscovery-
|
|
895
|
+
const { resolveSkillByName } = await import("./skillDiscovery-6M2BZUFN.js");
|
|
896
896
|
const resolved = resolveSkillByName(args.cwd, name);
|
|
897
897
|
if (!resolved) {
|
|
898
898
|
return {
|
|
@@ -919,13 +919,13 @@ ${body}`,
|
|
|
919
919
|
};
|
|
920
920
|
}
|
|
921
921
|
async function formatUnknownSkillMessage(cwd, requestedName) {
|
|
922
|
-
const { discoverSkills } = await import("./skillDiscovery-
|
|
922
|
+
const { discoverSkills } = await import("./skillDiscovery-6M2BZUFN.js");
|
|
923
923
|
let available = [];
|
|
924
924
|
try {
|
|
925
925
|
available = discoverSkills(cwd).map((s) => s.name);
|
|
926
926
|
} catch {
|
|
927
927
|
}
|
|
928
|
-
const header = `Skill "${requestedName}" not found in this workspace's skill
|
|
928
|
+
const header = `Skill "${requestedName}" not found in this workspace's skill directory (.agents/skills/<name>/SKILL.md).`;
|
|
929
929
|
if (available.length === 0) return `${header}
|
|
930
930
|
|
|
931
931
|
No skills were discovered in this workspace.`;
|