ns-omp-provider-kiro 0.3.3 → 0.3.5
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.js +16 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -267,6 +267,7 @@ var init_endpoints = __esm({
|
|
|
267
267
|
"../kiro-core/dist/endpoints.js"() {
|
|
268
268
|
"use strict";
|
|
269
269
|
API_REGION_MAP = {
|
|
270
|
+
"sa-east-1": "us-east-1",
|
|
270
271
|
"us-west-1": "us-east-1",
|
|
271
272
|
"us-west-2": "us-east-1",
|
|
272
273
|
"us-east-2": "us-east-1",
|
|
@@ -2335,17 +2336,19 @@ ${text.substring(text.length - half)}`;
|
|
|
2335
2336
|
}
|
|
2336
2337
|
var KIRO_TOOL_USE_ID_PATTERN = /^[a-zA-Z0-9_.:-]{1,64}$/;
|
|
2337
2338
|
function toKiroToolUseId(toolUseId) {
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2339
|
+
const id = typeof toolUseId === "string" ? toolUseId : String(toolUseId);
|
|
2340
|
+
if (KIRO_TOOL_USE_ID_PATTERN.test(id))
|
|
2341
|
+
return id;
|
|
2342
|
+
const digest = createHash2("sha256").update(id).digest("base64url").slice(0, 32);
|
|
2341
2343
|
return `pi_${digest}`;
|
|
2342
2344
|
}
|
|
2343
2345
|
var KIRO_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
2344
2346
|
function toKiroToolName(name) {
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
const
|
|
2347
|
+
const str2 = typeof name === "string" ? name : String(name);
|
|
2348
|
+
if (KIRO_TOOL_NAME_PATTERN.test(str2))
|
|
2349
|
+
return str2;
|
|
2350
|
+
const clean = str2.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 55);
|
|
2351
|
+
const digest = createHash2("sha256").update(str2).digest("base64url").slice(0, 8);
|
|
2349
2352
|
return `${clean || "tool"}_${digest}`;
|
|
2350
2353
|
}
|
|
2351
2354
|
function kiroToolNameAliases(tools) {
|
|
@@ -2403,11 +2406,16 @@ function toKiroInputSchema(parameters) {
|
|
|
2403
2406
|
}
|
|
2404
2407
|
return { type: "object", properties: {} };
|
|
2405
2408
|
}
|
|
2409
|
+
function toKiroToolDescription(description) {
|
|
2410
|
+
if (typeof description === "string")
|
|
2411
|
+
return description === "" ? {} : { description };
|
|
2412
|
+
return description == null ? {} : { description: String(description) };
|
|
2413
|
+
}
|
|
2406
2414
|
function convertToolsToKiro(tools) {
|
|
2407
2415
|
return tools.map((tool) => ({
|
|
2408
2416
|
toolSpecification: {
|
|
2409
2417
|
name: toKiroToolName(tool.name),
|
|
2410
|
-
|
|
2418
|
+
...toKiroToolDescription(tool.description),
|
|
2411
2419
|
inputSchema: { json: toKiroInputSchema(tool.parameters) }
|
|
2412
2420
|
}
|
|
2413
2421
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ns-omp-provider-kiro",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "OMP (oh-my-pi) provider plugin: adds Kiro (AWS CodeWhisperer/Q) models via your kiro-cli login",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"ns-kiro-core": "0.3.
|
|
40
|
+
"ns-kiro-core": "0.3.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@oh-my-pi/pi-ai": ">=18.2.0",
|