@paradow/ledge-relay 0.65.0 → 0.66.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.
- package/dist/{chunk-ELUIOWWS.js → chunk-OQPSXTOH.js} +36 -56
- package/dist/cli.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/web/assets/{App-CWVKEzXM.js → App-BSiUwkYQ.js} +3 -3
- package/web/assets/{boot-BCvuugom.js → boot-D2V-wju8.js} +1 -1
- package/web/assets/{index-CJFu9LP7.js → index-C5B85TXh.js} +12 -12
- package/web/assets/{label-CbD8UGH0.js → label-C-VicMT7.js} +1 -1
- package/web/assets/{xterm-CDPb9wXW.js → xterm-DmfYKkwX.js} +1 -1
- package/web/build.json +1 -1
- package/web/index.html +1 -1
- package/web/sw.js +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { createPrivateKey, createPublicKey, sign, verify } from "crypto";
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z40 } from "zod";
|
|
6
6
|
|
|
7
7
|
// ../../packages/protocol/src/attachments.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -1462,7 +1462,8 @@ var ChatPointSchema = z12.object({
|
|
|
1462
1462
|
laterAt: z12.string().datetime().optional()
|
|
1463
1463
|
});
|
|
1464
1464
|
var OperatorNoticeSchema = z12.object({
|
|
1465
|
-
/** `decision`: a decision a session put to the user (a task given to Ledge), said at once; its `id` is `decision:<task id>`.
|
|
1465
|
+
/** `decision`: a decision a session put to the user (a task given to Ledge), said at once; its `id` is `decision:<task id>`.
|
|
1466
|
+
* `point`: sent only by daemons before #27 (the point left the dynamic island); kept so their notices still parse. */
|
|
1466
1467
|
id: z12.string(),
|
|
1467
1468
|
kind: z12.enum(["point", "rig.ask", "decision"]),
|
|
1468
1469
|
qid: z12.string().optional(),
|
|
@@ -1758,22 +1759,25 @@ var IslandPrefsSchema = z19.object({
|
|
|
1758
1759
|
* name, `#index` without one). `second`, written by older fronts, is the first monitor that is not the primary. */
|
|
1759
1760
|
screen: z19.string().trim().min(1).max(200),
|
|
1760
1761
|
position: z19.enum(["center", "left", "right"]),
|
|
1761
|
-
/**
|
|
1762
|
-
|
|
1762
|
+
/** Retired with the floating island (#27): it was a strip under a maximised window. Optional and never read, so a file or
|
|
1763
|
+
* a front that still carries it parses; still written by DEFAULT_ISLAND_PREFS because a daemon before #27 requires it in
|
|
1764
|
+
* `island.set`. */
|
|
1765
|
+
discreet: z19.boolean().optional(),
|
|
1763
1766
|
islandScale: IslandScaleSchema,
|
|
1764
|
-
|
|
1767
|
+
/** Retired with the floating island (#27): the island's size sizes its cards too. Optional and never read; still written by
|
|
1768
|
+
* DEFAULT_ISLAND_PREFS for daemons before #27, which require it. */
|
|
1769
|
+
panelScale: IslandScaleSchema.optional(),
|
|
1765
1770
|
/** What the island shows besides asks and questions, which it always shows. */
|
|
1766
1771
|
shows: z19.object({
|
|
1767
1772
|
/** Allow, deny or answer in a line from the island; off, its cards only say « Open in Ledge ». */
|
|
1768
1773
|
quick: z19.boolean(),
|
|
1769
|
-
/** The 6 s
|
|
1774
|
+
/** The 6 s « Done » card when an agent finishes its turn. */
|
|
1770
1775
|
finished: z19.boolean(),
|
|
1771
|
-
/**
|
|
1772
|
-
say: z19.boolean(),
|
|
1773
|
-
|
|
1774
|
-
helpers: z19.boolean()
|
|
1776
|
+
/** Retired with the floating island (#27), like `helpers`: optional and never read, still written by default for older daemons. */
|
|
1777
|
+
say: z19.boolean().optional(),
|
|
1778
|
+
helpers: z19.boolean().optional()
|
|
1775
1779
|
}),
|
|
1776
|
-
/** The global shortcut that
|
|
1780
|
+
/** The global shortcut that reopens the oldest waiting request, as shown (`Ctrl Alt L`). */
|
|
1777
1781
|
shortcut: z19.string().trim().min(1).max(40)
|
|
1778
1782
|
});
|
|
1779
1783
|
|
|
@@ -4136,30 +4140,6 @@ var PhoneServerMessageSchema = z39.discriminatedUnion("type", [
|
|
|
4136
4140
|
}).strict()
|
|
4137
4141
|
]);
|
|
4138
4142
|
|
|
4139
|
-
// ../../packages/protocol/src/media.ts
|
|
4140
|
-
import { z as z40 } from "zod";
|
|
4141
|
-
var MediaCommandSchema = z40.enum(["previous", "play_pause", "next"]);
|
|
4142
|
-
var ARTWORK_MAX_BYTES = 512 * 1024;
|
|
4143
|
-
var NowPlayingSchema = z40.object({
|
|
4144
|
-
/** The track's title; a session without one is not reported (nothing to show). */
|
|
4145
|
-
title: z40.string().min(1),
|
|
4146
|
-
/** '' when the player gives none (a web video often has no artist). */
|
|
4147
|
-
artist: z40.string(),
|
|
4148
|
-
album: z40.string().optional(),
|
|
4149
|
-
/** The cover as a `data:image/…;base64,` URL; left out when the player has none, or it is over ARTWORK_MAX_BYTES. It can
|
|
4150
|
-
* arrive in a later event than the track itself: players often publish the thumbnail a moment after the title. */
|
|
4151
|
-
artwork: z40.string().startsWith("data:image/").optional(),
|
|
4152
|
-
/** True while it plays; a paused session is still reported (with false), `null` means no media session at all. */
|
|
4153
|
-
playing: z40.boolean(),
|
|
4154
|
-
/** What the player accepts now; a control it refuses is disabled, not hidden, at the front's choice. */
|
|
4155
|
-
can: z40.object({ previous: z40.boolean(), playPause: z40.boolean(), next: z40.boolean() }),
|
|
4156
|
-
/** The player: SMTC's source app id (`Spotify.exe`, `MSEdge`, a packaged app's AUMID), and its display name when
|
|
4157
|
-
* Windows knows one. Several players can hold a session: the one reported is the one playing (Windows' current one
|
|
4158
|
-
* first), else Windows' current one. Commands go to that same player. */
|
|
4159
|
-
player: z40.object({ id: z40.string().min(1), name: z40.string().optional() })
|
|
4160
|
-
});
|
|
4161
|
-
var NowPlayingStateSchema = NowPlayingSchema.nullable();
|
|
4162
|
-
|
|
4163
4143
|
// src/config.ts
|
|
4164
4144
|
var ConfigError = class extends Error {
|
|
4165
4145
|
constructor(message) {
|
|
@@ -4167,8 +4147,8 @@ var ConfigError = class extends Error {
|
|
|
4167
4147
|
this.name = "ConfigError";
|
|
4168
4148
|
}
|
|
4169
4149
|
};
|
|
4170
|
-
var TokensSchema =
|
|
4171
|
-
var PortSchema =
|
|
4150
|
+
var TokensSchema = z40.record(z40.string().min(1), z40.object({ accountId: z40.string().min(1), peer: RelayPeerSchema }));
|
|
4151
|
+
var PortSchema = z40.coerce.number().int().min(0).max(65535);
|
|
4172
4152
|
function required(env, name) {
|
|
4173
4153
|
const v = env[name];
|
|
4174
4154
|
if (!v) throw new ConfigError(`${name} is not set`);
|
|
@@ -4501,10 +4481,10 @@ function countedLog(log, ms) {
|
|
|
4501
4481
|
|
|
4502
4482
|
// src/routes.ts
|
|
4503
4483
|
import { createHash as createHash3, timingSafeEqual as timingSafeEqual2 } from "crypto";
|
|
4504
|
-
import { z as
|
|
4484
|
+
import { z as z42 } from "zod";
|
|
4505
4485
|
|
|
4506
4486
|
// src/github.ts
|
|
4507
|
-
import { z as
|
|
4487
|
+
import { z as z41 } from "zod";
|
|
4508
4488
|
var GitHubError = class extends Error {
|
|
4509
4489
|
code;
|
|
4510
4490
|
constructor(code) {
|
|
@@ -4513,21 +4493,21 @@ var GitHubError = class extends Error {
|
|
|
4513
4493
|
this.code = code;
|
|
4514
4494
|
}
|
|
4515
4495
|
};
|
|
4516
|
-
var DeviceStartSchema =
|
|
4517
|
-
device_code:
|
|
4518
|
-
user_code:
|
|
4519
|
-
verification_uri:
|
|
4520
|
-
expires_in:
|
|
4521
|
-
interval:
|
|
4522
|
-
});
|
|
4523
|
-
var TokenAnswerSchema =
|
|
4524
|
-
access_token:
|
|
4525
|
-
error:
|
|
4526
|
-
interval:
|
|
4527
|
-
});
|
|
4528
|
-
var UserSchema =
|
|
4529
|
-
id:
|
|
4530
|
-
login:
|
|
4496
|
+
var DeviceStartSchema = z41.object({
|
|
4497
|
+
device_code: z41.string().min(1),
|
|
4498
|
+
user_code: z41.string().min(1),
|
|
4499
|
+
verification_uri: z41.string().min(1),
|
|
4500
|
+
expires_in: z41.number().int().positive(),
|
|
4501
|
+
interval: z41.number().int().positive()
|
|
4502
|
+
});
|
|
4503
|
+
var TokenAnswerSchema = z41.object({
|
|
4504
|
+
access_token: z41.string().min(1).optional(),
|
|
4505
|
+
error: z41.string().optional(),
|
|
4506
|
+
interval: z41.number().int().positive().optional()
|
|
4507
|
+
});
|
|
4508
|
+
var UserSchema = z41.object({
|
|
4509
|
+
id: z41.number().int().nonnegative(),
|
|
4510
|
+
login: z41.string().min(1)
|
|
4531
4511
|
});
|
|
4532
4512
|
var DEVICE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
|
|
4533
4513
|
var USER_AGENT = "ledge-relay";
|
|
@@ -4782,10 +4762,10 @@ async function readJson(req, schema, max = MAX_BODY) {
|
|
|
4782
4762
|
if (!r.success) throw new Answer(400, "bad_request");
|
|
4783
4763
|
return r.data;
|
|
4784
4764
|
}
|
|
4785
|
-
var RevokeBodySchema =
|
|
4765
|
+
var RevokeBodySchema = z42.object({
|
|
4786
4766
|
peer: RelayPeerSchema.refine((p) => p !== "pc")
|
|
4787
4767
|
});
|
|
4788
|
-
var PollBodySchema =
|
|
4768
|
+
var PollBodySchema = z42.object({ deviceCode: z42.string().min(1).max(1024) });
|
|
4789
4769
|
function authRoutes(deps) {
|
|
4790
4770
|
const maxCalls = deps.maxGitHubCalls ?? DEFAULT_MAX_GITHUB_CALLS;
|
|
4791
4771
|
let inFlight = 0;
|
package/dist/cli.js
CHANGED
package/dist/main.js
CHANGED