@copilotkit/runtime 1.9.2-next.2 → 1.9.2-next.21
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 +136 -0
- package/dist/{chunk-CD2SZGIZ.mjs → chunk-47L6Z7PJ.mjs} +2 -2
- package/dist/chunk-AMUJQ6IR.mjs +50 -0
- package/dist/chunk-AMUJQ6IR.mjs.map +1 -0
- package/dist/{chunk-DOWRU5U6.mjs → chunk-IBYPYIVX.mjs} +2353 -1854
- package/dist/chunk-IBYPYIVX.mjs.map +1 -0
- package/dist/{chunk-D3SPXEVJ.mjs → chunk-IXK4UOV6.mjs} +2 -2
- package/dist/{chunk-6TQCQ3WJ.mjs → chunk-P3HORCYJ.mjs} +2 -2
- package/dist/{chunk-IIXJVVTV.mjs → chunk-QLLV2QVK.mjs} +132 -78
- package/dist/chunk-QLLV2QVK.mjs.map +1 -0
- package/dist/{chunk-ODF35LFG.mjs → chunk-UPC6N4MV.mjs} +19 -2
- package/dist/chunk-UPC6N4MV.mjs.map +1 -0
- package/dist/{chunk-5BIEM2UU.mjs → chunk-XWBDEXDA.mjs} +4 -3
- package/dist/{chunk-5BIEM2UU.mjs.map → chunk-XWBDEXDA.mjs.map} +1 -1
- package/dist/{groq-adapter-25a2bd35.d.ts → groq-adapter-098f97f6.d.ts} +5 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3728 -3114
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +5 -4
- package/dist/lib/index.js +2711 -2140
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +9 -8
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +160 -96
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +7 -6
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +160 -96
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +5 -4
- package/dist/lib/integrations/node-express/index.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +160 -96
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +5 -4
- package/dist/lib/integrations/node-http/index.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +160 -96
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +4 -3
- package/dist/service-adapters/index.d.ts +6 -4
- package/dist/service-adapters/index.js +202 -107
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +6 -2
- package/dist/service-adapters/shared/index.d.ts +9 -0
- package/dist/service-adapters/shared/index.js +72 -0
- package/dist/service-adapters/shared/index.js.map +1 -0
- package/dist/service-adapters/shared/index.mjs +8 -0
- package/dist/service-adapters/shared/index.mjs.map +1 -0
- package/dist/{shared-e272b15a.d.ts → shared-41d4988d.d.ts} +45 -5
- package/dist/utils/index.d.ts +17 -1
- package/dist/utils/index.js +3 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +2 -2
- package/src/agents/langgraph/event-source.ts +36 -38
- package/src/agents/langgraph/events.ts +19 -1
- package/src/graphql/resolvers/copilot.resolver.ts +107 -45
- package/src/graphql/resolvers/state.resolver.ts +3 -3
- package/src/lib/error-messages.ts +200 -0
- package/src/lib/integrations/shared.ts +43 -0
- package/src/lib/runtime/__tests__/copilot-runtime-error.test.ts +169 -0
- package/src/lib/runtime/agui-action.ts +9 -3
- package/src/lib/runtime/copilot-runtime.ts +384 -83
- package/src/lib/runtime/langgraph/langgraph-agent.ts +12 -0
- package/src/lib/runtime/remote-action-constructors.ts +28 -3
- package/src/lib/runtime/remote-actions.ts +6 -0
- package/src/lib/runtime/remote-lg-action.ts +130 -40
- package/src/lib/streaming.ts +125 -36
- package/src/service-adapters/anthropic/anthropic-adapter.ts +67 -8
- package/src/service-adapters/anthropic/utils.ts +3 -8
- package/src/service-adapters/events.ts +37 -81
- package/src/service-adapters/google/google-genai-adapter.ts +5 -0
- package/src/service-adapters/groq/groq-adapter.ts +66 -56
- package/src/service-adapters/index.ts +1 -0
- package/src/service-adapters/openai/openai-adapter.ts +4 -3
- package/src/service-adapters/shared/error-utils.ts +61 -0
- package/src/service-adapters/shared/index.ts +1 -0
- package/src/utils/failed-response-status-reasons.ts +23 -1
- package/tests/service-adapters/anthropic/anthropic-adapter.test.ts +172 -387
- package/dist/chunk-DOWRU5U6.mjs.map +0 -1
- package/dist/chunk-IIXJVVTV.mjs.map +0 -1
- package/dist/chunk-ODF35LFG.mjs.map +0 -1
- package/dist/{chunk-CD2SZGIZ.mjs.map → chunk-47L6Z7PJ.mjs.map} +0 -0
- package/dist/{chunk-D3SPXEVJ.mjs.map → chunk-IXK4UOV6.mjs.map} +0 -0
- package/dist/{chunk-6TQCQ3WJ.mjs.map → chunk-P3HORCYJ.mjs.map} +0 -0
- package/dist/{langserve-4a5c9217.d.ts → langserve-fc5cac89.d.ts} +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,141 @@
|
|
|
1
1
|
# @copilotkit/runtime
|
|
2
2
|
|
|
3
|
+
## 1.9.2-next.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @copilotkit/shared@1.9.2-next.21
|
|
8
|
+
|
|
9
|
+
## 1.9.2-next.20
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @copilotkit/shared@1.9.2-next.20
|
|
14
|
+
|
|
15
|
+
## 1.9.2-next.19
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 8e67158: - fixes gemini adapter
|
|
20
|
+
- @copilotkit/shared@1.9.2-next.19
|
|
21
|
+
|
|
22
|
+
## 1.9.2-next.18
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- fac89c2: - refactor: rename onTrace to onError throughout codebase
|
|
27
|
+
|
|
28
|
+
- Rename CopilotTraceEvent to CopilotErrorEvent and CopilotTraceHandler to CopilotErrorHandler
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [fac89c2]
|
|
31
|
+
- @copilotkit/shared@1.9.2-next.18
|
|
32
|
+
|
|
33
|
+
## 1.9.2-next.17
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 7ca7023: - feat: send node name to agui agent
|
|
38
|
+
- @copilotkit/shared@1.9.2-next.17
|
|
39
|
+
|
|
40
|
+
## 1.9.2-next.16
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- fe9009c: - feat(langgraph): new thread metadata
|
|
45
|
+
- @copilotkit/shared@1.9.2-next.16
|
|
46
|
+
|
|
47
|
+
## 1.9.2-next.15
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- @copilotkit/shared@1.9.2-next.15
|
|
52
|
+
|
|
53
|
+
## 1.9.2-next.14
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- 3a7f45f: - fix: resolve agui agents only after all other endpoints
|
|
58
|
+
- @copilotkit/shared@1.9.2-next.14
|
|
59
|
+
|
|
60
|
+
## 1.9.2-next.13
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- dec5527: - fix: only fetch agent state for langgraph agents
|
|
65
|
+
- @copilotkit/shared@1.9.2-next.13
|
|
66
|
+
|
|
67
|
+
## 1.9.2-next.12
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- @copilotkit/shared@1.9.2-next.12
|
|
72
|
+
|
|
73
|
+
## 1.9.2-next.11
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- 1f4949a: - fix: remove agent discovery for agui agents
|
|
78
|
+
- @copilotkit/shared@1.9.2-next.11
|
|
79
|
+
|
|
80
|
+
## 1.9.2-next.10
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- 20e8c3c: - fix(anthropic-adapter): resolve infinite loop caused by duplicate result messages
|
|
85
|
+
- @copilotkit/shared@1.9.2-next.10
|
|
86
|
+
|
|
87
|
+
## 1.9.2-next.9
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- 1d1c51d: - feat: surface all errors in structured format
|
|
92
|
+
- Updated dependencies [1d1c51d]
|
|
93
|
+
- @copilotkit/shared@1.9.2-next.9
|
|
94
|
+
|
|
95
|
+
## 1.9.2-next.8
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- 9b986ba: - fix: use active interrupt from thread instead of saving to global state
|
|
100
|
+
- @copilotkit/shared@1.9.2-next.8
|
|
101
|
+
|
|
102
|
+
## 1.9.2-next.7
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 54b62f0: - fix: add default schema keys for input and output of agui langgraph
|
|
107
|
+
- @copilotkit/shared@1.9.2-next.7
|
|
108
|
+
|
|
109
|
+
## 1.9.2-next.6
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- 4fd92d1: - fix: enable resolving of langgraph agents when cpk starts
|
|
114
|
+
- @copilotkit/shared@1.9.2-next.6
|
|
115
|
+
|
|
116
|
+
## 1.9.2-next.5
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- @copilotkit/shared@1.9.2-next.5
|
|
121
|
+
|
|
122
|
+
## 1.9.2-next.4
|
|
123
|
+
|
|
124
|
+
### Patch Changes
|
|
125
|
+
|
|
126
|
+
- 9169ad7: - feat: add onTrace handler for runtime and UI error/event tracking
|
|
127
|
+
- 9169ad7: - feat: add onTrace handler for comprehensive debugging and observability - Add CopilotTraceEvent interfaces with rich debugging context, implement runtime-side tracing with publicApiKey gating, add UI-side error tracing, include comprehensive test coverage, and fix tsup build config to exclude test files
|
|
128
|
+
- fix: extract publicApiKey for all requests + trace GraphQL errors
|
|
129
|
+
- Updated dependencies [9169ad7]
|
|
130
|
+
- Updated dependencies [9169ad7]
|
|
131
|
+
- @copilotkit/shared@1.9.2-next.4
|
|
132
|
+
|
|
133
|
+
## 1.9.2-next.3
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- @copilotkit/shared@1.9.2-next.3
|
|
138
|
+
|
|
3
139
|
## 1.9.2-next.2
|
|
4
140
|
|
|
5
141
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IBYPYIVX.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-47L6Z7PJ.mjs.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-FHD4JECV.mjs";
|
|
4
|
+
|
|
5
|
+
// src/service-adapters/shared/error-utils.ts
|
|
6
|
+
import { CopilotKitLowLevelError, CopilotKitErrorCode } from "@copilotkit/shared";
|
|
7
|
+
function convertServiceAdapterError(error, adapterName) {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
const errorName = ((_a = error == null ? void 0 : error.constructor) == null ? void 0 : _a.name) || error.name;
|
|
10
|
+
const errorMessage = (error == null ? void 0 : error.message) || String(error);
|
|
11
|
+
const statusCode = error.status || error.statusCode || ((_b = error.response) == null ? void 0 : _b.status);
|
|
12
|
+
const responseData = error.error || ((_c = error.response) == null ? void 0 : _c.data) || error.data;
|
|
13
|
+
const structuredError = new CopilotKitLowLevelError({
|
|
14
|
+
error: error instanceof Error ? error : new Error(errorMessage),
|
|
15
|
+
url: `${adapterName} service adapter`,
|
|
16
|
+
message: `${adapterName} API error: ${errorMessage}`
|
|
17
|
+
});
|
|
18
|
+
if (statusCode) {
|
|
19
|
+
structuredError.statusCode = statusCode;
|
|
20
|
+
}
|
|
21
|
+
if (responseData) {
|
|
22
|
+
structuredError.responseData = responseData;
|
|
23
|
+
}
|
|
24
|
+
if (errorName) {
|
|
25
|
+
structuredError.originalErrorType = errorName;
|
|
26
|
+
}
|
|
27
|
+
let newCode;
|
|
28
|
+
if (statusCode === 401) {
|
|
29
|
+
newCode = CopilotKitErrorCode.AUTHENTICATION_ERROR;
|
|
30
|
+
} else if (statusCode >= 400 && statusCode < 500) {
|
|
31
|
+
newCode = CopilotKitErrorCode.CONFIGURATION_ERROR;
|
|
32
|
+
} else if (statusCode >= 500) {
|
|
33
|
+
newCode = CopilotKitErrorCode.NETWORK_ERROR;
|
|
34
|
+
} else if (statusCode) {
|
|
35
|
+
newCode = CopilotKitErrorCode.CONFIGURATION_ERROR;
|
|
36
|
+
} else {
|
|
37
|
+
newCode = CopilotKitErrorCode.NETWORK_ERROR;
|
|
38
|
+
}
|
|
39
|
+
structuredError.code = newCode;
|
|
40
|
+
if (structuredError.extensions) {
|
|
41
|
+
structuredError.extensions.code = newCode;
|
|
42
|
+
}
|
|
43
|
+
return structuredError;
|
|
44
|
+
}
|
|
45
|
+
__name(convertServiceAdapterError, "convertServiceAdapterError");
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
convertServiceAdapterError
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-AMUJQ6IR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/service-adapters/shared/error-utils.ts"],"sourcesContent":["import { CopilotKitLowLevelError, CopilotKitErrorCode } from \"@copilotkit/shared\";\n\n/**\n * Converts service adapter errors to structured CopilotKitError format using HTTP status codes.\n * This provides consistent error classification across all service adapters.\n */\nexport function convertServiceAdapterError(\n error: any,\n adapterName: string,\n): CopilotKitLowLevelError {\n const errorName = error?.constructor?.name || error.name;\n const errorMessage = error?.message || String(error);\n const statusCode = error.status || error.statusCode || error.response?.status;\n const responseData = error.error || error.response?.data || error.data;\n\n // Create the base error with the constructor signature\n const structuredError = new CopilotKitLowLevelError({\n error: error instanceof Error ? error : new Error(errorMessage),\n url: `${adapterName} service adapter`,\n message: `${adapterName} API error: ${errorMessage}`,\n });\n\n // Add additional properties after construction\n if (statusCode) {\n (structuredError as any).statusCode = statusCode;\n }\n if (responseData) {\n (structuredError as any).responseData = responseData;\n }\n if (errorName) {\n (structuredError as any).originalErrorType = errorName;\n }\n\n // Classify error based on HTTP status codes (reliable and provider-agnostic)\n let newCode: CopilotKitErrorCode;\n\n if (statusCode === 401) {\n // 401 = Authentication/API key issues\n newCode = CopilotKitErrorCode.AUTHENTICATION_ERROR;\n } else if (statusCode >= 400 && statusCode < 500) {\n // 4xx = Client errors (bad request, invalid params, etc.) - these are configuration issues\n newCode = CopilotKitErrorCode.CONFIGURATION_ERROR;\n } else if (statusCode >= 500) {\n // 5xx = Server errors - keep as NETWORK_ERROR since it's infrastructure related\n newCode = CopilotKitErrorCode.NETWORK_ERROR;\n } else if (statusCode) {\n // Any other HTTP status with an error - likely configuration\n newCode = CopilotKitErrorCode.CONFIGURATION_ERROR;\n } else {\n // No status code - likely a genuine network/connection error\n newCode = CopilotKitErrorCode.NETWORK_ERROR;\n }\n\n // Update both the instance property and the extensions\n (structuredError as any).code = newCode;\n if ((structuredError as any).extensions) {\n (structuredError as any).extensions.code = newCode;\n }\n\n return structuredError;\n}\n"],"mappings":";;;;;AAAA,SAASA,yBAAyBC,2BAA2B;AAMtD,SAASC,2BACdC,OACAC,aAAmB;AARrB;AAUE,QAAMC,cAAYF,oCAAOG,gBAAPH,mBAAoBI,SAAQJ,MAAMI;AACpD,QAAMC,gBAAeL,+BAAOM,YAAWC,OAAOP,KAAAA;AAC9C,QAAMQ,aAAaR,MAAMS,UAAUT,MAAMQ,gBAAcR,WAAMU,aAANV,mBAAgBS;AACvE,QAAME,eAAeX,MAAMA,WAASA,WAAMU,aAANV,mBAAgBY,SAAQZ,MAAMY;AAGlE,QAAMC,kBAAkB,IAAIC,wBAAwB;IAClDd,OAAOA,iBAAiBe,QAAQf,QAAQ,IAAIe,MAAMV,YAAAA;IAClDW,KAAK,GAAGf;IACRK,SAAS,GAAGL,0BAA0BI;EACxC,CAAA;AAGA,MAAIG,YAAY;AACbK,oBAAwBL,aAAaA;EACxC;AACA,MAAIG,cAAc;AACfE,oBAAwBF,eAAeA;EAC1C;AACA,MAAIT,WAAW;AACZW,oBAAwBI,oBAAoBf;EAC/C;AAGA,MAAIgB;AAEJ,MAAIV,eAAe,KAAK;AAEtBU,cAAUC,oBAAoBC;EAChC,WAAWZ,cAAc,OAAOA,aAAa,KAAK;AAEhDU,cAAUC,oBAAoBE;EAChC,WAAWb,cAAc,KAAK;AAE5BU,cAAUC,oBAAoBG;EAChC,WAAWd,YAAY;AAErBU,cAAUC,oBAAoBE;EAChC,OAAO;AAELH,cAAUC,oBAAoBG;EAChC;AAGCT,kBAAwBU,OAAOL;AAChC,MAAKL,gBAAwBW,YAAY;AACtCX,oBAAwBW,WAAWD,OAAOL;EAC7C;AAEA,SAAOL;AACT;AAtDgBd;","names":["CopilotKitLowLevelError","CopilotKitErrorCode","convertServiceAdapterError","error","adapterName","errorName","constructor","name","errorMessage","message","String","statusCode","status","response","responseData","data","structuredError","CopilotKitLowLevelError","Error","url","originalErrorType","newCode","CopilotKitErrorCode","AUTHENTICATION_ERROR","CONFIGURATION_ERROR","NETWORK_ERROR","code","extensions"]}
|