@songsid/agend 2.3.2-beta.5 → 2.3.2-beta.7

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.
Files changed (79) hide show
  1. package/dist/backend/kiro-identity.d.ts +11 -0
  2. package/dist/backend/kiro-identity.js +16 -0
  3. package/dist/backend/kiro-identity.js.map +1 -1
  4. package/dist/backend/kiro-retired-model.d.ts +62 -0
  5. package/dist/backend/kiro-retired-model.js +160 -0
  6. package/dist/backend/kiro-retired-model.js.map +1 -0
  7. package/dist/backend/kiro.d.ts +17 -0
  8. package/dist/backend/kiro.js +77 -1
  9. package/dist/backend/kiro.js.map +1 -1
  10. package/dist/channel/adapters/discord.d.ts +11 -0
  11. package/dist/channel/adapters/discord.js +64 -10
  12. package/dist/channel/adapters/discord.js.map +1 -1
  13. package/dist/config-validator.js +25 -3
  14. package/dist/config-validator.js.map +1 -1
  15. package/dist/daemon.d.ts +2 -0
  16. package/dist/daemon.js +5 -0
  17. package/dist/daemon.js.map +1 -1
  18. package/dist/fleet-manager.d.ts +21 -5
  19. package/dist/fleet-manager.js +154 -133
  20. package/dist/fleet-manager.js.map +1 -1
  21. package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +14 -1
  22. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +14 -1
  23. package/dist/instance-lifecycle.d.ts +2 -0
  24. package/dist/instance-lifecycle.js +23 -8
  25. package/dist/instance-lifecycle.js.map +1 -1
  26. package/dist/locale.js +16 -0
  27. package/dist/locale.js.map +1 -1
  28. package/dist/notice-delivery.d.ts +7 -6
  29. package/dist/notice-delivery.js +16 -18
  30. package/dist/notice-delivery.js.map +1 -1
  31. package/dist/office-share-page.d.ts +13 -0
  32. package/dist/office-share-page.js +82 -0
  33. package/dist/office-share-page.js.map +1 -0
  34. package/dist/office-share-service.d.ts +89 -0
  35. package/dist/office-share-service.js +172 -0
  36. package/dist/office-share-service.js.map +1 -0
  37. package/dist/office-share.d.ts +228 -0
  38. package/dist/office-share.js +489 -0
  39. package/dist/office-share.js.map +1 -0
  40. package/dist/public-web-gateway.js +6 -0
  41. package/dist/public-web-gateway.js.map +1 -1
  42. package/dist/quickstart.js +0 -2
  43. package/dist/quickstart.js.map +1 -1
  44. package/dist/settings-api.js +1 -1
  45. package/dist/settings-api.js.map +1 -1
  46. package/dist/setup-form.d.ts +1 -1
  47. package/dist/setup-form.js +48 -5
  48. package/dist/setup-form.js.map +1 -1
  49. package/dist/setup-host.js +4 -3
  50. package/dist/setup-host.js.map +1 -1
  51. package/dist/setup-wizard.js +0 -2
  52. package/dist/setup-wizard.js.map +1 -1
  53. package/dist/types.d.ts +12 -3
  54. package/dist/ui/fleet-office-pack.js +7 -2
  55. package/dist/ui/fleet-office-skin.js +5 -4
  56. package/dist/ui/fleet-office-zones.js +17 -6
  57. package/dist/ui/fleet-office.js +20 -10
  58. package/dist/ui/office-share-dialog.js +145 -0
  59. package/dist/ui/office-share-page.js +116 -0
  60. package/dist/ui/panel-settings.js +12 -8
  61. package/dist/ui/settings-registry.js +2 -2
  62. package/dist/ui/settings-strings.js +6 -6
  63. package/dist/ui/shared/app.css +28 -0
  64. package/dist/web-api.d.ts +14 -0
  65. package/dist/web-api.js +91 -0
  66. package/dist/web-api.js.map +1 -1
  67. package/dist/web-office-skins.d.ts +2 -1
  68. package/dist/web-office-skins.js +2 -1
  69. package/dist/web-office-skins.js.map +1 -1
  70. package/dist/web-settings-patch.js +1 -1
  71. package/dist/web-settings-patch.js.map +1 -1
  72. package/dist/working-recovery.d.ts +2 -2
  73. package/dist/working-recovery.js +43 -8
  74. package/dist/working-recovery.js.map +1 -1
  75. package/dist/working-state-journal.d.ts +2 -0
  76. package/dist/working-state-journal.js +16 -1
  77. package/dist/working-state-journal.js.map +1 -1
  78. package/package.json +1 -1
  79. package/templates/windows-shortcuts.ps1 +151 -147
package/dist/web-api.js CHANGED
@@ -448,6 +448,95 @@ function handleAppIcon(req, res, url, ctx, method) {
448
448
  });
449
449
  return true;
450
450
  }
