@redocly/replay 0.23.0 → 0.24.0-next.0

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 +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-DPXEyS-i.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,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-BWZuPg7w.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-BWZuPg7w.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;
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-DPXEyS-i.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
  }, {
@@ -135,9 +142,9 @@ declare const definitions: {
135
142
  error?: undefined;
136
143
  }>;
137
144
  run_request: Tool< {
145
+ collectionId: string;
138
146
  workflowId: string;
139
147
  stepId: string;
140
- collectionId: string;
141
148
  }, {
142
149
  error: {
143
150
  message: string;
@@ -159,7 +166,7 @@ declare const definitions: {
159
166
  error?: undefined;
160
167
  }>;
161
168
  get_current_tab: Tool< {
162
- sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "severity" | "response")[];
169
+ sections: ("security" | "result" | "response" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "parameters" | "outputs" | "steps" | "requestBody" | "successCriteria" | "severity")[];
163
170
  }, {
164
171
  error: {
165
172
  message: string;
@@ -176,19 +183,19 @@ declare const definitions: {
176
183
  }>;
177
184
  search: Tool< {
178
185
  path?: string | undefined;
179
- type?: "workflow" | "collection" | "step" | "api" | "api_operation" | undefined;
186
+ type?: "workflow" | "collection" | "api" | "step" | "api_operation" | undefined;
180
187
  method?: string | undefined;
181
- query?: string | undefined;
182
- apiId?: string | undefined;
188
+ collectionId?: string | undefined;
183
189
  workflowId?: string | undefined;
184
190
  stepId?: string | undefined;
191
+ query?: string | undefined;
192
+ apiId?: string | undefined;
185
193
  operationId?: string | undefined;
186
- collectionId?: string | undefined;
187
194
  }, unknown>;
188
195
  update_security: Tool< {
196
+ collectionId: string;
189
197
  workflowId: string;
190
198
  stepId: string;
191
- collectionId: string;
192
199
  changes: ({
193
200
  type: import("../../../../types/security").SecurityTypes.BasicAuth;
194
201
  action: "add" | "update";
@@ -238,7 +245,7 @@ declare const definitions: {
238
245
  username?: string | undefined;
239
246
  clientId?: string | undefined;
240
247
  clientSecret?: string | undefined;
241
- grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
248
+ grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
242
249
  tokenUrl?: string | undefined;
243
250
  accessToken?: string | undefined;
244
251
  authorizationUrl?: string | undefined;
@@ -256,12 +263,12 @@ declare const definitions: {
256
263
  clientId?: string | undefined;
257
264
  clientSecret?: string | undefined;
258
265
  openIdConnectUrl?: string | undefined;
259
- grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
266
+ grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
267
+ userInfoUrl?: string | undefined;
260
268
  tokenUrl?: string | undefined;
261
269
  accessToken?: string | undefined;
262
270
  authorizationUrl?: string | undefined;
263
271
  callbackUrl?: string | undefined;
264
- userInfoUrl?: string | undefined;
265
272
  } | undefined;
266
273
  index?: number | undefined;
267
274
  schemeId?: string | undefined;
@@ -279,37 +286,42 @@ declare const definitions: {
279
286
  data?: undefined;
280
287
  } | {
281
288
  data: {
282
- changedCount: number;
289
+ applied: {
290
+ status: "failed" | "applied";
291
+ summary?: string | undefined;
292
+ }[];
293
+ totalChanges: number;
294
+ approvedChanges: number;
283
295
  };
284
296
  isError: false;
285
297
  error?: undefined;
286
298
  }>;
287
299
  update_step: Tool< {
300
+ collectionId: string;
288
301
  workflowId: string;
289
302
  stepId: string;
290
- collectionId: string;
291
303
  changes: ({
292
304
  data: string;
293
- field: "url";
294
305
  action: "add" | "remove" | "update";
295
306
  approved: boolean;
307
+ field: "url";
296
308
  id?: string | undefined;
297
309
  } | {
298
310
  data: string;
299
- field: "description";
300
311
  action: "add" | "remove" | "update";
301
312
  approved: boolean;
313
+ field: "description";
302
314
  id?: string | undefined;
303
315
  } | {
304
316
  data: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
305
- field: "method";
306
317
  action: "add" | "remove" | "update";
307
318
  approved: boolean;
319
+ field: "method";
308
320
  id?: string | undefined;
309
321
  } | {
310
- field: "parameters";
311
322
  action: "add" | "remove" | "update";
312
323
  approved: boolean;
324
+ field: "parameters";
313
325
  data?: {
314
326
  name: string;
315
327
  in: "header" | "path" | "query" | "cookie";
@@ -317,21 +329,21 @@ declare const definitions: {
317
329
  } | undefined;
318
330
  id?: string | undefined;
319
331
  } | {
320
- field: "outputs";
321
332
  action: "add" | "remove" | "update";
322
333
  approved: boolean;
334
+ field: "outputs";
323
335
  data?: {
324
336
  name: string;
325
337
  expression: string;
326
338
  } | undefined;
327
339
  id?: string | undefined;
328
340
  } | {
329
- field: "successCriteria";
330
341
  action: "add" | "remove" | "update";
331
342
  approved: boolean;
343
+ field: "successCriteria";
332
344
  data?: {
333
345
  condition: string;
334
- type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
346
+ type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
335
347
  context?: string | undefined;
336
348
  } | undefined;
337
349
  id?: string | undefined;
@@ -340,9 +352,9 @@ declare const definitions: {
340
352
  content: string;
341
353
  contentType?: string | undefined;
342
354
  };
343
- field: "body";
344
355
  action: "add" | "remove" | "update";
345
356
  approved: boolean;
357
+ field: "body";
346
358
  id?: string | undefined;
347
359
  })[];
348
360
  }, {
@@ -354,12 +366,18 @@ declare const definitions: {
354
366
  data?: undefined;
355
367
  } | {
356
368
  data: {
357
- changedFields: string[];
369
+ applied: {
370
+ status: "failed" | "applied";
371
+ summary?: string | undefined;
372
+ }[];
373
+ totalChanges: number;
374
+ approvedChanges: number;
358
375
  };
359
376
  isError: false;
360
377
  error?: undefined;
361
378
  }>;
362
379
  manage_collection: Tool< {
380
+ payload: {
363
381
  title: string;
364
382
  action: "create_collection";
365
383
  } | {
@@ -370,13 +388,33 @@ declare const definitions: {
370
388
  collectionId: string;
371
389
  action: "create_workflow";
372
390
  } | {
373
- workflowId: string;
374
391
  collectionId: string;
392
+ workflowId: string;
375
393
  action: "delete_workflow";
376
394
  } | {
377
- workflowId: string;
378
395
  collectionId: string;
396
+ workflowId: string;
379
397
  action: "create_step";
398
+ body?: {
399
+ content: string;
400
+ contentType?: string | undefined;
401
+ } | undefined;
402
+ description?: string | undefined;
403
+ parameters?: {
404
+ name: string;
405
+ in: "header" | "path" | "query" | "cookie";
406
+ value: string;
407
+ }[] | undefined;
408
+ outputs?: {
409
+ name: string;
410
+ expression: string;
411
+ }[] | undefined;
412
+ successCriteria?: {
413
+ condition: string;
414
+ type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
415
+ context?: string | undefined;
416
+ }[] | undefined;
417
+ stepName?: string | undefined;
380
418
  operation?: {
381
419
  path: string;
382
420
  method: string;
@@ -387,17 +425,17 @@ declare const definitions: {
387
425
  url: string;
388
426
  method: string;
389
427
  } | undefined;
390
- stepName?: string | undefined;
391
428
  } | {
429
+ collectionId: string;
392
430
  workflowId: string;
393
431
  stepId: string;
394
- collectionId: string;
395
432
  action: "delete_step";
396
433
  } | {
397
434
  action: "save_tab_to_collection";
398
435
  targetCollectionId: string;
399
436
  targetWorkflowId: string;
400
437
  newStepName: string;
438
+ };
401
439
  }, {
402
440
  error: {
403
441
  message: string;
@@ -408,14 +446,15 @@ declare const definitions: {
408
446
  } | {
409
447
  data: {
410
448
  summary: string;
449
+ collectionId?: string | undefined;
411
450
  workflowId?: string | undefined;
412
451
  stepId?: string | undefined;
413
- collectionId?: string | undefined;
414
452
  };
415
453
  isError: false;
416
454
  error?: undefined;
417
455
  }>;
418
456
  manage_environment: Tool< {
457
+ payload: {
419
458
  action: "get_environments";
420
459
  } | {
421
460
  action: "get_active_environment";
@@ -430,28 +469,29 @@ declare const definitions: {
430
469
  name: string;
431
470
  value: string;
432
471
  action: "upsert_input";
433
- isSecret?: boolean | undefined;
434
472
  environment?: string | undefined;
473
+ isSecret?: boolean | undefined;
435
474
  } | {
436
475
  action: "remove_input";
437
476
  inputName: string;
438
477
  environment?: string | undefined;
439
478
  } | {
440
479
  value: string;
441
- apiId: string;
442
480
  action: "upsert_server";
481
+ apiId: string;
482
+ environment?: string | undefined;
443
483
  variables?: {
444
484
  name: string;
445
485
  value: string;
446
486
  }[] | undefined;
447
- environment?: string | undefined;
448
487
  } | {
449
- apiId: string;
450
488
  action: "remove_server";
489
+ apiId: string;
451
490
  environment?: string | undefined;
452
491
  } | {
453
492
  environment: string;
454
493
  action: "set_active_environment";
494
+ };
455
495
  }, {
456
496
  error: {
457
497
  message: string;
@@ -467,13 +507,13 @@ declare const definitions: {
467
507
  value: string;
468
508
  isSecret: boolean;
469
509
  } | undefined;
470
- apiId?: string | undefined;
510
+ environment?: string | undefined;
471
511
  inputs?: {
472
512
  name: string;
473
513
  value: string;
474
514
  isSecret: boolean;
475
515
  }[] | undefined;
476
- environment?: string | undefined;
516
+ apiId?: string | undefined;
477
517
  environmentNames?: string[] | undefined;
478
518
  };
479
519
  isError: false;
@@ -529,6 +569,7 @@ declare type InputSettings = {
529
569
  hideOtherSecuritySchemes?: boolean;
530
570
  layout?: ReplayLayout;
531
571
  aiEnabled?: boolean;
572
+ aiProviders?: Partial<Record<HostedAiModel['provider'], AiProviderSettings>>;
532
573
  };
533
574
 
534
575
  declare type MediaType = {
@@ -1082,8 +1123,10 @@ declare type ReplayAppProps = {
1082
1123
  activeOperationPointer?: string;
1083
1124
  api?: OpenAPIDefinition;
1084
1125
  settings: InputSettings;
1126
+ getReuniteAuth?: ReuniteAuthGetter;
1085
1127
  onLoad?: () => void;
1086
1128
  renderProjectSelect?: () => React.ReactNode;
1129
+ onSettingsOpen?: (tab?: SettingsTab) => void;
1087
1130
  };
1088
1131
 
1089
1132
  declare type ReplayLayout = 'default' | 'overlay' | 'preview';
@@ -1147,6 +1190,12 @@ declare type ResponseDownload = {
1147
1190
  totalBytes?: number;
1148
1191
  };
1149
1192
 
1193
+ declare type ReuniteAuthGetter = () => Promise<{
1194
+ accessToken: string;
1195
+ baseUrl: string;
1196
+ clientId?: string;
1197
+ } | null>;
1198
+
1150
1199
  declare type Server = {
1151
1200
  url: string;
1152
1201
  description?: string;
@@ -1162,6 +1211,8 @@ declare type ServerVariable = {
1162
1211
  description?: string;
1163
1212
  };
1164
1213
 
1214
+ declare type SettingsTab = 'appearance' | 'certificates' | 'ai-providers';
1215
+
1165
1216
  export { SpanStatusCode }
1166
1217
 
1167
1218
  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-BWZuPg7w.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.0",
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.0"
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.0",
54
+ "@redocly/respect-core": "2.29.0",
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,7 +61,7 @@
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",
64
+ "drizzle-orm": "^0.45.0",
65
65
  "fast-xml-parser": "5.5.9",
66
66
  "idb": "^8.0.2",
67
67
  "js-yaml": "4.1.1",