@lessly/sdk-app 75.0.0 → 76.0.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.
@@ -71146,7 +71146,13 @@ export type BrainClickupSpacesListOutput = {
71146
71146
  export interface BrainCognitionDigestInput {
71147
71147
  }
71148
71148
  export interface BrainCognitionDigestOutput {
71149
+ /**
71150
+ * Id of the queued run. The completion event carries the same `run_id`, which is how a waiting step ties the event back to this call; brain_cognition_status reports the same run.
71151
+ */
71149
71152
  run_id: string;
71153
+ /**
71154
+ * Always true — the run was queued. The call fails outright rather than reporting a false here.
71155
+ */
71150
71156
  accepted: true;
71151
71157
  }
71152
71158
  export interface BrainCognitionStatusInput {
@@ -71179,7 +71185,13 @@ export interface BrainCognitionStatusOutput {
71179
71185
  export interface BrainCognitionSweepInput {
71180
71186
  }
71181
71187
  export interface BrainCognitionSweepOutput {
71188
+ /**
71189
+ * Id of the queued run. The completion event carries the same `run_id`, which is how a waiting step ties the event back to this call; brain_cognition_status reports the same run.
71190
+ */
71182
71191
  run_id: string;
71192
+ /**
71193
+ * Always true — the run was queued. The call fails outright rather than reporting a false here.
71194
+ */
71183
71195
  accepted: true;
71184
71196
  }
71185
71197
  export interface BrainConnectorBranchesListInput {
@@ -71209,6 +71221,9 @@ export type BrainConnectorReposListOutput = {
71209
71221
  defaultBranch: string;
71210
71222
  }[];
71211
71223
  export interface BrainDaemonBatchStatusInput {
71224
+ /**
71225
+ * Id of the ingestion daemon to act on, as returned by brain_daemons_list
71226
+ */
71212
71227
  id: string;
71213
71228
  }
71214
71229
  export interface BrainDaemonBatchStatusOutput {
@@ -71292,6 +71307,9 @@ export interface BrainDaemonCreateOutput {
71292
71307
  unmeasuredCount: number;
71293
71308
  }
71294
71309
  export interface BrainDaemonGetInput {
71310
+ /**
71311
+ * Id of the ingestion daemon to act on, as returned by brain_daemons_list
71312
+ */
71295
71313
  id: string;
71296
71314
  }
71297
71315
  export interface BrainDaemonGetOutput {
@@ -71315,52 +71333,154 @@ export interface BrainDaemonGetOutput {
71315
71333
  unmeasuredCount: number;
71316
71334
  }
71317
71335
  export interface BrainDaemonReingestInput {
71336
+ /**
71337
+ * Id of the ingestion daemon that owns these documents, as returned by brain_daemons_list
71338
+ */
71318
71339
  id: string;
71319
71340
  /**
71341
+ * Source paths to re-ingest, exactly as the daemon recorded them (a repo path such as docs/spec.md, a Drive file id, a ClickUp item id). 1-100 per call.
71342
+ *
71320
71343
  * @minItems 1
71321
71344
  * @maxItems 100
71322
71345
  */
71323
71346
  paths: [string, ...(string)[]];
71324
71347
  }
71325
71348
  export interface BrainDaemonReingestOutput {
71349
+ /**
71350
+ * The run started to pick the cleared paths up — brain/daemon.run-completed for this id is what finishes the step. Null when no run was started (see triggered/triggerError).
71351
+ */
71352
+ runId: (string | null);
71353
+ /**
71354
+ * Paths whose ingest state was cleared, so the next run will read them again from scratch
71355
+ */
71326
71356
  cleared: string[];
71357
+ /**
71358
+ * Paths this daemon has no ingest record for — usually a typo, or a document it never ingested
71359
+ */
71327
71360
  notFound: string[];
71361
+ /**
71362
+ * True when a run was started to pick the cleared paths up; false when the daemon is paused, a run is already in flight, or nothing was eligible
71363
+ */
71328
71364
  triggered: boolean;
71365
+ /**
71366
+ * Why no run was started; absent when one was
71367
+ */
71329
71368
  triggerError?: string;
71369
+ /**
71370
+ * Paths left alone because they are in an unfinished batch; re-ask once that run has finished
71371
+ */
71330
71372
  skippedPending: string[];
71331
71373
  }
71332
71374
  export interface BrainDaemonRemoveInput {
71375
+ /**
71376
+ * Id of the ingestion daemon to act on, as returned by brain_daemons_list
71377
+ */
71333
71378
  id: string;
71334
71379
  }
71335
71380
  export interface BrainDaemonRemoveOutput {
71336
71381
  ok: true;
71337
71382
  }
71338
71383
  export interface BrainDaemonRunInput {
71384
+ /**
71385
+ * Id of the ingestion daemon to act on, as returned by brain_daemons_list
71386
+ */
71339
71387
  id: string;
71340
71388
  }
71341
71389
  export interface BrainDaemonRunOutput {
71390
+ /**
71391
+ * True once the run has finished, whether it succeeded or failed
71392
+ */
71342
71393
  done: boolean;
71394
+ /**
71395
+ * Id of the run being reported; null when this daemon has never run
71396
+ */
71343
71397
  runId: (string | null);
71398
+ /**
71399
+ * Where the run stands: 'queued' waiting to start, 'running' in progress, 'done' finished, 'failed' gave up, 'none' this daemon has never run
71400
+ */
71344
71401
  status: ("queued" | "running" | "done" | "failed" | "none");
71402
+ /**
71403
+ * Per-source progress as the connector reported it; the shape differs by connector type and is meant for display, not for binding a step to
71404
+ */
71345
71405
  sources: unknown[];
71406
+ /**
71407
+ * Document counts for the run; null when nothing has been counted yet
71408
+ */
71346
71409
  progress: ({
71347
- counts: BrainDaemonRunOutputCounts;
71410
+ /**
71411
+ * Totals for the whole run
71412
+ */
71413
+ counts: {
71414
+ /**
71415
+ * Documents that failed after retries — transient failures, worth re-running
71416
+ */
71417
+ error: number;
71418
+ /**
71419
+ * Documents the source permanently refused (403/404/401) — a permissions or deletion problem, not a transient one
71420
+ */
71421
+ denied: number;
71422
+ /**
71423
+ * Of those, how many were downloaded
71424
+ */
71425
+ fetched: number;
71426
+ /**
71427
+ * Of those, how many became memories
71428
+ */
71429
+ ingested: number;
71430
+ /**
71431
+ * Documents the run found at the source
71432
+ */
71433
+ discovered: number;
71434
+ /**
71435
+ * Documents skipped because their content had not changed since the last run
71436
+ */
71437
+ skippedUnchanged: number;
71438
+ };
71439
+ /**
71440
+ * The same totals split by source category; the keys are the connector's own (github: markdown/issues/pulls, clickup: tasks/comments/docs/chat, gdrive: files)
71441
+ */
71348
71442
  byCategory: {
71349
- [k: string]: BrainDaemonRunOutputCounts;
71443
+ [k: string]: {
71444
+ /**
71445
+ * Documents that failed after retries — transient failures, worth re-running
71446
+ */
71447
+ error: number;
71448
+ /**
71449
+ * Documents the source permanently refused (403/404/401) — a permissions or deletion problem, not a transient one
71450
+ */
71451
+ denied: number;
71452
+ /**
71453
+ * Of those, how many were downloaded
71454
+ */
71455
+ fetched: number;
71456
+ /**
71457
+ * Of those, how many became memories
71458
+ */
71459
+ ingested: number;
71460
+ /**
71461
+ * Documents the run found at the source
71462
+ */
71463
+ discovered: number;
71464
+ /**
71465
+ * Documents skipped because their content had not changed since the last run
71466
+ */
71467
+ skippedUnchanged: number;
71468
+ };
71350
71469
  };
71351
71470
  } | null);
71471
+ /**
71472
+ * Which lane the run went to: 'realtime' finishes in minutes, 'batch' queues the work with the model provider and can take hours
71473
+ */
71352
71474
  routedTo: ("realtime" | "batch");
71475
+ /**
71476
+ * True when this call actually started a run; false when one was already in flight and nothing new was started
71477
+ */
71353
71478
  triggered: boolean;
71479
+ /**
71480
+ * Why the run could not be started; absent when it was started
71481
+ */
71354
71482
  triggerError?: string;
71355
71483
  }
71356
- export interface BrainDaemonRunOutputCounts {
71357
- error: number;
71358
- denied: number;
71359
- fetched: number;
71360
- ingested: number;
71361
- discovered: number;
71362
- skippedUnchanged: number;
71363
- }
71364
71484
  export interface BrainDaemonRunItemsInput {
71365
71485
  limit?: number;
71366
71486
  runId: string;
@@ -71378,64 +71498,208 @@ export interface BrainDaemonRunItemsOutput {
71378
71498
  }[];
71379
71499
  runId: string;
71380
71500
  counts: {
71501
+ /**
71502
+ * Documents that failed after retries — transient failures, worth re-running
71503
+ */
71381
71504
  error: number;
71505
+ /**
71506
+ * Documents the source permanently refused (403/404/401) — a permissions or deletion problem, not a transient one
71507
+ */
71382
71508
  denied: number;
71509
+ /**
71510
+ * Of those, how many were downloaded
71511
+ */
71383
71512
  fetched: number;
71513
+ /**
71514
+ * Of those, how many became memories
71515
+ */
71384
71516
  ingested: number;
71517
+ /**
71518
+ * Documents the run found at the source
71519
+ */
71385
71520
  discovered: number;
71521
+ /**
71522
+ * Documents skipped because their content had not changed since the last run
71523
+ */
71386
71524
  skippedUnchanged: number;
71387
71525
  };
71388
71526
  nextCursor: (string | null);
71389
71527
  }
71390
71528
  export interface BrainDaemonRunsInput {
71529
+ /**
71530
+ * Id of the ingestion daemon whose run history to read, as returned by brain_daemons_list
71531
+ */
71391
71532
  id: string;
71533
+ /**
71534
+ * How many of the most recent runs to return (default 20, max 100)
71535
+ */
71392
71536
  limit?: number;
71393
71537
  }
71394
71538
  export interface BrainDaemonRunsOutput {
71539
+ /**
71540
+ * The most recent runs, newest first
71541
+ */
71395
71542
  runs: {
71543
+ /**
71544
+ * How the run was carried out: 'realtime' inline, 'batch' through the model provider's batch queue, 'reclaimed' a stalled run closed out by the janitor
71545
+ */
71396
71546
  lane: ("realtime" | "batch" | "reclaimed");
71547
+ /**
71548
+ * Id of this run
71549
+ */
71397
71550
  runId: string;
71551
+ /**
71552
+ * Document counts for this run
71553
+ */
71398
71554
  counts: {
71555
+ /**
71556
+ * Documents that failed after retries — transient failures, worth re-running
71557
+ */
71399
71558
  error: number;
71559
+ /**
71560
+ * Documents the source permanently refused (403/404/401) — a permissions or deletion problem, not a transient one
71561
+ */
71400
71562
  denied: number;
71563
+ /**
71564
+ * Of those, how many were downloaded
71565
+ */
71401
71566
  fetched: number;
71567
+ /**
71568
+ * Of those, how many became memories
71569
+ */
71402
71570
  ingested: number;
71571
+ /**
71572
+ * Documents the run found at the source
71573
+ */
71403
71574
  discovered: number;
71575
+ /**
71576
+ * Documents skipped because their content had not changed since the last run
71577
+ */
71404
71578
  skippedUnchanged: number;
71405
71579
  };
71580
+ /**
71581
+ * Where the run ended up — 'queued', 'running', 'done' or 'failed'
71582
+ */
71406
71583
  status: string;
71584
+ /**
71585
+ * How a batch run finished, in the batch pipeline's own words (e.g. finalized, timeout, crash); null for a realtime run
71586
+ */
71407
71587
  outcome: (string | null);
71588
+ /**
71589
+ * When the run started, ISO 8601 timestamp
71590
+ */
71408
71591
  startedAt: string;
71592
+ /**
71593
+ * Documents that failed after retries during this run
71594
+ */
71409
71595
  errorCount: number;
71596
+ /**
71597
+ * When the run finished, ISO 8601 timestamp; null while it is still going
71598
+ */
71410
71599
  finishedAt: (string | null);
71600
+ /**
71601
+ * Documents the source permanently refused during this run
71602
+ */
71411
71603
  deniedCount: number;
71604
+ /**
71605
+ * Documents stored as raw text because the extraction step failed — NULL MEANS NOT MEASURED, never "clean": only realtime runs measure this, so every batch and reclaimed run reports null
71606
+ */
71412
71607
  degradedCount: (number | null);
71413
71608
  }[];
71609
+ /**
71610
+ * Id of the daemon these runs belong to
71611
+ */
71414
71612
  daemonId: string;
71415
71613
  }
71416
71614
  export interface BrainDaemonStatusInput {
71615
+ /**
71616
+ * Id of the ingestion daemon to act on, as returned by brain_daemons_list
71617
+ */
71417
71618
  id: string;
71418
71619
  }
71419
71620
  export interface BrainDaemonStatusOutput {
71621
+ /**
71622
+ * True once the run has finished, whether it succeeded or failed
71623
+ */
71420
71624
  done: boolean;
71625
+ /**
71626
+ * Id of the run being reported; null when this daemon has never run
71627
+ */
71421
71628
  runId: (string | null);
71629
+ /**
71630
+ * Where the run stands: 'queued' waiting to start, 'running' in progress, 'done' finished, 'failed' gave up, 'none' this daemon has never run
71631
+ */
71422
71632
  status: ("queued" | "running" | "done" | "failed" | "none");
71633
+ /**
71634
+ * Per-source progress as the connector reported it; the shape differs by connector type and is meant for display, not for binding a step to
71635
+ */
71423
71636
  sources: unknown[];
71637
+ /**
71638
+ * Document counts for the run; null when nothing has been counted yet
71639
+ */
71424
71640
  progress: ({
71425
- counts: BrainDaemonStatusOutputCounts;
71641
+ /**
71642
+ * Totals for the whole run
71643
+ */
71644
+ counts: {
71645
+ /**
71646
+ * Documents that failed after retries — transient failures, worth re-running
71647
+ */
71648
+ error: number;
71649
+ /**
71650
+ * Documents the source permanently refused (403/404/401) — a permissions or deletion problem, not a transient one
71651
+ */
71652
+ denied: number;
71653
+ /**
71654
+ * Of those, how many were downloaded
71655
+ */
71656
+ fetched: number;
71657
+ /**
71658
+ * Of those, how many became memories
71659
+ */
71660
+ ingested: number;
71661
+ /**
71662
+ * Documents the run found at the source
71663
+ */
71664
+ discovered: number;
71665
+ /**
71666
+ * Documents skipped because their content had not changed since the last run
71667
+ */
71668
+ skippedUnchanged: number;
71669
+ };
71670
+ /**
71671
+ * The same totals split by source category; the keys are the connector's own (github: markdown/issues/pulls, clickup: tasks/comments/docs/chat, gdrive: files)
71672
+ */
71426
71673
  byCategory: {
71427
- [k: string]: BrainDaemonStatusOutputCounts;
71674
+ [k: string]: {
71675
+ /**
71676
+ * Documents that failed after retries — transient failures, worth re-running
71677
+ */
71678
+ error: number;
71679
+ /**
71680
+ * Documents the source permanently refused (403/404/401) — a permissions or deletion problem, not a transient one
71681
+ */
71682
+ denied: number;
71683
+ /**
71684
+ * Of those, how many were downloaded
71685
+ */
71686
+ fetched: number;
71687
+ /**
71688
+ * Of those, how many became memories
71689
+ */
71690
+ ingested: number;
71691
+ /**
71692
+ * Documents the run found at the source
71693
+ */
71694
+ discovered: number;
71695
+ /**
71696
+ * Documents skipped because their content had not changed since the last run
71697
+ */
71698
+ skippedUnchanged: number;
71699
+ };
71428
71700
  };
71429
71701
  } | null);
71430
71702
  }
71431
- export interface BrainDaemonStatusOutputCounts {
71432
- error: number;
71433
- denied: number;
71434
- fetched: number;
71435
- ingested: number;
71436
- discovered: number;
71437
- skippedUnchanged: number;
71438
- }
71439
71703
  export interface BrainDaemonUpdateInput {
71440
71704
  id: string;
71441
71705
  name?: (string | null);
@@ -71521,46 +71785,121 @@ export interface BrainKnowledgeEntityMemoriesInput {
71521
71785
  entity_ref: string;
71522
71786
  }
71523
71787
  export interface BrainKnowledgeEntityMemoriesOutput {
71788
+ /**
71789
+ * How many memories back this entity in total, across all pages
71790
+ */
71524
71791
  total: number;
71792
+ /**
71793
+ * The entity the memories belong to; null when `entity_ref` matched nothing
71794
+ */
71525
71795
  entity: ({
71796
+ /**
71797
+ * How closely this entity matches the query, higher is closer; absent on an unscored read such as a plain type filter
71798
+ */
71526
71799
  score?: number;
71800
+ /**
71801
+ * Other names the same entity appears under in the ingested text
71802
+ */
71527
71803
  aliases: string[];
71804
+ /**
71805
+ * Id of this entity; pass it as `entity_ref` to brain_knowledge_neighborhood or brain_knowledge_entity_memories
71806
+ */
71528
71807
  entity_id: string;
71808
+ /**
71809
+ * What the entity is, as the engine summarised it from the memories mentioning it; null when it has not written one
71810
+ */
71529
71811
  description: (string | null);
71812
+ /**
71813
+ * Ontology type of the entity, e.g. Feature, Decision, Risk, Integration
71814
+ */
71530
71815
  entity_type: string;
71816
+ /**
71817
+ * The name to show a person — usually the spelling the source text used
71818
+ */
71531
71819
  display_name: string;
71820
+ /**
71821
+ * The one name this entity is stored under; use it when matching entities against each other
71822
+ */
71532
71823
  canonical_name: string;
71824
+ /**
71825
+ * How many memories mention this entity — a rough measure of how well attested it is
71826
+ */
71533
71827
  evidence_count: number;
71534
71828
  } | null);
71829
+ /**
71830
+ * One page of the memories this entity was drawn from — the same shape brain_memory_list returns
71831
+ */
71535
71832
  memories: {
71536
71833
  /**
71537
71834
  * Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer
71538
71835
  */
71539
71836
  kind: ("schema" | "intention" | "identity" | "basic" | "fact" | "summary" | "knowledge" | "raw" | "unknown");
71837
+ /**
71838
+ * Engine tags on this memory; empty when it carries none
71839
+ */
71540
71840
  tags: string[];
71541
71841
  /**
71542
71842
  * Engine memory layer (l0_basic_info…l7_intention)
71543
71843
  */
71544
71844
  layer: ("l6_schema" | "l7_intention" | "l4_identity" | "l0_basic_info" | "l2_fact" | "l3_summary" | "l5_knowledge" | "l1_raw");
71845
+ /**
71846
+ * Free-form metadata, verbatim as the writer passed brain_memory_add's `metadata`; keys are the caller's
71847
+ */
71545
71848
  custom: {
71546
71849
  [k: string]: unknown;
71547
71850
  };
71851
+ /**
71852
+ * Engine lifecycle status of the row — 'active' for a memory in use; superseded rows are not listed
71853
+ */
71548
71854
  status: string;
71855
+ /**
71856
+ * The memory text itself
71857
+ */
71549
71858
  content: string;
71859
+ /**
71860
+ * Engine user namespace the memory was written under
71861
+ */
71550
71862
  user_id: string;
71863
+ /**
71864
+ * Engine agent namespace the memory was written under — the shared pool for a 'shared' write, the caller's own for a private one
71865
+ */
71551
71866
  agent_id: string;
71867
+ /**
71868
+ * When the remembered EVENT happened, epoch milliseconds; null when the writer stated no time
71869
+ */
71552
71870
  memory_at: (number | null);
71871
+ /**
71872
+ * Engine id of this memory; pass it to brain_memory_get, _update or _delete
71873
+ */
71553
71874
  memory_id: string;
71875
+ /**
71876
+ * The engine's own inference about this memory, or null when it recorded none
71877
+ */
71554
71878
  speculate: (string | null);
71879
+ /**
71880
+ * Engine session the memory was written in; empty when the writer opened none
71881
+ */
71555
71882
  session_id: string;
71883
+ /**
71884
+ * When this memory row was written, epoch milliseconds
71885
+ */
71556
71886
  gmt_created: number;
71557
71887
  /**
71558
71888
  * Source authority (highest→lowest): policy > official > team > informal
71559
71889
  */
71560
71890
  source_authority: ("policy" | "official" | "team" | "informal");
71891
+ /**
71892
+ * Id of the l1_raw memory this one was derived from; null when it was written directly
71893
+ */
71561
71894
  source_raw_memory_id: (string | null);
71562
71895
  }[];
71896
+ /**
71897
+ * How long the engine took to answer, milliseconds
71898
+ */
71563
71899
  elapsed_ms: number;
71900
+ /**
71901
+ * Engine request id for this call — quote it when reporting a problem
71902
+ */
71564
71903
  request_id: string;
71565
71904
  }
71566
71905
  export interface BrainKnowledgeGraphInput {
@@ -71574,29 +71913,92 @@ export interface BrainKnowledgeGraphInput {
71574
71913
  scope?: ("shared" | "private" | "both");
71575
71914
  }
71576
71915
  export interface BrainKnowledgeGraphOutput {
71916
+ /**
71917
+ * The typed relations between those entities
71918
+ */
71577
71919
  edges: {
71920
+ /**
71921
+ * Why the engine drew this edge, in its own words; null when it recorded none
71922
+ */
71578
71923
  reason: (string | null);
71924
+ /**
71925
+ * Id of the node the edge points FROM (a `nodes[].id`)
71926
+ */
71579
71927
  source: string;
71928
+ /**
71929
+ * Id of the node the edge points TO (a `nodes[].id`)
71930
+ */
71580
71931
  target: string;
71932
+ /**
71933
+ * True when the relation reads the same in both directions
71934
+ */
71581
71935
  symmetric: boolean;
71936
+ /**
71937
+ * Ontology type of the relation, e.g. depends_on, competes_with, owns
71938
+ */
71582
71939
  relation_type: string;
71583
71940
  }[];
71941
+ /**
71942
+ * The entities in the exported graph
71943
+ */
71584
71944
  nodes: {
71945
+ /**
71946
+ * Id of this entity; the `source` and `target` of an edge refer to it
71947
+ */
71585
71948
  id: string;
71949
+ /**
71950
+ * How many edges touch this node — the hub concepts are the ones kept when the export is truncated
71951
+ */
71586
71952
  degree: number;
71953
+ /**
71954
+ * Other names the same entity appears under in the ingested text
71955
+ */
71587
71956
  aliases: string[];
71957
+ /**
71958
+ * What the entity is, as the engine summarised it; null when it has not written one
71959
+ */
71588
71960
  description: (string | null);
71961
+ /**
71962
+ * Ontology type of the entity, e.g. Feature, Decision, Risk, Integration
71963
+ */
71589
71964
  entity_type: string;
71965
+ /**
71966
+ * The name to show a person
71967
+ */
71590
71968
  display_name: string;
71969
+ /**
71970
+ * The one name this entity is stored under
71971
+ */
71591
71972
  canonical_name: string;
71973
+ /**
71974
+ * How many memories mention this entity
71975
+ */
71592
71976
  evidence_count: number;
71593
71977
  }[];
71978
+ /**
71979
+ * Sizes of what was actually returned
71980
+ */
71594
71981
  totals: {
71982
+ /**
71983
+ * Edges returned in this export
71984
+ */
71595
71985
  edgeCount: number;
71986
+ /**
71987
+ * Nodes returned in this export
71988
+ */
71596
71989
  nodeCount: number;
71597
71990
  };
71991
+ /**
71992
+ * True when `limit` cut the export short — the highest-degree nodes were kept, so what you get is the hubs
71993
+ */
71598
71994
  truncated: boolean;
71995
+ /**
71996
+ * How long the engine took to answer, milliseconds
71997
+ */
71599
71998
  elapsed_ms: number;
71999
+ /**
72000
+ * Engine request id for this call — quote it when reporting a problem
72001
+ */
71600
72002
  request_id: string;
71601
72003
  }
71602
72004
  export interface BrainKnowledgeNeighborhoodInput {
@@ -71626,38 +72028,128 @@ export interface BrainKnowledgeNeighborhoodInput {
71626
72028
  relation_type?: string;
71627
72029
  }
71628
72030
  export interface BrainKnowledgeNeighborhoodOutput {
72031
+ /**
72032
+ * The entity that was expanded around; null when `entity_ref` matched nothing
72033
+ */
71629
72034
  root: ({
72035
+ /**
72036
+ * How closely this entity matches the query, higher is closer; absent on an unscored read such as a plain type filter
72037
+ */
71630
72038
  score?: number;
72039
+ /**
72040
+ * Other names the same entity appears under in the ingested text
72041
+ */
71631
72042
  aliases: string[];
72043
+ /**
72044
+ * Id of this entity; pass it as `entity_ref` to brain_knowledge_neighborhood or brain_knowledge_entity_memories
72045
+ */
71632
72046
  entity_id: string;
72047
+ /**
72048
+ * What the entity is, as the engine summarised it from the memories mentioning it; null when it has not written one
72049
+ */
71633
72050
  description: (string | null);
72051
+ /**
72052
+ * Ontology type of the entity, e.g. Feature, Decision, Risk, Integration
72053
+ */
71634
72054
  entity_type: string;
72055
+ /**
72056
+ * The name to show a person — usually the spelling the source text used
72057
+ */
71635
72058
  display_name: string;
72059
+ /**
72060
+ * The one name this entity is stored under; use it when matching entities against each other
72061
+ */
71636
72062
  canonical_name: string;
72063
+ /**
72064
+ * How many memories mention this entity — a rough measure of how well attested it is
72065
+ */
71637
72066
  evidence_count: number;
71638
72067
  } | null);
72068
+ /**
72069
+ * The neighbours reached within `depth` hops of the root, the root excluded
72070
+ */
71639
72071
  entities: {
72072
+ /**
72073
+ * How closely this entity matches the query, higher is closer; absent on an unscored read such as a plain type filter
72074
+ */
71640
72075
  score?: number;
72076
+ /**
72077
+ * Other names the same entity appears under in the ingested text
72078
+ */
71641
72079
  aliases: string[];
72080
+ /**
72081
+ * Id of this entity; pass it as `entity_ref` to brain_knowledge_neighborhood or brain_knowledge_entity_memories
72082
+ */
71642
72083
  entity_id: string;
72084
+ /**
72085
+ * What the entity is, as the engine summarised it from the memories mentioning it; null when it has not written one
72086
+ */
71643
72087
  description: (string | null);
72088
+ /**
72089
+ * Ontology type of the entity, e.g. Feature, Decision, Risk, Integration
72090
+ */
71644
72091
  entity_type: string;
72092
+ /**
72093
+ * The name to show a person — usually the spelling the source text used
72094
+ */
71645
72095
  display_name: string;
72096
+ /**
72097
+ * The one name this entity is stored under; use it when matching entities against each other
72098
+ */
71646
72099
  canonical_name: string;
72100
+ /**
72101
+ * How many memories mention this entity — a rough measure of how well attested it is
72102
+ */
71647
72103
  evidence_count: number;
71648
72104
  }[];
72105
+ /**
72106
+ * The relations that connect the root and the neighbours above
72107
+ */
71649
72108
  relations: {
72109
+ /**
72110
+ * Why the engine drew this relation, in its own words; null when it recorded none
72111
+ */
71650
72112
  reason: (string | null);
72113
+ /**
72114
+ * Id of the entity the relation points FROM
72115
+ */
71651
72116
  source_id: string;
72117
+ /**
72118
+ * True when the relation reads the same in both directions, so source and target are interchangeable
72119
+ */
71652
72120
  symmetric: boolean;
72121
+ /**
72122
+ * Id of the entity the relation points TO
72123
+ */
71653
72124
  target_id: string;
72125
+ /**
72126
+ * Ontology type of the relation, e.g. depends_on, competes_with, owns
72127
+ */
71654
72128
  relation_type: string;
72129
+ /**
72130
+ * Name to show for the source entity
72131
+ */
71655
72132
  source_display_name: string;
72133
+ /**
72134
+ * Name to show for the target entity
72135
+ */
71656
72136
  target_display_name: string;
72137
+ /**
72138
+ * Stored name of the source entity
72139
+ */
71657
72140
  source_canonical_name: string;
72141
+ /**
72142
+ * Stored name of the target entity
72143
+ */
71658
72144
  target_canonical_name: string;
71659
72145
  }[];
72146
+ /**
72147
+ * How long the engine took to answer, milliseconds
72148
+ */
71660
72149
  elapsed_ms: number;
72150
+ /**
72151
+ * Engine request id for this call — quote it when reporting a problem
72152
+ */
71661
72153
  request_id: string;
71662
72154
  }
71663
72155
  export interface BrainKnowledgeRelationsInput {
@@ -71683,18 +72175,54 @@ export interface BrainKnowledgeRelationsInput {
71683
72175
  target_entity?: string;
71684
72176
  }
71685
72177
  export interface BrainKnowledgeRelationsOutput {
72178
+ /**
72179
+ * The relations matching the filters
72180
+ */
71686
72181
  relations: {
72182
+ /**
72183
+ * Why the engine drew this relation, in its own words; null when it recorded none
72184
+ */
71687
72185
  reason: (string | null);
72186
+ /**
72187
+ * Id of the entity the relation points FROM
72188
+ */
71688
72189
  source_id: string;
72190
+ /**
72191
+ * True when the relation reads the same in both directions, so source and target are interchangeable
72192
+ */
71689
72193
  symmetric: boolean;
72194
+ /**
72195
+ * Id of the entity the relation points TO
72196
+ */
71690
72197
  target_id: string;
72198
+ /**
72199
+ * Ontology type of the relation, e.g. depends_on, competes_with, owns
72200
+ */
71691
72201
  relation_type: string;
72202
+ /**
72203
+ * Name to show for the source entity
72204
+ */
71692
72205
  source_display_name: string;
72206
+ /**
72207
+ * Name to show for the target entity
72208
+ */
71693
72209
  target_display_name: string;
72210
+ /**
72211
+ * Stored name of the source entity
72212
+ */
71694
72213
  source_canonical_name: string;
72214
+ /**
72215
+ * Stored name of the target entity
72216
+ */
71695
72217
  target_canonical_name: string;
71696
72218
  }[];
72219
+ /**
72220
+ * How long the engine took to answer, milliseconds
72221
+ */
71697
72222
  elapsed_ms: number;
72223
+ /**
72224
+ * Engine request id for this call — quote it when reporting a problem
72225
+ */
71698
72226
  request_id: string;
71699
72227
  }
71700
72228
  export interface BrainKnowledgeSearchInput {
@@ -71720,18 +72248,54 @@ export interface BrainKnowledgeSearchInput {
71720
72248
  entity_type?: string;
71721
72249
  }
71722
72250
  export interface BrainKnowledgeSearchOutput {
72251
+ /**
72252
+ * How many entities match in total, across all pages — not the length of this page
72253
+ */
71723
72254
  total: number;
72255
+ /**
72256
+ * Matching entities, best match first
72257
+ */
71724
72258
  entities: {
72259
+ /**
72260
+ * How closely this entity matches the query, higher is closer; absent on an unscored read such as a plain type filter
72261
+ */
71725
72262
  score?: number;
72263
+ /**
72264
+ * Other names the same entity appears under in the ingested text
72265
+ */
71726
72266
  aliases: string[];
72267
+ /**
72268
+ * Id of this entity; pass it as `entity_ref` to brain_knowledge_neighborhood or brain_knowledge_entity_memories
72269
+ */
71727
72270
  entity_id: string;
72271
+ /**
72272
+ * What the entity is, as the engine summarised it from the memories mentioning it; null when it has not written one
72273
+ */
71728
72274
  description: (string | null);
72275
+ /**
72276
+ * Ontology type of the entity, e.g. Feature, Decision, Risk, Integration
72277
+ */
71729
72278
  entity_type: string;
72279
+ /**
72280
+ * The name to show a person — usually the spelling the source text used
72281
+ */
71730
72282
  display_name: string;
72283
+ /**
72284
+ * The one name this entity is stored under; use it when matching entities against each other
72285
+ */
71731
72286
  canonical_name: string;
72287
+ /**
72288
+ * How many memories mention this entity — a rough measure of how well attested it is
72289
+ */
71732
72290
  evidence_count: number;
71733
72291
  }[];
72292
+ /**
72293
+ * How long the engine took to answer, milliseconds
72294
+ */
71734
72295
  elapsed_ms: number;
72296
+ /**
72297
+ * Engine request id for this call — quote it when reporting a problem
72298
+ */
71735
72299
  request_id: string;
71736
72300
  }
71737
72301
  export interface BrainMemoryAddInput {
@@ -71755,8 +72319,17 @@ export interface BrainMemoryAddInput {
71755
72319
  source_authority?: ("policy" | "official" | "team" | "informal");
71756
72320
  }
71757
72321
  export interface BrainMemoryAddOutput {
72322
+ /**
72323
+ * True when the memory was stored
72324
+ */
71758
72325
  success: boolean;
72326
+ /**
72327
+ * Engine id of the memory just stored; keep it to read, replace or delete the memory later
72328
+ */
71759
72329
  memory_id: string;
72330
+ /**
72331
+ * Engine request id for this call — quote it when reporting a problem
72332
+ */
71760
72333
  request_id: string;
71761
72334
  }
71762
72335
  export interface BrainMemoryDeleteInput {
@@ -71766,8 +72339,17 @@ export interface BrainMemoryDeleteInput {
71766
72339
  memory_id: string;
71767
72340
  }
71768
72341
  export interface BrainMemoryDeleteOutput {
72342
+ /**
72343
+ * Always true — the call fails outright rather than reporting a false here
72344
+ */
71769
72345
  success: true;
72346
+ /**
72347
+ * Engine request id for this call — quote it when reporting a problem
72348
+ */
71770
72349
  request_id: string;
72350
+ /**
72351
+ * How many memory rows the engine removed for this id; 0 when it was already gone
72352
+ */
71771
72353
  deleted_count: number;
71772
72354
  }
71773
72355
  export interface BrainMemoryGetInput {
@@ -71777,72 +72359,177 @@ export interface BrainMemoryGetInput {
71777
72359
  memory_id: string;
71778
72360
  }
71779
72361
  export interface BrainMemoryGetOutput {
72362
+ /**
72363
+ * Engine tags on this memory; empty when it carries none
72364
+ */
71780
72365
  tags: string[];
71781
72366
  /**
71782
72367
  * Engine memory layer (l0_basic_info…l7_intention)
71783
72368
  */
71784
72369
  layer: ("l6_schema" | "l7_intention" | "l4_identity" | "l0_basic_info" | "l2_fact" | "l3_summary" | "l5_knowledge" | "l1_raw");
72370
+ /**
72371
+ * Free-form metadata, verbatim as the writer passed brain_memory_add's `metadata`; keys are the caller's
72372
+ */
71785
72373
  custom: {
71786
72374
  [k: string]: unknown;
71787
72375
  };
72376
+ /**
72377
+ * Which store answered the read — 'vdb' the vector store, 'graph' the memory graph. Diagnostic; the content is the same either way.
72378
+ */
71788
72379
  source: ("vdb" | "graph");
72380
+ /**
72381
+ * Engine lifecycle status of the row — 'active' for a memory in use
72382
+ */
71789
72383
  status: string;
72384
+ /**
72385
+ * The memory text itself
72386
+ */
71790
72387
  content: string;
72388
+ /**
72389
+ * Engine user namespace the memory was written under
72390
+ */
71791
72391
  user_id: string;
72392
+ /**
72393
+ * Engine agent namespace the memory was written under
72394
+ */
71792
72395
  agent_id: string;
72396
+ /**
72397
+ * True when this is the current version of the memory; false when a newer one has replaced it
72398
+ */
71793
72399
  is_latest: boolean;
72400
+ /**
72401
+ * When the remembered EVENT happened, epoch milliseconds; null when the writer stated no time
72402
+ */
71794
72403
  memory_at: (number | null);
72404
+ /**
72405
+ * Engine id of this memory — the id that was asked for
72406
+ */
71795
72407
  memory_id: string;
72408
+ /**
72409
+ * The engine's own inference about this memory, or null when it recorded none
72410
+ */
71796
72411
  speculate: (string | null);
72412
+ /**
72413
+ * The engine's confidence in this memory, 0..1
72414
+ */
71797
72415
  confidence: number;
72416
+ /**
72417
+ * How long the engine took to answer, milliseconds
72418
+ */
71798
72419
  elapsed_ms: number;
72420
+ /**
72421
+ * Engine request id for this call — quote it when reporting a problem
72422
+ */
71799
72423
  request_id: string;
72424
+ /**
72425
+ * Ids of the memories this one replaced; null when it replaced none
72426
+ */
71800
72427
  supersedes: (string[] | null);
72428
+ /**
72429
+ * When this memory row was written, epoch milliseconds
72430
+ */
71801
72431
  gmt_created: number;
72432
+ /**
72433
+ * Ids of the memories that replaced this one; null while it is still current
72434
+ */
71802
72435
  superseded_by: (string[] | null);
71803
72436
  /**
71804
72437
  * Source authority (highest→lowest): policy > official > team > informal
71805
72438
  */
71806
72439
  source_authority: ("policy" | "official" | "team" | "informal");
72440
+ /**
72441
+ * Id of the l1_raw memory this one was derived from; null when it was written directly
72442
+ */
71807
72443
  source_raw_memory_id: (string | null);
71808
72444
  }
71809
72445
  export interface BrainMemoryListInput {
72446
+ /**
72447
+ * How many memories to return, max 1000. Omit to use the engine's own page size.
72448
+ */
71810
72449
  limit?: number;
72450
+ /**
72451
+ * Sort by write time: 'desc' newest first, 'asc' oldest first. Omit to take the engine's own order.
72452
+ */
71811
72453
  order?: ("asc" | "desc");
71812
72454
  /**
71813
72455
  * Read scope; 'both' (default) unions shared + your private
71814
72456
  */
71815
72457
  scope?: ("shared" | "private" | "both");
72458
+ /**
72459
+ * How many memories to skip before this page — offset 100 with limit 100 is the second page. Omit to start at the beginning.
72460
+ */
71816
72461
  offset?: number;
71817
72462
  }
71818
72463
  export interface BrainMemoryListOutput {
72464
+ /**
72465
+ * How many memories match in total, across all pages — not the length of this page
72466
+ */
71819
72467
  total: number;
72468
+ /**
72469
+ * One page of memories, newest first unless `order` said otherwise
72470
+ */
71820
72471
  memories: {
71821
72472
  /**
71822
72473
  * Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer
71823
72474
  */
71824
72475
  kind: ("schema" | "intention" | "identity" | "basic" | "fact" | "summary" | "knowledge" | "raw" | "unknown");
72476
+ /**
72477
+ * Engine tags on this memory; empty when it carries none
72478
+ */
71825
72479
  tags: string[];
71826
72480
  /**
71827
72481
  * Engine memory layer (l0_basic_info…l7_intention)
71828
72482
  */
71829
72483
  layer: ("l6_schema" | "l7_intention" | "l4_identity" | "l0_basic_info" | "l2_fact" | "l3_summary" | "l5_knowledge" | "l1_raw");
72484
+ /**
72485
+ * Free-form metadata, verbatim as the writer passed brain_memory_add's `metadata`; keys are the caller's
72486
+ */
71830
72487
  custom: {
71831
72488
  [k: string]: unknown;
71832
72489
  };
72490
+ /**
72491
+ * Engine lifecycle status of the row — 'active' for a memory in use; superseded rows are not listed
72492
+ */
71833
72493
  status: string;
72494
+ /**
72495
+ * The memory text itself
72496
+ */
71834
72497
  content: string;
72498
+ /**
72499
+ * Engine user namespace the memory was written under
72500
+ */
71835
72501
  user_id: string;
72502
+ /**
72503
+ * Engine agent namespace the memory was written under — the shared pool for a 'shared' write, the caller's own for a private one
72504
+ */
71836
72505
  agent_id: string;
72506
+ /**
72507
+ * When the remembered EVENT happened, epoch milliseconds; null when the writer stated no time
72508
+ */
71837
72509
  memory_at: (number | null);
72510
+ /**
72511
+ * Engine id of this memory; pass it to brain_memory_get, _update or _delete
72512
+ */
71838
72513
  memory_id: string;
72514
+ /**
72515
+ * The engine's own inference about this memory, or null when it recorded none
72516
+ */
71839
72517
  speculate: (string | null);
72518
+ /**
72519
+ * Engine session the memory was written in; empty when the writer opened none
72520
+ */
71840
72521
  session_id: string;
72522
+ /**
72523
+ * When this memory row was written, epoch milliseconds
72524
+ */
71841
72525
  gmt_created: number;
71842
72526
  /**
71843
72527
  * Source authority (highest→lowest): policy > official > team > informal
71844
72528
  */
71845
72529
  source_authority: ("policy" | "official" | "team" | "informal");
72530
+ /**
72531
+ * Id of the l1_raw memory this one was derived from; null when it was written directly
72532
+ */
71846
72533
  source_raw_memory_id: (string | null);
71847
72534
  }[];
71848
72535
  }
@@ -71861,8 +72548,17 @@ export interface BrainMemorySearchInput {
71861
72548
  scope?: ("shared" | "private" | "both");
71862
72549
  }
71863
72550
  export interface BrainMemorySearchOutput {
72551
+ /**
72552
+ * Ordinary hits: the facts, summaries and raw notes that match the query
72553
+ */
71864
72554
  normal: BrainMemorySearchOutputItems[];
72555
+ /**
72556
+ * Hits describing WHO the subject is — stable identity and preference memories (l0/l4). Usually the ones worth carrying into a prompt.
72557
+ */
71865
72558
  profile: BrainMemorySearchOutputItems[];
72559
+ /**
72560
+ * Hits the engine offers unprompted — intentions and open threads (l7) it judged relevant to the query rather than matched to it
72561
+ */
71866
72562
  proactive: BrainMemorySearchOutputItems[];
71867
72563
  }
71868
72564
  export interface BrainMemorySearchOutputItems {
@@ -71870,23 +72566,53 @@ export interface BrainMemorySearchOutputItems {
71870
72566
  * Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer
71871
72567
  */
71872
72568
  kind: ("schema" | "intention" | "identity" | "basic" | "fact" | "summary" | "knowledge" | "raw" | "unknown");
72569
+ /**
72570
+ * Engine tags on this memory; empty when it carries none
72571
+ */
71873
72572
  tags: string[];
71874
72573
  /**
71875
72574
  * Engine memory layer (l0_basic_info…l7_intention)
71876
72575
  */
71877
72576
  layer: ("l6_schema" | "l7_intention" | "l4_identity" | "l0_basic_info" | "l2_fact" | "l3_summary" | "l5_knowledge" | "l1_raw");
72577
+ /**
72578
+ * How closely this hit matches the query — higher is closer. An engine-internal scale, not a percentage; compare hits against each other, never against a fixed threshold.
72579
+ */
71878
72580
  score: number;
72581
+ /**
72582
+ * The memory text itself
72583
+ */
71879
72584
  content: string;
72585
+ /**
72586
+ * When the remembered EVENT happened, epoch milliseconds; null when the writer stated no time
72587
+ */
71880
72588
  memory_at: (number | null);
72589
+ /**
72590
+ * Engine id of this memory; pass it to brain_memory_get, _update or _delete
72591
+ */
71881
72592
  memory_id: string;
72593
+ /**
72594
+ * The engine's own inference about this memory, or null when it recorded none
72595
+ */
71882
72596
  speculate: (string | null);
72597
+ /**
72598
+ * When this memory row was written, epoch milliseconds
72599
+ */
71883
72600
  gmt_created: number;
72601
+ /**
72602
+ * Name of the l6_schema type this memory instantiates; absent on every other layer
72603
+ */
71884
72604
  schema_type?: string;
72605
+ /**
72606
+ * Ids of the earlier memories this one grew out of, oldest first; absent when it has no history
72607
+ */
71885
72608
  evolution_chain?: string[];
71886
72609
  /**
71887
72610
  * Source authority (highest→lowest): policy > official > team > informal
71888
72611
  */
71889
72612
  source_authority: ("policy" | "official" | "team" | "informal");
72613
+ /**
72614
+ * Id of the l1_raw memory this one was derived from; null when it was written directly
72615
+ */
71890
72616
  source_raw_memory_id: (string | null);
71891
72617
  }
71892
72618
  export interface BrainMemoryStatsInput {
@@ -71896,19 +72622,52 @@ export interface BrainMemoryStatsInput {
71896
72622
  scope?: ("shared" | "private" | "both");
71897
72623
  }
71898
72624
  export interface BrainMemoryStatsOutput {
72625
+ /**
72626
+ * Size of the engine's memory graph
72627
+ */
71899
72628
  graph: {
72629
+ /**
72630
+ * Edges between those nodes
72631
+ */
71900
72632
  edgeCount: number;
72633
+ /**
72634
+ * Nodes in the memory graph
72635
+ */
71901
72636
  nodeCount: number;
71902
72637
  };
72638
+ /**
72639
+ * Memory counts for the requested scope
72640
+ */
71903
72641
  memories: {
72642
+ /**
72643
+ * How many memories the scope holds in total
72644
+ */
71904
72645
  total: number;
72646
+ /**
72647
+ * Counts for the three derived layers the engine reports; the other layers are not broken out
72648
+ */
71905
72649
  byLayer: {
72650
+ /**
72651
+ * Count of l2_fact memories — extracted facts
72652
+ */
71906
72653
  l2: number;
72654
+ /**
72655
+ * Count of l3_summary memories — summaries over facts
72656
+ */
71907
72657
  l3: number;
72658
+ /**
72659
+ * Count of l4_identity memories — who the subject is
72660
+ */
71908
72661
  l4: number;
71909
72662
  };
71910
72663
  };
72664
+ /**
72665
+ * Size of the product knowledge graph
72666
+ */
71911
72667
  knowledge: {
72668
+ /**
72669
+ * Entities in the product knowledge graph (see brain_knowledge_search)
72670
+ */
71912
72671
  entityCount: number;
71913
72672
  };
71914
72673
  }
@@ -71923,8 +72682,17 @@ export interface BrainMemoryUpdateInput {
71923
72682
  memory_id: string;
71924
72683
  }
71925
72684
  export interface BrainMemoryUpdateOutput {
72685
+ /**
72686
+ * Always true — the call fails outright rather than reporting a false here
72687
+ */
71926
72688
  success: true;
72689
+ /**
72690
+ * Engine id of the memory that was replaced
72691
+ */
71927
72692
  memory_id: string;
72693
+ /**
72694
+ * Engine request id for this call — quote it when reporting a problem
72695
+ */
71928
72696
  request_id: string;
71929
72697
  }
71930
72698
  export interface BrainProductSharedMemoryResetInput {
@@ -71973,6 +72741,9 @@ export interface BrainUsageReportInput {
71973
72741
  days?: number;
71974
72742
  }
71975
72743
  export interface BrainUsageReportOutput {
72744
+ /**
72745
+ * A standing warning, in words, that product.rows and platform.meters have different subjects and need not match
72746
+ */
71976
72747
  note: string;
71977
72748
  /**
71978
72749
  * Brain's own ledger, for THIS product only
@@ -71990,6 +72761,9 @@ export interface BrainUsageReportOutput {
71990
72761
  * Inclusive UTC start of the window, YYYY-MM-DD
71991
72762
  */
71992
72763
  from: string;
72764
+ /**
72765
+ * One row per UTC day and meter dimension — the grain to join against a billing export
72766
+ */
71993
72767
  rows: {
71994
72768
  /**
71995
72769
  * 'sync' | 'batch'; '' when the push carried none
@@ -72028,27 +72802,72 @@ export interface BrainUsageReportOutput {
72028
72802
  * The rows rolled up per meter across the whole window
72029
72803
  */
72030
72804
  totals: {
72805
+ /**
72806
+ * Manifest meter slug, e.g. llm-tokens
72807
+ */
72031
72808
  meter: string;
72809
+ /**
72810
+ * How many metered calls landed in the window
72811
+ */
72032
72812
  events: number;
72813
+ /**
72814
+ * Tokens metered for this meter across the whole window
72815
+ */
72033
72816
  tokens: number;
72817
+ /**
72818
+ * Of those calls, how many billing did not accept — a non-zero here means our ledger and the invoice will differ
72819
+ */
72034
72820
  delivery_failed: number;
72035
72821
  }[];
72822
+ /**
72823
+ * The product this ledger belongs to — the one the call was made for
72824
+ */
72036
72825
  product_id: string;
72037
72826
  };
72038
72827
  /**
72039
72828
  * The platform billing aggregate for the whole ORG; null if it could not be read
72040
72829
  */
72041
72830
  platform: ({
72831
+ /**
72832
+ * The billing plan in force for that organisation
72833
+ */
72042
72834
  plan: string;
72835
+ /**
72836
+ * Always 'org' — a reminder that these numbers are the whole organisation's, not this product's
72837
+ */
72043
72838
  scope: "org";
72839
+ /**
72840
+ * Per-meter allowance and month-to-date usage as billing reports it
72841
+ */
72044
72842
  meters: {
72843
+ /**
72844
+ * What the numbers below are counted in, e.g. tokens
72845
+ */
72045
72846
  unit?: string;
72847
+ /**
72848
+ * How much of it has been used MONTH TO DATE, for the whole org — not for the window asked for here
72849
+ */
72046
72850
  used?: number;
72851
+ /**
72852
+ * The plan's allowance for this meter; null or absent when there is no cap
72853
+ */
72047
72854
  limit?: (number | null);
72855
+ /**
72856
+ * Allowance left; null or absent when the meter is uncapped
72857
+ */
72048
72858
  remaining?: (number | null);
72859
+ /**
72860
+ * True when this meter has no cap at all
72861
+ */
72049
72862
  unlimited?: boolean;
72863
+ /**
72864
+ * Platform meter slug, e.g. llm-tokens
72865
+ */
72050
72866
  meter_slug: string;
72051
72867
  }[];
72868
+ /**
72869
+ * The organisation the billing aggregate was read for
72870
+ */
72052
72871
  org_id: string;
72053
72872
  } | null);
72054
72873
  /**
@@ -116863,25 +117682,70 @@ export interface UsersApikeysCreateInput {
116863
117682
  type: ("server" | "publishable");
116864
117683
  }
116865
117684
  export interface UsersApikeysCreateOutput {
117685
+ /**
117686
+ * Id of the key. Pass it to users_apikeys_revoke.
117687
+ */
116866
117688
  id: string;
117689
+ /**
117690
+ * The full secret key, shown ONCE. Store it now — it is never returned again, and a lost key is replaced by minting a new one.
117691
+ */
116867
117692
  key: string;
117693
+ /**
117694
+ * The label a human gave this key — which backend or environment holds it.
117695
+ */
116868
117696
  name: string;
117697
+ /**
117698
+ * `server` for a secret backend key (usk_…), `publishable` for a browser-safe one (upk_…).
117699
+ */
116869
117700
  type: ("server" | "publishable");
117701
+ /**
117702
+ * The full value of a publishable key, which is not a secret. Null for a server key — that value exists in exactly one response, ever.
117703
+ */
116870
117704
  value: (string | null);
117705
+ /**
117706
+ * `usk_`/`upk_` plus six characters — enough to recognise a key, never to use one.
117707
+ */
116871
117708
  prefix: string;
117709
+ /**
117710
+ * When the key was issued (ISO 8601).
117711
+ */
116872
117712
  createdAt: string;
117713
+ /**
117714
+ * When the key was revoked (ISO 8601). Null while it still works.
117715
+ */
116873
117716
  revokedAt: (string | null);
116874
117717
  }
116875
117718
  export interface UsersApikeysListInput {
116876
117719
  }
116877
117720
  export interface UsersApikeysListOutput {
116878
117721
  keys: {
117722
+ /**
117723
+ * Id of the key. Pass it to users_apikeys_revoke.
117724
+ */
116879
117725
  id: string;
117726
+ /**
117727
+ * The label a human gave this key — which backend or environment holds it.
117728
+ */
116880
117729
  name: string;
117730
+ /**
117731
+ * `server` for a secret backend key (usk_…), `publishable` for a browser-safe one (upk_…).
117732
+ */
116881
117733
  type: ("server" | "publishable");
117734
+ /**
117735
+ * The full value of a publishable key, which is not a secret. Null for a server key — that value exists in exactly one response, ever.
117736
+ */
116882
117737
  value: (string | null);
117738
+ /**
117739
+ * `usk_`/`upk_` plus six characters — enough to recognise a key, never to use one.
117740
+ */
116883
117741
  prefix: string;
117742
+ /**
117743
+ * When the key was issued (ISO 8601).
117744
+ */
116884
117745
  createdAt: string;
117746
+ /**
117747
+ * When the key was revoked (ISO 8601). Null while it still works.
117748
+ */
116885
117749
  revokedAt: (string | null);
116886
117750
  }[];
116887
117751
  }
@@ -116892,7 +117756,13 @@ export interface UsersApikeysRevokeInput {
116892
117756
  id: string;
116893
117757
  }
116894
117758
  export interface UsersApikeysRevokeOutput {
117759
+ /**
117760
+ * Id of the key that was revoked.
117761
+ */
116895
117762
  id: string;
117763
+ /**
117764
+ * Always true — revocation is immediate and final.
117765
+ */
116896
117766
  revoked: true;
116897
117767
  }
116898
117768
  export interface UsersAuditListInput {
@@ -116926,21 +117796,60 @@ export interface UsersAuditListInput {
116926
117796
  targetType?: string;
116927
117797
  }
116928
117798
  export interface UsersAuditListOutput {
117799
+ /**
117800
+ * The page of audit events, newest first.
117801
+ */
116929
117802
  events: {
117803
+ /**
117804
+ * Id of this audit row.
117805
+ */
116930
117806
  id: string;
117807
+ /**
117808
+ * IP the action came from. Null when it was not an HTTP action.
117809
+ */
116931
117810
  ip: (string | null);
117811
+ /**
117812
+ * What happened, as a dotted name — `user.created`, `passkey.deleted`, `email_change.override_applied`.
117813
+ */
116932
117814
  action: string;
117815
+ /**
117816
+ * Id of the actor. Null for a system action.
117817
+ */
116933
117818
  actorId: (string | null);
117819
+ /**
117820
+ * Action-specific detail — the reason text, counts, whatever the action recorded.
117821
+ */
116934
117822
  metadata: {
116935
117823
  [k: string]: unknown;
116936
117824
  };
117825
+ /**
117826
+ * Id of the row the action was about. Null when there was none.
117827
+ */
116937
117828
  targetId: (string | null);
117829
+ /**
117830
+ * Who acted: `operator` (a human or agent on the management plane), `end_user`, or `system`.
117831
+ */
116938
117832
  actorType: ("operator" | "system" | "end_user");
117833
+ /**
117834
+ * When the action happened (ISO 8601).
117835
+ */
116939
117836
  createdAt: string;
117837
+ /**
117838
+ * Product the audited action happened in.
117839
+ */
116940
117840
  productId: string;
117841
+ /**
117842
+ * User agent the action came from. Null when none was sent.
117843
+ */
116941
117844
  userAgent: (string | null);
117845
+ /**
117846
+ * What kind of row the action was about — `user` or `product`. Null when it was about nothing in particular.
117847
+ */
116942
117848
  targetType: (string | null);
116943
117849
  }[];
117850
+ /**
117851
+ * Pass back as `cursor` to fetch the next page. Null when this page is the last.
117852
+ */
116944
117853
  nextCursor: (string | null);
116945
117854
  }
116946
117855
  export interface UsersConfigGetInput {
@@ -117916,12 +118825,33 @@ export interface UsersFactorsListInput {
117916
118825
  userId: string;
117917
118826
  }
117918
118827
  export interface UsersFactorsListOutput {
118828
+ /**
118829
+ * Every second factor this user has — types and status only, never material.
118830
+ */
117919
118831
  factors: {
118832
+ /**
118833
+ * Kind of second factor: `totp` or `backup_codes`. No key material is ever returned.
118834
+ */
117920
118835
  type: ("totp" | "backup_codes" | "webauthn");
118836
+ /**
118837
+ * Whether this factor is enrolled and usable, or still pending verification.
118838
+ */
117921
118839
  status: ("unverified" | "verified");
118840
+ /**
118841
+ * When the factor was enrolled (ISO 8601).
118842
+ */
117922
118843
  createdAt: string;
118844
+ /**
118845
+ * `backup_codes` only: how many of the batch are still unspent. Null for any other factor type.
118846
+ */
117923
118847
  remaining: (number | null);
118848
+ /**
118849
+ * When the factor was last used to sign in (ISO 8601). Null if it never was.
118850
+ */
117924
118851
  lastUsedAt: (string | null);
118852
+ /**
118853
+ * When the user first proved the factor works (ISO 8601). Null while it is unverified.
118854
+ */
117925
118855
  verifiedAt: (string | null);
117926
118856
  }[];
117927
118857
  }
@@ -117936,7 +118866,13 @@ export interface UsersFactorsResetInput {
117936
118866
  userId: string;
117937
118867
  }
117938
118868
  export interface UsersFactorsResetOutput {
118869
+ /**
118870
+ * Id of the scheduled reset. The same value arrives on `users/mfa.reset-settled`, which is what finishes this step.
118871
+ */
117939
118872
  requestId: string;
118873
+ /**
118874
+ * When the removal happens, if nobody aborts it first (ISO 8601). The delay is this product's, not a fixed one.
118875
+ */
117940
118876
  scheduledFor: string;
117941
118877
  }
117942
118878
  export interface UsersKeysListInput {
@@ -118254,9 +119190,18 @@ export interface UsersPasskeysRevokeOutput {
118254
119190
  * Present when the revoke was refused — today, only because it was the last way in.
118255
119191
  */
118256
119192
  error: ({
119193
+ /**
119194
+ * Why it was refused. Today only `passkey_last_way_in`.
119195
+ */
118257
119196
  code: string;
119197
+ /**
119198
+ * The refusal in a sentence, safe to show a human.
119199
+ */
118258
119200
  message: string;
118259
119201
  } | null);
119202
+ /**
119203
+ * `deleted` when the credential is gone, `failed` when the revoke was refused.
119204
+ */
118260
119205
  status: ("deleted" | "failed");
118261
119206
  }
118262
119207
  export interface UsersSessionsGetInput {
@@ -118266,7 +119211,13 @@ export interface UsersSessionsGetInput {
118266
119211
  sessionId: string;
118267
119212
  }
118268
119213
  export interface UsersSessionsGetOutput {
119214
+ /**
119215
+ * Id of this session. Pass it to users_sessions_revoke.
119216
+ */
118269
119217
  id: string;
119218
+ /**
119219
+ * IP the session was opened from. Null when it was not recorded.
119220
+ */
118270
119221
  ip: (string | null);
118271
119222
  /**
118272
119223
  * `aal2` only if a verified second factor completed.
@@ -118276,18 +119227,42 @@ export interface UsersSessionsGetOutput {
118276
119227
  * The factors this session was established with.
118277
119228
  */
118278
119229
  amr: string[];
119230
+ /**
119231
+ * Whether the session is still usable, expired, or revoked.
119232
+ */
118279
119233
  status: ("active" | "revoked");
119234
+ /**
119235
+ * The end user this session belongs to.
119236
+ */
118280
119237
  userId: string;
119238
+ /**
119239
+ * When the session was opened (ISO 8601).
119240
+ */
118281
119241
  createdAt: string;
119242
+ /**
119243
+ * When the current token stops working unless refreshed (ISO 8601).
119244
+ */
118282
119245
  expiresAt: string;
119246
+ /**
119247
+ * When the session was revoked (ISO 8601). Null while it is live.
119248
+ */
118283
119249
  revokedAt: (string | null);
119250
+ /**
119251
+ * User agent the session was opened from. Null when none was sent.
119252
+ */
118284
119253
  userAgent: (string | null);
118285
119254
  revokedReason: (string | null);
118286
119255
  /**
118287
119256
  * The operator behind an impersonated session, or null for an ordinary one.
118288
119257
  */
118289
119258
  impersonatedBy: (string | null);
119259
+ /**
119260
+ * When the session last refreshed its tokens (ISO 8601). Null if it never has.
119261
+ */
118290
119262
  lastRefreshedAt: (string | null);
119263
+ /**
119264
+ * When the session ends no matter how often it refreshes (ISO 8601).
119265
+ */
118291
119266
  absoluteExpiresAt: string;
118292
119267
  }
118293
119268
  export interface UsersSessionsImpersonateInput {
@@ -118323,16 +119298,49 @@ export interface UsersSessionsListInput {
118323
119298
  userId: string;
118324
119299
  }
118325
119300
  export interface UsersSessionsListOutput {
119301
+ /**
119302
+ * The sessions matching the filter, newest first.
119303
+ */
118326
119304
  sessions: {
119305
+ /**
119306
+ * Id of this session. Pass it to users_sessions_revoke.
119307
+ */
118327
119308
  id: string;
119309
+ /**
119310
+ * IP the session was opened from. Null when it was not recorded.
119311
+ */
118328
119312
  ip: (string | null);
119313
+ /**
119314
+ * Whether the session is still usable, expired, or revoked.
119315
+ */
118329
119316
  status: ("active" | "revoked");
119317
+ /**
119318
+ * The end user this session belongs to.
119319
+ */
118330
119320
  userId: string;
119321
+ /**
119322
+ * When the session was opened (ISO 8601).
119323
+ */
118331
119324
  createdAt: string;
119325
+ /**
119326
+ * When the current token stops working unless refreshed (ISO 8601).
119327
+ */
118332
119328
  expiresAt: string;
119329
+ /**
119330
+ * When the session was revoked (ISO 8601). Null while it is live.
119331
+ */
118333
119332
  revokedAt: (string | null);
119333
+ /**
119334
+ * User agent the session was opened from. Null when none was sent.
119335
+ */
118334
119336
  userAgent: (string | null);
119337
+ /**
119338
+ * When the session last refreshed its tokens (ISO 8601). Null if it never has.
119339
+ */
118335
119340
  lastRefreshedAt: (string | null);
119341
+ /**
119342
+ * When the session ends no matter how often it refreshes (ISO 8601).
119343
+ */
118336
119344
  absoluteExpiresAt: string;
118337
119345
  }[];
118338
119346
  }
@@ -118347,6 +119355,9 @@ export interface UsersSessionsRevokeInput {
118347
119355
  sessionId?: string;
118348
119356
  }
118349
119357
  export interface UsersSessionsRevokeOutput {
119358
+ /**
119359
+ * How many sessions were revoked. Zero when there was nothing live to revoke.
119360
+ */
118350
119361
  revoked: number;
118351
119362
  }
118352
119363
  export interface UsersStatsGetInput {
@@ -118469,37 +119480,126 @@ export interface UsersUsersBanInput {
118469
119480
  userId: string;
118470
119481
  }
118471
119482
  export interface UsersUsersBanOutput {
119483
+ /**
119484
+ * Id of this end user. Pass it to any users_users_* tool.
119485
+ */
118472
119486
  id: string;
119487
+ /**
119488
+ * The user's display name. Null when nobody set one.
119489
+ */
118473
119490
  name: (string | null);
119491
+ /**
119492
+ * When the user was banned (ISO 8601). Null while they are not banned.
119493
+ */
118474
119494
  bannedAt: (string | null);
119495
+ /**
119496
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
119497
+ */
118475
119498
  erasedAt: (string | null);
119499
+ /**
119500
+ * URL of the user's avatar. Null when there is none.
119501
+ */
118476
119502
  imageUrl: (string | null);
119503
+ /**
119504
+ * Whether this is a test fixture — excluded from metering and from the default listing.
119505
+ */
118477
119506
  testUser: boolean;
119507
+ /**
119508
+ * When the user was created (ISO 8601).
119509
+ */
118478
119510
  createdAt: string;
119511
+ /**
119512
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
119513
+ */
118479
119514
  deletedAt: (string | null);
119515
+ /**
119516
+ * Product this user belongs to. Never an input — it comes from the calling identity.
119517
+ */
118480
119518
  productId: string;
119519
+ /**
119520
+ * When the user was last changed (ISO 8601).
119521
+ */
118481
119522
  updatedAt: string;
119523
+ /**
119524
+ * Whether this user is still on the waitlist and cannot sign in yet.
119525
+ */
118482
119526
  waitlisted: boolean;
119527
+ /**
119528
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
119529
+ */
118483
119530
  identifiers: {
119531
+ /**
119532
+ * Id of this identifier row.
119533
+ */
118484
119534
  id: string;
119535
+ /**
119536
+ * What kind of identifier this is. Today always `email`.
119537
+ */
118485
119538
  type: "email";
119539
+ /**
119540
+ * The address as the user typed it, for display.
119541
+ */
118486
119542
  value: string;
119543
+ /**
119544
+ * Whether this is the identifier the user signs in with and is contacted at.
119545
+ */
118487
119546
  isPrimary: boolean;
119547
+ /**
119548
+ * When this address was verified (ISO 8601). Null while it never was.
119549
+ */
118488
119550
  verifiedAt: (string | null);
119551
+ /**
119552
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
119553
+ */
118489
119554
  valueCanonical: string;
119555
+ /**
119556
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
119557
+ */
118490
119558
  verificationStatus: ("unverified" | "verified" | "expired");
118491
119559
  }[];
119560
+ /**
119561
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
119562
+ */
118492
119563
  lockedUntil: (string | null);
119564
+ /**
119565
+ * When the user last signed in (ISO 8601). Null if they never have.
119566
+ */
118493
119567
  lastSignInAt: (string | null);
119568
+ /**
119569
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
119570
+ */
119571
+ primaryEmail: (string | null);
119572
+ /**
119573
+ * Whether the user must set a new password at their next sign-in.
119574
+ */
118494
119575
  requiresReset: boolean;
118495
- publicMetadata: UsersUsersBanOutputPublicMetadata;
118496
- unsafeMetadata: UsersUsersBanOutputPublicMetadata;
118497
- privateMetadata: UsersUsersBanOutputPublicMetadata;
119576
+ /**
119577
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
119578
+ */
119579
+ publicMetadata: {
119580
+ [k: string]: unknown;
119581
+ };
119582
+ /**
119583
+ * Metadata the end user may write themselves. Treat it as untrusted.
119584
+ */
119585
+ unsafeMetadata: {
119586
+ [k: string]: unknown;
119587
+ };
119588
+ /**
119589
+ * Metadata for the management plane only. Never reaches the end user or a token.
119590
+ */
119591
+ privateMetadata: {
119592
+ [k: string]: unknown;
119593
+ };
119594
+ /**
119595
+ * Id of the primary identifier row. Null when there is no primary identifier.
119596
+ */
119597
+ primaryIdentifierId: (string | null);
119598
+ /**
119599
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
119600
+ */
118498
119601
  emailChangeLockedUntil: (string | null);
118499
119602
  }
118500
- export interface UsersUsersBanOutputPublicMetadata {
118501
- [k: string]: unknown;
118502
- }
118503
119603
  export interface UsersUsersCreateInput {
118504
119604
  /**
118505
119605
  * The user's display name.
@@ -118603,37 +119703,126 @@ export interface UsersUsersCreateInputPublicMetadata1 {
118603
119703
  [k: string]: unknown;
118604
119704
  }
118605
119705
  export interface UsersUsersCreateOutput {
119706
+ /**
119707
+ * Id of this end user. Pass it to any users_users_* tool.
119708
+ */
118606
119709
  id: string;
119710
+ /**
119711
+ * The user's display name. Null when nobody set one.
119712
+ */
118607
119713
  name: (string | null);
119714
+ /**
119715
+ * When the user was banned (ISO 8601). Null while they are not banned.
119716
+ */
118608
119717
  bannedAt: (string | null);
119718
+ /**
119719
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
119720
+ */
118609
119721
  erasedAt: (string | null);
119722
+ /**
119723
+ * URL of the user's avatar. Null when there is none.
119724
+ */
118610
119725
  imageUrl: (string | null);
119726
+ /**
119727
+ * Whether this is a test fixture — excluded from metering and from the default listing.
119728
+ */
118611
119729
  testUser: boolean;
119730
+ /**
119731
+ * When the user was created (ISO 8601).
119732
+ */
118612
119733
  createdAt: string;
119734
+ /**
119735
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
119736
+ */
118613
119737
  deletedAt: (string | null);
119738
+ /**
119739
+ * Product this user belongs to. Never an input — it comes from the calling identity.
119740
+ */
118614
119741
  productId: string;
119742
+ /**
119743
+ * When the user was last changed (ISO 8601).
119744
+ */
118615
119745
  updatedAt: string;
119746
+ /**
119747
+ * Whether this user is still on the waitlist and cannot sign in yet.
119748
+ */
118616
119749
  waitlisted: boolean;
119750
+ /**
119751
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
119752
+ */
118617
119753
  identifiers: {
119754
+ /**
119755
+ * Id of this identifier row.
119756
+ */
118618
119757
  id: string;
119758
+ /**
119759
+ * What kind of identifier this is. Today always `email`.
119760
+ */
118619
119761
  type: "email";
119762
+ /**
119763
+ * The address as the user typed it, for display.
119764
+ */
118620
119765
  value: string;
119766
+ /**
119767
+ * Whether this is the identifier the user signs in with and is contacted at.
119768
+ */
118621
119769
  isPrimary: boolean;
119770
+ /**
119771
+ * When this address was verified (ISO 8601). Null while it never was.
119772
+ */
118622
119773
  verifiedAt: (string | null);
119774
+ /**
119775
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
119776
+ */
118623
119777
  valueCanonical: string;
119778
+ /**
119779
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
119780
+ */
118624
119781
  verificationStatus: ("unverified" | "verified" | "expired");
118625
119782
  }[];
119783
+ /**
119784
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
119785
+ */
118626
119786
  lockedUntil: (string | null);
119787
+ /**
119788
+ * When the user last signed in (ISO 8601). Null if they never have.
119789
+ */
118627
119790
  lastSignInAt: (string | null);
119791
+ /**
119792
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
119793
+ */
119794
+ primaryEmail: (string | null);
119795
+ /**
119796
+ * Whether the user must set a new password at their next sign-in.
119797
+ */
118628
119798
  requiresReset: boolean;
118629
- publicMetadata: UsersUsersCreateOutputPublicMetadata;
118630
- unsafeMetadata: UsersUsersCreateOutputPublicMetadata;
118631
- privateMetadata: UsersUsersCreateOutputPublicMetadata;
119799
+ /**
119800
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
119801
+ */
119802
+ publicMetadata: {
119803
+ [k: string]: unknown;
119804
+ };
119805
+ /**
119806
+ * Metadata the end user may write themselves. Treat it as untrusted.
119807
+ */
119808
+ unsafeMetadata: {
119809
+ [k: string]: unknown;
119810
+ };
119811
+ /**
119812
+ * Metadata for the management plane only. Never reaches the end user or a token.
119813
+ */
119814
+ privateMetadata: {
119815
+ [k: string]: unknown;
119816
+ };
119817
+ /**
119818
+ * Id of the primary identifier row. Null when there is no primary identifier.
119819
+ */
119820
+ primaryIdentifierId: (string | null);
119821
+ /**
119822
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
119823
+ */
118632
119824
  emailChangeLockedUntil: (string | null);
118633
119825
  }
118634
- export interface UsersUsersCreateOutputPublicMetadata {
118635
- [k: string]: unknown;
118636
- }
118637
119826
  export interface UsersUsersDeleteInput {
118638
119827
  /**
118639
119828
  * The opaque user id returned by users_users_create or _list.
@@ -118641,37 +119830,126 @@ export interface UsersUsersDeleteInput {
118641
119830
  userId: string;
118642
119831
  }
118643
119832
  export interface UsersUsersDeleteOutput {
119833
+ /**
119834
+ * Id of this end user. Pass it to any users_users_* tool.
119835
+ */
118644
119836
  id: string;
119837
+ /**
119838
+ * The user's display name. Null when nobody set one.
119839
+ */
118645
119840
  name: (string | null);
119841
+ /**
119842
+ * When the user was banned (ISO 8601). Null while they are not banned.
119843
+ */
118646
119844
  bannedAt: (string | null);
119845
+ /**
119846
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
119847
+ */
118647
119848
  erasedAt: (string | null);
119849
+ /**
119850
+ * URL of the user's avatar. Null when there is none.
119851
+ */
118648
119852
  imageUrl: (string | null);
119853
+ /**
119854
+ * Whether this is a test fixture — excluded from metering and from the default listing.
119855
+ */
118649
119856
  testUser: boolean;
119857
+ /**
119858
+ * When the user was created (ISO 8601).
119859
+ */
118650
119860
  createdAt: string;
119861
+ /**
119862
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
119863
+ */
118651
119864
  deletedAt: (string | null);
119865
+ /**
119866
+ * Product this user belongs to. Never an input — it comes from the calling identity.
119867
+ */
118652
119868
  productId: string;
119869
+ /**
119870
+ * When the user was last changed (ISO 8601).
119871
+ */
118653
119872
  updatedAt: string;
119873
+ /**
119874
+ * Whether this user is still on the waitlist and cannot sign in yet.
119875
+ */
118654
119876
  waitlisted: boolean;
119877
+ /**
119878
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
119879
+ */
118655
119880
  identifiers: {
119881
+ /**
119882
+ * Id of this identifier row.
119883
+ */
118656
119884
  id: string;
119885
+ /**
119886
+ * What kind of identifier this is. Today always `email`.
119887
+ */
118657
119888
  type: "email";
119889
+ /**
119890
+ * The address as the user typed it, for display.
119891
+ */
118658
119892
  value: string;
119893
+ /**
119894
+ * Whether this is the identifier the user signs in with and is contacted at.
119895
+ */
118659
119896
  isPrimary: boolean;
119897
+ /**
119898
+ * When this address was verified (ISO 8601). Null while it never was.
119899
+ */
118660
119900
  verifiedAt: (string | null);
119901
+ /**
119902
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
119903
+ */
118661
119904
  valueCanonical: string;
119905
+ /**
119906
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
119907
+ */
118662
119908
  verificationStatus: ("unverified" | "verified" | "expired");
118663
119909
  }[];
119910
+ /**
119911
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
119912
+ */
118664
119913
  lockedUntil: (string | null);
119914
+ /**
119915
+ * When the user last signed in (ISO 8601). Null if they never have.
119916
+ */
118665
119917
  lastSignInAt: (string | null);
119918
+ /**
119919
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
119920
+ */
119921
+ primaryEmail: (string | null);
119922
+ /**
119923
+ * Whether the user must set a new password at their next sign-in.
119924
+ */
118666
119925
  requiresReset: boolean;
118667
- publicMetadata: UsersUsersDeleteOutputPublicMetadata;
118668
- unsafeMetadata: UsersUsersDeleteOutputPublicMetadata;
118669
- privateMetadata: UsersUsersDeleteOutputPublicMetadata;
119926
+ /**
119927
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
119928
+ */
119929
+ publicMetadata: {
119930
+ [k: string]: unknown;
119931
+ };
119932
+ /**
119933
+ * Metadata the end user may write themselves. Treat it as untrusted.
119934
+ */
119935
+ unsafeMetadata: {
119936
+ [k: string]: unknown;
119937
+ };
119938
+ /**
119939
+ * Metadata for the management plane only. Never reaches the end user or a token.
119940
+ */
119941
+ privateMetadata: {
119942
+ [k: string]: unknown;
119943
+ };
119944
+ /**
119945
+ * Id of the primary identifier row. Null when there is no primary identifier.
119946
+ */
119947
+ primaryIdentifierId: (string | null);
119948
+ /**
119949
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
119950
+ */
118670
119951
  emailChangeLockedUntil: (string | null);
118671
119952
  }
118672
- export interface UsersUsersDeleteOutputPublicMetadata {
118673
- [k: string]: unknown;
118674
- }
118675
119953
  export interface UsersUsersExportInput {
118676
119954
  /**
118677
119955
  * Rows per page, 1-500. Default 100.
@@ -118697,40 +119975,129 @@ export interface UsersUsersExportInput {
118697
119975
  export interface UsersUsersExportOutput {
118698
119976
  count: number;
118699
119977
  users: {
119978
+ /**
119979
+ * Id of this end user. Pass it to any users_users_* tool.
119980
+ */
118700
119981
  id: string;
119982
+ /**
119983
+ * The user's display name. Null when nobody set one.
119984
+ */
118701
119985
  name: (string | null);
119986
+ /**
119987
+ * When the user was banned (ISO 8601). Null while they are not banned.
119988
+ */
118702
119989
  bannedAt: (string | null);
119990
+ /**
119991
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
119992
+ */
118703
119993
  erasedAt: (string | null);
119994
+ /**
119995
+ * URL of the user's avatar. Null when there is none.
119996
+ */
118704
119997
  imageUrl: (string | null);
119998
+ /**
119999
+ * Whether this is a test fixture — excluded from metering and from the default listing.
120000
+ */
118705
120001
  testUser: boolean;
120002
+ /**
120003
+ * When the user was created (ISO 8601).
120004
+ */
118706
120005
  createdAt: string;
120006
+ /**
120007
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
120008
+ */
118707
120009
  deletedAt: (string | null);
120010
+ /**
120011
+ * Product this user belongs to. Never an input — it comes from the calling identity.
120012
+ */
118708
120013
  productId: string;
120014
+ /**
120015
+ * When the user was last changed (ISO 8601).
120016
+ */
118709
120017
  updatedAt: string;
120018
+ /**
120019
+ * Whether this user is still on the waitlist and cannot sign in yet.
120020
+ */
118710
120021
  waitlisted: boolean;
120022
+ /**
120023
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
120024
+ */
118711
120025
  identifiers: {
120026
+ /**
120027
+ * Id of this identifier row.
120028
+ */
118712
120029
  id: string;
120030
+ /**
120031
+ * What kind of identifier this is. Today always `email`.
120032
+ */
118713
120033
  type: "email";
120034
+ /**
120035
+ * The address as the user typed it, for display.
120036
+ */
118714
120037
  value: string;
120038
+ /**
120039
+ * Whether this is the identifier the user signs in with and is contacted at.
120040
+ */
118715
120041
  isPrimary: boolean;
120042
+ /**
120043
+ * When this address was verified (ISO 8601). Null while it never was.
120044
+ */
118716
120045
  verifiedAt: (string | null);
120046
+ /**
120047
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
120048
+ */
118717
120049
  valueCanonical: string;
120050
+ /**
120051
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
120052
+ */
118718
120053
  verificationStatus: ("unverified" | "verified" | "expired");
118719
120054
  }[];
120055
+ /**
120056
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
120057
+ */
118720
120058
  lockedUntil: (string | null);
120059
+ /**
120060
+ * When the user last signed in (ISO 8601). Null if they never have.
120061
+ */
118721
120062
  lastSignInAt: (string | null);
120063
+ /**
120064
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
120065
+ */
120066
+ primaryEmail: (string | null);
120067
+ /**
120068
+ * Whether the user must set a new password at their next sign-in.
120069
+ */
118722
120070
  requiresReset: boolean;
118723
- publicMetadata: UsersUsersExportOutputPublicMetadata;
118724
- unsafeMetadata: UsersUsersExportOutputPublicMetadata;
118725
- privateMetadata: UsersUsersExportOutputPublicMetadata;
120071
+ /**
120072
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
120073
+ */
120074
+ publicMetadata: {
120075
+ [k: string]: unknown;
120076
+ };
120077
+ /**
120078
+ * Metadata the end user may write themselves. Treat it as untrusted.
120079
+ */
120080
+ unsafeMetadata: {
120081
+ [k: string]: unknown;
120082
+ };
120083
+ /**
120084
+ * Metadata for the management plane only. Never reaches the end user or a token.
120085
+ */
120086
+ privateMetadata: {
120087
+ [k: string]: unknown;
120088
+ };
120089
+ /**
120090
+ * Id of the primary identifier row. Null when there is no primary identifier.
120091
+ */
120092
+ primaryIdentifierId: (string | null);
120093
+ /**
120094
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
120095
+ */
118726
120096
  emailChangeLockedUntil: (string | null);
118727
120097
  }[];
118728
120098
  exportedAt: string;
118729
120099
  nextCursor: (string | null);
118730
120100
  }
118731
- export interface UsersUsersExportOutputPublicMetadata {
118732
- [k: string]: unknown;
118733
- }
118734
120101
  export interface UsersUsersGetInput {
118735
120102
  /**
118736
120103
  * The opaque user id returned by users_users_create or _list.
@@ -118738,37 +120105,126 @@ export interface UsersUsersGetInput {
118738
120105
  userId: string;
118739
120106
  }
118740
120107
  export interface UsersUsersGetOutput {
120108
+ /**
120109
+ * Id of this end user. Pass it to any users_users_* tool.
120110
+ */
118741
120111
  id: string;
120112
+ /**
120113
+ * The user's display name. Null when nobody set one.
120114
+ */
118742
120115
  name: (string | null);
120116
+ /**
120117
+ * When the user was banned (ISO 8601). Null while they are not banned.
120118
+ */
118743
120119
  bannedAt: (string | null);
120120
+ /**
120121
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
120122
+ */
118744
120123
  erasedAt: (string | null);
120124
+ /**
120125
+ * URL of the user's avatar. Null when there is none.
120126
+ */
118745
120127
  imageUrl: (string | null);
120128
+ /**
120129
+ * Whether this is a test fixture — excluded from metering and from the default listing.
120130
+ */
118746
120131
  testUser: boolean;
120132
+ /**
120133
+ * When the user was created (ISO 8601).
120134
+ */
118747
120135
  createdAt: string;
120136
+ /**
120137
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
120138
+ */
118748
120139
  deletedAt: (string | null);
120140
+ /**
120141
+ * Product this user belongs to. Never an input — it comes from the calling identity.
120142
+ */
118749
120143
  productId: string;
120144
+ /**
120145
+ * When the user was last changed (ISO 8601).
120146
+ */
118750
120147
  updatedAt: string;
120148
+ /**
120149
+ * Whether this user is still on the waitlist and cannot sign in yet.
120150
+ */
118751
120151
  waitlisted: boolean;
120152
+ /**
120153
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
120154
+ */
118752
120155
  identifiers: {
120156
+ /**
120157
+ * Id of this identifier row.
120158
+ */
118753
120159
  id: string;
120160
+ /**
120161
+ * What kind of identifier this is. Today always `email`.
120162
+ */
118754
120163
  type: "email";
120164
+ /**
120165
+ * The address as the user typed it, for display.
120166
+ */
118755
120167
  value: string;
120168
+ /**
120169
+ * Whether this is the identifier the user signs in with and is contacted at.
120170
+ */
118756
120171
  isPrimary: boolean;
120172
+ /**
120173
+ * When this address was verified (ISO 8601). Null while it never was.
120174
+ */
118757
120175
  verifiedAt: (string | null);
120176
+ /**
120177
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
120178
+ */
118758
120179
  valueCanonical: string;
120180
+ /**
120181
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
120182
+ */
118759
120183
  verificationStatus: ("unverified" | "verified" | "expired");
118760
120184
  }[];
120185
+ /**
120186
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
120187
+ */
118761
120188
  lockedUntil: (string | null);
120189
+ /**
120190
+ * When the user last signed in (ISO 8601). Null if they never have.
120191
+ */
118762
120192
  lastSignInAt: (string | null);
120193
+ /**
120194
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
120195
+ */
120196
+ primaryEmail: (string | null);
120197
+ /**
120198
+ * Whether the user must set a new password at their next sign-in.
120199
+ */
118763
120200
  requiresReset: boolean;
118764
- publicMetadata: UsersUsersGetOutputPublicMetadata;
118765
- unsafeMetadata: UsersUsersGetOutputPublicMetadata;
118766
- privateMetadata: UsersUsersGetOutputPublicMetadata;
120201
+ /**
120202
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
120203
+ */
120204
+ publicMetadata: {
120205
+ [k: string]: unknown;
120206
+ };
120207
+ /**
120208
+ * Metadata the end user may write themselves. Treat it as untrusted.
120209
+ */
120210
+ unsafeMetadata: {
120211
+ [k: string]: unknown;
120212
+ };
120213
+ /**
120214
+ * Metadata for the management plane only. Never reaches the end user or a token.
120215
+ */
120216
+ privateMetadata: {
120217
+ [k: string]: unknown;
120218
+ };
120219
+ /**
120220
+ * Id of the primary identifier row. Null when there is no primary identifier.
120221
+ */
120222
+ primaryIdentifierId: (string | null);
120223
+ /**
120224
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
120225
+ */
118767
120226
  emailChangeLockedUntil: (string | null);
118768
120227
  }
118769
- export interface UsersUsersGetOutputPublicMetadata {
118770
- [k: string]: unknown;
118771
- }
118772
120228
  export interface UsersUsersImportInput {
118773
120229
  /**
118774
120230
  * The users to import, at most 500 per call — batch client-side beyond that. Each row: identifiers (email), optional profile, optional password HASH, optional flags.
@@ -118779,15 +120235,42 @@ export interface UsersUsersImportInput {
118779
120235
  users: [unknown, ...(unknown)[]];
118780
120236
  }
118781
120237
  export interface UsersUsersImportOutput {
120238
+ /**
120239
+ * How many rows could not be imported at all.
120240
+ */
118782
120241
  failed: number;
120242
+ /**
120243
+ * How many users were created.
120244
+ */
118783
120245
  created: number;
120246
+ /**
120247
+ * One row per submitted row, in the order you sent them.
120248
+ */
118784
120249
  results: {
120250
+ /**
120251
+ * Zero-based index of the row in the `users` array you sent.
120252
+ */
118785
120253
  row: number;
120254
+ /**
120255
+ * Why it was skipped, or what went wrong. Null for a created row.
120256
+ */
118786
120257
  reason: (string | null);
120258
+ /**
120259
+ * What happened to this row.
120260
+ */
118787
120261
  status: ("created" | "skipped" | "failed");
120262
+ /**
120263
+ * The created user's id. Null for skipped and failed rows.
120264
+ */
118788
120265
  userId: (string | null);
118789
120266
  }[];
120267
+ /**
120268
+ * How many rows were passed over — an address already in the directory, typically.
120269
+ */
118790
120270
  skipped: number;
120271
+ /**
120272
+ * How many rows you submitted.
120273
+ */
118791
120274
  requested: number;
118792
120275
  }
118793
120276
  export interface UsersUsersInviteInput {
@@ -118813,9 +120296,21 @@ export interface UsersUsersInviteInput {
118813
120296
  };
118814
120297
  }
118815
120298
  export interface UsersUsersInviteOutput {
120299
+ /**
120300
+ * False when the re-invite cooldown or the mail toolkit refused the send. The invite is still live.
120301
+ */
118816
120302
  mailed: boolean;
120303
+ /**
120304
+ * The invited user, created immediately and listed straight away — they simply cannot sign in until they accept.
120305
+ */
118817
120306
  userId: string;
120307
+ /**
120308
+ * False when this address had already been invited; the same user is returned.
120309
+ */
118818
120310
  created: boolean;
120311
+ /**
120312
+ * When the invite link stops working (ISO 8601).
120313
+ */
118819
120314
  expiresAt: string;
118820
120315
  }
118821
120316
  export interface UsersUsersListInput {
@@ -118849,40 +120344,135 @@ export interface UsersUsersListInput {
118849
120344
  includeWaitlisted?: boolean;
118850
120345
  }
118851
120346
  export interface UsersUsersListOutput {
120347
+ /**
120348
+ * The page of users, newest first.
120349
+ */
118852
120350
  users: {
120351
+ /**
120352
+ * Id of this end user. Pass it to any users_users_* tool.
120353
+ */
118853
120354
  id: string;
120355
+ /**
120356
+ * The user's display name. Null when nobody set one.
120357
+ */
118854
120358
  name: (string | null);
120359
+ /**
120360
+ * When the user was banned (ISO 8601). Null while they are not banned.
120361
+ */
118855
120362
  bannedAt: (string | null);
120363
+ /**
120364
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
120365
+ */
118856
120366
  erasedAt: (string | null);
120367
+ /**
120368
+ * URL of the user's avatar. Null when there is none.
120369
+ */
118857
120370
  imageUrl: (string | null);
120371
+ /**
120372
+ * Whether this is a test fixture — excluded from metering and from the default listing.
120373
+ */
118858
120374
  testUser: boolean;
120375
+ /**
120376
+ * When the user was created (ISO 8601).
120377
+ */
118859
120378
  createdAt: string;
120379
+ /**
120380
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
120381
+ */
118860
120382
  deletedAt: (string | null);
120383
+ /**
120384
+ * Product this user belongs to. Never an input — it comes from the calling identity.
120385
+ */
118861
120386
  productId: string;
120387
+ /**
120388
+ * When the user was last changed (ISO 8601).
120389
+ */
118862
120390
  updatedAt: string;
120391
+ /**
120392
+ * Whether this user is still on the waitlist and cannot sign in yet.
120393
+ */
118863
120394
  waitlisted: boolean;
120395
+ /**
120396
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
120397
+ */
118864
120398
  identifiers: {
120399
+ /**
120400
+ * Id of this identifier row.
120401
+ */
118865
120402
  id: string;
120403
+ /**
120404
+ * What kind of identifier this is. Today always `email`.
120405
+ */
118866
120406
  type: "email";
120407
+ /**
120408
+ * The address as the user typed it, for display.
120409
+ */
118867
120410
  value: string;
120411
+ /**
120412
+ * Whether this is the identifier the user signs in with and is contacted at.
120413
+ */
118868
120414
  isPrimary: boolean;
120415
+ /**
120416
+ * When this address was verified (ISO 8601). Null while it never was.
120417
+ */
118869
120418
  verifiedAt: (string | null);
120419
+ /**
120420
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
120421
+ */
118870
120422
  valueCanonical: string;
120423
+ /**
120424
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
120425
+ */
118871
120426
  verificationStatus: ("unverified" | "verified" | "expired");
118872
120427
  }[];
120428
+ /**
120429
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
120430
+ */
118873
120431
  lockedUntil: (string | null);
120432
+ /**
120433
+ * When the user last signed in (ISO 8601). Null if they never have.
120434
+ */
118874
120435
  lastSignInAt: (string | null);
120436
+ /**
120437
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
120438
+ */
120439
+ primaryEmail: (string | null);
120440
+ /**
120441
+ * Whether the user must set a new password at their next sign-in.
120442
+ */
118875
120443
  requiresReset: boolean;
118876
- publicMetadata: UsersUsersListOutputPublicMetadata;
118877
- unsafeMetadata: UsersUsersListOutputPublicMetadata;
118878
- privateMetadata: UsersUsersListOutputPublicMetadata;
120444
+ /**
120445
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
120446
+ */
120447
+ publicMetadata: {
120448
+ [k: string]: unknown;
120449
+ };
120450
+ /**
120451
+ * Metadata the end user may write themselves. Treat it as untrusted.
120452
+ */
120453
+ unsafeMetadata: {
120454
+ [k: string]: unknown;
120455
+ };
120456
+ /**
120457
+ * Metadata for the management plane only. Never reaches the end user or a token.
120458
+ */
120459
+ privateMetadata: {
120460
+ [k: string]: unknown;
120461
+ };
120462
+ /**
120463
+ * Id of the primary identifier row. Null when there is no primary identifier.
120464
+ */
120465
+ primaryIdentifierId: (string | null);
120466
+ /**
120467
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
120468
+ */
118879
120469
  emailChangeLockedUntil: (string | null);
118880
120470
  }[];
120471
+ /**
120472
+ * Pass back as `cursor` to fetch the next page. Null when this page is the last.
120473
+ */
118881
120474
  nextCursor: (string | null);
118882
120475
  }
118883
- export interface UsersUsersListOutputPublicMetadata {
118884
- [k: string]: unknown;
118885
- }
118886
120476
  export interface UsersUsersSetPrimaryIdentifierInput {
118887
120477
  /**
118888
120478
  * The address to make primary. Must not already belong, verified, to another user of this product.
@@ -118898,7 +120488,13 @@ export interface UsersUsersSetPrimaryIdentifierInput {
118898
120488
  userId: string;
118899
120489
  }
118900
120490
  export interface UsersUsersSetPrimaryIdentifierOutput {
120491
+ /**
120492
+ * Id of the scheduled change. It appears in the audit rows and in the abort link mailed to the old address.
120493
+ */
118901
120494
  requestId: string;
120495
+ /**
120496
+ * When the swap becomes applicable, if nobody aborts it first (ISO 8601). The delay is this product's `emailChange.overrideDelayHours`, 72 by default.
120497
+ */
118902
120498
  scheduledFor: string;
118903
120499
  }
118904
120500
  export interface UsersUsersUnbanInput {
@@ -118908,37 +120504,126 @@ export interface UsersUsersUnbanInput {
118908
120504
  userId: string;
118909
120505
  }
118910
120506
  export interface UsersUsersUnbanOutput {
120507
+ /**
120508
+ * Id of this end user. Pass it to any users_users_* tool.
120509
+ */
118911
120510
  id: string;
120511
+ /**
120512
+ * The user's display name. Null when nobody set one.
120513
+ */
118912
120514
  name: (string | null);
120515
+ /**
120516
+ * When the user was banned (ISO 8601). Null while they are not banned.
120517
+ */
118913
120518
  bannedAt: (string | null);
120519
+ /**
120520
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
120521
+ */
118914
120522
  erasedAt: (string | null);
120523
+ /**
120524
+ * URL of the user's avatar. Null when there is none.
120525
+ */
118915
120526
  imageUrl: (string | null);
120527
+ /**
120528
+ * Whether this is a test fixture — excluded from metering and from the default listing.
120529
+ */
118916
120530
  testUser: boolean;
120531
+ /**
120532
+ * When the user was created (ISO 8601).
120533
+ */
118917
120534
  createdAt: string;
120535
+ /**
120536
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
120537
+ */
118918
120538
  deletedAt: (string | null);
120539
+ /**
120540
+ * Product this user belongs to. Never an input — it comes from the calling identity.
120541
+ */
118919
120542
  productId: string;
120543
+ /**
120544
+ * When the user was last changed (ISO 8601).
120545
+ */
118920
120546
  updatedAt: string;
120547
+ /**
120548
+ * Whether this user is still on the waitlist and cannot sign in yet.
120549
+ */
118921
120550
  waitlisted: boolean;
120551
+ /**
120552
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
120553
+ */
118922
120554
  identifiers: {
120555
+ /**
120556
+ * Id of this identifier row.
120557
+ */
118923
120558
  id: string;
120559
+ /**
120560
+ * What kind of identifier this is. Today always `email`.
120561
+ */
118924
120562
  type: "email";
120563
+ /**
120564
+ * The address as the user typed it, for display.
120565
+ */
118925
120566
  value: string;
120567
+ /**
120568
+ * Whether this is the identifier the user signs in with and is contacted at.
120569
+ */
118926
120570
  isPrimary: boolean;
120571
+ /**
120572
+ * When this address was verified (ISO 8601). Null while it never was.
120573
+ */
118927
120574
  verifiedAt: (string | null);
120575
+ /**
120576
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
120577
+ */
118928
120578
  valueCanonical: string;
120579
+ /**
120580
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
120581
+ */
118929
120582
  verificationStatus: ("unverified" | "verified" | "expired");
118930
120583
  }[];
120584
+ /**
120585
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
120586
+ */
118931
120587
  lockedUntil: (string | null);
120588
+ /**
120589
+ * When the user last signed in (ISO 8601). Null if they never have.
120590
+ */
118932
120591
  lastSignInAt: (string | null);
120592
+ /**
120593
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
120594
+ */
120595
+ primaryEmail: (string | null);
120596
+ /**
120597
+ * Whether the user must set a new password at their next sign-in.
120598
+ */
118933
120599
  requiresReset: boolean;
118934
- publicMetadata: UsersUsersUnbanOutputPublicMetadata;
118935
- unsafeMetadata: UsersUsersUnbanOutputPublicMetadata;
118936
- privateMetadata: UsersUsersUnbanOutputPublicMetadata;
120600
+ /**
120601
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
120602
+ */
120603
+ publicMetadata: {
120604
+ [k: string]: unknown;
120605
+ };
120606
+ /**
120607
+ * Metadata the end user may write themselves. Treat it as untrusted.
120608
+ */
120609
+ unsafeMetadata: {
120610
+ [k: string]: unknown;
120611
+ };
120612
+ /**
120613
+ * Metadata for the management plane only. Never reaches the end user or a token.
120614
+ */
120615
+ privateMetadata: {
120616
+ [k: string]: unknown;
120617
+ };
120618
+ /**
120619
+ * Id of the primary identifier row. Null when there is no primary identifier.
120620
+ */
120621
+ primaryIdentifierId: (string | null);
120622
+ /**
120623
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
120624
+ */
118937
120625
  emailChangeLockedUntil: (string | null);
118938
120626
  }
118939
- export interface UsersUsersUnbanOutputPublicMetadata {
118940
- [k: string]: unknown;
118941
- }
118942
120627
  export interface UsersUsersUpdateInput {
118943
120628
  /**
118944
120629
  * The user's display name. Pass null to clear.
@@ -118986,37 +120671,126 @@ export interface UsersUsersUpdateInputPublicMetadata1 {
118986
120671
  [k: string]: unknown;
118987
120672
  }
118988
120673
  export interface UsersUsersUpdateOutput {
120674
+ /**
120675
+ * Id of this end user. Pass it to any users_users_* tool.
120676
+ */
118989
120677
  id: string;
120678
+ /**
120679
+ * The user's display name. Null when nobody set one.
120680
+ */
118990
120681
  name: (string | null);
120682
+ /**
120683
+ * When the user was banned (ISO 8601). Null while they are not banned.
120684
+ */
118991
120685
  bannedAt: (string | null);
120686
+ /**
120687
+ * When this user's personal data was purged for good (ISO 8601). Null while it is intact.
120688
+ */
118992
120689
  erasedAt: (string | null);
120690
+ /**
120691
+ * URL of the user's avatar. Null when there is none.
120692
+ */
118993
120693
  imageUrl: (string | null);
120694
+ /**
120695
+ * Whether this is a test fixture — excluded from metering and from the default listing.
120696
+ */
118994
120697
  testUser: boolean;
120698
+ /**
120699
+ * When the user was created (ISO 8601).
120700
+ */
118995
120701
  createdAt: string;
120702
+ /**
120703
+ * When the user was soft-deleted (ISO 8601). Null while the account is live.
120704
+ */
118996
120705
  deletedAt: (string | null);
120706
+ /**
120707
+ * Product this user belongs to. Never an input — it comes from the calling identity.
120708
+ */
118997
120709
  productId: string;
120710
+ /**
120711
+ * When the user was last changed (ISO 8601).
120712
+ */
118998
120713
  updatedAt: string;
120714
+ /**
120715
+ * Whether this user is still on the waitlist and cannot sign in yet.
120716
+ */
118999
120717
  waitlisted: boolean;
120718
+ /**
120719
+ * Every identifier of this user, the primary one flagged. To bind the primary address itself, use `primaryEmail` — `identifiers.0` means "the first", not "the primary".
120720
+ */
119000
120721
  identifiers: {
120722
+ /**
120723
+ * Id of this identifier row.
120724
+ */
119001
120725
  id: string;
120726
+ /**
120727
+ * What kind of identifier this is. Today always `email`.
120728
+ */
119002
120729
  type: "email";
120730
+ /**
120731
+ * The address as the user typed it, for display.
120732
+ */
119003
120733
  value: string;
120734
+ /**
120735
+ * Whether this is the identifier the user signs in with and is contacted at.
120736
+ */
119004
120737
  isPrimary: boolean;
120738
+ /**
120739
+ * When this address was verified (ISO 8601). Null while it never was.
120740
+ */
119005
120741
  verifiedAt: (string | null);
120742
+ /**
120743
+ * The address lowercased and NFC-normalised — what uniqueness is checked against.
120744
+ */
119006
120745
  valueCanonical: string;
120746
+ /**
120747
+ * `unverified`, `verified`, or `expired` when a verification link ran out before it was used.
120748
+ */
119007
120749
  verificationStatus: ("unverified" | "verified" | "expired");
119008
120750
  }[];
120751
+ /**
120752
+ * When a failed-attempt lockout expires (ISO 8601). Null when the user is not locked out.
120753
+ */
119009
120754
  lockedUntil: (string | null);
120755
+ /**
120756
+ * When the user last signed in (ISO 8601). Null if they never have.
120757
+ */
119010
120758
  lastSignInAt: (string | null);
120759
+ /**
120760
+ * The user's primary email address, as typed. Null when they have no primary identifier. Bind this rather than `identifiers.0.value`.
120761
+ */
120762
+ primaryEmail: (string | null);
120763
+ /**
120764
+ * Whether the user must set a new password at their next sign-in.
120765
+ */
119011
120766
  requiresReset: boolean;
119012
- publicMetadata: UsersUsersUpdateOutputPublicMetadata;
119013
- unsafeMetadata: UsersUsersUpdateOutputPublicMetadata;
119014
- privateMetadata: UsersUsersUpdateOutputPublicMetadata;
120767
+ /**
120768
+ * Metadata the end user may read; the only bag projected into their access token. Capped at 1.2 KB.
120769
+ */
120770
+ publicMetadata: {
120771
+ [k: string]: unknown;
120772
+ };
120773
+ /**
120774
+ * Metadata the end user may write themselves. Treat it as untrusted.
120775
+ */
120776
+ unsafeMetadata: {
120777
+ [k: string]: unknown;
120778
+ };
120779
+ /**
120780
+ * Metadata for the management plane only. Never reaches the end user or a token.
120781
+ */
120782
+ privateMetadata: {
120783
+ [k: string]: unknown;
120784
+ };
120785
+ /**
120786
+ * Id of the primary identifier row. Null when there is no primary identifier.
120787
+ */
120788
+ primaryIdentifierId: (string | null);
120789
+ /**
120790
+ * Until this instant the user may not start another email change, because somebody reverted one (ISO 8601). Null for a user who never reverted one.
120791
+ */
119015
120792
  emailChangeLockedUntil: (string | null);
119016
120793
  }
119017
- export interface UsersUsersUpdateOutputPublicMetadata {
119018
- [k: string]: unknown;
119019
- }
119020
120794
  export interface UsersWaitlistFunnelInput {
119021
120795
  }
119022
120796
  export interface UsersWaitlistFunnelOutput {
@@ -119194,15 +120968,42 @@ export interface UsersWaitlistImportInput {
119194
120968
  ];
119195
120969
  }
119196
120970
  export interface UsersWaitlistImportOutput {
120971
+ /**
120972
+ * How many could not be imported at all.
120973
+ */
119197
120974
  failed: number;
120975
+ /**
120976
+ * One row per submitted row, in the order you sent them.
120977
+ */
119198
120978
  results: {
120979
+ /**
120980
+ * Zero-based index of the row in the array you sent.
120981
+ */
119199
120982
  row: number;
120983
+ /**
120984
+ * Why it was skipped, or what went wrong. Null for an imported row.
120985
+ */
119200
120986
  reason: (string | null);
120987
+ /**
120988
+ * What happened to this row.
120989
+ */
119201
120990
  status: ("imported" | "skipped" | "failed");
120991
+ /**
120992
+ * The waitlisted user this row created. Null for skipped and failed rows.
120993
+ */
119202
120994
  userId: (string | null);
119203
120995
  }[];
120996
+ /**
120997
+ * How many were already on the list or otherwise passed over.
120998
+ */
119204
120999
  skipped: number;
121000
+ /**
121001
+ * How many became waitlist entries.
121002
+ */
119205
121003
  imported: number;
121004
+ /**
121005
+ * How many rows you submitted.
121006
+ */
119206
121007
  requested: number;
119207
121008
  }
119208
121009
  export interface UsersWaitlistInviteInput {
@@ -119215,12 +121016,30 @@ export interface UsersWaitlistInviteInput {
119215
121016
  userIds: [string, ...(string)[]];
119216
121017
  }
119217
121018
  export interface UsersWaitlistInviteOutput {
121019
+ /**
121020
+ * How many of the requested users were invited.
121021
+ */
119218
121022
  invited: number;
121023
+ /**
121024
+ * One row per user you asked for, in the order you sent them.
121025
+ */
119219
121026
  results: {
121027
+ /**
121028
+ * Why this user was skipped. Null for an invited row.
121029
+ */
119220
121030
  reason: (("suppressed" | "not_found" | "already_registered") | null);
121031
+ /**
121032
+ * Whether this user was invited or passed over.
121033
+ */
119221
121034
  status: ("invited" | "skipped");
121035
+ /**
121036
+ * The user this row is about.
121037
+ */
119222
121038
  userId: string;
119223
121039
  }[];
121040
+ /**
121041
+ * How many were passed over — see each row's `reason`.
121042
+ */
119224
121043
  skipped: number;
119225
121044
  }
119226
121045
  export interface UsersWaitlistListInput {
@@ -119242,23 +121061,62 @@ export interface UsersWaitlistListInput {
119242
121061
  confirmed?: boolean;
119243
121062
  }
119244
121063
  export interface UsersWaitlistListOutput {
121064
+ /**
121065
+ * The page of waitlist entries, newest first.
121066
+ */
119245
121067
  entries: {
121068
+ /**
121069
+ * Where in the funnel this entry is: `pending`, `invited`, `registered` or `withdrawn`.
121070
+ */
119246
121071
  status: ("pending" | "invited" | "registered" | "withdrawn");
121072
+ /**
121073
+ * The waitlisted user. Every users_users_* tool takes this id.
121074
+ */
119247
121075
  userId: string;
121076
+ /**
121077
+ * When the entry joined the waitlist (ISO 8601).
121078
+ */
119248
121079
  createdAt: string;
121080
+ /**
121081
+ * When the invite was sent (ISO 8601). Null while the entry is pending.
121082
+ */
119249
121083
  invitedAt: (string | null);
121084
+ /**
121085
+ * The email address that signed up.
121086
+ */
119250
121087
  identifier: string;
121088
+ /**
121089
+ * Where the signup came from — the campaign, referrer and landing page recorded at the time.
121090
+ */
119251
121091
  attribution: {
119252
121092
  [k: string]: unknown;
119253
121093
  };
121094
+ /**
121095
+ * When the address confirmed a double opt-in (ISO 8601). Null when it never did.
121096
+ */
119254
121097
  confirmedAt: (string | null);
121098
+ /**
121099
+ * When the address asked to be taken off the list (ISO 8601). Null when it did not.
121100
+ */
119255
121101
  withdrawnAt: (string | null);
121102
+ /**
121103
+ * What was recorded to show this address consented: when, from where, and under which wording.
121104
+ */
119256
121105
  consentProof: {
119257
121106
  [k: string]: unknown;
119258
121107
  };
121108
+ /**
121109
+ * When the invitee finished signing up (ISO 8601). Null until they do.
121110
+ */
119259
121111
  registeredAt: (string | null);
121112
+ /**
121113
+ * Id of the live invite token. Null while the entry has not been invited.
121114
+ */
119260
121115
  inviteTokenId: (string | null);
119261
121116
  }[];
121117
+ /**
121118
+ * Pass back as `cursor` to fetch the next page. Null when this page is the last.
121119
+ */
119262
121120
  nextCursor: (string | null);
119263
121121
  }
119264
121122
  export interface UsersWebhooksCreateInput {