@cleocode/lafs-protocol 1.3.2 → 1.4.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.
- package/README.md +31 -4
- package/dist/schemas/v1/conformance-profiles.json +35 -0
- package/dist/src/a2a/bindings/index.d.ts +4 -0
- package/dist/src/a2a/bindings/index.js +25 -0
- package/dist/src/a2a/bridge.d.ts +2 -1
- package/dist/src/a2a/bridge.js +17 -0
- package/dist/src/a2a/extensions.d.ts +17 -0
- package/dist/src/a2a/extensions.js +43 -1
- package/dist/src/a2a/index.d.ts +3 -1
- package/dist/src/a2a/index.js +8 -2
- package/dist/src/a2a/streaming.d.ts +74 -0
- package/dist/src/a2a/streaming.js +265 -0
- package/dist/src/a2a/task-lifecycle.d.ts +11 -0
- package/dist/src/a2a/task-lifecycle.js +52 -2
- package/dist/src/compliance.d.ts +31 -0
- package/dist/src/compliance.js +89 -0
- package/dist/src/conformance.d.ts +5 -1
- package/dist/src/conformance.js +103 -3
- package/dist/src/conformanceProfiles.d.ts +11 -0
- package/dist/src/conformanceProfiles.js +34 -0
- package/dist/src/deprecationRegistry.d.ts +13 -0
- package/dist/src/deprecationRegistry.js +39 -0
- package/dist/src/envelope.d.ts +46 -0
- package/dist/src/envelope.js +89 -0
- package/dist/src/errorRegistry.d.ts +6 -0
- package/dist/src/errorRegistry.js +16 -0
- package/dist/src/index.d.ts +6 -2
- package/dist/src/index.js +8 -2
- package/lafs.md +15 -3
- package/package.json +7 -2
- package/schemas/v1/conformance-profiles.json +35 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
2
|
export * from "./errorRegistry.js";
|
|
3
|
+
export * from "./deprecationRegistry.js";
|
|
3
4
|
export * from "./validateEnvelope.js";
|
|
5
|
+
export * from "./envelope.js";
|
|
4
6
|
export * from "./flagSemantics.js";
|
|
5
7
|
export * from "./conformance.js";
|
|
8
|
+
export * from "./conformanceProfiles.js";
|
|
9
|
+
export * from "./compliance.js";
|
|
6
10
|
export * from "./tokenEstimator.js";
|
|
7
11
|
export * from "./budgetEnforcement.js";
|
|
8
12
|
export * from "./mcpAdapter.js";
|
|
@@ -10,6 +14,6 @@ export * from "./discovery.js";
|
|
|
10
14
|
export * from "./health/index.js";
|
|
11
15
|
export * from "./shutdown/index.js";
|
|
12
16
|
export * from "./circuit-breaker/index.js";
|
|
13
|
-
export { LafsA2AResult, createLafsArtifact, createTextArtifact, createFileArtifact, isExtensionRequired, getExtensionParams, AGENT_CARD_PATH, HTTP_EXTENSION_HEADER, LAFS_EXTENSION_URI, A2A_EXTENSIONS_HEADER, parseExtensionsHeader, negotiateExtensions, formatExtensionsHeader, buildLafsExtension, ExtensionSupportRequiredError, extensionNegotiationMiddleware, TERMINAL_STATES, INTERRUPTED_STATES, VALID_TRANSITIONS, isValidTransition, isTerminalState, isInterruptedState, InvalidStateTransitionError, TaskImmutabilityError, TaskNotFoundError, TaskManager, attachLafsEnvelope, } from "./a2a/index.js";
|
|
14
|
-
export type { LafsA2AConfig, LafsSendMessageParams, LafsExtensionParams, ExtensionNegotiationResult, BuildLafsExtensionOptions, ExtensionNegotiationMiddlewareOptions, CreateTaskOptions, ListTasksOptions, ListTasksResult, } from "./a2a/index.js";
|
|
17
|
+
export { LafsA2AResult, createLafsArtifact, createTextArtifact, createFileArtifact, isExtensionRequired, getExtensionParams, AGENT_CARD_PATH, HTTP_EXTENSION_HEADER, LAFS_EXTENSION_URI, A2A_EXTENSIONS_HEADER, parseExtensionsHeader, negotiateExtensions, formatExtensionsHeader, buildLafsExtension, ExtensionSupportRequiredError, extensionNegotiationMiddleware, TERMINAL_STATES, INTERRUPTED_STATES, VALID_TRANSITIONS, isValidTransition, isTerminalState, isInterruptedState, InvalidStateTransitionError, TaskImmutabilityError, TaskNotFoundError, TaskRefinementError, TaskManager, attachLafsEnvelope, TaskEventBus, PushNotificationConfigStore, PushNotificationDispatcher, TaskArtifactAssembler, streamTaskEvents, } from "./a2a/index.js";
|
|
18
|
+
export type { LafsA2AConfig, LafsSendMessageParams, LafsExtensionParams, ExtensionNegotiationResult, BuildLafsExtensionOptions, ExtensionNegotiationMiddlewareOptions, CreateTaskOptions, ListTasksOptions, ListTasksResult, TaskStreamEvent, StreamIteratorOptions, PushNotificationDeliveryResult, PushTransport, } from "./a2a/index.js";
|
|
15
19
|
export type { Task, TaskState, TaskStatus, Artifact, Part, Message, PushNotificationConfig, MessageSendConfiguration, TaskStatusUpdateEvent, TaskArtifactUpdateEvent, SendMessageResponse, SendMessageSuccessResponse, JSONRPCErrorResponse, TextPart, DataPart, FilePart, } from "./a2a/index.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
2
|
export * from "./errorRegistry.js";
|
|
3
|
+
export * from "./deprecationRegistry.js";
|
|
3
4
|
export * from "./validateEnvelope.js";
|
|
5
|
+
export * from "./envelope.js";
|
|
4
6
|
export * from "./flagSemantics.js";
|
|
5
7
|
export * from "./conformance.js";
|
|
8
|
+
export * from "./conformanceProfiles.js";
|
|
9
|
+
export * from "./compliance.js";
|
|
6
10
|
export * from "./tokenEstimator.js";
|
|
7
11
|
export * from "./budgetEnforcement.js";
|
|
8
12
|
export * from "./mcpAdapter.js";
|
|
@@ -17,8 +21,10 @@ export * from "./circuit-breaker/index.js";
|
|
|
17
21
|
// For full A2A types, import from '@cleocode/lafs-protocol/a2a'.
|
|
18
22
|
export {
|
|
19
23
|
// Bridge
|
|
20
|
-
LafsA2AResult, createLafsArtifact, createTextArtifact, createFileArtifact, isExtensionRequired, getExtensionParams,
|
|
24
|
+
LafsA2AResult, createLafsArtifact, createTextArtifact, createFileArtifact, isExtensionRequired, getExtensionParams, AGENT_CARD_PATH, HTTP_EXTENSION_HEADER,
|
|
21
25
|
// Extensions (T098)
|
|
22
26
|
LAFS_EXTENSION_URI, A2A_EXTENSIONS_HEADER, parseExtensionsHeader, negotiateExtensions, formatExtensionsHeader, buildLafsExtension, ExtensionSupportRequiredError, extensionNegotiationMiddleware,
|
|
23
27
|
// Task Lifecycle (T099)
|
|
24
|
-
TERMINAL_STATES, INTERRUPTED_STATES, VALID_TRANSITIONS, isValidTransition, isTerminalState, isInterruptedState, InvalidStateTransitionError, TaskImmutabilityError, TaskNotFoundError, TaskManager, attachLafsEnvelope,
|
|
28
|
+
TERMINAL_STATES, INTERRUPTED_STATES, VALID_TRANSITIONS, isValidTransition, isTerminalState, isInterruptedState, InvalidStateTransitionError, TaskImmutabilityError, TaskNotFoundError, TaskRefinementError, TaskManager, attachLafsEnvelope,
|
|
29
|
+
// Streaming and Async (T101)
|
|
30
|
+
TaskEventBus, PushNotificationConfigStore, PushNotificationDispatcher, TaskArtifactAssembler, streamTaskEvents, } from "./a2a/index.js";
|
package/lafs.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# LAFS: LLM-Agent-First Specification
|
|
2
2
|
|
|
3
3
|
> 📚 **Documentation:** https://codluv.gitbook.io/lafs-protocol/
|
|
4
|
-
> **Version:** 1.
|
|
4
|
+
> **Version:** 1.4.1 | **Status:** Production Ready
|
|
5
5
|
|
|
6
6
|
## 1. Scope
|
|
7
7
|
|
|
@@ -130,7 +130,7 @@ All responses MUST conform to `schemas/v1/envelope.schema.json`.
|
|
|
130
130
|
"requestId": "req_123",
|
|
131
131
|
"transport": "cli",
|
|
132
132
|
"strict": true,
|
|
133
|
-
"mvi":
|
|
133
|
+
"mvi": "standard",
|
|
134
134
|
"contextVersion": 0
|
|
135
135
|
},
|
|
136
136
|
"success": true,
|
|
@@ -142,7 +142,6 @@ All responses MUST conform to `schemas/v1/envelope.schema.json`.
|
|
|
142
142
|
|
|
143
143
|
### 6.1 Envelope invariants
|
|
144
144
|
|
|
145
|
-
- Exactly one of `result` or `error` MUST be non-null.
|
|
146
145
|
- `success=true` implies `error=null` or error omitted.
|
|
147
146
|
- `success=false` implies `result=null` and `error` MUST be present.
|
|
148
147
|
- The `page` and `error` fields are optional when their value would be null. In strict mode, producers SHOULD omit these fields rather than set them to null.
|
|
@@ -413,6 +412,16 @@ Returns checksum and version for validation.
|
|
|
413
412
|
- **Validation**: Use `mode=summary` to verify sync state
|
|
414
413
|
- **Default recommendation**: `delta` mode for agent-optimal behavior
|
|
415
414
|
|
|
415
|
+
### 8.2 Lazy Context Retrieval
|
|
416
|
+
|
|
417
|
+
To reduce token and I/O overhead, implementations SHOULD support lazy retrieval semantics:
|
|
418
|
+
|
|
419
|
+
- Clients SHOULD start with `mode=summary` and request `mode=delta` only when `version` or `checksum` changes.
|
|
420
|
+
- Delta responses SHOULD be bounded by `limit` and MAY return paged deltas.
|
|
421
|
+
- Servers SHOULD treat context retrieval as task-scoped and MUST NOT leak entries across `contextId` domains.
|
|
422
|
+
- When a consumer requests additional context beyond MVI defaults, servers MAY return progressive context slices rather than full ledgers.
|
|
423
|
+
- If requested context scope cannot be satisfied within declared budget, servers SHOULD fail with `E_MVI_BUDGET_EXCEEDED`.
|
|
424
|
+
|
|
416
425
|
---
|
|
417
426
|
|
|
418
427
|
## 9. MVI and Progressive Disclosure
|
|
@@ -448,6 +457,9 @@ Clients MAY request expanded/nested data via the `_expand` request parameter.
|
|
|
448
457
|
- List operations SHOULD return deterministic `page` metadata.
|
|
449
458
|
- Pagination mode (offset or cursor) MUST be documented.
|
|
450
459
|
- Mixed pagination modes in one request MUST fail validation.
|
|
460
|
+
- `page.limit` SHOULD represent the effective item window after `_fields`/`_expand` processing.
|
|
461
|
+
- When `_meta.mvi` is `minimal` and projected payload size exceeds budget, servers SHOULD reduce `page.limit` rather than silently truncate item content.
|
|
462
|
+
- If limit reduction still cannot satisfy declared budget, servers MUST fail with `E_MVI_BUDGET_EXCEEDED`.
|
|
451
463
|
|
|
452
464
|
### 9.5 Token Budget Signaling
|
|
453
465
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/lafs-protocol",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "LLM-Agent-First Specification schemas and conformance tooling",
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
"./a2a/bindings": {
|
|
23
23
|
"import": "./dist/src/a2a/bindings/index.js",
|
|
24
24
|
"types": "./dist/src/a2a/bindings/index.d.ts"
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"./schemas/v1/envelope.schema.json": "./schemas/v1/envelope.schema.json",
|
|
27
|
+
"./schemas/v1/error-registry.json": "./schemas/v1/error-registry.json",
|
|
28
|
+
"./schemas/v1/context-ledger.schema.json": "./schemas/v1/context-ledger.schema.json",
|
|
29
|
+
"./schemas/v1/discovery.schema.json": "./schemas/v1/discovery.schema.json",
|
|
30
|
+
"./schemas/v1/conformance-profiles.json": "./schemas/v1/conformance-profiles.json"
|
|
26
31
|
},
|
|
27
32
|
"files": [
|
|
28
33
|
"dist",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"tiers": {
|
|
5
|
+
"core": [
|
|
6
|
+
"envelope_schema_valid",
|
|
7
|
+
"envelope_invariants",
|
|
8
|
+
"error_code_registered"
|
|
9
|
+
],
|
|
10
|
+
"standard": [
|
|
11
|
+
"envelope_schema_valid",
|
|
12
|
+
"envelope_invariants",
|
|
13
|
+
"error_code_registered",
|
|
14
|
+
"transport_mapping_consistent",
|
|
15
|
+
"meta_mvi_present",
|
|
16
|
+
"meta_strict_present",
|
|
17
|
+
"strict_mode_behavior",
|
|
18
|
+
"pagination_mode_consistent",
|
|
19
|
+
"strict_mode_enforced"
|
|
20
|
+
],
|
|
21
|
+
"complete": [
|
|
22
|
+
"envelope_schema_valid",
|
|
23
|
+
"envelope_invariants",
|
|
24
|
+
"error_code_registered",
|
|
25
|
+
"transport_mapping_consistent",
|
|
26
|
+
"context_mutation_failure",
|
|
27
|
+
"context_preservation_valid",
|
|
28
|
+
"meta_mvi_present",
|
|
29
|
+
"meta_strict_present",
|
|
30
|
+
"strict_mode_behavior",
|
|
31
|
+
"pagination_mode_consistent",
|
|
32
|
+
"strict_mode_enforced"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|