ns-omp-provider-kiro 0.3.4 → 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.
Files changed (2) hide show
  1. package/dist/index.js +15 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2336,17 +2336,19 @@ ${text.substring(text.length - half)}`;
2336
2336
  }
2337
2337
  var KIRO_TOOL_USE_ID_PATTERN = /^[a-zA-Z0-9_.:-]{1,64}$/;
2338
2338
  function toKiroToolUseId(toolUseId) {
2339
- if (KIRO_TOOL_USE_ID_PATTERN.test(toolUseId))
2340
- return toolUseId;
2341
- const digest = createHash2("sha256").update(toolUseId).digest("base64url").slice(0, 32);
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);
2342
2343
  return `pi_${digest}`;
2343
2344
  }
2344
2345
  var KIRO_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
2345
2346
  function toKiroToolName(name) {
2346
- if (KIRO_TOOL_NAME_PATTERN.test(name))
2347
- return name;
2348
- const clean = name.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 55);
2349
- const digest = createHash2("sha256").update(name).digest("base64url").slice(0, 8);
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);
2350
2352
  return `${clean || "tool"}_${digest}`;
2351
2353
  }
2352
2354
  function kiroToolNameAliases(tools) {
@@ -2404,11 +2406,16 @@ function toKiroInputSchema(parameters) {
2404
2406
  }
2405
2407
  return { type: "object", properties: {} };
2406
2408
  }
2409
+ function toKiroToolDescription(description) {
2410
+ if (typeof description === "string")
2411
+ return description === "" ? {} : { description };
2412
+ return description == null ? {} : { description: String(description) };
2413
+ }
2407
2414
  function convertToolsToKiro(tools) {
2408
2415
  return tools.map((tool) => ({
2409
2416
  toolSpecification: {
2410
2417
  name: toKiroToolName(tool.name),
2411
- description: tool.description,
2418
+ ...toKiroToolDescription(tool.description),
2412
2419
  inputSchema: { json: toKiroInputSchema(tool.parameters) }
2413
2420
  }
2414
2421
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ns-omp-provider-kiro",
3
- "version": "0.3.4",
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.4"
40
+ "ns-kiro-core": "0.3.5"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@oh-my-pi/pi-ai": ">=18.2.0",