@cleocode/lafs 2026.3.74 → 2026.4.3

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 (143) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +97 -68
  3. package/dist/schemas/v1/agent-card.schema.json +230 -0
  4. package/dist/schemas/v1/conformance-profiles.json +0 -0
  5. package/dist/schemas/v1/context-ledger.schema.json +70 -0
  6. package/dist/schemas/v1/discovery.schema.json +132 -0
  7. package/dist/schemas/v1/envelope.schema.json +0 -0
  8. package/dist/schemas/v1/error-registry.json +0 -0
  9. package/dist/src/a2a/bindings/grpc.d.ts +118 -11
  10. package/dist/src/a2a/bindings/grpc.d.ts.map +1 -0
  11. package/dist/src/a2a/bindings/grpc.js +80 -8
  12. package/dist/src/a2a/bindings/grpc.js.map +1 -0
  13. package/dist/src/a2a/bindings/http.d.ts +131 -15
  14. package/dist/src/a2a/bindings/http.d.ts.map +1 -0
  15. package/dist/src/a2a/bindings/http.js +101 -14
  16. package/dist/src/a2a/bindings/http.js.map +1 -0
  17. package/dist/src/a2a/bindings/index.d.ts +83 -9
  18. package/dist/src/a2a/bindings/index.d.ts.map +1 -0
  19. package/dist/src/a2a/bindings/index.js +74 -6
  20. package/dist/src/a2a/bindings/index.js.map +1 -0
  21. package/dist/src/a2a/bindings/jsonrpc.d.ts +194 -9
  22. package/dist/src/a2a/bindings/jsonrpc.d.ts.map +1 -0
  23. package/dist/src/a2a/bindings/jsonrpc.js +155 -10
  24. package/dist/src/a2a/bindings/jsonrpc.js.map +1 -0
  25. package/dist/src/a2a/bridge.d.ts +237 -44
  26. package/dist/src/a2a/bridge.d.ts.map +1 -0
  27. package/dist/src/a2a/bridge.js +187 -48
  28. package/dist/src/a2a/bridge.js.map +1 -0
  29. package/dist/src/a2a/extensions.d.ts +222 -12
  30. package/dist/src/a2a/extensions.d.ts.map +1 -0
  31. package/dist/src/a2a/extensions.js +178 -13
  32. package/dist/src/a2a/extensions.js.map +1 -0
  33. package/dist/src/a2a/index.d.ts +10 -7
  34. package/dist/src/a2a/index.d.ts.map +1 -0
  35. package/dist/src/a2a/index.js +24 -27
  36. package/dist/src/a2a/index.js.map +1 -0
  37. package/dist/src/a2a/streaming.d.ts +276 -3
  38. package/dist/src/a2a/streaming.d.ts.map +1 -0
  39. package/dist/src/a2a/streaming.js +255 -11
  40. package/dist/src/a2a/streaming.js.map +1 -0
  41. package/dist/src/a2a/task-lifecycle.d.ts +341 -20
  42. package/dist/src/a2a/task-lifecycle.d.ts.map +1 -0
  43. package/dist/src/a2a/task-lifecycle.js +327 -26
  44. package/dist/src/a2a/task-lifecycle.js.map +1 -0
  45. package/dist/src/budgetEnforcement.d.ts +93 -20
  46. package/dist/src/budgetEnforcement.d.ts.map +1 -0
  47. package/dist/src/budgetEnforcement.js +146 -31
  48. package/dist/src/budgetEnforcement.js.map +1 -0
  49. package/dist/src/circuit-breaker/index.d.ts +260 -10
  50. package/dist/src/circuit-breaker/index.d.ts.map +1 -0
  51. package/dist/src/circuit-breaker/index.js +226 -14
  52. package/dist/src/circuit-breaker/index.js.map +1 -0
  53. package/dist/src/cli.d.ts +1 -0
  54. package/dist/src/cli.d.ts.map +1 -0
  55. package/dist/src/cli.js +12 -11
  56. package/dist/src/cli.js.map +1 -0
  57. package/dist/src/compliance.d.ts +180 -3
  58. package/dist/src/compliance.d.ts.map +1 -0
  59. package/dist/src/compliance.js +114 -13
  60. package/dist/src/compliance.js.map +1 -0
  61. package/dist/src/conformance.d.ts +55 -2
  62. package/dist/src/conformance.d.ts.map +1 -0
  63. package/dist/src/conformance.js +124 -76
  64. package/dist/src/conformance.js.map +1 -0
  65. package/dist/src/conformanceProfiles.d.ts +68 -1
  66. package/dist/src/conformanceProfiles.d.ts.map +1 -0
  67. package/dist/src/conformanceProfiles.js +53 -1
  68. package/dist/src/conformanceProfiles.js.map +1 -0
  69. package/dist/src/deprecationRegistry.d.ts +82 -1
  70. package/dist/src/deprecationRegistry.d.ts.map +1 -0
  71. package/dist/src/deprecationRegistry.js +58 -7
  72. package/dist/src/deprecationRegistry.js.map +1 -0
  73. package/dist/src/discovery.d.ts +347 -65
  74. package/dist/src/discovery.d.ts.map +1 -0
  75. package/dist/src/discovery.js +130 -72
  76. package/dist/src/discovery.js.map +1 -0
  77. package/dist/src/envelope.d.ts +262 -9
  78. package/dist/src/envelope.d.ts.map +1 -0
  79. package/dist/src/envelope.js +179 -15
  80. package/dist/src/envelope.js.map +1 -0
  81. package/dist/src/errorRegistry.d.ts +163 -3
  82. package/dist/src/errorRegistry.d.ts.map +1 -0
  83. package/dist/src/errorRegistry.js +119 -3
  84. package/dist/src/errorRegistry.js.map +1 -0
  85. package/dist/src/fieldExtraction.d.ts +128 -27
  86. package/dist/src/fieldExtraction.d.ts.map +1 -0
  87. package/dist/src/fieldExtraction.js +100 -27
  88. package/dist/src/fieldExtraction.js.map +1 -0
  89. package/dist/src/flagResolver.d.ts +77 -10
  90. package/dist/src/flagResolver.d.ts.map +1 -0
  91. package/dist/src/flagResolver.js +22 -5
  92. package/dist/src/flagResolver.js.map +1 -0
  93. package/dist/src/flagSemantics.d.ts +80 -4
  94. package/dist/src/flagSemantics.d.ts.map +1 -0
  95. package/dist/src/flagSemantics.js +78 -11
  96. package/dist/src/flagSemantics.js.map +1 -0
  97. package/dist/src/health/index.d.ts +103 -9
  98. package/dist/src/health/index.d.ts.map +1 -0
  99. package/dist/src/health/index.js +75 -26
  100. package/dist/src/health/index.js.map +1 -0
  101. package/dist/src/index.d.ts +34 -23
  102. package/dist/src/index.d.ts.map +1 -0
  103. package/dist/src/index.js +40 -28
  104. package/dist/src/index.js.map +1 -0
  105. package/dist/src/mviProjection.d.ts +43 -6
  106. package/dist/src/mviProjection.d.ts.map +1 -0
  107. package/dist/src/mviProjection.js +32 -5
  108. package/dist/src/mviProjection.js.map +1 -0
  109. package/dist/src/native-loader.d.ts +49 -0
  110. package/dist/src/native-loader.d.ts.map +1 -0
  111. package/dist/src/native-loader.js +56 -0
  112. package/dist/src/native-loader.js.map +1 -0
  113. package/dist/src/problemDetails.d.ts +71 -4
  114. package/dist/src/problemDetails.d.ts.map +1 -0
  115. package/dist/src/problemDetails.js +27 -3
  116. package/dist/src/problemDetails.js.map +1 -0
  117. package/dist/src/shutdown/index.d.ts +103 -9
  118. package/dist/src/shutdown/index.d.ts.map +1 -0
  119. package/dist/src/shutdown/index.js +78 -12
  120. package/dist/src/shutdown/index.js.map +1 -0
  121. package/dist/src/tokenEstimator.d.ts +98 -11
  122. package/dist/src/tokenEstimator.d.ts.map +1 -0
  123. package/dist/src/tokenEstimator.js +91 -13
  124. package/dist/src/tokenEstimator.js.map +1 -0
  125. package/dist/src/types.d.ts +477 -11
  126. package/dist/src/types.d.ts.map +1 -0
  127. package/dist/src/types.js +76 -2
  128. package/dist/src/types.js.map +1 -0
  129. package/dist/src/validateEnvelope.d.ts +61 -2
  130. package/dist/src/validateEnvelope.d.ts.map +1 -0
  131. package/dist/src/validateEnvelope.js +81 -14
  132. package/dist/src/validateEnvelope.js.map +1 -0
  133. package/dist/tsconfig.build.tsbuildinfo +1 -0
  134. package/lafs.md +3 -4
  135. package/package.json +14 -12
  136. package/schemas/v1/agent-card.schema.json +0 -0
  137. package/schemas/v1/conformance-profiles.json +0 -0
  138. package/schemas/v1/context-ledger.schema.json +0 -0
  139. package/schemas/v1/discovery.schema.json +0 -0
  140. package/schemas/v1/envelope.schema.json +0 -0
  141. package/schemas/v1/error-registry.json +0 -0
  142. package/dist/src/mcpAdapter.d.ts +0 -28
  143. package/dist/src/mcpAdapter.js +0 -281
