@byollm/protocol 0.1.0-alpha.62 → 0.1.0-alpha.64

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.
package/ABOUT-SHORT.md ADDED
@@ -0,0 +1,7 @@
1
+ BYOLLM – Bring Your Own LLM – lets you use your own AI on websites you authorize. A small program installed on your machine lets you use your own models and subscriptions on any BYOLLM-integrated site, including new models the moment you get access – no site updates required. BYOLLM Cloud connects sites to your devices with end-to-end encryption, so no one, including us, can see your data.
2
+
3
+ <!-- lede ends here. Surfaces with room show the tail below; the welcome screen shows the lede only. -->
4
+
5
+ Sites can charge you less because you bring your own – see why that matters →. Teams can optionally share the free or metered services on their devices with people they name. Personal subscriptions are never shared.
6
+
7
+ **Learn more →**
package/ABOUT.md ADDED
@@ -0,0 +1,60 @@
1
+ # About BYOLLM
2
+
3
+ **What BYOLLM is**
4
+
5
+ BYOLLM lets you use your own AI on websites. You install one small program on
6
+ your computer. Then, websites that support BYOLLM can use the AI you already
7
+ have — a free model running on your machine, or an AI service you already pay
8
+ for — instead of the website paying for AI and passing the cost to you.
9
+
10
+ **Why it matters**
11
+
12
+ For you:
13
+
14
+ - Your favorite model, everywhere you go.
15
+ - New models the moment you get them – not when a site gets around to adding
16
+ them.
17
+ - Encrypted end-to-end. Your prompts go to your own device; byollm.cloud can't
18
+ read them.
19
+ - Sites never learn which model you use, and your subscriptions are never
20
+ shared.
21
+ - Pay less. Sites that don't pay for AI can charge you less – or nothing.
22
+
23
+ For sites and developers:
24
+
25
+ - Zero AI bills. Your users bring their own compute.
26
+ - No floating money – you don't pay LLM bills up front and hope to collect
27
+ later, and you never ask people to prepay just to try you.
28
+ - Free trials that cost you nothing to offer.
29
+ - Ship the AI features you kept private for fear of the API bill.
30
+ - One small integration. Your users choose the models.
31
+
32
+ **Your device**
33
+
34
+ The `byollm` program runs on your computer. It knows which AI services you have
35
+ set up: free open-source models on your machine, metered services you pay per
36
+ use, or your own subscriptions like Claude Pro/Max. When a website you have
37
+ enabled sends work, your device runs it with the service you chose. Your
38
+ prompts are encrypted end-to-end to your own device. byollm.cloud passes them
39
+ along and cannot read them.
40
+
41
+ **Sites**
42
+
43
+ A website that wants to use BYOLLM says what it needs — "writing help," "chat,"
44
+ and so on. When you connect the site, you pick which of your services answers
45
+ each one. The site never learns which model you use. You can turn a site off at
46
+ any time, and it stops getting your work.
47
+
48
+ **Teams (optional)**
49
+
50
+ A team lets you share what runs on your devices with people you name — the free
51
+ open-source models on your machine, or a metered service with a spending limit
52
+ you set. Your subscription accounts (like Claude Pro/Max) are never shared with
53
+ anyone. That is a rule, not a setting.
54
+
55
+ **byollm.cloud (or your own relay)**
56
+
57
+ Many sites, many devices, many people. byollm.cloud keeps track of who has
58
+ allowed what and sends each job to the right device. It never sees your
59
+ prompts. If you would rather run this part yourself, the relay is open source —
60
+ you can run your own instead of using byollm.cloud.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  > [!WARNING]
2
- > **Alpha (`0.1.0-alpha.62`) — under active development. Don't use this yet.**
2
+ > **Alpha (`0.1.0-alpha.64`) — under active development. Don't use this yet.**
3
3
  >
4
4
  > Install it deliberately: `npm install @byollm/protocol@alpha`.
5
5
  >
@@ -83,7 +83,7 @@
83
83
  > packages published and `@byollm/server` did not: a Sigstore
84
84
  > transparency-log 409 on its provenance attestation. The workflow's
85
85
  > "already published" guard correctly refuses to resume a partial publish,
