Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions apps/agentstack-sdk-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "0.4.4",
"type": "module",
"scripts": {
"build": "rimraf dist && microbundle --format modern,cjs,umd",
"dev": "microbundle watch"
"build": "rimraf dist && microbundle --format modern,cjs,umd src/*.ts",
"dev": "microbundle watch src/*.ts"
},
"source": "src/index.ts",
"repository": {
Expand All @@ -25,13 +25,53 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./types": {
"./api": {
"require": {
"types": "./dist/types/index.d.cts"
"types": "./dist/api.d.cts",
"default": "./dist/api.cjs"
},
"import": {
"types": "./dist/types/index.d.ts"
}
"types": "./dist/api.d.ts",
"default": "./dist/api.js"
},
"types": "./dist/api.d.ts",
"default": "./dist/api.js"
},
"./client": {
"require": {
"types": "./dist/client.d.cts",
"default": "./dist/client.cjs"
},
"import": {
"types": "./dist/client.d.ts",
"default": "./dist/client.js"
},
"types": "./dist/client.d.ts",
"default": "./dist/client.js"
},
"./errors": {
"require": {
"types": "./dist/errors.d.cts",
"default": "./dist/errors.cjs"
},
"import": {
"types": "./dist/errors.d.ts",
"default": "./dist/errors.js"
},
"types": "./dist/errors.d.ts",
"default": "./dist/errors.js"
},
"./extensions": {
"require": {
"types": "./dist/extensions.d.cts",
"default": "./dist/extensions.cjs"
},
"import": {
"types": "./dist/extensions.d.ts",
"default": "./dist/extensions.js"
},
"types": "./dist/extensions.d.ts",
"default": "./dist/extensions.js"
},
"./package.json": "./package.json"
},
Expand Down
7 changes: 7 additions & 0 deletions apps/agentstack-sdk-ts/src/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

export * from './client/api/schemas';
export * from './client/api/types';
7 changes: 7 additions & 0 deletions apps/agentstack-sdk-ts/src/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

export * from './client/client';
export * from './client/client/types';
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

import z from 'zod';

import type { A2AServiceExtension, A2AUiExtension } from '../../../runtime/types';
import { oAuthDemandsSchema, oAuthFulfillmentsSchema, oAuthRequestSchema } from './schemas';
import type { OAuthDemands, OAuthFulfillments, OAuthRequest } from './types';

const URI = 'https://a2a-extensions.agentstack.beeai.dev/auth/oauth/v1';

export const oAuthExtension: A2AServiceExtension<typeof URI, OAuthDemands, OAuthFulfillments> = {
getUri: () => URI,
getDemandsSchema: () => oAuthDemandsSchema,
getFulfillmentsSchema: () => oAuthFulfillmentsSchema,
};

export const oAuthRequestExtension: A2AUiExtension<typeof URI, OAuthRequest> = {
getUri: () => URI,
getMessageMetadataSchema: () => z.object({ [URI]: oAuthRequestSchema }).partial(),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

import z from 'zod';

export const oAuthDemandSchema = z.object({
redirect_uri: z.boolean(),
});

export const oAuthDemandsSchema = z.object({
oauth_demands: z.record(z.string(), oAuthDemandSchema),
});

export const oAuthFulfillmentSchema = z.object({
redirect_uri: z.string(),
});

export const oAuthFulfillmentsSchema = z.object({
oauth_fulfillments: z.record(z.string(), oAuthFulfillmentSchema),
});

export const oAuthRequestSchema = z.object({
authorization_endpoint_url: z.string(),
});

export const oAuthResponseSchema = z.object({
redirect_uri: z.string(),
});

export const oAuthMessageSchema = z.object({
data: oAuthResponseSchema,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

import type z from 'zod';

import type {
oAuthDemandSchema,
oAuthDemandsSchema,
oAuthFulfillmentSchema,
oAuthFulfillmentsSchema,
oAuthMessageSchema,
oAuthRequestSchema,
oAuthResponseSchema,
} from './schemas';

export type OAuthDemand = z.infer<typeof oAuthDemandSchema>;
export type OAuthDemands = z.infer<typeof oAuthDemandsSchema>;

export type OAuthFulfillment = z.infer<typeof oAuthFulfillmentSchema>;
export type OAuthFulfillments = z.infer<typeof oAuthFulfillmentsSchema>;

export type OAuthRequest = z.infer<typeof oAuthRequestSchema>;
export type OAuthResponse = z.infer<typeof oAuthResponseSchema>;

export type OAuthMessage = z.infer<typeof oAuthMessageSchema>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

import z from 'zod';

import type { A2AServiceExtension, A2AUiExtension } from '../../../runtime/types';
import { secretDemandsSchema, secretFulfillmentsSchema } from './schemas';
import type { SecretDemands, SecretFulfillments } from './types';

const URI = 'https://a2a-extensions.agentstack.beeai.dev/auth/secrets/v1';

export const secretsExtension: A2AServiceExtension<typeof URI, SecretDemands, SecretFulfillments> = {
getUri: () => URI,
getDemandsSchema: () => secretDemandsSchema,
getFulfillmentsSchema: () => secretFulfillmentsSchema,
};

export const secretsRequestExtension: A2AUiExtension<typeof URI, SecretDemands> = {
getUri: () => URI,
getMessageMetadataSchema: () => z.object({ [URI]: secretDemandsSchema }).partial(),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

import z from 'zod';

export const secretDemandSchema = z.object({
name: z.string(),
description: z.string().nullish(),
});

export const secretDemandsSchema = z.object({
secret_demands: z.record(z.string(), secretDemandSchema),
});

export const secretFulfillmentSchema = z.object({
secret: z.string(),
});

export const secretFulfillmentsSchema = z.object({
secret_fulfillments: z.record(z.string(), secretFulfillmentSchema),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
* SPDX-License-Identifier: Apache-2.0
*/

import type z from 'zod';

import type {
secretDemandSchema,
secretDemandsSchema,
secretFulfillmentSchema,
secretFulfillmentsSchema,
} from './schemas';

export type SecretDemand = z.infer<typeof secretDemandSchema>;
export type SecretDemands = z.infer<typeof secretDemandsSchema>;

export type SecretFulfillment = z.infer<typeof secretFulfillmentSchema>;
export type SecretFulfillments = z.infer<typeof secretFulfillmentsSchema>;
Loading
Loading