agl 42.0.0 → 42.1.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/changelog.md +6 -0
- package/dist_serve/bundle.js +2493 -2143
- package/dist_serve/bundle.js.map +2 -2
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/aglapi/aglapisurface.document.js +2 -2
- package/dist_ts/classes.authstore.d.ts +2 -0
- package/dist_ts/classes.authstore.js +50 -17
- package/dist_ts/classes.controller.d.ts +71 -2
- package/dist_ts/classes.controller.js +500 -113
- package/dist_ts/classes.controllerdevices.d.ts +128 -0
- package/dist_ts/classes.controllerdevices.js +472 -0
- package/dist_ts/classes.sessionfeed.d.ts +10 -1
- package/dist_ts/classes.sessionfeed.js +12 -2
- package/dist_ts/classes.validation.d.ts +2 -0
- package/dist_ts/classes.validation.js +2 -2
- package/dist_ts/functions.deviceapi.d.ts +28 -0
- package/dist_ts/functions.deviceapi.js +246 -0
- package/dist_ts/functions.deviceproof.d.ts +33 -0
- package/dist_ts/functions.deviceproof.js +93 -0
- package/dist_ts/functions.remotecli.d.ts +1 -1
- package/dist_ts/functions.remotecli.js +12 -7
- package/dist_ts/interfaces.auth.d.ts +1 -1
- package/dist_ts/interfaces.auth.js +6 -1
- package/dist_ts_interfaces/devices.d.ts +331 -0
- package/dist_ts_interfaces/devices.js +34 -0
- package/dist_ts_interfaces/index.d.ts +2 -0
- package/dist_ts_interfaces/index.js +3 -1
- package/dist_ts_interfaces/interfaces.d.ts +4 -2
- package/dist_ts_interfaces/interfaces.js +3 -2
- package/dist_ts_interfaces/mcprequests.d.ts +1 -1
- package/dist_ts_interfaces/requests.d.ts +2 -1
- package/dist_ts_interfaces/requests.devices.d.ts +89 -0
- package/dist_ts_interfaces/requests.devices.js +2 -0
- package/dist_ts_interfaces/requests.js +1 -1
- package/package.json +1 -1
- package/readme.md +36 -4
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/aglapi/aglapisurface.document.ts +2 -2
- package/ts/classes.authstore.ts +46 -14
- package/ts/classes.controller.ts +697 -167
- package/ts/classes.controllerdevices.ts +469 -0
- package/ts/classes.sessionfeed.ts +13 -1
- package/ts/classes.validation.ts +1 -1
- package/ts/functions.deviceapi.ts +295 -0
- package/ts/functions.deviceproof.ts +118 -0
- package/ts/functions.remotecli.ts +11 -5
- package/ts/interfaces.auth.ts +5 -0
- package/ts_interfaces/devices.schema.json +890 -0
- package/ts_interfaces/devices.ts +392 -0
- package/ts_interfaces/index.ts +2 -0
- package/ts_interfaces/interfaces.ts +4 -1
- package/ts_interfaces/mcprequests.ts +1 -1
- package/ts_interfaces/requests.devices.ts +95 -0
- package/ts_interfaces/requests.ts +10 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/classes.controllersocketclient.ts +27 -0
- package/ts_web/elements.devices.ts +752 -0
- package/ts_web/elements.harnesscontrollerapp.ts +18 -1
|
@@ -160,6 +160,10 @@ export declare class OpenCodeController {
|
|
|
160
160
|
private pendingFlexMessageEventBytes;
|
|
161
161
|
private flexControllerEventDrainTask?;
|
|
162
162
|
private controllerEventDelivery?;
|
|
163
|
+
/** Every authenticated device connection's own ordered event queue, of the events a device receives. */
|
|
164
|
+
private deviceEventDelivery?;
|
|
165
|
+
/** The paired devices, their pairing codes and authenticated connections; open while the controller runs. */
|
|
166
|
+
private devices?;
|
|
163
167
|
private flexAutoAcceptDrainTask?;
|
|
164
168
|
/** Sweeps whose auto-accept failed, queued again when the retry timer fires. */
|
|
165
169
|
private readonly failedFlexAutoAcceptSweeps;
|
|
@@ -1042,12 +1046,43 @@ export declare class OpenCodeController {
|
|
|
1042
1046
|
private recordPeerLogout;
|
|
1043
1047
|
private performStop;
|
|
1044
1048
|
/**
|
|
1045
|
-
* Composes the
|
|
1049
|
+
* Composes the five auth scopes. A handler is guarded by the scope router it is
|
|
1046
1050
|
* registered on and by nothing else, so each `register*Handlers` method is handed
|
|
1047
1051
|
* exactly one scope here, and test/test.routerscopes.node.ts freezes the resulting
|
|
1048
|
-
* method-to-scope table.
|
|
1052
|
+
* method-to-scope table. A paired device reaches only `devicePairing` (before it is
|
|
1053
|
+
* authenticated) and `device`; it never reaches `protected`.
|
|
1049
1054
|
*/
|
|
1050
1055
|
private createRouter;
|
|
1056
|
+
private requireDevices;
|
|
1057
|
+
private requireSessionFeed;
|
|
1058
|
+
/**
|
|
1059
|
+
* Runs a device's request under the connection's operation budget and abort signal, which revoking the device
|
|
1060
|
+
* aborts. `deviceIdArg` names the authenticated device: its requests share one budget across its connections, count
|
|
1061
|
+
* against the authenticated rate limit and are audited as `device:<id>`.
|
|
1062
|
+
*/
|
|
1063
|
+
private runDeviceOperation;
|
|
1064
|
+
/** The authenticated device of a request in the `device` scope, which its middleware checked. */
|
|
1065
|
+
private requestDevice;
|
|
1066
|
+
/** The session a device names, as the session feed lists it now: a conversation or a native session, never a terminal. */
|
|
1067
|
+
private deviceSessionTarget;
|
|
1068
|
+
/**
|
|
1069
|
+
* Scope `devicePairing`: what a device asks before it is authenticated -- the protocol version, pairing with a QR
|
|
1070
|
+
* code, and the challenge and proof that authenticate a connection. Every request counts against the
|
|
1071
|
+
* unauthenticated preflight budget; a pairing and a proof are audited, under the unauthenticated audit budget.
|
|
1072
|
+
*/
|
|
1073
|
+
private registerDevicePairingHandlers;
|
|
1074
|
+
/**
|
|
1075
|
+
* Scope `device`: the session feed, bounded transcript reads, direct sends and permission and question answers of an
|
|
1076
|
+
* authenticated device -- through the same operations the owner's browser runs, audited as `device:<id>`.
|
|
1077
|
+
*/
|
|
1078
|
+
private registerDeviceHandlers;
|
|
1079
|
+
/**
|
|
1080
|
+
* The owner's side of the devices, in Settings → Devices: the list, the single-use pairing code of the QR, and
|
|
1081
|
+
* revoking a device, which closes its live connections with 4403 at once.
|
|
1082
|
+
*/
|
|
1083
|
+
private registerDevicesHandlers;
|
|
1084
|
+
/** Ends a revoked device's connection: its requests in flight are aborted, and it is closed with 4403. */
|
|
1085
|
+
private closeRevokedDevicePeer;
|
|
1051
1086
|
/** Public scope: a browser reads the status before it holds a passkey session. */
|
|
1052
1087
|
private registerStatusHandlers;
|
|
1053
1088
|
/**
|
|
@@ -1097,6 +1132,16 @@ export declare class OpenCodeController {
|
|
|
1097
1132
|
* are scoped through their parent session and live with the session handlers.
|
|
1098
1133
|
*/
|
|
1099
1134
|
private registerPromptReplyHandlers;
|
|
1135
|
+
/**
|
|
1136
|
+
* Answers a permission request of a conversation, for the owner's browser and a paired device alike: the request must
|
|
1137
|
+
* be pending in the session, and the harness that owns it takes the answer.
|
|
1138
|
+
*/
|
|
1139
|
+
private replyPermissionForPrincipal;
|
|
1140
|
+
/**
|
|
1141
|
+
* Answers a question of a conversation, for the owner's browser and a paired device alike; `null` rejects it. The
|
|
1142
|
+
* question must be pending in the session. Questions are never answered automatically.
|
|
1143
|
+
*/
|
|
1144
|
+
private replyQuestionForPrincipal;
|
|
1100
1145
|
private registerResourceHandlers;
|
|
1101
1146
|
private registerBrowserHandlers;
|
|
1102
1147
|
private registerTicketHandlers;
|
|
@@ -1154,6 +1199,16 @@ export declare class OpenCodeController {
|
|
|
1154
1199
|
* with that reason.
|
|
1155
1200
|
*/
|
|
1156
1201
|
private registerNativeSessionHandlers;
|
|
1202
|
+
/**
|
|
1203
|
+
* A native session, a bounded page of its transcript and what AGL's own turns in it wait for, for the owner's browser
|
|
1204
|
+
* and a paired device alike. The session resolves only through what the session feed's sources list.
|
|
1205
|
+
*/
|
|
1206
|
+
private readNativeSessionForPrincipal;
|
|
1207
|
+
/**
|
|
1208
|
+
* Answers a permission (`permission`) or a question (`answers`, `null` rejects it) of AGL's own turn in a native
|
|
1209
|
+
* session, for the owner's browser and a paired device alike. The request must still be pending.
|
|
1210
|
+
*/
|
|
1211
|
+
private replyNativeSessionForPrincipal;
|
|
1157
1212
|
/** The requests of AGL's own turns in a native session that wait for an answer. */
|
|
1158
1213
|
private nativeSessionAttention;
|
|
1159
1214
|
private replyNativeSessionRequest;
|
|
@@ -1524,6 +1579,12 @@ export declare class OpenCodeController {
|
|
|
1524
1579
|
private childScopeBindingKey;
|
|
1525
1580
|
private childScopeParentKey;
|
|
1526
1581
|
private childScopeCredentialId;
|
|
1582
|
+
/**
|
|
1583
|
+
* A connection is either the owner's browser or a device, never both: every browser sign-in step (setup, passkey,
|
|
1584
|
+
* temporary password, resume) refuses a connection a device authenticated, before it reads or consumes anything, as
|
|
1585
|
+
* `device.auth.prove` refuses a connection signed in as the browser.
|
|
1586
|
+
*/
|
|
1587
|
+
private refuseDevicePeerSignIn;
|
|
1527
1588
|
private setAuthenticatedPeerCredential;
|
|
1528
1589
|
/** Takes the authentication of a live connection away; its socket stays open. */
|
|
1529
1590
|
private signOutPeer;
|
|
@@ -2261,6 +2322,12 @@ export declare class OpenCodeController {
|
|
|
2261
2322
|
* holds the event, never on an acknowledgement.
|
|
2262
2323
|
*/
|
|
2263
2324
|
private pushControllerEvent;
|
|
2325
|
+
/**
|
|
2326
|
+
* Every authenticated device connection's own ordered event queue, created with the first event a device receives:
|
|
2327
|
+
* the queues and their collapse rules are the browsers', the limits smaller, and each event is projected to the
|
|
2328
|
+
* device's shape (`deviceEvent`) as it is sent, so a session the feed does not list reaches no device.
|
|
2329
|
+
*/
|
|
2330
|
+
private deviceEventDeliveryQueues;
|
|
2264
2331
|
private runUpgradePreparationAdmission;
|
|
2265
2332
|
private upgradePreparationReplayIsAccepted;
|
|
2266
2333
|
private createUpgradePreparationContext;
|
|
@@ -2296,6 +2363,8 @@ export declare class OpenCodeController {
|
|
|
2296
2363
|
private isFlexPromptAdmissionTerminated;
|
|
2297
2364
|
private assertStartActive;
|
|
2298
2365
|
private runOperation;
|
|
2366
|
+
/** The signal every operation of a connection runs under: its close, and a revoked device's revocation, abort it. */
|
|
2367
|
+
private peerOperationSignal;
|
|
2299
2368
|
private runPrincipalOperation;
|
|
2300
2369
|
private assertControllerOperationPrincipal;
|
|
2301
2370
|
private auditPeerId;
|