@ever-works/oidc-identity 1.0.4 → 1.0.6

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.
package/dist/index.cjs CHANGED
@@ -324,10 +324,14 @@ var USER_SELECTABLE_WORK_KINDS = [
324
324
  "repo",
325
325
  "app"
326
326
  ];
327
- var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "default"];
327
+ var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "project", "default"];
328
328
  var WORK_KIND_SET = new Set(WORK_KINDS);
329
329
  var GOAL_KINDS = ["metric", "delivery"];
330
330
  var GOAL_KIND_SET = new Set(GOAL_KINDS);
331
+ var RECORD_VISIBILITIES = ["private", "team", "organization"];
332
+ var RECORD_VISIBILITY_SET = new Set(RECORD_VISIBILITIES);
333
+ var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
334
+ var RECORD_LIST_VIEW_SET = new Set(RECORD_LIST_VIEWS);
331
335
  var APP_DEPENDENCY_BACKUP_OVERDUE_MS = 26 * 36e5;
332
336
  var APP_DEPENDENCY_MANAGED = {
333
337
  pgRoleConnectionLimit: 20,
@@ -1120,6 +1124,10 @@ var FLEET_AGENT_TASK_TIMELINE_MAX_BYTES = 48 * 1024;
1120
1124
  var FLEET_AGENT_TASK_TRANSCRIPT_MAX_BYTES = 64 * 1024;
1121
1125
  var FLEET_AGENT_TASK_QUESTION_MAX_FILE_BYTES = 64 * 1024;
1122
1126
  var FLEET_AGENT_TASK_QUESTION_MAX_CONTEXT_BYTES = 6 * 1024;
1127
+ var FLEET_MODEL_USAGE_LIMIT_FALLBACK_MS = 60 * 60 * 1e3;
1128
+ var FLEET_MODEL_USAGE_LIMIT_MIN_MS = 60 * 1e3;
1129
+ var FLEET_MODEL_USAGE_LIMIT_MAX_MS = 8 * 24 * 60 * 60 * 1e3;
1130
+ var FLEET_MODEL_USAGE_LIMIT_RESET_SLACK_MS = 60 * 1e3;
1123
1131
  var FLEET_NODE_MAX_MEMORY_MB = 1024 * 1024;
1124
1132
  var FLEET_MAX_DAILY_COST_CEILING_CENTS = 1e5 * 100;
1125
1133
  var FLEET_MAX_DISK_FREE_BYTES = 2 ** 60;
@@ -1529,6 +1537,152 @@ var EVER_STATS_SIGNATURE_HEADER = CONSTANTS.stats_headers.signature;
1529
1537
  var EVER_STATS_KEY_ID_HEADER = CONSTANTS.stats_headers.key_id;
1530
1538
  var EVER_STATS_SIGNATURE_PREFIX = CONSTANTS.stats_signature_prefix;
1531
1539
  var EVER_STATS_MAX_BODY_BYTES = CONSTANTS.stats.max_bytes;
1540
+ var DOMAIN_EVENT_CATALOG = [
1541
+ // EW-P2-6 — `org:write` (and the app) create Organizations.
1542
+ { type: "organization.created", domain: "organization", aggregateType: "organization", phase: "P2" },
1543
+ { type: "organization.updated", domain: "organization", aggregateType: "organization", phase: "P1" },
1544
+ {
1545
+ type: "organization.member.added",
1546
+ domain: "organization",
1547
+ aggregateType: "organization",
1548
+ phase: "P1",
1549
+ child: "member"
1550
+ },
1551
+ {
1552
+ type: "organization.member.updated",
1553
+ domain: "organization",
1554
+ aggregateType: "organization",
1555
+ phase: "P1",
1556
+ child: "member"
1557
+ },
1558
+ {
1559
+ type: "organization.member.removed",
1560
+ domain: "organization",
1561
+ aggregateType: "organization",
1562
+ phase: "P1",
1563
+ child: "member"
1564
+ },
1565
+ { type: "agent.created", domain: "agents", aggregateType: "agent", phase: "P1" },
1566
+ { type: "agent.updated", domain: "agents", aggregateType: "agent", phase: "P1" },
1567
+ { type: "agent.status_changed", domain: "agents", aggregateType: "agent", phase: "P1" },
1568
+ { type: "agent.archived", domain: "agents", aggregateType: "agent", phase: "P1" },
1569
+ { type: "agent.deleted", domain: "agents", aggregateType: "agent", phase: "P1" },
1570
+ { type: "team.created", domain: "teams", aggregateType: "team", phase: "P1" },
1571
+ { type: "team.updated", domain: "teams", aggregateType: "team", phase: "P1" },
1572
+ { type: "team.deleted", domain: "teams", aggregateType: "team", phase: "P1" },
1573
+ { type: "team.member.added", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1574
+ { type: "team.member.updated", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1575
+ { type: "team.member.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1576
+ { type: "team.resource.added", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1577
+ { type: "team.resource.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1578
+ { type: "work.created", domain: "works", aggregateType: "work", phase: "P1" },
1579
+ { type: "work.updated", domain: "works", aggregateType: "work", phase: "P1" },
1580
+ { type: "work.archived", domain: "works", aggregateType: "work", phase: "P1" },
1581
+ { type: "work.deleted", domain: "works", aggregateType: "work", phase: "P1" },
1582
+ { type: "work.member.added", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1583
+ { type: "work.member.updated", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1584
+ { type: "work.member.removed", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1585
+ { type: "mission.created", domain: "missions", aggregateType: "mission", phase: "P2" },
1586
+ { type: "mission.updated", domain: "missions", aggregateType: "mission", phase: "P2" },
1587
+ { type: "mission.status_changed", domain: "missions", aggregateType: "mission", phase: "P2" },
1588
+ { type: "mission.deleted", domain: "missions", aggregateType: "mission", phase: "P2" },
1589
+ { type: "mission.goal.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1590
+ { type: "mission.goal.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1591
+ { type: "mission.work.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1592
+ { type: "mission.work.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1593
+ { type: "goal.created", domain: "goals", aggregateType: "goal", phase: "P2" },
1594
+ { type: "goal.updated", domain: "goals", aggregateType: "goal", phase: "P2" },
1595
+ { type: "goal.status_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1596
+ { type: "goal.archived", domain: "goals", aggregateType: "goal", phase: "P2" },
1597
+ { type: "goal.unarchived", domain: "goals", aggregateType: "goal", phase: "P2" },
1598
+ { type: "goal.deleted", domain: "goals", aggregateType: "goal", phase: "P2" },
1599
+ { type: "goal.progress_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1600
+ { type: "idea.created", domain: "ideas", aggregateType: "idea", phase: "P2" },
1601
+ { type: "idea.updated", domain: "ideas", aggregateType: "idea", phase: "P2" },
1602
+ { type: "idea.status_changed", domain: "ideas", aggregateType: "idea", phase: "P2" },
1603
+ { type: "idea.deleted", domain: "ideas", aggregateType: "idea", phase: "P2" },
1604
+ { type: "task.created", domain: "tasks", aggregateType: "task", phase: "P1" },
1605
+ { type: "task.updated", domain: "tasks", aggregateType: "task", phase: "P1" },
1606
+ { type: "task.transitioned", domain: "tasks", aggregateType: "task", phase: "P1" },
1607
+ { type: "task.deleted", domain: "tasks", aggregateType: "task", phase: "P1" },
1608
+ { type: "task.assignee.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1609
+ { type: "task.assignee.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1610
+ { type: "task.watcher.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1611
+ { type: "task.watcher.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1612
+ { type: "task.block.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1613
+ { type: "task.block.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1614
+ { type: "task.relation.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1615
+ { type: "task.relation.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1616
+ { type: "task.comment.created", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1617
+ { type: "task.comment.updated", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1618
+ { type: "task.comment.deleted", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1619
+ { type: "task.attachment.added", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1620
+ { type: "task.attachment.removed", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1621
+ { type: "task.runtime_updated", domain: "tasks", aggregateType: "task", phase: "P1", optIn: true },
1622
+ { type: "inbox.item.created", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1623
+ { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1624
+ { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1625
+ { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1626
+ { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1627
+ { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1628
+ { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1629
+ { type: "kb.document.archived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1630
+ { type: "kb.document.unarchived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1631
+ { type: "kb.document.deleted", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1632
+ { type: "kb.document.review_changed", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1633
+ { type: "kb.folder.created", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1634
+ { type: "kb.folder.updated", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1635
+ { type: "kb.folder.deleted", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1636
+ { type: "email.message.received", domain: "email", aggregateType: "email_message", phase: "P4" },
1637
+ { type: "email.message.sent", domain: "email", aggregateType: "email_message", phase: "P4" },
1638
+ { type: "email.message.status_changed", domain: "email", aggregateType: "email_message", phase: "P4" },
1639
+ { type: "task.visibility_changed", domain: "visibility", aggregateType: "task", phase: "P1" },
1640
+ { type: "agent.visibility_changed", domain: "visibility", aggregateType: "agent", phase: "P1" },
1641
+ { type: "goal.visibility_changed", domain: "visibility", aggregateType: "goal", phase: "P2" },
1642
+ { type: "mission.visibility_changed", domain: "visibility", aggregateType: "mission", phase: "P2" },
1643
+ { type: "idea.visibility_changed", domain: "visibility", aggregateType: "idea", phase: "P2" }
1644
+ ];
1645
+ var DOMAIN_EVENT_TYPES = DOMAIN_EVENT_CATALOG.map((entry) => entry.type);
1646
+ var CATALOG_BY_TYPE = new Map(
1647
+ DOMAIN_EVENT_CATALOG.map((entry) => [entry.type, entry])
1648
+ );
1649
+ var RECIPIENT_SCOPED_EVENT_DOMAINS = {
1650
+ inbox: "inbox:read",
1651
+ email: "email:read"
1652
+ };
1653
+ var RECIPIENT_EVENT_SCOPES = Object.values(RECIPIENT_SCOPED_EVENT_DOMAINS);
1654
+ var INTEGRATION_SCOPES = [
1655
+ "org:read",
1656
+ "org:write",
1657
+ "members:read",
1658
+ "members:write",
1659
+ "agents:read",
1660
+ "teams:read",
1661
+ "teams:write",
1662
+ "works:read",
1663
+ "works:write",
1664
+ "missions:read",
1665
+ "missions:write",
1666
+ "goals:read",
1667
+ "goals:write",
1668
+ "ideas:read",
1669
+ "ideas:write",
1670
+ "tasks:read",
1671
+ "tasks:write",
1672
+ "inbox:read",
1673
+ "inbox:write",
1674
+ "kb:read",
1675
+ "kb:write",
1676
+ "email:read",
1677
+ "email:write",
1678
+ "events:read",
1679
+ "webhooks:manage",
1680
+ "links:write"
1681
+ ];
1682
+ var INTEGRATION_OPT_IN_SCOPES = ["org:write", "email:write"];
1683
+ var EVER_GAUZY_PRESET_SCOPES = INTEGRATION_SCOPES.filter(
1684
+ (scope) => !INTEGRATION_OPT_IN_SCOPES.includes(scope)
1685
+ );
1532
1686
 
1533
1687
  // ../../plugin/dist/index.js
1534
1688
  var DEFAULT_DIFF_MAX_BYTES = 256 * 1024;
@@ -1675,7 +1829,14 @@ var PLUGIN_CAPABILITIES = {
1675
1829
  // new category: the tier's plugin is a `deployment` plugin, so
1676
1830
  // `PLUGIN_CATEGORIES` is untouched and every exhaustive map over it in
1677
1831
  // `apps/web` stays total.
1678
- APPS_TIER: "apps-tier"
1832
+ APPS_TIER: "apps-tier",
1833
+ // Domain events (EW-P1-1) — plugins that follow the durable domain event
1834
+ // outbox (`task.updated`, `team.member.added`, …) through the relay, at
1835
+ // least once, with a per-plugin cursor. See
1836
+ // `capabilities/domain-event-subscriber.interface.ts`. Appended last, so
1837
+ // every existing constant keeps its value and its position; no category is
1838
+ // added (a subscriber plugin keeps the category of what it otherwise is).
1839
+ DOMAIN_EVENT_SUBSCRIBER: "domain-event-subscriber"
1679
1840
  };
1680
1841
  var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
1681
1842
  var IdentityTokenRejectedError = class extends Error {
package/dist/index.js CHANGED
@@ -259,10 +259,14 @@ var USER_SELECTABLE_WORK_KINDS = [
259
259
  "repo",
260
260
  "app"
261
261
  ];
262
- var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "default"];
262
+ var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "project", "default"];
263
263
  var WORK_KIND_SET = new Set(WORK_KINDS);
264
264
  var GOAL_KINDS = ["metric", "delivery"];
265
265
  var GOAL_KIND_SET = new Set(GOAL_KINDS);
266
+ var RECORD_VISIBILITIES = ["private", "team", "organization"];
267
+ var RECORD_VISIBILITY_SET = new Set(RECORD_VISIBILITIES);
268
+ var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
269
+ var RECORD_LIST_VIEW_SET = new Set(RECORD_LIST_VIEWS);
266
270
  var APP_DEPENDENCY_BACKUP_OVERDUE_MS = 26 * 36e5;
267
271
  var APP_DEPENDENCY_MANAGED = {
268
272
  pgRoleConnectionLimit: 20,
@@ -1055,6 +1059,10 @@ var FLEET_AGENT_TASK_TIMELINE_MAX_BYTES = 48 * 1024;
1055
1059
  var FLEET_AGENT_TASK_TRANSCRIPT_MAX_BYTES = 64 * 1024;
1056
1060
  var FLEET_AGENT_TASK_QUESTION_MAX_FILE_BYTES = 64 * 1024;
1057
1061
  var FLEET_AGENT_TASK_QUESTION_MAX_CONTEXT_BYTES = 6 * 1024;
1062
+ var FLEET_MODEL_USAGE_LIMIT_FALLBACK_MS = 60 * 60 * 1e3;
1063
+ var FLEET_MODEL_USAGE_LIMIT_MIN_MS = 60 * 1e3;
1064
+ var FLEET_MODEL_USAGE_LIMIT_MAX_MS = 8 * 24 * 60 * 60 * 1e3;
1065
+ var FLEET_MODEL_USAGE_LIMIT_RESET_SLACK_MS = 60 * 1e3;
1058
1066
  var FLEET_NODE_MAX_MEMORY_MB = 1024 * 1024;
1059
1067
  var FLEET_MAX_DAILY_COST_CEILING_CENTS = 1e5 * 100;
1060
1068
  var FLEET_MAX_DISK_FREE_BYTES = 2 ** 60;
@@ -1464,6 +1472,152 @@ var EVER_STATS_SIGNATURE_HEADER = CONSTANTS.stats_headers.signature;
1464
1472
  var EVER_STATS_KEY_ID_HEADER = CONSTANTS.stats_headers.key_id;
1465
1473
  var EVER_STATS_SIGNATURE_PREFIX = CONSTANTS.stats_signature_prefix;
1466
1474
  var EVER_STATS_MAX_BODY_BYTES = CONSTANTS.stats.max_bytes;
1475
+ var DOMAIN_EVENT_CATALOG = [
1476
+ // EW-P2-6 — `org:write` (and the app) create Organizations.
1477
+ { type: "organization.created", domain: "organization", aggregateType: "organization", phase: "P2" },
1478
+ { type: "organization.updated", domain: "organization", aggregateType: "organization", phase: "P1" },
1479
+ {
1480
+ type: "organization.member.added",
1481
+ domain: "organization",
1482
+ aggregateType: "organization",
1483
+ phase: "P1",
1484
+ child: "member"
1485
+ },
1486
+ {
1487
+ type: "organization.member.updated",
1488
+ domain: "organization",
1489
+ aggregateType: "organization",
1490
+ phase: "P1",
1491
+ child: "member"
1492
+ },
1493
+ {
1494
+ type: "organization.member.removed",
1495
+ domain: "organization",
1496
+ aggregateType: "organization",
1497
+ phase: "P1",
1498
+ child: "member"
1499
+ },
1500
+ { type: "agent.created", domain: "agents", aggregateType: "agent", phase: "P1" },
1501
+ { type: "agent.updated", domain: "agents", aggregateType: "agent", phase: "P1" },
1502
+ { type: "agent.status_changed", domain: "agents", aggregateType: "agent", phase: "P1" },
1503
+ { type: "agent.archived", domain: "agents", aggregateType: "agent", phase: "P1" },
1504
+ { type: "agent.deleted", domain: "agents", aggregateType: "agent", phase: "P1" },
1505
+ { type: "team.created", domain: "teams", aggregateType: "team", phase: "P1" },
1506
+ { type: "team.updated", domain: "teams", aggregateType: "team", phase: "P1" },
1507
+ { type: "team.deleted", domain: "teams", aggregateType: "team", phase: "P1" },
1508
+ { type: "team.member.added", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1509
+ { type: "team.member.updated", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1510
+ { type: "team.member.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1511
+ { type: "team.resource.added", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1512
+ { type: "team.resource.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1513
+ { type: "work.created", domain: "works", aggregateType: "work", phase: "P1" },
1514
+ { type: "work.updated", domain: "works", aggregateType: "work", phase: "P1" },
1515
+ { type: "work.archived", domain: "works", aggregateType: "work", phase: "P1" },
1516
+ { type: "work.deleted", domain: "works", aggregateType: "work", phase: "P1" },
1517
+ { type: "work.member.added", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1518
+ { type: "work.member.updated", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1519
+ { type: "work.member.removed", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1520
+ { type: "mission.created", domain: "missions", aggregateType: "mission", phase: "P2" },
1521
+ { type: "mission.updated", domain: "missions", aggregateType: "mission", phase: "P2" },
1522
+ { type: "mission.status_changed", domain: "missions", aggregateType: "mission", phase: "P2" },
1523
+ { type: "mission.deleted", domain: "missions", aggregateType: "mission", phase: "P2" },
1524
+ { type: "mission.goal.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1525
+ { type: "mission.goal.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1526
+ { type: "mission.work.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1527
+ { type: "mission.work.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1528
+ { type: "goal.created", domain: "goals", aggregateType: "goal", phase: "P2" },
1529
+ { type: "goal.updated", domain: "goals", aggregateType: "goal", phase: "P2" },
1530
+ { type: "goal.status_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1531
+ { type: "goal.archived", domain: "goals", aggregateType: "goal", phase: "P2" },
1532
+ { type: "goal.unarchived", domain: "goals", aggregateType: "goal", phase: "P2" },
1533
+ { type: "goal.deleted", domain: "goals", aggregateType: "goal", phase: "P2" },
1534
+ { type: "goal.progress_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1535
+ { type: "idea.created", domain: "ideas", aggregateType: "idea", phase: "P2" },
1536
+ { type: "idea.updated", domain: "ideas", aggregateType: "idea", phase: "P2" },
1537
+ { type: "idea.status_changed", domain: "ideas", aggregateType: "idea", phase: "P2" },
1538
+ { type: "idea.deleted", domain: "ideas", aggregateType: "idea", phase: "P2" },
1539
+ { type: "task.created", domain: "tasks", aggregateType: "task", phase: "P1" },
1540
+ { type: "task.updated", domain: "tasks", aggregateType: "task", phase: "P1" },
1541
+ { type: "task.transitioned", domain: "tasks", aggregateType: "task", phase: "P1" },
1542
+ { type: "task.deleted", domain: "tasks", aggregateType: "task", phase: "P1" },
1543
+ { type: "task.assignee.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1544
+ { type: "task.assignee.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1545
+ { type: "task.watcher.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1546
+ { type: "task.watcher.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1547
+ { type: "task.block.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1548
+ { type: "task.block.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1549
+ { type: "task.relation.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1550
+ { type: "task.relation.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1551
+ { type: "task.comment.created", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1552
+ { type: "task.comment.updated", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1553
+ { type: "task.comment.deleted", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1554
+ { type: "task.attachment.added", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1555
+ { type: "task.attachment.removed", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1556
+ { type: "task.runtime_updated", domain: "tasks", aggregateType: "task", phase: "P1", optIn: true },
1557
+ { type: "inbox.item.created", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1558
+ { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1559
+ { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1560
+ { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1561
+ { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1562
+ { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1563
+ { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1564
+ { type: "kb.document.archived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1565
+ { type: "kb.document.unarchived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1566
+ { type: "kb.document.deleted", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1567
+ { type: "kb.document.review_changed", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1568
+ { type: "kb.folder.created", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1569
+ { type: "kb.folder.updated", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1570
+ { type: "kb.folder.deleted", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1571
+ { type: "email.message.received", domain: "email", aggregateType: "email_message", phase: "P4" },
1572
+ { type: "email.message.sent", domain: "email", aggregateType: "email_message", phase: "P4" },
1573
+ { type: "email.message.status_changed", domain: "email", aggregateType: "email_message", phase: "P4" },
1574
+ { type: "task.visibility_changed", domain: "visibility", aggregateType: "task", phase: "P1" },
1575
+ { type: "agent.visibility_changed", domain: "visibility", aggregateType: "agent", phase: "P1" },
1576
+ { type: "goal.visibility_changed", domain: "visibility", aggregateType: "goal", phase: "P2" },
1577
+ { type: "mission.visibility_changed", domain: "visibility", aggregateType: "mission", phase: "P2" },
1578
+ { type: "idea.visibility_changed", domain: "visibility", aggregateType: "idea", phase: "P2" }
1579
+ ];
1580
+ var DOMAIN_EVENT_TYPES = DOMAIN_EVENT_CATALOG.map((entry) => entry.type);
1581
+ var CATALOG_BY_TYPE = new Map(
1582
+ DOMAIN_EVENT_CATALOG.map((entry) => [entry.type, entry])
1583
+ );
1584
+ var RECIPIENT_SCOPED_EVENT_DOMAINS = {
1585
+ inbox: "inbox:read",
1586
+ email: "email:read"
1587
+ };
1588
+ var RECIPIENT_EVENT_SCOPES = Object.values(RECIPIENT_SCOPED_EVENT_DOMAINS);
1589
+ var INTEGRATION_SCOPES = [
1590
+ "org:read",
1591
+ "org:write",
1592
+ "members:read",
1593
+ "members:write",
1594
+ "agents:read",
1595
+ "teams:read",
1596
+ "teams:write",
1597
+ "works:read",
1598
+ "works:write",
1599
+ "missions:read",
1600
+ "missions:write",
1601
+ "goals:read",
1602
+ "goals:write",
1603
+ "ideas:read",
1604
+ "ideas:write",
1605
+ "tasks:read",
1606
+ "tasks:write",
1607
+ "inbox:read",
1608
+ "inbox:write",
1609
+ "kb:read",
1610
+ "kb:write",
1611
+ "email:read",
1612
+ "email:write",
1613
+ "events:read",
1614
+ "webhooks:manage",
1615
+ "links:write"
1616
+ ];
1617
+ var INTEGRATION_OPT_IN_SCOPES = ["org:write", "email:write"];
1618
+ var EVER_GAUZY_PRESET_SCOPES = INTEGRATION_SCOPES.filter(
1619
+ (scope) => !INTEGRATION_OPT_IN_SCOPES.includes(scope)
1620
+ );
1467
1621
 
1468
1622
  // ../../plugin/dist/index.js
1469
1623
  var DEFAULT_DIFF_MAX_BYTES = 256 * 1024;
@@ -1610,7 +1764,14 @@ var PLUGIN_CAPABILITIES = {
1610
1764
  // new category: the tier's plugin is a `deployment` plugin, so
1611
1765
  // `PLUGIN_CATEGORIES` is untouched and every exhaustive map over it in
1612
1766
  // `apps/web` stays total.
1613
- APPS_TIER: "apps-tier"
1767
+ APPS_TIER: "apps-tier",
1768
+ // Domain events (EW-P1-1) — plugins that follow the durable domain event
1769
+ // outbox (`task.updated`, `team.member.added`, …) through the relay, at
1770
+ // least once, with a per-plugin cursor. See
1771
+ // `capabilities/domain-event-subscriber.interface.ts`. Appended last, so
1772
+ // every existing constant keeps its value and its position; no category is
1773
+ // added (a subscriber plugin keeps the category of what it otherwise is).
1774
+ DOMAIN_EVENT_SUBSCRIBER: "domain-event-subscriber"
1614
1775
  };
1615
1776
  var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
1616
1777
  var IdentityTokenRejectedError = class extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ever-works/oidc-identity",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "OpenID Connect identity provider plugin (Ever ID) for Ever Works",
5
5
  "author": {
6
6
  "name": "Ever Co. LTD",
@@ -38,20 +38,20 @@
38
38
  "test:coverage": "vitest run --coverage"
39
39
  },
40
40
  "peerDependencies": {
41
- "@ever-works/plugin": "^1.2.4"
41
+ "@ever-works/plugin": "^1.2.6"
42
42
  },
43
43
  "dependencies": {
44
44
  "jose": "^6",
45
45
  "openid-client": "^6"
46
46
  },
47
47
  "devDependencies": {
48
- "@ever-works/plugin": "^1.2.4",
48
+ "@ever-works/plugin": "^1.2.6",
49
49
  "@types/node": "^26.6.4",
50
50
  "ajv": "^8.18.0",
51
51
  "ajv-formats": "^3.0.1",
52
52
  "tsup": "^8.0.0",
53
53
  "typescript": "^5.9.3",
54
- "vitest": "^4.1.0"
54
+ "vitest": "^5.0.5"
55
55
  },
56
56
  "everworks": {
57
57
  "plugin": {
@@ -81,8 +81,8 @@
81
81
  "url": "https://github.com/ever-works/ever-works/issues"
82
82
  },
83
83
  "everworksRelease": {
84
- "contentHash": "sha256:16b32409bd6fdaa8b6aab4bd22b10d8bdb25e9cc9012bcf648fe4efe6d6a032a",
85
- "commit": "db9734a246fefc8963505af3712703524107f75a",
86
- "source": "https://github.com/ever-works/ever-works/tree/db9734a246fefc8963505af3712703524107f75a/packages/plugins/oidc-identity"
84
+ "contentHash": "sha256:4ca67706a6886437e609edcf027e5eee9fe402f90f05fdde9d8e33709427ad71",
85
+ "commit": "48bb7f0a20744cbdfae87675743421804e100af6",
86
+ "source": "https://github.com/ever-works/ever-works/tree/48bb7f0a20744cbdfae87675743421804e100af6/packages/plugins/oidc-identity"
87
87
  }
88
88
  }