@stigmer/react 3.12.4 → 3.12.5

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.
Files changed (190) hide show
  1. package/attachment/AttachmentChipList.js +16 -6
  2. package/attachment/AttachmentChipList.js.map +1 -1
  3. package/attachment/index.d.ts +1 -1
  4. package/attachment/index.d.ts.map +1 -1
  5. package/attachment/index.js.map +1 -1
  6. package/attachment/useAttachments.d.ts +51 -8
  7. package/attachment/useAttachments.d.ts.map +1 -1
  8. package/attachment/useAttachments.js +74 -3
  9. package/attachment/useAttachments.js.map +1 -1
  10. package/composer/SessionComposer.d.ts.map +1 -1
  11. package/composer/SessionComposer.js +17 -10
  12. package/composer/SessionComposer.js.map +1 -1
  13. package/conversation/ConversationComposer.d.ts +19 -3
  14. package/conversation/ConversationComposer.d.ts.map +1 -1
  15. package/conversation/ConversationComposer.js +4 -4
  16. package/conversation/ConversationComposer.js.map +1 -1
  17. package/conversation/ConversationTemplatePickerDialog.d.ts +63 -0
  18. package/conversation/ConversationTemplatePickerDialog.d.ts.map +1 -0
  19. package/conversation/ConversationTemplatePickerDialog.js +151 -0
  20. package/conversation/ConversationTemplatePickerDialog.js.map +1 -0
  21. package/conversation/ConversationsWorkbench.d.ts.map +1 -1
  22. package/conversation/ConversationsWorkbench.js +16 -5
  23. package/conversation/ConversationsWorkbench.js.map +1 -1
  24. package/conversation/index.d.ts +3 -1
  25. package/conversation/index.d.ts.map +1 -1
  26. package/conversation/index.js +1 -0
  27. package/conversation/index.js.map +1 -1
  28. package/conversation/useConversationParticipation.d.ts +41 -4
  29. package/conversation/useConversationParticipation.d.ts.map +1 -1
  30. package/conversation/useConversationParticipation.js +13 -2
  31. package/conversation/useConversationParticipation.js.map +1 -1
  32. package/identity-account/AccountPreferencesPanel.d.ts +35 -0
  33. package/identity-account/AccountPreferencesPanel.d.ts.map +1 -0
  34. package/identity-account/AccountPreferencesPanel.js +187 -0
  35. package/identity-account/AccountPreferencesPanel.js.map +1 -0
  36. package/identity-account/index.d.ts +8 -0
  37. package/identity-account/index.d.ts.map +1 -1
  38. package/identity-account/index.js +4 -0
  39. package/identity-account/index.js.map +1 -1
  40. package/identity-account/useAccountExecutionDefaults.d.ts +36 -0
  41. package/identity-account/useAccountExecutionDefaults.d.ts.map +1 -0
  42. package/identity-account/useAccountExecutionDefaults.js +46 -0
  43. package/identity-account/useAccountExecutionDefaults.js.map +1 -0
  44. package/identity-account/useMyIdentityAccount.d.ts +55 -0
  45. package/identity-account/useMyIdentityAccount.d.ts.map +1 -0
  46. package/identity-account/useMyIdentityAccount.js +37 -0
  47. package/identity-account/useMyIdentityAccount.js.map +1 -0
  48. package/identity-account/useUpdateIdentityAccount.d.ts +42 -0
  49. package/identity-account/useUpdateIdentityAccount.d.ts.map +1 -0
  50. package/identity-account/useUpdateIdentityAccount.js +53 -0
  51. package/identity-account/useUpdateIdentityAccount.js.map +1 -0
  52. package/index.d.ts +11 -9
  53. package/index.d.ts.map +1 -1
  54. package/index.js +8 -5
  55. package/index.js.map +1 -1
  56. package/internal/StandingContextField.d.ts +37 -0
  57. package/internal/StandingContextField.d.ts.map +1 -0
  58. package/internal/StandingContextField.js +24 -0
  59. package/internal/StandingContextField.js.map +1 -0
  60. package/library/InstanceVisibilitySelector.d.ts.map +1 -1
  61. package/library/InstanceVisibilitySelector.js +9 -2
  62. package/library/InstanceVisibilitySelector.js.map +1 -1
  63. package/library/ResourceVisibilityControl.d.ts +13 -3
  64. package/library/ResourceVisibilityControl.d.ts.map +1 -1
  65. package/library/ResourceVisibilityControl.js +33 -5
  66. package/library/ResourceVisibilityControl.js.map +1 -1
  67. package/library/VisibilityOptionRow.d.ts +6 -0
  68. package/library/VisibilityOptionRow.d.ts.map +1 -1
  69. package/library/VisibilityOptionRow.js +11 -1
  70. package/library/VisibilityOptionRow.js.map +1 -1
  71. package/library/VisibilitySelector.d.ts.map +1 -1
  72. package/library/VisibilitySelector.js +14 -2
  73. package/library/VisibilitySelector.js.map +1 -1
  74. package/library/index.d.ts +4 -2
  75. package/library/index.d.ts.map +1 -1
  76. package/library/index.js +2 -1
  77. package/library/index.js.map +1 -1
  78. package/library/useCanSetPublicVisibility.d.ts +30 -0
  79. package/library/useCanSetPublicVisibility.d.ts.map +1 -0
  80. package/library/useCanSetPublicVisibility.js +41 -0
  81. package/library/useCanSetPublicVisibility.js.map +1 -0
  82. package/library/visibilityLevels.d.ts +32 -1
  83. package/library/visibilityLevels.d.ts.map +1 -1
  84. package/library/visibilityLevels.js +34 -14
  85. package/library/visibilityLevels.js.map +1 -1
  86. package/mcp-server/useMcpServerConnect.d.ts +8 -5
  87. package/mcp-server/useMcpServerConnect.d.ts.map +1 -1
  88. package/mcp-server/useMcpServerConnect.js +2 -1
  89. package/mcp-server/useMcpServerConnect.js.map +1 -1
  90. package/mcp-server/useMcpServerOAuthConnect.d.ts.map +1 -1
  91. package/mcp-server/useMcpServerOAuthConnect.js +7 -2
  92. package/mcp-server/useMcpServerOAuthConnect.js.map +1 -1
  93. package/oauth-app/CreateOAuthAppForm.d.ts +2 -2
  94. package/oauth-app/CreateOAuthAppForm.d.ts.map +1 -1
  95. package/oauth-app/CreateOAuthAppForm.js +13 -4
  96. package/oauth-app/CreateOAuthAppForm.js.map +1 -1
  97. package/oauth-app/OAuthAppDetailPanel.d.ts.map +1 -1
  98. package/oauth-app/OAuthAppDetailPanel.js +32 -5
  99. package/oauth-app/OAuthAppDetailPanel.js.map +1 -1
  100. package/organization/OrgPreferencesPanel.d.ts +32 -0
  101. package/organization/OrgPreferencesPanel.d.ts.map +1 -0
  102. package/organization/OrgPreferencesPanel.js +90 -0
  103. package/organization/OrgPreferencesPanel.js.map +1 -0
  104. package/organization/OrgProfilePanel.d.ts.map +1 -1
  105. package/organization/OrgProfilePanel.js +5 -4
  106. package/organization/OrgProfilePanel.js.map +1 -1
  107. package/organization/index.d.ts +2 -0
  108. package/organization/index.d.ts.map +1 -1
  109. package/organization/index.js +1 -0
  110. package/organization/index.js.map +1 -1
  111. package/package.json +4 -4
  112. package/session/NewSessionViewer.d.ts +10 -1
  113. package/session/NewSessionViewer.d.ts.map +1 -1
  114. package/session/NewSessionViewer.js +2 -1
  115. package/session/NewSessionViewer.js.map +1 -1
  116. package/session/useNewSessionFlow.d.ts +27 -1
  117. package/session/useNewSessionFlow.d.ts.map +1 -1
  118. package/session/useNewSessionFlow.js +45 -8
  119. package/session/useNewSessionFlow.js.map +1 -1
  120. package/settings/AccountPreferencesSection.d.ts +3 -0
  121. package/settings/AccountPreferencesSection.d.ts.map +1 -0
  122. package/settings/AccountPreferencesSection.js +10 -0
  123. package/settings/AccountPreferencesSection.js.map +1 -0
  124. package/settings/OrgPreferencesSection.d.ts +3 -0
  125. package/settings/OrgPreferencesSection.d.ts.map +1 -0
  126. package/settings/OrgPreferencesSection.js +13 -0
  127. package/settings/OrgPreferencesSection.js.map +1 -0
  128. package/settings/index.d.ts +2 -0
  129. package/settings/index.d.ts.map +1 -1
  130. package/settings/index.js +2 -0
  131. package/settings/index.js.map +1 -1
  132. package/settings/settings-nav.d.ts.map +1 -1
  133. package/settings/settings-nav.js +17 -1
  134. package/settings/settings-nav.js.map +1 -1
  135. package/src/attachment/AttachmentChipList.tsx +19 -8
  136. package/src/attachment/__tests__/AttachmentChipList.test.tsx +12 -0
  137. package/src/attachment/__tests__/useAttachments.test.ts +293 -0
  138. package/src/attachment/index.ts +1 -0
  139. package/src/attachment/useAttachments.ts +143 -11
  140. package/src/composer/SessionComposer.tsx +23 -14
  141. package/src/conversation/ConversationComposer.tsx +38 -4
  142. package/src/conversation/ConversationTemplatePickerDialog.tsx +441 -0
  143. package/src/conversation/ConversationsWorkbench.tsx +40 -4
  144. package/src/conversation/__tests__/ConversationComposer.test.tsx +56 -1
  145. package/src/conversation/__tests__/ConversationTemplatePickerDialog.test.tsx +224 -0
  146. package/src/conversation/__tests__/useConversationParticipation.test.tsx +45 -4
  147. package/src/conversation/index.ts +4 -0
  148. package/src/conversation/useConversationParticipation.ts +58 -6
  149. package/src/identity-account/AccountPreferencesPanel.tsx +446 -0
  150. package/src/identity-account/__tests__/AccountPreferencesPanel.test.tsx +233 -0
  151. package/src/identity-account/__tests__/useAccountExecutionDefaults.test.tsx +116 -0
  152. package/src/identity-account/__tests__/useMyIdentityAccount.test.tsx +121 -0
  153. package/src/identity-account/index.ts +11 -0
  154. package/src/identity-account/useAccountExecutionDefaults.ts +63 -0
  155. package/src/identity-account/useMyIdentityAccount.ts +75 -0
  156. package/src/identity-account/useUpdateIdentityAccount.ts +73 -0
  157. package/src/index.ts +24 -2
  158. package/src/internal/StandingContextField.tsx +92 -0
  159. package/src/library/InstanceVisibilitySelector.tsx +9 -2
  160. package/src/library/ResourceVisibilityControl.tsx +46 -13
  161. package/src/library/VisibilityOptionRow.tsx +28 -6
  162. package/src/library/VisibilitySelector.tsx +14 -2
  163. package/src/library/__tests__/VisibilitySelector.test.tsx +48 -1
  164. package/src/library/__tests__/visibilityLevels.test.ts +67 -1
  165. package/src/library/index.ts +6 -1
  166. package/src/library/useCanSetPublicVisibility.ts +56 -0
  167. package/src/library/visibilityLevels.ts +65 -14
  168. package/src/mcp-server/__tests__/useMcpServerConnect.asyncLane.test.tsx +117 -0
  169. package/src/mcp-server/useMcpServerConnect.ts +9 -6
  170. package/src/mcp-server/useMcpServerOAuthConnect.ts +7 -2
  171. package/src/oauth-app/CreateOAuthAppForm.tsx +58 -3
  172. package/src/oauth-app/OAuthAppDetailPanel.tsx +84 -3
  173. package/src/organization/OrgPreferencesPanel.tsx +221 -0
  174. package/src/organization/OrgProfilePanel.tsx +5 -4
  175. package/src/organization/__tests__/OrgPreferencesPanel.test.tsx +145 -0
  176. package/src/organization/__tests__/OrgProfilePanel.test.tsx +108 -0
  177. package/src/organization/index.ts +2 -0
  178. package/src/session/NewSessionViewer.tsx +12 -0
  179. package/src/session/__tests__/useNewSessionFlow.test.tsx +151 -0
  180. package/src/session/useNewSessionFlow.ts +76 -9
  181. package/src/settings/AccountPreferencesSection.tsx +25 -0
  182. package/src/settings/OrgPreferencesSection.tsx +35 -0
  183. package/src/settings/__tests__/settings-nav.test.ts +27 -0
  184. package/src/settings/index.ts +2 -0
  185. package/src/settings/settings-nav.ts +18 -0
  186. package/src/workflow/ApprovalFormBuilder.tsx +5 -27
  187. package/styles.css +1 -1
  188. package/workflow/ApprovalFormBuilder.d.ts.map +1 -1
  189. package/workflow/ApprovalFormBuilder.js +8 -5
  190. package/workflow/ApprovalFormBuilder.js.map +1 -1
