@synap-core/api-types 1.16.0 → 1.17.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.
@@ -71,6 +71,11 @@ export interface Context {
71
71
  * When set, proposals created during this request are linked to this message.
72
72
  */
73
73
  sourceMessageId?: string | null;
74
+ /**
75
+ * Session ID that triggered this hub-protocol request.
76
+ * When set, proposals created during this request are linked to this session.
77
+ */
78
+ sessionId?: string | null;
74
79
  }
75
80
  /**
76
81
  * Users Table - Cache for Kratos Identity Data
@@ -451,6 +456,25 @@ export interface WorkspaceDefaultSource {
451
456
  profileSlug?: string;
452
457
  label?: string;
453
458
  }
459
+ /**
460
+ * Provenance record for a workspace composed via `definition.extends`
461
+ * (Wave 7 / north star §10 — workspace composition). One entry per resolved
462
+ * source. COPY semantics: the imported profiles/views are independent copies
463
+ * on this workspace; this is a snapshot of where they came from, not a live
464
+ * link. Surfaced in the frontend so an imported brick reads "from <source>".
465
+ */
466
+ export interface WorkspaceComposedFromEntry {
467
+ /** Resolved source workspace id. */
468
+ sourceWorkspaceId: string;
469
+ /** The original `source` ref as declared (workspaceId or systemSlug). */
470
+ source: string;
471
+ /** Profile slugs imported from this source. */
472
+ profiles: string[];
473
+ /** View names imported from this source. */
474
+ views: string[];
475
+ /** ISO timestamp of when the import was resolved. */
476
+ importedAt: string;
477
+ }
454
478
  export interface WorkspaceSettings {
455
479
  defaultEntityTypes?: string[];
456
480
  theme?: string;
@@ -484,6 +508,12 @@ export interface WorkspaceSettings {
484
508
  * workspaces so features can resolve defaults without copying data.
485
509
  */
486
510
  defaultSources?: Record<string, WorkspaceDefaultSource>;
511
+ /**
512
+ * Provenance of bricks (profiles/views) imported from other workspaces via
513
+ * `definition.extends`. COPY semantics — a snapshot of origin, not a live
514
+ * dependency. Used by the UI to tag imported bricks with their source.
515
+ */
516
+ composedFrom?: WorkspaceComposedFromEntry[];
487
517
  /** External MCP servers whose tools will be available to AI agents in this workspace */
488
518
  mcpServers?: McpServerConfig[];
489
519
  layout?: WorkspaceLayoutConfig;
@@ -1331,254 +1361,1011 @@ export interface AiProviderModelEntry {
1331
1361
  costPer1MInput?: number;
1332
1362
  costPer1MOutput?: number;
1333
1363
  }
1334
- /**
1335
- * EventRecord - Database representation of an event
1336
- *
1337
- * This is the format returned from the database.
1338
- * It maps directly to the events table structure.
1339
- */
1340
- export interface EventRecord {
1341
- id: string;
1342
- timestamp: Date;
1343
- subjectId: string;
1344
- subjectType: string;
1345
- eventType: string;
1346
- userId: string;
1347
- data: Record<string, unknown>;
1348
- metadata?: Record<string, unknown>;
1349
- version: number;
1350
- causationId?: string;
1351
- correlationId?: string;
1352
- source: string;
1353
- }
1354
- /** Minimal message fields for list/preview */
1355
- export interface LinkedMessagePreview {
1356
- id: string;
1357
- channelId: string;
1358
- role: string;
1359
- content: string;
1360
- timestamp: Date;
1361
- userId: string;
1362
- }
1363
- export interface LinkedMessageItem {
1364
- link: MessageLink;
1365
- message: LinkedMessagePreview;
1366
- }
1367
- export interface EffectiveProperty extends PropertyDef {
1368
- required: boolean;
1369
- defaultValue: unknown;
1370
- displayOrder: number;
1371
- }
1372
- /**
1373
- * RendererRef — what a profile or workspace stores as its renderer choice
1374
- * for a (slot, profile) pair.
1375
- *
1376
- * Structural mirror of `RendererTarget` from `@synap-core/renderer-runtime`.
1377
- * Kept as a structural type in the database layer (rather than importing the
1378
- * frontend package) so the schema package stays UI-free. The canonical type
1379
- * lives in `@synap-core/renderer-runtime` and is re-exported by
1380
- * `@synap-core/profile-renderer` as `RendererRef`.
1381
- *
1382
- * Stored as JSONB on `profiles.default_(list|detail)_renderer` and inside
1383
- * `workspaces.settings.profileRenderers[slug]`.
1384
- *
1385
- * Spec: synap-team-docs/content/team/platform/profile-renderer.mdx
1386
- */
1387
- export type RendererRef = {
1388
- kind: "cell";
1389
- cellKey: string;
1390
- props: Record<string, unknown>;
1391
- title?: string;
1392
- displayMode?: string;
1393
- rendererHint?: Record<string, unknown>;
1394
- } | {
1395
- kind: "view";
1396
- viewId: string;
1397
- title?: string;
1398
- displayMode?: string;
1399
- } | {
1400
- kind: "iframe-srcdoc";
1401
- appId: string;
1402
- srcdoc: string;
1403
- title?: string;
1404
- props?: Record<string, unknown>;
1405
- } | {
1406
- kind: "external-app";
1407
- appId: string;
1408
- url: string;
1409
- title?: string;
1410
- props?: Record<string, unknown>;
1411
- } | {
1412
- kind: "url";
1413
- url: string;
1414
- external?: boolean;
1415
- title?: string;
1416
- } | {
1417
- kind: "view-adapter";
1418
- adapterKey: string;
1419
- props?: Record<string, unknown>;
1420
- title?: string;
1421
- };
1422
- /**
1423
- * Column definition for views
1424
- */
1425
- export interface ViewColumn {
1426
- id: string;
1427
- field: string;
1428
- title?: string;
1429
- valueType?: string;
1430
- indexed?: boolean;
1431
- visible?: boolean;
1432
- width?: number;
1433
- }
1434
- /**
1435
- * View Query Types
1436
- *
1437
- * Single source of truth for all view query and filter types.
1438
- */
1439
- /**
1440
- * Filter operator types
1441
- */
1442
- export type FilterOperator = "equals" | "not_equals" | "contains" | "not_contains" | "in" | "not_in" | "is_empty" | "is_not_empty" | "greater_than" | "less_than" | "greater_than_or_equal" | "less_than_or_equal";
1443
- /**
1444
- * Filter definition for entity queries
1445
- */
1446
- export interface EntityFilter {
1447
- field: string;
1448
- operator: FilterOperator;
1449
- value?: unknown;
1450
- }
1451
- /**
1452
- * Sort rule for entity queries
1453
- */
1454
- export interface SortRule {
1455
- field: string;
1456
- direction: "asc" | "desc";
1457
- }
1458
- /**
1459
- * Query definition for structured views
1460
- * Defines which entities to show and how to filter them
1461
- *
1462
- * NOTE: profileIds/profileSlugs are now stored in views.scopeProfileIds
1463
- * This query structure only contains filters, sorts, search, pagination, and groupBy
1464
- */
1465
- export interface EntityQuery {
1466
- /** @deprecated - Profile IDs now stored in views.scopeProfileIds */
1467
- profileIds?: string[];
1468
- /** @deprecated - Profile slugs now stored in views.scopeProfileIds (resolved to IDs) */
1469
- profileSlugs?: string[];
1470
- /** @deprecated - Use profileSlugs instead, which is also deprecated */
1471
- entityTypes?: string[];
1472
- /** Specific entity IDs (for fixed sets) */
1473
- entityIds?: string[];
1474
- /** Filter conditions */
1475
- filters?: EntityFilter[];
1476
- /** Sort rules (multiple sorts supported) */
1477
- sorts?: SortRule[];
1478
- /** Full-text search query */
1479
- search?: string;
1480
- /** Maximum number of entities to return */
1481
- limit?: number;
1482
- /** Offset for pagination */
1483
- offset?: number;
1484
- /** Group by field (for kanban, timeline) */
1485
- groupBy?: string;
1486
- }
1487
- declare enum AgentType {
1488
- DEFAULT = "default",
1489
- META = "meta",
1490
- PROMPTING = "prompting",
1491
- KNOWLEDGE_SEARCH = "knowledge-search",
1492
- CODE = "code",
1493
- WRITING = "writing",
1494
- ACTION = "action",
1495
- ONBOARDING = "onboarding",
1496
- WORKSPACE_CREATION = "workspace-creation"
1497
- }
1498
- /**
1499
- * Agent type as string literal union (for flexibility)
1500
- */
1501
- export type AgentTypeString = `${AgentType}` | (string & {});
1502
- declare enum AIStepType {
1503
- THINKING = "thinking",
1504
- TOOL_CALL = "tool_call",
1505
- TOOL_RESULT = "tool_result",
1506
- DECISION = "decision",
1507
- ERROR = "error"
1508
- }
1509
- /**
1510
- * AI step - shows what the AI is doing
1511
- *
1512
- * Represents any step in the AI's reasoning/execution process:
1513
- * - thinking: General analysis and reasoning
1514
- * - tool_call: When AI calls a tool
1515
- * - tool_result: Result from tool execution
1516
- * - decision: AI making a decision
1517
- * - error: Error during processing
1518
- */
1519
- export interface AIStep {
1520
- id: string;
1521
- type: AIStepType | string;
1522
- content: string;
1523
- toolName?: string;
1524
- toolInput?: unknown;
1525
- toolOutput?: unknown;
1526
- timestamp: string;
1527
- duration?: number;
1528
- error?: string;
1529
- title?: string;
1530
- description?: string;
1531
- status?: "pending" | "running" | "complete" | "error";
1532
- }
1533
- /**
1534
- * Branch decision from meta-agent
1535
- */
1536
- export interface BranchDecision {
1537
- shouldBranch: boolean;
1538
- reason: string;
1539
- suggestedAgentType?: AgentTypeString;
1540
- suggestedTitle?: string;
1541
- suggestedPurpose?: string;
1542
- }
1543
- declare const EVENT_ACTIONS: readonly [
1544
- "create",
1545
- "update",
1546
- "delete",
1547
- "archive",
1548
- "restore"
1549
- ];
1550
- export type EventAction = (typeof EVENT_ACTIONS)[number];
1551
- /**
1552
- * Universal Update Request
1553
- *
1554
- * The standard envelope for all change requests in the system.
1555
- * This object is stored in the `proposals` table (as part of StoredProposalData)
1556
- * and passed in events. changeType aligns with EventAction for event-sourced flow.
1557
- */
1558
- export interface UpdateRequest {
1559
- /** Unique ID for this specific request */
1560
- requestId: string;
1561
- /** Who initiated the change? */
1562
- source: "user" | "ai" | "system" | "intelligence" | "agent" | "openwebui-pipeline" | "openclaw" | "extension" | "cli" | "n8n" | "raycast";
1563
- sourceId: string;
1564
- /** Context */
1565
- workspaceId: string | null;
1566
- /** Target Entity */
1567
- targetType: "document" | "entity" | "whiteboard" | "view" | "profile";
1568
- targetId: string;
1569
- /** Human-readable target label resolved server-side when available. */
1570
- targetName?: string;
1571
- /** What kind of change? (aligns with EventAction) */
1572
- changeType: EventAction;
1573
- /**
1574
- * Lightweight metadata changes (e.g. title rename, status change).
1575
- * For entities: create/update payload. For documents: not used when proposedContent is used.
1576
- */
1577
- data?: Record<string, unknown>;
1578
- /**
1579
- * Heavy Content Reference (S3/MinIO).
1580
- * Used for Documents, Whiteboards, etc.
1581
- */
1364
+ declare const focusSessions: import("drizzle-orm/pg-core").PgTableWithColumns<{
1365
+ name: "focus_sessions";
1366
+ schema: undefined;
1367
+ columns: {
1368
+ id: import("drizzle-orm/pg-core").PgColumn<{
1369
+ name: "id";
1370
+ tableName: "focus_sessions";
1371
+ dataType: "string";
1372
+ columnType: "PgUUID";
1373
+ data: string;
1374
+ driverParam: string;
1375
+ notNull: true;
1376
+ hasDefault: true;
1377
+ isPrimaryKey: true;
1378
+ isAutoincrement: false;
1379
+ hasRuntimeDefault: false;
1380
+ enumValues: undefined;
1381
+ baseColumn: never;
1382
+ identity: undefined;
1383
+ generated: undefined;
1384
+ }, {}, {}>;
1385
+ workspaceId: import("drizzle-orm/pg-core").PgColumn<{
1386
+ name: "workspace_id";
1387
+ tableName: "focus_sessions";
1388
+ dataType: "string";
1389
+ columnType: "PgText";
1390
+ data: string;
1391
+ driverParam: string;
1392
+ notNull: true;
1393
+ hasDefault: false;
1394
+ isPrimaryKey: false;
1395
+ isAutoincrement: false;
1396
+ hasRuntimeDefault: false;
1397
+ enumValues: [
1398
+ string,
1399
+ ...string[]
1400
+ ];
1401
+ baseColumn: never;
1402
+ identity: undefined;
1403
+ generated: undefined;
1404
+ }, {}, {}>;
1405
+ userId: import("drizzle-orm/pg-core").PgColumn<{
1406
+ name: "user_id";
1407
+ tableName: "focus_sessions";
1408
+ dataType: "string";
1409
+ columnType: "PgText";
1410
+ data: string;
1411
+ driverParam: string;
1412
+ notNull: true;
1413
+ hasDefault: false;
1414
+ isPrimaryKey: false;
1415
+ isAutoincrement: false;
1416
+ hasRuntimeDefault: false;
1417
+ enumValues: [
1418
+ string,
1419
+ ...string[]
1420
+ ];
1421
+ baseColumn: never;
1422
+ identity: undefined;
1423
+ generated: undefined;
1424
+ }, {}, {}>;
1425
+ correlationId: import("drizzle-orm/pg-core").PgColumn<{
1426
+ name: "correlation_id";
1427
+ tableName: "focus_sessions";
1428
+ dataType: "string";
1429
+ columnType: "PgText";
1430
+ data: string;
1431
+ driverParam: string;
1432
+ notNull: false;
1433
+ hasDefault: false;
1434
+ isPrimaryKey: false;
1435
+ isAutoincrement: false;
1436
+ hasRuntimeDefault: false;
1437
+ enumValues: [
1438
+ string,
1439
+ ...string[]
1440
+ ];
1441
+ baseColumn: never;
1442
+ identity: undefined;
1443
+ generated: undefined;
1444
+ }, {}, {}>;
1445
+ goal: import("drizzle-orm/pg-core").PgColumn<{
1446
+ name: "goal";
1447
+ tableName: "focus_sessions";
1448
+ dataType: "string";
1449
+ columnType: "PgText";
1450
+ data: string;
1451
+ driverParam: string;
1452
+ notNull: true;
1453
+ hasDefault: false;
1454
+ isPrimaryKey: false;
1455
+ isAutoincrement: false;
1456
+ hasRuntimeDefault: false;
1457
+ enumValues: [
1458
+ string,
1459
+ ...string[]
1460
+ ];
1461
+ baseColumn: never;
1462
+ identity: undefined;
1463
+ generated: undefined;
1464
+ }, {}, {}>;
1465
+ status: import("drizzle-orm/pg-core").PgColumn<{
1466
+ name: "status";
1467
+ tableName: "focus_sessions";
1468
+ dataType: "string";
1469
+ columnType: "PgText";
1470
+ data: "active" | "paused" | "closed";
1471
+ driverParam: string;
1472
+ notNull: true;
1473
+ hasDefault: true;
1474
+ isPrimaryKey: false;
1475
+ isAutoincrement: false;
1476
+ hasRuntimeDefault: false;
1477
+ enumValues: [
1478
+ "active",
1479
+ "paused",
1480
+ "closed"
1481
+ ];
1482
+ baseColumn: never;
1483
+ identity: undefined;
1484
+ generated: undefined;
1485
+ }, {}, {}>;
1486
+ templateId: import("drizzle-orm/pg-core").PgColumn<{
1487
+ name: "template_id";
1488
+ tableName: "focus_sessions";
1489
+ dataType: "string";
1490
+ columnType: "PgText";
1491
+ data: string;
1492
+ driverParam: string;
1493
+ notNull: false;
1494
+ hasDefault: false;
1495
+ isPrimaryKey: false;
1496
+ isAutoincrement: false;
1497
+ hasRuntimeDefault: false;
1498
+ enumValues: [
1499
+ string,
1500
+ ...string[]
1501
+ ];
1502
+ baseColumn: never;
1503
+ identity: undefined;
1504
+ generated: undefined;
1505
+ }, {}, {}>;
1506
+ playbookId: import("drizzle-orm/pg-core").PgColumn<{
1507
+ name: "playbook_id";
1508
+ tableName: "focus_sessions";
1509
+ dataType: "string";
1510
+ columnType: "PgUUID";
1511
+ data: string;
1512
+ driverParam: string;
1513
+ notNull: false;
1514
+ hasDefault: false;
1515
+ isPrimaryKey: false;
1516
+ isAutoincrement: false;
1517
+ hasRuntimeDefault: false;
1518
+ enumValues: undefined;
1519
+ baseColumn: never;
1520
+ identity: undefined;
1521
+ generated: undefined;
1522
+ }, {}, {}>;
1523
+ expectedOutputs: import("drizzle-orm/pg-core").PgColumn<{
1524
+ name: "expected_outputs";
1525
+ tableName: "focus_sessions";
1526
+ dataType: "json";
1527
+ columnType: "PgJsonb";
1528
+ data: unknown;
1529
+ driverParam: unknown;
1530
+ notNull: false;
1531
+ hasDefault: true;
1532
+ isPrimaryKey: false;
1533
+ isAutoincrement: false;
1534
+ hasRuntimeDefault: false;
1535
+ enumValues: undefined;
1536
+ baseColumn: never;
1537
+ identity: undefined;
1538
+ generated: undefined;
1539
+ }, {}, {}>;
1540
+ channelId: import("drizzle-orm/pg-core").PgColumn<{
1541
+ name: "channel_id";
1542
+ tableName: "focus_sessions";
1543
+ dataType: "string";
1544
+ columnType: "PgUUID";
1545
+ data: string;
1546
+ driverParam: string;
1547
+ notNull: false;
1548
+ hasDefault: false;
1549
+ isPrimaryKey: false;
1550
+ isAutoincrement: false;
1551
+ hasRuntimeDefault: false;
1552
+ enumValues: undefined;
1553
+ baseColumn: never;
1554
+ identity: undefined;
1555
+ generated: undefined;
1556
+ }, {}, {}>;
1557
+ progress: import("drizzle-orm/pg-core").PgColumn<{
1558
+ name: "progress";
1559
+ tableName: "focus_sessions";
1560
+ dataType: "number";
1561
+ columnType: "PgInteger";
1562
+ data: number;
1563
+ driverParam: string | number;
1564
+ notNull: false;
1565
+ hasDefault: false;
1566
+ isPrimaryKey: false;
1567
+ isAutoincrement: false;
1568
+ hasRuntimeDefault: false;
1569
+ enumValues: undefined;
1570
+ baseColumn: never;
1571
+ identity: undefined;
1572
+ generated: undefined;
1573
+ }, {}, {}>;
1574
+ agentIds: import("drizzle-orm/pg-core").PgColumn<{
1575
+ name: "agent_ids";
1576
+ tableName: "focus_sessions";
1577
+ dataType: "array";
1578
+ columnType: "PgArray";
1579
+ data: string[];
1580
+ driverParam: string | string[];
1581
+ notNull: false;
1582
+ hasDefault: true;
1583
+ isPrimaryKey: false;
1584
+ isAutoincrement: false;
1585
+ hasRuntimeDefault: false;
1586
+ enumValues: [
1587
+ string,
1588
+ ...string[]
1589
+ ];
1590
+ baseColumn: import("drizzle-orm").Column<{
1591
+ name: "agent_ids";
1592
+ tableName: "focus_sessions";
1593
+ dataType: "string";
1594
+ columnType: "PgText";
1595
+ data: string;
1596
+ driverParam: string;
1597
+ notNull: false;
1598
+ hasDefault: false;
1599
+ isPrimaryKey: false;
1600
+ isAutoincrement: false;
1601
+ hasRuntimeDefault: false;
1602
+ enumValues: [
1603
+ string,
1604
+ ...string[]
1605
+ ];
1606
+ baseColumn: never;
1607
+ identity: undefined;
1608
+ generated: undefined;
1609
+ }, {}, {}>;
1610
+ identity: undefined;
1611
+ generated: undefined;
1612
+ }, {}, {
1613
+ size: undefined;
1614
+ baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
1615
+ name: "agent_ids";
1616
+ dataType: "string";
1617
+ columnType: "PgText";
1618
+ data: string;
1619
+ enumValues: [
1620
+ string,
1621
+ ...string[]
1622
+ ];
1623
+ driverParam: string;
1624
+ }, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
1625
+ }>;
1626
+ closedAt: import("drizzle-orm/pg-core").PgColumn<{
1627
+ name: "closed_at";
1628
+ tableName: "focus_sessions";
1629
+ dataType: "date";
1630
+ columnType: "PgTimestamp";
1631
+ data: Date;
1632
+ driverParam: string;
1633
+ notNull: false;
1634
+ hasDefault: false;
1635
+ isPrimaryKey: false;
1636
+ isAutoincrement: false;
1637
+ hasRuntimeDefault: false;
1638
+ enumValues: undefined;
1639
+ baseColumn: never;
1640
+ identity: undefined;
1641
+ generated: undefined;
1642
+ }, {}, {}>;
1643
+ contextReport: import("drizzle-orm/pg-core").PgColumn<{
1644
+ name: "context_report";
1645
+ tableName: "focus_sessions";
1646
+ dataType: "json";
1647
+ columnType: "PgJsonb";
1648
+ data: unknown;
1649
+ driverParam: unknown;
1650
+ notNull: false;
1651
+ hasDefault: false;
1652
+ isPrimaryKey: false;
1653
+ isAutoincrement: false;
1654
+ hasRuntimeDefault: false;
1655
+ enumValues: undefined;
1656
+ baseColumn: never;
1657
+ identity: undefined;
1658
+ generated: undefined;
1659
+ }, {}, {}>;
1660
+ planReport: import("drizzle-orm/pg-core").PgColumn<{
1661
+ name: "plan_report";
1662
+ tableName: "focus_sessions";
1663
+ dataType: "json";
1664
+ columnType: "PgJsonb";
1665
+ data: unknown;
1666
+ driverParam: unknown;
1667
+ notNull: false;
1668
+ hasDefault: false;
1669
+ isPrimaryKey: false;
1670
+ isAutoincrement: false;
1671
+ hasRuntimeDefault: false;
1672
+ enumValues: undefined;
1673
+ baseColumn: never;
1674
+ identity: undefined;
1675
+ generated: undefined;
1676
+ }, {}, {}>;
1677
+ executionLog: import("drizzle-orm/pg-core").PgColumn<{
1678
+ name: "execution_log";
1679
+ tableName: "focus_sessions";
1680
+ dataType: "json";
1681
+ columnType: "PgJsonb";
1682
+ data: unknown;
1683
+ driverParam: unknown;
1684
+ notNull: false;
1685
+ hasDefault: false;
1686
+ isPrimaryKey: false;
1687
+ isAutoincrement: false;
1688
+ hasRuntimeDefault: false;
1689
+ enumValues: undefined;
1690
+ baseColumn: never;
1691
+ identity: undefined;
1692
+ generated: undefined;
1693
+ }, {}, {}>;
1694
+ verificationReport: import("drizzle-orm/pg-core").PgColumn<{
1695
+ name: "verification_report";
1696
+ tableName: "focus_sessions";
1697
+ dataType: "json";
1698
+ columnType: "PgJsonb";
1699
+ data: unknown;
1700
+ driverParam: unknown;
1701
+ notNull: false;
1702
+ hasDefault: false;
1703
+ isPrimaryKey: false;
1704
+ isAutoincrement: false;
1705
+ hasRuntimeDefault: false;
1706
+ enumValues: undefined;
1707
+ baseColumn: never;
1708
+ identity: undefined;
1709
+ generated: undefined;
1710
+ }, {}, {}>;
1711
+ startedAt: import("drizzle-orm/pg-core").PgColumn<{
1712
+ name: "started_at";
1713
+ tableName: "focus_sessions";
1714
+ dataType: "date";
1715
+ columnType: "PgTimestamp";
1716
+ data: Date;
1717
+ driverParam: string;
1718
+ notNull: true;
1719
+ hasDefault: true;
1720
+ isPrimaryKey: false;
1721
+ isAutoincrement: false;
1722
+ hasRuntimeDefault: false;
1723
+ enumValues: undefined;
1724
+ baseColumn: never;
1725
+ identity: undefined;
1726
+ generated: undefined;
1727
+ }, {}, {}>;
1728
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1729
+ name: "created_at";
1730
+ tableName: "focus_sessions";
1731
+ dataType: "date";
1732
+ columnType: "PgTimestamp";
1733
+ data: Date;
1734
+ driverParam: string;
1735
+ notNull: true;
1736
+ hasDefault: true;
1737
+ isPrimaryKey: false;
1738
+ isAutoincrement: false;
1739
+ hasRuntimeDefault: false;
1740
+ enumValues: undefined;
1741
+ baseColumn: never;
1742
+ identity: undefined;
1743
+ generated: undefined;
1744
+ }, {}, {}>;
1745
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
1746
+ name: "updated_at";
1747
+ tableName: "focus_sessions";
1748
+ dataType: "date";
1749
+ columnType: "PgTimestamp";
1750
+ data: Date;
1751
+ driverParam: string;
1752
+ notNull: true;
1753
+ hasDefault: true;
1754
+ isPrimaryKey: false;
1755
+ isAutoincrement: false;
1756
+ hasRuntimeDefault: false;
1757
+ enumValues: undefined;
1758
+ baseColumn: never;
1759
+ identity: undefined;
1760
+ generated: undefined;
1761
+ }, {}, {}>;
1762
+ };
1763
+ dialect: "pg";
1764
+ }>;
1765
+ export type FocusSession = typeof focusSessions.$inferSelect;
1766
+ /**
1767
+ * Playbooks Schema — session templates (CONFIGURATION)
1768
+ *
1769
+ * A Playbook is a *template* of a Session: a goal (with params), the
1770
+ * capabilities (tools/skills/commands) the AI may use, an input-strategy
1771
+ * ("what to check"), a channel spec (the room), expected outputs, an optional
1772
+ * schedule, and an executor target (IS / BYOA / hybrid).
1773
+ *
1774
+ * CONFIGURATION, not entity DATA — playbooks live in their own table; a runtime
1775
+ * `focus_sessions` row is an *instance* of a playbook (focus_sessions.playbook_id).
1776
+ * The richer JSONB shapes (params/input_strategy/channel_spec/expected_outputs/
1777
+ * schedule) conform to the contracts in @synap/playbooks; they are stored loosely
1778
+ * here and interpreted at the domain/API boundary.
1779
+ *
1780
+ * Design doc: team/platform/playbooks-capability-substrate.mdx
1781
+ */
1782
+ /** Which "hands" run this playbook. Mirrors @synap/playbooks ExecutorRef. */
1783
+ export type PlaybookExecutorRef = "is-agent" | "external-agent" | "hybrid";
1784
+ declare const playbooks: import("drizzle-orm/pg-core").PgTableWithColumns<{
1785
+ name: "playbooks";
1786
+ schema: undefined;
1787
+ columns: {
1788
+ id: import("drizzle-orm/pg-core").PgColumn<{
1789
+ name: "id";
1790
+ tableName: "playbooks";
1791
+ dataType: "string";
1792
+ columnType: "PgUUID";
1793
+ data: string;
1794
+ driverParam: string;
1795
+ notNull: true;
1796
+ hasDefault: true;
1797
+ isPrimaryKey: true;
1798
+ isAutoincrement: false;
1799
+ hasRuntimeDefault: false;
1800
+ enumValues: undefined;
1801
+ baseColumn: never;
1802
+ identity: undefined;
1803
+ generated: undefined;
1804
+ }, {}, {}>;
1805
+ workspaceId: import("drizzle-orm/pg-core").PgColumn<{
1806
+ name: "workspace_id";
1807
+ tableName: "playbooks";
1808
+ dataType: "string";
1809
+ columnType: "PgUUID";
1810
+ data: string;
1811
+ driverParam: string;
1812
+ notNull: false;
1813
+ hasDefault: false;
1814
+ isPrimaryKey: false;
1815
+ isAutoincrement: false;
1816
+ hasRuntimeDefault: false;
1817
+ enumValues: undefined;
1818
+ baseColumn: never;
1819
+ identity: undefined;
1820
+ generated: undefined;
1821
+ }, {}, {}>;
1822
+ createdBy: import("drizzle-orm/pg-core").PgColumn<{
1823
+ name: "created_by";
1824
+ tableName: "playbooks";
1825
+ dataType: "string";
1826
+ columnType: "PgText";
1827
+ data: string;
1828
+ driverParam: string;
1829
+ notNull: true;
1830
+ hasDefault: false;
1831
+ isPrimaryKey: false;
1832
+ isAutoincrement: false;
1833
+ hasRuntimeDefault: false;
1834
+ enumValues: [
1835
+ string,
1836
+ ...string[]
1837
+ ];
1838
+ baseColumn: never;
1839
+ identity: undefined;
1840
+ generated: undefined;
1841
+ }, {}, {}>;
1842
+ name: import("drizzle-orm/pg-core").PgColumn<{
1843
+ name: "name";
1844
+ tableName: "playbooks";
1845
+ dataType: "string";
1846
+ columnType: "PgText";
1847
+ data: string;
1848
+ driverParam: string;
1849
+ notNull: true;
1850
+ hasDefault: false;
1851
+ isPrimaryKey: false;
1852
+ isAutoincrement: false;
1853
+ hasRuntimeDefault: false;
1854
+ enumValues: [
1855
+ string,
1856
+ ...string[]
1857
+ ];
1858
+ baseColumn: never;
1859
+ identity: undefined;
1860
+ generated: undefined;
1861
+ }, {}, {}>;
1862
+ description: import("drizzle-orm/pg-core").PgColumn<{
1863
+ name: "description";
1864
+ tableName: "playbooks";
1865
+ dataType: "string";
1866
+ columnType: "PgText";
1867
+ data: string;
1868
+ driverParam: string;
1869
+ notNull: false;
1870
+ hasDefault: false;
1871
+ isPrimaryKey: false;
1872
+ isAutoincrement: false;
1873
+ hasRuntimeDefault: false;
1874
+ enumValues: [
1875
+ string,
1876
+ ...string[]
1877
+ ];
1878
+ baseColumn: never;
1879
+ identity: undefined;
1880
+ generated: undefined;
1881
+ }, {}, {}>;
1882
+ goalTemplate: import("drizzle-orm/pg-core").PgColumn<{
1883
+ name: "goal_template";
1884
+ tableName: "playbooks";
1885
+ dataType: "string";
1886
+ columnType: "PgText";
1887
+ data: string;
1888
+ driverParam: string;
1889
+ notNull: true;
1890
+ hasDefault: false;
1891
+ isPrimaryKey: false;
1892
+ isAutoincrement: false;
1893
+ hasRuntimeDefault: false;
1894
+ enumValues: [
1895
+ string,
1896
+ ...string[]
1897
+ ];
1898
+ baseColumn: never;
1899
+ identity: undefined;
1900
+ generated: undefined;
1901
+ }, {}, {}>;
1902
+ params: import("drizzle-orm/pg-core").PgColumn<{
1903
+ name: "params";
1904
+ tableName: "playbooks";
1905
+ dataType: "json";
1906
+ columnType: "PgJsonb";
1907
+ data: unknown;
1908
+ driverParam: unknown;
1909
+ notNull: true;
1910
+ hasDefault: true;
1911
+ isPrimaryKey: false;
1912
+ isAutoincrement: false;
1913
+ hasRuntimeDefault: false;
1914
+ enumValues: undefined;
1915
+ baseColumn: never;
1916
+ identity: undefined;
1917
+ generated: undefined;
1918
+ }, {}, {}>;
1919
+ inputStrategy: import("drizzle-orm/pg-core").PgColumn<{
1920
+ name: "input_strategy";
1921
+ tableName: "playbooks";
1922
+ dataType: "json";
1923
+ columnType: "PgJsonb";
1924
+ data: unknown;
1925
+ driverParam: unknown;
1926
+ notNull: true;
1927
+ hasDefault: true;
1928
+ isPrimaryKey: false;
1929
+ isAutoincrement: false;
1930
+ hasRuntimeDefault: false;
1931
+ enumValues: undefined;
1932
+ baseColumn: never;
1933
+ identity: undefined;
1934
+ generated: undefined;
1935
+ }, {}, {}>;
1936
+ channelSpec: import("drizzle-orm/pg-core").PgColumn<{
1937
+ name: "channel_spec";
1938
+ tableName: "playbooks";
1939
+ dataType: "json";
1940
+ columnType: "PgJsonb";
1941
+ data: unknown;
1942
+ driverParam: unknown;
1943
+ notNull: true;
1944
+ hasDefault: true;
1945
+ isPrimaryKey: false;
1946
+ isAutoincrement: false;
1947
+ hasRuntimeDefault: false;
1948
+ enumValues: undefined;
1949
+ baseColumn: never;
1950
+ identity: undefined;
1951
+ generated: undefined;
1952
+ }, {}, {}>;
1953
+ expectedOutputs: import("drizzle-orm/pg-core").PgColumn<{
1954
+ name: "expected_outputs";
1955
+ tableName: "playbooks";
1956
+ dataType: "json";
1957
+ columnType: "PgJsonb";
1958
+ data: unknown;
1959
+ driverParam: unknown;
1960
+ notNull: true;
1961
+ hasDefault: true;
1962
+ isPrimaryKey: false;
1963
+ isAutoincrement: false;
1964
+ hasRuntimeDefault: false;
1965
+ enumValues: undefined;
1966
+ baseColumn: never;
1967
+ identity: undefined;
1968
+ generated: undefined;
1969
+ }, {}, {}>;
1970
+ schedule: import("drizzle-orm/pg-core").PgColumn<{
1971
+ name: "schedule";
1972
+ tableName: "playbooks";
1973
+ dataType: "json";
1974
+ columnType: "PgJsonb";
1975
+ data: unknown;
1976
+ driverParam: unknown;
1977
+ notNull: false;
1978
+ hasDefault: false;
1979
+ isPrimaryKey: false;
1980
+ isAutoincrement: false;
1981
+ hasRuntimeDefault: false;
1982
+ enumValues: undefined;
1983
+ baseColumn: never;
1984
+ identity: undefined;
1985
+ generated: undefined;
1986
+ }, {}, {}>;
1987
+ executor: import("drizzle-orm/pg-core").PgColumn<{
1988
+ name: "executor";
1989
+ tableName: "playbooks";
1990
+ dataType: "string";
1991
+ columnType: "PgText";
1992
+ data: PlaybookExecutorRef;
1993
+ driverParam: string;
1994
+ notNull: true;
1995
+ hasDefault: true;
1996
+ isPrimaryKey: false;
1997
+ isAutoincrement: false;
1998
+ hasRuntimeDefault: false;
1999
+ enumValues: [
2000
+ "is-agent",
2001
+ "external-agent",
2002
+ "hybrid"
2003
+ ];
2004
+ baseColumn: never;
2005
+ identity: undefined;
2006
+ generated: undefined;
2007
+ }, {}, {
2008
+ $type: PlaybookExecutorRef;
2009
+ }>;
2010
+ status: import("drizzle-orm/pg-core").PgColumn<{
2011
+ name: "status";
2012
+ tableName: "playbooks";
2013
+ dataType: "string";
2014
+ columnType: "PgText";
2015
+ data: "active" | "draft" | "paused" | "archived";
2016
+ driverParam: string;
2017
+ notNull: true;
2018
+ hasDefault: true;
2019
+ isPrimaryKey: false;
2020
+ isAutoincrement: false;
2021
+ hasRuntimeDefault: false;
2022
+ enumValues: [
2023
+ "draft",
2024
+ "active",
2025
+ "paused",
2026
+ "archived"
2027
+ ];
2028
+ baseColumn: never;
2029
+ identity: undefined;
2030
+ generated: undefined;
2031
+ }, {}, {}>;
2032
+ metadata: import("drizzle-orm/pg-core").PgColumn<{
2033
+ name: "metadata";
2034
+ tableName: "playbooks";
2035
+ dataType: "json";
2036
+ columnType: "PgJsonb";
2037
+ data: unknown;
2038
+ driverParam: unknown;
2039
+ notNull: true;
2040
+ hasDefault: true;
2041
+ isPrimaryKey: false;
2042
+ isAutoincrement: false;
2043
+ hasRuntimeDefault: false;
2044
+ enumValues: undefined;
2045
+ baseColumn: never;
2046
+ identity: undefined;
2047
+ generated: undefined;
2048
+ }, {}, {}>;
2049
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
2050
+ name: "created_at";
2051
+ tableName: "playbooks";
2052
+ dataType: "date";
2053
+ columnType: "PgTimestamp";
2054
+ data: Date;
2055
+ driverParam: string;
2056
+ notNull: true;
2057
+ hasDefault: true;
2058
+ isPrimaryKey: false;
2059
+ isAutoincrement: false;
2060
+ hasRuntimeDefault: false;
2061
+ enumValues: undefined;
2062
+ baseColumn: never;
2063
+ identity: undefined;
2064
+ generated: undefined;
2065
+ }, {}, {}>;
2066
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
2067
+ name: "updated_at";
2068
+ tableName: "playbooks";
2069
+ dataType: "date";
2070
+ columnType: "PgTimestamp";
2071
+ data: Date;
2072
+ driverParam: string;
2073
+ notNull: true;
2074
+ hasDefault: true;
2075
+ isPrimaryKey: false;
2076
+ isAutoincrement: false;
2077
+ hasRuntimeDefault: false;
2078
+ enumValues: undefined;
2079
+ baseColumn: never;
2080
+ identity: undefined;
2081
+ generated: undefined;
2082
+ }, {}, {}>;
2083
+ };
2084
+ dialect: "pg";
2085
+ }>;
2086
+ export type Playbook = typeof playbooks.$inferSelect;
2087
+ /**
2088
+ * Links Schema — the config/runtime graph edges
2089
+ *
2090
+ * A polymorphic edge between CONFIGURATION/RUNTIME objects (playbook · tool ·
2091
+ * skill · command · session · source) and, where useful, entity DATA. This is
2092
+ * the deliberate mirror of the entity `relations` table — `relations` is the
2093
+ * graph for entity DATA; `links` is the graph for everything else — keeping the
2094
+ * data/config separation clean while still letting config point at data.
2095
+ *
2096
+ * ONE table powers every detail page's "related" panel and the capability graph:
2097
+ * `SELECT * FROM links WHERE (from_type,from_id)=$ OR (to_type,to_id)=$`.
2098
+ *
2099
+ * Edge semantics (linkType):
2100
+ * playbook --grants--> tool | skill | command
2101
+ * skill --requires--> tool
2102
+ * command --requires--> tool (command tool deps)
2103
+ * session --instantiated_from--> playbook
2104
+ * session --used--> tool | skill (run provenance)
2105
+ * session --targets--> entity (e.g. a linked task)
2106
+ * session --produced--> entity (run output)
2107
+ * session --promoted_to--> playbook (promotion lineage)
2108
+ * source --feeds--> playbook (input-strategy source)
2109
+ * tool --provided_by--> source (tool backed by a provider)
2110
+ * participant|channel --member_of--> session (room participants)
2111
+ *
2112
+ * Design doc: team/platform/playbooks-capability-substrate.mdx
2113
+ */
2114
+ /**
2115
+ * The kind of object on either end of a link edge.
2116
+ * `participant` = a user-id OR agent-user-id (both live in the `users` table).
2117
+ */
2118
+ export type LinkEndpointType = "playbook" | "tool" | "skill" | "command" | "session" | "source" | "entity" | "channel" | "participant";
2119
+ /** The relationship an edge expresses. */
2120
+ export type LinkType = "grants" | "requires" | "instantiated_from" | "used" | "targets" | "produced" | "member_of" | "feeds" | "promoted_to" | "provided_by";
2121
+ /**
2122
+ * EventRecord - Database representation of an event
2123
+ *
2124
+ * This is the format returned from the database.
2125
+ * It maps directly to the events table structure.
2126
+ */
2127
+ export interface EventRecord {
2128
+ id: string;
2129
+ timestamp: Date;
2130
+ subjectId: string;
2131
+ subjectType: string;
2132
+ eventType: string;
2133
+ userId: string;
2134
+ data: Record<string, unknown>;
2135
+ metadata?: Record<string, unknown>;
2136
+ version: number;
2137
+ causationId?: string;
2138
+ correlationId?: string;
2139
+ source: string;
2140
+ }
2141
+ /** Minimal message fields for list/preview */
2142
+ export interface LinkedMessagePreview {
2143
+ id: string;
2144
+ channelId: string;
2145
+ role: string;
2146
+ content: string;
2147
+ timestamp: Date;
2148
+ userId: string;
2149
+ }
2150
+ export interface LinkedMessageItem {
2151
+ link: MessageLink;
2152
+ message: LinkedMessagePreview;
2153
+ }
2154
+ export interface EffectiveProperty extends PropertyDef {
2155
+ required: boolean;
2156
+ defaultValue: unknown;
2157
+ displayOrder: number;
2158
+ }
2159
+ /**
2160
+ * RendererRef — what a profile or workspace stores as its renderer choice
2161
+ * for a (slot, profile) pair.
2162
+ *
2163
+ * Structural mirror of `RendererTarget` from `@synap-core/renderer-runtime`.
2164
+ * Kept as a structural type in the database layer (rather than importing the
2165
+ * frontend package) so the schema package stays UI-free. The canonical type
2166
+ * lives in `@synap-core/renderer-runtime` and is re-exported by
2167
+ * `@synap-core/profile-renderer` as `RendererRef`.
2168
+ *
2169
+ * Stored as JSONB on `profiles.default_(list|detail)_renderer` and inside
2170
+ * `workspaces.settings.profileRenderers[slug]`.
2171
+ *
2172
+ * Spec: synap-team-docs/content/team/platform/profile-renderer.mdx
2173
+ */
2174
+ export type RendererRef = {
2175
+ kind: "cell";
2176
+ cellKey: string;
2177
+ props: Record<string, unknown>;
2178
+ title?: string;
2179
+ displayMode?: string;
2180
+ rendererHint?: Record<string, unknown>;
2181
+ } | {
2182
+ kind: "view";
2183
+ viewId: string;
2184
+ title?: string;
2185
+ displayMode?: string;
2186
+ } | {
2187
+ kind: "iframe-srcdoc";
2188
+ appId: string;
2189
+ srcdoc: string;
2190
+ title?: string;
2191
+ props?: Record<string, unknown>;
2192
+ } | {
2193
+ kind: "external-app";
2194
+ appId: string;
2195
+ url: string;
2196
+ title?: string;
2197
+ props?: Record<string, unknown>;
2198
+ } | {
2199
+ kind: "url";
2200
+ url: string;
2201
+ external?: boolean;
2202
+ title?: string;
2203
+ } | {
2204
+ kind: "view-adapter";
2205
+ adapterKey: string;
2206
+ props?: Record<string, unknown>;
2207
+ title?: string;
2208
+ };
2209
+ /**
2210
+ * Column definition for views
2211
+ */
2212
+ export interface ViewColumn {
2213
+ id: string;
2214
+ field: string;
2215
+ title?: string;
2216
+ valueType?: string;
2217
+ indexed?: boolean;
2218
+ visible?: boolean;
2219
+ width?: number;
2220
+ }
2221
+ /**
2222
+ * View Query Types
2223
+ *
2224
+ * Single source of truth for all view query and filter types.
2225
+ */
2226
+ /**
2227
+ * Filter operator types
2228
+ */
2229
+ export type FilterOperator = "equals" | "not_equals" | "contains" | "not_contains" | "in" | "not_in" | "is_empty" | "is_not_empty" | "greater_than" | "less_than" | "greater_than_or_equal" | "less_than_or_equal";
2230
+ /**
2231
+ * Filter definition for entity queries
2232
+ */
2233
+ export interface EntityFilter {
2234
+ field: string;
2235
+ operator: FilterOperator;
2236
+ value?: unknown;
2237
+ }
2238
+ /**
2239
+ * Sort rule for entity queries
2240
+ */
2241
+ export interface SortRule {
2242
+ field: string;
2243
+ direction: "asc" | "desc";
2244
+ }
2245
+ /**
2246
+ * Query definition for structured views
2247
+ * Defines which entities to show and how to filter them
2248
+ *
2249
+ * NOTE: profileIds/profileSlugs are now stored in views.scopeProfileIds
2250
+ * This query structure only contains filters, sorts, search, pagination, and groupBy
2251
+ */
2252
+ export interface EntityQuery {
2253
+ /** @deprecated - Profile IDs now stored in views.scopeProfileIds */
2254
+ profileIds?: string[];
2255
+ /** @deprecated - Profile slugs now stored in views.scopeProfileIds (resolved to IDs) */
2256
+ profileSlugs?: string[];
2257
+ /** @deprecated - Use profileSlugs instead, which is also deprecated */
2258
+ entityTypes?: string[];
2259
+ /** Specific entity IDs (for fixed sets) */
2260
+ entityIds?: string[];
2261
+ /** Filter conditions */
2262
+ filters?: EntityFilter[];
2263
+ /** Sort rules (multiple sorts supported) */
2264
+ sorts?: SortRule[];
2265
+ /** Full-text search query */
2266
+ search?: string;
2267
+ /** Maximum number of entities to return */
2268
+ limit?: number;
2269
+ /** Offset for pagination */
2270
+ offset?: number;
2271
+ /** Group by field (for kanban, timeline) */
2272
+ groupBy?: string;
2273
+ }
2274
+ declare enum AgentType {
2275
+ DEFAULT = "default",
2276
+ META = "meta",
2277
+ PROMPTING = "prompting",
2278
+ KNOWLEDGE_SEARCH = "knowledge-search",
2279
+ CODE = "code",
2280
+ WRITING = "writing",
2281
+ ACTION = "action",
2282
+ ONBOARDING = "onboarding",
2283
+ WORKSPACE_CREATION = "workspace-creation"
2284
+ }
2285
+ /**
2286
+ * Agent type as string literal union (for flexibility)
2287
+ */
2288
+ export type AgentTypeString = `${AgentType}` | (string & {});
2289
+ declare enum AIStepType {
2290
+ THINKING = "thinking",
2291
+ TOOL_CALL = "tool_call",
2292
+ TOOL_RESULT = "tool_result",
2293
+ DECISION = "decision",
2294
+ ERROR = "error"
2295
+ }
2296
+ /**
2297
+ * AI step - shows what the AI is doing
2298
+ *
2299
+ * Represents any step in the AI's reasoning/execution process:
2300
+ * - thinking: General analysis and reasoning
2301
+ * - tool_call: When AI calls a tool
2302
+ * - tool_result: Result from tool execution
2303
+ * - decision: AI making a decision
2304
+ * - error: Error during processing
2305
+ */
2306
+ export interface AIStep {
2307
+ id: string;
2308
+ type: AIStepType | string;
2309
+ content: string;
2310
+ toolName?: string;
2311
+ toolInput?: unknown;
2312
+ toolOutput?: unknown;
2313
+ timestamp: string;
2314
+ duration?: number;
2315
+ error?: string;
2316
+ title?: string;
2317
+ description?: string;
2318
+ status?: "pending" | "running" | "complete" | "error";
2319
+ }
2320
+ /**
2321
+ * Branch decision from meta-agent
2322
+ */
2323
+ export interface BranchDecision {
2324
+ shouldBranch: boolean;
2325
+ reason: string;
2326
+ suggestedAgentType?: AgentTypeString;
2327
+ suggestedTitle?: string;
2328
+ suggestedPurpose?: string;
2329
+ }
2330
+ declare const EVENT_ACTIONS: readonly [
2331
+ "create",
2332
+ "update",
2333
+ "delete",
2334
+ "archive",
2335
+ "restore"
2336
+ ];
2337
+ export type EventAction = (typeof EVENT_ACTIONS)[number];
2338
+ /**
2339
+ * Universal Update Request
2340
+ *
2341
+ * The standard envelope for all change requests in the system.
2342
+ * This object is stored in the `proposals` table (as part of StoredProposalData)
2343
+ * and passed in events. changeType aligns with EventAction for event-sourced flow.
2344
+ */
2345
+ export interface UpdateRequest {
2346
+ /** Unique ID for this specific request */
2347
+ requestId: string;
2348
+ /** Who initiated the change? */
2349
+ source: "user" | "ai" | "system" | "intelligence" | "agent" | "openwebui-pipeline" | "openclaw" | "extension" | "cli" | "n8n" | "raycast";
2350
+ sourceId: string;
2351
+ /** Context */
2352
+ workspaceId: string | null;
2353
+ /** Target Entity */
2354
+ targetType: "document" | "entity" | "whiteboard" | "view" | "profile";
2355
+ targetId: string;
2356
+ /** Human-readable target label resolved server-side when available. */
2357
+ targetName?: string;
2358
+ /** What kind of change? (aligns with EventAction) */
2359
+ changeType: EventAction;
2360
+ /**
2361
+ * Lightweight metadata changes (e.g. title rename, status change).
2362
+ * For entities: create/update payload. For documents: not used when proposedContent is used.
2363
+ */
2364
+ data?: Record<string, unknown>;
2365
+ /**
2366
+ * Heavy Content Reference (S3/MinIO).
2367
+ * Used for Documents, Whiteboards, etc.
2368
+ */
1582
2369
  contentRef?: {
1583
2370
  storageKey: string;
1584
2371
  mimeType: string;
@@ -1669,6 +2456,43 @@ export interface ProposalReviewModel {
1669
2456
  graph?: ProposalReviewGraph;
1670
2457
  events: ProposalReviewEvent[];
1671
2458
  }
2459
+ export interface CompositeCreateEntityOp {
2460
+ op: "create_entity";
2461
+ /** Profile slug for the new entity (e.g. "question"). */
2462
+ profileSlug: string;
2463
+ title?: string;
2464
+ description?: string;
2465
+ properties?: Record<string, unknown>;
2466
+ /**
2467
+ * Long-form body. When set, the entity-create path materializes a LINKED
2468
+ * DOCUMENT (versioned, MinIO-stored) instead of inlining into properties.
2469
+ * Used by markdown/document import.
2470
+ */
2471
+ content?: string;
2472
+ /**
2473
+ * Link to an EXISTING entity instead of creating one. When set, the writer
2474
+ * registers this op's ref → existingEntityId (so relations can target it) and
2475
+ * skips creation. Lets a graph mix new and pre-existing entities (capture's
2476
+ * "link don't create" path).
2477
+ */
2478
+ existingEntityId?: string;
2479
+ /**
2480
+ * Stable handle for THIS entity within the proposal, used by relation ops to
2481
+ * reference it (e.g. "t1"). Optional — the positional `$opN` ref always works.
2482
+ */
2483
+ ref?: string;
2484
+ }
2485
+ export interface CompositeCreateRelationOp {
2486
+ op: "create_relation";
2487
+ /** Relation type slug (system type or workspace relation_def). */
2488
+ type: string;
2489
+ /** Source: an op ref ("t1"/"$op0"/PRIMARY_REF) or a real entity UUID. */
2490
+ sourceRef: string;
2491
+ /** Target: an op ref ("t1"/"$op0"/PRIMARY_REF) or a real entity UUID. */
2492
+ targetRef: string;
2493
+ metadata?: Record<string, unknown>;
2494
+ }
2495
+ export type CompositeProposalOperation = CompositeCreateEntityOp | CompositeCreateRelationOp;
1672
2496
  /**
1673
2497
  * Record of what a proposal MATERIALIZED on approval.
1674
2498
  *
@@ -2138,6 +2962,7 @@ export type PaginatedResponse<T> = {
2138
2962
  offset: number;
2139
2963
  };
2140
2964
  };
2965
+ export type ImportRevealSource = "obsidian" | "markdown" | "csv" | "bookmark";
2141
2966
  export interface EnrichmentResult {
2142
2967
  source: string;
2143
2968
  confidence: number;
@@ -2225,6 +3050,52 @@ export interface ReactionEvent {
2225
3050
  /** the fan-out */
2226
3051
  reactions: Reaction[];
2227
3052
  }
3053
+ /**
3054
+ * @synap/playbooks — Playbooks & Capability Substrate contracts
3055
+ *
3056
+ * The pure, I/O-free DOMAIN contracts for the autonomous-capability spine:
3057
+ * Tool · Skill(ref) · Playbook · Link · Executor · PlaybookRun.
3058
+ *
3059
+ * Contains NO database / event / proposal side effects — ONLY types + the
3060
+ * Executor interface. Persistence ROW types live in @synap/database/schema
3061
+ * (tools / playbooks / links); the interfaces here describe the behavioral
3062
+ * shapes the loosely-typed JSONB columns conform to, applied at the domain/API
3063
+ * boundary. Small string-unions are intentionally re-declared here (rather than
3064
+ * imported from @synap/database) so this package stays dependency-free — they
3065
+ * must stay in lock-step with the `.$type<>()` unions in the schema files.
3066
+ *
3067
+ * Design doc: team/platform/playbooks-capability-substrate.mdx
3068
+ */
3069
+ /** IS persona-agent · BYOA external agent (Claude Code, CLI) · hybrid. */
3070
+ export type ExecutorRef = "is-agent" | "external-agent" | "hybrid";
3071
+ /** A credential a Tool/Skill needs at run time — mirrors the vault taxonomy. */
3072
+ export interface CredentialRequirement {
3073
+ /** Logical name the tool/skill references (e.g. "apiKey"). */
3074
+ name: string;
3075
+ secretType: "api-key" | "credential" | "ssh-key" | "oauth-token" | "env-variable" | "connection-string";
3076
+ /** Human-facing reason, surfaced in the vault approval proposal. */
3077
+ purpose?: string;
3078
+ }
3079
+ /** What a Playbook can GRANT / a run uses. (Tools and Skills are linked, not merged.) */
3080
+ export type GrantableKind = "tool" | "skill" | "command";
3081
+ /**
3082
+ * The normalized shape the Phase-1 adapters produce from builtin IS tools,
3083
+ * code/instruction skills, intelligence_commands, and source providers — so a
3084
+ * Playbook can grant capabilities uniformly and the AI can discover them.
3085
+ */
3086
+ /** The full read-model kind set: grantables + the discoverable source systems. */
3087
+ export type CapabilityKind = GrantableKind | "source-provider" | "builtin-tool";
3088
+ export interface Capability {
3089
+ kind: CapabilityKind;
3090
+ id: string;
3091
+ name: string;
3092
+ description?: string | null;
3093
+ inputSchema: Record<string, unknown>;
3094
+ credentials?: CredentialRequirement[];
3095
+ executor: ExecutorRef;
3096
+ /** Whether AI use is auto-approved or routed through a proposal. */
3097
+ governance: "auto" | "propose";
3098
+ }
2228
3099
  /**
2229
3100
  * Core API Router
2230
3101
  */
@@ -2359,6 +3230,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2359
3230
  context?: Record<string, unknown> | undefined;
2360
3231
  };
