@redocly/replay 0.23.0-next.1 → 0.23.0-next.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.
- package/dist/replay-index-BIn_L-wL.js +7088 -0
- package/dist/{replay-index-ChvV5L2N.js → replay-index-BZey8T6L.js} +43974 -36674
- package/dist/replay-index-BiGbduSF.js +43 -0
- package/dist/replay-index-D0afgYe2.js +1 -0
- package/dist/replay-respect-run-DA0kXc2x.js +81 -0
- package/dist/{replay-respect-run-COl6B6SF.js → replay-respect-run-naS5LaxK.js} +4140 -4848
- package/dist/{replay-tauri-path-aqQJB8US.js → replay-tauri-path--QWniCtD.js} +1 -1
- package/dist/{replay-tauri-path-B1UtU85M.js → replay-tauri-path-Ep0VMwdL.js} +4 -4
- package/dist/replay.cjs +1 -1
- package/dist/replay.d.ts +173 -38
- package/dist/replay.js +1 -1
- package/package.json +6 -5
- package/dist/replay-index-BRzRPq_g.js +0 -1
- package/dist/replay-index-EqalpLsI.js +0 -6846
- package/dist/replay-index-rmmlneys.js +0 -7
- package/dist/replay-respect-run-DEcYG1NI.js +0 -84
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BIn_L-wL.js");async function u(r,n){const t=e.sep(),l=await e.resolve(r),c=await e.resolve(n),a=l.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),i=c.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),m=Math.min(a.length,i.length);let s=0;for(let o=0;o<m&&a[o]===i[o];o++)s++;const p=a.slice(s).map(()=>".."),f=i.slice(s);return[...p,...f].join(t)}async function g(r){const n=await e.extname(r);return n?`.${n}`:""}exports.dirname=e.dirname;exports.isAbsolute=e.isAbsolute;exports.join=e.join;exports.resolve=e.resolve;exports.extname=g;exports.relative=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as j, a as b, j as d } from "./replay-index-
|
|
1
|
+
import { e as h, s as x, r as i } from "./replay-index-BZey8T6L.js";
|
|
2
|
+
import { d as j, a as b, j as d } from "./replay-index-BZey8T6L.js";
|
|
3
3
|
async function u(n, e) {
|
|
4
|
-
const t =
|
|
4
|
+
const t = x(), l = await i(n), c = await i(e), o = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), r = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, r.length);
|
|
5
5
|
let s = 0;
|
|
6
6
|
for (let a = 0; a < m && o[a] === r[a]; a++)
|
|
7
7
|
s++;
|
|
@@ -9,7 +9,7 @@ async function u(n, e) {
|
|
|
9
9
|
return [...p, ...f].join(t);
|
|
10
10
|
}
|
|
11
11
|
async function w(n) {
|
|
12
|
-
const e = await
|
|
12
|
+
const e = await h(n);
|
|
13
13
|
return e ? `.${e}` : "";
|
|
14
14
|
}
|
|
15
15
|
export {
|
package/dist/replay.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BIn_L-wL.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AgentLoop=e.AgentLoop;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.Replay=e.Replay;exports.ReplayOverlay=e.ReplayOverlay;Object.defineProperty(exports,"SpanStatusCode",{enumerable:!0,get:()=>e.SpanStatusCode});exports.TelemetryClient=e.TelemetryClient;exports.applyThemeToDOM=e.applyThemeToDOM;exports.getCurrentTheme=e.getCurrentTheme;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
|
package/dist/replay.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AgentCallParameters } from 'ai';
|
|
2
1
|
import { AsyncApiReplay } from '@redocly/replay-asyncapi-sdk';
|
|
3
2
|
import { Context } from 'react';
|
|
4
|
-
import { GenerateTextResult } from 'ai';
|
|
5
3
|
import { ImmutableObject } from '@redocly/hookstate-core';
|
|
4
|
+
import { InferToolInput } from 'ai';
|
|
5
|
+
import { InferToolOutput } from 'ai';
|
|
6
6
|
import { JSX } from 'react/jsx-runtime';
|
|
7
7
|
import { NamedExoticComponent } from 'react';
|
|
8
8
|
import { ReactElement } from 'react';
|
|
9
9
|
import { SpanStatusCode } from '@opentelemetry/api';
|
|
10
|
-
import { StreamTextResult } from 'ai';
|
|
11
10
|
import { SystemModelMessage } from 'ai';
|
|
12
11
|
import { Context as TelemetryContext } from '@opentelemetry/api';
|
|
13
12
|
import { Tool } from 'ai';
|
|
13
|
+
import { ToolLoopAgent } from 'ai';
|
|
14
14
|
import { ToolLoopAgentOnFinishCallback } from 'ai';
|
|
15
15
|
import { ToolLoopAgentOnStepFinishCallback } from 'ai';
|
|
16
16
|
import { ToolLoopAgentSettings } from 'ai';
|
|
@@ -19,20 +19,23 @@ export declare class AgentLoop {
|
|
|
19
19
|
private readonly toolLoopAgent;
|
|
20
20
|
private readonly maxHistoryMessages;
|
|
21
21
|
private readonly maxHistoryChars;
|
|
22
|
+
private readonly context;
|
|
23
|
+
private readonly systemInstructions;
|
|
24
|
+
private tools;
|
|
22
25
|
constructor(config: AgentRuntimeConfig);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
getAgent(): ToolLoopAgent<never, ReplayToolSet, never>;
|
|
27
|
+
addContext(context: SystemModelMessage[]): void;
|
|
28
|
+
registerTools(tools: ReplayToolSet): void;
|
|
29
|
+
private prepareMessages;
|
|
30
|
+
private preparePrompt;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
declare type AgentLoopMethodParameters = AgentCallParameters<never, ReplayToolSet>;
|
|
29
|
-
|
|
30
33
|
declare type AgentRuntimeConfig = {
|
|
31
34
|
model: Model;
|
|
32
|
-
|
|
35
|
+
tools: ReplayToolSet;
|
|
33
36
|
maxSteps?: number;
|
|
34
|
-
maxOutputTokens?:
|
|
35
|
-
maxRetries?:
|
|
37
|
+
maxOutputTokens?: ToolLoopAgentConfig['maxOutputTokens'];
|
|
38
|
+
maxRetries?: ToolLoopAgentConfig['maxRetries'];
|
|
36
39
|
onStepFinish?: ToolLoopAgentOnStepFinishCallback<ReplayToolSet>;
|
|
37
40
|
onFinish?: ToolLoopAgentOnFinishCallback<ReplayToolSet>;
|
|
38
41
|
maxHistoryMessages?: number;
|
|
@@ -97,6 +100,142 @@ declare type ClientCredentialsOAuthFlowsObject = {
|
|
|
97
100
|
|
|
98
101
|
declare type ConvertOperationFunction = (path: string, method: string, openAPI: any) => OpenAPIOperation_2 | undefined;
|
|
99
102
|
|
|
103
|
+
declare const definitions: {
|
|
104
|
+
open_tab: Tool< {
|
|
105
|
+
action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run";
|
|
106
|
+
tabIndex?: number | undefined;
|
|
107
|
+
collectionId?: string | undefined;
|
|
108
|
+
workflowId?: string | undefined;
|
|
109
|
+
stepId?: string | undefined;
|
|
110
|
+
operationId?: string | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
error: {
|
|
113
|
+
message: string;
|
|
114
|
+
details?: unknown;
|
|
115
|
+
};
|
|
116
|
+
isError: true;
|
|
117
|
+
data?: undefined;
|
|
118
|
+
} | {
|
|
119
|
+
data: {
|
|
120
|
+
tabId: string;
|
|
121
|
+
outcome: "focused" | "opened";
|
|
122
|
+
activeTabIndex: number;
|
|
123
|
+
tabType: TabDataType;
|
|
124
|
+
};
|
|
125
|
+
isError: false;
|
|
126
|
+
error?: undefined;
|
|
127
|
+
}>;
|
|
128
|
+
run_request: Tool< {
|
|
129
|
+
collectionId: string;
|
|
130
|
+
workflowId: string;
|
|
131
|
+
stepId: string;
|
|
132
|
+
}, {
|
|
133
|
+
error: {
|
|
134
|
+
message: string;
|
|
135
|
+
details?: unknown;
|
|
136
|
+
};
|
|
137
|
+
isError: true;
|
|
138
|
+
data?: undefined;
|
|
139
|
+
} | {
|
|
140
|
+
data: {
|
|
141
|
+
body?: string | undefined;
|
|
142
|
+
url?: string | undefined;
|
|
143
|
+
status?: number | undefined;
|
|
144
|
+
size?: number | undefined;
|
|
145
|
+
headers?: [string, string][] | undefined;
|
|
146
|
+
cookies?: [string, string][] | undefined;
|
|
147
|
+
duration?: number | undefined;
|
|
148
|
+
};
|
|
149
|
+
isError: false;
|
|
150
|
+
error?: undefined;
|
|
151
|
+
}>;
|
|
152
|
+
get_current_tab: Tool< {
|
|
153
|
+
sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "response" | "severity")[];
|
|
154
|
+
}, {
|
|
155
|
+
error: {
|
|
156
|
+
message: string;
|
|
157
|
+
details?: unknown;
|
|
158
|
+
};
|
|
159
|
+
isError: true;
|
|
160
|
+
data?: undefined;
|
|
161
|
+
} | {
|
|
162
|
+
data: {
|
|
163
|
+
message: string;
|
|
164
|
+
};
|
|
165
|
+
isError: false;
|
|
166
|
+
error?: undefined;
|
|
167
|
+
}>;
|
|
168
|
+
search: Tool< {
|
|
169
|
+
path?: string | undefined;
|
|
170
|
+
type?: "workflow" | "collection" | "step" | "api" | "api_operation" | undefined;
|
|
171
|
+
method?: string | undefined;
|
|
172
|
+
collectionId?: string | undefined;
|
|
173
|
+
workflowId?: string | undefined;
|
|
174
|
+
stepId?: string | undefined;
|
|
175
|
+
apiId?: string | undefined;
|
|
176
|
+
operationId?: string | undefined;
|
|
177
|
+
query?: string | undefined;
|
|
178
|
+
}, unknown>;
|
|
179
|
+
update_step: Tool< {
|
|
180
|
+
collectionId: string;
|
|
181
|
+
workflowId: string;
|
|
182
|
+
stepId: string;
|
|
183
|
+
body?: {
|
|
184
|
+
content: string;
|
|
185
|
+
contentType?: string | undefined;
|
|
186
|
+
} | undefined;
|
|
187
|
+
security?: ({
|
|
188
|
+
values: Record<string, unknown>;
|
|
189
|
+
schemeName: string;
|
|
190
|
+
} | {
|
|
191
|
+
values: Record<string, unknown>;
|
|
192
|
+
scheme: {
|
|
193
|
+
type: "http";
|
|
194
|
+
scheme: "basic" | "digest" | "bearer";
|
|
195
|
+
bearerFormat?: string | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
type: "apiKey";
|
|
198
|
+
name: string;
|
|
199
|
+
in: "header" | "query" | "cookie";
|
|
200
|
+
} | {
|
|
201
|
+
type: "oauth2";
|
|
202
|
+
flows: Record<string, unknown>;
|
|
203
|
+
} | {
|
|
204
|
+
type: "openIdConnect";
|
|
205
|
+
flows?: Record<string, unknown> | undefined;
|
|
206
|
+
openIdConnectUrl?: string | undefined;
|
|
207
|
+
};
|
|
208
|
+
})[] | undefined;
|
|
209
|
+
description?: string | undefined;
|
|
210
|
+
url?: string | undefined;
|
|
211
|
+
method?: string | undefined;
|
|
212
|
+
parameters?: {
|
|
213
|
+
name: string;
|
|
214
|
+
in: "header" | "path" | "query" | "cookie";
|
|
215
|
+
value: string;
|
|
216
|
+
}[] | undefined;
|
|
217
|
+
outputs?: Record<string, string> | undefined;
|
|
218
|
+
successCriteria?: {
|
|
219
|
+
condition: string;
|
|
220
|
+
type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
|
|
221
|
+
context?: string | undefined;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
error: {
|
|
225
|
+
message: string;
|
|
226
|
+
details?: unknown;
|
|
227
|
+
};
|
|
228
|
+
isError: true;
|
|
229
|
+
data?: undefined;
|
|
230
|
+
} | {
|
|
231
|
+
data: {
|
|
232
|
+
changedFields: string[];
|
|
233
|
+
};
|
|
234
|
+
isError: false;
|
|
235
|
+
error?: undefined;
|
|
236
|
+
}>;
|
|
237
|
+
};
|
|
238
|
+
|
|
100
239
|
export declare function EmbeddedReplay(props: ReplayAppProps): JSX.Element;
|
|
101
240
|
|
|
102
241
|
declare type EndpointModel = {
|
|
@@ -126,6 +265,7 @@ declare type ImplicitOAuthFlowsObject = {
|
|
|
126
265
|
|
|
127
266
|
declare type InputSettings = {
|
|
128
267
|
corsProxyUrl?: string;
|
|
268
|
+
credentialOrigin?: string;
|
|
129
269
|
disableCollectionsTab?: boolean;
|
|
130
270
|
disableDraft?: boolean;
|
|
131
271
|
oAuth2RedirectURI?: string | null;
|
|
@@ -692,24 +832,6 @@ declare type Referenced<T> = T | OpenAPIRef;
|
|
|
692
832
|
|
|
693
833
|
export declare function Replay(props: ReplayAppProps): JSX.Element;
|
|
694
834
|
|
|
695
|
-
declare const REPLAY_TOOLS: {
|
|
696
|
-
readonly search: Tool<{
|
|
697
|
-
query: string;
|
|
698
|
-
}, ToolExecutionResult< {
|
|
699
|
-
message: string;
|
|
700
|
-
}>>;
|
|
701
|
-
readonly open_tab: Tool<{
|
|
702
|
-
operationId: string;
|
|
703
|
-
}, ToolExecutionResult< {
|
|
704
|
-
operationId: string;
|
|
705
|
-
}>>;
|
|
706
|
-
readonly run_request: Tool<{
|
|
707
|
-
operationId: string;
|
|
708
|
-
}, ToolExecutionResult< {
|
|
709
|
-
operationId: string;
|
|
710
|
-
}>>;
|
|
711
|
-
};
|
|
712
|
-
|
|
713
835
|
declare type ReplayAppProps = {
|
|
714
836
|
activeOperationId?: string;
|
|
715
837
|
activeOperationPointer?: string;
|
|
@@ -737,9 +859,21 @@ declare type ReplayOverlayProps = {
|
|
|
737
859
|
onRequestChange?: (props: ReplayOnChangeParams) => void;
|
|
738
860
|
} & ReplayAppProps;
|
|
739
861
|
|
|
740
|
-
declare type ReplayToolNames =
|
|
862
|
+
declare type ReplayTool<T extends ReplayToolNames> = Tool<ReplayToolInput<T>, ReplayToolOutput<T>>;
|
|
741
863
|
|
|
742
|
-
declare type
|
|
864
|
+
declare type ReplayToolDefinition<T extends ReplayToolNames> = ReplayToolDefinitions[T];
|
|
865
|
+
|
|
866
|
+
declare type ReplayToolDefinitions = typeof definitions;
|
|
867
|
+
|
|
868
|
+
declare type ReplayToolInput<T extends ReplayToolNames> = InferToolInput<ReplayToolDefinition<T>>;
|
|
869
|
+
|
|
870
|
+
declare type ReplayToolNames = keyof ReplayToolDefinitions;
|
|
871
|
+
|
|
872
|
+
declare type ReplayToolOutput<T extends ReplayToolNames> = InferToolOutput<ReplayToolDefinition<T>>;
|
|
873
|
+
|
|
874
|
+
declare type ReplayToolSet = {
|
|
875
|
+
[K in ReplayToolNames]: ReplayTool<K>;
|
|
876
|
+
};
|
|
743
877
|
|
|
744
878
|
export declare type ResolvedTheme = 'light' | 'dark';
|
|
745
879
|
|
|
@@ -785,6 +919,13 @@ declare type ServerVariable = {
|
|
|
785
919
|
|
|
786
920
|
export { SpanStatusCode }
|
|
787
921
|
|
|
922
|
+
declare enum TabDataType {
|
|
923
|
+
Workflow = "workflow",
|
|
924
|
+
WorkflowRun = "workflowRun",
|
|
925
|
+
Collection = "collection",
|
|
926
|
+
Step = "step"
|
|
927
|
+
}
|
|
928
|
+
|
|
788
929
|
export declare class TelemetryClient {
|
|
789
930
|
private _client;
|
|
790
931
|
private _isInitialized;
|
|
@@ -828,13 +969,7 @@ export declare type TelemetryMethods = {
|
|
|
828
969
|
|
|
829
970
|
export declare type Theme = 'light' | 'dark' | 'auto';
|
|
830
971
|
|
|
831
|
-
declare type
|
|
832
|
-
status: ToolExecutionStatus;
|
|
833
|
-
data?: TData;
|
|
834
|
-
error?: string;
|
|
835
|
-
};
|
|
836
|
-
|
|
837
|
-
declare type ToolExecutionStatus = 'success' | 'error' | 'not_implemented';
|
|
972
|
+
declare type ToolLoopAgentConfig = ToolLoopAgentSettings<never, ReplayToolSet, never>;
|
|
838
973
|
|
|
839
974
|
declare type TracerName = 'try-it' | 'replay-openapi' | 'desktop' | 'reunite-tab';
|
|
840
975
|
|
package/dist/replay.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as s, x as t, E as l, M as r, R as o, y as m, S as n, T as p, z as y, C as T, D as d, F as h, G as u, H as C } from "./replay-index-BZey8T6L.js";
|
|
2
2
|
import { O as A, h as O } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
|
|
3
3
|
export {
|
|
4
4
|
s as AgentLoop,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/replay",
|
|
3
|
-
"version": "0.23.0-next.
|
|
3
|
+
"version": "0.23.0-next.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/replay.cjs",
|
|
6
6
|
"module": "./dist/replay.js",
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"react-dom": "^19.2.4",
|
|
21
21
|
"react-router-dom": "^6.30.3",
|
|
22
22
|
"styled-components": "^5.3.11",
|
|
23
|
-
"@redocly/theme": "0.64.0-next.
|
|
23
|
+
"@redocly/theme": "0.64.0-next.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@ai-sdk/google": "3.0.1",
|
|
27
27
|
"@ai-sdk/provider": "3.0.0",
|
|
28
|
+
"@ai-sdk/react": "3.0.118",
|
|
28
29
|
"@codemirror/autocomplete": "^6.15.0",
|
|
29
30
|
"@codemirror/lang-html": "^6.4.7",
|
|
30
31
|
"@codemirror/lang-java": "^6.0.2",
|
|
@@ -47,8 +48,8 @@
|
|
|
47
48
|
"@opentelemetry/api": "1.9.0",
|
|
48
49
|
"@redocly/hookstate-core": "^4.2.1",
|
|
49
50
|
"@redocly/hookstate-devtools": "^4.2.0",
|
|
50
|
-
"@redocly/openapi-core": "2.
|
|
51
|
-
"@redocly/respect-core": "2.
|
|
51
|
+
"@redocly/openapi-core": "2.25.2",
|
|
52
|
+
"@redocly/respect-core": "2.25.2",
|
|
52
53
|
"@redocly/vscode-json-languageservice": "^3.4.9",
|
|
53
54
|
"@tauri-apps/api": "2.4.1",
|
|
54
55
|
"@tauri-apps/plugin-dialog": "2.0.0-rc.1",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"ai": "6.0.111",
|
|
60
61
|
"dayjs": "^1.11.7",
|
|
61
62
|
"drizzle-orm": "^0.36.4",
|
|
62
|
-
"fast-xml-parser": "5.
|
|
63
|
+
"fast-xml-parser": "5.5.9",
|
|
63
64
|
"idb": "^8.0.2",
|
|
64
65
|
"js-yaml": "4.1.1",
|
|
65
66
|
"json-pointer": "^0.6.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./replay-index-EqalpLsI.js");async function n(e={}){return typeof e=="object"&&Object.freeze(e),await t.invoke("plugin:dialog|open",{options:e})}exports.open=n;
|