@omnicross/subscriptions 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sayo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,45 @@
1
+ @omnicross/subscriptions — THIRD-PARTY NOTICES
2
+ ==============================================
3
+
4
+ This package contains the subscription-as-provider block (auth strategies,
5
+ account service, provider registry, dispatcher, OpenCodeGo routing). Some routing
6
+ shapes and configuration-data values were adapted,
7
+ clean-room, from the following third-party works. Those repositories are NOT
8
+ vendored into this tree; only original TypeScript that mirrors their routing
9
+ shape / config-data values lives here (see the in-code provenance comments).
10
+
11
+ --------------------------------------------------------------------------------
12
+ 1. claude-relay-service (MIT License) — routing shape only
13
+ --------------------------------------------------------------------------------
14
+
15
+ The Codex (ChatGPT OAuth) upstream routing shape — the
16
+ `https://chatgpt.com/backend-api/codex/responses` endpoint dispatch in
17
+ `src/SubscriptionProviderRegistry.ts` — mirrors the route shape of
18
+ `claude-relay-service` (`src/routes/openaiRoutes.js`). Routing shape only; the
19
+ TypeScript is original, and the upstream repository is not vendored.
20
+
21
+ https://github.com/Wei-Shaw/claude-relay-service
22
+ Licensed under the MIT License.
23
+
24
+ --------------------------------------------------------------------------------
25
+ 2. oc-go-cc (OpenCodeGo CC) — model-map + routing-shape / config-data
26
+ --------------------------------------------------------------------------------
27
+
28
+ The OpenCodeGo routing-shape, scenario router, model-map defaults, endpoint
29
+ shapes, and Anthropic-shape `x-api-key` fallback in
30
+ `src/opencodego/{defaults,endpoints,model-shape,ScenarioRouter}.ts` and
31
+ `src/auth/StaticBearerAuthStrategy.ts` are clean-room ports of the model-map and
32
+ routing shape from `oc-go-cc` (`internal/router/model_router.go`,
33
+ `internal/client/opencode.go`, `configs/config.example.json`). Configuration
34
+ data + routing shape only; the TypeScript is original, and the upstream
35
+ repository is not vendored.
36
+
37
+ --------------------------------------------------------------------------------
38
+ 3. js-tiktoken (MIT License)
39
+ --------------------------------------------------------------------------------
40
+
41
+ `src/opencodego/token-count.ts` lazily imports `js-tiktoken` (cl100k_base
42
+ encoding) to estimate input-token counts for OpenCodeGo scenario routing.
43
+
44
+ https://github.com/dqbd/tiktoken
45
+ Licensed under the MIT License.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @omnicross/subscriptions
2
+
3
+ omnicross subscription-as-provider support — pass-through / OAuth-bearer / static-bearer auth strategies, the Claude / Codex / Gemini OAuth flows, and the OpenCodeGo scenario dispatcher + fallback chain.
4
+
5
+ Part of the [omnicross](https://github.com/Dumoedss/omnicross) monorepo — see the root README for the full overview.
6
+
7
+ ```bash
8
+ npm install @omnicross/subscriptions
9
+ ```
10
+
11
+ ## License
12
+
13
+ [MIT](LICENSE)
14
+
15
+ This package adapts third-party work under its own license — see the `NOTICE` file.