Spaces:
Running
Running
Deploy 0720960 to Docker Space
Browse filesSource: MisonL/gpt-image-playground-customer@07209608cdbddc4207aa853b7eb6ea60db1f1827
- docs/deployment/huggingface-space-free.md +3 -3
- package.json +2 -1
- public/hf-space-deploy-marker.json +3 -3
- scripts/command-center.test.mjs +2 -1
- scripts/doctor-hf-space.mjs +1 -1
- scripts/status.mjs +2 -1
- src/app/api/deploy-marker/route.ts +1 -1
- src/lib/agent-api-contracts.test.ts +2 -1
- src/lib/agent-api-contracts.ts +4 -2
- src/lib/agent-openapi.ts +2 -1
docs/deployment/huggingface-space-free.md
CHANGED
|
@@ -46,7 +46,7 @@ hf auth whoami
|
|
| 46 |
- npm 随 Node.js 一起可用。
|
| 47 |
- Hugging Face CLI 使用当前官方 `hf` 命令。
|
| 48 |
- `hf auth login` 使用 Hugging Face Access Token,不是账号密码。
|
| 49 |
-
- Docker 只对 `npm run smoke:hf-space` 和本地容器验证必需;部署到远端 Space 使用 `hf` CLI。
|
| 50 |
|
| 51 |
安装 Hugging Face CLI 时,以官方文档为准。不要把远程安装脚本直接管道到 shell;如需使用官方脚本,先下载、核对来源和内容后再执行。
|
| 52 |
|
|
@@ -208,7 +208,7 @@ node skills/gpt-image-playground-agent/scripts/generate-image.mjs \
|
|
| 208 |
提交前运行:
|
| 209 |
|
| 210 |
```bash
|
| 211 |
-
npm run smoke:hf-space
|
| 212 |
```
|
| 213 |
|
| 214 |
该命令会:
|
|
@@ -278,7 +278,7 @@ npm run lint
|
|
| 278 |
npm run lint:scripts
|
| 279 |
npm run build
|
| 280 |
npm run keepalive:hf-space
|
| 281 |
-
npm run smoke:hf-space
|
| 282 |
git diff --check
|
| 283 |
```
|
| 284 |
|
|
|
|
| 46 |
- npm 随 Node.js 一起可用。
|
| 47 |
- Hugging Face CLI 使用当前官方 `hf` 命令。
|
| 48 |
- `hf auth login` 使用 Hugging Face Access Token,不是账号密码。
|
| 49 |
+
- Docker 只对本地 Space-like 容器 smoke(推荐 `npm run smoke:hf-space-local`,兼容别名 `npm run smoke:hf-space`)和本地容器验证必需;部署到远端 Space 使用 `hf` CLI。
|
| 50 |
|
| 51 |
安装 Hugging Face CLI 时,以官方文档为准。不要把远程安装脚本直接管道到 shell;如需使用官方脚本,先下载、核对来源和内容后再执行。
|
| 52 |
|
|
|
|
| 208 |
提交前运行:
|
| 209 |
|
| 210 |
```bash
|
| 211 |
+
npm run smoke:hf-space-local
|
| 212 |
```
|
| 213 |
|
| 214 |
该命令会:
|
|
|
|
| 278 |
npm run lint:scripts
|
| 279 |
npm run build
|
| 280 |
npm run keepalive:hf-space
|
| 281 |
+
npm run smoke:hf-space-local
|
| 282 |
git diff --check
|
| 283 |
```
|
| 284 |
|
package.json
CHANGED
|
@@ -24,7 +24,8 @@
|
|
| 24 |
"deploy:hf-space": "node scripts/deploy-hf-space.mjs",
|
| 25 |
"doctor:hf-space": "node scripts/doctor-hf-space.mjs",
|
| 26 |
"keepalive:hf-space": "node scripts/keepalive-hf-space.mjs",
|
| 27 |
-
"smoke:hf-space": "
|
|
|
|
| 28 |
"smoke:image-upstream-compat": "node --import tsx scripts/smoke-image-upstream-compat.mjs",
|
| 29 |
"smoke:image-upstream-local": "node scripts/smoke-image-upstream-local-final-gate.mjs",
|
| 30 |
"smoke:image-upstream-real": "node --import tsx -- scripts/smoke-image-upstream-real.mjs",
|
|
|
|
| 24 |
"deploy:hf-space": "node scripts/deploy-hf-space.mjs",
|
| 25 |
"doctor:hf-space": "node scripts/doctor-hf-space.mjs",
|
| 26 |
"keepalive:hf-space": "node scripts/keepalive-hf-space.mjs",
|
| 27 |
+
"smoke:hf-space": "npm run smoke:hf-space-local",
|
| 28 |
+
"smoke:hf-space-local": "node scripts/smoke-hf-space-memory.mjs",
|
| 29 |
"smoke:image-upstream-compat": "node --import tsx scripts/smoke-image-upstream-compat.mjs",
|
| 30 |
"smoke:image-upstream-local": "node scripts/smoke-image-upstream-local-final-gate.mjs",
|
| 31 |
"smoke:image-upstream-real": "node --import tsx -- scripts/smoke-image-upstream-real.mjs",
|
public/hf-space-deploy-marker.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"schema_version": 1,
|
| 3 |
-
"local_sha": "
|
| 4 |
-
"created_at": "2026-06-26T01:
|
| 5 |
-
"deploy_id": "
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"schema_version": 1,
|
| 3 |
+
"local_sha": "07209608cdbddc4207aa853b7eb6ea60db1f1827",
|
| 4 |
+
"created_at": "2026-06-26T01:51:20.764Z",
|
| 5 |
+
"deploy_id": "fce636f2-7a61-4ff6-8f38-d69ac5edeb35"
|
| 6 |
}
|
scripts/command-center.test.mjs
CHANGED
|
@@ -40,7 +40,8 @@ describe('Command center scripts', () => {
|
|
| 40 |
docker_cleanup_fixtures: 'npm run docker:cleanup-fixtures',
|
| 41 |
agent_doctor: 'npm run agent:doctor',
|
| 42 |
hf_space_doctor: 'npm run doctor:hf-space',
|
| 43 |
-
|
|
|
|
| 44 |
});
|
| 45 |
});
|
| 46 |
|
|
|
|
| 40 |
docker_cleanup_fixtures: 'npm run docker:cleanup-fixtures',
|
| 41 |
agent_doctor: 'npm run agent:doctor',
|
| 42 |
hf_space_doctor: 'npm run doctor:hf-space',
|
| 43 |
+
hf_space_local_smoke: 'npm run smoke:hf-space-local',
|
| 44 |
+
hf_space_smoke_legacy_alias: 'npm run smoke:hf-space'
|
| 45 |
});
|
| 46 |
});
|
| 47 |
|
scripts/doctor-hf-space.mjs
CHANGED
|
@@ -200,7 +200,7 @@ function main() {
|
|
| 200 |
if (docker.ok) {
|
| 201 |
addCheck(checks, 'pass', 'docker', 'docker is available.', { version: docker.stdout.split(/\r?\n/)[0] });
|
| 202 |
} else {
|
| 203 |
-
addCheck(checks, 'warn', 'docker', 'Docker is unavailable; npm run smoke:hf-space will not work.', {
|
| 204 |
error: docker.error
|
| 205 |
});
|
| 206 |
const dockerCli = runDoctorCommand('docker', ['--version']);
|
|
|
|
| 200 |
if (docker.ok) {
|
| 201 |
addCheck(checks, 'pass', 'docker', 'docker is available.', { version: docker.stdout.split(/\r?\n/)[0] });
|
| 202 |
} else {
|
| 203 |
+
addCheck(checks, 'warn', 'docker', 'Docker is unavailable; npm run smoke:hf-space-local will not work.', {
|
| 204 |
error: docker.error
|
| 205 |
});
|
| 206 |
const dockerCli = runDoctorCommand('docker', ['--version']);
|
scripts/status.mjs
CHANGED
|
@@ -47,7 +47,8 @@ export function buildAdminCommands() {
|
|
| 47 |
docker_cleanup_fixtures: 'npm run docker:cleanup-fixtures',
|
| 48 |
agent_doctor: 'npm run agent:doctor',
|
| 49 |
hf_space_doctor: 'npm run doctor:hf-space',
|
| 50 |
-
|
|
|
|
| 51 |
};
|
| 52 |
}
|
| 53 |
|
|
|
|
| 47 |
docker_cleanup_fixtures: 'npm run docker:cleanup-fixtures',
|
| 48 |
agent_doctor: 'npm run agent:doctor',
|
| 49 |
hf_space_doctor: 'npm run doctor:hf-space',
|
| 50 |
+
hf_space_local_smoke: 'npm run smoke:hf-space-local',
|
| 51 |
+
hf_space_smoke_legacy_alias: 'npm run smoke:hf-space'
|
| 52 |
};
|
| 53 |
}
|
| 54 |
|
src/app/api/deploy-marker/route.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import { NextResponse } from 'next/server';
|
| 2 |
|
| 3 |
-
const deployMarker = {"schema_version":1,"local_sha":"
|
| 4 |
|
| 5 |
export const dynamic = 'force-dynamic';
|
| 6 |
|
|
|
|
| 1 |
import { NextResponse } from 'next/server';
|
| 2 |
|
| 3 |
+
const deployMarker = {"schema_version":1,"local_sha":"07209608cdbddc4207aa853b7eb6ea60db1f1827","created_at":"2026-06-26T01:51:20.764Z","deploy_id":"fce636f2-7a61-4ff6-8f38-d69ac5edeb35"} as const;
|
| 4 |
|
| 5 |
export const dynamic = 'force-dynamic';
|
| 6 |
|
src/lib/agent-api-contracts.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import {
|
| 2 |
AGENT_PAGE_REQUEST_DIAGNOSTICS_NO_MATCH_HINT,
|
|
|
|
| 3 |
AGENT_SCHEMA_VERSION,
|
| 4 |
PAGE_SSE_CLIENT_REQUEST_ID_MAX_LENGTH,
|
| 5 |
buildAgentAuthCapabilities,
|
|
@@ -439,7 +440,7 @@ describe('buildAgentCapabilities', () => {
|
|
| 439 |
});
|
| 440 |
assert.equal(
|
| 441 |
capabilities.agent_streaming.page_sse.agent_usage,
|
| 442 |
-
|
| 443 |
);
|
| 444 |
assert.deepEqual(capabilities.upstream_request_headers.default, {
|
| 445 |
user_agent_effective: 'gpt-image-playground/2.1.0',
|
|
|
|
| 1 |
import {
|
| 2 |
AGENT_PAGE_REQUEST_DIAGNOSTICS_NO_MATCH_HINT,
|
| 3 |
+
AGENT_PAGE_SSE_AGENT_USAGE,
|
| 4 |
AGENT_SCHEMA_VERSION,
|
| 5 |
PAGE_SSE_CLIENT_REQUEST_ID_MAX_LENGTH,
|
| 6 |
buildAgentAuthCapabilities,
|
|
|
|
| 440 |
});
|
| 441 |
assert.equal(
|
| 442 |
capabilities.agent_streaming.page_sse.agent_usage,
|
| 443 |
+
AGENT_PAGE_SSE_AGENT_USAGE
|
| 444 |
);
|
| 445 |
assert.deepEqual(capabilities.upstream_request_headers.default, {
|
| 446 |
user_agent_effective: 'gpt-image-playground/2.1.0',
|
src/lib/agent-api-contracts.ts
CHANGED
|
@@ -97,6 +97,8 @@ export const AGENT_UPSTREAM_SSE_EDIT_REQUEST_FIELDS = [
|
|
| 97 |
'streaming_strategy',
|
| 98 |
'partial_images'
|
| 99 |
] as const;
|
|
|
|
|
|
|
| 100 |
const AGENT_DEFAULT_PARTIAL_IMAGES = 2;
|
| 101 |
|
| 102 |
export type AgentStateBackend = 'memory' | 'sqlite' | 'postgres';
|
|
@@ -334,7 +336,7 @@ export type AgentCapabilities = {
|
|
| 334 |
source_header: 'Idempotency-Key';
|
| 335 |
max_length: number;
|
| 336 |
};
|
| 337 |
-
agent_usage:
|
| 338 |
};
|
| 339 |
};
|
| 340 |
orchestration: {
|
|
@@ -1013,7 +1015,7 @@ export function buildAgentCapabilities(env: Record<string, string | undefined>):
|
|
| 1013 |
source_header: 'Idempotency-Key',
|
| 1014 |
max_length: PAGE_SSE_CLIENT_REQUEST_ID_MAX_LENGTH
|
| 1015 |
},
|
| 1016 |
-
agent_usage:
|
| 1017 |
}
|
| 1018 |
},
|
| 1019 |
orchestration: {
|
|
|
|
| 97 |
'streaming_strategy',
|
| 98 |
'partial_images'
|
| 99 |
] as const;
|
| 100 |
+
export const AGENT_PAGE_SSE_AGENT_USAGE =
|
| 101 |
+
'explicit_for_generate_recommended_for_page_only_fields_default_webp_edit_high_resolution_edit_long_image_recovery_and_complex_batch' as const;
|
| 102 |
const AGENT_DEFAULT_PARTIAL_IMAGES = 2;
|
| 103 |
|
| 104 |
export type AgentStateBackend = 'memory' | 'sqlite' | 'postgres';
|
|
|
|
| 336 |
source_header: 'Idempotency-Key';
|
| 337 |
max_length: number;
|
| 338 |
};
|
| 339 |
+
agent_usage: typeof AGENT_PAGE_SSE_AGENT_USAGE;
|
| 340 |
};
|
| 341 |
};
|
| 342 |
orchestration: {
|
|
|
|
| 1015 |
source_header: 'Idempotency-Key',
|
| 1016 |
max_length: PAGE_SSE_CLIENT_REQUEST_ID_MAX_LENGTH
|
| 1017 |
},
|
| 1018 |
+
agent_usage: AGENT_PAGE_SSE_AGENT_USAGE
|
| 1019 |
}
|
| 1020 |
},
|
| 1021 |
orchestration: {
|
src/lib/agent-openapi.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
| 5 |
AGENT_MODERATIONS,
|
| 6 |
AGENT_MODELS,
|
| 7 |
AGENT_OUTPUT_FORMATS,
|
|
|
|
| 8 |
AGENT_QUALITIES,
|
| 9 |
AGENT_RESPONSE_MODES,
|
| 10 |
AGENT_STREAM_MODES,
|
|
@@ -1084,7 +1085,7 @@ export function buildAgentOpenApiDocument(env: Record<string, string | undefined
|
|
| 1084 |
},
|
| 1085 |
agent_usage: {
|
| 1086 |
type: 'string',
|
| 1087 |
-
enum: [
|
| 1088 |
}
|
| 1089 |
}
|
| 1090 |
}
|
|
|
|
| 5 |
AGENT_MODERATIONS,
|
| 6 |
AGENT_MODELS,
|
| 7 |
AGENT_OUTPUT_FORMATS,
|
| 8 |
+
AGENT_PAGE_SSE_AGENT_USAGE,
|
| 9 |
AGENT_QUALITIES,
|
| 10 |
AGENT_RESPONSE_MODES,
|
| 11 |
AGENT_STREAM_MODES,
|
|
|
|
| 1085 |
},
|
| 1086 |
agent_usage: {
|
| 1087 |
type: 'string',
|
| 1088 |
+
enum: [AGENT_PAGE_SSE_AGENT_USAGE]
|
| 1089 |
}
|
| 1090 |
}
|
| 1091 |
}
|