@raybase/cli 0.0.2 → 0.3.4
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/LICENSE +21 -0
- package/dist/admin-assets.d.ts +22 -0
- package/dist/admin-assets.d.ts.map +1 -0
- package/dist/admin-assets.js +285 -0
- package/dist/admin-assets.js.map +1 -0
- package/dist/agent-remote-mcp-cli.d.ts +71 -0
- package/dist/agent-remote-mcp-cli.d.ts.map +1 -0
- package/dist/agent-remote-mcp-cli.js +466 -0
- package/dist/agent-remote-mcp-cli.js.map +1 -0
- package/dist/agent-skills-cli.d.ts +4 -0
- package/dist/agent-skills-cli.d.ts.map +1 -0
- package/dist/agent-skills-cli.js +144 -0
- package/dist/agent-skills-cli.js.map +1 -0
- package/dist/agent.d.ts +169 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +531 -0
- package/dist/agent.js.map +1 -0
- package/dist/app-manifest.d.ts +41 -0
- package/dist/app-manifest.d.ts.map +1 -0
- package/dist/app-manifest.js +294 -0
- package/dist/app-manifest.js.map +1 -0
- package/dist/dev-cron-backstop.d.ts +53 -0
- package/dist/dev-cron-backstop.d.ts.map +1 -0
- package/dist/dev-cron-backstop.js +364 -0
- package/dist/dev-cron-backstop.js.map +1 -0
- package/dist/dev-do-watchdog.d.ts +37 -0
- package/dist/dev-do-watchdog.d.ts.map +1 -0
- package/dist/dev-do-watchdog.js +75 -0
- package/dist/dev-do-watchdog.js.map +1 -0
- package/dist/dev-inference-tape.d.ts +35 -0
- package/dist/dev-inference-tape.d.ts.map +1 -0
- package/dist/dev-inference-tape.js +502 -0
- package/dist/dev-inference-tape.js.map +1 -0
- package/dist/dev-ports.d.ts +25 -0
- package/dist/dev-ports.d.ts.map +1 -0
- package/dist/dev-ports.js +84 -0
- package/dist/dev-ports.js.map +1 -0
- package/dist/dev-project-lock.d.ts +24 -0
- package/dist/dev-project-lock.d.ts.map +1 -0
- package/dist/dev-project-lock.js +307 -0
- package/dist/dev-project-lock.js.map +1 -0
- package/dist/env-files.d.ts +10 -0
- package/dist/env-files.d.ts.map +1 -0
- package/dist/env-files.js +108 -0
- package/dist/env-files.js.map +1 -0
- package/dist/external-json.d.ts +3 -0
- package/dist/external-json.d.ts.map +1 -0
- package/dist/external-json.js +21 -0
- package/dist/external-json.js.map +1 -0
- package/dist/frameworks.d.ts +67 -0
- package/dist/frameworks.d.ts.map +1 -0
- package/dist/frameworks.js +210 -0
- package/dist/frameworks.js.map +1 -0
- package/dist/guide-corpus-doctor.d.ts +24 -0
- package/dist/guide-corpus-doctor.d.ts.map +1 -0
- package/dist/guide-corpus-doctor.js +111 -0
- package/dist/guide-corpus-doctor.js.map +1 -0
- package/dist/hosting.d.ts +85 -0
- package/dist/hosting.d.ts.map +1 -0
- package/dist/hosting.js +136 -0
- package/dist/hosting.js.map +1 -0
- package/dist/index.d.ts +253 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11497 -0
- package/dist/index.js.map +1 -0
- package/dist/kit-doctor.d.ts +19 -0
- package/dist/kit-doctor.d.ts.map +1 -0
- package/dist/kit-doctor.js +255 -0
- package/dist/kit-doctor.js.map +1 -0
- package/dist/kit-install.d.ts +67 -0
- package/dist/kit-install.d.ts.map +1 -0
- package/dist/kit-install.js +409 -0
- package/dist/kit-install.js.map +1 -0
- package/dist/kit-manifest.d.ts +154 -0
- package/dist/kit-manifest.d.ts.map +1 -0
- package/dist/kit-manifest.js +252 -0
- package/dist/kit-manifest.js.map +1 -0
- package/dist/kit-registry.d.ts +42 -0
- package/dist/kit-registry.d.ts.map +1 -0
- package/dist/kit-registry.js +231 -0
- package/dist/kit-registry.js.map +1 -0
- package/dist/kit-spec.d.ts +37 -0
- package/dist/kit-spec.d.ts.map +1 -0
- package/dist/kit-spec.js +48 -0
- package/dist/kit-spec.js.map +1 -0
- package/dist/kit-state.d.ts +57 -0
- package/dist/kit-state.d.ts.map +1 -0
- package/dist/kit-state.js +31 -0
- package/dist/kit-state.js.map +1 -0
- package/dist/kits.d.ts +82 -0
- package/dist/kits.d.ts.map +1 -0
- package/dist/kits.js +255 -0
- package/dist/kits.js.map +1 -0
- package/dist/license-keys.d.ts +3 -0
- package/dist/license-keys.d.ts.map +1 -0
- package/dist/license-keys.js +10 -0
- package/dist/license-keys.js.map +1 -0
- package/dist/licensing.d.ts +269 -0
- package/dist/licensing.d.ts.map +1 -0
- package/dist/licensing.js +477 -0
- package/dist/licensing.js.map +1 -0
- package/dist/local-codex-relay.d.ts +19 -0
- package/dist/local-codex-relay.d.ts.map +1 -0
- package/dist/local-codex-relay.js +203 -0
- package/dist/local-codex-relay.js.map +1 -0
- package/dist/module-doctor.d.ts +35 -0
- package/dist/module-doctor.d.ts.map +1 -0
- package/dist/module-doctor.js +966 -0
- package/dist/module-doctor.js.map +1 -0
- package/dist/module-install.d.ts +71 -0
- package/dist/module-install.d.ts.map +1 -0
- package/dist/module-install.js +1133 -0
- package/dist/module-install.js.map +1 -0
- package/dist/module-manifest.d.ts +33 -0
- package/dist/module-manifest.d.ts.map +1 -0
- package/dist/module-manifest.js +301 -0
- package/dist/module-manifest.js.map +1 -0
- package/dist/module-state.d.ts +76 -0
- package/dist/module-state.d.ts.map +1 -0
- package/dist/module-state.js +162 -0
- package/dist/module-state.js.map +1 -0
- package/dist/modules.d.ts +52 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +110 -0
- package/dist/modules.js.map +1 -0
- package/dist/palette-check.d.ts +42 -0
- package/dist/palette-check.d.ts.map +1 -0
- package/dist/palette-check.js +217 -0
- package/dist/palette-check.js.map +1 -0
- package/dist/palette-compile.d.ts +30 -0
- package/dist/palette-compile.d.ts.map +1 -0
- package/dist/palette-compile.js +149 -0
- package/dist/palette-compile.js.map +1 -0
- package/dist/pm.d.ts +11 -0
- package/dist/pm.d.ts.map +1 -0
- package/dist/pm.js +30 -0
- package/dist/pm.js.map +1 -0
- package/dist/project-local-codex-relay.d.ts +11 -0
- package/dist/project-local-codex-relay.d.ts.map +1 -0
- package/dist/project-local-codex-relay.js +95 -0
- package/dist/project-local-codex-relay.js.map +1 -0
- package/dist/shared.d.ts +4 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +38 -0
- package/dist/shared.js.map +1 -0
- package/dist/shell-match.d.ts +29 -0
- package/dist/shell-match.d.ts.map +1 -0
- package/dist/shell-match.js +160 -0
- package/dist/shell-match.js.map +1 -0
- package/dist/template-doctor.d.ts +40 -0
- package/dist/template-doctor.d.ts.map +1 -0
- package/dist/template-doctor.js +722 -0
- package/dist/template-doctor.js.map +1 -0
- package/dist/template-install.d.ts +135 -0
- package/dist/template-install.d.ts.map +1 -0
- package/dist/template-install.js +1311 -0
- package/dist/template-install.js.map +1 -0
- package/dist/template-manifest.d.ts +328 -0
- package/dist/template-manifest.d.ts.map +1 -0
- package/dist/template-manifest.js +533 -0
- package/dist/template-manifest.js.map +1 -0
- package/dist/template-registry.d.ts +76 -0
- package/dist/template-registry.d.ts.map +1 -0
- package/dist/template-registry.js +365 -0
- package/dist/template-registry.js.map +1 -0
- package/dist/template-spec.d.ts +24 -0
- package/dist/template-spec.d.ts.map +1 -0
- package/dist/template-spec.js +38 -0
- package/dist/template-spec.js.map +1 -0
- package/dist/template-state.d.ts +108 -0
- package/dist/template-state.d.ts.map +1 -0
- package/dist/template-state.js +93 -0
- package/dist/template-state.js.map +1 -0
- package/dist/templates.d.ts +123 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +541 -0
- package/dist/templates.js.map +1 -0
- package/dist/theme-match.d.ts +41 -0
- package/dist/theme-match.d.ts.map +1 -0
- package/dist/theme-match.js +92 -0
- package/dist/theme-match.js.map +1 -0
- package/dist/wrangler-secrets.d.ts +15 -0
- package/dist/wrangler-secrets.d.ts.map +1 -0
- package/dist/wrangler-secrets.js +97 -0
- package/dist/wrangler-secrets.js.map +1 -0
- package/kits/datasheet-grid/file-manifest.json +65 -0
- package/kits/datasheet-grid/files/AGENTS.md +6 -0
- package/kits/datasheet-grid/files/docs/datasheet-grid.md +15 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/DatasheetGridRoute.tsx +35 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/README.md +10 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-adapter.ts +30 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-metadata.ts +19 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-state.ts +24 -0
- package/kits/datasheet-grid/files/kit.json +119 -0
- package/kits/datasheet-grid/files/skills/datasheet-grid/SKILL.md +16 -0
- package/kits/datasheet-grid/files/tests/datasheet-grid.test.ts +15 -0
- package/kits/datasheet-grid/kit.json +146 -0
- package/kits/index.json +71 -0
- package/kits/resend-email/file-manifest.json +47 -0
- package/kits/resend-email/files/AGENTS.md +7 -0
- package/kits/resend-email/files/docs/resend-email.md +13 -0
- package/kits/resend-email/files/files/src/kits/resend-email/README.md +17 -0
- package/kits/resend-email/files/files/src/kits/resend-email/send-email.ts +44 -0
- package/kits/resend-email/files/kit.json +128 -0
- package/kits/resend-email/files/skills/resend-email/SKILL.md +20 -0
- package/kits/resend-email/files/tests/resend-email.test.ts +54 -0
- package/kits/resend-email/kit.json +159 -0
- package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
- package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
- package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
- package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
- package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
- package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
- package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
- package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
- package/modules/docs/templates/react-router/source.config.ts +5 -0
- package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
- package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
- package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
- package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
- package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
- package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
- package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
- package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
- package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
- package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
- package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
- package/package.json +34 -8
- package/README.md +0 -3
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { createServer } from "node:http";
|
|
3
|
+
import { Readable } from "node:stream";
|
|
4
|
+
import { pipeline } from "node:stream/promises";
|
|
5
|
+
export const localCodexRelayUrlEnv = "RAYBASE_LOCAL_CODEX_RELAY_URL";
|
|
6
|
+
export const localCodexRelaySecretEnv = "RAYBASE_LOCAL_CODEX_RELAY_SECRET";
|
|
7
|
+
export const localCodexRelaySecretHeader = "x-raybase-local-codex-relay-secret";
|
|
8
|
+
const defaultCodexOrigin = "https://chatgpt.com";
|
|
9
|
+
const codexResponsesPath = "/backend-api/codex/responses";
|
|
10
|
+
const hopByHopHeaders = new Set([
|
|
11
|
+
"connection",
|
|
12
|
+
"keep-alive",
|
|
13
|
+
"proxy-authenticate",
|
|
14
|
+
"proxy-authorization",
|
|
15
|
+
"te",
|
|
16
|
+
"trailer",
|
|
17
|
+
"transfer-encoding",
|
|
18
|
+
"upgrade"
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Starts the dev-only Codex hop on an ephemeral IPv4 loopback port. The
|
|
22
|
+
* server deliberately has no request logging: upstream authorization and
|
|
23
|
+
* account headers must never reach terminal output.
|
|
24
|
+
*/
|
|
25
|
+
export async function startLocalCodexRelay(options = {}) {
|
|
26
|
+
const secret = randomBytes(32).toString("base64url");
|
|
27
|
+
const upstreamFetch = options.upstreamFetch ?? fetch;
|
|
28
|
+
const codexOrigin = normalizeCodexOrigin(options.codexOrigin ?? defaultCodexOrigin);
|
|
29
|
+
const server = createServer((request, response) => {
|
|
30
|
+
void handleRelayRequest(request, response, { secret, upstreamFetch, codexOrigin });
|
|
31
|
+
});
|
|
32
|
+
server.requestTimeout = 60_000;
|
|
33
|
+
server.headersTimeout = 65_000;
|
|
34
|
+
await listenLoopback(server);
|
|
35
|
+
const address = server.address();
|
|
36
|
+
if (!address || typeof address === "string") {
|
|
37
|
+
await closeServer(server);
|
|
38
|
+
throw new Error("raybase dev Codex relay did not acquire a loopback TCP port");
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
url: `http://127.0.0.1:${address.port}`,
|
|
42
|
+
secret,
|
|
43
|
+
close: () => closeServer(server)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async function handleRelayRequest(request, response, context) {
|
|
47
|
+
if (!authorized(request.headers[localCodexRelaySecretHeader], context.secret)) {
|
|
48
|
+
response.writeHead(401, { "content-type": "text/plain; charset=utf-8" });
|
|
49
|
+
response.end("Unauthorized");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const target = relayTarget(request.url, context.codexOrigin);
|
|
53
|
+
if (request.method !== "POST" || !target) {
|
|
54
|
+
response.writeHead(404, { "content-type": "text/plain; charset=utf-8" });
|
|
55
|
+
response.end("Not found");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const controller = new AbortController();
|
|
59
|
+
const abort = () => controller.abort();
|
|
60
|
+
request.once("aborted", abort);
|
|
61
|
+
response.once("close", abort);
|
|
62
|
+
try {
|
|
63
|
+
const upstreamInit = {
|
|
64
|
+
method: request.method,
|
|
65
|
+
headers: forwardedRequestHeaders(request.headers),
|
|
66
|
+
body: request,
|
|
67
|
+
redirect: "manual",
|
|
68
|
+
signal: controller.signal,
|
|
69
|
+
duplex: "half"
|
|
70
|
+
};
|
|
71
|
+
const upstream = await context.upstreamFetch(target, upstreamInit);
|
|
72
|
+
response.writeHead(upstream.status, upstream.statusText, forwardedResponseHeaders(upstream.headers));
|
|
73
|
+
if (!upstream.body) {
|
|
74
|
+
response.end();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
await pipeline(Readable.fromWeb(upstream.body), response);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
if (!response.headersSent && !response.destroyed) {
|
|
81
|
+
response.writeHead(502, { "content-type": "text/plain; charset=utf-8" });
|
|
82
|
+
response.end("Codex relay upstream request failed");
|
|
83
|
+
}
|
|
84
|
+
else if (!response.destroyed) {
|
|
85
|
+
response.destroy();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
request.off("aborted", abort);
|
|
90
|
+
response.off("close", abort);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function authorized(value, expected) {
|
|
94
|
+
if (typeof value !== "string")
|
|
95
|
+
return false;
|
|
96
|
+
const actualBytes = Buffer.from(value);
|
|
97
|
+
const expectedBytes = Buffer.from(expected);
|
|
98
|
+
return actualBytes.length === expectedBytes.length && timingSafeEqual(actualBytes, expectedBytes);
|
|
99
|
+
}
|
|
100
|
+
function relayTarget(rawUrl, codexOrigin) {
|
|
101
|
+
if (!rawUrl)
|
|
102
|
+
return null;
|
|
103
|
+
try {
|
|
104
|
+
const parsed = new URL(rawUrl, "http://127.0.0.1");
|
|
105
|
+
if (parsed.pathname !== codexResponsesPath || parsed.search || parsed.hash)
|
|
106
|
+
return null;
|
|
107
|
+
return new URL(codexResponsesPath, codexOrigin);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function forwardedRequestHeaders(source) {
|
|
114
|
+
const headers = new Headers();
|
|
115
|
+
for (const [name, value] of Object.entries(source)) {
|
|
116
|
+
const lower = name.toLowerCase();
|
|
117
|
+
if (lower === localCodexRelaySecretHeader || lower === "host" || hopByHopHeaders.has(lower) || value === undefined)
|
|
118
|
+
continue;
|
|
119
|
+
if (isIntermediaryHeader(lower))
|
|
120
|
+
continue;
|
|
121
|
+
if (Array.isArray(value)) {
|
|
122
|
+
for (const item of value)
|
|
123
|
+
headers.append(name, item);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
headers.set(name, value);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return headers;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Headers describing the hop, not the request the module authored.
|
|
133
|
+
*
|
|
134
|
+
* workerd stamps `cf-worker` on every outbound subrequest, and a `raybase dev`
|
|
135
|
+
* session that proxies remote bindings can add the rest of Cloudflare's
|
|
136
|
+
* visitor set. Forwarding those to chatgpt.com — itself behind Cloudflare —
|
|
137
|
+
* presents the request as one already handled by Cloudflare's edge, and its
|
|
138
|
+
* front door answers `403` with the HTML blocked page before the Codex API is
|
|
139
|
+
* ever reached (no `x-oai-request-id`). That was the whole reason the relay
|
|
140
|
+
* appeared not to work: it moved the TCP client to Node but carried workerd's
|
|
141
|
+
* `cf-worker` header through unchanged.
|
|
142
|
+
*
|
|
143
|
+
* Stripping these is proxy hygiene of the same kind as dropping `host` and the
|
|
144
|
+
* hop-by-hop set above — never a disguise. Everything the module itself sets
|
|
145
|
+
* (authorization, chatgpt-account-id, originator, accept) is forwarded byte
|
|
146
|
+
* for byte, so Raybase still presents itself honestly upstream.
|
|
147
|
+
*/
|
|
148
|
+
function isIntermediaryHeader(lower) {
|
|
149
|
+
return lower.startsWith("cf-")
|
|
150
|
+
|| lower.startsWith("x-forwarded-")
|
|
151
|
+
|| lower === "forwarded"
|
|
152
|
+
|| lower === "x-real-ip";
|
|
153
|
+
}
|
|
154
|
+
function forwardedResponseHeaders(source) {
|
|
155
|
+
const headers = {};
|
|
156
|
+
// Node fetch transparently decodes gzip/br/deflate but deliberately leaves
|
|
157
|
+
// the upstream representation headers in place. Forwarding those two
|
|
158
|
+
// headers would make workerd decode an already-decoded SSE body.
|
|
159
|
+
const decoded = Boolean(source.get("content-encoding")?.trim()) && source.get("content-encoding") !== "identity";
|
|
160
|
+
for (const [name, value] of source) {
|
|
161
|
+
const lower = name.toLowerCase();
|
|
162
|
+
if (hopByHopHeaders.has(lower))
|
|
163
|
+
continue;
|
|
164
|
+
if (decoded && (lower === "content-encoding" || lower === "content-length"))
|
|
165
|
+
continue;
|
|
166
|
+
headers[name] = value;
|
|
167
|
+
}
|
|
168
|
+
return headers;
|
|
169
|
+
}
|
|
170
|
+
function normalizeCodexOrigin(value) {
|
|
171
|
+
const parsed = new URL(value);
|
|
172
|
+
if (parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
|
|
173
|
+
throw new Error("Codex relay origin must be a bare HTTP(S) origin");
|
|
174
|
+
}
|
|
175
|
+
if (parsed.protocol !== "https:" && !(parsed.protocol === "http:" && parsed.hostname === "127.0.0.1")) {
|
|
176
|
+
throw new Error("Codex relay origin must use HTTPS");
|
|
177
|
+
}
|
|
178
|
+
return parsed.origin;
|
|
179
|
+
}
|
|
180
|
+
function listenLoopback(server) {
|
|
181
|
+
return new Promise((resolve, reject) => {
|
|
182
|
+
const onError = (error) => {
|
|
183
|
+
server.off("listening", onListening);
|
|
184
|
+
reject(error);
|
|
185
|
+
};
|
|
186
|
+
const onListening = () => {
|
|
187
|
+
server.off("error", onError);
|
|
188
|
+
resolve();
|
|
189
|
+
};
|
|
190
|
+
server.once("error", onError);
|
|
191
|
+
server.once("listening", onListening);
|
|
192
|
+
server.listen({ host: "127.0.0.1", port: 0, exclusive: true });
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function closeServer(server) {
|
|
196
|
+
if (!server.listening)
|
|
197
|
+
return Promise.resolve();
|
|
198
|
+
return new Promise((resolve, reject) => {
|
|
199
|
+
server.close((error) => error ? reject(error) : resolve());
|
|
200
|
+
server.closeAllConnections();
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=local-codex-relay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-codex-relay.js","sourceRoot":"","sources":["../src/local-codex-relay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,YAAY,EAKb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,kCAAkC,CAAC;AAC3E,MAAM,CAAC,MAAM,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mB,EAAE,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type RaybaseAppManifestReadResult } from "./app-manifest.js";
|
|
2
|
+
import { type FirstPartyModuleId } from "./module-state.js";
|
|
3
|
+
import type { FrameworkProfile } from "./frameworks.js";
|
|
4
|
+
export type ModuleDoctorIssue = {
|
|
5
|
+
level: "error" | "warning" | "info";
|
|
6
|
+
check: string;
|
|
7
|
+
message: string;
|
|
8
|
+
fix: string;
|
|
9
|
+
};
|
|
10
|
+
export type ModuleDoctorResult = {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
issues: ModuleDoctorIssue[];
|
|
13
|
+
modules: FirstPartyModuleId[];
|
|
14
|
+
};
|
|
15
|
+
export type ModuleDoctorSchemaSummary = {
|
|
16
|
+
config: {
|
|
17
|
+
auth?: {
|
|
18
|
+
publicRoutes?: string[];
|
|
19
|
+
};
|
|
20
|
+
mcp?: {
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
};
|
|
23
|
+
ai?: {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
provider?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function doctorModules(projectRoot: string, options: {
|
|
30
|
+
profile: FrameworkProfile;
|
|
31
|
+
summary?: ModuleDoctorSchemaSummary | null;
|
|
32
|
+
appManifest?: RaybaseAppManifestReadResult;
|
|
33
|
+
suppressAppManifestIssue?: boolean;
|
|
34
|
+
}): ModuleDoctorResult;
|
|
35
|
+
//# sourceMappingURL=module-doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-doctor.d.ts","sourceRoot":"","sources":["../src/module-doctor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmF,KAAK,4BAA4B,EAAkC,MAAM,mBAAmB,CAAC;AAIvL,OAAO,EASL,KAAK,kBAAkB,EAGxB,MAAM,mBAAmB,CAAC;AAC3B,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