@@ -10,6 +10,8 @@ export { ConversationAttentionBanner } from "./ConversationAttentionBanner.js";
10
10
  export type { ConversationAttentionBannerProps } from "./ConversationAttentionBanner.js";
11
11
  export { ConversationComposer } from "./ConversationComposer.js";
12
12
  export type { ConversationComposerProps } from "./ConversationComposer.js";
13
+ export { ConversationTemplatePickerDialog } from "./ConversationTemplatePickerDialog.js";
14
+ export type { ConversationTemplatePickerDialogProps } from "./ConversationTemplatePickerDialog.js";
13
15
  export { useConversation } from "./useConversation.js";
14
16
  export type { UseConversationOptions, UseConversationReturn, } from "./useConversation.js";
15
17
  export { useConversationList } from "./useConversationList.js";
@@ -19,7 +21,7 @@ export type { UseConversationTimelineOptions, UseConversationTimelineReturn, } f
19
21
  export { useConversationMediaUrl } from "./useConversationMediaUrl.js";
20
22
  export type { UseConversationMediaUrlOptions, UseConversationMediaUrlReturn, } from "./useConversationMediaUrl.js";
21
23
  export { useConversationParticipation } from "./useConversationParticipation.js";
22
- export type { ConversationCommand, UseConversationParticipationOptions, UseConversationParticipationReturn, } from "./useConversationParticipation.js";
24
+ export type { ConversationCommand, ConversationReplyPayload, UseConversationParticipationOptions, UseConversationParticipationReturn, } from "./useConversationParticipation.js";
23
25
  export { useConversationsWantsHumanCount } from "./useConversationsWantsHumanCount.js";
