kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
bb65d09ab0
commit
f54470cb45
|
@ -1,3 +1,3 @@
|
||||||
# autogenerated file
|
# autogenerated file
|
||||||
packages/api-client/src/openapi.d.ts
|
packages/types/src/openapi.d.ts
|
||||||
packages/apps/gateway/src/worker.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 { parseFaasIdentifier } from '@agentic/platform-validators'
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import { oraPromise } from 'ora'
|
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 { AuthStore } from './auth-store'
|
||||||
import { loadAgenticConfig } from './load-agentic-config'
|
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(
|
export function pruneDeployment(
|
||||||
deployment: Deployment,
|
deployment: Deployment,
|
||||||
|
@ -13,6 +13,7 @@ export function pruneDeployment(
|
||||||
|
|
||||||
if (d.originAdapter?.type === 'openapi') {
|
if (d.originAdapter?.type === 'openapi') {
|
||||||
d.originAdapter.spec = '<omitted>'
|
d.originAdapter.spec = '<omitted>'
|
||||||
|
d.originAdapter.toolToOperationMap = '<omitted>' as any
|
||||||
}
|
}
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
|
@ -2,7 +2,9 @@ import type { z, ZodTypeDef } from 'zod'
|
||||||
import { parseZodSchema } from '@agentic/platform-core'
|
import { parseZodSchema } from '@agentic/platform-core'
|
||||||
import {
|
import {
|
||||||
type AgenticProjectConfig,
|
type AgenticProjectConfig,
|
||||||
agenticProjectConfigSchema
|
agenticProjectConfigSchema,
|
||||||
|
type ResolvedAgenticProjectConfig,
|
||||||
|
resolvedAgenticProjectConfigSchema
|
||||||
} from '@agentic/platform-types'
|
} from '@agentic/platform-types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,3 +31,28 @@ export function parseAgenticProjectConfig(
|
||||||
inputConfig
|
inputConfig
|
||||||
) as AgenticProjectConfig
|
) 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 { Logger } from '@agentic/platform-core'
|
||||||
import {
|
import type {
|
||||||
type AgenticProjectConfig,
|
AgenticProjectConfig,
|
||||||
agenticProjectConfigSchema,
|
ResolvedAgenticProjectConfig
|
||||||
type ResolvedAgenticProjectConfig,
|
|
||||||
resolvedAgenticProjectConfigSchema
|
|
||||||
} from '@agentic/platform-types'
|
} from '@agentic/platform-types'
|
||||||
|
|
||||||
|
import {
|
||||||
|
parseAgenticProjectConfig,
|
||||||
|
parseResolvedAgenticProjectConfig
|
||||||
|
} from './parse-agentic-project-config'
|
||||||
import { resolveMetadata } from './resolve-metadata'
|
import { resolveMetadata } from './resolve-metadata'
|
||||||
import { resolveOriginAdapter } from './resolve-origin-adapter'
|
import { resolveOriginAdapter } from './resolve-origin-adapter'
|
||||||
import { validatePricing } from './validate-pricing'
|
import { validatePricing } from './validate-pricing'
|
||||||
|
@ -15,7 +17,7 @@ export async function resolveAgenticProjectConfig(
|
||||||
inputConfig: AgenticProjectConfig,
|
inputConfig: AgenticProjectConfig,
|
||||||
opts: { logger?: Logger; cwd?: URL; label?: string } = {}
|
opts: { logger?: Logger; cwd?: URL; label?: string } = {}
|
||||||
): Promise<ResolvedAgenticProjectConfig> {
|
): Promise<ResolvedAgenticProjectConfig> {
|
||||||
const config = parseZodSchema(agenticProjectConfigSchema.strip(), inputConfig)
|
const config = parseAgenticProjectConfig(inputConfig)
|
||||||
|
|
||||||
const { name, version } = resolveMetadata(config)
|
const { name, version } = resolveMetadata(config)
|
||||||
validatePricing(config)
|
validatePricing(config)
|
||||||
|
@ -29,7 +31,7 @@ export async function resolveAgenticProjectConfig(
|
||||||
originAdapter: config.originAdapter
|
originAdapter: config.originAdapter
|
||||||
})
|
})
|
||||||
|
|
||||||
const resolvedConfig = parseZodSchema(resolvedAgenticProjectConfigSchema, {
|
const resolvedConfig = parseResolvedAgenticProjectConfig({
|
||||||
...config,
|
...config,
|
||||||
name,
|
name,
|
||||||
version,
|
version,
|
||||||
|
|
Ładowanie…
Reference in New Issue