@groundnuty/macf-channel-server 0.2.28 → 0.2.33

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.
@@ -34,24 +34,54 @@
34
34
  * don't accidentally re-include it.
35
35
  */
36
36
  import { z } from 'zod';
37
+ import { A2A_ENDPOINT_PATH } from './a2a-types.js';
37
38
  // ---------------------------------------------------------------------------
38
39
  // Zod schema (hand-rolled from A2A v1.0 spec § 4.4.1 + § 4.4.5 + § 4.5.6)
39
40
  // ---------------------------------------------------------------------------
40
41
  /**
41
- * AgentSkill — per spec § 4.4.5. Required: id, name. Optional:
42
- * description, tags, examples, inputModes, outputModes, metadata,
43
- * extensions.
42
+ * AgentSkill — per canonical proto (`a2aproject/A2A:specification/a2a.proto`
43
+ * `message AgentSkill`). Required per proto: id, name, description, tags.
44
+ * Optional: examples, input_modes, output_modes, security_requirements.
45
+ *
46
+ * JSON wire form uses canonical lowerCamelCase mapping from proto
47
+ * snake_case (`input_modes` → `inputModes`, etc.) per proto3 JSON spec.
48
+ *
49
+ * **macf#393 Phase 2c**: `description` + `tags` upgraded from optional
50
+ * (Phase 1's lenient shape) to required per proto. Strict-validating
51
+ * external A2A clients (Bedrock AgentCore, Microsoft Agent Framework,
52
+ * etc.) reject AgentCards with skill entries missing required fields.
44
53
  */
45
54
  export const AgentSkillSchema = z.object({
46
55
  id: z.string().min(1),
47
56
  name: z.string().min(1),
48
- description: z.string().optional(),
49
- tags: z.array(z.string()).optional(),
57
+ description: z.string().min(1),
58
+ tags: z.array(z.string()).min(1),
50
59
  examples: z.array(z.string()).optional(),
51
60
  inputModes: z.array(z.string()).optional(),
52
61
  outputModes: z.array(z.string()).optional(),
53
62
  metadata: z.record(z.string(), z.unknown()).optional(),
54
63
  });
64
+ /**
65
+ * AgentInterface — per canonical proto `message AgentInterface`.
66
+ * Per AgentCard `supported_interfaces` (proto field 3, REQUIRED): the
67
+ * endpoint URL + protocol binding the agent serves. v1.0 moves the
68
+ * endpoint URL OUT of AgentCard top-level into the (repeated)
69
+ * AgentInterface entries.
70
+ *
71
+ * Required per proto: url, protocol_binding, protocol_version.
72
+ * Optional: tenant.
73
+ *
74
+ * JSON wire form: `protocolBinding` (lowerCamelCase) + `protocolVersion`.
75
+ */
76
+ export const AgentInterfaceSchema = z.object({
77
+ url: z.string().url(),
78
+ /** Protocol binding identifier: `"JSONRPC"` | `"GRPC"` | `"HTTP+JSON"`. */
79
+ protocolBinding: z.string().min(1),
80
+ /** Optional tenant identifier for multi-tenant deployments. */
81
+ tenant: z.string().optional(),
82
+ /** A2A protocol version this interface serves, e.g. `"1.0"`. */
83
+ protocolVersion: z.string().min(1),
84
+ });
55
85
  /**
56
86
  * MutualTlsSecurityScheme — per spec § 4.5.6. Type discriminator
57
87
  * `mutualTls`. No additional fields required at the scheme level;
@@ -83,29 +113,49 @@ export const AgentCapabilitiesSchema = z.object({
83
113
  pushNotifications: z.boolean().optional(),
84
114
  }).catchall(z.unknown());
85
115
  /**
86
- * AgentCard — per spec § 4.4.1. Required: id, name, url, version,
87
- * provider, capabilities, securitySchemes. Optional: description,
88
- * defaultInputModes, defaultOutputModes, skills, extensions, security,
89
- * metadata.
116
+ * AgentCard — per canonical proto `message AgentCard` (verified verbatim
117
+ * from `a2aproject/A2A:specification/a2a.proto` 2026-05-19).
118
+ *
119
+ * Required per proto: name, description, supported_interfaces,
120
+ * version, capabilities, default_input_modes, default_output_modes, skills.
121
+ * Optional: provider, documentation_url, security_schemes,
122
+ * security_requirements, signatures, icon_url.
123
+ *
124
+ * JSON wire form uses canonical lowerCamelCase mapping from proto
125
+ * snake_case (`supported_interfaces` → `supportedInterfaces`, etc.).
126
+ *
127
+ * **macf#393 Phase 2c** — schema realignment to canonical proto:
128
+ * - REMOVED top-level `id` (no such field in proto)
129
+ * - REMOVED top-level `url` (moves to `supportedInterfaces[0].url`)
130
+ * - ADDED `description` as required (was optional in Phase 1)
131
+ * - ADDED `supportedInterfaces` as required (endpoint URL lives here per v1.0)
132
+ * - ADDED `defaultInputModes` + `defaultOutputModes` as required
133
+ * - `skills` upgraded from optional to required (proto says REQUIRED)
134
+ *
135
+ * The schema change is structurally breaking for any consumer that parsed
136
+ * Phase 1's AgentCard shape; pre-flight grep on 2026-05-19 confirmed zero
137
+ * external consumers (Phase 1 shipped ~24h prior). Migration documented
138
+ * in DR-022 Amendment M.
90
139
  */