86
- > so `0.1.0-alpha.62` is that release, whole.
86
+ > so `0.1.0-alpha.64` is that release, whole.
87
87
  >
88
88
  > If you run the Supabase adapter, `alpha.21` needs
89
89
  > `20260819010000_completed_by_lease_id.sql`: alpha.19 shipped §3.6's
package/dist/index.d.ts CHANGED
@@ -1,5 +1,19 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /** The full description — five sections, plus why it matters. */
4
+ declare const ABOUT = "# About BYOLLM\n\n**What BYOLLM is**\n\nBYOLLM lets you use your own AI on websites. You install one small program on\nyour computer. Then, websites that support BYOLLM can use the AI you already\nhave \u2014 a free model running on your machine, or an AI service you already pay\nfor \u2014 instead of the website paying for AI and passing the cost to you.\n\n**Why it matters**\n\nFor you:\n\n- Your favorite model, everywhere you go.\n- New models the moment you get them \u2013 not when a site gets around to adding\n them.\n- Encrypted end-to-end. Your prompts go to your own device; byollm.cloud can't\n read them.\n- Sites never learn which model you use, and your subscriptions are never\n shared.\n- Pay less. Sites that don't pay for AI can charge you less \u2013 or nothing.\n\nFor sites and developers:\n\n- Zero AI bills. Your users bring their own compute.\n- No floating money \u2013 you don't pay LLM bills up front and hope to collect\n later, and you never ask people to prepay just to try you.\n- Free trials that cost you nothing to offer.\n- Ship the AI features you kept private for fear of the API bill.\n- One small integration. Your users choose the models.\n\n**Your device**\n\nThe `byollm` program runs on your computer. It knows which AI services you have\nset up: free open-source models on your machine, metered services you pay per\nuse, or your own subscriptions like Claude Pro/Max. When a website you have\nenabled sends work, your device runs it with the service you chose. Your\nprompts are encrypted end-to-end to your own device. byollm.cloud passes them\nalong and cannot read them.\n\n**Sites**\n\nA website that wants to use BYOLLM says what it needs \u2014 \"writing help,\" \"chat,\"\nand so on. When you connect the site, you pick which of your services answers\neach one. The site never learns which model you use. You can turn a site off at\nany time, and it stops getting your work.\n\n**Teams (optional)**\n\nA team lets you share what runs on your devices with people you name \u2014 the free\nopen-source models on your machine, or a metered service with a spending limit\nyou set. Your subscription accounts (like Claude Pro/Max) are never shared with\nanyone. That is a rule, not a setting.\n\n**byollm.cloud (or your own relay)**\n\nMany sites, many devices, many people. byollm.cloud keeps track of who has\nallowed what and sends each job to the right device. It never sees your\nprompts. If you would rather run this part yourself, the relay is open source \u2014\nyou can run your own instead of using byollm.cloud.";
5
+ /**
6
+ * The first paragraph, which stands alone.
7
+ *
8
+ * What the welcome screen shows: somebody deciding whether to trust a site's
9
+ * button needs the whole idea in one breath, not a page.
10
+ */
11
+ declare const ABOUT_SHORT_LEDE = "BYOLLM \u2013 Bring Your Own LLM \u2013 lets you use your own AI on websites you authorize. A small program installed on your machine lets you use your own models and subscriptions on any BYOLLM-integrated site, including new models the moment you get access \u2013 no site updates required. BYOLLM Cloud connects sites to your devices with end-to-end encryption, so no one, including us, can see your data.";
12
+ /** The rest, for surfaces with room. Shown before "Learn more →". */
13
+ declare const ABOUT_SHORT_TAIL = "Sites can charge you less because you bring your own \u2013 see why that matters \u2192. Teams can optionally share the free or metered services on their devices with people they name. Personal subscriptions are never shared.";
14
+ /** Both halves, for a surface that wants the paragraph entire. */
15
+ declare const ABOUT_SHORT = "BYOLLM \u2013 Bring Your Own LLM \u2013 lets you use your own AI on websites you authorize. A small program installed on your machine lets you use your own models and subscriptions on any BYOLLM-integrated site, including new models the moment you get access \u2013 no site updates required. BYOLLM Cloud connects sites to your devices with end-to-end encryption, so no one, including us, can see your data.\n\nSites can charge you less because you bring your own \u2013 see why that matters \u2192. Teams can optionally share the free or metered services on their devices with people they name. Personal subscriptions are never shared.";
16
+
3
17
  /**
4
18
  * Its members, for anything that has to report what it accepts.
5
19
  *
@@ -880,6 +894,16 @@ declare const SIZE_CLASSES: readonly ("small" | "medium" | "large" | "unbounded"
880
894
  * bucket survives compression and encoding changes that an exact count does
881
895
  * not.
882
896
  *
897
+ * **Two grains, on purpose — ratified 2026-08-28.** Metering a
898
+ * GB-denominated plan needs real totals, and this is deliberately not where
899
+ * they come from: exact bytes exist only as increment-only *monthly*
900
+ * aggregates, and no per-job byte figure is ever persisted anywhere. The
901
+ * record needs vagueness and the meter needs totals; neither borrows the
902
+ * other's grain, which is why the consent screen's "roughly how big" stays
903
+ * exactly true of everything retained about a job. If you are here because
904
+ * you need a number, the aggregate is the one to reach for — adding a byte
905
+ * count to this envelope would trade a promise for a convenience.
906
+ *
883
907
  * `unbounded` exists for streamed jobs, which have no size when they start.
884
908
  * It is reserved now rather than added later: byollm_009 §8.1 — adding a
885
909
  * field to a published envelope is the v2 break all over again.
@@ -891,6 +915,41 @@ declare const SizeClass: z.ZodEnum<{
891
915
  unbounded: "unbounded";
892
916
  }>;
893
917
  type SizeClass = z.infer<typeof SizeClass>;
918
+ /**
919
+ * The most one envelope may be, in bytes — ratified 2026-08-28.
920
+ *
921
+ * A **relay-memory safety rail**, not a plan feature: every tier has the same
922
+ * ceiling, and differentiating tiers on it would be selling a safety limit as
923
+ * a benefit. What it bounds is any single job, so no one message can make the
924
+ * relay hold an unbounded amount of somebody else's memory.
925
+ *
926
+ * ## It stores nothing, and that is the design
927
+ *
928
+ * Enforced at ingress by refusing before acceptance, in both directions. A
929
+ * ceiling on what the relay already has in hand needs no schema and no record:
930
+ * the size is known for the length of the check and then it is gone. This
931
+ * matters because the alternative — recording a size to enforce a limit
932
+ * against — is precisely the per-job byte figure the metering ruling exists to
933
+ * not have.
934
+ *
935
+ * ## Measured on the serialised envelope
936
+ *
937
+ * The same quantity the monthly rollup counts, deliberately. The relay stores
938
+ * the serialised envelope and the meter measures what it stored, so a cap on
939
+ * anything else — the ciphertext alone, the decoded length — would mean the
940
+ * limit and the bill disagreed about what a byte is, and a job could be small
941
+ * enough to accept and larger than it was charged as.
942
+ */
943
+ declare const MAX_ENVELOPE_BYTES: number;
944
+ /**
945
+ * How big an envelope is, by the one measure that counts it.
946
+ *
947
+ * `JSON.stringify` because that is what the store persists and therefore what
948
+ * the meter measures. Length in UTF-16 code units rather than encoded bytes:
949
+ * it is the same number the store's own `HSTRLEN` reports, and the point of
950
+ * this function is that one number answers both questions.
951
+ */
952
+ declare function envelopeBytes(envelope: unknown): number;
894
953
  /** Where the bucket boundaries sit, in characters of payload text. */
