agl 43.1.0 → 43.3.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 +32 -0
- package/dist_serve/bundle.js +5950 -5530
- package/dist_serve/bundle.js.map +2 -2
- package/dist_serve/bundle.js.third-party-notices.json +31 -31
- package/dist_serve/bundle.js.third-party-notices.txt +31 -31
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/aglapi/aglapisurface.document.js +521 -17
- package/dist_ts/aglapi/interfaces.d.ts +3 -0
- package/dist_ts/aglapi/interfaces.js +2 -1
- package/dist_ts/classes.accountsactions.d.ts +3 -1
- package/dist_ts/classes.accountsactions.js +21 -3
- package/dist_ts/classes.authmodels.js +17 -4
- package/dist_ts/classes.authstore.js +16 -2
- package/dist_ts/classes.claudeharness.d.ts +16 -0
- package/dist_ts/classes.claudeharness.js +24 -2
- package/dist_ts/classes.cli.d.ts +4 -2
- package/dist_ts/classes.cli.js +6 -3
- package/dist_ts/classes.codexclientadapter.d.ts +11 -0
- package/dist_ts/classes.codexclientadapter.js +14 -2
- package/dist_ts/classes.controller.d.ts +175 -11
- package/dist_ts/classes.controller.js +1213 -173
- package/dist_ts/classes.controllerdevices.d.ts +2 -0
- package/dist_ts/classes.controllerdevices.js +6 -1
- package/dist_ts/classes.controllermanagement.d.ts +14 -4
- package/dist_ts/classes.controllermanagement.js +20 -2
- package/dist_ts/classes.gatewayclient.d.ts +115 -0
- package/dist_ts/classes.gatewayclient.js +336 -0
- package/dist_ts/classes.gatewayclientstore.d.ts +97 -0
- package/dist_ts/classes.gatewayclientstore.js +261 -0
- package/dist_ts/classes.inbox.d.ts +72 -0
- package/dist_ts/classes.inbox.js +231 -0
- package/dist_ts/classes.inferencerouter.d.ts +19 -0
- package/dist_ts/classes.inferencerouter.js +15 -3
- package/dist_ts/classes.inferenceservice.d.ts +9 -0
- package/dist_ts/classes.inferenceservice.js +28 -2
- package/dist_ts/classes.mcpclient.d.ts +4 -1
- package/dist_ts/classes.mcpclient.js +42 -6
- package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -1
- package/dist_ts/classes.mcpcontrollerhost.js +11 -1
- package/dist_ts/classes.mcptools.d.ts +3 -3
- package/dist_ts/classes.mcptools.js +38 -8
- package/dist_ts/classes.mcpvalidation.d.ts +5 -0
- package/dist_ts/classes.mcpvalidation.js +38 -2
- package/dist_ts/classes.nativesessions.d.ts +17 -4
- package/dist_ts/classes.nativesessions.js +41 -9
- package/dist_ts/classes.opencodeclient.d.ts +23 -2
- package/dist_ts/classes.opencodeclient.js +47 -3
- package/dist_ts/classes.proxycontrol.d.ts +11 -0
- package/dist_ts/classes.proxycontrol.js +7 -1
- package/dist_ts/classes.proxycontrolclient.d.ts +17 -0
- package/dist_ts/classes.proxycontrolclient.js +35 -1
- package/dist_ts/classes.proxydaemon.js +8 -1
- package/dist_ts/classes.proxymonitor.d.ts +7 -0
- package/dist_ts/classes.proxymonitor.js +13 -1
- package/dist_ts/classes.publishedset.d.ts +38 -0
- package/dist_ts/classes.publishedset.js +50 -0
- package/dist_ts/classes.sessionfeed.d.ts +3 -3
- package/dist_ts/classes.sessionfeed.js +18 -26
- package/dist_ts/classes.systemmetricssampler.d.ts +6 -0
- package/dist_ts/classes.systemmetricssampler.js +15 -3
- package/dist_ts/classes.ticketstore.d.ts +50 -3
- package/dist_ts/classes.ticketstore.js +45 -8
- package/dist_ts/classes.trustedproxysecrets.d.ts +2 -0
- package/dist_ts/classes.trustedproxysecrets.js +5 -1
- package/dist_ts/driver/classes.directreports.d.ts +14 -4
- package/dist_ts/driver/classes.directreports.js +25 -6
- package/dist_ts/driver/classes.driverservice.d.ts +44 -3
- package/dist_ts/driver/classes.driverservice.js +50 -16
- package/dist_ts/fleet/classes.claudeworkers.d.ts +21 -5
- package/dist_ts/fleet/classes.claudeworkers.js +142 -46
- package/dist_ts/fleet/classes.codexworkers.d.ts +16 -4
- package/dist_ts/fleet/classes.codexworkers.js +22 -5
- package/dist_ts/fleet/classes.workercommand.d.ts +6 -1
- package/dist_ts/fleet/classes.workercommand.js +15 -4
- package/dist_ts/fleet/classes.workers.d.ts +5 -1
- package/dist_ts/fleet/classes.workers.js +8 -2
- package/dist_ts/fleet/functions.unbounddrivers.js +2 -2
- package/dist_ts/fleet/functions.workervalidation.js +2 -2
- package/dist_ts/fleet/interfaces.workers.d.ts +21 -3
- package/dist_ts/fleet/interfaces.workers.js +1 -1
- package/dist_ts/functions.agentmessage.d.ts +3 -0
- package/dist_ts/functions.agentmessage.js +4 -1
- package/dist_ts/functions.controllermanagementsurface.d.ts +4 -0
- package/dist_ts/functions.controllermanagementsurface.js +15 -1
- package/dist_ts/functions.deviceapi.d.ts +151 -4
- package/dist_ts/functions.deviceapi.js +893 -38
- package/dist_ts/functions.fleetworkercli.d.ts +1 -1
- package/dist_ts/functions.fleetworkercli.js +11 -8
- package/dist_ts/functions.gatewaycli.d.ts +24 -0
- package/dist_ts/functions.gatewaycli.js +395 -0
- package/dist_ts/functions.gatewayroute.d.ts +135 -0
- package/dist_ts/functions.gatewayroute.js +366 -0
- package/dist_ts/functions.inferencecli.js +32 -1
- package/dist_ts/functions.inferencecliarguments.d.ts +8 -2
- package/dist_ts/functions.inferencecliarguments.js +31 -3
- package/dist_ts/functions.mcpfleetworkertools.js +2 -2
- package/dist_ts/functions.proxycapacity.d.ts +50 -0
- package/dist_ts/functions.proxycapacity.js +142 -0
- package/dist_ts/functions.proxycapacitycli.d.ts +30 -0
- package/dist_ts/functions.proxycapacitycli.js +65 -0
- package/dist_ts/functions.remotecli.d.ts +30 -3
- package/dist_ts/functions.remotecli.js +44 -18
- package/dist_ts/functions.ticketvalidation.js +11 -2
- package/dist_ts/interfaces.auth.d.ts +25 -4
- package/dist_ts/interfaces.auth.js +15 -1
- package/dist_ts/plugins.d.ts +5 -1
- package/dist_ts/plugins.js +10 -2
- package/dist_ts_authswitch/authority-contract.d.ts +25 -0
- package/dist_ts_authswitch/authority-contract.js +1 -1
- package/dist_ts_authswitch/authority-overview.d.ts +8 -0
- package/dist_ts_authswitch/authority-overview.js +17 -6
- package/dist_ts_authswitch/authority-placement.d.ts +20 -16
- package/dist_ts_authswitch/authority-placement.js +19 -26
- package/dist_ts_authswitch/authority-renewal.d.ts +34 -0
- package/dist_ts_authswitch/authority-renewal.js +56 -0
- package/dist_ts_authswitch/authority-usagelimit.d.ts +29 -0
- package/dist_ts_authswitch/authority-usagelimit.js +66 -2
- package/dist_ts_authswitch/authority-usagewindows.d.ts +6 -0
- package/dist_ts_authswitch/authority-usagewindows.js +15 -1
- package/dist_ts_authswitch/classes.authoritybroker.d.ts +8 -0
- package/dist_ts_authswitch/classes.authoritybroker.js +35 -2
- package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
- package/dist_ts_authswitch/classes.authoritycli.js +44 -3
- package/dist_ts_authswitch/classes.authorityclient.d.ts +6 -1
- package/dist_ts_authswitch/classes.authorityclient.js +12 -4
- package/dist_ts_authswitch/classes.authoritydaemon.js +8 -1
- package/dist_ts_authswitch/classes.authoritydatabase.js +6 -2
- package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
- package/dist_ts_authswitch/classes.authoritymodels.js +21 -5
- package/dist_ts_interfaces/devices.d.ts +1012 -5
- package/dist_ts_interfaces/devices.js +68 -2
- package/dist_ts_interfaces/fleetworkers.d.ts +5 -3
- package/dist_ts_interfaces/gateway.d.ts +151 -0
- package/dist_ts_interfaces/gateway.js +66 -0
- package/dist_ts_interfaces/inbox.d.ts +234 -0
- package/dist_ts_interfaces/inbox.js +101 -0
- package/dist_ts_interfaces/index.d.ts +3 -0
- package/dist_ts_interfaces/index.js +4 -1
- package/dist_ts_interfaces/interfaces.d.ts +10 -3
- package/dist_ts_interfaces/interfaces.js +4 -2
- package/dist_ts_interfaces/management.d.ts +4 -4
- package/dist_ts_interfaces/management.js +3 -2
- package/dist_ts_interfaces/mcprequests.d.ts +48 -6
- package/dist_ts_interfaces/mcprequests.js +12 -1
- package/dist_ts_interfaces/mcpworkspacerequests.d.ts +4 -1
- package/dist_ts_interfaces/mcpworkspacerequests.js +1 -1
- package/dist_ts_interfaces/nativesessions.d.ts +16 -3
- package/dist_ts_interfaces/plugins.d.ts +2 -1
- package/dist_ts_interfaces/plugins.js +4 -2
- package/dist_ts_interfaces/proxycapacity.d.ts +99 -0
- package/dist_ts_interfaces/proxycapacity.js +74 -0
- package/dist_ts_interfaces/requests.accounts.d.ts +21 -0
- package/dist_ts_interfaces/requests.accounts.js +3 -1
- package/dist_ts_interfaces/requests.d.ts +3 -2
- package/dist_ts_interfaces/requests.js +1 -1
- package/docs/authswitch.md +20 -1
- package/package.json +6 -5
- package/readme.md +191 -31
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/aglapi/aglapisurface.document.ts +520 -16
- package/ts/aglapi/interfaces.ts +1 -0
- package/ts/classes.accountsactions.ts +30 -3
- package/ts/classes.authmodels.ts +22 -3
- package/ts/classes.authstore.ts +15 -1
- package/ts/classes.claudeharness.ts +27 -1
- package/ts/classes.cli.ts +7 -3
- package/ts/classes.codexclientadapter.ts +14 -1
- package/ts/classes.controller.ts +1428 -249
- package/ts/classes.controllerdevices.ts +6 -0
- package/ts/classes.controllermanagement.ts +40 -7
- package/ts/classes.gatewayclient.ts +401 -0
- package/ts/classes.gatewayclientstore.ts +272 -0
- package/ts/classes.inbox.ts +239 -0
- package/ts/classes.inferencerouter.ts +27 -2
- package/ts/classes.inferenceservice.ts +28 -1
- package/ts/classes.mcpclient.ts +42 -3
- package/ts/classes.mcpcontrollerhost.ts +15 -0
- package/ts/classes.mcptools.ts +42 -9
- package/ts/classes.mcpvalidation.ts +32 -1
- package/ts/classes.nativesessions.ts +50 -12
- package/ts/classes.opencodeclient.ts +55 -4
- package/ts/classes.proxycontrol.ts +16 -0
- package/ts/classes.proxycontrolclient.ts +30 -0
- package/ts/classes.proxydaemon.ts +8 -0
- package/ts/classes.proxymonitor.ts +12 -0
- package/ts/classes.publishedset.ts +56 -0
- package/ts/classes.sessionfeed.ts +17 -20
- package/ts/classes.systemmetricssampler.ts +13 -2
- package/ts/classes.ticketstore.ts +73 -12
- package/ts/classes.trustedproxysecrets.ts +5 -0
- package/ts/driver/classes.directreports.ts +25 -6
- package/ts/driver/classes.driverservice.ts +75 -14
- package/ts/fleet/classes.claudeworkers.ts +112 -39
- package/ts/fleet/classes.codexworkers.ts +21 -6
- package/ts/fleet/classes.workercommand.ts +14 -4
- package/ts/fleet/classes.workers.ts +9 -2
- package/ts/fleet/functions.unbounddrivers.ts +1 -1
- package/ts/fleet/functions.workervalidation.ts +1 -1
- package/ts/fleet/interfaces.workers.ts +20 -5
- package/ts/functions.agentmessage.ts +3 -0
- package/ts/functions.controllermanagementsurface.ts +15 -0
- package/ts/functions.deviceapi.ts +1071 -34
- package/ts/functions.fleetworkercli.ts +10 -7
- package/ts/functions.gatewaycli.ts +436 -0
- package/ts/functions.gatewayroute.ts +429 -0
- package/ts/functions.inferencecli.ts +26 -0
- package/ts/functions.inferencecliarguments.ts +30 -4
- package/ts/functions.mcpfleetworkertools.ts +1 -1
- package/ts/functions.proxycapacity.ts +191 -0
- package/ts/functions.proxycapacitycli.ts +104 -0
- package/ts/functions.remotecli.ts +56 -20
- package/ts/functions.ticketvalidation.ts +11 -1
- package/ts/interfaces.auth.ts +36 -4
- package/ts/plugins.ts +12 -0
- package/ts_authswitch/authority-contract.ts +20 -0
- package/ts_authswitch/authority-overview.ts +28 -6
- package/ts_authswitch/authority-placement.ts +27 -32
- package/ts_authswitch/authority-renewal.ts +64 -0
- package/ts_authswitch/authority-usagelimit.ts +84 -1
- package/ts_authswitch/authority-usagewindows.ts +13 -0
- package/ts_authswitch/classes.authoritybroker.ts +34 -1
- package/ts_authswitch/classes.authoritycli.ts +49 -2
- package/ts_authswitch/classes.authorityclient.ts +14 -4
- package/ts_authswitch/classes.authoritydaemon.ts +9 -1
- package/ts_authswitch/classes.authoritydatabase.ts +5 -1
- package/ts_authswitch/classes.authoritymodels.ts +23 -3
- package/ts_authswitch/native-contracts.md +21 -0
- package/ts_authswitch/readme.md +1 -1
- package/ts_interfaces/devices.schema.json +3573 -603
- package/ts_interfaces/devices.ts +1093 -4
- package/ts_interfaces/fleetworkers.ts +5 -3
- package/ts_interfaces/gateway.ts +242 -0
- package/ts_interfaces/inbox.ts +287 -0
- package/ts_interfaces/index.ts +3 -0
- package/ts_interfaces/interfaces.ts +9 -2
- package/ts_interfaces/management.ts +6 -4
- package/ts_interfaces/mcprequests.ts +61 -4
- package/ts_interfaces/mcpworkspacerequests.ts +4 -2
- package/ts_interfaces/nativesessions.ts +17 -3
- package/ts_interfaces/plugins.ts +3 -1
- package/ts_interfaces/proxycapacity.ts +162 -0
- package/ts_interfaces/requests.accounts.ts +20 -0
- package/ts_interfaces/requests.ts +4 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/accounts.plugins.ts +4 -2
- package/ts_web/classes.accountsreadmodel.ts +33 -0
- package/ts_web/classes.browserpresentation.ts +19 -6
- package/ts_web/classes.inboxfeed.ts +329 -0
- package/ts_web/classes.nativesessionstate.ts +9 -23
- package/ts_web/elements.accounts.ts +121 -113
- package/ts_web/elements.configurationpane.ts +24 -37
- package/ts_web/elements.deployments.ts +66 -2
- package/ts_web/elements.devices.ts +4 -17
- package/ts_web/elements.flexlimitstrip.ts +21 -70
- package/ts_web/elements.harnesscontrollerapp.ts +198 -222
- package/ts_web/elements.inbox.ts +808 -0
- package/ts_web/functions.inbox.ts +95 -0
- package/ts_web/functions.sessioncards.ts +40 -0
- package/ts_web/plugins.ts +2 -0
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
preuseView,
|
|
32
32
|
maxUsageReason,
|
|
33
33
|
recheckNotice,
|
|
34
|
+
renewalFact,
|
|
35
|
+
renewalReason,
|
|
34
36
|
renameReason,
|
|
35
37
|
servicePanel,
|
|
36
38
|
spendLimitDraft,
|
|
@@ -91,6 +93,15 @@ export interface IAccountsOpenConfigurationDetail {
|
|
|
91
93
|
|
|
92
94
|
/** The screen's three views: the accounts, the tools on this host, and the accounts service. */
|
|
93
95
|
export type TAccountsTab = 'list' | 'host' | 'service';
|
|
96
|
+
const accountsTabs: readonly TAccountsTab[] = ['list', 'host', 'service'];
|
|
97
|
+
|
|
98
|
+
/** What new Claude terminals can run on, as the Host view offers it. */
|
|
99
|
+
const claudeTerminalsChoices = ['claude_code', 'chatgpt'] as const;
|
|
100
|
+
const claudeTerminalsOptions: plugins.deesCatalog.TRadiogroupOption[] = [
|
|
101
|
+
{ key: 'claude_code', option: 'Claude Code\'s own configuration',
|
|
102
|
+
description: 'Route it through the AGL proxy in Configuration → Inference to give it AGL\'s accounts.' },
|
|
103
|
+
{ key: 'chatgpt', option: 'ChatGPT models through the AGL proxy', description: 'Claude Code\'s terminal, answered by the ChatGPT accounts.' },
|
|
104
|
+
];
|
|
94
105
|
|
|
95
106
|
/**
|
|
96
107
|
* The confirmation or sign-in in view, if any. It names what it acts on, never a copy of it: the dialog reads its
|
|
@@ -127,6 +138,10 @@ const apiKeyProviderName = (providerIdArg: interfaces.TControllerApiKeyProvider)
|
|
|
127
138
|
providerIdArg === 'openai' ? 'OpenAI' : 'Anthropic'
|
|
128
139
|
);
|
|
129
140
|
|
|
141
|
+
/** What a renewal does, under its field. */
|
|
142
|
+
const renewalDescription = 'Any date and time the subscription renewed or renews; it renews monthly from there. Usage a'
|
|
143
|
+
+ ' window would still hold at the next renewal is used first. Whether Claude resets usage at a renewal is not known.';
|
|
144
|
+
|
|
130
145
|
/** What a usage threshold does, under its field. */
|
|
131
146
|
const maxUsageDescription = 'At this share of any usage window AGL places no new work on the account and moves its'
|
|
132
147
|
+ ' sessions on, so the rest stays yours outside AGL.';
|
|
@@ -259,6 +274,10 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
259
274
|
@plugins.deesElement.state()
|
|
260
275
|
private accessor maxUsageDraft: string | null = null;
|
|
261
276
|
|
|
277
|
+
/** A Claude sign-in's renewal as the open page's field holds it while edited; `null` while it shows the saved one. */
|
|
278
|
+
@plugins.deesElement.state()
|
|
279
|
+
private accessor renewalDraft: string | null = null;
|
|
280
|
+
|
|
262
281
|
/** A key's spend limit, in dollars, as the open page's field holds it while edited; `null` while it shows the saved one. */
|
|
263
282
|
@plugins.deesElement.state()
|
|
264
283
|
private accessor spendLimitDraft: string | null = null;
|
|
@@ -340,69 +359,13 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
340
359
|
gap: var(--dees-spacing-md);
|
|
341
360
|
}
|
|
342
361
|
|
|
343
|
-
.
|
|
344
|
-
display: inline-flex;
|
|
345
|
-
gap: 2px;
|
|
346
|
-
padding: 2px;
|
|
347
|
-
border-radius: var(--dees-radius-md);
|
|
348
|
-
background: var(--dees-color-fill-tertiary, var(--dees-color-hover));
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.tabs button {
|
|
352
|
-
display: inline-flex;
|
|
353
|
-
align-items: center;
|
|
354
|
-
gap: var(--dees-spacing-xs);
|
|
355
|
-
height: 26px;
|
|
356
|
-
padding: 0 var(--dees-spacing-md);
|
|
357
|
-
border: 0;
|
|
358
|
-
border-radius: var(--dees-radius-sm);
|
|
359
|
-
background: transparent;
|
|
360
|
-
color: var(--dees-color-text-primary);
|
|
361
|
-
font: inherit;
|
|
362
|
-
font-size: var(--dees-font-footnote-size);
|
|
363
|
-
font-weight: 500;
|
|
364
|
-
cursor: pointer;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.tabs button[aria-pressed='true'] {
|
|
368
|
-
background: var(--dees-color-bg-elevated, var(--dees-color-bg-primary));
|
|
369
|
-
box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.tabs button:focus-visible, .row:focus-visible, .back:focus-visible, .freshness:focus-visible {
|
|
362
|
+
.row:focus-visible {
|
|
373
363
|
outline: var(--dees-line-width-focus-ring, 2px) solid var(--dees-color-focus-ring);
|
|
374
364
|
outline-offset: 2px;
|
|
375
365
|
}
|
|
376
366
|
|
|
377
|
-
.count { color: var(--dees-color-text-muted); font-size: var(--dees-font-caption1-size); }
|
|
378
|
-
|
|
379
367
|
.tools, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--dees-spacing-xs); }
|
|
380
368
|
|
|
381
|
-
.freshness {
|
|
382
|
-
display: inline-flex;
|
|
383
|
-
align-items: center;
|
|
384
|
-
gap: var(--dees-spacing-xs);
|
|
385
|
-
height: 30px;
|
|
386
|
-
padding: 0 var(--dees-spacing-sm);
|
|
387
|
-
border: 0;
|
|
388
|
-
border-radius: var(--dees-radius-md);
|
|
389
|
-
background: transparent;
|
|
390
|
-
color: var(--dees-color-text-secondary);
|
|
391
|
-
font: inherit;
|
|
392
|
-
font-size: var(--dees-font-caption1-size);
|
|
393
|
-
cursor: pointer;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.serviceDot {
|
|
397
|
-
width: 7px;
|
|
398
|
-
height: 7px;
|
|
399
|
-
flex: none;
|
|
400
|
-
border-radius: 999px;
|
|
401
|
-
background: var(--dees-color-accent-success);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.serviceDot.stale { background: var(--dees-color-accent-warning); }
|
|
405
|
-
|
|
406
369
|
.reason {
|
|
407
370
|
margin: 0;
|
|
408
371
|
color: var(--dees-color-text-secondary);
|
|
@@ -561,19 +524,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
561
524
|
|
|
562
525
|
.page { display: grid; gap: var(--dees-spacing-lg); }
|
|
563
526
|
|
|
564
|
-
.back {
|
|
565
|
-
justify-self: start;
|
|
566
|
-
display: inline-flex;
|
|
567
|
-
align-items: center;
|
|
568
|
-
gap: 2px;
|
|
569
|
-
padding: 0;
|
|
570
|
-
border: 0;
|
|
571
|
-
background: none;
|
|
572
|
-
color: var(--dees-color-accent-primary, var(--dees-color-text-link));
|
|
573
|
-
font: inherit;
|
|
574
|
-
font-size: var(--dees-font-footnote-size);
|
|
575
|
-
cursor: pointer;
|
|
576
|
-
}
|
|
527
|
+
.back { justify-self: start; }
|
|
577
528
|
|
|
578
529
|
.pageHead {
|
|
579
530
|
display: grid;
|
|
@@ -635,16 +586,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
635
586
|
overflow-wrap: anywhere;
|
|
636
587
|
}
|
|
637
588
|
|
|
638
|
-
|
|
639
|
-
display: grid;
|
|
640
|
-
grid-template-columns: 18px minmax(0, 1fr);
|
|
641
|
-
gap: var(--dees-spacing-sm);
|
|
642
|
-
align-items: start;
|
|
643
|
-
padding: var(--dees-spacing-md) var(--dees-spacing-lg);
|
|
644
|
-
cursor: pointer;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
.radio input { margin: 2px 0 0; accent-color: var(--dees-color-accent-primary); }
|
|
589
|
+
dees-input-radiogroup { padding: var(--dees-spacing-md) var(--dees-spacing-lg); }
|
|
648
590
|
|
|
649
591
|
/* The one visual difference of a last-known screen: the service's accounts, and only those. */
|
|
650
592
|
.dimmed .row, .dimmed .page { opacity: .62; }
|
|
@@ -1056,6 +998,24 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1056
998
|
});
|
|
1057
999
|
}
|
|
1058
1000
|
|
|
1001
|
+
/**
|
|
1002
|
+
* Sets a Claude sign-in's renewal from the field, or clears it with `null`. The field is read here, in the page's own
|
|
1003
|
+
* time zone, and sent as its UTC instant, so the accounts service never reads a local time in its own zone.
|
|
1004
|
+
*/
|
|
1005
|
+
private async setRenewal(rowArg: IAccountRow, draftArg: string | null): Promise<void> {
|
|
1006
|
+
const renewsAt = draftArg === null ? null : new Date(Date.parse(draftArg.trim())).toISOString();
|
|
1007
|
+
await this.runAction(`renewal:${rowArg.accountId}`, async () => {
|
|
1008
|
+
const { answer } = await this.client!.fire<interfaces.IReq_ControllerAccountsRenewal>(
|
|
1009
|
+
'controller.accounts.renewal',
|
|
1010
|
+
{ accountId: rowArg.accountId, expectedRevision: rowArg.revision, renewsAt },
|
|
1011
|
+
{ maxRetries: 0 },
|
|
1012
|
+
);
|
|
1013
|
+
this.notice = answerNotice(answer);
|
|
1014
|
+
if (answer.state === 'done') this.renewalDraft = null;
|
|
1015
|
+
await this.refresh();
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1059
1019
|
/** Sets an API key's monthly spend limit from the field, in dollars, or clears it with `null`. */
|
|
1060
1020
|
private async setSpendLimit(rowArg: IAccountRow, spendLimitMicroUsdArg: number | null): Promise<void> {
|
|
1061
1021
|
await this.runAction(`spendlimit:${rowArg.accountId}`, async () => {
|
|
@@ -1441,6 +1401,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1441
1401
|
this.openKey = rowArg.key;
|
|
1442
1402
|
this.renaming = false;
|
|
1443
1403
|
this.maxUsageDraft = null;
|
|
1404
|
+
this.renewalDraft = null;
|
|
1444
1405
|
this.spendLimitDraft = null;
|
|
1445
1406
|
}
|
|
1446
1407
|
|
|
@@ -1476,18 +1437,21 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1476
1437
|
`;
|
|
1477
1438
|
}
|
|
1478
1439
|
|
|
1440
|
+
/** The screen's three views as one segmented control; choosing the open view again closes an account's page. */
|
|
1479
1441
|
private renderTabs(viewArg: IAccountsView): plugins.deesElement.TemplateResult {
|
|
1480
1442
|
const count = viewArg.list.groups.reduce((sumArg, groupArg) => sumArg + groupArg.rows.length, 0);
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
`;
|
|
1443
|
+
const options: plugins.deesCatalog.TMultitoggleOption[] = [
|
|
1444
|
+
{ key: 'list', label: 'Accounts', badge: count },
|
|
1445
|
+
{ key: 'host', label: 'This host' },
|
|
1446
|
+
{ key: 'service', label: 'Service' },
|
|
1447
|
+
];
|
|
1487
1448
|
return plugins.deesElement.html`
|
|
1488
|
-
<
|
|
1489
|
-
|
|
1490
|
-
|
|
1449
|
+
<dees-input-multitoggle data-tabs size="sm" label="Accounts views" .labelPosition=${'none'} .options=${options}
|
|
1450
|
+
.selectedOption=${this.tab}
|
|
1451
|
+
@option-activate=${(eventArg: CustomEvent<{ selectedOption: string }>) => {
|
|
1452
|
+
this.tab = accountsTabs.find((tabArg) => tabArg === eventArg.detail.selectedOption) ?? this.tab;
|
|
1453
|
+
this.openKey = '';
|
|
1454
|
+
}}></dees-input-multitoggle>
|
|
1491
1455
|
`;
|
|
1492
1456
|
}
|
|
1493
1457
|
|
|
@@ -1631,6 +1595,56 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1631
1595
|
`;
|
|
1632
1596
|
}
|
|
1633
1597
|
|
|
1598
|
+
/**
|
|
1599
|
+
* A Claude sign-in's monthly renewal: any date and time the subscription renewed or renews, saved with its own Save,
|
|
1600
|
+
* or cleared. AGL then spends first the usage a window would still hold at the next renewal.
|
|
1601
|
+
*/
|
|
1602
|
+
private renderRenewal(rowArg: IAccountRow, slotArg: IAccountActionSlot): plugins.deesElement.TemplateResult {
|
|
1603
|
+
const saved = rowArg.renewsAt;
|
|
1604
|
+
if (saved === null && this.renewalDraft === null) {
|
|
1605
|
+
return plugins.deesElement.html`
|
|
1606
|
+
<div class="item" data-renewal>
|
|
1607
|
+
<div>
|
|
1608
|
+
<div class="itemLabel">Renewal</div>
|
|
1609
|
+
<div class="itemText">Not set. Set the date and time the subscription renews each month, and AGL uses first
|
|
1610
|
+
the usage that would still be left at the renewal.</div>
|
|
1611
|
+
</div>
|
|
1612
|
+
${this.slots([slotArg], () => { this.renewalDraft = ''; }, () => 'Set the renewal…')}
|
|
1613
|
+
</div>
|
|
1614
|
+
`;
|
|
1615
|
+
}
|
|
1616
|
+
const draft = this.renewalDraft ?? saved!;
|
|
1617
|
+
const reason = slotArg.reason || renewalReason(draft, saved);
|
|
1618
|
+
return plugins.deesElement.html`
|
|
1619
|
+
<div class="item stacked" data-renewal>
|
|
1620
|
+
<div>
|
|
1621
|
+
<div class="itemLabel">Renewal</div>
|
|
1622
|
+
<div class="itemText">${renewalDescription}${saved === null ? ''
|
|
1623
|
+
: ` Next: ${renewalFact(saved, Date.now())}.`}</div>
|
|
1624
|
+
</div>
|
|
1625
|
+
<div class="inline">
|
|
1626
|
+
<dees-input-text .label=${'Renewal (date and time)'} .labelPosition=${'none'} .value=${draft}
|
|
1627
|
+
@input=${(eventArg: Event) => {
|
|
1628
|
+
const target = eventArg.currentTarget as HTMLElement & { value?: string };
|
|
1629
|
+
this.renewalDraft = target.value ?? '';
|
|
1630
|
+
}}></dees-input-text>
|
|
1631
|
+
<div>${this.slots(
|
|
1632
|
+
[
|
|
1633
|
+
{ id: 'renewal', label: 'Save', icon: 'lucide:Check', reason },
|
|
1634
|
+
...(saved === null ? []
|
|
1635
|
+
: [{ id: 'clearRenewal' as const, label: 'No renewal', icon: 'lucide:X', reason: slotArg.reason }]),
|
|
1636
|
+
],
|
|
1637
|
+
(runArg) => void this.setRenewal(rowArg, runArg.id === 'clearRenewal' ? null : draft),
|
|
1638
|
+
)}</div>
|
|
1639
|
+
${saved === null
|
|
1640
|
+
? plugins.deesElement.html`<dees-button size="sm" type="ghost" text="Keep it unset" data-action="keepRenewal"
|
|
1641
|
+
@clicked=${() => { this.renewalDraft = null; }}></dees-button>`
|
|
1642
|
+
: ''}
|
|
1643
|
+
</div>
|
|
1644
|
+
</div>
|
|
1645
|
+
`;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1634
1648
|
/**
|
|
1635
1649
|
* An API key's monthly spend limit in dollars, saved with its own Save, or removed so the key serves without one. A
|
|
1636
1650
|
* limit below what the month spent holds the key at its next request.
|
|
@@ -1688,6 +1702,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1688
1702
|
?? rowArg.actions.find((slotArg) => slotArg.id === idArg) ?? null;
|
|
1689
1703
|
const renameSlot = slot('rename');
|
|
1690
1704
|
const maxUsageSlot = slot('maxUsage');
|
|
1705
|
+
const renewalSlot = slot('renewal');
|
|
1691
1706
|
const spendLimitSlot = slot('spendLimit');
|
|
1692
1707
|
const claudeCodeSlot = slot('claudeCode');
|
|
1693
1708
|
const liftSlot = slot('liftReserve');
|
|
@@ -1730,9 +1745,8 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1730
1745
|
const signInHead = rowArg.apiKey ? 'Key' : 'Sign-in';
|
|
1731
1746
|
return plugins.deesElement.html`
|
|
1732
1747
|
<section class="page" data-account-page=${rowArg.key} aria-label=${`Account ${rowArg.label}`}>
|
|
1733
|
-
<button class="back" type="
|
|
1734
|
-
|
|
1735
|
-
</button>
|
|
1748
|
+
<dees-button class="back" type="link" size="sm" icon="lucide:ChevronLeft" data-action="back"
|
|
1749
|
+
@clicked=${() => { this.openKey = ''; }}>Accounts</dees-button>
|
|
1736
1750
|
<header class="pageHead">
|
|
1737
1751
|
${renderMark(rowArg)}
|
|
1738
1752
|
<div>
|
|
@@ -1798,6 +1812,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1798
1812
|
<div class="sectionHead"><span>Limits</span></div>
|
|
1799
1813
|
<div class="card">
|
|
1800
1814
|
${this.renderMaxUsage(rowArg, this.effectiveSlot(maxUsageSlot))}
|
|
1815
|
+
${renewalSlot ? this.renderRenewal(rowArg, this.effectiveSlot(renewalSlot)) : ''}
|
|
1801
1816
|
${liftSlot
|
|
1802
1817
|
? plugins.deesElement.html`<div class="item" data-lift>
|
|
1803
1818
|
<div>
|
|
@@ -1938,23 +1953,17 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
1938
1953
|
? plugins.deesElement.html`<div class="card"><div class="item stacked" data-claude-terminals>
|
|
1939
1954
|
<div class="statusText">${read.state === 'pending' ? 'Reading what new Claude terminals run on.' : read.reason}</div>
|
|
1940
1955
|
</div></div>`
|
|
1941
|
-
: plugins.deesElement.html`<div class="card"
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
// The choice shows what the controller holds: it changes once the controller saved it.
|
|
1953
|
-
eventArg.preventDefault();
|
|
1954
|
-
if (valueArg !== read.terminals) void this.useClaudeTerminals(valueArg);
|
|
1955
|
-
}}>
|
|
1956
|
-
<span><span class="itemLabel">${labelArg}</span><div class="itemText">${textArg}</div></span>
|
|
1957
|
-
</label>`)}
|
|
1956
|
+
: plugins.deesElement.html`<div class="card" data-claude-terminals=${read.terminals}>
|
|
1957
|
+
<dees-input-radiogroup aria-label="New Claude terminals run on" .options=${claudeTerminalsOptions}
|
|
1958
|
+
.selectedOption=${read.terminals} .disabled=${this.busyAction !== ''}
|
|
1959
|
+
@change=${(eventArg: Event) => {
|
|
1960
|
+
// The choice shows what the controller holds: the pick goes back at once, and the choice changes once
|
|
1961
|
+
// the controller saved it.
|
|
1962
|
+
const group = eventArg.currentTarget as plugins.deesCatalog.DeesInputRadiogroup;
|
|
1963
|
+
const picked = claudeTerminalsChoices.find((choiceArg) => choiceArg === group.selectedOption);
|
|
1964
|
+
group.selectedOption = read.terminals;
|
|
1965
|
+
if (picked && picked !== read.terminals) void this.useClaudeTerminals(picked);
|
|
1966
|
+
}}></dees-input-radiogroup>
|
|
1958
1967
|
<div class="item stacked"><div class="statusText">${claudeTerminalsText(read.terminals)} Terminals already
|
|
1959
1968
|
open keep what they run on.</div></div>
|
|
1960
1969
|
</div>`}
|
|
@@ -2265,10 +2274,9 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
|
|
|
2265
2274
|
<div class="bar">
|
|
2266
2275
|
${this.renderTabs(view)}
|
|
2267
2276
|
<div class="tools">
|
|
2268
|
-
<button
|
|
2269
|
-
|
|
2270
|
-
Accounts service · ${view.service.freshness}
|
|
2271
|
-
</button>
|
|
2277
|
+
<dees-button type="ghost" size="sm" data-freshness .badge=${''} .badgeDot=${true}
|
|
2278
|
+
.badgeVariant=${view.service.state === 'current' ? 'success' : 'warning'}
|
|
2279
|
+
@clicked=${() => { this.tab = 'service'; this.openKey = ''; }}>Accounts service · ${view.service.freshness}</dees-button>
|
|
2272
2280
|
<dees-button size="sm" type="ghost" icon="lucide:RefreshCw" data-action="refresh" title="Read the accounts again"
|
|
2273
2281
|
aria-label="Read the accounts again" .disabled=${this.reading}
|
|
2274
2282
|
@clicked=${() => void this.refresh(true)}></dees-button>
|
|
@@ -432,8 +432,6 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
432
432
|
[data-tone='ok'] { color: var(--dees-color-text-success); }
|
|
433
433
|
[data-tone='warn'] { color: var(--dees-color-text-warning); }
|
|
434
434
|
[data-tone='bad'] { color: var(--dees-color-text-error); }
|
|
435
|
-
button.link { border: 0; padding: 0; background: transparent; color: var(--dees-color-link); cursor: pointer; font-size: inherit; }
|
|
436
|
-
button.link:hover { color: var(--dees-color-link-hover); }
|
|
437
435
|
.confirm {
|
|
438
436
|
display: flex; flex-wrap: wrap; align-items: center; gap: var(--dees-spacing-sm) var(--dees-spacing-md);
|
|
439
437
|
padding: var(--dees-spacing-sm-plus) var(--dees-spacing-lg); background: var(--dees-color-badge-warning-bg);
|
|
@@ -577,18 +575,15 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
577
575
|
.list .li .tag { margin-left: auto; white-space: nowrap; font-size: var(--dees-font-caption2-size); color: var(--dees-color-text-muted); }
|
|
578
576
|
.list .empty { padding: var(--dees-spacing-md); color: var(--dees-color-text-muted); font-size: var(--dees-font-secondary-size); }
|
|
579
577
|
.lab { display: block; margin-bottom: var(--dees-spacing-xs-plus); font-size: var(--dees-font-caption1-size); color: var(--dees-color-text-muted); }
|
|
578
|
+
/* The file tabs sit on the pane's own surface, one hairline under the tabs and the file actions. */
|
|
580
579
|
.filetabs {
|
|
581
580
|
display: flex; flex-wrap: wrap; align-items: center; gap: var(--dees-spacing-2xs);
|
|
582
581
|
border-bottom: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
583
582
|
}
|
|
584
|
-
.filetabs
|
|
585
|
-
min-
|
|
586
|
-
|
|
587
|
-
font-family: var(--dees-font-family-mono); font-size: var(--dees-font-caption1-size); color: var(--dees-color-text-secondary);
|
|
583
|
+
.filetabs dees-appui-tabs {
|
|
584
|
+
flex: 1 1 240px; min-width: 0; margin-bottom: calc(-1 * var(--dees-line-width-hairline));
|
|
585
|
+
--dees-appui-row-height: 40px; --dees-appui-chrome-bg: var(--dees-color-bg-primary);
|
|
588
586
|
}
|
|
589
|
-
.filetabs .tab[aria-selected='true'] { color: var(--dees-color-text-primary); border-bottom-color: var(--dees-color-accent-primary); }
|
|
590
|
-
.filetabs .tabs { display: flex; flex-wrap: wrap; gap: var(--dees-spacing-2xs); }
|
|
591
|
-
.filetabs .spacer { flex: 1 1 auto; }
|
|
592
587
|
.filepanel { display: flex; flex-direction: column; gap: var(--dees-spacing-md); }
|
|
593
588
|
|
|
594
589
|
.note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--dees-spacing-sm-plus); padding: var(--dees-spacing-sm-plus) var(--dees-spacing-md); font-size: var(--dees-font-secondary-size); line-height: 1.45; }
|
|
@@ -632,10 +627,11 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
632
627
|
}
|
|
633
628
|
.applybar > div { flex: 1 1 var(--dees-content-width-sm); }
|
|
634
629
|
.arow {
|
|
635
|
-
display: grid; grid-template-columns:
|
|
636
|
-
padding: var(--dees-spacing-sm-plus) var(--dees-spacing-md);
|
|
630
|
+
display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--dees-spacing-sm-plus);
|
|
631
|
+
padding: var(--dees-spacing-sm-plus) var(--dees-spacing-md);
|
|
637
632
|
}
|
|
638
|
-
|
|
633
|
+
/* The files line under the checkbox's label, in line with it: the box is 18px wide, the gap the checkbox's own. */
|
|
634
|
+
.arow .sd { padding-left: calc(18px + var(--dees-spacing-sm)); }
|
|
639
635
|
.afoot {
|
|
640
636
|
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--dees-spacing-sm) var(--dees-spacing-md);
|
|
641
637
|
padding: var(--dees-spacing-sm-plus) var(--dees-spacing-md); font-size: var(--dees-font-caption1-size); color: var(--dees-color-text-muted);
|
|
@@ -678,6 +674,9 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
678
674
|
if (changedArg.has('confirming') && this.confirming) {
|
|
679
675
|
void this.shadowRoot?.querySelector<HTMLElement & { focus(): void }>('.confirm [data-keep]')?.focus();
|
|
680
676
|
}
|
|
677
|
+
// The skill file tabs name the panel they control by element: an id reference cannot reach into their shadow root.
|
|
678
|
+
const fileTabs = this.shadowRoot?.querySelector<plugins.deesCatalog.DeesAppuiTabs>('dees-appui-tabs.skillfiles');
|
|
679
|
+
if (fileTabs) fileTabs.controlsElement = this.shadowRoot?.querySelector<HTMLElement>('.filepanel') ?? undefined;
|
|
681
680
|
}
|
|
682
681
|
|
|
683
682
|
/** Whether the master editor holds changes that are not saved yet. */
|
|
@@ -1140,8 +1139,8 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
1140
1139
|
const status = this.harnessesStatus();
|
|
1141
1140
|
return html`<span class="status" data-tone=${status.tone}>
|
|
1142
1141
|
${status.tone === 'ok' ? html`<dees-icon icon="lucide:Check" iconSize="14"></dees-icon>` : ''}${status.text}
|
|
1143
|
-
${status.toHistory && this.selection.kind !== 'history' ? html` · <button
|
|
1144
|
-
@
|
|
1142
|
+
${status.toHistory && this.selection.kind !== 'history' ? html` · <dees-button type="link" size="sm" data-action="openHistory"
|
|
1143
|
+
@clicked=${() => { this.selection = { kind: 'history' }; }}>Apply and history</dees-button>` : ''}
|
|
1145
1144
|
</span>`;
|
|
1146
1145
|
}
|
|
1147
1146
|
|
|
@@ -1545,32 +1544,20 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
1545
1544
|
this.skillFile = fileIndexArg;
|
|
1546
1545
|
this.renamingFile = false;
|
|
1547
1546
|
};
|
|
1548
|
-
//
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
: eventArg.key === 'Home' ? 0 : eventArg.key === 'End' ? count - 1 : undefined;
|
|
1553
|
-
if (next === undefined) return;
|
|
1554
|
-
eventArg.preventDefault();
|
|
1555
|
-
choose(next);
|
|
1556
|
-
await this.updateComplete;
|
|
1557
|
-
this.shadowRoot?.querySelector<HTMLButtonElement>('.filetabs [role="tab"][aria-selected="true"]')?.focus();
|
|
1558
|
-
};
|
|
1547
|
+
// A tab's key is its file's index: renaming a file keeps its tab chosen.
|
|
1548
|
+
const tabs: plugins.deesCatalog.IMenuItem[] = skillArg.files.map((candidate, fileIndex) => ({
|
|
1549
|
+
key: String(fileIndex), label: candidate.path, action: () => choose(fileIndex),
|
|
1550
|
+
}));
|
|
1559
1551
|
return html`
|
|
1560
1552
|
<div class="filetabs">
|
|
1561
|
-
<
|
|
1562
|
-
${skillArg.files.map((candidate, fileIndex) => html`<button class="tab" role="tab" id=${`skill-file-${fileIndex}`}
|
|
1563
|
-
aria-selected=${String(fileIndex === index)} aria-controls="skill-file-panel" tabindex=${fileIndex === index ? '0' : '-1'}
|
|
1564
|
-
@click=${() => choose(fileIndex)}>${candidate.path}</button>`)}
|
|
1565
|
-
</div>
|
|
1553
|
+
<dees-appui-tabs class="skillfiles" .tabs=${tabs} .selectedTab=${tabs[index] ?? null} .labels=${{ tabsName: 'Skill files' }}></dees-appui-tabs>
|
|
1566
1554
|
<dees-button size="sm" type="ghost" data-action="addFile" @clicked=${addFile}>+ Add file</dees-button>
|
|
1567
|
-
<span class="spacer"></span>
|
|
1568
1555
|
${file ? html`
|
|
1569
1556
|
<dees-button size="sm" type="ghost" data-action="renameFile" @clicked=${() => { this.renamingFile = !this.renamingFile; }}>${this.renamingFile ? 'Done' : 'Rename file'}</dees-button>
|
|
1570
1557
|
<dees-button size="sm" type="ghost" data-action="removeFile" ?disabled=${skillArg.files.length < 2}
|
|
1571
1558
|
@clicked=${() => { this.setField(filesPath, skillArg.files.filter((_, i) => i !== index)); choose(Math.max(0, index - 1)); }}>Remove file</dees-button>` : ''}
|
|
1572
1559
|
</div>
|
|
1573
|
-
${file ? html`<div role="tabpanel"
|
|
1560
|
+
${file ? html`<div role="tabpanel" aria-label=${file.path} class="filepanel">
|
|
1574
1561
|
${this.renamingFile ? this.textField([...filesPath, index, 'path'], 'File path') : ''}
|
|
1575
1562
|
${plugins.deesElement.directives.keyed(JSON.stringify([this.editorEpoch, pathArg, index]), html`
|
|
1576
1563
|
<dees-input-code key=${`file:${index}`} label="" aria-label="File contents" language=${codeLanguage(file.path)} height="400px"
|
|
@@ -1867,18 +1854,18 @@ export class AglConfigurationPane extends plugins.deesElement.DeesElement {
|
|
|
1867
1854
|
: html`${pending.map((harness) => {
|
|
1868
1855
|
const relative = this.relativeTo(harness);
|
|
1869
1856
|
const replaced = this.replacedEdits(harness);
|
|
1870
|
-
return html`<
|
|
1871
|
-
<input type="checkbox" .checked=${this.applyTargets.includes(harness.targetId)}
|
|
1872
|
-
@change=${(eventArg: Event) => toggle(harness.targetId, (eventArg.target as HTMLInputElement).checked)}>
|
|
1857
|
+
return html`<div class="arow" data-harness=${harness.targetId}>
|
|
1873
1858
|
<span>
|
|
1874
|
-
<
|
|
1859
|
+
<dees-input-checkbox .label=${`${harnessLabels[harness.targetId]} · ${plural(harness.files.length, 'file')}`}
|
|
1860
|
+
.value=${this.applyTargets.includes(harness.targetId)}
|
|
1861
|
+
@newValue=${(eventArg: CustomEvent<boolean>) => toggle(harness.targetId, eventArg.detail)}></dees-input-checkbox>
|
|
1875
1862
|
${harness.state === 'drifted' || replaced.length
|
|
1876
1863
|
? html`<div class="sd warn">${replaced.length ? `Applying replaces the edits made outside AGL in ${joinNames(replaced)}.`
|
|
1877
1864
|
: 'Its files were edited outside AGL; applying replaces those edits.'}</div>`
|
|
1878
1865
|
: html`<div class="sd">${harness.files.map((file) => relative(file.path)).join(', ')}</div>`}
|
|
1879
1866
|
</span>
|
|
1880
1867
|
<dees-badge rounded dot type=${badgeTypes[stateTones[harness.state]]} text=${stateLabels[harness.state]}></dees-badge>
|
|
1881
|
-
</
|
|
1868
|
+
</div>`;
|
|
1882
1869
|
})}
|
|
1883
1870
|
<div class="afoot">
|
|
1884
1871
|
<span>A harness whose files changed since its review is refused and has to be reviewed again.</span>
|
|
@@ -978,10 +978,23 @@ export class AglDeployPlan extends plugins.deesElement.DeesElement {
|
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
|
|
981
|
+
/** When a go's deploy may run, for the Inbox's go: the target's condition and the window the deploy would run in. */
|
|
982
|
+
const inboxDeployWhenText = (planArg: interfaces.IControllerInboxDeployGo): string | undefined => {
|
|
983
|
+
switch (planArg.deployWhen) {
|
|
984
|
+
case undefined: return undefined;
|
|
985
|
+
case 'anytime': return 'At any time.';
|
|
986
|
+
case 'idle': return 'When no session is busy.';
|
|
987
|
+
case 'window': return planArg.window
|
|
988
|
+
? `Inside the maintenance window ${deployWindowRange(planArg.window)}.`
|
|
989
|
+
: 'Only inside a maintenance window; none is planned.';
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
|
|
981
993
|
/**
|
|
982
994
|
* The go dialog's body: the question of a deploy plan (what each answer does for the target, and who deploys it) or of a
|
|
983
995
|
* maintenance window the driver proposed (its time and targets). The answer is the owner's, as on the ticket; the
|
|
984
|
-
* dialog's buttons send it.
|
|
996
|
+
* dialog's buttons send it. The Inbox shows a go from what its item carries instead (`inboxPlan`, `inboxWindow`): what
|
|
997
|
+
* the target runs, what it deploys and what ships with it.
|
|
985
998
|
*/
|
|
986
999
|
@plugins.deesElement.customElement('agl-deploy-go')
|
|
987
1000
|
export class AglDeployGo extends plugins.deesElement.DeesElement {
|
|
@@ -1008,6 +1021,14 @@ export class AglDeployGo extends plugins.deesElement.DeesElement {
|
|
|
1008
1021
|
@plugins.deesElement.property({ attribute: false })
|
|
1009
1022
|
accessor question: interfaces.ITicketQuestion | undefined;
|
|
1010
1023
|
|
|
1024
|
+
/** A deploy plan's go as the Inbox lists it, in place of `target` and `plan`. */
|
|
1025
|
+
@plugins.deesElement.property({ attribute: false })
|
|
1026
|
+
accessor inboxPlan: interfaces.IControllerInboxDeployGo | undefined;
|
|
1027
|
+
|
|
1028
|
+
/** A proposed maintenance window's go as the Inbox lists it, in place of `window`. */
|
|
1029
|
+
@plugins.deesElement.property({ attribute: false })
|
|
1030
|
+
accessor inboxWindow: interfaces.IControllerInboxWindowGo | undefined;
|
|
1031
|
+
|
|
1011
1032
|
@plugins.deesElement.state()
|
|
1012
1033
|
accessor error = '';
|
|
1013
1034
|
|
|
@@ -1022,7 +1043,14 @@ export class AglDeployGo extends plugins.deesElement.DeesElement {
|
|
|
1022
1043
|
];
|
|
1023
1044
|
|
|
1024
1045
|
public render(): plugins.deesElement.TemplateResult {
|
|
1025
|
-
const { target, plan, window, question } = this;
|
|
1046
|
+
const { target, plan, window, question, inboxPlan, inboxWindow } = this;
|
|
1047
|
+
if (question && inboxPlan) return this.renderGo(question, false, this.inboxPlanSections(inboxPlan));
|
|
1048
|
+
if (question && inboxWindow) return this.renderGo(question, true, [{ header: 'Maintenance window', rows: [
|
|
1049
|
+
{ key: 'time', label: 'When', icon: 'lucide:Clock', description: deployWindowRange(inboxWindow) },
|
|
1050
|
+
{ key: 'targets', label: 'Targets', icon: 'lucide:Server', description: inboxWindow.targets.join(', ') },
|
|
1051
|
+
{ key: 'what', label: 'What it does', icon: 'lucide:Info',
|
|
1052
|
+
description: 'Approved, the targets that deploy only in a window may be deployed in it, and the deploys you queued into the next window run then.' },
|
|
1053
|
+
] }]);
|
|
1026
1054
|
if (!question || !(target && plan) && !window) return html``;
|
|
1027
1055
|
const icons: Record<string, string> = window
|
|
1028
1056
|
? { [interfaces.ticketWindowOptions.approve]: 'lucide:CalendarCheck', [interfaces.ticketWindowOptions.decline]: 'lucide:CalendarX' }
|
|
@@ -1051,6 +1079,42 @@ export class AglDeployGo extends plugins.deesElement.DeesElement {
|
|
|
1051
1079
|
`;
|
|
1052
1080
|
}
|
|
1053
1081
|
|
|
1082
|
+
/** The Inbox's go: the question's options, then what the deploy does and what ships with it. */
|
|
1083
|
+
private renderGo(questionArg: interfaces.ITicketQuestion, windowArg: boolean,
|
|
1084
|
+
sectionsArg: plugins.deesCatalog.IGroupedListSection[]): plugins.deesElement.TemplateResult {
|
|
1085
|
+
const icons: Record<string, string> = windowArg
|
|
1086
|
+
? { [interfaces.ticketWindowOptions.approve]: 'lucide:CalendarCheck', [interfaces.ticketWindowOptions.decline]: 'lucide:CalendarX' }
|
|
1087
|
+
: { [interfaces.ticketDeployPlanOptions.now]: 'lucide:Rocket', [interfaces.ticketDeployPlanOptions.later]: 'lucide:CalendarClock',
|
|
1088
|
+
[interfaces.ticketDeployPlanOptions.hold]: 'lucide:CirclePause' };
|
|
1089
|
+
const answer = questionArg.answer;
|
|
1090
|
+
const options: plugins.deesCatalog.IGroupedListRow[] = questionArg.options.map((optionArg) => ({ key: optionArg.id, label: optionArg.label,
|
|
1091
|
+
icon: icons[optionArg.id] ?? 'lucide:Circle', ...(optionArg.description ? { description: optionArg.description } : {}),
|
|
1092
|
+
...(answer?.choices.includes(optionArg.id) ? { accessory: html`<dees-badge tone="success" text="the answer"></dees-badge>` } : {}) }));
|
|
1093
|
+
return html`
|
|
1094
|
+
<dees-grouped-list .inset=${false} .sections=${[{ header: answer ? 'Answered' : 'Your go', rows: options,
|
|
1095
|
+
...(answer ? { footer: `${answer.answeredBy.name} answered ${deployMoment(answer.answeredAt)}.` } : {}) }, ...sectionsArg]}></dees-grouped-list>
|
|
1096
|
+
`;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/** What a deploy plan's go names: what runs, what it deploys, when and by whom, and the tickets that ship with it. */
|
|
1100
|
+
private inboxPlanSections(planArg: interfaces.IControllerInboxDeployGo): plugins.deesCatalog.IGroupedListSection[] {
|
|
1101
|
+
const when = inboxDeployWhenText(planArg);
|
|
1102
|
+
const more = planArg.shipsTotal - planArg.ships.length;
|
|
1103
|
+
return [
|
|
1104
|
+
{ header: [planArg.targetName ?? planArg.target, planArg.environment].filter(Boolean).join(' → '), rows: [
|
|
1105
|
+
{ key: 'runs', label: 'Runs now', icon: 'lucide:Server', value: planArg.runs ?? 'not observed yet' },
|
|
1106
|
+
{ key: 'deploys', label: 'Deploys', icon: 'lucide:Rocket', value: planArg.version },
|
|
1107
|
+
...(when === undefined ? [] : [{ key: 'when', label: 'When it deploys', icon: 'lucide:Clock', description: when }]),
|
|
1108
|
+
{ key: 'who', label: 'Who deploys', icon: 'lucide:User',
|
|
1109
|
+
description: planArg.assignee ? `${planArg.assignee}, as the plan's assignee` : 'The driver: the plan has no assignee.' },
|
|
1110
|
+
] },
|
|
1111
|
+
{ header: `What ships · ${planArg.shipsTotal} ticket${planArg.shipsTotal === 1 ? '' : 's'}`,
|
|
1112
|
+
rows: planArg.ships.map((shipArg) => ({ key: shipArg.key, label: shipArg.key, description: shipArg.title })),
|
|
1113
|
+
...(planArg.shipsTotal === 0 ? { footer: `No ticket that ${planArg.targetName ?? planArg.target} does not run yet ships with it.` }
|
|
1114
|
+
: more > 0 ? { footer: `And ${more} more.` } : {}) },
|
|
1115
|
+
];
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1054
1118
|
/** Sends the owner's answer; resolves false with the reason shown when the controller refuses it. */
|
|
1055
1119
|
public async answer(optionIdArg: string): Promise<boolean> {
|
|
1056
1120
|
if (!this.sender || !this.subjectKey || !this.question) return false;
|
|
@@ -155,7 +155,7 @@ export class AglDevices extends plugins.deesElement.DeesElement {
|
|
|
155
155
|
.row:hover { background: var(--dees-color-hover); }
|
|
156
156
|
.row:active { background: var(--dees-color-active); }
|
|
157
157
|
|
|
158
|
-
.row:focus-visible
|
|
158
|
+
.row:focus-visible {
|
|
159
159
|
outline: var(--dees-line-width-focus-ring, 2px) solid var(--dees-color-focus-ring);
|
|
160
160
|
outline-offset: 2px;
|
|
161
161
|
}
|
|
@@ -206,19 +206,7 @@ export class AglDevices extends plugins.deesElement.DeesElement {
|
|
|
206
206
|
|
|
207
207
|
.page { display: grid; gap: var(--dees-spacing-lg); }
|
|
208
208
|
|
|
209
|
-
.back {
|
|
210
|
-
justify-self: start;
|
|
211
|
-
display: inline-flex;
|
|
212
|
-
align-items: center;
|
|
213
|
-
gap: 2px;
|
|
214
|
-
padding: 0;
|
|
215
|
-
border: 0;
|
|
216
|
-
background: none;
|
|
217
|
-
color: var(--dees-color-accent-primary, var(--dees-color-text-link));
|
|
218
|
-
font: inherit;
|
|
219
|
-
font-size: var(--dees-font-footnote-size);
|
|
220
|
-
cursor: pointer;
|
|
221
|
-
}
|
|
209
|
+
.back { justify-self: start; }
|
|
222
210
|
|
|
223
211
|
.pageHead {
|
|
224
212
|
display: grid;
|
|
@@ -564,9 +552,8 @@ export class AglDevices extends plugins.deesElement.DeesElement {
|
|
|
564
552
|
const status = deviceStatus(deviceArg);
|
|
565
553
|
return plugins.deesElement.html`
|
|
566
554
|
<div class="page" data-device-page=${deviceArg.id}>
|
|
567
|
-
<button class="back" type="
|
|
568
|
-
|
|
569
|
-
</button>
|
|
555
|
+
<dees-button class="back" type="link" size="sm" icon="lucide:ChevronLeft" data-action="back"
|
|
556
|
+
@clicked=${() => { this.openId = ''; }}>Devices</dees-button>
|
|
570
557
|
<div class="pageHead">
|
|
571
558
|
<span class="glyph"><dees-icon icon="lucide:Smartphone" iconSize="16" aria-hidden="true"></dees-icon></span>
|
|
572
559
|
<h3 class="pageTitle">${deviceArg.name}</h3>
|