@inkeep/agents-manage-api 0.23.5 → 0.24.1

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.cjs CHANGED
@@ -13,7 +13,6 @@ var factory = require('hono/factory');
13
13
  var zod = require('zod');
14
14
  var swaggerUi = require('@hono/swagger-ui');
15
15
  var nanoid = require('nanoid');
16
- var streaming = require('hono/streaming');
17
16
 
18
17
  var __defProp = Object.defineProperty;
19
18
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -1948,101 +1947,6 @@ app8.openapi(
1948
1947
  return c.body(null, 204);
1949
1948
  }
1950
1949
  );
1951
- app8.openapi(
1952
- zodOpenapi.createRoute({
1953
- method: "post",
1954
- path: "/{id}/generate-preview",
1955
- summary: "Generate Component Preview",
1956
- operationId: "generate-component-preview",
1957
- tags: ["Data Component"],
1958
- request: {
1959
- params: agentsCore.TenantProjectIdParamsSchema,
1960
- body: {
1961
- content: {
1962
- "application/json": {
1963
- schema: zod.z.object({
1964
- instructions: zod.z.string().optional(),
1965
- existingCode: zod.z.string().optional()
1966
- })
1967
- }
1968
- }
1969
- }
1970
- },
1971
- responses: {
1972
- 200: {
1973
- description: "Streaming component code generation",
1974
- content: {
1975
- "text/plain": {
1976
- schema: { type: "string" }
1977
- }
1978
- }
1979
- },
1980
- ...agentsCore.commonGetErrorResponses
1981
- }
1982
- }),
1983
- async (c) => {
1984
- const { tenantId, projectId, id } = c.req.valid("param");
1985
- const body = c.req.valid("json");
1986
- const runApiUrl = env.AGENTS_RUN_API_URL;
1987
- const url = `${runApiUrl}/v1/${tenantId}/projects/${projectId}/data-components/${id}/generate-preview`;
1988
- try {
1989
- const response = await fetch(url, {
1990
- method: "POST",
1991
- headers: {
1992
- "Content-Type": "application/json"
1993
- },
1994
- body: JSON.stringify(body)
1995
- });
1996
- if (!response.ok) {
1997
- throw agentsCore.createApiError({
1998
- code: "internal_server_error",
1999
- message: `Failed to generate preview: ${response.statusText}`
2000
- });
2001
- }
2002
- if (!response.body) {
2003
- throw agentsCore.createApiError({
2004
- code: "internal_server_error",
2005
- message: "No response body from preview generation"
2006
- });
2007
- }
2008
- c.header("Content-Type", "text/plain; charset=utf-8");
2009
- c.header("Cache-Control", "no-cache");
2010
- c.header("Connection", "keep-alive");
2011
- return streaming.stream(c, async (stream2) => {
2012
- const responseBody = response.body;
2013
- if (!responseBody) {
2014
- throw agentsCore.createApiError({
2015
- code: "internal_server_error",
2016
- message: "Response body is null"
2017
- });
2018
- }
2019
- const reader = responseBody.getReader();
2020
- const decoder = new TextDecoder();
2021
- try {
2022
- while (true) {
2023
- const { done, value } = await reader.read();
2024
- if (done) break;
2025
- const text = decoder.decode(value, { stream: true });
2026
- await stream2.write(text);
2027
- }
2028
- } catch {
2029
- throw agentsCore.createApiError({
2030
- code: "internal_server_error",
2031
- message: "Error streaming preview generation"
2032
- });
2033
- }
2034
- });
2035
- } catch (error) {
2036
- if (error instanceof Error && "code" in error) {
2037
- throw error;
2038
- }
2039
- throw agentsCore.createApiError({
2040
- code: "internal_server_error",
2041
- message: "Failed to generate component preview"
2042
- });
2043
- }
2044
- }
2045
- );
2046
1950
  var dataComponents_default = app8;
2047
1951
  var app9 = new zodOpenapi.OpenAPIHono();
