pisha-server 0.0.11 → 0.0.13
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/boards/boards.js +9 -1
- package/companies.js +5 -5
- package/company.js +10 -2
- package/dashboard/dashboard.js +6 -2
- package/machines/machines.js +2 -0
- package/messaging/index.js +1 -1
- package/messaging/messaging.js +29 -3
- package/observation/observation.js +30 -4
- package/package.json +3 -1
- package/pisha-host.mjs +44 -9
- package/pisha-host.mjs.sig +1 -1
- package/platform/http.js +3 -1
- package/platform/index.js +3 -0
- package/routes.js +15 -1
- package/ui/addmachine.js +7 -0
- package/ui/back.js +4 -0
- package/ui/content.js +14 -2
- package/ui/i18n.js +290 -0
- package/ui/icons.js +2 -0
- package/ui/inbox.js +12 -4
- package/ui/index.html +4 -0
- package/ui/nav.js +4 -2
- package/ui/org.js +20 -4
- package/ui/palette.js +2 -0
- package/ui/people.js +2 -1
- package/ui/router.js +6 -2
- package/ui/routes.js +5 -0
- package/ui/screen-org.css +8 -2
- package/ui/screen-session.css +1 -0
- package/ui/screen-usage.css +60 -0
- package/ui/screen-webhooks.css +111 -0
- package/ui/session.js +5 -2
- package/ui/squads.js +2 -1
- package/ui/stream.js +4 -0
- package/ui/team.js +2 -0
- package/ui/timeline.js +1 -0
- package/ui/topbar.js +12 -0
- package/ui/usage.js +175 -0
- package/ui/webhooks.js +427 -0
- package/usage/index.js +1 -0
- package/usage/usage.js +128 -0
- package/webhooks/index.js +1 -0
- package/webhooks/webhooks.js +800 -0
package/ui/i18n.js
CHANGED
|
@@ -14,6 +14,8 @@ export const COLLATOR = new Intl.Collator(LOCALE, { numeric: true })
|
|
|
14
14
|
const I18N = {
|
|
15
15
|
en: {
|
|
16
16
|
offline: ago => `Disconnected · seen ${ago} ago`,
|
|
17
|
+
notJoined: 'Not connected: Pisha refused to log in',
|
|
18
|
+
svNotJoined: 'Why it is not connected',
|
|
17
19
|
working: d => `Working · ${d}`,
|
|
18
20
|
waitingTool: what => `Waiting for permission · ${what}`,
|
|
19
21
|
waitingInput: w => `Waiting: ${w || 'your answer'}`,
|
|
@@ -387,6 +389,7 @@ const I18N = {
|
|
|
387
389
|
notifyBlocked: 'This browser blocks notices from this site: allow them in its settings.',
|
|
388
390
|
notifyUnsupported: 'This browser can not show notices.',
|
|
389
391
|
retentionInbox: 'Inbox, what is done (days)',
|
|
392
|
+
retentionUsage: 'Token usage (days)',
|
|
390
393
|
ibxWaiting: n => (n === 1 ? '1 waiting on you' : `${n} waiting on you`),
|
|
391
394
|
ibxNothingListed: 'Nothing here yet.',
|
|
392
395
|
ibxEmptyHint: 'When a coordinator needs a decision, or has something for you, it shows up here.',
|
|
@@ -423,6 +426,8 @@ const I18N = {
|
|
|
423
426
|
tlDismissed: 'You dismissed it',
|
|
424
427
|
ibxPermTitle: (name, what) => (what ? `${name} asks for permission: ${what}` : `${name} asks for permission`),
|
|
425
428
|
ibxPermHint: 'It is answered in its session: open it to see exactly what it wants to run.',
|
|
429
|
+
ibxWithCoord: c => `${c} is deciding it`,
|
|
430
|
+
ibxPermRelayedHint: c => `It went to ${c}, its coordinator: ${c} decides it, or asks you here in the inbox. You can still answer it in its session, and ${c} is told.`,
|
|
426
431
|
ibxApproveTitle: name => `${name} wants to coordinate`,
|
|
427
432
|
ibxApproveHint: 'A name nobody has used before took the coordinator role. Approve it from its session if you know it.',
|
|
428
433
|
ibxOpenSession: 'Open its session',
|
|
@@ -476,6 +481,146 @@ const I18N = {
|
|
|
476
481
|
vRates: ['Normal', 'Fast', 'Faster'],
|
|
477
482
|
// Task boards
|
|
478
483
|
boards: 'Boards',
|
|
484
|
+
usage: 'Usage',
|
|
485
|
+
usageSub: 'Tokens spent by the agents',
|
|
486
|
+
usagePeriod: 'Period',
|
|
487
|
+
usageRanges: { today: 'Today', d7: '7 days', d30: '30 days', d90: '90 days' },
|
|
488
|
+
usageExport: 'Export CSV',
|
|
489
|
+
usageLoading: 'Loading…',
|
|
490
|
+
usageAllTeams: 'All teams',
|
|
491
|
+
usageAllAgents: 'All agents',
|
|
492
|
+
usageAllModels: 'All models',
|
|
493
|
+
usageNoTeam: '(no team)',
|
|
494
|
+
usageTotal: 'Tokens',
|
|
495
|
+
usageKinds: { input: 'Input', output: 'Output', cache_read: 'Cache read', cache_write: 'Cache write' },
|
|
496
|
+
usageCached: p => `${p} % of input from cache`,
|
|
497
|
+
usageCalls: n => `${n.toLocaleString('en-GB')} model call${n === 1 ? '' : 's'}`,
|
|
498
|
+
usageOverTime: 'Over time',
|
|
499
|
+
usageByTeam: 'By team',
|
|
500
|
+
usageByCause: 'By what started the work',
|
|
501
|
+
usageByTask: 'By board task',
|
|
502
|
+
usageByModel: 'By model',
|
|
503
|
+
usageBySession: 'By session',
|
|
504
|
+
usageNoTasks: 'Nothing spent on a board task in this period.',
|
|
505
|
+
usageEmpty: 'Nothing spent in this period',
|
|
506
|
+
usageEmptyHint: 'Each session reports the tokens it spends as it works: Claude Code, Codex CLI and Grok CLI.',
|
|
507
|
+
usageCauses: { user: 'Your orders', inbox: 'Your answers from the inbox', coordinator: 'From their coordinator', worker: 'Workers\' reports', link: 'Between linked teams', board: 'Board notices', webhook: 'Webhooks', system: 'Server notices', other: 'Other messages', self: 'On its own' },
|
|
508
|
+
usageCauseHints: { user: 'Turns started by what you typed in a session\'s terminal', inbox: 'Turns started by your answers from the inbox', coordinator: 'Workers\' turns on what their coordinator handed them', worker: 'Coordinators\' turns on their workers\' reports', link: 'Turns started by a message from a linked team', board: 'Turns started by the task board', webhook: 'Turns started by what a webhook brought', system: 'Turns started by the server\'s notices', other: 'Turns started by another message', self: 'Before any prompt: a session starting, or after a compaction' },
|
|
509
|
+
whTitle: 'Webhooks',
|
|
510
|
+
whSub: 'What other services sent your teams',
|
|
511
|
+
whStatus: { queued: 'Queued', delivered: 'Delivered', processing: 'Being dealt with', unreported: 'No report', done: 'Done', ignored: 'Nothing to do', failed: 'Failed', filtered: 'Filtered out', ping: 'Ping', duplicate: 'Repeated', undelivered: 'Not delivered', no_coordinator: 'No coordinator', bad_signature: 'Bad signature', bad_json: 'Not JSON', too_large: 'Too large', disabled: 'Turned off', rate_limited: 'Too many' },
|
|
512
|
+
whNone: 'No webhooks yet. Make one so a service like GitHub or GitLab can send this team what happens there: its coordinator gets it as it came, with your instructions.',
|
|
513
|
+
whSeeLog: 'See the log',
|
|
514
|
+
whNew: 'New webhook',
|
|
515
|
+
whOn: 'On',
|
|
516
|
+
whOff: 'Turned off',
|
|
517
|
+
whOffNoCoord: 'Turned off: the team has no coordinator',
|
|
518
|
+
whPreset: { github: 'GitHub', gitlab: 'GitLab', stripe: 'Stripe', standard: 'Standard Webhooks', custom: 'Other' },
|
|
519
|
+
whNothingYet: 'Nothing received yet',
|
|
520
|
+
whOnlyEvents: n => `Only ${n} event${n === 1 ? '' : 's'}`,
|
|
521
|
+
whActions: name => `Actions for ${name}`,
|
|
522
|
+
whEdit: 'Edit',
|
|
523
|
+
whTest: 'Send a test',
|
|
524
|
+
whShowUrl: 'Show its address',
|
|
525
|
+
whNewSecret: 'New secret',
|
|
526
|
+
whTurnOff: 'Turn off',
|
|
527
|
+
whTurnOn: 'Turn on',
|
|
528
|
+
whTestSent: (id, status) => `Test sent (#${id}): ${status}. Its coordinator will see it as a webhook.`,
|
|
529
|
+
whNewSecretTitle: name => `New secret for ${name}?`,
|
|
530
|
+
whNewSecretText: 'The current one stops working at once: whatever sends to this webhook is refused until you give it the new one.',
|
|
531
|
+
whDeleteTitle: name => `Delete ${name}?`,
|
|
532
|
+
whDeleteText: 'Its address stops working, and its log is deleted with it.',
|
|
533
|
+
whEditTitle: name => `Edit ${name}`,
|
|
534
|
+
whNewTitle: team => `New webhook for ${team}`,
|
|
535
|
+
whName: 'Name',
|
|
536
|
+
whNamePh: 'GitHub — website repository',
|
|
537
|
+
whService: 'Service',
|
|
538
|
+
whVerify: 'How it signs',
|
|
539
|
+
whVerifyName: { 'hmac-sha256': 'HMAC-SHA256 of the body (like GitHub)', token: 'A token in a header (like GitLab)', stripe: 'Timestamped, like Stripe (t=…,v1=…)', standard: 'Standard Webhooks (Svix, Resend, Clerk…)' },
|
|
540
|
+
whSigHeader: 'Signature header',
|
|
541
|
+
whEventHeader: 'Event header',
|
|
542
|
+
whDeliveryHeader: 'Delivery id header',
|
|
543
|
+
whEvents: 'Events it takes',
|
|
544
|
+
whEventsHint: 'Separated by commas. An event alone (push) or with its action (pull_request.opened). Empty: all of them.',
|
|
545
|
+
whPrompt: 'What the coordinator should do with it',
|
|
546
|
+
whPromptPh: 'Review each new pull request and tell me if something is wrong',
|
|
547
|
+
whPromptHint: 'Optional. It goes with every delivery, before the JSON.',
|
|
548
|
+
whOwnSecret: 'Secret',
|
|
549
|
+
whOwnSecretPh: 'Empty: one is made for you',
|
|
550
|
+
whCreate: 'Create',
|
|
551
|
+
whMadeTitle: name => `${name} is ready`,
|
|
552
|
+
whRenewedTitle: name => `New secret for ${name}`,
|
|
553
|
+
whUrlTitle: name => `Address of ${name}`,
|
|
554
|
+
whUrl: 'Address (Payload URL)',
|
|
555
|
+
whSecret: 'Secret',
|
|
556
|
+
whToken: 'Secret token',
|
|
557
|
+
whSecretOnce: 'Copy it now: it will not be shown again. You can always make a new one.',
|
|
558
|
+
whSecretHidden: 'The secret is not shown again. If you lost it, make a new one from the webhook\'s menu.',
|
|
559
|
+
whSteps: {
|
|
560
|
+
github: ['In GitHub, open the repository or organisation: Settings › Webhooks › Add webhook.', 'Paste the address in Payload URL, and choose application/json as Content type.', 'Paste the secret in Secret, pick the events and save: GitHub sends a ping, which shows up in the log.'],
|
|
561
|
+
gitlab: ['In GitLab, open the project: Settings › Webhooks › Add new webhook.', 'Paste the address in URL and the secret in Secret token.', 'Pick the triggers and save. Test sends one so you can see it in the log.'],
|
|
562
|
+
stripe: ['In Stripe, open Developers › Webhooks › Add destination, and choose the events.', 'Paste the address as the endpoint URL and save.', 'Stripe shows its Signing secret (whsec_…): it is the one you pasted here. If you made it before, check it is the same.'],
|
|
563
|
+
standard: ['In the service (Resend, Clerk, any built on Svix…), add an endpoint with this address and choose the events.', 'The service shows its signing secret (whsec_…): it is the one you pasted here.', 'Send a test from there: it shows up in the log.'],
|
|
564
|
+
custom: ['Give the service the address and the secret.', 'It must send JSON by POST, signed as you chose, in the headers you named.'],
|
|
565
|
+
},
|
|
566
|
+
whPublicNote: 'The service must be able to reach this server from the internet: with your own domain (HTTPS), or through a tunnel if Pisha runs on your computer.',
|
|
567
|
+
whLogOf: team => `Webhooks of ${team}`,
|
|
568
|
+
whAllWebhooks: 'All webhooks',
|
|
569
|
+
whAllStatuses: 'Any state',
|
|
570
|
+
whBackToTeam: 'Back to the team',
|
|
571
|
+
whLogEmpty: 'Nothing has come in',
|
|
572
|
+
whLogEmptyHint: 'Everything that reaches a webhook is written down here, also what was refused.',
|
|
573
|
+
whLogNoHooks: 'There are no webhooks here: make one on a team\'s page.',
|
|
574
|
+
whWhen: 'Received',
|
|
575
|
+
whWebhook: 'Webhook',
|
|
576
|
+
whEvent: 'Event',
|
|
577
|
+
whState: 'State',
|
|
578
|
+
whResult: 'Result',
|
|
579
|
+
whMore: 'Show older ones',
|
|
580
|
+
whShown: n => `${n} shown`,
|
|
581
|
+
whDeliveredTo: c => `Given to ${c}`,
|
|
582
|
+
whDeliveryTitle: id => `Delivery #${id}`,
|
|
583
|
+
whDeliveryKey: 'Delivery id',
|
|
584
|
+
whFrom: 'From',
|
|
585
|
+
whSize: 'Size',
|
|
586
|
+
whBytes: n => (n >= 1024 ? `${(n / 1024).toFixed(1)} KB` : `${n} bytes`),
|
|
587
|
+
whReason: 'Why',
|
|
588
|
+
whTo: 'Given to',
|
|
589
|
+
whMessage: id => `message #${id}`,
|
|
590
|
+
whHeaders: n => `Headers (${n})`,
|
|
591
|
+
whBody: 'What it sent',
|
|
592
|
+
whNoBody: 'Nothing of it was kept: what is refused is written down without what it brought.',
|
|
593
|
+
whRedeliver: 'Give it to the coordinator again',
|
|
594
|
+
whRedelivered: id => `Given again as delivery #${id}.`,
|
|
595
|
+
whWhy: { processing: 'Its coordinator is on it', unreported: 'Its coordinator\'s turn ended without saying what came of it', filtered: 'Not one of the events this webhook takes', duplicate: 'Already received: not given again', bad_signature: 'The signature does not match this webhook\'s secret', bad_json: 'What came is not JSON', too_large: 'Bigger than a webhook may send', disabled: 'The webhook is turned off', rate_limited: 'Too many in a minute', no_coordinator: 'The team has no coordinator', ping: 'The service checking the address' },
|
|
596
|
+
whWhyAgain: id => `Given again, from #${id}`,
|
|
597
|
+
whWhyTest: 'A test sent from the dashboard',
|
|
598
|
+
whServiceSecret: 'Signing secret, from the service',
|
|
599
|
+
whServiceSecretHint: 'This service makes the secret itself: copy it from where you add the webhook there.',
|
|
600
|
+
whSecretFromService: 'The secret is the one the service gave you, which you pasted: it is not shown here.',
|
|
601
|
+
whPasteSecretText: 'Paste the new signing secret the service shows. The current one stops working at once.',
|
|
602
|
+
whByEvent: 'Instructions by event',
|
|
603
|
+
whByEventHint: 'For one event (pull_request) or one event and action (pull_request.opened): the most specific one is used, and the ones above for the rest.',
|
|
604
|
+
whByEventAdd: '+ Instructions for an event',
|
|
605
|
+
whRemove: 'Remove',
|
|
606
|
+
whBatch: 'Gather bursts (seconds)',
|
|
607
|
+
whBatchHint: 'What arrives within these seconds goes to the coordinator in one notice. 0: each one on its own.',
|
|
608
|
+
whBatchTag: n => `Gathers ${n} s`,
|
|
609
|
+
whTogether: list => `Given in one notice with ${list}: what its coordinator did is theirs too.`,
|
|
610
|
+
whNoWorkerReport: 'No report from the worker yet',
|
|
611
|
+
whWaitingFor: names => `Waiting for ${names}'s report`,
|
|
612
|
+
whWorkerTokens: (n, calls) => `Its workers: ${n} tokens in ${calls} call${calls === 1 ? '' : 's'}`,
|
|
613
|
+
whWhatItDid: 'What its coordinator did',
|
|
614
|
+
whNoReport: 'It has not said what came of it (webhook_result).',
|
|
615
|
+
whNotYet: 'Its coordinator has not started on it yet.',
|
|
616
|
+
whNoTrace: 'Nothing of its turn was seen: its observation may be off.',
|
|
617
|
+
whTook: s => (s < 90 ? `Its turn: ${s} s` : `Its turn: ${Math.round(s / 60)} min`),
|
|
618
|
+
whStillOn: 'Still on it',
|
|
619
|
+
whTools: n => `${n} tool call${n === 1 ? '' : 's'}`,
|
|
620
|
+
whSent: n => `${n} message${n === 1 ? '' : 's'} sent`,
|
|
621
|
+
whSentTo: to => `To ${to}:`,
|
|
622
|
+
whLastWords: 'What it said at the end',
|
|
623
|
+
whTokens: (n, calls) => `${n} tokens in ${calls} call${calls === 1 ? '' : 's'}`,
|
|
479
624
|
boardsCount: n => `${n} board${n === 1 ? '' : 's'}`,
|
|
480
625
|
noBoards: 'No boards yet',
|
|
481
626
|
noBoardsHint: 'A board keeps the company\'s tasks. People and agents work on them, and each team sees the boards it is given.',
|
|
@@ -1052,6 +1197,8 @@ const I18N = {
|
|
|
1052
1197
|
},
|
|
1053
1198
|
es: {
|
|
1054
1199
|
offline: ago => `Desconectada · vista hace ${ago}`,
|
|
1200
|
+
notJoined: 'Sin conectar: Pisha no pudo iniciar sesión',
|
|
1201
|
+
svNotJoined: 'Por qué no está conectada',
|
|
1055
1202
|
working: d => `Trabajando · ${d}`,
|
|
1056
1203
|
waitingTool: what => `Esperando permiso · ${what}`,
|
|
1057
1204
|
waitingInput: w => `Esperando: ${w || 'tu respuesta'}`,
|
|
@@ -1425,6 +1572,7 @@ const I18N = {
|
|
|
1425
1572
|
notifyBlocked: 'Este navegador bloquea los avisos de este sitio: permítelos en sus ajustes.',
|
|
1426
1573
|
notifyUnsupported: 'Este navegador no puede mostrar avisos.',
|
|
1427
1574
|
retentionInbox: 'Bandeja, lo hecho (días)',
|
|
1575
|
+
retentionUsage: 'Consumo de tokens (días)',
|
|
1428
1576
|
ibxWaiting: n => (n === 1 ? '1 te espera' : `${n} te esperan`),
|
|
1429
1577
|
ibxNothingListed: 'Aún no hay nada.',
|
|
1430
1578
|
ibxEmptyHint: 'Cuando un coordinador necesite una decisión, o tenga algo para ti, aparecerá aquí.',
|
|
@@ -1461,6 +1609,8 @@ const I18N = {
|
|
|
1461
1609
|
tlDismissed: 'La descartaste',
|
|
1462
1610
|
ibxPermTitle: (name, what) => (what ? `${name} pide permiso: ${what}` : `${name} pide permiso`),
|
|
1463
1611
|
ibxPermHint: 'Se responde en su sesión: ábrela para ver exactamente qué quiere ejecutar.',
|
|
1612
|
+
ibxWithCoord: c => `Lo está decidiendo ${c}`,
|
|
1613
|
+
ibxPermRelayedHint: c => `Se le ha pasado a ${c}, su coordinador: lo decide ${c} o te lo pregunta aquí, en la bandeja. También puedes contestarlo en su sesión, y ${c} se entera.`,
|
|
1464
1614
|
ibxApproveTitle: name => `${name} quiere coordinar`,
|
|
1465
1615
|
ibxApproveHint: 'Un nombre que nadie había usado tomó el rol de coordinador. Apruébalo desde su sesión si lo conoces.',
|
|
1466
1616
|
ibxOpenSession: 'Abrir su sesión',
|
|
@@ -1514,6 +1664,146 @@ const I18N = {
|
|
|
1514
1664
|
vRates: ['Normal', 'Rápido', 'Muy rápido'],
|
|
1515
1665
|
// Tableros de tareas
|
|
1516
1666
|
boards: 'Tableros',
|
|
1667
|
+
usage: 'Consumo',
|
|
1668
|
+
usageSub: 'Los tokens que gastan los agentes',
|
|
1669
|
+
usagePeriod: 'Periodo',
|
|
1670
|
+
usageRanges: { today: 'Hoy', d7: '7 días', d30: '30 días', d90: '90 días' },
|
|
1671
|
+
usageExport: 'Exportar CSV',
|
|
1672
|
+
usageLoading: 'Cargando…',
|
|
1673
|
+
usageAllTeams: 'Todos los equipos',
|
|
1674
|
+
usageAllAgents: 'Todos los agentes',
|
|
1675
|
+
usageAllModels: 'Todos los modelos',
|
|
1676
|
+
usageNoTeam: '(sin equipo)',
|
|
1677
|
+
usageTotal: 'Tokens',
|
|
1678
|
+
usageKinds: { input: 'Entrada', output: 'Salida', cache_read: 'Lectura de caché', cache_write: 'Escritura de caché' },
|
|
1679
|
+
usageCached: p => `${p} % de la entrada, desde la caché`,
|
|
1680
|
+
usageCalls: n => `${n.toLocaleString('es-ES')} llamada${n === 1 ? '' : 's'} al modelo`,
|
|
1681
|
+
usageOverTime: 'En el tiempo',
|
|
1682
|
+
usageByTeam: 'Por equipo',
|
|
1683
|
+
usageByCause: 'Por lo que empezó el trabajo',
|
|
1684
|
+
usageByTask: 'Por tarea del tablero',
|
|
1685
|
+
usageByModel: 'Por modelo',
|
|
1686
|
+
usageBySession: 'Por sesión',
|
|
1687
|
+
usageNoTasks: 'Nada gastado en tareas del tablero en este periodo.',
|
|
1688
|
+
usageEmpty: 'Nada gastado en este periodo',
|
|
1689
|
+
usageEmptyHint: 'Cada sesión informa de los tokens que gasta mientras trabaja: Claude Code, Codex CLI y Grok CLI.',
|
|
1690
|
+
usageCauses: { user: 'Tus órdenes', inbox: 'Tus respuestas desde la bandeja', coordinator: 'De su coordinador', worker: 'Informes de los workers', link: 'Entre equipos enlazados', board: 'Avisos del tablero', webhook: 'Webhooks', system: 'Avisos del servidor', other: 'Otros mensajes', self: 'Por su cuenta' },
|
|
1691
|
+
usageCauseHints: { user: 'Turnos empezados por lo que escribiste en el terminal de una sesión', inbox: 'Turnos empezados por tus respuestas desde la bandeja', coordinator: 'Turnos de los workers con lo que les pasó su coordinador', worker: 'Turnos de los coordinadores con los informes de sus workers', link: 'Turnos empezados por un mensaje de un equipo enlazado', board: 'Turnos empezados por el tablero de tareas', webhook: 'Turnos empezados por lo que trajo un webhook', system: 'Turnos empezados por avisos del servidor', other: 'Turnos empezados por otro mensaje', self: 'Antes de cualquier prompt: una sesión que empieza, o tras una compactación' },
|
|
1692
|
+
whTitle: 'Webhooks',
|
|
1693
|
+
whSub: 'Lo que otros servicios envían a tus equipos',
|
|
1694
|
+
whStatus: { queued: 'En cola', delivered: 'Entregado', processing: 'En marcha', unreported: 'Sin informe', done: 'Hecho', ignored: 'Nada que hacer', failed: 'Falló', filtered: 'Filtrado', ping: 'Ping', duplicate: 'Repetido', undelivered: 'No entregado', no_coordinator: 'Sin coordinador', bad_signature: 'Firma inválida', bad_json: 'No es JSON', too_large: 'Demasiado grande', disabled: 'Desactivado', rate_limited: 'Demasiados' },
|
|
1695
|
+
whNone: 'Aún no hay webhooks. Crea uno para que un servicio como GitHub o GitLab envíe a este equipo lo que pasa allí: su coordinador lo recibe tal cual, con tus instrucciones.',
|
|
1696
|
+
whSeeLog: 'Ver el registro',
|
|
1697
|
+
whNew: 'Nuevo webhook',
|
|
1698
|
+
whOn: 'Activo',
|
|
1699
|
+
whOff: 'Desactivado',
|
|
1700
|
+
whOffNoCoord: 'Desactivado: el equipo no tiene coordinador',
|
|
1701
|
+
whPreset: { github: 'GitHub', gitlab: 'GitLab', stripe: 'Stripe', standard: 'Standard Webhooks', custom: 'Otro' },
|
|
1702
|
+
whNothingYet: 'Aún no ha llegado nada',
|
|
1703
|
+
whOnlyEvents: n => `Solo ${n} evento${n === 1 ? '' : 's'}`,
|
|
1704
|
+
whActions: name => `Acciones de ${name}`,
|
|
1705
|
+
whEdit: 'Editar',
|
|
1706
|
+
whTest: 'Enviar una prueba',
|
|
1707
|
+
whShowUrl: 'Ver su dirección',
|
|
1708
|
+
whNewSecret: 'Nuevo secreto',
|
|
1709
|
+
whTurnOff: 'Desactivar',
|
|
1710
|
+
whTurnOn: 'Activar',
|
|
1711
|
+
whTestSent: (id, status) => `Prueba enviada (#${id}): ${status}. Su coordinador la verá como un webhook.`,
|
|
1712
|
+
whNewSecretTitle: name => `¿Nuevo secreto para ${name}?`,
|
|
1713
|
+
whNewSecretText: 'El actual deja de funcionar al momento: lo que envíe a este webhook se rechaza hasta que le des el nuevo.',
|
|
1714
|
+
whDeleteTitle: name => `¿Eliminar ${name}?`,
|
|
1715
|
+
whDeleteText: 'Su dirección deja de funcionar y su registro se elimina con él.',
|
|
1716
|
+
whEditTitle: name => `Editar ${name}`,
|
|
1717
|
+
whNewTitle: team => `Nuevo webhook para ${team}`,
|
|
1718
|
+
whName: 'Nombre',
|
|
1719
|
+
whNamePh: 'GitHub — repositorio de la web',
|
|
1720
|
+
whService: 'Servicio',
|
|
1721
|
+
whVerify: 'Cómo firma',
|
|
1722
|
+
whVerifyName: { 'hmac-sha256': 'HMAC-SHA256 del cuerpo (como GitHub)', token: 'Un token en una cabecera (como GitLab)', stripe: 'Con marca de tiempo, como Stripe (t=…,v1=…)', standard: 'Standard Webhooks (Svix, Resend, Clerk…)' },
|
|
1723
|
+
whSigHeader: 'Cabecera de la firma',
|
|
1724
|
+
whEventHeader: 'Cabecera del evento',
|
|
1725
|
+
whDeliveryHeader: 'Cabecera del id de entrega',
|
|
1726
|
+
whEvents: 'Eventos que acepta',
|
|
1727
|
+
whEventsHint: 'Separados por comas. Un evento solo (push) o con su acción (pull_request.opened). Vacío: todos.',
|
|
1728
|
+
whPrompt: 'Qué debe hacer el coordinador con él',
|
|
1729
|
+
whPromptPh: 'Revisa cada pull request nueva y avísame si algo está mal',
|
|
1730
|
+
whPromptHint: 'Opcional. Va con cada entrega, antes del JSON.',
|
|
1731
|
+
whOwnSecret: 'Secreto',
|
|
1732
|
+
whOwnSecretPh: 'Vacío: se genera uno',
|
|
1733
|
+
whCreate: 'Crear',
|
|
1734
|
+
whMadeTitle: name => `${name} está listo`,
|
|
1735
|
+
whRenewedTitle: name => `Nuevo secreto para ${name}`,
|
|
1736
|
+
whUrlTitle: name => `Dirección de ${name}`,
|
|
1737
|
+
whUrl: 'Dirección (Payload URL)',
|
|
1738
|
+
whSecret: 'Secreto',
|
|
1739
|
+
whToken: 'Token secreto',
|
|
1740
|
+
whSecretOnce: 'Cópialo ahora: no se volverá a mostrar. Siempre puedes generar otro.',
|
|
1741
|
+
whSecretHidden: 'El secreto no se vuelve a mostrar. Si lo perdiste, genera uno nuevo desde el menú del webhook.',
|
|
1742
|
+
whSteps: {
|
|
1743
|
+
github: ['En GitHub, abre el repositorio u organización: Settings › Webhooks › Add webhook.', 'Pega la dirección en Payload URL y elige application/json como Content type.', 'Pega el secreto en Secret, elige los eventos y guarda: GitHub envía un ping, que aparece en el registro.'],
|
|
1744
|
+
gitlab: ['En GitLab, abre el proyecto: Settings › Webhooks › Add new webhook.', 'Pega la dirección en URL y el secreto en Secret token.', 'Elige los disparadores y guarda. Con Test envías uno para verlo en el registro.'],
|
|
1745
|
+
stripe: ['En Stripe, abre Developers › Webhooks › Add destination y elige los eventos.', 'Pega la dirección como URL del endpoint y guarda.', 'Stripe muestra su Signing secret (whsec_…): es el que pegaste aquí. Si lo creaste antes, comprueba que es el mismo.'],
|
|
1746
|
+
standard: ['En el servicio (Resend, Clerk, cualquiera hecho con Svix…), añade un endpoint con esta dirección y elige los eventos.', 'El servicio muestra su secreto de firma (whsec_…): es el que pegaste aquí.', 'Envía una prueba desde allí: aparece en el registro.'],
|
|
1747
|
+
custom: ['Dale al servicio la dirección y el secreto.', 'Tiene que enviar JSON por POST, firmado como elegiste, en las cabeceras que indicaste.'],
|
|
1748
|
+
},
|
|
1749
|
+
whPublicNote: 'El servicio tiene que poder llegar a este servidor desde internet: con tu propio dominio (HTTPS), o con un túnel si Pisha corre en tu ordenador.',
|
|
1750
|
+
whLogOf: team => `Webhooks de ${team}`,
|
|
1751
|
+
whAllWebhooks: 'Todos los webhooks',
|
|
1752
|
+
whAllStatuses: 'Cualquier estado',
|
|
1753
|
+
whBackToTeam: 'Volver al equipo',
|
|
1754
|
+
whLogEmpty: 'No ha llegado nada',
|
|
1755
|
+
whLogEmptyHint: 'Aquí queda anotado todo lo que llega a un webhook, también lo rechazado.',
|
|
1756
|
+
whLogNoHooks: 'Aquí no hay webhooks: crea uno en la página de un equipo.',
|
|
1757
|
+
whWhen: 'Recibido',
|
|
1758
|
+
whWebhook: 'Webhook',
|
|
1759
|
+
whEvent: 'Evento',
|
|
1760
|
+
whState: 'Estado',
|
|
1761
|
+
whResult: 'Resultado',
|
|
1762
|
+
whMore: 'Ver más antiguos',
|
|
1763
|
+
whShown: n => `${n} mostrados`,
|
|
1764
|
+
whDeliveredTo: c => `Entregado a ${c}`,
|
|
1765
|
+
whDeliveryTitle: id => `Entrega #${id}`,
|
|
1766
|
+
whDeliveryKey: 'Id de entrega',
|
|
1767
|
+
whFrom: 'Desde',
|
|
1768
|
+
whSize: 'Tamaño',
|
|
1769
|
+
whBytes: n => (n >= 1024 ? `${(n / 1024).toFixed(1).replace('.', ',')} KB` : `${n} bytes`),
|
|
1770
|
+
whReason: 'Motivo',
|
|
1771
|
+
whTo: 'Entregado a',
|
|
1772
|
+
whMessage: id => `mensaje #${id}`,
|
|
1773
|
+
whHeaders: n => `Cabeceras (${n})`,
|
|
1774
|
+
whBody: 'Lo que envió',
|
|
1775
|
+
whNoBody: 'No se guardó nada: lo rechazado se anota sin lo que traía.',
|
|
1776
|
+
whRedeliver: 'Entregárselo otra vez al coordinador',
|
|
1777
|
+
whRedelivered: id => `Entregado otra vez como entrega #${id}.`,
|
|
1778
|
+
whWhy: { processing: 'Su coordinador está con ello', unreported: 'El turno de su coordinador terminó sin decir qué salió de ello', filtered: 'No es uno de los eventos que acepta este webhook', duplicate: 'Ya recibido: no se entrega otra vez', bad_signature: 'La firma no coincide con el secreto del webhook', bad_json: 'Lo que llegó no es JSON', too_large: 'Más grande de lo que puede enviar un webhook', disabled: 'El webhook está desactivado', rate_limited: 'Demasiados en un minuto', no_coordinator: 'El equipo no tiene coordinador', ping: 'El servicio comprobando la dirección' },
|
|
1779
|
+
whWhyAgain: id => `Entregado otra vez, desde la #${id}`,
|
|
1780
|
+
whWhyTest: 'Una prueba enviada desde el panel',
|
|
1781
|
+
whServiceSecret: 'Secreto de firma, del servicio',
|
|
1782
|
+
whServiceSecretHint: 'Este servicio genera el secreto él mismo: cópialo de donde añades el webhook allí.',
|
|
1783
|
+
whSecretFromService: 'El secreto es el que te dio el servicio y pegaste: aquí no se muestra.',
|
|
1784
|
+
whPasteSecretText: 'Pega el nuevo secreto de firma que muestra el servicio. El actual deja de funcionar al momento.',
|
|
1785
|
+
whByEvent: 'Instrucciones por evento',
|
|
1786
|
+
whByEventHint: 'Para un evento (pull_request) o un evento y acción (pull_request.opened): se usa la más concreta, y las de arriba para el resto.',
|
|
1787
|
+
whByEventAdd: '+ Instrucciones para un evento',
|
|
1788
|
+
whRemove: 'Quitar',
|
|
1789
|
+
whBatch: 'Agrupar ráfagas (segundos)',
|
|
1790
|
+
whBatchHint: 'Lo que llegue en estos segundos le llega al coordinador en un solo aviso. 0: cada uno por separado.',
|
|
1791
|
+
whBatchTag: n => `Agrupa ${n} s`,
|
|
1792
|
+
whTogether: list => `Entregado en un solo aviso con ${list}: lo que hizo su coordinador también es de ellas.`,
|
|
1793
|
+
whNoWorkerReport: 'El worker aún no ha informado',
|
|
1794
|
+
whWaitingFor: names => `Esperando el informe de ${names}`,
|
|
1795
|
+
whWorkerTokens: (n, calls) => `Sus workers: ${n} tokens en ${calls} llamada${calls === 1 ? '' : 's'}`,
|
|
1796
|
+
whWhatItDid: 'Qué hizo su coordinador',
|
|
1797
|
+
whNoReport: 'No ha dicho qué salió de ello (webhook_result).',
|
|
1798
|
+
whNotYet: 'Su coordinador aún no se ha puesto con ello.',
|
|
1799
|
+
whNoTrace: 'No se vio nada de su turno: puede que tenga la observación apagada.',
|
|
1800
|
+
whTook: s => (s < 90 ? `Su turno: ${s} s` : `Su turno: ${Math.round(s / 60)} min`),
|
|
1801
|
+
whStillOn: 'Sigue con ello',
|
|
1802
|
+
whTools: n => `${n} llamada${n === 1 ? '' : 's'} a herramientas`,
|
|
1803
|
+
whSent: n => `${n} mensaje${n === 1 ? '' : 's'} enviado${n === 1 ? '' : 's'}`,
|
|
1804
|
+
whSentTo: to => `A ${to}:`,
|
|
1805
|
+
whLastWords: 'Lo que dijo al final',
|
|
1806
|
+
whTokens: (n, calls) => `${n} tokens en ${calls} llamada${calls === 1 ? '' : 's'}`,
|
|
1517
1807
|
boardsCount: n => `${n} tablero${n === 1 ? '' : 's'}`,
|
|
1518
1808
|
noBoards: 'Todavía no hay tableros',
|
|
1519
1809
|
noBoardsHint: 'Un tablero guarda las tareas de la empresa. Personas y agentes trabajan en ellas, y cada equipo ve los tableros que se le asignan.',
|
package/ui/icons.js
CHANGED
|
@@ -19,6 +19,8 @@ const PATHS = {
|
|
|
19
19
|
more: '<circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/>',
|
|
20
20
|
sun: '<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>',
|
|
21
21
|
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
|
|
22
|
+
webhook: '<circle cx="12" cy="6" r="2.6"/><circle cx="5.5" cy="17.5" r="2.6"/><circle cx="18.5" cy="17.5" r="2.6"/><path d="M10.7 8.3 6.9 15M8.1 17.5h7.8M13.3 8.3l3.8 6.7"/>',
|
|
23
|
+
usage: '<path d="M4 20h16"/><rect x="5" y="11" width="3" height="6" rx="1"/><rect x="10.5" y="6" width="3" height="11" rx="1"/><rect x="16" y="9" width="3" height="8" rx="1"/>',
|
|
22
24
|
board: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16M15 4v16"/><path d="M5.5 8h1.5M11 8h2M11 11h2M17 8h1.5"/>',
|
|
23
25
|
pr: '<circle cx="6" cy="6" r="2.3"/><circle cx="6" cy="18" r="2.3"/><circle cx="18" cy="18" r="2.3"/><path d="M6 8.3v7.4M18 15.7V10a3 3 0 0 0-3-3h-4"/><path d="m13 4.5-2.5 2.5 2.5 2.5"/>',
|
|
24
26
|
// (What an inbox entry is: a permission, someone to approve, a question, news, done.)
|
package/ui/inbox.js
CHANGED
|
@@ -61,6 +61,9 @@ export function cantAnswer(i) {
|
|
|
61
61
|
return null
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
// The coordinator a worker's permission prompt went to, while it is there.
|
|
65
|
+
const relayedTo = s => s.activity?.relayed_to ?? null
|
|
66
|
+
|
|
64
67
|
// What a session waiting for permission wants to run.
|
|
65
68
|
const permWhat = s => { const a = s.activity ?? {}; return a.tool?.name ? [a.tool.name, a.tool.summary].filter(Boolean).join(' · ') : a.waiting ?? '' }
|
|
66
69
|
|
|
@@ -79,7 +82,8 @@ function entries() {
|
|
|
79
82
|
const tells = open.filter(i => i.kind === 'tell').map(i => ({ key: `i${i.id}`, kind: 'tell', i, at: i.created_at }))
|
|
80
83
|
const newest = (a, b) => b.at - a.at
|
|
81
84
|
return [
|
|
82
|
-
|
|
85
|
+
// (A worker's prompt its coordinator is deciding comes after what the coordinators ask.)
|
|
86
|
+
{ id: 'decide', label: T.ibxDecide, list: [...perms.filter(e => !relayedTo(e.s)).sort(newest), ...asks.sort(newest), ...perms.filter(e => relayedTo(e.s)).sort(newest), ...approvals] },
|
|
83
87
|
{ id: 'know', label: T.inboxTell, list: tells.sort(newest) },
|
|
84
88
|
]
|
|
85
89
|
}
|
|
@@ -168,7 +172,7 @@ function row(e, on, tab = 'pending') {
|
|
|
168
172
|
meta = [who(e.s.name), esc(teamOf(e.s.name))]
|
|
169
173
|
} else if (e.kind === 'perm') {
|
|
170
174
|
dot = 'warn'; title = T.ibxPermTitle(e.s.name, permWhat(e.s))
|
|
171
|
-
meta = [who(e.s.name), esc(teamOf(e.s.name))]
|
|
175
|
+
meta = [who(e.s.name), esc(teamOf(e.s.name)), relayedTo(e.s) ? esc(T.ibxWithCoord(relayedTo(e.s))) : '']
|
|
172
176
|
} else if (e.kind === 'approve') {
|
|
173
177
|
dot = 'warn'; title = T.ibxApproveTitle(e.s.name)
|
|
174
178
|
meta = [who(e.s.name), esc(T.approveNote)]
|
|
@@ -221,8 +225,12 @@ function detail(e) {
|
|
|
221
225
|
const s = e.s
|
|
222
226
|
return `<article class="ibx-card">${head(s.name, T.ibxPermission, e.at, false)}
|
|
223
227
|
<div class="ibx-body"><h2 class="ibx-q">${esc(T.ibxPermTitle(s.name, ''))}</h2><pre class="ibx-perm">${esc(permWhat(s) || status(s).text)}</pre>
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
${relayedTo(s)
|
|
229
|
+
// (With its coordinator: answered there, or asked here; its terminal is only the way around.)
|
|
230
|
+
? `<p class="ibx-note" data-relayed>${esc(T.ibxPermRelayedHint(relayedTo(s)))}</p>
|
|
231
|
+
<div class="ibx-actions"><a class="btn" href="#/s/${encodeURIComponent(s.name)}">${esc(T.ibxOpenSession)}</a></div>`
|
|
232
|
+
: `<p class="ibx-note">${esc(T.ibxPermHint)}</p>
|
|
233
|
+
<div class="ibx-actions"><a class="btn primary ok" href="#/s/${encodeURIComponent(s.name)}">${esc(T.ibxOpenSession)}</a></div>`}</div></article>`
|
|
226
234
|
}
|
|
227
235
|
if (e.kind === 'approve') {
|
|
228
236
|
const s = e.s
|
package/ui/index.html
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
<link rel="stylesheet" href="/ui/screen-teams.css">
|
|
25
25
|
<link rel="stylesheet" href="/ui/screen-org.css">
|
|
26
26
|
<link rel="stylesheet" href="/ui/screen-boards.css">
|
|
27
|
+
<link rel="stylesheet" href="/ui/screen-usage.css">
|
|
28
|
+
<link rel="stylesheet" href="/ui/screen-webhooks.css">
|
|
27
29
|
<link rel="stylesheet" href="/ui/screen-team.css">
|
|
28
30
|
<link rel="stylesheet" href="/ui/screen-session.css">
|
|
29
31
|
<link rel="stylesheet" href="/ui/screen-machines.css">
|
|
@@ -81,6 +83,8 @@
|
|
|
81
83
|
<div id="alerts" hidden></div>
|
|
82
84
|
<div id="teams" hidden></div>
|
|
83
85
|
<div id="boards" hidden></div>
|
|
86
|
+
<div id="usage" hidden></div>
|
|
87
|
+
<div id="webhooks" hidden></div>
|
|
84
88
|
<div id="team" hidden></div>
|
|
85
89
|
<div id="newteam" hidden></div>
|
|
86
90
|
<div id="addmachine" hidden></div>
|
package/ui/nav.js
CHANGED
|
@@ -97,8 +97,10 @@ export function renderNav() {
|
|
|
97
97
|
let html = `<div class="rail-group" role="group" aria-label="${esc(T.mainNav)}">
|
|
98
98
|
<a href="#/"${here(r.view === 'inbox')}>${icon('inbox')}<span class="name">${esc(T.inbox)}</span>${inboxN ? `<span class="badge">${inboxN}</span>` : ''}</a>
|
|
99
99
|
<a href="#/teams"${here(isTeams(r) && !r.squad)}>${icon('teams')}<span class="name">${esc(T.teams)}</span></a>
|
|
100
|
-
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span class="name">${esc(T.boards)}</span>${boardsPending() ? `<span class="rail-count" title="${esc(T.pendingTitle)}">${boardsPending()}</span>` : ''}</a>
|
|
101
100
|
<div class="rail-row"><a href="#/hosts"${here(isMachines(r))}>${icon('machines')}<span class="name">${esc(T.machines)}</span>${machineList.length ? `<span class="rail-count">${esc(T.ofTotal(machinesOn, machineList.length))}</span>` : ''}</a>${can('manager') ? `<button type="button" class="icon-btn" id="addHostBtn" title="${esc(T.addTitle)}" aria-label="${esc(T.addTitle)}">${icon('plus')}</button>` : ''}</div>
|
|
101
|
+
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span class="name">${esc(T.boards)}</span>${boardsPending() ? `<span class="rail-count" title="${esc(T.pendingTitle)}">${boardsPending()}</span>` : ''}</a>
|
|
102
|
+
<a href="#/webhooks"${here(r.view === 'webhooks')}>${icon('webhook')}<span class="name">${esc(T.whTitle)}</span></a>
|
|
103
|
+
<a href="#/usage"${here(r.view === 'usage')}>${icon('usage')}<span class="name">${esc(T.usage)}</span></a>
|
|
102
104
|
</div>`
|
|
103
105
|
|
|
104
106
|
// Names waiting for the user: their ⋯ menu has the button.
|
|
@@ -118,8 +120,8 @@ export function renderNav() {
|
|
|
118
120
|
// the thumb's reach. (There is no sidebar there: all it has is reached from these.)
|
|
119
121
|
setHtml($('tabbar'), `<a href="#/"${here(r.view === 'inbox')}>${icon('inbox')}<span>${esc(T.inbox)}</span>${inboxN ? `<span class="badge">${inboxN}</span>` : ''}</a>
|
|
120
122
|
<a href="#/teams"${here(isTeams(r) || r.view === 'session')}>${icon('teams')}<span>${esc(T.teams)}</span></a>
|
|
121
|
-
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span>${esc(T.boards)}</span></a>
|
|
122
123
|
<a href="#/hosts"${here(isMachines(r))}>${icon('machines')}<span>${esc(T.machines)}</span></a>
|
|
124
|
+
<a href="#/boards"${here(isBoards(r))}>${icon('board')}<span>${esc(T.boards)}</span></a>
|
|
123
125
|
<button type="button" class="rail-item" data-palette>${icon('search')}<span>${esc(T.goToShort)}</span></button>
|
|
124
126
|
<button type="button" class="rail-item" data-settings aria-haspopup="dialog">${icon('settings')}<span>${esc(T.settings)}</span></button>`)
|
|
125
127
|
}
|
package/ui/org.js
CHANGED
|
@@ -109,6 +109,18 @@ function orgLinkPath(p, q) {
|
|
|
109
109
|
const d = Math.max(30, Math.abs(y2 - y1) / 2) * (down ? 1 : -1)
|
|
110
110
|
return { d: `M${pc} ${y1} C${pc} ${y1 + d} ${qc} ${y2 - d} ${qc} ${y2}`, mx: (pc + qc) / 2, my: (y1 + y2) / 2 }
|
|
111
111
|
}
|
|
112
|
+
// A message between two linked coordinators: a light runs along their link,
|
|
113
|
+
// from the one who wrote to the other, and its count pulses.
|
|
114
|
+
const linkFlashes = new Map() // "from>to" -> when
|
|
115
|
+
const LINK_FLASH = 1800
|
|
116
|
+
export function flashLink(from, to) {
|
|
117
|
+
linkFlashes.set(`${from}>${to}`, now())
|
|
118
|
+
if (currentRoute().view !== 'org') return
|
|
119
|
+
soon(renderOrg)
|
|
120
|
+
setTimeout(() => { linkFlashes.delete(`${from}>${to}`); if (currentRoute().view === 'org') soon(renderOrg) }, LINK_FLASH + 100)
|
|
121
|
+
}
|
|
122
|
+
const flashing = (from, to) => now() - (linkFlashes.get(`${from}>${to}`) ?? 0) < LINK_FLASH
|
|
123
|
+
|
|
112
124
|
function orgLinesHtml() {
|
|
113
125
|
let paths = '', labels = ''
|
|
114
126
|
for (const l of state.links) {
|
|
@@ -118,8 +130,9 @@ function orgLinesHtml() {
|
|
|
118
130
|
const n = recentOf(l)
|
|
119
131
|
// (Amber from three quarters of what two coordinators may send each other in an hour.)
|
|
120
132
|
const cls = n >= 60 ? 'full' : n >= 45 ? 'warn' : ''
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
const runs = [[l.a, l.b, p, q], [l.b, l.a, q, p]].filter(([f, t]) => flashing(f, t)).map(([, , from, to]) => `<path class="run" pathLength="100" d="${orgLinkPath(from, to).d}"/>`).join('')
|
|
134
|
+
paths += `<path class="l ${cls}" d="${d}"/>${runs}<path class="hit" d="${d}" data-la="${esc(l.a)}" data-lb="${esc(l.b)}"/>`
|
|
135
|
+
labels += `<button class="org-label ${cls}${runs ? ' got' : ''}" style="left:${Math.round(mx)}px;top:${Math.round(my)}px" data-la="${esc(l.a)}" data-lb="${esc(l.b)}" title="${esc(T.orgLinkRecent(n))}">${n}</button>`
|
|
123
136
|
}
|
|
124
137
|
return { paths, labels }
|
|
125
138
|
}
|
|
@@ -138,11 +151,14 @@ export function noteHandoff(m) {
|
|
|
138
151
|
soon(renderOrg)
|
|
139
152
|
setTimeout(() => { flashes.delete(m.target); if (currentRoute().view === 'org') soon(renderOrg) }, 2200)
|
|
140
153
|
}
|
|
154
|
+
// A plan task's ref as a short tag: the board task or issue it names (SQ-12,
|
|
155
|
+
// #30), or none. A path or a link stays in the tooltip, not on the card.
|
|
156
|
+
const refId = ref => String(ref ?? '').match(/\b[A-Z][A-Z0-9]{0,5}-\d{1,9}\b|#\d{1,9}\b/)?.[0] ?? ''
|
|
141
157
|
function taskOf(s, kind) {
|
|
142
158
|
const coord = kind === 'coord' ? s.name : orgCoordOf(s)
|
|
143
159
|
const plan = coord ? state.plans.get(coord) : null
|
|
144
160
|
const t = plan?.tasks.find(x => x.who === s.name && x.state === 'doing')
|
|
145
|
-
if (t) return { title: t.title, ref: t.ref, since: t.since }
|
|
161
|
+
if (t) return { title: t.title, ref: refId(t.ref), full: t.ref, since: t.since }
|
|
146
162
|
const h = handed.get(s.name)
|
|
147
163
|
if (h) return { title: h.text.replace(/\s+/g, ' '), from: h.from, since: h.at }
|
|
148
164
|
if (kind === 'coord' && plan?.title) return { title: plan.title }
|
|
@@ -174,7 +190,7 @@ function orgAgent(s, kind) {
|
|
|
174
190
|
<span class="oa-who"><span class="oa-nm"><b>${esc(s.name)}</b><span class="oa-st ${st.cls}">${st.cls === 'work' ? '<span class="oa-spin" aria-hidden="true"></span>' : st.cls ? '<span class="oa-pd" aria-hidden="true"></span>' : ''}${esc(st.label)}</span></span>
|
|
175
191
|
${model ? `<span class="oa-model">${esc(model)}</span>` : ''}${kind === 'coord' ? `<span class="oa-lead">${esc(T.roleName.coordinator)}</span>` : ''}</span>
|
|
176
192
|
<button class="org-more" data-orgmenu="agent" data-name="${esc(s.name)}" aria-label="${esc(T.orgAgentMenu(s.name))}" aria-haspopup="menu">${icon('more')}</button></div>
|
|
177
|
-
<div class="oa-task${task ? '' : ' none'}" title="${esc(task?.title
|
|
193
|
+
<div class="oa-task${task ? '' : ' none'}" title="${esc([task?.title, task?.full].filter(Boolean).join(' · '))}">${task?.from ? `<span class="oa-from">↳ ${esc(task.from)}</span>` : ''}${task?.ref ? `<span class="oa-ref">${esc(task.ref)}</span>` : ''}<span class="oa-tt">${esc(task?.title ?? T.orgNoTask)}</span>${clockHtml(task?.since)}</div>
|
|
178
194
|
<div class="oa-now">${esc(status(s).text)}</div>
|
|
179
195
|
${Number.isFinite(pct) ? `<div class="oa-ctx" title="${esc(T.contextPct(Math.round(pct)))}"><span class="oa-bar"><i class="${pct >= 95 ? 'hot' : pct >= 80 ? 'warm' : ''}" style="width:${Math.max(2, Math.min(100, pct))}%"></i></span>${a.context_tokens && window ? `${kTokens(a.context_tokens)} / ${kTokens(window)}` : `${Math.round(pct)}%`}</div>` : ''}
|
|
180
196
|
</div>`
|
package/ui/palette.js
CHANGED
|
@@ -58,6 +58,8 @@ function candidates() {
|
|
|
58
58
|
{ group: 'screens', label: T.viewMosaic, sub: T.allSessions, lead: icon('teams'), go: '#/mosaic' },
|
|
59
59
|
{ group: 'screens', label: T.org, lead: icon('teams'), go: '#/org' },
|
|
60
60
|
{ group: 'screens', label: T.machines, sub: hosts.size ? T.ofTotal([...hosts.values()].filter(h => h.online).length, hosts.size) : '', lead: icon('machines'), go: '#/hosts' },
|
|
61
|
+
{ group: 'screens', label: T.whTitle, sub: T.whSub, lead: icon('webhook'), go: '#/webhooks' },
|
|
62
|
+
{ group: 'screens', label: T.usage, sub: T.usageSub, lead: icon('usage'), go: '#/usage' },
|
|
61
63
|
{ group: 'screens', label: T.settings, lead: icon('settings'), run: async () => (await import('./people.js')).openSettings() },
|
|
62
64
|
)
|
|
63
65
|
if (sortedSessions({ archived: true }).length) items.push({ group: 'screens', label: T.archived, lead: icon('archive'), go: '#/archived' })
|
package/ui/people.js
CHANGED
|
@@ -229,6 +229,7 @@ export function openSettings(start) {
|
|
|
229
229
|
<div class="set-card"><form data-retention class="people-form"><label class="field"><span>${esc(T.retentionDays)}</span><input type="text" inputmode="numeric" name="retention_days" value="${esc(kept.retention_days)}"></label>
|
|
230
230
|
<label class="field"><span>${esc(T.eventHours)}</span><input type="text" inputmode="numeric" name="event_hours" value="${esc(kept.event_hours)}"></label>
|
|
231
231
|
<label class="field"><span>${esc(T.retentionInbox)}</span><input type="text" inputmode="numeric" name="inbox_days" value="${esc(kept.inbox_days ?? 90)}"></label>
|
|
232
|
+
<label class="field"><span>${esc(T.retentionUsage)}</span><input type="text" inputmode="numeric" name="usage_days" value="${esc(kept.usage_days ?? 400)}"></label>
|
|
232
233
|
<button class="btn primary">${esc(T.save)}</button></form><p class="note" data-saved></p></div>
|
|
233
234
|
<h4>${esc(T.exportTitle)}</h4><div class="set-card set-row"><p class="note">${esc(T.exportHint)}</p>
|
|
234
235
|
<a class="btn" href="${esc(inCompany('/api/company/export'))}" download>${esc(T.exportBtn)}</a></div>
|
|
@@ -242,7 +243,7 @@ export function openSettings(start) {
|
|
|
242
243
|
ok()
|
|
243
244
|
const v = Object.fromEntries(new FormData(e.target))
|
|
244
245
|
try {
|
|
245
|
-
await call(inCompany('/api/company/retention/set'), { retention_days: Number(v.retention_days), event_hours: Number(v.event_hours), inbox_days: Number(v.inbox_days) })
|
|
246
|
+
await call(inCompany('/api/company/retention/set'), { retention_days: Number(v.retention_days), event_hours: Number(v.event_hours), inbox_days: Number(v.inbox_days), usage_days: Number(v.usage_days) })
|
|
246
247
|
body.querySelector('[data-saved]').textContent = T.saved
|
|
247
248
|
} catch (err) { fail(err) }
|
|
248
249
|
}
|
package/ui/router.js
CHANGED
|
@@ -10,6 +10,8 @@ import { buildMosaic, renderArchived } from './mosaic.js'
|
|
|
10
10
|
import { renderInbox } from './inbox.js'
|
|
11
11
|
import { renderTeams } from './teams.js'
|
|
12
12
|
import { renderBoards } from './boards.js'
|
|
13
|
+
import { renderUsage } from './usage.js'
|
|
14
|
+
import { renderWebhooks } from './webhooks.js'
|
|
13
15
|
import { renderTeam } from './team.js'
|
|
14
16
|
import { renderSessionAside } from './session.js'
|
|
15
17
|
import { renderNewTeam } from './newteam.js'
|
|
@@ -100,6 +102,8 @@ export function route() {
|
|
|
100
102
|
$('inbox').hidden = r.view !== 'inbox'
|
|
101
103
|
$('teams').hidden = r.view !== 'teams'
|
|
102
104
|
$('boards').hidden = r.view !== 'boards' && r.view !== 'board'
|
|
105
|
+
$('usage').hidden = r.view !== 'usage'
|
|
106
|
+
$('webhooks').hidden = r.view !== 'webhooks'
|
|
103
107
|
$('team').hidden = r.view !== 'team'
|
|
104
108
|
$('newteam').hidden = r.view !== 'newteam'
|
|
105
109
|
$('addmachine').hidden = r.view !== 'addmachine'
|
|
@@ -131,12 +135,12 @@ export function route() {
|
|
|
131
135
|
$('session').hidden = true
|
|
132
136
|
$('mosaic').hidden = false
|
|
133
137
|
buildMosaic()
|
|
134
|
-
} else if (r.view === 'archived' || r.view === 'org' || r.view === 'inbox' || r.view === 'teams' || r.view === 'boards' || r.view === 'board' || r.view === 'team' || r.view === 'newteam' || r.view === 'addmachine') {
|
|
138
|
+
} else if (r.view === 'archived' || r.view === 'org' || r.view === 'inbox' || r.view === 'teams' || r.view === 'boards' || r.view === 'board' || r.view === 'usage' || r.view === 'webhooks' || r.view === 'team' || r.view === 'newteam' || r.view === 'addmachine') {
|
|
135
139
|
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
|
136
140
|
clearMosaic()
|
|
137
141
|
$('session').hidden = true
|
|
138
142
|
$('mosaic').hidden = true
|
|
139
|
-
if (r.view === 'org') renderOrg(); else if (r.view === 'inbox') renderInbox(); else if (r.view === 'teams') renderTeams(); else if (r.view === 'boards' || r.view === 'board') renderBoards(); else if (r.view === 'team') renderTeam(); else if (r.view === 'newteam') renderNewTeam(); else if (r.view === 'addmachine') renderAddMachine(); else renderArchived()
|
|
143
|
+
if (r.view === 'org') renderOrg(); else if (r.view === 'inbox') renderInbox(); else if (r.view === 'teams') renderTeams(); else if (r.view === 'boards' || r.view === 'board') renderBoards(); else if (r.view === 'usage') renderUsage(); else if (r.view === 'webhooks') renderWebhooks(); else if (r.view === 'team') renderTeam(); else if (r.view === 'newteam') renderNewTeam(); else if (r.view === 'addmachine') renderAddMachine(); else renderArchived()
|
|
140
144
|
} else if (st) {
|
|
141
145
|
// The session's live terminal, as in Machines: watch it and type to it.
|
|
142
146
|
if (state.sessionView) { state.sessionView.destroy(); state.sessionView = null; $('session').innerHTML = '' }
|
package/ui/routes.js
CHANGED
|
@@ -19,6 +19,11 @@ export function parseRoute(hash) {
|
|
|
19
19
|
if (hash === '#/teams') return { view: 'teams' }
|
|
20
20
|
// The task boards; one of them, with a task open beside it (or a new one).
|
|
21
21
|
if (hash === '#/boards') return { view: 'boards' }
|
|
22
|
+
if (hash === '#/usage') return { view: 'usage' }
|
|
23
|
+
// What came in through the webhooks: all of them, or one team's.
|
|
24
|
+
if (hash === '#/webhooks') return { view: 'webhooks' }
|
|
25
|
+
const wq = hash.match(/^#\/webhooks\/q\/([^/]+)$/)
|
|
26
|
+
if (wq) return ROUTE_NAME.test(dec(wq[1])) ? { view: 'webhooks', team: dec(wq[1]) } : { view: 'webhooks' }
|
|
22
27
|
const bd = hash.match(/^#\/b\/(\d{1,9})(?:\/(new|[A-Za-z][A-Za-z0-9]{0,5}-\d{1,9}))?$/)
|
|
23
28
|
if (bd) return { view: 'board', board: Number(bd[1]), ...(bd[2] ? { task: bd[2] } : {}) }
|
|
24
29
|
if (hash === '#/new') return { view: 'newteam' }
|
package/ui/screen-org.css
CHANGED
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
.oa-task { display: flex; align-items: baseline; gap: 6px; min-width: 0; color: var(--text); font-weight: 500; }
|
|
88
88
|
.oa-task.none { color: var(--faint); font-weight: 400; }
|
|
89
89
|
.oa-tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
90
|
-
.oa-ref { flex:
|
|
90
|
+
.oa-ref { flex: 0 1 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 5px; border-radius: 5px; background: var(--tray); color: var(--muted); font: 500 11px/18px var(--mono); }
|
|
91
91
|
.oa-from { flex: none; color: var(--muted); font: 500 12px var(--mono); }
|
|
92
92
|
.oa-clock { flex: none; color: var(--muted); font: 500 var(--fs-sm)/1 var(--sans); font-variant-numeric: tabular-nums; }
|
|
93
93
|
.oa-now { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
@@ -101,7 +101,13 @@
|
|
|
101
101
|
.org-extra { border-radius: 18px; border: 1.5px dashed var(--line-2); background: none; padding: 8px; display: flex; flex-direction: column; gap: 8px; width: auto; }
|
|
102
102
|
.org-extra .org-agent { width: 232px; }
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
/* A message between linked teams: a light along their link, and its count pulses. */
|
|
105
|
+
.org-lines .run { fill: none; stroke: var(--coord); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 16 100; animation: org-link-run 1.6s cubic-bezier(.4, 0, .2, 1) both; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--coord) 75%, transparent)); }
|
|
106
|
+
@keyframes org-link-run { from { stroke-dashoffset: 16; } to { stroke-dashoffset: -100; } }
|
|
107
|
+
.org-label.got { animation: org-label-got 1.6s ease-out; }
|
|
108
|
+
@keyframes org-label-got { 25%, 55% { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 6px color-mix(in srgb, var(--coord) 22%, transparent); } }
|
|
109
|
+
|
|
110
|
+
@media (prefers-reduced-motion: reduce) { .oa-wires .run, .org-agent.got, .oa-spin, .org-lines .run, .org-label.got { animation: none; } }
|
|
105
111
|
|
|
106
112
|
@media (max-width: 900px) {
|
|
107
113
|
.org-card { width: auto; }
|