@@ -1,13 +1,94 @@
1
- import type { LAFSEnvelope, Warning } from "./types.js";
1
+ import type { LAFSEnvelope, Warning } from './types.js';
2
+ /**
3
+ * A single deprecation rule in the registry.
4
+ *
5
+ * @remarks
6
+ * Each entry defines a detector function that inspects an envelope for
7
+ * deprecated usage patterns, along with metadata for generating warnings.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const entry: DeprecationEntry = {
12
+ * id: "meta-mvi-boolean",
13
+ * code: "W_DEPRECATED_META_MVI_BOOLEAN",
14
+ * message: "_meta.mvi boolean values are deprecated",
15
+ * deprecated: "1.0.0",
16
+ * replacement: "Use _meta.mvi as one of: minimal|standard|full|custom",
17
+ * removeBy: "2.0.0",
18
+ * detector: (env) => typeof env._meta.mvi === "boolean",
19
+ * };
20
+ * ```
21
+ */
2
22
  export interface DeprecationEntry {
23
+ /** Unique identifier for this deprecation rule */
3
24
  id: string;
25
+ /** Warning code emitted when detected */
4
26
  code: string;
27
+ /** Human-readable deprecation message */
5
28
  message: string;
29
+ /** Version where the feature was deprecated */
6
30
  deprecated: string;
31
+ /**
32
+ * Suggested replacement or migration path.
33
+ * @defaultValue `undefined`
34
+ */
7
35
  replacement?: string;
36
+ /** Version where the deprecated feature will be removed */
8
37
  removeBy: string;
38
+ /** Predicate that returns `true` when the envelope uses the deprecated feature */
9
39
  detector: (envelope: LAFSEnvelope) => boolean;
10
40
  }
