@elevasis/ui 2.64.1 → 2.66.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 (72) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.d.ts +26 -0
  3. package/dist/app/index.js +8 -8
  4. package/dist/auth/index.d.ts +12 -5
  5. package/dist/auth/index.js +8 -8
  6. package/dist/charts/index.js +8 -8
  7. package/dist/{chunk-DRQPEMJI.js → chunk-4DV4ECMG.js} +3 -0
  8. package/dist/{chunk-KRWALB24.js → chunk-6SSQGWK7.js} +1 -1
  9. package/dist/{chunk-ZTWA5H77.js → chunk-6ZAP3FOA.js} +0 -1
  10. package/dist/{chunk-PGAA4G3T.js → chunk-ANNM5R7S.js} +275 -382
  11. package/dist/{chunk-I3CFGE3N.js → chunk-BLXJEIQS.js} +1 -1
  12. package/dist/chunk-L7BZZ4SI.js +56 -0
  13. package/dist/chunk-P45GQ3ZW.js +104 -0
  14. package/dist/{chunk-EIXSQONC.js → chunk-RT4KRGZT.js} +37 -59
  15. package/dist/{chunk-FVOMKZ7S.js → chunk-Y6I3IC45.js} +3 -6
  16. package/dist/components/index.d.ts +274 -191
  17. package/dist/components/index.js +8 -8
  18. package/dist/components/navigation/index.js +8 -8
  19. package/dist/execution/index.d.ts +115 -104
  20. package/dist/execution/index.js +2 -2
  21. package/dist/features/auth/index.d.ts +125 -9
  22. package/dist/features/auth/index.js +154 -14
  23. package/dist/features/clients/index.js +8 -8
  24. package/dist/features/crm/index.d.ts +20 -0
  25. package/dist/features/crm/index.js +8 -8
  26. package/dist/features/dashboard/index.js +8 -8
  27. package/dist/features/delivery/index.d.ts +20 -0
  28. package/dist/features/delivery/index.js +8 -8
  29. package/dist/features/knowledge/index.js +8 -8
  30. package/dist/features/lead-gen/index.js +8 -8
  31. package/dist/features/monitoring/index.js +8 -8
  32. package/dist/features/monitoring/requests/index.js +9 -9
  33. package/dist/features/notes/index.js +2 -2
  34. package/dist/features/operations/index.d.ts +177 -106
  35. package/dist/features/operations/index.js +8 -8
  36. package/dist/features/public-agent-chat/index.js +1 -1
  37. package/dist/features/settings/index.d.ts +21 -0
  38. package/dist/features/settings/index.js +8 -8
  39. package/dist/hooks/access/index.js +8 -8
  40. package/dist/hooks/delivery/index.d.ts +20 -0
  41. package/dist/hooks/delivery/index.js +8 -8
  42. package/dist/hooks/index.d.ts +319 -145
  43. package/dist/hooks/index.js +8 -8
  44. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -2
  45. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
  46. package/dist/hooks/published.d.ts +319 -145
  47. package/dist/hooks/published.js +8 -8
  48. package/dist/index.d.ts +409 -219
  49. package/dist/index.js +8 -8
  50. package/dist/initialization/index.d.ts +95 -28
  51. package/dist/initialization/index.js +3 -3
  52. package/dist/knowledge/index.js +12 -12
  53. package/dist/{knowledge-search-index-JOPRYZN6.js → knowledge-search-index-6EZNBNSR.js} +4 -4
  54. package/dist/layout/index.js +8 -8
  55. package/dist/organization/index.d.ts +63 -4
  56. package/dist/organization/index.js +8 -8
  57. package/dist/profile/index.d.ts +43 -2
  58. package/dist/profile/index.js +1 -1
  59. package/dist/provider/index.d.ts +20 -0
  60. package/dist/provider/index.js +8 -8
  61. package/dist/provider/published.d.ts +20 -0
  62. package/dist/provider/published.js +8 -8
  63. package/dist/supabase/index.d.ts +40 -0
  64. package/dist/test-utils/index.d.ts +5 -0
  65. package/dist/test-utils/index.js +4 -4
  66. package/dist/test-utils/setup-integration.js +1 -1
  67. package/dist/test-utils/setup.js +1 -1
  68. package/dist/types/index.d.ts +483 -244
  69. package/dist/utils/index.js +2 -2
  70. package/package.json +6 -4
  71. package/dist/chunk-LO7GWG24.js +0 -75
  72. package/dist/chunk-T4LA4RY2.js +0 -56
@@ -160,10 +160,50 @@ interface ListMembershipsResponse {
160
160
  after?: string | null;
161
161
  };
162
162
  }
