@apotech-os/support-kit 4.1.0 → 5.0.1

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
@@ -2462,7 +2462,7 @@ var SUPPORT_KIT_SETTINGS_FIELDS = [
2462
2462
  { key: "escalationTag", type: "string", label: "Escalation tag", default: "wai/escalated" },
2463
2463
  { key: "autoRepliedTag", type: "string", label: "Auto-replied tag", default: "wai/auto-replied" },
2464
2464
  { key: "needsReviewTag", type: "string", label: "Review-before-send tag", default: "wai/escalated" },
2465
- { key: "followupTag", type: "string", label: "Followup tag", default: "wai/followup-required" },
2465
+ { key: "followupTag", type: "string", label: "Followup tag", default: "wai/human-required" },
2466
2466
  // Sending
2467
2467
  { key: "autoSendEnabled", type: "boolean", label: "Auto-send enabled", default: false },
2468
2468
  { key: "senderEmail", type: "string", label: "Sender email", default: "" },
@@ -5631,30 +5631,23 @@ function pageIdentifierFor(config, key) {
5631
5631
  }
5632
5632
  return id;
5633
5633
  }
5634
-
5635
- // src/pipeline.ts
5636
- var SUPPORT_KIT_GORGIAS_ACTIONS = [
5637
- "applyTags",
5638
- "buildTicketContext",
5639
- "fetchTicketsFromView",
5640
- "getRawTicket",
5641
- "getTicketUrlBase",
5642
- "getTicketWithContext",
5643
- "listViews",
5644
- "postWhatsappNote",
5645
- "renameTicket",
5646
- "replyEmail"
5647
- ];
5648
5634
  var SUPPORT_KIT_CAPABILITIES = [
5649
5635
  "runs",
5650
5636
  "inbox",
5651
5637
  "approvals",
5652
5638
  "prompts",
5653
- "langfuse"
5639
+ "langfuse",
5640
+ "llm"
5654
5641
  ];
5655
- var SUPPORT_KIT_ACTIONS = [
5656
- ...SUPPORT_KIT_GORGIAS_ACTIONS.map((action) => ({ provider: "gorgias", action })),
5657
- { provider: "llm", action: "complete" }
5642
+ var SUPPORT_KIT_GORGIAS_SCOPES = [
5643
+ "read_customers",
5644
+ "read_tickets",
5645
+ "read_views",
5646
+ "write_tags",
5647
+ "write_tickets"
5648
+ ];
5649
+ var SUPPORT_KIT_INTEGRATIONS = [
5650
+ { provider: "gorgias", scopes: [...SUPPORT_KIT_GORGIAS_SCOPES] }
5658
5651
  ];
5659
5652
  var SUPPORT_KIT_EMITS = [TRIAGE_RUN_REQUESTED_EVENT];
5660
5653
  var FUNCTION_ASSEMBLY = [
@@ -5761,8 +5754,14 @@ function dedupe(items, keyOf) {
5761
5754
  for (const item of items) seen.set(keyOf(item), item);
5762
5755
  return [...seen.values()];
5763
5756
  }
5764
- function mergeActionRefs(actions) {
5765
- return dedupe([...actions, ...SUPPORT_KIT_ACTIONS], (a) => `${a.provider}::${a.action}`);
5757
+ function mergeIntegrationRefs(integrations) {
5758
+ const byProvider = /* @__PURE__ */ new Map();
5759
+ for (const entry of [...integrations, ...SUPPORT_KIT_INTEGRATIONS]) {
5760
+ const scopes = byProvider.get(entry.provider) ?? /* @__PURE__ */ new Set();
5761
+ for (const scope of entry.scopes) scopes.add(scope);
5762
+ byProvider.set(entry.provider, scopes);
5763
+ }
5764
+ return [...byProvider.entries()].map(([provider, scopes]) => ({ provider, scopes: [...scopes].sort() })).sort((a, b) => a.provider.localeCompare(b.provider));
5766
5765
  }
5767
5766
  var KIT_READ_ONLY_OBJECT_KEYS = ["category", "category-group"];
5768
5767
  var KIT_WRITE_ONLY_OBJECT_KEYS = ["evaluation", "diff-analysis"];
@@ -5776,7 +5775,6 @@ function buildMergeRole(config) {
5776
5775
  ...role,
5777
5776
  reads: dedupe([...role.reads, ...kitReadRefs], (ref) => ref),
5778
5777
  writes: dedupe([...role.writes, ...kitWriteRefs], (ref) => ref),
5779
- actions: mergeActionRefs(role.actions),
5780
5778
  capabilities: dedupe([...role.capabilities ?? [], ...SUPPORT_KIT_CAPABILITIES], (c) => c),
5781
5779
  prompts: dedupe([...role.prompts ?? [], ...kitPrompts], (p) => p)
5782
5780
  });
@@ -5843,12 +5841,12 @@ function buildSupportPipeline(config) {
5843
5841
  pages: buildPages(config),
5844
5842
  navigation: buildNavigation(config),
5845
5843
  settingsPage: buildSettingsPage(config),
5846
- actions: SUPPORT_KIT_ACTIONS,
5844
+ integrations: SUPPORT_KIT_INTEGRATIONS,
5847
5845
  emits: SUPPORT_KIT_EMITS,
5848
5846
  defaultRole: "NO_ACCESS",
5849
5847
  handlers,
5850
5848
  mergeRole: buildMergeRole(config),
5851
- mergeActions: mergeActionRefs
5849
+ mergeIntegrations: mergeIntegrationRefs
5852
5850
  };
5853
5851
  }
5854
5852