24
26
  export type { UseConversationsWantsHumanCountOptions, UseConversationsWantsHumanCountReturn, } from "./useConversationsWantsHumanCount.js";
25
27
  export { authorKindOf, awaitingIndicatorOf, compareTimelineItemsNewestFirst, conversationContactOf, conversationLabelOf, inboundPlaceholderOf, isInternalItem, receiptOf, sendAttemptOf, serviceWindowOf, } from "./conversationPresentation.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EACV,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EACV,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAEzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EACV,mBAAmB,EACnB,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,YAAY,EACV,sCAAsC,EACtC,qCAAqC,GACtC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,mCAAmC,EACnC,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EACV,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EACV,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,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;AACvC,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,mCAAmC,EACnC,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,cAAc,CAAC"}
@@ -4,6 +4,7 @@ export { ConversationTimelineView } from "./ConversationTimelineView.js";
4
4
  export { ConversationControlBanner } from "./ConversationControlBanner.js";
5
5
  export { ConversationAttentionBanner } from "./ConversationAttentionBanner.js";
6
6
  export { ConversationComposer } from "./ConversationComposer.js";
7
+ export { ConversationTemplatePickerDialog } from "./ConversationTemplatePickerDialog.js";
7
8
  export { useConversation } from "./useConversation.js";
8
9
  export { useConversationList } from "./useConversationList.js";
9
10
  export { useConversationTimeline } from "./useConversationTimeline.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/conversation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAMrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAM/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAOjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AA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AkC,GACnC,MAAM,cAAc,CAAC"}
@@ -2,6 +2,40 @@ import type { ChannelConversation } from "@stigmer/protos/ai/stigmer/agentic/age
2
2
  import type { SendChannelMessageOutput } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/message_io_pb";
3
3
  /** The four staff-facing participation commands. */
4
4
  export type ConversationCommand = "reply" | "takeOver" | "handBack" | "clearAttention";
5
+ /**
6
+ * A staff reply's payload — the client-side face of the wire's
7
+ * `ChannelOutboundPayload` oneof. Reply is ONE command with two lanes,
8
+ * never two commands: both lanes share the implicit takeover, the
9
+ * `"reply"` pending key, and the outcome contract.
10
+ *
11
+ * - `text` — free-form; requires an open 24-hour customer-service
12
+ * window on providers that enforce one (WhatsApp).
13
+ * - `template` — a provider-approved message template, the only lane
14
+ * for a closed window. `language` is always required here (the wire
15
+ * allows omitting it for single-language names, but a caller that
16
+ * picked a template knows its language — sending it structurally
17
+ * avoids the ambiguity refusal). Image-header templates are not yet
18
+ * sendable from the SDK: the wire's `header_image_link` needs a
19
+ * public HTTPS asset no console surface can supply today.
20
+ */
21
+ export type ConversationReplyPayload = {
22
+ readonly kind: "text";
23
+ /** The message body, as the customer will receive it. */
24
+ readonly body: string;
25
+ } | {
26
+ readonly kind: "template";
27
+ /** Template name on the channel provider's registry. */
28
+ readonly name: string;
29
+ /** Template language code (e.g. `"en"`, `"en_US"`). */
30
+ readonly language: string;
31
+ /**
32
+ * Variable values: keyed by parameter name for NAMED templates,
33
+ * by position (`"1"`, `"2"`, …) for POSITIONAL ones — exactly the
34
+ * template's declared parameters, no more, no fewer (the server's
35
+ * pre-check refuses mismatches with a corrective detail).
36
+ */
37
+ readonly parameters: Readonly<Record<string, string>>;
38
+ };
5
39
  /** Options for {@link useConversationParticipation}. */