163
+ /**
164
+ * How a membership row relates to the two systems that describe it.
165
+ *
166
+ * - `linked` — an `org_memberships` row that carries a `workos_membership_id`
167
+ * - `pre_provisioned` — an `org_memberships` row with no `workos_membership_id`;
168
+ * the invitee was provisioned but has not completed signup
169
+ * - `workos_only` — a WorkOS membership with no `org_memberships` row (a sync gap)
170
+ */
171
+ type MembershipProvisioningState = 'linked' | 'pre_provisioned' | 'workos_only';
163
172
  /**
164
173
  * Extended membership with user and organization details for UI
174
+ *
175
+ * **ID convention (step 17 of the auth/invitations architecture refactor):**
176
+ * `id`, `userId`, and `organizationId` are the canonical Supabase UUIDs
177
+ * (`org_memberships.id` / `users.id` / `organizations.id`) on every producer
178
+ * of this type. `workosMembershipId` / `workosUserId` /
179
+ * `organization.workos_org_id` carry the WorkOS-side forms explicitly instead
180
+ * -- the contract does not overload the canonical fields with either form.
181
+ *
182
+ * The one exception: a `workos_only` row (a WorkOS membership with no
183
+ * `org_memberships` row -- a sync gap) has no canonical membership UUID to
184
+ * report, because no such row exists. `id` stays the WorkOS `om_...` form for
185
+ * that `provisioningState` alone; `userId` / `organizationId` are still
186
+ * resolved to their Supabase forms where the user/organization themselves
187
+ * exist.
165
188
  */
