@yak-io/rest 0.1.1 → 0.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,WAAW,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AAE/F,gDAAgD;AAChD,MAAM,MAAM,qBAAqB,GAAG;IAClC,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,wGAAwG;IACxG,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9D,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AA2BF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,WAAW,CA6BhF"}
1
+ {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,WAAW,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AAE/F,gDAAgD;AAChD,MAAM,MAAM,qBAAqB,GAAG;IAClC,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,wGAAwG;IACxG,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9D,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AA2BF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,WAAW,CA+BhF"}
package/dist/adapters.js CHANGED
@@ -42,7 +42,10 @@ const REST_INPUT_SCHEMA = {
42
42
  */
43
43
  export function createRESTToolAdapter(config) {
44
44
  const toolName = `rest_${config.name}`;
45
- const specStr = typeof config.spec === "string" ? config.spec : JSON.stringify(config.spec, null, 2);
45
+ // Minified, not pretty-printed: the model reads compact JSON identically, and the
46
+ // spec is embedded verbatim in the tool description sent to the LLM on every turn —
47
+ // dropping the indentation/newlines is a free token saving for large specs.
48
+ const specStr = typeof config.spec === "string" ? config.spec : JSON.stringify(config.spec);
46
49
  const tool = {
47
50
  name: toolName,
48
51
  description: `Make a REST API call to the ${config.name} API. Based on the OpenAPI spec below, ` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yak-io/rest",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "REST/OpenAPI adapter for yak chatbot - exposes a REST API as a chatbot tool",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -41,21 +41,20 @@
41
41
  },
42
42
  "./package.json": "./package.json"
43
43
  },
44
- "scripts": {
45
- "build": "tsc",
46
- "check-types": "tsc --noEmit",
47
- "test": "vitest run",
48
- "lint": "biome lint ./src --fix",
49
- "format": "biome format ./src --write",
50
- "prepare": "pnpm build"
51
- },
52
44
  "dependencies": {
53
- "@yak-io/javascript": "workspace:*"
45
+ "@yak-io/javascript": "0.10.1"
54
46
  },
55
47
  "devDependencies": {
56
- "@repo/typescript-config": "workspace:*",
57
48
  "@types/node": "^24.12.4",
58
- "typescript": "^5.3.0"
49
+ "typescript": "^5.3.0",
50
+ "@repo/typescript-config": "0.0.0"
59
51
  },
60
- "homepage": "https://docs.yak.io/docs/tool-adapters/rest"
61
- }
52
+ "homepage": "https://docs.yak.io/docs/tool-adapters/rest",
53
+ "scripts": {
54
+ "build": "tsc",
55
+ "check-types": "tsc --noEmit",
56
+ "test": "vitest run",
57
+ "lint": "biome lint ./src --fix",
58
+ "format": "biome format ./src --write"
59
+ }
60
+ }