@elevasis/ui 2.64.1 → 2.65.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 (58) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.d.ts +20 -0
  3. package/dist/app/index.js +4 -4
  4. package/dist/auth/index.js +4 -4
  5. package/dist/charts/index.js +4 -4
  6. package/dist/{chunk-PGAA4G3T.js → chunk-3WVZRN37.js} +40 -17
  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-I3CFGE3N.js → chunk-BLXJEIQS.js} +1 -1
  10. package/dist/{chunk-FVOMKZ7S.js → chunk-Y6I3IC45.js} +3 -6
  11. package/dist/components/index.d.ts +52 -0
  12. package/dist/components/index.js +4 -4
  13. package/dist/components/navigation/index.js +4 -4
  14. package/dist/execution/index.js +2 -2
  15. package/dist/features/auth/index.d.ts +87 -2
  16. package/dist/features/auth/index.js +142 -7
  17. package/dist/features/clients/index.js +4 -4
  18. package/dist/features/crm/index.d.ts +20 -0
  19. package/dist/features/crm/index.js +4 -4
  20. package/dist/features/dashboard/index.js +4 -4
  21. package/dist/features/delivery/index.d.ts +20 -0
  22. package/dist/features/delivery/index.js +4 -4
  23. package/dist/features/knowledge/index.js +4 -4
  24. package/dist/features/lead-gen/index.js +4 -4
  25. package/dist/features/monitoring/index.js +4 -4
  26. package/dist/features/monitoring/requests/index.js +5 -5
  27. package/dist/features/operations/index.d.ts +36 -1
  28. package/dist/features/operations/index.js +4 -4
  29. package/dist/features/public-agent-chat/index.js +1 -1
  30. package/dist/features/settings/index.d.ts +20 -0
  31. package/dist/features/settings/index.js +4 -4
  32. package/dist/hooks/access/index.js +4 -4
  33. package/dist/hooks/delivery/index.d.ts +20 -0
  34. package/dist/hooks/delivery/index.js +4 -4
  35. package/dist/hooks/index.d.ts +53 -1
  36. package/dist/hooks/index.js +4 -4
  37. package/dist/hooks/published.d.ts +53 -1
  38. package/dist/hooks/published.js +4 -4
  39. package/dist/index.d.ts +53 -1
  40. package/dist/index.js +4 -4
  41. package/dist/initialization/index.d.ts +34 -0
  42. package/dist/knowledge/index.js +5 -5
  43. package/dist/layout/index.js +4 -4
  44. package/dist/organization/index.d.ts +14 -0
  45. package/dist/organization/index.js +4 -4
  46. package/dist/profile/index.d.ts +20 -0
  47. package/dist/provider/index.d.ts +20 -0
  48. package/dist/provider/index.js +4 -4
  49. package/dist/provider/published.d.ts +20 -0
  50. package/dist/provider/published.js +4 -4
  51. package/dist/supabase/index.d.ts +40 -0
  52. package/dist/test-utils/index.d.ts +5 -0
  53. package/dist/test-utils/index.js +4 -4
  54. package/dist/test-utils/setup-integration.js +1 -1
  55. package/dist/test-utils/setup.js +1 -1
  56. package/dist/types/index.d.ts +180 -0
  57. package/dist/utils/index.js +2 -2
  58. package/package.json +6 -4
@@ -411,6 +411,15 @@ interface ModelConfig {
411
411
  modelOptions?: ModelSpecificOptions;
412
412
  }
413
413
 
