@ever-works/hermes-agent-plugin 1.0.5 → 1.0.7

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,
@@ -1091,6 +1095,10 @@ var FLEET_AGENT_TASK_TIMELINE_MAX_BYTES = 48 * 1024;
1091
1095
  var FLEET_AGENT_TASK_TRANSCRIPT_MAX_BYTES = 64 * 1024;
1092
1096
  var FLEET_AGENT_TASK_QUESTION_MAX_FILE_BYTES = 64 * 1024;
1093
1097
  var FLEET_AGENT_TASK_QUESTION_MAX_CONTEXT_BYTES = 6 * 1024;
1098
+ var FLEET_MODEL_USAGE_LIMIT_FALLBACK_MS = 60 * 60 * 1e3;
1099
+ var FLEET_MODEL_USAGE_LIMIT_MIN_MS = 60 * 1e3;
1100
+ var FLEET_MODEL_USAGE_LIMIT_MAX_MS = 8 * 24 * 60 * 60 * 1e3;
1101
+ var FLEET_MODEL_USAGE_LIMIT_RESET_SLACK_MS = 60 * 1e3;
1094
1102
  var FLEET_NODE_MAX_MEMORY_MB = 1024 * 1024;
1095
1103
  var FLEET_MAX_DAILY_COST_CEILING_CENTS = 1e5 * 100;
1096
1104
  var FLEET_MAX_DISK_FREE_BYTES = 2 ** 60;
@@ -1500,6 +1508,152 @@ var EVER_STATS_SIGNATURE_HEADER = CONSTANTS.stats_headers.signature;
1500
1508
  var EVER_STATS_KEY_ID_HEADER = CONSTANTS.stats_headers.key_id;
1501
1509
  var EVER_STATS_SIGNATURE_PREFIX = CONSTANTS.stats_signature_prefix;
1502
1510
  var EVER_STATS_MAX_BODY_BYTES = CONSTANTS.stats.max_bytes;
