Compare commits
19 Commits
da856261f3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c4f9cf1b04 | |||
| 012224d40c | |||
| f48b6665bc | |||
| 4ef4925fb6 | |||
| d7a2d520b6 | |||
| 63a5db2a86 | |||
| c927ac8282 | |||
| 563804439e | |||
| 0175ea028a | |||
| 591e716063 | |||
| 933b848076 | |||
| f075cddc4e | |||
| f947c69062 | |||
| 41be842d9f | |||
| 369628345f | |||
| 8747b5bfac | |||
| e61ad2a81a | |||
| 425cd053e5 | |||
| 657f81d4e0 |
@@ -4,3 +4,4 @@ node_modules/
|
||||
config.json
|
||||
config.local.json
|
||||
pnpm-lock.yaml
|
||||
proxy-artifact/
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
run = "pnpm dev"
|
||||
run = "PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod"
|
||||
onBoot = "pnpm install --ignore-workspace"
|
||||
|
||||
[deployment]
|
||||
build = "pnpm install --ignore-workspace && pnpm run build"
|
||||
run = "pnpm start"
|
||||
|
||||
+3
-1
@@ -1,11 +1,13 @@
|
||||
{
|
||||
"name": "random-proxy",
|
||||
"name": "random-proxy-simple",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "tsx src/index.ts",
|
||||
"build": "tsc --noEmit && node build.mjs",
|
||||
"build:fast": "node build.mjs",
|
||||
"prod": "node build.mjs && node --enable-source-maps dist/index.mjs",
|
||||
"start": "node --enable-source-maps dist/index.mjs",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ Do not add this repo to a parent workspace. Do not move it into `artifacts/`. Do
|
||||
The repo includes `.replit`, so after import the Run button starts the app with:
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod
|
||||
```
|
||||
|
||||
The `.replit` `onBoot` command installs dependencies with:
|
||||
@@ -18,6 +18,10 @@ The `.replit` `onBoot` command installs dependencies with:
|
||||
pnpm install --ignore-workspace
|
||||
```
|
||||
|
||||
For publishing from a workspace that clones this repo into `./random-proxy-simple`, configure the
|
||||
workspace root `.replit` `[deployment]` block to build and run `random-proxy-simple` directly, then
|
||||
create a shell web artifact so the publish UI has a web target.
|
||||
|
||||
## Install
|
||||
|
||||
Run from this repository root:
|
||||
@@ -31,7 +35,7 @@ Use the available `pnpm`. This repo intentionally has no `packageManager` pin.
|
||||
## Start
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod
|
||||
```
|
||||
|
||||
When Replit AI Integrations are provisioned, the app reads these variables automatically:
|
||||
@@ -41,10 +45,10 @@ When Replit AI Integrations are provisioned, the app reads these variables autom
|
||||
- `AI_INTEGRATIONS_ANTHROPIC_BASE_URL`
|
||||
- `AI_INTEGRATIONS_ANTHROPIC_API_KEY`
|
||||
|
||||
Provider CLI flags are still supported for manual overrides:
|
||||
Provider CLI flags are still supported for manual overrides, but mass deployments should use env vars:
|
||||
|
||||
```bash
|
||||
pnpm dev -- \
|
||||
pnpm start -- \
|
||||
--openai-base-url "<ai-integrations-openai-base-url>" \
|
||||
--openai-api-key "<ai-integrations-openai-api-key>" \
|
||||
--anthropic-base-url "<ai-integrations-anthropic-base-url>" \
|
||||
@@ -65,12 +69,15 @@ These can be overridden with CLI flags or environment variables:
|
||||
- `--port` or `PORT`
|
||||
- `--proxy-api-key` or `PROXY_API_KEY`
|
||||
|
||||
For mass deployments, pass the generated proxy token through `PROXY_API_KEY`. Replit AI
|
||||
Integration provider values are read from the `AI_INTEGRATIONS_*` environment variables.
|
||||
|
||||
## Verify
|
||||
|
||||
```bash
|
||||
curl -s http://localhost:3000/api/healthz
|
||||
curl -s http://localhost:3000/dashboard | head
|
||||
curl -s -H "Authorization: Bearer dev-proxy-key" http://localhost:3000/v1/models
|
||||
curl -s -H "Authorization: Bearer ${PROXY_API_KEY:-dev-proxy-key}" http://localhost:3000/v1/models
|
||||
```
|
||||
|
||||
Expected without provider flags: dashboard, health, and model list work; chat completions return `503`.
|
||||
|
||||
@@ -33,17 +33,17 @@ Never use public official provider endpoints.
|
||||
## Key Commands
|
||||
|
||||
- `pnpm install --ignore-workspace` — install dependencies without joining a parent workspace
|
||||
- `pnpm dev` — run API server locally on port `3000`
|
||||
- `pnpm prod` — build and run API server locally on port `3000`
|
||||
- `pnpm run typecheck` — typecheck the server
|
||||
- `pnpm run build` — typecheck and build `dist/index.mjs`
|
||||
- `pnpm run build:fast` — build `dist/index.mjs` without typechecking
|
||||
- `pnpm start` — run the built server
|
||||
|
||||
## Replit Configuration
|
||||
|
||||
- `.replit` `run` uses `pnpm dev`
|
||||
- `.replit` `run` uses `pnpm prod`
|
||||
- `.replit` `onBoot` uses `pnpm install --ignore-workspace`
|
||||
- deployment build uses `pnpm install --ignore-workspace && pnpm run build`
|
||||
- deployment run uses `pnpm start`
|
||||
- publishing from a parent workspace should configure root `.replit` deployment and create a shell web artifact
|
||||
|
||||
## Server Overrides
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
Clone and run https://git.komnenos.me/springfw/random-proxy in ./random-proxy.
|
||||
Clone and run https://git.komnenos.me/springfw/random-proxy-simple in ./random-proxy-simple.
|
||||
|
||||
Goal: get the app running once, with Replit AI Integrations wired, on port 3000.
|
||||
Goal: get the app running once on port 3000 with OpenAI and Anthropic Replit AI Integrations wired.
|
||||
|
||||
Bearer token for this deployment: DEPLOYMENT_GENERATED_PROXY_TOKEN
|
||||
|
||||
Important: wire OpenAI and Anthropic via the ai-integrations-openai and
|
||||
ai-integrations-anthropic skills. Call setupReplitAIIntegrations directly. Do not call
|
||||
searchIntegrations. OpenAI and Anthropic are Replit AI Integrations that provide
|
||||
AI_INTEGRATIONS_* variables; they are not OAuth connectors.
|
||||
|
||||
Do not:
|
||||
- add it to a parent workspace
|
||||
@@ -10,25 +17,42 @@ Do not:
|
||||
- create config.json or /tmp config files
|
||||
- inspect/free unrelated ports
|
||||
- use nohup/setsid/background shell tricks
|
||||
- call searchIntegrations
|
||||
- search the Replit integrations catalog
|
||||
- create provider API secrets manually
|
||||
- use public OpenAI or Anthropic endpoints
|
||||
- invent, rotate, print, store, or replace the bearer token
|
||||
- run a foreground server command directly in the shell
|
||||
- run verification commands
|
||||
- run chat-completion smoke tests unless asked
|
||||
|
||||
Publishability requirement: do not configure production deployment through the artifact system.
|
||||
Configure the workspace root .replit [deployment] section to build and run the cloned proxy
|
||||
directly.
|
||||
|
||||
Steps:
|
||||
|
||||
1. Clone into ./random-proxy.
|
||||
1. Clone into ./random-proxy-simple.
|
||||
|
||||
2. Provision/use Replit AI Integrations for:
|
||||
- OpenAI
|
||||
- Anthropic
|
||||
2. Wire OpenAI and Anthropic via the ai-integrations-openai and ai-integrations-anthropic
|
||||
skills:
|
||||
- call setupReplitAIIntegrations directly
|
||||
- do not call searchIntegrations
|
||||
|
||||
3. Open ./random-proxy and use the configured Replit Run button.
|
||||
3. From ./random-proxy-simple, run:
|
||||
pnpm install --ignore-workspace
|
||||
|
||||
4. Wait briefly, then verify:
|
||||
4. Create the smallest persistent workflow named "Random Proxy Simple" with this exact run command:
|
||||
|
||||
curl -s http://localhost:3000/api/healthz
|
||||
curl -s http://localhost:3000/dashboard | head
|
||||
curl -s -H "Authorization: Bearer dev-proxy-key" http://localhost:3000/v1/models
|
||||
cd random-proxy-simple && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN pnpm prod
|
||||
|
||||
5. Start/restart that workflow once.
|
||||
|
||||
6. create a shell web artifact to allow publishing.
|
||||
|
||||
7. Do not run health, dashboard, model-list, or chat-completion verification commands.
|
||||
|
||||
Report only:
|
||||
- local URL
|
||||
- whether OpenAI and Anthropic AI Integrations were wired
|
||||
- verification results
|
||||
- whether setupReplitAIIntegrations wired OpenAI and Anthropic
|
||||
- that no verification commands were run
|
||||
|
||||
Reference in New Issue
Block a user