@agentstep/agent-sdk 0.5.19 → 0.5.20

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.
@@ -97,17 +97,38 @@ async function resolveSkillInputs(skills, nowIso) {
97
97
  if ("skill_id" in s && s.skill_id) {
98
98
  const { getSkill: dbGetSkill, getSkillVersion: dbGetSkillVersion } = await import("./db/skills.js");
99
99
  const dbSkill = dbGetSkill(s.skill_id);
100
- if (!dbSkill) throw badRequest(`skill ${s.skill_id} not found`);
101
- const version = s.version ?? dbSkill.current_version;
102
- const sv = dbGetSkillVersion(s.skill_id, version);
103
- if (!sv) throw badRequest(`skill version ${version} not found for skill ${s.skill_id}`);
104
- resolved.push({
105
- name: dbSkill.name,
106
- source: `skill:${s.skill_id}@${version}`,
107
- content: sv.content,
108
- ...sv.files && Object.keys(sv.files).length > 0 ? { files: sv.files } : {},
109
- installed_at: nowIso
110
- });
100
+ if (dbSkill) {
101
+ const version = s.version ?? dbSkill.current_version;
102
+ const sv = dbGetSkillVersion(s.skill_id, version);
103
+ if (!sv) throw badRequest(`skill version ${version} not found for skill ${s.skill_id}`);
104
+ resolved.push({
105
+ name: dbSkill.name,
106
+ source: `skill:${s.skill_id}@${version}`,
107
+ content: sv.content,
108
+ ...sv.files && Object.keys(sv.files).length > 0 ? { files: sv.files } : {},
109
+ installed_at: nowIso
110
+ });
111
+ } else if (s.type === "anthropic" || !s.type) {
112
+ const skillName = s.skill_id;
113
+ try {
114
+ const skillMdUrl = `https://raw.githubusercontent.com/anthropics/skills/main/skills/${skillName}/SKILL.md`;
115
+ const resp = await fetch(skillMdUrl, { signal: AbortSignal.timeout(1e4) });
116
+ if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
117
+ const content = await resp.text();
118
+ resolved.push({
119
+ name: skillName,
120
+ source: `anthropic:${skillName}`,
121
+ content,
122
+ installed_at: nowIso
123
+ });
124
+ } catch (err) {
125
+ throw badRequest(
126
+ `skill "${skillName}" not found in local DB or Anthropic skills repo. Upload it via POST /v1/skills or check the skill_id. Available Anthropic skills: docx, pdf, pptx, xlsx`
127
+ );
128
+ }
129
+ } else {
130
+ throw badRequest(`skill "${s.skill_id}" not found`);
131
+ }
111
132
  } else {
112
133
  const inline = s;
113
134
  resolved.push({
@@ -6,7 +6,7 @@ import {
6
6
  handleListAgentVersions,
7
7
  handleListAgents,
8
8
  handleUpdateAgent
9
- } from "../chunk-37JORFNW.js";
9
+ } from "../chunk-EH73DPPL.js";
10
10
  import "../chunk-23UKWXJH.js";
11
11
  import "../chunk-HZY43FS6.js";
12
12
  import "../chunk-D2XITRN6.js";
@@ -146,7 +146,7 @@ import {
146
146
  handleListAgentVersions,
147
147
  handleListAgents,
148
148
  handleUpdateAgent
149
- } from "../chunk-37JORFNW.js";
149
+ } from "../chunk-EH73DPPL.js";
150
150
  import {
151
151
  handleCreateApiKey,
152
152
  handleGetApiKey,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "Apache-2.0",
3
3
  "name": "@agentstep/agent-sdk",
4
- "version": "0.5.19",
4
+ "version": "0.5.20",
5
5
  "description": "Core engine for AgentStep Gateway \u2014 backends, sandbox providers, session orchestration, and vault encryption.",
6
6
  "keywords": [
7
7
  "anthropic",