@redocly/replay 0.24.0-next.4 → 0.24.0-next.6

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-CjmdsV7D.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-DRC1NPbj.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-BvG3rjLC.js";
2
- import { d as j, a as b, j as d } from "./replay-index-BvG3rjLC.js";
1
+ import { e as h, s as x, r as i } from "./replay-index-De6tUBSJ.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-De6tUBSJ.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-CjmdsV7D.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-DRC1NPbj.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.createResource=e.createResource;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
@@ -21,8 +21,6 @@ export declare class AgentLoop {
21
21
  private model;
22
22
  private tools;
23
23
  private readonly toolLoopAgent;
24
- private readonly maxHistoryMessages;
25
- private readonly maxHistoryChars;
26
24
  private readonly maxSteps;
27
25
  private readonly context;
28
26
  private readonly systemInstructions;
@@ -48,11 +46,9 @@ declare type AgentRuntimeConfig = {
48
46
  maxRetries?: ToolLoopAgentConfig['maxRetries'];
49
47
  onStepFinish?: ToolLoopAgentOnStepFinishCallback<ReplayToolSet>;
50
48
  onFinish?: ToolLoopAgentOnFinishCallback<ReplayToolSet>;
51
- maxHistoryMessages?: number;
52
- maxHistoryChars?: number;
53
49
  };
54
50
 
55
- declare type AiChatTelemetrySendEvent = <T extends AsyncApiReplay.EventType>(event: T, data: AsyncApiReplay.GetEventData<T>) => void;
51
+ declare type AiChatTelemetrySendEvent = TelemetryMethods['sendEvent'];
56
52
 
57
53
  export declare const AiPanelContext: Context<AiPanelContextValue>;
58
54
 
@@ -117,14 +113,29 @@ declare type ClientCredentialsOAuthFlowsObject = {
117
113
 
118
114
  declare type ConvertOperationFunction = (path: string, method: string, openAPI: any) => OpenAPIOperation_2 | undefined;
119
115
 
116
+ /**
117
+ * Canonical URI for Replay telemetry `data[]` items.
118
+ * Prefers `window.location.href` in non-Tauri browser contexts; otherwise emits a Redocly URN.
119
+ *
120
+ * The browser URL is stripped of its query string and fragment so that auth tokens, password-reset
121
+ * codes, OAuth `state`, session IDs, and similar secrets in `?…` or `#…` cannot leak into telemetry.
122
+ *
123
+ * @see docs/intranet/engineering/knowledge-base/telemetry/cloudevent-structure.md
124
+ */
125
+ export declare function createResource<O extends string = string>(object: O, id: string, component?: string): {
126
+ object: O;
127
+ id: string;
128
+ uri: string;
129
+ };
130
+
120
131
  declare const definitions: {
121
132
  open_tab: Tool< {
122
133
  action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run" | "open_new_request";
123
134
  tabIndex?: number | undefined;
124
- collectionId?: string | undefined;
125
135
  workflowId?: string | undefined;
126
136
  stepId?: string | undefined;
127
137
  operationId?: string | undefined;
138
+ collectionId?: string | undefined;
128
139
  requestUrl?: string | undefined;
129
140
  requestMethod?: string | undefined;
130
141
  }, {
@@ -161,9 +172,9 @@ declare const definitions: {
161
172
  error?: undefined;
162
173
  }>;
163
174
  run_request: Tool< {
164
- collectionId: string;
165
175
  workflowId: string;
166
176
  stepId: string;
177
+ collectionId: string;
167
178
  }, {
168
179
  error: {
169
180
  message: string;
@@ -185,7 +196,7 @@ declare const definitions: {
185
196
  error?: undefined;
186
197
  }>;
187
198
  get_current_tab: Tool< {
188
- sections: ("security" | "result" | "response" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "parameters" | "outputs" | "steps" | "requestBody" | "successCriteria" | "severity")[];
199
+ sections: ("security" | "result" | "response" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "severity")[];
189
200
  }, {
190
201
  error: {
191
202
  message: string;
@@ -204,17 +215,17 @@ declare const definitions: {
204
215
  path?: string | undefined;
205
216
  type?: "workflow" | "collection" | "api" | "step" | "api_operation" | undefined;
206
217
  method?: string | undefined;
207
- collectionId?: string | undefined;
208
- workflowId?: string | undefined;
209
- stepId?: string | undefined;
210
218
  query?: string | undefined;
211
219
  apiId?: string | undefined;
220
+ workflowId?: string | undefined;
221
+ stepId?: string | undefined;
212
222
  operationId?: string | undefined;
223
+ collectionId?: string | undefined;
213
224
  }, unknown>;
214
225
  update_security: Tool< {
215
- collectionId: string;
216
226
  workflowId: string;
217
227
  stepId: string;
228
+ collectionId: string;
218
229
  changes: ({
219
230
  type: import("../../../../types/security").SecurityTypes.BasicAuth;
220
231
  action: "add" | "update";
@@ -264,7 +275,7 @@ declare const definitions: {
264
275
  username?: string | undefined;
265
276
  clientId?: string | undefined;
266
277
  clientSecret?: string | undefined;
267
- grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
278
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
268
279
  tokenUrl?: string | undefined;
269
280
  accessToken?: string | undefined;
270
281
  authorizationUrl?: string | undefined;
@@ -282,12 +293,12 @@ declare const definitions: {
282
293
  clientId?: string | undefined;
283
294
  clientSecret?: string | undefined;
284
295
  openIdConnectUrl?: string | undefined;
285
- grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
286
- userInfoUrl?: string | undefined;
296
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
287
297
  tokenUrl?: string | undefined;
288
298
  accessToken?: string | undefined;
289
299
  authorizationUrl?: string | undefined;
290
300
  callbackUrl?: string | undefined;
301
+ userInfoUrl?: string | undefined;
291
302
  } | undefined;
292
303
  index?: number | undefined;
293
304
  schemeId?: string | undefined;
@@ -316,31 +327,31 @@ declare const definitions: {
316
327
  error?: undefined;
317
328
  }>;
318
329
  update_step: Tool< {
319
- collectionId: string;
320
330
  workflowId: string;
321
331
  stepId: string;
332
+ collectionId: string;
322
333
  changes: ({
323
334
  data: string;
335
+ field: "url";
324
336
  action: "add" | "remove" | "update";
325
337
  approved: boolean;
326
- field: "url";
327
338
  id?: string | undefined;
328
339
  } | {
329
340
  data: string;
341
+ field: "description";
330
342
  action: "add" | "remove" | "update";
331
343
  approved: boolean;
332
- field: "description";
333
344
  id?: string | undefined;
334
345
  } | {
335
346
  data: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
347
+ field: "method";
336
348
  action: "add" | "remove" | "update";
337
349
  approved: boolean;
338
- field: "method";
339
350
  id?: string | undefined;
340
351
  } | {
352
+ field: "parameters";
341
353
  action: "add" | "remove" | "update";
342
354
  approved: boolean;
343
- field: "parameters";
344
355
  data?: {
345
356
  name: string;
346
357
  in: "header" | "path" | "query" | "cookie";
@@ -348,21 +359,21 @@ declare const definitions: {
348
359
  } | undefined;
349
360
  id?: string | undefined;
350
361
  } | {
362
+ field: "outputs";
351
363
  action: "add" | "remove" | "update";
352
364
  approved: boolean;
353
- field: "outputs";
354
365
  data?: {
355
366
  name: string;
356
367
  expression: string;
357
368
  } | undefined;
358
369
  id?: string | undefined;
359
370
  } | {
371
+ field: "successCriteria";
360
372
  action: "add" | "remove" | "update";
361
373
  approved: boolean;
362
- field: "successCriteria";
363
374
  data?: {
364
375
  condition: string;
365
- type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
376
+ type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
366
377
  context?: string | undefined;
367
378
  } | undefined;
368
379
  id?: string | undefined;
@@ -371,9 +382,9 @@ declare const definitions: {
371
382
  content: string;
372
383
  contentType?: string | undefined;
373
384
  };
385
+ field: "body";
374
386
  action: "add" | "remove" | "update";
375
387
  approved: boolean;
376
- field: "body";
377
388
  id?: string | undefined;
378
389
  })[];
379
390
  }, {
@@ -407,12 +418,12 @@ declare const definitions: {
407
418
  collectionId: string;
408
419
  action: "create_workflow";
409
420
  } | {
410
- collectionId: string;
411
421
  workflowId: string;
422
+ collectionId: string;
412
423
  action: "delete_workflow";
413
424
  } | {
414
- collectionId: string;
415
425
  workflowId: string;
426
+ collectionId: string;
416
427
  action: "create_step";
417
428
  body?: {
418
429
  content: string;
@@ -430,10 +441,9 @@ declare const definitions: {
430
441
  }[] | undefined;
431
442
  successCriteria?: {
432
443
  condition: string;
433
- type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
444
+ type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
434
445
  context?: string | undefined;
435
446
  }[] | undefined;
436
- stepName?: string | undefined;
437
447
  operation?: {
438
448
  path: string;
439
449
  method: string;
@@ -444,10 +454,11 @@ declare const definitions: {
444
454
  url: string;
445
455
  method: string;
446
456
  } | undefined;
457
+ stepName?: string | undefined;
447
458
  } | {
448
- collectionId: string;
449
459
  workflowId: string;
450
460
  stepId: string;
461
+ collectionId: string;
451
462
  action: "delete_step";
452
463
  } | {
453
464
  action: "save_tab_to_collection";
@@ -465,9 +476,9 @@ declare const definitions: {
465
476
  } | {
466
477
  data: {
467
478
  summary: string;
468
- collectionId?: string | undefined;
469
479
  workflowId?: string | undefined;
470
480
  stepId?: string | undefined;
481
+ collectionId?: string | undefined;
471
482
  };
472
483
  isError: false;
473
484
  error?: undefined;
@@ -481,6 +492,9 @@ declare const definitions: {
481
492
  action: "get_inputs";
482
493
  environment?: string | undefined;
483
494
  } | {
495
+ action: "get_servers";
496
+ environment?: string | undefined;
497
+ } | {
484
498
  action: "get_input";
485
499
  inputName: string;
486
500
  environment?: string | undefined;
@@ -496,16 +510,33 @@ declare const definitions: {
496
510
  environment?: string | undefined;
497
511
  } | {
498
512
  value: string;
499
- action: "upsert_server";
500
513
  apiId: string;
514
+ action: "upsert_server";
501
515
  environment?: string | undefined;
502
516
  variables?: {
503
517
  name: string;
504
518
  value: string;
505
519
  }[] | undefined;
506
520
  } | {
507
- action: "remove_server";
521
+ environment: string;
522
+ action: "add_environment";
523
+ inputs?: {
524
+ name: string;
525
+ value: string;
526
+ isSecret?: boolean | undefined;
527
+ }[] | undefined;
528
+ servers?: {
529
+ value: string;
508
530
  apiId: string;
531
+ variables?: {
532
+ name: string;
533
+ value: string;
534
+ }[] | undefined;
535
+ }[] | undefined;
536
+ setActive?: boolean | undefined;
537
+ } | {
538
+ apiId: string;
539
+ action: "remove_server";
509
540
  environment?: string | undefined;
510
541
  } | {
511
542
  environment: string;
@@ -527,12 +558,20 @@ declare const definitions: {
527
558
  isSecret: boolean;
528
559
  } | undefined;
529
560
  environment?: string | undefined;
561
+ apiId?: string | undefined;
530
562
  inputs?: {
531
563
  name: string;
532
564
  value: string;
533
565
  isSecret: boolean;
534
566
  }[] | undefined;
535
- apiId?: string | undefined;
567
+ servers?: {
568
+ value: string;
569
+ apiId: string;
570
+ variables: {
571
+ name: string;
572
+ value: string;
573
+ }[];
574
+ }[] | undefined;
536
575
  environmentNames?: string[] | undefined;
537
576
  };
538
577
  isError: false;
package/dist/replay.js CHANGED
@@ -1,21 +1,22 @@
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-BvG3rjLC.js";
2
- import { O, h as R } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
1
+ import { w as s, x as t, E as r, M as l, R as o, y as p, S as y, T as m, z as n, C as d, D as u, F as T, G as h, H as i, I as A, K as C } from "./replay-index-De6tUBSJ.js";
2
+ import { O, h as x } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
3
3
  export {
4
4
  s as AgentLoop,
5
5
  t as AiPanelContext,
6
- l as EmbeddedReplay,
7
- r as Modal,
6
+ r as EmbeddedReplay,
7
+ l as Modal,
8
8
  O as OAuth2Error,
9
9
  o as Replay,
10
10
  p as ReplayOverlay,
11
11
  y as SpanStatusCode,
12
12
  m as TelemetryClient,
13
13
  n as applyThemeToDOM,
14
- d as getCurrentTheme,
15
- R as handleOAuth2Redirect,
14
+ d as createResource,
15
+ u as getCurrentTheme,
16
+ x as handleOAuth2Redirect,
16
17
  T as resolveTheme,
17
18
  h as useAiPanel,
18
19
  i as useTelemetry,
19
- u as useTelemetryClient,
20
- A as validateApiKey
20
+ A as useTelemetryClient,
21
+ C as validateApiKey
21
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/replay",
3
- "version": "0.24.0-next.4",
3
+ "version": "0.24.0-next.6",
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.65.0-next.4"
23
+ "@redocly/theme": "0.65.0-next.5"
24
24
  },
25
25
  "dependencies": {
26
26
  "@ai-sdk/anthropic": "3.0.1",
@@ -50,8 +50,8 @@
50
50
  "@opentelemetry/api": "1.9.0",
51
51
  "@redocly/hookstate-core": "4.2.3",
52
52
  "@redocly/hookstate-devtools": "^4.2.0",
53
- "@redocly/openapi-core": "2.30.3",
54
- "@redocly/respect-core": "2.30.3",
53
+ "@redocly/openapi-core": "2.30.5",
54
+ "@redocly/respect-core": "2.30.5",
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",
@@ -62,7 +62,7 @@
62
62
  "ai": "6.0.111",
63
63
  "dayjs": "^1.11.7",
64
64
  "drizzle-orm": "^0.45.0",
65
- "fast-xml-parser": "5.7.1",
65
+ "fast-xml-parser": "5.7.3",
66
66
  "idb": "^8.0.2",
67
67
  "js-yaml": "4.1.1",
68
68
  "json-pointer": "^0.6.2",