@stigmer/react 3.3.0 → 3.4.0

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 (219) hide show
  1. package/billing/index.d.ts +0 -18
  2. package/billing/index.d.ts.map +1 -1
  3. package/billing/index.js +4 -9
  4. package/billing/index.js.map +1 -1
  5. package/cursor-accounts/CursorAccountEditor.d.ts +7 -1
  6. package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -1
  7. package/cursor-accounts/CursorAccountEditor.js +21 -5
  8. package/cursor-accounts/CursorAccountEditor.js.map +1 -1
  9. package/cursor-accounts/CursorAccountsConsole.d.ts +9 -5
  10. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
  11. package/cursor-accounts/CursorAccountsConsole.js +34 -140
  12. package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
  13. package/cursor-accounts/MemberCoverageTable.d.ts +29 -0
  14. package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -0
  15. package/cursor-accounts/MemberCoverageTable.js +150 -0
  16. package/cursor-accounts/MemberCoverageTable.js.map +1 -0
  17. package/cursor-accounts/MemberKeysPanel.d.ts +25 -0
  18. package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -0
  19. package/cursor-accounts/MemberKeysPanel.js +115 -0
  20. package/cursor-accounts/MemberKeysPanel.js.map +1 -0
  21. package/cursor-accounts/badges.d.ts +9 -0
  22. package/cursor-accounts/badges.d.ts.map +1 -0
  23. package/cursor-accounts/badges.js +10 -0
  24. package/cursor-accounts/badges.js.map +1 -0
  25. package/cursor-accounts/cursor-account-coverage.d.ts +41 -0
  26. package/cursor-accounts/cursor-account-coverage.d.ts.map +1 -0
  27. package/cursor-accounts/cursor-account-coverage.js +26 -0
  28. package/cursor-accounts/cursor-account-coverage.js.map +1 -0
  29. package/cursor-accounts/cursor-account-format.d.ts +13 -0
  30. package/cursor-accounts/cursor-account-format.d.ts.map +1 -1
  31. package/cursor-accounts/cursor-account-format.js +16 -1
  32. package/cursor-accounts/cursor-account-format.js.map +1 -1
  33. package/datastore/CollectionRecordsBrowser.js +18 -4
  34. package/datastore/CollectionRecordsBrowser.js.map +1 -1
  35. package/datastore/RecordFilterBuilder.d.ts +8 -1
  36. package/datastore/RecordFilterBuilder.d.ts.map +1 -1
  37. package/datastore/RecordFilterBuilder.js +2 -2
  38. package/datastore/RecordFilterBuilder.js.map +1 -1
  39. package/datastore/recordFilter.d.ts +9 -1
  40. package/datastore/recordFilter.d.ts.map +1 -1
  41. package/datastore/recordFilter.js +12 -1
  42. package/datastore/recordFilter.js.map +1 -1
  43. package/execution/ExecutionProgress.d.ts.map +1 -1
  44. package/execution/ExecutionProgress.js +13 -4
  45. package/execution/ExecutionProgress.js.map +1 -1
  46. package/execution/MessageThread.d.ts.map +1 -1
  47. package/execution/MessageThread.js +10 -2
  48. package/execution/MessageThread.js.map +1 -1
  49. package/execution/useCreateAgentExecution.d.ts +31 -1
  50. package/execution/useCreateAgentExecution.d.ts.map +1 -1
  51. package/execution/useCreateAgentExecution.js +2 -0
  52. package/execution/useCreateAgentExecution.js.map +1 -1
  53. package/index.d.ts +4 -2
  54. package/index.d.ts.map +1 -1
  55. package/index.js +6 -2
  56. package/index.js.map +1 -1
  57. package/internal/form-primitives.d.ts +10 -0
  58. package/internal/form-primitives.d.ts.map +1 -0
  59. package/{billing → internal}/form-primitives.js +5 -9
  60. package/internal/form-primitives.js.map +1 -0
  61. package/package.json +4 -4
  62. package/pricing-governance/BaselineEditor.d.ts.map +1 -0
  63. package/{billing → pricing-governance}/BaselineEditor.js +19 -2
  64. package/pricing-governance/BaselineEditor.js.map +1 -0
  65. package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
  66. package/pricing-governance/ModelCatalogPanel.js.map +1 -0
  67. package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
  68. package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
  69. package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
  70. package/pricing-governance/OperatorAccessNotice.js.map +1 -0
  71. package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
  72. package/{billing → pricing-governance}/PricingGovernanceConsole.js +1 -1
  73. package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
  74. package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
  75. package/pricing-governance/PricingGovernancePanel.js.map +1 -0
  76. package/pricing-governance/RetireConfirm.d.ts.map +1 -0
  77. package/{billing → pricing-governance}/RetireConfirm.js +1 -1
  78. package/pricing-governance/RetireConfirm.js.map +1 -0
  79. package/pricing-governance/governance-primitives.d.ts.map +1 -0
  80. package/pricing-governance/governance-primitives.js.map +1 -0
  81. package/pricing-governance/index.d.ts +19 -0
  82. package/pricing-governance/index.d.ts.map +1 -0
  83. package/pricing-governance/index.js +20 -0
  84. package/pricing-governance/index.js.map +1 -0
  85. package/pricing-governance/pricing-format.d.ts.map +1 -0
  86. package/pricing-governance/pricing-format.js.map +1 -0
  87. package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
  88. package/pricing-governance/useDecidePricingOverride.js.map +1 -0
  89. package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
  90. package/pricing-governance/useModelGovernanceView.js.map +1 -0
  91. package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
  92. package/pricing-governance/useModelPricingBaselines.js.map +1 -0
  93. package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
  94. package/pricing-governance/usePricingGovernance.js.map +1 -0
  95. package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
  96. package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
  97. package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
  98. package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
  99. package/session/useCreateSession.d.ts +28 -0
  100. package/session/useCreateSession.d.ts.map +1 -1
  101. package/session/useCreateSession.js +2 -1
  102. package/session/useCreateSession.js.map +1 -1
  103. package/session/useNewSessionFlow.d.ts +30 -0
  104. package/session/useNewSessionFlow.d.ts.map +1 -1
  105. package/session/useNewSessionFlow.js +7 -1
  106. package/session/useNewSessionFlow.js.map +1 -1
  107. package/session/useUpdateSession.d.ts +29 -10
  108. package/session/useUpdateSession.d.ts.map +1 -1
  109. package/session/useUpdateSession.js +29 -10
  110. package/session/useUpdateSession.js.map +1 -1
  111. package/src/billing/index.ts +5 -37
  112. package/src/cursor-accounts/CursorAccountEditor.tsx +61 -13
  113. package/src/cursor-accounts/CursorAccountsConsole.tsx +44 -400
  114. package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
  115. package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
  116. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +306 -10
  117. package/src/cursor-accounts/__tests__/cursor-account-coverage.test.ts +73 -0
  118. package/src/cursor-accounts/badges.tsx +26 -0
  119. package/src/cursor-accounts/cursor-account-coverage.ts +71 -0
  120. package/src/cursor-accounts/cursor-account-format.ts +17 -1
  121. package/src/datastore/CollectionRecordsBrowser.tsx +29 -3
  122. package/src/datastore/RecordFilterBuilder.tsx +12 -1
  123. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +38 -0
  124. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +14 -0
  125. package/src/datastore/__tests__/recordFilter.test.ts +13 -0
  126. package/src/datastore/recordFilter.ts +15 -1
  127. package/src/execution/ExecutionProgress.tsx +14 -4
  128. package/src/execution/MessageThread.tsx +10 -2
  129. package/src/execution/__tests__/ExecutionProgress.test.tsx +67 -0
  130. package/src/execution/__tests__/MessageThread.test.tsx +44 -0
  131. package/src/execution/__tests__/useCreateAgentExecution.test.tsx +86 -0
  132. package/src/execution/useCreateAgentExecution.ts +41 -6
  133. package/src/index.ts +32 -24
  134. package/src/{billing → internal}/form-primitives.tsx +4 -32
  135. package/src/{billing → pricing-governance}/BaselineEditor.tsx +36 -3
  136. package/src/{billing → pricing-governance}/PricingGovernanceConsole.tsx +1 -1
  137. package/src/{billing → pricing-governance}/RetireConfirm.tsx +1 -1
  138. package/src/pricing-governance/index.ts +50 -0
  139. package/src/session/__tests__/useCreateSession.test.tsx +94 -0
  140. package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
  141. package/src/session/useCreateSession.ts +30 -0
  142. package/src/session/useNewSessionFlow.ts +45 -1
  143. package/src/session/useUpdateSession.ts +29 -10
  144. package/styles.css +1 -1
  145. package/billing/BaselineEditor.d.ts.map +0 -1
  146. package/billing/BaselineEditor.js.map +0 -1
  147. package/billing/ModelCatalogPanel.d.ts.map +0 -1
  148. package/billing/ModelCatalogPanel.js.map +0 -1
  149. package/billing/ModelGovernanceDetail.d.ts.map +0 -1
  150. package/billing/ModelGovernanceDetail.js.map +0 -1
  151. package/billing/OperatorAccessNotice.d.ts.map +0 -1
  152. package/billing/OperatorAccessNotice.js.map +0 -1
  153. package/billing/PricingGovernanceConsole.d.ts.map +0 -1
  154. package/billing/PricingGovernanceConsole.js.map +0 -1
  155. package/billing/PricingGovernancePanel.d.ts.map +0 -1
  156. package/billing/PricingGovernancePanel.js.map +0 -1
  157. package/billing/RetireConfirm.d.ts.map +0 -1
  158. package/billing/RetireConfirm.js.map +0 -1
  159. package/billing/form-primitives.d.ts +0 -18
  160. package/billing/form-primitives.d.ts.map +0 -1
  161. package/billing/form-primitives.js.map +0 -1
  162. package/billing/governance-primitives.d.ts.map +0 -1
  163. package/billing/governance-primitives.js.map +0 -1
  164. package/billing/pricing-format.d.ts.map +0 -1
  165. package/billing/pricing-format.js.map +0 -1
  166. package/billing/useDecidePricingOverride.d.ts.map +0 -1
  167. package/billing/useDecidePricingOverride.js.map +0 -1
  168. package/billing/useModelGovernanceView.d.ts.map +0 -1
  169. package/billing/useModelGovernanceView.js.map +0 -1
  170. package/billing/useModelPricingBaselines.d.ts.map +0 -1
  171. package/billing/useModelPricingBaselines.js.map +0 -1
  172. package/billing/usePricingGovernance.d.ts.map +0 -1
  173. package/billing/usePricingGovernance.js.map +0 -1
  174. package/billing/useRetireModelPricingBaseline.d.ts.map +0 -1
  175. package/billing/useRetireModelPricingBaseline.js.map +0 -1
  176. package/billing/useUpsertModelPricingBaseline.d.ts.map +0 -1
  177. package/billing/useUpsertModelPricingBaseline.js.map +0 -1
  178. /package/{billing → pricing-governance}/BaselineEditor.d.ts +0 -0
  179. /package/{billing → pricing-governance}/ModelCatalogPanel.d.ts +0 -0
  180. /package/{billing → pricing-governance}/ModelCatalogPanel.js +0 -0
  181. /package/{billing → pricing-governance}/ModelGovernanceDetail.d.ts +0 -0
  182. /package/{billing → pricing-governance}/ModelGovernanceDetail.js +0 -0
  183. /package/{billing → pricing-governance}/OperatorAccessNotice.d.ts +0 -0
  184. /package/{billing → pricing-governance}/OperatorAccessNotice.js +0 -0
  185. /package/{billing → pricing-governance}/PricingGovernanceConsole.d.ts +0 -0
  186. /package/{billing → pricing-governance}/PricingGovernancePanel.d.ts +0 -0
  187. /package/{billing → pricing-governance}/PricingGovernancePanel.js +0 -0
  188. /package/{billing → pricing-governance}/RetireConfirm.d.ts +0 -0
  189. /package/{billing → pricing-governance}/governance-primitives.d.ts +0 -0
  190. /package/{billing → pricing-governance}/governance-primitives.js +0 -0
  191. /package/{billing → pricing-governance}/pricing-format.d.ts +0 -0
  192. /package/{billing → pricing-governance}/pricing-format.js +0 -0
  193. /package/{billing → pricing-governance}/useDecidePricingOverride.d.ts +0 -0
  194. /package/{billing → pricing-governance}/useDecidePricingOverride.js +0 -0
  195. /package/{billing → pricing-governance}/useModelGovernanceView.d.ts +0 -0
  196. /package/{billing → pricing-governance}/useModelGovernanceView.js +0 -0
  197. /package/{billing → pricing-governance}/useModelPricingBaselines.d.ts +0 -0
  198. /package/{billing → pricing-governance}/useModelPricingBaselines.js +0 -0
  199. /package/{billing → pricing-governance}/usePricingGovernance.d.ts +0 -0
  200. /package/{billing → pricing-governance}/usePricingGovernance.js +0 -0
  201. /package/{billing → pricing-governance}/useRetireModelPricingBaseline.d.ts +0 -0
  202. /package/{billing → pricing-governance}/useRetireModelPricingBaseline.js +0 -0
  203. /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.d.ts +0 -0
  204. /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.js +0 -0
  205. /package/src/{billing → pricing-governance}/ModelCatalogPanel.tsx +0 -0
  206. /package/src/{billing → pricing-governance}/ModelGovernanceDetail.tsx +0 -0
  207. /package/src/{billing → pricing-governance}/OperatorAccessNotice.tsx +0 -0
  208. /package/src/{billing → pricing-governance}/PricingGovernancePanel.tsx +0 -0
  209. /package/src/{billing → pricing-governance}/__tests__/ModelCatalogPanel.test.tsx +0 -0
  210. /package/src/{billing → pricing-governance}/__tests__/PricingGovernanceConsole.test.tsx +0 -0
  211. /package/src/{billing → pricing-governance}/__tests__/useModelGovernanceView.test.tsx +0 -0
  212. /package/src/{billing → pricing-governance}/governance-primitives.tsx +0 -0
  213. /package/src/{billing → pricing-governance}/pricing-format.ts +0 -0
  214. /package/src/{billing → pricing-governance}/useDecidePricingOverride.ts +0 -0
  215. /package/src/{billing → pricing-governance}/useModelGovernanceView.ts +0 -0
  216. /package/src/{billing → pricing-governance}/useModelPricingBaselines.ts +0 -0
  217. /package/src/{billing → pricing-governance}/usePricingGovernance.ts +0 -0
  218. /package/src/{billing → pricing-governance}/useRetireModelPricingBaseline.ts +0 -0
  219. /package/src/{billing → pricing-governance}/useUpsertModelPricingBaseline.ts +0 -0
