@redocly/replay 0.27.0-next.3 → 0.27.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.
Files changed (62) hide show
  1. package/dist/replay-AiChatProvider-BGXsZqW2.js +6 -0
  2. package/dist/replay-AiChatProvider-CVvR1kSd.js +1004 -0
  3. package/dist/replay-AiChatSqliteDBStorage-BFHRKFlk.js +88 -0
  4. package/dist/replay-AiChatSqliteDBStorage-DVJ9f2EK.js +1 -0
  5. package/dist/replay-AiPanel-CynVcVmm.js +2873 -0
  6. package/dist/replay-AiPanel-qVp_s4gD.js +849 -0
  7. package/dist/replay-HistorySqliteDBStorage-BrILW8Fu.js +1 -0
  8. package/dist/replay-HistorySqliteDBStorage-CtF6-vY8.js +113 -0
  9. package/dist/replay-SqliteDBStorage-CSz7NYH4.js +2857 -0
  10. package/dist/replay-SqliteDBStorage-eRBPh4E8.js +14 -0
  11. package/dist/replay-StepContextSqliteDBStorage-BSepLyBI.js +1 -0
  12. package/dist/replay-StepContextSqliteDBStorage-BfAAKDwA.js +83 -0
  13. package/dist/replay-agent-loop-C60p47KY.js +1 -0
  14. package/dist/replay-agent-loop-CEZz1kj-.js +1533 -0
  15. package/dist/replay-ai-chat-mappers-BAHU6JIc.js +99 -0
  16. package/dist/replay-ai-chat-mappers-Dqg-QVZy.js +1 -0
  17. package/dist/replay-ai-message-parts.schema-BBdjwldJ.js +1 -0
  18. package/dist/replay-ai-message-parts.schema-E9u9-nqr.js +60 -0
  19. package/dist/replay-create-model-C2NQtDcL.js +38224 -0
  20. package/dist/replay-create-model-CUL-l-eX.js +104 -0
  21. package/dist/replay-db-C4jAfGtc.js +64 -0
  22. package/dist/replay-db-Dw-X2WGx.js +306 -0
  23. package/dist/replay-defaults-CzR6jw9a.js +32 -0
  24. package/dist/replay-defaults-DVvOnvnR.js +27 -0
  25. package/dist/replay-external-resolver-DAkLV0nr.js +34 -0
  26. package/dist/replay-external-resolver-DN_PWq_2.js +2 -0
  27. package/dist/replay-history.schema-5ce6X0R1.js +28 -0
  28. package/dist/replay-history.schema-miM3Etuf.js +1 -0
  29. package/dist/replay-index-BmX1FPBL.js +6877 -0
  30. package/dist/replay-index-DR1uVBvc.js +503 -0
  31. package/dist/replay-index-DSKZHOXq.js +1 -0
  32. package/dist/{replay-index-gw_CfN4i.js → replay-index-DT5gdiBA.js} +1 -1
  33. package/dist/replay-index-O_Pq5an3.js +92924 -0
  34. package/dist/{replay-index-CiP3e-cc.js → replay-index-m00jnWFr.js} +6 -6
  35. package/dist/replay-index-qZlgEmbq.js +1 -0
  36. package/dist/replay-index-rRWvC2pp.js +1 -0
  37. package/dist/replay-indexes-CfsvVMi_.js +1242 -0
  38. package/dist/replay-indexes-Dqjl8m6C.js +1 -0
  39. package/dist/replay-lint-CcVVykW7.js +33217 -0
  40. package/dist/replay-lint-ON47l7Vu.js +184 -0
  41. package/dist/{replay-lint-graphql-DV4sCSe6.js → replay-lint-graphql-5cGt2KR_.js} +5 -5
  42. package/dist/{replay-lint-graphql-Cbptkd8N.js → replay-lint-graphql-DlD7bblx.js} +2 -2
  43. package/dist/replay-resolve-BTzo-fSv.js +47 -0
  44. package/dist/replay-resolve-Ca3DUbGq.js +3683 -0
  45. package/dist/{replay-respect-run-ChMawzhr.js → replay-respect-run-BtC2agF9.js} +54 -54
  46. package/dist/{replay-respect-run-BscBAlnT.js → replay-respect-run-eSRzH2dk.js} +447 -447
  47. package/dist/replay-step-context.schema-BuuXkAck.js +1 -0
  48. package/dist/replay-step-context.schema-DBk4jufr.js +21 -0
  49. package/dist/{replay-tauri-path-BMmQuI9X.js → replay-tauri-path-C-oxFOHe.js} +4 -4
  50. package/dist/{replay-tauri-path-kR-IXn3X.js → replay-tauri-path-CKcvIl_h.js} +1 -1
  51. package/dist/replay-useAiChatQueries-CVTxcu2Z.js +192 -0
  52. package/dist/replay-useAiChatQueries-vdKvbmp2.js +3413 -0
  53. package/dist/replay-validate-key-CwIopif3.js +28 -0
  54. package/dist/replay-validate-key-VkgZoK1f.js +1 -0
  55. package/dist/replay.cjs +1 -1
  56. package/dist/replay.d.ts +2 -0
  57. package/dist/replay.js +21 -21
  58. package/package.json +22 -25
  59. package/dist/replay-index-CUY_5IyO.js +0 -8308
  60. package/dist/replay-index-CUdCFVnz.js +0 -178626
  61. package/dist/replay-index-D8qtqDhF.js +0 -1
  62. package/dist/replay-index-DgjC0DLq.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./replay-history.schema-miM3Etuf.js"),r=require("./replay-indexes-Dqjl8m6C.js");function l(t){return r.sql`count(${r.sql.raw("*")})`.mapWith(Number)}function c(t){if(!t.step)throw new Error(`Invalid step history record: missing step data for id ${t.id}`);return{id:t.id,date:t.date,type:"step",step:t.step,response:t.response??null,statusCode:t.statusCode??null}}function u(t){if(!t.workflowId||!t.collectionId||!t.workflow||!t.workflowResult||t.success===null)throw new Error(`Invalid workflow history record: missing required fields for id ${t.id}`);return{id:t.id,date:t.date,type:"workflow",workflowId:t.workflowId,collectionId:t.collectionId,workflow:t.workflow,workflowResult:t.workflowResult,success:t.success,durationMs:t.durationMs??null}}function w(t){return{id:t.id,date:t.date,type:"step",step:t.step,response:t.response,statusCode:t.statusCode}}function y(t){return{id:t.id,date:t.date,type:"workflow",workflowId:t.workflowId,collectionId:t.collectionId,workflow:t.workflow,workflowResult:t.workflowResult,success:t.success,durationMs:t.durationMs}}function a(t){return t.type==="workflow"?u(t):c(t)}function h(t){return t.type==="workflow"?y(t):w(t)}class f{constructor(e){this.sqliteDB=e}sqliteDB;get db(){return this.sqliteDB.db}selectAll(){return this.db.select().from(i.history)}async initialize(){await this.sqliteDB.initialize()}async read(e){await this.initialize();const s=this.selectAll();return(e?.type?await s.where(r.eq(i.history.type,e.type)).orderBy(r.desc(i.history.date)):await s.orderBy(r.desc(i.history.date))).map(a)}async addItem(e){await this.initialize();const s=h(e);await this.db.insert(i.history).values(s)}async updateItem(e,s){await this.initialize();const{id:o,type:n,...d}=s;await this.db.update(i.history).set(d).where(r.eq(i.history.id,e))}async deleteItem(e){await this.initialize(),await this.db.delete(i.history).where(r.eq(i.history.id,e))}async clear(){await this.initialize(),await this.db.delete(i.history)}async getById(e){await this.initialize();const s=await this.selectAll().where(r.eq(i.history.id,e)).limit(1);return s.length===0?null:a(s[0])}async getRecent(e,s){await this.initialize();const o=this.selectAll();return(s?.type?await o.where(r.eq(i.history.type,s.type)).orderBy(r.desc(i.history.date)).limit(e):await o.orderBy(r.desc(i.history.date)).limit(e)).map(a)}async count(e){return await this.initialize(),(e?.type?await this.db.select({value:l()}).from(i.history).where(r.eq(i.history.type,e.type)):await this.db.select({value:l()}).from(i.history))[0]?.value||0}}exports.HistorySqliteDBStorage=f;
