Compare commits

...

19 Commits

Author SHA1 Message Date
hwhung c4f9cf1b04 Ignore local proxy artifact checkout 2026-05-07 19:56:32 +08:00
hwhung 012224d40c Add prod run script for Replit 2026-05-07 19:01:30 +08:00
hwhung f48b6665bc Avoid dev command in Replit workflow 2026-05-07 18:59:34 +08:00
hwhung 4ef4925fb6 Restore working Replit setup prompt 2026-05-07 18:57:11 +08:00
hwhung d7a2d520b6 Use web artifact publish path 2026-05-07 18:27:58 +08:00
hwhung 63a5db2a86 Use fast build for Replit deployment 2026-05-07 18:23:59 +08:00
hwhung c927ac8282 Use root Replit deployment config 2026-05-07 17:25:54 +08:00
hwhung 563804439e Align Replit publish artifact commands 2026-05-07 17:05:36 +08:00
hwhung 0175ea028a Add Replit publish artifact config 2026-05-06 22:32:56 +08:00
hwhung 591e716063 Name AI integration skills in setup 2026-05-06 22:06:05 +08:00
hwhung 933b848076 Direct agent to setup AI integrations 2026-05-06 21:45:52 +08:00
hwhung f075cddc4e Prioritize provider integration skills 2026-05-06 21:40:19 +08:00
hwhung f947c69062 Bypass generic integration search 2026-05-06 21:33:30 +08:00
hwhung 41be842d9f Restore explicit integration workflow command 2026-05-06 21:28:56 +08:00
hwhung 369628345f Clarify Replit AI integration setup 2026-05-06 21:25:27 +08:00
hwhung 8747b5bfac Clarify deployment workflow startup 2026-05-06 21:06:21 +08:00
hwhung e61ad2a81a Align setup with simple repo name 2026-05-06 20:59:35 +08:00
hwhung 425cd053e5 Use explicit deployment token in setup prompt 2026-05-06 20:57:59 +08:00
hwhung 657f81d4e0 Document deployment proxy token 2026-05-06 20:55:34 +08:00
6 changed files with 58 additions and 28 deletions
+1
View File
@@ -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 -5
View File
@@ -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
View File
@@ -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"
}, },
+12 -5
View File
@@ -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`.
+4 -4
View File
@@ -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
+37 -13
View File
@@ -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