@@ -111,6 +111,36 @@ export interface UseNewSessionFlowOptions {
111
111
  * @default "integrator"
112
112
  */
113
113
  readonly audience?: SessionAudience;
114
+ /**
115
+ * Custom key-value pairs stored on the created session's
116
+ * `SessionSpec.metadata`.
117
+ *
118
+ * A passthrough for embedder-owned keys (correlation IDs, tenant tags)
119
+ * and for platform-reserved `stigmer.ai/*` keys set explicitly. For the
120
+ * common case — standing user context injected into the agent's prompt —
121
+ * prefer the typed {@link sessionContext} option, which maps onto the
122
+ * reserved `stigmer.ai/session-context` key and wins over a raw entry
123
+ * under that key when both are provided.
124
+ */
125
+ readonly metadata?: Record<string, string>;
126
+ /**
127
+ * Standing, per-user context the agent receives on every turn but the
128
+ * conversation UI never renders — who the caller is, their experience
129
+ * level, their standing instructions (stigmer/stigmer#286).
130
+ *
131
+ * Stored on the created session's `SessionSpec.metadata` under
132
+ * `stigmer.ai/session-context`; the agent runner injects it into the
133
+ * system prompt as already-known background, so agents can greet the
134
+ * user by name and calibrate depth/defaults from the first turn without
135
+ * a visible context preamble.
136
+ *
137
+ * Personalization, not authorization: anyone who can create the session
138
+ * can set this (the same trust level as authoring the first message).
139
+ * Hidden from the conversation thread, not from the API — `session.get`
140
+ * returns it, so never put secrets here; secrets belong in `runtimeEnv`
141
+ * or Environment resources. Large values bloat every prompt.
142
+ */
143
+ readonly sessionContext?: string;
114
144
  }
