nolo-cli 0.47.0-alpha.1 → 0.47.0-alpha.2

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.
Files changed (60) hide show
  1. package/{_executeModel-JWAASOOT.js → _executeModel-5PG6CUWD.js} +13 -12
  2. package/{agentDeleteCommand-QL7TF5F2.js → agentDeleteCommand-SHSPQZHI.js} +1 -1
  3. package/{agentEmailCommands-AC3XQM53.js → agentEmailCommands-LQKO5GRW.js} +13 -12
  4. package/{agentListCommands-4YMFHDU6.js → agentListCommands-5QTNEYMQ.js} +1 -1
  5. package/{agentMachineCommands-MFQKYUV4.js → agentMachineCommands-P5K454CN.js} +2 -2
  6. package/{agentRecordCommands-QG3YBSTQ.js → agentRecordCommands-Z4QYCNP4.js} +13 -12
  7. package/{agentRunCommand-B4PGT36L.js → agentRunCommand-HV3Y34B5.js} +14 -13
  8. package/{agentRuntimeLocal-V2UKJPNE.js → agentRuntimeLocal-ZKXYFLXI.js} +1 -1
  9. package/{agentSlice-B5O3RTRP.js → agentSlice-NKFLP3RI.js} +1 -1
  10. package/{appDeleteCommands-BQCRRHOM.js → appDeleteCommands-XYGAZIJX.js} +1 -1
  11. package/{appDeployCommands-UMJ67TUR.js → appDeployCommands-7T5CABRB.js} +1 -1
  12. package/{appDeployStatusCommands-KASPUR4V.js → appDeployStatusCommands-KTFQMRPZ.js} +1 -1
  13. package/{appGetCommands-FFT2LTGF.js → appGetCommands-HOX2ULSV.js} +1 -1
  14. package/{appListCommands-TAVWFRZZ.js → appListCommands-3SLCEHND.js} +1 -1
  15. package/{chatQueueReduxAdapter-OVDKLHLD.js → chatQueueReduxAdapter-WMMBQK3Y.js} +2 -2
  16. package/{chunk-7US2USK7.js → chunk-4ZNDBDWG.js} +3 -3
  17. package/{chunk-NSQNNYGW.js → chunk-5BPZLBFB.js} +4 -4
  18. package/{chunk-BIMCW2CC.js → chunk-5PPFYHU2.js} +2 -2
  19. package/{chunk-XOFZEJGM.js → chunk-6LYUN76O.js} +3 -3
  20. package/{chunk-6HIGYUBQ.js → chunk-6XIE5ZGI.js} +1 -1
  21. package/chunk-AETZ7AD6.js +274 -0
  22. package/{chunk-5PFBRLJN.js → chunk-FAWK6DBF.js} +8 -8
  23. package/{chunk-FM6ZGNMV.js → chunk-H2JQB6B6.js} +2 -2
  24. package/{chunk-CTXR4SRT.js → chunk-HOM6NILS.js} +1 -1
  25. package/{chunk-NC3CSWVT.js → chunk-IWUPQUWA.js} +1 -1
  26. package/{chunk-C5UWCCLI.js → chunk-JEGPB5H2.js} +3 -3
  27. package/{chunk-EY7V7REW.js → chunk-KHCLMKZZ.js} +6 -280
  28. package/{chunk-OFSVXPQS.js → chunk-MUIJYGYW.js} +3 -3
  29. package/{chunk-DROE55W3.js → chunk-MWT2BBCH.js} +8 -8
  30. package/chunk-OFZPJ3NT.js +114 -0
  31. package/{chunk-XIRSTDYF.js → chunk-Q6DMA2OM.js} +5 -5
  32. package/{chunk-5IQX2XPA.js → chunk-V2IPBG5U.js} +1 -1
  33. package/{chunk-RNNAJ34U.js → chunk-WPFNAEIW.js} +1 -1
  34. package/{chunk-GYSVYO35.js → chunk-XMI3APSU.js} +6 -6
  35. package/{chunk-SEIOEDBB.js → chunk-YNOGNUBC.js} +11 -11
  36. package/{codingSkills-QLDAXJRA.js → codingSkills-BYQI6EPT.js} +3 -2
  37. package/{createAgentAutomationAction-TQ7PYONU.js → createAgentAutomationAction-ENDNA3Q4.js} +3 -3
  38. package/{createDialogAction-EOQFCM3K.js → createDialogAction-2KNX6S2D.js} +6 -5
  39. package/{createPageAction-ZG5PH6BI.js → createPageAction-SNBCYPK6.js} +5 -4
  40. package/{dialogCommands-DCGMVLBA.js → dialogCommands-6E5P35DG.js} +1 -1
  41. package/{dialogSlice-YHGPDBAZ.js → dialogSlice-RTPOD6EW.js} +2 -2
  42. package/{docCreateCommands-A2LVLROP.js → docCreateCommands-JWY25UFB.js} +4 -3
  43. package/{docDeleteCommands-ENMROKH6.js → docDeleteCommands-BPJOCSX4.js} +4 -3
  44. package/{docReadCommands-XSRUV4EM.js → docReadCommands-BSEZCYTQ.js} +4 -3
  45. package/{docStore-WIKRGVQJ.js → docStore-TYHVLU7G.js} +4 -4
  46. package/{docUpdateCommands-5B5NBORA.js → docUpdateCommands-S2IE2VV4.js} +4 -3
  47. package/{handleSendMessageAction-WT4FDMQS.js → handleSendMessageAction-QYXDQXGH.js} +2 -2
  48. package/index.js +40 -40
  49. package/{machineCommands-BFLTBAK6.js → machineCommands-QCE4KLGR.js} +13 -12
  50. package/{machineWsRunDispatch-VCJB5LHO.js → machineWsRunDispatch-FBRMGU5D.js} +13 -12
  51. package/package.json +1 -1
  52. package/{readlineWorkspace-VBJLMU6V.js → readlineWorkspace-2TACWKMN.js} +14 -13
  53. package/{runAgentClientLoop-4QOEJOJP.js → runAgentClientLoop-GBLDVBT5.js} +11 -10
  54. package/{skillDiscovery-GPUDHDTZ.js → skillDiscovery-COX56OBO.js} +2 -1
  55. package/{spaceCommands-FBB7XSAW.js → spaceCommands-XOLPJMRK.js} +1 -1
  56. package/{spaceSlice-YMDZ4G6H.js → spaceSlice-OQPAGQDP.js} +3 -3
  57. package/{streamAgentChatTurn-5NBWQHY6.js → streamAgentChatTurn-SN5XJJ7U.js} +12 -11
  58. package/{tools-37H5A4OG.js → tools-Y65Y3CI4.js} +9 -8
  59. package/{updateDialogTitleAction-XAGMXHW5.js → updateDialogTitleAction-OAOP7CCE.js} +3 -3
  60. package/chunk-2BWU4ORW.js +0 -2574
