@hasna/skills 0.1.53 → 0.1.55

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/bin/mcp.js CHANGED
@@ -6697,9 +6697,9 @@ function getSkillRunPricing(slug, input, args = []) {
6697
6697
  tier: "premium",
6698
6698
  costCents: ARTICLE_USER_COST_CENTS * count,
6699
6699
  costMicros: ARTICLE_INTERNAL_COST_CENTS * count * 1e4,
6700
- provider: "cerebras",
6701
- model: "gpt-oss",
6702
- providers: ["cerebras"],
6700
+ provider: "openrouter",
6701
+ model: "openai/gpt-4o-mini",
6702
+ providers: ["openrouter"],
6703
6703
  description: `Remote article generation; ${count} article${count === 1 ? "" : "s"}`
6704
6704
  };
6705
6705
  }
@@ -7067,8 +7067,8 @@ var init_pricing = __esm(() => {
7067
7067
  { slug: "transcript", displayName: "Transcript", tier: "premium", costCents: 10, providers: ["openai", "elevenlabs", "deepgram", "hosted"], description: "Audio/video transcription with timestamps, diarization, and URL support" },
7068
7068
  { slug: "webcrawling", displayName: "Web Crawling", tier: "premium", costCents: 5, providers: ["firecrawl"], description: "Structured web page crawling and extraction" },
7069
7069
  { slug: "browse", displayName: "Browse", tier: "premium", costCents: 5, providers: ["browser"], description: "Web browsing and page interaction" },
7070
- { slug: "read-pdf", displayName: "Read PDF", tier: "premium", costCents: 5, providers: ["cerebras"], description: "Hosted PDF extraction and structured content analysis" },
7071
- { slug: "pdf-read", displayName: "PDF Read", tier: "premium", costCents: 5, providers: ["cerebras"], description: "Hosted multi-PDF text extraction with page ranges" },
7070
+ { slug: "read-pdf", displayName: "Read PDF", tier: "premium", costCents: 5, providers: ["openrouter"], description: "Hosted PDF extraction and structured content analysis" },
7071
+ { slug: "pdf-read", displayName: "PDF Read", tier: "premium", costCents: 5, providers: ["openrouter"], description: "Hosted multi-PDF text extraction with page ranges" },
7072
7072
  { slug: "pdf-to-markdown", displayName: "PDF to Markdown", tier: "premium", costCents: 5, providers: ["hosted"], description: "Hosted PDF to markdown conversion and cleanup" },
7073
7073
  { slug: "pdf-to-dataset", displayName: "PDF to Dataset", tier: "premium", costCents: 15, providers: ["hosted"], description: "Hosted PDF table and form extraction into CSV/JSON datasets" },
7074
7074
  { slug: "market-research-report", displayName: "Market Research Report", tier: "premium", costCents: 150, providers: ["hosted"], description: "Hosted market research report with competitor, audience, pricing, and source artifacts" },
@@ -21819,7 +21819,7 @@ class StdioServerTransport {
21819
21819
  // package.json
21820
21820
  var package_default = {
21821
21821
  name: "@hasna/skills",
21822
- version: "0.1.53",
21822
+ version: "0.1.55",
21823
21823
  description: "Skills library for AI coding agents",
21824
21824
  type: "module",
21825
21825
  bin: {
@@ -31150,6 +31150,13 @@ var PROJECT_MANAGEMENT_SKILLS = [
31150
31150
  description: "Create, validate, and serve standardized Hasna project dashboard reports",
31151
31151
  category: "Project Management",
31152
31152
  tags: ["projects", "dashboard", "reports", "json-render"]
31153
+ },
31154
+ {
31155
+ name: "todos-plan",
31156
+ displayName: "Todos Plan",
31157
+ description: "Author, sync, route, and verify Todos plans using Todos CLI plan IDs as source of truth",
31158
+ category: "Project Management",
31159
+ tags: ["todos", "plans", "tasks", "verification", "workflow"]
31153
31160
  }
31154
31161
  ];
31155
31162
 
@@ -31518,14 +31525,14 @@ var DATA_ANALYSIS_SKILLS = [
31518
31525
  displayName: "Read PDF",
31519
31526
  description: "Extract text and structured content from PDF files with chunked Claude document analysis",
31520
31527
  category: "Data & Analysis",
31521
- tags: ["pdf", "documents", "extraction", "analysis", "remote", "premium", "cerebras"]
31528
+ tags: ["pdf", "documents", "extraction", "analysis", "remote", "premium", "gateway"]
31522
31529
  },
31523
31530
  {
31524
31531
  name: "pdf-read",
31525
31532
  displayName: "PDF Read",
31526
31533
  description: "Read multiple PDFs with page-range selection, chunked reading, and parallel processing",
31527
31534
  category: "Data & Analysis",
31528
- tags: ["pdf", "reader", "extraction", "parallel", "remote", "premium", "cerebras"]
31535
+ tags: ["pdf", "reader", "extraction", "parallel", "remote", "premium", "gateway"]
31529
31536
  },
31530
31537
  {
31531
31538
  name: "pdf-to-markdown",
@@ -33054,6 +33061,20 @@ var skillSummarySchema = objectSchema({
33054
33061
  category: stringSchema("Skill category."),
33055
33062
  pricing: pricingSchema
33056
33063
  }, ["name", "category"], "Compact skill summary.");
33064
+ var toolPrimitiveSummarySchema = objectSchema({
33065
+ name: stringSchema("Primitive tool name."),
33066
+ title: stringSchema("Display name."),
33067
+ family: stringSchema("Primitive family."),
33068
+ runtime: stringSchema("Runtime type: local, hosted, gateway, connector, or mixed."),
33069
+ description: stringSchema("Primitive description.")
33070
+ }, ["name", "title", "family", "runtime", "description"], "Primitive tool summary.");
33071
+ var skillToolDependencySchema = objectSchema({
33072
+ skill: stringSchema("Skill slug."),
33073
+ primitive: stringSchema("Primitive tool name."),
33074
+ family: stringSchema("Primitive family."),
33075
+ required: { type: "boolean" },
33076
+ reason: stringSchema("Why this skill depends on the primitive.")
33077
+ }, ["skill", "primitive", "family", "required", "reason"], "Primitive dependency for a skill.");
33057
33078
  var validationMessageSchema = objectSchema({
33058
33079
  code: stringSchema("Stable validation code."),
33059
33080
  message: stringSchema("Validation message."),
@@ -33234,6 +33255,74 @@ var toolContracts = [
33234
33255
  inputSchema: objectSchema({ name: skillNameInput }, ["name"]),
33235
33256
  outputSchema: { type: "string", description: "Best available skill documentation." }
33236
33257
  },
33258
+ {
33259
+ name: "list_tool_primitives",
33260
+ title: "List Tool Primitives",
33261
+ description: "List primitive tools used by skills across CLI, MCP, API, and hosted worker execution.",
33262
+ params: ["query?"],
33263
+ category: "discovery",
33264
+ sideEffects: "none",
33265
+ stable: true,
33266
+ inputSchema: objectSchema({ query: stringSchema("Optional primitive search query.") }),
33267
+ outputSchema: objectSchema({
33268
+ schemaVersion: { type: "number" },
33269
+ primitives: arraySchema(toolPrimitiveSummarySchema),
33270
+ total: { type: "number" }
33271
+ }, ["schemaVersion", "primitives", "total"])
33272
+ },
33273
+ {
33274
+ name: "get_tool_primitive",
33275
+ title: "Get Tool Primitive",
33276
+ description: "Get one primitive tool definition by name.",
33277
+ params: ["name"],
33278
+ category: "metadata",
33279
+ sideEffects: "none",
33280
+ stable: true,
33281
+ inputSchema: objectSchema({ name: stringSchema("Primitive tool name.") }, ["name"]),
33282
+ outputSchema: objectSchema({}, [], "Primitive tool definition.", true)
33283
+ },
33284
+ {
33285
+ name: "get_skill_tool_dependencies",
33286
+ title: "Get Skill Tool Dependencies",
33287
+ description: "Get primitive tool dependencies for one skill.",
33288
+ params: ["name"],
33289
+ category: "metadata",
33290
+ sideEffects: "none",
33291
+ stable: true,
33292
+ inputSchema: objectSchema({ name: skillNameInput }, ["name"]),
33293
+ outputSchema: objectSchema({
33294
+ schemaVersion: { type: "number" },
33295
+ skill: skillNameInput,
33296
+ category: stringSchema("Skill category."),
33297
+ source: stringSchema("Skill source."),
33298
+ dependencies: arraySchema(skillToolDependencySchema),
33299
+ gatewayBacked: { type: "boolean" },
33300
+ hostedRuntime: { type: "boolean" }
33301
+ }, ["schemaVersion", "skill", "category", "dependencies", "gatewayBacked", "hostedRuntime"])
33302
+ },
33303
+ {
33304
+ name: "validate_tool_primitives",
33305
+ title: "Validate Tool Primitives",
33306
+ description: "Validate primitive tool coverage for the bundled skill catalog.",
33307
+ params: ["profile?"],
33308
+ category: "validation",
33309
+ sideEffects: "none",
33310
+ stable: true,
33311
+ inputSchema: objectSchema({
33312
+ profile: { type: "string", enum: ["basic", "all"], default: "all" }
33313
+ }),
33314
+ outputSchema: objectSchema({
33315
+ schemaVersion: { type: "number" },
33316
+ valid: { type: "boolean" },
33317
+ profile: stringSchema("Registry profile."),
33318
+ skillCount: { type: "number" },
33319
+ primitiveCount: { type: "number" },
33320
+ mappedSkillCount: { type: "number" },
33321
+ gatewayBackedSkillCount: { type: "number" },
33322
+ hostedRuntimeSkillCount: { type: "number" },
33323
+ issues: arraySchema(objectSchema({}, [], "Coverage issue.", true))
33324
+ }, ["schemaVersion", "valid", "profile", "skillCount", "primitiveCount", "mappedSkillCount", "issues"])
33325
+ },
33237
33326
  {
33238
33327
  name: "pin_skill",
33239
33328
  title: "Pin Skill",
@@ -33626,6 +33715,13 @@ var resourceContracts = [
33626
33715
  mimeType: "application/json",
33627
33716
  schema: arraySchema(skillSummarySchema)
33628
33717
  },
33718
+ {
33719
+ uri: "skills://tool-primitives",
33720
+ name: "Tool Primitives",
33721
+ description: "Primitive tool catalog used by skills across CLI, MCP, API, and hosted workers.",
33722
+ mimeType: "application/json",
33723
+ schema: arraySchema(toolPrimitiveSummarySchema)
33724
+ },
33629
33725
  {
33630
33726
  uri: "skills://{name}",
33631
33727
  name: "Skill Info",
@@ -33769,6 +33865,7 @@ var VENDOR_TERMS = [
33769
33865
  "DALL-E 3",
33770
33866
  "GPT-4o Mini",
33771
33867
  "Cerebras",
33868
+ "OpenRouter",
33772
33869
  "Firecrawl",
33773
33870
  "ElevenLabs",
33774
33871
  "Anthropic",
@@ -33797,6 +33894,7 @@ var VENDOR_TAGS = new Set([
33797
33894
  "google",
33798
33895
  "minimax",
33799
33896
  "openai",
33897
+ "openrouter",
33800
33898
  "seedance",
33801
33899
  "whisper",
33802
33900
  "xai"
@@ -33810,6 +33908,7 @@ var VENDOR_ENV_PREFIXES = [
33810
33908
  "GOOGLE_",
33811
33909
  "MINIMAX_",
33812
33910
  "OPENAI_",
33911
+ "OPENROUTER_",
33813
33912
  "XAI_"
33814
33913
  ];
33815
33914
  var VENDOR_PACKAGE_PATTERNS = [
@@ -33820,6 +33919,7 @@ var VENDOR_PACKAGE_PATTERNS = [
33820
33919
  /gemini/i,
33821
33920
  /minimax/i,
33822
33921
  /openai/i,
33922
+ /openrouter/i,
33823
33923
  /xai/i
33824
33924
  ];
33825
33925
  var vendorPattern = new RegExp(`\\b(${VENDOR_TERMS.map(escapeRegExp).join("|")})\\b`, "gi");
@@ -33882,6 +33982,395 @@ function resolveDiscoveryPricing(skill) {
33882
33982
  return skill.pricing && typeof skill.pricing.formattedCost === "string" ? skill.pricing : getPublicSkillPricing(skill.name);
33883
33983
  }
33884
33984
 
33985
+ // src/lib/tool-primitives.ts
33986
+ init_pricing();
33987
+ var TOOL_PRIMITIVE_SCHEMA_VERSION = 1;
33988
+ var TOOL_PRIMITIVES = [
33989
+ {
33990
+ name: "ai-gateway",
33991
+ title: "AI Gateway",
33992
+ family: "ai",
33993
+ description: "Provider-neutral text, code, reasoning, and multimodal model calls routed through the configured hosted gateway.",
33994
+ runtime: "gateway",
33995
+ stable: true,
33996
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
33997
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
33998
+ apiSurfaces: ["runSkill", "SkillRunRecord", "RemoteSkillRunContract"],
33999
+ envVars: ["SKILLS_API_KEY"],
34000
+ outputTypes: ["text", "json", "markdown", "artifact"],
34001
+ capabilities: ["completion", "reasoning", "tool-calling", "vision-input", "structured-output"]
34002
+ },
34003
+ {
34004
+ name: "documents-read",
34005
+ title: "Document Read",
34006
+ family: "documents",
34007
+ description: "Read, parse, normalize, and extract from PDF, DOCX, slides, invoices, contracts, and other document files.",
34008
+ runtime: "mixed",
34009
+ stable: true,
34010
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34011
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34012
+ apiSurfaces: ["getSkillRequirements", "runSkill"],
34013
+ envVars: [],
34014
+ outputTypes: ["text", "json", "markdown"],
34015
+ capabilities: ["pdf-parse", "office-parse", "ocr", "metadata-extraction"]
34016
+ },
34017
+ {
34018
+ name: "documents-write",
34019
+ title: "Document Write",
34020
+ family: "documents",
34021
+ description: "Generate PDFs, DOCX, slide decks, ebooks, reports, and other downloadable document artifacts.",
34022
+ runtime: "mixed",
34023
+ stable: true,
34024
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34025
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34026
+ apiSurfaces: ["createSkillRun", "completeSkillRun", "writeRunLogs"],
34027
+ envVars: [],
34028
+ outputTypes: ["pdf", "docx", "pptx", "markdown", "zip"],
34029
+ capabilities: ["document-generation", "layout", "export-artifacts"]
34030
+ },
34031
+ {
34032
+ name: "structured-data",
34033
+ title: "Structured Data",
34034
+ family: "data",
34035
+ description: "Read, transform, validate, and export CSV, Excel, JSON, SQL, metrics, and tabular datasets.",
34036
+ runtime: "mixed",
34037
+ stable: true,
34038
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34039
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34040
+ apiSurfaces: ["runSkill", "SkillRunArtifact"],
34041
+ envVars: [],
34042
+ outputTypes: ["csv", "xlsx", "json", "sql", "markdown"],
34043
+ capabilities: ["csv", "excel", "etl", "schema", "analytics"]
34044
+ },
34045
+ {
34046
+ name: "media-image",
34047
+ title: "Image Tooling",
34048
+ family: "media",
34049
+ description: "Generate, inspect, transform, remove backgrounds from, and package image artifacts.",
34050
+ runtime: "gateway",
34051
+ stable: true,
34052
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34053
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34054
+ apiSurfaces: ["runSkill", "RemoteSkillRunContract"],
34055
+ envVars: ["SKILLS_API_KEY"],
34056
+ outputTypes: ["png", "jpeg", "webp", "svg", "zip"],
34057
+ capabilities: ["image-generation", "image-analysis", "image-editing", "asset-packaging"]
34058
+ },
34059
+ {
34060
+ name: "media-audio",
34061
+ title: "Audio Tooling",
34062
+ family: "media",
34063
+ description: "Transcribe, extract, clean, generate, and package audio, voiceover, music, and podcast outputs.",
34064
+ runtime: "gateway",
34065
+ stable: true,
34066
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34067
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34068
+ apiSurfaces: ["runSkill", "RemoteSkillRunContract"],
34069
+ envVars: ["SKILLS_API_KEY"],
34070
+ outputTypes: ["mp3", "wav", "txt", "srt", "json", "zip"],
34071
+ capabilities: ["transcription", "audio-generation", "voiceover", "audio-cleanup"]
34072
+ },
34073
+ {
34074
+ name: "media-video",
34075
+ title: "Video Tooling",
34076
+ family: "media",
34077
+ description: "Generate, analyze, cut, caption, summarize, thumbnail, and package video outputs.",
34078
+ runtime: "gateway",
34079
+ stable: true,
34080
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34081
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34082
+ apiSurfaces: ["runSkill", "RemoteSkillRunContract"],
34083
+ envVars: ["SKILLS_API_KEY"],
34084
+ outputTypes: ["mp4", "mov", "srt", "png", "json", "zip"],
34085
+ capabilities: ["video-generation", "video-analysis", "captioning", "highlight-extraction"]
34086
+ },
34087
+ {
34088
+ name: "web-browser",
34089
+ title: "Web Browser",
34090
+ family: "web",
34091
+ description: "Browse, crawl, search, screenshot, inspect, and analyze websites and web application states.",
34092
+ runtime: "mixed",
34093
+ stable: true,
34094
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34095
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34096
+ apiSurfaces: ["runSkill", "SkillRunArtifact"],
34097
+ envVars: [],
34098
+ outputTypes: ["html", "markdown", "png", "json", "har"],
34099
+ capabilities: ["crawl", "browser-automation", "screenshots", "site-analysis"]
34100
+ },
34101
+ {
34102
+ name: "connectors-run",
34103
+ title: "Connector Operations",
34104
+ family: "connectors",
34105
+ description: "Declare and execute external account operations through approved connector plans instead of direct provider CLIs.",
34106
+ runtime: "connector",
34107
+ stable: true,
34108
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34109
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34110
+ apiSurfaces: ["SkillRunContext", "RemoteSkillRunContract"],
34111
+ envVars: ["SKILLS_API_KEY"],
34112
+ outputTypes: ["json", "artifact"],
34113
+ capabilities: ["approval", "external-api", "account-scoped-execution"]
34114
+ },
34115
+ {
34116
+ name: "project-artifacts",
34117
+ title: "Project Artifacts",
34118
+ family: "workspace",
34119
+ description: "Read project context and write deterministic run logs, exports, and downloadable artifacts.",
34120
+ runtime: "local",
34121
+ stable: true,
34122
+ cliCommands: ["skills tools deps <skill>", "skills run <skill>"],
34123
+ mcpTools: ["get_skill_tool_dependencies", "run_skill"],
34124
+ apiSurfaces: ["createSkillRun", "completeSkillRun", "writeRunLogs", "SkillRunArtifact"],
34125
+ envVars: [],
34126
+ outputTypes: ["log", "json", "markdown", "file"],
34127
+ capabilities: ["filesystem", "run-state", "artifact-export", "deterministic-logs"]
34128
+ },
34129
+ {
34130
+ name: "safety-approval",
34131
+ title: "Safety And Approval",
34132
+ family: "safety",
34133
+ description: "Gate risky, paid, security-sensitive, or compliance-sensitive skill actions behind explicit approval and structured evidence.",
34134
+ runtime: "mixed",
34135
+ stable: true,
34136
+ cliCommands: ["skills quote <skill>", "skills tools deps <skill>"],
34137
+ mcpTools: ["quote_skill", "get_skill_tool_dependencies"],
34138
+ apiSurfaces: ["getSkillPricing", "getSkillRunCostCents", "validateSkillDirectory"],
34139
+ envVars: [],
34140
+ outputTypes: ["json", "markdown"],
34141
+ capabilities: ["pricing-approval", "risk-review", "policy-evidence", "validation"]
34142
+ },
34143
+ {
34144
+ name: "hosted-auth",
34145
+ title: "Hosted Auth",
34146
+ family: "hosted",
34147
+ description: "Authenticate hosted and premium runs through Skills account credentials rather than local provider keys.",
34148
+ runtime: "hosted",
34149
+ stable: true,
34150
+ cliCommands: ["skills auth login", "skills billing status", "skills run <skill>"],
34151
+ mcpTools: ["run_skill", "quote_skill"],
34152
+ apiSurfaces: ["RemoteSkillsClient", "RemoteSkillRunContract"],
34153
+ envVars: ["SKILLS_API_KEY"],
34154
+ outputTypes: ["json"],
34155
+ capabilities: ["account-auth", "billing", "remote-run-submit"]
34156
+ }
34157
+ ];
34158
+ var CATEGORY_RULES = [
34159
+ { primitive: "ai-gateway", categories: ["Business & Marketing", "Content Generation", "Design & Branding", "Research & Writing", "Education & Learning", "Communication", "Health & Wellness", "Travel & Lifestyle", "Event Management", "Science & Academic"], reason: "Category is primarily AI-assisted generation, analysis, or planning." },
34160
+ { primitive: "project-artifacts", categories: ["Development Tools", "Project Management", "Productivity & Organization"], reason: "Category operates on project context, run logs, or workspace artifacts." },
34161
+ { primitive: "structured-data", categories: ["Data & Analysis", "Finance & Compliance", "Science & Academic"], reason: "Category works with structured inputs, tabular evidence, metrics, or analytical outputs." },
34162
+ { primitive: "safety-approval", categories: ["Finance & Compliance"], reason: "Category has compliance-sensitive outputs that need reviewable evidence." },
34163
+ { primitive: "web-browser", categories: ["Web & Browser"], reason: "Category depends on browser, crawl, search, or web inspection primitives." },
34164
+ { primitive: "media-image", categories: ["Media Processing", "Design & Branding"], reason: "Category includes visual asset generation, inspection, or packaging." }
34165
+ ];
34166
+ var NAME_RULES = [
34167
+ { primitive: "documents-read", names: ["read-pdf", "pdf-read", "pdf-to-markdown", "pdf-to-dataset", "doc-read", "extract-invoice", "contract-review-report", "invoice-reconciliation"], reason: "Skill explicitly reads or extracts from document files." },
34168
+ { primitive: "documents-write", names: ["pdf-generate", "doc-generate", "generate-presentation", "slide-deck-generator", "pitch-deck", "proposal-pack", "create-ebook", "generate-book-cover", "api-docs-portal", "landing-page-pack", "one-page-website"], reason: "Skill generates downloadable documents or presentation artifacts." },
34169
+ { primitive: "structured-data", names: ["read-csv", "read-excel", "excel", "generate-sql", "generate-mock-data", "benchmark-finder", "budget-variance-analyzer", "subscription-spend-watcher", "payroll-change-prepper"], reason: "Skill reads, creates, or analyzes structured data." },
34170
+ { primitive: "media-image", names: ["image", "read-image", "brand-photo-shoot", "campaign-moodboard", "logo-design", "icon-pack", "emoji", "product-mockup", "photo-album", "remove-background", "video-thumbnail", "banner-ad-suite", "ad-creative-generator", "ad-creative-pack", "print-collateral-designer", "packaging-concept-studio"], reason: "Skill works directly with image or visual asset primitives." },
34171
+ { primitive: "media-audio", names: ["audio", "music", "transcript", "audio-extract", "audio-transcript-pack", "music-album", "voiceover-jingle-pack", "podcast-show-notes", "subtitle", "audio-cleanup-lab"], reason: "Skill works directly with audio, music, voiceover, or transcription primitives." },
34172
+ { primitive: "media-video", names: ["video", "short-video-pack", "video-highlight-pack", "video-cut-suggester", "video-thumbnail"], reason: "Skill works directly with video generation, editing, captions, or thumbnails." },
34173
+ { primitive: "web-browser", names: ["browse", "webcrawling", "siteanalyze", "performance-audit-report", "seo-content-pack", "competitor-ad-analyzer", "security-audit-report"], reason: "Skill needs live web, crawl, browser, or site inspection primitives." },
34174
+ { primitive: "connectors-run", names: ["email-sequence", "meeting-pack", "customer-feedback-report", "inbox-priority-planner", "crm-note-enhancer", "campaign-metric-brief"], reason: "Skill can execute account-scoped external communication or CRM operations." },
34175
+ { primitive: "safety-approval", names: ["security-audit-report", "contract-review-report", "risk-disclosure-kit", "compliance-report-pack", "procurement-scorecard"], reason: "Skill produces security, legal, compliance, or procurement-sensitive evidence." }
34176
+ ];
34177
+ var KEYWORD_RULES = [
34178
+ { primitive: "documents-read", keywords: ["pdf", "docx", "document", "invoice", "contract"], reason: "Skill metadata references document parsing or review." },
34179
+ { primitive: "documents-write", keywords: ["deck", "presentation", "report", "proposal", "ebook", "pdf"], reason: "Skill metadata references generated document artifacts." },
34180
+ { primitive: "structured-data", keywords: ["csv", "excel", "spreadsheet", "dataset", "sql", "metric", "analytics", "scorecard", "budget"], reason: "Skill metadata references tabular or analytical data." },
34181
+ { primitive: "media-image", keywords: ["image", "photo", "logo", "icon", "thumbnail", "visual", "ad creative", "mockup"], reason: "Skill metadata references image or visual assets." },
34182
+ { primitive: "media-audio", keywords: ["audio", "voice", "music", "podcast", "transcript", "subtitle"], reason: "Skill metadata references audio or transcript assets." },
34183
+ { primitive: "media-video", keywords: ["video", "clip", "caption", "highlight"], reason: "Skill metadata references video assets." },
34184
+ { primitive: "web-browser", keywords: ["web", "website", "browser", "crawl", "seo", "landing page", "site"], reason: "Skill metadata references web or browser work." },
34185
+ { primitive: "connectors-run", keywords: ["email", "calendar", "crm", "inbox", "meeting", "outreach"], reason: "Skill metadata references external account operations." }
34186
+ ];
34187
+ var primitiveByName = new Map(TOOL_PRIMITIVES.map((primitive) => [primitive.name, primitive]));
34188
+ var HOSTED_RUNTIME_SKILL_NAMES = new Set([
34189
+ "audio",
34190
+ "browse",
34191
+ "convert",
34192
+ "image",
34193
+ "music",
34194
+ "pdf-read",
34195
+ "pdf-to-dataset",
34196
+ "pdf-to-markdown",
34197
+ "read-pdf",
34198
+ "transcript",
34199
+ "video",
34200
+ "webcrawling"
34201
+ ]);
34202
+ function listToolPrimitives(query) {
34203
+ const needle = query?.trim().toLowerCase();
34204
+ return TOOL_PRIMITIVES.filter((primitive) => !needle || primitiveHaystack(primitive).includes(needle)).map(summarizeToolPrimitive).sort((a, b) => a.name.localeCompare(b.name));
34205
+ }
34206
+ function getToolPrimitive(name) {
34207
+ return clone3(primitiveByName.get(name));
34208
+ }
34209
+ function getSkillToolDependencies(name) {
34210
+ const skill = getSkill(name);
34211
+ if (!skill)
34212
+ return null;
34213
+ return createSkillToolDependencies(skill);
34214
+ }
34215
+ function createSkillToolDependencies(skill) {
34216
+ const dependencies = inferPrimitiveDependencies(skill);
34217
+ const primitiveNames = new Set(dependencies.map((dependency) => dependency.primitive));
34218
+ return {
34219
+ schemaVersion: TOOL_PRIMITIVE_SCHEMA_VERSION,
34220
+ skill: skill.name,
34221
+ category: skill.category,
34222
+ source: skill.source ?? "official",
34223
+ dependencies,
34224
+ gatewayBacked: [...primitiveNames].some((name) => primitiveByName.get(name)?.runtime === "gateway" || name === "ai-gateway"),
34225
+ hostedRuntime: isHostedRuntimeSkill(skill) || primitiveNames.has("hosted-auth")
34226
+ };
34227
+ }
34228
+ function validateToolPrimitiveCoverage(profile = "all") {
34229
+ const skills = loadRegistryProfile(profile);
34230
+ const issues = [];
34231
+ let mappedSkillCount = 0;
34232
+ let gatewayBackedSkillCount = 0;
34233
+ let hostedRuntimeSkillCount = 0;
34234
+ for (const skill of skills) {
34235
+ const deps = createSkillToolDependencies(skill);
34236
+ if (deps.dependencies.length === 0) {
34237
+ issues.push({
34238
+ skill: skill.name,
34239
+ code: "skill.unmapped",
34240
+ message: `Skill '${skill.name}' has no primitive dependencies.`
34241
+ });
34242
+ continue;
34243
+ }
34244
+ mappedSkillCount++;
34245
+ if (deps.gatewayBacked)
34246
+ gatewayBackedSkillCount++;
34247
+ if (deps.hostedRuntime)
34248
+ hostedRuntimeSkillCount++;
34249
+ for (const dependency of deps.dependencies) {
34250
+ if (!primitiveByName.has(dependency.primitive)) {
34251
+ issues.push({
34252
+ skill: skill.name,
34253
+ code: "primitive.missing",
34254
+ message: `Skill '${skill.name}' references missing primitive '${dependency.primitive}'.`
34255
+ });
34256
+ }
34257
+ }
34258
+ }
34259
+ return {
34260
+ schemaVersion: TOOL_PRIMITIVE_SCHEMA_VERSION,
34261
+ valid: issues.length === 0,
34262
+ profile,
34263
+ skillCount: skills.length,
34264
+ primitiveCount: TOOL_PRIMITIVES.length,
34265
+ mappedSkillCount,
34266
+ gatewayBackedSkillCount,
34267
+ hostedRuntimeSkillCount,
34268
+ issues
34269
+ };
34270
+ }
34271
+ function inferPrimitiveDependencies(skill) {
34272
+ const matches = [];
34273
+ const allRules = [...CATEGORY_RULES, ...NAME_RULES, ...KEYWORD_RULES];
34274
+ for (const rule of allRules) {
34275
+ if (!ruleMatches(skill, rule))
34276
+ continue;
34277
+ const primitive = primitiveByName.get(rule.primitive);
34278
+ if (!primitive)
34279
+ continue;
34280
+ matches.push({
34281
+ skill: skill.name,
34282
+ primitive: primitive.name,
34283
+ family: primitive.family,
34284
+ required: rule.required ?? true,
34285
+ reason: rule.reason
34286
+ });
34287
+ }
34288
+ if (isHostedRuntimeSkill(skill)) {
34289
+ const primitive = primitiveByName.get("hosted-auth");
34290
+ matches.push({
34291
+ skill: skill.name,
34292
+ primitive: primitive.name,
34293
+ family: primitive.family,
34294
+ required: true,
34295
+ reason: "Skill is premium, remote, or hosted and must use Skills account authentication."
34296
+ });
34297
+ }
34298
+ if (matches.length === 0) {
34299
+ const primitive = primitiveByName.get("project-artifacts");
34300
+ matches.push({
34301
+ skill: skill.name,
34302
+ primitive: primitive.name,
34303
+ family: primitive.family,
34304
+ required: true,
34305
+ reason: "Default workspace primitive for local skill execution, run logs, and artifacts."
34306
+ });
34307
+ }
34308
+ return dedupeDependencies(matches).sort((a, b) => a.primitive.localeCompare(b.primitive));
34309
+ }
34310
+ function ruleMatches(skill, rule) {
34311
+ const name = skill.name.toLowerCase();
34312
+ const category = skill.category.toLowerCase();
34313
+ const tags = skill.tags.map((tag) => tag.toLowerCase());
34314
+ const haystack = [
34315
+ skill.name,
34316
+ skill.displayName,
34317
+ skill.description,
34318
+ skill.category,
34319
+ ...skill.tags
34320
+ ].join(" ").toLowerCase();
34321
+ if (rule.names?.some((candidate) => candidate.toLowerCase() === name))
34322
+ return true;
34323
+ if (rule.categories?.some((candidate) => candidate.toLowerCase() === category))
34324
+ return true;
34325
+ if (rule.tags?.some((candidate) => tags.includes(candidate.toLowerCase())))
34326
+ return true;
34327
+ if (rule.keywords?.some((keyword) => haystack.includes(keyword.toLowerCase())))
34328
+ return true;
34329
+ return false;
34330
+ }
34331
+ function isHostedRuntimeSkill(skill) {
34332
+ const tags = new Set(skill.tags.map((tag) => tag.toLowerCase()));
34333
+ return isPremiumSkill(skill.name) || HOSTED_RUNTIME_SKILL_NAMES.has(skill.name) || tags.has("premium") || tags.has("remote") || tags.has("hosted") || skill.pricing?.tier === "premium";
34334
+ }
34335
+ function dedupeDependencies(dependencies) {
34336
+ const byPrimitive = new Map;
34337
+ for (const dependency of dependencies) {
34338
+ const existing = byPrimitive.get(dependency.primitive);
34339
+ if (!existing) {
34340
+ byPrimitive.set(dependency.primitive, dependency);
34341
+ continue;
34342
+ }
34343
+ byPrimitive.set(dependency.primitive, {
34344
+ ...existing,
34345
+ required: existing.required || dependency.required,
34346
+ reason: existing.reason === dependency.reason ? existing.reason : `${existing.reason} ${dependency.reason}`
34347
+ });
34348
+ }
34349
+ return [...byPrimitive.values()];
34350
+ }
34351
+ function summarizeToolPrimitive(primitive) {
34352
+ return {
34353
+ name: primitive.name,
34354
+ title: primitive.title,
34355
+ family: primitive.family,
34356
+ runtime: primitive.runtime,
34357
+ description: primitive.description
34358
+ };
34359
+ }
34360
+ function primitiveHaystack(primitive) {
34361
+ return [
34362
+ primitive.name,
34363
+ primitive.title,
34364
+ primitive.family,
34365
+ primitive.description,
34366
+ primitive.runtime,
34367
+ ...primitive.capabilities
34368
+ ].join(" ").toLowerCase();
34369
+ }
34370
+ function clone3(value) {
34371
+ return value === undefined ? undefined : JSON.parse(JSON.stringify(value));
34372
+ }
34373
+
33885
34374
  // src/lib/compact-output.ts
33886
34375
  var DEFAULT_MCP_LIMIT = 25;
33887
34376
  var MAX_PAGE_LIMIT = 200;
@@ -34127,6 +34616,48 @@ function registerDiscoveryTools(server) {
34127
34616
  }
34128
34617
  return { content: [{ type: "text", text: doc2 }] };
34129
34618
  });
34619
+ server.registerTool("list_tool_primitives", {
34620
+ title: "List Tool Primitives",
34621
+ description: "List primitive tools that skills depend on across CLI, MCP, API, and hosted worker execution.",
34622
+ inputSchema: {
34623
+ query: exports_external.string().optional()
34624
+ }
34625
+ }, async ({ query }) => mcpJson({
34626
+ schemaVersion: 1,
34627
+ primitives: listToolPrimitives(query),
34628
+ total: listToolPrimitives(query).length
34629
+ }));
34630
+ server.registerTool("get_tool_primitive", {
34631
+ title: "Get Tool Primitive",
34632
+ description: "Get one primitive tool definition by name.",
34633
+ inputSchema: {
34634
+ name: exports_external.string()
34635
+ }
34636
+ }, async ({ name }) => {
34637
+ const primitive = getToolPrimitive(name);
34638
+ if (!primitive)
34639
+ return mcpError("PRIMITIVE_NOT_FOUND", `Primitive '${name}' not found`);
34640
+ return mcpJson(primitive);
34641
+ });
34642
+ server.registerTool("get_skill_tool_dependencies", {
34643
+ title: "Get Skill Tool Dependencies",
34644
+ description: "Get primitive tool dependencies for one skill.",
34645
+ inputSchema: {
34646
+ name: exports_external.string()
34647
+ }
34648
+ }, async ({ name }) => {
34649
+ const deps = getSkillToolDependencies(name);
34650
+ if (!deps)
34651
+ return mcpError("SKILL_NOT_FOUND", `Skill '${name}' not found`, findSimilarSkills(name));
34652
+ return mcpJson(deps);
34653
+ });
34654
+ server.registerTool("validate_tool_primitives", {
34655
+ title: "Validate Tool Primitives",
34656
+ description: "Validate primitive tool coverage for the bundled skill catalog.",
34657
+ inputSchema: {
34658
+ profile: exports_external.enum(["basic", "all"]).optional()
34659
+ }
34660
+ }, async ({ profile }) => mcpJson(validateToolPrimitiveCoverage(profile || "all")));
34130
34661
  }
34131
34662
 
34132
34663
  // src/mcp/operation-tools.ts
@@ -34860,6 +35391,15 @@ function registerResourceMetaTools(server) {
34860
35391
  mimeType: "application/json"
34861
35392
  }]
34862
35393
  }));
35394
+ server.registerResource("Tool Primitives", "skills://tool-primitives", {
35395
+ description: "Primitive tool catalog used by skills across CLI, MCP, API, and hosted workers."
35396
+ }, async () => ({
35397
+ contents: [{
35398
+ uri: "skills://tool-primitives",
35399
+ text: JSON.stringify(listToolPrimitives(), null, 2),
35400
+ mimeType: "application/json"
35401
+ }]
35402
+ }));
34863
35403
  server.registerResource("Skill Info", new ResourceTemplate("skills://{name}", { list: undefined }), {
34864
35404
  description: "Individual skill metadata and documentation"
34865
35405
  }, async (uri, { name }) => {
@@ -34878,6 +35418,7 @@ function registerResourceMetaTools(server) {
34878
35418
  ...skill ? getPublicSkillDiscovery(skill) : {},
34879
35419
  documentation: skill ? publicDiscoveryDocumentation(skill, doc2) : doc2,
34880
35420
  requirements: publicReqs,
35421
+ toolDependencies: skill ? getSkillToolDependencies(skill.name) : null,
34881
35422
  ...skill ? { mcp: createSkillMcpMetadata(getPublicSkillDiscovery(skill)) } : {}
34882
35423
  }, null, 2),
34883
35424
  mimeType: "application/json"