@plurnk/plurnk-a2a 1.17.0 → 1.19.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/.env.defaults +12 -8
- package/README.md +16 -13
- package/SPEC.md +155 -37
- package/dist/A2a.d.ts +19 -5
- package/dist/A2a.d.ts.map +1 -1
- package/dist/A2a.js +120 -33
- package/dist/A2a.js.map +1 -1
- package/dist/A2aMessage.d.ts +2 -1
- package/dist/A2aMessage.d.ts.map +1 -1
- package/dist/A2aMessage.js +11 -6
- package/dist/A2aMessage.js.map +1 -1
- package/dist/A2aProjection.d.ts +13 -4
- package/dist/A2aProjection.d.ts.map +1 -1
- package/dist/A2aProjection.js +94 -52
- package/dist/A2aProjection.js.map +1 -1
- package/dist/Functionality.d.ts +6 -4
- package/dist/Functionality.d.ts.map +1 -1
- package/dist/Functionality.js +18 -17
- package/dist/Functionality.js.map +1 -1
- package/dist/Module.d.ts +8 -15
- package/dist/Module.d.ts.map +1 -1
- package/dist/Module.js +75 -40
- package/dist/Module.js.map +1 -1
- package/dist/OutboundModule.d.ts +0 -1
- package/dist/OutboundModule.d.ts.map +1 -1
- package/dist/OutboundModule.js +4 -7
- package/dist/OutboundModule.js.map +1 -1
- package/dist/PlurnkAgentExecutor.d.ts +4 -1
- package/dist/PlurnkAgentExecutor.d.ts.map +1 -1
- package/dist/PlurnkAgentExecutor.js +51 -16
- package/dist/PlurnkAgentExecutor.js.map +1 -1
- package/dist/PlurnkRequestHandler.d.ts +11 -0
- package/dist/PlurnkRequestHandler.d.ts.map +1 -0
- package/dist/PlurnkRequestHandler.js +19 -0
- package/dist/PlurnkRequestHandler.js.map +1 -0
- package/dist/PlurnkTaskStore.d.ts +2 -1
- package/dist/PlurnkTaskStore.d.ts.map +1 -1
- package/dist/PlurnkTaskStore.js +88 -42
- package/dist/PlurnkTaskStore.js.map +1 -1
- package/dist/WorkspaceBinding.d.ts +1 -0
- package/dist/WorkspaceBinding.d.ts.map +1 -1
- package/dist/WorkspaceBinding.js +14 -5
- package/dist/WorkspaceBinding.js.map +1 -1
- package/dist/config.d.ts +5 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +46 -20
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/docs/a2a.md +54 -15
- package/package.json +6 -6
- package/docs/agents.md +0 -42
package/docs/a2a.md
CHANGED
|
@@ -1,22 +1,61 @@
|
|
|
1
|
-
#
|
|
1
|
+
# a2a
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An A2A agent is another agent reachable over HTTP that advertises an Agent
|
|
4
|
+
Card. Once added, it is addressed as `a2a://<alias>` and worked like a worker
|
|
5
|
+
you cannot see inside: `SEND` it a task, wait for its result, `READ` what it
|
|
6
|
+
returned. It is not a tool with a schema; it is a peer that takes instructions
|
|
7
|
+
in prose.
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
Artifacts as addressable Plurnk resources.
|
|
9
|
+
## When to reach for an agent
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
- The user names an agent, or the turn-0 catalog lists an enabled one whose
|
|
12
|
+
card describes the job at hand. `READ (a2a://<alias>)` shows its card and
|
|
13
|
+
skills before you commit work to it.
|
|
14
|
+
- Delegation you could do yourself with a worker (`WORK`) stays a worker:
|
|
15
|
+
an agent is for capability that lives elsewhere.
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
## discover, then add
|
|
18
|
+
|
|
19
|
+
`discover` takes `{"source": "<agent base URL>"}`, fetches the Agent Card, and
|
|
20
|
+
returns one inert candidate carrying the exact definition. `add` persists and
|
|
21
|
+
enables it for this workspace (a host effect, run on acceptance):
|
|
22
|
+
|
|
23
|
+
````a2a (add)
|
|
24
|
+
{"alias": "planner", "definition": {"name": "planner", "url": "https://agents.example.com/planner"}}
|
|
25
|
+
````
|
|
26
|
+
|
|
27
|
+
Authentication is the definition's business (headers or a token the operator
|
|
28
|
+
configured), never something you type into a body. An agent whose card is
|
|
29
|
+
unreachable is listed `unavailable` with its exact Problem. `disable` and
|
|
30
|
+
`remove` follow the family lifecycle; operator-configured agents
|
|
31
|
+
(`PLURNK_A2A_*`) can only be disabled.
|
|
32
|
+
|
|
33
|
+
## Working with an added agent
|
|
34
|
+
|
|
35
|
+
````SEND (a2a://planner) <!-- start a task -->
|
|
36
|
+
Compare the two proposals in docs/ and return a recommendation with evidence.
|
|
12
37
|
````
|
|
13
38
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
A task answers `102` with its `a2a://planner/tasks/<id>` resource and wakes
|
|
40
|
+
your next turn when it concludes; a direct message answers `200` with an
|
|
41
|
+
`a2a://planner/messages/<id>` resource. `READ` the task for its status,
|
|
42
|
+
artifacts, and any input it requests; `SEND` to the task resource to continue
|
|
43
|
+
it; `KILL` it to cancel, which also asks the remote agent to stop.
|
|
44
|
+
|
|
45
|
+
A task resource defaults to a concise `#body` and keeps the protocol snapshot
|
|
46
|
+
in `#json`. Its Artifacts and binary Parts are retained as linked resources;
|
|
47
|
+
`READ` a link to inspect its content. Supplied URLs are not fetched on arrival.
|
|
48
|
+
|
|
49
|
+
## Attachments
|
|
50
|
+
|
|
51
|
+
````SEND (a2a://planner) [{"attachments":["report.pdf","data/results.json"]}]
|
|
52
|
+
Review these results.
|
|
53
|
+
````
|
|
18
54
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
55
|
+
Select exact resource paths or channels. SEND captures their current bytes;
|
|
56
|
+
creating or reading a file alone never sends it. A missing source fails the
|
|
57
|
+
SEND before delivery. To answer an incoming A2A request with files, omit the
|
|
58
|
+
target and use the same attachment option. The caller receives standard
|
|
59
|
+
Artifacts. Incoming files arrive as ordinary resource links; READ them normally.
|
|
60
|
+
Incoming response-format preferences appear beside the message when supplied.
|
|
61
|
+
Attachment media types remain those of the selected resources.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-a2a",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "A2A v1 exterior adapter for Plurnk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"test": "npm run test:lint && npm run test:unit && npm run test:intg",
|
|
32
32
|
"test:lint": "tsc --noEmit",
|
|
33
|
-
"test:unit": "node --conditions=plurnk-dev --test src/*.test.ts",
|
|
34
|
-
"test:intg": "node --conditions=plurnk-dev --test test/intg/*.test.ts",
|
|
33
|
+
"test:unit": "node --conditions=plurnk-dev --env-file=.env.defaults --test src/*.test.ts",
|
|
34
|
+
"test:intg": "node --conditions=plurnk-dev --env-file=.env.defaults --test test/intg/*.test.ts",
|
|
35
35
|
"build:clean": "rm -rf dist",
|
|
36
36
|
"build:dist": "tsc -p tsconfig.build.json",
|
|
37
37
|
"build": "npm run build:clean && npm run build:dist",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"prepublishOnly": "npm audit --audit-level=moderate && npm test"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@a2a-js/sdk": "1.
|
|
42
|
+
"@a2a-js/sdk": "1.2.0",
|
|
43
43
|
"express": "5.2.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@plurnk/plurnk-contracts": "^1.
|
|
47
|
-
"@plurnk/plurnk-schemes": "^1.
|
|
46
|
+
"@plurnk/plurnk-contracts": "^1.19.0",
|
|
47
|
+
"@plurnk/plurnk-schemes": "^1.19.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/express": "5.0.6"
|
package/docs/agents.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# agents
|
|
2
|
-
|
|
3
|
-
An A2A agent is another agent reachable over HTTP that advertises an Agent
|
|
4
|
-
Card. Once added, it is addressed as `a2a://<alias>` and worked like a worker
|
|
5
|
-
you cannot see inside: `SEND` it a task, wait for its result, `READ` what it
|
|
6
|
-
returned. It is not a tool with a schema; it is a peer that takes instructions
|
|
7
|
-
in prose.
|
|
8
|
-
|
|
9
|
-
## When to reach for an agent
|
|
10
|
-
|
|
11
|
-
- The user names an agent, or the turn-0 catalog lists an enabled one whose
|
|
12
|
-
card describes the job at hand. `READ (a2a://<alias>)` shows its card and
|
|
13
|
-
skills before you commit work to it.
|
|
14
|
-
- Delegation you could do yourself with a worker (`WORK`) stays a worker:
|
|
15
|
-
an agent is for capability that lives elsewhere.
|
|
16
|
-
|
|
17
|
-
## discover, then add
|
|
18
|
-
|
|
19
|
-
`discover` takes `{"source": "<agent base URL>"}`, fetches the Agent Card, and
|
|
20
|
-
returns one inert candidate carrying the exact definition. `add` persists and
|
|
21
|
-
enables it for this workspace (a host effect, run on acceptance):
|
|
22
|
-
|
|
23
|
-
````agents (add)
|
|
24
|
-
{"alias": "planner", "definition": {"name": "planner", "url": "https://agents.example.com/planner"}}
|
|
25
|
-
````
|
|
26
|
-
|
|
27
|
-
Authentication is the definition's business (headers or a token the operator
|
|
28
|
-
configured), never something you type into a body. An agent whose card is
|
|
29
|
-
unreachable is listed `unavailable` with its exact Problem.
|
|
30
|
-
|
|
31
|
-
## Working with an added agent
|
|
32
|
-
|
|
33
|
-
````SEND (a2a://planner) <!-- start a task -->
|
|
34
|
-
Compare the two proposals in docs/ and return a recommendation with evidence.
|
|
35
|
-
````
|
|
36
|
-
|
|
37
|
-
A task answers `102` with its `a2a://planner/tasks/<id>` resource and wakes
|
|
38
|
-
your next turn when it concludes; a direct message answers `200` with an
|
|
39
|
-
`a2a://planner/messages/<id>` resource. `READ` the task for its status,
|
|
40
|
-
artifacts, and any input it requests; `SEND` to the task resource to continue
|
|
41
|
-
it; `KILL` it to cancel. `disable` and `remove` follow the family lifecycle;
|
|
42
|
-
operator-configured agents (`PLURNK_A2A_*`) can only be disabled.
|