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.
@@ -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
- return format_error(
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
- # 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
- )
180
-
181
- return 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
- )
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
- return format_error("INIT_PROJECT_ERROR", str(e), retry=False)
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
- return format_error(
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
- context = ProjectContext.from_current_directory()
233
-
234
- if not context:
235
- return format_error(
236
- "NO_PROJECT_CONTEXT",
237
- "No .notion file found. Are you in a project directory?",
238
- retry=False,
239
- )
240
-
241
- # Update role
242
- context.update_role(new_role, path=path or None)
243
-
244
- return format_success(
245
- {
246
- "message": f"Role updated to {new_role}",
247
- "previous_role": context.role,
248
- "new_role": new_role,
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
- return format_error("ROLE_UPDATE_ERROR", str(e), retry=False)
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
- return format_error(
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
- # Get role description
286
- description = RoleManager.get_role_description(context.role)
287
-
288
- return format_success(
289
- {
290
- "role": context.role,
291
- "description": description,
292
- "project": context.project_name,
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
- return format_error("ROLE_ERROR", str(e), retry=False)
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
- return format_success(
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
- return format_error("ROLE_LIST_ERROR", str(e), retry=False)
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.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=4c0kaPLOqUQ7vIISgCm4Y9TG306Vew5A8dfDrLsAGwc,327
109
- better_notion/plugins/official/agents.py,sha256=WyDR1335dt_aGXk2v-WgZJUYCijyAW-gYMDg1ZzA72Y,12220
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.0.dist-info/METADATA,sha256=okvm0q4eprZu0_TPkDb8UO7bd8HeJBiFlLRzwLDnV-0,11143
123
- better_notion-1.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
124
- better_notion-1.0.0.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
125
- better_notion-1.0.0.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
126
- better_notion-1.0.0.dist-info/RECORD,,
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,,