@mountaya/studio 0.1.0 → 0.2.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 (260) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/agent/index.cjs +2561 -2815
  3. package/dist/agent/index.cjs.map +1 -1
  4. package/dist/agent/index.d.cts +766 -786
  5. package/dist/agent/index.d.ts +766 -786
  6. package/dist/agent/index.js +2553 -2790
  7. package/dist/agent/index.js.map +1 -1
  8. package/dist/chunk-3Oi_Zrtm.js +9 -0
  9. package/dist/chunk-3Oi_Zrtm.js.map +1 -0
  10. package/dist/chunk-B18OPIu_.js +6 -0
  11. package/dist/chunk-B18OPIu_.js.map +1 -0
  12. package/dist/chunk-B5Uz3Qct.cjs +15 -0
  13. package/dist/chunk-B5Uz3Qct.cjs.map +1 -0
  14. package/dist/chunk-BBEJwkd3.d.cts +839 -0
  15. package/dist/chunk-BIEc_SkR.cjs +29 -0
  16. package/dist/chunk-BIEc_SkR.cjs.map +1 -0
  17. package/dist/chunk-BKMFOe-N.js +171 -0
  18. package/dist/chunk-BKMFOe-N.js.map +1 -0
  19. package/dist/chunk-BP4uy7E1.d.ts +11583 -0
  20. package/dist/chunk-BSHTsFiB.js +1403 -0
  21. package/dist/chunk-BSHTsFiB.js.map +1 -0
  22. package/dist/chunk-BTUUABGI.js +17 -0
  23. package/dist/chunk-BTUUABGI.js.map +1 -0
  24. package/dist/chunk-BaPiaz5X.cjs +115 -0
  25. package/dist/chunk-BaPiaz5X.cjs.map +1 -0
  26. package/dist/chunk-BeCVpkYr.cjs +542 -0
  27. package/dist/chunk-BeCVpkYr.cjs.map +1 -0
  28. package/dist/chunk-BgngsvK8.cjs +6202 -0
  29. package/dist/chunk-BgngsvK8.cjs.map +1 -0
  30. package/dist/chunk-BhInd7CJ.d.cts +253 -0
  31. package/dist/chunk-Bn6ZbxkS.cjs +27 -0
  32. package/dist/chunk-By9ZnkVI.js +60 -0
  33. package/dist/chunk-By9ZnkVI.js.map +1 -0
  34. package/dist/chunk-BzqPhxsz.cjs +367 -0
  35. package/dist/chunk-BzqPhxsz.cjs.map +1 -0
  36. package/dist/chunk-C2mMX81q.d.ts +443 -0
  37. package/dist/chunk-C2rr9Q0V.cjs +1402 -0
  38. package/dist/chunk-C2rr9Q0V.cjs.map +1 -0
  39. package/dist/{directorThreads-CqmvsV8b.d.cts → chunk-CDJCbwIQ.d.cts} +20 -22
  40. package/dist/chunk-CLGvBOVH.d.cts +1654 -0
  41. package/dist/chunk-COdw1dc6.d.ts +525 -0
  42. package/dist/chunk-CQCJnT2i.d.ts +511 -0
  43. package/dist/chunk-CSyHY67q.cjs +353 -0
  44. package/dist/chunk-CSyHY67q.cjs.map +1 -0
  45. package/dist/chunk-CiK1Iqrv.js +950 -0
  46. package/dist/chunk-CiK1Iqrv.js.map +1 -0
  47. package/dist/chunk-CmJBgSwZ.cjs +24 -0
  48. package/dist/chunk-CmJBgSwZ.cjs.map +1 -0
  49. package/dist/chunk-CnrsRK2u.cjs +83 -0
  50. package/dist/chunk-CnrsRK2u.cjs.map +1 -0
  51. package/dist/chunk-Co782_9r.js +326 -0
  52. package/dist/chunk-Co782_9r.js.map +1 -0
  53. package/dist/chunk-Csr3KDpZ.cjs +32 -0
  54. package/dist/chunk-Csr3KDpZ.cjs.map +1 -0
  55. package/dist/chunk-CwkmccXv.js +89 -0
  56. package/dist/chunk-CwkmccXv.js.map +1 -0
  57. package/dist/chunk-D0Q4iL9B.cjs +255 -0
  58. package/dist/chunk-D0Q4iL9B.cjs.map +1 -0
  59. package/dist/chunk-DFwiSzUS.cjs +72 -0
  60. package/dist/chunk-DFwiSzUS.cjs.map +1 -0
  61. package/dist/chunk-DIFayl2P.d.cts +443 -0
  62. package/dist/chunk-DIGF58ux.d.cts +525 -0
  63. package/dist/chunk-DKuuuld5.js +101 -0
  64. package/dist/chunk-DKuuuld5.js.map +1 -0
  65. package/dist/chunk-DMePkFEo.js +5054 -0
  66. package/dist/chunk-DMePkFEo.js.map +1 -0
  67. package/dist/chunk-DO5SIBgu.js +305 -0
  68. package/dist/chunk-DO5SIBgu.js.map +1 -0
  69. package/dist/chunk-DOQ_7eE5.d.ts +6662 -0
  70. package/dist/{tabs-B2nRO4p_.d.ts → chunk-DThaaNeb.d.cts} +2 -2
  71. package/dist/{tabs-B2nRO4p_.d.cts → chunk-DThaaNeb.d.ts} +2 -2
  72. package/dist/{directorThreads-CqmvsV8b.d.ts → chunk-DUQzjUJy.d.ts} +20 -22
  73. package/dist/chunk-DX37IPhV.cjs +1903 -0
  74. package/dist/chunk-DX37IPhV.cjs.map +1 -0
  75. package/dist/chunk-Damps5Tk.cjs +155 -0
  76. package/dist/chunk-Damps5Tk.cjs.map +1 -0
  77. package/dist/chunk-DbK5PhpJ.d.ts +1654 -0
  78. package/dist/chunk-De0vAASv.d.ts +253 -0
  79. package/dist/chunk-DhSZ7YZt.d.cts +6662 -0
  80. package/dist/chunk-DjEvqvPA.cjs +43 -0
  81. package/dist/chunk-DjEvqvPA.cjs.map +1 -0
  82. package/dist/{saveFile-j-1kkApx.d.cts → chunk-DkwDzwvu.d.cts} +7 -9
  83. package/dist/{saveFile-j-1kkApx.d.ts → chunk-DkwDzwvu.d.ts} +7 -9
  84. package/dist/chunk-Dmszv9If.js +71 -0
  85. package/dist/chunk-Dmszv9If.js.map +1 -0
  86. package/dist/chunk-Dp_ftNWY.d.cts +511 -0
  87. package/dist/chunk-DsHQySz0.js +31 -0
  88. package/dist/chunk-DsHQySz0.js.map +1 -0
  89. package/dist/chunk-DwoUyHHh.js +281 -0
  90. package/dist/chunk-DwoUyHHh.js.map +1 -0
  91. package/dist/chunk-IaIDQflj.d.cts +2315 -0
  92. package/dist/chunk-IaIDQflj.d.ts +2315 -0
  93. package/dist/chunk-cVXLsZfL.d.ts +839 -0
  94. package/dist/chunk-mIaCX9EJ.d.cts +11583 -0
  95. package/dist/chunk-nJQxbOwQ.cjs +8962 -0
  96. package/dist/chunk-nJQxbOwQ.cjs.map +1 -0
  97. package/dist/chunk-o9jaxhCO.js +8852 -0
  98. package/dist/chunk-o9jaxhCO.js.map +1 -0
  99. package/dist/chunk-p-Tt_Lwz.js +14 -0
  100. package/dist/chunk-p-Tt_Lwz.js.map +1 -0
  101. package/dist/engines/index.cjs +2046 -3401
  102. package/dist/engines/index.cjs.map +1 -1
  103. package/dist/engines/index.d.cts +1510 -1550
  104. package/dist/engines/index.d.ts +1510 -1550
  105. package/dist/engines/index.js +2039 -3380
  106. package/dist/engines/index.js.map +1 -1
  107. package/dist/handlers/index.cjs +47 -93
  108. package/dist/handlers/index.cjs.map +1 -1
  109. package/dist/handlers/index.d.cts +61 -103
  110. package/dist/handlers/index.d.ts +61 -103
  111. package/dist/handlers/index.js +27 -36
  112. package/dist/handlers/index.js.map +1 -1
  113. package/dist/index.cjs +3347 -4398
  114. package/dist/index.cjs.map +1 -1
  115. package/dist/index.d.cts +8 -7297
  116. package/dist/index.d.ts +8 -7297
  117. package/dist/index.js +2997 -3187
  118. package/dist/index.js.map +1 -1
  119. package/dist/plugins/index.cjs +482 -949
  120. package/dist/plugins/index.cjs.map +1 -1
  121. package/dist/plugins/index.d.cts +44 -61
  122. package/dist/plugins/index.d.ts +44 -61
  123. package/dist/plugins/index.js +471 -915
  124. package/dist/plugins/index.js.map +1 -1
  125. package/dist/seams/index.cjs +77 -140
  126. package/dist/seams/index.cjs.map +1 -1
  127. package/dist/seams/index.d.cts +125 -158
  128. package/dist/seams/index.d.ts +125 -158
  129. package/dist/seams/index.js +41 -71
  130. package/dist/seams/index.js.map +1 -1
  131. package/dist/strings/fr/index.cjs +2130 -2116
  132. package/dist/strings/fr/index.cjs.map +1 -1
  133. package/dist/strings/fr/index.d.cts +3 -5
  134. package/dist/strings/fr/index.d.ts +3 -5
  135. package/dist/strings/fr/index.js +2125 -2114
  136. package/dist/strings/fr/index.js.map +1 -1
  137. package/dist/strings/index.cjs +2331 -2625
  138. package/dist/strings/index.cjs.map +1 -1
  139. package/dist/strings/index.d.cts +3 -731
  140. package/dist/strings/index.d.ts +3 -731
  141. package/dist/strings/index.js +2324 -2615
  142. package/dist/strings/index.js.map +1 -1
  143. package/dist/testing/index.cjs +214 -276
  144. package/dist/testing/index.cjs.map +1 -1
  145. package/dist/testing/index.d.cts +61 -121
  146. package/dist/testing/index.d.ts +61 -121
  147. package/dist/testing/index.js +208 -273
  148. package/dist/testing/index.js.map +1 -1
  149. package/dist/time/index.cjs +23 -23
  150. package/dist/time/index.cjs.map +1 -1
  151. package/dist/time/index.d.cts +5 -7
  152. package/dist/time/index.d.ts +5 -7
  153. package/dist/time/index.js +18 -21
  154. package/dist/time/index.js.map +1 -1
  155. package/package.json +14 -15
  156. package/src/agent/rules/stateDelta.ts +1 -0
  157. package/src/agent/stores/agentThreads.ts +1 -4
  158. package/src/bus/rules/bus.ts +1 -2
  159. package/src/bus/rules/defineRegistry.ts +3 -5
  160. package/src/bus/rules/types.ts +6 -7
  161. package/src/chrome/stores/uiStore.ts +4 -2
  162. package/src/embed/rules/fieldDependencies.ts +2 -0
  163. package/src/embed/rules/safetyRules.ts +2 -0
  164. package/src/embed/rules/tableCode.ts +4 -3
  165. package/src/index.ts +6 -27
  166. package/src/itinerary/rules/import.ts +6 -8
  167. package/src/plugins/contracts/plugin.ts +4 -2
  168. package/src/seams/rules/formatters.ts +5 -3
  169. package/src/testing/index.ts +1 -5
  170. package/src/viewer/rules/platformViewer.ts +1 -0
  171. package/dist/bus-BwiNiXdH.d.ts +0 -514
  172. package/dist/bus-DzmhPwdK.d.cts +0 -514
  173. package/dist/chainModel-B23pEP_1.d.cts +0 -127
  174. package/dist/chainModel-B23pEP_1.d.ts +0 -127
  175. package/dist/chunk-2HFY7ETU.js +0 -5721
  176. package/dist/chunk-2HFY7ETU.js.map +0 -1
  177. package/dist/chunk-355TOXSB.js +0 -72
  178. package/dist/chunk-355TOXSB.js.map +0 -1
  179. package/dist/chunk-4ZCUZVSV.js +0 -10275
  180. package/dist/chunk-4ZCUZVSV.js.map +0 -1
  181. package/dist/chunk-6HEKY3NF.js +0 -95
  182. package/dist/chunk-6HEKY3NF.js.map +0 -1
  183. package/dist/chunk-7GFLGGBX.cjs +0 -8
  184. package/dist/chunk-7GFLGGBX.cjs.map +0 -1
  185. package/dist/chunk-7NBRCENN.cjs +0 -19
  186. package/dist/chunk-7NBRCENN.cjs.map +0 -1
  187. package/dist/chunk-AF5GCXE3.js +0 -8
  188. package/dist/chunk-AF5GCXE3.js.map +0 -1
  189. package/dist/chunk-CJDIFRGZ.cjs +0 -2005
  190. package/dist/chunk-CJDIFRGZ.cjs.map +0 -1
  191. package/dist/chunk-CNPZY7N3.js +0 -349
  192. package/dist/chunk-CNPZY7N3.js.map +0 -1
  193. package/dist/chunk-DZJHTWSF.cjs +0 -45
  194. package/dist/chunk-DZJHTWSF.cjs.map +0 -1
  195. package/dist/chunk-EABIHHWA.js +0 -42
  196. package/dist/chunk-EABIHHWA.js.map +0 -1
  197. package/dist/chunk-EKZWV6RS.cjs +0 -415
  198. package/dist/chunk-EKZWV6RS.cjs.map +0 -1
  199. package/dist/chunk-EOKRXXAC.cjs +0 -24
  200. package/dist/chunk-EOKRXXAC.cjs.map +0 -1
  201. package/dist/chunk-F73W2ZTJ.js +0 -1126
  202. package/dist/chunk-F73W2ZTJ.js.map +0 -1
  203. package/dist/chunk-H4DVOZ5O.js +0 -1897
  204. package/dist/chunk-H4DVOZ5O.js.map +0 -1
  205. package/dist/chunk-HI52PBFT.cjs +0 -10314
  206. package/dist/chunk-HI52PBFT.cjs.map +0 -1
  207. package/dist/chunk-IDBXFBLG.cjs +0 -1225
  208. package/dist/chunk-IDBXFBLG.cjs.map +0 -1
  209. package/dist/chunk-LBWTJZUJ.js +0 -297
  210. package/dist/chunk-LBWTJZUJ.js.map +0 -1
  211. package/dist/chunk-NCLA6DKD.cjs +0 -310
  212. package/dist/chunk-NCLA6DKD.cjs.map +0 -1
  213. package/dist/chunk-O4MC5DPD.js +0 -19
  214. package/dist/chunk-O4MC5DPD.js.map +0 -1
  215. package/dist/chunk-OP37FKW6.cjs +0 -98
  216. package/dist/chunk-OP37FKW6.cjs.map +0 -1
  217. package/dist/chunk-OQSYFH3Z.cjs +0 -5945
  218. package/dist/chunk-OQSYFH3Z.cjs.map +0 -1
  219. package/dist/chunk-PACIO4NS.cjs +0 -26
  220. package/dist/chunk-PACIO4NS.cjs.map +0 -1
  221. package/dist/chunk-PSZ2R3TC.cjs +0 -75
  222. package/dist/chunk-PSZ2R3TC.cjs.map +0 -1
  223. package/dist/chunk-QFO5CZG2.cjs +0 -136
  224. package/dist/chunk-QFO5CZG2.cjs.map +0 -1
  225. package/dist/chunk-QL63MUEW.cjs +0 -140
  226. package/dist/chunk-QL63MUEW.cjs.map +0 -1
  227. package/dist/chunk-RFUPPVZO.js +0 -17
  228. package/dist/chunk-RFUPPVZO.js.map +0 -1
  229. package/dist/chunk-RPG2LWMP.js +0 -23
  230. package/dist/chunk-RPG2LWMP.js.map +0 -1
  231. package/dist/chunk-TIBXK6B7.cjs +0 -12
  232. package/dist/chunk-TIBXK6B7.cjs.map +0 -1
  233. package/dist/chunk-UU65VNEV.js +0 -381
  234. package/dist/chunk-UU65VNEV.js.map +0 -1
  235. package/dist/chunk-VGX6TR2I.js +0 -209
  236. package/dist/chunk-VGX6TR2I.js.map +0 -1
  237. package/dist/chunk-WUTDDBVP.js +0 -130
  238. package/dist/chunk-WUTDDBVP.js.map +0 -1
  239. package/dist/chunk-WVQQLKCI.cjs +0 -224
  240. package/dist/chunk-WVQQLKCI.cjs.map +0 -1
  241. package/dist/chunk-WZYXG3SE.js +0 -111
  242. package/dist/chunk-WZYXG3SE.js.map +0 -1
  243. package/dist/chunk-XDI2X3KE.js +0 -6
  244. package/dist/chunk-XDI2X3KE.js.map +0 -1
  245. package/dist/chunk-XKHLRIC7.cjs +0 -381
  246. package/dist/chunk-XKHLRIC7.cjs.map +0 -1
  247. package/dist/context-DNtd2WUv.d.cts +0 -11666
  248. package/dist/context-DgB72Bur.d.ts +0 -11666
  249. package/dist/en-Bu4Ti9Ev.d.cts +0 -2315
  250. package/dist/en-Bu4Ti9Ev.d.ts +0 -2315
  251. package/dist/shareLink-B6hlt942.d.ts +0 -144
  252. package/dist/shareLink-C7rIMb7x.d.ts +0 -527
  253. package/dist/shareLink-CnTxxXjp.d.cts +0 -144
  254. package/dist/shareLink-DyZVYH2V.d.cts +0 -527
  255. package/dist/studioPlugin-C3C7VjMy.d.ts +0 -847
  256. package/dist/studioPlugin-Cf3OBNUv.d.cts +0 -847
  257. package/dist/types-BzJRV6UI.d.cts +0 -845
  258. package/dist/types-BzJRV6UI.d.ts +0 -845
  259. package/dist/zoneForm-CdYNtnnA.d.cts +0 -320
  260. package/dist/zoneForm-mG85yt5e.d.ts +0 -320
