@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.
- package/LICENSE +0 -0
- package/README.md +97 -68
- package/dist/schemas/v1/agent-card.schema.json +230 -0
- package/dist/schemas/v1/conformance-profiles.json +0 -0
- package/dist/schemas/v1/context-ledger.schema.json +70 -0
- package/dist/schemas/v1/discovery.schema.json +132 -0
- package/dist/schemas/v1/envelope.schema.json +0 -0
- package/dist/schemas/v1/error-registry.json +0 -0
- package/dist/src/a2a/bindings/grpc.d.ts +118 -11
- package/dist/src/a2a/bindings/grpc.d.ts.map +1 -0
- package/dist/src/a2a/bindings/grpc.js +80 -8
- package/dist/src/a2a/bindings/grpc.js.map +1 -0
- package/dist/src/a2a/bindings/http.d.ts +131 -15
- package/dist/src/a2a/bindings/http.d.ts.map +1 -0
- package/dist/src/a2a/bindings/http.js +101 -14
- package/dist/src/a2a/bindings/http.js.map +1 -0
- package/dist/src/a2a/bindings/index.d.ts +83 -9
- package/dist/src/a2a/bindings/index.d.ts.map +1 -0
- package/dist/src/a2a/bindings/index.js +74 -6
- package/dist/src/a2a/bindings/index.js.map +1 -0
- package/dist/src/a2a/bindings/jsonrpc.d.ts +194 -9
- package/dist/src/a2a/bindings/jsonrpc.d.ts.map +1 -0
- package/dist/src/a2a/bindings/jsonrpc.js +155 -10
- package/dist/src/a2a/bindings/jsonrpc.js.map +1 -0
- package/dist/src/a2a/bridge.d.ts +237 -44
- package/dist/src/a2a/bridge.d.ts.map +1 -0
- package/dist/src/a2a/bridge.js +187 -48
- package/dist/src/a2a/bridge.js.map +1 -0
- package/dist/src/a2a/extensions.d.ts +222 -12
- package/dist/src/a2a/extensions.d.ts.map +1 -0
- package/dist/src/a2a/extensions.js +178 -13
- package/dist/src/a2a/extensions.js.map +1 -0
- package/dist/src/a2a/index.d.ts +10 -7
- package/dist/src/a2a/index.d.ts.map +1 -0
- package/dist/src/a2a/index.js +24 -27
- package/dist/src/a2a/index.js.map +1 -0
- package/dist/src/a2a/streaming.d.ts +276 -3
- package/dist/src/a2a/streaming.d.ts.map +1 -0
- package/dist/src/a2a/streaming.js +255 -11
- package/dist/src/a2a/streaming.js.map +1 -0
- package/dist/src/a2a/task-lifecycle.d.ts +341 -20
- package/dist/src/a2a/task-lifecycle.d.ts.map +1 -0
- package/dist/src/a2a/task-lifecycle.js +327 -26
- package/dist/src/a2a/task-lifecycle.js.map +1 -0
- package/dist/src/budgetEnforcement.d.ts +93 -20
- package/dist/src/budgetEnforcement.d.ts.map +1 -0
- package/dist/src/budgetEnforcement.js +146 -31
- package/dist/src/budgetEnforcement.js.map +1 -0
- package/dist/src/circuit-breaker/index.d.ts +260 -10
- package/dist/src/circuit-breaker/index.d.ts.map +1 -0
- package/dist/src/circuit-breaker/index.js +226 -14
- package/dist/src/circuit-breaker/index.js.map +1 -0
- package/dist/src/cli.d.ts +1 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +12 -11
- package/dist/src/cli.js.map +1 -0
- package/dist/src/compliance.d.ts +180 -3
- package/dist/src/compliance.d.ts.map +1 -0
- package/dist/src/compliance.js +114 -13
- package/dist/src/compliance.js.map +1 -0
- package/dist/src/conformance.d.ts +55 -2
- package/dist/src/conformance.d.ts.map +1 -0
- package/dist/src/conformance.js +124 -76
- package/dist/src/conformance.js.map +1 -0
- package/dist/src/conformanceProfiles.d.ts +68 -1
- package/dist/src/conformanceProfiles.d.ts.map +1 -0
- package/dist/src/conformanceProfiles.js +53 -1
- package/dist/src/conformanceProfiles.js.map +1 -0
- package/dist/src/deprecationRegistry.d.ts +82 -1
- package/dist/src/deprecationRegistry.d.ts.map +1 -0
- package/dist/src/deprecationRegistry.js +58 -7
- package/dist/src/deprecationRegistry.js.map +1 -0
- package/dist/src/discovery.d.ts +347 -65
- package/dist/src/discovery.d.ts.map +1 -0
- package/dist/src/discovery.js +130 -72
- package/dist/src/discovery.js.map +1 -0
- package/dist/src/envelope.d.ts +262 -9
- package/dist/src/envelope.d.ts.map +1 -0
- package/dist/src/envelope.js +179 -15
- package/dist/src/envelope.js.map +1 -0
- package/dist/src/errorRegistry.d.ts +163 -3
- package/dist/src/errorRegistry.d.ts.map +1 -0
- package/dist/src/errorRegistry.js +119 -3
- package/dist/src/errorRegistry.js.map +1 -0
- package/dist/src/fieldExtraction.d.ts +128 -27
- package/dist/src/fieldExtraction.d.ts.map +1 -0
- package/dist/src/fieldExtraction.js +100 -27
- package/dist/src/fieldExtraction.js.map +1 -0
- package/dist/src/flagResolver.d.ts +77 -10
- package/dist/src/flagResolver.d.ts.map +1 -0
- package/dist/src/flagResolver.js +22 -5
- package/dist/src/flagResolver.js.map +1 -0
- package/dist/src/flagSemantics.d.ts +80 -4
- package/dist/src/flagSemantics.d.ts.map +1 -0
- package/dist/src/flagSemantics.js +78 -11
- package/dist/src/flagSemantics.js.map +1 -0
- package/dist/src/health/index.d.ts +103 -9
- package/dist/src/health/index.d.ts.map +1 -0
- package/dist/src/health/index.js +75 -26
- package/dist/src/health/index.js.map +1 -0
- package/dist/src/index.d.ts +34 -23
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +40 -28
- package/dist/src/index.js.map +1 -0
- package/dist/src/mviProjection.d.ts +43 -6
- package/dist/src/mviProjection.d.ts.map +1 -0
- package/dist/src/mviProjection.js +32 -5
- package/dist/src/mviProjection.js.map +1 -0
- package/dist/src/native-loader.d.ts +49 -0
- package/dist/src/native-loader.d.ts.map +1 -0
- package/dist/src/native-loader.js +56 -0
- package/dist/src/native-loader.js.map +1 -0
- package/dist/src/problemDetails.d.ts +71 -4
- package/dist/src/problemDetails.d.ts.map +1 -0
- package/dist/src/problemDetails.js +27 -3
- package/dist/src/problemDetails.js.map +1 -0
- package/dist/src/shutdown/index.d.ts +103 -9
- package/dist/src/shutdown/index.d.ts.map +1 -0
- package/dist/src/shutdown/index.js +78 -12
- package/dist/src/shutdown/index.js.map +1 -0
- package/dist/src/tokenEstimator.d.ts +98 -11
- package/dist/src/tokenEstimator.d.ts.map +1 -0
- package/dist/src/tokenEstimator.js +91 -13
- package/dist/src/tokenEstimator.js.map +1 -0
- package/dist/src/types.d.ts +477 -11
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +76 -2
- package/dist/src/types.js.map +1 -0
- package/dist/src/validateEnvelope.d.ts +61 -2
- package/dist/src/validateEnvelope.d.ts.map +1 -0
- package/dist/src/validateEnvelope.js +81 -14
- package/dist/src/validateEnvelope.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/lafs.md +3 -4
- package/package.json +14 -12
- package/schemas/v1/agent-card.schema.json +0 -0
- package/schemas/v1/conformance-profiles.json +0 -0
- package/schemas/v1/context-ledger.schema.json +0 -0
- package/schemas/v1/discovery.schema.json +0 -0
- package/schemas/v1/envelope.schema.json +0 -0
- package/schemas/v1/error-registry.json +0 -0
- package/dist/src/mcpAdapter.d.ts +0 -28
- package/dist/src/mcpAdapter.js +0 -281
|
@@ -1,13 +1,94 @@
|
|
|
1
|
-
import type { LAFSEnvelope, Warning } from
|
|
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:
|
|
4
|
-
code:
|
|
5
|
-
message:
|
|
6
|
-
deprecated:
|
|
7
|
-
replacement:
|
|
8
|
-
removeBy:
|
|
9
|
-
detector: (envelope) => typeof envelope._meta.mvi ===
|
|
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"}
|