@pi-in-go/pigpen-a2a 0.1.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 (52) hide show
  1. package/CREDITS.md +26 -0
  2. package/LICENSE +21 -0
  3. package/README.md +97 -0
  4. package/extensions/a2a/auth.go +120 -0
  5. package/extensions/a2a/auth_test.go +133 -0
  6. package/extensions/a2a/bench_test.go +70 -0
  7. package/extensions/a2a/binary_test.go +225 -0
  8. package/extensions/a2a/cancelqueued_test.go +142 -0
  9. package/extensions/a2a/card_cache_test.go +42 -0
  10. package/extensions/a2a/client.go +499 -0
  11. package/extensions/a2a/client_test.go +402 -0
  12. package/extensions/a2a/config.go +282 -0
  13. package/extensions/a2a/config_test.go +194 -0
  14. package/extensions/a2a/e2e_test.go +311 -0
  15. package/extensions/a2a/executor.go +318 -0
  16. package/extensions/a2a/extension.go +382 -0
  17. package/extensions/a2a/extension_test.go +396 -0
  18. package/extensions/a2a/fakehost_test.go +548 -0
  19. package/extensions/a2a/fakepig_test.go +212 -0
  20. package/extensions/a2a/gaps_test.go +59 -0
  21. package/extensions/a2a/go.mod +15 -0
  22. package/extensions/a2a/go.sum +14 -0
  23. package/extensions/a2a/interop_test.go +163 -0
  24. package/extensions/a2a/procattr_other.go +25 -0
  25. package/extensions/a2a/procattr_windows.go +26 -0
  26. package/extensions/a2a/resubscribe_test.go +113 -0
  27. package/extensions/a2a/review_test.go +293 -0
  28. package/extensions/a2a/server.go +267 -0
  29. package/extensions/a2a/server_test.go +792 -0
  30. package/extensions/a2a/survivors_test.go +302 -0
  31. package/extensions/a2a/worker.go +388 -0
  32. package/extensions/a2a/worker_test.go +257 -0
  33. package/package.json +41 -0
  34. package/port/PORT.md +126 -0
  35. package/port/a2a-go-LICENSE +201 -0
  36. package/port/golden/flag-without-auth-refused.jsonl +5 -0
  37. package/port/golden/listener-off.jsonl +4 -0
  38. package/port/golden/send-missing-message.jsonl +18 -0
  39. package/port/golden/send-without-remotes.jsonl +18 -0
  40. package/port/golden/task-unknown-action.jsonl +18 -0
  41. package/port/golden/tools-visible-to-model.jsonl +11 -0
  42. package/port/interop/kagent/main.go +73 -0
  43. package/port/mutation-run.txt +222 -0
  44. package/port/mutations.json +656 -0
  45. package/port/red.txt +105 -0
  46. package/port/scenarios/flag-without-auth-refused.json +8 -0
  47. package/port/scenarios/listener-off.json +7 -0
  48. package/port/scenarios/send-missing-message.json +11 -0
  49. package/port/scenarios/send-without-remotes.json +11 -0
  50. package/port/scenarios/task-unknown-action.json +11 -0
  51. package/port/scenarios/tools-visible-to-model.json +8 -0
  52. package/provenance.json +18 -0
