ai-world-sdk 1.5.11 → 1.5.12
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/dist/config.d.ts +3 -3
- package/dist/config.js +2 -2
- package/package.json +3 -2
- package/pacakges/ai-sdk-provider/.changeset/README.md +0 -34
- package/pacakges/ai-sdk-provider/.changeset/config.json +0 -13
- package/pacakges/ai-sdk-provider/.github/PULL_REQUEST_TEMPLATE.md +0 -16
- package/pacakges/ai-sdk-provider/.github/workflows/ci.yaml +0 -24
- package/pacakges/ai-sdk-provider/.github/workflows/publish-manual.yaml +0 -36
- package/pacakges/ai-sdk-provider/.github/workflows/publish.yaml +0 -107
- package/pacakges/ai-sdk-provider/.vscode/settings.json +0 -32
- package/pacakges/ai-sdk-provider/CHANGELOG.md +0 -631
- package/pacakges/ai-sdk-provider/CLAUDE.md +0 -79
- package/pacakges/ai-sdk-provider/CONTRIBUTING.md +0 -241
- package/pacakges/ai-sdk-provider/LICENSE +0 -201
- package/pacakges/ai-sdk-provider/README.md +0 -426
- package/pacakges/ai-sdk-provider/biome.json +0 -122
- package/pacakges/ai-sdk-provider/e2e/cache-control.test.ts +0 -74
- package/pacakges/ai-sdk-provider/e2e/embeddings/index.test.ts +0 -128
- package/pacakges/ai-sdk-provider/e2e/fixtures/pdfs/generate-pdfs.sh +0 -181
- package/pacakges/ai-sdk-provider/e2e/fixtures/pdfs/large.json +0 -7
- package/pacakges/ai-sdk-provider/e2e/fixtures/pdfs/large.pdf +41 -12894
- package/pacakges/ai-sdk-provider/e2e/gemini/reasoning-multiturn.test.ts +0 -221
- package/pacakges/ai-sdk-provider/e2e/issues/issue-160-toolcallid-uniqueness.test.ts +0 -88
- package/pacakges/ai-sdk-provider/e2e/issues/issue-166-finish-reason-null.test.ts +0 -129
- package/pacakges/ai-sdk-provider/e2e/issues/issue-171-cache-tool-key-ordering.test.ts +0 -70
- package/pacakges/ai-sdk-provider/e2e/issues/issue-181-tool-response-image.test.ts +0 -199
- package/pacakges/ai-sdk-provider/e2e/issues/issue-190-streamobject-flush-error.test.ts +0 -114
- package/pacakges/ai-sdk-provider/e2e/issues/issue-194-grok-invalid-json.test.ts +0 -93
- package/pacakges/ai-sdk-provider/e2e/issues/issue-196-anthropic-1h-cache-ttl.test.ts +0 -85
- package/pacakges/ai-sdk-provider/e2e/issues/issue-199-openai-pdf-processing.test.ts +0 -102
- package/pacakges/ai-sdk-provider/e2e/issues/issue-212-anthropic-web-search-online.test.ts +0 -128
- package/pacakges/ai-sdk-provider/e2e/issues/issue-234-prompt-caching.test.ts +0 -201
- package/pacakges/ai-sdk-provider/e2e/issues/issue-237-reasoning-linebreaks.test.ts +0 -103
- package/pacakges/ai-sdk-provider/e2e/issues/issue-248-gemini-web-search-empty-response.test.ts +0 -210
- package/pacakges/ai-sdk-provider/e2e/issues/issue-269-image-size-parameter.test.ts +0 -208
- package/pacakges/ai-sdk-provider/e2e/issues/issue-287-tool-calls-missing-arguments.test.ts +0 -87
- package/pacakges/ai-sdk-provider/e2e/issues/issue-341-cache-control-last-text-part.test.ts +0 -138
- package/pacakges/ai-sdk-provider/e2e/issues/issue-383-video-url-support.test.ts +0 -120
- package/pacakges/ai-sdk-provider/e2e/issues/issue-386-image-files-parameter.test.ts +0 -109
- package/pacakges/ai-sdk-provider/e2e/issues/issue-387-temperature-settings.test.ts +0 -113
- package/pacakges/ai-sdk-provider/e2e/issues/issue-389-system-cache-control.test.ts +0 -107
- package/pacakges/ai-sdk-provider/e2e/issues/issue-391-reasoning-effort-values.test.ts +0 -121
- package/pacakges/ai-sdk-provider/e2e/issues/issue-392-auto-router-plugin.test.ts +0 -84
- package/pacakges/ai-sdk-provider/e2e/issues/issue-394-reasoning-end-signature.test.ts +0 -157
- package/pacakges/ai-sdk-provider/e2e/issues/issue-407-token-usage-details.test.ts +0 -141
- package/pacakges/ai-sdk-provider/e2e/issues/issue-411-output-object-tools-conflict.test.ts +0 -75
- package/pacakges/ai-sdk-provider/e2e/issues/issue-412-mid-stream-termination.test.ts +0 -217
- package/pacakges/ai-sdk-provider/e2e/issues/issue-413-reasoning-metadata-bloat.test.ts +0 -292
- package/pacakges/ai-sdk-provider/e2e/issues/issue-413-tool-input-end-streaming.test.ts +0 -167
- package/pacakges/ai-sdk-provider/e2e/issues/issue-418-gemini-thought-signature.test.ts +0 -171
- package/pacakges/ai-sdk-provider/e2e/issues/issue-419-420-finish-reason-usage-fallback.test.ts +0 -87
- package/pacakges/ai-sdk-provider/e2e/issues/issue-419-usage-fallback.test.ts +0 -106
- package/pacakges/ai-sdk-provider/e2e/issues/issue-422-incomplete-error-information.test.ts +0 -46
- package/pacakges/ai-sdk-provider/e2e/issues/issue-423-signature-stripped.test.ts +0 -165
- package/pacakges/ai-sdk-provider/e2e/issues/issue-423-streaming-signature-loss.test.ts +0 -161
- package/pacakges/ai-sdk-provider/e2e/issues/issue-423-uimessage-roundtrip.test.ts +0 -111
- package/pacakges/ai-sdk-provider/e2e/issues/issue-424-anthropic-auto-cache.test.ts +0 -66
- package/pacakges/ai-sdk-provider/e2e/issues/issue-432-raw-response-body.test.ts +0 -52
- package/pacakges/ai-sdk-provider/e2e/issues/issue-438-gemini-reasoning-redacted.test.ts +0 -120
- package/pacakges/ai-sdk-provider/e2e/issues/issue-439-exact-payload.test.ts +0 -108
- package/pacakges/ai-sdk-provider/e2e/issues/issue-443-eager-input-streaming.test.ts +0 -204
- package/pacakges/ai-sdk-provider/e2e/issues/issue-453-signature-reopen.test.ts +0 -203
- package/pacakges/ai-sdk-provider/e2e/issues/issue-474-web-search-server-tool.test.ts +0 -102
- package/pacakges/ai-sdk-provider/e2e/issues/issue-483-response-format-strict-option.test.ts +0 -199
- package/pacakges/ai-sdk-provider/e2e/issues/issue-484-image-url-query-params.test.ts +0 -165
- package/pacakges/ai-sdk-provider/e2e/issues/issue-63-web-search-annotations.test.ts +0 -159
- package/pacakges/ai-sdk-provider/e2e/parallel-tool-calls.test.ts +0 -425
- package/pacakges/ai-sdk-provider/e2e/pdf-blob/index.test.ts +0 -139
- package/pacakges/ai-sdk-provider/e2e/pdf-url/index.test.ts +0 -60
- package/pacakges/ai-sdk-provider/e2e/reasoning-effort.test.ts +0 -139
- package/pacakges/ai-sdk-provider/e2e/reasoning-multiturn/index.test.ts +0 -69
- package/pacakges/ai-sdk-provider/e2e/tools-with-reasoning.test.ts +0 -76
- package/pacakges/ai-sdk-provider/e2e/tools.ts +0 -61
- package/pacakges/ai-sdk-provider/e2e/usage-accounting.test.ts +0 -55
- package/pacakges/ai-sdk-provider/e2e/utils.ts +0 -15
- package/pacakges/ai-sdk-provider/e2e/video-generation.test.ts +0 -43
- package/pacakges/ai-sdk-provider/e2e/web-search/index.test.ts +0 -50
- package/pacakges/ai-sdk-provider/example.env.e2e +0 -3
- package/pacakges/ai-sdk-provider/pnpm-lock.yaml +0 -3075
- package/pacakges/ai-sdk-provider/pnpm-workspace.yaml +0 -6
- package/pacakges/ai-sdk-provider/src/chat/convert-to-openrouter-chat-messages.test.ts +0 -3079
- package/pacakges/ai-sdk-provider/src/chat/convert-to-openrouter-chat-messages.ts +0 -618
- package/pacakges/ai-sdk-provider/src/chat/errors.test.ts +0 -97
- package/pacakges/ai-sdk-provider/src/chat/file-parser-schema.test.ts +0 -112
- package/pacakges/ai-sdk-provider/src/chat/file-url-utils.ts +0 -167
- package/pacakges/ai-sdk-provider/src/chat/get-tool-choice.ts +0 -42
- package/pacakges/ai-sdk-provider/src/chat/index.test.ts +0 -6093
- package/pacakges/ai-sdk-provider/src/chat/index.ts +0 -1300
- package/pacakges/ai-sdk-provider/src/chat/is-url.ts +0 -15
- package/pacakges/ai-sdk-provider/src/chat/large-pdf-response.test.ts +0 -108
- package/pacakges/ai-sdk-provider/src/chat/payload-comparison.test.ts +0 -154
- package/pacakges/ai-sdk-provider/src/chat/schemas.ts +0 -288
- package/pacakges/ai-sdk-provider/src/chat/signature-roundtrip.test.ts +0 -777
- package/pacakges/ai-sdk-provider/src/completion/convert-to-openrouter-completion-prompt.ts +0 -150
- package/pacakges/ai-sdk-provider/src/completion/index.test.ts +0 -958
- package/pacakges/ai-sdk-provider/src/completion/index.ts +0 -441
- package/pacakges/ai-sdk-provider/src/completion/schemas.ts +0 -67
- package/pacakges/ai-sdk-provider/src/embedding/index.test.ts +0 -262
- package/pacakges/ai-sdk-provider/src/embedding/index.ts +0 -113
- package/pacakges/ai-sdk-provider/src/embedding/schemas.ts +0 -26
- package/pacakges/ai-sdk-provider/src/facade.ts +0 -131
- package/pacakges/ai-sdk-provider/src/image/index.test.ts +0 -769
- package/pacakges/ai-sdk-provider/src/image/index.ts +0 -206
- package/pacakges/ai-sdk-provider/src/image/schemas.ts +0 -48
- package/pacakges/ai-sdk-provider/src/index.ts +0 -3
- package/pacakges/ai-sdk-provider/src/internal/index.ts +0 -10
- package/pacakges/ai-sdk-provider/src/provider.ts +0 -327
- package/pacakges/ai-sdk-provider/src/schemas/error-response.test.ts +0 -171
- package/pacakges/ai-sdk-provider/src/schemas/error-response.ts +0 -105
- package/pacakges/ai-sdk-provider/src/schemas/format.ts +0 -12
- package/pacakges/ai-sdk-provider/src/schemas/image.ts +0 -23
- package/pacakges/ai-sdk-provider/src/schemas/provider-metadata.ts +0 -91
- package/pacakges/ai-sdk-provider/src/schemas/reasoning-details.ts +0 -92
- package/pacakges/ai-sdk-provider/src/tests/provider-options.test.ts +0 -234
- package/pacakges/ai-sdk-provider/src/tests/stream-usage-accounting.test.ts +0 -409
- package/pacakges/ai-sdk-provider/src/tests/usage-accounting.test.ts +0 -555
- package/pacakges/ai-sdk-provider/src/tests/web-search-tool.test.ts +0 -319
- package/pacakges/ai-sdk-provider/src/tool/web-search.ts +0 -52
- package/pacakges/ai-sdk-provider/src/types/index.ts +0 -114
- package/pacakges/ai-sdk-provider/src/types/openrouter-api-types.ts +0 -83
- package/pacakges/ai-sdk-provider/src/types/openrouter-chat-completions-input.ts +0 -116
- package/pacakges/ai-sdk-provider/src/types/openrouter-chat-settings.ts +0 -233
- package/pacakges/ai-sdk-provider/src/types/openrouter-completion-settings.ts +0 -39
- package/pacakges/ai-sdk-provider/src/types/openrouter-embedding-settings.ts +0 -56
- package/pacakges/ai-sdk-provider/src/types/openrouter-image-settings.ts +0 -49
- package/pacakges/ai-sdk-provider/src/types/openrouter-video-settings.ts +0 -26
- package/pacakges/ai-sdk-provider/src/utils/compute-token-usage.test.ts +0 -186
- package/pacakges/ai-sdk-provider/src/utils/compute-token-usage.ts +0 -55
- package/pacakges/ai-sdk-provider/src/utils/deterministic-stringify.test.ts +0 -87
- package/pacakges/ai-sdk-provider/src/utils/deterministic-stringify.ts +0 -35
- package/pacakges/ai-sdk-provider/src/utils/map-finish-reason.ts +0 -43
- package/pacakges/ai-sdk-provider/src/utils/reasoning-details-duplicate-tracker.test.ts +0 -324
- package/pacakges/ai-sdk-provider/src/utils/reasoning-details-duplicate-tracker.ts +0 -70
- package/pacakges/ai-sdk-provider/src/utils/remove-undefined.ts +0 -12
- package/pacakges/ai-sdk-provider/src/utils/type-guards.ts +0 -6
- package/pacakges/ai-sdk-provider/src/utils/with-stream-error-handling.test.ts +0 -119
- package/pacakges/ai-sdk-provider/src/utils/with-stream-error-handling.ts +0 -25
- package/pacakges/ai-sdk-provider/src/utils/with-user-agent-suffix.test.ts +0 -133
- package/pacakges/ai-sdk-provider/src/utils/with-user-agent-suffix.ts +0 -78
- package/pacakges/ai-sdk-provider/src/version.ts +0 -4
- package/pacakges/ai-sdk-provider/src/video/index.test.ts +0 -515
- package/pacakges/ai-sdk-provider/src/video/index.ts +0 -275
- package/pacakges/ai-sdk-provider/src/video/schemas.ts +0 -36
- package/pacakges/ai-sdk-provider/tsconfig.json +0 -42
- package/pacakges/ai-sdk-provider/tsup.config.ts +0 -28
- package/pacakges/ai-sdk-provider/turbo.json +0 -8
- package/pacakges/ai-sdk-provider/vitest.e2e.config.ts +0 -21
- package/pacakges/ai-sdk-provider/vitest.edge.config.ts +0 -16
- package/pacakges/ai-sdk-provider/vitest.issues.config.ts +0 -28
- package/pacakges/ai-sdk-provider/vitest.node.config.ts +0 -16
package/dist/config.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* 注意: {VERSION} 占位符会在构建时被替换为实际版本号
|
|
11
11
|
*/
|
|
12
|
-
export declare const SDK_SIGNATURE = "AI_WORLD_SDK_V:1.5.
|
|
12
|
+
export declare const SDK_SIGNATURE = "AI_WORLD_SDK_V:1.5.12";
|
|
13
13
|
/**
|
|
14
14
|
* 版本兼容性错误
|
|
15
15
|
*/
|
|
@@ -35,8 +35,8 @@ declare class SDKConfig {
|
|
|
35
35
|
private _authCheckPromise;
|
|
36
36
|
private _currentUser;
|
|
37
37
|
private _cliMode;
|
|
38
|
-
readonly sdkSignature = "AI_WORLD_SDK_V:1.5.
|
|
39
|
-
readonly sdkVersion = "1.5.
|
|
38
|
+
readonly sdkSignature = "AI_WORLD_SDK_V:1.5.12";
|
|
39
|
+
readonly sdkVersion = "1.5.12";
|
|
40
40
|
constructor();
|
|
41
41
|
/**
|
|
42
42
|
* Set global base URL
|
package/dist/config.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.sdkConfig = exports.VersionCompatibilityError = exports.SDK_SIGNATURE = void 0;
|
|
8
8
|
// SDK 版本号(构建时自动从 package.json 更新)
|
|
9
9
|
// 此版本号会在运行 npm run build 时自动从 package.json 读取并更新
|
|
10
|
-
const SDK_VERSION = "1.5.
|
|
10
|
+
const SDK_VERSION = "1.5.12";
|
|
11
11
|
/**
|
|
12
12
|
* SDK 特征码 - 用于在构建后的 JS 文件中识别 SDK 版本
|
|
13
13
|
* 格式: AI_WORLD_SDK_V:版本号
|
|
@@ -15,7 +15,7 @@ const SDK_VERSION = "1.5.11";
|
|
|
15
15
|
*
|
|
16
16
|
* 注意: {VERSION} 占位符会在构建时被替换为实际版本号
|
|
17
17
|
*/
|
|
18
|
-
exports.SDK_SIGNATURE = "AI_WORLD_SDK_V:1.5.
|
|
18
|
+
exports.SDK_SIGNATURE = "AI_WORLD_SDK_V:1.5.12";
|
|
19
19
|
/**
|
|
20
20
|
* 版本兼容性错误
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-world-sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.12",
|
|
4
4
|
"description": "TypeScript SDK for AI World Platform - Chat Models, Image Generation, and Video Generation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
"files": [
|
|
77
77
|
"dist",
|
|
78
78
|
"skills",
|
|
79
|
-
"pacakges"
|
|
79
|
+
"pacakges/ai-sdk-provider/dist",
|
|
80
|
+
"pacakges/ai-sdk-provider/package.json"
|
|
80
81
|
],
|
|
81
82
|
"dependencies": {
|
|
82
83
|
"@ai-sdk/anthropic": "^3.0.78",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Changesets
|
|
2
|
-
|
|
3
|
-
Hello! This folder contains [Changesets](https://github.com/changesets/changesets), which help manage releases and changelogs.
|
|
4
|
-
|
|
5
|
-
## Adding a changeset
|
|
6
|
-
|
|
7
|
-
To create a new changeset, run:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pnpm changeset
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
This will prompt you for:
|
|
14
|
-
|
|
15
|
-
1. Which type of change (patch/minor/major)
|
|
16
|
-
2. A summary of the changes
|
|
17
|
-
|
|
18
|
-
The tool will create a markdown file in `.changeset/` with your changes.
|
|
19
|
-
|
|
20
|
-
## How releases work
|
|
21
|
-
|
|
22
|
-
When changes are merged to `main`:
|
|
23
|
-
|
|
24
|
-
1. The Release workflow creates/updates a "Version Packages" PR
|
|
25
|
-
2. This PR will bump versions and update CHANGELOGs based on all changesets
|
|
26
|
-
3. When you merge the "Version Packages" PR, packages are automatically published to npm
|
|
27
|
-
|
|
28
|
-
## Empty changesets
|
|
29
|
-
|
|
30
|
-
If your changes don't need a release (docs, tests, CI config):
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
pnpm changeset --empty
|
|
34
|
-
```
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://unpkg.com/@changesets/config@1.6.4/schema.json",
|
|
3
|
-
"changelog": [
|
|
4
|
-
"@changesets/changelog-github",
|
|
5
|
-
{ "repo": "OpenRouterTeam/ai-sdk-provider" }
|
|
6
|
-
],
|
|
7
|
-
"commit": false,
|
|
8
|
-
"linked": [],
|
|
9
|
-
"access": "public",
|
|
10
|
-
"baseBranch": "main",
|
|
11
|
-
"updateInternalDependencies": "patch",
|
|
12
|
-
"ignore": []
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
## Description
|
|
2
|
-
|
|
3
|
-
<!-- Briefly describe your changes -->
|
|
4
|
-
|
|
5
|
-
## Checklist
|
|
6
|
-
|
|
7
|
-
- [ ] I have run `pnpm stylecheck` and `pnpm typecheck`
|
|
8
|
-
- [ ] I have run `pnpm test` and all tests pass
|
|
9
|
-
- [ ] I have added tests for my changes (if applicable)
|
|
10
|
-
- [ ] I have updated documentation (if applicable)
|
|
11
|
-
|
|
12
|
-
### Changeset
|
|
13
|
-
|
|
14
|
-
- [ ] I have run `pnpm changeset` to create a changeset file
|
|
15
|
-
|
|
16
|
-
> **Note:** A changeset is required for your changes to trigger a release. If your PR only contains docs, tests, or CI changes that don't need a release, run `pnpm changeset --empty` instead.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
push:
|
|
6
|
-
branches: [main]
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
ci:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
permissions:
|
|
12
|
-
contents: read
|
|
13
|
-
packages: write
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
- uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: "20.x"
|
|
19
|
-
- uses: pnpm/action-setup@v4
|
|
20
|
-
- run: pnpm install
|
|
21
|
-
- run: pnpm test
|
|
22
|
-
- run: pnpm build
|
|
23
|
-
- run: pnpm typecheck
|
|
24
|
-
- run: pnpm stylecheck
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# DEPRECATED: This workflow is kept for emergency manual releases only.
|
|
2
|
-
# Normal releases should use the changeset-based publish.yaml workflow.
|
|
3
|
-
# To use this, manually create a GitHub Release.
|
|
4
|
-
name: Publish package (legacy)
|
|
5
|
-
on:
|
|
6
|
-
release:
|
|
7
|
-
types: [published]
|
|
8
|
-
workflow_dispatch: {}
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
permissions:
|
|
13
|
-
contents: read
|
|
14
|
-
packages: write
|
|
15
|
-
id-token: write
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: "20.x"
|
|
21
|
-
registry-url: "https://registry.npmjs.org"
|
|
22
|
-
scope: "@openrouter"
|
|
23
|
-
- uses: pnpm/action-setup@v4
|
|
24
|
-
- run: pnpm install --frozen-lockfile
|
|
25
|
-
- run: pnpm typecheck
|
|
26
|
-
- run: pnpm build
|
|
27
|
-
- run: pnpm test
|
|
28
|
-
- name: Publish to npm
|
|
29
|
-
run: |
|
|
30
|
-
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
|
|
31
|
-
pnpm publish --provenance --access public --no-git-checks --tag beta
|
|
32
|
-
else
|
|
33
|
-
pnpm publish --provenance --access public --no-git-checks
|
|
34
|
-
fi
|
|
35
|
-
env:
|
|
36
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
|
|
6
|
-
concurrency:
|
|
7
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
|
8
|
-
|
|
9
|
-
permissions: {}
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
release:
|
|
13
|
-
if: github.repository_owner == 'OpenRouterTeam'
|
|
14
|
-
name: Release
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
timeout-minutes: 30
|
|
17
|
-
permissions:
|
|
18
|
-
contents: write
|
|
19
|
-
id-token: write
|
|
20
|
-
pull-requests: write
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v4
|
|
23
|
-
- uses: pnpm/action-setup@v4
|
|
24
|
-
- uses: actions/setup-node@v4
|
|
25
|
-
with:
|
|
26
|
-
node-version: "20.x"
|
|
27
|
-
registry-url: "https://registry.npmjs.org"
|
|
28
|
-
scope: "@openrouter"
|
|
29
|
-
cache: pnpm
|
|
30
|
-
- name: Install dependencies
|
|
31
|
-
run: pnpm install --frozen-lockfile
|
|
32
|
-
- name: Upgrade npm for OIDC support
|
|
33
|
-
run: npm install -g npm@latest
|
|
34
|
-
- name: Create Release Pull Request or Publish
|
|
35
|
-
id: changesets
|
|
36
|
-
uses: changesets/action@v1
|
|
37
|
-
with:
|
|
38
|
-
version: pnpm changeset-version
|
|
39
|
-
env:
|
|
40
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
-
|
|
42
|
-
- name: OIDC preflight - scrub .npmrc and verify registry
|
|
43
|
-
run: |
|
|
44
|
-
echo "=== OIDC Preflight ==="
|
|
45
|
-
|
|
46
|
-
# Remove auth tokens from all potential .npmrc locations to ensure OIDC is used
|
|
47
|
-
for npmrc in "$NPM_CONFIG_USERCONFIG" ~/.npmrc .npmrc; do
|
|
48
|
-
if [ -n "$npmrc" ] && [ -f "$npmrc" ]; then
|
|
49
|
-
echo "Cleaning $npmrc of any existing auth tokens..."
|
|
50
|
-
# Remove registry-scoped tokens (allow optional whitespace around =)
|
|
51
|
-
sed -i -E '/\/\/registry\.npmjs\.org\/:(_authToken|_auth)\s*=/d' "$npmrc"
|
|
52
|
-
# Remove global tokens in any form
|
|
53
|
-
sed -i -E '/^\s*(_authToken|_auth)\s*=/d' "$npmrc"
|
|
54
|
-
# Remove global always-auth (case-insensitive, allow spacing)
|
|
55
|
-
sed -i -E '/^\s*[Aa]lways-[Aa]uth\s*=/d' "$npmrc"
|
|
56
|
-
fi
|
|
57
|
-
done
|
|
58
|
-
|
|
59
|
-
# Verify npm connectivity
|
|
60
|
-
echo "Testing npm registry connectivity..."
|
|
61
|
-
npm ping || exit 1
|
|
62
|
-
|
|
63
|
-
# Verify no token is active (should fail for OIDC to work)
|
|
64
|
-
echo "Verifying no auth token is configured..."
|
|
65
|
-
if npm whoami >/dev/null 2>&1; then
|
|
66
|
-
echo "⚠ Warning: npm whoami succeeded without OIDC token"
|
|
67
|
-
else
|
|
68
|
-
echo "✓ Confirmed: npm whoami failed (OIDC will be used)"
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
echo ""
|
|
72
|
-
echo "Registry configuration:"
|
|
73
|
-
npm config get registry
|
|
74
|
-
npm config get @openrouter:registry || echo " (no @openrouter scope override)"
|
|
75
|
-
|
|
76
|
-
- name: Publish with OIDC
|
|
77
|
-
if: steps.changesets.outputs.hasChangesets == 'false'
|
|
78
|
-
run: pnpm changeset-publish
|
|
79
|
-
env:
|
|
80
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
81
|
-
|
|
82
|
-
- name: Post-mortem diagnostics
|
|
83
|
-
if: failure()
|
|
84
|
-
run: |
|
|
85
|
-
echo "=== Post-mortem Diagnostics ==="
|
|
86
|
-
echo "Versions:"
|
|
87
|
-
echo " Node: $(node --version)"
|
|
88
|
-
echo " npm: $(npm --version)"
|
|
89
|
-
echo " pnpm: $(pnpm --version)"
|
|
90
|
-
echo ""
|
|
91
|
-
echo "Registry configuration:"
|
|
92
|
-
echo " registry: $(npm config get registry)"
|
|
93
|
-
echo " @openrouter scope: $(npm config get @openrouter:registry || echo '(inherited from global)')"
|
|
94
|
-
echo ""
|
|
95
|
-
echo ".npmrc files status:"
|
|
96
|
-
for npmrc in "$NPM_CONFIG_USERCONFIG" ~/.npmrc .npmrc; do
|
|
97
|
-
if [ -n "$npmrc" ] && [ -f "$npmrc" ]; then
|
|
98
|
-
echo " $npmrc:"
|
|
99
|
-
echo " Lines: $(wc -l < "$npmrc")"
|
|
100
|
-
echo " Auth lines: $(grep -c "_auth\|_token" "$npmrc" || echo "0")"
|
|
101
|
-
echo " Content (redacted):"
|
|
102
|
-
sed 's/\(_auth[^=]*=\).*/\1***REDACTED***/g; s/\(_token[^=]*=\).*/\1***REDACTED***/g' "$npmrc" | sed 's/^/ /'
|
|
103
|
-
fi
|
|
104
|
-
done
|
|
105
|
-
echo ""
|
|
106
|
-
echo "Package availability:"
|
|
107
|
-
npm view @openrouter/ai-sdk-provider@latest version 2>&1 || echo " (could not fetch)"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files.exclude": {
|
|
3
|
-
"**/.git": true,
|
|
4
|
-
"**/.svn": true,
|
|
5
|
-
"**/.hg": true,
|
|
6
|
-
"**/CVS": true,
|
|
7
|
-
"**/.DS_Store": true,
|
|
8
|
-
"**/Thumbs.db": true,
|
|
9
|
-
"**/node_modules": true,
|
|
10
|
-
"**/.turbo": true,
|
|
11
|
-
"**/.expo": true,
|
|
12
|
-
"**/expo-env.d.ts": true,
|
|
13
|
-
"**/.next": true,
|
|
14
|
-
"**/next-env.d.ts": true,
|
|
15
|
-
"**/.swc": true,
|
|
16
|
-
"**/*.log": true
|
|
17
|
-
},
|
|
18
|
-
"workbench.colorCustomizations": {
|
|
19
|
-
"titleBar.activeForeground": "#eee",
|
|
20
|
-
"titleBar.activeBackground": "#f4f" // Change this color!
|
|
21
|
-
},
|
|
22
|
-
"editor.formatOnSave": true,
|
|
23
|
-
"files.insertFinalNewline": true,
|
|
24
|
-
"editor.defaultFormatter": "biomejs.biome",
|
|
25
|
-
"editor.codeActionsOnSave": {
|
|
26
|
-
"source.organizeImports.biome": "explicit",
|
|
27
|
-
"source.fixAll.biome": "explicit"
|
|
28
|
-
},
|
|
29
|
-
"[typescript]": {
|
|
30
|
-
"editor.defaultFormatter": "biomejs.biome"
|
|
31
|
-
}
|
|
32
|
-
}
|