2048
1952
  app9.openapi(
package/dist/index.js CHANGED
@@ -9,7 +9,6 @@ import { createMiddleware } from 'hono/factory';
9
9
  import { z } from 'zod';
10
10
  import { swaggerUI } from '@hono/swagger-ui';
11
11
  import { nanoid } from 'nanoid';
12
- import { stream } from 'hono/streaming';
13
12
 
14
13
  var __defProp = Object.defineProperty;
15
14
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -1944,101 +1943,6 @@ app8.openapi(
1944
1943
  return c.body(null, 204);
1945
1944
  }
1946
1945
  );
1947
- app8.openapi(
1948
- createRoute({
1949
- method: "post",
1950
- path: "/{id}/generate-preview",
1951
- summary: "Generate Component Preview",
1952
- operationId: "generate-component-preview",
1953
- tags: ["Data Component"],
1954
- request: {
1955
- params: TenantProjectIdParamsSchema,
1956
- body: {
1957
- content: {
1958
- "application/json": {
1959
- schema: z.object({
1960
- instructions: z.string().optional(),
1961
- existingCode: z.string().optional()
1962
- })
1963
- }
1964
- }
1965
- }
1966
- },
1967
- responses: {
1968
- 200: {
1969
- description: "Streaming component code generation",
1970
- content: {
1971
- "text/plain": {
1972
- schema: { type: "string" }
1973
- }
1974
- }
1975
- },
1976
- ...commonGetErrorResponses
1977
- }
1978
- }),
1979
- async (c) => {
1980
- const { tenantId, projectId, id } = c.req.valid("param");
1981
- const body = c.req.valid("json");
1982
- const runApiUrl = env.AGENTS_RUN_API_URL;
1983
- const url = `${runApiUrl}/v1/${tenantId}/projects/${projectId}/data-components/${id}/generate-preview`;
1984
- try {
1985
- const response = await fetch(url, {
1986
- method: "POST",
1987
- headers: {
1988
- "Content-Type": "application/json"
1989
- },
1990
- body: JSON.stringify(body)
1991
- });
1992
- if (!response.ok) {
1993
- throw createApiError({
1994
- code: "internal_server_error",
1995
- message: `Failed to generate preview: ${response.statusText}`
1996
- });
1997
- }
1998
- if (!response.body) {
1999
- throw createApiError({
2000
- code: "internal_server_error",
2001
- message: "No response body from preview generation"
2002
- });
2003
- }
2004
- c.header("Content-Type", "text/plain; charset=utf-8");
2005
- c.header("Cache-Control", "no-cache");
2006
- c.header("Connection", "keep-alive");
2007
- return stream(c, async (stream2) => {
2008
- const responseBody = response.body;
2009
- if (!responseBody) {
2010
- throw createApiError({
2011
- code: "internal_server_error",
2012
- message: "Response body is null"
2013
- });
2014
- }
2015
- const reader = responseBody.getReader();
2016
- const decoder = new TextDecoder();
2017
- try {
2018
- while (true) {
2019
- const { done, value } = await reader.read();
2020
- if (done) break;
2021
- const text = decoder.decode(value, { stream: true });
2022
- await stream2.write(text);
2023
- }
2024
- } catch {
2025
- throw createApiError({
2026
- code: "internal_server_error",
2027
- message: "Error streaming preview generation"
2028
- });
2029
- }
2030
- });
2031
- } catch (error) {
2032
- if (error instanceof Error && "code" in error) {
2033
- throw error;
2034
- }
2035
- throw createApiError({
2036
- code: "internal_server_error",
2037
- message: "Failed to generate component preview"
2038
- });
2039
- }
2040
- }
2041
- );
2042
1946
  var dataComponents_default = app8;
2043
1947
  var app9 = new OpenAPIHono();
2044
1948
  app9.openapi(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.23.5",
3
+ "version": "0.24.1",
4
4
  "description": "Agents Manage API for Inkeep Agent Framework - handles CRUD operations and OAuth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "openid-client": "^6.6.4",
24
24
  "pino": "^9.7.0",
25
25
  "zod": "^4.1.11",
26
- "@inkeep/agents-core": "^0.23.5"
26
+ "@inkeep/agents-core": "^0.24.1"
27
27
  },
28
28
  "optionalDependencies": {
29
29
  "keytar": "^7.9.0"