@cleocode/lafs 1.8.0 → 2026.4.0
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 +0 -0
- 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 +1 -0
- package/dist/src/a2a/bindings/grpc.d.ts.map +1 -0
- package/dist/src/a2a/bindings/grpc.js +1 -0
- package/dist/src/a2a/bindings/grpc.js.map +1 -0
- package/dist/src/a2a/bindings/http.d.ts +2 -1
- package/dist/src/a2a/bindings/http.d.ts.map +1 -0
- package/dist/src/a2a/bindings/http.js +8 -2
- package/dist/src/a2a/bindings/http.js.map +1 -0
- package/dist/src/a2a/bindings/index.d.ts +3 -2
- package/dist/src/a2a/bindings/index.d.ts.map +1 -0
- package/dist/src/a2a/bindings/index.js +5 -4
- package/dist/src/a2a/bindings/index.js.map +1 -0
- package/dist/src/a2a/bindings/jsonrpc.d.ts +1 -0
- package/dist/src/a2a/bindings/jsonrpc.d.ts.map +1 -0
- package/dist/src/a2a/bindings/jsonrpc.js +3 -1
- package/dist/src/a2a/bindings/jsonrpc.js.map +1 -0
- package/dist/src/a2a/bridge.d.ts +5 -7
- package/dist/src/a2a/bridge.d.ts.map +1 -0
- package/dist/src/a2a/bridge.js +15 -24
- package/dist/src/a2a/bridge.js.map +1 -0
- package/dist/src/a2a/extensions.d.ts +1 -0
- package/dist/src/a2a/extensions.d.ts.map +1 -0
- package/dist/src/a2a/extensions.js +3 -2
- package/dist/src/a2a/extensions.js.map +1 -0
- package/dist/src/a2a/index.d.ts +8 -7
- package/dist/src/a2a/index.d.ts.map +1 -0
- package/dist/src/a2a/index.js +22 -27
- package/dist/src/a2a/index.js.map +1 -0
- package/dist/src/a2a/streaming.d.ts +2 -1
- package/dist/src/a2a/streaming.d.ts.map +1 -0
- package/dist/src/a2a/streaming.js +10 -9
- package/dist/src/a2a/streaming.js.map +1 -0
- package/dist/src/a2a/task-lifecycle.d.ts +2 -1
- package/dist/src/a2a/task-lifecycle.d.ts.map +1 -0
- package/dist/src/a2a/task-lifecycle.js +25 -7
- package/dist/src/a2a/task-lifecycle.js.map +1 -0
- package/dist/src/budgetEnforcement.d.ts +5 -6
- package/dist/src/budgetEnforcement.d.ts.map +1 -0
- package/dist/src/budgetEnforcement.js +14 -12
- package/dist/src/budgetEnforcement.js.map +1 -0
- package/dist/src/circuit-breaker/index.d.ts +6 -1
- package/dist/src/circuit-breaker/index.d.ts.map +1 -0
- package/dist/src/circuit-breaker/index.js +8 -5
- 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 +4 -3
- package/dist/src/compliance.d.ts.map +1 -0
- package/dist/src/compliance.js +14 -13
- package/dist/src/compliance.js.map +1 -0
- package/dist/src/conformance.d.ts +3 -2
- package/dist/src/conformance.d.ts.map +1 -0
- package/dist/src/conformance.js +83 -76
- package/dist/src/conformance.js.map +1 -0
- package/dist/src/conformanceProfiles.d.ts +2 -1
- package/dist/src/conformanceProfiles.d.ts.map +1 -0
- package/dist/src/conformanceProfiles.js +2 -1
- package/dist/src/conformanceProfiles.js.map +1 -0
- package/dist/src/deprecationRegistry.d.ts +2 -1
- package/dist/src/deprecationRegistry.d.ts.map +1 -0
- package/dist/src/deprecationRegistry.js +8 -7
- package/dist/src/deprecationRegistry.js.map +1 -0
- package/dist/src/discovery.d.ts +3 -2
- package/dist/src/discovery.d.ts.map +1 -0
- package/dist/src/discovery.js +63 -59
- package/dist/src/discovery.js.map +1 -0
- package/dist/src/envelope.d.ts +10 -9
- package/dist/src/envelope.d.ts.map +1 -0
- package/dist/src/envelope.js +14 -15
- package/dist/src/envelope.js.map +1 -0
- package/dist/src/errorRegistry.d.ts +4 -3
- package/dist/src/errorRegistry.d.ts.map +1 -0
- package/dist/src/errorRegistry.js +4 -3
- package/dist/src/errorRegistry.js.map +1 -0
- package/dist/src/fieldExtraction.d.ts +3 -2
- package/dist/src/fieldExtraction.d.ts.map +1 -0
- package/dist/src/fieldExtraction.js +15 -11
- package/dist/src/fieldExtraction.js.map +1 -0
- package/dist/src/flagResolver.d.ts +2 -1
- package/dist/src/flagResolver.d.ts.map +1 -0
- package/dist/src/flagResolver.js +2 -1
- package/dist/src/flagResolver.js.map +1 -0
- package/dist/src/flagSemantics.d.ts +4 -3
- package/dist/src/flagSemantics.d.ts.map +1 -0
- package/dist/src/flagSemantics.js +12 -11
- package/dist/src/flagSemantics.js.map +1 -0
- package/dist/src/health/index.d.ts +16 -3
- package/dist/src/health/index.d.ts.map +1 -0
- package/dist/src/health/index.js +21 -20
- package/dist/src/health/index.js.map +1 -0
- package/dist/src/index.d.ts +23 -23
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +29 -28
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcpAdapter.d.ts +4 -3
- package/dist/src/mcpAdapter.d.ts.map +1 -0
- package/dist/src/mcpAdapter.js +62 -57
- package/dist/src/mcpAdapter.js.map +1 -0
- package/dist/src/mviProjection.d.ts +1 -0
- package/dist/src/mviProjection.d.ts.map +1 -0
- package/dist/src/mviProjection.js +1 -0
- package/dist/src/mviProjection.js.map +1 -0
- package/dist/src/problemDetails.d.ts +1 -0
- package/dist/src/problemDetails.d.ts.map +1 -0
- package/dist/src/problemDetails.js +6 -0
- package/dist/src/problemDetails.js.map +1 -0
- package/dist/src/shutdown/index.d.ts +7 -2
- package/dist/src/shutdown/index.d.ts.map +1 -0
- package/dist/src/shutdown/index.js +6 -5
- package/dist/src/shutdown/index.js.map +1 -0
- package/dist/src/tokenEstimator.d.ts +1 -0
- package/dist/src/tokenEstimator.d.ts.map +1 -0
- package/dist/src/tokenEstimator.js +1 -2
- package/dist/src/tokenEstimator.js.map +1 -0
- package/dist/src/types.d.ts +10 -9
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +12 -2
- package/dist/src/types.js.map +1 -0
- package/dist/src/validateEnvelope.d.ts +2 -1
- package/dist/src/validateEnvelope.d.ts.map +1 -0
- package/dist/src/validateEnvelope.js +11 -10
- package/dist/src/validateEnvelope.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/lafs.md +0 -0
- package/package.json +10 -11
- package/schemas/v1/agent-card.schema.json +0 -0
- package/schemas/v1/conformance-profiles.d.ts +15 -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.d.ts +14 -0
- package/schemas/v1/envelope.schema.json +0 -0
- package/schemas/v1/error-registry.d.ts +24 -0
- package/schemas/v1/error-registry.json +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagSemantics.d.ts","sourceRoot":"","sources":["../../src/flagSemantics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAChD,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,qBAAa,aAAc,SAAQ,KAAM,YAAW,SAAS;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAErB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAUjF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,CA+BpE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRegistryCode } from
|
|
1
|
+
import { getRegistryCode } from './errorRegistry.js';
|
|
2
2
|
export class LAFSFlagError extends Error {
|
|
3
3
|
code;
|
|
4
4
|
category;
|
|
@@ -7,10 +7,10 @@ export class LAFSFlagError extends Error {
|
|
|
7
7
|
details;
|
|
8
8
|
constructor(code, message, details = {}) {
|
|
9
9
|
super(message);
|
|
10
|
-
this.name =
|
|
10
|
+
this.name = 'LAFSFlagError';
|
|
11
11
|
this.code = code;
|
|
12
12
|
const entry = getRegistryCode(code);
|
|
13
|
-
this.category = (entry?.category ??
|
|
13
|
+
this.category = (entry?.category ?? 'CONTRACT');
|
|
14
14
|
this.retryable = entry?.retryable ?? false;
|
|
15
15
|
this.retryAfterMs = null;
|
|
16
16
|
this.details = details;
|
|
@@ -18,28 +18,29 @@ export class LAFSFlagError extends Error {
|
|
|
18
18
|
}
|
|
19
19
|
export function resolveOutputFormat(input) {
|
|
20
20
|
if (input.humanFlag && input.jsonFlag) {
|
|
21
|
-
throw new LAFSFlagError(
|
|
21
|
+
throw new LAFSFlagError('E_FORMAT_CONFLICT', 'Cannot combine --human and --json in the same invocation.');
|
|
22
22
|
}
|
|
23
23
|
const quiet = input.quiet ?? false;
|
|
24
24
|
if (input.requestedFormat) {
|
|
25
|
-
return { format: input.requestedFormat, source:
|
|
25
|
+
return { format: input.requestedFormat, source: 'flag', quiet };
|
|
26
26
|
}
|
|
27
27
|
if (input.humanFlag) {
|
|
28
|
-
return { format:
|
|
28
|
+
return { format: 'human', source: 'flag', quiet };
|
|
29
29
|
}
|
|
30
30
|
if (input.jsonFlag) {
|
|
31
|
-
return { format:
|
|
31
|
+
return { format: 'json', source: 'flag', quiet };
|
|
32
32
|
}
|
|
33
33
|
if (input.projectDefault) {
|
|
34
|
-
return { format: input.projectDefault, source:
|
|
34
|
+
return { format: input.projectDefault, source: 'project', quiet };
|
|
35
35
|
}
|
|
36
36
|
if (input.userDefault) {
|
|
37
|
-
return { format: input.userDefault, source:
|
|
37
|
+
return { format: input.userDefault, source: 'user', quiet };
|
|
38
38
|
}
|
|
39
39
|
// TTY terminals default to human-readable output for usability.
|
|
40
40
|
// Non-TTY (piped, CI, agents) defaults to JSON per LAFS protocol.
|
|
41
41
|
if (input.tty) {
|
|
42
|
-
return { format:
|
|
42
|
+
return { format: 'human', source: 'default', quiet };
|
|
43
43
|
}
|
|
44
|
-
return { format:
|
|
44
|
+
return { format: 'json', source: 'default', quiet };
|
|
45
45
|
}
|
|
46
|
+
//# sourceMappingURL=flagSemantics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagSemantics.js","sourceRoot":"","sources":["../../src/flagSemantics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAUrD,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,IAAI,CAAS;IACb,QAAQ,CAAoB;IAC5B,SAAS,CAAU;IACnB,YAAY,CAAgB;IAC5B,OAAO,CAA0B;IAEjC,YAAY,IAAY,EAAE,OAAe,EAAE,UAAmC,EAAE;QAC9E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,IAAI,UAAU,CAAsB,CAAC;QACrE,IAAI,CAAC,SAAS,GAAG,KAAK,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EAAE,KAAK,EAAE,CAAC;IACvD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -45,7 +45,11 @@ export interface HealthStatus {
|
|
|
45
45
|
* }));
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
export declare function healthCheck(config?: HealthCheckConfig): (
|
|
48
|
+
export declare function healthCheck(config?: HealthCheckConfig): (_req: unknown, res: {
|
|
49
|
+
status: (code: number) => {
|
|
50
|
+
json: (body: unknown) => void;
|
|
51
|
+
};
|
|
52
|
+
}) => Promise<void>;
|
|
49
53
|
/**
|
|
50
54
|
* Create a database health check
|
|
51
55
|
*
|
|
@@ -89,7 +93,11 @@ export declare function createExternalServiceHealthCheck(config: {
|
|
|
89
93
|
* app.get('/health/live', livenessProbe());
|
|
90
94
|
* ```
|
|
91
95
|
*/
|
|
92
|
-
export declare function livenessProbe(): (
|
|
96
|
+
export declare function livenessProbe(): (_req: unknown, res: {
|
|
97
|
+
status: (code: number) => {
|
|
98
|
+
json: (body: unknown) => void;
|
|
99
|
+
};
|
|
100
|
+
}) => void;
|
|
93
101
|
/**
|
|
94
102
|
* Readiness probe - check that service is ready to accept traffic
|
|
95
103
|
*
|
|
@@ -102,4 +110,9 @@ export declare function livenessProbe(): (req: any, res: any) => void;
|
|
|
102
110
|
*/
|
|
103
111
|
export declare function readinessProbe(config?: {
|
|
104
112
|
checks?: HealthCheckFunction[];
|
|
105
|
-
}): (
|
|
113
|
+
}): (_req: unknown, res: {
|
|
114
|
+
status: (code: number) => {
|
|
115
|
+
json: (body: unknown) => void;
|
|
116
|
+
};
|
|
117
|
+
}) => Promise<void>;
|
|
118
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/health/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAY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G;AACH,wBAAgB,aAAa,KACnB,MAAM,OAAO,EAAE,KAAK;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAA;CAAE,UAM5F;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE;IAAE,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAA;CAAO,IAE1E,MAAM,OAAO,EACb,KAAK;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAA;CAAE,mBAiCvE"}
|
package/dist/src/health/index.js
CHANGED
|
@@ -37,9 +37,9 @@ catch {
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
export function healthCheck(config = {}) {
|
|
40
|
-
const { path = '/health', checks = [] } = config;
|
|
40
|
+
const { path: _path = '/health', checks = [] } = config;
|
|
41
41
|
const startTime = Date.now();
|
|
42
|
-
return async (
|
|
42
|
+
return async (_req, res) => {
|
|
43
43
|
const timestamp = new Date().toISOString();
|
|
44
44
|
const checkResults = [];
|
|
45
45
|
// Run all health checks
|
|
@@ -55,22 +55,22 @@ export function healthCheck(config = {}) {
|
|
|
55
55
|
name: 'unknown',
|
|
56
56
|
status: 'error',
|
|
57
57
|
message: error instanceof Error ? error.message : 'Check failed',
|
|
58
|
-
duration: Date.now() - start
|
|
58
|
+
duration: Date.now() - start,
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
// Add default checks
|
|
63
63
|
checkResults.push({
|
|
64
64
|
name: 'envelopeValidation',
|
|
65
|
-
status: 'ok'
|
|
65
|
+
status: 'ok',
|
|
66
66
|
});
|
|
67
67
|
checkResults.push({
|
|
68
68
|
name: 'tokenBudgets',
|
|
69
|
-
status: 'ok'
|
|
69
|
+
status: 'ok',
|
|
70
70
|
});
|
|
71
71
|
// Determine overall status
|
|
72
|
-
const hasErrors = checkResults.some(c => c.status === 'error');
|
|
73
|
-
const hasWarnings = checkResults.some(c => c.status === 'warning');
|
|
72
|
+
const hasErrors = checkResults.some((c) => c.status === 'error');
|
|
73
|
+
const hasWarnings = checkResults.some((c) => c.status === 'warning');
|
|
74
74
|
const status = hasErrors
|
|
75
75
|
? 'unhealthy'
|
|
76
76
|
: hasWarnings
|
|
@@ -81,7 +81,7 @@ export function healthCheck(config = {}) {
|
|
|
81
81
|
timestamp,
|
|
82
82
|
version: pkg.version,
|
|
83
83
|
uptime: Math.floor((Date.now() - startTime) / 1000),
|
|
84
|
-
checks: checkResults
|
|
84
|
+
checks: checkResults,
|
|
85
85
|
};
|
|
86
86
|
const statusCode = status === 'healthy' ? 200 : status === 'degraded' ? 200 : 503;
|
|
87
87
|
res.status(statusCode).json(health);
|
|
@@ -108,14 +108,14 @@ export function createDatabaseHealthCheck(config) {
|
|
|
108
108
|
return {
|
|
109
109
|
name: config.name || 'database',
|
|
110
110
|
status: isConnected ? 'ok' : 'error',
|
|
111
|
-
message: isConnected ? 'Connected' : 'Connection failed'
|
|
111
|
+
message: isConnected ? 'Connected' : 'Connection failed',
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
catch (error) {
|
|
115
115
|
return {
|
|
116
116
|
name: config.name || 'database',
|
|
117
117
|
status: 'error',
|
|
118
|
-
message: error instanceof Error ? error.message : 'Database check failed'
|
|
118
|
+
message: error instanceof Error ? error.message : 'Database check failed',
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
};
|
|
@@ -139,14 +139,14 @@ export function createExternalServiceHealthCheck(config) {
|
|
|
139
139
|
const controller = new AbortController();
|
|
140
140
|
const timeout = setTimeout(() => controller.abort(), config.timeout || 5000);
|
|
141
141
|
const response = await fetch(config.url, {
|
|
142
|
-
signal: controller.signal
|
|
142
|
+
signal: controller.signal,
|
|
143
143
|
});
|
|
144
144
|
clearTimeout(timeout);
|
|
145
145
|
return {
|
|
146
146
|
name: config.name,
|
|
147
147
|
status: response.ok ? 'ok' : 'error',
|
|
148
148
|
message: response.ok ? 'Service healthy' : `HTTP ${response.status}`,
|
|
149
|
-
duration: Date.now() - start
|
|
149
|
+
duration: Date.now() - start,
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
catch (error) {
|
|
@@ -154,7 +154,7 @@ export function createExternalServiceHealthCheck(config) {
|
|
|
154
154
|
name: config.name,
|
|
155
155
|
status: 'error',
|
|
156
156
|
message: error instanceof Error ? error.message : 'Service unreachable',
|
|
157
|
-
duration: Date.now() - start
|
|
157
|
+
duration: Date.now() - start,
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
};
|
|
@@ -168,10 +168,10 @@ export function createExternalServiceHealthCheck(config) {
|
|
|
168
168
|
* ```
|
|
169
169
|
*/
|
|
170
170
|
export function livenessProbe() {
|
|
171
|
-
return (
|
|
171
|
+
return (_req, res) => {
|
|
172
172
|
res.status(200).json({
|
|
173
173
|
status: 'alive',
|
|
174
|
-
timestamp: new Date().toISOString()
|
|
174
|
+
timestamp: new Date().toISOString(),
|
|
175
175
|
});
|
|
176
176
|
};
|
|
177
177
|
}
|
|
@@ -186,7 +186,7 @@ export function livenessProbe() {
|
|
|
186
186
|
* ```
|
|
187
187
|
*/
|
|
188
188
|
export function readinessProbe(config = {}) {
|
|
189
|
-
return async (
|
|
189
|
+
return async (_req, res) => {
|
|
190
190
|
const checkResults = [];
|
|
191
191
|
if (config.checks) {
|
|
192
192
|
for (const check of config.checks) {
|
|
@@ -198,23 +198,24 @@ export function readinessProbe(config = {}) {
|
|
|
198
198
|
checkResults.push({
|
|
199
199
|
name: 'unknown',
|
|
200
200
|
status: 'error',
|
|
201
|
-
message: error instanceof Error ? error.message : 'Check failed'
|
|
201
|
+
message: error instanceof Error ? error.message : 'Check failed',
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
const hasErrors = checkResults.some(c => c.status === 'error');
|
|
206
|
+
const hasErrors = checkResults.some((c) => c.status === 'error');
|
|
207
207
|
if (hasErrors) {
|
|
208
208
|
res.status(503).json({
|
|
209
209
|
status: 'not ready',
|
|
210
|
-
checks: checkResults
|
|
210
|
+
checks: checkResults,
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
214
|
res.status(200).json({
|
|
215
215
|
status: 'ready',
|
|
216
|
-
checks: checkResults
|
|
216
|
+
checks: checkResults,
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/health/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,GAAwB,CAAC;AAC7B,IAAI,CAAC;IACH,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACtC,CAAC;AAAC,MAAM,CAAC;IACP,GAAG,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACzC,CAAC;AAwBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,WAAW,CAAC,SAA4B,EAAE;IACxD,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,SAAS,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAExD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,OAAO,KAAK,EACV,IAAa,EACb,GAAoE,EACpE,EAAE;QACF,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAwB,EAAE,CAAC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
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export
|
|
1
|
+
export type { Artifact, BuildLafsExtensionOptions, CreateTaskOptions, DataPart, ExtensionNegotiationMiddlewareOptions, ExtensionNegotiationResult, FilePart, JSONRPCErrorResponse, LafsA2AConfig, LafsExtensionParams, LafsSendMessageParams, ListTasksOptions, ListTasksResult, Message, MessageSendConfiguration, Part, PushNotificationConfig, PushNotificationDeliveryResult, PushTransport, SendMessageResponse, SendMessageSuccessResponse, StreamIteratorOptions, Task, TaskArtifactUpdateEvent, TaskState, TaskStatus, TaskStatusUpdateEvent, TaskStreamEvent, TextPart, } from './a2a/index.js';
|
|
2
|
+
export { A2A_EXTENSIONS_HEADER, AGENT_CARD_PATH, attachLafsEnvelope, buildLafsExtension, createFileArtifact, createLafsArtifact, createTextArtifact, ExtensionSupportRequiredError, extensionNegotiationMiddleware, formatExtensionsHeader, getExtensionParams, HTTP_EXTENSION_HEADER, INTERRUPTED_STATES, InvalidStateTransitionError, isExtensionRequired, isInterruptedState, isTerminalState, isValidTransition, LAFS_EXTENSION_URI, LafsA2AResult, negotiateExtensions, PushNotificationConfigStore, PushNotificationDispatcher, parseExtensionsHeader, streamTaskEvents, TaskArtifactAssembler, TaskEventBus, TaskImmutabilityError, TaskManager, TaskNotFoundError, TaskRefinementError, TERMINAL_STATES, VALID_TRANSITIONS, } from './a2a/index.js';
|
|
3
|
+
export * from './budgetEnforcement.js';
|
|
4
|
+
export * from './circuit-breaker/index.js';
|
|
5
|
+
export * from './compliance.js';
|
|
6
|
+
export * from './conformance.js';
|
|
7
|
+
export * from './conformanceProfiles.js';
|
|
8
|
+
export * from './deprecationRegistry.js';
|
|
9
|
+
export * from './discovery.js';
|
|
10
|
+
export * from './envelope.js';
|
|
11
|
+
export * from './errorRegistry.js';
|
|
12
|
+
export * from './fieldExtraction.js';
|
|
13
|
+
export * from './flagResolver.js';
|
|
14
|
+
export * from './flagSemantics.js';
|
|
15
|
+
export * from './health/index.js';
|
|
16
|
+
export * from './mcpAdapter.js';
|
|
17
|
+
export * from './mviProjection.js';
|
|
18
18
|
export type { LafsProblemDetails } from './problemDetails.js';
|
|
19
|
-
export
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
|
|
19
|
+
export { lafsErrorToProblemDetails, PROBLEM_DETAILS_CONTENT_TYPE } from './problemDetails.js';
|
|
20
|
+
export * from './shutdown/index.js';
|
|
21
|
+
export * from './tokenEstimator.js';
|
|
22
|
+
export * from './types.js';
|
|
23
|
+
export * from './validateEnvelope.js';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,yBAAyB,EACzB,iBAAiB,EACjB,QAAQ,EACR,qCAAqC,EACrC,0BAA0B,EAC1B,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,OAAO,EACP,wBAAwB,EACxB,IAAI,EACJ,sBAAsB,EACtB,8BAA8B,EAC9B,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,IAAI,EACJ,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EAEjB,kBAAkB,EAElB,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EAErB,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EAEnB,eAAe,EACf,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAC9F,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
export * from "./types.js";
|
|
2
|
-
export * from "./errorRegistry.js";
|
|
3
|
-
export * from "./deprecationRegistry.js";
|
|
4
|
-
export * from "./validateEnvelope.js";
|
|
5
|
-
export * from "./envelope.js";
|
|
6
|
-
export * from "./flagSemantics.js";
|
|
7
|
-
export * from "./fieldExtraction.js";
|
|
8
|
-
export * from "./flagResolver.js";
|
|
9
|
-
export * from "./mviProjection.js";
|
|
10
|
-
export * from "./conformance.js";
|
|
11
|
-
export * from "./conformanceProfiles.js";
|
|
12
|
-
export * from "./compliance.js";
|
|
13
|
-
export * from "./tokenEstimator.js";
|
|
14
|
-
export * from "./budgetEnforcement.js";
|
|
15
|
-
export * from "./mcpAdapter.js";
|
|
16
|
-
export * from "./discovery.js";
|
|
17
|
-
export { lafsErrorToProblemDetails, PROBLEM_DETAILS_CONTENT_TYPE } from './problemDetails.js';
|
|
18
|
-
// Operations & Reliability
|
|
19
|
-
export * from "./health/index.js";
|
|
20
|
-
export * from "./shutdown/index.js";
|
|
21
|
-
export * from "./circuit-breaker/index.js";
|
|
22
1
|
// A2A Integration
|
|
23
2
|
// Explicitly re-export to avoid naming conflicts with discovery types
|
|
24
3
|
// (AgentCard, AgentSkill, AgentCapabilities, AgentExtension).
|
|
25
4
|
// For full A2A types, import from '@cleocode/lafs/a2a'.
|
|
26
|
-
export {
|
|
27
|
-
// Bridge
|
|
28
|
-
LafsA2AResult, createLafsArtifact, createTextArtifact, createFileArtifact, isExtensionRequired, getExtensionParams, AGENT_CARD_PATH, HTTP_EXTENSION_HEADER,
|
|
5
|
+
export { A2A_EXTENSIONS_HEADER, AGENT_CARD_PATH, attachLafsEnvelope, buildLafsExtension, createFileArtifact, createLafsArtifact, createTextArtifact, ExtensionSupportRequiredError, extensionNegotiationMiddleware, formatExtensionsHeader, getExtensionParams, HTTP_EXTENSION_HEADER, INTERRUPTED_STATES, InvalidStateTransitionError, isExtensionRequired, isInterruptedState, isTerminalState, isValidTransition,
|
|
29
6
|
// Extensions (T098)
|
|
30
|
-
LAFS_EXTENSION_URI,
|
|
31
|
-
//
|
|
32
|
-
|
|
7
|
+
LAFS_EXTENSION_URI,
|
|
8
|
+
// Bridge
|
|
9
|
+
LafsA2AResult, negotiateExtensions, PushNotificationConfigStore, PushNotificationDispatcher, parseExtensionsHeader, streamTaskEvents, TaskArtifactAssembler,
|
|
33
10
|
// Streaming and Async (T101)
|
|
34
|
-
TaskEventBus,
|
|
11
|
+
TaskEventBus, TaskImmutabilityError, TaskManager, TaskNotFoundError, TaskRefinementError,
|
|
12
|
+
// Task Lifecycle (T099)
|
|
13
|
+
TERMINAL_STATES, VALID_TRANSITIONS, } from './a2a/index.js';
|
|
14
|
+
export * from './budgetEnforcement.js';
|
|
15
|
+
export * from './circuit-breaker/index.js';
|
|
16
|
+
export * from './compliance.js';
|
|
17
|
+
export * from './conformance.js';
|
|
18
|
+
export * from './conformanceProfiles.js';
|
|
19
|
+
export * from './deprecationRegistry.js';
|
|
20
|
+
export * from './discovery.js';
|
|
21
|
+
export * from './envelope.js';
|
|
22
|
+
export * from './errorRegistry.js';
|
|
23
|
+
export * from './fieldExtraction.js';
|
|
24
|
+
export * from './flagResolver.js';
|
|
25
|
+
export * from './flagSemantics.js';
|
|
26
|
+
// Operations & Reliability
|
|
27
|
+
export * from './health/index.js';
|
|
28
|
+
export * from './mcpAdapter.js';
|
|
29
|
+
export * from './mviProjection.js';
|
|
30
|
+
export { lafsErrorToProblemDetails, PROBLEM_DETAILS_CONTENT_TYPE } from './problemDetails.js';
|
|
31
|
+
export * from './shutdown/index.js';
|
|
32
|
+
export * from './tokenEstimator.js';
|
|
33
|
+
export * from './types.js';
|
|
34
|
+
export * from './validateEnvelope.js';
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgCA,kBAAkB;AAClB,sEAAsE;AACtE,8DAA8D;AAC9D,wDAAwD;AACxD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,iBAAiB;AACjB,oBAAoB;AACpB,kBAAkB;AAClB,SAAS;AACT,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB;AACrB,6BAA6B;AAC7B,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,mBAAmB;AACnB,wBAAwB;AACxB,eAAe,EACf,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,2BAA2B;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAC9F,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC"}
|
package/dist/src/mcpAdapter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallToolResult, TextContent } from
|
|
2
|
-
import type { LAFSEnvelope, LAFSError } from
|
|
1
|
+
import type { CallToolResult, TextContent } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { LAFSEnvelope, LAFSError } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Wrap MCP tool result in LAFS envelope
|
|
5
5
|
*
|
|
@@ -17,7 +17,7 @@ export declare function wrapMCPResult(mcpResult: CallToolResult, operation: stri
|
|
|
17
17
|
* @param category - Error category
|
|
18
18
|
* @returns LAFS error envelope
|
|
19
19
|
*/
|
|
20
|
-
export declare function createAdapterErrorEnvelope(message: string, operation: string, category?: LAFSError[
|
|
20
|
+
export declare function createAdapterErrorEnvelope(message: string, operation: string, category?: LAFSError['category']): LAFSEnvelope;
|
|
21
21
|
/**
|
|
22
22
|
* Type guard to check if content is TextContent
|
|
23
23
|
*/
|
|
@@ -26,3 +26,4 @@ export declare function isTextContent(content: unknown): content is TextContent;
|
|
|
26
26
|
* Parse MCP text content as JSON if possible
|
|
27
27
|
*/
|
|
28
28
|
export declare function parseMCPTextContent(content: TextContent): unknown;
|
|
29
|
+
//# sourceMappingURL=mcpAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpAdapter.d.ts","sourceRoot":"","sources":["../../src/mcpAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAA2B,MAAM,YAAY,CAAC;AAmMnF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,YAAY,CA6Dd;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,SAAS,CAAC,UAAU,CAAc,GAC3C,YAAY,CAiCd;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,WAAW,CAStE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAMjE"}
|