better-notion 1.3.0__py3-none-any.whl → 1.4.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.
@@ -343,72 +343,258 @@ class AgentsPlugin(CombinedPluginInterface):
343
343
  except Exception as e:
344
344
  return format_error("ROLE_LIST_ERROR", str(e), retry=False)
345
345
 
346
- # Register agents app to main CLI
346
+ # Register the agents app to main CLI FIRST
347
347
  app.add_typer(agents_app)
348
348
 
349
- # Import and register CRUD commands as sub-commands of agents
349
+ # Import CLI functions for CRUD commands
350
350
  from better_notion.plugins.official import agents_cli
351
351
 
352
352
  # Organizations commands (under agents)
353
353
  orgs_app = typer.Typer(name="orgs", help="Organizations management commands")
354
- orgs_app.command("list")(agents_cli.orgs_list)
355
- orgs_app.command("get")(agents_cli.orgs_get)
356
- orgs_app.command("create")(agents_cli.orgs_create)
354
+
355
+ @orgs_app.command("list")
356
+ def orgs_list_cmd():
357
+ typer.echo(agents_cli.orgs_list())
358
+
359
+ @orgs_app.command("get")
360
+ def orgs_get_cmd(org_id: str):
361
+ typer.echo(agents_cli.orgs_get(org_id))
362
+
363
+ @orgs_app.command("create")
364
+ def orgs_create_cmd(
365
+ name: str = typer.Option(..., "--name", "-n"),
366
+ slug: str = typer.Option(..., "--slug"),
367
+ description: str = typer.Option("", "--description", "-d"),
368
+ repository_url: str = typer.Option("", "--repository-url"),
369
+ status: str = typer.Option("Active", "--status"),
370
+ ):
371
+ typer.echo(agents_cli.orgs_create(name, slug, description, repository_url, status))
372
+
357
373
  agents_app.add_typer(orgs_app)
358
374
 
359
375
  # Projects commands (under agents)
360
376
  projects_app = typer.Typer(name="projects", help="Projects management commands")
361
- projects_app.command("list")(projects_list_with_cli := lambda **kwargs: agents_cli.projects_list(**kwargs))
362
- projects_app.command("get")(projects_get_with_cli := lambda project_id: agents_cli.projects_get(project_id))
363
- projects_app.command("create")(lambda **kwargs: agents_cli.projects_create(**kwargs))
377
+
378
+ @projects_app.command("list")
379
+ def projects_list_cmd(org_id: str = typer.Option(None, "--org-id", "-o")):
380
+ typer.echo(agents_cli.projects_list(org_id))
381
+
382
+ @projects_app.command("get")
383
+ def projects_get_cmd(project_id: str):
384
+ typer.echo(agents_cli.projects_get(project_id))
385
+
386
+ @projects_app.command("create")
387
+ def projects_create_cmd(
388
+ name: str = typer.Option(..., "--name", "-n"),
389
+ org_id: str = typer.Option(..., "--org-id", "-o"),
390
+ slug: str = typer.Option("", "--slug"),
391
+ description: str = typer.Option("", "--description", "-d"),
392
+ repository: str = typer.Option("", "--repository"),
393
+ status: str = typer.Option("Active", "--status"),
394
+ tech_stack: str = typer.Option("", "--tech-stack"),
395
+ ):
396
+ typer.echo(agents_cli.projects_create(name, org_id, slug, description, repository, status, tech_stack))
397
+
364
398
  agents_app.add_typer(projects_app)
365
399
 
366
400
  # Versions commands (under agents)
367
401
  versions_app = typer.Typer(name="versions", help="Versions management commands")
368
- versions_app.command("list")(lambda **kwargs: agents_cli.versions_list(**kwargs))
369
- versions_app.command("get")(lambda version_id: agents_cli.versions_get(version_id))
370
- versions_app.command("create")(lambda **kwargs: agents_cli.versions_create(**kwargs))
402
+
403
+ @versions_app.command("list")
404
+ def versions_list_cmd(project_id: str = typer.Option(None, "--project-id", "-p")):
405
+ typer.echo(agents_cli.versions_list(project_id))
406
+
407
+ @versions_app.command("get")
408
+ def versions_get_cmd(version_id: str):
409
+ typer.echo(agents_cli.versions_get(version_id))
410
+
411
+ @versions_app.command("create")
412
+ def versions_create_cmd(
413
+ name: str = typer.Option(..., "--name", "-n"),
414
+ project_id: str = typer.Option(..., "--project-id", "-p"),
415
+ status: str = typer.Option("Planning", "--status"),
416
+ type_: str = typer.Option("Minor", "--type", "-t"),
417
+ branch_name: str = typer.Option("", "--branch-name"),
418
+ ):
419
+ typer.echo(agents_cli.versions_create(name, project_id, status, type_, branch_name))
420
+
371
421
  agents_app.add_typer(versions_app)
