projectdavid-orm 1.9.1__tar.gz → 1.10.0__tar.gz

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.
Files changed (26) hide show
  1. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/CHANGELOG.md +7 -0
  2. {projectdavid_orm-1.9.1/src/projectdavid_orm.egg-info → projectdavid_orm-1.10.0}/PKG-INFO +1 -1
  3. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/pyproject.toml +1 -1
  4. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/projectdavid_orm/models.py +135 -0
  5. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0/src/projectdavid_orm.egg-info}/PKG-INFO +1 -1
  6. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/LICENSE +0 -0
  7. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/MANIFEST.in +0 -0
  8. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/README.md +0 -0
  9. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/setup.cfg +0 -0
  10. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_common.egg-info/PKG-INFO +0 -0
  11. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_common.egg-info/SOURCES.txt +0 -0
  12. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_common.egg-info/dependency_links.txt +0 -0
  13. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_common.egg-info/entry_points.txt +0 -0
  14. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_common.egg-info/requires.txt +0 -0
  15. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_common.egg-info/top_level.txt +0 -0
  16. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/__init__.py +0 -0
  17. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/constants/__init__.py +0 -0
  18. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/ormInterface.py +0 -0
  19. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/projectdavid_orm/__init__.py +0 -0
  20. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/projectdavid_orm/base.py +0 -0
  21. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm/utilities/__init__.py +0 -0
  22. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm.egg-info/SOURCES.txt +0 -0
  23. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm.egg-info/dependency_links.txt +0 -0
  24. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm.egg-info/requires.txt +0 -0
  25. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/src/projectdavid_orm.egg-info/top_level.txt +0 -0
  26. {projectdavid_orm-1.9.1 → projectdavid_orm-1.10.0}/tests/test_clients.py +0 -0