91
140
  export const AgentCardSchema = z.object({
92
- id: z.string().min(1),
93
141
  name: z.string().min(1),
94
- url: z.string().url(),
142
+ description: z.string().min(1),
143
+ supportedInterfaces: z.array(AgentInterfaceSchema).min(1),
95
144
  version: z.string().min(1),
96
- provider: AgentProviderSchema,
145
+ provider: AgentProviderSchema.optional(),
97
146
  capabilities: AgentCapabilitiesSchema,
98
147
  // Phase 1 mTLS-only stance. Phase 2+ widening to a discriminated
99
148
  // union (OAuth/OIDC for external integrations per A2A spec § 4.5)
100
149
  // lives here when needed — replace `MutualTlsSecuritySchemeSchema`
101
150
  // with `z.discriminatedUnion('type', [MutualTls..., OAuth2..., ...])`.
102
151
  // Per #370 review (science-agent 2026-05-18).
103
- securitySchemes: z.record(z.string(), MutualTlsSecuritySchemeSchema),
104
- description: z.string().optional(),
105
- defaultInputModes: z.array(z.string()).optional(),
106
- defaultOutputModes: z.array(z.string()).optional(),
107
- skills: z.array(AgentSkillSchema).optional(),
152
+ securitySchemes: z.record(z.string(), MutualTlsSecuritySchemeSchema).optional(),
153
+ defaultInputModes: z.array(z.string()).min(1),
154
+ defaultOutputModes: z.array(z.string()).min(1),
155
+ skills: z.array(AgentSkillSchema).min(1),
108
156
  security: z.array(z.record(z.string(), z.array(z.string()))).optional(),
157
+ documentationUrl: z.string().optional(),
158
+ iconUrl: z.string().optional(),
109
159
  metadata: z.record(z.string(), z.unknown()).optional(),
110
160
  });
111
161
  /**
@@ -116,25 +166,44 @@ export const AgentCardSchema = z.object({
116
166
  * clients SHOULD NOT depend on it. A source-level test in
117
167
  * `test/agent-card.test.ts` pins this invariant.
118
168
  *
119
- * Skills in Phase 1: empty array. The MACF coordination surfaces
120
- * (POST /notify for inbound peer notifications) are framework-internal,
121
- * not user-invocable agent skills in the A2A sense. Phase 2+ may add
122
- * skills as A2A's task lifecycle surfaces materialize.
169
+ * Skills in Phase 2a (macf#390): MACF domain capabilities what the
170
+ * agent can DO, not what JSON-RPC methods it serves. Per spec § 4.4.5,
171
+ * skills describe agent-specific actions on top of the A2A protocol
172
+ * methods. Initial mapping (Phase 2a):
173
+ *
174
+ * - `macf.notify_peer` — Cross-Agent Notification (the canonical MACF
175
+ * coordination primitive; #267)
176
+ * - `macf.checkpoint_to_memory` — Persist Context to Memory (the PreCompact
177
+ * checkpoint MCP tool; #271 DR-023 §UC-3)
178
+ *
179
+ * Phase 3+ will add role-specific skills if the MACF MCP-tool surface
180
+ * grows. `/macf/sign` is intentionally absent — live cryptographic
181
+ * attestation stays MACF-only per DR-010 Path 2 + #371; a source-level
182
+ * test pins this invariant.
183
+ *
184
+ * `url` field: Phase 2a points AgentCard.url to the JSON-RPC endpoint
185
+ * (`<inputs.url>/a2a/v1`). A2A clients discover via
186
+ * `/.well-known/agent-card.json` then POST `message/send` to the
187
+ * advertised url.
123
188
  */
124
189
  export function buildAgentCard(inputs) {
190
+ // macf#393 Phase 2c: canonical proto-aligned AgentCard shape.
191
+ // - No top-level `id` or `url` (proto has neither at AgentCard level)
192
+ // - Endpoint URL lives in supportedInterfaces[].url
193
+ // - description, supportedInterfaces, defaultInputModes,
194
+ // defaultOutputModes, skills are all REQUIRED per proto
195
+ const endpointUrl = `${inputs.url.replace(/\/+$/, '')}${A2A_ENDPOINT_PATH}`;
125
196
  const card = {
126
- id: `${inputs.project}-${inputs.agentName}`,
127
197
  name: inputs.agentName,
128
- description: `MACF agent (${inputs.agentRole}) in project ${inputs.project}. Coordinates with peer MACF agents over mTLS-authenticated channels.`,
129
- url: inputs.url,
198
+ description: `MACF ${inputs.agentRole} agent in project ${inputs.project}. Coordinates with peer MACF agents over mTLS-authenticated channels; serves A2A v1.0 inbound message/send at /a2a/v1.`,
130
199
  version: inputs.version,
131
200
  provider: {
132
201
  organization: `groundnuty/macf (${inputs.project})`,
133
202
  url: 'https://github.com/groundnuty/macf',
134
203
  },
135
204
  capabilities: {
136
- // Phase 1: no claimed capabilities; Phase 2 will populate as
137
- // inbound A2A JSON-RPC `message/send` + task lifecycle land.
205
+ streaming: false,
206
+ pushNotifications: false,
138
207
  },
139
208
  securitySchemes: {
140
209
  mutual_tls: {
@@ -143,9 +212,33 @@ export function buildAgentCard(inputs) {
143
212
  },
144
213
  },
145
214
  security: [{ mutual_tls: [] }],
146
- defaultInputModes: ['application/json'],
147
- defaultOutputModes: ['application/json'],
148
- skills: [],
215
+ supportedInterfaces: [
216
+ {
217
+ url: endpointUrl,
218
+ protocolBinding: 'JSONRPC',
219
+ protocolVersion: '1.0',
220
+ },
221
+ ],
222
+ defaultInputModes: ['text/plain', 'application/json'],
223
+ defaultOutputModes: ['text/plain', 'application/json'],
224
+ skills: [
225
+ {
226
+ id: 'macf.notify_peer',
227
+ name: 'Cross-Agent Notification',
228
+ description: 'Send a notification to a peer MACF agent. Used for issue/PR routing, CI-completion signaling, and ad-hoc cross-agent messaging. Sender-side delivery is mTLS-authenticated; receiver dispatches based on notification type.',
229
+ tags: ['notification', 'coordination', 'multi-agent'],
230
+ inputModes: ['application/json'],
231
+ outputModes: ['application/json'],
232
+ },
233
+ {
234
+ id: 'macf.checkpoint_to_memory',
235
+ name: 'Persist Context to Memory',
236
+ description: 'Persist current session context to MACF memory layer. Invoked via PreCompact hook (DR-023 §UC-3) or manually before long pauses. Returns a memory-file reference for later recall.',
237
+ tags: ['memory', 'persistence', 'checkpoint'],
238
+ inputModes: ['application/json'],
239
+ outputModes: ['application/json'],
240
+ },
241
+ ],
149
242
  };
150
243
  // Defense-in-depth: validate our own output before returning.
151
244
  // Catches bugs where a field shape drifts from the schema without
@@ -1 +1 @@
1
- {"version":3,"file":"agent-card.js","sourceRoot":"","sources":["../src/agent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aAAa,CAAC;gBACrD,UAAU,EAAE,CAAC,kBAAkB,CAAC;gBAChC,WAAW,EAAE,CAAC,kBAAkB,CAAC;aAClC;YACD;gBACE,EAAE,EAAE,2BAA2B;gBAC/B,IAAI,EAAE,2BAA2B;gBACjC,WAAW,EAAE,oLAAoL;gBACjM,IAAI,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC;gBAC7C,UAAU,EAAE,CAAC,kBAAkB,CAAC;gBAChC,WAAW,EAAE,CAAC,kBAAkB,CAAC;aAClC;SACF;KACF,CAAC;IACF,8DAA8D;IAC9D,kEAAkE;IAClE,+BAA+B;IAC/B,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
package/dist/https.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { NotifyPayload, SignRequest, HealthResponse, HttpsServer, Logger } from '@groundnuty/macf-core';
2
+ import type { TaskStore } from './a2a-task.js';
2
3
  export declare const PORT_RANGE_START = 8800;
3
4
  export declare const PORT_RANGE_SIZE = 1000;
4
5
  export declare const CLIENT_AUTH_EKU_OID = "1.3.6.1.5.5.7.3.2";
@@ -28,6 +29,17 @@ export declare function createHttpsServer(config: {
28
29
  * behavior change to existing endpoints.
29
30
  */
30
31
  readonly agentCard?: unknown;
32
+ /**
33
+ * A2A v1.0 inbound task store for `message/send` JSON-RPC handling
34
+ * at `/a2a/v1` (groundnuty/macf#390 Phase 2a). Optional — pre-#390
35
+ * channel-servers skip the route and return 404.
36
+ *
37
+ * Phase 2a: in-memory `Map<taskId, Task>`. Each request drives a
38
+ * fresh task through the happy path SUBMITTED → WORKING → COMPLETED.
39
+ * Phase 2b will exercise INPUT_REQUIRED / AUTH_REQUIRED + resume
40
+ * via `Message.taskId`.
41
+ */
42
+ readonly taskStore?: TaskStore;
31
43
  readonly logger: Logger;
32
44
  }): HttpsServer;
33
45
  //# sourceMappingURL=https.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"https.d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