@redocly/replay 0.24.0-next.3 → 0.24.0-next.5

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-o0B_MaDr.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-Dr8zYd7m.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-CJcnXz6B.js";
2
- import { d as j, a as b, j as d } from "./replay-index-CJcnXz6B.js";
1
+ import { e as h, s as x, r as i } from "./replay-index-BaSiOcII.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-BaSiOcII.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-o0B_MaDr.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-Dr8zYd7m.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;
@@ -42,16 +40,15 @@ declare type AgentRuntimeConfig = {
42
40
  model: Model;
43
41
  tools: ReplayToolSet;
44
42
  sendEvent: AiChatTelemetrySendEvent;
43
+ parentCtx?: TelemetryContext;
45
44
  maxSteps?: number;
46
45
  maxOutputTokens?: ToolLoopAgentConfig['maxOutputTokens'];
47
46
  maxRetries?: ToolLoopAgentConfig['maxRetries'];
48
47
  onStepFinish?: ToolLoopAgentOnStepFinishCallback<ReplayToolSet>;
49
48
  onFinish?: ToolLoopAgentOnFinishCallback<ReplayToolSet>;
50
- maxHistoryMessages?: number;
51
- maxHistoryChars?: number;
52
49
  };
53
50
 
54
- declare type AiChatTelemetrySendEvent = <T extends AsyncApiReplay.EventType>(event: T, data: AsyncApiReplay.GetEventData<T>) => void;
51
+ declare type AiChatTelemetrySendEvent = TelemetryMethods['sendEvent'];
55
52
 
56
53
  export declare const AiPanelContext: Context<AiPanelContextValue>;
57
54
 
