(url: string, init: RequestInit)
| 71 | function effectiveCatalogContext(input: AssertKiloModelAvailableInput): EffectiveCatalogContext { |
| 72 | return { |
| 73 | token: input.originalToken, |
| 74 | organizationId: input.env.KILOCODE_ORG_ID_OVERRIDE ?? input.originalOrganizationId, |
| 75 | feature: input.createdOnPlatform ?? 'cloud-agent', |
| 76 | }; |
| 77 | } |
| 78 | |
| 79 | function requestHeaders(context: EffectiveCatalogContext): Headers { |
| 80 | const headers = new Headers(); |
| 81 | headers.set('Content-Type', 'application/json'); |
| 82 | headers.set('X-KiloCode-Feature', context.feature); |
| 83 | if (context.proof) headers.set(RUNTIME_PROXY_ATTESTATION_HEADER, context.proof); |
| 84 | if (context.token) headers.set('Authorization', `Bearer ${context.token}`); |
| 85 | if (context.organizationId) { |
no test coverage detected