better-notion 1.0.1__py3-none-any.whl → 1.1.0__py3-none-any.whl

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.
@@ -0,0 +1,146 @@
1
+ """Agents SDK Plugin - Registers workflow models and caches.
2
+
3
+ This plugin implements the SDKPluginInterface to register workflow
4
+ entity models (Organization, Project, Version, Task) and their
5
+ dedicated caches with NotionClient.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from typing import TYPE_CHECKING, Any
11
+
12
+ from better_notion._sdk.cache import Cache
13
+ from better_notion._sdk.plugins import SDKPluginInterface
14
+
15
+ if TYPE_CHECKING:
16
+ from better_notion._sdk.base.entity import BaseEntity
17
+ from better_notion._sdk.client import NotionClient
18
+
19
+
20
+ class AgentsSDKPlugin:
21
+ """
22
+ SDK Plugin for agents workflow management system.
23
+
24
+ This plugin registers workflow entity models and dedicated caches
25
+ with NotionClient, enabling agents to work with Organizations,
26
+ Projects, Versions, and Tasks through the SDK.
27
+
28
+ Example:
29
+ >>> from better_notion import NotionClient
30
+ >>> from better_notion.plugins.official.agents_sdk import AgentsSDKPlugin
31
+ >>>
32
+ >>> client = NotionClient(auth="...")
33
+ >>> plugin = AgentsSDKPlugin()
34
+ >>>
35
+ >>> # Register models and caches
36
+ >>> client.register_sdk_plugin(plugin)
37
+ >>>
38
+ >>> # Now use models
39
+ >>> org = await Organization.get("org_id", client=client)
40
+ """
41
+
42
+ def register_models(self) -> dict[str, type]:
43
+ """Register workflow entity models.
44
+
45
+ Returns:
46
+ Dictionary mapping model names to model classes
47
+ """
48
+ from better_notion.plugins.official.agents_sdk.models import (
49
+ Idea,
50
+ Incident,
51
+ Organization,
52
+ Project,
53
+ Task,
54
+ Version,
55
+ WorkIssue,
56
+ )
57
+
58
+ return {
59
+ "Organization": Organization,
60
+ "Project": Project,
61
+ "Version": Version,
62
+ "Task": Task,
63
+ "Idea": Idea,
64
+ "WorkIssue": WorkIssue,
65
+ "Incident": Incident,
66
+ }
67
+
68
+ def register_caches(self, client: "NotionClient") -> dict[str, Cache]:
69
+ """Register dedicated caches for workflow entities.
70
+
71
+ Args:
72
+ client: NotionClient instance
73
+
74
+ Returns:
75
+ Dictionary mapping cache names to Cache instances
76
+ """
77
+ return {
78
+ "organizations": Cache(),
79
+ "projects": Cache(),
80
+ "versions": Cache(),
81
+ "tasks": Cache(),
82
+ "ideas": Cache(),
83
+ "work_issues": Cache(),
84
+ "incidents": Cache(),
85
+ }
86
+
87
+ def register_managers(self, client: "NotionClient") -> dict[str, Any]:
88
+ """Register custom managers for workflow entities.
89
+
90
+ Args:
91
+ client: NotionClient instance
92
+
93
+ Returns:
94
+ Dictionary mapping manager names to manager instances
95
+ """
96
+ from better_notion.plugins.official.agents_sdk.managers import (
97
+ IdeaManager,
98
+ IncidentManager,
99
+ OrganizationManager,
100
+ ProjectManager,
101
+ TaskManager,
102
+ VersionManager,
103
+ WorkIssueManager,
104
+ )
105
+
106
+ return {
107
+ "organizations": OrganizationManager(client),
108
+ "projects": ProjectManager(client),
109
+ "versions": VersionManager(client),
110
+ "tasks": TaskManager(client),
111
+ "ideas": IdeaManager(client),
112
+ "work_issues": WorkIssueManager(client),
113
+ "incidents": IncidentManager(client),
114
+ }
115
+
116
+ def initialize(self, client: "NotionClient") -> None:
117
+ """Initialize plugin resources.
118
+
119
+ Loads workspace configuration to get database IDs.
120
+
121
+ Args:
122
+ client: NotionClient instance
123
+ """
124
+ import json
125
+ from pathlib import Path
126
+
127
+ config_path = Path.home() / ".notion" / "workspace.json"
128
+
129
+ if config_path.exists():
130
+ with open(config_path) as f:
131
+ client._workspace_config = json.load(f)
132
+ else:
133
+ client._workspace_config = {}
134
+
135
+ def get_info(self) -> dict[str, Any]:
136
+ """Return plugin metadata.
137
+
138
+ Returns:
139
+ Dictionary with plugin information
140
+ """
141
+ return {
142
+ "name": "agents-sdk",
143
+ "version": "1.0.0",
144
+ "description": "SDK extensions for agents workflow management",
145
+ "author": "Better Notion Team",
146
+ }
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: better-notion
3
- Version: 1.0.1
4
- Summary: A high-level Python SDK for the Notion API with developer experience in mind. Now with AI agents workflow management system!
3
+ Version: 1.1.0
4
+ Summary: A high-level Python SDK for the Notion API with developer experience in mind.
5
5
  Project-URL: Homepage, https://github.com/nesalia-inc/better-notion
6
6
  Project-URL: Documentation, https://github.com/nesalia-inc/better-notion#readme
7
7
  Project-URL: Repository, https://github.com/nesalia-inc/better-notion
@@ -50,7 +50,8 @@ better_notion/_cli/commands/users.py,sha256=wpjKCo-HHfpiGsjvLSs8nb2MjZ8nxtppCC0N
50
50
  better_notion/_cli/commands/workspace.py,sha256=f3VQcXZ6lu2QrAxkQyFVb3FVU7LYC8kag6VOUvVEu-c,3671
51
51
  better_notion/_cli/utils/__init__.py,sha256=VV2SaZnclN-HMMRIsqgxlBNL2HB4n1AvAfMJJWCoTxo,29
52
52
  better_notion/_sdk/__init__.py,sha256=oTo9qHSrRBRqPw-2ZHU5TR4erVZTf9IzYRFP8ju9H5U,210
53
- better_notion/_sdk/client.py,sha256=M4caAOYIfEYomZSAvZZKlPTzukh-6iwAECxr36OcZ7Y,10185
53
+ better_notion/_sdk/client.py,sha256=1XKpMLNesCNi4xq6zi__qgh02SLcB3ZwWM-gG-7PAUQ,13660
54
+ better_notion/_sdk/plugins.py,sha256=G_EU37nnDdYW6_qyw09goteJi5nvwV0F0jZ8-v-OSEA,6090
54
55
  better_notion/_sdk/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
56
  better_notion/_sdk/base/entity.py,sha256=eAFb_7CTVV6A6L-cfi0RkI5jA1lAa7SUTuruDT1cfEA,8655
56
57
  better_notion/_sdk/cache/__init__.py,sha256=JEfrfPWoOTbFv-DhAL-SkPXBlxzuALk4KO1r80iVznU,147
@@ -102,12 +103,17 @@ better_notion/_sdk/query/__init__.py,sha256=1zpOcxwX211AHky1DGA7JDi3eijhEn90zBQL
102
103
  better_notion/_sdk/query/database_query.py,sha256=O-fdt7q8C6df9OpZXYVbJPLP6cB7_g0zuGyAOBaNXRY,8979
103
104
  better_notion/_sdk/query/filter_translator.py,sha256=Fdsyz5-1OLChi5yzSRPSDUyGspJeK0ME20-EAek0yT4,11204
104
105
  better_notion/plugins/__init__.py,sha256=ZbaLy0BS4_zWfEyCW0Xv9EhK427cEhrKIap_8DRvp04,322
105
- better_notion/plugins/base.py,sha256=G2asUEvQXWIiyWvNtB1hgg9JXZhDayi7Jvfq15FeQWY,5255
106
- better_notion/plugins/loader.py,sha256=ewCG_Thv7Khh8IsHLB17U1Hi0cWpq0YG3w37hrpbeRk,7710
106
+ better_notion/plugins/base.py,sha256=3h9jOZzS--UqmVW3RREtcQ2h1GTWWPUryTencsJKhTM,8452
107
+ better_notion/plugins/loader.py,sha256=zCWsMdJyvZs1IHFm0zjEiqm_l_5jB1Uw4x30Kq8rLS4,9527
107
108
  better_notion/plugins/state.py,sha256=jH_tZWvC35hqLO4qwl2Kwq9ziWVavwCEUcCqy3s5wMY,3780
108
- better_notion/plugins/official/__init__.py,sha256=rPg5vdk1cEANVstMPzxcWmImtsOpdSR40JSml7h1uUk,426
109
- better_notion/plugins/official/agents.py,sha256=8Cwx5fkNMaYc1bavS48jyvaXCTMYWgCaIMZH0y9YSbM,12696
109
+ better_notion/plugins/official/__init__.py,sha256=4c0kaPLOqUQ7vIISgCm4Y9TG306Vew5A8dfDrLsAGwc,327
110
+ better_notion/plugins/official/agents.py,sha256=XT8dRaaSs5PSciuA4ne6belQflneS72_L1-GLgDccw0,19308
111
+ better_notion/plugins/official/agents_cli.py,sha256=rFF3cIXXzxOnvd5dnaR1CESvs1mwmR1hBv1lVADcIu8,56317
110
112
  better_notion/plugins/official/productivity.py,sha256=_-whP4pYA4HufE1aUFbIdhrjU-O9njI7xUO_Id2M1J8,8726
113
+ better_notion/plugins/official/agents_sdk/__init__.py,sha256=luQBzZLsJ7fC5U0jFu8dfzMviiXj2SBZXcTohM53wkQ,725
114
+ better_notion/plugins/official/agents_sdk/managers.py,sha256=dkpGozJhKXvz8rFqc2tAWyL6MeVzFVcjGMC0Ed2Z1dQ,29813
115
+ better_notion/plugins/official/agents_sdk/models.py,sha256=gwGw9t-Z17NxddzmRKWiD9Noje86sxgPNlLJGARI0KA,75448
116
+ better_notion/plugins/official/agents_sdk/plugin.py,sha256=bs9O8Unv6SARGj4lBU5Gj9HGbLTUNqTacJ3RLUhdbI4,4479
111
117
  better_notion/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
118
  better_notion/utils/helpers.py,sha256=HgFuUQlG_HzBOB0z2GA9RxPLoXgwRc0DIxa9Fg6C-Jk,2337
113
119
  better_notion/utils/retry.py,sha256=9WJDNitiIfVTL18hIlipvOKn41ukePrOwtAwx-LevpQ,7479
@@ -119,8 +125,8 @@ better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWC
119
125
  better_notion/utils/agents/schemas.py,sha256=e_lpGGO12FXtfqFyI91edj9xc5RUtuA6pU7Sk6ip7xg,21784
120
126
  better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
121
127
  better_notion/utils/agents/workspace.py,sha256=T8mP_DNIWhI1-k6UydJINsEJ6kQxQ6_Pa44ul58k088,12370
122
- better_notion-1.0.1.dist-info/METADATA,sha256=twwihoncbT6FKJ_VmFtC_5g2zXSY12q-YAWFm4hLaqQ,11143
123
- better_notion-1.0.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
124
- better_notion-1.0.1.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
125
- better_notion-1.0.1.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
126
- better_notion-1.0.1.dist-info/RECORD,,
128
+ better_notion-1.1.0.dist-info/METADATA,sha256=0DMYo11viAhTUxNMaap6BklxMC0WnkKxxSM8ASsIicE,11096
129
+ better_notion-1.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
130
+ better_notion-1.1.0.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
131
+ better_notion-1.1.0.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
132
+ better_notion-1.1.0.dist-info/RECORD,,