2361
3232
  output: {
3233
+ propertiesDropped?: true | undefined;
3234
+ degradedFrom?: string | undefined;
2362
3235
  success: boolean;
2363
3236
  entityId: string;
2364
3237
  profileSlug: string;
@@ -2369,7 +3242,13 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2369
3242
  }>;
2370
3243
  structure: import("@trpc/server").TRPCMutationProcedure<{
2371
3244
  input: {
2372
- text: string;
3245
+ text?: string | undefined;
3246
+ file?: {
3247
+ content: string;
3248
+ mimeType: string;
3249
+ filename?: string | undefined;
3250
+ encoding?: "base64" | "utf8" | undefined;
3251
+ } | undefined;
2373
3252
  url?: string | undefined;
2374
3253
  html?: string | undefined;
2375
3254
  context?: string | undefined;
@@ -2382,6 +3261,63 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2382
3261
  }[] | undefined;
2383
3262
  };
2384
3263
  output: {
3264
+ proposals: {
3265
+ tempId: string;
3266
+ profileSlug: string;
3267
+ title: string;
3268
+ description: string | undefined;
3269
+ properties: {
3270
+ content: string;
3271
+ };
3272
+ confidence: number;
3273
+ }[];
3274
+ relations: Array<{
3275
+ sourceTempId: string;
3276
+ targetTempId: string;
3277
+ relationType: string;
3278
+ }>;
3279
+ followUp: string | null;
3280
+ targetWorkspaceId: string | null;
3281
+ dedupCandidates: Record<string, Array<{
3282
+ entityId: string;
3283
+ title: string;
3284
+ profileSlug: string;
3285
+ score: number;
3286
+ }>>;
3287
+ degraded: true;
3288
+ degradedReason: "is_auth_error" | "is_invalid_response" | "is_empty_result";
3289
+ } | {
3290
+ extraction: {
3291
+ kind: string;
3292
+ extractor: string;
3293
+ metadata?: Record<string, unknown>;
3294
+ warnings?: string[];
3295
+ };
3296
+ dedupSkipped?: true | undefined;
3297
+ proposals: {
3298
+ tempId: string;
3299
+ profileSlug: string;
3300
+ title: string;
3301
+ description?: string;
3302
+ properties?: Record<string, unknown>;
3303
+ confidence: number;
3304
+ }[];
3305
+ relations: {
3306
+ sourceTempId: string;
3307
+ targetTempId: string;
3308
+ relationType: string;
3309
+ }[];
3310
+ followUp: string | null;
3311
+ targetWorkspaceId: string | null;
3312
+ dedupCandidates: Record<string, {
3313
+ entityId: string;
3314
+ title: string;
3315
+ profileSlug: string;
3316
+ score: number;
3317
+ }[]>;
3318
+ } | {
3319
+ extraction?: undefined;
3320
+ dedupSkipped?: true | undefined;
2385
3321
  proposals: {
2386
3322
  tempId: string;
2387
3323
  profileSlug: string;
@@ -2443,6 +3379,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2443
3379
  };
2444
3380
  output: {
2445
3381
  created: {
3382
+ propertiesDropped?: true | undefined;
3383
+ degradedFrom?: string | undefined;
2446
3384
  tempId: string;
2447
3385
  entityId: string;
2448
3386
  profileSlug: string;
@@ -2549,9 +3487,9 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2549
3487
  output: {
2550
3488
  status: string;
2551
3489
  message: string;
2552
- id: `${string}-${string}-${string}-${string}-${string}`;
2553
3490
  entity: Record<string, unknown> | null;
2554
3491
  proposalId: string;
3492
+ id?: undefined;
2555
3493
  } | {
2556
3494
  status: string;
2557
3495
  message: string;
@@ -2588,6 +3526,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
2588
3526
  profileSlug?: string | undefined;
2589
3527
  includeDescendants?: boolean | undefined;
2590
3528
  globalOnly?: boolean | undefined;
3529
+ includePodWide?: boolean | undefined;
3530
+ sourceProposalId?: string | undefined;
2591
3531
  };
2592
3532
  output: {
2593
3533
  items: {
@@ -3091,7 +4031,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3091
4031
  createAgentCollabChannel: import("@trpc/server").TRPCMutationProcedure<{
3092
4032
  input: {
3093
4033
  topic: string;
3094
- visibility?: "open" | "closed" | undefined;
4034
+ visibility?: "closed" | "open" | undefined;
3095
4035
  participants?: string[] | undefined;
3096
4036
  title?: string | undefined;
3097
4037
  };
@@ -3214,6 +4154,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3214
4154
  output: {
3215
4155
  messages: {
3216
4156
  userId: string;
4157
+ sessionId: string | null;
3217
4158
  id: string;
3218
4159
  timestamp: Date;
3219
4160
  metadata: {
@@ -3296,7 +4237,6 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
3296
4237
  routedSource: "orchestrator" | "mention" | "direct" | null;
3297
4238
  previousHash: string | null;
3298
4239
  hash: string;
3299
- sessionId: string | null;
3300
4240
  }[];
3301
4241
  nextCursor: string | undefined;
3302
4242
  hasMore: boolean;
@@ -4021,6 +4961,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4021
4961
  targetType?: "entity" | "document" | "view" | "whiteboard" | "profile" | undefined;
4022
4962
  targetId?: string | undefined;
4023
4963
  threadId?: string | undefined;
4964
+ correlationId?: string | undefined;
4965
+ sessionId?: string | undefined;
4024
4966
  agentUserId?: string | undefined;
4025
4967
  agentOnly?: boolean | undefined;
4026
4968
  includeExpired?: boolean | undefined;
@@ -4032,6 +4974,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4032
4974
  viewerCanReview: boolean;
4033
4975
  workspaceId: string | null;
4034
4976
  sourceMessageId: string | null;
4977
+ sessionId: string | null;
4035
4978
  id: string;
4036
4979
  data: unknown;
4037
4980
  updatedAt: Date;
@@ -4067,6 +5010,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4067
5010
  viewerCanReview: boolean;
4068
5011
  workspaceId: string | null;
4069
5012
  sourceMessageId: string | null;
5013
+ sessionId: string | null;
4070
5014
  id: string;
4071
5015
  data: unknown;
4072
5016
  updatedAt: Date;
@@ -4101,6 +5045,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4101
5045
  output: {
4102
5046
  workspaceId: string | null;
4103
5047
  sourceMessageId: string | null;
5048
+ sessionId: string | null;
4104
5049
  id: string;
4105
5050
  data: unknown;
4106
5051
  updatedAt: Date;
@@ -4465,7 +5410,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
4465
5410
  output: {
4466
5411
  timestamp: string;
4467
5412
  health: {
4468
- status: "healthy" | "degraded" | "critical";
5413
+ status: "degraded" | "healthy" | "critical";
4469
5414
  errorRate: number;
4470
5415
  };
4471
5416
  throughput: {
@@ -8141,6 +9086,13 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
8141
9086
  [x: string]: unknown;
8142
9087
  workspaceName?: string | undefined;
8143
9088
  description?: string | undefined;
9089
+ extends?: {
9090
+ source: string;
9091
+ import?: {
9092
+ profiles?: string[] | undefined;
9093
+ views?: string[] | undefined;
9094
+ } | undefined;
9095
+ }[] | undefined;
8144
9096
  profiles?: {
8145
9097
  slug: string;
8146
9098
  displayName: string;
@@ -8268,7 +9220,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
8268
9220
  profileEntityBentoTemplates?: Record<string, {
8269
9221
  blocks: Record<string, unknown>[];
8270
9222
  }> | undefined;
8271
- workspacePurpose?: "personal" | "agent" | "project" | "library" | "operational" | undefined;
9223
+ workspacePurpose?: "personal" | "agent" | "library" | "project" | "operational" | undefined;
8272
9224
  workspaceSubtype?: string | undefined;
8273
9225
  workspaceVisibility?: "members" | "private" | "pod_visible" | "pod_joinable" | "public_link" | undefined;
8274
9226
  workspaceCapabilities?: string[] | undefined;
@@ -9104,6 +10056,18 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
9104
10056
  };
9105
10057
  meta: object;
9106
10058
  }>;
10059
+ setDefaultCompanion: import("@trpc/server").TRPCMutationProcedure<{
10060
+ input: {
10061
+ agentId: string | null;
10062
+ };
10063
+ output: {
10064
+ success: boolean;
10065
+ preferences: {
10066
+ [x: string]: unknown;
10067
+ };
10068
+ };
10069
+ meta: object;
10070
+ }>;
9107
10071
  setIntelligenceService: import("@trpc/server").TRPCMutationProcedure<{
9108
10072
  input: {
9109
10073
  serviceId: string | null;
@@ -9519,7 +10483,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
9519
10483
  fieldMapping: Record<string, {
9520
10484
  slot: string;
9521
10485
  renderer?: {
9522
- type: "number" | "date" | "relations" | "tag" | "link" | "text" | "badge" | "avatar" | "progress" | "checkbox" | "currency";
10486
+ type: "number" | "date" | "relations" | "tag" | "progress" | "link" | "text" | "badge" | "avatar" | "checkbox" | "currency";
9523
10487
  variant?: string | undefined;
9524
10488
  size?: string | undefined;
9525
10489
  format?: string | undefined;
@@ -9633,7 +10597,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
9633
10597
  fieldMapping: Record<string, {
9634
10598
  slot: string;
9635
10599
  renderer?: {
9636
- type: "number" | "date" | "relations" | "tag" | "link" | "text" | "badge" | "avatar" | "progress" | "checkbox" | "currency";
10600
+ type: "number" | "date" | "relations" | "tag" | "progress" | "link" | "text" | "badge" | "avatar" | "checkbox" | "currency";
9637
10601
  variant?: string | undefined;
9638
10602
  size?: string | undefined;
9639
10603
  format?: string | undefined;
@@ -10998,7 +11962,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
10998
11962
  output: {
10999
11963
  relationDefs: {
11000
11964
  userId: string;
11001
- workspaceId: string;
11965
+ workspaceId: string | null;
11002
11966
  id: string;
11003
11967
  updatedAt: Date;
11004
11968
  createdAt: Date;
@@ -11022,7 +11986,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
11022
11986
  output: {
11023
11987
  relationDef: {
11024
11988
  userId: string;
11025
- workspaceId: string;
11989
+ workspaceId: string | null;
11026
11990
  id: string;
11027
11991
  updatedAt: Date;
11028
11992
  createdAt: Date;
@@ -11046,7 +12010,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
11046
12010
  output: {
11047
12011
  relationDef: {
11048
12012
  userId: string;
11049
- workspaceId: string;
12013
+ workspaceId: string | null;
11050
12014
  id: string;
11051
12015
  updatedAt: Date;
11052
12016
  createdAt: Date;
@@ -11551,7 +12515,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
11551
12515
  }>;
11552
12516
  workspaceList: import("@trpc/server").TRPCQueryProcedure<{
11553
12517
  input: {
11554
- ownerType?: "provider" | "system" | undefined;
12518
+ ownerType?: "user" | "provider" | "system" | undefined;
11555
12519
  };
11556
12520
  output: {
11557
12521
  id: string;
@@ -12090,6 +13054,44 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12090
13054
  };
12091
13055
  meta: object;
12092
13056
  }>;
13057
+ analyze: import("@trpc/server").TRPCMutationProcedure<{
13058
+ input: {
13059
+ source: "markdown" | "obsidian" | "csv" | "bookmark";
13060
+ items: {
13061
+ path: string;
13062
+ content: string;
13063
+ }[];
13064
+ workspaceId?: string | undefined;
13065
+ relationType?: string | undefined;
13066
+ aiStructure?: boolean | undefined;
13067
+ };
13068
+ output: {
13069
+ workspaceId: string;
13070
+ source: ImportRevealSource;
13071
+ mode: "deep" | "shallow";
13072
+ proposalId: string | null;
13073
+ operations: CompositeProposalOperation[];
13074
+ summary: string;
13075
+ stats: Record<string, unknown>;
13076
+ droppedReferences: number;
13077
+ aiTyped: number;
13078
+ };
13079
+ meta: object;
13080
+ }>;
13081
+ applyImport: import("@trpc/server").TRPCMutationProcedure<{
13082
+ input: {
13083
+ source: "markdown" | "obsidian" | "csv" | "bookmark";
13084
+ operations: Record<string, unknown>[];
13085
+ workspaceId?: string | undefined;
13086
+ };
13087
+ output: {
13088
+ workspaceId: string;
13089
+ source: ImportRevealSource;
13090
+ created: number;
13091
+ linked: number;
13092
+ };
13093
+ meta: object;
13094
+ }>;
12093
13095
  linkedInContacts: import("@trpc/server").TRPCMutationProcedure<{
12094
13096
  input: {
12095
13097
  contacts: {
@@ -12381,7 +13383,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12381
13383
  list: import("@trpc/server").TRPCQueryProcedure<{
12382
13384
  input: {
12383
13385
  status?: "read" | "unread" | "dismissed" | "all" | undefined;
12384
- category?: "data" | "system" | "ai" | "governance" | "inbox" | undefined;
13386
+ category?: "data" | "system" | "governance" | "ai" | "inbox" | undefined;
12385
13387
  limit?: number | undefined;
12386
13388
  offset?: number | undefined;
12387
13389
  };
@@ -12391,8 +13393,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12391
13393
  workspaceId: string | null;
12392
13394
  userId: string;
12393
13395
  type: string;
12394
- category: "data" | "system" | "ai" | "governance" | "inbox";
12395
- priority: "normal" | "low" | "high" | "urgent";
13396
+ category: "data" | "system" | "governance" | "ai" | "inbox";
13397
+ priority: "low" | "normal" | "high" | "urgent";
12396
13398
  title: string;
12397
13399
  body: string;
12398
13400
  icon: string | null;
@@ -12413,7 +13415,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12413
13415
  listAll: import("@trpc/server").TRPCQueryProcedure<{
12414
13416
  input: {
12415
13417
  status?: "read" | "unread" | "dismissed" | "all" | undefined;
12416
- category?: "data" | "system" | "ai" | "governance" | "inbox" | undefined;
13418
+ category?: "data" | "system" | "governance" | "ai" | "inbox" | undefined;
12417
13419
  limit?: number | undefined;
12418
13420
  offset?: number | undefined;
12419
13421
  };
@@ -12423,8 +13425,8 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12423
13425
  workspaceId: string | null;
12424
13426
  userId: string;
12425
13427
  type: string;
12426
- category: "data" | "system" | "ai" | "governance" | "inbox";
12427
- priority: "normal" | "low" | "high" | "urgent";
13428
+ category: "data" | "system" | "governance" | "ai" | "inbox";
13429
+ priority: "low" | "normal" | "high" | "urgent";
12428
13430
  title: string;
12429
13431
  body: string;
12430
13432
  icon: string | null;
@@ -12643,22 +13645,15 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12643
13645
  addPeer: import("@trpc/server").TRPCMutationProcedure<{
12644
13646
  input: {
12645
13647
  peerPodUrl: string;
12646
- direction: "push" | "pull";
13648
+ direction: "push" | "bidirectional" | "pull";
12647
13649
  label?: string | undefined;
12648
13650
  authToken?: string | undefined;
12649
13651
  workspaceIds?: string[] | undefined;
13652
+ localRole?: "primary" | "secondary" | "unset" | undefined;
12650
13653
  enabled?: boolean | undefined;
12651
13654
  };
12652
13655
  output: {
12653
- id: string;
12654
- updatedAt: Date;
12655
- createdAt: Date;
12656
- enabled: boolean;
12657
- peerPodUrl: string;
12658
- direction: string;
12659
- label: string | null;
12660
- authToken: string | null;
12661
- workspaceIds: string[] | null;
13656
+ peerId: string;
12662
13657
  };
12663
13658
  meta: object;
12664
13659
  }>;
@@ -12678,6 +13673,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12678
13673
  label?: string | undefined;
12679
13674
  authToken?: string | undefined;
12680
13675
  workspaceIds?: string[] | null | undefined;
13676
+ localRole?: "primary" | "secondary" | "unset" | undefined;
12681
13677
  enabled?: boolean | undefined;
12682
13678
  };
12683
13679
  output: {
@@ -12688,6 +13684,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12688
13684
  label: string | null;
12689
13685
  authToken: string | null;
12690
13686
  workspaceIds: string[] | null;
13687
+ localRole: string | null;
12691
13688
  createdAt: Date;
12692
13689
  updatedAt: Date;
12693
13690
  };
@@ -12721,6 +13718,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12721
13718
  label: string | null;
12722
13719
  authToken: string | null;
12723
13720
  workspaceIds: string[] | null;
13721
+ localRole: string | null;
12724
13722
  }[];
12725
13723
  meta: object;
12726
13724
  }>;
@@ -12922,25 +13920,172 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12922
13920
  input: {
12923
13921
  id: string;
12924
13922
  patch: {
12925
- name?: string | undefined;
12926
- description?: string | null | undefined;
12927
- config?: Record<string, unknown> | undefined;
12928
- enabled?: boolean | undefined;
13923
+ name?: string | undefined;
13924
+ description?: string | null | undefined;
13925
+ config?: Record<string, unknown> | undefined;
13926
+ enabled?: boolean | undefined;
13927
+ };
13928
+ };
13929
+ output: {
13930
+ id: string;
13931
+ userId: string;
13932
+ workspaceId: string | null;
13933
+ providerType: string;
13934
+ name: string;
13935
+ description: string | null;
13936
+ config: Record<string, unknown>;
13937
+ enabled: boolean;
13938
+ metadata: Record<string, unknown> | null;
13939
+ lastTestedAt: Date | null;
13940
+ lastTestStatus: string | null;
13941
+ lastTestError: string | null;
13942
+ createdAt: Date;
13943
+ updatedAt: Date;
13944
+ };
13945
+ meta: object;
13946
+ }>;
13947
+ delete: import("@trpc/server").TRPCMutationProcedure<{
13948
+ input: {
13949
+ id: string;
13950
+ };
13951
+ output: {
13952
+ ok: boolean;
13953
+ };
13954
+ meta: object;
13955
+ }>;
13956
+ testConnection: import("@trpc/server").TRPCMutationProcedure<{
13957
+ input: {
13958
+ id: string;
13959
+ };
13960
+ output: {
13961
+ ok: boolean;
13962
+ error?: string;
13963
+ sampleCount?: number;
13964
+ };
13965
+ meta: object;
13966
+ }>;
13967
+ }>>;
13968
+ sourceSubscriptions: import("@trpc/server").TRPCBuiltRouter<{
13969
+ ctx: Context;
13970
+ meta: object;
13971
+ errorShape: {
13972
+ message: string;
13973
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
13974
+ data: import("@trpc/server").TRPCDefaultErrorData;
13975
+ };
13976
+ transformer: true;
13977
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13978
+ list: import("@trpc/server").TRPCQueryProcedure<{
13979
+ input: {
13980
+ workspaceId?: string | undefined;
13981
+ status?: "error" | "active" | "paused" | undefined;
13982
+ limit?: number | undefined;
13983
+ offset?: number | undefined;
13984
+ };
13985
+ output: {
13986
+ id: string;
13987
+ userId: string;
13988
+ workspaceId: string | null;
13989
+ feedId: string;
13990
+ sourceConfigId: string;
13991
+ params: Record<string, unknown>;
13992
+ cursor: string | null;
13993
+ lastFetchedAt: Date | null;
13994
+ lastItemAt: Date | null;
13995
+ status: string;
13996
+ errorMessage: string | null;
13997
+ createdAt: Date;
13998
+ updatedAt: Date;
13999
+ }[];
14000
+ meta: object;
14001
+ }>;
14002
+ listBySourceConfig: import("@trpc/server").TRPCQueryProcedure<{
14003
+ input: {
14004
+ sourceConfigId: string;
14005
+ };
14006
+ output: {
14007
+ id: string;
14008
+ userId: string;
14009
+ workspaceId: string | null;
14010
+ feedId: string;
14011
+ sourceConfigId: string;
14012
+ params: Record<string, unknown>;
14013
+ cursor: string | null;
14014
+ lastFetchedAt: Date | null;
14015
+ lastItemAt: Date | null;
14016
+ status: string;
14017
+ errorMessage: string | null;
14018
+ createdAt: Date;
14019
+ updatedAt: Date;
14020
+ }[];
14021
+ meta: object;
14022
+ }>;
14023
+ get: import("@trpc/server").TRPCQueryProcedure<{
14024
+ input: {
14025
+ id: string;
14026
+ };
14027
+ output: {
14028
+ id: string;
14029
+ feedId: string;
14030
+ params: Record<string, unknown>;
14031
+ cursor: string | null;
14032
+ lastFetchedAt: Date | null;
14033
+ status: string;
14034
+ errorMessage: string | null;
14035
+ sourceConfig: {
14036
+ id: string;
14037
+ providerType: string;
14038
+ name: string;
14039
+ enabled: boolean;
14040
+ };
14041
+ };
14042
+ meta: object;
14043
+ }>;
14044
+ create: import("@trpc/server").TRPCMutationProcedure<{
14045
+ input: {
14046
+ feedId: string;
14047
+ sourceConfigId: string;
14048
+ params?: Record<string, unknown> | undefined;
14049
+ workspaceId?: string | null | undefined;
14050
+ };
14051
+ output: {
14052
+ userId: string;
14053
+ workspaceId: string | null;
14054
+ id: string;
14055
+ errorMessage: string | null;
14056
+ updatedAt: Date;
14057
+ createdAt: Date;
14058
+ status: string;
14059
+ lastFetchedAt: Date | null;
14060
+ feedId: string;
14061
+ sourceConfigId: string;
14062
+ params: Record<string, unknown>;
14063
+ cursor: string | null;
14064
+ lastItemAt: Date | null;
14065
+ };
14066
+ meta: object;
14067
+ }>;
14068
+ update: import("@trpc/server").TRPCMutationProcedure<{
14069
+ input: {
14070
+ id: string;
14071
+ patch: {
14072
+ params?: Record<string, unknown> | undefined;
14073
+ status?: "error" | "active" | "paused" | undefined;
14074
+ cursor?: string | undefined;
12929
14075
  };
12930
14076
  };
12931
14077
  output: {
12932
14078
  id: string;
12933
14079
  userId: string;
12934
14080
  workspaceId: string | null;
12935
- providerType: string;
12936
- name: string;
12937
- description: string | null;
12938
- config: Record<string, unknown>;
12939
- enabled: boolean;
12940
- metadata: Record<string, unknown> | null;
12941
- lastTestedAt: Date | null;
12942
- lastTestStatus: string | null;
12943
- lastTestError: string | null;
14081
+ feedId: string;
14082
+ sourceConfigId: string;
14083
+ params: Record<string, unknown>;
14084
+ cursor: string | null;
14085
+ lastFetchedAt: Date | null;
14086
+ lastItemAt: Date | null;
14087
+ status: string;
14088
+ errorMessage: string | null;
12944
14089
  createdAt: Date;
12945
14090
  updatedAt: Date;
12946
14091
  };
@@ -12955,34 +14100,30 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12955
14100
  };
12956
14101
  meta: object;
12957
14102
  }>;
12958
- testConnection: import("@trpc/server").TRPCMutationProcedure<{
14103
+ pause: import("@trpc/server").TRPCMutationProcedure<{
12959
14104
  input: {
12960
14105
  id: string;
12961
14106
  };
12962
14107
  output: {
12963
- ok: boolean;
12964
- error?: string;
12965
- sampleCount?: number;
14108
+ id: string;
14109
+ userId: string;
14110
+ workspaceId: string | null;
14111
+ feedId: string;
14112
+ sourceConfigId: string;
14113
+ params: Record<string, unknown>;
14114
+ cursor: string | null;
14115
+ lastFetchedAt: Date | null;
14116
+ lastItemAt: Date | null;
14117
+ status: string;
14118
+ errorMessage: string | null;
14119
+ createdAt: Date;
14120
+ updatedAt: Date;
12966
14121
  };
12967
14122
  meta: object;
12968
14123
  }>;
12969
- }>>;
12970
- sourceSubscriptions: import("@trpc/server").TRPCBuiltRouter<{
12971
- ctx: Context;
12972
- meta: object;
12973
- errorShape: {
12974
- message: string;
12975
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
12976
- data: import("@trpc/server").TRPCDefaultErrorData;
12977
- };
12978
- transformer: true;
12979
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
12980
- list: import("@trpc/server").TRPCQueryProcedure<{
14124
+ resume: import("@trpc/server").TRPCMutationProcedure<{
12981
14125
  input: {
12982
- workspaceId?: string | undefined;
12983
- status?: "error" | "active" | "paused" | undefined;
12984
- limit?: number | undefined;
12985
- offset?: number | undefined;
14126
+ id: string;
12986
14127
  };
12987
14128
  output: {
12988
14129
  id: string;
@@ -12998,12 +14139,15 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
12998
14139
  errorMessage: string | null;
12999
14140
  createdAt: Date;
13000
14141
  updatedAt: Date;
13001
- }[];
14142
+ };
13002
14143
  meta: object;
13003
14144
  }>;
13004
- listBySourceConfig: import("@trpc/server").TRPCQueryProcedure<{
14145
+ updateCursor: import("@trpc/server").TRPCMutationProcedure<{
13005
14146
  input: {
13006
- sourceConfigId: string;
14147
+ id: string;
14148
+ cursor: string;
14149
+ lastFetchedAt?: unknown;
14150
+ lastItemAt?: unknown;
13007
14151
  };
13008
14152
  output: {
13009
14153
  id: string;
@@ -13019,157 +14163,314 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
13019
14163
  errorMessage: string | null;
13020
14164
  createdAt: Date;
13021
14165
  updatedAt: Date;
13022
- }[];
14166
+ };
13023
14167
  meta: object;
13024
14168
  }>;
13025
- get: import("@trpc/server").TRPCQueryProcedure<{
14169
+ }>>;
14170
+ feeds: import("@trpc/server").TRPCBuiltRouter<{
14171
+ ctx: Context;
14172
+ meta: object;
14173
+ errorShape: {
14174
+ message: string;
14175
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
14176
+ data: import("@trpc/server").TRPCDefaultErrorData;
14177
+ };
14178
+ transformer: true;
14179
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
14180
+ list: import("@trpc/server").TRPCQueryProcedure<{
13026
14181
  input: {
13027
- id: string;
14182
+ workspaceId?: string | undefined;
14183
+ sourceConfigId?: string | undefined;
14184
+ status?: "error" | "active" | "paused" | undefined;
14185
+ limit?: number | undefined;
14186
+ offset?: number | undefined;
13028
14187
  };
13029
14188
  output: {
14189
+ derivedQueryCount: number;
14190
+ derivedQueries: {
14191
+ upstreamType: string;
14192
+ label: string;
14193
+ }[] | undefined;
13030
14194
  id: string;
13031
14195
  feedId: string;
13032
14196
  params: Record<string, unknown>;
13033
14197
  cursor: string | null;
13034
14198
  lastFetchedAt: Date | null;
14199
+ lastItemAt: Date | null;
13035
14200
  status: string;
13036
14201
  errorMessage: string | null;
13037
14202
  sourceConfig: {
13038
14203
  id: string;
13039
- providerType: string;
13040
14204
  name: string;
14205
+ providerType: string;
13041
14206
  enabled: boolean;
13042
14207
  };
14208
+ }[];
14209
+ meta: object;
14210
+ }>;
14211
+ recentItems: import("@trpc/server").TRPCQueryProcedure<{
14212
+ input: {
14213
+ subscriptionId: string;
14214
+ limit?: number | undefined;
14215
+ };
14216
+ output: {
14217
+ subscription: {
14218
+ id: string;
14219
+ feedId: string;
14220
+ status: string;
14221
+ lastFetchedAt: Date | null;
14222
+ lastItemAt: Date | null;
14223
+ errorMessage: string | null;
14224
+ };
14225
+ messageLimit: number;
14226
+ note: string;
13043
14227
  };
13044
14228
  meta: object;
13045
14229
  }>;
13046
- create: import("@trpc/server").TRPCMutationProcedure<{
14230
+ updateLastFetched: import("@trpc/server").TRPCMutationProcedure<{
13047
14231
  input: {
14232
+ id: string;
14233
+ cursor?: string | undefined;
14234
+ lastItemAt?: unknown;
14235
+ };
14236
+ output: {
14237
+ id: string;
14238
+ userId: string;
14239
+ workspaceId: string | null;
13048
14240
  feedId: string;
13049
14241
  sourceConfigId: string;
13050
- params?: Record<string, unknown> | undefined;
13051
- workspaceId?: string | null | undefined;
14242
+ params: Record<string, unknown>;
14243
+ cursor: string | null;
14244
+ lastFetchedAt: Date | null;
14245
+ lastItemAt: Date | null;
14246
+ status: string;
14247
+ errorMessage: string | null;
14248
+ createdAt: Date;
14249
+ updatedAt: Date;
14250
+ };
14251
+ meta: object;
14252
+ }>;
14253
+ healthSummary: import("@trpc/server").TRPCQueryProcedure<{
14254
+ input: void;
14255
+ output: {
14256
+ total: number;
14257
+ active: number;
14258
+ paused: number;
14259
+ error: number;
14260
+ recentlyFetched: number;
14261
+ lastRefreshed: Date;
14262
+ };
14263
+ meta: object;
14264
+ }>;
14265
+ countBySourceConfig: import("@trpc/server").TRPCQueryProcedure<{
14266
+ input: void;
14267
+ output: {
14268
+ sourceConfigId: string;
14269
+ sourceConfigName: string | null;
14270
+ providerType: string | null;
14271
+ count: number;
14272
+ }[];
14273
+ meta: object;
14274
+ }>;
14275
+ }>>;
14276
+ devplane: import("@trpc/server").TRPCBuiltRouter<{
14277
+ ctx: Context;
14278
+ meta: object;
14279
+ errorShape: {
14280
+ message: string;
14281
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
14282
+ data: import("@trpc/server").TRPCDefaultErrorData;
14283
+ };
14284
+ transformer: true;
14285
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
14286
+ bootstrap: import("@trpc/server").TRPCMutationProcedure<{
14287
+ input: Record<string, never> | undefined;
14288
+ output: {
14289
+ success: boolean;
14290
+ message: string;
14291
+ profilesCreated: number;
14292
+ propertiesCreated: number;
14293
+ linksCreated: number;
14294
+ };
14295
+ meta: object;
14296
+ }>;
14297
+ getEnvironmentInfo: import("@trpc/server").TRPCQueryProcedure<{
14298
+ input: {
14299
+ environmentEntityId: string;
14300
+ };
14301
+ output: {
14302
+ id: string;
14303
+ name: string;
14304
+ host: string | null;
14305
+ port: number;
14306
+ sshUser: string | null;
14307
+ hasKey: boolean;
14308
+ };
14309
+ meta: object;
14310
+ }>;
14311
+ getRecipe: import("@trpc/server").TRPCQueryProcedure<{
14312
+ input: {
14313
+ recipeEntityId: string;
14314
+ };
14315
+ output: {
14316
+ id: string;
14317
+ title: string;
14318
+ recipeName: string | null;
14319
+ recipeDescription: string | null;
14320
+ steps: RecipeStep[];
14321
+ linkedEnvironmentId: string | null;
14322
+ linkedAppSlug: string | null;
14323
+ onFailure: "rollback" | "stop" | "continue";
14324
+ rollbackRecipeId: string | null;
14325
+ recipeTemplate: "custom" | "kamal" | "docker-compose" | "git-pull" | null;
14326
+ };
14327
+ meta: object;
14328
+ }>;
14329
+ listRecipeRuns: import("@trpc/server").TRPCQueryProcedure<{
14330
+ input: {
14331
+ recipeId?: string | undefined;
14332
+ };
14333
+ output: {
14334
+ id: string;
14335
+ title: string;
14336
+ recipeId: string | null;
14337
+ runStatus: "success" | "running" | "failed" | "cancelled" | null;
14338
+ runSteps: RunStep[];
14339
+ runStartedAt: string | null;
14340
+ runFinishedAt: string | null;
14341
+ runDuration: number | null;
14342
+ triggeredBy: "manual" | "automation";
14343
+ createdAt: Date;
14344
+ }[];
14345
+ meta: object;
14346
+ }>;
14347
+ seedSynapProjectData: import("@trpc/server").TRPCMutationProcedure<{
14348
+ input: Record<string, never> | undefined;
14349
+ output: {
14350
+ seeded: boolean;
14351
+ message: string;
14352
+ counts?: undefined;
14353
+ } | {
14354
+ seeded: boolean;
14355
+ counts: {
14356
+ apps: number;
14357
+ services: number;
14358
+ packages: number;
14359
+ features: number;
14360
+ environments: number;
14361
+ recipes: number;
14362
+ };
14363
+ message?: undefined;
13052
14364
  };
14365
+ meta: object;
14366
+ }>;
14367
+ seedDefaultSnippets: import("@trpc/server").TRPCMutationProcedure<{
14368
+ input: Record<string, never> | undefined;
13053
14369
  output: {
13054
- userId: string;
13055
- workspaceId: string | null;
13056
- id: string;
13057
- errorMessage: string | null;
13058
- updatedAt: Date;
13059
- createdAt: Date;
13060
- status: string;
13061
- lastFetchedAt: Date | null;
13062
- feedId: string;
13063
- sourceConfigId: string;
13064
- params: Record<string, unknown>;
13065
- cursor: string | null;
13066
- lastItemAt: Date | null;
14370
+ seeded: boolean;
14371
+ message: string;
14372
+ count?: undefined;
14373
+ } | {
14374
+ seeded: boolean;
14375
+ count: number;
14376
+ message?: undefined;
13067
14377
  };
13068
14378
  meta: object;
13069
14379
  }>;
13070
- update: import("@trpc/server").TRPCMutationProcedure<{
14380
+ saveProviderApiKey: import("@trpc/server").TRPCMutationProcedure<{
13071
14381
  input: {
13072
- id: string;
13073
- patch: {
13074
- params?: Record<string, unknown> | undefined;
13075
- status?: "error" | "active" | "paused" | undefined;
13076
- cursor?: string | undefined;
13077
- };
14382
+ providerType: "openai" | "anthropic" | "openrouter";
14383
+ apiKey: string;
13078
14384
  };
13079
14385
  output: {
13080
- id: string;
13081
- userId: string;
13082
- workspaceId: string | null;
13083
- feedId: string;
13084
- sourceConfigId: string;
13085
- params: Record<string, unknown>;
13086
- cursor: string | null;
13087
- lastFetchedAt: Date | null;
13088
- lastItemAt: Date | null;
13089
- status: string;
13090
- errorMessage: string | null;
13091
- createdAt: Date;
13092
- updatedAt: Date;
14386
+ ok: boolean;
13093
14387
  };
13094
14388
  meta: object;
13095
14389
  }>;
13096
- delete: import("@trpc/server").TRPCMutationProcedure<{
14390
+ saveEntitySecret: import("@trpc/server").TRPCMutationProcedure<{
13097
14391
  input: {
13098
- id: string;
14392
+ entityId: string;
14393
+ propertySlug: "sshKeyVaultRef" | "npmTokenVaultRef" | "githubTokenVaultRef";
14394
+ secretValue: string;
14395
+ secretName?: string | undefined;
13099
14396
  };
13100
14397
  output: {
13101
- ok: boolean;
14398
+ vaultRef: string;
13102
14399
  };
13103
14400
  meta: object;
13104
14401
  }>;
13105
- pause: import("@trpc/server").TRPCMutationProcedure<{
14402
+ resolveEntitySecret: import("@trpc/server").TRPCMutationProcedure<{
13106
14403
  input: {
13107
- id: string;
14404
+ vaultRef: string;
13108
14405
  };
13109
14406
  output: {
13110
- id: string;
13111
- userId: string;
13112
- workspaceId: string | null;
13113
- feedId: string;
13114
- sourceConfigId: string;
13115
- params: Record<string, unknown>;
13116
- cursor: string | null;
13117
- lastFetchedAt: Date | null;
13118
- lastItemAt: Date | null;
13119
- status: string;
13120
- errorMessage: string | null;
13121
- createdAt: Date;
13122
- updatedAt: Date;
14407
+ value: string;
13123
14408
  };
13124
14409
  meta: object;
13125
14410
  }>;
13126
- resume: import("@trpc/server").TRPCMutationProcedure<{
13127
- input: {
13128
- id: string;
13129
- };
14411
+ getProviderConfigs: import("@trpc/server").TRPCQueryProcedure<{
14412
+ input: Record<string, never> | undefined;
13130
14413
  output: {
13131
- id: string;
13132
- userId: string;
13133
- workspaceId: string | null;
13134
- feedId: string;
13135
- sourceConfigId: string;
13136
- params: Record<string, unknown>;
13137
- cursor: string | null;
13138
- lastFetchedAt: Date | null;
13139
- lastItemAt: Date | null;
13140
- status: string;
13141
- errorMessage: string | null;
13142
- createdAt: Date;
13143
- updatedAt: Date;
14414
+ anthropic: {
14415
+ configured: boolean;
14416
+ };
14417
+ openrouter: {
14418
+ configured: boolean;
14419
+ };
14420
+ openai: {
14421
+ configured: boolean;
14422
+ };
14423
+ aiTerminal: {
14424
+ tool?: string;
14425
+ linkedProvider?: string;
14426
+ customCommand?: string;
14427
+ } | null;
13144
14428
  };
13145
14429
  meta: object;
13146
14430
  }>;
13147
- updateCursor: import("@trpc/server").TRPCMutationProcedure<{
14431
+ }>>;
14432
+ audit: import("@trpc/server").TRPCBuiltRouter<{
14433
+ ctx: Context;
14434
+ meta: object;
14435
+ errorShape: {
14436
+ message: string;
14437
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
14438
+ data: import("@trpc/server").TRPCDefaultErrorData;
14439
+ };
14440
+ transformer: true;
14441
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
14442
+ listForWorkspace: import("@trpc/server").TRPCQueryProcedure<{
13148
14443
  input: {
13149
- id: string;
13150
- cursor: string;
13151
- lastFetchedAt?: unknown;
13152
- lastItemAt?: unknown;
14444
+ eventType?: string | undefined;
14445
+ subjectType?: string | undefined;
14446
+ subjectId?: string | undefined;
14447
+ userId?: string | undefined;
14448
+ fromDate?: string | undefined;
14449
+ toDate?: string | undefined;
14450
+ limit?: number | undefined;
14451
+ offset?: number | undefined;
13153
14452
  };
13154
14453
  output: {
13155
- id: string;
13156
- userId: string;
13157
- workspaceId: string | null;
13158
- feedId: string;
13159
- sourceConfigId: string;
13160
- params: Record<string, unknown>;
13161
- cursor: string | null;
13162
- lastFetchedAt: Date | null;
13163
- lastItemAt: Date | null;
13164
- status: string;
13165
- errorMessage: string | null;
13166
- createdAt: Date;
13167
- updatedAt: Date;
14454
+ events: {
14455
+ id: string;
14456
+ type: string;
14457
+ timestamp: string;
14458
+ userId: string;
14459
+ subjectId: string;
14460
+ subjectType: string;
14461
+ data: Record<string, unknown>;
14462
+ metadata: Record<string, unknown> | undefined;
14463
+ causationId: string | undefined;
14464
+ correlationId: string | undefined;
14465
+ source: string;
14466
+ }[];
14467
+ total: number;
14468
+ hasMore: boolean;
13168
14469
  };
13169
14470
  meta: object;
13170
14471
  }>;
13171
14472
  }>>;
13172
- feeds: import("@trpc/server").TRPCBuiltRouter<{
14473
+ secretsVault: import("@trpc/server").TRPCBuiltRouter<{
13173
14474
  ctx: Context;
13174
14475
  meta: object;
13175
14476
  errorShape: {
@@ -13179,259 +14480,324 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
13179
14480
  };
13180
14481
  transformer: true;
13181
14482
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
14483
+ hasVault: import("@trpc/server").TRPCQueryProcedure<{
14484
+ input: void;
14485
+ output: boolean;
14486
+ meta: object;
14487
+ }>;
14488
+ getVaultMetadata: import("@trpc/server").TRPCQueryProcedure<{
14489
+ input: void;
14490
+ output: {
14491
+ salt: any;
14492
+ keyDerivationAlgorithm: any;
14493
+ keyDerivationParams: any;
14494
+ verificationCipher: any;
14495
+ verificationIv: any;
14496
+ verificationTag: any;
14497
+ hasRecoveryKey: boolean;
14498
+ } | null;
14499
+ meta: object;
14500
+ }>;
14501
+ setupVault: import("@trpc/server").TRPCMutationProcedure<{
14502
+ input: {
14503
+ salt?: string | undefined;
14504
+ keyDerivationAlgorithm?: string | undefined;
14505
+ keyDerivationParams?: {
14506
+ N: number;
14507
+ r: number;
14508
+ p: number;
14509
+ } | undefined;
14510
+ verificationCipher?: string | undefined;
14511
+ verificationIv?: string | undefined;
14512
+ verificationTag?: string | undefined;
14513
+ recoveryKeyHash?: string | undefined;
14514
+ };
14515
+ output: {
14516
+ success: boolean;
14517
+ };
14518
+ meta: object;
14519
+ }>;
14520
+ recordUnlock: import("@trpc/server").TRPCMutationProcedure<{
14521
+ input: void;
14522
+ output: {
14523
+ success: boolean;
14524
+ };
14525
+ meta: object;
14526
+ }>;
14527
+ generateRecoveryKey: import("@trpc/server").TRPCMutationProcedure<{
14528
+ input: void;
14529
+ output: {
14530
+ recoveryKey: string;
14531
+ message: string;
14532
+ };
14533
+ meta: object;
14534
+ }>;
13182
14535
  list: import("@trpc/server").TRPCQueryProcedure<{
13183
14536
  input: {
13184
- workspaceId?: string | undefined;
13185
- sourceConfigId?: string | undefined;
13186
- status?: "error" | "active" | "paused" | undefined;
14537
+ type?: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth" | undefined;
14538
+ category?: string | undefined;
14539
+ search?: string | undefined;
14540
+ tags?: string[] | undefined;
14541
+ includeDeleted?: boolean | undefined;
13187
14542
  limit?: number | undefined;
13188
14543
  offset?: number | undefined;
14544
+ } | undefined;
14545
+ output: any;
14546
+ meta: object;
14547
+ }>;
14548
+ get: import("@trpc/server").TRPCQueryProcedure<{
14549
+ input: {
14550
+ id: string;
13189
14551
  };
13190
14552
  output: {
13191
- derivedQueryCount: number;
13192
- derivedQueries: {
13193
- upstreamType: string;
13194
- label: string;
13195
- }[] | undefined;
13196
14553
  id: string;
13197
- feedId: string;
13198
- params: Record<string, unknown>;
13199
- cursor: string | null;
13200
- lastFetchedAt: Date | null;
13201
- lastItemAt: Date | null;
13202
- status: string;
13203
- errorMessage: string | null;
13204
- sourceConfig: {
13205
- id: string;
13206
- name: string;
13207
- providerType: string;
13208
- enabled: boolean;
13209
- };
13210
- }[];
14554
+ name: string;
14555
+ type: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth";
14556
+ url: string | null;
14557
+ category: string | null;
14558
+ description: string | null;
14559
+ iconUrl: string | null;
14560
+ encryptedData: string;
14561
+ iv: string;
14562
+ authTag: string;
14563
+ encryptionVersion: number;
14564
+ isFavorite: boolean;
14565
+ isShared: boolean;
14566
+ isCompromised: boolean | null;
14567
+ passwordStrength: number | null;
14568
+ passwordLastChanged: Date | null;
14569
+ lastAccessedAt: Date | null;
14570
+ accessCount: number;
14571
+ createdAt: Date;
14572
+ updatedAt: Date;
14573
+ tags: string[];
14574
+ };
13211
14575
  meta: object;
13212
14576
  }>;
13213
- recentItems: import("@trpc/server").TRPCQueryProcedure<{
14577
+ reveal: import("@trpc/server").TRPCMutationProcedure<{
13214
14578
  input: {
13215
- subscriptionId: string;
13216
- limit?: number | undefined;
14579
+ id: string;
13217
14580
  };
13218
14581
  output: {
13219
- subscription: {
13220
- id: string;
13221
- feedId: string;
13222
- status: string;
13223
- lastFetchedAt: Date | null;
13224
- lastItemAt: Date | null;
13225
- errorMessage: string | null;
13226
- };
13227
- messageLimit: number;
13228
- note: string;
14582
+ value: string | Record<string, unknown>;
13229
14583
  };
13230
14584
  meta: object;
13231
14585
  }>;
13232
- updateLastFetched: import("@trpc/server").TRPCMutationProcedure<{
14586
+ create: import("@trpc/server").TRPCMutationProcedure<{
13233
14587
  input: {
13234
- id: string;
13235
- cursor?: string | undefined;
13236
- lastItemAt?: unknown;
14588
+ name: string;
14589
+ type: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth";
14590
+ value: string | Record<string, unknown>;
14591
+ url?: string | undefined;
14592
+ category?: string | undefined;
14593
+ description?: string | undefined;
14594
+ iconUrl?: string | undefined;
14595
+ passwordStrength?: number | undefined;
14596
+ tags?: string[] | undefined;
14597
+ workspaceId?: string | undefined;
13237
14598
  };
13238
14599
  output: {
13239
14600
  id: string;
13240
- userId: string;
13241
- workspaceId: string | null;
13242
- feedId: string;
13243
- sourceConfigId: string;
13244
- params: Record<string, unknown>;
13245
- cursor: string | null;
13246
- lastFetchedAt: Date | null;
13247
- lastItemAt: Date | null;
13248
- status: string;
13249
- errorMessage: string | null;
14601
+ name: string;
14602
+ type: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth";
13250
14603
  createdAt: Date;
13251
- updatedAt: Date;
13252
14604
  };
13253
14605
  meta: object;
13254
14606
  }>;
13255
- healthSummary: import("@trpc/server").TRPCQueryProcedure<{
13256
- input: void;
14607
+ update: import("@trpc/server").TRPCMutationProcedure<{
14608
+ input: {
14609
+ id: string;
14610
+ name?: string | undefined;
14611
+ url?: string | null | undefined;
14612
+ category?: string | null | undefined;
14613
+ description?: string | null | undefined;
14614
+ iconUrl?: string | null | undefined;
14615
+ value?: string | Record<string, unknown> | undefined;
14616
+ isFavorite?: boolean | undefined;
14617
+ sortOrder?: number | undefined;
14618
+ passwordStrength?: number | undefined;
14619
+ tags?: string[] | undefined;
14620
+ };
13257
14621
  output: {
13258
- total: number;
13259
- active: number;
13260
- paused: number;
13261
- error: number;
13262
- recentlyFetched: number;
13263
- lastRefreshed: Date;
14622
+ id: string;
14623
+ name: string;
14624
+ updatedAt: Date;
13264
14625
  };
13265
14626
  meta: object;
13266
14627
  }>;
13267
- countBySourceConfig: import("@trpc/server").TRPCQueryProcedure<{
13268
- input: void;
14628
+ delete: import("@trpc/server").TRPCMutationProcedure<{
14629
+ input: {
14630
+ id: string;
14631
+ };
13269
14632
  output: {
13270
- sourceConfigId: string;
13271
- sourceConfigName: string | null;
13272
- providerType: string | null;
13273
- count: number;
13274
- }[];
14633
+ success: boolean;
14634
+ };
13275
14635
  meta: object;
13276
14636
  }>;
13277
- }>>;
13278
- devplane: import("@trpc/server").TRPCBuiltRouter<{
13279
- ctx: Context;
13280
- meta: object;
13281
- errorShape: {
13282
- message: string;
13283
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
13284
- data: import("@trpc/server").TRPCDefaultErrorData;
13285
- };
13286
- transformer: true;
13287
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13288
- bootstrap: import("@trpc/server").TRPCMutationProcedure<{
13289
- input: Record<string, never> | undefined;
14637
+ permanentDelete: import("@trpc/server").TRPCMutationProcedure<{
14638
+ input: {
14639
+ id: string;
14640
+ };
13290
14641
  output: {
13291
14642
  success: boolean;
13292
- message: string;
13293
- profilesCreated: number;
13294
- propertiesCreated: number;
13295
- linksCreated: number;
13296
14643
  };
13297
14644
  meta: object;
13298
14645
  }>;
13299
- getEnvironmentInfo: import("@trpc/server").TRPCQueryProcedure<{
14646
+ restore: import("@trpc/server").TRPCMutationProcedure<{
13300
14647
  input: {
13301
- environmentEntityId: string;
14648
+ id: string;
13302
14649
  };
13303
14650
  output: {
13304
- id: string;
13305
- name: string;
13306
- host: string | null;
13307
- port: number;
13308
- sshUser: string | null;
13309
- hasKey: boolean;
14651
+ success: boolean;
13310
14652
  };
13311
14653
  meta: object;
13312
14654
  }>;
13313
- getRecipe: import("@trpc/server").TRPCQueryProcedure<{
14655
+ findByUrl: import("@trpc/server").TRPCQueryProcedure<{
13314
14656
  input: {
13315
- recipeEntityId: string;
14657
+ url: string;
13316
14658
  };
13317
- output: {
14659
+ output: any;
14660
+ meta: object;
14661
+ }>;
14662
+ recordCopy: import("@trpc/server").TRPCMutationProcedure<{
14663
+ input: {
13318
14664
  id: string;
13319
- title: string;
13320
- recipeName: string | null;
13321
- recipeDescription: string | null;
13322
- steps: RecipeStep[];
13323
- linkedEnvironmentId: string | null;
13324
- linkedAppSlug: string | null;
13325
- onFailure: "rollback" | "stop" | "continue";
13326
- rollbackRecipeId: string | null;
13327
- recipeTemplate: "custom" | "kamal" | "docker-compose" | "git-pull" | null;
14665
+ };
14666
+ output: {
14667
+ success: boolean;
13328
14668
  };
13329
14669
  meta: object;
13330
14670
  }>;
13331
- listRecipeRuns: import("@trpc/server").TRPCQueryProcedure<{
14671
+ getCategories: import("@trpc/server").TRPCQueryProcedure<{
14672
+ input: void;
14673
+ output: string[];
14674
+ meta: object;
14675
+ }>;
14676
+ getTags: import("@trpc/server").TRPCQueryProcedure<{
14677
+ input: void;
14678
+ output: string[];
14679
+ meta: object;
14680
+ }>;
14681
+ share: import("@trpc/server").TRPCMutationProcedure<{
13332
14682
  input: {
13333
- recipeId?: string | undefined;
14683
+ secretId: string;
14684
+ sharedWithUserId?: string | undefined;
14685
+ sharedWithWorkspaceId?: string | undefined;
14686
+ permission?: "read" | "write" | undefined;
14687
+ expiresAt?: Date | undefined;
13334
14688
  };
13335
14689
  output: {
13336
14690
  id: string;
13337
- title: string;
13338
- recipeId: string | null;
13339
- runStatus: "success" | "running" | "failed" | "cancelled" | null;
13340
- runSteps: RunStep[];
13341
- runStartedAt: string | null;
13342
- runFinishedAt: string | null;
13343
- runDuration: number | null;
13344
- triggeredBy: "manual" | "automation";
13345
- createdAt: Date;
13346
- }[];
14691
+ secretId: string;
14692
+ permission: string;
14693
+ };
13347
14694
  meta: object;
13348
14695
  }>;
13349
- seedSynapProjectData: import("@trpc/server").TRPCMutationProcedure<{
13350
- input: Record<string, never> | undefined;
14696
+ revokeShare: import("@trpc/server").TRPCMutationProcedure<{
14697
+ input: {
14698
+ shareId: string;
14699
+ };
13351
14700
  output: {
13352
- seeded: boolean;
13353
- message: string;
13354
- counts?: undefined;
13355
- } | {
13356
- seeded: boolean;
13357
- counts: {
13358
- apps: number;
13359
- services: number;
13360
- packages: number;
13361
- features: number;
13362
- environments: number;
13363
- recipes: number;
13364
- };
13365
- message?: undefined;
14701
+ success: boolean;
13366
14702
  };
13367
14703
  meta: object;
13368
14704
  }>;
13369
- seedDefaultSnippets: import("@trpc/server").TRPCMutationProcedure<{
13370
- input: Record<string, never> | undefined;
14705
+ sharedWithMe: import("@trpc/server").TRPCQueryProcedure<{
14706
+ input: void;
14707
+ output: any;
14708
+ meta: object;
14709
+ }>;
14710
+ getAuditLog: import("@trpc/server").TRPCQueryProcedure<{
14711
+ input: {
14712
+ secretId: string;
14713
+ limit?: number | undefined;
14714
+ };
14715
+ output: any;
14716
+ meta: object;
14717
+ }>;
14718
+ getSecurityStats: import("@trpc/server").TRPCQueryProcedure<{
14719
+ input: void;
13371
14720
  output: {
13372
- seeded: boolean;
13373
- message: string;
13374
- count?: undefined;
13375
- } | {
13376
- seeded: boolean;
13377
- count: number;
13378
- message?: undefined;
14721
+ compromised: number;
14722
+ weakPasswords: number;
14723
+ oldPasswords: number;
14724
+ total: number;
13379
14725
  };
13380
14726
  meta: object;
13381
14727
  }>;
13382
- saveProviderApiKey: import("@trpc/server").TRPCMutationProcedure<{
14728
+ markCompromised: import("@trpc/server").TRPCMutationProcedure<{
13383
14729
  input: {
13384
- providerType: "openai" | "anthropic" | "openrouter";
13385
- apiKey: string;
14730
+ id: string;
13386
14731
  };
13387
14732
  output: {
13388
- ok: boolean;
14733
+ success: boolean;
13389
14734
  };
13390
14735
  meta: object;
13391
14736
  }>;
13392
- saveEntitySecret: import("@trpc/server").TRPCMutationProcedure<{
14737
+ grantAIAccess: import("@trpc/server").TRPCMutationProcedure<{
13393
14738
  input: {
13394
- entityId: string;
13395
- propertySlug: "sshKeyVaultRef" | "npmTokenVaultRef" | "githubTokenVaultRef";
13396
- secretValue: string;
13397
- secretName?: string | undefined;
14739
+ secretId: string;
14740
+ proposalId: string;
14741
+ scope?: "session" | "once" | "permanent" | undefined;
14742
+ ttlMinutes?: number | undefined;
13398
14743
  };
13399
14744
  output: {
13400
14745
  vaultRef: string;
14746
+ secretId: string;
14747
+ proposalId: string;
14748
+ grantId: string;
14749
+ scope: "session" | "once" | "permanent";
14750
+ expiresAt: string | null;
14751
+ };
14752
+ meta: object;
14753
+ }>;
14754
+ listGrants: import("@trpc/server").TRPCQueryProcedure<{
14755
+ input: {
14756
+ secretId: string;
13401
14757
  };
14758
+ output: {
14759
+ id: string;
14760
+ scope: "session" | "once" | "permanent";
14761
+ grantedTo: string | null;
14762
+ proposalId: string | null;
14763
+ expiresAt: string | null;
14764
+ maxUses: number | null;
14765
+ useCount: number;
14766
+ revokedAt: string | null;
14767
+ createdAt: string;
14768
+ active: boolean;
14769
+ }[];
14770
+ meta: object;
14771
+ }>;
14772
+ listAllGrants: import("@trpc/server").TRPCQueryProcedure<{
14773
+ input: void;
14774
+ output: {
14775
+ grantId: string;
14776
+ secretId: string;
14777
+ secretName: string | null;
14778
+ grantedTo: string | null;
14779
+ proposalId: string | null;
14780
+ scope: "session" | "once" | "permanent";
14781
+ expiresAt: string | null;
14782
+ maxUses: number | null;
14783
+ useCount: number;
14784
+ revokedAt: string | null;
14785
+ createdAt: string;
14786
+ active: boolean;
14787
+ }[];
13402
14788
  meta: object;
13403
14789
  }>;
13404
- resolveEntitySecret: import("@trpc/server").TRPCMutationProcedure<{
14790
+ revokeGrant: import("@trpc/server").TRPCMutationProcedure<{
13405
14791
  input: {
13406
- vaultRef: string;
13407
- };
13408
- output: {
13409
- value: string;
14792
+ grantId: string;
13410
14793
  };
13411
- meta: object;
13412
- }>;
13413
- getProviderConfigs: import("@trpc/server").TRPCQueryProcedure<{
13414
- input: Record<string, never> | undefined;
13415
14794
  output: {
13416
- anthropic: {
13417
- configured: boolean;
13418
- };
13419
- openrouter: {
13420
- configured: boolean;
13421
- };
13422
- openai: {
13423
- configured: boolean;
13424
- };
13425
- aiTerminal: {
13426
- tool?: string;
13427
- linkedProvider?: string;
13428
- customCommand?: string;
13429
- } | null;
14795
+ success: boolean;
13430
14796
  };
13431
14797
  meta: object;
13432
14798
  }>;
13433
14799
  }>>;
13434
- audit: import("@trpc/server").TRPCBuiltRouter<{
14800
+ subscriptions: import("@trpc/server").TRPCBuiltRouter<{
13435
14801
  ctx: Context;
13436
14802
  meta: object;
13437
14803
  errorShape: {
@@ -13441,38 +14807,31 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
13441
14807
  };
13442
14808
  transformer: true;
13443
14809
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13444
- listForWorkspace: import("@trpc/server").TRPCQueryProcedure<{
14810
+ listAll: import("@trpc/server").TRPCQueryProcedure<{
13445
14811
  input: {
13446
- eventType?: string | undefined;
13447
- subjectType?: string | undefined;
13448
- subjectId?: string | undefined;
13449
- userId?: string | undefined;
13450
- fromDate?: string | undefined;
13451
- toDate?: string | undefined;
14812
+ workspaceId?: string | null | undefined;
13452
14813
  limit?: number | undefined;
13453
- offset?: number | undefined;
14814
+ kind?: "webhook" | "automation" | "ai_feed" | "ai_react" | "notify" | "message_out" | undefined;
14815
+ eventType?: string | undefined;
14816
+ lens?: "external" | "all" | "internal" | undefined;
14817
+ pending?: boolean | undefined;
13454
14818
  };
13455
14819
  output: {
13456
- events: {
13457
- id: string;
13458
- type: string;
13459
- timestamp: string;
13460
- userId: string;
13461
- subjectId: string;
13462
- subjectType: string;
13463
- data: Record<string, unknown>;
13464
- metadata: Record<string, unknown> | undefined;
13465
- causationId: string | undefined;
13466
- correlationId: string | undefined;
13467
- source: string;
13468
- }[];
13469
- total: number;
13470
- hasMore: boolean;
14820
+ items: ReactionEvent[];
14821
+ lens: ReactionLens;
14822
+ };
14823
+ meta: object;
14824
+ }>;
14825
+ eventFanout: import("@trpc/server").TRPCQueryProcedure<{
14826
+ input: {
14827
+ eventId: string;
14828
+ lens?: "external" | "all" | "internal" | undefined;
13471
14829
  };
14830
+ output: ReactionEvent;
13472
14831
  meta: object;
13473
14832
  }>;
13474
14833
  }>>;
13475
- secretsVault: import("@trpc/server").TRPCBuiltRouter<{
14834
+ aiProviders: import("@trpc/server").TRPCBuiltRouter<{
13476
14835
  ctx: Context;
13477
14836
  meta: object;
13478
14837
  errorShape: {
@@ -13482,269 +14841,454 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
13482
14841
  };
13483
14842
  transformer: true;
13484
14843
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13485
- hasVault: import("@trpc/server").TRPCQueryProcedure<{
13486
- input: void;
13487
- output: boolean;
13488
- meta: object;
13489
- }>;
13490
- getVaultMetadata: import("@trpc/server").TRPCQueryProcedure<{
14844
+ list: import("@trpc/server").TRPCQueryProcedure<{
13491
14845
  input: void;
13492
14846
  output: {
13493
- salt: any;
13494
- keyDerivationAlgorithm: any;
13495
- keyDerivationParams: any;
13496
- verificationCipher: any;
13497
- verificationIv: any;
13498
- verificationTag: any;
13499
- hasRecoveryKey: boolean;
13500
- } | null;
14847
+ hasApiKey: boolean;
14848
+ name: string;
14849
+ id: string;
14850
+ updatedAt: Date;
14851
+ createdAt: Date;
14852
+ metadata: Record<string, unknown>;
14853
+ priority: number;
14854
+ tags: string[];
14855
+ enabled: boolean;
14856
+ providerId: string;
14857
+ baseUrl: string;
14858
+ apiKeyEnvVar: string;
14859
+ models: AiProviderModelEntry[];
14860
+ rateLimit: {
14861
+ rpm: number;
14862
+ rpd?: number;
14863
+ } | null;
14864
+ extraBody: Record<string, unknown> | null;
14865
+ systemPromptPrefix: string | null;
14866
+ }[];
13501
14867
  meta: object;
13502
14868
  }>;
13503
- setupVault: import("@trpc/server").TRPCMutationProcedure<{
14869
+ upsert: import("@trpc/server").TRPCMutationProcedure<{
13504
14870
  input: {
13505
- salt: string;
13506
- keyDerivationAlgorithm: string;
13507
- keyDerivationParams: {
13508
- N: number;
13509
- r: number;
13510
- p: number;
13511
- };
13512
- verificationCipher: string;
13513
- verificationIv: string;
13514
- verificationTag: string;
13515
- recoveryKeyHash?: string | undefined;
14871
+ providerId: string;
14872
+ name: string;
14873
+ baseUrl: string;
14874
+ apiKeyEnvVar: string;
14875
+ apiKey?: string | undefined;
14876
+ enabled?: boolean | undefined;
14877
+ priority?: number | undefined;
14878
+ tags?: string[] | undefined;
14879
+ models?: {
14880
+ id: string;
14881
+ tier?: "free" | "balanced" | "advanced" | "complex" | undefined;
14882
+ contextWindow?: number | undefined;
14883
+ supportsTools?: boolean | undefined;
14884
+ supportsJson?: boolean | undefined;
14885
+ costPer1MInput?: number | undefined;
14886
+ costPer1MOutput?: number | undefined;
14887
+ }[] | undefined;
14888
+ rateLimit?: {
14889
+ rpm: number;
14890
+ rpd?: number | undefined;
14891
+ } | undefined;
14892
+ extraBody?: Record<string, unknown> | undefined;
14893
+ systemPromptPrefix?: string | undefined;
14894
+ metadata?: Record<string, unknown> | undefined;
13516
14895
  };
13517
14896
  output: {
13518
- success: boolean;
14897
+ hasApiKey: boolean;
14898
+ name: string;
14899
+ id: string;
14900
+ updatedAt: Date;
14901
+ createdAt: Date;
14902
+ metadata: Record<string, unknown>;
14903
+ priority: number;
14904
+ tags: string[];
14905
+ enabled: boolean;
14906
+ providerId: string;
14907
+ baseUrl: string;
14908
+ apiKeyEnvVar: string;
14909
+ models: AiProviderModelEntry[];
14910
+ rateLimit: {
14911
+ rpm: number;
14912
+ rpd?: number;
14913
+ } | null;
14914
+ extraBody: Record<string, unknown> | null;
14915
+ systemPromptPrefix: string | null;
13519
14916
  };
13520
14917
  meta: object;
13521
14918
  }>;
13522
- recordUnlock: import("@trpc/server").TRPCMutationProcedure<{
13523
- input: void;
14919
+ enable: import("@trpc/server").TRPCMutationProcedure<{
14920
+ input: {
14921
+ providerId: string;
14922
+ };
13524
14923
  output: {
13525
- success: boolean;
14924
+ ok: boolean;
13526
14925
  };
13527
14926
  meta: object;
13528
14927
  }>;
13529
- generateRecoveryKey: import("@trpc/server").TRPCMutationProcedure<{
13530
- input: void;
14928
+ disable: import("@trpc/server").TRPCMutationProcedure<{
14929
+ input: {
14930
+ providerId: string;
14931
+ };
13531
14932
  output: {
13532
- recoveryKey: string;
13533
- message: string;
14933
+ ok: boolean;
13534
14934
  };
13535
14935
  meta: object;
13536
14936
  }>;
13537
- list: import("@trpc/server").TRPCQueryProcedure<{
14937
+ remove: import("@trpc/server").TRPCMutationProcedure<{
13538
14938
  input: {
13539
- type?: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth" | undefined;
13540
- category?: string | undefined;
13541
- search?: string | undefined;
13542
- tags?: string[] | undefined;
13543
- includeDeleted?: boolean | undefined;
13544
- limit?: number | undefined;
13545
- offset?: number | undefined;
13546
- } | undefined;
13547
- output: any;
14939
+ providerId: string;
14940
+ };
14941
+ output: {
14942
+ ok: boolean;
14943
+ };
13548
14944
  meta: object;
13549
14945
  }>;
13550
- get: import("@trpc/server").TRPCQueryProcedure<{
14946
+ probe: import("@trpc/server").TRPCMutationProcedure<{
13551
14947
  input: {
13552
- id: string;
14948
+ providerId: string;
13553
14949
  };
13554
14950
  output: {
13555
- id: string;
13556
- name: string;
13557
- type: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth";
13558
- url: string | null;
13559
- category: string | null;
13560
- description: string | null;
13561
- iconUrl: string | null;
13562
- encryptedData: string;
13563
- iv: string;
13564
- authTag: string;
13565
- encryptionVersion: number;
13566
- isFavorite: boolean;
13567
- isShared: boolean;
13568
- isCompromised: boolean | null;
13569
- passwordStrength: number | null;
13570
- passwordLastChanged: Date | null;
13571
- lastAccessedAt: Date | null;
13572
- accessCount: number;
13573
- createdAt: Date;
13574
- updatedAt: Date;
13575
- tags: string[];
14951
+ ok: boolean;
14952
+ models: string[];
14953
+ latencyMs: number;
14954
+ error?: string;
13576
14955
  };
13577
14956
  meta: object;
13578
14957
  }>;
13579
- create: import("@trpc/server").TRPCMutationProcedure<{
14958
+ sync: import("@trpc/server").TRPCMutationProcedure<{
14959
+ input: void;
14960
+ output: {
14961
+ ok: boolean;
14962
+ count: number;
14963
+ };
14964
+ meta: object;
14965
+ }>;
14966
+ }>>;
14967
+ aiProviderCredentials: import("@trpc/server").TRPCBuiltRouter<{
14968
+ ctx: Context;
14969
+ meta: object;
14970
+ errorShape: {
14971
+ message: string;
14972
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
14973
+ data: import("@trpc/server").TRPCDefaultErrorData;
14974
+ };
14975
+ transformer: true;
14976
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
14977
+ listForWorkspace: import("@trpc/server").TRPCQueryProcedure<{
13580
14978
  input: {
13581
- name: string;
13582
- type: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth";
13583
- encryptedData: string;
13584
- iv: string;
13585
- authTag: string;
13586
- url?: string | undefined;
13587
- category?: string | undefined;
13588
- description?: string | undefined;
13589
- iconUrl?: string | undefined;
13590
- passwordStrength?: number | undefined;
13591
- tags?: string[] | undefined;
13592
- workspaceId?: string | undefined;
14979
+ workspaceId: string;
13593
14980
  };
13594
- output: {
13595
- id: string;
13596
- name: string;
13597
- type: "identity" | "password" | "api_key" | "credential" | "note" | "card" | "ssh_key" | "certificate" | "env_variable" | "database" | "oauth";
14981
+ output: (Omit<{
14982
+ userId: string | null;
14983
+ workspaceId: string | null;
14984
+ id: string;
14985
+ updatedAt: Date;
13598
14986
  createdAt: Date;
13599
- };
14987
+ createdBy: string;
14988
+ priority: number;
14989
+ enabled: boolean;
14990
+ providerId: string;
14991
+ encryptedApiKey: string;
14992
+ }, "encryptedApiKey"> & {
14993
+ hasApiKey: true;
14994
+ })[];
13600
14995
  meta: object;
13601
14996
  }>;
13602
- update: import("@trpc/server").TRPCMutationProcedure<{
14997
+ upsertForWorkspace: import("@trpc/server").TRPCMutationProcedure<{
13603
14998
  input: {
13604
- id: string;
13605
- name?: string | undefined;
13606
- url?: string | null | undefined;
13607
- category?: string | null | undefined;
13608
- description?: string | null | undefined;
13609
- iconUrl?: string | null | undefined;
13610
- encryptedData?: string | undefined;
13611
- iv?: string | undefined;
13612
- authTag?: string | undefined;
13613
- isFavorite?: boolean | undefined;
13614
- sortOrder?: number | undefined;
13615
- passwordStrength?: number | undefined;
13616
- tags?: string[] | undefined;
14999
+ providerId: string;
15000
+ apiKey: string;
15001
+ workspaceId: string;
15002
+ enabled?: boolean | undefined;
15003
+ priority?: number | undefined;
13617
15004
  };
13618
15005
  output: {
13619
- id: string;
13620
- name: string;
13621
- updatedAt: Date;
15006
+ ok: boolean;
13622
15007
  };
13623
15008
  meta: object;
13624
15009
  }>;
13625
- delete: import("@trpc/server").TRPCMutationProcedure<{
15010
+ removeForWorkspace: import("@trpc/server").TRPCMutationProcedure<{
13626
15011
  input: {
13627
- id: string;
15012
+ workspaceId: string;
15013
+ providerId: string;
13628
15014
  };
13629
15015
  output: {
13630
- success: boolean;
15016
+ ok: boolean;
13631
15017
  };
13632
15018
  meta: object;
13633
15019
  }>;
13634
- permanentDelete: import("@trpc/server").TRPCMutationProcedure<{
13635
- input: {
15020
+ listForUser: import("@trpc/server").TRPCQueryProcedure<{
15021
+ input: void;
15022
+ output: (Omit<{
15023
+ userId: string | null;
15024
+ workspaceId: string | null;
13636
15025
  id: string;
15026
+ updatedAt: Date;
15027
+ createdAt: Date;
15028
+ createdBy: string;
15029
+ priority: number;
15030
+ enabled: boolean;
15031
+ providerId: string;
15032
+ encryptedApiKey: string;
15033
+ }, "encryptedApiKey"> & {
15034
+ hasApiKey: true;
15035
+ })[];
15036
+ meta: object;
15037
+ }>;
15038
+ upsertForUser: import("@trpc/server").TRPCMutationProcedure<{
15039
+ input: {
15040
+ providerId: string;
15041
+ apiKey: string;
15042
+ enabled?: boolean | undefined;
15043
+ priority?: number | undefined;
15044
+ workspaceId?: string | undefined;
13637
15045
  };
13638
15046
  output: {
13639
- success: boolean;
15047
+ ok: boolean;
13640
15048
  };
13641
15049
  meta: object;
13642
15050
  }>;
13643
- restore: import("@trpc/server").TRPCMutationProcedure<{
15051
+ removeForUser: import("@trpc/server").TRPCMutationProcedure<{
13644
15052
  input: {
13645
- id: string;
15053
+ providerId: string;
13646
15054
  };
13647
15055
  output: {
13648
- success: boolean;
15056
+ ok: boolean;
13649
15057
  };
13650
15058
  meta: object;
13651
15059
  }>;
13652
- findByUrl: import("@trpc/server").TRPCQueryProcedure<{
15060
+ }>>;
15061
+ focusSessions: import("@trpc/server").TRPCBuiltRouter<{
15062
+ ctx: Context;
15063
+ meta: object;
15064
+ errorShape: {
15065
+ message: string;
15066
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
15067
+ data: import("@trpc/server").TRPCDefaultErrorData;
15068
+ };
15069
+ transformer: true;
15070
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
15071
+ list: import("@trpc/server").TRPCQueryProcedure<{
13653
15072
  input: {
13654
- url: string;
15073
+ workspaceId: string;
15074
+ status?: "active" | "paused" | "closed" | "all" | undefined;
15075
+ limit?: number | undefined;
13655
15076
  };
13656
- output: any;
15077
+ output: {
15078
+ id: string;
15079
+ workspaceId: string;
15080
+ userId: string;
15081
+ correlationId: string | null;
15082
+ goal: string;
15083
+ status: "active" | "paused" | "closed";
15084
+ templateId: string | null;
15085
+ playbookId: string | null;
15086
+ expectedOutputs: unknown;
15087
+ channelId: string | null;
15088
+ progress: number | null;
15089
+ agentIds: string[] | null;
15090
+ closedAt: Date | null;
15091
+ contextReport: unknown;
15092
+ planReport: unknown;
15093
+ executionLog: unknown;
15094
+ verificationReport: unknown;
15095
+ startedAt: Date;
15096
+ createdAt: Date;
15097
+ updatedAt: Date;
15098
+ }[];
13657
15099
  meta: object;
13658
15100
  }>;
13659
- recordCopy: import("@trpc/server").TRPCMutationProcedure<{
15101
+ listAll: import("@trpc/server").TRPCQueryProcedure<{
13660
15102
  input: {
13661
- id: string;
15103
+ status?: "active" | "paused" | "closed" | "all" | undefined;
15104
+ limit?: number | undefined;
13662
15105
  };
13663
15106
  output: {
13664
- success: boolean;
13665
- };
13666
- meta: object;
13667
- }>;
13668
- getCategories: import("@trpc/server").TRPCQueryProcedure<{
13669
- input: void;
13670
- output: string[];
13671
- meta: object;
13672
- }>;
13673
- getTags: import("@trpc/server").TRPCQueryProcedure<{
13674
- input: void;
13675
- output: string[];
15107
+ id: string;
15108
+ workspaceId: string;
15109
+ userId: string;
15110
+ correlationId: string | null;
15111
+ goal: string;
15112
+ status: "active" | "paused" | "closed";
15113
+ templateId: string | null;
15114
+ playbookId: string | null;
15115
+ expectedOutputs: unknown;
15116
+ channelId: string | null;
15117
+ progress: number | null;
15118
+ agentIds: string[] | null;
15119
+ closedAt: Date | null;
15120
+ contextReport: unknown;
15121
+ planReport: unknown;
15122
+ executionLog: unknown;
15123
+ verificationReport: unknown;
15124
+ startedAt: Date;
15125
+ createdAt: Date;
15126
+ updatedAt: Date;
15127
+ }[];
13676
15128
  meta: object;
13677
15129
  }>;
13678
- share: import("@trpc/server").TRPCMutationProcedure<{
15130
+ get: import("@trpc/server").TRPCQueryProcedure<{
13679
15131
  input: {
13680
- secretId: string;
13681
- sharedWithUserId?: string | undefined;
13682
- sharedWithWorkspaceId?: string | undefined;
13683
- permission?: "read" | "write" | undefined;
13684
- expiresAt?: Date | undefined;
15132
+ id: string;
13685
15133
  };
13686
15134
  output: {
15135
+ userId: string;
15136
+ workspaceId: string;
13687
15137
  id: string;
13688
- secretId: string;
13689
- permission: string;
15138
+ updatedAt: Date;
15139
+ createdAt: Date;
15140
+ correlationId: string | null;
15141
+ channelId: string | null;
15142
+ startedAt: Date;
15143
+ status: "active" | "paused" | "closed";
15144
+ goal: string;
15145
+ templateId: string | null;
15146
+ playbookId: string | null;
15147
+ expectedOutputs: unknown;
15148
+ progress: number | null;
15149
+ agentIds: string[] | null;
15150
+ closedAt: Date | null;
15151
+ contextReport: unknown;
15152
+ planReport: unknown;
15153
+ executionLog: unknown;
15154
+ verificationReport: unknown;
13690
15155
  };
13691
15156
  meta: object;
13692
15157
  }>;
13693
- revokeShare: import("@trpc/server").TRPCMutationProcedure<{
15158
+ getByCorrelationId: import("@trpc/server").TRPCQueryProcedure<{
13694
15159
  input: {
13695
- shareId: string;
15160
+ correlationId: string;
13696
15161
  };
13697
15162
  output: {
13698
- success: boolean;
15163
+ userId: string;
15164
+ workspaceId: string;
15165
+ id: string;
15166
+ updatedAt: Date;
15167
+ createdAt: Date;
15168
+ correlationId: string | null;
15169
+ channelId: string | null;
15170
+ startedAt: Date;
15171
+ status: "active" | "paused" | "closed";
15172
+ goal: string;
15173
+ templateId: string | null;
15174
+ playbookId: string | null;
15175
+ expectedOutputs: unknown;
15176
+ progress: number | null;
15177
+ agentIds: string[] | null;
15178
+ closedAt: Date | null;
15179
+ contextReport: unknown;
15180
+ planReport: unknown;
15181
+ executionLog: unknown;
15182
+ verificationReport: unknown;
13699
15183
  };
13700
15184
  meta: object;
13701
15185
  }>;
13702
- sharedWithMe: import("@trpc/server").TRPCQueryProcedure<{
13703
- input: void;
13704
- output: any;
13705
- meta: object;
13706
- }>;
13707
- getAuditLog: import("@trpc/server").TRPCQueryProcedure<{
15186
+ create: import("@trpc/server").TRPCMutationProcedure<{
13708
15187
  input: {
13709
- secretId: string;
13710
- limit?: number | undefined;
15188
+ workspaceId: string;
15189
+ goal: string;
15190
+ templateId?: string | undefined;
15191
+ expectedOutputs?: {
15192
+ kind: string;
15193
+ label: string;
15194
+ icon?: string | undefined;
15195
+ }[] | undefined;
15196
+ channelId?: string | undefined;
15197
+ agentIds?: string[] | undefined;
13711
15198
  };
13712
- output: any;
13713
- meta: object;
13714
- }>;
13715
- getSecurityStats: import("@trpc/server").TRPCQueryProcedure<{
13716
- input: void;
13717
15199
  output: {
13718
- compromised: number;
13719
- weakPasswords: number;
13720
- oldPasswords: number;
13721
- total: number;
15200
+ userId: string;
15201
+ workspaceId: string;
15202
+ id: string;
15203
+ updatedAt: Date;
15204
+ createdAt: Date;
15205
+ correlationId: string | null;
15206
+ channelId: string | null;
15207
+ startedAt: Date;
15208
+ status: "active" | "paused" | "closed";
15209
+ goal: string;
15210
+ templateId: string | null;
15211
+ playbookId: string | null;
15212
+ expectedOutputs: unknown;
15213
+ progress: number | null;
15214
+ agentIds: string[] | null;
15215
+ closedAt: Date | null;
15216
+ contextReport: unknown;
15217
+ planReport: unknown;
15218
+ executionLog: unknown;
15219
+ verificationReport: unknown;
13722
15220
  };
13723
15221
  meta: object;
13724
15222
  }>;
13725
- markCompromised: import("@trpc/server").TRPCMutationProcedure<{
15223
+ update: import("@trpc/server").TRPCMutationProcedure<{
13726
15224
  input: {
13727
15225
  id: string;
15226
+ status?: "active" | "paused" | "closed" | undefined;
15227
+ progress?: number | undefined;
15228
+ channelId?: string | undefined;
15229
+ correlationId?: string | undefined;
15230
+ goal?: string | undefined;
15231
+ agentIds?: string[] | undefined;
15232
+ expectedOutputs?: {
15233
+ kind: string;
15234
+ label: string;
15235
+ icon?: string | undefined;
15236
+ }[] | undefined;
13728
15237
  };
13729
15238
  output: {
13730
- success: boolean;
15239
+ userId: string;
15240
+ workspaceId: string;
15241
+ id: string;
15242
+ updatedAt: Date;
15243
+ createdAt: Date;
15244
+ correlationId: string | null;
15245
+ channelId: string | null;
15246
+ startedAt: Date;
15247
+ status: "active" | "paused" | "closed";
15248
+ goal: string;
15249
+ templateId: string | null;
15250
+ playbookId: string | null;
15251
+ expectedOutputs: unknown;
15252
+ progress: number | null;
15253
+ agentIds: string[] | null;
15254
+ closedAt: Date | null;
15255
+ contextReport: unknown;
15256
+ planReport: unknown;
15257
+ executionLog: unknown;
15258
+ verificationReport: unknown;
13731
15259
  };
13732
15260
  meta: object;
13733
15261
  }>;
13734
- grantAIAccess: import("@trpc/server").TRPCMutationProcedure<{
15262
+ close: import("@trpc/server").TRPCMutationProcedure<{
13735
15263
  input: {
13736
- secretId: string;
13737
- proposalId: string;
15264
+ id: string;
13738
15265
  };
13739
15266
  output: {
13740
- vaultRef: string;
13741
- secretId: string;
13742
- proposalId: string;
15267
+ userId: string;
15268
+ workspaceId: string;
15269
+ id: string;
15270
+ updatedAt: Date;
15271
+ createdAt: Date;
15272
+ correlationId: string | null;
15273
+ channelId: string | null;
15274
+ startedAt: Date;
15275
+ status: "active" | "paused" | "closed";
15276
+ goal: string;
15277
+ templateId: string | null;
15278
+ playbookId: string | null;
15279
+ expectedOutputs: unknown;
15280
+ progress: number | null;
15281
+ agentIds: string[] | null;
15282
+ closedAt: Date | null;
15283
+ contextReport: unknown;
15284
+ planReport: unknown;
15285
+ executionLog: unknown;
15286
+ verificationReport: unknown;
13743
15287
  };
13744
15288
  meta: object;
13745
15289
  }>;
13746
15290
  }>>;
13747
- subscriptions: import("@trpc/server").TRPCBuiltRouter<{
15291
+ playbooks: import("@trpc/server").TRPCBuiltRouter<{
13748
15292
  ctx: Context;
13749
15293
  meta: object;
13750
15294
  errorShape: {
@@ -13754,164 +15298,265 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
13754
15298
  };
13755
15299
  transformer: true;
13756
15300
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13757
- listAll: import("@trpc/server").TRPCQueryProcedure<{
13758
- input: {
13759
- workspaceId?: string | null | undefined;
13760
- limit?: number | undefined;
13761
- kind?: "webhook" | "automation" | "ai_feed" | "ai_react" | "notify" | "message_out" | undefined;
13762
- eventType?: string | undefined;
13763
- lens?: "external" | "all" | "internal" | undefined;
13764
- pending?: boolean | undefined;
13765
- };
13766
- output: {
13767
- items: ReactionEvent[];
13768
- lens: ReactionLens;
13769
- };
15301
+ links: import("@trpc/server").TRPCBuiltRouter<{
15302
+ ctx: Context;
13770
15303
  meta: object;
13771
- }>;
13772
- eventFanout: import("@trpc/server").TRPCQueryProcedure<{
13773
- input: {
13774
- eventId: string;
13775
- lens?: "external" | "all" | "internal" | undefined;
13776
- };
13777
- output: ReactionEvent;
15304
+ errorShape: {
15305
+ message: string;
15306
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
15307
+ data: import("@trpc/server").TRPCDefaultErrorData;
15308
+ };
15309
+ transformer: true;
15310
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
15311
+ getFor: import("@trpc/server").TRPCQueryProcedure<{
15312
+ input: {
15313
+ type: "session" | "source" | "channel" | "command" | "entity" | "playbook" | "tool" | "skill" | "participant";
15314
+ id: string;
15315
+ };
15316
+ output: {
15317
+ workspaceId: string | null;
15318
+ id: string;
15319
+ createdAt: Date;
15320
+ metadata: unknown;
15321
+ createdBy: string | null;
15322
+ linkType: LinkType;
15323
+ fromType: LinkEndpointType;
15324
+ fromId: string;
15325
+ toType: LinkEndpointType;
15326
+ toId: string;
15327
+ }[];
15328
+ meta: object;
15329
+ }>;
15330
+ }>>;
15331
+ capabilityRegistry: import("@trpc/server").TRPCBuiltRouter<{
15332
+ ctx: Context;
13778
15333
  meta: object;
13779
- }>;
13780
- }>>;
13781
- aiProviders: import("@trpc/server").TRPCBuiltRouter<{
13782
- ctx: Context;
13783
- meta: object;
13784
- errorShape: {
13785
- message: string;
13786
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
13787
- data: import("@trpc/server").TRPCDefaultErrorData;
13788
- };
13789
- transformer: true;
13790
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
15334
+ errorShape: {
15335
+ message: string;
15336
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
15337
+ data: import("@trpc/server").TRPCDefaultErrorData;
15338
+ };
15339
+ transformer: true;
15340
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
15341
+ list: import("@trpc/server").TRPCQueryProcedure<{
15342
+ input: void;
15343
+ output: Capability[];
15344
+ meta: object;
15345
+ }>;
15346
+ }>>;
13791
15347
  list: import("@trpc/server").TRPCQueryProcedure<{
13792
- input: void;
15348
+ input: {
15349
+ status?: "active" | "paused" | "archived" | "draft" | undefined;
15350
+ limit?: number | undefined;
15351
+ } | undefined;
13793
15352
  output: {
13794
- hasApiKey: boolean;
13795
- name: string;
13796
15353
  id: string;
13797
- updatedAt: Date;
15354
+ workspaceId: string | null;
15355
+ createdBy: string;
15356
+ name: string;
15357
+ description: string | null;
15358
+ goalTemplate: string;
15359
+ params: unknown;
15360
+ inputStrategy: unknown;
15361
+ channelSpec: unknown;
15362
+ expectedOutputs: unknown;
15363
+ schedule: unknown;
15364
+ executor: PlaybookExecutorRef;
15365
+ status: "active" | "paused" | "archived" | "draft";
15366
+ metadata: unknown;
13798
15367
  createdAt: Date;
13799
- metadata: Record<string, unknown>;
13800
- priority: number;
13801
- tags: string[];
13802
- enabled: boolean;
13803
- providerId: string;
13804
- baseUrl: string;
13805
- apiKeyEnvVar: string;
13806
- models: AiProviderModelEntry[];
13807
- rateLimit: {
13808
- rpm: number;
13809
- rpd?: number;
13810
- } | null;
13811
- extraBody: Record<string, unknown> | null;
13812
- systemPromptPrefix: string | null;
15368
+ updatedAt: Date;
13813
15369
  }[];
13814
15370
  meta: object;
13815
15371
  }>;
13816
- upsert: import("@trpc/server").TRPCMutationProcedure<{
15372
+ get: import("@trpc/server").TRPCQueryProcedure<{
13817
15373
  input: {
13818
- providerId: string;
13819
- name: string;
13820
- baseUrl: string;
13821
- apiKeyEnvVar: string;
13822
- apiKey?: string | undefined;
13823
- enabled?: boolean | undefined;
13824
- priority?: number | undefined;
13825
- tags?: string[] | undefined;
13826
- models?: {
13827
- id: string;
13828
- tier?: "free" | "balanced" | "advanced" | "complex" | undefined;
13829
- contextWindow?: number | undefined;
13830
- supportsTools?: boolean | undefined;
13831
- supportsJson?: boolean | undefined;
13832
- costPer1MInput?: number | undefined;
13833
- costPer1MOutput?: number | undefined;
13834
- }[] | undefined;
13835
- rateLimit?: {
13836
- rpm: number;
13837
- rpd?: number | undefined;
13838
- } | undefined;
13839
- extraBody?: Record<string, unknown> | undefined;
13840
- systemPromptPrefix?: string | undefined;
13841
- metadata?: Record<string, unknown> | undefined;
15374
+ id: string;
13842
15375
  };
13843
15376
  output: {
13844
- hasApiKey: boolean;
13845
15377
  name: string;
15378
+ workspaceId: string | null;
13846
15379
  id: string;
13847
15380
  updatedAt: Date;
13848
15381
  createdAt: Date;
13849
- metadata: Record<string, unknown>;
13850
- priority: number;
13851
- tags: string[];
13852
- enabled: boolean;
13853
- providerId: string;
13854
- baseUrl: string;
13855
- apiKeyEnvVar: string;
13856
- models: AiProviderModelEntry[];
13857
- rateLimit: {
13858
- rpm: number;
13859
- rpd?: number;
13860
- } | null;
13861
- extraBody: Record<string, unknown> | null;
13862
- systemPromptPrefix: string | null;
15382
+ metadata: unknown;
15383
+ status: "active" | "paused" | "archived" | "draft";
15384
+ description: string | null;
15385
+ createdBy: string;
15386
+ schedule: unknown;
15387
+ params: unknown;
15388
+ expectedOutputs: unknown;
15389
+ executor: PlaybookExecutorRef;
15390
+ goalTemplate: string;
15391
+ inputStrategy: unknown;
15392
+ channelSpec: unknown;
13863
15393
  };
13864
15394
  meta: object;
13865
15395
  }>;
13866
- enable: import("@trpc/server").TRPCMutationProcedure<{
15396
+ create: import("@trpc/server").TRPCMutationProcedure<{
13867
15397
  input: {
13868
- providerId: string;
15398
+ name: string;
15399
+ goalTemplate: string;
15400
+ agentUserId?: string | undefined;
15401
+ source?: string | undefined;
15402
+ reasoning?: string | undefined;
15403
+ description?: string | undefined;
15404
+ params?: Record<string, unknown>[] | undefined;
15405
+ inputStrategy?: Record<string, unknown> | undefined;
15406
+ channelSpec?: Record<string, unknown> | undefined;
15407
+ expectedOutputs?: Record<string, unknown>[] | undefined;
15408
+ schedule?: unknown;
15409
+ executor?: "is-agent" | "external-agent" | "hybrid" | undefined;
15410
+ status?: "active" | "paused" | "archived" | "draft" | undefined;
13869
15411
  };
13870
15412
  output: {
13871
- ok: boolean;
15413
+ playbook: Playbook | null;
15414
+ status: "proposed";
15415
+ message: string;
15416
+ proposalId: string;
15417
+ } | {
15418
+ playbook: Playbook;
15419
+ status: "created";
15420
+ message: string;
15421
+ proposalId: string | null;
13872
15422
  };
13873
15423
  meta: object;
13874
15424
  }>;
13875
- disable: import("@trpc/server").TRPCMutationProcedure<{
15425
+ update: import("@trpc/server").TRPCMutationProcedure<{
13876
15426
  input: {
13877
- providerId: string;
15427
+ id: string;
15428
+ agentUserId?: string | undefined;
15429
+ source?: string | undefined;
15430
+ reasoning?: string | undefined;
15431
+ name?: string | undefined;
15432
+ description?: string | undefined;
15433
+ goalTemplate?: string | undefined;
15434
+ params?: Record<string, unknown>[] | undefined;
15435
+ inputStrategy?: Record<string, unknown> | undefined;
15436
+ channelSpec?: Record<string, unknown> | undefined;
15437
+ expectedOutputs?: Record<string, unknown>[] | undefined;
15438
+ schedule?: unknown;
15439
+ executor?: "is-agent" | "external-agent" | "hybrid" | undefined;
15440
+ status?: "active" | "paused" | "archived" | "draft" | undefined;
13878
15441
  };
13879
15442
  output: {
13880
- ok: boolean;
15443
+ playbook: Playbook | null;
15444
+ status: "proposed";
15445
+ message: string;
15446
+ proposalId: string;
15447
+ } | {
15448
+ playbook: Playbook;
15449
+ status: "updated";
15450
+ message: string;
15451
+ proposalId: string | null;
13881
15452
  };
13882
15453
  meta: object;
13883
15454
  }>;
13884
- remove: import("@trpc/server").TRPCMutationProcedure<{
15455
+ archive: import("@trpc/server").TRPCMutationProcedure<{
13885
15456
  input: {
13886
- providerId: string;
15457
+ id: string;
15458
+ agentUserId?: string | undefined;
15459
+ source?: string | undefined;
15460
+ reasoning?: string | undefined;
13887
15461
  };
13888
15462
  output: {
13889
- ok: boolean;
15463
+ playbook: Playbook | null;
15464
+ status: "proposed";
15465
+ message: string;
15466
+ proposalId: string;
15467
+ } | {
15468
+ playbook: Playbook;
15469
+ status: "archived";
15470
+ message: string;
15471
+ proposalId: string | null;
13890
15472
  };
13891
15473
  meta: object;
13892
15474
  }>;
13893
- probe: import("@trpc/server").TRPCMutationProcedure<{
15475
+ instantiate: import("@trpc/server").TRPCMutationProcedure<{
13894
15476
  input: {
13895
- providerId: string;
15477
+ playbookId: string;
15478
+ params?: Record<string, unknown> | undefined;
15479
+ agentIds?: string[] | undefined;
15480
+ channelId?: string | undefined;
15481
+ agentUserId?: string | undefined;
15482
+ source?: string | undefined;
15483
+ reasoning?: string | undefined;
13896
15484
  };
13897
15485
  output: {
13898
- ok: boolean;
13899
- models: string[];
13900
- latencyMs: number;
13901
- error?: string;
15486
+ session: FocusSession | null;
15487
+ status: "proposed";
15488
+ message: string;
15489
+ proposalId: string;
15490
+ } | {
15491
+ session: {
15492
+ userId: string;
15493
+ workspaceId: string;
15494
+ id: string;
15495
+ updatedAt: Date;
15496
+ createdAt: Date;
15497
+ correlationId: string | null;
15498
+ channelId: string | null;
15499
+ startedAt: Date;
15500
+ status: "active" | "paused" | "closed";
15501
+ goal: string;
15502
+ templateId: string | null;
15503
+ playbookId: string | null;
15504
+ expectedOutputs: unknown;
15505
+ progress: number | null;
15506
+ agentIds: string[] | null;
15507
+ closedAt: Date | null;
15508
+ contextReport: unknown;
15509
+ planReport: unknown;
15510
+ executionLog: unknown;
15511
+ verificationReport: unknown;
15512
+ };
15513
+ status: "created";
15514
+ message: string;
15515
+ proposalId: string | null;
13902
15516
  };
13903
15517
  meta: object;
13904
15518
  }>;
13905
- sync: import("@trpc/server").TRPCMutationProcedure<{
13906
- input: void;
15519
+ promote: import("@trpc/server").TRPCMutationProcedure<{
15520
+ input: {
15521
+ sessionId: string;
15522
+ name?: string | undefined;
15523
+ description?: string | undefined;
15524
+ agentUserId?: string | undefined;
15525
+ source?: string | undefined;
15526
+ reasoning?: string | undefined;
15527
+ };
13907
15528
  output: {
13908
- ok: boolean;
13909
- count: number;
15529
+ playbook: Playbook | null;
15530
+ status: "proposed";
15531
+ message: string;
15532
+ proposalId: string;
15533
+ } | {
15534
+ playbook: {
15535
+ name: string;
15536
+ workspaceId: string | null;
15537
+ id: string;
15538
+ updatedAt: Date;
15539
+ createdAt: Date;
15540
+ metadata: unknown;
15541
+ status: "active" | "paused" | "archived" | "draft";
15542
+ description: string | null;
15543
+ createdBy: string;
15544
+ schedule: unknown;
15545
+ params: unknown;
15546
+ expectedOutputs: unknown;
15547
+ executor: PlaybookExecutorRef;
15548
+ goalTemplate: string;
15549
+ inputStrategy: unknown;
15550
+ channelSpec: unknown;
15551
+ };
15552
+ status: "promoted";
15553
+ message: string;
15554
+ proposalId: string | null;
13910
15555
  };
13911
15556
  meta: object;
13912
15557
  }>;
13913
15558
  }>>;
13914
- aiProviderCredentials: import("@trpc/server").TRPCBuiltRouter<{
15559
+ artifacts: import("@trpc/server").TRPCBuiltRouter<{
13915
15560
  ctx: Context;
13916
15561
  meta: object;
13917
15562
  errorShape: {
@@ -13921,86 +15566,144 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
13921
15566
  };
13922
15567
  transformer: true;
13923
15568
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13924
- listForWorkspace: import("@trpc/server").TRPCQueryProcedure<{
15569
+ list: import("@trpc/server").TRPCQueryProcedure<{
13925
15570
  input: {
13926
- workspaceId: string;
15571
+ state?: "working" | "kept" | "swept" | undefined;
15572
+ placement?: "desk" | "home" | "sidebar" | "library" | undefined;
15573
+ sessionId?: string | undefined;
15574
+ limit?: number | undefined;
13927
15575
  };
13928
- output: (Omit<{
13929
- userId: string | null;
13930
- workspaceId: string | null;
15576
+ output: {
13931
15577
  id: string;
13932
- updatedAt: Date;
15578
+ workspaceId: string;
15579
+ userId: string;
15580
+ kind: "url" | "entity" | "cell" | "document" | "view";
15581
+ refId: string | null;
15582
+ cellKey: string | null;
15583
+ props: unknown;
15584
+ title: string;
15585
+ originKind: "user" | "system" | "agent" | "deeplink";
15586
+ actorId: string | null;
15587
+ sessionId: string | null;
15588
+ state: "working" | "kept" | "swept";
15589
+ placement: "desk" | "home" | "sidebar" | "library";
15590
+ keptAt: Date | null;
15591
+ sweptAt: Date | null;
13933
15592
  createdAt: Date;
13934
- createdBy: string;
13935
- priority: number;
13936
- enabled: boolean;
13937
- providerId: string;
13938
- encryptedApiKey: string;
13939
- }, "encryptedApiKey"> & {
13940
- hasApiKey: true;
13941
- })[];
15593
+ updatedAt: Date;
15594
+ }[];
13942
15595
  meta: object;
13943
15596
  }>;
13944
- upsertForWorkspace: import("@trpc/server").TRPCMutationProcedure<{
15597
+ listAll: import("@trpc/server").TRPCQueryProcedure<{
13945
15598
  input: {
13946
- providerId: string;
13947
- apiKey: string;
13948
- workspaceId: string;
13949
- enabled?: boolean | undefined;
13950
- priority?: number | undefined;
15599
+ state?: "working" | "kept" | "swept" | undefined;
15600
+ placement?: "desk" | "home" | "sidebar" | "library" | undefined;
15601
+ sessionId?: string | undefined;
15602
+ limit?: number | undefined;
13951
15603
  };
13952
15604
  output: {
13953
- ok: boolean;
13954
- };
15605
+ id: string;
15606
+ workspaceId: string;
15607
+ userId: string;
15608
+ kind: "url" | "entity" | "cell" | "document" | "view";
15609
+ refId: string | null;
15610
+ cellKey: string | null;
15611
+ props: unknown;
15612
+ title: string;
15613
+ originKind: "user" | "system" | "agent" | "deeplink";
15614
+ actorId: string | null;
15615
+ sessionId: string | null;
15616
+ state: "working" | "kept" | "swept";
15617
+ placement: "desk" | "home" | "sidebar" | "library";
15618
+ keptAt: Date | null;
15619
+ sweptAt: Date | null;
15620
+ createdAt: Date;
15621
+ updatedAt: Date;
15622
+ }[];
13955
15623
  meta: object;
13956
15624
  }>;
13957
- removeForWorkspace: import("@trpc/server").TRPCMutationProcedure<{
15625
+ get: import("@trpc/server").TRPCQueryProcedure<{
13958
15626
  input: {
13959
- workspaceId: string;
13960
- providerId: string;
15627
+ id: string;
13961
15628
  };
13962
15629
  output: {
13963
- ok: boolean;
13964
- };
13965
- meta: object;
13966
- }>;
13967
- listForUser: import("@trpc/server").TRPCQueryProcedure<{
13968
- input: void;
13969
- output: (Omit<{
13970
- userId: string | null;
13971
- workspaceId: string | null;
15630
+ userId: string;
15631
+ workspaceId: string;
15632
+ sessionId: string | null;
13972
15633
  id: string;
13973
15634
  updatedAt: Date;
13974
15635
  createdAt: Date;
13975
- createdBy: string;
13976
- priority: number;
13977
- enabled: boolean;
13978
- providerId: string;
13979
- encryptedApiKey: string;
13980
- }, "encryptedApiKey"> & {
13981
- hasApiKey: true;
13982
- })[];
15636
+ title: string;
15637
+ kind: "url" | "entity" | "cell" | "document" | "view";
15638
+ refId: string | null;
15639
+ cellKey: string | null;
15640
+ props: unknown;
15641
+ originKind: "user" | "system" | "agent" | "deeplink";
15642
+ actorId: string | null;
15643
+ state: "working" | "kept" | "swept";
15644
+ placement: "desk" | "home" | "sidebar" | "library";
15645
+ keptAt: Date | null;
15646
+ sweptAt: Date | null;
15647
+ };
13983
15648
  meta: object;
13984
15649
  }>;
13985
- upsertForUser: import("@trpc/server").TRPCMutationProcedure<{
15650
+ create: import("@trpc/server").TRPCMutationProcedure<{
13986
15651
  input: {
13987
- providerId: string;
13988
- apiKey: string;
13989
- enabled?: boolean | undefined;
13990
- priority?: number | undefined;
13991
- workspaceId?: string | undefined;
15652
+ kind: "url" | "entity" | "cell" | "document" | "view";
15653
+ title: string;
15654
+ refId?: string | undefined;
15655
+ cellKey?: string | undefined;
15656
+ props?: unknown;
15657
+ originKind?: "user" | "system" | "agent" | "deeplink" | undefined;
15658
+ actorId?: string | undefined;
15659
+ sessionId?: string | undefined;
15660
+ placement?: "desk" | "home" | "sidebar" | "library" | undefined;
13992
15661
  };
13993
15662
  output: {
13994
- ok: boolean;
15663
+ userId: string;
15664
+ workspaceId: string;
15665
+ sessionId: string | null;
15666
+ id: string;
15667
+ updatedAt: Date;
15668
+ createdAt: Date;
15669
+ title: string;
15670
+ kind: "url" | "entity" | "cell" | "document" | "view";
15671
+ refId: string | null;
15672
+ cellKey: string | null;
15673
+ props: unknown;
15674
+ originKind: "user" | "system" | "agent" | "deeplink";
15675
+ actorId: string | null;
15676
+ state: "working" | "kept" | "swept";
15677
+ placement: "desk" | "home" | "sidebar" | "library";
15678
+ keptAt: Date | null;
15679
+ sweptAt: Date | null;
13995
15680
  };
13996
15681
  meta: object;
13997
15682
  }>;
13998
- removeForUser: import("@trpc/server").TRPCMutationProcedure<{
15683
+ setState: import("@trpc/server").TRPCMutationProcedure<{
13999
15684
  input: {
14000
- providerId: string;
15685
+ id: string;
15686
+ state: "working" | "kept" | "swept";
15687
+ placement?: "desk" | "home" | "sidebar" | "library" | undefined;
14001
15688
  };
14002
15689
  output: {
14003
- ok: boolean;
15690
+ userId: string;
15691
+ workspaceId: string;
15692
+ sessionId: string | null;
15693
+ id: string;
15694
+ updatedAt: Date;
15695
+ createdAt: Date;
15696
+ title: string;
15697
+ kind: "url" | "entity" | "cell" | "document" | "view";
15698
+ refId: string | null;
15699
+ cellKey: string | null;
15700
+ props: unknown;
15701
+ originKind: "user" | "system" | "agent" | "deeplink";
15702
+ actorId: string | null;
15703
+ state: "working" | "kept" | "swept";
15704
+ placement: "desk" | "home" | "sidebar" | "library";
15705
+ keptAt: Date | null;
15706
+ sweptAt: Date | null;
14004
15707
  };
14005
15708
  meta: object;
14006
15709
  }>;