@ai-matrx/associations 0.14.78 → 0.14.80

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.
@@ -400,6 +400,7 @@ var ENTITY_TYPE_METADATA = {
400
400
  "crm_contact_candidate": { token: "crm_contact_candidate", schema: "crm", table: "contact_candidate", label: "Contact Candidate", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
401
401
  "crm_deal": { token: "crm_deal", schema: "crm", table: "deal", label: "Deal", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: "name", contentRole: "source", referenceCategory: null },
402
402
  "crm_deal_stage_event": { token: "crm_deal_stage_event", schema: "crm", table: "deal_stage_event", label: "Deal Stage Event", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
403
+ "crm_enrichment_call": { token: "crm_enrichment_call", schema: "crm", table: "enrichment_call", label: "Enrichment Call", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
403
404
  "crm_interaction": { token: "crm_interaction", schema: "crm", table: "interaction", label: "Interaction", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: "subject", contentRole: null, referenceCategory: null },
404
405
  "crm_merge_candidate": { token: "crm_merge_candidate", schema: "crm", table: "merge_candidate", label: "Merge Candidate", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
405
406
  "crm_outreach_list": { token: "crm_outreach_list", schema: "crm", table: "outreach_list", label: "Outreach List", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: "name", contentRole: "container", referenceCategory: null },
@@ -837,6 +838,7 @@ var ENTITY_TYPE_METADATA = {
837
838
  "ops_proof_check": { token: "ops_proof_check", schema: "ops", table: "proof_check", label: "Proof Check", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
838
839
  "ops_proof_run": { token: "ops_proof_run", schema: "ops", table: "proof_run", label: "Proof Run", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
839
840
  "ops_proof_scenario": { token: "ops_proof_scenario", schema: "ops", table: "proof_scenario", label: "Proof Scenario", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
841
+ "ops_source_read_cache": { token: "ops_source_read_cache", schema: "ops", table: "source_read_cache", label: "Source Read Cache", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
840
842
  "ops_test_replay_cache": { token: "ops_test_replay_cache", schema: "ops", table: "test_replay_cache", label: "Test Replay Cache Entry", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
841
843
  "org_admin_audit": { token: "org_admin_audit", schema: "iam", table: "org_admin_audit", label: "Org admin audit", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
842
844
  "org_change_policy": { token: "org_change_policy", schema: "platform", table: "org_change_policy", label: "Org Change Policy", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
@@ -1173,6 +1175,7 @@ var ENTITY_TYPE_METADATA = {
1173
1175
  "tool_bundle": { token: "tool_bundle", schema: "tool", table: "bundle", label: "Tool Bundle", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: "Tools", referencePickable: true, titleColumn: "name", contentRole: null, referenceCategory: null },
1174
1176
  "tool_call": { token: "tool_call", schema: "chat", table: "tool_call", label: "Tool Call", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1175
1177
  "tool_call_facts": { token: "tool_call_facts", schema: "chat", table: "_tool_call_facts", label: "Tool call facts", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1178
+ "tool_canary_run": { token: "tool_canary_run", schema: "tool", table: "canary_run", label: "Watchtower Canary Run", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1176
1179
  "tool_catalog_cache": { token: "tool_catalog_cache", schema: "tool", table: "catalog_cache", label: "Tool Answer Cache", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1177
1180
  "tool_catalog_call": { token: "tool_catalog_call", schema: "tool", table: "catalog_call", label: "Tool Call", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1178
1181
  "tool_catalog_call_attempt": { token: "tool_catalog_call_attempt", schema: "tool", table: "catalog_call_attempt", label: "Tool Call Attempt", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
@@ -1182,6 +1185,7 @@ var ENTITY_TYPE_METADATA = {
1182
1185
  "tool_catalog_provider": { token: "tool_catalog_provider", schema: "tool", table: "catalog_provider", label: "Tool Catalog Provider", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1183
1186
  "tool_definition_version": { token: "tool_definition_version", schema: "tool", table: "definition_version", label: "Tool Definition Version", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: "Tools", referencePickable: false, titleColumn: "name", contentRole: null, referenceCategory: null },
1184
1187
  "tool_executor": { token: "tool_executor", schema: "tool", table: "executor", label: "Tool executor", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1188
+ "tool_feature_scorecard": { token: "tool_feature_scorecard", schema: "tool", table: "feature_scorecard", label: "Watchtower Feature Scorecard", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1185
1189
  "tool_surface_defaults": { token: "tool_surface_defaults", schema: "tool", table: "surface_defaults", label: "Tool surface defaults", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1186
1190
  "tool_test_sample": { token: "tool_test_sample", schema: "tool", table: "test_sample", label: "Tool Test Sample", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: "Tools", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1187
1191
  "tool_ui": { token: "tool_ui", schema: "tool", table: "ui", label: "Tool UI", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: "Tools", referencePickable: false, titleColumn: "display_name", contentRole: null, referenceCategory: null },
@@ -1631,6 +1635,7 @@ var ENTITY_TYPE_TOKENS = [
1631
1635
  "crm_contact_candidate",
1632
1636
  "crm_deal",
1633
1637
  "crm_deal_stage_event",
1638
+ "crm_enrichment_call",
1634
1639
  "crm_interaction",
1635
1640
  "crm_merge_candidate",
1636
1641
  "crm_outreach_list",
@@ -2068,6 +2073,7 @@ var ENTITY_TYPE_TOKENS = [
2068
2073
  "ops_proof_check",
2069
2074
  "ops_proof_run",
2070
2075
  "ops_proof_scenario",
2076
+ "ops_source_read_cache",
2071
2077
  "ops_test_replay_cache",
2072
2078
  "org_admin_audit",
2073
2079
  "org_change_policy",
@@ -2404,6 +2410,7 @@ var ENTITY_TYPE_TOKENS = [
2404
2410
  "tool_bundle",
2405
2411
  "tool_call",
2406
2412
  "tool_call_facts",
2413
+ "tool_canary_run",
2407
2414
  "tool_catalog_cache",
2408
2415
  "tool_catalog_call",
2409
2416
  "tool_catalog_call_attempt",
@@ -2413,6 +2420,7 @@ var ENTITY_TYPE_TOKENS = [
2413
2420
  "tool_catalog_provider",
2414
2421
  "tool_definition_version",
2415
2422
  "tool_executor",
2423
+ "tool_feature_scorecard",
2416
2424
  "tool_surface_defaults",
2417
2425
  "tool_test_sample",
2418
2426
  "tool_ui",
@@ -2666,7 +2674,9 @@ function readPgFields(e) {
2666
2674
  }
2667
2675
  return { pgCode: null, pgMessage: null, pgHint: void 0 };
2668
2676
  }
2669
- function createRpcResultHelpers(errorSink) {
2677
+ var SIGNED_OUT_LEAD = "You're signed out";
2678
+ var SIGNED_OUT_MESSAGE = `${SIGNED_OUT_LEAD}. Sign in again \u2014 your text is kept here.`;
2679
+ function createRpcResultHelpers(errorSink, sessionAttached) {
2670
2680
  function mapPgError(e) {
2671
2681
  const { pgCode, pgMessage, pgHint } = readPgFields(e);
2672
2682
  if (pgCode === "PGRST202") {
@@ -2699,10 +2709,13 @@ function createRpcResultHelpers(errorSink) {
2699
2709
  }
2700
2710
  if (pgCode === "PGRST116")
2701
2711
  return { code: "not_found", message: "Not found" };
2702
- if (pgCode === "42501")
2712
+ if (pgCode === "PGRST301" || pgCode === "PGRST303" || pgCode === "28000")
2713
+ return { code: "unauthorized", message: SIGNED_OUT_MESSAGE };
2714
+ if (pgCode === "42501") {
2715
+ const anonymous = /permission denied for function/i.test(pgMessage ?? "") && !(sessionAttached?.() ?? false);
2716
+ if (anonymous) return { code: "unauthorized", message: SIGNED_OUT_MESSAGE };
2703
2717
  return { code: "forbidden_org", message: "Permission denied" };
2704
- if (pgCode === "PGRST301" || pgCode === "PGRST303")
2705
- return { code: "unauthorized", message: "Your session expired" };
2718
+ }
2706
2719
  if (pgCode === "57014") {
2707
2720
  const out2 = {
2708
2721
  code: "internal",
@@ -4351,7 +4364,10 @@ function createAssociationsStore(config) {
4351
4364
  identity: config.identity,
4352
4365
  errorSink,
4353
4366
  guards: createAssociationGuards(errorSink),
4354
- rpc: createRpcResultHelpers(errorSink),
4367
+ rpc: createRpcResultHelpers(
4368
+ errorSink,
4369
+ config.identity.sessionAttached ? () => config.identity.sessionAttached() : void 0
4370
+ ),
4355
4371
  registry
4356
4372
  };
4357
4373
  const associations = createAssociationsService(deps);