@copilotkit/runtime 1.5.1-next.0 → 1.5.1-next.2
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/CHANGELOG.md +17 -0
- package/__snapshots__/schema/schema.graphql +11 -0
- package/dist/{chunk-E7C6IPQ3.mjs → chunk-2FY7EQEE.mjs} +2 -2
- package/dist/{chunk-ESA3KK24.mjs → chunk-2V7BHSFE.mjs} +134 -20
- package/dist/chunk-2V7BHSFE.mjs.map +1 -0
- package/dist/{chunk-BZWZBSGW.mjs → chunk-2ZPE55QG.mjs} +2 -2
- package/dist/{chunk-BDHGW64L.mjs → chunk-W6E7AVR7.mjs} +2 -2
- package/dist/{copilot-runtime-6285d897.d.ts → copilot-runtime-36700e00.d.ts} +9 -2
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/{groq-adapter-15d41154.d.ts → groq-adapter-696b5d29.d.ts} +1 -1
- package/dist/{index-ff3fbc33.d.ts → index-cc2b17be.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +133 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{langserve-48e976ac.d.ts → langserve-9125a12e.d.ts} +1 -1
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +133 -19
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +94 -19
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.d.ts +3 -3
- package/dist/lib/integrations/nest/index.js +94 -19
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.d.ts +3 -3
- package/dist/lib/integrations/node-express/index.js +94 -19
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.d.ts +3 -3
- package/dist/lib/integrations/node-http/index.js +94 -19
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/service-adapters/index.d.ts +4 -4
- package/package.json +2 -2
- package/src/graphql/resolvers/copilot.resolver.ts +16 -0
- package/src/graphql/types/agents-response.type.ts +22 -0
- package/src/lib/runtime/copilot-runtime.ts +50 -0
- package/dist/chunk-ESA3KK24.mjs.map +0 -1
- /package/dist/{chunk-E7C6IPQ3.mjs.map → chunk-2FY7EQEE.mjs.map} +0 -0
- /package/dist/{chunk-BZWZBSGW.mjs.map → chunk-2ZPE55QG.mjs.map} +0 -0
- /package/dist/{chunk-BDHGW64L.mjs.map → chunk-W6E7AVR7.mjs.map} +0 -0
package/dist/lib/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-2FY7EQEE.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-2ZPE55QG.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-W6E7AVR7.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
buildSchema,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getCommonConfig,
|
|
21
21
|
langGraphPlatformEndpoint,
|
|
22
22
|
resolveEndpointType
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-2V7BHSFE.mjs";
|
|
24
24
|
import {
|
|
25
25
|
GoogleGenerativeAIAdapter,
|
|
26
26
|
GroqAdapter,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-
|
|
2
|
-
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-
|
|
1
|
+
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-36700e00.js';
|
|
2
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-36700e00.js';
|
|
3
3
|
import * as graphql_yoga from 'graphql-yoga';
|
|
4
4
|
import { YogaServerInstance } from 'graphql-yoga';
|
|
5
5
|
export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
|
|
6
6
|
export { copilotRuntimeNodeExpressEndpoint } from './node-express/index.js';
|
|
7
7
|
export { copilotRuntimeNestEndpoint } from './nest/index.js';
|
|
8
8
|
import '@copilotkit/shared';
|
|
9
|
-
import '../../langserve-
|
|
10
|
-
import '../../index-
|
|
9
|
+
import '../../langserve-9125a12e.js';
|
|
10
|
+
import '../../index-cc2b17be.js';
|
|
11
11
|
import '../../graphql/types/base/index.js';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import 'graphql';
|
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.5.1-next.
|
|
47
|
+
version: "1.5.1-next.2",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -137,10 +137,10 @@ __export(integrations_exports, {
|
|
|
137
137
|
module.exports = __toCommonJS(integrations_exports);
|
|
138
138
|
|
|
139
139
|
// src/lib/integrations/shared.ts
|
|
140
|
-
var
|
|
140
|
+
var import_type_graphql17 = require("type-graphql");
|
|
141
141
|
|
|
142
142
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
143
|
-
var
|
|
143
|
+
var import_type_graphql16 = require("type-graphql");
|
|
144
144
|
var import_rxjs3 = require("rxjs");
|
|
145
145
|
|
|
146
146
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
@@ -1424,6 +1424,9 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
1424
1424
|
|
|
1425
1425
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1426
1426
|
var import_shared4 = require("@copilotkit/shared");
|
|
1427
|
+
|
|
1428
|
+
// src/graphql/types/agents-response.type.ts
|
|
1429
|
+
var import_type_graphql15 = require("type-graphql");
|
|
1427
1430
|
function _ts_decorate14(decorators, target, key, desc) {
|
|
1428
1431
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1429
1432
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -1440,6 +1443,58 @@ function _ts_metadata14(k, v) {
|
|
|
1440
1443
|
return Reflect.metadata(k, v);
|
|
1441
1444
|
}
|
|
1442
1445
|
__name(_ts_metadata14, "_ts_metadata");
|
|
1446
|
+
var Agent = class {
|
|
1447
|
+
id;
|
|
1448
|
+
name;
|
|
1449
|
+
description;
|
|
1450
|
+
};
|
|
1451
|
+
__name(Agent, "Agent");
|
|
1452
|
+
_ts_decorate14([
|
|
1453
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1454
|
+
_ts_metadata14("design:type", String)
|
|
1455
|
+
], Agent.prototype, "id", void 0);
|
|
1456
|
+
_ts_decorate14([
|
|
1457
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1458
|
+
_ts_metadata14("design:type", String)
|
|
1459
|
+
], Agent.prototype, "name", void 0);
|
|
1460
|
+
_ts_decorate14([
|
|
1461
|
+
(0, import_type_graphql15.Field)(() => String),
|
|
1462
|
+
_ts_metadata14("design:type", String)
|
|
1463
|
+
], Agent.prototype, "description", void 0);
|
|
1464
|
+
Agent = _ts_decorate14([
|
|
1465
|
+
(0, import_type_graphql15.ObjectType)()
|
|
1466
|
+
], Agent);
|
|
1467
|
+
var AgentsResponse = class {
|
|
1468
|
+
agents;
|
|
1469
|
+
};
|
|
1470
|
+
__name(AgentsResponse, "AgentsResponse");
|
|
1471
|
+
_ts_decorate14([
|
|
1472
|
+
(0, import_type_graphql15.Field)(() => [
|
|
1473
|
+
Agent
|
|
1474
|
+
]),
|
|
1475
|
+
_ts_metadata14("design:type", Array)
|
|
1476
|
+
], AgentsResponse.prototype, "agents", void 0);
|
|
1477
|
+
AgentsResponse = _ts_decorate14([
|
|
1478
|
+
(0, import_type_graphql15.ObjectType)()
|
|
1479
|
+
], AgentsResponse);
|
|
1480
|
+
|
|
1481
|
+
// src/graphql/resolvers/copilot.resolver.ts
|
|
1482
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
1483
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1484
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1485
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1486
|
+
else
|
|
1487
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1488
|
+
if (d = decorators[i])
|
|
1489
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1490
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1491
|
+
}
|
|
1492
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
1493
|
+
function _ts_metadata15(k, v) {
|
|
1494
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1495
|
+
return Reflect.metadata(k, v);
|
|
1496
|
+
}
|
|
1497
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
1443
1498
|
function _ts_param(paramIndex, decorator) {
|
|
1444
1499
|
return function(target, key) {
|
|
1445
1500
|
decorator(target, key, paramIndex);
|
|
@@ -1481,6 +1536,17 @@ var CopilotResolver = class {
|
|
|
1481
1536
|
async hello() {
|
|
1482
1537
|
return "Hello World";
|
|
1483
1538
|
}
|
|
1539
|
+
async availableAgents(ctx) {
|
|
1540
|
+
let logger2 = ctx.logger.child({
|
|
1541
|
+
component: "CopilotResolver.availableAgents"
|
|
1542
|
+
});
|
|
1543
|
+
logger2.debug("Processing");
|
|
1544
|
+
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
1545
|
+
logger2.debug("Event source created, creating response");
|
|
1546
|
+
return {
|
|
1547
|
+
agents
|
|
1548
|
+
};
|
|
1549
|
+
}
|
|
1484
1550
|
async generateCopilotResponse(ctx, data, properties) {
|
|
1485
1551
|
var _a, _b, _c;
|
|
1486
1552
|
telemetry_client_default.capture("oss.runtime.copilot_request_created", {
|
|
@@ -1833,29 +1899,38 @@ var CopilotResolver = class {
|
|
|
1833
1899
|
}
|
|
1834
1900
|
};
|
|
1835
1901
|
__name(CopilotResolver, "CopilotResolver");
|
|
1836
|
-
|
|
1837
|
-
(0,
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1902
|
+
_ts_decorate15([
|
|
1903
|
+
(0, import_type_graphql16.Query)(() => String),
|
|
1904
|
+
_ts_metadata15("design:type", Function),
|
|
1905
|
+
_ts_metadata15("design:paramtypes", []),
|
|
1906
|
+
_ts_metadata15("design:returntype", Promise)
|
|
1841
1907
|
], CopilotResolver.prototype, "hello", null);
|
|
1842
|
-
|
|
1843
|
-
(0,
|
|
1844
|
-
_ts_param(0, (0,
|
|
1845
|
-
|
|
1846
|
-
|
|
1908
|
+
_ts_decorate15([
|
|
1909
|
+
(0, import_type_graphql16.Query)(() => AgentsResponse),
|
|
1910
|
+
_ts_param(0, (0, import_type_graphql16.Ctx)()),
|
|
1911
|
+
_ts_metadata15("design:type", Function),
|
|
1912
|
+
_ts_metadata15("design:paramtypes", [
|
|
1913
|
+
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
1914
|
+
]),
|
|
1915
|
+
_ts_metadata15("design:returntype", Promise)
|
|
1916
|
+
], CopilotResolver.prototype, "availableAgents", null);
|
|
1917
|
+
_ts_decorate15([
|
|
1918
|
+
(0, import_type_graphql16.Mutation)(() => CopilotResponse),
|
|
1919
|
+
_ts_param(0, (0, import_type_graphql16.Ctx)()),
|
|
1920
|
+
_ts_param(1, (0, import_type_graphql16.Arg)("data")),
|
|
1921
|
+
_ts_param(2, (0, import_type_graphql16.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1847
1922
|
nullable: true
|
|
1848
1923
|
})),
|
|
1849
|
-
|
|
1850
|
-
|
|
1924
|
+
_ts_metadata15("design:type", Function),
|
|
1925
|
+
_ts_metadata15("design:paramtypes", [
|
|
1851
1926
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1852
1927
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1853
1928
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1854
1929
|
]),
|
|
1855
|
-
|
|
1930
|
+
_ts_metadata15("design:returntype", Promise)
|
|
1856
1931
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1857
|
-
CopilotResolver =
|
|
1858
|
-
(0,
|
|
1932
|
+
CopilotResolver = _ts_decorate15([
|
|
1933
|
+
(0, import_type_graphql16.Resolver)(() => CopilotResponse)
|
|
1859
1934
|
], CopilotResolver);
|
|
1860
1935
|
|
|
1861
1936
|
// src/lib/integrations/shared.ts
|
|
@@ -1910,7 +1985,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
1910
1985
|
__name(createContext, "createContext");
|
|
1911
1986
|
function buildSchema(options = {}) {
|
|
1912
1987
|
logger.debug("Building GraphQL schema...");
|
|
1913
|
-
const schema = (0,
|
|
1988
|
+
const schema = (0, import_type_graphql17.buildSchemaSync)({
|
|
1914
1989
|
resolvers: [
|
|
1915
1990
|
CopilotResolver
|
|
1916
1991
|
],
|