41
+ /**
42
+ * Retrieve all registered deprecation entries.
43
+ *
44
+ * @returns Array of all {@link DeprecationEntry} rules in the registry
45
+ *
46
+ * @remarks
47
+ * Returns the internal registry array by reference. Callers should not
48
+ * mutate the returned array.
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * const entries = getDeprecationRegistry();
53
+ * console.log(entries.length); // number of registered deprecations
54
+ * ```
55
+ */
11
56
  export declare function getDeprecationRegistry(): DeprecationEntry[];
57
+ /**
58
+ * Detect deprecated field usage in a LAFS envelope.
59
+ *
60
+ * @param envelope - The LAFS envelope to inspect
61
+ * @returns Array of {@link Warning} objects for each detected deprecation
62
+ *
63
+ * @remarks
64
+ * Runs all registered deprecation detectors against the envelope and returns
65
+ * warnings for each match. Returns an empty array if no deprecations are found.
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const warnings = detectDeprecatedEnvelopeFields(envelope);
70
+ * for (const w of warnings) {
71
+ * console.warn(`${w.code}: ${w.message}`);
72
+ * }
73
+ * ```
74
+ */
12
75
  export declare function detectDeprecatedEnvelopeFields(envelope: LAFSEnvelope): Warning[];
76
+ /**
77
+ * Emit deprecation warnings by attaching them to the envelope metadata.
78
+ *
79
+ * @param envelope - The LAFS envelope to augment
80
+ * @returns A new envelope with deprecation warnings appended to `_meta.warnings`
81
+ *
82
+ * @remarks
83
+ * If no deprecations are detected, the original envelope is returned unchanged
84
+ * (no copy is made). Otherwise, a shallow copy is returned with the warnings
85
+ * array extended.
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const enriched = emitDeprecationWarnings(envelope);
90
+ * console.log(enriched._meta.warnings); // includes any deprecation warnings
91
+ * ```
92
+ */
13
93
  export declare function emitDeprecationWarnings(envelope: LAFSEnvelope): LAFSEnvelope;
