Commit Graph

84 Commits

Author SHA1 Message Date
fengmk2
7ed72ed1d0 feat(server): support comment notification type (#12924)
#### PR Dependency Tree


* **PR #12924** 👈
  * **PR #12925**

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Introduced comment and comment mention notifications, including email
notifications when users are mentioned or receive comments on documents.
* Added new email templates for comment and comment mention
notifications.
* Users can now control whether they receive comment-related emails via
a new user setting.

* **Bug Fixes**
  * None.

* **Documentation**
* Updated GraphQL schema documentation to reflect new notification types
and user settings.

* **Refactor**
* Streamlined and enhanced test coverage for notification and user
settings, including comment notifications.

* **Chores**
* Improved test setup and snapshot coverage for user settings and
notifications.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-01 13:48:06 +00:00
DarkSky
6e034185cf feat: title of session (#12971)
fix AI-253
2025-07-01 05:24:42 +00:00
fengmk2
e773930256 feat(server): add comment-attachment model (#12909)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Introduced support for comment attachments, allowing users to add,
view, and manage attachments linked to comments within documents.
* **Tests**
* Added comprehensive tests to ensure correct behavior for adding,
updating, deleting, listing, and retrieving comment attachments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


#### PR Dependency Tree


* **PR #12909** 👈
  * **PR #12911**
    * **PR #12761**
      * **PR #12924**
        * **PR #12925**

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
2025-06-28 08:45:24 +00:00
fengmk2
e2a799c70a feat(server): comment model (#12760)
close CLOUD-226

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced support for comments and replies within workspaces and
documents, enabling users to create, update, delete, and resolve
comments, as well as manage threaded replies.
- **Bug Fixes**
- Added user-friendly error messages and handling for situations where
comments or replies are not found.
- **Tests**
- Added comprehensive tests to ensure correct behavior of comment and
reply operations.
- **Localization**
  - Added English translations for new comment and reply error messages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->














#### PR Dependency Tree


* **PR #12760** 👈
  * **PR #12909**
    * **PR #12911**
      * **PR #12761**
        * **PR #12924**
          * **PR #12925**

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
2025-06-28 08:01:53 +00:00
DarkSky
06f27e8d6a feat(server): allow multiple session attach to doc (#12933)
fix AI-236
2025-06-26 02:15:31 +00:00
DarkSky
dfaf69475b fix(server): session unique index conflict (#12865) 2025-06-20 08:36:22 +08:00
DarkSky
bd04930560 feat(server): allow chat session dangling & pin session support (#12849)
fix AI-181
fix AI-179
fix AI-178
fix PD-2682
fix PD-2683
2025-06-19 13:17:01 +08:00
Wu Yue
6169cdab3a feat(core): add stream object api (#12841)
Close [AI-193](https://linear.app/affine-design/issue/AI-193)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added support for streaming structured AI chat responses as objects,
enabling richer and more interactive chat experiences.
- Chat messages now include a new field displaying structured stream
objects, such as reasoning steps, text deltas, tool calls, and tool
results.
- GraphQL APIs and queries updated to expose these structured streaming
objects in chat histories.
  - Introduced a new streaming chat endpoint for object-based responses.

- **Bug Fixes**
- Improved error handling for streaming responses to ensure more robust
and informative error reporting.

- **Refactor**
- Centralized and streamlined session preparation and streaming logic
for AI chat providers.
  - Unified streaming setup across multiple AI model providers.

- **Tests**
- Extended test coverage for streaming object responses to ensure
reliability and correctness.

- **Documentation**
- Updated type definitions and schemas to reflect new streaming object
capabilities in both backend and frontend code.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
2025-06-19 09:13:18 +08:00
darkskygit
99198e246b fix: migration compatible for postgres (#12659)
fix AI-162

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Chores**
  - Improved database migration scripts to prevent errors by ensuring changes are only applied if relevant tables exist. No visible changes to user features or functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-04 02:21:57 +00:00
darkskygit
7fd3ee957f fix(server): embedding chunks primary key (#12416)
fix AI-131

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Refactor**
  - Updated database schema to consolidate unique constraints into composite primary keys for embedding-related data, improving consistency.
  - Changed the relation in the Snapshot model to allow multiple embeddings.
  - Improved filtering logic for documents and snapshots based on embedding existence.
  - Reformatted SQL queries and schema attributes for improved readability; no changes to functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-21 10:51:35 +00:00
fengmk2
a34c3ea200 feat(server): auto index all workspaces to indexer (#12205)
close CLOUD-207

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced automated periodic indexing of workspaces with a new job type and a scheduled cron job running every 30 seconds.
  - Added a unique sequential identifier (`sid`) and an "indexed" flag to workspaces to track indexing status.
- **Improvements**
  - Enhanced workspace indexing to handle missing workspaces and snapshots distinctly and selectively index documents.
  - Added ability to query workspaces after a given identifier with result limits.
- **Bug Fixes**
  - Improved error handling and logging during workspace indexing operations.
- **Tests**
  - Expanded test coverage for workspace indexing and auto-indexing, including scheduling and edge cases.
- **Chores**
  - Updated data models and schema to support new workspace fields and indexing features.
  - Enhanced mock data utilities to allow custom timestamps.
  - Improved type safety and flexibility in document snapshot retrieval.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-19 04:39:38 +00:00
darkskygit
cecf545590 feat(server): improve context metadata & matching (#12064)
fix AI-20

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Enhanced file metadata with MIME type, blob ID, and file name across context and workspace, now visible in UI and API.
  - Added workspace-level matching for files and documents with configurable thresholds and workspace scoping in search queries.
  - Introduced a new error type and user-friendly messaging for global workspace context matching failures.

- **Bug Fixes**
  - Improved consistent handling of file MIME types and nullable context IDs for accurate metadata.

- **Documentation**
  - Updated GraphQL schema, queries, and mutations to include new metadata fields, optional parameters, and error types.

- **Style**
  - Added new localization strings for global context matching error messages.

- **Tests**
  - Extended test coverage with new and updated snapshot tests for metadata and matching logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-14 06:32:29 +00:00
akumatus
74452a0aab feat(core): add optionalModels field in AiPrompt and support the front-end modelId param (#12224)
Close [AI-116](https://linear.app/affine-design/issue/AI-116)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for specifying alternative AI models in chat prompts, enabling users to select from multiple available models.
  - Expanded AI model options with new additions: 'gpt-4.1', 'o3', and 'claude-3-5-sonnet-20241022'.

- **Enhancements**
  - Users can now optionally choose a specific AI model during chat interactions.
  - Prompts and chat sessions reflect and support selection of alternative models where applicable.

- **Bug Fixes**
  - Improved handling of prompt configuration defaults for better reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-13 09:17:34 +00:00
forehalo
93e01b4442 feat(server): support installable license (#12181)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for installing self-hosted team licenses via encrypted license files.
  - Introduced a new "Onetime" license variant for self-hosted environments.
  - Added a GraphQL mutation to upload and install license files.
  - License details now display the license variant.

- **Bug Fixes**
  - Improved error messages for license activation and expiration, including dynamic reasons.

- **Localization**
  - Updated and improved license-related error messages for better clarity.

- **Tests**
  - Added comprehensive end-to-end tests for license installation scenarios.

- **Chores**
  - Enhanced environment variable handling and public key management for license verification.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-09 04:16:05 +00:00
liuyi
2e1bed061e feat(server): delay subscription after invitation accepted or approved (#11992) 2025-04-30 14:27:47 +08:00
darkskygit
f2adb9f72c feat(server): workspace file embedding & ignored docs model impl (#11804)
fix AI-30
fix AI-31
2025-04-21 05:34:10 +00:00
darkskygit
38e8806787 feat(server): add doc embedding switch for workspace (#11760)
fix AI-33
2025-04-17 07:13:22 +00:00
forehalo
0ea38680fa refactor(server): config system (#11081) 2025-03-27 12:32:28 +00:00
darkskygit
3b9d64d74d feat(server): update trascript endpoint (#11196) 2025-03-27 10:18:49 +00:00
fengmk2
a8c86c5ede refactor(server): rename settings to user-settings (#11161) 2025-03-25 08:47:27 +00:00
fengmk2
28f8639aff feat(server): send invitation review notification (#10418) 2025-03-24 03:32:24 +00:00
darkskygit
5acba9d5a0 feat(server): adapt context model (#11028)
expose more field in listContextObject
2025-03-21 05:36:45 +00:00
darkskygit
b24376a9f7 feat(server): impl context model (#11027) 2025-03-20 10:24:28 +00:00
darkskygit
b099546164 feat(server): copilot job models (#10732) 2025-03-19 14:34:14 +00:00
fengmk2
5dcbae6f86 feat(server): add settings model (#10755)
close CLOUD-166
2025-03-18 00:41:21 +00:00
darkskygit
d8373f66e7 feat(server): context awareness for copilot (#9611)
fix PD-2167
fix PD-2169
fix PD-2190
2025-03-13 11:44:55 +00:00
forehalo
ea72599bde feat(server): ban account (#10761)
close CLOUD-158
2025-03-12 02:52:18 +00:00
fengmk2
7302c4f954 feat(server): notification system (#10053)
closes CLOUD-52
2025-03-06 15:25:05 +00:00
fengmk2
81694a1144 feat(server): add workspace name and avatarKey to database (#10513)
close CLOUD-153
2025-03-06 15:25:05 +00:00
fengmk2
c76b2504fe feat(server): add doc title and summary to database (#10505)
close CLOUD-152
2025-03-06 14:27:42 +00:00
fengmk2
43ded6aa38 feat(server): add blocked state to workspace docs (#10585)
close CLOUD-162
2025-03-05 12:49:33 +00:00
Brooooooklyn
73fa04e249 chore: unify Cargo deps versions (#10553) 2025-03-03 03:30:59 +00:00
darkskygit
a725df6ebe feat(server): basic context api (#10056)
fix CLOUD-97
fix CLOUD-98
2025-02-11 10:45:01 +00:00
Brooooooklyn
5710e8c639 fix(server): generate migration for workspace pages default role (#10002) 2025-02-07 03:16:54 +00:00
forehalo
7c7febd495 refactor(server): remove never used column in page permission (#9985) 2025-02-06 10:52:05 +00:00
forehalo
7826e2b7c8 refactor(server): use feature model (#9932) 2025-02-05 10:27:26 +00:00
forehalo
d03447f52e fix(server): should redeem onetime invoice only once (#9927)
fix CLOUD-115
2025-02-02 09:18:06 +00:00
forehalo
994d758c07 feat(server): support selfhost licenses (#8947) 2025-01-22 10:21:07 +00:00
Brooooooklyn
752e697c6a feat(ios): nbstore swift native binding (#9211) 2024-12-27 06:34:30 +00:00
forehalo
2f80b4f822 feat(nbstore): add cloud implementation (#8810) 2024-12-10 10:48:27 +00:00
DarkSky
9365958a02 feat(server): team quota (#8955) 2024-12-09 18:51:54 +09:00
forehalo
5bf8ed1095 feat(server): support team workspace subscription (#8919)
close AF-1724, AF-1722
2024-12-05 08:31:01 +00:00
forehalo
4055e3aa67 refactor(server): payment service (#8906) 2024-12-05 08:31:00 +00:00
darkskygit
1c2b23b160 feat(native): split package (#8853) 2024-11-18 13:18:16 +00:00
forehalo
69fb5c06f4 feat(server): support onetime payment subscription (#8369) 2024-10-10 10:12:40 +00:00
forehalo
0add8917f9 feat(server): enable share og information for docs (#7794) 2024-09-10 04:03:52 +00:00
darkskygit
34eac4c24e feat: improve ai query performance (#8170) 2024-09-09 09:39:28 +00:00
forehalo
32f673fa3d perf(server): index lower user email (#8167) 2024-09-09 04:43:59 +00:00
darkskygit
2a135d8a93 feat: add index for snapshots (#8163) 2024-09-08 13:49:41 +00:00
forehalo
63e1fce3ca perf(server): accelerate user workspace permission queries (#8161) 2024-09-08 12:04:00 +00:00