agentstack-sdk 0.5.0 → 0.5.1-rc3
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.
- package/dist/client/a2a/create-authenticated-fetch.d.ts +5 -0
- package/dist/client/a2a/extensions/handle-agent-card.d.ts +3 -0
- package/dist/client/a2a/extensions/handle-task-status-update.d.ts +8 -2
- package/dist/client/a2a/extensions/interactions/approval.d.ts +52 -0
- package/dist/client/api/types.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/client/a2a/create-authenticated-fetch.ts +21 -0
- package/src/client/a2a/extensions/handle-agent-card.ts +3 -0
- package/src/client/a2a/extensions/handle-task-status-update.ts +22 -1
- package/src/client/a2a/extensions/interactions/approval.ts +50 -0
- package/src/client/api/build-api-client.ts +13 -3
- package/src/client/api/types.ts +44 -20
- package/src/index.ts +1 -0
package/src/client/api/types.ts
CHANGED
|
@@ -58,26 +58,50 @@ export const contextPermissionsGrantSchema = z.object({
|
|
|
58
58
|
|
|
59
59
|
export type ContextPermissionsGrant = z.infer<typeof contextPermissionsGrantSchema>;
|
|
60
60
|
|
|
61
|
-
export const globalPermissionsGrantSchema = contextPermissionsGrantSchema
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
export const globalPermissionsGrantSchema = contextPermissionsGrantSchema
|
|
62
|
+
.extend({
|
|
63
|
+
feedback: z.array(z.literal('write')).optional(),
|
|
64
|
+
|
|
65
|
+
llm: z.array(z.union([z.literal('*'), resourceIdPermissionSchema])).optional(),
|
|
66
|
+
embeddings: z.array(z.union([z.literal('*'), resourceIdPermissionSchema])).optional(),
|
|
67
|
+
model_providers: z.array(z.literal(['read', 'write', '*'])).optional(),
|
|
68
|
+
|
|
69
|
+
a2a_proxy: z.array(z.union([z.literal('*'), z.string()])).optional(),
|
|
70
|
+
|
|
71
|
+
providers: z.array(z.literal(['read', 'write', '*'])).optional(),
|
|
72
|
+
provider_variables: z.array(z.literal(['read', 'write', '*'])).optional(),
|
|
73
|
+
|
|
74
|
+
contexts: z.array(z.literal(['read', 'write', '*'])).optional(),
|
|
75
|
+
|
|
76
|
+
mcp_providers: z.array(z.literal(['read', 'write', '*'])).optional(),
|
|
77
|
+
mcp_tools: z.array(z.literal(['read', '*'])).optional(),
|
|
78
|
+
mcp_proxy: z.array(z.literal('*')).optional(),
|
|
79
|
+
|
|
80
|
+
connectors: z.array(z.literal(['read', 'write', 'proxy', '*'])).optional(),
|
|
81
|
+
})
|
|
82
|
+
.superRefine((val, ctx) => {
|
|
83
|
+
if (!val.a2a_proxy) return;
|
|
84
|
+
|
|
85
|
+
if (val.a2a_proxy.length === 0) {
|
|
86
|
+
ctx.addIssue({
|
|
87
|
+
code: z.ZodIssueCode.custom,
|
|
88
|
+
message: 'a2a_proxy cannot be empty array',
|
|
89
|
+
path: ['a2a_proxy'],
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const hasWildcard = val.a2a_proxy.includes('*');
|
|
95
|
+
const hasOthers = val.a2a_proxy.some((v) => v !== '*');
|
|
96
|
+
|
|
97
|
+
if (hasWildcard && hasOthers) {
|
|
98
|
+
ctx.addIssue({
|
|
99
|
+
code: z.ZodIssueCode.custom,
|
|
100
|
+
message: "a2a_proxy cannot mix '*' with specific providers",
|
|
101
|
+
path: ['a2a_proxy'],
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
81
105
|
|
|
82
106
|
export type GlobalPermissionsGrant = z.infer<typeof globalPermissionsGrantSchema>;
|
|
83
107
|
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
export { createAuthenticatedFetch } from './client/a2a/create-authenticated-fetch';
|
|
6
7
|
export * from './client/a2a/extensions/common/form';
|
|
7
8
|
export * from './client/a2a/extensions/fulfillment-resolvers/build-llm-extension-fulfillment-resolver';
|
|
8
9
|
export { type Fulfillments, handleAgentCard } from './client/a2a/extensions/handle-agent-card';
|