@ever-works/hermes-agent-plugin 1.0.5 → 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
@@ -295,10 +295,14 @@ var USER_SELECTABLE_WORK_KINDS = [
295
295
  "repo",
296
296
  "app"
297
297
  ];
298
- var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "default"];
298
+ var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "project", "default"];
299
299
  var WORK_KIND_SET = new Set(WORK_KINDS);
300
300
  var GOAL_KINDS = ["metric", "delivery"];
301
301
  var GOAL_KIND_SET = new Set(GOAL_KINDS);
302
+ var RECORD_VISIBILITIES = ["private", "team", "organization"];
303
+ var RECORD_VISIBILITY_SET = new Set(RECORD_VISIBILITIES);
304
+ var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
305
+ var RECORD_LIST_VIEW_SET = new Set(RECORD_LIST_VIEWS);
302
306
  var APP_DEPENDENCY_BACKUP_OVERDUE_MS = 26 * 36e5;
303
307
  var APP_DEPENDENCY_MANAGED = {
304
308
  pgRoleConnectionLimit: 20,
@@ -1500,6 +1504,152 @@ var EVER_STATS_SIGNATURE_HEADER = CONSTANTS.stats_headers.signature;
1500
1504
  var EVER_STATS_KEY_ID_HEADER = CONSTANTS.stats_headers.key_id;
1501
1505
  var EVER_STATS_SIGNATURE_PREFIX = CONSTANTS.stats_signature_prefix;
1502
1506
  var EVER_STATS_MAX_BODY_BYTES = CONSTANTS.stats.max_bytes;
1507
+ var DOMAIN_EVENT_CATALOG = [
1508
+ // EW-P2-6 — `org:write` (and the app) create Organizations.
1509
+ { type: "organization.created", domain: "organization", aggregateType: "organization", phase: "P2" },
1510
+ { type: "organization.updated", domain: "organization", aggregateType: "organization", phase: "P1" },
1511
+ {
1512
+ type: "organization.member.added",
1513
+ domain: "organization",
1514
+ aggregateType: "organization",
1515
+ phase: "P1",
1516
+ child: "member"
1517
+ },
1518
+ {
1519
+ type: "organization.member.updated",
1520
+ domain: "organization",
1521
+ aggregateType: "organization",
1522
+ phase: "P1",
1523
+ child: "member"
1524
+ },
1525
+ {
1526
+ type: "organization.member.removed",
1527
+ domain: "organization",
1528
+ aggregateType: "organization",
1529
+ phase: "P1",
1530
+ child: "member"
1531
+ },
1532
+ { type: "agent.created", domain: "agents", aggregateType: "agent", phase: "P1" },
1533
+ { type: "agent.updated", domain: "agents", aggregateType: "agent", phase: "P1" },
1534
+ { type: "agent.status_changed", domain: "agents", aggregateType: "agent", phase: "P1" },
1535
+ { type: "agent.archived", domain: "agents", aggregateType: "agent", phase: "P1" },
1536
+ { type: "agent.deleted", domain: "agents", aggregateType: "agent", phase: "P1" },
1537
+ { type: "team.created", domain: "teams", aggregateType: "team", phase: "P1" },
1538
+ { type: "team.updated", domain: "teams", aggregateType: "team", phase: "P1" },
1539
+ { type: "team.deleted", domain: "teams", aggregateType: "team", phase: "P1" },
1540
+ { type: "team.member.added", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1541
+ { type: "team.member.updated", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1542
+ { type: "team.member.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1543
+ { type: "team.resource.added", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1544
+ { type: "team.resource.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1545
+ { type: "work.created", domain: "works", aggregateType: "work", phase: "P1" },
1546
+ { type: "work.updated", domain: "works", aggregateType: "work", phase: "P1" },
1547
+ { type: "work.archived", domain: "works", aggregateType: "work", phase: "P1" },
1548
+ { type: "work.deleted", domain: "works", aggregateType: "work", phase: "P1" },
1549
+ { type: "work.member.added", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1550
+ { type: "work.member.updated", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1551
+ { type: "work.member.removed", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1552
+ { type: "mission.created", domain: "missions", aggregateType: "mission", phase: "P2" },
1553
+ { type: "mission.updated", domain: "missions", aggregateType: "mission", phase: "P2" },
1554
+ { type: "mission.status_changed", domain: "missions", aggregateType: "mission", phase: "P2" },
1555
+ { type: "mission.deleted", domain: "missions", aggregateType: "mission", phase: "P2" },
1556
+ { type: "mission.goal.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1557
+ { type: "mission.goal.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1558
+ { type: "mission.work.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1559
+ { type: "mission.work.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1560
+ { type: "goal.created", domain: "goals", aggregateType: "goal", phase: "P2" },
1561
+ { type: "goal.updated", domain: "goals", aggregateType: "goal", phase: "P2" },
1562
+ { type: "goal.status_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1563
+ { type: "goal.archived", domain: "goals", aggregateType: "goal", phase: "P2" },
1564
+ { type: "goal.unarchived", domain: "goals", aggregateType: "goal", phase: "P2" },
1565
+ { type: "goal.deleted", domain: "goals", aggregateType: "goal", phase: "P2" },
1566
+ { type: "goal.progress_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1567
+ { type: "idea.created", domain: "ideas", aggregateType: "idea", phase: "P2" },
1568
+ { type: "idea.updated", domain: "ideas", aggregateType: "idea", phase: "P2" },
1569
+ { type: "idea.status_changed", domain: "ideas", aggregateType: "idea", phase: "P2" },
1570
+ { type: "idea.deleted", domain: "ideas", aggregateType: "idea", phase: "P2" },
1571
+ { type: "task.created", domain: "tasks", aggregateType: "task", phase: "P1" },
1572
+ { type: "task.updated", domain: "tasks", aggregateType: "task", phase: "P1" },
1573
+ { type: "task.transitioned", domain: "tasks", aggregateType: "task", phase: "P1" },
1574
+ { type: "task.deleted", domain: "tasks", aggregateType: "task", phase: "P1" },
1575
+ { type: "task.assignee.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1576
+ { type: "task.assignee.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1577
+ { type: "task.watcher.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1578
+ { type: "task.watcher.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1579
+ { type: "task.block.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1580
+ { type: "task.block.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1581
+ { type: "task.relation.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1582
+ { type: "task.relation.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1583
+ { type: "task.comment.created", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1584
+ { type: "task.comment.updated", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1585
+ { type: "task.comment.deleted", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1586
+ { type: "task.attachment.added", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1587
+ { type: "task.attachment.removed", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1588
+ { type: "task.runtime_updated", domain: "tasks", aggregateType: "task", phase: "P1", optIn: true },
1589
+ { type: "inbox.item.created", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1590
+ { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1591
+ { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1592
+ { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1593
+ { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1594
+ { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1595
+ { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1596
+ { type: "kb.document.archived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1597
+ { type: "kb.document.unarchived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1598
+ { type: "kb.document.deleted", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1599
+ { type: "kb.document.review_changed", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1600
+ { type: "kb.folder.created", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1601
+ { type: "kb.folder.updated", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1602
+ { type: "kb.folder.deleted", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1603
+ { type: "email.message.received", domain: "email", aggregateType: "email_message", phase: "P4" },
1604
+ { type: "email.message.sent", domain: "email", aggregateType: "email_message", phase: "P4" },
1605
+ { type: "email.message.status_changed", domain: "email", aggregateType: "email_message", phase: "P4" },
1606
+ { type: "task.visibility_changed", domain: "visibility", aggregateType: "task", phase: "P1" },
1607
+ { type: "agent.visibility_changed", domain: "visibility", aggregateType: "agent", phase: "P1" },
1608
+ { type: "goal.visibility_changed", domain: "visibility", aggregateType: "goal", phase: "P2" },
1609
+ { type: "mission.visibility_changed", domain: "visibility", aggregateType: "mission", phase: "P2" },
1610
+ { type: "idea.visibility_changed", domain: "visibility", aggregateType: "idea", phase: "P2" }
1611
+ ];
1612
+ var DOMAIN_EVENT_TYPES = DOMAIN_EVENT_CATALOG.map((entry) => entry.type);
1613
+ var CATALOG_BY_TYPE = new Map(
1614
+ DOMAIN_EVENT_CATALOG.map((entry) => [entry.type, entry])
1615
+ );
1616
+ var RECIPIENT_SCOPED_EVENT_DOMAINS = {
1617
+ inbox: "inbox:read",
1618
+ email: "email:read"
1619
+ };
1620
+ var RECIPIENT_EVENT_SCOPES = Object.values(RECIPIENT_SCOPED_EVENT_DOMAINS);
1621
+ var INTEGRATION_SCOPES = [
1622
+ "org:read",
1623
+ "org:write",
1624
+ "members:read",
1625
+ "members:write",
1626
+ "agents:read",
1627
+ "teams:read",
1628
+ "teams:write",
1629
+ "works:read",
1630
+ "works:write",
1631
+ "missions:read",
1632
+ "missions:write",
1633
+ "goals:read",
1634
+ "goals:write",
1635
+ "ideas:read",
1636
+ "ideas:write",
1637
+ "tasks:read",
1638
+ "tasks:write",
1639
+ "inbox:read",
1640
+ "inbox:write",
1641
+ "kb:read",
1642
+ "kb:write",
1643
+ "email:read",
1644
+ "email:write",
1645
+ "events:read",
1646
+ "webhooks:manage",
1647
+ "links:write"
1648
+ ];
1649
+ var INTEGRATION_OPT_IN_SCOPES = ["org:write", "email:write"];
1650
+ var EVER_GAUZY_PRESET_SCOPES = INTEGRATION_SCOPES.filter(
1651
+ (scope) => !INTEGRATION_OPT_IN_SCOPES.includes(scope)
1652
+ );
1503
1653
 
1504
1654
  // ../../../node_modules/.pnpm/jsonrepair@3.13.2/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js
1505
1655
  var JSONRepairError = class extends Error {
@@ -2307,7 +2457,14 @@ var PLUGIN_CAPABILITIES = {
2307
2457
  // new category: the tier's plugin is a `deployment` plugin, so
2308
2458
  // `PLUGIN_CATEGORIES` is untouched and every exhaustive map over it in
2309
2459
  // `apps/web` stays total.
2310
- APPS_TIER: "apps-tier"
2460
+ APPS_TIER: "apps-tier",
2461
+ // Domain events (EW-P1-1) — plugins that follow the durable domain event
2462
+ // outbox (`task.updated`, `team.member.added`, …) through the relay, at
2463
+ // least once, with a per-plugin cursor. See
2464
+ // `capabilities/domain-event-subscriber.interface.ts`. Appended last, so
2465
+ // every existing constant keeps its value and its position; no category is
2466
+ // added (a subscriber plugin keeps the category of what it otherwise is).
2467
+ DOMAIN_EVENT_SUBSCRIBER: "domain-event-subscriber"
2311
2468
  };
2312
2469
  var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
2313
2470
  function validateRequiredItemFields(data) {
package/dist/index.js CHANGED
@@ -256,10 +256,14 @@ var USER_SELECTABLE_WORK_KINDS = [
256
256
  "repo",
257
257
  "app"
258
258
  ];
259
- var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "default"];
259
+ var WORK_KINDS = [...USER_SELECTABLE_WORK_KINDS, "company", "campaign", "project", "default"];
260
260
  var WORK_KIND_SET = new Set(WORK_KINDS);
261
261
  var GOAL_KINDS = ["metric", "delivery"];
262
262
  var GOAL_KIND_SET = new Set(GOAL_KINDS);
263
+ var RECORD_VISIBILITIES = ["private", "team", "organization"];
264
+ var RECORD_VISIBILITY_SET = new Set(RECORD_VISIBILITIES);
265
+ var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
266
+ var RECORD_LIST_VIEW_SET = new Set(RECORD_LIST_VIEWS);
263
267
  var APP_DEPENDENCY_BACKUP_OVERDUE_MS = 26 * 36e5;
264
268
  var APP_DEPENDENCY_MANAGED = {
265
269
  pgRoleConnectionLimit: 20,
@@ -1461,6 +1465,152 @@ var EVER_STATS_SIGNATURE_HEADER = CONSTANTS.stats_headers.signature;
1461
1465
  var EVER_STATS_KEY_ID_HEADER = CONSTANTS.stats_headers.key_id;
1462
1466
  var EVER_STATS_SIGNATURE_PREFIX = CONSTANTS.stats_signature_prefix;
1463
1467
  var EVER_STATS_MAX_BODY_BYTES = CONSTANTS.stats.max_bytes;
1468
+ var DOMAIN_EVENT_CATALOG = [
1469
+ // EW-P2-6 — `org:write` (and the app) create Organizations.
1470
+ { type: "organization.created", domain: "organization", aggregateType: "organization", phase: "P2" },
1471
+ { type: "organization.updated", domain: "organization", aggregateType: "organization", phase: "P1" },
1472
+ {
1473
+ type: "organization.member.added",
1474
+ domain: "organization",
1475
+ aggregateType: "organization",
1476
+ phase: "P1",
1477
+ child: "member"
1478
+ },
1479
+ {
1480
+ type: "organization.member.updated",
1481
+ domain: "organization",
1482
+ aggregateType: "organization",
1483
+ phase: "P1",
1484
+ child: "member"
1485
+ },
1486
+ {
1487
+ type: "organization.member.removed",
1488
+ domain: "organization",
1489
+ aggregateType: "organization",
1490
+ phase: "P1",
1491
+ child: "member"
1492
+ },
1493
+ { type: "agent.created", domain: "agents", aggregateType: "agent", phase: "P1" },
1494
+ { type: "agent.updated", domain: "agents", aggregateType: "agent", phase: "P1" },
1495
+ { type: "agent.status_changed", domain: "agents", aggregateType: "agent", phase: "P1" },
1496
+ { type: "agent.archived", domain: "agents", aggregateType: "agent", phase: "P1" },
1497
+ { type: "agent.deleted", domain: "agents", aggregateType: "agent", phase: "P1" },
1498
+ { type: "team.created", domain: "teams", aggregateType: "team", phase: "P1" },
1499
+ { type: "team.updated", domain: "teams", aggregateType: "team", phase: "P1" },
1500
+ { type: "team.deleted", domain: "teams", aggregateType: "team", phase: "P1" },
1501
+ { type: "team.member.added", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1502
+ { type: "team.member.updated", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1503
+ { type: "team.member.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1504
+ { type: "team.resource.added", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1505
+ { type: "team.resource.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1506
+ { type: "work.created", domain: "works", aggregateType: "work", phase: "P1" },
1507
+ { type: "work.updated", domain: "works", aggregateType: "work", phase: "P1" },
1508
+ { type: "work.archived", domain: "works", aggregateType: "work", phase: "P1" },
1509
+ { type: "work.deleted", domain: "works", aggregateType: "work", phase: "P1" },
1510
+ { type: "work.member.added", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1511
+ { type: "work.member.updated", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1512
+ { type: "work.member.removed", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1513
+ { type: "mission.created", domain: "missions", aggregateType: "mission", phase: "P2" },
1514
+ { type: "mission.updated", domain: "missions", aggregateType: "mission", phase: "P2" },
1515
+ { type: "mission.status_changed", domain: "missions", aggregateType: "mission", phase: "P2" },
1516
+ { type: "mission.deleted", domain: "missions", aggregateType: "mission", phase: "P2" },
1517
+ { type: "mission.goal.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1518
+ { type: "mission.goal.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1519
+ { type: "mission.work.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1520
+ { type: "mission.work.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1521
+ { type: "goal.created", domain: "goals", aggregateType: "goal", phase: "P2" },
1522
+ { type: "goal.updated", domain: "goals", aggregateType: "goal", phase: "P2" },
1523
+ { type: "goal.status_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1524
+ { type: "goal.archived", domain: "goals", aggregateType: "goal", phase: "P2" },
1525
+ { type: "goal.unarchived", domain: "goals", aggregateType: "goal", phase: "P2" },
1526
+ { type: "goal.deleted", domain: "goals", aggregateType: "goal", phase: "P2" },
1527
+ { type: "goal.progress_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1528
+ { type: "idea.created", domain: "ideas", aggregateType: "idea", phase: "P2" },
1529
+ { type: "idea.updated", domain: "ideas", aggregateType: "idea", phase: "P2" },
1530
+ { type: "idea.status_changed", domain: "ideas", aggregateType: "idea", phase: "P2" },
1531
+ { type: "idea.deleted", domain: "ideas", aggregateType: "idea", phase: "P2" },
1532
+ { type: "task.created", domain: "tasks", aggregateType: "task", phase: "P1" },
1533
+ { type: "task.updated", domain: "tasks", aggregateType: "task", phase: "P1" },
1534
+ { type: "task.transitioned", domain: "tasks", aggregateType: "task", phase: "P1" },
1535
+ { type: "task.deleted", domain: "tasks", aggregateType: "task", phase: "P1" },
1536
+ { type: "task.assignee.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1537
+ { type: "task.assignee.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1538
+ { type: "task.watcher.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1539
+ { type: "task.watcher.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1540
+ { type: "task.block.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1541
+ { type: "task.block.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1542
+ { type: "task.relation.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1543
+ { type: "task.relation.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1544
+ { type: "task.comment.created", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1545
+ { type: "task.comment.updated", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1546
+ { type: "task.comment.deleted", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1547
+ { type: "task.attachment.added", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1548
+ { type: "task.attachment.removed", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1549
+ { type: "task.runtime_updated", domain: "tasks", aggregateType: "task", phase: "P1", optIn: true },
1550
+ { type: "inbox.item.created", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1551
+ { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1552
+ { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1553
+ { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1554
+ { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1555
+ { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1556
+ { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1557
+ { type: "kb.document.archived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1558
+ { type: "kb.document.unarchived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1559
+ { type: "kb.document.deleted", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1560
+ { type: "kb.document.review_changed", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1561
+ { type: "kb.folder.created", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1562
+ { type: "kb.folder.updated", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1563
+ { type: "kb.folder.deleted", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1564
+ { type: "email.message.received", domain: "email", aggregateType: "email_message", phase: "P4" },
1565
+ { type: "email.message.sent", domain: "email", aggregateType: "email_message", phase: "P4" },
1566
+ { type: "email.message.status_changed", domain: "email", aggregateType: "email_message", phase: "P4" },
1567
+ { type: "task.visibility_changed", domain: "visibility", aggregateType: "task", phase: "P1" },
1568
+ { type: "agent.visibility_changed", domain: "visibility", aggregateType: "agent", phase: "P1" },
1569
+ { type: "goal.visibility_changed", domain: "visibility", aggregateType: "goal", phase: "P2" },
1570
+ { type: "mission.visibility_changed", domain: "visibility", aggregateType: "mission", phase: "P2" },
1571
+ { type: "idea.visibility_changed", domain: "visibility", aggregateType: "idea", phase: "P2" }
1572
+ ];
1573
+ var DOMAIN_EVENT_TYPES = DOMAIN_EVENT_CATALOG.map((entry) => entry.type);
1574
+ var CATALOG_BY_TYPE = new Map(
1575
+ DOMAIN_EVENT_CATALOG.map((entry) => [entry.type, entry])
1576
+ );
1577
+ var RECIPIENT_SCOPED_EVENT_DOMAINS = {
1578
+ inbox: "inbox:read",
1579
+ email: "email:read"
1580
+ };
1581
+ var RECIPIENT_EVENT_SCOPES = Object.values(RECIPIENT_SCOPED_EVENT_DOMAINS);
1582
+ var INTEGRATION_SCOPES = [
1583
+ "org:read",
1584
+ "org:write",
1585
+ "members:read",
1586
+ "members:write",
1587
+ "agents:read",
1588
+ "teams:read",
1589
+ "teams:write",
1590
+ "works:read",
1591
+ "works:write",
1592
+ "missions:read",
1593
+ "missions:write",
1594
+ "goals:read",
1595
+ "goals:write",
1596
+ "ideas:read",
1597
+ "ideas:write",
1598
+ "tasks:read",
1599
+ "tasks:write",
1600
+ "inbox:read",
1601
+ "inbox:write",
1602
+ "kb:read",
1603
+ "kb:write",
1604
+ "email:read",
1605
+ "email:write",
1606
+ "events:read",
1607
+ "webhooks:manage",
1608
+ "links:write"
1609
+ ];
1610
+ var INTEGRATION_OPT_IN_SCOPES = ["org:write", "email:write"];
1611
+ var EVER_GAUZY_PRESET_SCOPES = INTEGRATION_SCOPES.filter(
1612
+ (scope) => !INTEGRATION_OPT_IN_SCOPES.includes(scope)
1613
+ );
1464
1614
 
1465
1615
  // ../../../node_modules/.pnpm/jsonrepair@3.13.2/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js
1466
1616
  var JSONRepairError = class extends Error {
@@ -2268,7 +2418,14 @@ var PLUGIN_CAPABILITIES = {
2268
2418
  // new category: the tier's plugin is a `deployment` plugin, so
2269
2419
  // `PLUGIN_CATEGORIES` is untouched and every exhaustive map over it in
2270
2420
  // `apps/web` stays total.
2271
- APPS_TIER: "apps-tier"
2421
+ APPS_TIER: "apps-tier",
2422
+ // Domain events (EW-P1-1) — plugins that follow the durable domain event
2423
+ // outbox (`task.updated`, `team.member.added`, …) through the relay, at
2424
+ // least once, with a per-plugin cursor. See
2425
+ // `capabilities/domain-event-subscriber.interface.ts`. Appended last, so
2426
+ // every existing constant keeps its value and its position; no category is
2427
+ // added (a subscriber plugin keeps the category of what it otherwise is).
2428
+ DOMAIN_EVENT_SUBSCRIBER: "domain-event-subscriber"
2272
2429
  };
2273
2430
  var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
2274
2431
  function validateRequiredItemFields(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ever-works/hermes-agent-plugin",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Hermes Agent pipeline plugin for Ever Works",
5
5
  "author": {
6
6
  "name": "Ever Co. LTD",
@@ -33,14 +33,14 @@
33
33
  "test:coverage": "vitest run --coverage"
34
34
  },
35
35
  "peerDependencies": {
36
- "@ever-works/plugin": "^1.2.4"
36
+ "@ever-works/plugin": "^1.2.5"
37
37
  },
38
38
  "devDependencies": {
39
- "@ever-works/plugin": "^1.2.4",
39
+ "@ever-works/plugin": "^1.2.5",
40
40
  "@types/node": "^26.6.4",
41
41
  "tsup": "^8.0.0",
42
42
  "typescript": "^5.9.3",
43
- "vitest": "^4.1.0"
43
+ "vitest": "^5.0.5"
44
44
  },
45
45
  "everworks": {
46
46
  "plugin": {
@@ -73,8 +73,8 @@
73
73
  "url": "https://github.com/ever-works/ever-works/issues"
74
74
  },
75
75
  "everworksRelease": {
76
- "contentHash": "sha256:32bf97eb4976d9820d492a5896a511b19e4a16cd6a5539e11d052ff2584f2807",
77
- "commit": "61b8320b4ad7d30bf5161acf7ee13b250a6172b9",
78
- "source": "https://github.com/ever-works/ever-works/tree/61b8320b4ad7d30bf5161acf7ee13b250a6172b9/packages/plugins/hermes-agent"
76
+ "contentHash": "sha256:dc4388c91fef19d1f52f496952919db6f3050c2e8e54411f609c10d570be4e52",
77
+ "commit": "19905c70cf05be3bc523db030597046067cd322a",
78
+ "source": "https://github.com/ever-works/ever-works/tree/19905c70cf05be3bc523db030597046067cd322a/packages/plugins/hermes-agent"
79
79
  }
80
80
  }