@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.
Files changed (54) hide show
  1. package/.env.defaults +12 -8
  2. package/README.md +16 -13
  3. package/SPEC.md +155 -37
  4. package/dist/A2a.d.ts +19 -5
  5. package/dist/A2a.d.ts.map +1 -1
  6. package/dist/A2a.js +120 -33
  7. package/dist/A2a.js.map +1 -1
  8. package/dist/A2aMessage.d.ts +2 -1
  9. package/dist/A2aMessage.d.ts.map +1 -1
  10. package/dist/A2aMessage.js +11 -6
  11. package/dist/A2aMessage.js.map +1 -1
  12. package/dist/A2aProjection.d.ts +13 -4
  13. package/dist/A2aProjection.d.ts.map +1 -1
  14. package/dist/A2aProjection.js +94 -52
  15. package/dist/A2aProjection.js.map +1 -1
  16. package/dist/Functionality.d.ts +6 -4
  17. package/dist/Functionality.d.ts.map +1 -1
  18. package/dist/Functionality.js +18 -17
  19. package/dist/Functionality.js.map +1 -1
  20. package/dist/Module.d.ts +8 -15
  21. package/dist/Module.d.ts.map +1 -1
  22. package/dist/Module.js +75 -40
  23. package/dist/Module.js.map +1 -1
  24. package/dist/OutboundModule.d.ts +0 -1
  25. package/dist/OutboundModule.d.ts.map +1 -1
  26. package/dist/OutboundModule.js +4 -7
  27. package/dist/OutboundModule.js.map +1 -1
  28. package/dist/PlurnkAgentExecutor.d.ts +4 -1
  29. package/dist/PlurnkAgentExecutor.d.ts.map +1 -1
  30. package/dist/PlurnkAgentExecutor.js +51 -16
  31. package/dist/PlurnkAgentExecutor.js.map +1 -1
  32. package/dist/PlurnkRequestHandler.d.ts +11 -0
  33. package/dist/PlurnkRequestHandler.d.ts.map +1 -0
  34. package/dist/PlurnkRequestHandler.js +19 -0
  35. package/dist/PlurnkRequestHandler.js.map +1 -0
  36. package/dist/PlurnkTaskStore.d.ts +2 -1
  37. package/dist/PlurnkTaskStore.d.ts.map +1 -1
  38. package/dist/PlurnkTaskStore.js +88 -42
  39. package/dist/PlurnkTaskStore.js.map +1 -1
  40. package/dist/WorkspaceBinding.d.ts +1 -0
  41. package/dist/WorkspaceBinding.d.ts.map +1 -1
  42. package/dist/WorkspaceBinding.js +14 -5
  43. package/dist/WorkspaceBinding.js.map +1 -1
  44. package/dist/config.d.ts +5 -2
  45. package/dist/config.d.ts.map +1 -1
  46. package/dist/config.js +46 -20
  47. package/dist/config.js.map +1 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/index.js.map +1 -1
  52. package/docs/a2a.md +54 -15
  53. package/package.json +6 -6
  54. package/docs/agents.md +0 -42
package/docs/a2a.md CHANGED
@@ -1,22 +1,61 @@
1
- # A2A
1
+ # a2a
2
2
 
3
- ## Summary
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
- Call configured A2A v1 agents and retain their current Messages, Tasks, and
6
- Artifacts as addressable Plurnk resources.
9
+ ## When to reach for an agent
7
10
 
8
- ## Invocation
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
- ````SEND (a2a://researcher)
11
- Compare the two proposals and return a recommendation with evidence.
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
- `SEND` to an agent root starts new work. A Task response returns `102` and an
15
- exact `a2a://<agent>/tasks/<id>` resource; a direct Message returns `200` and an
16
- exact `a2a://<agent>/messages/<id>` resource. Continue an interrupted Task by
17
- sending the requested input to its Task resource.
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
- Task resources default to a concise `#body` and retain the protocol snapshot in
20
- `#json`. Their Artifact addresses are listed in the body and materialize on
21
- READ. ````` ````KILL ````` of a live Task resource cancels the local obligation and
22
- requests remote cancellation.
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.17.0",
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.1.0",
42
+ "@a2a-js/sdk": "1.2.0",
43
43
  "express": "5.2.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "@plurnk/plurnk-contracts": "^1.17.0",
47
- "@plurnk/plurnk-schemes": "^1.17.0"
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.