414
+ /**
415
+ * What happened to `strict` on a request, recorded per call rather than inferred.
416
+ *
417
+ * `applied` and `notAttempted` are the two states that a refusal-only field cannot tell apart —
418
+ * both leave `strictRefusalReasons` empty. Recording the verdict positively is what makes "was
419
+ * this agent's output actually enforced?" answerable from an `ai_calls` row.
420
+ */
421
+ type StrictStatus = 'applied' | 'refused' | 'compileRejected' | 'notAttempted';
422
+
414
423
  declare const ResourceGovernanceStatusSchema: z.ZodEnum<{
415
424
  active: "active";
416
425
  deprecated: "deprecated";
@@ -723,6 +732,14 @@ interface WorkflowNodeVisualizerData {
723
732
  * Memory types mirror action types for clarity and filtering
724
733
  */
725
734
  type MemoryEntryType = 'context' | 'input' | 'reasoning' | 'tool-result' | 'delegation-result' | 'error';
735
+ /**
736
+ * Who authored an entry's content.
737
+ *
738
+ * This is what lets the assembled prompt tell framework-authored text apart from text that
739
+ * originated outside the trust boundary. `'framework'` content is ours; the other three are not
740
+ * and are rendered inside the JSON data envelope (see `MemoryManager.toContextParts`).
741
+ */
742
+ type MemoryEntrySource = 'framework' | 'user' | 'tool' | 'model';
726
743
  /**
727
744
  * Memory entry - represents a single entry in agent memory
728
745
  * Stored in agent memory, translated by adapters to vendor-specific formats
@@ -733,6 +750,16 @@ interface MemoryEntry {
733
750
  timestamp: number;
734
751
  turnNumber: number | null;
735
752
  iterationNumber: number | null;
753
+ /**
754
+ * Provenance. **Optional on purpose** — `undefined` means unknown, which is what every
755
+ * pre-existing snapshot and every not-yet-redeployed tenant bundle produces. Read sites MUST
756
+ * test `== null`, never `=== undefined`: the `inTurnScope` predicate in `manager.ts` is the
757
+ * cautionary precedent, where a `=== undefined` check silently dropped every `null`-stamped
758
+ * entry. `isMemoryEntry` is deliberately NOT tightened to require this field; doing so would
759
+ * make every stored snapshot fail validation, and `restoreSessionMemory` fails open by
760
+ * starting the agent with empty memory rather than throwing.
761
+ */
762
+ source?: MemoryEntrySource;
736
763
  }
737
764
  /**
738
765
  * Agent memory - Self-orchestrated memory with session + working storage
@@ -3554,6 +3581,7 @@ type Database = {
3554
3581
  deleted_at: string | null;
3555
3582
  ended_at: string | null;
3556
3583
  memory_snapshot: Json;
3584
+ memory_version: number;
3557
3585
  metadata: Json | null;
3558
3586
  organization_id: string;
3559
3587
  resource_id: string;
@@ -3570,6 +3598,7 @@ type Database = {
3570
3598
  deleted_at?: string | null;
3571
3599
  ended_at?: string | null;
3572
3600
  memory_snapshot: Json;
3601
+ memory_version?: number;
3573
3602
  metadata?: Json | null;
3574
3603
  organization_id: string;
3575
3604
  resource_id: string;
@@ -3586,6 +3615,7 @@ type Database = {
3586
3615
  deleted_at?: string | null;
3587
3616
  ended_at?: string | null;
3588
3617
  memory_snapshot?: Json;
3618
+ memory_version?: number;
3589
3619
  metadata?: Json | null;
3590
3620
  organization_id?: string;
3591
3621
  resource_id?: string;
@@ -3923,9 +3953,14 @@ type Database = {
3923
3953
  p_session_id: string;
3924
3954
  };
3925
3955
  Returns: {
3956
+ context_window_size: number;
3926
3957
  created_at: string;
3958
+ cumulative_input_tokens: number;
3959
+ cumulative_output_tokens: number;
3960
+ deleted_at: string;
3927
3961
  ended_at: string;
3928
3962
  memory_snapshot: Json;
3963
+ memory_version: number;
3929
3964
  metadata: Json;
3930
3965
  organization_id: string;
3931
3966
  resource_id: string;
@@ -3967,6 +4002,18 @@ type Database = {
3967
4002
  };
3968
4003
  Returns: boolean;
3969
4004
  };
4005
+ increment_session_tokens: {
4006
+ Args: {
4007
+ p_input_tokens: number;
4008
+ p_output_tokens: number;
4009
+ p_session_id: string;
4010
+ };
4011
+ Returns: {
4012
+ context_window_size: number;
4013
+ cumulative_input_tokens: number;
4014
+ cumulative_output_tokens: number;
4015
+ }[];
4016
+ };
3970
4017
  is_org_member: {
3971
4018
  Args: {
3972
4019
  org_id: string;
@@ -4627,10 +4674,24 @@ interface ListMembershipsParams {
4627
4674
  after?: string;
4628
4675
  order?: 'asc' | 'desc';
4629
4676
  }
4677
+ /**
4678
+ * How a membership row relates to the two systems that describe it.
4679
+ *
4680
+ * - `linked` — an `org_memberships` row that carries a `workos_membership_id`
4681
+ * - `pre_provisioned` — an `org_memberships` row with no `workos_membership_id`;
4682
+ * the invitee was provisioned but has not completed signup
4683
+ * - `workos_only` — a WorkOS membership with no `org_memberships` row (a sync gap)
4684
+ */
4685
+ type MembershipProvisioningState = 'linked' | 'pre_provisioned' | 'workos_only';
4630
4686
  /**
4631
4687
  * Extended membership with user and organization details for UI
4632
4688
  */
4633
4689
  interface MembershipWithDetails extends OrganizationMembership {
4690
+ /**
4691
+ * Set by `GET /memberships`. Optional so existing consumers are unaffected;
4692
+ * treat `undefined` as "not reported by this endpoint".
4693
+ */
4694
+ provisioningState?: MembershipProvisioningState;
4634
4695
  user?: {
4635
4696
  id: string;
4636
4697
  email: string;
@@ -4678,6 +4739,25 @@ interface OAuthState {
4678
4739
  provider: string;
4679
4740
  }
4680
4741
 
4742
+ /**
4743
+ * Which `role:'user'` message slot a sanitizer warning came from, derived from the request's
4744
+ * message array (no new plumbing from callers):
4745
+ * - `'memory-context'` — the framework's framing message, identified by the `=== MEMORY STATUS ===`
4746
+ * banner. Framework-authored and trusted; it is no longer scanned at all, so this source should
4747
+ * not appear for agent calls. Retained because stale tenant bundles still emit the old combined
4748
+ * block, and their rows must stay readable.
4749
+ * - `'data-envelope'` — the JSON envelope carrying every stored fragment. Untrusted, and the slot
4750
+ * where a match is genuine signal.
4751
+ * - `'input'` — the turn's own input, on its own message. Also untrusted.
4752
+ * - `'history'` — replayed prior turns. Untrusted, but already screened at their own front door,
4753
+ * so warnings here are recorded and never block (see `screenInput`).
4754
+ */
4755
+ type InputWarningSource = 'memory-context' | 'data-envelope' | 'history' | 'input';
4756
+ /** Per-source breakdown of sanitizer warnings, so a memory-context echo is distinguishable from a genuine hit. */
4757
+ interface SourcedInputWarnings {
4758
+ source: InputWarningSource;
4759
+ warnings: string[];
4760
+ }
4681
4761
  interface BaseAICall {
4682
4762
  callSequence: number;
4683
4763
  callType: 'agent-reasoning' | 'agent-completion' | 'workflow-step' | 'tool' | 'other';
@@ -4687,6 +4767,106 @@ interface BaseAICall {
4687
4767
  costUsd: number;
4688
4768
  latencyMs: number;
4689
4769
  context?: AICallContext;
4770
+ /**
4771
+ * Distinct prompt-injection pattern types detected in the request's user-role messages.
4772
+ * Present only when the input sanitizer matched something. Non-blocking matches ride along on
4773
+ * the successful call's row; a blocked call records a row of its own (see `inputBlocked`).
4774
+ *
4775
+ * Flat union across all `role:'user'` messages — unchanged shape, kept for existing readers.
4776
+ * See `inputWarningsBySource` for the per-slot breakdown.
4777
+ */
4778
+ inputWarnings?: string[];
4779
+ /**
4780
+ * Additive breakdown of `inputWarnings` by message slot (see `InputWarningSource`). Present only
4781
+ * when at least one source produced a warning. Existing readers that only look at the flat
4782
+ * `inputWarnings` array are unaffected.
4783
+ */
4784
+ inputWarningsBySource?: SourcedInputWarnings[];
4785
+ /**
4786
+ * True when the sanitizer blocked the request and no provider call was made.
4787
+ * Such a row carries zero tokens, zero cost, and zero latency — it exists so a hard,
4788
+ * user-visible failure is observable at all. Before this, a blocked call produced no row.
4789
+ */
4790
+ inputBlocked?: boolean;
4791
+ /**
4792
+ * The validator's message when the provider responded but its output failed `responseSchema`
4793
+ * validation (e.g. `missing required field 'nextActions'`). Present only on such a row.
4794
+ *
4795
+ * This is NOT the blocked-input case: the provider DID respond and tokens WERE spent, so the row
4796
+ * carries real `inputTokens`, `outputTokens`, cost and latency. It is a paid call that produced
4797
+ * nothing usable, and before this it produced no row at all.
4798
+ *
4799
+ * One row per failed attempt — the adapter retries a validation failure up to `LLM_MAX_ATTEMPTS`,
4800
+ * so a turn that exhausts its retries records three. Reading `inputTokens` across these rows is
4801
+ * what measures malformed-output rate against context size rather than inferring it.
4802
+ *
4803
+ * Existing readers that only look at the fields above are unaffected.
4804
+ */
4805
+ outputValidationError?: string;
4806
+ /**
4807
+ * The raw model output that failed validation, JSON-stringified and truncated to a bounded
4808
+ * length. Truncation is visible in the value itself (a trailing `…[truncated: N chars total]`),
4809
+ * never silent. Present only alongside `outputValidationError`.
4810
+ */
4811
+ unvalidatedOutput?: string;
4812
+ /**
4813
+ * What happened to `strict` structured output on this call — `applied`, `refused`,
4814
+ * `compileRejected`, or `notAttempted`. Every server adapter sets it, so this is the field that
4815
+ * answers "is this agent's output actually being enforced?" without reading source.
4816
+ *
4817
+ * It replaces an inference that turned out to be unsound. `strictRefusalReasons` alone records
4818
+ * only refusals, so an empty row meant "strict held" OR "this adapter never tries" — and a prod
4819
+ * run recorded zero refusals while a call returned an array-typed field as a string, which a
4820
+ * grammar makes impossible. The absence proved nothing, because the deployed API had no way to
4821
+ * write the field at all.
4822
+ *
4823
+ * Absent on rows written before this field existed; that absence is itself diagnostic (the API
4824
+ * predates the change). Existing readers that only look at the fields above are unaffected.
4825
+ */
4826
+ strictStatus?: StrictStatus;
4827
+ /**
4828
+ * Why this call went out without `strict`, when a strict-capable adapter refused the schema. The
4829
+ * detail behind `strictStatus: 'refused' | 'compileRejected'` — read `strictStatus` for whether
4830
+ * it was enforced, this for why not.
4831
+ *
4832
+ * Existing readers that only look at the fields above are unaffected.
4833
+ */
4834
+ strictRefusalReasons?: string[];
4835
+ /**
4836
+ * Time spent in the base adapter's `generate()` call alone, excluding `responseSchema`
4837
+ * validation. On a success or validation-failure row, `providerMs + validateMs === latencyMs`
4838
+ * (modulo rounding) -- `latencyMs` keeps its existing meaning unchanged; this and `validateMs`
4839
+ * are the same window split into its two components.
4840
+ *
4841
+ * Present on success and validation-failure rows. Absent on a blocked row (no provider call was
4842
+ * made) and on rows written before this field existed.
4843
+ */
4844
+ providerMs?: number;
4845
+ /**
4846
+ * Time spent in `validateResponseSchema` alone. Omitted when the call carried no `responseSchema`
4847
+ * (nothing to validate); `0` is a legitimate value meaning a schema was supplied and validation
4848
+ * was effectively instant. See `providerMs` for how the two relate to `latencyMs`.
4849
+ *
4850
+ * Present on success and validation-failure rows that supplied a `responseSchema`. Absent on a
4851
+ * blocked row and on rows written before this field existed.
4852
+ */
4853
+ validateMs?: number;
4854
+ /**
4855
+ * Total elapsed time for the WHOLE `generate()` call -- every retry attempt plus every backoff
4856
+ * sleep between them. Unlike `latencyMs` (which is per-attempt and never includes backoff, by
4857
+ * design -- see `runWithRetry`), this is the one number that answers "how long did the caller
4858
+ * actually wait". On a call that never retried, `wallClockMs === latencyMs`. On a retried call,
4859
+ * `wallClockMs` is strictly greater than any individual row's `latencyMs` from that same call, by
4860
+ * at least the backoff time actually slept.
4861
+ *
4862
+ * The same value is attached to every row produced by one `generate()` call (a validation-failure
4863
+ * row from an earlier attempt included), because it describes the call, not the attempt.
4864
+ *
4865
+ * Present on success and validation-failure rows. Absent on a blocked row -- a blocked call never
4866
+ * reaches the retry loop, so `wallClockMs` would just restate `latencyMs` (0). Absent on rows
4867
+ * written before this field existed.
4868
+ */
4869
+ wallClockMs?: number;
4690
4870
  }
4691
4871
  type AICallContext = AgentReasoningContext | AgentCompletionContext | WorkflowStepContext | ToolCallContext | OtherCallContext;
4692
4872
  interface AgentReasoningContext {
@@ -1,5 +1,5 @@
1
1
  export { APIClientError, API_URL, DEBOUNCE_FILTER, DEBOUNCE_SLIDER, GC_TIME_LONG, GC_TIME_MEDIUM, GC_TIME_SHORT, LIMIT_ACTIVITY_FEED, OAUTH_FLOW_TIMEOUT, PAGE_SIZE_DEFAULT, STALE_TIME_ADMIN, STALE_TIME_DEFAULT, STALE_TIME_MONITORING, formatChartAxisDate, formatDate, formatDateTime, formatErrorMessage, formatRelativeTime, formatTimeAgo, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, isAPIClientError, restoreConsole, setupBrowserMocks, suppressKnownWarnings, validateEmail } from '../chunk-I7BZVVVU.js';
2
- export { REFETCH_INTERVAL_DASHBOARD, REFETCH_INTERVAL_REALTIME, REFETCH_INTERVAL_RUNNING, REFETCH_INTERVAL_RUNNING_FAST, SSE_CLOSE_GRACE_PERIOD, SSE_TOKEN_REFRESH_DELAY, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, debounce, getTimeRangeDates, getTimeRangeLabel } from '../chunk-FVOMKZ7S.js';
3
- export { ResourceStatusColors } from '../chunk-KRWALB24.js';
2
+ export { REFETCH_INTERVAL_DASHBOARD, REFETCH_INTERVAL_REALTIME, REFETCH_INTERVAL_RUNNING, REFETCH_INTERVAL_RUNNING_FAST, SSE_CLOSE_GRACE_PERIOD, SSE_TOKEN_REFRESH_DELAY, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, debounce, getTimeRangeDates, getTimeRangeLabel } from '../chunk-Y6I3IC45.js';
3
+ export { ResourceStatusColors } from '../chunk-6SSQGWK7.js';
4
4
  import '../chunk-TVTSASST.js';
5
5
  import '../chunk-I2KLQ2HA.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "2.64.1",
3
+ "version": "2.65.0",
4
4
  "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -224,6 +224,8 @@
224
224
  "@elevasis/sdk": "^1.16.0",
225
225
  "react": "^19.2.0",
226
226
  "react-dom": "^19.2.0",
227
+ "@supabase/supabase-js": "^2.49.4",
228
+ "@workos-inc/authkit-react": "^0.11.0",
227
229
  "@tanstack/react-query": "^5.76.2",
228
230
  "@tanstack/react-router": "^1.131.28",
229
231
  "zod": "^4.1.0",
@@ -274,8 +276,8 @@
274
276
  "typescript": "5.9.2",
275
277
  "vite": "^7.0.0",
276
278
  "vitest": "^3.2.4",
277
- "@elevasis/sdk": "1.39.0",
278
- "@repo/core": "0.56.0",
279
+ "@repo/core": "0.58.0",
280
+ "@elevasis/sdk": "1.42.0",
279
281
  "@repo/elevasis-core": "1.0.0",
280
282
  "@repo/typescript-config": "0.0.0",
281
283
  "@repo/eslint-config": "0.0.0"
@@ -355,7 +357,7 @@
355
357
  "lint": "eslint src --max-warnings 0",
356
358
  "check-types": "tsc --noEmit",
357
359
  "test": "vitest run --passWithNoTests",
358
- "test:publish-artifacts": "pnpm build:publish && vitest run src/__tests__/sdk-exports.test.ts src/provider/__tests__/published-surface.test.ts src/__tests__/published-artifact.test.ts",
360
+ "test:publish-artifacts": "pnpm build:publish && vitest run src/__tests__/sdk-exports.test.ts src/provider/__tests__/published-surface.test.ts src/__tests__/published-artifact.test.ts src/__tests__/published-peer-dependencies.test.ts",
359
361
  "test:watch": "vitest watch"
360
362
  }
361
363
  }