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.json
|
||||||
config.local.json
|
config.local.json
|
||||||
pnpm-lock.yaml
|
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"
|
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",
|
"version": "0.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsx src/index.ts",
|
"dev": "tsx src/index.ts",
|
||||||
"build": "tsc --noEmit && node build.mjs",
|
"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",
|
"start": "node --enable-source-maps dist/index.mjs",
|
||||||
"typecheck": "tsc --noEmit"
|
"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:
|
The repo includes `.replit`, so after import the Run button starts the app with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm dev
|
PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod
|
||||||
```
|
```
|
||||||
|
|
||||||
The `.replit` `onBoot` command installs dependencies with:
|
The `.replit` `onBoot` command installs dependencies with:
|
||||||
@@ -18,6 +18,10 @@ The `.replit` `onBoot` command installs dependencies with:
|
|||||||
pnpm install --ignore-workspace
|
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
|
## Install
|
||||||
|
|
||||||
Run from this repository root:
|
Run from this repository root:
|
||||||
@@ -31,7 +35,7 @@ Use the available `pnpm`. This repo intentionally has no `packageManager` pin.
|
|||||||
## Start
|
## Start
|
||||||
|
|
||||||
```bash
|
```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:
|
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_BASE_URL`
|
||||||
- `AI_INTEGRATIONS_ANTHROPIC_API_KEY`
|
- `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
|
```bash
|
||||||
pnpm dev -- \
|
pnpm start -- \
|
||||||
--openai-base-url "<ai-integrations-openai-base-url>" \
|
--openai-base-url "<ai-integrations-openai-base-url>" \
|
||||||
--openai-api-key "<ai-integrations-openai-api-key>" \
|
--openai-api-key "<ai-integrations-openai-api-key>" \
|
||||||
--anthropic-base-url "<ai-integrations-anthropic-base-url>" \
|
--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`
|
- `--port` or `PORT`
|
||||||
- `--proxy-api-key` or `PROXY_API_KEY`
|
- `--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
|
## Verify
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -s http://localhost:3000/api/healthz
|
curl -s http://localhost:3000/api/healthz
|
||||||
curl -s http://localhost:3000/dashboard | head
|
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`.
|
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
|
## Key Commands
|
||||||
|
|
||||||
- `pnpm install --ignore-workspace` — install dependencies without joining a parent workspace
|
- `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 typecheck` — typecheck the server
|
||||||
- `pnpm run build` — typecheck and build `dist/index.mjs`
|
- `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
|
- `pnpm start` — run the built server
|
||||||
|
|
||||||
## Replit Configuration
|
## Replit Configuration
|
||||||
|
|
||||||
- `.replit` `run` uses `pnpm dev`
|
- `.replit` `run` uses `pnpm prod`
|
||||||
- `.replit` `onBoot` uses `pnpm install --ignore-workspace`
|
- `.replit` `onBoot` uses `pnpm install --ignore-workspace`
|
||||||
- deployment build uses `pnpm install --ignore-workspace && pnpm run build`
|
- publishing from a parent workspace should configure root `.replit` deployment and create a shell web artifact
|
||||||
- deployment run uses `pnpm start`
|
|
||||||
|
|
||||||
## Server Overrides
|
## 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:
|
Do not:
|
||||||
- add it to a parent workspace
|
- add it to a parent workspace
|
||||||
@@ -10,25 +17,42 @@ Do not:
|
|||||||
- create config.json or /tmp config files
|
- create config.json or /tmp config files
|
||||||
- inspect/free unrelated ports
|
- inspect/free unrelated ports
|
||||||
- use nohup/setsid/background shell tricks
|
- 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
|
- 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:
|
Steps:
|
||||||
|
|
||||||
1. Clone into ./random-proxy.
|
1. Clone into ./random-proxy-simple.
|
||||||
|
|
||||||
2. Provision/use Replit AI Integrations for:
|
2. Wire OpenAI and Anthropic via the ai-integrations-openai and ai-integrations-anthropic
|
||||||
- OpenAI
|
skills:
|
||||||
- Anthropic
|
- 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
|
cd random-proxy-simple && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN pnpm prod
|
||||||
curl -s http://localhost:3000/dashboard | head
|
|
||||||
curl -s -H "Authorization: Bearer dev-proxy-key" http://localhost:3000/v1/models
|
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:
|
Report only:
|
||||||
- local URL
|
- local URL
|
||||||
- whether OpenAI and Anthropic AI Integrations were wired
|
- whether setupReplitAIIntegrations wired OpenAI and Anthropic
|
||||||
- verification results
|
- that no verification commands were run
|
||||||
|
|||||||
Reference in New Issue
Block a user