Skip to content

Commit b4a4932

Browse files
committed
docs: rewrite public README for open-source users
Rewrite the project README as a normal open-source entrypoint: - explain purpose, use cases, benefits, install options, and requirements - add quick-start examples for core metadata, RunningHub descriptors, client usage, and key-pool helpers - clarify what the kit does and does not provide - link documentation, development commands, harness rules, security, contribution, and license information Also record the README update and verification result in the daily log.
1 parent b29f34a commit b4a4932

2 files changed

Lines changed: 251 additions & 56 deletions

File tree

README.md

Lines changed: 220 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,56 @@
11
# AIGC Provider Runtime Kit
22

3-
Reusable TypeScript runtime primitives for AIGC products that need to manage multiple model providers and RunningHub entries without rebuilding the same provider configuration layer for every project.
3+
[![CI](https://github.com/Hhh2178/aigc-provider-runtime-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/Hhh2178/aigc-provider-runtime-kit/actions/workflows/ci.yml)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
5+
[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue.svg)](https://www.typescriptlang.org/)
46

5-
![CI](https://github.com/Hhh2178/aigc-provider-runtime-kit/actions/workflows/ci.yml/badge.svg)
7+
Framework-neutral TypeScript primitives for AIGC products that need to manage model providers, model parameters, request bodies, RunningHub Apps/Workflows, and provider key concurrency without rebuilding the same runtime layer in every project.
68

7-
This project starts as a small, framework-neutral kit extracted from production lessons:
9+
This repository is a small runtime kit, not a hosted service. It gives your application typed building blocks; your application keeps ownership of credentials, databases, queues, permissions, billing, and auditing.
810

9-
- Provider protocol and model capability types.
10-
- Model parameter schema and UI metadata helpers.
11-
- JSON and multipart request body helpers.
12-
- RunningHub App / Workflow catalog types.
13-
- RunningHub execution descriptor generation.
14-
- RunningHub submit / poll client.
15-
- RunningHub key-pool concurrency dispatch.
16-
- Project harness docs and verification contracts for long-term maintenance.
11+
## Why This Exists
1712

18-
## Status
13+
Most AIGC applications eventually need the same provider infrastructure:
1914

20-
`v0.1.0` is a foundation release. APIs are intentionally small and may evolve before a stable `1.0`.
15+
- A normalized way to describe providers and models.
16+
- Model parameter schemas that can drive admin forms, canvas nodes, or API payloads.
17+
- Request body helpers for JSON and multipart provider APIs.
18+
- A reusable RunningHub App/Workflow catalog model.
19+
- A safe way to submit, poll, and extract media outputs from RunningHub tasks.
20+
- Key-pool helpers so multiple API keys can be used without exceeding concurrency limits.
21+
22+
`aigc-provider-runtime-kit` packages those common pieces as reusable TypeScript modules.
23+
24+
## Features
25+
26+
- **Provider contracts**: typed provider, model, capability, and parameter schema definitions.
27+
- **UI-ready model metadata**: convert schemas into aspect ratio, size, duration, resolution, and reference-input metadata.
28+
- **Request body helpers**: build multipart `FormData` payloads from scalar fields, remote URLs, or data URLs.
29+
- **RunningHub catalog helpers**: normalize RunningHub App/Workflow records into reusable host-app entries.
30+
- **Execution descriptors**: generate submit/poll/output handling metadata for RunningHub tasks.
31+
- **RunningHub client**: submit tasks, poll results, normalize failures, and extract image/video/audio URLs.
32+
- **Key-pool concurrency**: acquire and release RunningHub keys against a Redis-like runtime interface.
33+
- **No framework lock-in**: works with Node.js services, workers, CLI tools, or any framework that can import ESM.
34+
- **Governed project harness**: includes docs, CI, tests, and verification scripts to keep the package maintainable.
35+
36+
## Install
37+
38+
```bash
39+
npm install aigc-provider-runtime-kit
40+
```
41+
42+
The package is currently in the `0.1.x` foundation line. APIs are intentionally small and may evolve before `1.0`.
43+
44+
If the package has not been published to npm in your environment yet, install directly from GitHub:
45+
46+
```bash
47+
npm install github:Hhh2178/aigc-provider-runtime-kit
48+
```
49+
50+
## Requirements
51+
52+
- Node.js 22 or a modern runtime with ESM, `fetch`, `FormData`, `Blob`, and `AbortSignal.timeout`.
53+
- TypeScript is recommended for the best developer experience.
2154

2255
## Package Entrypoints
2356

@@ -28,85 +61,216 @@ This project starts as a small, framework-neutral kit extracted from production
2861
| `aigc-provider-runtime-kit/runninghub` | RunningHub catalog, descriptor, client, and key-pool helpers |
2962
| `aigc-provider-runtime-kit/runtime` | Explicit combined runtime exports |
3063

31-
## Install
64+
## Quick Start
3265

33-
```bash
34-
npm install aigc-provider-runtime-kit
35-
```
66+
Create UI-friendly model metadata from a provider model:
3667

37-
Until the package is published to npm, consume the GitHub repository directly or copy the packages into an internal workspace.
68+
```ts
69+
import {
70+
defaultParameterSchemaForModel,
71+
uiMetadataFromSchema
72+
} from "aigc-provider-runtime-kit/core";
3873

39-
## Quick Example
74+
const schema = defaultParameterSchemaForModel("image", "gpt-image-2", "openai");
75+
const ui = uiMetadataFromSchema(schema, "image");
76+
77+
console.log(ui.defaultAspectRatio);
78+
console.log(ui.maxReferenceImages);
79+
```
80+
81+
Build a RunningHub execution descriptor:
4082

4183
```ts
42-
import { defaultParameterSchemaForModel } from "aigc-provider-runtime-kit/core";
4384
import { buildRunningHubExecutionDescriptor } from "aigc-provider-runtime-kit/runninghub";
4485

45-
const schema = defaultParameterSchemaForModel("image", "gpt-image-2", "openai");
46-
4786
const execution = buildRunningHubExecutionDescriptor({
48-
kind: "app",
49-
appId: "rh-app-id",
50-
runTargetId: "rh-app-id",
51-
taskCapability: "image",
52-
fields: []
87+
kind: "workflow",
88+
workflowId: "workflow-id",
89+
runTargetId: "workflow-id",
90+
taskCapability: "video",
91+
fields: [
92+
{
93+
nodeId: "6",
94+
fieldName: "prompt",
95+
label: "Prompt",
96+
valueType: "string",
97+
required: true
98+
}
99+
]
100+
});
101+
102+
console.log(execution.submit.submitMode);
103+
console.log(execution.polling.intervalMs);
104+
```
105+
106+
Submit and poll a RunningHub task from your worker:
107+
108+
```ts
109+
import { createRunningHubClient } from "aigc-provider-runtime-kit/runninghub";
110+
111+
const client = createRunningHubClient({
112+
apiKey: process.env.RUNNINGHUB_API_KEY!,
113+
baseUrl: "https://www.runninghub.cn"
53114
});
115+
116+
const result = await client.runTask({
117+
targetType: "workflow",
118+
runTargetId: "workflow-id",
119+
workflowId: "workflow-id",
120+
nodeInfoList: [
121+
{
122+
nodeId: "6",
123+
fieldName: "prompt",
124+
fieldValue: "A cinematic robot walking through a rainy neon street"
125+
}
126+
],
127+
timeoutMs: 10 * 60 * 1000
128+
});
129+
130+
console.log(result.videoUrls);
131+
```
132+
133+
Use key-pool helpers with a Redis-like runtime:
134+
135+
```ts
136+
import {
137+
acquireRunningHubKey,
138+
releaseRunningHubKey
139+
} from "aigc-provider-runtime-kit/runninghub";
140+
141+
const acquired = await acquireRunningHubKey({
142+
providerId: "runninghub",
143+
defaultConcurrency: 2,
144+
runtime: redisLikeRuntime,
145+
keys: [
146+
{
147+
id: "key-1",
148+
note: "primary",
149+
apiKey: process.env.RUNNINGHUB_API_KEY,
150+
maxConcurrency: 2,
151+
enabled: true,
152+
isDefault: true
153+
}
154+
]
155+
});
156+
157+
if (!acquired.acquired) {
158+
throw new Error(`No RunningHub key available: ${acquired.reason}`);
159+
}
160+
161+
try {
162+
// Run provider task with acquired.key.apiKey.
163+
} finally {
164+
await releaseRunningHubKey({
165+
providerId: "runninghub",
166+
keyId: acquired.key.id,
167+
runtime: redisLikeRuntime
168+
});
169+
}
54170
```
55171

56-
More examples:
172+
## What You Can Build With It
57173

58-
- `docs/getting-started.md`
59-
- `docs/api-reference.md`
60-
- `examples/node-basic/`
174+
- A multi-provider AIGC backend.
175+
- A provider/model management admin panel.
176+
- A visual canvas node runtime for image, video, audio, or workflow generation.
177+
- A RunningHub App/Workflow gateway.
178+
- A worker service that dispatches provider jobs with API key concurrency limits.
179+
- A shared provider runtime layer reused across multiple products.
180+
181+
## What This Kit Does Not Do
182+
183+
- It does not store API keys or credentials.
184+
- It does not provide a hosted API service.
185+
- It does not include a database schema or migration system.
186+
- It does not implement user permissions, billing, or quota policies.
187+
- It does not ship an admin UI.
188+
- It does not hide RunningHub or provider-specific business rules from your host application.
189+
190+
## Recommended Architecture
191+
192+
```text
193+
Your app/admin UI
194+
-> your database and permission model
195+
-> your job queue or worker
196+
-> aigc-provider-runtime-kit
197+
-> provider APIs such as RunningHub or OpenAI-compatible services
198+
```
199+
200+
Keep secrets and user permissions in your application. Use this package to normalize provider definitions, request contracts, task execution metadata, result extraction, and key-pool coordination.
201+
202+
## Documentation
203+
204+
- [Getting Started](./docs/getting-started.md)
205+
- [API Reference](./docs/api-reference.md)
206+
- [Roadmap](./docs/roadmap.md)
207+
- [Provider System Notes](./docs/systems/providers/README.md)
208+
- [RunningHub System Notes](./docs/systems/runninghub/README.md)
209+
- [Project Harness Notes](./docs/systems/harness/README.md)
210+
- [Contributing](./CONTRIBUTING.md)
211+
- [Security Policy](./SECURITY.md)
212+
- [Changelog](./CHANGELOG.md)
61213

62214
## Repository Layout
63215

64216
```text
65217
packages/core/ Provider, model, schema, and request body primitives
66218
packages/runninghub/ RunningHub catalog, descriptor, client, and key-pool helpers
67219
packages/runtime/ Combined public exports
68-
docs/ Harness, governance, system docs, specs, and plans
69-
scripts/ Local verification contracts
70220
examples/ Minimal usage examples
71221
tests/ Node built-in test coverage for public behavior
222+
docs/ Harness, governance, system docs, specs, and plans
223+
scripts/ Local verification contracts
72224
.github/workflows/ GitHub CI verification
73225
```
74226

75-
## Harness
76-
77-
This repository uses a lightweight doc-log harness:
78-
79-
- `AGENTS.md` is the AI agent constitution.
80-
- `docs/INDEX.md` is the documentation router.
81-
- `docs/systems/` owns system contracts.
82-
- `docs/logbooks/` records audit evidence.
83-
- `scripts/verify-harness.mjs` checks required project anchors.
84-
85-
Run:
227+
## Local Development
86228

87229
```bash
230+
npm ci
88231
npm run harness:verify:project
89232
npm run type-check
233+
npm run build
90234
npm test
91235
```
92236

93-
## Local Development
237+
Use the full release gate before publishing or tagging:
94238

95239
```bash
96-
npm ci
97-
npm run harness:verify:project
98-
npm run type-check
99-
npm run build
100-
npm test
240+
npm run harness:verify:release
101241
```
102242

103-
## Public Project Docs
243+
## Harness
104244

105-
- `CONTRIBUTING.md` explains contribution flow and commit boundaries.
106-
- `SECURITY.md` defines vulnerability and secret-handling rules.
107-
- `CHANGELOG.md` records public release changes.
108-
- `docs/roadmap.md` tracks the foundation roadmap without promising hosted infrastructure.
245+
This repository uses a lightweight doc-log Harness so future maintainers and AI agents can understand and verify changes without guessing:
246+
247+
- `AGENTS.md` is the agent constitution.
248+
- `docs/INDEX.md` is the documentation router.
249+
- `docs/systems/` owns system contracts.
250+
- `docs/logbooks/` records audit evidence.
251+
- `scripts/verify-harness.mjs` checks required project anchors.
109252

110253
## Security
111254

112-
Never commit provider API keys, RunningHub keys, `.env` files, server credentials, or real customer configuration. This kit should contain reusable contracts and code only.
255+
Never commit provider API keys, RunningHub keys, `.env` files, private keys, server credentials, customer data, or real production configuration.
256+
257+
Host applications are responsible for:
258+
259+
- Secret storage.
260+
- Permission checks.
261+
- Provider quotas.
262+
- Audit logs.
263+
- Network egress controls.
264+
- Incident response.
265+
266+
See [SECURITY.md](./SECURITY.md) for details.
267+
268+
## Contributing
269+
270+
Contributions are welcome. Please keep changes small, typed, tested, and framework-neutral. If you change public exports or runtime behavior, update the API reference and relevant system docs.
271+
272+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full workflow.
273+
274+
## License
275+
276+
MIT. See [LICENSE](./LICENSE).

docs/logbooks/daily/2026/2026-07/2026-07-08.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,34 @@ Upgrade the repository from an internal extraction scaffold into a more complete
7070
## Next
7171

7272
Run verification, fix any failures, then commit and push the standalone project maturity update.
73+
74+
---
75+
76+
## Intent
77+
78+
Rewrite the public README for external GitHub users so the project reads like a normal open-source package instead of an internal extraction note.
79+
80+
## Changed
81+
82+
| Area | Files | Purpose |
83+
| --- | --- | --- |
84+
| Public project entry | `README.md` | Add open-source positioning, feature list, install paths, requirements, quick starts, architecture guidance, docs map, local development, harness, security, contributing, and license sections |
85+
86+
## Verification
87+
88+
| Check | Result | Notes |
89+
| --- | --- | --- |
90+
| `npm run harness:verify:project` | Passed | README still satisfies required public project anchors |
91+
92+
## Decisions
93+
94+
- Use English for the public README because the GitHub project is intended for broader external reuse.
95+
- Keep README focused on reusable runtime value and avoid claiming this package is a hosted backend or full admin system.
96+
97+
## Risks
98+
99+
- GitHub badge depends on the repository workflow path remaining `.github/workflows/ci.yml`.
100+
101+
## Next
102+
103+
Run harness verification, commit, and push the README improvement.

0 commit comments

Comments
 (0)