@ai-matrx/associations 0.14.79 → 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.
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ComponentType, ReactNode } from 'react';
3
- import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentAnchor, x as CommentMutationResult, e as AssociationPickerProps, y as EntityDoorProps, z as EntityRefProps, B as ContentRole } from '../CommentThread-iSMK-0Lb.cjs';
4
- export { D as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, F as AssociationCard, G as AssociationCardGrid, b as AssociationCardGridProps, H as AssociationCardLook, a as AssociationCardProps, I as AssociationEntitySelect, J as AssociationEntitySelectAdapter, K as AssociationEntitySelectItem, c as AssociationEntitySelectProps, L as AssociationList, d as AssociationListProps, M as AssociationWindow, f as AssociationWindowProps, N as AssociationWriteResult, O as AttachedItemsSheet, g as AttachedItemsSheetProps, Q as CaptureAttach, R as CaptureAttachResult, S as CaptureToolbarAction, T as CategorySelect, C as CategorySelectProps, V as CategoryTagPicker, h as CategoryTagPickerProps, X as CommentComposer, Y as CommentComposerProps, Z as CommentThread, i as CommentThreadProps, _ as ContainerLink, $ as ContainerResourceRow, a0 as ContainerResourcesAdapter, a1 as DefaultEntityIcon, a2 as PostedComment, a3 as PrimaryContainerEntity, a4 as PrimaryEntity, a5 as PrimaryEntityProvider, a6 as PrimaryFiledEntity, a7 as TagPickerIcon, a8 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a9 as UseAssociationEntitySelectAdapterArgs, aa as UseAssociationsArgs, ab as UseAssociationsReturn, ac as UseContainerLinksArgs, ad as UseContainerLinksReturn, ae as attachedKey, af as buildCommentTree, ag as containerLinksArgs, ah as linkDirection, ai as useAssociationEntitySelectAdapter, aj as useAssociations, ak as useContainerLinks, al as useContainerLinksAdapter, am as useEntityRelationships, an as usePrimaryEntity } from '../CommentThread-iSMK-0Lb.cjs';
3
+ import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentAnchor, x as CommentMutationResult, e as AssociationPickerProps, y as EntityDoorProps, z as EntityRefProps, B as ContentRole } from '../CommentThread-BKGU9jR-.cjs';
4
+ export { D as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, F as AssociationCard, G as AssociationCardGrid, b as AssociationCardGridProps, H as AssociationCardLook, a as AssociationCardProps, I as AssociationEntitySelect, J as AssociationEntitySelectAdapter, K as AssociationEntitySelectItem, c as AssociationEntitySelectProps, L as AssociationList, d as AssociationListProps, M as AssociationWindow, f as AssociationWindowProps, N as AssociationWriteResult, O as AttachedItemsSheet, g as AttachedItemsSheetProps, Q as CaptureAttach, R as CaptureAttachResult, S as CaptureToolbarAction, T as CategorySelect, C as CategorySelectProps, V as CategoryTagPicker, h as CategoryTagPickerProps, X as CommentComposer, Y as CommentComposerProps, Z as CommentThread, i as CommentThreadProps, _ as ContainerLink, $ as ContainerResourceRow, a0 as ContainerResourcesAdapter, a1 as DefaultEntityIcon, a2 as PostedComment, a3 as PrimaryContainerEntity, a4 as PrimaryEntity, a5 as PrimaryEntityProvider, a6 as PrimaryFiledEntity, a7 as TagPickerIcon, a8 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a9 as UseAssociationEntitySelectAdapterArgs, aa as UseAssociationsArgs, ab as UseAssociationsReturn, ac as UseContainerLinksArgs, ad as UseContainerLinksReturn, ae as attachedKey, af as buildCommentTree, ag as containerLinksArgs, ah as linkDirection, ai as useAssociationEntitySelectAdapter, aj as useAssociations, ak as useContainerLinks, al as useContainerLinksAdapter, am as useEntityRelationships, an as usePrimaryEntity } from '../CommentThread-BKGU9jR-.cjs';
5
5
  import '@ai-matrx/data/db';
6
6
 
7
7
  interface AssociationsUiPorts {
@@ -19,13 +19,19 @@ interface AssociationsUiPorts {
19
19
  body: string;
20
20
  className?: string | undefined;
21
21
  }>;
22
+ /**
23
+ * Sign in again (a signed-out tab). Shown as the action beside a signed-out
24
+ * failure; absent → the sentence alone, with Retry. The host opens its login
25
+ * in a NEW tab so the words typed here stay for Retry.
26
+ */
27
+ signIn?: () => void;
22
28
  }
23
29
  interface AssociationsProviderProps extends AssociationsUiPorts {
24
30
  /** The /core store the host constructed with `createAssociationsStore`. */
25
31
  store: AssociationsStore;
26
32
  children: ReactNode;
27
33
  }
