mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-10-26 11:37:06 +00:00
feat(core): handle AI subscription for pro models (#13682)
Some checks are pending
Build & Test / Analyze (javascript, affine) (push) Waiting to run
Build & Test / Analyze (javascript, blocksuite) (push) Waiting to run
Build & Test / Analyze (typescript, affine) (push) Waiting to run
Build & Test / Analyze (typescript, blocksuite) (push) Waiting to run
Build & Test / Lint (push) Waiting to run
Build & Test / Typecheck (push) Waiting to run
Build & Test / Lint Rust (push) Waiting to run
Build & Test / Check Git Status (push) Blocked by required conditions
Build & Test / Check yarn binary (push) Waiting to run
Build & Test / E2E BlockSuite Test (1) (push) Waiting to run
Build & Test / E2E BlockSuite Test (10) (push) Waiting to run
Build & Test / E2E BlockSuite Test (2) (push) Waiting to run
Build & Test / E2E BlockSuite Test (3) (push) Waiting to run
Build & Test / E2E BlockSuite Test (4) (push) Waiting to run
Build & Test / E2E BlockSuite Test (5) (push) Waiting to run
Build & Test / E2E BlockSuite Test (6) (push) Waiting to run
Build & Test / E2E BlockSuite Test (7) (push) Waiting to run
Build & Test / E2E BlockSuite Test (8) (push) Waiting to run
Build & Test / E2E BlockSuite Test (9) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (chromium, 1) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (chromium, 2) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (firefox, 1) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (firefox, 2) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (webkit, 1) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (webkit, 2) (push) Waiting to run
Build & Test / E2E Test (1) (push) Waiting to run
Build & Test / E2E Test (10) (push) Waiting to run
Build & Test / E2E Test (2) (push) Waiting to run
Build & Test / E2E Test (3) (push) Waiting to run
Build & Test / E2E Test (4) (push) Waiting to run
Build & Test / E2E Test (5) (push) Waiting to run
Build & Test / E2E Test (6) (push) Waiting to run
Build & Test / E2E Test (7) (push) Waiting to run
Build & Test / E2E Test (8) (push) Waiting to run
Build & Test / E2E Test (9) (push) Waiting to run
Build & Test / E2E Mobile Test (1) (push) Waiting to run
Build & Test / E2E Mobile Test (2) (push) Waiting to run
Build & Test / E2E Mobile Test (3) (push) Waiting to run
Build & Test / E2E Mobile Test (4) (push) Waiting to run
Build & Test / E2E Mobile Test (5) (push) Waiting to run
Build & Test / Unit Test (1) (push) Blocked by required conditions
Build & Test / Unit Test (2) (push) Blocked by required conditions
Build & Test / Unit Test (3) (push) Blocked by required conditions
Build & Test / Unit Test (4) (push) Blocked by required conditions
Build & Test / Unit Test (5) (push) Blocked by required conditions
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:macos-latest target:aarch64-apple-darwin]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:macos-latest target:x86_64-apple-darwin]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:ubuntu-latest target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:windows-latest target:aarch64-pc-windows-msvc]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:windows-latest target:x86_64-pc-windows-msvc]) (push) Waiting to run
Build & Test / Build Server native (push) Waiting to run
Build & Test / Build @affine/electron renderer (push) Waiting to run
Build & Test / Native Unit Test (push) Blocked by required conditions
Build & Test / Server Test (0, 8) (push) Blocked by required conditions
Build & Test / Server Test (1, 8) (push) Blocked by required conditions
Build & Test / Server Test (2, 8) (push) Blocked by required conditions
Build & Test / Server Test (3, 8) (push) Blocked by required conditions
Build & Test / Server Test (4, 8) (push) Blocked by required conditions
Build & Test / Server Test (5, 8) (push) Blocked by required conditions
Build & Test / Server Test (6, 8) (push) Blocked by required conditions
Build & Test / Server Test (7, 8) (push) Blocked by required conditions
Build & Test / Server Test with Elasticsearch (push) Blocked by required conditions
Build & Test / Server E2E Test (push) Blocked by required conditions
Build & Test / miri code check (push) Waiting to run
Build & Test / loom thread test (push) Waiting to run
Build & Test / fuzzing (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:macos-13 target:x86_64-apple-darwin]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:macos-latest target:aarch64-apple-darwin]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:ubuntu-24.04-arm target:aarch64-unknown-linux-gnu]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:ubuntu-latest target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:windows-11-arm target:aarch64-pc-windows-msvc]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:windows-latest target:x86_64-pc-windows-msvc]) (push) Waiting to run
Build & Test / Run native tests (push) Waiting to run
Build & Test / Server Copilot Api Test (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (1, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (10, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (2, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (3, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (4, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (5, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (6, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (7, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (8, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (9, 10) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud Desktop E2E Test script:yarn affine @affine/electron build:dev
# Workaround for Electron apps failing to initialize on Ubuntu 24.04 due to AppArmor restrictions
# Disables unprivileged user namespaces restrictio… (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 1/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=1/10 shard:1]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 10/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=10/10 shard:10]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 2/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=2/10 shard:2]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 3/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=3/10 shard:3]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 4/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=4/10 shard:4]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 5/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=5/10 shard:5]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 6/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=6/10 shard:6]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 7/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=7/10 shard:7]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 8/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=8/10 shard:8]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 9/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=9/10 shard:9]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:arm64 os:macos-latest platform:macos target:aarch64-apple-darwin test:true]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:macos-latest platform:macos target:x86_64-apple-darwin test:false]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:ubuntu-latest platform:linux target:x86_64-unknown-linux-gnu test:true]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:windows-latest platform:windows target:x86_64-pc-windows-msvc test:true]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:arm64 os:macos-latest platform:macos target:aarch64-apple-darwin test:true]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:macos-latest platform:macos target:x86_64-apple-darwin test:false]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:ubuntu-latest platform:linux target:x86_64-unknown-linux-gnu test:true]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:windows-latest platform:windows target:x86_64-pc-windows-msvc test:true]) (push) Blocked by required conditions
Build & Test / 3, 2, 1 Launch (push) Blocked by required conditions
Some checks are pending
Build & Test / Analyze (javascript, affine) (push) Waiting to run
Build & Test / Analyze (javascript, blocksuite) (push) Waiting to run
Build & Test / Analyze (typescript, affine) (push) Waiting to run
Build & Test / Analyze (typescript, blocksuite) (push) Waiting to run
Build & Test / Lint (push) Waiting to run
Build & Test / Typecheck (push) Waiting to run
Build & Test / Lint Rust (push) Waiting to run
Build & Test / Check Git Status (push) Blocked by required conditions
Build & Test / Check yarn binary (push) Waiting to run
Build & Test / E2E BlockSuite Test (1) (push) Waiting to run
Build & Test / E2E BlockSuite Test (10) (push) Waiting to run
Build & Test / E2E BlockSuite Test (2) (push) Waiting to run
Build & Test / E2E BlockSuite Test (3) (push) Waiting to run
Build & Test / E2E BlockSuite Test (4) (push) Waiting to run
Build & Test / E2E BlockSuite Test (5) (push) Waiting to run
Build & Test / E2E BlockSuite Test (6) (push) Waiting to run
Build & Test / E2E BlockSuite Test (7) (push) Waiting to run
Build & Test / E2E BlockSuite Test (8) (push) Waiting to run
Build & Test / E2E BlockSuite Test (9) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (chromium, 1) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (chromium, 2) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (firefox, 1) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (firefox, 2) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (webkit, 1) (push) Waiting to run
Build & Test / E2E BlockSuite Cross Browser Test (webkit, 2) (push) Waiting to run
Build & Test / E2E Test (1) (push) Waiting to run
Build & Test / E2E Test (10) (push) Waiting to run
Build & Test / E2E Test (2) (push) Waiting to run
Build & Test / E2E Test (3) (push) Waiting to run
Build & Test / E2E Test (4) (push) Waiting to run
Build & Test / E2E Test (5) (push) Waiting to run
Build & Test / E2E Test (6) (push) Waiting to run
Build & Test / E2E Test (7) (push) Waiting to run
Build & Test / E2E Test (8) (push) Waiting to run
Build & Test / E2E Test (9) (push) Waiting to run
Build & Test / E2E Mobile Test (1) (push) Waiting to run
Build & Test / E2E Mobile Test (2) (push) Waiting to run
Build & Test / E2E Mobile Test (3) (push) Waiting to run
Build & Test / E2E Mobile Test (4) (push) Waiting to run
Build & Test / E2E Mobile Test (5) (push) Waiting to run
Build & Test / Unit Test (1) (push) Blocked by required conditions
Build & Test / Unit Test (2) (push) Blocked by required conditions
Build & Test / Unit Test (3) (push) Blocked by required conditions
Build & Test / Unit Test (4) (push) Blocked by required conditions
Build & Test / Unit Test (5) (push) Blocked by required conditions
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:macos-latest target:aarch64-apple-darwin]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:macos-latest target:x86_64-apple-darwin]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:ubuntu-latest target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:windows-latest target:aarch64-pc-windows-msvc]) (push) Waiting to run
Build & Test / Build AFFiNE native (${{ matrix.spec.target }}) (map[os:windows-latest target:x86_64-pc-windows-msvc]) (push) Waiting to run
Build & Test / Build Server native (push) Waiting to run
Build & Test / Build @affine/electron renderer (push) Waiting to run
Build & Test / Native Unit Test (push) Blocked by required conditions
Build & Test / Server Test (0, 8) (push) Blocked by required conditions
Build & Test / Server Test (1, 8) (push) Blocked by required conditions
Build & Test / Server Test (2, 8) (push) Blocked by required conditions
Build & Test / Server Test (3, 8) (push) Blocked by required conditions
Build & Test / Server Test (4, 8) (push) Blocked by required conditions
Build & Test / Server Test (5, 8) (push) Blocked by required conditions
Build & Test / Server Test (6, 8) (push) Blocked by required conditions
Build & Test / Server Test (7, 8) (push) Blocked by required conditions
Build & Test / Server Test with Elasticsearch (push) Blocked by required conditions
Build & Test / Server E2E Test (push) Blocked by required conditions
Build & Test / miri code check (push) Waiting to run
Build & Test / loom thread test (push) Waiting to run
Build & Test / fuzzing (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:macos-13 target:x86_64-apple-darwin]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:macos-latest target:aarch64-apple-darwin]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:ubuntu-24.04-arm target:aarch64-unknown-linux-gnu]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:ubuntu-latest target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:windows-11-arm target:aarch64-pc-windows-msvc]) (push) Waiting to run
Build & Test / y-octo binding test on ${{ matrix.settings.target }} (map[os:windows-latest target:x86_64-pc-windows-msvc]) (push) Waiting to run
Build & Test / Run native tests (push) Waiting to run
Build & Test / Server Copilot Api Test (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (1, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (10, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (2, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (3, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (4, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (5, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (6, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (7, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (8, 10) (push) Blocked by required conditions
Build & Test / Frontend Copilot E2E Test (9, 10) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud Desktop E2E Test script:yarn affine @affine/electron build:dev
# Workaround for Electron apps failing to initialize on Ubuntu 24.04 due to AppArmor restrictions
# Disables unprivileged user namespaces restrictio… (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 1/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=1/10 shard:1]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 10/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=10/10 shard:10]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 2/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=2/10 shard:2]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 3/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=3/10 shard:3]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 4/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=4/10 shard:4]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 5/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=5/10 shard:5]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 6/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=6/10 shard:6]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 7/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=7/10 shard:7]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 8/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=8/10 shard:8]) (push) Blocked by required conditions
Build & Test / ${{ matrix.tests.name }} (map[name:Cloud E2E Test 9/10 script:yarn affine @affine-test/affine-cloud e2e --forbid-only --shard=9/10 shard:9]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:arm64 os:macos-latest platform:macos target:aarch64-apple-darwin test:true]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:macos-latest platform:macos target:x86_64-apple-darwin test:false]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:ubuntu-latest platform:linux target:x86_64-unknown-linux-gnu test:true]) (push) Blocked by required conditions
Build & Test / Desktop Test (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:windows-latest platform:windows target:x86_64-pc-windows-msvc test:true]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:arm64 os:macos-latest platform:macos target:aarch64-apple-darwin test:true]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:macos-latest platform:macos target:x86_64-apple-darwin test:false]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:ubuntu-latest platform:linux target:x86_64-unknown-linux-gnu test:true]) (push) Blocked by required conditions
Build & Test / Desktop bundle check (${{ matrix.spec.os }}, ${{ matrix.spec.platform }}, ${{ matrix.spec.arch }}, ${{ matrix.spec.target }}, ${{ matrix.spec.test }}) (map[arch:x64 os:windows-latest platform:windows target:x86_64-pc-windows-msvc test:true]) (push) Blocked by required conditions
Build & Test / 3, 2, 1 Launch (push) Blocked by required conditions
<img width="576" height="251" alt="截屏2025-09-30 14 55 20" src="https://github.com/user-attachments/assets/947a4ab3-8b34-434d-94a6-afb5dad3d32c" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added “Subscribe to AI” action across chat experiences (panel, content, composer, input, playground, peek view) that launches an in-app checkout flow. - Chat content now refreshes subscription status when opened; desktop chat pages wire the subscription action for seamless checkout. - **Style** - Polished hover state for the subscription icon in chat preferences. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
4b3ebd899b
commit
03ef4625bc
@ -137,6 +137,9 @@ export class ChatPanel extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor aiModelService!: AIModelService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe!: () => Promise<void>;
|
||||
|
||||
@state()
|
||||
accessor session: CopilotChatHistoryFragment | null | undefined;
|
||||
|
||||
@ -462,6 +465,7 @@ export class ChatPanel extends SignalWatcher(
|
||||
.peekViewService=${this.peekViewService}
|
||||
.subscriptionService=${this.subscriptionService}
|
||||
.aiModelService=${this.aiModelService}
|
||||
.onAISubscribe=${this.onAISubscribe}
|
||||
.onEmbeddingProgressChange=${this.onEmbeddingProgressChange}
|
||||
.onContextChange=${this.onContextChange}
|
||||
.width=${this.sidebarWidth}
|
||||
|
||||
@ -149,6 +149,9 @@ export class AIChatComposer extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor aiModelService!: AIModelService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe!: () => Promise<void>;
|
||||
|
||||
@state()
|
||||
accessor chips: ChatChip[] = [];
|
||||
|
||||
@ -200,6 +203,7 @@ export class AIChatComposer extends SignalWatcher(
|
||||
.notificationService=${this.notificationService}
|
||||
.subscriptionService=${this.subscriptionService}
|
||||
.aiModelService=${this.aiModelService}
|
||||
.onAISubscribe=${this.onAISubscribe}
|
||||
.portalContainer=${this.portalContainer}
|
||||
.onChatSuccess=${this.onChatSuccess}
|
||||
.trackOptions=${this.trackOptions}
|
||||
|
||||
@ -192,6 +192,9 @@ export class AIChatContent extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor subscriptionService!: SubscriptionService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe!: () => Promise<void>;
|
||||
|
||||
@state()
|
||||
accessor chatContextValue: ChatContextValue = DEFAULT_CHAT_CONTEXT_VALUE;
|
||||
|
||||
@ -381,6 +384,9 @@ export class AIChatContent extends SignalWatcher(
|
||||
.catch(console.error);
|
||||
}
|
||||
|
||||
// revalidate subscription to get the latest status
|
||||
this.subscriptionService.subscription.revalidate();
|
||||
|
||||
this._disposables.add(
|
||||
AIProvider.slots.actions.subscribe(({ event }) => {
|
||||
const { status } = this.chatContextValue;
|
||||
@ -472,6 +478,7 @@ export class AIChatContent extends SignalWatcher(
|
||||
.aiToolsConfigService=${this.aiToolsConfigService}
|
||||
.subscriptionService=${this.subscriptionService}
|
||||
.aiModelService=${this.aiModelService}
|
||||
.onAISubscribe=${this.onAISubscribe}
|
||||
.trackOptions=${{
|
||||
where: 'chat-panel',
|
||||
control: 'chat-send',
|
||||
|
||||
@ -377,6 +377,9 @@ export class AIChatInput extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor aiModelService!: AIModelService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe!: () => Promise<void>;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor isRootSession: boolean = true;
|
||||
|
||||
@ -534,6 +537,7 @@ export class AIChatInput extends SignalWatcher(
|
||||
.notificationService=${this.notificationService}
|
||||
.subscriptionService=${this.subscriptionService}
|
||||
.aiModelService=${this.aiModelService}
|
||||
.onAISubscribe=${this.onAISubscribe}
|
||||
></chat-input-preference>
|
||||
${status === 'transmitting' || status === 'loading'
|
||||
? html`<button
|
||||
|
||||
@ -72,6 +72,9 @@ export class ChatInputPreference extends SignalWatcher(
|
||||
.ai-model-prefix svg {
|
||||
color: ${unsafeCSSVarV2('icon/activated')};
|
||||
}
|
||||
.ai-model-postfix svg:hover {
|
||||
color: ${unsafeCSSVarV2('icon/activated')};
|
||||
}
|
||||
.ai-model-version {
|
||||
font-size: 12px;
|
||||
color: ${unsafeCSSVarV2('text/tertiary')};
|
||||
@ -119,6 +122,9 @@ export class ChatInputPreference extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor aiModelService!: AIModelService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe!: () => Promise<void>;
|
||||
|
||||
model = computed(() => {
|
||||
const modelId = this.aiModelService.modelId.value;
|
||||
const activeModel = this.aiModelService.models.value.find(
|
||||
@ -161,7 +167,7 @@ export class ChatInputPreference extends SignalWatcher(
|
||||
</div>
|
||||
`,
|
||||
postfix: html`
|
||||
<div>
|
||||
<div class="ai-model-postfix" @click=${this.onAISubscribe}>
|
||||
${model.isPro && !isSubscribed ? LockIcon() : undefined}
|
||||
</div>
|
||||
`,
|
||||
|
||||
@ -182,6 +182,9 @@ export class PlaygroundChat extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor aiToolsConfigService!: AIToolsConfigService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe: (() => Promise<void>) | undefined;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor addChat!: () => Promise<void>;
|
||||
|
||||
@ -374,6 +377,7 @@ export class PlaygroundChat extends SignalWatcher(
|
||||
.aiToolsConfigService=${this.aiToolsConfigService}
|
||||
.affineWorkspaceDialogService=${this.affineWorkspaceDialogService}
|
||||
.affineFeatureFlagService=${this.affineFeatureFlagService}
|
||||
.onAISubscribe=${this.onAISubscribe}
|
||||
></ai-chat-composer>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ import type {
|
||||
AIDraftService,
|
||||
AIToolsConfigService,
|
||||
} from '@affine/core/modules/ai-button';
|
||||
import type { AIModelService } from '@affine/core/modules/ai-button/services/models';
|
||||
import type { SubscriptionService } from '@affine/core/modules/cloud';
|
||||
import type { WorkspaceDialogService } from '@affine/core/modules/dialogs';
|
||||
import type { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import type {
|
||||
@ -622,6 +624,9 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
}}
|
||||
.portalContainer=${this.parentElement}
|
||||
.reasoningConfig=${this.reasoningConfig}
|
||||
.subscriptionService=${this.subscriptionService}
|
||||
.aiModelService=${this.aiModelService}
|
||||
.onAISubscribe=${this.onAISubscribe}
|
||||
></ai-chat-composer>
|
||||
</div> `;
|
||||
}
|
||||
@ -659,6 +664,15 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
@property({ attribute: false })
|
||||
accessor aiToolsConfigService!: AIToolsConfigService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor aiModelService!: AIModelService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor subscriptionService!: SubscriptionService;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onAISubscribe!: () => Promise<void>;
|
||||
|
||||
@state()
|
||||
accessor _historyMessages: ChatMessage[] = [];
|
||||
|
||||
@ -697,7 +711,10 @@ export const AIChatBlockPeekViewTemplate = (
|
||||
affineFeatureFlagService: FeatureFlagService,
|
||||
affineWorkspaceDialogService: WorkspaceDialogService,
|
||||
aiDraftService: AIDraftService,
|
||||
aiToolsConfigService: AIToolsConfigService
|
||||
aiToolsConfigService: AIToolsConfigService,
|
||||
subscriptionService: SubscriptionService,
|
||||
aiModelService: AIModelService,
|
||||
onAISubscribe: (() => Promise<void>) | undefined
|
||||
) => {
|
||||
return html`<ai-chat-block-peek-view
|
||||
.blockModel=${blockModel}
|
||||
@ -710,5 +727,8 @@ export const AIChatBlockPeekViewTemplate = (
|
||||
.affineWorkspaceDialogService=${affineWorkspaceDialogService}
|
||||
.aiDraftService=${aiDraftService}
|
||||
.aiToolsConfigService=${aiToolsConfigService}
|
||||
.subscriptionService=${subscriptionService}
|
||||
.aiModelService=${aiModelService}
|
||||
.onAISubscribe=${onAISubscribe}
|
||||
></ai-chat-block-peek-view>`;
|
||||
};
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
import { generateSubscriptionCallbackLink } from '@affine/core/components/hooks/affine/use-subscription-notify';
|
||||
import { AuthService, SubscriptionService } from '@affine/core/modules/cloud';
|
||||
import { UrlService } from '@affine/core/modules/url';
|
||||
import { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql';
|
||||
import { useFramework } from '@toeverything/infra';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
/**
|
||||
* Hook to handle AI subscription checkout
|
||||
* @returns A function that initiates the AI subscription checkout process
|
||||
*/
|
||||
export const useAISubscribe = () => {
|
||||
const framework = useFramework();
|
||||
|
||||
const handleAISubscribe = useCallback(async () => {
|
||||
try {
|
||||
const authService = framework.get(AuthService);
|
||||
const subscriptionService = framework.get(SubscriptionService);
|
||||
const urlService = framework.get(UrlService);
|
||||
|
||||
const account = authService.session.account$.value;
|
||||
if (!account) {
|
||||
return;
|
||||
}
|
||||
|
||||
const idempotencyKey = nanoid();
|
||||
const checkoutOptions = {
|
||||
recurring: SubscriptionRecurring.Yearly,
|
||||
plan: SubscriptionPlan.AI,
|
||||
variant: null,
|
||||
coupon: null,
|
||||
successCallbackLink: generateSubscriptionCallbackLink(
|
||||
account,
|
||||
SubscriptionPlan.AI,
|
||||
SubscriptionRecurring.Yearly
|
||||
),
|
||||
};
|
||||
|
||||
const session = await subscriptionService.createCheckoutSession({
|
||||
idempotencyKey,
|
||||
...checkoutOptions,
|
||||
});
|
||||
|
||||
urlService.openExternal(session);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}, [framework]);
|
||||
|
||||
return handleAISubscribe;
|
||||
};
|
||||
@ -11,6 +11,7 @@ import { getViewManager } from '@affine/core/blocksuite/manager/view';
|
||||
import { NotificationServiceImpl } from '@affine/core/blocksuite/view-extensions/editor-view/notification-service';
|
||||
import { useAIChatConfig } from '@affine/core/components/hooks/affine/use-ai-chat-config';
|
||||
import { useAISpecs } from '@affine/core/components/hooks/affine/use-ai-specs';
|
||||
import { useAISubscribe } from '@affine/core/components/hooks/affine/use-ai-subscribe';
|
||||
import {
|
||||
AIDraftService,
|
||||
AIToolsConfigService,
|
||||
@ -197,6 +198,7 @@ export const Component = () => {
|
||||
const confirmModal = useConfirmModal();
|
||||
const specs = useAISpecs();
|
||||
const mockStd = useMockStd();
|
||||
const handleAISubscribe = useAISubscribe();
|
||||
|
||||
// init or update ai-chat-content
|
||||
useEffect(() => {
|
||||
@ -233,6 +235,8 @@ export const Component = () => {
|
||||
content.aiToolsConfigService = framework.get(AIToolsConfigService);
|
||||
content.subscriptionService = framework.get(SubscriptionService);
|
||||
content.aiModelService = framework.get(AIModelService);
|
||||
content.onAISubscribe = handleAISubscribe;
|
||||
|
||||
content.createSession = createSession;
|
||||
content.onOpenDoc = onOpenDoc;
|
||||
|
||||
@ -260,6 +264,7 @@ export const Component = () => {
|
||||
onContextChange,
|
||||
specs,
|
||||
onOpenDoc,
|
||||
handleAISubscribe,
|
||||
]);
|
||||
|
||||
// init or update header ai-chat-toolbar
|
||||
|
||||
@ -4,6 +4,7 @@ import type { AffineEditorContainer } from '@affine/core/blocksuite/block-suite-
|
||||
import { NotificationServiceImpl } from '@affine/core/blocksuite/view-extensions/editor-view/notification-service';
|
||||
import { useAIChatConfig } from '@affine/core/components/hooks/affine/use-ai-chat-config';
|
||||
import { useAISpecs } from '@affine/core/components/hooks/affine/use-ai-specs';
|
||||
import { useAISubscribe } from '@affine/core/components/hooks/affine/use-ai-subscribe';
|
||||
import {
|
||||
AIDraftService,
|
||||
AIToolsConfigService,
|
||||
@ -63,6 +64,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
} = useAIChatConfig();
|
||||
const confirmModal = useConfirmModal();
|
||||
const specs = useAISpecs();
|
||||
const handleAISubscribe = useAISubscribe();
|
||||
|
||||
useEffect(() => {
|
||||
if (!editor || !editor.host) return;
|
||||
@ -109,6 +111,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
chatPanelRef.current.subscriptionService =
|
||||
framework.get(SubscriptionService);
|
||||
chatPanelRef.current.aiModelService = framework.get(AIModelService);
|
||||
chatPanelRef.current.onAISubscribe = handleAISubscribe;
|
||||
|
||||
containerRef.current?.append(chatPanelRef.current);
|
||||
} else {
|
||||
@ -141,6 +144,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
playgroundConfig,
|
||||
confirmModal,
|
||||
specs,
|
||||
handleAISubscribe,
|
||||
]);
|
||||
|
||||
const [autoResized, setAutoResized] = useState(false);
|
||||
|
||||
@ -2,10 +2,13 @@ import { toReactNode } from '@affine/component';
|
||||
import { AIChatBlockPeekViewTemplate } from '@affine/core/blocksuite/ai';
|
||||
import type { AIChatBlockModel } from '@affine/core/blocksuite/ai/blocks/ai-chat-block/model/ai-chat-model';
|
||||
import { useAIChatConfig } from '@affine/core/components/hooks/affine/use-ai-chat-config';
|
||||
import { useAISubscribe } from '@affine/core/components/hooks/affine/use-ai-subscribe';
|
||||
import {
|
||||
AIDraftService,
|
||||
AIToolsConfigService,
|
||||
} from '@affine/core/modules/ai-button';
|
||||
import { AIModelService } from '@affine/core/modules/ai-button/services/models';
|
||||
import { SubscriptionService } from '@affine/core/modules/cloud';
|
||||
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import type { EditorHost } from '@blocksuite/affine/std';
|
||||
@ -33,6 +36,9 @@ export const AIChatBlockPeekView = ({
|
||||
const affineWorkspaceDialogService = framework.get(WorkspaceDialogService);
|
||||
const aiDraftService = framework.get(AIDraftService);
|
||||
const aiToolsConfigService = framework.get(AIToolsConfigService);
|
||||
const subscriptionService = framework.get(SubscriptionService);
|
||||
const aiModelService = framework.get(AIModelService);
|
||||
const handleAISubscribe = useAISubscribe();
|
||||
|
||||
return useMemo(() => {
|
||||
const template = AIChatBlockPeekViewTemplate(
|
||||
@ -45,7 +51,10 @@ export const AIChatBlockPeekView = ({
|
||||
affineFeatureFlagService,
|
||||
affineWorkspaceDialogService,
|
||||
aiDraftService,
|
||||
aiToolsConfigService
|
||||
aiToolsConfigService,
|
||||
subscriptionService,
|
||||
aiModelService,
|
||||
handleAISubscribe
|
||||
);
|
||||
return toReactNode(template);
|
||||
}, [
|
||||
@ -59,5 +68,8 @@ export const AIChatBlockPeekView = ({
|
||||
affineWorkspaceDialogService,
|
||||
aiDraftService,
|
||||
aiToolsConfigService,
|
||||
subscriptionService,
|
||||
aiModelService,
|
||||
handleAISubscribe,
|
||||
]);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user