94
+ //# sourceMappingURL=deprecationRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecationRegistry.d.ts","sourceRoot":"","sources":["../../src/deprecationRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,OAAO,CAAC;CAC/C;AAeD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,EAAE,CAE3D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,EAAE,CAUhF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,CAc5E"}
@@ -1,17 +1,50 @@
1
1
  const DEPRECATION_REGISTRY = [
2
2
  {
3
- id: "meta-mvi-boolean",
4
- code: "W_DEPRECATED_META_MVI_BOOLEAN",
5
- message: "_meta.mvi boolean values are deprecated",
6
- deprecated: "1.0.0",
7
- replacement: "Use _meta.mvi as one of: minimal|standard|full|custom",
8
- removeBy: "2.0.0",
9
- detector: (envelope) => typeof envelope._meta.mvi === "boolean",
3
+ id: 'meta-mvi-boolean',
4
+ code: 'W_DEPRECATED_META_MVI_BOOLEAN',
5
+ message: '_meta.mvi boolean values are deprecated',
6
+ deprecated: '1.0.0',
7
+ replacement: 'Use _meta.mvi as one of: minimal|standard|full|custom',
8
+ removeBy: '2.0.0',
9
+ detector: (envelope) => typeof envelope._meta.mvi === 'boolean',
10
10
  },
11
11
  ];
12
+ /**
13
+ * Retrieve all registered deprecation entries.
14
+ *
15
+ * @returns Array of all {@link DeprecationEntry} rules in the registry
16
+ *
17
+ * @remarks
18
+ * Returns the internal registry array by reference. Callers should not
19
+ * mutate the returned array.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const entries = getDeprecationRegistry();
24
+ * console.log(entries.length); // number of registered deprecations
25
+ * ```
26
+ */
12
27
  export function getDeprecationRegistry() {
13
28
  return DEPRECATION_REGISTRY;
14
29
  }
30
+ /**
31
+ * Detect deprecated field usage in a LAFS envelope.
32
+ *
33
+ * @param envelope - The LAFS envelope to inspect
34
+ * @returns Array of {@link Warning} objects for each detected deprecation
35
+ *
36
+ * @remarks
37
+ * Runs all registered deprecation detectors against the envelope and returns
38
+ * warnings for each match. Returns an empty array if no deprecations are found.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const warnings = detectDeprecatedEnvelopeFields(envelope);
43
+ * for (const w of warnings) {
44
+ * console.warn(`${w.code}: ${w.message}`);
45
+ * }
46
+ * ```
47
+ */
15
48
  export function detectDeprecatedEnvelopeFields(envelope) {
16
49
  return getDeprecationRegistry()
17
50
  .filter((entry) => entry.detector(envelope))
@@ -23,6 +56,23 @@ export function detectDeprecatedEnvelopeFields(envelope) {
23
56
  removeBy: entry.removeBy,
24
57
  }));
25
58
  }
59
+ /**
60
+ * Emit deprecation warnings by attaching them to the envelope metadata.
61
+ *
62
+ * @param envelope - The LAFS envelope to augment
63
+ * @returns A new envelope with deprecation warnings appended to `_meta.warnings`
64
+ *
65
+ * @remarks
66
+ * If no deprecations are detected, the original envelope is returned unchanged
67
+ * (no copy is made). Otherwise, a shallow copy is returned with the warnings
68
+ * array extended.
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const enriched = emitDeprecationWarnings(envelope);
73
+ * console.log(enriched._meta.warnings); // includes any deprecation warnings
74
+ * ```
75
+ */
26
76
  export function emitDeprecationWarnings(envelope) {
27
77
  const detected = detectDeprecatedEnvelopeFields(envelope);
28
78
  if (detected.length === 0) {
@@ -37,3 +87,4 @@ export function emitDeprecationWarnings(envelope) {
37
87
  },
38
88
  };
39
89
  }
90
+ //# sourceMappingURL=deprecationRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecationRegistry.js","sourceRoot":"","sources":["../../src/deprecationRegistry.ts"],"names":[],"mappings":"AA0CA,MAAM,oBAAoB,GAAuB;IAC/C;QACE,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,yCAAyC;QAClD,UAAU,EAAE,OAAO;QACnB,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CACrB,OAAQ,QAAwC,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS;KAC3E;CACF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,8BAA8B,CAAC,QAAsB;IACnE,OAAO,sBAAsB,EAAE;SAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;SAC3C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC,CAAC;AACR,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAsB;IAC5D,MAAM,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;IACvD,OAAO;QACL,GAAG,QAAQ;QACX,KAAK,EAAE;YACL,GAAG,QAAQ,CAAC,KAAK;YACjB,QAAQ,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,QAAQ,CAAC;SAC7C;KACF,CAAC;AACJ,CAAC"}