115
145
 
116
146
  /** Return value of {@link useNewSessionFlow}. */
@@ -217,7 +247,15 @@ export interface UseNewSessionFlowReturn {
217
247
  export function useNewSessionFlow(
218
248
  options: UseNewSessionFlowOptions,
219
249
  ): UseNewSessionFlowReturn {
220
- const { org, onSessionCreated, onError, getRuntimeEnv, defaultHarness } = options;
250
+ const {
251
+ org,
252
+ onSessionCreated,
253
+ onError,
254
+ getRuntimeEnv,
255
+ defaultHarness,
256
+ metadata,
257
+ sessionContext,
258
+ } = options;
221
259
  const isGuest = options.audience === "guest";
222
260
  const contextTarget = useExecutionTarget();
223
261
  const executionTarget = options.executionTarget ?? contextTarget;
@@ -336,6 +374,10 @@ export function useNewSessionFlow(
336
374
  : undefined,
337
375
  mcpServerUsages: mcpServerUsages.length > 0 ? mcpServerUsages : undefined,
338
376
  skillRefs: skillRefs.length > 0 ? skillRefs : undefined,
377
+ // The typed-wins merge happens downstream in useCreateAgentExecution;
378
+ // both fields are forwarded verbatim here.
379
+ metadata,
380
+ sessionContext,
339
381
  harness,
340
382
  executionTarget,
341
383
  };
@@ -440,6 +482,8 @@ export function useNewSessionFlow(
440
482
  workspace,
441
483
  mcpServerUsages,
442
484
  skillRefs,
485
+ metadata,
486
+ sessionContext,
443
487
  agentRef,
444
488
  resolution,
445
489
  defaultAgent,
@@ -24,28 +24,47 @@ export interface UseUpdateSessionReturn {
24
24
  * {@link SessionInput} including the session's `name` and `org` (used
25
25
  * by the backend to identify the resource) and all spec fields.
26
26
  *
27
+ * **Full-replace semantics.** The backend replaces the entire spec with
28
+ * what you send — there is no field mask. Round-trip every spec field
29
+ * you do not intend to change, *including `metadata`*: an update built
30
+ * from a reconstructed partial spec silently wipes the fields it omits
31
+ * (workspace entries, MCP servers, and `stigmer.ai/*` metadata keys such
32
+ * as the embedder session context). To change only the subject, prefer
33
+ * the field-level `session.updateSubject()` RPC instead of this hook.
34
+ *
27
35
  * Typically composed into higher-level hooks like
28
- * {@link useSessionConversation} rather than used directly. Platform
29
- * builders who need direct session mutation can use this hook
30
- * standalone.
36
+ * {@link useSessionConversation} (whose update path round-trips the
37
+ * fetched spec) rather than used directly. Platform builders who need
38
+ * direct session mutation can use this hook standalone.
31
39
  *
32
40
  * @example
33
41
  * ```tsx
34
- * function RenameSession({ session }: { session: Session }) {
35
- * const { update, isUpdating, error } = useUpdateSession();
42
+ * function TagSession({ session }: { session: Session }) {
43
+ * const { update, isUpdating } = useUpdateSession();
36
44
  *
37
- * async function handleRename(newSubject: string) {
45
+ * async function handleTag() {
46
+ * const spec = session.spec;
38
47
  * await update({
39
48
  * name: session.metadata!.name,
40
49
  * org: session.metadata!.org,
41
- * agentInstanceId: session.spec?.agentInstanceId,
42
- * subject: newSubject,
50
+ * // Full replace: carry over every fetched spec field...
51
+ * agentInstanceId: spec?.agentInstanceId,
52
+ * subject: spec?.subject,
53
+ * harnessStateId: spec?.harnessStateId,
54
+ * harness: spec?.harness,
55
+ * cursorMode: spec?.cursorMode,
56
+ * executionTarget: spec?.executionTarget,
57
+ * // ...including the spec lists (workspaceEntries, mcpServerUsages,
58
+ * // skillRefs), converted from the fetched proto exactly as
59
+ * // useSessionConversation's update path does...
60
+ * // ...then apply the one change on top of the carried metadata.
61
+ * metadata: { ...spec?.metadata, "acme/reviewed": "true" },
43
62
  * });
44
63
  * }
45
64
  *
46
65
  * return (
47
- * <button onClick={() => handleRename("New subject")} disabled={isUpdating}>
48
- * Rename
66
+ * <button onClick={handleTag} disabled={isUpdating}>
67
+ * Mark reviewed
49
68
  * </button>
50
69
  * );
51
70
  * }