byollm 0.1.2 → 0.1.4
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 +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-K7QYAF7V.js → chunk-LGN2DHFP.js} +316 -48
- package/dist/chunk-LGN2DHFP.js.map +1 -0
- package/dist/index.d.ts +59 -6
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-K7QYAF7V.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -647,6 +647,25 @@ type ServiceState =
|
|
|
647
647
|
| {
|
|
648
648
|
readonly kind: "unstartable";
|
|
649
649
|
readonly model: string;
|
|
650
|
+
/**
|
|
651
|
+
* The type byollm WOULD start at this service's address — B098's offer,
|
|
652
|
+
* carried to the screen people look at.
|
|
653
|
+
*
|
|
654
|
+
* Todd, 10-05, after a reboot: `glm-5.2` is `openai-http` at
|
|
655
|
+
* `127.0.0.1:11434`, and this line told him only "start it yourself".
|
|
656
|
+
* He read it as on-demand start having broken. It had not — only
|
|
657
|
+
* `type: "ollama"` is ever started, ruled 09-10, offered not inferred —
|
|
658
|
+
* and `byollm diagnose` already printed the one-field fix. `status`
|
|
659
|
+
* did not, and `status` is what people read.
|
|
660
|
+
*
|
|
661
|
+
* Set by the daemon from `startableAt` (local-server.ts), the same function
|
|
662
|
+
* diagnose asks, and only when that provider is installed here: an
|
|
663
|
+
* offer to retype a service into one that would then read "not found"
|
|
664
|
+
* is a remedy that moves the problem. Optional, and absent means no
|
|
665
|
+
* offer — a file written before this field existed says what it always
|
|
666
|
+
* said.
|
|
667
|
+
*/
|
|
668
|
+
readonly startableAs?: BackendId | undefined;
|
|
650
669
|
} | {
|
|
651
670
|
readonly kind: "stopped";
|
|
652
671
|
readonly model: string;
|
|
@@ -934,6 +953,7 @@ declare const CommunityBudget: z.ZodObject<{
|
|
|
934
953
|
maxWallClockMs: z.ZodDefault<z.ZodNumber>;
|
|
935
954
|
maxOutputBytes: z.ZodDefault<z.ZodNumber>;
|
|
936
955
|
maxPayloadChars: z.ZodDefault<z.ZodNumber>;
|
|
956
|
+
countTeamJobs: z.ZodDefault<z.ZodBoolean>;
|
|
937
957
|
}, z.core.$strict>;
|
|
938
958
|
type CommunityBudget = z.infer<typeof CommunityBudget>;
|
|
939
959
|
/** Ingress-log retention (byollm_004 Rev 1). */
|
|
@@ -1003,6 +1023,7 @@ declare const DaemonConfig: z.ZodObject<{
|
|
|
1003
1023
|
maxWallClockMs: z.ZodDefault<z.ZodNumber>;
|
|
1004
1024
|
maxOutputBytes: z.ZodDefault<z.ZodNumber>;
|
|
1005
1025
|
maxPayloadChars: z.ZodDefault<z.ZodNumber>;
|
|
1026
|
+
countTeamJobs: z.ZodDefault<z.ZodBoolean>;
|
|
1006
1027
|
}, z.core.$strict>>;
|
|
1007
1028
|
ingress: z.ZodPrefault<z.ZodObject<{
|
|
1008
1029
|
communityPromptDays: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1110,7 +1131,20 @@ declare function loadConfig(path: string): Promise<LoadedConfig>;
|
|
|
1110
1131
|
*/
|
|
1111
1132
|
declare function resolveConfig(config: DaemonConfig): LoadedConfig;
|
|
1112
1133
|
|
|
1113
|
-
|
|
1134
|
+
/**
|
|
1135
|
+
* The caps this class enforces. `countTeamJobs` is not one of them: whether a
|
|
1136
|
+
* job is counted is the runner's question, asked per job, and answered here
|
|
1137
|
+
* through `check`'s `counted`.
|
|
1138
|
+
*/
|
|
1139
|
+
type Caps = Omit<CommunityBudget, "countTeamJobs">;
|
|
1140
|
+
/** Which brake refused a community job — written to the ingress log. */
|
|
1141
|
+
declare const BudgetRefusal: z.ZodEnum<{
|
|
1142
|
+
"hourly-cap": "hourly-cap";
|
|
1143
|
+
"daily-cap": "daily-cap";
|
|
1144
|
+
"payload-too-large": "payload-too-large";
|
|
1145
|
+
"ledger-untrusted": "ledger-untrusted";
|
|
1146
|
+
}>;
|
|
1147
|
+
type BudgetRefusal = z.infer<typeof BudgetRefusal>;
|
|
1114
1148
|
type BudgetDecision = {
|
|
1115
1149
|
readonly ok: true;
|
|
1116
1150
|
} | {
|
|
@@ -1129,7 +1163,7 @@ type BudgetDecision = {
|
|
|
1129
1163
|
*/
|
|
1130
1164
|
declare class Budgets {
|
|
1131
1165
|
#private;
|
|
1132
|
-
constructor(path: string, limits:
|
|
1166
|
+
constructor(path: string, limits: Caps);
|
|
1133
1167
|
/**
|
|
1134
1168
|
* Read the record of what has already been accepted.
|
|
1135
1169
|
*
|
|
@@ -1146,15 +1180,20 @@ declare class Budgets {
|
|
|
1146
1180
|
*
|
|
1147
1181
|
* @param payloadChars - total payload text length, checked against the
|
|
1148
1182
|
* stricter community limit rather than the protocol's absolute ceiling.
|
|
1183
|
+
* @param counted - whether this job counts toward the hourly and daily
|
|
1184
|
+
* caps. `false` only for a teammate's job on a metered service the owner
|
|
1185
|
+
* shared, which the spend ceiling already bounds — see
|
|
1186
|
+
* {@link CommunityBudget}'s `countTeamJobs`. The payload limit applies
|
|
1187
|
+
* either way.
|
|
1149
1188
|
*/
|
|
1150
|
-
check(now: number, payloadChars: number): BudgetDecision;
|
|
1189
|
+
check(now: number, payloadChars: number, counted?: boolean): BudgetDecision;
|
|
1151
1190
|
/** Count a community job as accepted. Call only after {@link check} passes. */
|
|
1152
1191
|
record(now: number): Promise<void>;
|
|
1153
1192
|
/** Current usage, for `byollm status`. */
|
|
1154
1193
|
usage(now: number): {
|
|
1155
1194
|
hour: number;
|
|
1156
1195
|
day: number;
|
|
1157
|
-
limits:
|
|
1196
|
+
limits: Caps;
|
|
1158
1197
|
};
|
|
1159
1198
|
}
|
|
1160
1199
|
|
|
@@ -1376,6 +1415,12 @@ declare const OutcomeEntry: z.ZodObject<{
|
|
|
1376
1415
|
unavailable: "unavailable";
|
|
1377
1416
|
unverified: "unverified";
|
|
1378
1417
|
}>>;
|
|
1418
|
+
brake: z.ZodOptional<z.ZodEnum<{
|
|
1419
|
+
"hourly-cap": "hourly-cap";
|
|
1420
|
+
"daily-cap": "daily-cap";
|
|
1421
|
+
"payload-too-large": "payload-too-large";
|
|
1422
|
+
"ledger-untrusted": "ledger-untrusted";
|
|
1423
|
+
}>>;
|
|
1379
1424
|
}, z.core.$strict>;
|
|
1380
1425
|
type OutcomeEntry = z.infer<typeof OutcomeEntry>;
|
|
1381
1426
|
declare const IngressEntry: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1420,6 +1465,12 @@ declare const IngressEntry: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1420
1465
|
unavailable: "unavailable";
|
|
1421
1466
|
unverified: "unverified";
|
|
1422
1467
|
}>>;
|
|
1468
|
+
brake: z.ZodOptional<z.ZodEnum<{
|
|
1469
|
+
"hourly-cap": "hourly-cap";
|
|
1470
|
+
"daily-cap": "daily-cap";
|
|
1471
|
+
"payload-too-large": "payload-too-large";
|
|
1472
|
+
"ledger-untrusted": "ledger-untrusted";
|
|
1473
|
+
}>>;
|
|
1423
1474
|
}, z.core.$strict>, z.ZodObject<{
|
|
1424
1475
|
type: z.ZodLiteral<"memory">;
|
|
1425
1476
|
at: z.ZodNumber;
|
|
@@ -1483,6 +1534,7 @@ declare class IngressLog {
|
|
|
1483
1534
|
detail?: string;
|
|
1484
1535
|
stop?: StopReason;
|
|
1485
1536
|
stopKind?: StopReasonMapping["kind"];
|
|
1537
|
+
brake?: BudgetRefusal;
|
|
1486
1538
|
}): Promise<void>;
|
|
1487
1539
|
/** Record what the memory guard decided — B080. */
|
|
1488
1540
|
recordMemory(input: {
|
|
@@ -2064,6 +2116,7 @@ declare class Runner {
|
|
|
2064
2116
|
} | {
|
|
2065
2117
|
ok: false;
|
|
2066
2118
|
reason: string;
|
|
2119
|
+
brake?: BudgetRefusal;
|
|
2067
2120
|
};
|
|
2068
2121
|
/**
|
|
2069
2122
|
* Run one job, and report HOW it ran as well as what it produced — B064
|
|
@@ -2545,7 +2598,7 @@ declare const BASE_URL_REFUSAL_MESSAGES: Readonly<Record<BaseUrlRefusal, string>
|
|
|
2545
2598
|
* define: an app's runner list shows this string, so a stale one is a lie
|
|
2546
2599
|
* told to every user, and a literal that a test pins cannot drift quietly.
|
|
2547
2600
|
*/
|
|
2548
|
-
declare const DAEMON_VERSION = "0.1.
|
|
2601
|
+
declare const DAEMON_VERSION = "0.1.4";
|
|
2549
2602
|
/**
|
|
2550
2603
|
* Everything needed to reason about one daemon — byollm_010 §5.
|
|
2551
2604
|
*
|
|
@@ -2571,4 +2624,4 @@ declare function daemonVersion(): DaemonVersion;
|
|
|
2571
2624
|
/** One line, for `--version` and for pasting into an issue. */
|
|
2572
2625
|
declare function formatVersion(v?: DaemonVersion): string;
|
|
2573
2626
|
|
|
2574
|
-
export { BASE_URL_REFUSAL_MESSAGES, type Backend, type BackendErrorCode, type BackendHealth, type BackendInit, type BackendRequest, type BackendResult, type BaseUrlCheck, type BaseUrlRefusal, type BudgetDecision,
|
|
2627
|
+
export { BASE_URL_REFUSAL_MESSAGES, type Backend, type BackendErrorCode, type BackendHealth, type BackendInit, type BackendRequest, type BackendResult, type BaseUrlCheck, type BaseUrlRefusal, type BudgetDecision, BudgetRefusal, Budgets, ClaudeCliBackend, type CliIo, ClientError, type ClientErrorKind, type ClientOptions, CommunityBudget, type ConfigProblem, type ConnectOptions, type ConnectResult, DAEMON_VERSION, DEFAULT_CONFIG, DaemonConfig, type DaemonPaths, type DaemonVersion, DeviceIdentity, type ExitCode, IngressEntry, IngressLog, type IngressOptions, IngressRetention, Limits, type LoadedConfig, type MemoryPressure, type MemoryReading, OpenAiHttpBackend, OutcomeEntry, Pairing, Pairings, PromptEntry, ProtocolClient, type ReadCommand, type ResolvedRoute, Runner, type RunnerEvent, type RunnerOptions, type RunnerStatus, ServiceConfig, SpendLedger, UnusableOrigin, checkBaseUrl, childEnv, claudeArgv, composePrompt, connect, createBackend, currentPlatform, daemonPaths, daemonVersion, defaultRoot, estimateCents, formatVersion, hashText, loadConfig, main, normalizeOrigin, parseMemInfo, parsePressureLevel, parsePsi, parseSwapUsage, parseVmStat, readMemory, readPressure, resolveConfig, runCli, stripControlChars };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "byollm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Bring Your Own LLM — run an app's LLM jobs on your own models.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"zod": "4.4.3",
|
|
27
|
-
"@byollm/protocol": "0.1.
|
|
27
|
+
"@byollm/protocol": "0.1.4"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|