@@ -1,3 +1,10 @@
1
+ # [1.10.0](https://github.com/project-david-ai/projectdavid-orm/compare/v1.9.1...v1.10.0) (2026-09-26)
2
+
3
+
4
+ ### Features
5
+
6
+ * add MCP registration persistence models ([61867c1](https://github.com/project-david-ai/projectdavid-orm/commit/61867c139ed1fa2ca1de3d263a5a77dabf0242dd))
7
+
1
8
  ## [1.9.1](https://github.com/project-david-ai/projectdavid-orm/compare/v1.9.0...v1.9.1) (2026-08-27)
2
9
 
3
10
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid-orm
3
- Version: 1.9.1
3
+ Version: 1.10.0
4
4
  Summary: Shared SQLAlchemy ORM models for ProjectDavid services
5
5
  Author-email: "Francis N." <engineering@projectdavid.co.uk>
6
6
  License: PolyForm Noncommercial License 1.0.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "projectdavid-orm"
7
- version = "1.9.1"
7
+ version = "1.10.0"
8
8
  description = "Shared SQLAlchemy ORM models for ProjectDavid services"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -180,6 +180,13 @@ class User(Base):
180
180
 
181
181
  audit_logs = relationship("AuditLog", back_populates="user", lazy="dynamic")
182
182
 
183
+ mcp_server_registrations = relationship(
184
+ "McpServerRegistration",
185
+ back_populates="owner",
186
+ cascade="all, delete-orphan",
187
+ lazy="select",
188
+ )
189
+
183
190
  __table_args__ = (
184
191
  UniqueConstraint(
185
192
  "oauth_provider", "provider_user_id", name="uq_user_oauth_provider_id"
@@ -489,6 +496,134 @@ class Assistant(Base):
489
496
  lazy="select",
490
497
  )
491
498
 
499
+ mcp_tools = relationship(
500
+ "AssistantMcpTool",
501
+ back_populates="assistant",
502
+ cascade="all, delete-orphan",
503
+ lazy="select",
504
+ )
505
+
506
+
507
+ class McpServerRegistration(Base):
508
+ """A user-owned remote MCP server registration.
509
+
510
+ Credentials are intentionally absent. MCP-5A supports unauthenticated
511
+ Streamable HTTP registrations only until Project David has a dedicated
512
+ reversible secret-reference facility.
513
+ """
514
+
515
+ __tablename__ = "mcp_server_registrations"
516
+
517
+ id = Column(String(64), primary_key=True, index=True)
518
+
519
+ owner_id = Column(
520
+ String(64),
521
+ ForeignKey("users.id", ondelete="CASCADE"),
522
+ nullable=False,
523
+ index=True,
524
+ )
525
+
526
+ name = Column(String(128), nullable=False)
527
+
528
+ url = Column(Text, nullable=False)
529
+ normalized_url = Column(Text, nullable=False)
530
+
531
+ identity_key = Column(
532
+ String(64),
533
+ nullable=False,
534
+ comment=(
535
+ "Stable SHA-256 identity derived from transport + normalized URL. "
536
+ "Combined with owner_id to make registration idempotent."
537
+ ),
538
+ )
539
+
540
+ transport = Column(
541
+ String(32),
542
+ nullable=False,
543
+ default="streamable_http",
544
+ server_default="streamable_http",
545
+ )
546
+
547
+ timeout_seconds = Column(Float, nullable=False, default=30.0, server_default="30")
548
+
549
+ enabled = Column(Boolean, nullable=False, default=True, server_default="1")
550
+
551
+ created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
552
+ updated_at = Column(
553
+ DateTime,
554
+ nullable=False,
555
+ default=datetime.utcnow,
556
+ onupdate=datetime.utcnow,
557
+ )
558
+
559
+ owner = relationship("User", back_populates="mcp_server_registrations")
560
+
561
+ assistant_tools = relationship(
562
+ "AssistantMcpTool",
563
+ back_populates="registration",
564
+ cascade="all, delete-orphan",
565
+ lazy="select",
566
+ )
567
+
568
+ __table_args__ = (
569
+ UniqueConstraint(
570
+ "owner_id",
571
+ "identity_key",
572
+ name="uq_mcp_registration_owner_identity",
573
+ ),
574
+ Index("idx_mcp_registration_owner_enabled", "owner_id", "enabled"),
575
+ )
576
+
577
+
578
+ class AssistantMcpTool(Base):
579
+ """Assistant-specific provenance for one discovered MCP tool."""
580
+
581
+ __tablename__ = "assistant_mcp_tools"
582
+
583
+ id = Column(String(64), primary_key=True, index=True)
584
+
585
+ assistant_id = Column(
586
+ String(64),
587
+ ForeignKey("assistants.id", ondelete="CASCADE"),
588
+ nullable=False,
589
+ index=True,
590
+ )
591
+
592
+ registration_id = Column(
593
+ String(64),
594
+ ForeignKey("mcp_server_registrations.id", ondelete="CASCADE"),
595
+ nullable=False,
596
+ index=True,
597
+ )
598
+
599
+ remote_name = Column(String(255), nullable=False)
600
+ canonical_id = Column(String(512), nullable=False)
601
+ provider_name = Column(String(64), nullable=False)
602
+
603
+ enabled = Column(Boolean, nullable=False, default=True, server_default="1")
604
+ created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
605
+
606
+ assistant = relationship("Assistant", back_populates="mcp_tools")
607
+ registration = relationship(
608
+ "McpServerRegistration",
609
+ back_populates="assistant_tools",
610
+ )
611
+
612
+ __table_args__ = (
613
+ UniqueConstraint(
614
+ "assistant_id",
615
+ "registration_id",
616
+ "remote_name",
617
+ name="uq_assistant_mcp_remote_tool",
618
+ ),
619
+ UniqueConstraint(
620
+ "assistant_id",
621
+ "provider_name",
622
+ name="uq_assistant_mcp_provider_name",
623
+ ),
624
+ Index("idx_assistant_mcp_registration", "registration_id"),
625
+ )
626
+
492
627
 
493
628
  class Action(Base):
494
629
  __tablename__ = "actions"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid-orm
3
- Version: 1.9.1
3
+ Version: 1.10.0
4
4
  Summary: Shared SQLAlchemy ORM models for ProjectDavid services
5
5
  Author-email: "Francis N." <engineering@projectdavid.co.uk>
6
6
  License: PolyForm Noncommercial License 1.0.0