1511
+ var DOMAIN_EVENT_CATALOG = [
1512
+ // EW-P2-6 — `org:write` (and the app) create Organizations.
1513
+ { type: "organization.created", domain: "organization", aggregateType: "organization", phase: "P2" },
1514
+ { type: "organization.updated", domain: "organization", aggregateType: "organization", phase: "P1" },
1515
+ {
1516
+ type: "organization.member.added",
1517
+ domain: "organization",
1518
+ aggregateType: "organization",
1519
+ phase: "P1",
1520
+ child: "member"
1521
+ },
1522
+ {
1523
+ type: "organization.member.updated",
1524
+ domain: "organization",
1525
+ aggregateType: "organization",
1526
+ phase: "P1",
1527
+ child: "member"
1528
+ },
1529
+ {
1530
+ type: "organization.member.removed",
1531
+ domain: "organization",
1532
+ aggregateType: "organization",
1533
+ phase: "P1",
1534
+ child: "member"
1535
+ },
1536
+ { type: "agent.created", domain: "agents", aggregateType: "agent", phase: "P1" },
1537
+ { type: "agent.updated", domain: "agents", aggregateType: "agent", phase: "P1" },
1538
+ { type: "agent.status_changed", domain: "agents", aggregateType: "agent", phase: "P1" },
1539
+ { type: "agent.archived", domain: "agents", aggregateType: "agent", phase: "P1" },
1540
+ { type: "agent.deleted", domain: "agents", aggregateType: "agent", phase: "P1" },
1541
+ { type: "team.created", domain: "teams", aggregateType: "team", phase: "P1" },
1542
+ { type: "team.updated", domain: "teams", aggregateType: "team", phase: "P1" },
1543
+ { type: "team.deleted", domain: "teams", aggregateType: "team", phase: "P1" },
1544
+ { type: "team.member.added", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1545
+ { type: "team.member.updated", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1546
+ { type: "team.member.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1547
+ { type: "team.resource.added", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1548
+ { type: "team.resource.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1549
+ { type: "work.created", domain: "works", aggregateType: "work", phase: "P1" },
1550
+ { type: "work.updated", domain: "works", aggregateType: "work", phase: "P1" },
1551
+ { type: "work.archived", domain: "works", aggregateType: "work", phase: "P1" },
1552
+ { type: "work.deleted", domain: "works", aggregateType: "work", phase: "P1" },
1553
+ { type: "work.member.added", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1554
+ { type: "work.member.updated", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1555
+ { type: "work.member.removed", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1556
+ { type: "mission.created", domain: "missions", aggregateType: "mission", phase: "P2" },
1557
+ { type: "mission.updated", domain: "missions", aggregateType: "mission", phase: "P2" },
1558
+ { type: "mission.status_changed", domain: "missions", aggregateType: "mission", phase: "P2" },
1559
+ { type: "mission.deleted", domain: "missions", aggregateType: "mission", phase: "P2" },
1560
+ { type: "mission.goal.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1561
+ { type: "mission.goal.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1562
+ { type: "mission.work.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1563
+ { type: "mission.work.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1564
+ { type: "goal.created", domain: "goals", aggregateType: "goal", phase: "P2" },
1565
+ { type: "goal.updated", domain: "goals", aggregateType: "goal", phase: "P2" },
1566
+ { type: "goal.status_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1567
+ { type: "goal.archived", domain: "goals", aggregateType: "goal", phase: "P2" },
1568
+ { type: "goal.unarchived", domain: "goals", aggregateType: "goal", phase: "P2" },
1569
+ { type: "goal.deleted", domain: "goals", aggregateType: "goal", phase: "P2" },
1570
+ { type: "goal.progress_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1571
+ { type: "idea.created", domain: "ideas", aggregateType: "idea", phase: "P2" },
1572
+ { type: "idea.updated", domain: "ideas", aggregateType: "idea", phase: "P2" },
1573
+ { type: "idea.status_changed", domain: "ideas", aggregateType: "idea", phase: "P2" },
1574
+ { type: "idea.deleted", domain: "ideas", aggregateType: "idea", phase: "P2" },
1575
+ { type: "task.created", domain: "tasks", aggregateType: "task", phase: "P1" },
1576
+ { type: "task.updated", domain: "tasks", aggregateType: "task", phase: "P1" },
1577
+ { type: "task.transitioned", domain: "tasks", aggregateType: "task", phase: "P1" },
1578
+ { type: "task.deleted", domain: "tasks", aggregateType: "task", phase: "P1" },
1579
+ { type: "task.assignee.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1580
+ { type: "task.assignee.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1581
+ { type: "task.watcher.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1582
+ { type: "task.watcher.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1583
+ { type: "task.block.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1584
+ { type: "task.block.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1585
+ { type: "task.relation.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1586
+ { type: "task.relation.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1587
+ { type: "task.comment.created", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1588
+ { type: "task.comment.updated", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1589
+ { type: "task.comment.deleted", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1590
+ { type: "task.attachment.added", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1591
+ { type: "task.attachment.removed", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1592
+ { type: "task.runtime_updated", domain: "tasks", aggregateType: "task", phase: "P1", optIn: true },
1593
+ { type: "inbox.item.created", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1594
+ { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1595
+ { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1596
+ { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1597
+ { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1598
+ { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1599
+ { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1600
+ { type: "kb.document.archived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1601
+ { type: "kb.document.unarchived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1602
+ { type: "kb.document.deleted", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1603
+ { type: "kb.document.review_changed", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1604
+ { type: "kb.folder.created", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1605
+ { type: "kb.folder.updated", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1606
+ { type: "kb.folder.deleted", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1607
+ { type: "email.message.received", domain: "email", aggregateType: "email_message", phase: "P4" },
1608
+ { type: "email.message.sent", domain: "email", aggregateType: "email_message", phase: "P4" },
1609
+ { type: "email.message.status_changed", domain: "email", aggregateType: "email_message", phase: "P4" },
1610
+ { type: "task.visibility_changed", domain: "visibility", aggregateType: "task", phase: "P1" },
1611
+ { type: "agent.visibility_changed", domain: "visibility", aggregateType: "agent", phase: "P1" },
1612
+ { type: "goal.visibility_changed", domain: "visibility", aggregateType: "goal", phase: "P2" },
1613
+ { type: "mission.visibility_changed", domain: "visibility", aggregateType: "mission", phase: "P2" },
1614
+ { type: "idea.visibility_changed", domain: "visibility", aggregateType: "idea", phase: "P2" }
1615
+ ];
1616
+ var DOMAIN_EVENT_TYPES = DOMAIN_EVENT_CATALOG.map((entry) => entry.type);
1617
+ var CATALOG_BY_TYPE = new Map(
1618
+ DOMAIN_EVENT_CATALOG.map((entry) => [entry.type, entry])
1619
+ );
1620
+ var RECIPIENT_SCOPED_EVENT_DOMAINS = {
1621
+ inbox: "inbox:read",
1622
+ email: "email:read"
1623
+ };
1624
+ var RECIPIENT_EVENT_SCOPES = Object.values(RECIPIENT_SCOPED_EVENT_DOMAINS);
1625
+ var INTEGRATION_SCOPES = [
1626
+ "org:read",
1627
+ "org:write",
1628
+ "members:read",
1629
+ "members:write",
1630
+ "agents:read",
1631
+ "teams:read",
1632
+ "teams:write",
1633
+ "works:read",
1634
+ "works:write",
1635
+ "missions:read",
1636
+ "missions:write",
1637
+ "goals:read",
1638
+ "goals:write",
1639
+ "ideas:read",
1640
+ "ideas:write",
1641
+ "tasks:read",
1642
+ "tasks:write",
1643
+ "inbox:read",
1644
+ "inbox:write",
1645
+ "kb:read",
1646
+ "kb:write",
1647
+ "email:read",
1648
+ "email:write",
1649
+ "events:read",
1650
+ "webhooks:manage",
1651
+ "links:write"
1652
+ ];
1653
+ var INTEGRATION_OPT_IN_SCOPES = ["org:write", "email:write"];
1654
+ var EVER_GAUZY_PRESET_SCOPES = INTEGRATION_SCOPES.filter(
1655
+ (scope) => !INTEGRATION_OPT_IN_SCOPES.includes(scope)
1656
+ );
1503
1657
 
1504
1658
  // ../../../node_modules/.pnpm/jsonrepair@3.13.2/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js
1505
1659
  var JSONRepairError = class extends Error {
@@ -2307,7 +2461,14 @@ var PLUGIN_CAPABILITIES = {
2307
2461
  // new category: the tier's plugin is a `deployment` plugin, so
2308
2462
  // `PLUGIN_CATEGORIES` is untouched and every exhaustive map over it in
2309
2463
  // `apps/web` stays total.
2310
- APPS_TIER: "apps-tier"
2464
+ APPS_TIER: "apps-tier",
2465
+ // Domain events (EW-P1-1) — plugins that follow the durable domain event
2466
+ // outbox (`task.updated`, `team.member.added`, …) through the relay, at
2467
+ // least once, with a per-plugin cursor. See
2468
+ // `capabilities/domain-event-subscriber.interface.ts`. Appended last, so
2469
+ // every existing constant keeps its value and its position; no category is
2470
+ // added (a subscriber plugin keeps the category of what it otherwise is).
2471
+ DOMAIN_EVENT_SUBSCRIBER: "domain-event-subscriber"
2311
2472
  };
2312
2473
  var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
2313
2474
  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,
@@ -1052,6 +1056,10 @@ var FLEET_AGENT_TASK_TIMELINE_MAX_BYTES = 48 * 1024;
1052
1056
  var FLEET_AGENT_TASK_TRANSCRIPT_MAX_BYTES = 64 * 1024;
1053
1057
  var FLEET_AGENT_TASK_QUESTION_MAX_FILE_BYTES = 64 * 1024;
1054
1058
  var FLEET_AGENT_TASK_QUESTION_MAX_CONTEXT_BYTES = 6 * 1024;
1059
+ var FLEET_MODEL_USAGE_LIMIT_FALLBACK_MS = 60 * 60 * 1e3;
1060
+ var FLEET_MODEL_USAGE_LIMIT_MIN_MS = 60 * 1e3;
1061
+ var FLEET_MODEL_USAGE_LIMIT_MAX_MS = 8 * 24 * 60 * 60 * 1e3;
1062
+ var FLEET_MODEL_USAGE_LIMIT_RESET_SLACK_MS = 60 * 1e3;
1055
1063
  var FLEET_NODE_MAX_MEMORY_MB = 1024 * 1024;
1056
1064
  var FLEET_MAX_DAILY_COST_CEILING_CENTS = 1e5 * 100;
1057
1065
  var FLEET_MAX_DISK_FREE_BYTES = 2 ** 60;
@@ -1461,6 +1469,152 @@ var EVER_STATS_SIGNATURE_HEADER = CONSTANTS.stats_headers.signature;
1461
1469
  var EVER_STATS_KEY_ID_HEADER = CONSTANTS.stats_headers.key_id;
1462
1470
  var EVER_STATS_SIGNATURE_PREFIX = CONSTANTS.stats_signature_prefix;
1463
1471
  var EVER_STATS_MAX_BODY_BYTES = CONSTANTS.stats.max_bytes;
1472
+ var DOMAIN_EVENT_CATALOG = [
1473
+ // EW-P2-6 — `org:write` (and the app) create Organizations.
1474
+ { type: "organization.created", domain: "organization", aggregateType: "organization", phase: "P2" },
1475
+ { type: "organization.updated", domain: "organization", aggregateType: "organization", phase: "P1" },
1476
+ {
1477
+ type: "organization.member.added",
1478
+ domain: "organization",
1479
+ aggregateType: "organization",
1480
+ phase: "P1",
1481
+ child: "member"
1482
+ },
1483
+ {
1484
+ type: "organization.member.updated",
1485
+ domain: "organization",
1486
+ aggregateType: "organization",
1487
+ phase: "P1",
1488
+ child: "member"
1489
+ },
1490
+ {
1491
+ type: "organization.member.removed",
1492
+ domain: "organization",
1493
+ aggregateType: "organization",
1494
+ phase: "P1",
1495
+ child: "member"
1496
+ },
1497
+ { type: "agent.created", domain: "agents", aggregateType: "agent", phase: "P1" },
1498
+ { type: "agent.updated", domain: "agents", aggregateType: "agent", phase: "P1" },
1499
+ { type: "agent.status_changed", domain: "agents", aggregateType: "agent", phase: "P1" },
1500
+ { type: "agent.archived", domain: "agents", aggregateType: "agent", phase: "P1" },
1501
+ { type: "agent.deleted", domain: "agents", aggregateType: "agent", phase: "P1" },
1502
+ { type: "team.created", domain: "teams", aggregateType: "team", phase: "P1" },
1503
+ { type: "team.updated", domain: "teams", aggregateType: "team", phase: "P1" },
1504
+ { type: "team.deleted", domain: "teams", aggregateType: "team", phase: "P1" },
1505
+ { type: "team.member.added", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1506
+ { type: "team.member.updated", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1507
+ { type: "team.member.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "member" },
1508
+ { type: "team.resource.added", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1509
+ { type: "team.resource.removed", domain: "teams", aggregateType: "team", phase: "P1", child: "resource" },
1510
+ { type: "work.created", domain: "works", aggregateType: "work", phase: "P1" },
1511
+ { type: "work.updated", domain: "works", aggregateType: "work", phase: "P1" },
1512
+ { type: "work.archived", domain: "works", aggregateType: "work", phase: "P1" },
1513
+ { type: "work.deleted", domain: "works", aggregateType: "work", phase: "P1" },
1514
+ { type: "work.member.added", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1515
+ { type: "work.member.updated", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1516
+ { type: "work.member.removed", domain: "works", aggregateType: "work", phase: "P1", child: "member" },
1517
+ { type: "mission.created", domain: "missions", aggregateType: "mission", phase: "P2" },
1518
+ { type: "mission.updated", domain: "missions", aggregateType: "mission", phase: "P2" },
1519
+ { type: "mission.status_changed", domain: "missions", aggregateType: "mission", phase: "P2" },
1520
+ { type: "mission.deleted", domain: "missions", aggregateType: "mission", phase: "P2" },
1521
+ { type: "mission.goal.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1522
+ { type: "mission.goal.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "goal" },
1523
+ { type: "mission.work.linked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1524
+ { type: "mission.work.unlinked", domain: "missions", aggregateType: "mission", phase: "P2", child: "work" },
1525
+ { type: "goal.created", domain: "goals", aggregateType: "goal", phase: "P2" },
1526
+ { type: "goal.updated", domain: "goals", aggregateType: "goal", phase: "P2" },
1527
+ { type: "goal.status_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1528
+ { type: "goal.archived", domain: "goals", aggregateType: "goal", phase: "P2" },
1529
+ { type: "goal.unarchived", domain: "goals", aggregateType: "goal", phase: "P2" },
1530
+ { type: "goal.deleted", domain: "goals", aggregateType: "goal", phase: "P2" },
1531
+ { type: "goal.progress_changed", domain: "goals", aggregateType: "goal", phase: "P2" },
1532
+ { type: "idea.created", domain: "ideas", aggregateType: "idea", phase: "P2" },
1533
+ { type: "idea.updated", domain: "ideas", aggregateType: "idea", phase: "P2" },
1534
+ { type: "idea.status_changed", domain: "ideas", aggregateType: "idea", phase: "P2" },
1535
+ { type: "idea.deleted", domain: "ideas", aggregateType: "idea", phase: "P2" },
1536
+ { type: "task.created", domain: "tasks", aggregateType: "task", phase: "P1" },
1537
+ { type: "task.updated", domain: "tasks", aggregateType: "task", phase: "P1" },
1538
+ { type: "task.transitioned", domain: "tasks", aggregateType: "task", phase: "P1" },
1539
+ { type: "task.deleted", domain: "tasks", aggregateType: "task", phase: "P1" },
1540
+ { type: "task.assignee.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1541
+ { type: "task.assignee.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "assignee" },
1542
+ { type: "task.watcher.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1543
+ { type: "task.watcher.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "watcher" },
1544
+ { type: "task.block.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1545
+ { type: "task.block.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "block" },
1546
+ { type: "task.relation.added", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1547
+ { type: "task.relation.removed", domain: "tasks", aggregateType: "task", phase: "P1", child: "relation" },
1548
+ { type: "task.comment.created", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1549
+ { type: "task.comment.updated", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1550
+ { type: "task.comment.deleted", domain: "tasks", aggregateType: "task", phase: "P1", child: "comment" },
1551
+ { type: "task.attachment.added", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1552
+ { type: "task.attachment.removed", domain: "tasks", aggregateType: "task", phase: "P3", child: "attachment" },
1553
+ { type: "task.runtime_updated", domain: "tasks", aggregateType: "task", phase: "P1", optIn: true },
1554
+ { type: "inbox.item.created", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1555
+ { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1556
+ { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1557
+ { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
1558
+ { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1559
+ { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1560
+ { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1561
+ { type: "kb.document.archived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1562
+ { type: "kb.document.unarchived", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1563
+ { type: "kb.document.deleted", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1564
+ { type: "kb.document.review_changed", domain: "kb", aggregateType: "kb_document", phase: "P3" },
1565
+ { type: "kb.folder.created", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1566
+ { type: "kb.folder.updated", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1567
+ { type: "kb.folder.deleted", domain: "kb", aggregateType: "kb_folder", phase: "P3" },
1568
+ { type: "email.message.received", domain: "email", aggregateType: "email_message", phase: "P4" },
1569
+ { type: "email.message.sent", domain: "email", aggregateType: "email_message", phase: "P4" },
1570
+ { type: "email.message.status_changed", domain: "email", aggregateType: "email_message", phase: "P4" },
1571
+ { type: "task.visibility_changed", domain: "visibility", aggregateType: "task", phase: "P1" },
1572
+ { type: "agent.visibility_changed", domain: "visibility", aggregateType: "agent", phase: "P1" },
1573
+ { type: "goal.visibility_changed", domain: "visibility", aggregateType: "goal", phase: "P2" },
1574
+ { type: "mission.visibility_changed", domain: "visibility", aggregateType: "mission", phase: "P2" },
1575
+ { type: "idea.visibility_changed", domain: "visibility", aggregateType: "idea", phase: "P2" }
1576
+ ];
1577
+ var DOMAIN_EVENT_TYPES = DOMAIN_EVENT_CATALOG.map((entry) => entry.type);
1578
+ var CATALOG_BY_TYPE = new Map(
1579
+ DOMAIN_EVENT_CATALOG.map((entry) => [entry.type, entry])
1580
+ );
1581
+ var RECIPIENT_SCOPED_EVENT_DOMAINS = {
1582
+ inbox: "inbox:read",
1583
+ email: "email:read"
1584
+ };
1585
+ var RECIPIENT_EVENT_SCOPES = Object.values(RECIPIENT_SCOPED_EVENT_DOMAINS);
1586
+ var INTEGRATION_SCOPES = [
1587
+ "org:read",
1588
+ "org:write",
1589
+ "members:read",
1590
+ "members:write",
1591
+ "agents:read",
1592
+ "teams:read",
1593
+ "teams:write",
1594
+ "works:read",
1595
+ "works:write",
1596
+ "missions:read",
1597
+ "missions:write",
1598
+ "goals:read",
1599
+ "goals:write",
1600
+ "ideas:read",
1601
+ "ideas:write",
1602
+ "tasks:read",
1603
+ "tasks:write",
1604
+ "inbox:read",
1605
+ "inbox:write",
1606
+ "kb:read",
1607
+ "kb:write",
1608
+ "email:read",
1609
+ "email:write",
1610
+ "events:read",
1611
+ "webhooks:manage",
1612
+ "links:write"
1613
+ ];
1614
+ var INTEGRATION_OPT_IN_SCOPES = ["org:write", "email:write"];
1615
+ var EVER_GAUZY_PRESET_SCOPES = INTEGRATION_SCOPES.filter(
1616
+ (scope) => !INTEGRATION_OPT_IN_SCOPES.includes(scope)
1617
+ );
1464
1618
 
1465
1619
  // ../../../node_modules/.pnpm/jsonrepair@3.13.2/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js
1466
1620
  var JSONRepairError = class extends Error {
@@ -2268,7 +2422,14 @@ var PLUGIN_CAPABILITIES = {
2268
2422
  // new category: the tier's plugin is a `deployment` plugin, so
2269
2423
  // `PLUGIN_CATEGORIES` is untouched and every exhaustive map over it in
2270
2424
  // `apps/web` stays total.
2271
- APPS_TIER: "apps-tier"
2425
+ APPS_TIER: "apps-tier",
2426
+ // Domain events (EW-P1-1) — plugins that follow the durable domain event
2427
+ // outbox (`task.updated`, `team.member.added`, …) through the relay, at
2428
+ // least once, with a per-plugin cursor. See
2429
+ // `capabilities/domain-event-subscriber.interface.ts`. Appended last, so
2430
+ // every existing constant keeps its value and its position; no category is
2431
+ // added (a subscriber plugin keeps the category of what it otherwise is).
2432
+ DOMAIN_EVENT_SUBSCRIBER: "domain-event-subscriber"
2272
2433
  };
2273
2434
  var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
2274
2435
  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.7",
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.6"
37
37
  },
38
38
  "devDependencies": {
39
- "@ever-works/plugin": "^1.2.4",
39
+ "@ever-works/plugin": "^1.2.6",
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:080d2a850700c823f36369f606f3234497b5ba8871fd0bf14207e80e5aa9fd5b",
77
+ "commit": "48bb7f0a20744cbdfae87675743421804e100af6",
78
+ "source": "https://github.com/ever-works/ever-works/tree/48bb7f0a20744cbdfae87675743421804e100af6/packages/plugins/hermes-agent"
79
79
  }
80
80
  }