@ai-matrx/associations 0.14.79 → 0.14.81

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.
@@ -437,6 +437,7 @@ var ENTITY_TYPE_METADATA = {
437
437
  "cx_pending_injection": { token: "cx_pending_injection", schema: "chat", table: "pending_injection", label: "Pending Injection", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: "Conversations", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
438
438
  "cx_request": { token: "cx_request", schema: "chat", table: "request", label: "Conversation Request", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: "Conversations", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
439
439
  "cx_request_snapshot": { token: "cx_request_snapshot", schema: "chat", table: "request_snapshot", label: "Request Snapshot", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: "Conversations", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
440
+ "cx_request_values": { token: "cx_request_values", schema: "chat", table: "request_values", label: "Run values (server only)", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
440
441
  "cx_tool_trace": { token: "cx_tool_trace", schema: "chat", table: "tool_trace", label: "Tool Trace", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: "Conversations", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
441
442
  "cx_user_request": { token: "cx_user_request", schema: "chat", table: "user_request", label: "User Request", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: "Conversations", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
442
443
  "cx_user_todo": { token: "cx_user_todo", schema: "chat", table: "user_todo", label: "User Todo", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: "Conversations", referencePickable: false, titleColumn: "title", contentRole: null, referenceCategory: null },
@@ -952,6 +953,8 @@ var ENTITY_TYPE_METADATA = {
952
953
  "recompute_queue": { token: "recompute_queue", schema: "hr", table: "_recompute_queue", label: "Recompute Queue", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
953
954
  "record": { token: "record", schema: "custom", table: "record", label: "Record", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: "Custom Data", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
954
955
  "record_alias": { token: "record_alias", schema: "custom", table: "record_alias", label: "Record Alias", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
956
+ "record_computed": { token: "record_computed", schema: "custom", table: "record_computed", label: "Record Computed Values", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
957
+ "record_follow": { token: "record_follow", schema: "custom", table: "record_follow", label: "Record Follow", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
955
958
  "redaction_mapping": { token: "redaction_mapping", schema: "pdf", table: "redaction_mapping", label: "Redaction Mapping", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
956
959
  "relationship_rule": { token: "relationship_rule", schema: "platform", table: "relationship_rule", label: "Relationship rule", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
957
960
  "research_analysis": { token: "research_analysis", schema: "research", table: "rs_analysis", label: "Research Analysis", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
@@ -1311,6 +1314,7 @@ var ENTITY_TYPE_METADATA = {
1311
1314
  "workflow_checkpoint": { token: "workflow_checkpoint", schema: "workflow", table: "checkpoint", label: "Workflow Checkpoint", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1312
1315
  "workflow_checkpoint_value": { token: "workflow_checkpoint_value", schema: "workflow", table: "checkpoint_value", label: "Workflow Checkpoint Value", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1313
1316
  "workflow_comparison": { token: "workflow_comparison", schema: "workflow", table: "comparison", label: "Workflow Comparison", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1317
+ "workflow_definition_overview": { token: "workflow_definition_overview", schema: "workflow", table: "definition_overview", label: "Workflow overview", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1314
1318
  "workflow_definition_version": { token: "workflow_definition_version", schema: "workflow", table: "definition_version", label: "Workflow Definition Version", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: "name", contentRole: null, referenceCategory: null },
1315
1319
  "workflow_idempotency": { token: "workflow_idempotency", schema: "workflow", table: "idempotency", label: "Workflow Idempotency", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1316
1320
  "workflow_job": { token: "workflow_job", schema: "workflow", table: "job", label: "Workflow Job", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
@@ -1672,6 +1676,7 @@ var ENTITY_TYPE_TOKENS = [
1672
1676
  "cx_pending_injection",
1673
1677
  "cx_request",
1674
1678
  "cx_request_snapshot",
1679
+ "cx_request_values",
1675
1680
  "cx_tool_trace",
1676
1681
  "cx_user_request",
1677
1682
  "cx_user_todo",
@@ -2187,6 +2192,8 @@ var ENTITY_TYPE_TOKENS = [
2187
2192
  "recompute_queue",
2188
2193
  "record",
2189
2194
  "record_alias",
2195
+ "record_computed",
2196
+ "record_follow",
2190
2197
  "redaction_mapping",
2191
2198
  "relationship_rule",
2192
2199
  "research_analysis",
@@ -2546,6 +2553,7 @@ var ENTITY_TYPE_TOKENS = [
2546
2553
  "workflow_checkpoint",
2547
2554
  "workflow_checkpoint_value",
2548
2555
  "workflow_comparison",
2556
+ "workflow_definition_overview",
2549
2557
  "workflow_definition_version",
2550
2558
  "workflow_idempotency",
2551
2559
  "workflow_job",
@@ -2674,7 +2682,9 @@ function readPgFields(e) {
2674
2682
  }
2675
2683
  return { pgCode: null, pgMessage: null, pgHint: void 0 };
2676
2684
  }
2677
- function createRpcResultHelpers(errorSink) {
2685
+ var SIGNED_OUT_LEAD = "You're signed out";
2686
+ var SIGNED_OUT_MESSAGE = `${SIGNED_OUT_LEAD}. Sign in again \u2014 your text is kept here.`;
2687
+ function createRpcResultHelpers(errorSink, sessionAttached) {
2678
2688
  function mapPgError(e) {
2679
2689
  const { pgCode, pgMessage, pgHint } = readPgFields(e);
2680
2690
  if (pgCode === "PGRST202") {
@@ -2707,10 +2717,13 @@ function createRpcResultHelpers(errorSink) {
2707
2717
  }
2708
2718
  if (pgCode === "PGRST116")
2709
2719
  return { code: "not_found", message: "Not found" };
2710
- if (pgCode === "42501")
2720
+ if (pgCode === "PGRST301" || pgCode === "PGRST303" || pgCode === "28000")
2721
+ return { code: "unauthorized", message: SIGNED_OUT_MESSAGE };
2722
+ if (pgCode === "42501") {
2723
+ const anonymous = /permission denied for function/i.test(pgMessage ?? "") && !(sessionAttached?.() ?? false);
2724
+ if (anonymous) return { code: "unauthorized", message: SIGNED_OUT_MESSAGE };
2711
2725
  return { code: "forbidden_org", message: "Permission denied" };
2712
- if (pgCode === "PGRST301" || pgCode === "PGRST303")
2713
- return { code: "unauthorized", message: "Your session expired" };
2726
+ }
2714
2727
  if (pgCode === "57014") {
2715
2728
  const out2 = {
2716
2729
  code: "internal",
@@ -4359,7 +4372,10 @@ function createAssociationsStore(config) {
4359
4372
  identity: config.identity,
4360
4373
  errorSink,
4361
4374
  guards: createAssociationGuards(errorSink),
4362
- rpc: createRpcResultHelpers(errorSink),
4375
+ rpc: createRpcResultHelpers(
4376
+ errorSink,
4377
+ config.identity.sessionAttached ? () => config.identity.sessionAttached() : void 0
4378
+ ),
4363
4379
  registry
4364
4380
  };
4365
4381
  const associations = createAssociationsService(deps);