kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
bb65d09ab0
commit
f54470cb45
|
@ -1,3 +1,3 @@
|
|||
# autogenerated file
|
||||
packages/api-client/src/openapi.d.ts
|
||||
packages/types/src/openapi.d.ts
|
||||
packages/apps/gateway/src/worker.d.ts
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Deployment } from '@agentic/platform-api-client'
|
||||
import type { Deployment } from '@agentic/platform-types'
|
||||
import { parseFaasIdentifier } from '@agentic/platform-validators'
|
||||
import { Command } from 'commander'
|
||||
import { oraPromise } from 'ora'
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import type { AgenticApiClient, Deployment } from '@agentic/platform-api-client'
|
||||
import type { AgenticApiClient } from '@agentic/platform-api-client'
|
||||
import type { Deployment } from '@agentic/platform-types'
|
||||
|
||||
import { AuthStore } from './auth-store'
|
||||
import { loadAgenticConfig } from './load-agentic-config'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Deployment } from '@agentic/platform-api-client'
|
||||
import type { Deployment } from '@agentic/platform-types'
|
||||
|
||||
export function pruneDeployment(
|
||||
deployment: Deployment,
|
||||
|
@ -13,6 +13,7 @@ export function pruneDeployment(
|
|||
|
||||
if (d.originAdapter?.type === 'openapi') {
|
||||
d.originAdapter.spec = '<omitted>'
|
||||
d.originAdapter.toolToOperationMap = '<omitted>' as any
|
||||
}
|
||||
|
||||
return d
|
||||
|
|
|
@ -2,7 +2,9 @@ import type { z, ZodTypeDef } from 'zod'
|
|||
import { parseZodSchema } from '@agentic/platform-core'
|
||||
import {
|
||||
type AgenticProjectConfig,
|
||||
agenticProjectConfigSchema
|
||||
agenticProjectConfigSchema,
|
||||
type ResolvedAgenticProjectConfig,
|
||||
resolvedAgenticProjectConfigSchema
|
||||
} from '@agentic/platform-types'
|
||||
|
||||
/**
|
||||
|
@ -29,3 +31,28 @@ export function parseAgenticProjectConfig(
|
|||
inputConfig
|
||||
) as AgenticProjectConfig
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function parseResolvedAgenticProjectConfig(
|
||||
inputConfig: unknown,
|
||||
{ strip = false, strict = false }: { strip?: boolean; strict?: boolean } = {}
|
||||
): ResolvedAgenticProjectConfig {
|
||||
// NOTE: The extra typing and cast here are necessary because we're
|
||||
// overriding the default zod types for some fields (e.g. `pricingPlans`) in
|
||||
// order to get stricter TypeScript types than what zod v3 allows (nested
|
||||
// discrimianted unions). This should be removed once we upgrade to zod v4.
|
||||
return parseZodSchema<
|
||||
z.infer<typeof resolvedAgenticProjectConfigSchema>,
|
||||
ZodTypeDef,
|
||||
z.input<typeof resolvedAgenticProjectConfigSchema>
|
||||
>(
|
||||
strip
|
||||
? resolvedAgenticProjectConfigSchema.strip()
|
||||
: strict
|
||||
? resolvedAgenticProjectConfigSchema.strict()
|
||||
: resolvedAgenticProjectConfigSchema,
|
||||
inputConfig
|
||||
) as ResolvedAgenticProjectConfig
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { type Logger, parseZodSchema } from '@agentic/platform-core'
|
||||
import {
|
||||
type AgenticProjectConfig,
|
||||
agenticProjectConfigSchema,
|
||||
type ResolvedAgenticProjectConfig,
|
||||
resolvedAgenticProjectConfigSchema
|
||||
import type { Logger } from '@agentic/platform-core'
|
||||
import type {
|
||||
AgenticProjectConfig,
|
||||
ResolvedAgenticProjectConfig
|
||||
} from '@agentic/platform-types'
|
||||
|
||||
import {
|
||||
parseAgenticProjectConfig,
|
||||
parseResolvedAgenticProjectConfig
|
||||
} from './parse-agentic-project-config'
|
||||
import { resolveMetadata } from './resolve-metadata'
|
||||
import { resolveOriginAdapter } from './resolve-origin-adapter'
|
||||
import { validatePricing } from './validate-pricing'
|
||||
|
@ -15,7 +17,7 @@ export async function resolveAgenticProjectConfig(
|
|||
inputConfig: AgenticProjectConfig,
|
||||
opts: { logger?: Logger; cwd?: URL; label?: string } = {}
|
||||
): Promise<ResolvedAgenticProjectConfig> {
|
||||
const config = parseZodSchema(agenticProjectConfigSchema.strip(), inputConfig)
|
||||
const config = parseAgenticProjectConfig(inputConfig)
|
||||
|
||||
const { name, version } = resolveMetadata(config)
|
||||
validatePricing(config)
|
||||
|
@ -29,7 +31,7 @@ export async function resolveAgenticProjectConfig(
|
|||
originAdapter: config.originAdapter
|
||||
})
|
||||
|
||||
const resolvedConfig = parseZodSchema(resolvedAgenticProjectConfigSchema, {
|
||||
const resolvedConfig = parseResolvedAgenticProjectConfig({
|
||||
...config,
|
||||
name,
|
||||
version,
|
||||
|
|
Ładowanie…
Reference in New Issue