@@ -1,11 +1,4 @@
1
- import {
2
- asTrimmedNonEmptyStringArray
3
- } from "./chunk-I42VC5KR.js";
4
- import {
5
- asOptionalTrimmedString
6
- } from "./chunk-G3SUCT4W.js";
7
-
8
- // packages/ai/node_modules/js-yaml/dist/js-yaml.mjs
1
+ // node_modules/js-yaml/dist/js-yaml.mjs
9
2
  function getDefaultExportFromCjs(x) {
10
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
11
4
  }
@@ -1283,21 +1276,16 @@ function requireLoader() {
1283
1276
  state.result += _result;
1284
1277
  }
1285
1278
  }
1286
- function chargeMergeWork(state) {
1287
- state.totalMergeKeys++;
1288
- if (state.maxTotalMergeKeys !== -1 && state.totalMergeKeys > state.maxTotalMergeKeys) {
1289
- throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
1290
- }
1291
- }
1292
1279
  function mergeMappings(state, destination, source, overridableKeys) {
1293
1280
  if (!common2.isObject(source)) {
1294
1281
  throwError(state, "cannot merge mappings; the provided source object is unacceptable");
1295
1282
  }
1296
- chargeMergeWork(state);
1297
1283
  const sourceKeys = Object.keys(source);
1298
1284
  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
1299
1285
  const key = sourceKeys[index];
1300
- chargeMergeWork(state);
1286
+ if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
1287
+ throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
1288
+ }
1301
1289
  if (!_hasOwnProperty.call(destination, key)) {
1302
1290
  setProperty(destination, key, source[key]);
1303
1291
  overridableKeys[key] = true;
@@ -1325,9 +1313,6 @@ function requireLoader() {
1325
1313
  }
1326
1314
  if (keyTag === "tag:yaml.org,2002:merge") {
1327
1315
  if (Array.isArray(valueNode)) {
1328
- if (valueNode.length > 100) {
1329
- throwError(state, "abnormal merge sequence size");
1330
- }
1331
1316
  for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
1332
1317
  mergeMappings(state, _result, valueNode[index], overridableKeys);
1333
1318
  }
@@ -3071,266 +3056,7 @@ var {
3071
3056
  safeDump
3072
3057
  } = yaml;
3073
3058
 
3074
- // packages/ai/skills/skillDocProtocol.ts
3075
- var SKILL_DOC_ENUMS = {
3076
- triggerMode: ["explicit", "required", "recommended"],
3077
- // budgetTier 只服务 WorkflowReferenceConfig;skill 侧已移除(零读点)。
3078
- budgetTier: ["low", "medium", "high"],
3079
- modality: ["text", "image", "video", "audio", "3d"],
3080
- docKind: ["knowledge", "instruction", "skill"]
3081
- };
3082
- var SKILL_CONFIG_BLOCK = "skill-config";
3083
- var EVAL_CONFIG_BLOCK = "eval-config";
3084
- var WORKFLOW_CONFIG_BLOCK = "workflow-config";
3085
- var normalizeStringArray = (value) => {
3086
- if (!Array.isArray(value)) return void 0;
3087
- const items = [...new Set(asTrimmedNonEmptyStringArray(value))];
3088
- return items.length > 0 ? items : void 0;
3089
- };
3090
- var normalizeSkillEnumValue = (key, value) => typeof value === "string" && SKILL_DOC_ENUMS[key].includes(value) ? value : void 0;
3091
- var normalizeSkillModalities = (value) => {
3092
- const raw = normalizeStringArray(value);
3093
- if (!raw) return void 0;
3094
- const filtered = raw.flatMap((item) => {
3095
- const modality = normalizeSkillEnumValue("modality", item);
3096
- return modality ? [modality] : [];
3097
- });
3098
- return filtered.length > 0 ? Array.from(new Set(filtered)) : void 0;
3099
- };
3100
- var normalizeSkillConfig = (value, fallbackTools) => {
3101
- if (!value || typeof value !== "object") return void 0;
3102
- const record = value;
3103
- const name = asOptionalTrimmedString(record.name) ?? "";
3104
- const description = asOptionalTrimmedString(record.description) ?? "";
3105
- if (!name || !description) return void 0;
3106
- const triggerMode = normalizeSkillEnumValue("triggerMode", record.triggerMode);
3107
- const modalities = normalizeSkillModalities(record.modalities);
3108
- const toolNames = normalizeStringArray(record.toolNames) ?? normalizeStringArray(fallbackTools) ?? void 0;
3109
- return {
3110
- version: "0.1",
3111
- kind: "skill",
3112
- id: asOptionalTrimmedString(record.id),
3113
- name,
3114
- description,
3115
- triggerMode,
3116
- toolNames,
3117
- modalities,
3118
- requiredSkills: normalizeStringArray(record.requiredSkills),
3119
- recommendedSkills: normalizeStringArray(record.recommendedSkills),
3120
- promptPatch: asOptionalTrimmedString(record.promptPatch)
3121
- };
3122
- };
3123
- var normalizeEvalConfig = (value) => {
3124
- if (!value || typeof value !== "object") return void 0;
3125
- const record = value;
3126
- if (!Array.isArray(record.cases)) return void 0;
3127
- const cases = [];
3128
- for (const item of record.cases) {
3129
- if (!item || typeof item !== "object") continue;
3130
- const testCase = item;
3131
- const input = asOptionalTrimmedString(testCase.input) ?? "";
3132
- if (!input) continue;
3133
- cases.push({
3134
- input,
3135
- expectedTools: normalizeStringArray(testCase.expectedTools),
3136
- expectedSignals: normalizeStringArray(testCase.expectedSignals),
3137
- forbiddenSignals: normalizeStringArray(testCase.forbiddenSignals)
3138
- });
3139
- }
3140
- return cases.length > 0 ? {
3141
- version: "0.1",
3142
- cases
3143
- } : void 0;
3144
- };
3145
- var normalizeWorkflowConfig = (value) => {
3146
- if (!value || typeof value !== "object") return void 0;
3147
- const record = value;
3148
- const name = asOptionalTrimmedString(record.name) ?? "";
3149
- const description = asOptionalTrimmedString(record.description) ?? "";
3150
- if (!name || !description) return void 0;
3151
- const budgetTier = normalizeSkillEnumValue("budgetTier", record.budgetTier);
3152
- return {
3153
- version: "0.1",
3154
- kind: "workflow",
3155
- id: asOptionalTrimmedString(record.id),
3156
- name,
3157
- description,
3158
- defaultAgent: asOptionalTrimmedString(record.defaultAgent),
3159
- inputs: normalizeStringArray(record.inputs),
3160
- recommendedTools: normalizeStringArray(record.recommendedTools),
3161
- requiredTools: normalizeStringArray(record.requiredTools),
3162
- requiredOutputs: normalizeStringArray(record.requiredOutputs),
3163
- gates: normalizeStringArray(record.gates),
3164
- budgetTier,
3165
- contextStrategy: asOptionalTrimmedString(record.contextStrategy),
3166
- failureProtocol: asOptionalTrimmedString(record.failureProtocol)
3167
- };
3168
- };
3169
- var normalizePageSkillMetadata = (value, fallbackTools) => {
3170
- if (!value || typeof value !== "object") return void 0;
3171
- const record = value;
3172
- const kind = normalizeSkillEnumValue("docKind", record.kind);
3173
- const meta = {
3174
- kind,
3175
- requiredSkills: normalizeStringArray(record.requiredSkills),
3176
- recommendedSkills: normalizeStringArray(record.recommendedSkills),
3177
- skillConfig: normalizeSkillConfig(record.skillConfig, fallbackTools),
3178
- evalConfig: normalizeEvalConfig(record.evalConfig),
3179
- workflowConfig: normalizeWorkflowConfig(record.workflowConfig)
3180
- };
3181
- if (meta.skillConfig && !meta.kind) {
3182
- meta.kind = "skill";
3183
- }
3184
- if (meta.workflowConfig && !meta.kind) {
3185
- meta.kind = "instruction";
3186
- }
3187
- return meta.kind || meta.requiredSkills || meta.recommendedSkills || meta.skillConfig || meta.evalConfig || meta.workflowConfig ? meta : void 0;
3188
- };
3189
- var extractCommentBlock = (markdown, blockName) => {
3190
- if (!markdown) return void 0;
3191
- const matcher = new RegExp(
3192
- `<!--\\s*${blockName}\\s*\\n([\\s\\S]*?)-->`,
3193
- "i"
3194
- );
3195
- const match = markdown.match(matcher);
3196
- return asOptionalTrimmedString(match?.[1]);
3197
- };
3198
- var removeCommentBlock = (markdown, blockName) => markdown.replace(
3199
- new RegExp(`\\n?<!--\\s*${blockName}\\s*\\n[\\s\\S]*?-->\\s*`, "gi"),
3200
- "\n\n"
3201
- );
3202
- var parseYamlObject = (raw) => {
3203
- if (!raw) return void 0;
3204
- try {
3205
- const parsed = load(raw);
3206
- return parsed && typeof parsed === "object" ? parsed : void 0;
3207
- } catch {
3208
- return void 0;
3209
- }
3210
- };
3211
- var parseSkillDocProtocol = (markdown, existingMeta, fallbackTools) => {
3212
- const source = typeof markdown === "string" ? markdown : "";
3213
- const skillBlock = parseYamlObject(extractCommentBlock(source, SKILL_CONFIG_BLOCK));
3214
- const evalBlock = parseYamlObject(extractCommentBlock(source, EVAL_CONFIG_BLOCK));
3215
- const workflowBlock = parseYamlObject(extractCommentBlock(source, WORKFLOW_CONFIG_BLOCK));
3216
- const cleanedContent = removeCommentBlock(
3217
- removeCommentBlock(
3218
- removeCommentBlock(source, SKILL_CONFIG_BLOCK),
3219
- EVAL_CONFIG_BLOCK
3220
- ),
3221
- WORKFLOW_CONFIG_BLOCK
3222
- ).replace(/\n{3,}/g, "\n\n").trim();
3223
- const parsedMeta = normalizePageSkillMetadata(
3224
- {
3225
- ...existingMeta ?? {},
3226
- ...skillBlock ? {
3227
- kind: existingMeta?.kind === "skill" || skillBlock.kind === "skill" ? "skill" : existingMeta?.kind,
3228
- requiredSkills: skillBlock.requiredSkills ?? existingMeta?.requiredSkills,
3229
- recommendedSkills: skillBlock.recommendedSkills ?? existingMeta?.recommendedSkills,
3230
- skillConfig: skillBlock
3231
- } : {},
3232
- ...evalBlock ? { evalConfig: evalBlock } : {},
3233
- ...workflowBlock ? { workflowConfig: workflowBlock } : {}
3234
- },
3235
- fallbackTools
3236
- );
3237
- return {
3238
- content: cleanedContent,
3239
- meta: parsedMeta
3240
- };
3241
- };
3242
- var resolvePageSkillMetadata = (page) => {
3243
- if (!page) return void 0;
3244
- const existingMeta = normalizePageSkillMetadata(page.meta, page.tools);
3245
- return parseSkillDocProtocol(page.content ?? "", existingMeta, page.tools).meta;
3246
- };
3247
- var yamlBlock = (value) => dump(value, { lineWidth: 120, noRefs: true }).trim();
3248
- var buildSkillConfigComment = (config) => {
3249
- const payload = {
3250
- version: config.version,
3251
- kind: config.kind,
3252
- ...config.id ? { id: config.id } : {},
3253
- name: config.name,
3254
- description: config.description,
3255
- ...config.triggerMode ? { triggerMode: config.triggerMode } : {},
3256
- ...config.requiredSkills?.length ? { requiredSkills: config.requiredSkills } : {},
3257
- ...config.recommendedSkills?.length ? { recommendedSkills: config.recommendedSkills } : {},
3258
- ...config.toolNames?.length ? { toolNames: config.toolNames } : {},
3259
- ...config.modalities?.length ? { modalities: config.modalities } : {},
3260
- ...config.promptPatch ? { promptPatch: config.promptPatch } : {}
3261
- };
3262
- return `<!-- ${SKILL_CONFIG_BLOCK}
3263
- ${yamlBlock(payload)}
3264
- -->`;
3265
- };
3266
- var buildEvalConfigComment = (config) => `<!-- ${EVAL_CONFIG_BLOCK}
3267
- ${yamlBlock({
3268
- version: config.version,
3269
- cases: config.cases
3270
- })}
3271
- -->`;
3272
- var buildWorkflowConfigComment = (config) => `<!-- ${WORKFLOW_CONFIG_BLOCK}
3273
- ${yamlBlock({
3274
- version: config.version,
3275
- kind: config.kind,
3276
- ...config.id ? { id: config.id } : {},
3277
- name: config.name,
3278
- description: config.description,
3279
- ...config.defaultAgent ? { defaultAgent: config.defaultAgent } : {},
3280
- ...config.inputs?.length ? { inputs: config.inputs } : {},
3281
- ...config.recommendedTools?.length ? { recommendedTools: config.recommendedTools } : {},
3282
- ...config.requiredTools?.length ? { requiredTools: config.requiredTools } : {},
3283
- ...config.requiredOutputs?.length ? { requiredOutputs: config.requiredOutputs } : {},
3284
- ...config.gates?.length ? { gates: config.gates } : {},
3285
- ...config.budgetTier ? { budgetTier: config.budgetTier } : {},
3286
- ...config.contextStrategy ? { contextStrategy: config.contextStrategy } : {},
3287
- ...config.failureProtocol ? { failureProtocol: config.failureProtocol } : {}
3288
- })}
3289
- -->`;
3290
- var buildSkillDocMarkdown = (options) => {
3291
- const sections = [
3292
- asOptionalTrimmedString(options.body) ?? "",
3293
- buildSkillConfigComment(options.skillConfig),
3294
- options.evalConfig ? buildEvalConfigComment(options.evalConfig) : "",
3295
- options.workflowConfig ? buildWorkflowConfigComment(options.workflowConfig) : ""
3296
- ].filter(Boolean);
3297
- return sections.join("\n\n").trim();
3298
- };
3299
- var extractFrontmatter = (markdown) => {
3300
- const match = markdown.match(/^\s*---\s*\n([\s\S]*?)\n\s*---\s*\n?/);
3301
- if (!match) return { body: markdown.trim() };
3302
- const frontmatter = parseYamlObject(match[1]);
3303
- const body = markdown.slice(match[0].length).trim();
3304
- return { frontmatter, body };
3305
- };
3306
- var normalizeAllowedTools = (value) => {
3307
- if (Array.isArray(value)) {
3308
- return normalizeStringArray(value) ?? [];
3309
- }
3310
- if (typeof value === "string") {
3311
- return value.split(/\s+/).map((item) => item.trim()).filter(Boolean);
3312
- }
3313
- return [];
3314
- };
3315
- var parseExternalSkillMarkdown = (markdown) => {
3316
- const { frontmatter, body } = extractFrontmatter(markdown);
3317
- return {
3318
- name: asOptionalTrimmedString(frontmatter?.name),
3319
- description: asOptionalTrimmedString(frontmatter?.description),
3320
- compatibility: asOptionalTrimmedString(frontmatter?.compatibility),
3321
- allowedTools: normalizeAllowedTools(frontmatter?.["allowed-tools"]),
3322
- metadata: frontmatter?.metadata && typeof frontmatter.metadata === "object" ? Object.fromEntries(
3323
- Object.entries(frontmatter.metadata).filter(([, value]) => typeof value === "string").map(([key, value]) => [key, String(value)])
3324
- ) : void 0,
3325
- body
3326
- };
3327
- };
3328
-
3329
3059
  export {
3330
- normalizeStringArray,
3331
- normalizeSkillModalities,
3332
- parseSkillDocProtocol,
3333
- resolvePageSkillMetadata,
3334
- buildSkillDocMarkdown,
3335
- parseExternalSkillMarkdown
3060
+ load,
3061
+ dump
3336
3062
  };
@@ -6894,10 +6894,10 @@ function buildLoadSkillExecutor(args) {
6894
6894
  metadata: { loadSkill: true, resolved: false }
6895
6895
  };
6896
6896
  }
6897
- const { resolveSkillByName } = await import("./skillDiscovery-GPUDHDTZ.js");
6897
+ const { resolveSkillByName } = await import("./skillDiscovery-COX56OBO.js");
6898
6898
  const resolved = resolveSkillByName(args.cwd, name);
6899
6899
  if (!resolved) {
6900
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-QLDAXJRA.js");
6900
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-BYQI6EPT.js");
6901
6901
  const builtinSlug = resolveCodingBuiltinSlug(name);
6902
6902
  if (builtinSlug) {
6903
6903
  const body = buildCodingSkillContentBySlug(builtinSlug);
@@ -6932,7 +6932,7 @@ ${body}`,
6932
6932
  };
6933
6933
  }
6934
6934
  async function formatUnknownSkillMessage(cwd, requestedName) {
6935
- const { discoverSkills } = await import("./skillDiscovery-GPUDHDTZ.js");
6935
+ const { discoverSkills } = await import("./skillDiscovery-COX56OBO.js");
6936
6936
  let available = [];
6937
6937
  try {
6938
6938
  available = discoverSkills(cwd).map((s) => s.name);
@@ -20,7 +20,7 @@ import {
20
20
  parseAgentRunEvent,
21
21
  t,
22
22
  toolLabel
23
- } from "./chunk-XIRSTDYF.js";
23
+ } from "./chunk-Q6DMA2OM.js";
24
24
  import {
25
25
  getReadableCliDb
26
26
  } from "./chunk-43CXXVJD.js";
@@ -53,7 +53,7 @@ import {
53
53
  } from "./chunk-LTRXGFMS.js";
54
54
  import {
55
55
  formatAgentListCard
56
- } from "./chunk-SEIOEDBB.js";
56
+ } from "./chunk-YNOGNUBC.js";
57
57
  import {
58
58
  isGatewayHttpStatus
59
59
  } from "./chunk-RQSOAMPJ.js";
@@ -72,28 +72,28 @@ import {
72
72
  chooseMemoryOwners,
73
73
  loadMemoryCandidatesFromDb,
74
74
  resolveAgentMemoryPolicy
75
- } from "./chunk-7US2USK7.js";
75
+ } from "./chunk-4ZNDBDWG.js";
76
76
  import {
77
77
  API_REPORTED_COST_MULTIPLIER,
78
78
  normalizeUsage,
79
79
  parseUiAskChoiceContent
80
- } from "./chunk-5PFBRLJN.js";
80
+ } from "./chunk-FAWK6DBF.js";
81
81
  import {
82
82
  getDefaultCliLocalRuntimeDb
83
83
  } from "./chunk-IA3A5373.js";
84
84
  import {
85
85
  buildSkillDiscoveryContextLayer
86
- } from "./chunk-2BWU4ORW.js";
86
+ } from "./chunk-OFZPJ3NT.js";
87
87
  import {
88
88
  parseExternalSkillMarkdown,
89
89
  parseSkillDocProtocol
90
- } from "./chunk-EY7V7REW.js";
90
+ } from "./chunk-AETZ7AD6.js";
91
91
  import {
92
92
  LOCAL_AGENT_CONFIG_MISSING_CODE,
93
93
  LOCAL_TURN_ABORTED_CODE,
94
94
  readActionGate,
95
95
  readCommandActionGatePayload
96
- } from "./chunk-OFSVXPQS.js";
96
+ } from "./chunk-MUIJYGYW.js";
97
97
  import {
98
98
  resolveAgentRuntimeConfigFromRecord
99
99
  } from "./chunk-XO3G35OV.js";
@@ -5442,7 +5442,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
5442
5442
  // packages/cli/client/agentRun.ts
5443
5443
  import { ulid } from "ulid";
5444
5444
  async function loadRunLocalAgentTurn() {
5445
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-V2UKJPNE.js");
5445
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-ZKXYFLXI.js");
5446
5446
  return runLocalAgentTurn;
5447
5447
  }
5448
5448
  async function resolveCurrentMachineId(options) {
@@ -0,0 +1,114 @@
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
+ };
@@ -53,7 +53,7 @@ import {
53
53
  import {
54
54
  inlineImageUrlsForCustomProvider,
55
55
  prepareTools
56
- } from "./chunk-NC3CSWVT.js";
56
+ } from "./chunk-IWUPQUWA.js";
57
57
  import {
58
58
  getServerProviderSecret
59
59
  } from "./chunk-HS7MLR74.js";
@@ -72,7 +72,7 @@ import {
72
72
  rememberMemoryFunctionSchema,
73
73
  resolveAgentRequiredPackIds,
74
74
  setTodoListFunc
75
- } from "./chunk-SEIOEDBB.js";
75
+ } from "./chunk-YNOGNUBC.js";
76
76
  import {
77
77
  createDrainExhaustedResponse,
78
78
  isCoreDrainingBody,
@@ -97,13 +97,13 @@ import {
97
97
  prepareTokenUsageData,
98
98
  resolveBuiltinPlatformAgentConfig,
99
99
  runKeyed
100
- } from "./chunk-5PFBRLJN.js";
100
+ } from "./chunk-FAWK6DBF.js";
101
101
  import {
102
102
  BUILTIN_TITLE_LLM_CONFIG
103
103
  } from "./chunk-EVBFYPDC.js";
104
104
  import {
105
105
  fetchServerSyncedCredential
106
- } from "./chunk-XOFZEJGM.js";
106
+ } from "./chunk-6LYUN76O.js";
107
107
  import {
108
108
  require_date_fns
109
109
  } from "./chunk-M76ECQRD.js";
@@ -142,7 +142,7 @@ import {
142
142
  parseSyncServersEnv,
143
143
  resolveOpenAiCompatibleProviderConfig,
144
144
  summarizeToolArguments
145
- } from "./chunk-OFSVXPQS.js";
145
+ } from "./chunk-MUIJYGYW.js";
146
146
  import {
147
147
  buildPlatformChatCompletionRequest,
148
148
  canUsePlatformChatProvider,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  buildSkillDocMarkdown,
7
7
  resolvePageSkillMetadata
8
- } from "./chunk-EY7V7REW.js";
8
+ } from "./chunk-AETZ7AD6.js";
9
9
  import {
10
10
  canonicalizeToolNames
11
11
  } from "./chunk-O6OSWFZQ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-NSQNNYGW.js";
4
+ } from "./chunk-5BPZLBFB.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-NC3CSWVT.js";
8
+ } from "./chunk-IWUPQUWA.js";
9
9
  import {
10
10
  INVALID_TOOL_ARGS_REPLACEMENT,
11
11
  buildInvalidToolCallSelfHealResult,
12
12
  parseToolCallArguments,
13
13
  performFetchRequest,
14
14
  sanitizeOutboundMessages
15
- } from "./chunk-NSQNNYGW.js";
15
+ } from "./chunk-5BPZLBFB.js";
16
16
  import {
17
17
  createSSEParser,
18
18
  createToolRunId,
@@ -23,22 +23,22 @@ import {
23
23
  toolRunSetPending,
24
24
  toolRunStarted,
25
25
  toolRunSucceeded
26
- } from "./chunk-SEIOEDBB.js";
26
+ } from "./chunk-YNOGNUBC.js";
27
27
  import {
28
28
  getPublicImageAgentMode
29
29
  } from "./chunk-VIDPVFP3.js";
30
30
  import {
31
31
  getCurrentSpaceId
32
- } from "./chunk-FM6ZGNMV.js";
32
+ } from "./chunk-H2JQB6B6.js";
33
33
  import {
34
34
  addToolMessage,
35
35
  messageStreamEnd,
36
36
  messageStreaming,
37
37
  updateToolMessage
38
- } from "./chunk-5PFBRLJN.js";
38
+ } from "./chunk-FAWK6DBF.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-XOFZEJGM.js";
41
+ } from "./chunk-6LYUN76O.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,