451
+ /**
452
+ * #2636: Office share links — GET /ui/office-share (the open ones, and whether this fleet offers them), POST { office,
453
+ * minutes?, text? } (a new one; answers its URL once its tunnel is up, or why not), DELETE /ui/office-share/<id|all>.
454
+ * An admin session only — on the dashboard reached directly, or (the user, #2636 follow-up) a fleet admin signed in over
455
+ * the /web public link: the same check either way. Never the CLI token, a read-only session or a guest. The share's own
456
+ * tunnel and gateway stay apart from /web's. The person is asked again once the body is in.
457
+ */
458
+ function handleOfficeShare(req, res, url, ctx, path, method) {
459
+ const service = ctx.officeShares;
460
+ if (!service) {
461
+ json(res, 404, { error: "Office share links are not kept on this fleet" });
462
+ return true;
463
+ }
464
+ const one = /^\/ui\/office-share\/([0-9a-f]{8}|all)$/.exec(path);
465
+ const known = (method === "GET" && path === "/ui/office-share") || (method === "POST" && path === "/ui/office-share") || (method === "DELETE" && !!one);
466
+ if (!known) {
467
+ json(res, 404, { error: "not found" });
468
+ return true;
469
+ }
470
+ const who = () => {
471
+ const verdict = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
472
+ if (verdict.kind !== "allow")
473
+ return { status: 401 };
474
+ if (verdict.via !== "session" || verdict.session?.tier !== "admin")
475
+ return { status: 403 };
476
+ const owner = verdict.session.owner;
477
+ return { person: owner ? webPersonKey(owner) : "admin-session", name: owner ? ctx.webPerson?.(owner)?.name ?? owner.userId : "admin" };
478
+ };
479
+ const refuse = (status) => json(res, status, { error: status === 401 ? WEB_TOKEN_INVALID_MESSAGE : "office_share_needs_an_admin_session" });
480
+ const first = who();
481
+ if ("status" in first) {
482
+ refuse(first.status);
483
+ return true;
484
+ }
485
+ res.setHeader("Cache-Control", "no-store");
486
+ if (method === "GET") {
487
+ // Each with its office's name as it is now (Settings' card has no office list of its own).
488
+ const names = new Map((ctx.officeStore?.list().offices ?? []).map(o => [o.id, o.name]));
489
+ json(res, 200, { enabled: service.enabled(), shares: service.list().map(s => ({ ...s, ...(names.has(s.office) ? { office_name: names.get(s.office) } : {}) })) });
490
+ return true;
491
+ }
492
+ if (method === "DELETE") {
493
+ const id = one[1];
494
+ const before = id === "all" ? null : service.list().find(s => s.id === id) ?? null;
495
+ const n = service.revoke(id);
496
+ if (n)
497
+ ctx.officeShareNotice?.("revoked", first.name, before, n);
498
+ json(res, n ? 200 : 404, n ? { revoked: n } : { error: "not_found" });
499
+ return true;
500
+ }
501
+ (async () => {
502
+ let body;
503
+ try {
504
+ body = await parseBody(req);
505
+ }
506
+ catch {
507
+ json(res, 400, { error: "Invalid JSON" });
508
+ return;
509
+ }
510
+ if (!permitWebContinuation(req, res, ctx))
511
+ return;
512
+ const now = who();
513
+ if ("status" in now) {
514
+ refuse(now.status);
515
+ return;
516
+ }
517
+ if (!body || typeof body !== "object" || Array.isArray(body) || typeof body.office !== "string"
518
+ || (body.minutes !== undefined && typeof body.minutes !== "number") || (body.text !== undefined && typeof body.text !== "boolean")) {
519
+ json(res, 400, { error: "office (string), minutes? (number), text? (boolean)" });
520
+ return;
521
+ }
522
+ const made = await service.create({ office: body.office, owner: now.person, ...(typeof body.minutes === "number" ? { minutes: body.minutes } : {}),
523
+ ...(typeof body.text === "boolean" ? { text: body.text } : {}) });
524
+ if (!made.ok) {
525
+ const status = made.error === "disabled" ? 404 : made.error === "tunnel" ? 503 : made.error === "too_many" ? 409 : 400;
526
+ json(res, status, { error: made.error, ...(made.reason ? { reason: made.reason } : {}) });
527
+ return;
528
+ }
529
+ ctx.officeShareNotice?.("created", now.name, made.share, 1);
530
+ json(res, 200, { share: made.share, url: made.url });
531
+ })().catch(err => {
532
+ ctx.logger.error({ err: err.message }, "Office share failed");
533
+ try {
534
+ json(res, 500, { error: "Office share failed" });
535
+ }
536
+ catch { /* already answered */ }
537
+ });
538
+ return true;
539
+ }
451
540
  /**
452
541
  * #2513: the Office view's skin packs (web-office-skins.ts). The reads are the offices' (GET /ui/offices): whoever may
453
542
  * open the org chart, the public link too (its manifest lists them; a guest's routes do not): the list, a pack's
@@ -2322,6 +2411,8 @@ export function handleWebRequest(req, res, url, ctx) {
2322
2411
  }
2323
2412
  if (path === "/ui/office-skins" || path.startsWith("/ui/office-skins/"))
2324
2413
  return handleOfficeSkins(req, res, url, ctx, path, method);
2414
+ if (path === "/ui/office-share" || path.startsWith("/ui/office-share/"))
2415
+ return handleOfficeShare(req, res, url, ctx, path, method);
2325
2416
  // ── #1630: avatars and Discord server emoji, same-origin (the page never loads a platform's CDN; img-src stays 'self') ──
2326
2417
  const imageMatch = path.match(/^\/ui\/img\/(bot|avatar|emoji)\/([^/]+)$/);
2327
2418
  if (method === "GET" && imageMatch) {