better-notion 1.0.0__py3-none-any.whl → 1.0.1__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.
- better_notion/plugins/official/__init__.py +3 -1
- better_notion/plugins/official/agents.py +69 -61
- {better_notion-1.0.0.dist-info → better_notion-1.0.1.dist-info}/METADATA +1 -1
- {better_notion-1.0.0.dist-info → better_notion-1.0.1.dist-info}/RECORD +7 -7
- {better_notion-1.0.0.dist-info → better_notion-1.0.1.dist-info}/WHEEL +0 -0
- {better_notion-1.0.0.dist-info → better_notion-1.0.1.dist-info}/entry_points.txt +0 -0
- {better_notion-1.0.0.dist-info → better_notion-1.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -4,10 +4,12 @@ Official plugins for Better Notion CLI.
|
|
|
4
4
|
This package contains officially maintained plugins that extend
|
|
5
5
|
the CLI with commonly-needed functionality.
|
|
6
6
|
"""
|
|
7
|
+
from better_notion.plugins.official.agents import AgentsPlugin
|
|
7
8
|
from better_notion.plugins.official.productivity import ProductivityPlugin
|
|
8
9
|
|
|
9
|
-
__all__ = ["ProductivityPlugin"]
|
|
10
|
+
__all__ = ["AgentsPlugin", "ProductivityPlugin"]
|
|
10
11
|
|
|
11
12
|
OFFICIAL_PLUGINS = [
|
|
13
|
+
AgentsPlugin,
|
|
12
14
|
ProductivityPlugin,
|
|
13
15
|
]
|
|
@@ -163,34 +163,36 @@ class AgentsPlugin(PluginInterface):
|
|
|
163
163
|
try:
|
|
164
164
|
# Validate role
|
|
165
165
|
if not RoleManager.is_valid_role(role):
|
|
166
|
-
|
|
166
|
+
result = format_error(
|
|
167
167
|
"INVALID_ROLE",
|
|
168
168
|
f"Invalid role: {role}. Valid roles: {', '.join(RoleManager.get_all_roles())}",
|
|
169
169
|
retry=False,
|
|
170
170
|
)
|
|
171
|
+
else:
|
|
172
|
+
# Create .notion file
|
|
173
|
+
context = ProjectContext.create(
|
|
174
|
+
project_id=project_id,
|
|
175
|
+
project_name=project_name,
|
|
176
|
+
org_id=org_id,
|
|
177
|
+
role=role,
|
|
178
|
+
path=Path.cwd(),
|
|
179
|
+
)
|
|
171
180
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
{
|
|
183
|
-
"message": "Project initialized successfully",
|
|
184
|
-
"project_id": context.project_id,
|
|
185
|
-
"project_name": context.project_name,
|
|
186
|
-
"org_id": context.org_id,
|
|
187
|
-
"role": context.role,
|
|
188
|
-
"notion_file": str(Path.cwd() / ".notion"),
|
|
189
|
-
}
|
|
190
|
-
)
|
|
181
|
+
result = format_success(
|
|
182
|
+
{
|
|
183
|
+
"message": "Project initialized successfully",
|
|
184
|
+
"project_id": context.project_id,
|
|
185
|
+
"project_name": context.project_name,
|
|
186
|
+
"org_id": context.org_id,
|
|
187
|
+
"role": context.role,
|
|
188
|
+
"notion_file": str(Path.cwd() / ".notion"),
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
191
|
|
|
192
192
|
except Exception as e:
|
|
193
|
-
|
|
193
|
+
result = format_error("INIT_PROJECT_ERROR", str(e), retry=False)
|
|
194
|
+
|
|
195
|
+
typer.echo(result)
|
|
194
196
|
|
|
195
197
|
# Role management commands
|
|
196
198
|
role_app = typer.Typer(
|
|
@@ -219,38 +221,40 @@ class AgentsPlugin(PluginInterface):
|
|
|
219
221
|
try:
|
|
220
222
|
# Validate role
|
|
221
223
|
if not RoleManager.is_valid_role(new_role):
|
|
222
|
-
|
|
224
|
+
result = format_error(
|
|
223
225
|
"INVALID_ROLE",
|
|
224
226
|
f"Invalid role: {new_role}. Valid roles: {', '.join(RoleManager.get_all_roles())}",
|
|
225
227
|
retry=False,
|
|
226
228
|
)
|
|
227
|
-
|
|
228
|
-
# Load project context
|
|
229
|
-
if path:
|
|
230
|
-
context = ProjectContext.from_path(path)
|
|
231
229
|
else:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
230
|
+
# Load project context
|
|
231
|
+
if path:
|
|
232
|
+
context = ProjectContext.from_path(path)
|
|
233
|
+
else:
|
|
234
|
+
context = ProjectContext.from_current_directory()
|
|
235
|
+
|
|
236
|
+
if not context:
|
|
237
|
+
result = format_error(
|
|
238
|
+
"NO_PROJECT_CONTEXT",
|
|
239
|
+
"No .notion file found. Are you in a project directory?",
|
|
240
|
+
retry=False,
|
|
241
|
+
)
|
|
242
|
+
else:
|
|
243
|
+
# Update role
|
|
244
|
+
context.update_role(new_role, path=path or None)
|
|
245
|
+
|
|
246
|
+
result = format_success(
|
|
247
|
+
{
|
|
248
|
+
"message": f"Role updated to {new_role}",
|
|
249
|
+
"previous_role": context.role,
|
|
250
|
+
"new_role": new_role,
|
|
251
|
+
}
|
|
252
|
+
)
|
|
251
253
|
|
|
252
254
|
except Exception as e:
|
|
253
|
-
|
|
255
|
+
result = format_error("ROLE_UPDATE_ERROR", str(e), retry=False)
|
|
256
|
+
|
|
257
|
+
typer.echo(result)
|
|
254
258
|
|
|
255
259
|
@role_app.command("whoami")
|
|
256
260
|
def role_whoami(
|
|
@@ -276,26 +280,28 @@ class AgentsPlugin(PluginInterface):
|
|
|
276
280
|
context = ProjectContext.from_current_directory()
|
|
277
281
|
|
|
278
282
|
if not context:
|
|
279
|
-
|
|
283
|
+
result = format_error(
|
|
280
284
|
"NO_PROJECT_CONTEXT",
|
|
281
285
|
"No .notion file found. Are you in a project directory?",
|
|
282
286
|
retry=False,
|
|
283
287
|
)
|
|
288
|
+
else:
|
|
289
|
+
# Get role description
|
|
290
|
+
description = RoleManager.get_role_description(context.role)
|
|
284
291
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"permissions": RoleManager.get_permissions(context.role),
|
|
294
|
-
}
|
|
295
|
-
)
|
|
292
|
+
result = format_success(
|
|
293
|
+
{
|
|
294
|
+
"role": context.role,
|
|
295
|
+
"description": description,
|
|
296
|
+
"project": context.project_name,
|
|
297
|
+
"permissions": RoleManager.get_permissions(context.role),
|
|
298
|
+
}
|
|
299
|
+
)
|
|
296
300
|
|
|
297
301
|
except Exception as e:
|
|
298
|
-
|
|
302
|
+
result = format_error("ROLE_ERROR", str(e), retry=False)
|
|
303
|
+
|
|
304
|
+
typer.echo(result)
|
|
299
305
|
|
|
300
306
|
@role_app.command("list")
|
|
301
307
|
def role_list() -> None:
|
|
@@ -322,7 +328,7 @@ class AgentsPlugin(PluginInterface):
|
|
|
322
328
|
}
|
|
323
329
|
)
|
|
324
330
|
|
|
325
|
-
|
|
331
|
+
result = format_success(
|
|
326
332
|
{
|
|
327
333
|
"roles": role_info,
|
|
328
334
|
"total": len(roles),
|
|
@@ -330,7 +336,9 @@ class AgentsPlugin(PluginInterface):
|
|
|
330
336
|
)
|
|
331
337
|
|
|
332
338
|
except Exception as e:
|
|
333
|
-
|
|
339
|
+
result = format_error("ROLE_LIST_ERROR", str(e), retry=False)
|
|
340
|
+
|
|
341
|
+
typer.echo(result)
|
|
334
342
|
|
|
335
343
|
# Register agents app to main CLI
|
|
336
344
|
app.add_typer(agents_app)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: better-notion
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: A high-level Python SDK for the Notion API with developer experience in mind. Now with AI agents workflow management system!
|
|
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
|
|
@@ -105,8 +105,8 @@ better_notion/plugins/__init__.py,sha256=ZbaLy0BS4_zWfEyCW0Xv9EhK427cEhrKIap_8DR
|
|
|
105
105
|
better_notion/plugins/base.py,sha256=G2asUEvQXWIiyWvNtB1hgg9JXZhDayi7Jvfq15FeQWY,5255
|
|
106
106
|
better_notion/plugins/loader.py,sha256=ewCG_Thv7Khh8IsHLB17U1Hi0cWpq0YG3w37hrpbeRk,7710
|
|
107
107
|
better_notion/plugins/state.py,sha256=jH_tZWvC35hqLO4qwl2Kwq9ziWVavwCEUcCqy3s5wMY,3780
|
|
108
|
-
better_notion/plugins/official/__init__.py,sha256=
|
|
109
|
-
better_notion/plugins/official/agents.py,sha256=
|
|
108
|
+
better_notion/plugins/official/__init__.py,sha256=rPg5vdk1cEANVstMPzxcWmImtsOpdSR40JSml7h1uUk,426
|
|
109
|
+
better_notion/plugins/official/agents.py,sha256=8Cwx5fkNMaYc1bavS48jyvaXCTMYWgCaIMZH0y9YSbM,12696
|
|
110
110
|
better_notion/plugins/official/productivity.py,sha256=_-whP4pYA4HufE1aUFbIdhrjU-O9njI7xUO_Id2M1J8,8726
|
|
111
111
|
better_notion/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
112
112
|
better_notion/utils/helpers.py,sha256=HgFuUQlG_HzBOB0z2GA9RxPLoXgwRc0DIxa9Fg6C-Jk,2337
|
|
@@ -119,8 +119,8 @@ better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWC
|
|
|
119
119
|
better_notion/utils/agents/schemas.py,sha256=e_lpGGO12FXtfqFyI91edj9xc5RUtuA6pU7Sk6ip7xg,21784
|
|
120
120
|
better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
|
|
121
121
|
better_notion/utils/agents/workspace.py,sha256=T8mP_DNIWhI1-k6UydJINsEJ6kQxQ6_Pa44ul58k088,12370
|
|
122
|
-
better_notion-1.0.
|
|
123
|
-
better_notion-1.0.
|
|
124
|
-
better_notion-1.0.
|
|
125
|
-
better_notion-1.0.
|
|
126
|
-
better_notion-1.0.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|