372
422
 
373
423
  # Tasks commands (under agents)
374
424
  tasks_app = typer.Typer(name="tasks", help="Tasks management commands")
375
- tasks_app.command("list")(lambda **kwargs: agents_cli.tasks_list(**kwargs))
376
- tasks_app.command("get")(lambda task_id: agents_cli.tasks_get(task_id))
377
- tasks_app.command("create")(lambda **kwargs: agents_cli.tasks_create(**kwargs))
378
- tasks_app.command("next")(lambda **kwargs: agents_cli.tasks_next(**kwargs))
379
- tasks_app.command("claim")(lambda task_id: agents_cli.tasks_claim(task_id))
380
- tasks_app.command("start")(lambda task_id: agents_cli.tasks_start(task_id))
381
- tasks_app.command("complete")(lambda **kwargs: agents_cli.tasks_complete(**kwargs))
382
- tasks_app.command("can-start")(lambda task_id: agents_cli.tasks_can_start(task_id))
425
+
426
+ @tasks_app.command("list")
427
+ def tasks_list_cmd(
428
+ version_id: str = typer.Option(None, "--version-id", "-v"),
429
+ status: str = typer.Option(None, "--status", "-s"),
430
+ ):
431
+ typer.echo(agents_cli.tasks_list(version_id, status))
432
+
433
+ @tasks_app.command("get")
434
+ def tasks_get_cmd(task_id: str):
435
+ typer.echo(agents_cli.tasks_get(task_id))
436
+
437
+ @tasks_app.command("create")
438
+ def tasks_create_cmd(
439
+ title: str = typer.Option(..., "--title", "-t"),
440
+ version_id: str = typer.Option(..., "--version-id", "-v"),
441
+ type_: str = typer.Option("New Feature", "--type"),
442
+ priority: str = typer.Option("Medium", "--priority"),
443
+ estimated_hours: float = typer.Option(0, "--estimated-hours"),
444
+ ):
445
+ typer.echo(agents_cli.tasks_create(title, version_id, type_, priority, estimated_hours))
446
+
447
+ @tasks_app.command("next")
448
+ def tasks_next_cmd(project_id: str = typer.Option(None, "--project-id", "-p")):
449
+ typer.echo(agents_cli.tasks_next(project_id))
450
+
451
+ @tasks_app.command("claim")
452
+ def tasks_claim_cmd(task_id: str):
453
+ typer.echo(agents_cli.tasks_claim(task_id))
454
+
455
+ @tasks_app.command("start")
456
+ def tasks_start_cmd(task_id: str):
457
+ typer.echo(agents_cli.tasks_start(task_id))
458
+
459
+ @tasks_app.command("complete")
460
+ def tasks_complete_cmd(
461
+ task_id: str,
462
+ actual_hours: float = typer.Option(0, "--actual-hours"),
463
+ ):
464
+ typer.echo(agents_cli.tasks_complete(task_id, actual_hours))
465
+
466
+ @tasks_app.command("can-start")
467
+ def tasks_can_start_cmd(task_id: str):
468
+ typer.echo(agents_cli.tasks_can_start(task_id))
469
+
383
470
  agents_app.add_typer(tasks_app)
384
471
 
385
472
  # Ideas commands (under agents)
386
473
  ideas_app = typer.Typer(name="ideas", help="Ideas management commands")