6
40
  export interface UseConversationParticipationOptions {
7
41
  /** AgentChannel the conversation belongs to. */
@@ -21,13 +55,16 @@ export interface UseConversationParticipationOptions {
21
55
  /** Return value of {@link useConversationParticipation}. */
22
56
  export interface UseConversationParticipationReturn {
23
57
  /**
24
- * Send a staff text reply. Resolves with the truthful outcome of the
25
- * inline attempt: `accepted` (with `outboundMessageId` — the item will
26
- * appear on the timeline as `ob:<that id>`), `queued`, or `refused`.
58
+ * Send a staff reply text or template (see
59
+ * {@link ConversationReplyPayload}). Resolves with the truthful
60
+ * outcome of the inline attempt: `accepted` (with
61
+ * `outboundMessageId` — the item will appear on the timeline as
62
+ * `ob:<that id>`), `queued`, or `refused` (template pre-check
63
+ * refusals land here too, with the server's corrective detail).
27
64
  * A `refused` outcome WITHOUT an `outboundMessageId` left no ledger
28
65
  * row and no timeline item will ever exist for it.
29
66
  */
30
- readonly reply: (text: string) => Promise<SendChannelMessageOutput>;
67
+ readonly reply: (payload: ConversationReplyPayload) => Promise<SendChannelMessageOutput>;
31
68
  /**
32
69
  * Take the conversation over: the agent goes quiet until handBack.
33
70
  * Resolves with the fresh row — for the LOSER of a concurrent
@@ -1 +1 @@
1
- {"version":3,"file":"useConversationParticipation.d.ts","sourceRoot":"","sources":["../../src/conversation/useConversationParticipation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACpB,MAAM,uEAAuE,CAAC;AAM/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kEAAkE,CAAC;AAKjH,oDAAoD;AACpD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEvF,wDAAwD;AACxD,MAAM,WAAW,mCAAmC;IAClD,gDAAgD;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,2CAA2C;IAC3C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAChE;AAED,4DAA4D;AAC5D,MAAM,WAAW,kCAAkC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACpE;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtD,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtD,uEAAuE;IACvE,QAAQ,CAAC,cAAc,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5D,oCAAoC;IACpC,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC3D,kEAAkE;IAClE,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAChE,0CAA0C;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,mCAAmC,GAC3C,kCAAkC,CAiGpC"}
1
+ {"version":3,"file":"useConversationParticipation.d.ts","sourceRoot":"","sources":["../../src/conversation/useConversationParticipation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACpB,MAAM,uEAAuE,CAAC;AAM/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kEAAkE,CAAC;AAKjH,oDAAoD;AACpD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEvF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,wBAAwB,GAChC;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MA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ConversationParticipation(options) {
37
37
  onConversation?.(fresh);
38
38
  return fresh;
39
39
  }), [run, stigmer, controlInput, onConversation]);
40
- const reply = useCallback((text) => run("reply", async () => {
40
+ const reply = useCallback((payload) => run("reply", async () => {
41
41
  const output = await stigmer.agentChannel.reply(create(ReplyToConversationInputSchema, {
42
42
  agentChannelId,
43
43
  conversationKey,
44
- payload: { kind: { case: "text", value: { body: text } } },
44
+ payload: {
45
+ kind: payload.kind === "text"
46
+ ? { case: "text", value: { body: payload.body } }
47
+ : {
48
+ case: "template",
49
+ value: {
50
+ name: payload.name,
51
+ language: payload.language,
52
+ parameters: { ...payload.parameters },
53
+ },
54
+ },
55
+ },
45
56
  }));
46
57
  // The implicit takeover flipped control BEFORE the send ran —
47
58
  // even a refused reply moved it — but reply answers the send
@@ -1 +1 @@
1
- {"version":3,"file":"useConversationParticipation.js","sourceRoot":"","sources":["../../src/conversation/useConversationParticipation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,OAAO,EACL,8BAA8B,EAC9B,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,uEAAuE,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAoDvE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAA4C;IAE5C,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACpE,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,kBAAkB,EAAW,CAAC;IACjD,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;IAE3B,MAAM,YAAY,GAAG,WAAW,CAC9B,GAAG,EAAE,CA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AAO,EAAE,KAAK,IAAI,EAAE;QACtB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,KAAK,CAC7C,MAAM,CAAC,8BAA8B,EAAE;YACrC,cAAc;YACd,eAAe;YACf,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;SAC3D,CAAC,CACH,CAAC;QACF,8DAA8D;QAC9D,6DAA6D;QAC7D,6DAA6D;QAC7D,4DAA4D;QAC5D,0DAA0D;QAC1D,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC;gBACH,cAAc,CACZ,MAAM,OAAO,CAAC,YAAY,CAAC,eAAe,CACxC,MAAM,CAAC,iCAAiC,EAAE;oBACxC,cAAc;oBACd,eAAe;iBAChB,CAAC,CACH,CACF,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,8DAA8D;YAChE,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAsC,EACzC,CAAC,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAC,CAChE,CAAC;IAEF,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,cAAc;QACd,+DAA+D;QAC/D,6DAA6D;QAC7D,eAAe,EAAE,UAAU,CAAC,cAAkD;QAC9E,aAAa,EAAE,UAAU,CAAC,WAAsD;QAChF,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC,EACF;QACE,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,cAAc;QACd,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,WAAW;KACvB,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"useConversationParticipation.js","sourceRoot":"","sources":["../../src/conversation/useConversationParticipation.ts"],"names":[],"mappings":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AC7D,6DAA6D;QAC7D,4DAA4D;QAC5D,0DAA0D;QAC1D,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC;gBACH,cAAc,CACZ,MAAM,OAAO,CAAC,YAAY,CAAC,eAAe,CACxC,MAAM,CAAC,iCAAiC,EAAE;oBACxC,cAAc;oBACd,eAAe;iBAChB,CAAC,CACH,CACF,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,8DAA8D;YAChE,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAsC,EACzC,CAAC,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAC,CAChE,CAAC;IAEF,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,cAAc;QACd,+DAA+D;QAC/D,6DAA6D;QAC7D,eAAe,EAAE,UAAU,CAAC,cAAkD;QAC9E,aAAa,EAAE,UAAU,CAAC,WAAsD;QAChF,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC,EACF;QACE,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,cAAc;QACd,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,WAAW;KACvB,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
2
+ /** Props for {@link AccountPreferencesPanel}. */
3
+ export interface AccountPreferencesPanelProps {
4
+ /** Fired with the updated resource after a successful save. */
5
+ readonly onUpdated?: (account: IdentityAccount) => void;
6
+ /** Additional CSS class names for the root container. */
7
+ readonly className?: string;
8
+ }
9
+ /**
10
+ * Self-contained editor for the current user's declared preferences
11
+ * (`IdentityAccountSpec.preferences.standing_context`).
12
+ *
13
+ * The declared text is snapshotted into the user's own eligible agent
14
+ * executions and delivered to the agent as background context.
15
+ * Self-service: the account is resolved via `whoAmI()` and updated
16
+ * through the caller's self-ownership permission — no explicit
17
+ * permission check is needed. On save, calls `identityAccount.update()`
18
+ * with the complete mapped input (full-spec-replace safety) and fires
19
+ * `onUpdated`.
20
+ *
21
+ * Cloud-only: the OSS local server has no IdentityAccount (local mode
22
+ * is single-user, so the organization's preferences cover it). In local
23
+ * mode the panel renders a {@link CloudFeatureNotice} instead.
24
+ *
25
+ * All visual properties flow through `--stgm-*` design tokens. Zero
26
+ * dependencies on Console routing, auth context, or layout — platform
27
+ * builders can embed it directly:
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * <AccountPreferencesPanel />
32
+ * ```
33
+ */
34
+ export declare function AccountPreferencesPanel({ onUpdated, className, }: AccountPreferencesPanelProps): import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=AccountPreferencesPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountPreferencesPanel.d.ts","sourceRoot":"","sources":["../../src/identity-account/AccountPreferencesPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAUhG,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,SAAS,GACV,EAAE,4BAA4B,2CAqB9B"}
@@ -0,0 +1,187 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useId, useMemo, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { getUserMessage, toIdentityAccountUpdateInput } from "@stigmer/sdk";
6
+ import { useMyIdentityAccount } from "./useMyIdentityAccount.js";
7
+ import { useUpdateIdentityAccount } from "./useUpdateIdentityAccount.js";
8
+ import { useResourceAvailable, ApiResourceKind } from "../deployment-mode.js";
9
+ import { useModelRegistry } from "../models/index.js";
10
+ import { HARNESS_META } from "../models/harness.js";
11
+ import { CloudFeatureNotice } from "../internal/CloudFeatureNotice.js";
12
+ import { StandingContextField } from "../internal/StandingContextField.js";
13
+ import { SpinnerIcon } from "../internal/SpinnerIcon.js";
14
+ /**
15
+ * Self-contained editor for the current user's declared preferences
16
+ * (`IdentityAccountSpec.preferences.standing_context`).
17
+ *
18
+ * The declared text is snapshotted into the user's own eligible agent
19
+ * executions and delivered to the agent as background context.
20
+ * Self-service: the account is resolved via `whoAmI()` and updated
21
+ * through the caller's self-ownership permission — no explicit
22
+ * permission check is needed. On save, calls `identityAccount.update()`
23
+ * with the complete mapped input (full-spec-replace safety) and fires
24
+ * `onUpdated`.
25
+ *
26
+ * Cloud-only: the OSS local server has no IdentityAccount (local mode
27
+ * is single-user, so the organization's preferences cover it). In local
28
+ * mode the panel renders a {@link CloudFeatureNotice} instead.
29
+ *
30
+ * All visual properties flow through `--stgm-*` design tokens. Zero
31
+ * dependencies on Console routing, auth context, or layout — platform
32
+ * builders can embed it directly:
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <AccountPreferencesPanel />
37
+ * ```
38
+ */
39
+ export function AccountPreferencesPanel({ onUpdated, className, }) {
40
+ const baseId = useId();
41
+ const available = useResourceAvailable(ApiResourceKind.identity_account);
42
+ if (!available) {
43
+ return (_jsx(CloudFeatureNotice, { className: className, children: "Personal preferences require Stigmer Cloud. Local mode is single-user, so the organization's preferences apply to every execution \u2014 set standing context there instead." }));
44
+ }
45
+ return (_jsx(AccountPreferencesForm, { baseId: baseId, onUpdated: onUpdated, className: className }));
46
+ }
47
+ /**
48
+ * Inner form, mounted only when IdentityAccount is available — keeps the
49
+ * data hooks from issuing doomed RPCs against a local server.
50
+ */
51
+ function AccountPreferencesForm({ baseId, onUpdated, className, }) {
52
+ const { account, isLoading: isFetching, error: fetchError, refetch, } = useMyIdentityAccount();
53
+ const { update, isUpdating, error: updateError, clearError, } = useUpdateIdentityAccount();
54
+ const [standingContext, setStandingContext] = useState("");
55
+ const [defaultHarness, setDefaultHarness] = useState("");
56
+ const [defaultNativeModel, setDefaultNativeModel] = useState("");
57
+ const [defaultCursorModel, setDefaultCursorModel] = useState("");
58
+ const serverPreferences = account?.spec?.preferences;
59
+ const serverStandingContext = serverPreferences?.standingContext ?? "";
60
+ const serverDefaultHarness = serverPreferences?.defaultHarness ?? "";
61
+ const serverDefaultNativeModel = serverPreferences?.defaultNativeModel ?? "";
62
+ const serverDefaultCursorModel = serverPreferences?.defaultCursorModel ?? "";
63
+ // Sync the form fields when server data changes.
64
+ useEffect(() => {
65
+ if (!account)
66
+ return;
67
+ const prefs = account.spec?.preferences;
68
+ setStandingContext(prefs?.standingContext ?? "");
69
+ setDefaultHarness(prefs?.defaultHarness ?? "");
70
+ setDefaultNativeModel(prefs?.defaultNativeModel ?? "");
71
+ setDefaultCursorModel(prefs?.defaultCursorModel ?? "");
72
+ }, [account]);
73
+ const hasChanges = useMemo(() => standingContext.trim() !== serverStandingContext ||
74
+ defaultHarness !== serverDefaultHarness ||
75
+ defaultNativeModel !== serverDefaultNativeModel ||
76
+ defaultCursorModel !== serverDefaultCursorModel, [
77
+ standingContext,
78
+ defaultHarness,
79
+ defaultNativeModel,
80
+ defaultCursorModel,
81
+ serverStandingContext,
82
+ serverDefaultHarness,
83
+ serverDefaultNativeModel,
84
+ serverDefaultCursorModel,
85
+ ]);
86
+ const canSubmit = hasChanges && !isUpdating;
87
+ const handleDiscard = useCallback(() => {
88
+ setStandingContext(serverStandingContext);
89
+ setDefaultHarness(serverDefaultHarness);
90
+ setDefaultNativeModel(serverDefaultNativeModel);
91
+ setDefaultCursorModel(serverDefaultCursorModel);
92
+ clearError();
93
+ }, [
94
+ serverStandingContext,
95
+ serverDefaultHarness,
96
+ serverDefaultNativeModel,
97
+ serverDefaultCursorModel,
98
+ clearError,
99
+ ]);
100
+ const handleSubmit = useCallback(async (e) => {
101
+ e.preventDefault();
102
+ if (!canSubmit || !account)
103
+ return;
104
+ clearError();
105
+ try {
106
+ // update() is a full-spec replace: spread the complete mapped input
107
+ // so unedited spec fields survive. `preferences` is a nested message,
108
+ // so the override spreads the mapper's COMPLETE preferences too —
109
+ // fields this form does not own (added by later phases) survive.
110
+ const mapped = toIdentityAccountUpdateInput(account);
111
+ const updated = await update({
112
+ ...mapped,
113
+ preferences: {
114
+ ...mapped.preferences,
115
+ standingContext: standingContext.trim() || undefined,
116
+ defaultHarness: defaultHarness || undefined,
117
+ defaultNativeModel: defaultNativeModel || undefined,
118
+ defaultCursorModel: defaultCursorModel || undefined,
119
+ },
120
+ });
121
+ refetch();
122
+ onUpdated?.(updated);
123
+ }
124
+ catch {
125
+ // error state is managed by useUpdateIdentityAccount
126
+ }
127
+ }, [
128
+ canSubmit,
129
+ account,
130
+ standingContext,
131
+ defaultHarness,
132
+ defaultNativeModel,
133
+ defaultCursorModel,
134
+ update,
135
+ clearError,
136
+ refetch,
137
+ onUpdated,
138
+ ]);
139
+ // -----------------------------------------------------------------------
140
+ // Loading state
141
+ // -----------------------------------------------------------------------
142
+ if (isFetching && !account) {
143
+ return (_jsxs("div", { className: cn("stg:space-y-4", className), "aria-busy": "true", "aria-label": "Loading account preferences", children: [_jsx("div", { className: "stg:bg-muted-subtle stg:h-28 stg:animate-pulse stg:rounded" }), _jsx("div", { className: "stg:bg-muted-subtle stg:h-8 stg:w-32 stg:animate-pulse stg:rounded" })] }));
144
+ }
145
+ // -----------------------------------------------------------------------
146
+ // Fetch error
147
+ // -----------------------------------------------------------------------
148
+ if (fetchError) {
149
+ return (_jsxs("div", { className: cn("stg:space-y-3", className), role: "alert", children: [_jsx("p", { className: "stg:text-destructive stg:text-sm", children: getUserMessage(fetchError) }), _jsx("button", { type: "button", onClick: refetch, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"), children: "Retry" })] }));
150
+ }
151
+ if (!account)
152
+ return null;
153
+ // -----------------------------------------------------------------------
154
+ // Render
155
+ // -----------------------------------------------------------------------
156
+ return (_jsxs("form", { onSubmit: handleSubmit, className: cn("stg:space-y-4", className), children: [_jsx(StandingContextField, { id: `${baseId}-standing-context`, value: standingContext, onChange: setStandingContext, disabled: isUpdating, placeholder: "e.g. Keep answers terse. I prefer TypeScript examples. My timezone is IST.", helperText: "Shared with agents as background context \u2014 not instructions. Applies only to executions you start and is visible on those execution records." }), _jsxs("div", { className: "stg:space-y-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Execution defaults" }), _jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Seed new sessions across your devices and the CLI. An explicit pick in the composer always wins for that device." })] }), _jsx(DefaultHarnessRadioGroup, { baseId: baseId, value: defaultHarness, onChange: setDefaultHarness, disabled: isUpdating }), _jsxs("div", { className: "stg:grid stg:gap-3 stg:sm:grid-cols-2", children: [_jsx(DefaultModelSelect, { id: `${baseId}-default-native-model`, harness: "native", label: `Default model — ${HARNESS_META.native.label}`, value: defaultNativeModel, onChange: setDefaultNativeModel, disabled: isUpdating }), _jsx(DefaultModelSelect, { id: `${baseId}-default-cursor-model`, harness: "cursor", label: `Default model — ${HARNESS_META.cursor.label}`, value: defaultCursorModel, onChange: setDefaultCursorModel, disabled: isUpdating })] })] }), updateError && (_jsx("p", { className: "stg:text-destructive stg:text-[0.65rem]", role: "alert", children: getUserMessage(updateError) })), _jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsxs("button", { type: "submit", disabled: !canSubmit, className: cn("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-40"), children: [isUpdating && _jsx(SpinnerIcon, { size: 12 }), "Save changes"] }), hasChanges && !isUpdating && (_jsx("button", { type: "button", onClick: handleDiscard, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs", "stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover"), children: "Discard" }))] })] }));
157
+ }
158
+ /**
159
+ * Only harnesses with a shipped runtime are offerable as a default — must
160
+ * stay in lockstep with the proto's `default_harness` in-list validation.
161
+ */
162
+ const OFFERABLE_HARNESSES = ["native", "cursor"];
163
+ /**
164
+ * Default-harness choice: Platform default plus each shipped harness.
165
+ * A mutually exclusive, always-visible set — radio group, not a select.
166
+ */
167
+ function DefaultHarnessRadioGroup({ baseId, value, onChange, disabled, }) {
168
+ const name = `${baseId}-default-harness`;
169
+ const options = [
170
+ { value: "", label: "Platform default" },
171
+ ...OFFERABLE_HARNESSES.map((h) => ({ value: h, label: HARNESS_META[h].label })),
172
+ ];
173
+ return (_jsxs("fieldset", { className: "stg:space-y-1", disabled: disabled, children: [_jsx("legend", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Default harness" }), _jsx("div", { className: "stg:flex stg:flex-wrap stg:gap-x-4 stg:gap-y-1", children: options.map((option) => (_jsxs("label", { className: cn("stg:inline-flex stg:cursor-pointer stg:items-center stg:gap-1.5 stg:text-xs stg:text-foreground", disabled && "stg:cursor-default stg:opacity-50"), children: [_jsx("input", { type: "radio", name: name, value: option.value, checked: value === option.value, onChange: () => onChange(option.value), disabled: disabled, className: "stg:accent-primary stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring" }), option.label] }, option.value))) })] }));
174
+ }
175
+ /**
176
+ * Per-harness default model select, fed by the harness-filtered registry.
177
+ *
178
+ * A saved model that the registry no longer lists is rendered as its own
179
+ * "(unavailable)" option so the select never lies about the stored value;
180
+ * composers self-heal such a preference to the platform default on read.
181
+ */
182
+ function DefaultModelSelect({ id, harness, label, value, onChange, disabled, }) {
183
+ const { models, isLoading } = useModelRegistry({ harness });
184
+ const isStale = value !== "" && !isLoading && !models.some((m) => m.modelId === value);
185
+ return (_jsxs("div", { className: "stg:space-y-1", children: [_jsx("label", { htmlFor: id, className: "stg:text-xs stg:font-medium stg:text-foreground", children: label }), _jsxs("select", { id: id, value: value, onChange: (e) => onChange(e.target.value), disabled: disabled || isLoading, className: cn("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), children: [_jsx("option", { value: "", children: "Platform default" }), isStale && _jsxs("option", { value: value, children: [value, " (unavailable)"] }), models.map((model) => (_jsx("option", { value: model.modelId, children: model.displayName || model.modelId }, model.modelId)))] })] }));
186
+ }
187
+ //# sourceMappingURL=AccountPreferencesPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountPreferencesPanel.js","sourceRoot":"","sources":["../../src/identity-account/AccountPreferencesPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,k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AI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC;IAEvF,OAAO,CACL,eAAK,SAAS,EAAC,eAAe,aAC5B,gBACE,OAAO,EAAE,EAAE,EACX,SAAS,EAAC,iDAAiD,YAE1D,KAAK,GACA,EACR,kBACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,QAAQ,EAAE,QAAQ,IAAI,SAAS,EAC/B,SAAS,EAAE,EAAE,CACX,+HAA+H,EAC/H,qFAAqF,EACrF,0DAA0D,CAC3D,aAED,iBAAQ,KAAK,EAAC,EAAE,iCAA0B,EACzC,OAAO,IAAI,kBAAQ,KAAK,EAAE,KAAK,aAAG,KAAK,sBAAwB,EAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,iBAA4B,KAAK,EAAE,KAAK,CAAC,OAAO,YAC7C,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,IADxB,KAAK,CAAC,OAAO,CAEjB,CACV,CAAC,IACK,IACL,CACP,CAAC;AACJ,CAAC"}
@@ -1,2 +1,10 @@
1
1
  export { useIdentityAccountGate, type IdentityAccountGateState, type UseIdentityAccountGateReturn, } from "./useIdentityAccountGate.js";
2
+ export { useMyIdentityAccount } from "./useMyIdentityAccount.js";
3
+ export type { UseMyIdentityAccountOptions, UseMyIdentityAccountReturn, } from "./useMyIdentityAccount.js";
4
+ export { useAccountExecutionDefaults } from "./useAccountExecutionDefaults.js";
5
+ export type { AccountExecutionDefaults } from "./useAccountExecutionDefaults.js";
6
+ export { useUpdateIdentityAccount } from "./useUpdateIdentityAccount.js";
7
+ export type { UseUpdateIdentityAccountReturn } from "./useUpdateIdentityAccount.js";
8
+ export { AccountPreferencesPanel } from "./AccountPreferencesPanel.js";
9
+ export type { AccountPreferencesPanelProps } from "./AccountPreferencesPanel.js";
2
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,2 +1,6 @@
1
1
  export { useIdentityAccountGate, } from "./useIdentityAccountGate.js";
2
+ export { useMyIdentityAccount } from "./useMyIdentityAccount.js";
3
+ export { useAccountExecutionDefaults } from "./useAccountExecutionDefaults.js";
4
+ export { useUpdateIdentityAccount } from "./useUpdateIdentityAccount.js";
5
+ export { AccountPreferencesPanel } from "./AccountPreferencesPanel.js";
2
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { HarnessOption } from "../models/harness.js";
2
+ /**
3
+ * The current user's account-level execution defaults, shaped for the
4
+ * session launcher's `accountDefaults` prop.
5
+ */
6
+ export interface AccountExecutionDefaults {
7
+ /** Preferred harness for new sessions, when declared. */
8
+ readonly harness?: HarnessOption;
9
+ /** Preferred model for native-harness sessions, when declared. */
10
+ readonly nativeModel?: string;
11
+ /** Preferred model for cursor-harness sessions, when declared. */
12
+ readonly cursorModel?: string;
13
+ }
14
+ /**
15
+ * Data hook that reads the current user's execution defaults
16
+ * (`IdentityAccountSpec.preferences.default_*`) for seeding new-session
17
+ * composers.
18
+ *
19
+ * Returns `undefined` in local mode (no IdentityAccount), while loading,
20
+ * on error, and when no default is declared — every one of those cases
21
+ * degrades to the platform's existing defaults, so consumers wire the
22
+ * result straight through:
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <NewSessionViewer org={org} accountDefaults={useAccountExecutionDefaults()} />
27
+ * ```
28
+ *
29
+ * The defaults are a SEED, not an override: an explicit device-local pick
30
+ * outranks them (the layered precedence in `useNewSessionFlow`), and the
31
+ * chosen values ride the execution spec explicitly. Rides
32
+ * `useMyIdentityAccount`'s cross-mount cache, so the seed is available
33
+ * synchronously on every visit after the first.
34
+ */
35
+ export declare function useAccountExecutionDefaults(): AccountExecutionDefaults | undefined;
36
+ //# sourceMappingURL=useAccountExecutionDefaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccountExecutionDefaults.d.ts","sourceRoot":"","sources":["../../src/identity-account/useAccountExecutionDefaults.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,IAAI,wBAAwB,GAAG,SAAS,CAqBlF"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { useMyIdentityAccount } from "./useMyIdentityAccount.js";
4
+ import { useResourceAvailable, ApiResourceKind } from "../deployment-mode.js";
5
+ /**
6
+ * Data hook that reads the current user's execution defaults
7
+ * (`IdentityAccountSpec.preferences.default_*`) for seeding new-session
8
+ * composers.
9
+ *
10
+ * Returns `undefined` in local mode (no IdentityAccount), while loading,
11
+ * on error, and when no default is declared — every one of those cases
12
+ * degrades to the platform's existing defaults, so consumers wire the
13
+ * result straight through:
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <NewSessionViewer org={org} accountDefaults={useAccountExecutionDefaults()} />
18
+ * ```
19
+ *
20
+ * The defaults are a SEED, not an override: an explicit device-local pick
21
+ * outranks them (the layered precedence in `useNewSessionFlow`), and the
22
+ * chosen values ride the execution spec explicitly. Rides
23
+ * `useMyIdentityAccount`'s cross-mount cache, so the seed is available
24
+ * synchronously on every visit after the first.
25
+ */
26
+ export function useAccountExecutionDefaults() {
27
+ const available = useResourceAvailable(ApiResourceKind.identity_account);
28
+ const { account } = useMyIdentityAccount({ enabled: available });
29
+ return useMemo(() => {
30
+ const prefs = account?.spec?.preferences;
31
+ if (!prefs)
32
+ return undefined;
33
+ // The proto validates default_harness to the shipped set, but a client
34
+ // must not trust persisted data it did not write — unknown values are
35
+ // treated as undeclared.
36
+ const harness = prefs.defaultHarness === "native" || prefs.defaultHarness === "cursor"
37
+ ? prefs.defaultHarness
38
+ : undefined;
39
+ const nativeModel = prefs.defaultNativeModel || undefined;
40
+ const cursorModel = prefs.defaultCursorModel || undefined;
41
+ if (!harness && !nativeModel && !cursorModel)
42
+ return undefined;
43
+ return { harness, nativeModel, cursorModel };
44
+ }, [account]);
45
+ }
46
+ //# sourceMappingURL=useAccountExecutionDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccountExecutionDefaults.js","sourceRoot":"","sources":["../../src/identity-account/useAccountExecutionDefaults.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAgB9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,2BAA2B;IACzC,MAAM,SAAS,GAAG,oBAAoB,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;IACzE,MAAM,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAEjE,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,KAAK,GAAG,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAE7B,uEAAuE;QACvE,sEAAsE;QACtE,yBAAyB;QACzB,MAAM,OAAO,GACX,KAAK,CAAC,cAAc,KAAK,QAAQ,IAAI,KAAK,CAAC,cAAc,KAAK,QAAQ;YACpE,CAAC,CAAE,KAAK,CAAC,cAAuC;YAChD,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,IAAI,SAAS,CAAC;QAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,IAAI,SAAS,CAAC;QAE1D,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QAC/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IAC/C,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
2
+ /** Options for {@link useMyIdentityAccount}. */
3
+ export interface UseMyIdentityAccountOptions {
4
+ /**
5
+ * When `false`, the hook is idle: no RPC is issued and `account` stays
6
+ * `null`. Lets always-called hooks (React's rules) skip the doomed
7
+ * whoAmI against a local server — pass
8
+ * `useResourceAvailable(ApiResourceKind.identity_account)` here.
9
+ *
10
+ * @default true
11
+ */
12
+ readonly enabled?: boolean;
13
+ }
14
+ /** Return value of {@link useMyIdentityAccount}. */
15
+ export interface UseMyIdentityAccountReturn {
16
+ /** The authenticated user's identity account, or `null` while loading / on error. */
17
+ readonly account: IdentityAccount | null;
18
+ /** `true` while the initial fetch is in flight. */
19
+ readonly isLoading: boolean;
20
+ /** `true` while a background refetch is in flight and stale data is shown. */
21
+ readonly isRefetching: boolean;
22
+ /** Error from the last failed request, or `null` when healthy. */
23
+ readonly error: Error | null;
24
+ /** Re-fetch the account from the server (e.g. after an update). */
25
+ readonly refetch: () => void;
26
+ }
27
+ /**
28
+ * Data hook that fetches the current authenticated user's full
29
+ * {@link IdentityAccount} via `identityAccount.whoAmI()`.
30
+ *
31
+ * Unlike {@link useWhoAmI} (a cached identity lookup for "is this me?"
32
+ * checks), this hook is a refetchable data source for editors of the
33
+ * caller's own account — after a mutation, call `refetch()` to re-sync.
34
+ * `whoAmI()` returns the complete resource, so no follow-up `get()` is
35
+ * needed.
36
+ *
37
+ * Cloud-only by nature: the OSS local server does not implement
38
+ * IdentityAccount. Gate consumers with
39
+ * `useResourceAvailable(ApiResourceKind.identity_account)` — either by
40
+ * conditional mounting or via {@link UseMyIdentityAccountOptions.enabled}.
41
+ *
42
+ * Cached across mounts under a {@link FetchCacheProvider} (DD-014): a
43
+ * revisit renders the previous result immediately and refetches in the
44
+ * background, so consumers that seed UI from the account (e.g. composer
45
+ * defaults) settle synchronously after the first visit.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * const { account, refetch } = useMyIdentityAccount();
50
+ * const standingContext =
51
+ * account?.spec?.preferences?.standingContext ?? "";
52
+ * ```
53
+ */
54
+ export declare function useMyIdentityAccount(options?: UseMyIdentityAccountOptions): UseMyIdentityAccountReturn;
55
+ //# sourceMappingURL=useMyIdentityAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMyIdentityAccount.d.ts","sourceRoot":"","sources":["../../src/identity-account/useMyIdentityAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAIhG,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,oDAAoD;AACpD,MAAM,WAAW,0BAA0B;IACzC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,2BAA2B,GACpC,0BAA0B,CAY5B"}