@@ -116,14 +113,29 @@ declare type ClientCredentialsOAuthFlowsObject = {
116
113
 
117
114
  declare type ConvertOperationFunction = (path: string, method: string, openAPI: any) => OpenAPIOperation_2 | undefined;
118
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
+
119
131
  declare const definitions: {
120
132
  open_tab: Tool< {
121
133
  action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run" | "open_new_request";
122
134
  tabIndex?: number | undefined;
123
- collectionId?: string | undefined;
124
135
  workflowId?: string | undefined;
125
136
  stepId?: string | undefined;
126
137
  operationId?: string | undefined;
138
+ collectionId?: string | undefined;
127
139
  requestUrl?: string | undefined;
128
140
  requestMethod?: string | undefined;
129
141
  }, {
@@ -160,9 +172,9 @@ declare const definitions: {
160
172
  error?: undefined;
161
173
  }>;
162
174
  run_request: Tool< {
163
- collectionId: string;
164
175
  workflowId: string;
165
176
  stepId: string;
177
+ collectionId: string;
166
178
  }, {
167
179
  error: {
168
180
  message: string;
@@ -184,7 +196,7 @@ declare const definitions: {
184
196
  error?: undefined;
185
197
  }>;
186
198
  get_current_tab: Tool< {
187
- 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")[];
188
200
  }, {
189
201
  error: {
190
202
  message: string;
@@ -203,17 +215,17 @@ declare const definitions: {
203
215
  path?: string | undefined;
204
216
  type?: "workflow" | "collection" | "api" | "step" | "api_operation" | undefined;
205
217
  method?: string | undefined;
206
- collectionId?: string | undefined;
207
- workflowId?: string | undefined;
208
- stepId?: string | undefined;
209
218
  query?: string | undefined;
210
219
  apiId?: string | undefined;
220
+ workflowId?: string | undefined;
221
+ stepId?: string | undefined;
211
222
  operationId?: string | undefined;
223
+ collectionId?: string | undefined;
212
224
  }, unknown>;
213
225
  update_security: Tool< {
214
- collectionId: string;
215
226
  workflowId: string;
216
227
  stepId: string;
228
+ collectionId: string;
217
229
  changes: ({
218
230
  type: import("../../../../types/security").SecurityTypes.BasicAuth;
219
231
  action: "add" | "update";
@@ -263,7 +275,7 @@ declare const definitions: {
263
275
  username?: string | undefined;
264
276
  clientId?: string | undefined;
265
277
  clientSecret?: string | undefined;
266
- grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
278
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
267
279
  tokenUrl?: string | undefined;
268
280
  accessToken?: string | undefined;
269
281
  authorizationUrl?: string | undefined;
@@ -281,12 +293,12 @@ declare const definitions: {
281
293
  clientId?: string | undefined;
282
294
  clientSecret?: string | undefined;
283
295
  openIdConnectUrl?: string | undefined;
284
- grantType?: "password" | "clientCredentials" | "clientCredentialsWithJwtAssertion" | "authorizationCode" | "authorizationCodeWithPkce" | "implicit" | undefined;
285
- userInfoUrl?: string | undefined;
296
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
286
297
  tokenUrl?: string | undefined;
287
298
  accessToken?: string | undefined;
288
299
  authorizationUrl?: string | undefined;
289
300
  callbackUrl?: string | undefined;
301
+ userInfoUrl?: string | undefined;
290
302
  } | undefined;
291
303
  index?: number | undefined;
292
304
  schemeId?: string | undefined;
@@ -315,31 +327,31 @@ declare const definitions: {
315
327
  error?: undefined;
316
328
  }>;
317
329
  update_step: Tool< {
318
- collectionId: string;
319
330
  workflowId: string;
320
331
  stepId: string;
332
+ collectionId: string;
321
333
  changes: ({
322
334
  data: string;
335
+ field: "url";
323
336
  action: "add" | "remove" | "update";
324
337
  approved: boolean;
325
- field: "url";
326
338
  id?: string | undefined;
327
339
  } | {
328
340
  data: string;
341
+ field: "description";
329
342
  action: "add" | "remove" | "update";
330
343
  approved: boolean;
331
- field: "description";
332
344
  id?: string | undefined;
333
345
  } | {
334
346
  data: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
347
+ field: "method";
335
348
  action: "add" | "remove" | "update";
336
349
  approved: boolean;
337
- field: "method";
338
350
  id?: string | undefined;
339
351
  } | {
352
+ field: "parameters";
340
353
  action: "add" | "remove" | "update";
341
354
  approved: boolean;
342
- field: "parameters";
343
355
  data?: {
344
356
  name: string;
345
357
  in: "header" | "path" | "query" | "cookie";
@@ -347,21 +359,21 @@ declare const definitions: {
347
359
  } | undefined;
348
360
  id?: string | undefined;
349
361
  } | {
362
+ field: "outputs";
350
363
  action: "add" | "remove" | "update";
351
364
  approved: boolean;
352
- field: "outputs";
353
365
  data?: {
354
366
  name: string;
355
367
  expression: string;
356
368
  } | undefined;
357
369
  id?: string | undefined;
358
370
  } | {
371
+ field: "successCriteria";
359
372
  action: "add" | "remove" | "update";
360
373
  approved: boolean;
361
- field: "successCriteria";
362
374
  data?: {
363
375
  condition: string;
364
- type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
376
+ type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
365
377
  context?: string | undefined;
366
378
  } | undefined;
367
379
  id?: string | undefined;
@@ -370,9 +382,9 @@ declare const definitions: {
370
382
  content: string;
371
383
  contentType?: string | undefined;
372
384
  };
385
+ field: "body";
373
386
  action: "add" | "remove" | "update";
374
387
  approved: boolean;
375
- field: "body";
376
388
  id?: string | undefined;
377
389
  })[];
378
390
  }, {
@@ -406,12 +418,12 @@ declare const definitions: {
406
418
  collectionId: string;
407
419
  action: "create_workflow";
408
420
  } | {
409
- collectionId: string;
410
421
  workflowId: string;
422
+ collectionId: string;
411
423
  action: "delete_workflow";
412
424
  } | {
413
- collectionId: string;
414
425
  workflowId: string;
426
+ collectionId: string;
415
427
  action: "create_step";
416
428
  body?: {
417
429
  content: string;
@@ -429,10 +441,9 @@ declare const definitions: {
429
441
  }[] | undefined;
430
442
  successCriteria?: {
431
443
  condition: string;
432
- type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
444
+ type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
433
445
  context?: string | undefined;
434
446
  }[] | undefined;
435
- stepName?: string | undefined;
436
447
  operation?: {
437
448
  path: string;
438
449
  method: string;
@@ -443,10 +454,11 @@ declare const definitions: {
443
454
  url: string;
444
455
  method: string;
445
456
  } | undefined;
457
+ stepName?: string | undefined;
446
458
  } | {
447
- collectionId: string;
448
459
  workflowId: string;
449
460
  stepId: string;
461
+ collectionId: string;
450
462
  action: "delete_step";
451
463
  } | {
452
464
  action: "save_tab_to_collection";
@@ -464,9 +476,9 @@ declare const definitions: {
464
476
  } | {
465
477
  data: {
466
478
  summary: string;
467
- collectionId?: string | undefined;
468
479
  workflowId?: string | undefined;
469
480
  stepId?: string | undefined;
481
+ collectionId?: string | undefined;
470
482
  };
471
483
  isError: false;
472
484
  error?: undefined;
@@ -480,6 +492,9 @@ declare const definitions: {
480
492
  action: "get_inputs";
481
493
  environment?: string | undefined;
482
494
  } | {
495
+ action: "get_servers";
496
+ environment?: string | undefined;
497
+ } | {
483
498
  action: "get_input";
484
499
  inputName: string;
485
500
  environment?: string | undefined;
@@ -495,16 +510,33 @@ declare const definitions: {
495
510
  environment?: string | undefined;
496
511
  } | {
497
512
  value: string;
498
- action: "upsert_server";
499
513
  apiId: string;
514
+ action: "upsert_server";
500
515
  environment?: string | undefined;
501
516
  variables?: {
502
517
  name: string;
503
518
  value: string;
504
519
  }[] | undefined;
505
520
  } | {
506
- 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;
507
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";
508
540
  environment?: string | undefined;
509
541
  } | {
510
542
  environment: string;
@@ -526,12 +558,20 @@ declare const definitions: {
526
558
  isSecret: boolean;
527
559
  } | undefined;
528
560
  environment?: string | undefined;
561
+ apiId?: string | undefined;
529
562
  inputs?: {
530
563
  name: string;
531
564
  value: string;
532
565
  isSecret: boolean;
533
566
  }[] | undefined;
534
- apiId?: string | undefined;
567
+ servers?: {
568
+ value: string;
569
+ apiId: string;
570
+ variables: {
571
+ name: string;
572
+ value: string;
573
+ }[];
574
+ }[] | undefined;
535
575
  environmentNames?: string[] | undefined;
536
576
  };
537
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-CJcnXz6B.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-BaSiOcII.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.3",
3
+ "version": "0.24.0-next.5",
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.3"
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.2",
54
- "@redocly/respect-core": "2.30.2",
53
+ "@redocly/openapi-core": "2.30.3",
54
+ "@redocly/respect-core": "2.30.3",
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",