Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit 0da05dc

Browse files
feat: WIP non-managed gateway auth/payments
1 parent 3f5faf2 commit 0da05dc

File tree

4 files changed

+19
-483
lines changed

4 files changed

+19
-483
lines changed

packages/platform-core/src/hash-object.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
import type { LiteralUnion } from 'type-fest'
21
import decircular from 'decircular'
32
import isObject from 'is-obj'
43
import sortKeys from 'sort-keys'
54

65
import { sha256 } from './utils'
76

8-
export type Algorithm = LiteralUnion<
9-
'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512',
10-
string
11-
>
12-
13-
export type HashObjectOptions = {
14-
/** @default 'SHA-256' */
15-
readonly algorithm?: Algorithm
16-
}
17-
187
function normalizeObject(object: any): any {
198
if (typeof object === 'string') {
209
return object.normalize('NFD')

packages/types/src/agentic-project-config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,18 @@ To add support for annual pricing plans, for example, you can use: \`['month', '
246246
* `toolConfigs`, it will use the default behavior of the Agentic API
247247
* gateway.
248248
*/
249-
toolConfigs: z.array(toolConfigSchema).optional().default([])
249+
toolConfigs: z.array(toolConfigSchema).optional().default([]),
250+
251+
/**
252+
* Whether the project's auth and billing is managed by Agentic or by the
253+
* origin server.
254+
*
255+
* If `true`, Agentic will manage the project's auth and billing.
256+
* If `false`, the origin server is responsible.
257+
*
258+
* @default true
259+
*/
260+
managed: z.boolean().optional().default(true)
250261
})
251262
.strip()
252263

packages/types/src/origin-adapter.ts

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,14 @@ import { z } from '@hono/zod-openapi'
33
import { mcpServerInfoSchema } from './mcp'
44
import { toolNameSchema } from './tools'
55

6-
export const originAdapterLocationSchema = z.literal('external')
7-
// z.union([
8-
// z.literal('external'),
9-
// z.literal('internal')
10-
// ])
11-
export type OriginAdapterLocation = z.infer<typeof originAdapterLocationSchema>
12-
13-
// export const originAdapterInternalTypeSchema = z.union([
14-
// z.literal('docker'),
15-
// z.literal('mcp'),
16-
// z.literal('python-fastapi'),
17-
// // etc
18-
// ])
19-
// export type OriginAdapterInternalType = z.infer<
20-
// typeof originAdapterInternalTypeSchema
21-
// >
22-
236
export const commonOriginAdapterSchema = z.object({
24-
location: originAdapterLocationSchema.optional().default('external'),
25-
26-
/** Required origin API HTTPS base URL */
7+
/** Required URL of the remote origin server. Must be a valid \`https\` URL. */
278
url: z.string().url()
28-
.describe(`Required base URL of the externally hosted origin API server. Must be a valid \`https\` URL.
9+
.describe(`Required URL of the externally hosted origin server. Must be a valid \`https\` URL.
2910
3011
NOTE: Agentic currently only supports \`external\` API servers. If you'd like to host your API or MCP server on Agentic's infrastructure, please reach out to support@agentic.so.`)
31-
32-
// TODO: Add support for `internal` hosted API servers
33-
// internalType: originAdapterInternalTypeSchema.optional()
3412
})
3513

36-
// TODO: add future support for:
37-
// - external mcp
38-
// - internal docker
39-
// - internal mcp
40-
// - internal http
41-
// - etc
42-
4314
export const openapiOriginAdapterConfigSchema = commonOriginAdapterSchema.merge(
4415
z.object({
4516
/**
@@ -79,7 +50,8 @@ export type MCPOriginAdapterConfig = z.infer<
7950
typeof mcpOriginAdapterConfigSchema
8051
>
8152

82-
// TODO: Decide on whether to support `raw` origin adapters or not.
53+
// TODO: Decide on whether to support `raw` origin adapters or not. It's useful for
54+
// internal testing.
8355
export const rawOriginAdapterConfigSchema = commonOriginAdapterSchema.merge(
8456
z.object({
8557
/**
@@ -204,7 +176,9 @@ export const mcpOriginAdapterSchema = commonOriginAdapterSchema.merge(
204176
*/
205177
type: z.literal('mcp'),
206178

207-
// Optional headers to pass to the origin API server
179+
/**
180+
* Optional headers to pass to the origin API server.
181+
*/
208182
headers: z.record(z.string(), z.string()).optional(),
209183

210184
/**

0 commit comments

Comments
 (0)