@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.
- package/billing/index.d.ts +0 -18
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +4 -9
- package/billing/index.js.map +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +7 -1
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -1
- package/cursor-accounts/CursorAccountEditor.js +21 -5
- package/cursor-accounts/CursorAccountEditor.js.map +1 -1
- package/cursor-accounts/CursorAccountsConsole.d.ts +9 -5
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
- package/cursor-accounts/CursorAccountsConsole.js +34 -140
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
- package/cursor-accounts/MemberCoverageTable.d.ts +29 -0
- package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -0
- package/cursor-accounts/MemberCoverageTable.js +150 -0
- package/cursor-accounts/MemberCoverageTable.js.map +1 -0
- package/cursor-accounts/MemberKeysPanel.d.ts +25 -0
- package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -0
- package/cursor-accounts/MemberKeysPanel.js +115 -0
- package/cursor-accounts/MemberKeysPanel.js.map +1 -0
- package/cursor-accounts/badges.d.ts +9 -0
- package/cursor-accounts/badges.d.ts.map +1 -0
- package/cursor-accounts/badges.js +10 -0
- package/cursor-accounts/badges.js.map +1 -0
- package/cursor-accounts/cursor-account-coverage.d.ts +41 -0
- package/cursor-accounts/cursor-account-coverage.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-coverage.js +26 -0
- package/cursor-accounts/cursor-account-coverage.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +13 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -1
- package/cursor-accounts/cursor-account-format.js +16 -1
- package/cursor-accounts/cursor-account-format.js.map +1 -1
- package/datastore/CollectionRecordsBrowser.js +18 -4
- package/datastore/CollectionRecordsBrowser.js.map +1 -1
- package/datastore/RecordFilterBuilder.d.ts +8 -1
- package/datastore/RecordFilterBuilder.d.ts.map +1 -1
- package/datastore/RecordFilterBuilder.js +2 -2
- package/datastore/RecordFilterBuilder.js.map +1 -1
- package/datastore/recordFilter.d.ts +9 -1
- package/datastore/recordFilter.d.ts.map +1 -1
- package/datastore/recordFilter.js +12 -1
- package/datastore/recordFilter.js.map +1 -1
- package/execution/ExecutionProgress.d.ts.map +1 -1
- package/execution/ExecutionProgress.js +13 -4
- package/execution/ExecutionProgress.js.map +1 -1
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +10 -2
- package/execution/MessageThread.js.map +1 -1
- package/execution/useCreateAgentExecution.d.ts +31 -1
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js +2 -0
- package/execution/useCreateAgentExecution.js.map +1 -1
- package/index.d.ts +4 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -2
- package/index.js.map +1 -1
- package/internal/form-primitives.d.ts +10 -0
- package/internal/form-primitives.d.ts.map +1 -0
- package/{billing → internal}/form-primitives.js +5 -9
- package/internal/form-primitives.js.map +1 -0
- package/package.json +4 -4
- package/pricing-governance/BaselineEditor.d.ts.map +1 -0
- package/{billing → pricing-governance}/BaselineEditor.js +19 -2
- package/pricing-governance/BaselineEditor.js.map +1 -0
- package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
- package/pricing-governance/ModelCatalogPanel.js.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
- package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
- package/pricing-governance/OperatorAccessNotice.js.map +1 -0
- package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
- package/{billing → pricing-governance}/PricingGovernanceConsole.js +1 -1
- package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
- package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
- package/pricing-governance/PricingGovernancePanel.js.map +1 -0
- package/pricing-governance/RetireConfirm.d.ts.map +1 -0
- package/{billing → pricing-governance}/RetireConfirm.js +1 -1
- package/pricing-governance/RetireConfirm.js.map +1 -0
- package/pricing-governance/governance-primitives.d.ts.map +1 -0
- package/pricing-governance/governance-primitives.js.map +1 -0
- package/pricing-governance/index.d.ts +19 -0
- package/pricing-governance/index.d.ts.map +1 -0
- package/pricing-governance/index.js +20 -0
- package/pricing-governance/index.js.map +1 -0
- package/pricing-governance/pricing-format.d.ts.map +1 -0
- package/pricing-governance/pricing-format.js.map +1 -0
- package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
- package/pricing-governance/useDecidePricingOverride.js.map +1 -0
- package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
- package/pricing-governance/useModelGovernanceView.js.map +1 -0
- package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
- package/pricing-governance/useModelPricingBaselines.js.map +1 -0
- package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
- package/pricing-governance/usePricingGovernance.js.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
- package/session/useCreateSession.d.ts +28 -0
- package/session/useCreateSession.d.ts.map +1 -1
- package/session/useCreateSession.js +2 -1
- package/session/useCreateSession.js.map +1 -1
- package/session/useNewSessionFlow.d.ts +30 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +7 -1
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useUpdateSession.d.ts +29 -10
- package/session/useUpdateSession.d.ts.map +1 -1
- package/session/useUpdateSession.js +29 -10
- package/session/useUpdateSession.js.map +1 -1
- package/src/billing/index.ts +5 -37
- package/src/cursor-accounts/CursorAccountEditor.tsx +61 -13
- package/src/cursor-accounts/CursorAccountsConsole.tsx +44 -400
- package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
- package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +306 -10
- package/src/cursor-accounts/__tests__/cursor-account-coverage.test.ts +73 -0
- package/src/cursor-accounts/badges.tsx +26 -0
- package/src/cursor-accounts/cursor-account-coverage.ts +71 -0
- package/src/cursor-accounts/cursor-account-format.ts +17 -1
- package/src/datastore/CollectionRecordsBrowser.tsx +29 -3
- package/src/datastore/RecordFilterBuilder.tsx +12 -1
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +38 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +14 -0
- package/src/datastore/__tests__/recordFilter.test.ts +13 -0
- package/src/datastore/recordFilter.ts +15 -1
- package/src/execution/ExecutionProgress.tsx +14 -4
- package/src/execution/MessageThread.tsx +10 -2
- package/src/execution/__tests__/ExecutionProgress.test.tsx +67 -0
- package/src/execution/__tests__/MessageThread.test.tsx +44 -0
- package/src/execution/__tests__/useCreateAgentExecution.test.tsx +86 -0
- package/src/execution/useCreateAgentExecution.ts +41 -6
- package/src/index.ts +32 -24
- package/src/{billing → internal}/form-primitives.tsx +4 -32
- package/src/{billing → pricing-governance}/BaselineEditor.tsx +36 -3
- package/src/{billing → pricing-governance}/PricingGovernanceConsole.tsx +1 -1
- package/src/{billing → pricing-governance}/RetireConfirm.tsx +1 -1
- package/src/pricing-governance/index.ts +50 -0
- package/src/session/__tests__/useCreateSession.test.tsx +94 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
- package/src/session/useCreateSession.ts +30 -0
- package/src/session/useNewSessionFlow.ts +45 -1
- package/src/session/useUpdateSession.ts +29 -10
- package/styles.css +1 -1
- package/billing/BaselineEditor.d.ts.map +0 -1
- package/billing/BaselineEditor.js.map +0 -1
- package/billing/ModelCatalogPanel.d.ts.map +0 -1
- package/billing/ModelCatalogPanel.js.map +0 -1
- package/billing/ModelGovernanceDetail.d.ts.map +0 -1
- package/billing/ModelGovernanceDetail.js.map +0 -1
- package/billing/OperatorAccessNotice.d.ts.map +0 -1
- package/billing/OperatorAccessNotice.js.map +0 -1
- package/billing/PricingGovernanceConsole.d.ts.map +0 -1
- package/billing/PricingGovernanceConsole.js.map +0 -1
- package/billing/PricingGovernancePanel.d.ts.map +0 -1
- package/billing/PricingGovernancePanel.js.map +0 -1
- package/billing/RetireConfirm.d.ts.map +0 -1
- package/billing/RetireConfirm.js.map +0 -1
- package/billing/form-primitives.d.ts +0 -18
- package/billing/form-primitives.d.ts.map +0 -1
- package/billing/form-primitives.js.map +0 -1
- package/billing/governance-primitives.d.ts.map +0 -1
- package/billing/governance-primitives.js.map +0 -1
- package/billing/pricing-format.d.ts.map +0 -1
- package/billing/pricing-format.js.map +0 -1
- package/billing/useDecidePricingOverride.d.ts.map +0 -1
- package/billing/useDecidePricingOverride.js.map +0 -1
- package/billing/useModelGovernanceView.d.ts.map +0 -1
- package/billing/useModelGovernanceView.js.map +0 -1
- package/billing/useModelPricingBaselines.d.ts.map +0 -1
- package/billing/useModelPricingBaselines.js.map +0 -1
- package/billing/usePricingGovernance.d.ts.map +0 -1
- package/billing/usePricingGovernance.js.map +0 -1
- package/billing/useRetireModelPricingBaseline.d.ts.map +0 -1
- package/billing/useRetireModelPricingBaseline.js.map +0 -1
- package/billing/useUpsertModelPricingBaseline.d.ts.map +0 -1
- package/billing/useUpsertModelPricingBaseline.js.map +0 -1
- /package/{billing → pricing-governance}/BaselineEditor.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelCatalogPanel.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelCatalogPanel.js +0 -0
- /package/{billing → pricing-governance}/ModelGovernanceDetail.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelGovernanceDetail.js +0 -0
- /package/{billing → pricing-governance}/OperatorAccessNotice.d.ts +0 -0
- /package/{billing → pricing-governance}/OperatorAccessNotice.js +0 -0
- /package/{billing → pricing-governance}/PricingGovernanceConsole.d.ts +0 -0
- /package/{billing → pricing-governance}/PricingGovernancePanel.d.ts +0 -0
- /package/{billing → pricing-governance}/PricingGovernancePanel.js +0 -0
- /package/{billing → pricing-governance}/RetireConfirm.d.ts +0 -0
- /package/{billing → pricing-governance}/governance-primitives.d.ts +0 -0
- /package/{billing → pricing-governance}/governance-primitives.js +0 -0
- /package/{billing → pricing-governance}/pricing-format.d.ts +0 -0
- /package/{billing → pricing-governance}/pricing-format.js +0 -0
- /package/{billing → pricing-governance}/useDecidePricingOverride.d.ts +0 -0
- /package/{billing → pricing-governance}/useDecidePricingOverride.js +0 -0
- /package/{billing → pricing-governance}/useModelGovernanceView.d.ts +0 -0
- /package/{billing → pricing-governance}/useModelGovernanceView.js +0 -0
- /package/{billing → pricing-governance}/useModelPricingBaselines.d.ts +0 -0
- /package/{billing → pricing-governance}/useModelPricingBaselines.js +0 -0
- /package/{billing → pricing-governance}/usePricingGovernance.d.ts +0 -0
- /package/{billing → pricing-governance}/usePricingGovernance.js +0 -0
- /package/{billing → pricing-governance}/useRetireModelPricingBaseline.d.ts +0 -0
- /package/{billing → pricing-governance}/useRetireModelPricingBaseline.js +0 -0
- /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.d.ts +0 -0
- /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.js +0 -0
- /package/src/{billing → pricing-governance}/ModelCatalogPanel.tsx +0 -0
- /package/src/{billing → pricing-governance}/ModelGovernanceDetail.tsx +0 -0
- /package/src/{billing → pricing-governance}/OperatorAccessNotice.tsx +0 -0
- /package/src/{billing → pricing-governance}/PricingGovernancePanel.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/ModelCatalogPanel.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/PricingGovernanceConsole.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/useModelGovernanceView.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/governance-primitives.tsx +0 -0
- /package/src/{billing → pricing-governance}/pricing-format.ts +0 -0
- /package/src/{billing → pricing-governance}/useDecidePricingOverride.ts +0 -0
- /package/src/{billing → pricing-governance}/useModelGovernanceView.ts +0 -0
- /package/src/{billing → pricing-governance}/useModelPricingBaselines.ts +0 -0
- /package/src/{billing → pricing-governance}/usePricingGovernance.ts +0 -0
- /package/src/{billing → pricing-governance}/useRetireModelPricingBaseline.ts +0 -0
- /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 {
|
|
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}
|
|
29
|
-
*
|
|
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
|
|
35
|
-
* const { update, isUpdating
|
|
42
|
+
* function TagSession({ session }: { session: Session }) {
|
|
43
|
+
* const { update, isUpdating } = useUpdateSession();
|
|
36
44
|
*
|
|
37
|
-
* async function
|
|
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
|
-
*
|
|
42
|
-
*
|
|
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={
|
|
48
|
-
*
|
|
66
|
+
* <button onClick={handleTag} disabled={isUpdating}>
|
|
67
|
+
* Mark reviewed
|
|
49
68
|
* </button>
|
|
50
69
|
* );
|
|
51
70
|
* }
|