387
- ideas_app.command("list")(lambda **kwargs: agents_cli.ideas_list(**kwargs))
388
- ideas_app.command("get")(lambda idea_id: agents_cli.ideas_get(idea_id))
389
- ideas_app.command("create")(lambda **kwargs: agents_cli.ideas_create(**kwargs))
390
- ideas_app.command("review")(lambda count: agents_cli.ideas_review(count))
391
- ideas_app.command("accept")(lambda idea_id: agents_cli.ideas_accept(idea_id))
392
- ideas_app.command("reject")(lambda idea_id, reason: agents_cli.ideas_reject(idea_id, reason))
474
+
475
+ @ideas_app.command("list")
476
+ def ideas_list_cmd(
477
+ project_id: str = typer.Option(None, "--project-id", "-p"),
478
+ status: str = typer.Option(None, "--status", "-s"),
479
+ ):
480
+ typer.echo(agents_cli.ideas_list(project_id, status))
481
+
482
+ @ideas_app.command("get")
483
+ def ideas_get_cmd(idea_id: str):
484
+ typer.echo(agents_cli.ideas_get(idea_id))
485
+
486
+ @ideas_app.command("create")
487
+ def ideas_create_cmd(
488
+ title: str = typer.Option(..., "--title", "-t"),
489
+ project_id: str = typer.Option(None, "--project-id", "-p"),
490
+ category: str = typer.Option("Feature", "--category"),
491
+ description: str = typer.Option("", "--description", "-d"),
492
+ proposed_solution: str = typer.Option("", "--proposed-solution"),
493
+ benefits: str = typer.Option("", "--benefits"),
494
+ effort_estimate: str = typer.Option("Medium", "--effort-estimate"),
495
+ context: str = typer.Option("", "--context"),
496
+ ):
497
+ typer.echo(agents_cli.ideas_create(title, project_id, category, description, proposed_solution, benefits, effort_estimate, context))
498
+
499
+ @ideas_app.command("review")
500
+ def ideas_review_cmd(count: int = typer.Option(10, "--count", "-c")):
501
+ typer.echo(agents_cli.ideas_review(count))
502
+
503
+ @ideas_app.command("accept")
504
+ def ideas_accept_cmd(idea_id: str):
505
+ typer.echo(agents_cli.ideas_accept(idea_id))
506
+
507
+ @ideas_app.command("reject")
508
+ def ideas_reject_cmd(
509
+ idea_id: str,
510
+ reason: str = typer.Option("", "--reason", "-r"),
511
+ ):
512
+ typer.echo(agents_cli.ideas_reject(idea_id, reason))
513
+
393
514
  agents_app.add_typer(ideas_app)
394
515
 
395
516
  # Work Issues commands (under agents)
396
517
  work_issues_app = typer.Typer(name="work-issues", help="Work Issues management commands")
397
- work_issues_app.command("list")(lambda **kwargs: agents_cli.work_issues_list(**kwargs))
398
- work_issues_app.command("get")(lambda issue_id: agents_cli.work_issues_get(issue_id))
399
- work_issues_app.command("create")(lambda **kwargs: agents_cli.work_issues_create(**kwargs))
400
- work_issues_app.command("resolve")(lambda issue_id, resolution: agents_cli.work_issues_resolve(issue_id, resolution))
401
- work_issues_app.command("blockers")(lambda project_id: agents_cli.work_issues_blockers(project_id))
518
+
519
+ @work_issues_app.command("list")
520
+ def work_issues_list_cmd(
521
+ project_id: str = typer.Option(None, "--project-id", "-p"),
522
+ status: str = typer.Option(None, "--status", "-s"),
523
+ ):
524
+ typer.echo(agents_cli.work_issues_list(project_id, status))
525
+
526
+ @work_issues_app.command("get")
527
+ def work_issues_get_cmd(issue_id: str):
528
+ typer.echo(agents_cli.work_issues_get(issue_id))
529
+
530
+ @work_issues_app.command("create")
531
+ def work_issues_create_cmd(
532
+ title: str = typer.Option(..., "--title", "-t"),
533
+ project_id: str = typer.Option(None, "--project-id", "-p"),
534
+ task_id: str = typer.Option(None, "--task-id"),
535
+ type_: str = typer.Option("Blocker", "--type"),
536
+ severity: str = typer.Option("Medium", "--severity"),
537
+ description: str = typer.Option("", "--description", "-d"),
538
+ context: str = typer.Option("", "--context"),
539
+ proposed_solution: str = typer.Option("", "--proposed-solution"),
540
+ ):
541
+ typer.echo(agents_cli.work_issues_create(title, project_id, task_id, type_, severity, description, context, proposed_solution))
542
+
543
+ @work_issues_app.command("resolve")
544
+ def work_issues_resolve_cmd(
545
+ issue_id: str,
546
+ resolution: str = typer.Option("", "--resolution", "-r"),
547
+ ):
548
+ typer.echo(agents_cli.work_issues_resolve(issue_id, resolution))
549
+
550
+ @work_issues_app.command("blockers")
551
+ def work_issues_blockers_cmd(project_id: str):
552
+ typer.echo(agents_cli.work_issues_blockers(project_id))
553
+
402
554
  agents_app.add_typer(work_issues_app)
403
555
 
404
556
  # Incidents commands (under agents)
405
557
  incidents_app = typer.Typer(name="incidents", help="Incidents management commands")
