@amaster.ai/dsh-a2a 0.1.35 → 0.1.36
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 +18 -17
- package/lib/inbox-api.js +2 -2
- package/lib/inbox.js +1 -1
- package/lib/index.js +1 -3
- package/lib/types/inbox.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,13 +20,13 @@ Standard `SendMessage` / `SendStreamingMessage`, task queries, cancellation and
|
|
|
20
20
|
|
|
21
21
|
The same-process `a2aInbox` service exposes `resolve`, `content`, `enqueue`, `promote`, `cancel`, `get`, `update`, `move`, `remove`, `clearPending`, and `executePending`, plus the existing pause/wake/resume controls. Pending-only clearing preserves active work; context clearing discards all work.
|
|
22
22
|
|
|
23
|
-
For external clients, the [native inbox extension specification](#native-inbox-extension-v1) defines `
|
|
23
|
+
For external clients, the [native inbox extension specification](#native-inbox-extension-v1) defines `inbox/get`, `update`, `move`, `remove`, `clear`, `execute`, `steer`, and `subscribe` at the advertised JSONRPC endpoint. Activate it with the `A2A-Extensions` header set to the extension URI. Updates use standard A2A 1.0 user Messages; operations address native inbox IDs. REST/gRPC clients use the advertised JSONRPC endpoint for these extension methods. No extra queue or consumer is created.
|
|
24
24
|
|
|
25
|
-
`
|
|
25
|
+
`inbox/subscribe` streams checkpointed invalidations `{contextId, version}` over SSE, including native consumption and edits. It registers before its initial checkpoint and sends only after owner-scoped `ctx.sessions.flush()` returns true. A false/rejected checkpoint sends no success notification. Re-read the live inbox on invalidation and reconnect; there is no replay or durable outbox. Slow clients disconnect instead of accumulating notifications. To publish the same invalidations to host listeners on `a2a/inbox-checkpointed` without an SSE subscriber, enable `inbox.notifications: true` (default false). Hosts retain authentication, authorization and product-specific fan-out.
|
|
26
26
|
|
|
27
27
|
Existing native agents keep their setup and lifecycle owner. Reading/subscribing does not block their producers. Plugin shutdown detaches its own queued A2A inputs from a borrowed agent, retaining recovery data when configured; native work and the caller's agent remain available.
|
|
28
28
|
|
|
29
|
-
Wire snapshots are paginated: 50 entries by default, `pageSize: 1..100`, with `totalSize` and `nextPageToken`. Read `
|
|
29
|
+
Wire snapshots are paginated: 50 entries by default, `pageSize: 1..100`, with `totalSize` and `nextPageToken`. Read `inbox/get` until the token is empty, traversing next-step before next-turn. Any session-version change invalidates the cursor; restart from the first page. Mutations accept `pageSize` and return the first page. Same-process calls without page options still return the full snapshot. Adjacent reorders log only their affected interval, and slow notification checkpoints keep one pending version/error observer per batch.
|
|
30
30
|
|
|
31
31
|
The `E2E (dsh-a2a.inbox-api)` matrix leg installs the packed plugin into the pinned CLI and uses the real model gateway. It checks queue editing/reordering/removal/clearing, execution and steering, two checkpointed SSE subscribers, native consumption, and model recall in a subsequent context turn. A local loopback forwarder only gates the first model request to make steering deterministic; it never generates model responses.
|
|
32
32
|
|
|
@@ -77,11 +77,10 @@ DSH_NATIVE_OWNERSHIP_LANGFUSE_LIVE=true node .github/scripts/check-inbox.mjs -t
|
|
|
77
77
|
|
|
78
78
|
## Native inbox extension v1
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Protocol identifier: `https://github.com/TGYD-helige/dsh-plugins/blob/main/packages/dsh-a2a/README.md`
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`documentationUrl` pointing to this section.
|
|
82
|
+
This README contains the extension specification. The URI identifies the
|
|
83
|
+
extension during negotiation; no additional documentation parameter is advertised.
|
|
85
84
|
|
|
86
85
|
This is a project extension, not an official A2A extension. It follows the
|
|
87
86
|
[A2A extension mechanism](https://a2a-protocol.org/v1.0.1/topics/extensions/).
|
|
@@ -91,6 +90,8 @@ states, subscriptions and Push configurations keep their official meanings.
|
|
|
91
90
|
|
|
92
91
|
### Methods
|
|
93
92
|
|
|
93
|
+
Methods use the implementation-neutral `inbox/` namespace.
|
|
94
|
+
|
|
94
95
|
Send JSON-RPC 2.0 requests to the advertised JSONRPC endpoint. All methods take
|
|
95
96
|
`contextId`. IDs named `id` below are **native inbox message IDs**, not task IDs.
|
|
96
97
|
The extension adds no REST or gRPC service; those clients can discover and use
|
|
@@ -98,14 +99,14 @@ the advertised JSONRPC endpoint for these operations.
|
|
|
98
99
|
|
|
99
100
|
| Method | Additional parameters | Result |
|
|
100
101
|
| --- | --- | --- |
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
102
|
+
| `inbox/get` | Optional `pageSize`, `pageToken` | Live inbox snapshot page |
|
|
103
|
+
| `inbox/update` | `id`, `message` (A2A 1.0 user Message) | Updated snapshot |
|
|
104
|
+
| `inbox/move` | `id`, `index` (zero-based destination in the same list) | Updated snapshot |
|
|
105
|
+
| `inbox/remove` | `id` | Updated snapshot |
|
|
106
|
+
| `inbox/clear` | — | Snapshot after clearing pending input |
|
|
107
|
+
| `inbox/execute` | Optional `id` to move first in the next-turn list | Snapshot after waking pending work |
|
|
108
|
+
| `inbox/steer` | `id`, `taskId` (active target) | Snapshot after promotion |
|
|
109
|
+
| `inbox/subscribe` | — | SSE JSON-RPC result stream of `{contextId, version}` |
|
|
109
110
|
|
|
110
111
|
A snapshot is `{contextId, version, nextTurn, nextStep, totalSize, nextPageToken}`. Each entry is
|
|
111
112
|
`{id, message, editable}`: `message` uses the standard A2A 1.0 Message JSON shape.
|
|
@@ -129,7 +130,7 @@ limit serialized entries to about 1 MiB; one oversized Message is returned intac
|
|
|
129
130
|
to ensure progress, so a page may contain fewer items than requested. All mutation
|
|
130
131
|
methods accept `pageSize` for their returned first page; invalid values reject
|
|
131
132
|
before changing the queue. Pages traverse `nextStep` before `nextTurn`, keeping
|
|
132
|
-
native order within each list. Continue via `
|
|
133
|
+
native order within each list. Continue via `inbox/get` and `nextPageToken`
|
|
133
134
|
until the token is empty. Tokens bind the context and session version; a changed
|
|
134
135
|
version rejects stale tokens instead of silently skipping or duplicating input.
|
|
135
136
|
Re-read from the first page after invalidation. Same-process `get(contextId)`
|
|
@@ -165,7 +166,7 @@ coalesce changes per context, and checkpoint before publishing. A rejected or
|
|
|
165
166
|
false checkpoint produces no success notification. Later changes or reconnects
|
|
166
167
|
retry the current state; there is no durable outbox, replay or exactly-once
|
|
167
168
|
delivery. A host can consume the same feed through `a2a/inbox-checkpointed`.
|
|
168
|
-
Notification data contains no message bodies. Re-read `
|
|
169
|
+
Notification data contains no message bodies. Re-read `inbox/get` after an
|
|
169
170
|
invalidation and on reconnect. Each context checkpoints independently; slow SSE
|
|
170
171
|
clients disconnect instead of creating an unbounded notification backlog.
|
|
171
172
|
Closing the plugin unregisters observers/subscriptions and suppresses late sends.
|
package/lib/inbox-api.js
CHANGED
|
@@ -6,7 +6,7 @@ import { INBOX_EXTENSION, validateInboxPage } from './inbox.js';
|
|
|
6
6
|
export function inboxRpcHandler(inbox, card) {
|
|
7
7
|
return async (req, res, next) => {
|
|
8
8
|
const body = req.body;
|
|
9
|
-
if (typeof body?.method !== 'string' || !body.method.startsWith('
|
|
9
|
+
if (typeof body?.method !== 'string' || !body.method.startsWith('inbox/'))
|
|
10
10
|
return next();
|
|
11
11
|
try {
|
|
12
12
|
if (body.jsonrpc !== '2.0' || !['string', 'number'].includes(typeof body.id))
|
|
@@ -23,7 +23,7 @@ export function inboxRpcHandler(inbox, card) {
|
|
|
23
23
|
!params.contextId.trim() ||
|
|
24
24
|
(params.tenant !== undefined && params.tenant !== ''))
|
|
25
25
|
throw new RequestMalformedError('A contextId and the default tenant are required.');
|
|
26
|
-
const method = body.method.slice('
|
|
26
|
+
const method = body.method.slice('inbox/'.length);
|
|
27
27
|
const page = { pageSize: params.pageSize, pageToken: params.pageToken };
|
|
28
28
|
validateInboxPage(page);
|
|
29
29
|
if (method !== 'get' && page.pageToken)
|
package/lib/inbox.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createUserMessage } from '@deepseek-ai/dsh-llm/message';
|
|
|
7
7
|
import { InboxChanges } from './inbox-changes.js';
|
|
8
8
|
import { commitInboxInput, markInboxInputPending } from './task-store.js';
|
|
9
9
|
import { agentTextMessage, SessionTranslator, terminalStatusUpdate } from './translator.js';
|
|
10
|
-
export const INBOX_EXTENSION = 'https://github.com/TGYD-helige/dsh-plugins/blob/main/
|
|
10
|
+
export const INBOX_EXTENSION = 'https://github.com/TGYD-helige/dsh-plugins/blob/main/packages/dsh-a2a/README.md';
|
|
11
11
|
const RETAINED_INPUTS = `${INBOX_EXTENSION}#retained-inputs`;
|
|
12
12
|
export function validateInboxPage(page) {
|
|
13
13
|
if (page === undefined)
|
package/lib/index.js
CHANGED
|
@@ -178,9 +178,7 @@ export function apply(ctx, config) {
|
|
|
178
178
|
uri: INBOX_EXTENSION,
|
|
179
179
|
description: 'Native inbox management, steering and checkpointed invalidation',
|
|
180
180
|
required: false,
|
|
181
|
-
params:
|
|
182
|
-
documentationUrl: 'https://github.com/TGYD-helige/dsh-plugins/blob/main/packages/dsh-a2a/README.md#native-inbox-extension-v1',
|
|
183
|
-
},
|
|
181
|
+
params: undefined,
|
|
184
182
|
},
|
|
185
183
|
]
|
|
186
184
|
: [],
|
package/lib/types/inbox.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { InboxChanges } from './inbox-changes.js';
|
|
|
10
10
|
import type { A2aTurnContext } from './index.js';
|
|
11
11
|
import type { A2aServer } from './server.js';
|
|
12
12
|
import { type ManagedTaskStore } from './task-store.js';
|
|
13
|
-
export declare const INBOX_EXTENSION = "https://github.com/TGYD-helige/dsh-plugins/blob/main/
|
|
13
|
+
export declare const INBOX_EXTENSION = "https://github.com/TGYD-helige/dsh-plugins/blob/main/packages/dsh-a2a/README.md";
|
|
14
14
|
export interface A2aInboxEvent {
|
|
15
15
|
phase: string;
|
|
16
16
|
contextId: string;
|
package/package.json
CHANGED