···11+Mozilla Public License Version 2.0
22+==================================
33+44+1. Definitions
55+--------------
66+77+1.1. "Contributor"
88+ means each individual or legal entity that creates, contributes to
99+ the creation of, or owns Covered Software.
1010+1111+1.2. "Contributor Version"
1212+ means the combination of the Contributions of others (if any) used
1313+ by a Contributor and that particular Contributor's Contribution.
1414+1515+1.3. "Contribution"
1616+ means Covered Software of a particular Contributor.
1717+1818+1.4. "Covered Software"
1919+ means Source Code Form to which the initial Contributor has attached
2020+ the notice in Exhibit A, the Executable Form of such Source Code
2121+ Form, and Modifications of such Source Code Form, in each case
2222+ including portions thereof.
2323+2424+1.5. "Incompatible With Secondary Licenses"
2525+ means
2626+2727+ (a) that the initial Contributor has attached the notice described
2828+ in Exhibit B to the Covered Software; or
2929+3030+ (b) that the Covered Software was made available under the terms of
3131+ version 1.1 or earlier of the License, but not also under the
3232+ terms of a Secondary License.
3333+3434+1.6. "Executable Form"
3535+ means any form of the work other than Source Code Form.
3636+3737+1.7. "Larger Work"
3838+ means a work that combines Covered Software with other material, in
3939+ a separate file or files, that is not Covered Software.
4040+4141+1.8. "License"
4242+ means this document.
4343+4444+1.9. "Licensable"
4545+ means having the right to grant, to the maximum extent possible,
4646+ whether at the time of the initial grant or subsequently, any and
4747+ all of the rights conveyed by this License.
4848+4949+1.10. "Modifications"
5050+ means any of the following:
5151+5252+ (a) any file in Source Code Form that results from an addition to,
5353+ deletion from, or modification of the contents of Covered
5454+ Software; or
5555+5656+ (b) any new file in Source Code Form that contains any Covered
5757+ Software.
5858+5959+1.11. "Patent Claims" of a Contributor
6060+ means any patent claim(s), including without limitation, method,
6161+ process, and apparatus claims, in any patent Licensable by such
6262+ Contributor that would be infringed, but for the grant of the
6363+ License, by the making, using, selling, offering for sale, having
6464+ made, import, or transfer of either its Contributions or its
6565+ Contributor Version.
6666+6767+1.12. "Secondary License"
6868+ means either the GNU General Public License, Version 2.0, the GNU
6969+ Lesser General Public License, Version 2.1, the GNU Affero General
7070+ Public License, Version 3.0, or any later versions of those
7171+ licenses.
7272+7373+1.13. "Source Code Form"
7474+ means the form of the work preferred for making modifications.
7575+7676+1.14. "You" (or "Your")
7777+ means an individual or a legal entity exercising rights under this
7878+ License. For legal entities, "You" includes any entity that
7979+ controls, is controlled by, or is under common control with You. For
8080+ purposes of this definition, "control" means (a) the power, direct
8181+ or indirect, to cause the direction or management of such entity,
8282+ whether by contract or otherwise, or (b) ownership of more than
8383+ fifty percent (50%) of the outstanding shares or beneficial
8484+ ownership of such entity.
8585+8686+2. License Grants and Conditions
8787+--------------------------------
8888+8989+2.1. Grants
9090+9191+Each Contributor hereby grants You a world-wide, royalty-free,
9292+non-exclusive license:
9393+9494+(a) under intellectual property rights (other than patent or trademark)
9595+ Licensable by such Contributor to use, reproduce, make available,
9696+ modify, display, perform, distribute, and otherwise exploit its
9797+ Contributions, either on an unmodified basis, with Modifications, or
9898+ as part of a Larger Work; and
9999+100100+(b) under Patent Claims of such Contributor to make, use, sell, offer
101101+ for sale, have made, import, and otherwise transfer either its
102102+ Contributions or its Contributor Version.
103103+104104+2.2. Effective Date
105105+106106+The licenses granted in Section 2.1 with respect to any Contribution
107107+become effective for each Contribution on the date the Contributor first
108108+distributes such Contribution.
109109+110110+2.3. Limitations on Grant Scope
111111+112112+The licenses granted in this Section 2 are the only rights granted under
113113+this License. No additional rights or licenses will be implied from the
114114+distribution or licensing of Covered Software under this License.
115115+Notwithstanding Section 2.1(b) above, no patent license is granted by a
116116+Contributor:
117117+118118+(a) for any code that a Contributor has removed from Covered Software;
119119+ or
120120+121121+(b) for infringements caused by: (i) Your and any other third party's
122122+ modifications of Covered Software, or (ii) the combination of its
123123+ Contributions with other software (except as part of its Contributor
124124+ Version); or
125125+126126+(c) under Patent Claims infringed by Covered Software in the absence of
127127+ its Contributions.
128128+129129+This License does not grant any rights in the trademarks, service marks,
130130+or logos of any Contributor (except as may be necessary to comply with
131131+the notice requirements in Section 3.4).
132132+133133+2.4. Subsequent Licenses
134134+135135+No Contributor makes additional grants as a result of Your choice to
136136+distribute the Covered Software under a subsequent version of this
137137+License (see Section 10.2) or under the terms of a Secondary License (if
138138+permitted under the terms of Section 3.3).
139139+140140+2.5. Representation
141141+142142+Each Contributor represents that the Contributor believes its
143143+Contributions are its original creation(s) or it has sufficient rights
144144+to grant the rights to its Contributions conveyed by this License.
145145+146146+2.6. Fair Use
147147+148148+This License is not intended to limit any rights You have under
149149+applicable copyright doctrines of fair use, fair dealing, or other
150150+equivalents.
151151+152152+2.7. Conditions
153153+154154+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155155+in Section 2.1.
156156+157157+3. Responsibilities
158158+-------------------
159159+160160+3.1. Distribution of Source Form
161161+162162+All distribution of Covered Software in Source Code Form, including any
163163+Modifications that You create or to which You contribute, must be under
164164+the terms of this License. You must inform recipients that the Source
165165+Code Form of the Covered Software is governed by the terms of this
166166+License, and how they can obtain a copy of this License. You may not
167167+attempt to alter or restrict the recipients' rights in the Source Code
168168+Form.
169169+170170+3.2. Distribution of Executable Form
171171+172172+If You distribute Covered Software in Executable Form then:
173173+174174+(a) such Covered Software must also be made available in Source Code
175175+ Form, as described in Section 3.1, and You must inform recipients of
176176+ the Executable Form how they can obtain a copy of such Source Code
177177+ Form by reasonable means in a timely manner, at a charge no more
178178+ than the cost of distribution to the recipient; and
179179+180180+(b) You may distribute such Executable Form under the terms of this
181181+ License, or sublicense it under different terms, provided that the
182182+ license for the Executable Form does not attempt to limit or alter
183183+ the recipients' rights in the Source Code Form under this License.
184184+185185+3.3. Distribution of a Larger Work
186186+187187+You may create and distribute a Larger Work under terms of Your choice,
188188+provided that You also comply with the requirements of this License for
189189+the Covered Software. If the Larger Work is a combination of Covered
190190+Software with a work governed by one or more Secondary Licenses, and the
191191+Covered Software is not Incompatible With Secondary Licenses, this
192192+License permits You to additionally distribute such Covered Software
193193+under the terms of such Secondary License(s), so that the recipient of
194194+the Larger Work may, at their option, further distribute the Covered
195195+Software under the terms of either this License or such Secondary
196196+License(s).
197197+198198+3.4. Notices
199199+200200+You may not remove or alter the substance of any license notices
201201+(including copyright notices, patent notices, disclaimers of warranty,
202202+or limitations of liability) contained within the Source Code Form of
203203+the Covered Software, except that You may alter any license notices to
204204+the extent required to remedy known factual inaccuracies.
205205+206206+3.5. Application of Additional Terms
207207+208208+You may choose to offer, and to charge a fee for, warranty, support,
209209+indemnity or liability obligations to one or more recipients of Covered
210210+Software. However, You may do so only on Your own behalf, and not on
211211+behalf of any Contributor. You must make it absolutely clear that any
212212+such warranty, support, indemnity, or liability obligation is offered by
213213+You alone, and You hereby agree to indemnify every Contributor for any
214214+liability incurred by such Contributor as a result of warranty, support,
215215+indemnity or liability terms You offer. You may include additional
216216+disclaimers of warranty and limitations of liability specific to any
217217+jurisdiction.
218218+219219+4. Inability to Comply Due to Statute or Regulation
220220+---------------------------------------------------
221221+222222+If it is impossible for You to comply with any of the terms of this
223223+License with respect to some or all of the Covered Software due to
224224+statute, judicial order, or regulation then You must: (a) comply with
225225+the terms of this License to the maximum extent possible; and (b)
226226+describe the limitations and the code they affect. Such description must
227227+be placed in a text file included with all distributions of the Covered
228228+Software under this License. Except to the extent prohibited by statute
229229+or regulation, such description must be sufficiently detailed for a
230230+recipient of ordinary skill to be able to understand it.
231231+232232+5. Termination
233233+--------------
234234+235235+5.1. The rights granted under this License will terminate automatically
236236+if You fail to comply with any of its terms. However, if You become
237237+compliant, then the rights granted under this License from a particular
238238+Contributor are reinstated (a) provisionally, unless and until such
239239+Contributor explicitly and finally terminates Your grants, and (b) on an
240240+ongoing basis, if such Contributor fails to notify You of the
241241+non-compliance by some reasonable means prior to 60 days after You have
242242+come back into compliance. Moreover, Your grants from a particular
243243+Contributor are reinstated on an ongoing basis if such Contributor
244244+notifies You of the non-compliance by some reasonable means, this is the
245245+first time You have received notice of non-compliance with this License
246246+from such Contributor, and You become compliant prior to 30 days after
247247+Your receipt of the notice.
248248+249249+5.2. If You initiate litigation against any entity by asserting a patent
250250+infringement claim (excluding declaratory judgment actions,
251251+counter-claims, and cross-claims) alleging that a Contributor Version
252252+directly or indirectly infringes any patent, then the rights granted to
253253+You by any and all Contributors for the Covered Software under Section
254254+2.1 of this License shall terminate.
255255+256256+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257257+end user license agreements (excluding distributors and resellers) which
258258+have been validly granted by You or Your distributors under this License
259259+prior to termination shall survive termination.
260260+261261+************************************************************************
262262+* *
263263+* 6. Disclaimer of Warranty *
264264+* ------------------------- *
265265+* *
266266+* Covered Software is provided under this License on an "as is" *
267267+* basis, without warranty of any kind, either expressed, implied, or *
268268+* statutory, including, without limitation, warranties that the *
269269+* Covered Software is free of defects, merchantable, fit for a *
270270+* particular purpose or non-infringing. The entire risk as to the *
271271+* quality and performance of the Covered Software is with You. *
272272+* Should any Covered Software prove defective in any respect, You *
273273+* (not any Contributor) assume the cost of any necessary servicing, *
274274+* repair, or correction. This disclaimer of warranty constitutes an *
275275+* essential part of this License. No use of any Covered Software is *
276276+* authorized under this License except under this disclaimer. *
277277+* *
278278+************************************************************************
279279+280280+************************************************************************
281281+* *
282282+* 7. Limitation of Liability *
283283+* -------------------------- *
284284+* *
285285+* Under no circumstances and under no legal theory, whether tort *
286286+* (including negligence), contract, or otherwise, shall any *
287287+* Contributor, or anyone who distributes Covered Software as *
288288+* permitted above, be liable to You for any direct, indirect, *
289289+* special, incidental, or consequential damages of any character *
290290+* including, without limitation, damages for lost profits, loss of *
291291+* goodwill, work stoppage, computer failure or malfunction, or any *
292292+* and all other commercial damages or losses, even if such party *
293293+* shall have been informed of the possibility of such damages. This *
294294+* limitation of liability shall not apply to liability for death or *
295295+* personal injury resulting from such party's negligence to the *
296296+* extent applicable law prohibits such limitation. Some *
297297+* jurisdictions do not allow the exclusion or limitation of *
298298+* incidental or consequential damages, so this exclusion and *
299299+* limitation may not apply to You. *
300300+* *
301301+************************************************************************
302302+303303+8. Litigation
304304+-------------
305305+306306+Any litigation relating to this License may be brought only in the
307307+courts of a jurisdiction where the defendant maintains its principal
308308+place of business and such litigation shall be governed by laws of that
309309+jurisdiction, without reference to its conflict-of-law provisions.
310310+Nothing in this Section shall prevent a party's ability to bring
311311+cross-claims or counter-claims.
312312+313313+9. Miscellaneous
314314+----------------
315315+316316+This License represents the complete agreement concerning the subject
317317+matter hereof. If any provision of this License is held to be
318318+unenforceable, such provision shall be reformed only to the extent
319319+necessary to make it enforceable. Any law or regulation which provides
320320+that the language of a contract shall be construed against the drafter
321321+shall not be used to construe this License against a Contributor.
322322+323323+10. Versions of the License
324324+---------------------------
325325+326326+10.1. New Versions
327327+328328+Mozilla Foundation is the license steward. Except as provided in Section
329329+10.3, no one other than the license steward has the right to modify or
330330+publish new versions of this License. Each version will be given a
331331+distinguishing version number.
332332+333333+10.2. Effect of New Versions
334334+335335+You may distribute the Covered Software under the terms of the version
336336+of the License under which You originally received the Covered Software,
337337+or under the terms of any subsequent version published by the license
338338+steward.
339339+340340+10.3. Modified Versions
341341+342342+If you create software not governed by this License, and you want to
343343+create a new license for such software, you may create and use a
344344+modified version of this License if you rename the license and remove
345345+any references to the name of the license steward (except to note that
346346+such modified license differs from this License).
347347+348348+10.4. Distributing Source Code Form that is Incompatible With Secondary
349349+Licenses
350350+351351+If You choose to distribute Source Code Form that is Incompatible With
352352+Secondary Licenses under the terms of this version of the License, the
353353+notice described in Exhibit B of this License must be attached.
354354+355355+Exhibit A - Source Code Form License Notice
356356+-------------------------------------------
357357+358358+ This Source Code Form is subject to the terms of the Mozilla Public
359359+ License, v. 2.0. If a copy of the MPL was not distributed with this
360360+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
361361+362362+If it is not possible or desirable to put the notice in a particular
363363+file, then You may include the notice in a location (such as a LICENSE
364364+file in a relevant directory) where a recipient would be likely to look
365365+for such a notice.
366366+367367+You may add additional accurate notices of copyright ownership.
368368+369369+Exhibit B - "Incompatible With Secondary Licenses" Notice
370370+---------------------------------------------------------
371371+372372+ This Source Code Form is "Incompatible With Secondary Licenses", as
373373+ defined by the Mozilla Public License, v. 2.0.
+51
README.md
···11+**tubes** is a little irc client that goes in your web browser.
22+33+## interesting features
44+55+- does the irc
66+- looks nice
77+- works nice also
88+- supports many ircv3 features
99+- built-in bouncer integration
1010+- uses a nice font
1111+- worse than discord
1212+- possibly better than matrix depending on your priorities
1313+1414+## build it
1515+1616+this one has a build step (sorry)
1717+1818+### prerequisite(s)
1919+2020+- own a computer
2121+- install node.js
2222+2323+### doing the thing
2424+2525+```bash
2626+cd neo
2727+npm install
2828+npm run build
2929+# move dist/ somewhere accessible xoxo
3030+```
3131+3232+## say hello
3333+3434+it's all going down in [#tubes](ircs://irc.libera.chat/#tubes) on libera.chat
3535+3636+### contributing
3737+3838+submit pull requests to our lovely [codeberg page][codeberg]. lots of things to
3939+do can be found on the [issue tracker][issues]. there's not much in the way of
4040+documentation at the moment, so if you get stuck and/or confused please do ping
4141+me!
4242+4343+> [!NOTE]
4444+> This is a purely ideological project. Any changes that appear technically motivated will be rejected.
4545+4646+[codeberg]: https://codeberg.org/smethwick/tubes
4747+[issues]: https://codeberg.org/smethwick/tubes/issues
4848+4949+## licence
5050+5151+MPL 2.0, except tubes_core (inside lib/), which is ISC
···11+ISC License
22+33+Copyright 2023 Leah Clark
44+55+Permission to use, copy, modify, and/or distribute this software for any
66+purpose with or without fee is hereby granted, provided that the above
77+copyright notice and this permission notice appear in all copies.
88+99+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1010+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
1111+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1212+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1313+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1414+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1515+PERFORMANCE OF THIS SOFTWARE.
+88
core/README.md
···11+# tubes core
22+33+correct*, extensible & asynchronous IRCing for javascript
44+*correctness coming soon
55+66+(work in progress, don't bother using yet)
77+88+## lil example
99+1010+```ts
1111+// import Connection from `ws`. ws, as the name implies, only lets you connect
1212+// over a websocket (so you can use it in browsers and the like).
1313+// if you need to connect over TCP, use `tubes_core/tcp` instead.
1414+import { Connection } from "tubes_core/ws";
1515+1616+// create the connection
1717+const conn = new Connection({
1818+ url: "wss://testnet.ergo.chat/webirc",
1919+ nickname: "the_grungler",
2020+ realname: "i'm the grungler",
2121+});
2222+2323+// start connecting
2424+await conn.connect();
2525+// let the network know you're a bot by setting mode +B on your nick
2626+// (if you're writing a client, skip this)
2727+await conn.ima_bot();
2828+2929+// join a channel
3030+const channel = await conn.join_channel("#tubes");
3131+// send a message. you can omit the `await` if you don't care whether the
3232+// message was sent successfully
3333+await channel.privmsg("hello world!");
3434+3535+// gracefully quit the network once all is said and done
3636+await conn.disconnect();
3737+```
3838+3939+for tcp:
4040+4141+```ts
4242+import { Connection } from "tubes_core/tcp";
4343+4444+const conn = new Connection({
4545+ url: "ircs://testnet.ergo.chat",
4646+ nickname: "the_grungler",
4747+ realname: "i'm the grungler",
4848+});
4949+5050+// same as above from there
5151+```
5252+5353+listening out for messages:
5454+5555+```ts
5656+channel.subscribe((msg) => {
5757+ // check if the message is a PRIVMSG (i.e. a normal message sent
5858+ // to the channel) and if its content is "!ping".
5959+ if (msg.is_privmsg() && msg.content() == "!ping") {
6060+ // respond to the message. this uses the ircv3 replies thing if they're
6161+ // available.
6262+ await msg.reply("pong!");
6363+ }
6464+});
6565+```
6666+6767+### bouncers
6868+6969+tubes has an "adapter" system for connecting to irc bouncers.
7070+7171+### soju
7272+7373+```ts
7474+import { Adapter } from "tubes_core/soju";
7575+7676+const adp = new Adapter({
7777+ url: "wss://irc.example.org/socket",
7878+});
7979+8080+await adp.activate();
8181+8282+const conn = adp.connections[0]
8383+8484+conn.send("PING hello");
8585+```
8686+8787+proper documentation coming soon xoxo
8888+
+37
core/adapter.ts
···11+import { Signal } from "@preact/signals";
22+import { Connection, ConnectionConfig } from "./connection";
33+import { IrcProtocol } from "./support";
44+55+export abstract class Adapter<C = Connection> {
66+ abstract label: string;
77+ abstract protocols: IrcProtocol[];
88+99+ get connections(): C[] {
1010+ return this.$connections.peek();
1111+ }
1212+ abstract $connections: Signal<C[]>;
1313+1414+ constructor(
1515+ public id: string,
1616+ ) { }
1717+1818+ abstract activate(): Promise<void>;
1919+ abstract deactivate(): Promise<void>;
2020+2121+ abstract add_connection(config: ConnectionConfig): Promise<C>;
2222+2323+ /**
2424+ * Get an idea of what caps this network supports.
2525+ * Sends a CAP LS request, parses the response and then immedately quits.
2626+ */
2727+ conduct_reconnaissance? :(url: string) => Promise<ReconData>;
2828+}
2929+3030+export enum ReconError {
3131+ Timeout = "Timed out",
3232+}
3333+3434+export interface ReconData {
3535+ url: string,
3636+ supported_caps: Record<string, string | null>
3737+}
···11+import { WsConnection } from "./connection";
22+33+export {
44+ WsConnection as Connection,
55+}
docs/api/index.njk
This is a binary file and will not be displayed.
+26
docs/community.md
···11+# tubes community
22+33+tubes is a collaborative free software project. you are extremely welcome to
44+participate if you want!!
55+66+## irc
77+88+surprisingly enough, we operate an IRC channel on the
99+[Libera.Chat](https://libera.chat) network.
1010+1111+if you're looking to receive insights or wisdom from me (leah clark), please
1212+mention my nick (`thatcher`) in your message or else i will straight up not see
1313+it.
1414+1515+## elsewhere
1616+1717+accounts for broadcasting tube news are available on the following platforms:
1818+1919+* [mastodon and compatibles](https://h.pronounmail.com/@tubes)
2020+2121+these are all managed by me, leah clark.
2222+2323+## conduct
2424+2525+tldr: reactionaries banned on sight, don't get into slap fights, avoid being
2626+really fucking annoying, have fun.
···11+import "@css/placeholders.css";
22+33+const NoBufferPlaceholder = () => <article class="no-buffer">
44+ <h2>nothing open</h2>
55+ <span>(select a thing on the left to open it here)</span>
66+</article>
77+88+export default NoBufferPlaceholder;