406
- incidents_app.command("list")(lambda **kwargs: agents_cli.incidents_list(**kwargs))
407
- incidents_app.command("get")(lambda incident_id: agents_cli.incidents_get(incident_id))
408
- incidents_app.command("create")(lambda **kwargs: agents_cli.incidents_create(**kwargs))
409
- incidents_app.command("resolve")(lambda incident_id, resolution: agents_cli.incidents_resolve(incident_id, resolution))
410
- incidents_app.command("mttr")(lambda **kwargs: agents_cli.incidents_mttr(**kwargs))
411
- incidents_app.command("sla-violations")(lambda: agents_cli.incidents_sla_violations())
558
+
559
+ @incidents_app.command("list")
560
+ def incidents_list_cmd(
561
+ project_id: str = typer.Option(None, "--project-id", "-p"),
562
+ severity: str = typer.Option(None, "--severity", "-s"),
563
+ ):
564
+ typer.echo(agents_cli.incidents_list(project_id, severity))
565
+
566
+ @incidents_app.command("get")
567
+ def incidents_get_cmd(incident_id: str):
568
+ typer.echo(agents_cli.incidents_get(incident_id))
569
+
570
+ @incidents_app.command("create")
571
+ def incidents_create_cmd(
572
+ title: str = typer.Option(..., "--title", "-t"),
573
+ project_id: str = typer.Option(None, "--project-id", "-p"),
574
+ affected_version_id: str = typer.Option(None, "--affected-version-id"),
575
+ severity: str = typer.Option("Medium", "--severity"),
576
+ type_: str = typer.Option("Bug", "--type"),
577
+ ):
578
+ typer.echo(agents_cli.incidents_create(title, project_id, affected_version_id, severity, type_))
579
+
580
+ @incidents_app.command("resolve")
581
+ def incidents_resolve_cmd(
582
+ incident_id: str,
583
+ resolution: str = typer.Option("", "--resolution", "-r"),
584
+ ):
585
+ typer.echo(agents_cli.incidents_resolve(incident_id, resolution))
586
+
587
+ @incidents_app.command("mttr")
588
+ def incidents_mttr_cmd(
589
+ project_id: str = typer.Option(None, "--project-id", "-p"),
590
+ within_days: int = typer.Option(30, "--within-days", "-d"),
591
+ ):
592
+ typer.echo(agents_cli.incidents_mttr(project_id, within_days))
593
+
594
+ @incidents_app.command("sla-violations")
595
+ def incidents_sla_violations_cmd():
596
+ typer.echo(agents_cli.incidents_sla_violations())
597
+
412
598
  agents_app.add_typer(incidents_app)
413
599
 
414
600
  def register_sdk_models(self) -> dict[str, type]:
@@ -37,6 +37,27 @@ def get_workspace_config() -> dict:
37
37
  return json.load(f)
38
38
 
39
39
 
40
+ def register_agents_sdk_plugin(client: NotionClient) -> None:
41
+ """Register the agents SDK plugin with a NotionClient instance.
42
+
43
+ This helper function registers all models, caches, and managers
44
+ for the agents workflow system.
45
+
46
+ Args:
47
+ client: NotionClient instance
48
+ """
49
+ from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
50
+
51
+ plugin = AgentsSDKPlugin()
52
+ plugin.initialize(client)
53
+
54
+ # Register models, caches, and managers
55
+ models = plugin.register_models()
56
+ caches = plugin.register_caches(client)
57
+ managers = plugin.register_managers(client)
58
+ client.register_sdk_plugin(models=models, caches=caches, managers=managers)
59
+
60
+
40
61
  # ===== ORGANIZATIONS =====
41
62
 
42
63
  def orgs_list() -> str:
@@ -54,7 +75,12 @@ def orgs_list() -> str:
54
75
  from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
55
76
  plugin = AgentsSDKPlugin()
56
77
  plugin.initialize(client)
57
- client.register_sdk_plugin(plugin)
78
+
79
+ # Register models, caches, and managers
80
+ models = plugin.register_models()
81
+ caches = plugin.register_caches(client)
82
+ managers = plugin.register_managers(client)
83
+ client.register_sdk_plugin(models=models, caches=caches, managers=managers)
58
84
 
59
85
  # Get manager
60
86
  manager = client.plugin_manager("organizations")
@@ -94,10 +120,7 @@ def orgs_get(org_id: str) -> str:
94
120
  client = get_client()
95
121
 
96
122
  # Register SDK plugin
97
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
98
- plugin = AgentsSDKPlugin()
99
- plugin.initialize(client)
100
- client.register_sdk_plugin(plugin)
123
+ register_agents_sdk_plugin(client)
101
124
 
102
125
  # Get organization
103
126
  manager = client.plugin_manager("organizations")
