palbase 0.33.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +2 -2
  2. package/dist/ai/index.js +2 -2
  3. package/dist/backend/engine.js +2 -2
  4. package/dist/backend/env.js +1 -1
  5. package/dist/backend/index.js +3 -3
  6. package/dist/backend/stack.js +1 -1
  7. package/dist/backend/test.js +2 -2
  8. package/dist/chunks/{GVR2PSNL.js → 2OXYYE3V.js} +2 -2
  9. package/dist/chunks/{ECVJH7GC.js → 2YZ33WMV.js} +2 -2
  10. package/dist/chunks/{D4P4XLMT.js → 33B3S5RY.js} +1 -1
  11. package/dist/chunks/{KMWZK74K.js → 5AY6UR4J.js} +2 -2
  12. package/dist/chunks/{S4UAMADF.js → 6L2MMJA6.js} +2 -2
  13. package/dist/chunks/{7KKXGZP6.js → AAS47Y5B.js} +1 -1
  14. package/dist/chunks/{L5JYBOI3.js → ACXA3P2N.js} +2 -2
  15. package/dist/chunks/{STM6MJLC.js → ASBRNYVS.js} +1 -1
  16. package/dist/chunks/BGFOKJRG.js +2 -0
  17. package/dist/chunks/{HKUBQA4K.js → C2AFHALD.js} +1 -1
  18. package/dist/chunks/{OBLZE7OG.js → CFJZ3DPG.js} +2 -2
  19. package/dist/chunks/{PCOLUMJ2.js → CODVONHV.js} +2 -2
  20. package/dist/chunks/{AKE3ARBQ.js → FKGX3BOZ.js} +1 -1
  21. package/dist/chunks/{NAHDBHAC.js → FRUUIOFR.js} +2 -2
  22. package/dist/chunks/{BJ4U62LX.js → HMWR5O3Y.js} +2 -2
  23. package/dist/chunks/{WRGRQURQ.js → KBY7IBXO.js} +2 -2
  24. package/dist/chunks/{6D5QSXFP.js → LO57KBUW.js} +2 -2
  25. package/dist/chunks/{7MEZ7I4T.js → NOTDQXFX.js} +2 -2
  26. package/dist/chunks/{2TNGTQX6.js → OXEDY6JB.js} +2 -2
  27. package/dist/chunks/{W5YFK4GY.js → PGH2237Q.js} +1 -1
  28. package/dist/chunks/{WBYKUJPE.js → S4BXGBZ5.js} +2 -2
  29. package/dist/chunks/{HLESDZU4.js → TGIVD25Y.js} +2 -2
  30. package/dist/chunks/{5U6L3QNV.js → ZBKJUKQA.js} +1 -1
  31. package/dist/cli.js +114 -114
  32. package/dist/cloud/index.js +2 -2
  33. package/dist/refuse/ai.js +1 -1
  34. package/dist/refuse/backend.js +1 -1
  35. package/dist/refuse/cloud.js +1 -1
  36. package/dist/refuse/server.js +1 -1
  37. package/dist/server/index.js +2 -2
  38. package/dist/server/testing.js +2 -2
  39. package/dist/web/calls-ui.js +2 -2
  40. package/dist/web/index.js +2 -2
  41. package/dist/web/message.js +2 -2
  42. package/dist/web/palbe.js +2 -2
  43. package/dist/web/paywall.js +2 -2
  44. package/dist/web/push-sw.js +1 -1
  45. package/dist/web/ssr.js +2 -2
  46. package/dist/web/vite.js +2 -2
  47. package/package.json +2 -2
  48. package/types/internal/src/modules/ai.d.ts +4 -4
  49. package/types/internal/src/modules/calls.d.ts +102 -3
  50. package/types/internal/src/modules/machines.d.ts +38 -14
  51. package/dist/chunks/24U4NDH6.js +0 -2