package/port/red.txt ADDED
@@ -0,0 +1,105 @@
1
+ # RED run on the signature stub (Extension() registers nothing, every function returns "not implemented")
2
+ # go test -count=1 -v ./... (PiG 63c6ba456 SDK, a2a-go v2.6.0, go1.27.1)
3
+ # Stub-passing cases (error-only expectations or gap skips) are proven by mutation after green; see PORT.md.
4
+ --- FAIL: TestAuthenticateBearer (0.00s)
5
+ --- FAIL: TestAuthenticateRejects (0.00s)
6
+ --- FAIL: TestTokenInQueryStringIsIgnored (0.00s)
7
+ --- FAIL: TestWrapRejectsWith401AndChallenge (0.00s)
8
+ --- FAIL: TestWrapPassesPrincipalAndPublicPaths (0.00s)
9
+ --- FAIL: TestPrincipalKeysIsolate (0.00s)
10
+ --- FAIL: TestInsecureNoAuthGivesOneAnonymousPrincipal (0.00s)
11
+ --- PASS: TestNoTokensNoInsecureFlagIsAnError (0.00s)
12
+ --- FAIL: TestRemotesNamesAreSorted (0.00s)
13
+ --- FAIL: TestCardResolvesAndSummarises (0.00s)
14
+ --- FAIL: TestSendReturnsCompletedTaskText (0.00s)
15
+ --- FAIL: TestSendReusesContextAndSendsProtocolVersion (0.00s)
16
+ --- FAIL: TestBearerAndCustomHeadersComeFromEnvironment (0.00s)
17
+ --- FAIL: TestMissingTokenEnvironmentIsAnErrorBeforeAnyRequest (0.00s)
18
+ --- PASS: TestRemoteAuthFailureDoesNotEchoTheToken (0.00s)
19
+ --- FAIL: TestCardWithoutAProtocol10InterfaceIsRefused (0.00s)
20
+ --- FAIL: TestSkipCardUsesTheEndpointDirectly (0.00s)
21
+ --- FAIL: TestUnknownAgentNamesTheKnownOnes (0.00s)
22
+ --- FAIL: TestFailedAndInputRequiredStates (0.00s)
23
+ --- FAIL: TestCancellingTheCallCancelsTheRemoteTask (10.00s)
24
+ --- FAIL: TestGetAndCancelTask (0.00s)
25
+ --- PASS: TestSendHonoursTheConfiguredTimeout (0.00s)
26
+ --- FAIL: TestListenerIsOffUnlessConfigured (0.00s)
27
+ --- FAIL: TestConfigFileEnablesListener (0.00s)
28
+ --- FAIL: TestPrecedenceFlagOverEnvOverFile (0.00s)
29
+ --- FAIL: TestConfigPathFromEnv (0.00s)
30
+ --- PASS: TestInlineSecretsAreRejected (0.00s)
31
+ --- PASS: TestInlineSecretsAreRejected/token (0.00s)
32
+ --- PASS: TestInlineSecretsAreRejected/bearerToken (0.00s)
33
+ --- PASS: TestInlineSecretsAreRejected/unknown (0.00s)
34
+ --- PASS: TestListenerNeedsAuthentication (0.00s)
35
+ --- FAIL: TestInsecureNoAuthOnlyOnLoopback (0.00s)
36
+ --- FAIL: TestTokenEnvMustBeSetAndIsNotEchoed (0.00s)
37
+ --- PASS: TestTokenConfigValidation (0.00s)
38
+ --- PASS: TestTokenConfigValidation/duplicate_value (0.00s)
39
+ --- PASS: TestTokenConfigValidation/short_token (0.00s)
40
+ --- PASS: TestTokenConfigValidation/bad_tenant (0.00s)
41
+ --- PASS: TestTokenConfigValidation/no_name (0.00s)
42
+ --- PASS: TestTokenConfigValidation/duplicate_name (0.00s)
43
+ --- PASS: TestListenAddressMustBeHostPort (0.00s)
44
+ --- FAIL: TestRemoteDefaultsAndValidation (0.00s)
45
+ --- FAIL: TestWorkerDefaultsAreReadOnly (0.00s)
46
+ --- FAIL: TestWorkerProcessDoesNotOpenAListener (0.00s)
47
+ --- SKIP: TestGap_GRPCTransportBinding (0.00s)
48
+ --- SKIP: TestGap_RESTTransportBinding (0.00s)
49
+ --- SKIP: TestGap_PushNotifications (0.00s)
50
+ --- SKIP: TestGap_ProtocolV03Compatibility (0.00s)
51
+ --- SKIP: TestGap_ExtendedAgentCard (0.00s)
52
+ --- SKIP: TestGap_PersistentTaskStore (0.00s)
53
+ --- SKIP: TestGap_InputRequiredFromPiG (0.00s)
54
+ --- SKIP: TestGap_FileAndDataParts (0.00s)
55
+ --- SKIP: TestGap_OAuth2AndMutualTLSAuthentication (0.00s)
56
+ --- SKIP: TestGap_SignedAgentCards (0.00s)
57
+ --- SKIP: TestGap_SubscribeToTaskAfterRestart (0.00s)
58
+ --- SKIP: TestGap_ClientStreamingProgressToTheModel (0.00s)
59
+ --- FAIL: TestAgentCardIsPublicAndPinnedToProtocol10 (0.00s)
60
+ --- FAIL: TestAgentCardAdvertisesExternalURL (0.00s)
61
+ --- FAIL: TestUnauthenticatedRequestIsRejectedBeforeTheWorker (0.00s)
62
+ --- FAIL: TestSendMessageRunsATurnAndReturnsACompletedTask (0.00s)
63
+ --- FAIL: TestSameContextIDContinuesTheSameWorkerContext (0.00s)
64
+ --- FAIL: TestTenantsDoNotShareContextsOrTasks (0.00s)
65
+ --- FAIL: TestBobCannotAttachToAliceTaskWithAMessage (0.00s)
66
+ --- FAIL: TestRequestTenantMustMatchTheTokensTenant (0.00s)
67
+ --- FAIL: TestProtocolVersionIsPinned (0.00s)
68
+ --- FAIL: TestStreamingDeliversArtifactChunksBeforeCompletion (0.00s)
69
+ --- FAIL: TestCancelTaskAbortsTheWorkerAndEndsCanceled (0.00s)
70
+ --- FAIL: TestWorkerFailureBecomesAFailedTask (0.00s)
71
+ --- FAIL: TestWorkerErrorDetailIsNotSentToThePeer (0.00s)
72
+ --- FAIL: TestConcurrencyLimitQueuesTasks (0.00s)
73
+ --- FAIL: TestTasksInOneContextRunOneAtATime (0.00s)
74
+ --- FAIL: TestNonTextPartsAreRejected (0.00s)
75
+ --- FAIL: TestEmptyMessageIsRejected (0.00s)
76
+ --- FAIL: TestTaskTimeoutFailsTheTask (0.00s)
77
+ --- FAIL: TestShutdownCancelsRunningTasksAndStopsListening (0.00s)
78
+ --- FAIL: TestStartFailsOnAnAddressInUse (0.00s)
79
+ --- FAIL: TestOversizedRequestBodyIsRefused (0.00s)
80
+ --- FAIL: TestTLSListener (0.00s)
81
+ --- FAIL: TestSessionIDIsStableScopedAndSafe (0.00s)
82
+ --- FAIL: TestWorkerPassesFlagsSessionAndCwd (0.00s)
83
+ --- FAIL: TestWorkerModelAndExtraArgs (0.00s)
84
+ --- FAIL: TestWorkerEnvironmentIsAllowlisted (0.00s)
85
+ --- FAIL: TestWorkerStreamsUpdatesAndFinalText (0.00s)
86
+ --- FAIL: TestWorkerStreamedTextEqualsFinalTextWithoutDuplication (0.00s)
87
+ --- FAIL: TestWorkerModelFailureIsAFailureWithoutProviderDetail (0.00s)
88
+ --- FAIL: TestWorkerCancelAbortsThenReaps (0.00s)
89
+ --- FAIL: TestWorkerKillsAChildThatIgnoresAbort (0.00s)
90
+ --- PASS: TestWorkerCommandThatCannotStartIsReported (0.00s)
91
+ --- FAIL: TestWorkerRefusesEmptyPrompt (0.00s)
92
+ --- FAIL: TestRegistersToolsCommandAndLifecycleHandlers (0.00s)
93
+ --- FAIL: TestNoConfigurationOpensNoListener (0.00s)
94
+ --- FAIL: TestConfiguredListenerServesAndShutdownStopsIt (0.00s)
95
+ --- FAIL: TestSessionSwitchKeepsTheListenerReloadRestartsIt (0.00s)
96
+ --- FAIL: TestInvalidConfigurationIsReportedNotFatal (0.00s)
97
+ --- FAIL: TestWorkerChildNeverListens (0.00s)
98
+ --- FAIL: TestAgentsToolListsRemotesWithTheirCards (0.00s)
99
+ --- FAIL: TestSendToolRunsARemoteTaskEndToEnd (0.00s)
100
+ --- FAIL: TestTaskToolGetsAndCancels (0.00s)
101
+ --- FAIL: TestToolsRejectBadArguments (0.00s)
102
+ --- FAIL: TestToolsWithoutRemotesSayWhy (0.00s)
103
+ FAIL
104
+ FAIL github.com/MichaelKinsy/pigpen/a2a 10.043s
105
+ FAIL
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "flag-without-auth-refused",
3
+ "description": "--a2a-listen alone does not start an unauthenticated server: the user is told why and /a2a reports the listener off.",
4
+ "args": ["--a2a-listen", "127.0.0.1:0"],
5
+ "steps": [
6
+ {"name": "status", "rpc": {"type": "prompt", "message": "/a2a"}}
7
+ ]
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "listener-off",
3
+ "description": "No configuration: the extension loads, opens no listener and /a2a says so.",
4
+ "steps": [
5
+ {"name": "status", "rpc": {"type": "prompt", "message": "/a2a"}}
6
+ ]
7
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "send-missing-message",
3
+ "description": "a2a_send without a message is rejected before any remote is contacted.",
4
+ "llm": [
5
+ {"toolCalls": [{"name": "a2a_send", "arguments": {"agent": "peer"}}]},
6
+ {"text": "done"}
7
+ ],
8
+ "steps": [
9
+ {"name": "prompt", "rpc": {"type": "prompt", "message": "ask the peer"}}
10
+ ]
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "send-without-remotes",
3
+ "description": "The model calls a2a_send with no remotes configured: a tool error that says how to configure one, no network.",
4
+ "llm": [
5
+ {"toolCalls": [{"name": "a2a_send", "arguments": {"agent": "peer", "message": "hello peer"}}]},
6
+ {"text": "done"}
7
+ ],
8
+ "steps": [
9
+ {"name": "prompt", "rpc": {"type": "prompt", "message": "ask the peer"}}
10
+ ]
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "task-unknown-action",
3
+ "description": "a2a_task with an action outside get, cancel and list is an error the model sees.",
4
+ "llm": [
5
+ {"toolCalls": [{"name": "a2a_task", "arguments": {"agent": "peer", "action": "explode", "taskId": "t"}}]},
6
+ {"text": "done"}
7
+ ],
8
+ "steps": [
9
+ {"name": "prompt", "rpc": {"type": "prompt", "message": "poke the peer"}}
10
+ ]
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "tools-visible-to-model",
3
+ "description": "The three A2A tools are offered to the model; nothing else is added.",
4
+ "llm": [{"text": "ok"}],
5
+ "steps": [
6
+ {"name": "prompt", "rpc": {"type": "prompt", "message": "hello"}}
7
+ ]
8
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "origin": "original",
3
+ "authors": ["Michael Kinsy"],
4
+ "license": "MIT",
5
+ "licenseFile": "LICENSE",
6
+ "upstreams": [],
7
+ "dependencies": [
8
+ {
9
+ "name": "a2a-go",
10
+ "authors": ["The A2A Authors"],
11
+ "url": "https://github.com/a2aproject/a2a-go",
12
+ "revision": "ebf17c56ef7e63c72883a45454a538bbc0df66b8",
13
+ "license": "Apache-2.0",
14
+ "licenseFile": "port/a2a-go-LICENSE",
15
+ "attributionFile": "CREDITS.md"
16
+ }
17
+ ]
18
+ }