@ocpp-debugkit/toolkit 0.2.1 → 0.3.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.
Files changed (67) hide show
  1. package/README.md +234 -12
  2. package/dist/cli/commands/anonymize.d.ts +15 -0
  3. package/dist/cli/commands/anonymize.d.ts.map +1 -0
  4. package/dist/cli/commands/anonymize.js +104 -0
  5. package/dist/cli/commands/anonymize.js.map +1 -0
  6. package/dist/cli/commands/ci.d.ts +10 -0
  7. package/dist/cli/commands/ci.d.ts.map +1 -0
  8. package/dist/cli/commands/ci.js +96 -0
  9. package/dist/cli/commands/ci.js.map +1 -0
  10. package/dist/cli/commands/diff.d.ts +10 -0
  11. package/dist/cli/commands/diff.d.ts.map +1 -0
  12. package/dist/cli/commands/diff.js +71 -0
  13. package/dist/cli/commands/diff.js.map +1 -0
  14. package/dist/cli/index.js +27 -0
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/core/assertions.d.ts +36 -0
  17. package/dist/core/assertions.d.ts.map +1 -0
  18. package/dist/core/assertions.js +335 -0
  19. package/dist/core/assertions.js.map +1 -0
  20. package/dist/core/detection.d.ts +9 -1
  21. package/dist/core/detection.d.ts.map +1 -1
  22. package/dist/core/detection.js +344 -1
  23. package/dist/core/detection.js.map +1 -1
  24. package/dist/core/diff.d.ts +68 -0
  25. package/dist/core/diff.d.ts.map +1 -0
  26. package/dist/core/diff.js +199 -0
  27. package/dist/core/diff.js.map +1 -0
  28. package/dist/core/index.d.ts +4 -0
  29. package/dist/core/index.d.ts.map +1 -1
  30. package/dist/core/index.js +4 -0
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/types.d.ts +77 -2
  33. package/dist/core/types.d.ts.map +1 -1
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/scenarios/__scenarios__/heartbeat-irregular.d.ts +51 -0
  39. package/dist/scenarios/__scenarios__/heartbeat-irregular.d.ts.map +1 -0
  40. package/dist/scenarios/__scenarios__/heartbeat-irregular.js +81 -0
  41. package/dist/scenarios/__scenarios__/heartbeat-irregular.js.map +1 -0
  42. package/dist/scenarios/__scenarios__/meter-anomaly.d.ts +115 -0
  43. package/dist/scenarios/__scenarios__/meter-anomaly.d.ts.map +1 -0
  44. package/dist/scenarios/__scenarios__/meter-anomaly.js +152 -0
  45. package/dist/scenarios/__scenarios__/meter-anomaly.js.map +1 -0
  46. package/dist/scenarios/__scenarios__/short-session.d.ts +111 -0
  47. package/dist/scenarios/__scenarios__/short-session.d.ts.map +1 -0
  48. package/dist/scenarios/__scenarios__/short-session.js +129 -0
  49. package/dist/scenarios/__scenarios__/short-session.js.map +1 -0
  50. package/dist/scenarios/__scenarios__/slow-csms-response.d.ts +52 -0
  51. package/dist/scenarios/__scenarios__/slow-csms-response.d.ts.map +1 -0
  52. package/dist/scenarios/__scenarios__/slow-csms-response.js +61 -0
  53. package/dist/scenarios/__scenarios__/slow-csms-response.js.map +1 -0
  54. package/dist/scenarios/__scenarios__/unexpected-start.js +3 -3
  55. package/dist/scenarios/__scenarios__/unresponsive-csms.d.ts +53 -0
  56. package/dist/scenarios/__scenarios__/unresponsive-csms.d.ts.map +1 -0
  57. package/dist/scenarios/__scenarios__/unresponsive-csms.js +53 -0
  58. package/dist/scenarios/__scenarios__/unresponsive-csms.js.map +1 -0
  59. package/dist/scenarios/compare.d.ts +39 -0
  60. package/dist/scenarios/compare.d.ts.map +1 -0
  61. package/dist/scenarios/compare.js +77 -0
  62. package/dist/scenarios/compare.js.map +1 -0
  63. package/dist/scenarios/index.d.ts +10 -3
  64. package/dist/scenarios/index.d.ts.map +1 -1
  65. package/dist/scenarios/index.js +22 -1
  66. package/dist/scenarios/index.js.map +1 -1
  67. package/package.json +4 -4
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Scenario comparison — compare two scenario evaluation results.
3
+ *
4
+ * Useful for regression testing: did the fix change the detected failures?
5
+ * Compare a "before" run against an "after" run to see what changed.
6
+ *
7
+ * @module @ocpp-debugkit/toolkit/scenarios
8
+ */
9
+ import type { FailureCode, ScenarioEvalResult } from '../core/index.js';
10
+ /** Result of comparing two scenario evaluation reports. */
11
+ export interface ScenarioComparison {
12
+ /** Whether both scenarios passed all assertions. */
13
+ bothPassed: boolean;
14
+ /** Whether the first scenario (a) passed. */
15
+ aPassed: boolean;
16
+ /** Whether the second scenario (b) passed. */
17
+ bPassed: boolean;
18
+ /** Failure codes detected in A but not B. */
19
+ failuresOnlyInA: FailureCode[];
20
+ /** Failure codes detected in B but not A. */
21
+ failuresOnlyInB: FailureCode[];
22
+ /** Assertion results that changed (passed→failed or failed→passed). */
23
+ changedAssertions: {
24
+ assertionType: string;
25
+ passedInA: boolean;
26
+ passedInB: boolean;
27
+ }[];
28
+ /** Human-readable summary of changes. */
29
+ summary: string;
30
+ }
31
+ /**
32
+ * Compare two scenario evaluation results.
33
+ *
34
+ * @param a - First scenario evaluation result
35
+ * @param b - Second scenario evaluation result
36
+ * @returns A {@link ScenarioComparison} describing the differences
37
+ */
38
+ export declare function compareScenarioReports(a: ScenarioEvalResult, b: ScenarioEvalResult): ScenarioComparison;
39
+ //# sourceMappingURL=compare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../src/scenarios/compare.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMxE,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,6CAA6C;IAC7C,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,uEAAuE;IACvE,iBAAiB,EAAE;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,OAAO,CAAC;KACpB,EAAE,CAAC;IACJ,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,kBAAkB,EACrB,CAAC,EAAE,kBAAkB,GACpB,kBAAkB,CAgEpB"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Scenario comparison — compare two scenario evaluation results.
3
+ *
4
+ * Useful for regression testing: did the fix change the detected failures?
5
+ * Compare a "before" run against an "after" run to see what changed.
6
+ *
7
+ * @module @ocpp-debugkit/toolkit/scenarios
8
+ */
9
+ // ---------------------------------------------------------------------------
10
+ // Comparison
11
+ // ---------------------------------------------------------------------------
12
+ /**
13
+ * Compare two scenario evaluation results.
14
+ *
15
+ * @param a - First scenario evaluation result
16
+ * @param b - Second scenario evaluation result
17
+ * @returns A {@link ScenarioComparison} describing the differences
18
+ */
19
+ export function compareScenarioReports(a, b) {
20
+ const aPassed = a.allPassed;
21
+ const bPassed = b.allPassed;
22
+ const bothPassed = aPassed && bPassed;
23
+ // Failure code diff
24
+ const aCodes = new Set(a.detectedFailureCodes);
25
+ const bCodes = new Set(b.detectedFailureCodes);
26
+ const failuresOnlyInA = a.detectedFailureCodes.filter((c) => !bCodes.has(c));
27
+ const failuresOnlyInB = b.detectedFailureCodes.filter((c) => !aCodes.has(c));
28
+ // Assertion diff — compare assertions at the same index
29
+ const maxLen = Math.max(a.assertions.length, b.assertions.length);
30
+ const changedAssertions = [];
31
+ for (let i = 0; i < maxLen; i++) {
32
+ const aResult = a.assertions[i];
33
+ const bResult = b.assertions[i];
34
+ if (!aResult || !bResult)
35
+ continue;
36
+ if (aResult.passed !== bResult.passed) {
37
+ changedAssertions.push({
38
+ assertionType: aResult.assertion.type,
39
+ passedInA: aResult.passed,
40
+ passedInB: bResult.passed,
41
+ });
42
+ }
43
+ }
44
+ // Summary
45
+ const parts = [];
46
+ if (aPassed && !bPassed) {
47
+ parts.push('Scenario A passed but B failed — regression detected');
48
+ }
49
+ else if (!aPassed && bPassed) {
50
+ parts.push('Scenario A failed but B passed — improvement detected');
51
+ }
52
+ else if (bothPassed) {
53
+ parts.push('Both scenarios passed all assertions');
54
+ }
55
+ else {
56
+ parts.push('Both scenarios failed');
57
+ }
58
+ if (failuresOnlyInA.length > 0) {
59
+ parts.push(`Failures only in A: ${failuresOnlyInA.join(', ')}`);
60
+ }
61
+ if (failuresOnlyInB.length > 0) {
62
+ parts.push(`Failures only in B: ${failuresOnlyInB.join(', ')}`);
63
+ }
64
+ if (changedAssertions.length > 0) {
65
+ parts.push(`${changedAssertions.length} assertion(s) changed result`);
66
+ }
67
+ return {
68
+ bothPassed,
69
+ aPassed,
70
+ bPassed,
71
+ failuresOnlyInA,
72
+ failuresOnlyInB,
73
+ changedAssertions,
74
+ summary: parts.join('. '),
75
+ };
76
+ }
77
+ //# sourceMappingURL=compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/scenarios/compare.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8BH,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,CAAqB,EACrB,CAAqB;IAErB,MAAM,OAAO,GAAG,CAAC,CAAC,SAAS,CAAC;IAC5B,MAAM,OAAO,GAAG,CAAC,CAAC,SAAS,CAAC;IAC5B,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC;IAEtC,oBAAoB;IACpB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAC/C,MAAM,eA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,CAAC,uDAAuD,CAAC,CAAC;IACtE,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,uBAAuB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,uBAAuB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,MAAM,8BAA8B,CAAC,CAAC;IACxE,CAAC;IAED,OAAO;QACL,UAAU;QACV,OAAO;QACP,OAAO;QACP,eAAe;QACf,eAAe;QACf,iBAAiB;QACjB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;KAC1B,CAAC;AACJ,CAAC"}
@@ -15,9 +15,16 @@ declare const invalidStopReasonScenario: Scenario;
15
15
  declare const unexpectedStartScenario: Scenario;
