@synap-core/api-types 1.7.0 → 1.8.0

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.
@@ -56,6 +56,21 @@ export interface Context {
56
56
  socketIO?: any;
57
57
  workspaceId?: string | null;
58
58
  workspaceRole?: string | null;
59
+ /**
60
+ * Request source — "intelligence" when the request comes from the Intelligence Hub
61
+ * via API key auth. Set automatically by api-key-auth middleware; never set by humans.
62
+ */
63
+ source?: string | null;
64
+ /**
65
+ * Hard flag — true only when authenticated via a hub-protocol scoped API key.
66
+ * Cannot be spoofed by a human JWT session.
67
+ */
68
+ isHubProtocol?: boolean;
69
+ /**
70
+ * The message ID that triggered this hub-protocol request.
71
+ * When set, proposals created during this request are linked to this message.
72
+ */
73
+ sourceMessageId?: string | null;
59
74
  }
60
75
  /**
61
76
  * Users Table - Cache for Kratos Identity Data
@@ -569,11 +584,31 @@ export interface WorkspaceLayoutConfig {
569
584
  defaultView?: string;
570
585
  theme?: string;
571
586
  }
587
+ /**
588
+ * MCP server configuration — stored per workspace.
589
+ * Agents in this workspace will have access to tools from these servers.
590
+ */
591
+ export interface McpServerConfig {
592
+ /** Unique slug within the workspace, e.g. "playwright", "whatsapp" */
593
+ id: string;
594
+ /** Human-readable name shown in UI */
595
+ name: string;
596
+ /** Transport mechanism */
597
+ transport: "stdio" | "http";
598
+ command?: string;
599
+ args?: string[];
600
+ url?: string;
601
+ env?: Record<string, string>;
602
+ /** Set to false to disable without removing config. Default: true. */
603
+ enabled?: boolean;
604
+ }
572
605
  export interface WorkspaceSettings {
573
606
  defaultEntityTypes?: string[];
574
607
  theme?: string;
575
608
  aiEnabled?: boolean;
576
609
  allowExternalSharing?: boolean;
610
+ /** External MCP servers whose tools will be available to AI agents in this workspace */
611
+ mcpServers?: McpServerConfig[];
577
612
  layout?: WorkspaceLayoutConfig;
578
613
  mainWhiteboardId?: string;
579
614
  intelligenceServiceId?: string;
@@ -611,8 +646,23 @@ export interface WorkspaceSettings {
611
646
  /** Current provisioning status */
612
647
  provisioningStatus?: "pending" | "active" | "failed";
613
648
  aiGovernance?: {
614
- autoApprove?: boolean;
649
+ /**
650
+ * Whitelist of event keys that AI agents may execute WITHOUT a proposal.
651
+ * Everything else defaults to proposal-required.
652
+ *
653
+ * Format: "<subjectType>.<action>" or "<subjectType>.*" glob.
654
+ * Default (when field absent): ["search.*", "memory.recall", "entity.read", "document.read"]
655
+ *
656
+ * Examples:
657
+ * "entity.read" — agents can read entities without proposal
658
+ * "search.*" — all search operations bypass proposal
659
+ * "entity.create" — agents can create entities without proposal (high trust)
660
+ */
661
+ autoApproveFor?: string[];
662
+ /** @deprecated Use autoApproveFor instead. Kept for migration reference only. */
615
663
  requireReviewFor?: string[];
664
+ /** @deprecated Use autoApproveFor instead. */
665
+ autoApprove?: boolean;
616
666
  maxAgentsPerUser?: number;
617
667
  allowAgentCreation?: boolean;
618
668
  /** Who can approve AI proposals. Default: "owner_and_admins" */
@@ -995,8 +1045,9 @@ declare const propertyDefs: import("drizzle-orm/pg-core").PgTableWithColumns<{
995
1045
  }>;
996
1046
  export type PropertyDef = typeof propertyDefs.$inferSelect;
997
1047
  declare enum ProfileScope {
998
- SYSTEM = "system",// Available to all users
999
- WORKSPACE = "workspace",// Shared within workspace
1048
+ SYSTEM = "system",// Available to all users (pod-wide)
1049
+ SHARED = "shared",// Explicitly shared with specific workspaces via profile_workspace_access
1050
+ WORKSPACE = "workspace",// Owned by a single workspace
1000
1051
  USER = "user"
1001
1052
  }
1002
1053
  /**
@@ -1392,7 +1443,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1392
1443
  documentId?: string | undefined;
1393
1444
  content?: string | undefined;
1394
1445
  global?: boolean | undefined;
1395
- source?: "user" | "system" | "intelligence" | "ai" | undefined;
1446
+ source?: "user" | "system" | "intelligence" | "ai" | "agent" | undefined;
1396
1447
  reasoning?: string | undefined;
1397
1448
  agentUserId?: string | undefined;
1398
1449
  };
@@ -1489,6 +1540,48 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1489
1540
  };
1490
1541
  meta: object;
1491
1542
  }>;
1543
+ listMulti: import("@trpc/server").TRPCQueryProcedure<{
1544
+ input: {
1545
+ workspaceIds?: string[] | undefined;
1546
+ profileSlug?: string | undefined;
1547
+ includeGlobal?: boolean | undefined;
1548
+ limit?: number | undefined;
1549
+ };
1550
+ output: {
1551
+ entities: {
1552
+ id: string;
1553
+ userId: string;
1554
+ workspaceId: string | null;
1555
+ type: string;
1556
+ profileId: string | null;
1557
+ title: string | null;
1558
+ preview: string | null;
1559
+ documentId: string | null;
1560
+ properties: Record<string, unknown>;
1561
+ fileUrl: string | null;
1562
+ filePath: string | null;
1563
+ fileSize: number | null;
1564
+ fileType: string | null;
1565
+ checksum: string | null;
1566
+ version: number;
1567
+ createdAt: Date;
1568
+ updatedAt: Date;
1569
+ deletedAt: Date | null;
1570
+ }[];
1571
+ };
1572
+ meta: object;
1573
+ }>;
1574
+ listSavedUrls: import("@trpc/server").TRPCQueryProcedure<{
1575
+ input: void;
1576
+ output: {
1577
+ id: string;
1578
+ url: string;
1579
+ title: string;
1580
+ profileSlug: string;
1581
+ createdAt: string;
1582
+ }[];
1583
+ meta: object;
1584
+ }>;
1492
1585
  search: import("@trpc/server").TRPCQueryProcedure<{
1493
1586
  input: {
1494
1587
  query: string;
@@ -1547,7 +1640,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1547
1640
  description?: string | undefined;
1548
1641
  documentId?: string | null | undefined;
1549
1642
  properties?: Record<string, unknown> | undefined;
1550
- source?: "user" | "system" | "intelligence" | "ai" | undefined;
1643
+ source?: "user" | "system" | "intelligence" | "ai" | "agent" | undefined;
1551
1644
  reasoning?: string | undefined;
1552
1645
  agentUserId?: string | undefined;
1553
1646
  };
@@ -1565,7 +1658,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1565
1658
  delete: import("@trpc/server").TRPCMutationProcedure<{
1566
1659
  input: {
1567
1660
  id: string;
1568
- source?: "user" | "system" | "intelligence" | "ai" | undefined;
1661
+ source?: "user" | "system" | "intelligence" | "ai" | "agent" | undefined;
1569
1662
  reasoning?: string | undefined;
1570
1663
  agentUserId?: string | undefined;
1571
1664
  };
@@ -1663,6 +1756,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1663
1756
  threadId?: string | undefined;
1664
1757
  workspaceId?: string | undefined;
1665
1758
  agentType?: "code" | "action" | "meta" | "default" | "prompting" | "knowledge-search" | "writing" | "onboarding" | undefined;
1759
+ agentHandle?: string | undefined;
1760
+ parentChannelId?: string | undefined;
1666
1761
  };
1667
1762
  output: {
1668
1763
  threadId: string;
@@ -1721,7 +1816,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1721
1816
  }[];
1722
1817
  executionSummaries: {
1723
1818
  tool: string;
1724
- status: "error" | "skipped" | "success";
1819
+ status: "error" | "success" | "skipped";
1725
1820
  result?: unknown;
1726
1821
  error?: string | undefined;
1727
1822
  }[];
@@ -1784,6 +1879,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1784
1879
  workspaceId?: string | undefined;
1785
1880
  threadType?: "main" | "branch" | "ai_thread" | undefined;
1786
1881
  limit?: number | undefined;
1882
+ contextObjectId?: string | undefined;
1883
+ contextObjectType?: "entity" | "view" | "document" | undefined;
1787
1884
  };
1788
1885
  output: {
1789
1886
  threads: {
@@ -1904,10 +2001,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1904
2001
  contextItems: {
1905
2002
  workspaceId: string;
1906
2003
  userId: string;
2004
+ sourceMessageId: string | null;
1907
2005
  id: string;
1908
2006
  createdAt: Date;
1909
2007
  channelId: string;
1910
- sourceMessageId: string | null;
1911
2008
  objectType: ChannelContextObjectType;
1912
2009
  objectId: string;
1913
2010
  relationshipType: ChannelContextRelationshipType;
@@ -2032,10 +2129,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2032
2129
  items: {
2033
2130
  workspaceId: string;
2034
2131
  userId: string;
2132
+ sourceMessageId: string | null;
2035
2133
  id: string;
2036
2134
  createdAt: Date;
2037
2135
  channelId: string;
2038
- sourceMessageId: string | null;
2039
2136
  objectType: ChannelContextObjectType;
2040
2137
  objectId: string;
2041
2138
  relationshipType: ChannelContextRelationshipType;
@@ -2044,10 +2141,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2044
2141
  entities: {
2045
2142
  workspaceId: string;
2046
2143
  userId: string;
2144
+ sourceMessageId: string | null;
2047
2145
  id: string;
2048
2146
  createdAt: Date;
2049
2147
  channelId: string;
2050
- sourceMessageId: string | null;
2051
2148
  objectType: ChannelContextObjectType;
2052
2149
  objectId: string;
2053
2150
  relationshipType: ChannelContextRelationshipType;
@@ -2056,10 +2153,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2056
2153
  documents: {
2057
2154
  workspaceId: string;
2058
2155
  userId: string;
2156
+ sourceMessageId: string | null;
2059
2157
  id: string;
2060
2158
  createdAt: Date;
2061
2159
  channelId: string;
2062
- sourceMessageId: string | null;
2063
2160
  objectType: ChannelContextObjectType;
2064
2161
  objectId: string;
2065
2162
  relationshipType: ChannelContextRelationshipType;
@@ -2087,18 +2184,20 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2087
2184
  output: {
2088
2185
  proposals: {
2089
2186
  workspaceId: string;
2187
+ sourceMessageId: string | null;
2090
2188
  id: string;
2091
2189
  data: unknown;
2092
2190
  updatedAt: Date;
2093
2191
  createdAt: Date;
2094
- sourceMessageId: string | null;
2095
2192
  status: ProposalStatus;
2193
+ expiresAt: Date | null;
2096
2194
  createdBy: string | null;
2097
2195
  threadId: string | null;
2098
2196
  targetType: string;
2099
2197
  targetId: string;
2100
2198
  proposalType: string;
2101
2199
  commandRunId: string | null;
2200
+ agentUserId: string | null;
2102
2201
  reviewedBy: string | null;
2103
2202
  reviewedAt: Date | null;
2104
2203
  rejectionReason: string | null;
@@ -2474,7 +2573,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2474
2573
  }>;
2475
2574
  listUsers: import("@trpc/server").TRPCQueryProcedure<{
2476
2575
  input: {
2477
- type?: "all" | "human" | "agent" | undefined;
2576
+ type?: "agent" | "all" | "human" | undefined;
2478
2577
  limit?: number | undefined;
2479
2578
  offset?: number | undefined;
2480
2579
  };
@@ -3314,6 +3413,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3314
3413
  capabilities: string[];
3315
3414
  serviceId: string;
3316
3415
  webhookUrl: string;
3416
+ mcpEndpoint: string | null;
3317
3417
  apiKey: string;
3318
3418
  pricing: string | null;
3319
3419
  enabled: boolean;
@@ -3357,6 +3457,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3357
3457
  capabilities: string[];
3358
3458
  serviceId: string;
3359
3459
  webhookUrl: string;
3460
+ mcpEndpoint: string | null;
3360
3461
  pricing: string | null;
3361
3462
  enabled: boolean;
3362
3463
  lastHealthCheck: Date | null;
@@ -3382,6 +3483,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3382
3483
  description: string | null;
3383
3484
  version: string | null;
3384
3485
  webhookUrl: string;
3486
+ mcpEndpoint: string | null;
3385
3487
  apiKey: string;
3386
3488
  capabilities: string[];
3387
3489
  pricing: string | null;
@@ -3403,6 +3505,39 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3403
3505
  };
3404
3506
  meta: object;
3405
3507
  }>;
3508
+ rotateKey: import("@trpc/server").TRPCMutationProcedure<{
3509
+ input: {
3510
+ id: string;
3511
+ newApiKey: string;
3512
+ };
3513
+ output: {
3514
+ success: boolean;
3515
+ serviceId: string;
3516
+ };
3517
+ meta: object;
3518
+ }>;
3519
+ connectToWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3520
+ input: {
3521
+ serviceId: string;
3522
+ capability?: "chat" | "analysis" | undefined;
3523
+ };
3524
+ output: {
3525
+ success: boolean;
3526
+ workspaceId: string;
3527
+ serviceId: string;
3528
+ capability: string;
3529
+ };
3530
+ meta: object;
3531
+ }>;
3532
+ disconnectFromWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3533
+ input: {
3534
+ capability?: "chat" | "analysis" | undefined;
3535
+ };
3536
+ output: {
3537
+ success: boolean;
3538
+ };
3539
+ meta: object;
3540
+ }>;
3406
3541
  findByCapability: import("@trpc/server").TRPCQueryProcedure<{
3407
3542
  input: {
3408
3543
  capability: string;
@@ -3857,6 +3992,34 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3857
3992
  };
3858
3993
  meta: object;
3859
3994
  }>;
3995
+ checkHealth: import("@trpc/server").TRPCMutationProcedure<{
3996
+ input: {
3997
+ serviceId: string;
3998
+ };
3999
+ output: {
4000
+ serviceId: string;
4001
+ isHealthy: boolean;
4002
+ checkedAt: Date;
4003
+ };
4004
+ meta: object;
4005
+ }>;
4006
+ serviceUsageStats: import("@trpc/server").TRPCQueryProcedure<{
4007
+ input: {
4008
+ workspaceId?: string | undefined;
4009
+ days?: number | undefined;
4010
+ };
4011
+ output: {
4012
+ stats: {
4013
+ serviceId: string;
4014
+ messageCount: number;
4015
+ totalTokens: number;
4016
+ avgLatencyMs: number;
4017
+ }[];
4018
+ since: string;
4019
+ days: number;
4020
+ };
4021
+ meta: object;
4022
+ }>;
3860
4023
  }>>;
3861
4024
  search: import("@trpc/server").TRPCBuiltRouter<{
3862
4025
  ctx: Context;
@@ -4657,7 +4820,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4657
4820
  }>;
4658
4821
  list: import("@trpc/server").TRPCQueryProcedure<{
4659
4822
  input: {
4660
- workspaceId?: string | undefined;
4823
+ workspaceIds?: string[] | undefined;
4661
4824
  type?: "calendar" | "list" | "table" | "whiteboard" | "all" | "graph" | "timeline" | "grid" | "kanban" | "gallery" | "gantt" | "mindmap" | undefined;
4662
4825
  };
4663
4826
  output: {
@@ -5866,6 +6029,21 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
5866
6029
  };
5867
6030
  meta: object;
5868
6031
  }>;
6032
+ installFromUrl: import("@trpc/server").TRPCMutationProcedure<{
6033
+ input: {
6034
+ url: string;
6035
+ workspaceId: string;
6036
+ };
6037
+ output: {
6038
+ id: string;
6039
+ name: string;
6040
+ status: "installed";
6041
+ skillType: "instruction";
6042
+ source: "custom" | "clawhub" | "zeroclaw";
6043
+ version: string;
6044
+ };
6045
+ meta: object;
6046
+ }>;
5869
6047
  }>>;
5870
6048
  backgroundTasks: import("@trpc/server").TRPCBuiltRouter<{
5871
6049
  ctx: Context;
@@ -6136,7 +6314,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
6136
6314
  displayName: string;
6137
6315
  parentProfileId?: string | undefined;
6138
6316
  uiHints?: Record<string, unknown> | undefined;
6139
- scope?: "workspace" | "user" | "system" | undefined;
6317
+ scope?: "workspace" | "user" | "shared" | "system" | undefined;
6318
+ allowedWorkspaceIds?: string[] | undefined;
6140
6319
  source?: "user" | "system" | "intelligence" | "ai" | undefined;
6141
6320
  reasoning?: string | undefined;
6142
6321
  agentUserId?: string | undefined;
@@ -6194,6 +6373,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
6194
6373
  displayName?: string | undefined;
6195
6374
  parentProfileId?: string | null | undefined;
6196
6375
  uiHints?: Record<string, unknown> | undefined;
6376
+ scope?: "workspace" | "user" | "shared" | "system" | undefined;
6377
+ allowedWorkspaceIds?: string[] | undefined;
6197
6378
  };
6198
6379
  output: {
6199
6380
  profile: {
@@ -6253,6 +6434,48 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
6253
6434
  };
6254
6435
  meta: object;
6255
6436
  }>;
6437
+ grantAccess: import("@trpc/server").TRPCMutationProcedure<{
6438
+ input: {
6439
+ profileId: string;
6440
+ targetWorkspaceId: string;
6441
+ };
6442
+ output: {
6443
+ success: boolean;
6444
+ };
6445
+ meta: object;
6446
+ }>;
6447
+ listMulti: import("@trpc/server").TRPCQueryProcedure<{
6448
+ input: {
6449
+ workspaceIds?: string[] | undefined;
6450
+ };
6451
+ output: {
6452
+ profiles: {
6453
+ workspaceId: string | null;
6454
+ userId: string | null;
6455
+ id: string;
6456
+ updatedAt: Date;
6457
+ createdAt: Date;
6458
+ version: number;
6459
+ isActive: boolean;
6460
+ scope: ProfileScope;
6461
+ slug: string;
6462
+ uiHints: unknown;
6463
+ displayName: string;
6464
+ parentProfileId: string | null;
6465
+ }[];
6466
+ };
6467
+ meta: object;
6468
+ }>;
6469
+ revokeAccess: import("@trpc/server").TRPCMutationProcedure<{
6470
+ input: {
6471
+ profileId: string;
6472
+ targetWorkspaceId: string;
6473
+ };
6474
+ output: {
6475
+ success: boolean;
6476
+ };
6477
+ meta: object;
6478
+ }>;
6256
6479
  }>>;
6257
6480
  propertyDefs: import("@trpc/server").TRPCBuiltRouter<{
6258
6481
  ctx: Context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/api-types",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Type definitions for Synap API Router - tRPC types for frontend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -56,6 +56,21 @@ export interface Context {
56
56
  socketIO?: any;
57
57
  workspaceId?: string | null;
58
58
  workspaceRole?: string | null;
59
+ /**
60
+ * Request source — "intelligence" when the request comes from the Intelligence Hub
61
+ * via API key auth. Set automatically by api-key-auth middleware; never set by humans.
62
+ */
63
+ source?: string | null;
64
+ /**
65
+ * Hard flag — true only when authenticated via a hub-protocol scoped API key.
66
+ * Cannot be spoofed by a human JWT session.
67
+ */
68
+ isHubProtocol?: boolean;
69
+ /**
70
+ * The message ID that triggered this hub-protocol request.
71
+ * When set, proposals created during this request are linked to this message.
72
+ */
73
+ sourceMessageId?: string | null;
59
74
  }
60
75
  /**
61
76
  * Users Table - Cache for Kratos Identity Data
@@ -569,11 +584,31 @@ export interface WorkspaceLayoutConfig {
569
584
  defaultView?: string;
570
585
  theme?: string;
571
586
  }
587
+ /**
588
+ * MCP server configuration — stored per workspace.
589
+ * Agents in this workspace will have access to tools from these servers.
590
+ */
591
+ export interface McpServerConfig {
592
+ /** Unique slug within the workspace, e.g. "playwright", "whatsapp" */
593
+ id: string;
594
+ /** Human-readable name shown in UI */
595
+ name: string;
596
+ /** Transport mechanism */
597
+ transport: "stdio" | "http";
598
+ command?: string;
599
+ args?: string[];
600
+ url?: string;
601
+ env?: Record<string, string>;
602
+ /** Set to false to disable without removing config. Default: true. */
603
+ enabled?: boolean;
604
+ }
572
605
  export interface WorkspaceSettings {
573
606
  defaultEntityTypes?: string[];
574
607
  theme?: string;
575
608
  aiEnabled?: boolean;
576
609
  allowExternalSharing?: boolean;
610
+ /** External MCP servers whose tools will be available to AI agents in this workspace */
611
+ mcpServers?: McpServerConfig[];
577
612
  layout?: WorkspaceLayoutConfig;
578
613
  mainWhiteboardId?: string;
579
614
  intelligenceServiceId?: string;
@@ -611,8 +646,23 @@ export interface WorkspaceSettings {
611
646
  /** Current provisioning status */
612
647
  provisioningStatus?: "pending" | "active" | "failed";
613
648
  aiGovernance?: {
614
- autoApprove?: boolean;
649
+ /**
650
+ * Whitelist of event keys that AI agents may execute WITHOUT a proposal.
651
+ * Everything else defaults to proposal-required.
652
+ *
653
+ * Format: "<subjectType>.<action>" or "<subjectType>.*" glob.
654
+ * Default (when field absent): ["search.*", "memory.recall", "entity.read", "document.read"]
655
+ *
656
+ * Examples:
657
+ * "entity.read" — agents can read entities without proposal
658
+ * "search.*" — all search operations bypass proposal
659
+ * "entity.create" — agents can create entities without proposal (high trust)
660
+ */
661
+ autoApproveFor?: string[];
662
+ /** @deprecated Use autoApproveFor instead. Kept for migration reference only. */
615
663
  requireReviewFor?: string[];
664
+ /** @deprecated Use autoApproveFor instead. */
665
+ autoApprove?: boolean;
616
666
  maxAgentsPerUser?: number;
617
667
  allowAgentCreation?: boolean;
618
668
  /** Who can approve AI proposals. Default: "owner_and_admins" */
@@ -995,8 +1045,9 @@ declare const propertyDefs: import("drizzle-orm/pg-core").PgTableWithColumns<{
995
1045
  }>;
996
1046
  export type PropertyDef = typeof propertyDefs.$inferSelect;
997
1047
  declare enum ProfileScope {
998
- SYSTEM = "system",// Available to all users
999
- WORKSPACE = "workspace",// Shared within workspace
1048
+ SYSTEM = "system",// Available to all users (pod-wide)
1049
+ SHARED = "shared",// Explicitly shared with specific workspaces via profile_workspace_access
1050
+ WORKSPACE = "workspace",// Owned by a single workspace
1000
1051
  USER = "user"
1001
1052
  }
1002
1053
  /**
@@ -1392,7 +1443,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1392
1443
  documentId?: string | undefined;
1393
1444
  content?: string | undefined;
1394
1445
  global?: boolean | undefined;
1395
- source?: "user" | "system" | "intelligence" | "ai" | undefined;
1446
+ source?: "user" | "system" | "intelligence" | "ai" | "agent" | undefined;
1396
1447
  reasoning?: string | undefined;
1397
1448
  agentUserId?: string | undefined;
1398
1449
  };
@@ -1489,6 +1540,48 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1489
1540
  };
1490
1541
  meta: object;
1491
1542
  }>;
1543
+ listMulti: import("@trpc/server").TRPCQueryProcedure<{
1544
+ input: {
1545
+ workspaceIds?: string[] | undefined;
1546
+ profileSlug?: string | undefined;
1547
+ includeGlobal?: boolean | undefined;
1548
+ limit?: number | undefined;
1549
+ };
1550
+ output: {
1551
+ entities: {
1552
+ id: string;
1553
+ userId: string;
1554
+ workspaceId: string | null;
1555
+ type: string;
1556
+ profileId: string | null;
1557
+ title: string | null;
1558
+ preview: string | null;
1559
+ documentId: string | null;
1560
+ properties: Record<string, unknown>;
1561
+ fileUrl: string | null;
1562
+ filePath: string | null;
1563
+ fileSize: number | null;
1564
+ fileType: string | null;
1565
+ checksum: string | null;
1566
+ version: number;
1567
+ createdAt: Date;
1568
+ updatedAt: Date;
1569
+ deletedAt: Date | null;
1570
+ }[];
1571
+ };
1572
+ meta: object;
1573
+ }>;
1574
+ listSavedUrls: import("@trpc/server").TRPCQueryProcedure<{
1575
+ input: void;
1576
+ output: {
1577
+ id: string;
1578
+ url: string;
1579
+ title: string;
1580
+ profileSlug: string;
1581
+ createdAt: string;
1582
+ }[];
1583
+ meta: object;
1584
+ }>;
1492
1585
  search: import("@trpc/server").TRPCQueryProcedure<{
1493
1586
  input: {
1494
1587
  query: string;
@@ -1547,7 +1640,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1547
1640
  description?: string | undefined;
1548
1641
  documentId?: string | null | undefined;
1549
1642
  properties?: Record<string, unknown> | undefined;
1550
- source?: "user" | "system" | "intelligence" | "ai" | undefined;
1643
+ source?: "user" | "system" | "intelligence" | "ai" | "agent" | undefined;
1551
1644
  reasoning?: string | undefined;
1552
1645
  agentUserId?: string | undefined;
1553
1646
  };
@@ -1565,7 +1658,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1565
1658
  delete: import("@trpc/server").TRPCMutationProcedure<{
1566
1659
  input: {
1567
1660
  id: string;
1568
- source?: "user" | "system" | "intelligence" | "ai" | undefined;
1661
+ source?: "user" | "system" | "intelligence" | "ai" | "agent" | undefined;
1569
1662
  reasoning?: string | undefined;
1570
1663
  agentUserId?: string | undefined;
1571
1664
  };
@@ -1663,6 +1756,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1663
1756
  threadId?: string | undefined;
1664
1757
  workspaceId?: string | undefined;
1665
1758
  agentType?: "code" | "action" | "meta" | "default" | "prompting" | "knowledge-search" | "writing" | "onboarding" | undefined;
1759
+ agentHandle?: string | undefined;
1760
+ parentChannelId?: string | undefined;
1666
1761
  };
1667
1762
  output: {
1668
1763
  threadId: string;
@@ -1721,7 +1816,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1721
1816
  }[];
1722
1817
  executionSummaries: {
1723
1818
  tool: string;
1724
- status: "error" | "skipped" | "success";
1819
+ status: "error" | "success" | "skipped";
1725
1820
  result?: unknown;
1726
1821
  error?: string | undefined;
1727
1822
  }[];
@@ -1784,6 +1879,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1784
1879
  workspaceId?: string | undefined;
1785
1880
  threadType?: "main" | "branch" | "ai_thread" | undefined;
1786
1881
  limit?: number | undefined;
1882
+ contextObjectId?: string | undefined;
1883
+ contextObjectType?: "entity" | "view" | "document" | undefined;
1787
1884
  };
1788
1885
  output: {
1789
1886
  threads: {
@@ -1904,10 +2001,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
1904
2001
  contextItems: {
1905
2002
  workspaceId: string;
1906
2003
  userId: string;
2004
+ sourceMessageId: string | null;
1907
2005
  id: string;
1908
2006
  createdAt: Date;
1909
2007
  channelId: string;
1910
- sourceMessageId: string | null;
1911
2008
  objectType: ChannelContextObjectType;
1912
2009
  objectId: string;
1913
2010
  relationshipType: ChannelContextRelationshipType;
@@ -2032,10 +2129,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2032
2129
  items: {
2033
2130
  workspaceId: string;
2034
2131
  userId: string;
2132
+ sourceMessageId: string | null;
2035
2133
  id: string;
2036
2134
  createdAt: Date;
2037
2135
  channelId: string;
2038
- sourceMessageId: string | null;
2039
2136
  objectType: ChannelContextObjectType;
2040
2137
  objectId: string;
2041
2138
  relationshipType: ChannelContextRelationshipType;
@@ -2044,10 +2141,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2044
2141
  entities: {
2045
2142
  workspaceId: string;
2046
2143
  userId: string;
2144
+ sourceMessageId: string | null;
2047
2145
  id: string;
2048
2146
  createdAt: Date;
2049
2147
  channelId: string;
2050
- sourceMessageId: string | null;
2051
2148
  objectType: ChannelContextObjectType;
2052
2149
  objectId: string;
2053
2150
  relationshipType: ChannelContextRelationshipType;
@@ -2056,10 +2153,10 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2056
2153
  documents: {
2057
2154
  workspaceId: string;
2058
2155
  userId: string;
2156
+ sourceMessageId: string | null;
2059
2157
  id: string;
2060
2158
  createdAt: Date;
2061
2159
  channelId: string;
2062
- sourceMessageId: string | null;
2063
2160
  objectType: ChannelContextObjectType;
2064
2161
  objectId: string;
2065
2162
  relationshipType: ChannelContextRelationshipType;
@@ -2087,18 +2184,20 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2087
2184
  output: {
2088
2185
  proposals: {
2089
2186
  workspaceId: string;
2187
+ sourceMessageId: string | null;
2090
2188
  id: string;
2091
2189
  data: unknown;
2092
2190
  updatedAt: Date;
2093
2191
  createdAt: Date;
2094
- sourceMessageId: string | null;
2095
2192
  status: ProposalStatus;
2193
+ expiresAt: Date | null;
2096
2194
  createdBy: string | null;
2097
2195
  threadId: string | null;
2098
2196
  targetType: string;
2099
2197
  targetId: string;
2100
2198
  proposalType: string;
2101
2199
  commandRunId: string | null;
2200
+ agentUserId: string | null;
2102
2201
  reviewedBy: string | null;
2103
2202
  reviewedAt: Date | null;
2104
2203
  rejectionReason: string | null;
@@ -2474,7 +2573,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2474
2573
  }>;
2475
2574
  listUsers: import("@trpc/server").TRPCQueryProcedure<{
2476
2575
  input: {
2477
- type?: "all" | "human" | "agent" | undefined;
2576
+ type?: "agent" | "all" | "human" | undefined;
2478
2577
  limit?: number | undefined;
2479
2578
  offset?: number | undefined;
2480
2579
  };
@@ -3314,6 +3413,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3314
3413
  capabilities: string[];
3315
3414
  serviceId: string;
3316
3415
  webhookUrl: string;
3416
+ mcpEndpoint: string | null;
3317
3417
  apiKey: string;
3318
3418
  pricing: string | null;
3319
3419
  enabled: boolean;
@@ -3357,6 +3457,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3357
3457
  capabilities: string[];
3358
3458
  serviceId: string;
3359
3459
  webhookUrl: string;
3460
+ mcpEndpoint: string | null;
3360
3461
  pricing: string | null;
3361
3462
  enabled: boolean;
3362
3463
  lastHealthCheck: Date | null;
@@ -3382,6 +3483,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3382
3483
  description: string | null;
3383
3484
  version: string | null;
3384
3485
  webhookUrl: string;
3486
+ mcpEndpoint: string | null;
3385
3487
  apiKey: string;
3386
3488
  capabilities: string[];
3387
3489
  pricing: string | null;
@@ -3403,6 +3505,39 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3403
3505
  };
3404
3506
  meta: object;
3405
3507
  }>;
3508
+ rotateKey: import("@trpc/server").TRPCMutationProcedure<{
3509
+ input: {
3510
+ id: string;
3511
+ newApiKey: string;
3512
+ };
3513
+ output: {
3514
+ success: boolean;
3515
+ serviceId: string;
3516
+ };
3517
+ meta: object;
3518
+ }>;
3519
+ connectToWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3520
+ input: {
3521
+ serviceId: string;
3522
+ capability?: "chat" | "analysis" | undefined;
3523
+ };
3524
+ output: {
3525
+ success: boolean;
3526
+ workspaceId: string;
3527
+ serviceId: string;
3528
+ capability: string;
3529
+ };
3530
+ meta: object;
3531
+ }>;
3532
+ disconnectFromWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3533
+ input: {
3534
+ capability?: "chat" | "analysis" | undefined;
3535
+ };
3536
+ output: {
3537
+ success: boolean;
3538
+ };
3539
+ meta: object;
3540
+ }>;
3406
3541
  findByCapability: import("@trpc/server").TRPCQueryProcedure<{
3407
3542
  input: {
3408
3543
  capability: string;
@@ -3857,6 +3992,34 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3857
3992
  };
3858
3993
  meta: object;
3859
3994
  }>;
3995
+ checkHealth: import("@trpc/server").TRPCMutationProcedure<{
3996
+ input: {
3997
+ serviceId: string;
3998
+ };
3999
+ output: {
4000
+ serviceId: string;
4001
+ isHealthy: boolean;
4002
+ checkedAt: Date;
4003
+ };
4004
+ meta: object;
4005
+ }>;
4006
+ serviceUsageStats: import("@trpc/server").TRPCQueryProcedure<{
4007
+ input: {
4008
+ workspaceId?: string | undefined;
4009
+ days?: number | undefined;
4010
+ };
4011
+ output: {
4012
+ stats: {
4013
+ serviceId: string;
4014
+ messageCount: number;
4015
+ totalTokens: number;
4016
+ avgLatencyMs: number;
4017
+ }[];
4018
+ since: string;
4019
+ days: number;
4020
+ };
4021
+ meta: object;
4022
+ }>;
3860
4023
  }>>;
3861
4024
  search: import("@trpc/server").TRPCBuiltRouter<{
3862
4025
  ctx: Context;
@@ -4657,7 +4820,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4657
4820
  }>;
4658
4821
  list: import("@trpc/server").TRPCQueryProcedure<{
4659
4822
  input: {
4660
- workspaceId?: string | undefined;
4823
+ workspaceIds?: string[] | undefined;
4661
4824
  type?: "calendar" | "list" | "table" | "whiteboard" | "all" | "graph" | "timeline" | "grid" | "kanban" | "gallery" | "gantt" | "mindmap" | undefined;
4662
4825
  };
4663
4826
  output: {
@@ -5866,6 +6029,21 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
5866
6029
  };
5867
6030
  meta: object;
5868
6031
  }>;
6032
+ installFromUrl: import("@trpc/server").TRPCMutationProcedure<{
6033
+ input: {
6034
+ url: string;
6035
+ workspaceId: string;
6036
+ };
6037
+ output: {
6038
+ id: string;
6039
+ name: string;
6040
+ status: "installed";
6041
+ skillType: "instruction";
6042
+ source: "custom" | "clawhub" | "zeroclaw";
6043
+ version: string;
6044
+ };
6045
+ meta: object;
6046
+ }>;
5869
6047
  }>>;
5870
6048
  backgroundTasks: import("@trpc/server").TRPCBuiltRouter<{
5871
6049
  ctx: Context;
@@ -6136,7 +6314,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
6136
6314
  displayName: string;
6137
6315
  parentProfileId?: string | undefined;
6138
6316
  uiHints?: Record<string, unknown> | undefined;
6139
- scope?: "workspace" | "user" | "system" | undefined;
6317
+ scope?: "workspace" | "user" | "shared" | "system" | undefined;
6318
+ allowedWorkspaceIds?: string[] | undefined;
6140
6319
  source?: "user" | "system" | "intelligence" | "ai" | undefined;
6141
6320
  reasoning?: string | undefined;
6142
6321
  agentUserId?: string | undefined;
@@ -6194,6 +6373,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
6194
6373
  displayName?: string | undefined;
6195
6374
  parentProfileId?: string | null | undefined;
6196
6375
  uiHints?: Record<string, unknown> | undefined;
6376
+ scope?: "workspace" | "user" | "shared" | "system" | undefined;
6377
+ allowedWorkspaceIds?: string[] | undefined;
6197
6378
  };
6198
6379
  output: {
6199
6380
  profile: {
@@ -6253,6 +6434,48 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
6253
6434
  };
6254
6435
  meta: object;
6255
6436
  }>;
6437
+ grantAccess: import("@trpc/server").TRPCMutationProcedure<{
6438
+ input: {
6439
+ profileId: string;
6440
+ targetWorkspaceId: string;
6441
+ };
6442
+ output: {
6443
+ success: boolean;
6444
+ };
6445
+ meta: object;
6446
+ }>;
6447
+ listMulti: import("@trpc/server").TRPCQueryProcedure<{
6448
+ input: {
6449
+ workspaceIds?: string[] | undefined;
6450
+ };
6451
+ output: {
6452
+ profiles: {
6453
+ workspaceId: string | null;
6454
+ userId: string | null;
6455
+ id: string;
6456
+ updatedAt: Date;
6457
+ createdAt: Date;
6458
+ version: number;
6459
+ isActive: boolean;
6460
+ scope: ProfileScope;
6461
+ slug: string;
6462
+ uiHints: unknown;
6463
+ displayName: string;
6464
+ parentProfileId: string | null;
6465
+ }[];
6466
+ };
6467
+ meta: object;
6468
+ }>;
6469
+ revokeAccess: import("@trpc/server").TRPCMutationProcedure<{
6470
+ input: {
6471
+ profileId: string;
6472
+ targetWorkspaceId: string;
6473
+ };
6474
+ output: {
6475
+ success: boolean;
6476
+ };
6477
+ meta: object;
6478
+ }>;
6256
6479
  }>>;
6257
6480
  propertyDefs: import("@trpc/server").TRPCBuiltRouter<{
6258
6481
  ctx: Context;