@@ -0,0 +1,113 @@
1
+ import { h as i } from "./replay-history.schema-5ce6X0R1.js";
2
+ import { s as n, e as r, d as a } from "./replay-indexes-CfsvVMi_.js";
3
+ function d(t) {
4
+ return n`count(${n.raw("*")})`.mapWith(Number);
5
+ }
6
+ function u(t) {
7
+ if (!t.step)
8
+ throw new Error(`Invalid step history record: missing step data for id ${t.id}`);
9
+ return {
10
+ id: t.id,
11
+ date: t.date,
12
+ type: "step",
13
+ step: t.step,
14
+ response: t.response ?? null,
15
+ statusCode: t.statusCode ?? null
16
+ };
17
+ }
18
+ function f(t) {
19
+ if (!t.workflowId || !t.collectionId || !t.workflow || !t.workflowResult || t.success === null)
20
+ throw new Error(`Invalid workflow history record: missing required fields for id ${t.id}`);
21
+ return {
22
+ id: t.id,
23
+ date: t.date,
24
+ type: "workflow",
25
+ workflowId: t.workflowId,
26
+ collectionId: t.collectionId,
27
+ workflow: t.workflow,
28
+ workflowResult: t.workflowResult,
29
+ success: t.success,
30
+ durationMs: t.durationMs ?? null
31
+ };
32
+ }
33
+ function y(t) {
34
+ return {
35
+ id: t.id,
36
+ date: t.date,
37
+ type: "step",
38
+ step: t.step,
39
+ response: t.response,
40
+ statusCode: t.statusCode
41
+ };
42
+ }
43
+ function p(t) {
44
+ return {
45
+ id: t.id,
46
+ date: t.date,
47
+ type: "workflow",
48
+ workflowId: t.workflowId,
49
+ collectionId: t.collectionId,
50
+ workflow: t.workflow,
51
+ workflowResult: t.workflowResult,
52
+ success: t.success,
53
+ durationMs: t.durationMs
54
+ };
55
+ }
56
+ function l(t) {
57
+ return t.type === "workflow" ? f(t) : u(t);
58
+ }
59
+ function h(t) {
60
+ return t.type === "workflow" ? p(t) : y(t);
61
+ }
62
+ class m {
63
+ constructor(e) {
64
+ this.sqliteDB = e;
65
+ }
66
+ sqliteDB;
67
+ get db() {
68
+ return this.sqliteDB.db;
69
+ }
70
+ selectAll() {
71
+ return this.db.select().from(i);
72
+ }
73
+ async initialize() {
74
+ await this.sqliteDB.initialize();
75
+ }
76
+ async read(e) {
77
+ await this.initialize();
78
+ const s = this.selectAll();
79
+ return (e?.type ? await s.where(r(i.type, e.type)).orderBy(a(i.date)) : await s.orderBy(a(i.date))).map(l);
80
+ }
81
+ async addItem(e) {
82
+ await this.initialize();
83
+ const s = h(e);
84
+ await this.db.insert(i).values(s);
85
+ }
86
+ async updateItem(e, s) {
87
+ await this.initialize();
88
+ const { id: o, type: w, ...c } = s;
89
+ await this.db.update(i).set(c).where(r(i.id, e));
90
+ }
91
+ async deleteItem(e) {
92
+ await this.initialize(), await this.db.delete(i).where(r(i.id, e));
93
+ }
94
+ async clear() {
95
+ await this.initialize(), await this.db.delete(i);
96
+ }
97
+ async getById(e) {
98
+ await this.initialize();
99
+ const s = await this.selectAll().where(r(i.id, e)).limit(1);
100
+ return s.length === 0 ? null : l(s[0]);
101
+ }
102
+ async getRecent(e, s) {
103
+ await this.initialize();
104
+ const o = this.selectAll();
105
+ return (s?.type ? await o.where(r(i.type, s.type)).orderBy(a(i.date)).limit(e) : await o.orderBy(a(i.date)).limit(e)).map(l);
106
+ }
107
+ async count(e) {
108
+ return await this.initialize(), (e?.type ? await this.db.select({ value: d() }).from(i).where(r(i.type, e.type)) : await this.db.select({ value: d() }).from(i))[0]?.value || 0;
109
+ }
110
+ }
111
+ export {
112
+ m as HistorySqliteDBStorage
113
+ };