28
- declare function AssociationsProvider({ store, notifier, windowShell, capture, pickerOverrides, entityDoors, authorDisplay, commentBody, children, }: AssociationsProviderProps): react.JSX.Element;
34
+ declare function AssociationsProvider({ store, notifier, windowShell, capture, pickerOverrides, entityDoors, authorDisplay, commentBody, signIn, children, }: AssociationsProviderProps): react.JSX.Element;
29
35
  /** The /core store bound by the nearest provider. Throws when unmounted. */
30
36
  declare function useAssociationsStore(): AssociationsStore;
31
37
  /** The UI ports the host bound (each optional, each degradable). */
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ComponentType, ReactNode } from 'react';
3
- import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentAnchor, x as CommentMutationResult, e as AssociationPickerProps, y as EntityDoorProps, z as EntityRefProps, B as ContentRole } from '../CommentThread-iSMK-0Lb.js';
4
- export { D as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, F as AssociationCard, G as AssociationCardGrid, b as AssociationCardGridProps, H as AssociationCardLook, a as AssociationCardProps, I as AssociationEntitySelect, J as AssociationEntitySelectAdapter, K as AssociationEntitySelectItem, c as AssociationEntitySelectProps, L as AssociationList, d as AssociationListProps, M as AssociationWindow, f as AssociationWindowProps, N as AssociationWriteResult, O as AttachedItemsSheet, g as AttachedItemsSheetProps, Q as CaptureAttach, R as CaptureAttachResult, S as CaptureToolbarAction, T as CategorySelect, C as CategorySelectProps, V as CategoryTagPicker, h as CategoryTagPickerProps, X as CommentComposer, Y as CommentComposerProps, Z as CommentThread, i as CommentThreadProps, _ as ContainerLink, $ as ContainerResourceRow, a0 as ContainerResourcesAdapter, a1 as DefaultEntityIcon, a2 as PostedComment, a3 as PrimaryContainerEntity, a4 as PrimaryEntity, a5 as PrimaryEntityProvider, a6 as PrimaryFiledEntity, a7 as TagPickerIcon, a8 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a9 as UseAssociationEntitySelectAdapterArgs, aa as UseAssociationsArgs, ab as UseAssociationsReturn, ac as UseContainerLinksArgs, ad as UseContainerLinksReturn, ae as attachedKey, af as buildCommentTree, ag as containerLinksArgs, ah as linkDirection, ai as useAssociationEntitySelectAdapter, aj as useAssociations, ak as useContainerLinks, al as useContainerLinksAdapter, am as useEntityRelationships, an as usePrimaryEntity } from '../CommentThread-iSMK-0Lb.js';
3
+ import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentAnchor, x as CommentMutationResult, e as AssociationPickerProps, y as EntityDoorProps, z as EntityRefProps, B as ContentRole } from '../CommentThread-BKGU9jR-.js';
4
+ export { D as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, F as AssociationCard, G as AssociationCardGrid, b as AssociationCardGridProps, H as AssociationCardLook, a as AssociationCardProps, I as AssociationEntitySelect, J as AssociationEntitySelectAdapter, K as AssociationEntitySelectItem, c as AssociationEntitySelectProps, L as AssociationList, d as AssociationListProps, M as AssociationWindow, f as AssociationWindowProps, N as AssociationWriteResult, O as AttachedItemsSheet, g as AttachedItemsSheetProps, Q as CaptureAttach, R as CaptureAttachResult, S as CaptureToolbarAction, T as CategorySelect, C as CategorySelectProps, V as CategoryTagPicker, h as CategoryTagPickerProps, X as CommentComposer, Y as CommentComposerProps, Z as CommentThread, i as CommentThreadProps, _ as ContainerLink, $ as ContainerResourceRow, a0 as ContainerResourcesAdapter, a1 as DefaultEntityIcon, a2 as PostedComment, a3 as PrimaryContainerEntity, a4 as PrimaryEntity, a5 as PrimaryEntityProvider, a6 as PrimaryFiledEntity, a7 as TagPickerIcon, a8 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a9 as UseAssociationEntitySelectAdapterArgs, aa as UseAssociationsArgs, ab as UseAssociationsReturn, ac as UseContainerLinksArgs, ad as UseContainerLinksReturn, ae as attachedKey, af as buildCommentTree, ag as containerLinksArgs, ah as linkDirection, ai as useAssociationEntitySelectAdapter, aj as useAssociations, ak as useContainerLinks, al as useContainerLinksAdapter, am as useEntityRelationships, an as usePrimaryEntity } from '../CommentThread-BKGU9jR-.js';
5
5
  import '@ai-matrx/data/db';
6
6
 
7
7
  interface AssociationsUiPorts {
@@ -19,13 +19,19 @@ interface AssociationsUiPorts {
19
19
  body: string;
20
20
  className?: string | undefined;
21
21
  }>;
22
+ /**
23
+ * Sign in again (a signed-out tab). Shown as the action beside a signed-out
24
+ * failure; absent → the sentence alone, with Retry. The host opens its login
25
+ * in a NEW tab so the words typed here stay for Retry.
26
+ */
27
+ signIn?: () => void;
22
28
  }
