@byollm/protocol 0.1.0-alpha.60 → 0.1.0-alpha.61
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/README.md +2 -2
- package/dist/index.d.ts +55 -12
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
> [!WARNING]
|
|
2
|
-
> **Alpha (`0.1.0-alpha.
|
|
2
|
+
> **Alpha (`0.1.0-alpha.61`) — 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.
|
|
86
|
+
> so `0.1.0-alpha.61` 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,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Its members, for anything that has to report what it accepts.
|
|
5
|
+
*
|
|
6
|
+
* Derived from the enum for the reason `JOB_KINDS` and `OFFER_SCOPES` are: a
|
|
7
|
+
* second list of the same words is a second thing to keep in step, and this
|
|
8
|
+
* one is read by the promotion gate to compare a deployed hub against a
|
|
9
|
+
* version about to be promoted.
|
|
10
|
+
*/
|
|
11
|
+
declare const BACKEND_CLASSES: readonly ("http" | "process")[];
|
|
3
12
|
/**
|
|
4
13
|
* How a backend reaches its model — the taxonomy introduced in byollm_001
|
|
5
14
|
* Rev 1 §A, because the two classes have different threat surfaces.
|
|
@@ -860,6 +869,8 @@ declare const DeliveredResult: z.ZodObject<{
|
|
|
860
869
|
fallback: z.ZodOptional<z.ZodLiteral<true>>;
|
|
861
870
|
}, z.core.$strict>;
|
|
862
871
|
type DeliveredResult = z.infer<typeof DeliveredResult>;
|
|
872
|
+
/** Its members, derived — see {@link BACKEND_CLASSES} for why. */
|
|
873
|
+
declare const SIZE_CLASSES: readonly ("small" | "medium" | "large" | "unbounded")[];
|
|
863
874
|
/**
|
|
864
875
|
* How big a payload is, in buckets — byollm_009 §6.
|
|
865
876
|
*
|
|
@@ -1894,8 +1905,30 @@ declare const MUST_IDS: readonly ("PAIR_ONE_USER" | "PAIR_INTERACTIVE" | "PAIR_C
|
|
|
1894
1905
|
/** Every MUST verified a particular way. */
|
|
1895
1906
|
declare function mustsVerifiedBy(kind: MustVerification): MustId[];
|
|
1896
1907
|
|
|
1897
|
-
/**
|
|
1898
|
-
|
|
1908
|
+
/**
|
|
1909
|
+
* Protocol version carried on every request; servers refuse what they can't
|
|
1910
|
+
* speak.
|
|
1911
|
+
*
|
|
1912
|
+
* **`1` because byollm_016 changed the vocabulary** — byollm-review
|
|
1913
|
+
* 2026-08-27. `OfferScope` lost `public`, `self|named` became
|
|
1914
|
+
* `private|team`, `JobStub` lost `service` and gained `purpose`, and the
|
|
1915
|
+
* grant's site field changed namespace. The version stayed `0` through all of
|
|
1916
|
+
* it.
|
|
1917
|
+
*
|
|
1918
|
+
* The consequence was the failure the handshake exists to prevent, arriving
|
|
1919
|
+
* around it: a pre-rip daemon declares `0`, passes the version check, and
|
|
1920
|
+
* then fails whole-body schema validation with "request failed schema
|
|
1921
|
+
* validation" — no field named, no vocabulary named, no upgrade command. Once
|
|
1922
|
+
* every ten seconds, forever, while its owner watches a device go stale for
|
|
1923
|
+
* no stated reason. The check below was written because "a mismatch surfaced
|
|
1924
|
+
* as a generic bad-request" and "an error a user cannot act on is barely
|
|
1925
|
+
* better than a hang"; the number not moving is how that came back.
|
|
1926
|
+
*
|
|
1927
|
+
* A registry is a schema and an enum value is the contract — this project's
|
|
1928
|
+
* own words, from the release that silenced a fleet by adding a backend id.
|
|
1929
|
+
* The same sentence applies to removing an offer scope.
|
|
1930
|
+
*/
|
|
1931
|
+
declare const PROTOCOL_VERSION: "1";
|
|
1899
1932
|
/**
|
|
1900
1933
|
* Every protocol version this build can serve, **oldest first**.
|
|
1901
1934
|
*
|
|
@@ -1903,6 +1936,16 @@ declare const PROTOCOL_VERSION: "0";
|
|
|
1903
1936
|
* the check is the point: a server supporting two versions through a
|
|
1904
1937
|
* migration should not need a different code path from one supporting one.
|
|
1905
1938
|
*/
|
|
1939
|
+
/**
|
|
1940
|
+
* `0` is deliberately **not** here, though the list exists for exactly that.
|
|
1941
|
+
*
|
|
1942
|
+
* Supporting two versions through a migration is the shape this was built
|
|
1943
|
+
* for, and it is the wrong tool when the vocabularies are incompatible: a `0`
|
|
1944
|
+
* daemon sends `offer: "public"` and a `service` on its stubs, so accepting
|
|
1945
|
+
* its version only moves the refusal one layer down — to the schema error
|
|
1946
|
+
* that names nothing, which is the bug. Refusing the version is the whole
|
|
1947
|
+
* point, because that refusal says what to do.
|
|
1948
|
+
*/
|
|
1906
1949
|
declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
|
|
1907
1950
|
/**
|
|
1908
1951
|
* The oldest version this build will talk to — derived, not declared.
|
|
@@ -2105,7 +2148,7 @@ type GrantRef = z.infer<typeof GrantRef>;
|
|
|
2105
2148
|
* and nothing works over a copied string alone.
|
|
2106
2149
|
*/
|
|
2107
2150
|
declare const PairStartRequest: z.ZodObject<{
|
|
2108
|
-
protocolVersion: z.ZodLiteral<"
|
|
2151
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2109
2152
|
action: z.ZodLiteral<"start">;
|
|
2110
2153
|
daemon: z.ZodObject<{
|
|
2111
2154
|
version: z.ZodString;
|
|
@@ -2169,7 +2212,7 @@ declare const PairStartResponse: z.ZodObject<{
|
|
|
2169
2212
|
}, z.core.$strict>;
|
|
2170
2213
|
type PairStartResponse = z.infer<typeof PairStartResponse>;
|
|
2171
2214
|
declare const PairPollRequest: z.ZodObject<{
|
|
2172
|
-
protocolVersion: z.ZodLiteral<"
|
|
2215
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2173
2216
|
action: z.ZodLiteral<"poll">;
|
|
2174
2217
|
deviceCode: z.ZodString;
|
|
2175
2218
|
}, z.core.$strict>;
|
|
@@ -2194,7 +2237,7 @@ declare const PairPollResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2194
2237
|
}, z.core.$strict>], "status">;
|
|
2195
2238
|
type PairPollResponse = z.infer<typeof PairPollResponse>;
|
|
2196
2239
|
declare const PairRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2197
|
-
protocolVersion: z.ZodLiteral<"
|
|
2240
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2198
2241
|
action: z.ZodLiteral<"start">;
|
|
2199
2242
|
daemon: z.ZodObject<{
|
|
2200
2243
|
version: z.ZodString;
|
|
@@ -2248,13 +2291,13 @@ declare const PairRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2248
2291
|
}>;
|
|
2249
2292
|
}, z.core.$strict>>;
|
|
2250
2293
|
}, z.core.$strict>, z.ZodObject<{
|
|
2251
|
-
protocolVersion: z.ZodLiteral<"
|
|
2294
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2252
2295
|
action: z.ZodLiteral<"poll">;
|
|
2253
2296
|
deviceCode: z.ZodString;
|
|
2254
2297
|
}, z.core.$strict>], "action">;
|
|
2255
2298
|
type PairRequest = z.infer<typeof PairRequest>;
|
|
2256
2299
|
declare const ClaimRequest: z.ZodObject<{
|
|
2257
|
-
protocolVersion: z.ZodLiteral<"
|
|
2300
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2258
2301
|
runnerId: z.ZodString;
|
|
2259
2302
|
capabilities: z.ZodArray<z.ZodObject<{
|
|
2260
2303
|
kind: z.ZodEnum<{
|
|
@@ -2340,7 +2383,7 @@ declare const ClaimResponse: z.ZodObject<{
|
|
|
2340
2383
|
}, z.core.$strict>;
|
|
2341
2384
|
type ClaimResponse = z.infer<typeof ClaimResponse>;
|
|
2342
2385
|
declare const HeartbeatRequest: z.ZodObject<{
|
|
2343
|
-
protocolVersion: z.ZodLiteral<"
|
|
2386
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2344
2387
|
runnerId: z.ZodString;
|
|
2345
2388
|
daemonVersion: z.ZodString;
|
|
2346
2389
|
capabilities: z.ZodArray<z.ZodObject<{
|
|
@@ -2448,7 +2491,7 @@ declare const ResultDisposition: z.ZodEnum<{
|
|
|
2448
2491
|
}>;
|
|
2449
2492
|
type ResultDisposition = z.infer<typeof ResultDisposition>;
|
|
2450
2493
|
declare const ResultRequest: z.ZodObject<{
|
|
2451
|
-
protocolVersion: z.ZodLiteral<"
|
|
2494
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2452
2495
|
runnerId: z.ZodString;
|
|
2453
2496
|
jobId: z.ZodString;
|
|
2454
2497
|
leaseId: z.ZodString;
|
|
@@ -2476,7 +2519,7 @@ declare const ResultResponse: z.ZodObject<{
|
|
|
2476
2519
|
}, z.core.$strict>;
|
|
2477
2520
|
type ResultResponse = z.infer<typeof ResultResponse>;
|
|
2478
2521
|
declare const ReleaseRequest: z.ZodObject<{
|
|
2479
|
-
protocolVersion: z.ZodLiteral<"
|
|
2522
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2480
2523
|
runnerId: z.ZodString;
|
|
2481
2524
|
leases: z.ZodArray<z.ZodObject<{
|
|
2482
2525
|
jobId: z.ZodString;
|
|
@@ -2542,7 +2585,7 @@ type WireError = z.infer<typeof WireError>;
|
|
|
2542
2585
|
/** HTTP status each error code is served with. */
|
|
2543
2586
|
declare const ERROR_STATUS: Readonly<Record<WireErrorCode, number>>;
|
|
2544
2587
|
declare const FetchRequest: z.ZodObject<{
|
|
2545
|
-
protocolVersion: z.ZodLiteral<"
|
|
2588
|
+
protocolVersion: z.ZodLiteral<"1">;
|
|
2546
2589
|
runnerId: z.ZodString;
|
|
2547
2590
|
jobId: z.ZodString;
|
|
2548
2591
|
leaseId: z.ZodString;
|
|
@@ -2562,4 +2605,4 @@ declare const FetchResponse: z.ZodObject<{
|
|
|
2562
2605
|
}, z.core.$strict>;
|
|
2563
2606
|
type FetchResponse = z.infer<typeof FetchResponse>;
|
|
2564
2607
|
|
|
2565
|
-
export { AUDIENCES, Audience, BACKENDS, 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_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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { z as z2 } from "zod";
|
|
|
5
5
|
import { isIP } from "net";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
var BackendClass = z.enum(["http", "process"]);
|
|
8
|
+
var BACKEND_CLASSES = Object.freeze(BackendClass.options);
|
|
8
9
|
var BackendCost = z.enum(["free", "metered", "subscription"]);
|
|
9
10
|
var backend = (b) => Object.freeze(b);
|
|
10
11
|
var BACKENDS = Object.freeze({
|
|
@@ -838,6 +839,7 @@ var DeliveredResult = z6.object({
|
|
|
838
839
|
fallback: z6.literal(true).optional()
|
|
839
840
|
}).strict();
|
|
840
841
|
var SizeClass = z6.enum(["small", "medium", "large", "unbounded"]);
|
|
842
|
+
var SIZE_CLASSES = Object.freeze(SizeClass.options);
|
|
841
843
|
var SIZE_CLASS_LIMITS = Object.freeze({
|
|
842
844
|
small: 4e3,
|
|
843
845
|
medium: 64e3,
|
|
@@ -1681,7 +1683,7 @@ function mustsVerifiedBy(kind) {
|
|
|
1681
1683
|
|
|
1682
1684
|
// src/wire.ts
|
|
1683
1685
|
import { z as z11 } from "zod";
|
|
1684
|
-
var PROTOCOL_VERSION = "
|
|
1686
|
+
var PROTOCOL_VERSION = "1";
|
|
1685
1687
|
var SUPPORTED_PROTOCOL_VERSIONS = Object.freeze([
|
|
1686
1688
|
PROTOCOL_VERSION
|
|
1687
1689
|
]);
|
|
@@ -2288,6 +2290,7 @@ export {
|
|
|
2288
2290
|
AUDIENCES,
|
|
2289
2291
|
Audience,
|
|
2290
2292
|
BACKENDS,
|
|
2293
|
+
BACKEND_CLASSES,
|
|
2291
2294
|
BACKEND_IDS,
|
|
2292
2295
|
BackendClass,
|
|
2293
2296
|
BackendCost,
|
|
@@ -2361,6 +2364,7 @@ export {
|
|
|
2361
2364
|
ResultRequest,
|
|
2362
2365
|
ResultResponse,
|
|
2363
2366
|
RunMetadata,
|
|
2367
|
+
SIZE_CLASSES,
|
|
2364
2368
|
SIZE_CLASS_LIMITS,
|
|
2365
2369
|
SUCCESSION_CONTEXT,
|
|
2366
2370
|
SUPPORTED_PROTOCOL_VERSIONS,
|