oricore 1.5.0 → 1.5.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.
package/dist/index.cjs CHANGED
@@ -1342,6 +1342,155 @@ var init_models = __esm({
1342
1342
  modalities: { input: ["text"], output: ["text"] },
1343
1343
  open_weights: true,
1344
1344
  limit: { context: 204800, output: 131072 }
1345
+ },
1346
+ "gemini-3.1-flash-lite": {
1347
+ name: "Gemini 3.1 Flash Lite",
1348
+ attachment: true,
1349
+ reasoning: true,
1350
+ temperature: true,
1351
+ tool_call: true,
1352
+ knowledge: "2025-01",
1353
+ release_date: "2026-03-03",
1354
+ last_updated: "2026-03-03",
1355
+ modalities: {
1356
+ input: ["text", "image", "audio", "video", "pdf"],
1357
+ output: ["text"]
1358
+ },
1359
+ open_weights: false,
1360
+ limit: { context: 1048576, output: 64e3 }
1361
+ },
1362
+ "gemini-3.1-flash-live": {
1363
+ name: "Gemini 3.1 Flash Live",
1364
+ attachment: true,
1365
+ reasoning: true,
1366
+ temperature: true,
1367
+ tool_call: true,
1368
+ knowledge: "2025-01",
1369
+ release_date: "2026-03-15",
1370
+ last_updated: "2026-03-15",
1371
+ modalities: {
1372
+ input: ["text", "image", "audio", "video"],
1373
+ output: ["text", "audio"]
1374
+ },
1375
+ open_weights: false,
1376
+ limit: { context: 131072, output: 64e3 }
1377
+ },
1378
+ "glm-5.1": {
1379
+ name: "GLM-5.1",
1380
+ attachment: false,
1381
+ reasoning: true,
1382
+ temperature: true,
1383
+ tool_call: true,
1384
+ knowledge: "2025-04",
1385
+ release_date: "2026-03-27",
1386
+ last_updated: "2026-03-27",
1387
+ modalities: { input: ["text"], output: ["text"] },
1388
+ open_weights: true,
1389
+ limit: { context: 204800, output: 131072 }
1390
+ },
1391
+ "qwen3.6-plus": {
1392
+ name: "Qwen3.6 Plus",
1393
+ attachment: true,
1394
+ reasoning: true,
1395
+ temperature: true,
1396
+ tool_call: true,
1397
+ knowledge: "2025-04",
1398
+ release_date: "2026-03-31",
1399
+ last_updated: "2026-03-31",
1400
+ modalities: { input: ["text", "image", "video"], output: ["text"] },
1401
+ open_weights: false,
1402
+ limit: { context: 1048576, output: 65536 }
1403
+ },
1404
+ "kimi-k2.6": {
1405
+ name: "Kimi K2.6",
1406
+ attachment: true,
1407
+ reasoning: true,
1408
+ temperature: true,
1409
+ tool_call: true,
1410
+ knowledge: "2025-04",
1411
+ release_date: "2026-04-21",
1412
+ last_updated: "2026-04-21",
1413
+ modalities: { input: ["text", "image", "video"], output: ["text"] },
1414
+ open_weights: true,
1415
+ limit: { context: 262144, output: 98304 }
1416
+ },
1417
+ "deepseek-v4-pro": {
1418
+ name: "DeepSeek V4 Pro",
1419
+ attachment: false,
1420
+ reasoning: true,
1421
+ temperature: true,
1422
+ tool_call: true,
1423
+ knowledge: "2025-04",
1424
+ release_date: "2026-04-24",
1425
+ last_updated: "2026-04-24",
1426
+ modalities: { input: ["text"], output: ["text"] },
1427
+ open_weights: true,
1428
+ limit: { context: 1048576, output: 384e3 }
1429
+ },
1430
+ "deepseek-v4-flash": {
1431
+ name: "DeepSeek V4 Flash",
1432
+ attachment: false,
1433
+ reasoning: true,
1434
+ temperature: true,
1435
+ tool_call: true,
1436
+ knowledge: "2025-04",
1437
+ release_date: "2026-04-24",
1438
+ last_updated: "2026-04-24",
1439
+ modalities: { input: ["text"], output: ["text"] },
1440
+ open_weights: true,
1441
+ limit: { context: 1048576, output: 384e3 }
1442
+ },
1443
+ "gpt-5.5": {
1444
+ name: "GPT-5.5",
1445
+ attachment: true,
1446
+ reasoning: true,
1447
+ temperature: false,
1448
+ tool_call: true,
1449
+ knowledge: "2025-04",
1450
+ release_date: "2026-04-23",
1451
+ last_updated: "2026-04-23",
1452
+ modalities: { input: ["text", "image", "audio", "video"], output: ["text"] },
1453
+ open_weights: false,
1454
+ limit: { context: 1048576, output: 128e3 }
1455
+ },
1456
+ "seed3d-2.0": {
1457
+ name: "Seed3D 2.0",
1458
+ attachment: true,
1459
+ reasoning: false,
1460
+ temperature: true,
1461
+ tool_call: false,
1462
+ knowledge: "2025-04",
1463
+ release_date: "2026-04-23",
1464
+ last_updated: "2026-04-23",
1465
+ modalities: { input: ["text", "image"], output: ["text", "image"] },
1466
+ open_weights: false,
1467
+ limit: { context: 32e3, output: 32e3 }
1468
+ },
1469
+ "mimo-v2.5-pro": {
1470
+ name: "MiMo V2.5 Pro",
1471
+ attachment: false,
1472
+ reasoning: true,
1473
+ temperature: true,
1474
+ tool_call: true,
1475
+ knowledge: "2025-04",
1476
+ release_date: "2026-04-23",
1477
+ last_updated: "2026-04-23",
1478
+ modalities: { input: ["text"], output: ["text"] },
1479
+ open_weights: true,
1480
+ limit: { context: 1048576, output: 65536 }
1481
+ },
1482
+ "mimo-v2.5": {
1483
+ name: "MiMo V2.5",
1484
+ attachment: true,
1485
+ reasoning: true,
1486
+ temperature: true,
1487
+ tool_call: true,
1488
+ knowledge: "2025-04",
1489
+ release_date: "2026-04-23",
1490
+ last_updated: "2026-04-23",
1491
+ modalities: { input: ["text", "image", "video", "audio"], output: ["text"] },
1492
+ open_weights: true,
1493
+ limit: { context: 1048576, output: 65536 }
1345
1494
  }
1346
1495
  };