895
954
  declare const SIZE_CLASS_LIMITS: Readonly<{
896
955
  small: 4000;
@@ -2605,4 +2664,4 @@ declare const FetchResponse: z.ZodObject<{
2605
2664
  }, z.core.$strict>;
2606
2665
  type FetchResponse = z.infer<typeof FetchResponse>;
2607
2666
 
2608
- export { AUDIENCES, Audience, BACKENDS, BACKEND_CLASSES, BACKEND_IDS, BackendClass, BackendCost, type BackendDescriptor, type BackendId, BackendIdSchema, CLOCK_ATTRIBUTION_MS, CLOCK_SKEW_WARN_MS, Capability, CapabilityMatrix, ChatMessage, ChatPayload, ClaimRequest, ClaimResponse, ClaimedJob, ClaimedStub, DeliveredResult, ENCRYPTION_KEY_CONTEXT, ENDPOINTS, ENVELOPE_MAX_AGE_MS, ERROR_STATUS, type Endpoint, type EnvelopeContext, EnvelopeDirection, type EnvelopeFailure, FetchRequest, FetchResponse, GRANT_CONTEXT, GRANT_MAX_AGE_MS, GRANT_SIGNED_FIELDS, GeneratePayload, type GrantClaims, GrantRef, type GrantRefusal, HeartbeatRequest, HeartbeatResponse, JOB_KINDS, JobKind, JobOutcome, JobPayload, JobRefused, JobResultCanceled, JobResultError, JobResultOk, JobState, JobStub, KindedPayload, Lease, MAX_CLOCK_SKEW_MS, MAX_PURPOSES, MAX_SUCCESSION_CHAIN, MIN_PROTOCOL_VERSION, MUSTS, MUST_IDS, Manifest, type MatchDaemon, type MatchJob, MatchRefusal, type MatchResult, type Must, type MustEnforcer, type MustId, type MustVerification, type MustVerifiedBy, OFFER_SCOPES, OfferScope, type OpenResult, PAYLOAD_LIMITS, PROTOCOL_PREFIX, PROTOCOL_VERSION, PairPollRequest, PairPollResponse, PairRequest, PairStartRequest, PairStartResponse, type PayloadFor, PublicIdentity, Purpose, REFUSAL_MESSAGES, RESERVED_PURPOSE, RETIREMENT_WINDOW_MS, RefusalReason, ReleaseRequest, ReleaseResponse, RequestSignature, ResultDisposition, ResultProvenance, ResultRequest, ResultResponse, RunMetadata, SIZE_CLASSES, SIZE_CLASS_LIMITS, SUCCESSION_CONTEXT, SUPPORTED_PROTOCOL_VERSIONS, SealedEnvelope, SealedOutcome, type SignatureFailure, SignedGrant, SizeClass, type SpendConsent, StoredKeys, Succession, type SuccessionFailure, type SuccessionWalk, TERMINAL_STATES, type VersionRefusal, WireError, WireErrorCode, WithheldKind, backendDescriptor, backendName, canTransition, canonicalRequest, checkProtocolVersion, classifyCost, cryptoReady, declaredVersion, effectiveOfferScope, fingerprint, generateKeys, grantStatement, isBackendId, isCloudTaggedModel, isJobKind, isLocalHost, isTerminal, keyId, kindsOf, matchAudience, mustsVerifiedBy, open, payloadTextLength, provenanceFor, publicIdentityOf, resolveCost, seal, signGrant, signRequest, signSiteRequest, signSuccession, signWith, singlePurposeManifest, sizeClassCeiling, sizeClassOf, successionStatement, verifyGrant, verifyLink, verifyPublicIdentity, verifyRequest, verifySiteRequest, verifyWith, walkSuccession };
2667
+ export { ABOUT, ABOUT_SHORT, ABOUT_SHORT_LEDE, ABOUT_SHORT_TAIL, AUDIENCES, Audience, BACKENDS, BACKEND_CLASSES, BACKEND_IDS, BackendClass, BackendCost, type BackendDescriptor, type BackendId, BackendIdSchema, CLOCK_ATTRIBUTION_MS, CLOCK_SKEW_WARN_MS, Capability, CapabilityMatrix, ChatMessage, ChatPayload, ClaimRequest, ClaimResponse, ClaimedJob, ClaimedStub, DeliveredResult, ENCRYPTION_KEY_CONTEXT, ENDPOINTS, ENVELOPE_MAX_AGE_MS, ERROR_STATUS, type Endpoint, type EnvelopeContext, EnvelopeDirection, type EnvelopeFailure, FetchRequest, FetchResponse, GRANT_CONTEXT, GRANT_MAX_AGE_MS, GRANT_SIGNED_FIELDS, GeneratePayload, type GrantClaims, GrantRef, type GrantRefusal, HeartbeatRequest, HeartbeatResponse, JOB_KINDS, JobKind, JobOutcome, JobPayload, JobRefused, JobResultCanceled, JobResultError, JobResultOk, JobState, JobStub, KindedPayload, Lease, MAX_CLOCK_SKEW_MS, MAX_ENVELOPE_BYTES, MAX_PURPOSES, MAX_SUCCESSION_CHAIN, MIN_PROTOCOL_VERSION, MUSTS, MUST_IDS, Manifest, type MatchDaemon, type MatchJob, MatchRefusal, type MatchResult, type Must, type MustEnforcer, type MustId, type MustVerification, type MustVerifiedBy, OFFER_SCOPES, OfferScope, type OpenResult, PAYLOAD_LIMITS, PROTOCOL_PREFIX, PROTOCOL_VERSION, PairPollRequest, PairPollResponse, PairRequest, PairStartRequest, PairStartResponse, type PayloadFor, PublicIdentity, Purpose, REFUSAL_MESSAGES, RESERVED_PURPOSE, RETIREMENT_WINDOW_MS, RefusalReason, ReleaseRequest, ReleaseResponse, RequestSignature, ResultDisposition, ResultProvenance, ResultRequest, ResultResponse, RunMetadata, SIZE_CLASSES, SIZE_CLASS_LIMITS, SUCCESSION_CONTEXT, SUPPORTED_PROTOCOL_VERSIONS, SealedEnvelope, SealedOutcome, type SignatureFailure, SignedGrant, SizeClass, type SpendConsent, StoredKeys, Succession, type SuccessionFailure, type SuccessionWalk, TERMINAL_STATES, type VersionRefusal, WireError, WireErrorCode, WithheldKind, backendDescriptor, backendName, canTransition, canonicalRequest, checkProtocolVersion, classifyCost, cryptoReady, declaredVersion, effectiveOfferScope, envelopeBytes, fingerprint, generateKeys, grantStatement, isBackendId, isCloudTaggedModel, isJobKind, isLocalHost, isTerminal, keyId, kindsOf, matchAudience, mustsVerifiedBy, open, payloadTextLength, provenanceFor, publicIdentityOf, resolveCost, seal, signGrant, signRequest, signSiteRequest, signSuccession, signWith, singlePurposeManifest, sizeClassCeiling, sizeClassOf, successionStatement, verifyGrant, verifyLink, verifyPublicIdentity, verifyRequest, verifySiteRequest, verifyWith, walkSuccession };
package/dist/index.js CHANGED
@@ -1,3 +1,70 @@
1
+ // src/about.ts
2
+ var ABOUT = `# About BYOLLM
3
+
4
+ **What BYOLLM is**
5
+
6
+ BYOLLM lets you use your own AI on websites. You install one small program on
7
+ your computer. Then, websites that support BYOLLM can use the AI you already
8
+ have \u2014 a free model running on your machine, or an AI service you already pay
9
+ for \u2014 instead of the website paying for AI and passing the cost to you.
10
+
11
+ **Why it matters**
12
+
13
+ For you:
14
+
15
+ - Your favorite model, everywhere you go.
16
+ - New models the moment you get them \u2013 not when a site gets around to adding
17
+ them.
18
+ - Encrypted end-to-end. Your prompts go to your own device; byollm.cloud can't
19
+ read them.
20
+ - Sites never learn which model you use, and your subscriptions are never
21
+ shared.
22
+ - Pay less. Sites that don't pay for AI can charge you less \u2013 or nothing.
23
+
24
+ For sites and developers:
25
+
26
+ - Zero AI bills. Your users bring their own compute.
27
+ - No floating money \u2013 you don't pay LLM bills up front and hope to collect
28
+ later, and you never ask people to prepay just to try you.
29
+ - Free trials that cost you nothing to offer.
30
+ - Ship the AI features you kept private for fear of the API bill.
31
+ - One small integration. Your users choose the models.
32
+
33
+ **Your device**
34
+
35
+ The \`byollm\` program runs on your computer. It knows which AI services you have
36
+ set up: free open-source models on your machine, metered services you pay per
37
+ use, or your own subscriptions like Claude Pro/Max. When a website you have
38
+ enabled sends work, your device runs it with the service you chose. Your
39
+ prompts are encrypted end-to-end to your own device. byollm.cloud passes them
40
+ along and cannot read them.
41
+
42
+ **Sites**
43
+
44
+ A website that wants to use BYOLLM says what it needs \u2014 "writing help," "chat,"
45
+ and so on. When you connect the site, you pick which of your services answers
46
+ each one. The site never learns which model you use. You can turn a site off at
47
+ any time, and it stops getting your work.
48
+
49
+ **Teams (optional)**
50
+
51
+ A team lets you share what runs on your devices with people you name \u2014 the free
52
+ open-source models on your machine, or a metered service with a spending limit
53
+ you set. Your subscription accounts (like Claude Pro/Max) are never shared with
54
+ anyone. That is a rule, not a setting.
55
+
56
+ **byollm.cloud (or your own relay)**
57
+
58
+ Many sites, many devices, many people. byollm.cloud keeps track of who has
59
+ allowed what and sends each job to the right device. It never sees your
60
+ prompts. If you would rather run this part yourself, the relay is open source \u2014
61
+ you can run your own instead of using byollm.cloud.`;
62
+ var ABOUT_SHORT_LEDE = "BYOLLM \u2013 Bring Your Own LLM \u2013 lets you use your own AI on websites you authorize. A small program installed on your machine lets you use your own models and subscriptions on any BYOLLM-integrated site, including new models the moment you get access \u2013 no site updates required. BYOLLM Cloud connects sites to your devices with end-to-end encryption, so no one, including us, can see your data.";
63
+ var ABOUT_SHORT_TAIL = "Sites can charge you less because you bring your own \u2013 see why that matters \u2192. Teams can optionally share the free or metered services on their devices with people they name. Personal subscriptions are never shared.";
64
+ var ABOUT_SHORT = `${ABOUT_SHORT_LEDE}
65
+
66
+ ${ABOUT_SHORT_TAIL}`;
67
+
1
68
  // src/audience.ts
2
69
  import { z as z2 } from "zod";
3
70
 
@@ -840,6 +907,11 @@ var DeliveredResult = z6.object({
840
907
  }).strict();
841
908
  var SizeClass = z6.enum(["small", "medium", "large", "unbounded"]);
842
909
  var SIZE_CLASSES = Object.freeze(SizeClass.options);
910
+ var MAX_ENVELOPE_BYTES = 10 * 1024 * 1024;
911
+ function envelopeBytes(envelope) {
912
+ const serialised = JSON.stringify(envelope);
913
+ return serialised === void 0 ? 0 : serialised.length;
914
+ }
843
915
  var SIZE_CLASS_LIMITS = Object.freeze({
844
916
  small: 4e3,
845
917
  medium: 64e3,
@@ -2287,6 +2359,10 @@ var FetchResponse = z11.object({
2287
2359
  envelope: SealedEnvelope
2288
2360
  }).strict();
2289
2361
  export {
2362
+ ABOUT,
2363
+ ABOUT_SHORT,
2364
+ ABOUT_SHORT_LEDE,
2365
+ ABOUT_SHORT_TAIL,
2290
2366
  AUDIENCES,
2291
2367
  Audience,
2292
2368
  BACKENDS,
@@ -2333,6 +2409,7 @@ export {
2333
2409
  KindedPayload,
2334
2410
  Lease,
2335
2411
  MAX_CLOCK_SKEW_MS,
2412
+ MAX_ENVELOPE_BYTES,
2336
2413
  MAX_PURPOSES,
2337
2414
  MAX_SUCCESSION_CHAIN,
2338
2415
  MIN_PROTOCOL_VERSION,
@@ -2387,6 +2464,7 @@ export {
2387
2464
  cryptoReady,
2388
2465
  declaredVersion,
2389
2466
  effectiveOfferScope,
2467
+ envelopeBytes,
2390
2468
  fingerprint,
2391
2469
  generateKeys,
2392
2470
  grantStatement,