@redocly/replay 0.23.0 → 0.24.0-next.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.
@@ -1,5 +1,5 @@
1
- import { e as h, s as x, r as i } from "./replay-index-_k5xCRc7.js";
2
- import { d as j, a as b, j as d } from "./replay-index-_k5xCRc7.js";
1
+ import { e as h, s as x, r as i } from "./replay-index-DGOIXl2g.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-DGOIXl2g.js";
3
3
  async function u(n, e) {
4
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;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-D7BKht-m.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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-Dt0DBXvY.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;
package/dist/replay.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-D7BKht-m.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.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-Dt0DBXvY.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.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
package/dist/replay.d.ts CHANGED
@@ -16,15 +16,17 @@ import { ToolLoopAgentOnStepFinishCallback } from 'ai';
16
16
  import { ToolLoopAgentSettings } from 'ai';
17
17
 
18
18
  export declare class AgentLoop {
19
+ private model;
20
+ private tools;
19
21
  private readonly toolLoopAgent;
20
22
  private readonly maxHistoryMessages;
21
23
  private readonly maxHistoryChars;
22
24
  private readonly maxSteps;
23
25
  private readonly context;
24
26
  private readonly systemInstructions;
25
- private readonly model;
26
- private tools;
27
27
  constructor(config: AgentRuntimeConfig);
28
+ private createModel;
29
+ setModel(model: Model): void;
28
30
  getAgent(): ToolLoopAgent<never, ReplayToolSet, never>;
29
31
  addContext(context: SystemModelMessage[]): void;
30
32
  registerTools(tools: ReplayToolSet): void;
@@ -57,6 +59,11 @@ export declare type AiPanelContextValue = {
57
59
  closePanel: () => void;
58
60
  };
59
61
 
62
+ declare type AiProviderSettings = {
63
+ enabled: boolean;
64
+ apiKey?: string;
65
+ };
66
+
60
67
  declare type ApiPath = {
61
68
  path: string;
62
69
  method: string;
@@ -111,10 +118,10 @@ declare const definitions: {
111
118
  open_tab: Tool< {
112
119
  action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run" | "open_new_request";
113
120
  tabIndex?: number | undefined;
121
+ collectionId?: string | undefined;
114
122
  workflowId?: string | undefined;
115
123
  stepId?: string | undefined;
116
124
  operationId?: string | undefined;
117
- collectionId?: string | undefined;
118
125
  requestUrl?: string | undefined;
119
126
  requestMethod?: string | undefined;
120
127
  }, {
@@ -134,10 +141,26 @@ declare const definitions: {
134
141
  isError: false;
135
142
  error?: undefined;
136
143
  }>;
144
+ report_status: Tool< {
145
+ message: string;
146
+ }, {
147
+ error: {
148
+ message: string;
149
+ details?: unknown;
150
+ };
151
+ isError: true;
152
+ data?: undefined;
153
+ } | {
154
+ data: {
155
+ acknowledged: true;
156
+ };
157
+ isError: false;
158
+ error?: undefined;
159
+ }>;
137
160
  run_request: Tool< {
161
+ collectionId: string;
138
162
  workflowId: string;
139
163
  stepId: string;
140
- collectionId: string;
141
164
  }, {
142
165
  error: {
143
166
  message: string;
@@ -159,7 +182,7 @@ declare const definitions: {
159
182
  error?: undefined;
160
183
  }>;
161
184
  get_current_tab: Tool< {
162
- sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "severity" | "response")[];
185
+ sections: ("security" | "result" | "response" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "parameters" | "outputs" | "steps" | "requestBody" | "successCriteria" | "severity")[];
163
186
  }, {
164
187
  error: {
165
188
  message: string;
@@ -176,19 +199,19 @@ declare const definitions: {
176
199
  }>;
177
200
  search: Tool< {
178
201
  path?: string | undefined;
179
- type?: "workflow" | "collection" | "step" | "api" | "api_operation" | undefined;
202
+ type?: "workflow" | "collection" | "api" | "step" | "api_operation" | undefined;
180
203
  method?: string | undefined;
181
- query?: string | undefined;
182
- apiId?: string | undefined;
204
+ collectionId?: string | undefined;
183
205
  workflowId?: string | undefined;
184
206
  stepId?: string | undefined;
207
+ query?: string | undefined;
208
+ apiId?: string | undefined;
185
209
  operationId?: string | undefined;
186
- collectionId?: string | undefined;
187
210
  }, unknown>;
188
211
  update_security: Tool< {
212
+ collectionId: string;
189
213
  workflowId: string;
190
214
  stepId: string;
191
- collectionId: string;
192
215
  changes: ({
193
216
  type: import("../../../../types/security").SecurityTypes.BasicAuth;
194
217
  action: "add" | "update";
@@ -238,7 +261,7 @@ declare const definitions: {
238
261
  username?: string | undefined;
239
262
  clientId?: string | undefined;
240
263
  clientSecret?: string | undefined;
241
- grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
264
+ grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
242
265
  tokenUrl?: string | undefined;
243
266
  accessToken?: string | undefined;
244
267
  authorizationUrl?: string | undefined;
@@ -256,12 +279,12 @@ declare const definitions: {
256
279
  clientId?: string | undefined;
257
280
  clientSecret?: string | undefined;
258
281
  openIdConnectUrl?: string | undefined;
259
- grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
282
+ grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
283
+ userInfoUrl?: string | undefined;
260
284
  tokenUrl?: string | undefined;
261
285
  accessToken?: string | undefined;
262
286
  authorizationUrl?: string | undefined;
263
287
  callbackUrl?: string | undefined;
264
- userInfoUrl?: string | undefined;
265
288
  } | undefined;
266
289
  index?: number | undefined;
267
290
  schemeId?: string | undefined;
@@ -279,37 +302,42 @@ declare const definitions: {
279
302
  data?: undefined;
280
303
  } | {
281
304
  data: {
282
- changedCount: number;
305
+ applied: {
306
+ status: "failed" | "applied";
307
+ summary?: string | undefined;
308
+ }[];
309
+ totalChanges: number;
310
+ approvedChanges: number;
283
311
  };
284
312
  isError: false;
285
313
  error?: undefined;
286
314
  }>;
287
315
  update_step: Tool< {
316
+ collectionId: string;
288
317
  workflowId: string;
289
318
  stepId: string;
290
- collectionId: string;
291
319
  changes: ({
292
320
  data: string;
293
- field: "url";
294
321
  action: "add" | "remove" | "update";
295
322
  approved: boolean;
323
+ field: "url";
296
324
  id?: string | undefined;
297
325
  } | {
298
326
  data: string;
299
- field: "description";
300
327
  action: "add" | "remove" | "update";
301
328
  approved: boolean;
329
+ field: "description";
302
330
  id?: string | undefined;
303
331
  } | {
304
332
  data: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
305
- field: "method";
306
333
  action: "add" | "remove" | "update";
307
334
  approved: boolean;
335
+ field: "method";
308
336
  id?: string | undefined;
309
337
  } | {
310
- field: "parameters";
311
338
  action: "add" | "remove" | "update";
312
339
  approved: boolean;
340
+ field: "parameters";
313
341
  data?: {
314
342
  name: string;
315
343
  in: "header" | "path" | "query" | "cookie";
@@ -317,21 +345,21 @@ declare const definitions: {
317
345
  } | undefined;
318
346
  id?: string | undefined;
319
347
  } | {
320
- field: "outputs";
321
348
  action: "add" | "remove" | "update";
322
349
  approved: boolean;
350
+ field: "outputs";
323
351
  data?: {
324
352
  name: string;
325
353
  expression: string;
326
354
  } | undefined;
327
355
  id?: string | undefined;
328
356
  } | {
329
- field: "successCriteria";
330
357
  action: "add" | "remove" | "update";
331
358
  approved: boolean;
359
+ field: "successCriteria";
332
360
  data?: {
333
361
  condition: string;
334
- type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
362
+ type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
335
363
  context?: string | undefined;
336
364
  } | undefined;
337
365
  id?: string | undefined;
@@ -340,9 +368,9 @@ declare const definitions: {
340
368
  content: string;
341
369
  contentType?: string | undefined;
342
370
  };
343
- field: "body";
344
371
  action: "add" | "remove" | "update";
345
372
  approved: boolean;
373
+ field: "body";
346
374
  id?: string | undefined;
347
375
  })[];
348
376
  }, {
@@ -354,12 +382,18 @@ declare const definitions: {
354
382
  data?: undefined;
355
383
  } | {
356
384
  data: {
357
- changedFields: string[];
385
+ applied: {
386
+ status: "failed" | "applied";
387
+ summary?: string | undefined;
388
+ }[];
389
+ totalChanges: number;
390
+ approvedChanges: number;
358
391
  };
359
392
  isError: false;
360
393
  error?: undefined;
361
394
  }>;
362
395
  manage_collection: Tool< {
396
+ payload: {
363
397
  title: string;
364
398
  action: "create_collection";
365
399
  } | {
@@ -370,13 +404,33 @@ declare const definitions: {
370
404
  collectionId: string;
371
405
  action: "create_workflow";
372
406
  } | {
373
- workflowId: string;
374
407
  collectionId: string;
408
+ workflowId: string;
375
409
  action: "delete_workflow";
376
410
  } | {
377
- workflowId: string;
378
411
  collectionId: string;
412
+ workflowId: string;
379
413
  action: "create_step";
414
+ body?: {
415
+ content: string;
416
+ contentType?: string | undefined;
417
+ } | undefined;
418
+ description?: string | undefined;
419
+ parameters?: {
420
+ name: string;
421
+ in: "header" | "path" | "query" | "cookie";
422
+ value: string;
423
+ }[] | undefined;
424
+ outputs?: {
425
+ name: string;
426
+ expression: string;
427
+ }[] | undefined;
428
+ successCriteria?: {
429
+ condition: string;
430
+ type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
431
+ context?: string | undefined;
432
+ }[] | undefined;
433
+ stepName?: string | undefined;
380
434
  operation?: {
381
435
  path: string;
382
436
  method: string;
@@ -387,17 +441,17 @@ declare const definitions: {
387
441
  url: string;
388
442
  method: string;
389
443
  } | undefined;
390
- stepName?: string | undefined;
391
444
  } | {
445
+ collectionId: string;
392
446
  workflowId: string;
393
447
  stepId: string;
394
- collectionId: string;
395
448
  action: "delete_step";
396
449
  } | {
397
450
  action: "save_tab_to_collection";
398
451
  targetCollectionId: string;
399
452
  targetWorkflowId: string;
400
453
  newStepName: string;
454
+ };
401
455
  }, {
402
456
  error: {
403
457
  message: string;
@@ -408,14 +462,15 @@ declare const definitions: {
408
462
  } | {
409
463
  data: {
410
464
  summary: string;
465
+ collectionId?: string | undefined;
411
466
  workflowId?: string | undefined;
412
467
  stepId?: string | undefined;
413
- collectionId?: string | undefined;
414
468
  };
415
469
  isError: false;
416
470
  error?: undefined;
417
471
  }>;
418
472
  manage_environment: Tool< {
473
+ payload: {
419
474
  action: "get_environments";
420
475
  } | {
421
476
  action: "get_active_environment";
@@ -430,28 +485,29 @@ declare const definitions: {
430
485
  name: string;
431
486
  value: string;
432
487
  action: "upsert_input";
433
- isSecret?: boolean | undefined;
434
488
  environment?: string | undefined;
489
+ isSecret?: boolean | undefined;
435
490
  } | {
436
491
  action: "remove_input";
437
492
  inputName: string;
438
493
  environment?: string | undefined;
439
494
  } | {
440
495
  value: string;
441
- apiId: string;
442
496
  action: "upsert_server";
497
+ apiId: string;
498
+ environment?: string | undefined;
443
499
  variables?: {
444
500
  name: string;
445
501
  value: string;
446
502
  }[] | undefined;
447
- environment?: string | undefined;
448
503
  } | {
449
- apiId: string;
450
504
  action: "remove_server";
505
+ apiId: string;
451
506
  environment?: string | undefined;
452
507
  } | {
453
508
  environment: string;
454
509
  action: "set_active_environment";
510
+ };
455
511
  }, {
456
512
  error: {
457
513
  message: string;
@@ -467,13 +523,13 @@ declare const definitions: {
467
523
  value: string;
468
524
  isSecret: boolean;
469
525
  } | undefined;
470
- apiId?: string | undefined;
526
+ environment?: string | undefined;
471
527
  inputs?: {
472
528
  name: string;
473
529
  value: string;
474
530
  isSecret: boolean;
475
531
  }[] | undefined;
476
- environment?: string | undefined;
532
+ apiId?: string | undefined;
477
533
  environmentNames?: string[] | undefined;
478
534
  };
479
535
  isError: false;
@@ -529,6 +585,7 @@ declare type InputSettings = {
529
585
  hideOtherSecuritySchemes?: boolean;
530
586
  layout?: ReplayLayout;
531
587
  aiEnabled?: boolean;
588
+ aiProviders?: Partial<Record<HostedAiModel['provider'], AiProviderSettings>>;
532
589
  };
533
590
 
534
591
  declare type MediaType = {
@@ -1082,8 +1139,10 @@ declare type ReplayAppProps = {
1082
1139
  activeOperationPointer?: string;
1083
1140
  api?: OpenAPIDefinition;
1084
1141
  settings: InputSettings;
1142
+ getReuniteAuth?: ReuniteAuthGetter;
1085
1143
  onLoad?: () => void;
1086
1144
  renderProjectSelect?: () => React.ReactNode;
1145
+ onSettingsOpen?: (tab?: SettingsTab) => void;
1087
1146
  };
1088
1147
 
1089
1148
  declare type ReplayLayout = 'default' | 'overlay' | 'preview';
@@ -1147,6 +1206,12 @@ declare type ResponseDownload = {
1147
1206
  totalBytes?: number;
1148
1207
  };
1149
1208
 
1209
+ declare type ReuniteAuthGetter = () => Promise<{
1210
+ accessToken: string;
1211
+ baseUrl: string;
1212
+ clientId?: string;
1213
+ } | null>;
1214
+
1150
1215
  declare type Server = {
1151
1216
  url: string;
1152
1217
  description?: string;
@@ -1162,6 +1227,8 @@ declare type ServerVariable = {
1162
1227
  description?: string;
1163
1228
  };
1164
1229
 
1230
+ declare type SettingsTab = 'appearance' | 'certificates' | 'ai-providers';
1231
+
1165
1232
  export { SpanStatusCode }
1166
1233
 
1167
1234
  declare enum TabDataType {
package/dist/replay.js CHANGED
@@ -1,4 +1,4 @@
1
- import { w as s, x as t, E as l, M as r, R as o, y as p, S as y, T as m, z as n, C as d, D as T, F as h, G as i, H as u, I as A } from "./replay-index-_k5xCRc7.js";
1
+ import { w as s, x as t, E as l, M as r, R as o, y as p, S as y, T as m, z as n, C as d, D as T, F as h, G as i, H as u, I as A } from "./replay-index-DGOIXl2g.js";
2
2
  import { O, h as R } 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",
3
+ "version": "0.24.0-next.1",
4
4
  "type": "module",
5
5
  "main": "./dist/replay.cjs",
6
6
  "module": "./dist/replay.js",
@@ -20,7 +20,7 @@
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"
23
+ "@redocly/theme": "0.65.0-next.1"
24
24
  },
25
25
  "dependencies": {
26
26
  "@ai-sdk/anthropic": "3.0.1",
@@ -48,10 +48,10 @@
48
48
  "@lezer/highlight": "^1.1.6",
49
49
  "@noble/hashes": "^1.8.0",
50
50
  "@opentelemetry/api": "1.9.0",
51
- "@redocly/hookstate-core": "4.2.2",
51
+ "@redocly/hookstate-core": "4.2.3",
52
52
  "@redocly/hookstate-devtools": "^4.2.0",
53
- "@redocly/openapi-core": "2.25.2",
54
- "@redocly/respect-core": "2.25.2",
53
+ "@redocly/openapi-core": "2.29.1",
54
+ "@redocly/respect-core": "2.29.1",
55
55
  "@redocly/vscode-json-languageservice": "^3.4.9",
56
56
  "@tauri-apps/api": "2.4.1",
57
57
  "@tauri-apps/plugin-dialog": "2.0.0-rc.1",
@@ -61,8 +61,8 @@
61
61
  "@uiw/react-codemirror": "^4.21.20",
62
62
  "ai": "6.0.111",
63
63
  "dayjs": "^1.11.7",
64
- "drizzle-orm": "^0.36.4",
65
- "fast-xml-parser": "5.5.9",
64
+ "drizzle-orm": "^0.45.0",
65
+ "fast-xml-parser": "5.7.1",
66
66
  "idb": "^8.0.2",
67
67
  "js-yaml": "4.1.1",
68
68
  "json-pointer": "^0.6.2",