16
16
  declare const statusTransitionViolationScenario: Scenario;
17
17
  declare const diagnosticsFailureScenario: Scenario;
18
- export declare const scenarios: readonly [Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario];
19
- export declare const scenarioNames: readonly ["normal-session", "failed-auth", "connector-fault", "station-offline", "unexpected-stop-reason", "meter-value-gap", "invalid-stop-reason", "unexpected-start", "status-transition-violation", "diagnostics-failure"];
20
- export { normalSessionScenario, failedAuthScenario, connectorFaultScenario, stationOfflineScenario, unexpectedStopReasonScenario, meterValueGapScenario, invalidStopReasonScenario, unexpectedStartScenario, statusTransitionViolationScenario, diagnosticsFailureScenario, };
18
+ declare const slowCsmsResponseScenario: Scenario;
19
+ declare const meterAnomalyScenario: Scenario;
20
+ declare const shortSessionScenario: Scenario;
21
+ declare const heartbeatIrregularScenario: Scenario;
22
+ declare const unresponsiveCsmsScenario: Scenario;
23
+ export declare const scenarios: readonly [Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario, Scenario];
24
+ export declare const scenarioNames: readonly ["normal-session", "failed-auth", "connector-fault", "station-offline", "unexpected-stop-reason", "meter-value-gap", "invalid-stop-reason", "unexpected-start", "status-transition-violation", "diagnostics-failure", "slow-csms-response", "meter-anomaly", "short-session", "heartbeat-irregular", "unresponsive-csms"];
25
+ export { normalSessionScenario, failedAuthScenario, connectorFaultScenario, stationOfflineScenario, unexpectedStopReasonScenario, meterValueGapScenario, invalidStopReasonScenario, unexpectedStartScenario, statusTransitionViolationScenario, diagnosticsFailureScenario, slowCsmsResponseScenario, meterAnomalyScenario, shortSessionScenario, heartbeatIrregularScenario, unresponsiveCsmsScenario, };
26
+ export { compareScenarioReports } from './compare.js';
27
+ export type { ScenarioComparison } from './compare.js';
21
28
  /**
22
29
  * Get a scenario by name.
23
30
  * @returns The scenario, or undefined if not found.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scenarios/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAS,MAAM,kBAAkB,CAAC;AAexD,QAAA,MAAM,qBAAqB,EAAE,QAM5B,CAAC;AAEF,QAAA,MAAM,kBAAkB,EAAE,QAMzB,CAAC;AAEF,QAAA,MAAM,sBAAsB,EAAE,QAM7B,CAAC;AAMF,QAAA,MAAM,sBAAsB,EAAE,QAAgD,CAAC;AAC/E,QAAA,MAAM,4BAA4B,EAAE,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AC;AACnF,QAAA,MAAM,oBAAoB,EAAE,QAA8C,CAAC;AAC3E,QAAA,MAAM,oBAAoB,EAAE,QAA8C,CAAC;AAC3E,QAAA,MAAM,0BAA0B,EAAE,QAAoD,CAAC;AACvF,QAAA,MAAM,wBAAwB,EAAE,QAAkD,CAAC;AAMnF,eAAO,MAAM,SAAS,iKAgBZ,CAAC;AAEX,eAAO,MAAM,aAAa,oUAgBhB,CAAC;AAEX,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,GACzB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE9D"}
@@ -12,6 +12,11 @@ import invalidStopReason from './__scenarios__/invalid-stop-reason.js';
12
12
  import unexpectedStart from './__scenarios__/unexpected-start.js';
13
13
  import statusTransitionViolation from './__scenarios__/status-transition-violation.js';
14
14
  import diagnosticsFailure from './__scenarios__/diagnostics-failure.js';
15
+ import slowCsmsResponse from './__scenarios__/slow-csms-response.js';
16
+ import meterAnomaly from './__scenarios__/meter-anomaly.js';
17
+ import shortSession from './__scenarios__/short-session.js';
18
+ import heartbeatIrregular from './__scenarios__/heartbeat-irregular.js';
19
+ import unresponsiveCsms from './__scenarios__/unresponsive-csms.js';
15
20
  // ---------------------------------------------------------------------------
16
21
  // Scenarios derived from core fixtures
17
22
  // ---------------------------------------------------------------------------
@@ -43,6 +48,11 @@ const invalidStopReasonScenario = invalidStopReason;
43
48
  const unexpectedStartScenario = unexpectedStart;
44
49
  const statusTransitionViolationScenario = statusTransitionViolation;
45
50
  const diagnosticsFailureScenario = diagnosticsFailure;
51
+ const slowCsmsResponseScenario = slowCsmsResponse;
52
+ const meterAnomalyScenario = meterAnomaly;
53
+ const shortSessionScenario = shortSession;
54
+ const heartbeatIrregularScenario = heartbeatIrregular;
55
+ const unresponsiveCsmsScenario = unresponsiveCsms;
46
56
  // ---------------------------------------------------------------------------
47
57
  // Registry
48
58
  // ---------------------------------------------------------------------------
@@ -57,6 +67,11 @@ export const scenarios = [
57
67
  unexpectedStartScenario,
58
68
  statusTransitionViolationScenario,
59
69
  diagnosticsFailureScenario,
70
+ slowCsmsResponseScenario,
71
+ meterAnomalyScenario,
72
+ shortSessionScenario,
73
+ heartbeatIrregularScenario,
74
+ unresponsiveCsmsScenario,
60
75
  ];
61
76
  export const scenarioNames = [
62
77
  'normal-session',
@@ -69,8 +84,14 @@ export const scenarioNames = [
69
84
  'unexpected-start',
70
85
  'status-transition-violation',
71
86
  'diagnostics-failure',
87
+ 'slow-csms-response',
88
+ 'meter-anomaly',
89
+ 'short-session',
90
+ 'heartbeat-irregular',
91
+ 'unresponsive-csms',
72
92
  ];
73
- export { normalSessionScenario, failedAuthScenario, connectorFaultScenario, stationOfflineScenario, unexpectedStopReasonScenario, meterValueGapScenario, invalidStopReasonScenario, unexpectedStartScenario, statusTransitionViolationScenario, diagnosticsFailureScenario, };
93
+ export { normalSessionScenario, failedAuthScenario, connectorFaultScenario, stationOfflineScenario, unexpectedStopReasonScenario, meterValueGapScenario, invalidStopReasonScenario, unexpectedStartScenario, statusTransitionViolationScenario, diagnosticsFailureScenario, slowCsmsResponseScenario, meterAnomalyScenario, shortSessionScenario, heartbeatIrregularScenario, unresponsiveCsmsScenario, };
94
+ export { compareScenarioReports } from './compare.js';
74
95
  /**
75
96
  * Get a scenario by name.
76
97
  * @returns The scenario, or undefined if not found.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scenarios/index.ts"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BAAuC,CAAC;AAEnF,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,qBAAqB;IACrB,kBAAkB;IAClB,sBAAsB;IACtB,sBAAsB;IACtB,4BAA4B;IAC5B,qBAAqB;IACrB,yBAAyB;IACzB,uBAAuB;IACvB,iCAAiC;IACjC,0BAA0B;IAC1B,wBAAwB;IACxB,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAC1B,wBAAwB;CAChB,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,gBAAgB;IAChB,aAAa;IACb,iBAAiB;IACjB,iBAAiB;IACjB,wBAAwB;IACxB,iBAAiB;IACjB,qBAAqB;IACrB,kBAAkB;IAClB,6BAA6B;IAC7B,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,eAAe;IACf,qBAAqB;IACrB,mBAAmB;CACX,CAAC;AAEX,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,GACzB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAChD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocpp-debugkit/toolkit",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Open-source DevTools for debugging OCPP charging sessions — parser, normalizer, timeline, failure detection, scenarios, replay, reports, CLI, and React components.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -67,12 +67,12 @@
67
67
  ],
68
68
  "repository": {
69
69
  "type": "git",
70
- "url": "https://github.com/ocpp-debugkit/ocpp-debugkit.git",
70
+ "url": "https://github.com/ocpp-debugkit/toolkit.git",
71
71
  "directory": "packages/toolkit"
72
72
  },
73
- "homepage": "https://github.com/ocpp-debugkit/ocpp-debugkit/tree/main/packages/toolkit",
73
+ "homepage": "https://github.com/ocpp-debugkit/toolkit/tree/main/packages/toolkit",
74
74
  "bugs": {
75
- "url": "https://github.com/ocpp-debugkit/ocpp-debugkit/issues"
75
+ "url": "https://github.com/ocpp-debugkit/toolkit/issues"
76
76
  },
77
77
  "dependencies": {
78
78
  "zod": "^4.4.3",