@@ -1,144 +0,0 @@
1
- import { d as ToolFailure, e as ToolResult } from './types-BzJRV6UI.cjs';
2
-
3
- /**
4
- * ShareLinkScope says whether a resource can hold a share link at all. A share link belongs to
5
- * an organization, so the answer is who owns the resource:
6
- *
7
- * - `"organization"`: an organization owns it, so its link is read, created, reset and disabled.
8
- * - `"personal"`: no organization owns it. The API creates and resets nothing for it, so no
9
- * surface reads or creates one, and Disable stays, because a link the resource still stores
10
- * stays until its owner clears it.
11
- * - `"pending"`: the record that answers is still loading. Nothing is read until it does, so a
12
- * personal resource is never asked about a link it cannot hold.
13
- */
14
- type ShareLinkScope = "organization" | "pending" | "personal";
15
- /** ShareLinkScopeInput is what {@link shareLinkScope} decides from. */
16
- interface ShareLinkScopeInput {
17
- /**
18
- * Whether the read of the record failed. Read only while `record` is undefined: a record that
19
- * loaded answers whatever an earlier read did.
20
- */
21
- readonly failed: boolean;
22
- /**
23
- * The host's predicate for the reader's own scope, `StudioScopeSeam.isPersonalScope`: personal
24
- * scope has more than one spelling, and the host that knows its own is the one that answers.
25
- */
26
- readonly isPersonalScope: (organizationId: string | null | undefined) => boolean;
27
- /**
28
- * The record that names the resource's owner, or undefined while it has not loaded. Only its
29
- * `organization_id` is read, which an itinerary and a collection both carry, so a caller hands
30
- * over the record it holds.
31
- */
32
- readonly record: {
33
- readonly organization_id?: string | null | undefined;
34
- } | undefined;
35
- }
36
- /**
37
- * shareLinkScope decides whether a resource can hold a share link, from the record that names
38
- * its owner. It is the one answer every surface that manages a link reads, for an itinerary and
39
- * for a collection alike:
40
- *
41
- * - `"pending"` while the record has not loaded, so nothing is read before the owner is known.
42
- * - `"organization"` when the read of the record failed. The owner is unknown for good, and an
43
- * unknown owner leaves the question to the API, which refuses a link no organization owns.
44
- * - `"organization"` for a record an organization owns, by `isPublishableScope`.
45
- * - `"personal"` for every other record: one no organization owns, one the host's predicate
46
- * reads as the reader's own, and one whose owner is still the empty string.
47
- *
48
- * @example
49
- * ```ts
50
- * declare const collection: { organization_id: string | null } | undefined;
51
- * declare const isError: boolean;
52
- * declare const isPersonalScope: (organizationId: string | null | undefined) => boolean;
53
- *
54
- * const scope = shareLinkScope({ failed: isError, isPersonalScope, record: collection });
55
- * ```
56
- */
57
- declare const shareLinkScope: (input: ShareLinkScopeInput) => ShareLinkScope;
58
- /**
59
- * isRetryableShareLinkFailure reports whether asking again could turn a refused read of a share
60
- * link into an answer, or a refused mint into a link.
61
- *
62
- * A refusal the caller would meet again is an answer: no permission to manage the link, a
63
- * capability the surface lacks, a resource that is gone, an agreement that does not include it.
64
- * A retry there sends the identical request and is refused identically, so a surface withholds
65
- * it and lets the reason stand alone.
66
- * Everything else is an interruption a second attempt can clear and keeps the retry: a timeout,
67
- * a rate limit, a transport error, and a failure that carries no code at all.
68
- *
69
- * @param failure The refusal the read or the mint answered.
70
- */
71
- declare const isRetryableShareLinkFailure: (failure: ToolFailure) => boolean;
72
- /**
73
- * isShareLinkDisableSettled reports whether a disable left the resource with no active share
74
- * link, which is what its reader asked for.
75
- *
76
- * A disable that ran settles it. So does `not-found` on a `"personal"` resource: its Disable is
77
- * offered without knowing a link exists, so that answer is the API saying none was active. A
78
- * surface reports it as done, with words of its own, because the code's shared copy says the
79
- * resource itself is gone.
80
- *
81
- * On any other scope `not-found` stays a failure: the link was minted in the same surface, so a
82
- * link that is missing went away under it. Every other refusal is a failure in every scope.
83
- *
84
- * @param result What `studio.shareLink.disable` answered.
85
- * @param scope The scope of the resource the disable was sent for.
86
- */
87
- declare const isShareLinkDisableSettled: (result: ToolResult, scope: ShareLinkScope) => boolean;
88
- /**
89
- * ShareLinkActionAvailability is what one management action of a share link is worth offering:
90
- *
91
- * - `"ready"`: live. The viewer may run it and there is something for it to act on.
92
- * - `"waiting"`: shown and disabled with no reason given, because the record that answers is
93
- * loading or there is no link (none read yet, or none set), or, in a `ShareLinkEngine`'s
94
- * snapshot, because an action of the link is in flight. "Not yet" is no refusal.
95
- * - `"denied"`: shown and disabled, with the rule as its reason. The viewer does not hold the
96
- * edit grant the link's every verb needs.
97
- * - `"unavailable"`: not offered at all, because the resource cannot hold what the action makes.
98
- */
99
- type ShareLinkActionAvailability = "denied" | "ready" | "unavailable" | "waiting";
100
- /** ShareLinkActions is the availability of each management action of a share link. */
101
- interface ShareLinkActions {
102
- /** Disable, which revokes the link. Offered in every scope, so never `"unavailable"`. */
103
- readonly disable: Exclude<ShareLinkActionAvailability, "unavailable">;
104
- /** Reset, which retires the link's token and issues another. */
105
- readonly rotate: ShareLinkActionAvailability;
106
- }
107
- /** ShareLinkActionsInput is what {@link shareLinkActions} decides from. */
108
- interface ShareLinkActionsInput {
109
- /**
110
- * Whether the viewer holds the edit grant on the resource, which reading, creating, resetting
111
- * and disabling its link all need: a write role in the organization that owns it, or, for a
112
- * personal resource, its authorship. Read once `scope` is no longer `"pending"`: a caller
113
- * answers false while the record that answers is loading, and the scope says it is.
114
- */
115
- readonly canManage: boolean;
116
- /** Whether the resource can hold a link at all. */
117
- readonly scope: ShareLinkScope;
118
- /** The link's token, or null while there is none, or none has been read. */
119
- readonly token: string | null;
120
- }
121
- /**
122
- * shareLinkActions decides what Reset and Disable are worth offering for a share link.
123
- *
124
- * Both are always answered, so a surface draws the same action row from its first frame and
125
- * moves nothing when the read of the link and the capability land:
126
- *
127
- * - On an organization's resource both are `"denied"` to a viewer without the edit grant, who is
128
- * sent no read and so never holds a link, and otherwise wait for a link and then are
129
- * `"ready"`. A resource with no link set leaves both waiting until the reader creates one.
130
- * - While the scope is `"pending"` both wait for a link and then follow `canManage`. With no link
131
- * the refusal is withheld: `canManage` is false for everyone while its record loads, and
132
- * stating the rule then would state a rule that may not apply.
133
- * - On a `"personal"` resource Reset is `"unavailable"`, because a reset issues a fresh link and
134
- * the API refuses one. Disable follows `canManage` alone: there is no token to wait on, and a
135
- * scope reads personal only once the record that answers the capability has loaded, so a
136
- * refusal there is an answer.
137
- *
138
- * A proactive gate: it decides what a surface offers, and the tool bus and the API refuse a
139
- * verb the viewer's role does not cover either way.
140
- */
141
- declare const shareLinkActions: (input: ShareLinkActionsInput) => ShareLinkActions;
142
-
143
- export { isShareLinkDisableSettled as e, shareLinkScope as f, isRetryableShareLinkFailure as i, shareLinkActions as s };
144
- export type { ShareLinkScope as S, ShareLinkActions as a, ShareLinkActionAvailability as b, ShareLinkActionsInput as c, ShareLinkScopeInput as d };
@@ -1,527 +0,0 @@
1
- import { S as StudioToolContext, a as StudioToolInputs, c as StudioToolOutputs, h as ShareLinkTarget } from './context-DNtd2WUv.cjs';
2
- import { d as ToolFailure, c as ToolResultOf } from './types-BzJRV6UI.cjs';
3
- import { S as ShareLinkScope, a as ShareLinkActions } from './shareLink-CnTxxXjp.cjs';
4
-
5
- /** The tools a share link runs, by name. */
6
- type ShareLinkTool = "studio.shareLink.disable" | "studio.shareLink.mint" | "studio.shareLink.rotate";
7
- /**
8
- * ShareLinkDispatch runs one of the tools a share link runs in the given context, and resolves
9
- * with the tool's result.
10
- *
11
- * The result holds that tool's own data, as {@link StudioToolOutputs} states it: an `ok` answer
12
- * of a mint and of a reset holds the share token, which is never empty. So the dispatch a host
13
- * hands over is one typed by the studio's outputs: a bus built with `StudioToolInputs` and
14
- * `StudioToolOutputs`, or a binding's own dispatch that answers each verb's data.
15
- *
16
- * The type is all that holds a host's own dispatch to that, and a bus parses no answer. So the
17
- * engine reads the token through `mintedShareToken`, whose rule for a token is the contract's:
18
- * an `ok` answer that holds none is no link. A mint answered so is the failure with nothing to
19
- * word (see {@link ShareLinkFailure}), and a reset answered so resolves `"refused"` (see
20
- * {@link ShareLinkEngine.rotate}).
21
- *
22
- * It takes the context because a reset and a disable run in one the engine layers its own
23
- * confirm gate over (see {@link ShareLinkEngine.rotate}). A tool bus's dispatch never rejects: a
24
- * refusal is a result whose `ok` is false. One that throws or rejects all the same is answered
25
- * as a refusal the engine builds from what was thrown, and never reaches the engine's caller. A
26
- * host holding a bus writes it as `(context, name, input) => bus.dispatch(context, name, input)`.
27
- */
28
- type ShareLinkDispatch = <TName extends ShareLinkTool>(context: StudioToolContext, name: TName, input: StudioToolInputs[TName]) => Promise<ToolResultOf<StudioToolOutputs, TName>>;
29
- /**
30
- * ShareLinkReadResult is what a read of a share link answers: the link's token, null where the
31
- * resource has none set, or the refusal.
32
- */
33
- type ShareLinkReadResult = {
34
- readonly ok: true;
35
- /** The link's token, or null where no link is set. Never empty. */
36
- readonly token: string | null;
37
- } | ToolFailure;
38
- /**
39
- * ShareLinkRead reads a resource's share link without setting one, in the given context, and
40
- * resolves with what it found.
41
- *
42
- * `readShareLink` of `@mountaya/studio/handlers` is the studio's own: it reads an itinerary's link
43
- * through the context's persistence and a collection's through its client, and answers a
44
- * refusal rather than throwing. A read of the host's own is held to the same answer by its type
45
- * alone, so the engine holds an `ok` token to the contract's rule for one (a token that is empty
46
- * is no link) and answers one that throws or rejects as the refusal it builds from what was
47
- * thrown.
48
- *
49
- * A read and not a dispatch, because opening a share surface changes nothing: no verb runs, no
50
- * confirmation is asked, and the token it finds enters no transcript.
51
- */
52
- type ShareLinkRead = (context: StudioToolContext, target: ShareLinkTarget) => Promise<ShareLinkReadResult>;
53
- /**
54
- * ShareLinkConfig is what a share link reads from its host, all of it replaceable mid-life
55
- * through {@link ShareLinkEngine.configure}.
56
- */
57
- interface ShareLinkConfig {
58
- /**
59
- * Whether the viewer holds the edit grant on the resource, which reading, creating, resetting
60
- * and disabling its link all need: a write role in the organization that owns it, or, for a
61
- * personal resource, its authorship. False while the record that answers is loading. No read
62
- * is sent without it, so a viewer whose role reads only is never handed a link, nor asked to
63
- * meet the refusal the API would answer.
64
- */
65
- readonly canManage: boolean;
66
- /**
67
- * The tool context the link's tools and its read run in. Read when one is run, so the one
68
- * configured last is the one used, and never copied: a reset and a disable run in a layer over
69
- * it, which keeps its late-bound seams resolving when they are read.
70
- */
71
- readonly context: StudioToolContext;
72
- /** Runs the link's tools. Read when a tool is run, so the one configured last is the one used. */
73
- readonly dispatch: ShareLinkDispatch;
74
- /**
75
- * Reads the link without setting one. Read when the link is asked for, so the one configured
76
- * last is the one used. `readShareLink` of `@mountaya/studio/handlers` is the studio's own.
77
- */
78
- readonly read: ShareLinkRead;
79
- /**
80
- * Whether the resource can hold a link at all. Only `"organization"` is ever sent a read or a
81
- * create, and only for a viewer who holds `canManage`.
82
- */
83
- readonly scope: ShareLinkScope;
84
- /**
85
- * The resource the link is for. Compared by kind and id: one that differs is another question,
86
- * so the engine drops what it held and reads again.
87
- */
88
- readonly target: ShareLinkTarget;
89
- }
90
- /**
91
- * ShareLinkEngineOptions is the {@link ShareLinkConfig} an engine starts with, plus the one
92
- * setting that is fixed for its life.
93
- */
94
- interface ShareLinkEngineOptions extends ShareLinkConfig {
95
- /**
96
- * The link's token when the host already holds it, so a surface shows the link from its first
97
- * frame. The first subscriber still reads the link, which confirms the token, replaces one that
98
- * was reset elsewhere, or drops one that was disabled elsewhere.
99
- *
100
- * @default null
101
- */
102
- readonly token?: string | null | undefined;
103
- }
104
- /**
105
- * ShareLinkFailure is a read or a create that gave no answer, as a surface shows it: the refusal
106
- * to word and whether offering a retry would be honest.
107
- */
108
- interface ShareLinkFailure {
109
- /**
110
- * The refusal, for a surface to word with its `detail` or with `mapToolError`. Null when the
111
- * request gave nothing to word: a read or a dispatch that threw or rejected, or an `ok` answer
112
- * that holds no token. A surface shows its own generic line for that one.
113
- */
114
- readonly failure: ToolFailure | null;
115
- /**
116
- * Whether asking again could answer, by `isRetryableShareLinkFailure`. Always true for a
117
- * failure with nothing to word, since a second attempt there is as good as the first.
118
- */
119
- readonly retryable: boolean;
120
- }
121
- /**
122
- * ShareLinkSnapshot is what a {@link ShareLinkEngine} answers: the link, and what the engine has
123
- * decided about it.
124
- *
125
- * It names the target it answers for, so a reader holding one knows which resource the link
126
- * opens and never takes one resource's link for another's.
127
- */
128
- interface ShareLinkSnapshot {
129
- /**
130
- * What Reset and Disable are worth offering, by `shareLinkActions` over the configured
131
- * capability and scope and the token held. {@link ShareLinkEngine.rotate} and
132
- * {@link ShareLinkEngine.disable} run only what reads `"ready"` here.
133
- *
134
- * While either is in flight, from its call to its answer and its confirmation being asked
135
- * included, neither is offered: what would read `"ready"` reads `"waiting"`, since one link
136
- * runs one action at a time. A refusal and an absence read as they do.
137
- */
138
- readonly actions: ShareLinkActions;
139
- /**
140
- * The management action whose request is running, or null. It is set when the confirmation is
141
- * approved, never while it is asked, so a surface spins a control over the request alone. One
142
- * link runs one action at a time, so it names the only one in flight.
143
- */
144
- readonly busy: keyof ShareLinkActions | null;
145
- /**
146
- * What last happened to the link through this engine, or null while nothing has: `"read"` once
147
- * a read answered, the link or that none is set, `"minted"` once a create answered with a link,
148
- * `"rotated"` and `"disabled"` once a reset and a disable settled. A surface with a live region
149
- * announces it: the swap from a placeholder to a link, or from one link to another, is
150
- * otherwise silent.
151
- */
152
- readonly change: "disabled" | "minted" | "read" | "rotated" | null;
153
- /**
154
- * Whether the engine knows if a link is set for the target: a read or a create answered, a
155
- * reset or a disable settled, or the host handed a token over. While it is false a null `token`
156
- * says nothing. Once it is true a null `token` is a resource with no link, which a surface
157
- * offers to create through {@link ShareLinkEngine.mint}.
158
- */
159
- readonly known: boolean;
160
- /**
161
- * Why the latest create gave no link, or null. It leaves when a create is asked again, when a
162
- * reset settles, when a disable sent after that create settles, and with the target it was
163
- * about.
164
- */
165
- readonly mintFailure: ShareLinkFailure | null;
166
- /** Whether a create is in flight. */
167
- readonly minting: boolean;
168
- /**
169
- * Why the latest read gave no answer, or null. It leaves when the link is read again, when a
170
- * create, a reset or a disable sent after that read settles, and with the target it was about.
171
- *
172
- * Until one of those it reads beside whatever token is held: a link the host handed over whose
173
- * confirming read failed is still the link a surface shows, with the failure and its retry.
174
- */
175
- readonly readFailure: ShareLinkFailure | null;
176
- /** Whether a read is in flight. */
177
- readonly reading: boolean;
178
- /** The resource the snapshot answers for. One object until the target changes by kind or id. */
179
- readonly target: ShareLinkTarget;
180
- /** The link's token, or null while there is no link, or none is known yet (see `known`). */
181
- readonly token: string | null;
182
- }
183
- /**
184
- * ShareLinkActionOutcome is what a reset or a disable came to, for the surface that asked:
185
- *
186
- * - `"settled"`: the link is as the reader asked. `linkWasActive` is false when a disable found
187
- * no link to revoke (see `isShareLinkDisableSettled`), which a surface reports in other words.
188
- * - `"refused"`: the verb failed. `failure` is the refusal to word. A dispatch that threw or
189
- * rejected is one too, classified as the tool bus classifies a handler that throws: `internal`
190
- * unless the thrown value carries a status the bus knows. So is a reset answered `ok` with no
191
- * token, which is `internal`.
192
- * - `"withheld"`: the confirmation was refused or left to expire, so no verb ran. There is
193
- * nothing to report: the reader got what they chose.
194
- * - `"skipped"`: the engine ran nothing, because the action was not `"ready"`, an action of
195
- * this link was already in flight, or nobody was watching.
196
- */
197
- type ShareLinkActionOutcome = {
198
- readonly failure: ToolFailure;
199
- readonly status: "refused";
200
- } | {
201
- readonly linkWasActive: boolean;
202
- readonly status: "settled";
203
- } | {
204
- readonly status: "skipped";
205
- } | {
206
- readonly status: "withheld";
207
- };
208
- /**
209
- * ShareLinkEngine is the machine behind a resource's share link: it reads the link once somebody
210
- * watches, keeps the token, that none is set, or the reason it could not tell, and creates,
211
- * resets and disables the link through the tool bus when the reader asks.
212
- *
213
- * What it does, in the order a surface meets it:
214
- *
215
- * - **The read.** The first subscriber reads the link of an `"organization"` resource through
216
- * `read`, which sets nothing, so opening a surface hands no link out. A `"pending"` scope holds
217
- * the read until the record answers, and a `"personal"` one is never sent it: the API creates
218
- * no link for one. Nor is a viewer without the edit grant (`canManage` false): the API answers
219
- * their read 403, and the snapshot's `actions` already say they may not act on a link. A grant
220
- * that lands later, once the roster that answers it has, sends the read then.
221
- * - **No link.** A read that finds none leaves the snapshot `known` with no token, and
222
- * {@link ShareLinkEngine.mint} creates one through `studio.shareLink.mint` when the reader asks.
223
- * - **A refusal.** A read or a create that gave no answer is the snapshot's `readFailure` or
224
- * `mintFailure`, with whether a retry is worth offering (`isRetryableShareLinkFailure`).
225
- * Nothing retries by itself: {@link ShareLinkEngine.read} and {@link ShareLinkEngine.mint} ask
226
- * again.
227
- * - **Reset and Disable.** {@link ShareLinkEngine.rotate} and {@link ShareLinkEngine.disable}
228
- * run what the snapshot's `actions` report `"ready"`, one at a time, and resolve with what
229
- * each came to. The tool bus asks the confirmation. A withheld one leaves nothing to report:
230
- * no verb ran, nothing spun, and the actions that waited while it was asked are offered again.
231
- *
232
- * Every write goes through `dispatch`, so a person pressing a control and an agent calling the
233
- * same tools drive one link. Each write's answer is the link as it now stands, so the engine
234
- * takes it from there and reads nothing again: a create, a reset and a disable each cost one
235
- * request.
236
- *
237
- * The lifecycle is the listeners. Constructing one runs nothing; the first subscriber reads the
238
- * link; the last unsubscribe parks. A parked engine runs no command and drops the answer of a
239
- * read that lands on it, so the next subscriber reads again. React's StrictMode mounts,
240
- * unmounts and mounts again before any answer can land, which parks and resumes around the one
241
- * read in flight and reads once. A create, a reset or a disable in flight at a park is a write
242
- * that happened, so its answer is kept. {@link ShareLinkEngine.dispose} is the latch, for an
243
- * owner that is not a component.
244
- *
245
- * A read or a create and a reset or a disable can be in flight together, and their answers land
246
- * in any order. Which answer the link stands on is decided by what each request does, and where
247
- * that leaves a doubt, by the order the requests left in: a read and a create leave when they
248
- * are sent, a reset or a disable when its confirmation is approved.
249
- *
250
- * - **A reset outranks every read and create in flight with it.** Neither issues another link
251
- * where one is set, so the token a reset answers with is the newest whichever the server ran
252
- * first. The reset's token stands whatever they answered before it, and one still in flight
253
- * when the reset settles has its answer dropped: it may carry the token the reset retired. A
254
- * reset answered `ok` with no token outranks them as well, since the server may have made it,
255
- * and the engine then reads the link that stands.
256
- * - **A disable outranks the requests sent before it, and yields to one sent after it.** A read
257
- * or a create sent first may carry the token the disable revoked, so its answer is dropped. One
258
- * sent after the disable left answers the link as it stands once the disable has run, so it is
259
- * kept whichever answer lands first, and the disable's own outcome still says what the verb
260
- * came to. The order the two left in is the order the engine takes the server to have run them
261
- * in, which is the most a client can know of it.
262
- * - **A later answer outranks an earlier one.** A read or a create whose answer lands after the
263
- * answer of one sent later is dropped, so a read that set out before a create never takes back
264
- * the link the create made.
265
- *
266
- * A request whose answer is dropped stops the snapshot reading `reading` or `minting`, unless one
267
- * of its kind sent after it is still out, and leaves the token, the `change` and the absence of a
268
- * failure the write left.
269
- *
270
- * A listener is told through `notifyListeners`: one that throws stops neither the engine nor the
271
- * listeners after it, and its fault reaches the program as an uncaught error on a microtask.
272
- *
273
- * It keeps no time: nothing here is debounced, throttled or timed out, so the engine takes no
274
- * `Clock` and arms no timer.
275
- *
276
- * @example
277
- * ```ts
278
- * declare const context: StudioToolContext;
279
- * declare const read: ShareLinkRead;
280
- * declare function render(snapshot: ShareLinkSnapshot): void;
281
- * declare function report(failure: ToolFailure): void;
282
- *
283
- * const link = new ShareLinkEngine({
284
- * canManage: true,
285
- * context,
286
- * dispatch: (context, name, input) => bus.dispatch(context, name, input),
287
- * read,
288
- * scope: "organization",
289
- * target: { id: "itin-1", kind: "itinerary" },
290
- * });
291
- * const release = link.subscribe(() => render(link.getSnapshot()));
292
- *
293
- * const outcome = await link.rotate();
294
- * if (outcome.status === "refused") {
295
- * report(outcome.failure);
296
- * }
297
- * release();
298
- * ```
299
- */
300
- declare class ShareLinkEngine {
301
- private config;
302
- /** The target the state below answers for, replaced only by one that differs by kind or id. */
303
- private target;
304
- private token;
305
- private known;
306
- private readFailure;
307
- private mintFailure;
308
- private change;
309
- private reading;
310
- private minting;
311
- /**
312
- * Whether the link has been read under this target, so that no later subscriber reads again:
313
- * its token, that none is set, its failure or its read in flight is what the engine holds. A
314
- * settled disable raises it, since its reader asked for no link.
315
- */
316
- private asked;
317
- /**
318
- * The action called under this target and not yet answered, a confirmation being asked
319
- * included, or null. One slot, because a link takes one management action at a time.
320
- */
321
- private acting;
322
- /** Whether the confirmation of {@link acting} was approved, so its request is running. */
323
- private running;
324
- /** Counts the targets answered for: an answer sent under an earlier one is ignored. */
325
- private epoch;
326
- /**
327
- * Counts the requests that left, a read and a create when they are sent and a reset or a
328
- * disable at its approval, so each one holds its place in the order they were sent.
329
- */
330
- private sent;
331
- /**
332
- * The highest place a settled write outranks, or zero while none has settled: a read or a
333
- * create sent at or before it has its answer dropped. A reset outranks every request sent by the
334
- * time it settles, and a disable the ones sent before it.
335
- */
336
- private outranked;
337
- /**
338
- * The place of the read or the create whose answer the engine holds, or zero while it holds
339
- * none of theirs.
340
- */
341
- private answeredAt;
342
- /** The place of the latest read whose answer landed while nobody watched, or zero. */
343
- private unheard;
344
- /** The place of the read whose failure the engine holds, or zero while it holds none. */
345
- private readFailedAt;
346
- /** The place of the create whose failure the engine holds, or zero while it holds none. */
347
- private mintFailedAt;
348
- /** The place of the read sent last, or zero before any, which `reading` follows. */
349
- private latestRead;
350
- /** The place of the create sent last, or zero before any, which `minting` follows. */
351
- private latestMint;
352
- private snapshot;
353
- private readonly subscriptions;
354
- /** Whether nobody is watching. A parked engine asks for nothing and runs no command. */
355
- private parked;
356
- private disposed;
357
- /**
358
- * Constructing one holds the options and does nothing else: nothing is read and no tool is run.
359
- * A React binding constructs during a render React is free to throw away, and a constructor
360
- * with a side effect would leave the discarded copy reading.
361
- */
362
- constructor(options: ShareLinkEngineOptions);
363
- /** getSnapshot returns the current answer, by reference and stable between changes. */
364
- getSnapshot(): ShareLinkSnapshot;
365
- /**
366
- * subscribe registers a listener for every change of the snapshot, and returns its own
367
- * unsubscribe, which is idempotent.
368
- *
369
- * The first listener resumes the engine, which reads the link unless it already has, and the
370
- * last one leaving parks it. That is the whole lifecycle a component can express correctly:
371
- * React tears an effect down and sets it up again with the same object under StrictMode, so a
372
- * latch here would leave a live surface bound to a dead engine. Each call is its own
373
- * subscription, so two owners subscribing one shared function each hold the engine until they
374
- * release it.
375
- */
376
- subscribe(listener: () => void): () => void;
377
- /**
378
- * configure replaces the configuration, and tells its listeners only when the answer changed.
379
- *
380
- * A binding calls it on every render, so an unchanged configuration costs a comparison. A
381
- * changed capability or scope moves the snapshot's `actions`, and a scope that turns
382
- * `"organization"` sends the read a `"pending"` one held. A target that differs by kind or id
383
- * is another question: the token, what the engine knew, the failures and the latest change are
384
- * dropped, the answer of anything in flight for the previous target is ignored, an action still
385
- * running for it holds back none of the new target's, and the link is read again. A parked
386
- * engine keeps the configuration for its next subscriber.
387
- */
388
- configure(config: ShareLinkConfig): void;
389
- /**
390
- * dispose parks the engine and drops every listener, for good.
391
- *
392
- * Idempotent, and every call after it is a no-op rather than an error: an owner torn down
393
- * mid-request should not have to guard the calls it already queued. A request in flight still
394
- * reaches the tool it was sent to; its answer changes nothing here.
395
- */
396
- dispose(): void;
397
- /**
398
- * read reads the link again, and resolves once that read has answered.
399
- *
400
- * The first subscriber reads by itself. This is the retry a surface offers under a
401
- * `readFailure` whose `retryable` is true. The previous failure leaves the snapshot while the
402
- * read is in flight, so a surface shows its pending state.
403
- *
404
- * It does nothing, and resolves at once, while a read is in flight, while the scope is not
405
- * `"organization"`, while the viewer does not hold `canManage`, while parked, and after
406
- * {@link ShareLinkEngine.dispose}. It never rejects.
407
- */
408
- read(): Promise<void>;
409
- /**
410
- * mint creates the link through `studio.shareLink.mint`, and resolves once that create has
411
- * answered: the reader's Create, which a surface offers once the snapshot is `known` with no
412
- * token. The verb gets or creates, so a link made elsewhere in the meantime is the one it
413
- * answers, and no URL already handed out is retired. A refusal is the snapshot's `mintFailure`,
414
- * and asking again is its retry.
415
- *
416
- * It does nothing, and resolves at once, while a create is in flight, while a link is held,
417
- * while a reset or a disable of this link is in flight, while the scope is not
418
- * `"organization"`, while the viewer does not hold `canManage`, while parked, and after
419
- * {@link ShareLinkEngine.dispose}. It never rejects.
420
- */
421
- mint(): Promise<void>;
422
- /**
423
- * rotate resets the link through `studio.shareLink.rotate`: the token held is retired, every
424
- * URL carrying it stops working, and the snapshot takes the one issued in its place.
425
- *
426
- * The tool bus asks the confirmation inside the dispatch, so the tool runs in a context whose
427
- * confirm gate the engine layers over the configured one: the snapshot's `busy` turns
428
- * `"rotate"` when the gate approves, never while it is asked. A context with no confirm gate
429
- * refuses, as the bus does for one.
430
- *
431
- * It runs only while the snapshot's `actions.rotate` is `"ready"`, which it is not while a
432
- * reset or a disable of this target is in flight (one whose confirmation is still asked
433
- * included), and while somebody is watching; otherwise it resolves `"skipped"`. One at a time,
434
- * because two writes side by side would leave the token to whichever answer landed last. A
435
- * refusal leaves the link, the latest change and a read's or a create's failure as they were.
436
- * An answer that lands once the engine answers for another target, or after
437
- * {@link ShareLinkEngine.dispose}, changes nothing either, and the outcome still says what the
438
- * verb came to.
439
- *
440
- * It never rejects. A `dispatch` that throws or rejects resolves `"refused"` with the failure
441
- * the tool bus builds for a handler that throws, and leaves the reset free to be asked again.
442
- * So does an `ok` answer that holds no token, with the `internal` refusal the verb gives for a
443
- * link that holds none: its sentence says the link held may no longer open. The engine then
444
- * reads the link that stands, and drops the answer of a read or a create sent before the reset,
445
- * which may carry the link it retired. That read is sent as the first one is, to a watched
446
- * engine under the `"organization"` scope: a parked engine sends it for its next subscriber,
447
- * and another scope once it turns `"organization"`.
448
- */
449
- rotate(): Promise<ShareLinkActionOutcome>;
450
- /**
451
- * disable revokes the link through `studio.shareLink.disable`: every URL carrying its token
452
- * stops working, and the snapshot holds no token and knows that none is set. No later
453
- * subscriber reads it again; {@link ShareLinkEngine.mint} creates another.
454
- *
455
- * On a `"personal"` resource a `not-found` answer settles it too, with `linkWasActive` false:
456
- * no link was active, which is what the reader asked for (`isShareLinkDisableSettled`).
457
- *
458
- * The confirmation, the `busy` flag (`"disable"`) and the conditions it runs under are
459
- * {@link ShareLinkEngine.rotate}'s, read off `actions.disable`.
460
- */
461
- disable(): Promise<ShareLinkActionOutcome>;
462
- /** ask sends the first read of a target, once a scope that can hold a link is known. */
463
- private ask;
464
- /**
465
- * mayAsk reports whether the link may be read or created as configured: the resource is an
466
- * organization's, and the viewer holds the edit grant every request of its link needs.
467
- */
468
- private mayAsk;
469
- /**
470
- * runAsk sends one read or one create and keeps its answer, unless the engine has moved on by
471
- * then or a write sent after it has settled.
472
- */
473
- private runAsk;
474
- /** sendRead reads the link through the configured read, a throw answered as a refusal. */
475
- private sendRead;
476
- /** sendMint creates the link through the bus, a dispatch that throws answered as a refusal. */
477
- private sendMint;
478
- /** act runs one management action and settles the snapshot with its answer. */
479
- private act;
480
- /**
481
- * settleRotate ends a reset with its answer. The token it issued is the newest whatever a read
482
- * or a create answered or will answer, so every request sent by now is outranked.
483
- *
484
- * An `ok` answer that holds no token is refused as the verb refuses a link that holds none,
485
- * and the engine was handed no link to show. The server answered `ok` all the same, so it may
486
- * have retired the link held: every read and create sent by now is outranked, since its answer
487
- * may carry that link, and the engine reads which link stands
488
- * ({@link ShareLinkEngine.readStandingLink}). Until that read answers, the link and the latest
489
- * change read as they did.
490
- */
491
- private settleRotate;
492
- /**
493
- * readStandingLink reads which link stands, once a reset answered `ok` with no token.
494
- *
495
- * It is sent while somebody watches a resource whose scope is `"organization"`, the one scope a
496
- * read is sent under, for a viewer who holds the grant. On a parked engine, and under a scope or
497
- * a grant that takes no read by now, the question is left open: the next subscriber asks it,
498
- * or the configuration that takes one does. An engine that was disposed, or that answers for
499
- * another target by now, asks nothing.
500
- */
501
- private readStandingLink;
502
- /**
503
- * settleDisable ends a disable with its answer, judged under the scope it was sent under and
504
- * at the place it left in.
505
- */
506
- private settleDisable;
507
- /**
508
- * refuse ends an action whose verb did not run or failed, and answers what it came to:
509
- * `"withheld"` for a confirmation nobody approved, `"refused"` with the failure otherwise.
510
- * Nothing in the snapshot changes but the action in flight.
511
- */
512
- private refuse;
513
- /**
514
- * finish ends the action in flight: an action may be called again, and the snapshot stops
515
- * spinning and takes what `apply` writes, in one change. An engine that was disposed, or that
516
- * answers for another target by now, keeps everything as it is: the action it holds, if any,
517
- * is the new target's.
518
- */
519
- private finish;
520
- /** compose assembles the snapshot the engine's state stands for now. */
521
- private compose;
522
- /** publish replaces the snapshot when the state moved it, and tells every listener. */
523
- private publish;
524
- }
525
-
526
- export { ShareLinkEngine as c };
527
- export type { ShareLinkActionOutcome as S, ShareLinkConfig as a, ShareLinkDispatch as b, ShareLinkEngineOptions as d, ShareLinkFailure as e, ShareLinkRead as f, ShareLinkReadResult as g, ShareLinkSnapshot as h };