23
29
  interface AssociationsProviderProps extends AssociationsUiPorts {
24
30
  /** The /core store the host constructed with `createAssociationsStore`. */
25
31
  store: AssociationsStore;
26
32
  children: ReactNode;
27
33
  }
28
- declare function AssociationsProvider({ store, notifier, windowShell, capture, pickerOverrides, entityDoors, authorDisplay, commentBody, children, }: AssociationsProviderProps): react.JSX.Element;
34
+ declare function AssociationsProvider({ store, notifier, windowShell, capture, pickerOverrides, entityDoors, authorDisplay, commentBody, signIn, children, }: AssociationsProviderProps): react.JSX.Element;
29
35
  /** The /core store bound by the nearest provider. Throws when unmounted. */
30
36
  declare function useAssociationsStore(): AssociationsStore;
31
37
  /** The UI ports the host bound (each optional, each degradable). */
@@ -26,6 +26,7 @@ function AssociationsProvider({
26
26
  entityDoors,
27
27
  authorDisplay,
28
28
  commentBody,
29
+ signIn,
29
30
  children
30
31
  }) {
31
32
  const notifierWarned = useRef(false);
@@ -41,7 +42,8 @@ function AssociationsProvider({
41
42
  ...pickerOverrides !== void 0 ? { pickerOverrides } : {},
42
43
  ...entityDoors !== void 0 ? { entityDoors } : {},
43
44
  ...authorDisplay !== void 0 ? { authorDisplay } : {},
44
- ...commentBody !== void 0 ? { commentBody } : {}
45
+ ...commentBody !== void 0 ? { commentBody } : {},
46
+ ...signIn !== void 0 ? { signIn } : {}
45
47
  },
46
48
  children
47
49
  }
@@ -1339,6 +1341,14 @@ function isEntityTypeToken(value) {
1339
1341
  return typeof value === "string" && ENTITY_TYPE_TOKEN_SET.has(value);
1340
1342
  }
1341
1343
 
1344
+ // src/core/rpcResult.ts
1345
+ import { isTransportFailure } from "@ai-matrx/api/net";
1346
+ var SIGNED_OUT_LEAD = "You're signed out";
1347
+ var SIGNED_OUT_MESSAGE = `${SIGNED_OUT_LEAD}. Sign in again \u2014 your text is kept here.`;
1348
+ function isSignedOutMessage(text) {
1349
+ return typeof text === "string" && text.startsWith(SIGNED_OUT_LEAD);
1350
+ }
1351
+
1342
1352
  // src/association-types.generated.ts
1343
1353
  var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
1344
1354
  "agent>agent",
@@ -6276,6 +6286,7 @@ function CommentComposer({
6276
6286
  autoFocus = false
6277
6287
  }) {
6278
6288
  const notifier = useNotifier();
6289
+ const { signIn } = useAssociationsUiPorts();
6279
6290
  const [body, setBody] = useState16(initialValue);
6280
6291
  const [submitting, setSubmitting] = useState16(false);
6281
6292
  const [error, setError] = useState16(null);
@@ -6321,6 +6332,7 @@ function CommentComposer({
6321
6332
  origin: "associations/CommentThread"
6322
6333
  }
6323
6334
  ),
6335
+ error && signIn && isSignedOutMessage(error) && /* @__PURE__ */ jsx20(SignInAgain, { onClick: signIn }),
6324
6336
  /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
6325
6337
  /* @__PURE__ */ jsxs16(Button4, { type: "submit", size: "sm", disabled: !body.trim() || submitting, children: [
6326
6338
  submitting && /* @__PURE__ */ jsx20(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
@@ -6566,6 +6578,7 @@ function CommentThread({
6566
6578
  className
6567
6579
  }) {
6568
6580
  const thread = useComments({ token, id });
6581
+ const { signIn: signInPort } = useAssociationsUiPorts();
6569
6582
  const tree = buildCommentTree(thread.comments);
6570
6583
  const { childrenOf } = tree;
6571
6584
  const roots = part ? tree.roots.filter((c) => partKeyOf(c) === part.key) : tree.roots;
@@ -6597,6 +6610,7 @@ function CommentThread({
6597
6610
  origin: "associations/CommentThread",
6598
6611
  children: [
6599
6612
  /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1", children: thread.error }),
6613
+ signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */ jsx20(SignInAgain, { onClick: signInPort }),
6600
6614
  /* @__PURE__ */ jsx20(
6601
6615
  Button4,
6602
6616
  {
@@ -6640,6 +6654,9 @@ function CommentThread({
6640
6654
  )
6641
6655
  ] });
6642
6656
  }
6657
+ function SignInAgain({ onClick }) {
6658
+ return /* @__PURE__ */ jsx20(Button4, { type: "button", size: "sm", variant: "outline", onClick, children: "Sign in" });
6659
+ }
6643
6660
  export {
6644
6661
  AssociationCandidateBody,
6645
6662
  AssociationCaptureToolbar,