1347
1496
  }
@@ -26427,7 +26576,8 @@ var init_providers = __esm({
26427
26576
  "gpt-5.2": models["gpt-5.2"],
26428
26577
  "gpt-5.2-pro": models["gpt-5.2-pro"],
26429
26578
  "gpt-5.2-codex": models["gpt-5.2-codex"],
26430
- "gpt-5.3-codex": models["gpt-5.3-codex"]
26579
+ "gpt-5.3-codex": models["gpt-5.3-codex"],
26580
+ "gpt-5.5": models["gpt-5.5"]
26431
26581
  },
26432
26582
  createModel: openaiModelCreator
26433
26583
  },
@@ -26445,6 +26595,8 @@ var init_providers = __esm({
26445
26595
  "gemini-2.5-pro": models["gemini-2.5-pro"],
26446
26596
  "gemini-3-pro-preview": models["gemini-3-pro-preview"],
26447
26597
  "gemini-3.1-pro-preview": models["gemini-3.1-pro-preview"],
26598
+ "gemini-3.1-flash-lite": models["gemini-3.1-flash-lite"],
26599
+ "gemini-3.1-flash-live": models["gemini-3.1-flash-live"],
26448
26600
  "gemini-3-flash-preview": models["gemini-3-flash-preview"]
26449
26601
  },
26450
26602
  createModel(name, provider) {
@@ -26611,14 +26763,19 @@ var init_providers = __esm({
26611
26763
  "openai/gpt-5.2-pro": models["gpt-5.2-pro"],
26612
26764
  "openai/gpt-5.2-codex": models["gpt-5.2-codex"],
26613
26765
  "openai/gpt-5.3-codex": models["gpt-5.3-codex"],
26766
+ "openai/gpt-5.5": models["gpt-5.5"],
26614
26767
  "google/gemini-3-flash-preview": models["gemini-3-flash-preview"],
26615
26768
  "google/gemini-3-pro-preview": models["gemini-3-pro-preview"],
26769
+ "google/gemini-3.1-flash-lite": models["gemini-3.1-flash-lite"],
26770
+ "google/gemini-3.1-flash-live": models["gemini-3.1-flash-live"],
26616
26771
  "moonshotai/kimi-k2": models["kimi-k2"],
26617
26772
  "moonshotai/kimi-k2-0905": models["kimi-k2-0905"],
26618
26773
  "moonshotai/kimi-k2-thinking": models["kimi-k2-thinking"],
26619
26774
  "moonshotai/kimi-k2.5": models["kimi-k2.5"],
26775
+ "moonshotai/kimi-k2.6": models["kimi-k2.6"],
26620
26776
  "qwen/qwen3-coder": models["qwen3-coder-480b-a35b-instruct"],
26621
26777
  "qwen/qwen3-max": models["qwen3-max"],
26778
+ "qwen/qwen3.6-plus": models["qwen3.6-plus"],
26622
26779
  "x-ai/grok-code-fast-1": models["grok-code-fast-1"],
26623
26780
  "x-ai/grok-4": models["grok-4"],
26624
26781
  "x-ai/grok-4-fast": models["grok-4-fast"],
@@ -26661,7 +26818,8 @@ var init_providers = __esm({
26661
26818
  "kimi-k2-turbo-preview": models["kimi-k2-turbo-preview"],
26662
26819
  "kimi-k2-thinking": models["kimi-k2-thinking"],
26663
26820
  "kimi-k2-thinking-turbo": models["kimi-k2-thinking-turbo"],
26664
- "kimi-k2.5": models["kimi-k2.5"]
26821
+ "kimi-k2.5": models["kimi-k2.5"],
26822
+ "kimi-k2.6": models["kimi-k2.6"]
26665
26823
  },
26666
26824
  createModel: defaultModelCreator
26667
26825
  },
@@ -26677,7 +26835,8 @@ var init_providers = __esm({
26677
26835
  "kimi-k2-turbo-preview": models["kimi-k2-turbo-preview"],
26678
26836
  "kimi-k2-thinking": models["kimi-k2-thinking"],
26679
26837
  "kimi-k2-thinking-turbo": models["kimi-k2-thinking-turbo"],
26680
- "kimi-k2.5": models["kimi-k2.5"]
26838
+ "kimi-k2.5": models["kimi-k2.5"],
26839
+ "kimi-k2.6": models["kimi-k2.6"]
26681
26840
  },
26682
26841
  createModel: defaultModelCreator
26683
26842
  },
@@ -26727,10 +26886,15 @@ var init_providers = __esm({
26727
26886
  "deepseek-ai/DeepSeek-V3": models["deepseek-v3-0324"],
26728
26887
  "zai-org/GLM-4.5": models["glm-4.5"],
26729
26888
  "Pro/moonshotai/Kimi-K2.5": models["kimi-k2-5"],
26889
+ "Pro/moonshotai/Kimi-K2.6": models["kimi-k2.6"],
26730
26890
  "Pro/zai-org/GLM-5": models["glm-5"],
26891
+ "Pro/zai-org/GLM-5.1": models["glm-5.1"],
26731
26892
  "Pro/zai-org/GLM-4.7": models["glm-4.7"],
26732
26893
  "Pro/MiniMaxAI/MiniMax-M2.5": models["minimax-m2.5"],
26733
- "Pro/deepseek-ai/DeepSeek-V3.2": models["deepseek-v3.2"]
26894
+ "Pro/deepseek-ai/DeepSeek-V3.2": models["deepseek-v3.2"],
26895
+ "Pro/deepseek-ai/DeepSeek-V4-Pro": models["deepseek-v4-pro"],
26896
+ "Pro/deepseek-ai/DeepSeek-V4-Flash": models["deepseek-v4-flash"],
26897
+ "Pro/Qwen/Qwen3.6-Plus": models["qwen3.6-plus"]
26734
26898
  },
26735
26899
  createModel: defaultModelCreator
26736
26900
  },
@@ -26748,8 +26912,11 @@ var init_providers = __esm({
26748
26912
  "ZhipuAI/GLM-4.5V": models["glm-4.5v"],
26749
26913
  "ZhipuAI/GLM-4.6": models["glm-4.6"],
26750
26914
  "ZhipuAI/GLM-5": models["glm-5"],
26915
+ "ZhipuAI/GLM-5.1": models["glm-5.1"],
26751
26916
  "deepseek-ai/DeepSeek-V3.2": models["deepseek-v3.2"],
26752
- "deepseek-ai/DeepSeek-V3.2-Speciale": models["deepseek-v3.2-speciale"]
26917
+ "deepseek-ai/DeepSeek-V3.2-Speciale": models["deepseek-v3.2-speciale"],
26918
+ "deepseek-ai/DeepSeek-V4-Pro": models["deepseek-v4-pro"],
26919
+ "deepseek-ai/DeepSeek-V4-Flash": models["deepseek-v4-flash"]
26753
26920
  },
26754
26921
  createModel: defaultModelCreator
26755
26922
  },
@@ -26764,7 +26931,8 @@ var init_providers = __esm({
26764
26931
  "deepseek-v3-1-250821": models["deepseek-v3-1"],
26765
26932
  "deepseek-v3-1-terminus": models["deepseek-v3-1-terminus"],
26766
26933
  "doubao-seed-1-6-250615": models["doubao-seed-1.6"],
26767
- "kimi-k2-250905": models["kimi-k2-0905"]
26934
+ "kimi-k2-250905": models["kimi-k2-0905"],
26935
+ "seed3d-2.0": models["seed3d-2.0"]
26768
26936
  },
26769
26937
  createModel: defaultModelCreator
26770
26938
  },
@@ -26783,7 +26951,8 @@ var init_providers = __esm({
26783
26951
  "glm-4.6": models["glm-4.6"],
26784
26952
  "glm-4.6v": models["glm-4.6v"],
26785
26953
  "glm-4.7": models["glm-4.7"],
26786
- "glm-5": models["glm-5"]
26954
+ "glm-5": models["glm-5"],
26955
+ "glm-5.1": models["glm-5.1"]
26787
26956
  },
26788
26957
  createModel: defaultModelCreator
26789
26958
  },
@@ -26802,7 +26971,8 @@ var init_providers = __esm({
26802
26971
  "glm-4.5-flash": models["glm-4.5-flash"],
26803
26972
  "glm-4.6v": models["glm-4.6v"],
26804
26973
  "glm-4.7": models["glm-4.7"],
26805
- "glm-5": models["glm-5"]
26974
+ "glm-5": models["glm-5"],
26975
+ "glm-5.1": models["glm-5.1"]
26806
26976
  },
26807
26977
  createModel: defaultModelCreator
26808
26978
  },
@@ -26841,7 +27011,8 @@ var init_providers = __esm({
26841
27011
  "glm-4.5-flash": models["glm-4.5-flash"],
26842
27012
  "glm-4.6v": models["glm-4.6v"],
26843
27013
  "glm-4.7": models["glm-4.7"],
26844
- "glm-5": models["glm-5"]
27014
+ "glm-5": models["glm-5"],
27015
+ "glm-5.1": models["glm-5.1"]
26845
27016
  },
26846
27017
  createModel: defaultModelCreator
26847
27018
  },
@@ -26877,9 +27048,12 @@ var init_providers = __esm({
26877
27048
  "z-ai/glm-4.6v-flash": models["glm-4.6v"],
26878
27049
  "z-ai/glm-4.7": models["glm-4.7"],
26879
27050
  "z-ai/glm-5": models["glm-5"],
27051
+ "z-ai/glm-5.1": models["glm-5.1"],
26880
27052
  "deepseek/deepseek-v3.2-speciale": models["deepseek-v3.2-speciale"],
26881
27053
  "deepseek/deepseek-chat": models["deepseek-v3-2-exp"],
26882
27054
  "deepseek/deepseek-reasoner": models["deepseek-r1-0528"],
27055
+ "deepseek/deepseek-v4-pro": models["deepseek-v4-pro"],
27056
+ "deepseek/deepseek-v4-flash": models["deepseek-v4-flash"],
26883
27057
  "minimax/minimax-m2.5": models["minimax-m2.5"]
26884
27058
  },
26885
27059
  headers: {
@@ -26937,7 +27111,9 @@ var init_providers = __esm({
26937
27111
  api: "https://api.xiaomimimo.com/v1",
26938
27112
  doc: "https://platform.xiaomimimo.com/",
26939
27113
  models: {
26940
- "mimo-v2-flash": models["mimo-v2-flash"]
27114
+ "mimo-v2-flash": models["mimo-v2-flash"],
27115
+ "mimo-v2.5": models["mimo-v2.5"],
27116
+ "mimo-v2.5-pro": models["mimo-v2.5-pro"]
26941
27117
  },
26942
27118
  createModel: createModelCreatorCompatible({})
26943
27119
  },
@@ -27050,7 +27226,9 @@ var init_providers = __esm({
27050
27226
  "moonshotai/kimi-k2.5": models["kimi-k2.5"],
27051
27227
  "deepseek/deepseek-chat-v3.2": models["deepseek-v3-2-exp"],
27052
27228
  "openai/gpt-oss-120b": models["gpt-oss-120b"],
27053
- "xiaomimimo/mimo-v2-flash": models["mimo-v2-flash"]
27229
+ "xiaomimimo/mimo-v2-flash": models["mimo-v2-flash"],
27230
+ "xiaomimimo/mimo-v2.5": models["mimo-v2.5"],
27231
+ "xiaomimimo/mimo-v2.5-pro": models["mimo-v2.5-pro"]
27054
27232
  },
27055
27233
  createModel: defaultModelCreator
27056
27234
  },
@@ -27078,7 +27256,8 @@ var init_providers = __esm({
27078
27256
  "gpt-5.1-codex-mini": models["gpt-5.1-codex-mini"],
27079
27257
  "gpt-5.2": models["gpt-5.2"],
27080
27258
  "gpt-5.2-codex": models["gpt-5.2-codex"],
27081
- "gpt-5.3-codex": models["gpt-5.3-codex"]
27259
+ "gpt-5.3-codex": models["gpt-5.3-codex"],
27260
+ "gpt-5.5": models["gpt-5.5"]
27082
27261
  },
27083
27262
  createModel: (name, provider) => {
27084
27263
  if (name.startsWith("claude-") || name.startsWith("gemini-")) {
@@ -27110,7 +27289,8 @@ var init_providers = __esm({
27110
27289
  "google/gemini-3-pro-preview": models["gemini-3-pro-preview"],
27111
27290
  "minimax/minimax-m2.5:free": models["minimax-m2.5"],
27112
27291
  "minimax/minimax-m2.5": models["minimax-m2.5"],
27113
- "moonshotai/kimi-k2.5": models["kimi-k2-5"]
27292
+ "moonshotai/kimi-k2.5": models["kimi-k2-5"],
27293
+ "moonshotai/kimi-k2.6": models["kimi-k2.6"]
27114
27294
  },
27115
27295
  createModel: (name, provider) => {
27116
27296
  if (name.includes("claude-")) {
@@ -32813,80 +32993,6 @@ var init_read = __esm({
32813
32993
  }
32814
32994
  });
32815
32995
 
32816
- // src/tools/tools/skill.ts
32817
- function renderAvailableSkills(skills) {
32818
- return skills.map(
32819
- (skill) => `<skill>
32820
- <name>${skill.name}</name>
32821
- <description>${skill.description}</description>
32822
- </skill>`
32823
- ).join("\n");
32824
- }
32825
- function generateDescription(skillManager) {
32826
- const skills = skillManager.getSkills();
32827
- return `Execute a skill within the main conversation
32828
- <skills_instructions>
32829
- When users ask you to perform tasks, check if any of the available skills below match the task. If a skill matches, use this tool to invoke it. Skills provide specialized knowledge and procedures for specific tasks.
32830
- </skills_instructions>
32831
- <available_skills>
32832
- ${renderAvailableSkills(skills)}
32833
- </available_skills>`;
32834
- }
32835
- function createSkillTool(opts) {
32836
- return createTool({
32837
- name: "skill",
32838
- description: generateDescription(opts.skillManager),
32839
- parameters: import_zod9.z.object({
32840
- skill: import_zod9.z.string().describe("The skill name to execute")
32841
- }),
32842
- getDescription: ({ params }) => {
32843
- return params.skill;
32844
- },
32845
- async execute({ skill }) {
32846
- const trimmed = skill.trim();
32847
- const skillName = trimmed.startsWith("/") ? trimmed.substring(1) : trimmed;
32848
- const foundSkill = opts.skillManager.getSkill(skillName);
32849
- if (!foundSkill) {
32850
- return {
32851
- isError: true,
32852
- llmContent: `Skill "${skillName}" not found`
32853
- };
32854
- }
32855
- const body = await opts.skillManager.readSkillBody(foundSkill);
32856
- const baseDir = import_pathe13.default.dirname(foundSkill.path);
32857
- const messages = [
32858
- {
32859
- type: "text",
32860
- text: `<command-message>${skillName} is running\u2026</command-message>
32861
- <command-name>${skillName}</command-name>`
32862
- },
32863
- {
32864
- type: "text",
32865
- text: `Base directory for this skill: ${baseDir}
32866
-
32867
- ${body}`,
32868
- isMeta: true
32869
- }
32870
- ];
32871
- return {
32872
- llmContent: safeStringify(messages),
32873
- returnDisplay: `Loaded skill: ${foundSkill.name}`
32874
- };
32875
- },
32876
- approval: { category: "read" }
32877
- });
32878
- }
32879
- var import_pathe13, import_zod9;
32880
- var init_skill = __esm({
32881
- "src/tools/tools/skill.ts"() {
32882
- "use strict";
32883
- import_pathe13 = __toESM(require("pathe"), 1);
32884
- import_zod9 = require("zod");
32885
- init_tool();
32886
- init_safeStringify();
32887
- }
32888
- });
32889
-
32890
32996
  // src/tools/tools/task.ts
32891
32997
  function createTaskTool(opts) {
32892
32998
  const { signal, sessionId } = opts;
@@ -32953,11 +33059,11 @@ Since the user is greeting, use the greeting-responder agent to respond with a f
32953
33059
  assistant: "I'm going to use the ${"task" /* TASK */} tool to launch the with the greeting-responder agent"
32954
33060
  </example>
32955
33061
  `,
32956
- parameters: import_zod10.z.object({
32957
- description: import_zod10.z.string().describe("A short (3-5 word) description of task"),
32958
- prompt: import_zod10.z.string().describe("The task for the agent to perform"),
32959
- subagent_type: import_zod10.z.string().describe("The type of specialized agent to use for this task"),
32960
- resume: import_zod10.z.string().optional().describe(
33062
+ parameters: import_zod9.z.object({
33063
+ description: import_zod9.z.string().describe("A short (3-5 word) description of task"),
33064
+ prompt: import_zod9.z.string().describe("The task for the agent to perform"),
33065
+ subagent_type: import_zod9.z.string().describe("The type of specialized agent to use for this task"),
33066
+ resume: import_zod9.z.string().optional().describe(
32961
33067
  "Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript."
32962
33068
  )
32963
33069
  }),
@@ -33128,17 +33234,135 @@ Agent ID: ${result.agentId}`,
33128
33234
  approval: { category: "read" }
33129
33235
  });
33130
33236
  }
33131
- var import_zod10;
33237
+ var import_zod9;
33132
33238
  var init_task = __esm({
33133
33239
  "src/tools/tools/task.ts"() {
33134
33240
  "use strict";
33135
- import_zod10 = require("zod");
33241
+ import_zod9 = require("zod");
33136
33242
  init_constants();
33137
33243
  init_tool();
33138
33244
  init_randomUUID();
33139
33245
  }
33140
33246
  });
33141
33247
 
33248
+ // src/tools/tools/skill.ts
33249
+ function renderAvailableSkills(skills) {
33250
+ return skills.filter((skill) => skill.modelInvocable !== false).map(
33251
+ (skill) => `<skill>
33252
+ <name>${skill.name}</name>
33253
+ <description>${skill.description}</description>
33254
+ </skill>`
33255
+ ).join("\n");
33256
+ }
33257
+ function generateDescription(skillManager) {
33258
+ const skills = skillManager.getSkills({ modelInvocable: true });
33259
+ return `Execute a skill within the main conversation
33260
+ <skills_instructions>
33261
+ When users ask you to perform tasks, check if any of the available skills below match the task. If a skill matches, use this tool to invoke it. Skills provide specialized knowledge and procedures for specific tasks.
33262
+ </skills_instructions>
33263
+ <available_skills>
33264
+ ${renderAvailableSkills(skills)}
33265
+ </available_skills>`;
33266
+ }
33267
+ function createSkillTool(opts) {
33268
+ const { skillManager, context, tools, sessionId, signal } = opts;
33269
+ return createTool({
33270
+ name: "skill",
33271
+ description: generateDescription(skillManager),
33272
+ parameters: import_zod10.z.object({
33273
+ skill: import_zod10.z.string().describe("The skill name to execute"),
33274
+ args: import_zod10.z.string().optional().describe("Optional arguments to pass to the skill")
33275
+ }),
33276
+ getDescription: ({ params }) => {
33277
+ return params.args ? `${params.skill} ${params.args}` : params.skill;
33278
+ },
33279
+ async execute({ skill, args }) {
33280
+ const trimmed = skill.trim();
33281
+ const skillName = trimmed.startsWith("/") ? trimmed.substring(1) : trimmed;
33282
+ const foundSkill = skillManager.getSkill(skillName);
33283
+ if (!foundSkill) {
33284
+ return {
33285
+ isError: true,
33286
+ llmContent: `Skill "${skillName}" not found`
33287
+ };
33288
+ }
33289
+ if (foundSkill.modelInvocable === false) {
33290
+ return {
33291
+ isError: true,
33292
+ llmContent: `Skill "${skillName}" cannot be invoked by the model`
33293
+ };
33294
+ }
33295
+ const skillArgs = args || "";
33296
+ const body = await skillManager.readSkillBody(foundSkill, skillArgs);
33297
+ const baseDir = import_pathe13.default.dirname(foundSkill.path);
33298
+ if (foundSkill.context === "fork") {
33299
+ if (!context.agentManager) {
33300
+ return {
33301
+ isError: true,
33302
+ llmContent: `Skill "${skillName}" requires fork execution but agent manager is not available`
33303
+ };
33304
+ }
33305
+ const allowedTools = foundSkill.allowedTools;
33306
+ const filteredTools = allowedTools ? tools.filter(
33307
+ (t) => t.name !== "skill" && allowedTools.some(
33308
+ (allowed) => allowed.toLowerCase() === t.name.toLowerCase()
33309
+ )
33310
+ ) : tools.filter((t) => t.name !== "skill");
33311
+ const taskTool = createTaskTool({
33312
+ context,
33313
+ tools: filteredTools,
33314
+ sessionId,
33315
+ signal
33316
+ });
33317
+ const agentType = foundSkill.agent || "general-purpose";
33318
+ const prompt = `Base directory for this skill: ${baseDir}
33319
+
33320
+ ${body}`;
33321
+ const toolCallId = `skill-${skillName}-${randomUUID()}`;
33322
+ return taskTool.execute(
33323
+ {
33324
+ description: `Execute skill: ${skillName}`,
33325
+ prompt,
33326
+ subagent_type: agentType
33327
+ },
33328
+ toolCallId
33329
+ );
33330
+ }
33331
+ const messages = [
33332
+ {
33333
+ type: "text",
33334
+ text: `<command-message>${skillName} is running\u2026</command-message>
33335
+ <command-name>${skillName}</command-name>`
33336
+ },
33337
+ {
33338
+ type: "text",
33339
+ text: `Base directory for this skill: ${baseDir}
33340
+
33341
+ ${body}`,
33342
+ isMeta: true
33343
+ }
33344
+ ];
33345
+ return {
33346
+ llmContent: safeStringify(messages),
33347
+ returnDisplay: `Loaded skill: ${foundSkill.name}`
33348
+ };
33349
+ },
33350
+ approval: { category: "read" }
33351
+ });
33352
+ }
33353
+ var import_pathe13, import_zod10;
33354
+ var init_skill = __esm({
33355
+ "src/tools/tools/skill.ts"() {
33356
+ "use strict";
33357
+ import_pathe13 = __toESM(require("pathe"), 1);
33358
+ import_zod10 = require("zod");
33359
+ init_tool();
33360
+ init_safeStringify();
33361
+ init_task();
33362
+ init_randomUUID();
33363
+ }
33364
+ });
33365
+
33142
33366
  // src/tools/tools/todo.ts
33143
33367
  async function loadTodosFromFile(filePath) {
33144
33368
  if (!import_fs13.default.existsSync(filePath)) return [];
@@ -33481,8 +33705,7 @@ async function resolveTools(opts) {
33481
33705
  createLSTool({ cwd }),
33482
33706
  createGlobTool({ cwd }),
33483
33707
  createGrepTool({ cwd }),
33484
- createFetchTool({ model, fetch: opts.context.fetch }),
33485
- ...hasSkills ? [createSkillTool({ skillManager: opts.context.skillManager })] : []
33708
+ createFetchTool({ model, fetch: opts.context.fetch })
33486
33709
  ];
33487
33710
  const askUserQuestionTools = opts.askUserQuestion ? [createAskUserQuestionTool()] : [];
33488
33711
  const writeTools = opts.write ? [
@@ -33510,7 +33733,7 @@ async function resolveTools(opts) {
33510
33733
  })
33511
33734
  ] : [];
33512
33735
  const mcpTools = await getMcpTools(opts.context);
33513
- const allTools = [
33736
+ let allTools = [
33514
33737
  ...readonlyTools,
33515
33738
  ...askUserQuestionTools,
33516
33739
  ...writeTools,
@@ -33518,6 +33741,16 @@ async function resolveTools(opts) {
33518
33741
  ...backgroundTools,
33519
33742
  ...mcpTools
33520
33743
  ];
33744
+ if (hasSkills) {
33745
+ const skillTool = createSkillTool({
33746
+ skillManager: opts.context.skillManager,
33747
+ context: opts.context,
33748
+ tools: allTools,
33749
+ sessionId: opts.sessionId,
33750
+ signal: opts.signal
33751
+ });
33752
+ allTools = [...allTools, skillTool];
33753
+ }
33521
33754
  let availableTools = allTools;
33522
33755
  try {
33523
33756
  availableTools = await opts.context.apply({
@@ -34047,6 +34280,9 @@ __export(index_exports, {
34047
34280
  Usage: () => Usage,
34048
34281
  brainstormMode: () => brainstormMode,
34049
34282
  builtinModes: () => builtinModes,
34283
+ bundledSkillRegistry: () => bundledSkillRegistry,
34284
+ bundledSkillToMetadata: () => bundledSkillToMetadata,
34285
+ createBundledSkill: () => createBundledSkill,
34050
34286
  createEngine: () => createEngine,
34051
34287
  debugMode: () => debugMode,
34052
34288
  defaultMode: () => defaultMode,
@@ -34058,6 +34294,7 @@ __export(index_exports, {
34058
34294
  planMode: () => planMode,
34059
34295
  randomUUID: () => randomUUID,
34060
34296
  registerBuiltinModes: () => registerBuiltinModes,
34297
+ registerBundledSkill: () => registerBundledSkill,
34061
34298
  reviewMode: () => reviewMode
34062
34299
  });
34063
34300
  module.exports = __toCommonJS(index_exports);
@@ -36520,6 +36757,116 @@ var import_fs23 = __toESM(require("fs"), 1);
36520
36757
  var import_os9 = __toESM(require("os"), 1);
36521
36758
  var import_pathe26 = __toESM(require("pathe"), 1);
36522
36759
  init_plugin();
36760
+
36761
+ // src/skill/bundled.ts
36762
+ var BundledSkillRegistry = class {
36763
+ skills = /* @__PURE__ */ new Map();
36764
+ aliases = /* @__PURE__ */ new Map();
36765
+ /**
36766
+ * Register a bundled skill.
36767
+ * @param definition The skill definition
36768
+ */
36769
+ register(definition) {
36770
+ if (!definition.name) {
36771
+ throw new Error("Bundled skill must have a name");
36772
+ }
36773
+ if (!definition.description) {
36774
+ throw new Error("Bundled skill must have a description");
36775
+ }
36776
+ if (!definition.getPrompt) {
36777
+ throw new Error("Bundled skill must have a getPrompt function");
36778
+ }
36779
+ this.skills.set(definition.name, definition);
36780
+ if (definition.aliases) {
36781
+ for (const alias of definition.aliases) {
36782
+ this.aliases.set(alias, definition.name);
36783
+ }
36784
+ }
36785
+ }
36786
+ /**
36787
+ * Get a bundled skill by name or alias.
36788
+ * @param name Skill name or alias
36789
+ * @returns The skill definition or undefined if not found
36790
+ */
36791
+ get(name) {
36792
+ const skill = this.skills.get(name);
36793
+ if (skill) return skill;
36794
+ const aliasedName = this.aliases.get(name);
36795
+ if (aliasedName) {
36796
+ return this.skills.get(aliasedName);
36797
+ }
36798
+ return void 0;
36799
+ }
36800
+ /**
36801
+ * Get all registered bundled skills.
36802
+ * @param context Optional context to filter by isEnabled
36803
+ * @returns Array of skill definitions
36804
+ */
36805
+ getAll(context) {
36806
+ return Array.from(this.skills.values()).filter((skill) => {
36807
+ if (skill.isEnabled === void 0) return true;
36808
+ if (typeof skill.isEnabled === "boolean") return skill.isEnabled;
36809
+ if (typeof skill.isEnabled === "function" && context) {
36810
+ return skill.isEnabled(context);
36811
+ }
36812
+ return true;
36813
+ });
36814
+ }
36815
+ /**
36816
+ * Check if a skill is registered.
36817
+ * @param name Skill name or alias
36818
+ */
36819
+ has(name) {
36820
+ return this.skills.has(name) || this.aliases.has(name);
36821
+ }
36822
+ /**
36823
+ * Unregister a skill.
36824
+ * @param name Skill name
36825
+ */
36826
+ unregister(name) {
36827
+ const skill = this.skills.get(name);
36828
+ if (skill && skill.aliases) {
36829
+ for (const alias of skill.aliases) {
36830
+ this.aliases.delete(alias);
36831
+ }
36832
+ }
36833
+ this.skills.delete(name);
36834
+ }
36835
+ /**
36836
+ * Clear all registered skills.
36837
+ */
36838
+ clear() {
36839
+ this.skills.clear();
36840
+ this.aliases.clear();
36841
+ }
36842
+ };
36843
+ var bundledSkillRegistry = new BundledSkillRegistry();
36844
+ function bundledSkillToMetadata(definition, source = "builtin") {
36845
+ return {
36846
+ name: definition.name,
36847
+ description: definition.description,
36848
+ path: `bundled://${definition.name}`,
36849
+ source,
36850
+ allowedTools: definition.allowedTools,
36851
+ context: definition.context,
36852
+ agent: definition.agent,
36853
+ userInvocable: definition.userInvocable ?? true,
36854
+ modelInvocable: definition.modelInvocable ?? true
36855
+ // Note: bundled skills don't support 'paths' conditional activation
36856
+ };
36857
+ }
36858
+ function createBundledSkill(config) {
36859
+ return {
36860
+ ...config,
36861
+ getPrompt: typeof config.prompt === "string" ? () => config.prompt : config.prompt
36862
+ };
36863
+ }
36864
+ function registerBundledSkill(config) {
36865
+ const skill = createBundledSkill(config);
36866
+ bundledSkillRegistry.register(skill);
36867
+ }
36868
+
36869
+ // src/skill/skill.ts
36523
36870
  function isDirOrSymlinkToDir(parentDir, entry) {
36524
36871
  if (entry.isDirectory()) return true;
36525
36872
  if (entry.isSymbolicLink()) {
@@ -36536,6 +36883,7 @@ var SkillSource = /* @__PURE__ */ ((SkillSource2) => {
36536
36883
  SkillSource2["Global"] = "global";
36537
36884
  SkillSource2["ProjectClaude"] = "project-claude";
36538
36885
  SkillSource2["Project"] = "project";
36886
+ SkillSource2["Builtin"] = "builtin";
36539
36887
  return SkillSource2;
36540
36888
  })(SkillSource || {});
36541
36889
  var MAX_NAME_LENGTH2 = 64;
@@ -36545,21 +36893,119 @@ var SkillManager = class {
36545
36893
  errors = [];
36546
36894
  paths;
36547
36895
  context;
36896
+ /**
36897
+ * Tracks which skills are currently "active" based on file operations.
36898
+ * Skills with `paths` frontmatter are activated when matching files are accessed.
36899
+ */
36900
+ activeSkillNames = /* @__PURE__ */ new Set();
36901
+ /**
36902
+ * Maps alias names to original skill names for bundled skills.
36903
+ */
36904
+ aliasMap = /* @__PURE__ */ new Map();
36548
36905
  constructor(opts) {
36549
36906
  this.context = opts.context;
36550
36907
  this.paths = opts.context.paths;
36551
36908
  }
36552
- getSkills() {
36553
- return Array.from(this.skillsMap.values());
36909
+ /**
36910
+ * Get all loaded skills.
36911
+ * @param options Filter options
36912
+ * @returns Array of skill metadata
36913
+ */
36914
+ getSkills(options) {
36915
+ let skills = Array.from(this.skillsMap.values());
36916
+ if (options?.userInvocable !== void 0) {
36917
+ skills = skills.filter(
36918
+ (s) => (s.userInvocable ?? true) === options.userInvocable
36919
+ );
36920
+ }
36921
+ if (options?.modelInvocable !== void 0) {
36922
+ skills = skills.filter(
36923
+ (s) => (s.modelInvocable ?? true) === options.modelInvocable
36924
+ );
36925
+ }
36926
+ if (options?.activeOnly) {
36927
+ skills = skills.filter((s) => this.activeSkillNames.has(s.name));
36928
+ }
36929
+ return skills;
36554
36930
  }
36931
+ /**
36932
+ * Get a specific skill by name.
36933
+ * Automatically resolves aliases to the original skill.
36934
+ * @param name Skill name or alias
36935
+ * @returns Skill metadata or undefined if not found
36936
+ */
36555
36937
  getSkill(name) {
36556
- return this.skillsMap.get(name);
36938
+ const skill = this.skillsMap.get(name);
36939
+ if (skill) return skill;
36940
+ const originalName = this.aliasMap.get(name);
36941
+ if (originalName) {
36942
+ return this.skillsMap.get(originalName);
36943
+ }
36944
+ return void 0;
36945
+ }
36946
+ /**
36947
+ * Check if a skill is active (has matching paths for current context).
36948
+ * @param name Skill name
36949
+ */
36950
+ isSkillActive(name) {
36951
+ return this.activeSkillNames.has(name);
36952
+ }
36953
+ /**
36954
+ * Activate skills based on file paths.
36955
+ * Skills with `paths` frontmatter that match the given paths will be activated.
36956
+ * @param filePaths Array of file paths to check
36957
+ * @returns Array of newly activated skill names
36958
+ */
36959
+ activateSkillsForPaths(filePaths) {
36960
+ const newlyActivated = [];
36961
+ const minimatch = require("minimatch");
36962
+ for (const [name, skill] of this.skillsMap) {
36963
+ if (skill.paths && skill.paths.length > 0) {
36964
+ const isMatch = skill.paths.some(
36965
+ (pattern) => filePaths.some((filePath) => minimatch(filePath, pattern))
36966
+ );
36967
+ if (isMatch && !this.activeSkillNames.has(name)) {
36968
+ this.activeSkillNames.add(name);
36969
+ newlyActivated.push(name);
36970
+ }
36971
+ }
36972
+ }
36973
+ return newlyActivated;
36974
+ }
36975
+ /**
36976
+ * Clear all active skill activations.
36977
+ * Useful when switching contexts or projects.
36978
+ */
36979
+ clearActiveSkills() {
36980
+ this.activeSkillNames.clear();
36981
+ }
36982
+ /**
36983
+ * Get all skills that have path-based conditional activation.
36984
+ * @returns Array of skills with paths defined
36985
+ */
36986
+ getConditionalSkills() {
36987
+ return Array.from(this.skillsMap.values()).filter(
36988
+ (s) => s.paths && s.paths.length > 0
36989
+ );
36557
36990
  }
36558
36991
  getErrors() {
36559
36992
  return this.errors;
36560
36993
  }
36561
- async readSkillBody(skill) {
36994
+ /**
36995
+ * Read the body content of a skill.
36996
+ * For file-based skills, reads from disk.
36997
+ * For bundled skills, generates content via getPrompt.
36998
+ */
36999
+ async readSkillBody(skill, args = "") {
36562
37000
  try {
37001
+ if (skill.path.startsWith("bundled://")) {
37002
+ const bundledName = skill.path.replace("bundled://", "");
37003
+ const bundledSkill = bundledSkillRegistry.get(bundledName);
37004
+ if (!bundledSkill) {
37005
+ throw new Error(`Bundled skill "${bundledName}" not found in registry`);
37006
+ }
37007
+ return await bundledSkill.getPrompt(args, this.context);
37008
+ }
36563
37009
  const content = import_fs23.default.readFileSync(skill.path, "utf-8");
36564
37010
  const { body } = safeFrontMatter(content, skill.path);
36565
37011
  return body;
@@ -36568,9 +37014,26 @@ var SkillManager = class {
36568
37014
  throw new Error(`Failed to read skill ${skill.name}: ${message}`);
36569
37015
  }
36570
37016
  }
37017
+ /**
37018
+ * Get a bundled skill definition by name.
37019
+ * @param name Bundled skill name
37020
+ * @returns Bundled skill definition or undefined if not found
37021
+ */
37022
+ getBundledSkill(name) {
37023
+ return bundledSkillRegistry.get(name);
37024
+ }
37025
+ /**
37026
+ * Register a bundled skill programmatically.
37027
+ * @param definition Bundled skill definition
37028
+ */
37029
+ registerBundledSkill(definition) {
37030
+ bundledSkillRegistry.register(definition);
37031
+ this.loadBuiltinSkills();
37032
+ }
36571
37033
  async loadSkills() {
36572
37034
  this.skillsMap.clear();
36573
37035
  this.errors = [];
37036
+ this.loadBuiltinSkills();
36574
37037
  const pluginSkills = await this.context.apply({
36575
37038
  hook: "skill",
36576
37039
  args: [],
@@ -36613,6 +37076,22 @@ var SkillManager = class {
36613
37076
  const projectDir = import_pathe26.default.join(this.paths.projectConfigDir, "skills");
36614
37077
  this.loadSkillsFromDirectory(projectDir, "project" /* Project */);
36615
37078
  }
37079
+ /**
37080
+ * Load builtin/bundled skills from the registry.
37081
+ */
37082
+ loadBuiltinSkills() {
37083
+ this.aliasMap.clear();
37084
+ const bundledSkills = bundledSkillRegistry.getAll(this.context);
37085
+ for (const skill of bundledSkills) {
37086
+ const metadata = bundledSkillToMetadata(skill, "builtin" /* Builtin */);
37087
+ this.skillsMap.set(skill.name, metadata);
37088
+ if (skill.aliases) {
37089
+ for (const alias of skill.aliases) {
37090
+ this.aliasMap.set(alias, skill.name);
37091
+ }
37092
+ }
37093
+ }
37094
+ }
36616
37095
  loadSkillsFromDirectory(skillsDir, source) {
36617
37096
  if (!import_fs23.default.existsSync(skillsDir)) {
36618
37097
  return;
@@ -36688,10 +37167,19 @@ var SkillManager = class {
36688
37167
  });
36689
37168
  return null;
36690
37169
  }
37170
+ const allowedTools = this.parseStringArrayField(attributes.allowedTools);
37171
+ const context = attributes.context === "inline" || attributes.context === "fork" ? attributes.context : void 0;
37172
+ const paths = this.parseStringArrayField(attributes.paths);
36691
37173
  return {
36692
37174
  name: attributes.name,
36693
37175
  description: attributes.description,
36694
- path: skillPath
37176
+ path: skillPath,
37177
+ allowedTools,
37178
+ context,
37179
+ agent: attributes.agent,
37180
+ paths,
37181
+ userInvocable: attributes.userInvocable ?? true,
37182
+ modelInvocable: attributes.modelInvocable ?? true
36695
37183
  };
36696
37184
  } catch (error) {
36697
37185
  this.errors.push({
@@ -36701,6 +37189,21 @@ var SkillManager = class {
36701
37189
  return null;
36702
37190
  }
36703
37191
  }
37192
+ /**
37193
+ * Parse a field that can be either a comma-separated string or an array of strings.
37194
+ * @param value The value to parse
37195
+ * @returns Array of strings or undefined if empty
37196
+ */
37197
+ parseStringArrayField(value) {
37198
+ if (!value) return void 0;
37199
+ if (Array.isArray(value)) {
37200
+ return value.map((item) => item.trim()).filter((item) => item.length > 0);
37201
+ }
37202
+ if (typeof value === "string") {
37203
+ return value.split(",").map((item) => item.trim()).filter((item) => item.length > 0);
37204
+ }
37205
+ return void 0;
37206
+ }
36704
37207
  async addSkill(source, options = {}) {
36705
37208
  const {
36706
37209
  global: isGlobal = false,
@@ -38313,6 +38816,9 @@ var ENGINE_VERSION = "1.0.0";
38313
38816
  Usage,
38314
38817
  brainstormMode,
38315
38818
  builtinModes,
38819
+ bundledSkillRegistry,
38820
+ bundledSkillToMetadata,
38821
+ createBundledSkill,
38316
38822
  createEngine,
38317
38823
  debugMode,
38318
38824
  defaultMode,
@@ -38324,6 +38830,7 @@ var ENGINE_VERSION = "1.0.0";
38324
38830
  planMode,
38325
38831
  randomUUID,
38326
38832
  registerBuiltinModes,
38833
+ registerBundledSkill,
38327
38834
  reviewMode
38328
38835
  });
38329
38836
  /*! Bundled license information: