The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Commit 66ff6831

66ff6831b5d2Merged

aryaamin <[email protected]> · 2 months ago · 66 files · +40 added · ~26 modified

Description

feat: launch behavioral intelligence scorecards

Details

Commit
66ff6831b5d2
Parent
b95ad82c1c50

apps/api/src/app.tsmodifiedView file

@@ -31,7 +31,6 @@
3131
3232 type DashboardRepository = Pick<
3333 HostedRepository,
34- | 'dashboard'
3534 | 'getSettings'
3635 | 'saveSettings'
3736 | 'upsert'
@@ -41,8 +40,9 @@
4140 | 'getPublishedAgent'
4241 | 'resolveAgentReference'
4342 | 'searchPublishedAgents'
44-> &
45- Partial<
43+> & {
44+ dashboard(operatorId: string): Promise<Record<string, unknown>>;
45+} & Partial<
4646 Pick<
4747 HostedRepository,
4848 | 'createFederatedInteraction'
@@ -74,7 +74,16 @@
7474 | 'markHostedThreadRead'
7575 | 'closeHostedThread'
7676 >
77- >;
77+ > & {
78+ listContextualIntelligence?: (
79+ operatorId: string,
80+ input?: { agentId?: string; taskCategory?: string },
81+ ) => Promise<any[]>;
82+ searchPersonalizedMarketplace?: (
83+ operatorId: string,
84+ input?: { agentId?: string; taskCategory?: string; query?: string; limit?: number },
85+ ) => Promise<any[]>;
86+ };
7887
7988 export function buildApi(
8089 engine = new TrustEngine(),
@@ -360,9 +369,44 @@
360369 interactionConclusions: [],
361370 learningEligibility: [],
362371 profileDeltas: [],
372+ intelligenceSummaries: [],
363373 runtimes: [],
364374 };
365375 });
376+ router.get('/v0.1/intelligence', async (request) => {
377+ const owner = operatorId(request);
378+ if (!repository?.listContextualIntelligence || !owner)
379+ throw new Error('Contextual intelligence is not configured');
380+ const input = z
381+ .object({
382+ agentId: z.string().min(1).optional(),
383+ taskCategory: z.string().trim().min(1).max(100).optional(),
384+ })
385+ .parse(request.query);
386+ return repository.listContextualIntelligence(owner, {
387+ ...(input.agentId ? { agentId: input.agentId } : {}),
388+ ...(input.taskCategory ? { taskCategory: input.taskCategory } : {}),
389+ });
390+ });
391+ router.get('/v0.1/marketplace', async (request) => {
392+ const owner = operatorId(request);
393+ if (!repository?.searchPersonalizedMarketplace || !owner)
394+ throw new Error('Personalized marketplace is not configured');
395+ const input = z
396+ .object({
397+ agentId: z.string().min(1).optional(),
398+ taskCategory: z.string().trim().min(1).max(100).optional(),
399+ query: z.string().trim().max(100).optional(),
400+ limit: z.coerce.number().int().min(1).max(50).default(30),
401+ })
402+ .parse(request.query);
403+ return repository.searchPersonalizedMarketplace(owner, {
404+ ...(input.agentId ? { agentId: input.agentId } : {}),
405+ ...(input.taskCategory ? { taskCategory: input.taskCategory } : {}),
406+ ...(input.query ? { query: input.query } : {}),
407+ limit: input.limit,
408+ });
409+ });
366410 router.get('/v0.1/account', async (request) => {
367411 const owner = operatorId(request);
368412 return {