@@ -53,6 +53,10 @@ export type Call = {
53
53
  * Its people and bots
54
54
  */
55
55
  participants: Participant[];
56
+ /**
57
+ * The place it is held at, as the project names it (a channel of its app, a conversation: channel:42, conversation:<id>): the place's people — whom the project's rule lets in — find it going on and join it unasked. Null for a call of no place
58
+ */
59
+ place: string | null;
56
60
  /**
57
61
  * Whether it rings the people asked (false: a huddle they join)
58
62
  */
@@ -102,6 +106,10 @@ export type CallEvent = {
102
106
  * user or bot
103
107
  */
104
108
  participant_kind?: string;
109
+ /**
110
+ * The place it is held at (null for a call of no place)
111
+ */
112
+ place: string | null;
105
113
  /**
106
114
  * The call's room on the media server: what an agent's ticket is for
107
115
  */
@@ -240,6 +248,10 @@ export type HookSettings = {
240
248
  * A hook that does not answer: refuse the call, or let it
241
249
  */
242
250
  on_error?: "deny" | "allow";
251
+ /**
252
+ * The hook answers places too (action place: may this person see and join the calls held at a place). Off, it is never asked of a place, and a place's call is seen only by the people asked into it (a conversation:<id> place's members aside)
253
+ */
254
+ places?: boolean;
243
255
  /**
244
256
  * How long it is waited for (100 to 5,000; 2,000)
245
257
  */
@@ -262,6 +274,23 @@ export type InviteRequest = {
262
274
  */
263
275
  user_ids: string[];
264
276
  };
277
+ /**
278
+ * Comes into a group call on a device
279
+ */
280
+ export type JoinRequest = {
281
+ /**
282
+ * The device it is joined on
283
+ */
284
+ device_id: string;
285
+ /**
286
+ * Their picture, an https URL, likewise
287
+ */
288
+ image_url?: string | null;
289
+ /**
290
+ * What the others see of one who comes in unasked (a place's), where nothing else names them
291
+ */
292
+ name?: string | null;
293
+ };
265
294
  /**
266
295
  * A device's way into the call's room on the media server, where every call's media flows — one to one or in a group: its url and the ticket its client connects with
267
296
  */
@@ -332,6 +361,20 @@ export type Participant = {
332
361
  */
333
362
  user_id: string;
334
363
  };
364
+ /**
365
+ * A place and its call: going on, or — told to a watcher as it ends — its last, ended (with its version: a snapshot that comes late is known for older); no call when none goes on there. Participants carry no device_id
366
+ */
367
+ export type PlaceView = {
368
+ call?: Call;
369
+ /**
370
+ * The place
371
+ */
372
+ place: string;
373
+ /**
374
+ * How long the reader is told of the place's call (the place event on their calls channel) before the watch is asked again — a watch's answer alone
375
+ */
376
+ watch_seconds?: number;
377
+ };
335
378
  /**
336
379
  * A call to make
337
380
  */
@@ -362,12 +405,16 @@ export type StartCallRequest = {
362
405
  metadata?: {
363
406
  [key: string]: string;
364
407
  };
408
+ /**
409
+ * Holds the call at a place (a group call): letters, digits and . _ : -, 1 to 128 (channel:42; conversation:<id> for a conversation of Palbase's messaging, whose members it lets in). One call goes on at a place at a time. Who it lets in is the project's rule: a conversation's members, else the project's hook (calls.can_call, action place); with no hook, no one but those asked
410
+ */
411
+ place?: string | null;
365
412
  /**
366
413
  * Ring them (true, by default); false: a group call they join (a huddle)
367
414
  */
368
415
  ring?: boolean;
369
416
  /**
370
- * Who to call: one person (a direct call), or several (a group)
417
+ * Who to call: one person (a direct call), or several (a group); none for a call at a place, which its people join
371
418
  */
372
419
  user_ids: string[];
373
420
  /**
@@ -375,6 +422,25 @@ export type StartCallRequest = {
375
422
  */
376
423
  video?: boolean;
377
424
  };
425
+ /**
426
+ * A call not started: why, and — when a call goes on at its place (place_busy) — that call, to join
427
+ */
428
+ export type StartRefused = {
429
+ call?: Call;
430
+ /**
431
+ * The refusal's name
432
+ */
433
+ error: string;
434
+ /**
435
+ * What it means
436
+ */
437
+ error_description: string;
438
+ /**
439
+ * The request's id
440
+ */
441
+ request_id?: string;
442
+ [key: string]: unknown;
443
+ };
378
444
  /**
379
445
  * A way in for an agent
380
446
  */
@@ -517,6 +583,39 @@ export declare function client(t: Transport): {
517
583
  body: TicketRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
518
584
  signal?: AbortSignal;
519
585
  }): Promise<Reply<201, Ticket>>;
586
+ /**
587
+ * A place's call
588
+ *
589
+ * The call going on at the place, if one is, for a reader the place lets in: one of those in it or asked, or whom the project's rule lets in (a conversation's members for a conversation:<id> place, else the project's hook; with no hook, no one else).
590
+ */
591
+ getCallPlace(input: {
592
+ path: {
593
+ place: string;
594
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
595
+ signal?: AbortSignal;
596
+ }): Promise<Reply<200, PlaceView>>;
597
+ /**
598
+ * Watch a place
599
+ *
600
+ * The reader is told of the place's call — started, changed, ended (no call) — as the place event on their calls channel, for watch_seconds; an app showing the place asks again before it runs out. Answered with the place's call as it is.
601
+ */
602
+ watchCallPlace(input: {
603
+ path: {
604
+ place: string;
605
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
606
+ signal?: AbortSignal;
607
+ }): Promise<Reply<200, PlaceView>>;
608
+ /**
609
+ * Stop watching a place
610
+ *
611
+ * The reader is told no more of the place's call.
612
+ */
613
+ unwatchCallPlace(input: {
614
+ path: {
615
+ place: string;
616
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
617
+ signal?: AbortSignal;
618
+ }): Promise<Reply<204, undefined>>;
520
619
  /**
521
620
  * Call settings
522
621
  *
@@ -591,13 +690,13 @@ export declare function client(t: Transport): {
591
690
  /**
592
691
  * Join a group call
593
692
  *
594
- * Comes into a group call the reader was asked to — rung, missed, declined, or in before — on the device.
693
+ * Comes into a group call the reader was asked to — rung, missed, declined, or in before — on the device; or, unasked, a call held at a place whose rule lets the reader in.
595
694
  */
596
695
  joinCall(input: {
597
696
  path: {
598
697
  call_id: string;
599
698
  };
600
- body: DeviceRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
699
+ body: JoinRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
601
700
  signal?: AbortSignal;
602
701
  }): Promise<Reply<200, Call>>;
603
702
  /**
@@ -210,11 +210,11 @@ export type Machine = {
210
210
  */
211
211
  replicas: number;
212
212
  /**
213
- * Kept awake: a machine of a size that sleeps is never put to sleep when idle, and is started again at once when it is asleep — while its environment has paid rights (Pay as you go with a balance), which pays its every hour. Without them it sleeps as any; a dedicated size never sleeps.
213
+ * Kept awake: a machine of a size that sleeps is never put to sleep when idle, and is started again at once when it is asleep — while its environment has paid rights (Pay as you go), which pays its every hour. Without them it sleeps as any; a dedicated size never sleeps.
214
214
  */
215
215
  always_on: boolean;
216
216
  /**
217
- * Whether a pull request opened against its branch is previewed: its head built into a machine of its own, <name>-pr<n>, in this environment, with this environment's settings and secrets, answering at <name>-pr<n>-<ref> until the pull request closes; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's: the pull request's code runs with the environment's secrets.
217
+ * Whether a pull request opened against its branch is previewed: its head built into a machine of its own, <name>-pr<n>, in this environment, with this environment's settings and secrets, answering at <name>-pr<n>-<ref> until the pull request closes; the pull request is told where in a comment. Any environment previews, production's too: the pull request's code runs with the environment's settings, secrets and users, with a database of its own when the machine runs its database's migrations.
218
218
  */
219
219
  previews: boolean;
220
220
  /**
@@ -303,11 +303,11 @@ export type MachineCreate = {
303
303
  */
304
304
  replicas?: number;
305
305
  /**
306
- * Keeps it awake (Machine.always_on): open to an environment on Pay as you go with a balance, refused `always_on_not_available` otherwise.
306
+ * Keeps it awake (Machine.always_on): open to an environment on Pay as you go, refused `always_on_not_available` otherwise.
307
307
  */
308
308
  always_on?: boolean;
309
309
  /**
310
- * Whether a pull request opened against its branch is previewed: its head built into a machine of its own, <name>-pr<n>, in this environment, with this environment's settings and secrets, answering at <name>-pr<n>-<ref> until the pull request closes; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's: the pull request's code runs with the environment's secrets. A machine read with a platform's tokens (source.access token) previews what its platform puts (PUT /machines/{name}/previews/{pull_request}), no comment written.
310
+ * Whether a pull request opened against its branch is previewed: its head built into a machine of its own, <name>-pr<n>, in this environment, with this environment's settings and secrets, answering at <name>-pr<n>-<ref> until the pull request closes; the pull request is told where in a comment. Any environment previews, production's too: the pull request's code runs with the environment's settings, secrets and users, with a database of its own when the machine runs its database's migrations. A machine read with a platform's tokens (source.access token) previews what its platform puts (PUT /machines/{name}/previews/{pull_request}), no comment written.
311
311
  */
312
312
  previews?: boolean;
313
313
  /**
@@ -396,7 +396,7 @@ export type MachineUpdate = {
396
396
  */
397
397
  replicas?: number;
398
398
  /**
399
- * Whether it is kept awake from now on (Machine.always_on): no version changes. Turning it on is open to an environment on Pay as you go with a balance, refused `always_on_not_available` otherwise.
399
+ * Whether it is kept awake from now on (Machine.always_on): no version changes. Turning it on is open to an environment on Pay as you go, refused `always_on_not_available` otherwise.
400
400
  */
401
401
  always_on?: boolean;
402
402
  /**
@@ -538,9 +538,13 @@ export type Database = {
538
538
  */
539
539
  awake_hours?: number;
540
540
  /**
541
- * How long its size lets it run in a month, in hours: past it, it sleeps until the month ends, and a client is told so. Absent for a size with no such limit.
541
+ * How long a Free environment's free and preview databases may run in a month between them, in hours (environment_awake_hours): past it, they sleep until the month ends, and a client is told so. Absent for a size with no such limit.
542
542
  */
543
543
  awake_hours_limit?: number;
544
+ /**
545
+ * How long the environment's free and preview databases have run this month between them, deleted ones too, in hours: what awake_hours_limit holds — a database deleted and opened again gets no new hours. Present with awake_hours_limit.
546
+ */
547
+ environment_awake_hours?: number;
544
548
  /**
545
549
  * How much it held when last measured — every database in it summed, the ones its owner made too — measured while it is awake. Absent before its first measure.
546
550
  */
@@ -802,6 +806,14 @@ export type DatabaseLimits = {
802
806
  * The connections it takes (Postgres' max_connections).
803
807
  */
804
808
  connections: number;
809
+ /**
810
+ * The sessions its direct port (5432) takes at once.
811
+ */
812
+ direct_connections: number;
813
+ /**
814
+ * The transactions its pooled port (6543) runs at once.
815
+ */
816
+ pooled_connections: number;
805
817
  };
806
818
  /**
807
819
  * One bucket of a database's usage.
@@ -965,9 +977,13 @@ export type DatabaseCreated = {
965
977
  */
966
978
  awake_hours?: number;
967
979
  /**
968
- * How long its size lets it run in a month, in hours: past it, it sleeps until the month ends, and a client is told so. Absent for a size with no such limit.
980
+ * How long a Free environment's free and preview databases may run in a month between them, in hours (environment_awake_hours): past it, they sleep until the month ends, and a client is told so. Absent for a size with no such limit.
969
981
  */
970
982
  awake_hours_limit?: number;
983
+ /**
984
+ * How long the environment's free and preview databases have run this month between them, deleted ones too, in hours: what awake_hours_limit holds — a database deleted and opened again gets no new hours. Present with awake_hours_limit.
985
+ */
986
+ environment_awake_hours?: number;
971
987
  /**
972
988
  * How much it held when last measured — every database in it summed, the ones its owner made too — measured while it is awake. Absent before its first measure.
973
989
  */
@@ -1197,6 +1213,14 @@ export type DatabaseSize = {
1197
1213
  * A week asleep, its volume is taken back and its next connection brings it back from its backup.
1198
1214
  */
1199
1215
  archives: boolean;
1216
+ /**
1217
+ * How many sessions its direct port (5432) takes at once: a session holds one until it ends, and a client past them is refused (53300).
1218
+ */
1219
+ direct_connections: number;
1220
+ /**
1221
+ * How many transactions its pooled port (6543) runs at once, however many of its clients are connected: a transaction that finds none of them free within 20 s is refused (53300).
1222
+ */
1223
+ pooled_connections: number;
1200
1224
  /**
1201
1225
  * A size counted against the project's free databases; the others are paid for.
1202
1226
  */
@@ -1476,7 +1500,7 @@ export type Site = {
1476
1500
  source: SiteSourceView;
1477
1501
  build: SiteBuildSettings;
1478
1502
  /**
1479
- * Whether a pull request opened against its source's branch is previewed: its head built, with this environment's build settings, into a release of its own that answers at <name>-pr<n>-<ref> until the pull request closes — never what the site serves, none of its releases; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's.
1503
+ * Whether a pull request opened against its source's branch is previewed: its head built, with this environment's build settings, into a release of its own that answers at <name>-pr<n>-<ref> until the pull request closes — never what the site serves, none of its releases; the pull request is told where in a comment. Any environment previews, production's too: the pull request's build runs with the environment's settings.
1480
1504
  */
1481
1505
  previews: boolean;
1482
1506
  /**
@@ -1522,7 +1546,7 @@ export type SiteCreate = {
1522
1546
  source?: SiteSource;
1523
1547
  build?: SiteBuildSettings;
1524
1548
  /**
1525
- * Whether a pull request opened against its source's branch is previewed: its head built, with this environment's build settings, into a release of its own that answers at <name>-pr<n>-<ref> until the pull request closes — never what the site serves, none of its releases; the pull request is told where in a comment. Turn it on in an environment kept for previews, not production's.
1549
+ * Whether a pull request opened against its source's branch is previewed: its head built, with this environment's build settings, into a release of its own that answers at <name>-pr<n>-<ref> until the pull request closes — never what the site serves, none of its releases; the pull request is told where in a comment. Any environment previews, production's too: the pull request's build runs with the environment's settings.
1526
1550
  */
1527
1551
  previews?: boolean;
1528
1552
  /**
@@ -1858,7 +1882,7 @@ export type PreviewOpened = {
1858
1882
  commit: string;
1859
1883
  };
1860
1884
  /**
1861
- * A platform's pull request: its branch — one of the machine's repository's own — the head its machine's preview builds, and the token it is read with.
1885
+ * A platform's pull request: its branch — one of the machine's repository's own — the head its machine's preview builds, and, for a machine read with a platform's tokens, the token it is read with.
1862
1886
  */
1863
1887
  export type PreviewDeploy = {
1864
1888
  /**
@@ -1870,9 +1894,9 @@ export type PreviewDeploy = {
1870
1894
  */
1871
1895
  commit?: string;
1872
1896
  /**
1873
- * A GitHub App installation's token (ghs_…) for the machine's repository alone, read-only: used once, never kept.
1897
+ * For a machine read with a platform's tokens (source.access token), and required for one: a GitHub App installation's token (ghs_…) for the machine's repository alone, read-only, used once, never kept. A machine read with Palbase's GitHub App takes none (400 token_not_taken): its branch is read with the project's installation.
1874
1898
  */
1875
- git_access_token: string;
1899
+ git_access_token?: string;
1876
1900
  };
1877
1901
  /** Palbase Machines */
1878
1902
  export declare function client(t: Transport): {
@@ -2044,7 +2068,7 @@ export declare function client(t: Transport): {
2044
2068
  /**
2045
2069
  * Open or update a platform's pull request preview
2046
2070
  *
2047
- * For a machine read with a platform's tokens (source.access token: PalCore's, whose repositories have no Palbase App, so no pull request is heard here): opens the preview of the pull request at the head of its branch — one of the machine's repository's own: a fork's is not built — its own machine, <name>-pr<n>, and a database of its own when the machine runs its database's migrations — or builds the open one at it, and opens one that went idle again. The branch is read with git_access_token, a GitHub App installation's token for the machine's repository alone (ghs_…), once; a commit named must be the branch's head (409 commit_not_head). Its address and state are read with GET /machines/{name}/previews; the platform tells its pull request itself. Refused in a production environment (409 previews_in_production), for a machine read with Palbase's GitHub App (409 previews_from_github), with previews off (409 previews_off), and when the environment's limits refuse the preview (409 preview_refused, with why).
2071
+ * For a platform — PalCore — that previews its product's machine itself: one read with its tokens (source.access token), whose pull requests are not heard here, or one read with Palbase's GitHub App, whose numbers then are the platform's (a pull request GitHub told of keeps its own: 409 preview_taken). Opens the preview of the pull request at the head of its branch — one of the machine's repository's own: a fork's is not built — its own machine, <name>-pr<n>, and a database of its own when the machine runs its database's migrations — or builds the open one at it, and opens one that went idle again. A machine read with tokens has its branch read with git_access_token, a GitHub App installation's token for the machine's repository alone (ghs_…), once (400 token_required without); one read with Palbase's App, with the project's installation (400 token_not_taken with one). A commit named must be the branch's head (409 commit_not_head). Any environment previews, production's too: the preview runs with its settings, secrets and users. Its address and state are read with GET /machines/{name}/previews; the platform tells its pull request itself. Refused with previews off (409 previews_off), and when the environment's limits refuse the preview (409 preview_refused, with why).
2048
2072
  */
2049
2073
  putMachinePreview(input: {
2050
2074
  path: {
@@ -2057,7 +2081,7 @@ export declare function client(t: Transport): {
2057
2081
  /**
2058
2082
  * Close a platform's pull request preview
2059
2083
  *
2060
- * For a machine read with a platform's tokens: closes the preview of the pull request, its pull request closed — its machine and its own database are deleted at once. A machine read with Palbase's GitHub App has its previews closed as GitHub tells (409 previews_from_github).
2084
+ * Closes a preview its platform put (PUT): its machine and its own database are deleted at once. A preview GitHub told of closes as its pull request does (409 previews_from_github).
2061
2085
  */
2062
2086
  deleteMachinePreview(input: {
2063
2087
  path: {