@robota-sdk/agent-sdk 3.0.0-beta.30 → 3.0.0-beta.31
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/node/index.cjs +37 -15
- package/dist/node/index.d.cts +5 -0
- package/dist/node/index.d.ts +5 -0
- package/dist/node/index.js +37 -15
- package/package.json +5 -5
package/dist/node/index.cjs
CHANGED
|
@@ -1226,25 +1226,47 @@ var BundlePluginInstaller = class {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
return this.marketplaceClient.getMarketplaceSha(marketplaceName);
|
|
1228
1228
|
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Normalize source object — Claude Code manifests use `source` key instead of `type`.
|
|
1231
|
+
* e.g., { source: "url", url: "..." } → { type: "url", url: "..." }
|
|
1232
|
+
*/
|
|
1233
|
+
normalizeSource(source) {
|
|
1234
|
+
if (typeof source === "string") return source;
|
|
1235
|
+
const obj = source;
|
|
1236
|
+
if (!obj.type && typeof obj.source === "string") {
|
|
1237
|
+
return { ...obj, type: obj.source };
|
|
1238
|
+
}
|
|
1239
|
+
return source;
|
|
1240
|
+
}
|
|
1229
1241
|
/** Resolve the source and install the plugin. */
|
|
1230
|
-
resolveAndInstall(
|
|
1242
|
+
resolveAndInstall(rawSource, marketplaceName, pluginName, targetDir) {
|
|
1231
1243
|
(0, import_node_fs3.mkdirSync)(targetDir, { recursive: true });
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1244
|
+
const source = this.normalizeSource(rawSource);
|
|
1245
|
+
try {
|
|
1246
|
+
if (typeof source === "string") {
|
|
1247
|
+
const marketplaceDir = this.marketplaceClient.getMarketplaceDir(marketplaceName);
|
|
1248
|
+
const sourcePath = (0, import_node_path4.join)(marketplaceDir, source);
|
|
1249
|
+
if (!(0, import_node_fs3.existsSync)(sourcePath)) {
|
|
1250
|
+
throw new Error(
|
|
1251
|
+
`Plugin source path "${source}" not found in marketplace "${marketplaceName}"`
|
|
1252
|
+
);
|
|
1253
|
+
}
|
|
1254
|
+
(0, import_node_fs3.cpSync)(sourcePath, targetDir, { recursive: true });
|
|
1255
|
+
} else if (source.type === "github") {
|
|
1256
|
+
const repoUrl = `https://github.com/${source.repo}.git`;
|
|
1257
|
+
this.cloneToDir(repoUrl, targetDir, pluginName);
|
|
1258
|
+
} else if (source.type === "url" && typeof source.url === "string" && source.url.endsWith(".git")) {
|
|
1259
|
+
this.cloneToDir(source.url, targetDir, pluginName);
|
|
1260
|
+
} else if (source.type === "url") {
|
|
1261
|
+
throw new Error(`URL source "${source.url}" is not a git repository (must end with .git)`);
|
|
1262
|
+
} else {
|
|
1263
|
+
throw new Error(`Unknown source type: ${JSON.stringify(source)}`);
|
|
1264
|
+
}
|
|
1265
|
+
} catch (err) {
|
|
1266
|
+
if ((0, import_node_fs3.existsSync)(targetDir)) {
|
|
1236
1267
|
(0, import_node_fs3.rmSync)(targetDir, { recursive: true, force: true });
|
|
1237
|
-
throw new Error(
|
|
1238
|
-
`Plugin source path "${source}" not found in marketplace "${marketplaceName}"`
|
|
1239
|
-
);
|
|
1240
1268
|
}
|
|
1241
|
-
|
|
1242
|
-
} else if (source.type === "github") {
|
|
1243
|
-
const repoUrl = `https://github.com/${source.repo}.git`;
|
|
1244
|
-
this.cloneToDir(repoUrl, targetDir, pluginName);
|
|
1245
|
-
} else if (source.type === "url") {
|
|
1246
|
-
(0, import_node_fs3.rmSync)(targetDir, { recursive: true, force: true });
|
|
1247
|
-
throw new Error("URL source installation is not yet supported");
|
|
1269
|
+
throw err;
|
|
1248
1270
|
}
|
|
1249
1271
|
}
|
|
1250
1272
|
/** Clone a git repository to the target directory. */
|
package/dist/node/index.d.cts
CHANGED
|
@@ -657,6 +657,11 @@ declare class BundlePluginInstaller {
|
|
|
657
657
|
getPluginsByMarketplace(marketplaceName: string): IInstalledPluginRecord[];
|
|
658
658
|
/** Resolve the version for a plugin entry. */
|
|
659
659
|
private resolveVersion;
|
|
660
|
+
/**
|
|
661
|
+
* Normalize source object — Claude Code manifests use `source` key instead of `type`.
|
|
662
|
+
* e.g., { source: "url", url: "..." } → { type: "url", url: "..." }
|
|
663
|
+
*/
|
|
664
|
+
private normalizeSource;
|
|
660
665
|
/** Resolve the source and install the plugin. */
|
|
661
666
|
private resolveAndInstall;
|
|
662
667
|
/** Clone a git repository to the target directory. */
|
package/dist/node/index.d.ts
CHANGED
|
@@ -657,6 +657,11 @@ declare class BundlePluginInstaller {
|
|
|
657
657
|
getPluginsByMarketplace(marketplaceName: string): IInstalledPluginRecord[];
|
|
658
658
|
/** Resolve the version for a plugin entry. */
|
|
659
659
|
private resolveVersion;
|
|
660
|
+
/**
|
|
661
|
+
* Normalize source object — Claude Code manifests use `source` key instead of `type`.
|
|
662
|
+
* e.g., { source: "url", url: "..." } → { type: "url", url: "..." }
|
|
663
|
+
*/
|
|
664
|
+
private normalizeSource;
|
|
660
665
|
/** Resolve the source and install the plugin. */
|
|
661
666
|
private resolveAndInstall;
|
|
662
667
|
/** Clone a git repository to the target directory. */
|
package/dist/node/index.js
CHANGED
|
@@ -1167,25 +1167,47 @@ var BundlePluginInstaller = class {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
return this.marketplaceClient.getMarketplaceSha(marketplaceName);
|
|
1169
1169
|
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Normalize source object — Claude Code manifests use `source` key instead of `type`.
|
|
1172
|
+
* e.g., { source: "url", url: "..." } → { type: "url", url: "..." }
|
|
1173
|
+
*/
|
|
1174
|
+
normalizeSource(source) {
|
|
1175
|
+
if (typeof source === "string") return source;
|
|
1176
|
+
const obj = source;
|
|
1177
|
+
if (!obj.type && typeof obj.source === "string") {
|
|
1178
|
+
return { ...obj, type: obj.source };
|
|
1179
|
+
}
|
|
1180
|
+
return source;
|
|
1181
|
+
}
|
|
1170
1182
|
/** Resolve the source and install the plugin. */
|
|
1171
|
-
resolveAndInstall(
|
|
1183
|
+
resolveAndInstall(rawSource, marketplaceName, pluginName, targetDir) {
|
|
1172
1184
|
mkdirSync2(targetDir, { recursive: true });
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1185
|
+
const source = this.normalizeSource(rawSource);
|
|
1186
|
+
try {
|
|
1187
|
+
if (typeof source === "string") {
|
|
1188
|
+
const marketplaceDir = this.marketplaceClient.getMarketplaceDir(marketplaceName);
|
|
1189
|
+
const sourcePath = join6(marketplaceDir, source);
|
|
1190
|
+
if (!existsSync6(sourcePath)) {
|
|
1191
|
+
throw new Error(
|
|
1192
|
+
`Plugin source path "${source}" not found in marketplace "${marketplaceName}"`
|
|
1193
|
+
);
|
|
1194
|
+
}
|
|
1195
|
+
cpSync(sourcePath, targetDir, { recursive: true });
|
|
1196
|
+
} else if (source.type === "github") {
|
|
1197
|
+
const repoUrl = `https://github.com/${source.repo}.git`;
|
|
1198
|
+
this.cloneToDir(repoUrl, targetDir, pluginName);
|
|
1199
|
+
} else if (source.type === "url" && typeof source.url === "string" && source.url.endsWith(".git")) {
|
|
1200
|
+
this.cloneToDir(source.url, targetDir, pluginName);
|
|
1201
|
+
} else if (source.type === "url") {
|
|
1202
|
+
throw new Error(`URL source "${source.url}" is not a git repository (must end with .git)`);
|
|
1203
|
+
} else {
|
|
1204
|
+
throw new Error(`Unknown source type: ${JSON.stringify(source)}`);
|
|
1205
|
+
}
|
|
1206
|
+
} catch (err) {
|
|
1207
|
+
if (existsSync6(targetDir)) {
|
|
1177
1208
|
rmSync(targetDir, { recursive: true, force: true });
|
|
1178
|
-
throw new Error(
|
|
1179
|
-
`Plugin source path "${source}" not found in marketplace "${marketplaceName}"`
|
|
1180
|
-
);
|
|
1181
1209
|
}
|
|
1182
|
-
|
|
1183
|
-
} else if (source.type === "github") {
|
|
1184
|
-
const repoUrl = `https://github.com/${source.repo}.git`;
|
|
1185
|
-
this.cloneToDir(repoUrl, targetDir, pluginName);
|
|
1186
|
-
} else if (source.type === "url") {
|
|
1187
|
-
rmSync(targetDir, { recursive: true, force: true });
|
|
1188
|
-
throw new Error("URL source installation is not yet supported");
|
|
1210
|
+
throw err;
|
|
1189
1211
|
}
|
|
1190
1212
|
}
|
|
1191
1213
|
/** Clone a git repository to the target directory. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robota-sdk/agent-sdk",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.31",
|
|
4
4
|
"description": "Programmatic SDK for building AI agents with Robota — provides Session, query(), built-in tools, permissions, hooks, and context loading",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"chalk": "^5.3.0",
|
|
26
26
|
"zod": "^3.24.0",
|
|
27
|
-
"@robota-sdk/agent-core": "3.0.0-beta.
|
|
28
|
-
"@robota-sdk/agent-
|
|
29
|
-
"@robota-sdk/agent-
|
|
30
|
-
"@robota-sdk/agent-
|
|
27
|
+
"@robota-sdk/agent-core": "3.0.0-beta.31",
|
|
28
|
+
"@robota-sdk/agent-sessions": "3.0.0-beta.31",
|
|
29
|
+
"@robota-sdk/agent-provider-anthropic": "3.0.0-beta.31",
|
|
30
|
+
"@robota-sdk/agent-tools": "3.0.0-beta.31"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rimraf": "^5.0.5",
|