166
189
  interface MembershipWithDetails extends OrganizationMembership {
190
+ /**
191
+ * Set by `GET /memberships`. Optional so existing consumers are unaffected;
192
+ * treat `undefined` as "not reported by this endpoint".
193
+ */
194
+ provisioningState?: MembershipProvisioningState;
195
+ /**
196
+ * WorkOS `om_...` form of `id`. `null` when the membership is
197
+ * pre-provisioned (invited, signup not completed -- no WorkOS record yet).
198
+ * Explicit companion to the canonical `id`; see the type-level doc comment.
199
+ */
200
+ workosMembershipId?: string | null;
201
+ /**
202
+ * WorkOS `user_...` form of `userId`. `null` when the member has not
203
+ * completed WorkOS signup yet. Explicit companion to the canonical
204
+ * `userId`; see the type-level doc comment.
205
+ */
206
+ workosUserId?: string | null;
167
207
  user?: {
168
208
  id: string;
169
209
  email: string;
@@ -2927,6 +2967,7 @@ type Database = {
2927
2967
  deleted_at: string | null;
2928
2968
  ended_at: string | null;
2929
2969
  memory_snapshot: Json;
2970
+ memory_version: number;
2930
2971
  metadata: Json | null;
2931
2972
  organization_id: string;
2932
2973
  resource_id: string;
@@ -2943,6 +2984,7 @@ type Database = {
2943
2984
  deleted_at?: string | null;
2944
2985
  ended_at?: string | null;
2945
2986
  memory_snapshot: Json;
2987
+ memory_version?: number;
2946
2988
  metadata?: Json | null;
2947
2989
  organization_id: string;
2948
2990
  resource_id: string;
@@ -2959,6 +3001,7 @@ type Database = {
2959
3001
  deleted_at?: string | null;
2960
3002
  ended_at?: string | null;
2961
3003
  memory_snapshot?: Json;
3004
+ memory_version?: number;
2962
3005
  metadata?: Json | null;
2963
3006
  organization_id?: string;
2964
3007
  resource_id?: string;
@@ -3296,9 +3339,14 @@ type Database = {
3296
3339
  p_session_id: string;
3297
3340
  };
3298
3341
  Returns: {
3342
+ context_window_size: number;
3299
3343
  created_at: string;
3344
+ cumulative_input_tokens: number;
3345
+ cumulative_output_tokens: number;
3346
+ deleted_at: string;
3300
3347
  ended_at: string;
3301
3348
  memory_snapshot: Json;
3349
+ memory_version: number;
3302
3350
  metadata: Json;
3303
3351
  organization_id: string;
3304
3352
  resource_id: string;
@@ -3340,6 +3388,18 @@ type Database = {
3340
3388
  };
3341
3389
  Returns: boolean;
3342
3390
  };
3391
+ increment_session_tokens: {
3392
+ Args: {
3393
+ p_input_tokens: number;
3394
+ p_output_tokens: number;
3395
+ p_session_id: string;
3396
+ };
3397
+ Returns: {
3398
+ context_window_size: number;
3399
+ cumulative_input_tokens: number;
3400
+ cumulative_output_tokens: number;
3401
+ }[];
3402
+ };
3343
3403
  is_org_member: {
3344
3404
  Args: {
3345
3405
  org_id: string;
@@ -4053,107 +4113,87 @@ type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
4053
4113
  type ResourceLink = Link;
4054
4114
 
4055
4115
  /**
4056
- * Serialized Registry Types
4116
+ * Memory type definitions
4117
+ * Types for agent memory management with semantic entry types
4118
+ */
4119
+ /**
4120
+ * Semantic memory entry types
4121
+ * Use-case agnostic types that describe the purpose of each entry
4122
+ * Memory types mirror action types for clarity and filtering
4123
+ */
4124
+ type MemoryEntryType = 'context' | 'input' | 'reasoning' | 'tool-result' | 'error';
4125
+ /**
4126
+ * Who authored an entry's content.
4057
4127
  *
4058
- * Pre-computed JSON-safe types for API responses and Command View.
4059
- * Serialization happens once at API startup, enabling instant response times.
4128
+ * This is what lets the assembled prompt tell framework-authored text apart from text that
4129
+ * originated outside the trust boundary. `'framework'` content is ours; the other three are not
4130
+ * and are rendered inside the JSON data envelope (see `MemoryManager.toContextParts`).
4060
4131
  */
4061
-
4132
+ type MemoryEntrySource = 'framework' | 'user' | 'tool' | 'model';
4062
4133
  /**
4063
- * Serialized agent definition (JSON-safe)
4064
- * Result of serializeDefinition(AgentDefinition)
4134
+ * Memory entry - represents a single entry in agent memory
4135
+ * Stored in agent memory, translated by adapters to vendor-specific formats
4065
4136
  */
4066
- interface SerializedAgentDefinition {
4067
- config: {
4068
- resourceId: string;
4069
- name: string;
4070
- description: string;
4071
- version: string;
4072
- type: 'agent';
4073
- kind: 'orchestrator' | 'specialist' | 'utility' | 'system';
4074
- status: 'dev' | 'prod';
4075
- links?: ResourceLink[];
4076
- category?: ResourceCategory;
4077
- /** Whether this resource is archived and should be excluded from registration and deployment */
4078
- archived?: boolean;
4079
- systemPrompt: string;
4080
- constraints?: {
4081
- maxIterations?: number;
4082
- timeout?: number;
4083
- maxSessionMemoryKeys?: number;
4084
- maxMemoryTokens?: number;
4085
- };
4086
- sessionCapable?: boolean;
4087
- memoryPreferences?: string;
4088
- };
4089
- modelConfig: {
4090
- provider: string;
4091
- model: string;
4092
- apiKey: string;
4093
- temperature: number;
4094
- maxOutputTokens: number;
4095
- topP?: number;
4096
- modelOptions?: Record<string, unknown>;
4097
- };
4098
- contract: {
4099
- inputSchema: object;
4100
- outputSchema?: object;
4101
- };
4102
- tools: Array<{
4103
- name: string;
4104
- description: string;
4105
- inputSchema?: object;
4106
- outputSchema?: object;
4107
- }>;
4108
- knowledgeMap?: {
4109
- nodeCount: number;
4110
- nodes: Array<{
4111
- id: string;
4112
- description: string;
4113
- loaded: boolean;
4114
- hasPrompt: boolean;
4115
- }>;
4137
+ interface MemoryEntry {
4138
+ type: MemoryEntryType;
4139
+ content: string;
4140
+ timestamp: number;
4141
+ turnNumber: number | null;
4142
+ iterationNumber: number | null;
4143
+ /**
4144
+ * Provenance. **Optional on purpose** `undefined` means unknown, which is what every
4145
+ * pre-existing snapshot and every not-yet-redeployed tenant bundle produces. Read sites MUST
4146
+ * test `== null`, never `=== undefined`: the `inTurnScope` predicate in `manager.ts` is the
4147
+ * cautionary precedent, where a `=== undefined` check silently dropped every `null`-stamped
4148
+ * entry. `isMemoryEntry` is deliberately NOT tightened to require this field; doing so would
4149
+ * make every stored snapshot fail validation, and `restoreSessionMemory` fails open by
4150
+ * starting the agent with empty memory rather than throwing.
4151
+ */
4152
+ source?: MemoryEntrySource;
4153
+ /**
4154
+ * Which tool produced this entry. Set on `tool-result` entries so the model can tell N parallel
4155
+ * results apart -- the framework instructs batching independent tool calls in one iteration, and
4156
+ * an anonymous result is unattributable the moment two land in the same iteration. `addToolError`
4157
+ * already carries this (folded into its `content` JSON); this is the same fact for the success
4158
+ * path, carried as a real field instead of prose the caller has to parse back out.
4159
+ */
4160
+ toolName?: string;
4161
+ /**
4162
+ * Present when `truncateContent` cut this entry's `content` to fit its token budget. A sibling
4163
+ * field, never text appended into `content` -- the notice used to be spliced into the string
4164
+ * itself, which could (and did) land inside a JSON string literal `truncateContent` had just cut
4165
+ * open, breaking `JSON.parse` on the far end. Absent means never truncated.
4166
+ */
4167
+ truncated?: {
4168
+ omittedTokens: number;
4116
4169
  };
4117
- metricsConfig?: object;
4170
+ /**
4171
+ * Prompt-injection warning types found in `content`, screened once here -- when the entry is
4172
+ * written -- instead of by re-scanning the whole accumulated envelope on every iteration it gets
4173
+ * re-sent for (`screenRequest`'s `data-envelope` slot used to do exactly that). Empty array means
4174
+ * screened and clean; `undefined` means never screened (entries that bypass `addToHistory`/`set`,
4175
+ * or pre-existing snapshots from before this field existed).
4176
+ */
4177
+ warnings?: string[];
4118
4178
  }
4119
4179
  /**
4120
- * Serialized workflow definition (JSON-safe)
4121
- * Result of serializeDefinition(WorkflowDefinition)
4180
+ * Agent memory - Self-orchestrated memory with session + working storage
4181
+ * Agent has full control over what persists, framework handles auto-compaction
4122
4182
  */
4123
- interface SerializedWorkflowDefinition {
4124
- config: {
4125
- resourceId: string;
4126
- name: string;
4127
- description: string;
4128
- version: string;
4129
- type: 'workflow';
4130
- status: 'dev' | 'prod';
4131
- links?: ResourceLink[];
4132
- category?: ResourceCategory;
4133
- /** Whether this resource is archived and should be excluded from registration and deployment */
4134
- archived?: boolean;
4135
- };
4136
- entryPoint: string;
4137
- steps: Array<{
4138
- id: string;
4139
- name: string;
4140
- description: string;
4141
- inputSchema?: object;
4142
- outputSchema?: object;
4143
- next: {
4144
- type: 'linear' | 'conditional';
4145
- target?: string;
4146
- routes?: Array<{
4147
- target: string;
4148
- }>;
4149
- default?: string;
4150
- } | null;
4151
- }>;
4152
- contract: {
4153
- inputSchema: object;
4154
- outputSchema?: object;
4155
- };
4156
- metricsConfig?: object;
4183
+ interface AgentMemory {
4184
+ /**
4185
+ * Session memory - Persists for session/conversation duration
4186
+ * Never auto-trimmed by framework
4187
+ * Agent-managed key-value store for critical information
4188
+ * Agent provides strings, framework wraps in MemoryEntry
4189
+ */
4190
+ sessionMemory: Record<string, MemoryEntry>;
4191
+ /**
4192
+ * Working memory - Execution history
4193
+ * Automatically compacted by framework when needed
4194
+ * Agent doesn't control compaction
4195
+ */
4196
+ history: MemoryEntry[];
4157
4197
  }
4158
4198
 
4159
4199
  /**
@@ -4206,47 +4246,6 @@ interface FormSchema {
4206
4246
  fields: FormField[];
4207
4247
  }
4208
4248
 
4209
- /**
4210
- * Memory type definitions
4211
- * Types for agent memory management with semantic entry types
4212
- */
4213
- /**
4214
- * Semantic memory entry types
4215
- * Use-case agnostic types that describe the purpose of each entry
4216
- * Memory types mirror action types for clarity and filtering
4217
- */
4218
- type MemoryEntryType = 'context' | 'input' | 'reasoning' | 'tool-result' | 'delegation-result' | 'error';
4219
- /**
4220
- * Memory entry - represents a single entry in agent memory
4221
- * Stored in agent memory, translated by adapters to vendor-specific formats
4222
- */
4223
- interface MemoryEntry {
4224
- type: MemoryEntryType;
4225
- content: string;
4226
- timestamp: number;
4227
- turnNumber: number | null;
4228
- iterationNumber: number | null;
4229
- }
4230
- /**
4231
- * Agent memory - Self-orchestrated memory with session + working storage
4232
- * Agent has full control over what persists, framework handles auto-compaction
4233
- */
4234
- interface AgentMemory {
4235
- /**
4236
- * Session memory - Persists for session/conversation duration
4237
- * Never auto-trimmed by framework
4238
- * Agent-managed key-value store for critical information
4239
- * Agent provides strings, framework wraps in MemoryEntry
4240
- */
4241
- sessionMemory: Record<string, MemoryEntry>;
4242
- /**
4243
- * Working memory - Execution history
4244
- * Automatically compacted by framework when needed
4245
- * Agent doesn't control compaction
4246
- */
4247
- history: MemoryEntry[];
4248
- }
4249
-
4250
4249
  declare const TransitionItemRequestSchema: z.ZodObject<{
4251
4250
  pipelineKey: z.ZodString;
4252
4251
  stageKey: z.ZodString;
@@ -5239,6 +5238,121 @@ interface CostByModelResponse {
5239
5238
  totalCallCount: number;
5240
5239
  }
5241
5240
 
5241
+ /**
5242
+ * Agent-specific type definitions
5243
+ * Types for autonomous agents with tools, memory, and constraints
5244
+ */
5245
+
5246
+ type AgentKind = 'orchestrator' | 'specialist' | 'utility' | 'platform';
5247
+
5248
+ /**
5249
+ * Serialized Registry Types
5250
+ *
5251
+ * Pre-computed JSON-safe types for API responses and Command View.
5252
+ * Serialization happens once at API startup, enabling instant response times.
5253
+ */
5254
+
5255
+ /**
5256
+ * Serialized agent definition (JSON-safe)
5257
+ * Result of serializeDefinition(AgentDefinition)
5258
+ */
5259
+ interface SerializedAgentDefinition {
5260
+ config: {
5261
+ resourceId: string;
5262
+ name: string;
5263
+ description: string;
5264
+ version: string;
5265
+ type: 'agent';
5266
+ /**
5267
+ * Imported from the runtime type instead of hand-copied. It used to be a hand-written literal
5268
+ * union that said `'system'` where `AgentKind`'s fourth member is `'platform'` -- undetected
5269
+ * because `serializeDefinition` returns `any` and every call site casts the result to this
5270
+ * interface, so the literal union was never actually checked against real data. Deriving from
5271
+ * the source of truth makes that class of drift a type error instead of a silent typo.
5272
+ */
5273
+ kind: AgentKind;
5274
+ status: 'dev' | 'prod';
5275
+ links?: ResourceLink[];
5276
+ category?: ResourceCategory;
5277
+ /** Whether this resource is archived and should be excluded from registration and deployment */
5278
+ archived?: boolean;
5279
+ systemPrompt: string;
5280
+ constraints?: {
5281
+ maxIterations?: number;
5282
+ timeout?: number;
5283
+ maxSessionMemoryKeys?: number;
5284
+ maxMemoryTokens?: number;
5285
+ };
5286
+ sessionCapable?: boolean;
5287
+ memoryPreferences?: string;
5288
+ };
5289
+ modelConfig: {
5290
+ provider: string;
5291
+ model: string;
5292
+ apiKey: string;
5293
+ /**
5294
+ * Optional here, matching `ModelConfig` -- this used to be required even though neither real
5295
+ * agent literal in the monorepo (`local-test-agent`, the `createPlatformToolAgent` test fixture)
5296
+ * sets it, and nothing caught the mismatch for the same `serializeDefinition`-returns-`any`
5297
+ * reason `kind` drifted above.
5298
+ */
5299
+ temperature?: number;
5300
+ maxOutputTokens?: number;
5301
+ topP?: number;
5302
+ modelOptions?: Record<string, unknown>;
5303
+ };
5304
+ contract: {
5305
+ inputSchema: object;
5306
+ outputSchema?: object;
5307
+ };
5308
+ tools: Array<{
5309
+ name: string;
5310
+ description: string;
5311
+ inputSchema?: object;
5312
+ outputSchema?: object;
5313
+ }>;
5314
+ metricsConfig?: object;
5315
+ }
5316
+ /**
5317
+ * Serialized workflow definition (JSON-safe)
5318
+ * Result of serializeDefinition(WorkflowDefinition)
5319
+ */
5320
+ interface SerializedWorkflowDefinition {
5321
+ config: {
5322
+ resourceId: string;
5323
+ name: string;
5324
+ description: string;
5325
+ version: string;
5326
+ type: 'workflow';
5327
+ status: 'dev' | 'prod';
5328
+ links?: ResourceLink[];
5329
+ category?: ResourceCategory;
5330
+ /** Whether this resource is archived and should be excluded from registration and deployment */
5331
+ archived?: boolean;
5332
+ };
5333
+ entryPoint: string;
5334
+ steps: Array<{
5335
+ id: string;
5336
+ name: string;
5337
+ description: string;
5338
+ inputSchema?: object;
5339
+ outputSchema?: object;
5340
+ next: {
5341
+ type: 'linear' | 'conditional';
5342
+ target?: string;
5343
+ routes?: Array<{
5344
+ target: string;
5345
+ }>;
5346
+ default?: string;
5347
+ } | null;
5348
+ }>;
5349
+ contract: {
5350
+ inputSchema: object;
5351
+ outputSchema?: object;
5352
+ };
5353
+ metricsConfig?: object;
5354
+ }
5355
+
5242
5356
  /**
5243
5357
  * Base Execution Engine type definitions
5244
5358
  * Core types shared across all Execution Engine resources
@@ -5591,7 +5705,6 @@ interface CommandViewAgent extends ResourceDefinition {
5591
5705
  modelProvider: string;
5592
5706
  modelId: string;
5593
5707
  toolCount: number;
5594
- hasKnowledgeMap: boolean;
5595
5708
  hasMemory: boolean;
5596
5709
  sessionCapable: boolean;
5597
5710
  }
@@ -9734,21 +9847,56 @@ declare function useUserMemberships(userId: string, params?: Omit<ListMembership
9734
9847
 
9735
9848
  interface DeactivateMembershipMutationData {
9736
9849
  membershipId: string;
9850
+ /**
9851
+ * Accepted and ignored. These were read by an optimistic-update path that was
9852
+ * removed after it was found never to have executed -- see the note on the
9853
+ * hook below. They are kept in the signature because this hook is published
9854
+ * as part of `@elevasis/ui`, and narrowing a parameter type is a breaking
9855
+ * change; they should be dropped in the next deliberate major alongside the
9856
+ * other batched removals.
9857
+ */
9737
9858
  userId?: string;
9738
9859
  organizationId?: string;
9739
9860
  }
9740
- declare function useDeactivateMembership(): _tanstack_react_query.UseMutationResult<MembershipWithDetails, Error, DeactivateMembershipMutationData, {
9741
- previousData: unknown;
9742
- }>;
9861
+ /**
9862
+ * Deactivate an organization membership.
9863
+ *
9864
+ * NO OPTIMISTIC UPDATE, DELIBERATELY. This hook previously carried an
9865
+ * `onMutate` that patched two cache keys and an `onError` that rolled the patch
9866
+ * back. None of it ever ran: the only producer of a `memberships` key is
9867
+ * `useUserMemberships`, at `['memberships', 'user', userId, params]` -- four
9868
+ * elements -- while the patch wrote `['memberships', 'user', userId]` at three,
9869
+ * and `setQueryData` requires exact key equality. Its second branch targeted
9870
+ * `['memberships', 'organization', orgId]`, which no query produces at all. The
9871
+ * rollback snapshot was likewise always `undefined`.
9872
+ *
9873
+ * The list has therefore always refreshed via the invalidation below, and that
9874
+ * is now the only mechanism. Repairing the keys was considered and rejected: it
9875
+ * would switch on rollback logic that has never executed, on a surface where a
9876
+ * wrong patch shows an administrator a member as deactivated when the call
9877
+ * actually failed. If optimistic updates are wanted here, write them
9878
+ * deliberately with the rollback exercised by tests.
9879
+ */
9880
+ declare function useDeactivateMembership(): _tanstack_react_query.UseMutationResult<MembershipWithDetails, Error, DeactivateMembershipMutationData, unknown>;
9743
9881
 
9744
9882
  interface ReactivateMembershipMutationData {
9745
9883
  membershipId: string;
9884
+ /**
9885
+ * Accepted and ignored -- see the note on `useDeactivateMembership`. Kept
9886
+ * because this hook is published as part of `@elevasis/ui` and narrowing a
9887
+ * parameter type is a breaking change; drop in the next deliberate major.
9888
+ */
9746
9889
  userId?: string;
9747
9890
  organizationId?: string;
9748
9891
  }
9749
- declare function useReactivateMembership(): _tanstack_react_query.UseMutationResult<MembershipWithDetails, Error, ReactivateMembershipMutationData, {
9750
- previousData: unknown;
9751
- }>;
9892
+ /**
9893
+ * Reactivate an organization membership.
9894
+ *
9895
+ * NO OPTIMISTIC UPDATE, DELIBERATELY -- the removed `onMutate`/rollback pair
9896
+ * never executed. The full diagnosis is on `useDeactivateMembership`, which
9897
+ * carried an identical copy of the same dead machinery.
9898
+ */
9899
+ declare function useReactivateMembership(): _tanstack_react_query.UseMutationResult<MembershipWithDetails, Error, ReactivateMembershipMutationData, unknown>;
9752
9900
 
9753
9901
  type OrgRolDefinitionRow = Database['public']['Tables']['org_rol_definitions']['Row'];
9754
9902
  type OrgRole = OrgRolDefinitionRow & {
@@ -9771,7 +9919,18 @@ type RevokeRoleInput = {
9771
9919
  roleId: string;
9772
9920
  };
9773
9921
 
9774
- declare function useOrgRoles(orgId?: string): _tanstack_react_query.UseQueryResult<{
9922
+ /**
9923
+ * Roles for an organization, keyed on the **Supabase organization UUID**.
9924
+ *
9925
+ * `GET /organizations/:orgId/roles` compares the route param against
9926
+ * `getOrganizationId(request)` for a non-platform-admin caller, and that is
9927
+ * always the Supabase UUID (`requireMatchingOrganization` in
9928
+ * `role-management/handlers.ts`) -- the WorkOS `org_...` form 403s there.
9929
+ * Defaults to the caller's currently selected organization (read via
9930
+ * `OrganizationContext` rather than the throwing `useOrganization()` hook,
9931
+ * so this still works in trees that only mount `ElevasisServiceProvider`).
9932
+ */
9933
+ declare function useOrgRoles(orgId?: SupabaseOrgId): _tanstack_react_query.UseQueryResult<{
9775
9934
  roles: OrgRole[];
9776
9935
  }, Error>;
9777
9936
 
@@ -9779,19 +9938,34 @@ declare function usePermissionCatalog(): _tanstack_react_query.UseQueryResult<{
9779
9938
  permissions: PermissionDescriptor[];
9780
9939
  }, Error>;
9781
9940
 
9941
+ /**
9942
+ * Posts to `/organizations/:orgId/roles` using the **Supabase organization
9943
+ * UUID** -- see `useOrgRoles` for why the WorkOS form 403s here for a
9944
+ * non-platform-admin caller.
9945
+ */
9782
9946
  declare function useCreateOrgRole(): _tanstack_react_query.UseMutationResult<OrgRole, Error, CreateOrgRoleInput, unknown>;
9783
9947
 
9784
9948
  interface UpdateOrgRoleParams {
9785
9949
  roleId: string;
9786
9950
  input: UpdateOrgRoleInput;
9787
9951
  }
9952
+ /** Keyed on the Supabase organization UUID -- see `useOrgRoles`. */
9788
9953
  declare function useUpdateOrgRole(): _tanstack_react_query.UseMutationResult<OrgRole, Error, UpdateOrgRoleParams, unknown>;
9789
9954
 
9955
+ /** Keyed on the Supabase organization UUID -- see `useOrgRoles`. */
9790
9956
  declare function useDeleteOrgRole(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
9791
9957
 
9958
+ /**
9959
+ * Both mutations invalidate on the **Supabase organization UUID** -- the same
9960
+ * key space `useOrgRoles` and `useEffectivePermissions` read on. Previously
9961
+ * this invalidated `workOSOrganizationId`-keyed entries while `useOrgRoles`
9962
+ * callers such as `MemberAccessModal` read Supabase-UUID-keyed entries, so a
9963
+ * role change here never invalidated the cache the modal displayed.
9964
+ */
9792
9965
  declare function useAssignRole(): _tanstack_react_query.UseMutationResult<void, Error, AssignRoleInput, unknown>;
9793
9966
  declare function useRevokeRole(): _tanstack_react_query.UseMutationResult<void, Error, RevokeRoleInput, unknown>;
9794
9967
 
9968
+ /** Keyed on the Supabase organization UUID -- see `useAssignRole`/`useRevokeRole`. */
9795
9969
  declare function useEffectivePermissions(membershipId: string | undefined): _tanstack_react_query.UseQueryResult<{
9796
9970
  permissions: string[];
9797
9971
  }, Error>;
@@ -10082,8 +10256,8 @@ declare function useExecutionLogsFilters(_timeRange: TimeRange): {
10082
10256
  * Note: `organizationId` is passed as a parameter (not read from context)
10083
10257
  * so consumers can query for a specific organization independently.
10084
10258
  *
10085
- * @param organizationId - The organization to fetch members for
10086
- * @param params - Optional additional filters (reserved for future use)
10259
+ * @param organizationId - The Supabase organization UUID to fetch members for
10260
+ * @param params - Optional additional filters, forwarded to the API
10087
10261
  * @returns TanStack Query result with MembershipWithDetails array
10088
10262
  *
10089
10263
  * @example
@@ -10091,7 +10265,7 @@ declare function useExecutionLogsFilters(_timeRange: TimeRange): {
10091
10265
  * const { data: members, isLoading } = useOrganizationMembers(organizationId)
10092
10266
  * ```
10093
10267
  */
10094
- declare function useOrganizationMembers(organizationId: string, params?: Omit<ListMembershipsParams, 'organizationId'>): _tanstack_react_query.UseQueryResult<MembershipWithDetails[], Error>;
10268
+ declare function useOrganizationMembers(organizationId: SupabaseOrgId, params?: Omit<ListMembershipsParams, 'organizationId'>): _tanstack_react_query.UseQueryResult<MembershipWithDetails[], Error>;
10095
10269
 
10096
10270
  /**
10097
10271
  * Subscribe to the org-scoped delivery SSE stream.
@@ -1,27 +1,27 @@
1
- export { AccessKeys, ApiKeyService, CredentialService, DeploymentService, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, clientsKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, milestoneKeys, noteKeys, observabilityKeys, operationsKeys, projectActivityKeys, projectKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, taskKeys, useAccess, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useAddCompaniesToList, useAddContactsToList, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useClient, useClientStatus, useClients, useCommandQueue, useCommandQueueTask, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateClient, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateProject as useCreateDeliveryProject, useCreateList, useCreateMilestone, useCreateNote, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateTask, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteClient, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteProject as useDeleteDeliveryProject, useDeleteTask2 as useDeleteDeliveryTask, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteMilestone, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useEndSession, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useErrorTrends, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutionSSE, useExecutions, useGetExecutionHistory, useGetSchedule, useInFlightExecutions, useList, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListRecords, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useMilestones, useNotificationCount as useNotificationCountSSE, useNotifications, useOrgRoles, useOrganizationMembers, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProject, useProjectActivities, useProjectMilestones, useProjectNotes, useProjectRealtime, useProjectTasks, useProjects, useReactivateMembership, useRecentExecutionsByResource, useRemoveCompaniesFromList, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSubmitRequest, useSuccessNotification, useSystemHealth, useTableSelection, useTableSort, useTasks, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useTransitionState, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateClient, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateProject as useUpdateDeliveryProject, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateMilestone, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateTask, useUpdateWebhookEndpoint, useUserMemberships, useVerifyCredential, useVisibleResources, useWarningNotification, useWorkflowExecution } from '../chunk-PGAA4G3T.js';
1
+ export { AccessKeys, ApiKeyService, CredentialService, DeploymentService, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, clientsKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, milestoneKeys, noteKeys, observabilityKeys, operationsKeys, projectActivityKeys, projectKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, taskKeys, useAccess, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useAddCompaniesToList, useAddContactsToList, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useClient, useClientStatus, useClients, useCommandQueue, useCommandQueueTask, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateClient, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateProject as useCreateDeliveryProject, useCreateList, useCreateMilestone, useCreateNote, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateTask, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteClient, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteProject as useDeleteDeliveryProject, useDeleteTask2 as useDeleteDeliveryTask, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteMilestone, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useEndSession, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useErrorTrends, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutionSSE, useExecutions, useGetExecutionHistory, useGetSchedule, useInFlightExecutions, useList, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListRecords, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useMilestones, useNotificationCount as useNotificationCountSSE, useNotifications, useOrgRoles, useOrganizationMembers, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProject, useProjectActivities, useProjectMilestones, useProjectNotes, useProjectRealtime, useProjectTasks, useProjects, useReactivateMembership, useRecentExecutionsByResource, useRemoveCompaniesFromList, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSubmitRequest, useSuccessNotification, useSystemHealth, useTableSelection, useTableSort, useTasks, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useTransitionState, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateClient, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateProject as useUpdateDeliveryProject, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateMilestone, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateTask, useUpdateWebhookEndpoint, useUserMemberships, useVerifyCredential, useVisibleResources, useWarningNotification, useWorkflowExecution } from '../chunk-ANNM5R7S.js';
2
2
  import '../chunk-4OEVLV66.js';
3
3
  import '../chunk-RBGVNPA6.js';
4
- import '../chunk-ZTWA5H77.js';
4
+ import '../chunk-6ZAP3FOA.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
8
  import '../chunk-XNW3O6QW.js';
9
- import '../chunk-T4LA4RY2.js';
9
+ import '../chunk-L7BZZ4SI.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-62GVNH5U.js';
12
- import '../chunk-LO7GWG24.js';
12
+ import '../chunk-P45GQ3ZW.js';
13
13
  import '../chunk-DD3CCMCZ.js';
14
14
  export { mergeSessionMessages } from '../chunk-M7WWRZ5Z.js';
15
15
  import '../chunk-JFBZ6XDW.js';
16
16
  import '../chunk-2IFYDILW.js';
17
17
  import '../chunk-Q7DJKLEN.js';
18
18
  import '../chunk-HENXLGVD.js';
19
- export { useMergedExecution } from '../chunk-I3CFGE3N.js';
19
+ export { useMergedExecution } from '../chunk-BLXJEIQS.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
- import '../chunk-EIXSQONC.js';
21
+ import '../chunk-RT4KRGZT.js';
22
22
  import '../chunk-I7BZVVVU.js';
23
- export { REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY } from '../chunk-FVOMKZ7S.js';
24
- import '../chunk-KRWALB24.js';
23
+ export { REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY } from '../chunk-Y6I3IC45.js';
24
+ import '../chunk-6SSQGWK7.js';
25
25
  import '../chunk-BI5VDO2K.js';
26
26
  import '../chunk-MQZE7SUI.js';
27
27
  import '../chunk-TVTSASST.js';
@@ -694,7 +694,6 @@ interface CommandViewAgent extends ResourceDefinition {
694
694
  modelProvider: string;
695
695
  modelId: string;
696
696
  toolCount: number;
697
- hasKnowledgeMap: boolean;
698
697
  hasMemory: boolean;
699
698
  sessionCapable: boolean;
700
699
  }
@@ -787,7 +786,6 @@ interface AgentNode extends BaseResourceNode {
787
786
  modelProvider: string;
788
787
  modelId: string;
789
788
  toolCount: number;
790
- hasKnowledgeMap: boolean;
791
789
  hasMemory: boolean;
792
790
  }
793
791
  /**