@@ -143,10 +166,7 @@ def orgs_create(
143
166
  client = get_client()
144
167
 
145
168
  # Register SDK plugin
146
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
147
- plugin = AgentsSDKPlugin()
148
- plugin.initialize(client)
149
- client.register_sdk_plugin(plugin)
169
+ register_agents_sdk_plugin(client)
150
170
 
151
171
  # Create organization
152
172
  manager = client.plugin_manager("organizations")
@@ -191,10 +211,7 @@ def projects_list(
191
211
  client = get_client()
192
212
 
193
213
  # Register SDK plugin
194
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
195
- plugin = AgentsSDKPlugin()
196
- plugin.initialize(client)
197
- client.register_sdk_plugin(plugin)
214
+ register_agents_sdk_plugin(client)
198
215
 
199
216
  # Get manager
200
217
  manager = client.plugin_manager("projects")
@@ -236,10 +253,7 @@ def projects_get(project_id: str) -> str:
236
253
  client = get_client()
237
254
 
238
255
  # Register SDK plugin
239
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
240
- plugin = AgentsSDKPlugin()
241
- plugin.initialize(client)
242
- client.register_sdk_plugin(plugin)
256
+ register_agents_sdk_plugin(client)
243
257
 
244
258
  # Get project
245
259
  manager = client.plugin_manager("projects")
@@ -294,10 +308,7 @@ def projects_create(
294
308
  client = get_client()
295
309
 
296
310
  # Register SDK plugin
297
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
298
- plugin = AgentsSDKPlugin()
299
- plugin.initialize(client)
300
- client.register_sdk_plugin(plugin)
311
+ register_agents_sdk_plugin(client)
301
312
 
302
313
  # Parse tech stack
303
314
  tech_stack_list = tech_stack.split(",") if tech_stack else None
@@ -348,10 +359,7 @@ def versions_list(
348
359
  client = get_client()
349
360
 
350
361
  # Register SDK plugin
351
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
352
- plugin = AgentsSDKPlugin()
353
- plugin.initialize(client)
354
- client.register_sdk_plugin(plugin)
362
+ register_agents_sdk_plugin(client)
355
363
 
356
364
  # Get manager
357
365
  manager = client.plugin_manager("versions")
@@ -394,10 +402,7 @@ def versions_get(version_id: str) -> str:
394
402
  client = get_client()
395
403
 
396
404
  # Register SDK plugin
397
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
398
- plugin = AgentsSDKPlugin()
399
- plugin.initialize(client)
400
- client.register_sdk_plugin(plugin)
405
+ register_agents_sdk_plugin(client)
401
406
 
402
407
  # Get version
403
408
  manager = client.plugin_manager("versions")
@@ -446,10 +451,7 @@ def versions_create(
446
451
  client = get_client()
447
452
 
448
453
  # Register SDK plugin
449
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
450
- plugin = AgentsSDKPlugin()
451
- plugin.initialize(client)
452
- client.register_sdk_plugin(plugin)
454
+ register_agents_sdk_plugin(client)
453
455
 
454
456
  # Create version
455
457
  manager = client.plugin_manager("versions")
@@ -496,10 +498,7 @@ def tasks_list(
496
498
  client = get_client()
497
499
 
498
500
  # Register SDK plugin
499
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
500
- plugin = AgentsSDKPlugin()
501
- plugin.initialize(client)
502
- client.register_sdk_plugin(plugin)
501
+ register_agents_sdk_plugin(client)
503
502
 
504
503
  # Get manager
505
504
  manager = client.plugin_manager("tasks")
@@ -542,10 +541,7 @@ def tasks_get(task_id: str) -> str:
542
541
  client = get_client()
543
542
 
544
543
  # Register SDK plugin
545
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
546
- plugin = AgentsSDKPlugin()
547
- plugin.initialize(client)
548
- client.register_sdk_plugin(plugin)
544
+ register_agents_sdk_plugin(client)
549
545
 
550
546
  # Get task
551
547
  manager = client.plugin_manager("tasks")
@@ -598,10 +594,7 @@ def tasks_create(
598
594
  client = get_client()
599
595
 
600
596
  # Register SDK plugin
601
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
602
- plugin = AgentsSDKPlugin()
603
- plugin.initialize(client)
604
- client.register_sdk_plugin(plugin)
597
+ register_agents_sdk_plugin(client)
605
598
 
606
599
  # Parse dependencies
607
600
  dependency_ids = dependencies.split(",") if dependencies else None
@@ -655,10 +648,7 @@ def tasks_next(
655
648
  client = get_client()
656
649
 
657
650
  # Register SDK plugin
658
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
659
- plugin = AgentsSDKPlugin()
660
- plugin.initialize(client)
661
- client.register_sdk_plugin(plugin)
651
+ register_agents_sdk_plugin(client)
662
652
 
663
653
  # Get manager
664
654
  manager = client.plugin_manager("tasks")
@@ -703,10 +693,7 @@ def tasks_claim(task_id: str) -> str:
703
693
  client = get_client()
704
694
 
705
695
  # Register SDK plugin
706
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
707
- plugin = AgentsSDKPlugin()
708
- plugin.initialize(client)
709
- client.register_sdk_plugin(plugin)
696
+ register_agents_sdk_plugin(client)
710
697
 
711
698
  # Get and claim task
712
699
  manager = client.plugin_manager("tasks")
@@ -745,10 +732,7 @@ def tasks_start(task_id: str) -> str:
745
732
  client = get_client()
746
733
 
747
734
  # Register SDK plugin
748
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
749
- plugin = AgentsSDKPlugin()
750
- plugin.initialize(client)
751
- client.register_sdk_plugin(plugin)
735
+ register_agents_sdk_plugin(client)
752
736
 
753
737
  # Get and start task
754
738
  manager = client.plugin_manager("tasks")
@@ -800,10 +784,7 @@ def tasks_complete(
800
784
  client = get_client()
801
785
 
802
786
  # Register SDK plugin
803
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
804
- plugin = AgentsSDKPlugin()
805
- plugin.initialize(client)
806
- client.register_sdk_plugin(plugin)
787
+ register_agents_sdk_plugin(client)
807
788
 
808
789
  # Get and complete task
809
790
  manager = client.plugin_manager("tasks")
@@ -843,10 +824,7 @@ def tasks_can_start(task_id: str) -> str:
843
824
  client = get_client()
844
825
 
845
826
  # Register SDK plugin
846
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
847
- plugin = AgentsSDKPlugin()
848
- plugin.initialize(client)
849
- client.register_sdk_plugin(plugin)
827
+ register_agents_sdk_plugin(client)
850
828
 
851
829
  # Get task and check
852
830
  manager = client.plugin_manager("tasks")
@@ -907,10 +885,7 @@ def ideas_list(
907
885
  client = get_client()
908
886
 
909
887
  # Register SDK plugin
910
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
911
- plugin = AgentsSDKPlugin()
912
- plugin.initialize(client)
913
- client.register_sdk_plugin(plugin)
888
+ register_agents_sdk_plugin(client)
914
889
 
915
890
  # Get manager and list
916
891
  manager = client.plugin_manager("ideas")
@@ -956,10 +931,7 @@ def ideas_get(idea_id: str) -> str:
956
931
  client = get_client()
957
932
 
958
933
  # Register SDK plugin
959
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
960
- plugin = AgentsSDKPlugin()
961
- plugin.initialize(client)
962
- client.register_sdk_plugin(plugin)
934
+ register_agents_sdk_plugin(client)
963
935
 
964
936
  # Get idea
965
937
  from better_notion.plugins.official.agents_sdk.models import Idea
@@ -1013,10 +985,7 @@ def ideas_create(
1013
985
  client = get_client()
1014
986
 
1015
987
  # Register SDK plugin
1016
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1017
- plugin = AgentsSDKPlugin()
1018
- plugin.initialize(client)
1019
- client.register_sdk_plugin(plugin)
988
+ register_agents_sdk_plugin(client)
1020
989
 
1021
990
  # Get workspace config
1022
991
  workspace_config = get_workspace_config()
@@ -1088,10 +1057,7 @@ def ideas_review(count: int = 10) -> str:
1088
1057
  client = get_client()
1089
1058
 
1090
1059
  # Register SDK plugin
1091
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1092
- plugin = AgentsSDKPlugin()
1093
- plugin.initialize(client)
1094
- client.register_sdk_plugin(plugin)
1060
+ register_agents_sdk_plugin(client)
1095
1061
 
1096
1062
  # Get manager and review batch
1097
1063
  manager = client.plugin_manager("ideas")
@@ -1132,10 +1098,7 @@ def ideas_accept(idea_id: str) -> str:
1132
1098
  client = get_client()
1133
1099
 
1134
1100
  # Register SDK plugin
1135
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1136
- plugin = AgentsSDKPlugin()
1137
- plugin.initialize(client)
1138
- client.register_sdk_plugin(plugin)
1101
+ register_agents_sdk_plugin(client)
1139
1102
 
1140
1103
  # Get idea and accept
1141
1104
  from better_notion.plugins.official.agents_sdk.models import Idea
@@ -1170,10 +1133,7 @@ def ideas_reject(idea_id: str, reason: str = "") -> str:
1170
1133
  client = get_client()
1171
1134
 
1172
1135
  # Register SDK plugin
1173
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1174
- plugin = AgentsSDKPlugin()
1175
- plugin.initialize(client)
1176
- client.register_sdk_plugin(plugin)
1136
+ register_agents_sdk_plugin(client)
1177
1137
 
1178
1138
  # Get idea and reject
1179
1139
  from better_notion.plugins.official.agents_sdk.models import Idea
@@ -1220,10 +1180,7 @@ def work_issues_list(
1220
1180
  client = get_client()
1221
1181
 
1222
1182
  # Register SDK plugin
1223
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1224
- plugin = AgentsSDKPlugin()
1225
- plugin.initialize(client)
1226
- client.register_sdk_plugin(plugin)
1183
+ register_agents_sdk_plugin(client)
1227
1184
 
1228
1185
  # Get manager and list
1229
1186
  manager = client.plugin_manager("work_issues")
@@ -1270,10 +1227,7 @@ def work_issues_get(issue_id: str) -> str:
1270
1227
  client = get_client()
1271
1228
 
1272
1229
  # Register SDK plugin
1273
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1274
- plugin = AgentsSDKPlugin()
1275
- plugin.initialize(client)
1276
- client.register_sdk_plugin(plugin)
1230
+ register_agents_sdk_plugin(client)
1277
1231
 
1278
1232
  # Get issue
1279
1233
  from better_notion.plugins.official.agents_sdk.models import WorkIssue
@@ -1326,10 +1280,7 @@ def work_issues_create(
1326
1280
  client = get_client()
1327
1281
 
1328
1282
  # Register SDK plugin
1329
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1330
- plugin = AgentsSDKPlugin()
1331
- plugin.initialize(client)
1332
- client.register_sdk_plugin(plugin)
1283
+ register_agents_sdk_plugin(client)
1333
1284
 
1334
1285
  # Get workspace config
1335
1286
  workspace_config = get_workspace_config()
@@ -1396,10 +1347,7 @@ def work_issues_resolve(issue_id: str, resolution: str = "") -> str:
1396
1347
  client = get_client()
1397
1348
 
1398
1349
  # Register SDK plugin
1399
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1400
- plugin = AgentsSDKPlugin()
1401
- plugin.initialize(client)
1402
- client.register_sdk_plugin(plugin)
1350
+ register_agents_sdk_plugin(client)
1403
1351
 
1404
1352
  # Get issue and resolve
1405
1353
  from better_notion.plugins.official.agents_sdk.models import WorkIssue
@@ -1434,10 +1382,7 @@ def work_issues_blockers(project_id: str) -> str:
1434
1382
  client = get_client()
1435
1383
 
1436
1384
  # Register SDK plugin
1437
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1438
- plugin = AgentsSDKPlugin()
1439
- plugin.initialize(client)
1440
- client.register_sdk_plugin(plugin)
1385
+ register_agents_sdk_plugin(client)
1441
1386
 
1442
1387
  # Get manager and find blockers
1443
1388
  manager = client.plugin_manager("work_issues")
@@ -1488,10 +1433,7 @@ def incidents_list(
1488
1433
  client = get_client()
1489
1434
 
1490
1435
  # Register SDK plugin
1491
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1492
- plugin = AgentsSDKPlugin()
1493
- plugin.initialize(client)
1494
- client.register_sdk_plugin(plugin)
1436
+ register_agents_sdk_plugin(client)
1495
1437
 
1496
1438
  # Get manager and list
1497
1439
  manager = client.plugin_manager("incidents")
@@ -1537,10 +1479,7 @@ def incidents_get(incident_id: str) -> str:
1537
1479
  client = get_client()
1538
1480
 
1539
1481
  # Register SDK plugin
1540
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1541
- plugin = AgentsSDKPlugin()
1542
- plugin.initialize(client)
1543
- client.register_sdk_plugin(plugin)
1482
+ register_agents_sdk_plugin(client)
1544
1483
 
1545
1484
  # Get incident
1546
1485
  from better_notion.plugins.official.agents_sdk.models import Incident
@@ -1592,10 +1531,7 @@ def incidents_create(
1592
1531
  client = get_client()
1593
1532
 
1594
1533
  # Register SDK plugin
1595
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1596
- plugin = AgentsSDKPlugin()
1597
- plugin.initialize(client)
1598
- client.register_sdk_plugin(plugin)
1534
+ register_agents_sdk_plugin(client)
1599
1535
 
1600
1536
  # Get workspace config
1601
1537
  workspace_config = get_workspace_config()
@@ -1661,10 +1597,7 @@ def incidents_resolve(incident_id: str, resolution: str = "") -> str:
1661
1597
  client = get_client()
1662
1598
 
1663
1599
  # Register SDK plugin
1664
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1665
- plugin = AgentsSDKPlugin()
1666
- plugin.initialize(client)
1667
- client.register_sdk_plugin(plugin)
1600
+ register_agents_sdk_plugin(client)
1668
1601
 
1669
1602
  # Get incident and resolve
1670
1603
  from better_notion.plugins.official.agents_sdk.models import Incident
@@ -1700,10 +1633,7 @@ def incidents_mttr(project_id: Optional[str] = None, within_days: int = 30) -> s
1700
1633
  client = get_client()
1701
1634
 
1702
1635
  # Register SDK plugin
1703
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1704
- plugin = AgentsSDKPlugin()
1705
- plugin.initialize(client)
1706
- client.register_sdk_plugin(plugin)
1636
+ register_agents_sdk_plugin(client)
1707
1637
 
1708
1638
  # Get manager and calculate MTTR
1709
1639
  manager = client.plugin_manager("incidents")
@@ -1738,10 +1668,7 @@ def incidents_sla_violations() -> str:
1738
1668
  client = get_client()
1739
1669
 
1740
1670
  # Register SDK plugin
1741
- from better_notion.plugins.official.agents_sdk.plugin import AgentsSDKPlugin
1742
- plugin = AgentsSDKPlugin()
1743
- plugin.initialize(client)
1744
- client.register_sdk_plugin(plugin)
1671
+ register_agents_sdk_plugin(client)
1745
1672
 
1746
1673
  # Get manager and find violations
1747
1674
  manager = client.plugin_manager("incidents")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: better-notion
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
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
@@ -107,8 +107,8 @@ better_notion/plugins/base.py,sha256=3h9jOZzS--UqmVW3RREtcQ2h1GTWWPUryTencsJKhTM
107
107
  better_notion/plugins/loader.py,sha256=zCWsMdJyvZs1IHFm0zjEiqm_l_5jB1Uw4x30Kq8rLS4,9527
108
108
  better_notion/plugins/state.py,sha256=jH_tZWvC35hqLO4qwl2Kwq9ziWVavwCEUcCqy3s5wMY,3780
109
109
  better_notion/plugins/official/__init__.py,sha256=rPg5vdk1cEANVstMPzxcWmImtsOpdSR40JSml7h1uUk,426
110
- better_notion/plugins/official/agents.py,sha256=Co-P4unrxNkbm_wYcUHor6WC_neoyHKSkeFyPbEAyVw,19488
111
- better_notion/plugins/official/agents_cli.py,sha256=rFF3cIXXzxOnvd5dnaR1CESvs1mwmR1hBv1lVADcIu8,56317
110
+ better_notion/plugins/official/agents.py,sha256=UF9zn7DNBX-3_bmpjrHhbNd4dZXQIGa5ljhCC71SRcA,25939
111
+ better_notion/plugins/official/agents_cli.py,sha256=v2yem60ER6EVRt9u1f5xF3MOExQeQ4lGqGCQ6z7pV18,51706
112
112
  better_notion/plugins/official/productivity.py,sha256=_-whP4pYA4HufE1aUFbIdhrjU-O9njI7xUO_Id2M1J8,8726
113
113
  better_notion/plugins/official/agents_sdk/__init__.py,sha256=luQBzZLsJ7fC5U0jFu8dfzMviiXj2SBZXcTohM53wkQ,725
114
114
  better_notion/plugins/official/agents_sdk/managers.py,sha256=dkpGozJhKXvz8rFqc2tAWyL6MeVzFVcjGMC0Ed2Z1dQ,29813
@@ -125,8 +125,8 @@ better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWC
125
125
  better_notion/utils/agents/schemas.py,sha256=e_lpGGO12FXtfqFyI91edj9xc5RUtuA6pU7Sk6ip7xg,21784
126
126
  better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
127
127
  better_notion/utils/agents/workspace.py,sha256=T8mP_DNIWhI1-k6UydJINsEJ6kQxQ6_Pa44ul58k088,12370
128
- better_notion-1.3.0.dist-info/METADATA,sha256=MP9kADRDZFuIjs6PQ4EHuTK8HfNNMYehK8MC9JckJKg,11096
129
- better_notion-1.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
130
- better_notion-1.3.0.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
131
- better_notion-1.3.0.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
132
- better_notion-1.3.0.dist-info/RECORD,,
128
+ better_notion-1.4.0.dist-info/METADATA,sha256=WXldrn_zOf9rVjRSQJmWLLr_ixIdAOtZxGW2BhWNmZc,11096
129
+ better_notion-1.4.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
130
+ better_notion-1.4.0.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
131
+ better_notion-1.4.0.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
132
+ better_notion-1.4.0.dist-info/RECORD,,