@songsid/agend 2.4.0-beta.25 → 2.4.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-file-read.js +1 -1
- package/dist/agent-file-read.js.map +1 -1
- package/dist/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/delivery-outbox.js +4 -1
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-lock.d.ts +16 -0
- package/dist/fleet-lock.js +40 -0
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +20 -1
- package/dist/fleet-manager.js +154 -14
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +12 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +3 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +7 -0
- package/dist/hub/client.js +7 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +6 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +3 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.js +3 -2
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/member/room-ask.d.ts +7 -8
- package/dist/hub/member/room-ask.js +52 -13
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-reaction-acks.d.ts +12 -0
- package/dist/hub/member/room-reaction-acks.js +44 -0
- package/dist/hub/member/room-reaction-acks.js.map +1 -0
- package/dist/hub/protocol.d.ts +4 -0
- package/dist/hub/protocol.js +2 -2
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/roles/audit-details.d.ts +2 -0
- package/dist/hub/roles/audit-details.js +1 -1
- package/dist/hub/roles/audit-details.js.map +1 -1
- package/dist/hub/roles/authority.d.ts +8 -3
- package/dist/hub/roles/authority.js +144 -102
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/delegation.js +2 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/model.d.ts +5 -2
- package/dist/hub/roles/model.js +5 -4
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/review.js +2 -2
- package/dist/hub/roles/review.js.map +1 -1
- package/dist/hub/room-react-ack-model.d.ts +2 -0
- package/dist/hub/room-react-ack-model.js +3 -0
- package/dist/hub/room-react-ack-model.js.map +1 -0
- package/dist/hub/rooms/admin.d.ts +6 -0
- package/dist/hub/rooms/admin.js +33 -0
- package/dist/hub/rooms/admin.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +2 -0
- package/dist/hub/rooms/agents.js +44 -3
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +5 -1
- package/dist/hub/rooms/service.js +76 -24
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +2 -0
- package/dist/hub/server.js +6 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +2 -0
- package/dist/locale.js +2 -2
- package/dist/locale.js.map +1 -1
- package/dist/public-web-gateway.js +2 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/recover.cjs +212 -26
- package/dist/request-contact-native.js +4 -0
- package/dist/request-contact-native.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +9 -0
- package/dist/scheduler/scheduler.js +26 -0
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/scheduler.test.js +17 -0
- package/dist/scheduler/scheduler.test.js.map +1 -1
- package/dist/settings-api.js +72 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +13 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +11 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/ui/contact-auth-strings.js +7 -2
- package/dist/ui/contact-permissions.js +10 -2
- package/dist/ui/fleet-office-pack.d.ts +2 -2
- package/dist/ui/fleet-office-pack.js +25 -8
- package/dist/ui/fleet-office-vehicles.js +28 -11
- package/dist/ui/fleet-office-zones.js +2 -2
- package/dist/ui/fleet-office.js +25 -5
- package/dist/ui/hub-admin-rooms-strings.js +6 -2
- package/dist/ui/hub-admin-rooms.js +3 -1
- package/dist/ui/hub-group-search.js +2 -2
- package/dist/ui/hub-notify-keep.js +49 -0
- package/dist/ui/hub-role-view.js +1 -1
- package/dist/ui/hub-roles-strings.js +14 -10
- package/dist/ui/hub-roles.js +1 -1
- package/dist/ui/hub-room-notify.js +2 -1
- package/dist/ui/hub-room-strings.js +3 -3
- package/dist/ui/hub-room-thread.js +9 -4
- package/dist/ui/panel-hub.js +3 -2
- package/dist/ui/panel-needs.js +13 -5
- package/dist/ui/settings-update.js +13 -0
- package/dist/ui/shared/app-install.js +123 -0
- package/dist/ui/shared/app-shell.js +4 -2
- package/dist/ui/shared/app-update.js +16 -2
- package/dist/ui/shared/app.css +43 -0
- package/dist/ui/shared/app.js +3 -0
- package/dist/ui/shared/hub-chat.css +6 -0
- package/dist/ui/shared/ui-confirm.js +4 -3
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/update-card-ui.js +419 -0
- package/dist/update-abandon.d.ts +26 -0
- package/dist/update-abandon.js +111 -0
- package/dist/update-abandon.js.map +1 -0
- package/dist/update-forward.d.ts +5 -19
- package/dist/update-forward.js +19 -75
- package/dist/update-forward.js.map +1 -1
- package/dist/update-goback.d.ts +90 -0
- package/dist/update-goback.js +260 -0
- package/dist/update-goback.js.map +1 -0
- package/dist/update-journal.d.ts +8 -0
- package/dist/update-journal.js +8 -2
- package/dist/update-journal.js.map +1 -1
- package/dist/update-package-restore.d.ts +11 -2
- package/dist/update-package-restore.js +16 -5
- package/dist/update-package-restore.js.map +1 -1
- package/dist/update-quiescence.d.ts +38 -9
- package/dist/update-quiescence.js +50 -10
- package/dist/update-quiescence.js.map +1 -1
- package/dist/update-recovery/recover.js +10 -0
- package/dist/update-recovery/recover.js.map +1 -1
- package/dist/update-recovery/runner.d.ts +4 -0
- package/dist/update-recovery/runner.js +38 -5
- package/dist/update-recovery/runner.js.map +1 -1
- package/dist/update-restore.d.ts +7 -1
- package/dist/update-restore.js +10 -5
- package/dist/update-restore.js.map +1 -1
- package/dist/update-retained.d.ts +28 -1
- package/dist/update-retained.js +28 -3
- package/dist/update-retained.js.map +1 -1
- package/dist/update-settings.d.ts +27 -0
- package/dist/update-settings.js +40 -0
- package/dist/update-settings.js.map +1 -1
- package/dist/update-snapshot-scope.js +1 -0
- package/dist/update-snapshot-scope.js.map +1 -1
- package/dist/web-icons.d.ts +11 -0
- package/dist/web-icons.js +14 -2
- package/dist/web-icons.js.map +1 -1
- package/dist/web-mentions.d.ts +27 -8
- package/dist/web-mentions.js +108 -1
- package/dist/web-mentions.js.map +1 -1
- package/dist/web-office-acts.js +3 -0
- package/dist/web-office-acts.js.map +1 -1
- package/package.json +2 -2
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
// of them comes to the area takes it first, and nobody else does
|
|
32
32
|
// unless "lend" (default false) lends it while they are all
|
|
33
33
|
// elsewhere (a borrower moves off when one comes). A checked
|
|
34
|
-
// seat is { x, y } — plus, reserved, `for` and `lend
|
|
34
|
+
// seat is { x, y } — plus, reserved, `for` and `lend`; (#4503)
|
|
35
|
+
// "standFacing": "up" | "down" | "left" | "right" makes it a
|
|
36
|
+
// standing desk: whoever works there stands facing that way
|
|
35
37
|
// "stateZones": { "working": "desks", "idle": "lounge", "needs": "alert", "default": "lounge" },
|
|
36
38
|
// the org chart's states (fleet-org.js ORG_STATES) → an area; a
|
|
37
39
|
// state it does not name goes to "default", else the first area
|
|
@@ -405,15 +407,20 @@ function owners(v, at, empty = false) {
|
|
|
405
407
|
/**
|
|
406
408
|
* A seat (#2691): [x, y], or { x, y, for, lend } — reserved for `for` (lent to anyone while they are all elsewhere when
|
|
407
409
|
* `lend`). Checked: { x, y }, with `for` and `lend` only when reserved, so a plain seat is what it always was.
|
|
410
|
+
* `standFacing` (#4503): a standing desk — whoever works there stands facing that way (their walk strip's first frame).
|
|
408
411
|
*/
|
|
409
412
|
function seatOf(v, at, rect) {
|
|
410
413
|
let p = null, extra = {};
|
|
411
414
|
if (isObj(v)) {
|
|
412
|
-
keys(v, ["x", "y", "for", "lend"], at);
|
|
415
|
+
keys(v, ["x", "y", "for", "lend", "standFacing"], at);
|
|
413
416
|
p = { x: num(v.x, 0, C.w, `${at}.x`), y: num(v.y, 0, C.h, `${at}.y`) };
|
|
414
417
|
if (v.lend !== undefined && typeof v.lend !== "boolean") throw new Refused(`${at}.lend`, "true or false");
|
|
415
418
|
if (v.lend !== undefined && v.for === undefined) throw new Refused(`${at}.lend`, "only with for");
|
|
416
419
|
if (v.for !== undefined) extra = { for: owners(v.for, `${at}.for`), lend: v.lend === true };
|
|
420
|
+
if (v.standFacing !== undefined) {
|
|
421
|
+
if (!HEADINGS.includes(v.standFacing)) throw new Refused(`${at}.standFacing`, "up, down, left or right");
|
|
422
|
+
extra.standFacing = v.standFacing;
|
|
423
|
+
}
|
|
417
424
|
} else p = point(v, at);
|
|
418
425
|
if (p.x < rect.x || p.x > rect.x + rect.w || p.y < rect.y || p.y > rect.y + rect.h) throw new Refused(at, "outside its area's rect");
|
|
419
426
|
return { ...p, ...extra };
|
|
@@ -700,13 +707,16 @@ function snackLabelOf(v, at) {
|
|
|
700
707
|
* heading right (`dx` along the car, `dy` across it; fleet-office-vehicles.js seatAt places them for each heading).
|
|
701
708
|
* `sprite` (its picture heading right; mirrored going left), or `sprites` by heading (`right`, `left`, `up`, `down`),
|
|
702
709
|
* each a strip; `fronts` the same by heading, drawn over the riders (the car's front edge hiding their lower half). Who
|
|
703
|
-
* rides is the agents' own choice (office_set `ride`),
|
|
710
|
+
* rides is the agents' own choice (office_set `ride`), with one exception (#4503): a seat's `worker` (an instance's
|
|
711
|
+
* name, on one vehicle seat of the pack at most) is where that instance works — it rides there while working, and
|
|
712
|
+
* nobody else takes the seat. A stop's `queue` (at most a point a seat): where seat i's worker waits off the platform;
|
|
713
|
+
* they step onto it once the train is in.
|
|
704
714
|
*/
|
|
705
715
|
export const VEHICLE_LIMITS = { vehicles: 4, path: 64, stops: 8, seats: 16, minSpeed: 5, maxSpeed: 600, defaultSpeed: 80, maxSeconds: 600, defaultSeconds: 8, offset: 2000 };
|
|
706
716
|
const HEADINGS = ["right", "left", "up", "down"];
|
|
707
717
|
function vehiclesOf(v, scale) {
|
|
708
718
|
if (v === undefined) return [];
|
|
709
|
-
const seen = new Set();
|
|
719
|
+
const seen = new Set(), workers = new Set(); // a worker has one seat in the whole pack
|
|
710
720
|
return list(v, VEHICLE_LIMITS.vehicles, "vehicles").map((x, i) => {
|
|
711
721
|
const at = `vehicles[${i}]`;
|
|
712
722
|
obj(x, at); keys(x, ["id", "label", "sprite", "sprites", "fronts", "path", "speed", "stops", "seats"], at);
|
|
@@ -733,18 +743,25 @@ function vehiclesOf(v, scale) {
|
|
|
733
743
|
const taken = new Set();
|
|
734
744
|
const stops = list(x.stops ?? [], VEHICLE_LIMITS.stops, `${at}.stops`).map((s, j) => {
|
|
735
745
|
const here = `${at}.stops[${j}]`;
|
|
736
|
-
obj(s, here); keys(s, ["at", "seconds", "platform"], here);
|
|
746
|
+
obj(s, here); keys(s, ["at", "seconds", "platform", "queue"], here);
|
|
737
747
|
const k = int(s.at, 0, path.length - 1, `${here}.at`);
|
|
738
748
|
if (taken.has(k)) throw new Refused(`${here}.at`, "a path point no other stop has");
|
|
739
749
|
taken.add(k);
|
|
740
|
-
|
|
750
|
+
const queue = s.queue === undefined ? null : list(s.queue, VEHICLE_LIMITS.seats, `${here}.queue`).map((p, q) => point(p, `${here}.queue[${q}]`));
|
|
751
|
+
return { at: k, seconds: s.seconds === undefined ? VEHICLE_LIMITS.defaultSeconds : num(s.seconds, 1, VEHICLE_LIMITS.maxSeconds, `${here}.seconds`), platform: point(s.platform, `${here}.platform`),
|
|
752
|
+
...(queue && queue.length ? { queue } : {}) };
|
|
741
753
|
});
|
|
742
754
|
const seats = list(x.seats ?? [], VEHICLE_LIMITS.seats, `${at}.seats`).map((s, j) => {
|
|
743
755
|
const here = `${at}.seats[${j}]`;
|
|
744
|
-
obj(s, here); keys(s, ["dx", "dy"], here);
|
|
745
|
-
|
|
756
|
+
obj(s, here); keys(s, ["dx", "dy", "worker"], here);
|
|
757
|
+
const worker = s.worker === undefined ? null : names(s.worker, `${here}.worker`, 1)[0];
|
|
758
|
+
if (worker !== null && (Array.isArray(s.worker) || workers.has(worker))) throw new Refused(`${here}.worker`, "an instance's name no other vehicle seat has");
|
|
759
|
+
if (worker !== null) workers.add(worker);
|
|
760
|
+
return { dx: num(s.dx ?? 0, -VEHICLE_LIMITS.offset, VEHICLE_LIMITS.offset, `${here}.dx`), dy: num(s.dy ?? 0, -VEHICLE_LIMITS.offset, VEHICLE_LIMITS.offset, `${here}.dy`),
|
|
761
|
+
...(worker !== null ? { worker } : {}) };
|
|
746
762
|
});
|
|
747
763
|
if (seats.length && !stops.length) throw new Refused(`${at}.stops`, "at least one stop, for its seats to be boarded");
|
|
764
|
+
stops.forEach((s, j) => { if (s.queue && s.queue.length > seats.length) throw new Refused(`${at}.stops[${j}].queue`, `at most one point a seat (${seats.length})`); });
|
|
748
765
|
return { id: x.id, ...(x.label !== undefined ? { label: x.label.trim() } : {}), sprite: x.sprite === undefined ? null : checkStrip(x.sprite, `${at}.sprite`, scale),
|
|
749
766
|
...(sprites ? { sprites } : {}), ...(fronts && Object.keys(fronts).length ? { fronts } : {}), path, speed, stops, seats };
|
|
750
767
|
});
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
// wall clock alone, so every page shows it in the same place: it runs round its path at its speed and waits at each
|
|
3
3
|
// stop. People ride by their own choice (an agent's office_set `ride`): they walk to the platform, wait for the train
|
|
4
4
|
// to stop there, board, and ride in a seat (working there, moving with it); they get off only when it stops at a
|
|
5
|
-
// platform, then walk on.
|
|
5
|
+
// platform, then walk on. A pack may give an agent a seat as its workplace (#4503: a seat's `worker`): it rides there
|
|
6
|
+
// while working, and waits for the train at its seat's `queue` point. Pure — fleet-office.js draws the vehicles and
|
|
7
|
+
// moves the riders (the walkers' `ride`).
|
|
8
|
+
|
|
9
|
+
import { WALK, WANDER } from "./fleet-office-zones.js";
|
|
6
10
|
|
|
7
11
|
const LEGS = new WeakMap();
|
|
8
12
|
/** A vehicle's timetable: each leg (a path segment, then its stop's wait), in ms, and the whole lap. */
|
|
@@ -68,7 +72,7 @@ export const lapMs = (v) => legsOf(v).lap;
|
|
|
68
72
|
* `homeOf(name)`: their seat (to pick the nearest platform); `sinceOf(name)`: when their ride began (wall clock), so
|
|
69
73
|
* a page opened long after shows them on board, not walking to a train they took long ago; `urgent(name)`: they
|
|
70
74
|
* must get off now (a call: #4415, nothing keeps a caller from the Help desk), where their seat is, between stops too.
|
|
71
|
-
* Returns { targets: name → where to walk now (the platform), board: [{ name, vehicle, seat }], alight: [{ name, at }] };
|
|
75
|
+
* Returns { targets: name → where to walk now (the platform, or their queue point), board: [{ name, vehicle, seat }], alight: [{ name, at }] };
|
|
72
76
|
* `riding(name)` → { vehicle, seat } while on board; `clear()` forgets everyone and returns who was on board.
|
|
73
77
|
*/
|
|
74
78
|
export function createRiders() {
|
|
@@ -96,27 +100,38 @@ export function createRiders() {
|
|
|
96
100
|
continue; // off only at a stop
|
|
97
101
|
}
|
|
98
102
|
if (!v || !v.seats.length || !v.stops.length) { if (r) by.delete(name); continue; }
|
|
103
|
+
// #4503: a seat with a `worker` is theirs alone; they take no other, and everyone else takes only the others.
|
|
104
|
+
const own = v.seats.findIndex((s) => s.worker === name);
|
|
105
|
+
const freeSeat = () => { const taken = used(vid); return own >= 0 ? (taken.has(own) ? -1 : own) : v.seats.findIndex((s, i) => !s.worker && !taken.has(i)); };
|
|
99
106
|
// A page opened long after the ride began (more than a lap and the walk ago, `since`): they are on board already.
|
|
100
107
|
const since = sinceOf ? sinceOf(name) : null;
|
|
101
108
|
if (!r && since !== null && wall - since > lapMs(v) + RIDE.SETTLE_MS) {
|
|
102
|
-
const
|
|
109
|
+
const seat = freeSeat();
|
|
103
110
|
if (seat >= 0) { by.set(name, { phase: "riding", vehicle: vid, seat }); board.push({ name, vehicle: vid, seat }); continue; }
|
|
104
111
|
}
|
|
105
112
|
if (!r || r.vehicle !== vid) {
|
|
106
113
|
const home = homeOf(name) || posOf(name) || v.stops[0].platform;
|
|
107
114
|
let best = 0;
|
|
108
115
|
v.stops.forEach((s, i) => { if (Math.hypot(s.platform.x - home.x, s.platform.y - home.y) < Math.hypot(v.stops[best].platform.x - home.x, v.stops[best].platform.y - home.y)) best = i; });
|
|
109
|
-
r = { phase: "going", vehicle: vid, stop: best };
|
|
116
|
+
r = { phase: "going", vehicle: vid, stop: best, track: v.path[v.stops[best].at] };
|
|
110
117
|
by.set(name, r);
|
|
111
118
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (r.phase
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
+
// A worker waits at their seat's queue point (#4503), and steps onto the platform ("stepping") once the train is in.
|
|
120
|
+
const stop = v.stops[r.stop], platform = stop.platform, wait = (stop.queue && stop.queue[own]) || platform, here = posOf(name);
|
|
121
|
+
const at = vehicleAt(v, wall), open = at.stop === r.stop && at.left >= RIDE.BOARD_MS;
|
|
122
|
+
if (r.phase === "stepping" && !open) r.phase = "going"; // it left before they got there: back in line
|
|
123
|
+
targets.set(name, r.phase === "stepping" ? platform : wait);
|
|
124
|
+
if (r.phase === "going" && here && !here.walking && near(here, wait)) r.phase = "waiting";
|
|
125
|
+
if (r.phase !== "waiting" && r.phase !== "stepping") continue;
|
|
126
|
+
if (!open) continue; // the train is not in (or is leaving)
|
|
127
|
+
const seat = freeSeat();
|
|
119
128
|
if (seat < 0) continue; // full: wait for the next one
|
|
129
|
+
if (!near(here, platform)) {
|
|
130
|
+
// Off the platform: step on only with the time to get there (the walk, then up to a tick till it is seen), else wait.
|
|
131
|
+
if (r.phase === "waiting" && at.left < Math.hypot(wait.x - platform.x, wait.y - platform.y) / WALK.SPEED + WANDER.TICK + RIDE.BOARD_MS) continue;
|
|
132
|
+
r.phase = "stepping"; targets.set(name, platform);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
120
135
|
r.phase = "riding"; r.seat = seat;
|
|
121
136
|
targets.delete(name);
|
|
122
137
|
board.push({ name, vehicle: vid, seat });
|
|
@@ -124,6 +139,8 @@ export function createRiders() {
|
|
|
124
139
|
return { targets, board, alight };
|
|
125
140
|
},
|
|
126
141
|
riding(name) { const r = by.get(name); return r && r.phase === "riding" ? { vehicle: r.vehicle, seat: r.seat } : null; },
|
|
142
|
+
/** #4503: where the train they wait for (or walk to) stops, or null. */
|
|
143
|
+
waitingFor(name) { const r = by.get(name); return r && r.phase !== "riding" ? r.track : null; },
|
|
127
144
|
phase(name) { const r = by.get(name); return r ? r.phase : null; },
|
|
128
145
|
clear() { const on = [...by].filter(([, r]) => r.phase === "riding").map(([n]) => n); by.clear(); return on; },
|
|
129
146
|
};
|
|
@@ -83,7 +83,7 @@ export function assignSeats(pack, wants, prev = new Map(), seatPrefs = null) {
|
|
|
83
83
|
};
|
|
84
84
|
const pos = (area, slot) => (slot >= 0 ? areaOf(area).seats[slot] : spotsOf(area)[-slot - 1]);
|
|
85
85
|
const usedIn = (area) => { if (!taken.has(area)) taken.set(area, new Set()); return taken.get(area); };
|
|
86
|
-
const give = (name, area, slot) => { const p = pos(area, slot); usedIn(area).add(slot); seats.set(name, { area, slot, x: p.x, y: p.y }); };
|
|
86
|
+
const give = (name, area, slot) => { const p = pos(area, slot); usedIn(area).add(slot); seats.set(name, { area, slot, x: p.x, y: p.y, ...(p.standFacing ? { standFacing: p.standFacing } : {}) }); };
|
|
87
87
|
const free = (w) => !seats.has(w.name) && !!areaOf(w.area);
|
|
88
88
|
// Owners first: their own seat from last time (or saved seat pref), then their first free one.
|
|
89
89
|
for (const w of wants) {
|
|
@@ -152,7 +152,7 @@ export function zonesLayout(pack, nodes, prev = new Map(), { night = false, seat
|
|
|
152
152
|
const { seats, crowd, over } = placed;
|
|
153
153
|
const desks = nodes.filter((n) => seats.has(n.name)).map((n) => {
|
|
154
154
|
const s = seats.get(n.name);
|
|
155
|
-
return { key: `zone/${n.name}`, node: n, x: s.x - 24, y: s.y - 52, w: 48, h: 66, seat: { x: s.x, y: s.y }, wp: null, area: s.area, slot: s.slot, night: sleepers.has(n.name) };
|
|
155
|
+
return { key: `zone/${n.name}`, node: n, x: s.x - 24, y: s.y - 52, w: 48, h: 66, seat: { x: s.x, y: s.y, ...(s.standFacing ? { standFacing: s.standFacing } : {}) }, wp: null, area: s.area, slot: s.slot, night: sleepers.has(n.name) };
|
|
156
156
|
});
|
|
157
157
|
const cv = canvasOf(pack);
|
|
158
158
|
return { mode: "zones", rooms: [{ key: "\u0000zones", name: null, lobby: false, x: 0, y: 0, w: cv.w, h: cv.h, desks }], areas: pack.areas,
|
package/dist/ui/fleet-office.js
CHANGED
|
@@ -299,6 +299,8 @@ const AIR_FPS = 30;
|
|
|
299
299
|
const STYLES = BUILT_IN_SKINS;
|
|
300
300
|
/** Paused and stopped: left out when "Hide paused and stopped" is on. */
|
|
301
301
|
const ASLEEP = new Set(["paused", "stopped"]);
|
|
302
|
+
/** A seat's standFacing (#4503) as a walk heading. */
|
|
303
|
+
const STAND_FACING = { up: { dx: 0, dy: -1 }, down: { dx: 0, dy: 1 }, left: { dx: -1, dy: 0 }, right: { dx: 1, dy: 0 } };
|
|
302
304
|
const BUBBLE_STATES = ["working", "idle", "paused", "stopped", "needs", "crashed", "stuck"];
|
|
303
305
|
/** The page's own bubble lines, by state, in its language (short, never message content). */
|
|
304
306
|
export const bubbleDefaults = () => Object.fromEntries(BUBBLE_STATES.map((s) => [s, to(`b_${s}`).split("|")]));
|
|
@@ -498,6 +500,13 @@ export function actLive(a, state, at = Date.now(), seen = null) {
|
|
|
498
500
|
* (#4415: nothing keeps a caller from the Help desk; the ride resumes when the call is over). Working or a new turn do
|
|
499
501
|
* not end it (it is where they choose to be); clearing it, a new office_set or its end do.
|
|
500
502
|
*/
|
|
503
|
+
/**
|
|
504
|
+
* #4503: the vehicle whose seat names `name` as its `worker`, while they are working (any other state, a call above
|
|
505
|
+
* all, is null: they go where that state sends them, the Help desk for a call, as anyone does); else null. Here, not in
|
|
506
|
+
* fleet-office-vehicles.js: a tab opened before an upgrade may keep that module, and a named import it lacks would stop
|
|
507
|
+
* this one linking (#4505 review). The riders' `waitingFor` is optional for the same reason (`p.waitingFor ?`).
|
|
508
|
+
*/
|
|
509
|
+
export const workVehicleOf = (vehicles, name, state) => (state === "working" ? (vehicles.find((v) => v.seats.some((s) => s.worker === name)) || {}).id ?? null : null);
|
|
501
510
|
/**
|
|
502
511
|
* #4504: what the card's pose preview offers — every pose a character set may draw, walking by direction. Here, not in
|
|
503
512
|
* fleet-office-pack.js: a tab opened before an upgrade may keep that module, and a named import it lacks would stop this
|
|
@@ -715,14 +724,21 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
715
724
|
// A pat shows the set's `pat` strip for one full pass of it (pat.until), each pat from frame 0; a set without one keeps its pose.
|
|
716
725
|
const canPat = !q.at.walking && !canEat && ms > 0 && !!p.reacts && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
|
|
717
726
|
const patted = canPat ? patLook(posed, p.reacts.get(q.look.name), t) : null;
|
|
727
|
+
// #4503: working but not typing — at a standing desk (its seat's standFacing), or waiting for their train (facing
|
|
728
|
+
// where it stops) — they stand: their walk strip's first frame, that way.
|
|
729
|
+
const track = !q.at.walking && !q.at.riding && posed.pose === "working" && p.waitingFor ? p.waitingFor(q.look.name) : null;
|
|
730
|
+
const stand = q.at.walking || q.at.riding || posed.pose !== "working" ? null
|
|
731
|
+
: track ? (track.x !== q.at.x || track.y !== q.at.y ? { dx: track.x - q.at.x, dy: track.y - q.at.y } : null)
|
|
732
|
+
: q.d.seat && q.d.seat.standFacing && q.at.x === q.d.seat.x && q.at.y === q.d.seat.y ? STAND_FACING[q.d.seat.standFacing] : null;
|
|
718
733
|
const look0 = q.at.walking ? { ...q.look, pose: "walk", heading: q.at.heading }
|
|
719
734
|
: canEat ? { ...posed, pose: "eat", basePose: posed.pose }
|
|
720
|
-
: patted || posed;
|
|
735
|
+
: patted || (stand ? { ...posed, pose: "walk", heading: stand } : posed);
|
|
721
736
|
// #4504: the card's pose preview (this viewer's own): the picked pose in place, from its first frame (`clip`:
|
|
722
737
|
// Replay starts it again). Never over a call: a caller shows that they call, preview or not.
|
|
723
738
|
const pv = p.preview && p.preview.current;
|
|
724
|
-
const
|
|
725
|
-
|
|
739
|
+
const previewing = pv && pv.name === q.look.name && !q.at.walking && !CALLING.has(q.look.state);
|
|
740
|
+
const look = previewing ? { ...previewLook(posed, pv.pose), clip: `#${pv.t0}` } : look0;
|
|
741
|
+
drawPerson(ctx, sk, box, look, !previewing && stand && look.pose === "walk" ? 0 : ms, env, q.at.x + 20, q.at.y - 34, readScale);
|
|
726
742
|
if (canEat && eating.snackId && p.snacksById && sk.drawSnack) {
|
|
727
743
|
const sdef = p.snacksById.get(eating.snackId);
|
|
728
744
|
if (sdef && sdef.eat) sk.drawSnack(ctx, sdef.eat, Math.max(0, t - eating.t0), q.at.x, q.at.y, env);
|
|
@@ -1631,7 +1647,11 @@ export function Office({ view: given, traffic, q = "", lease, onOpen, assetUrl,
|
|
|
1631
1647
|
if (fresh) riders.clear();
|
|
1632
1648
|
if (vehicles.length) {
|
|
1633
1649
|
const byId = new Map(vehicles.map((v) => [v.id, v])), wall = Date.now(), here = desksOf(L);
|
|
1634
|
-
|
|
1650
|
+
// An act's ride first; else (no other act going) a worker's seat on a vehicle while working (#4503).
|
|
1651
|
+
const wants = new Map(here.map((d) => {
|
|
1652
|
+
const { name, state } = d.node, a = actsHere.get(name);
|
|
1653
|
+
return [name, d.night ? null : rideLive(a, state, wall) ? a.ride : actLive(a, state, wall, actSeen.current) ? null : workVehicleOf(vehicles, name, state)];
|
|
1654
|
+
}));
|
|
1635
1655
|
const r = riders.step({ wants, vehicles: byId, wall, posOf: (n) => walkers.at(n, t), homeOf: (n) => (here.find((d) => d.node.name === n) || {}).seat || null,
|
|
1636
1656
|
sinceOf: (n) => { const a = actsHere.get(n); return a && a.ride && typeof a.since === "number" ? a.since : null; },
|
|
1637
1657
|
urgent: (n) => { const d = here.find((x) => x.node.name === n); return !!d && CALLING.has(d.node.state); } });
|
|
@@ -1986,7 +2006,7 @@ export function Office({ view: given, traffic, q = "", lease, onOpen, assetUrl,
|
|
|
1986
2006
|
const parts = tiles.map((tl, i) => ({ ...partOf(tl.L, tileLooks[i], tl.skin, tl.zones, tl.walkers, tl.flights), night, key: tl.key, prefix: tl.prefix, tile: arranged.tiles[i], ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(tl.skin) }));
|
|
1987
2007
|
scene.current = { ...base, overview: true, parts, lay: arranged };
|
|
1988
2008
|
} else {
|
|
1989
|
-
scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin), reacts: reacts.current, preview, riding: riders.riding,
|
|
2009
|
+
scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin), reacts: reacts.current, preview, riding: riders.riding, waitingFor: riders.waitingFor,
|
|
1990
2010
|
hold: play ? hold : null, seatDrop: seatDropRef,
|
|
1991
2011
|
snacks: play ? snacks : null, snacksById, ownArea, snackDrop: snackDropRef, onSnackClaim, onSnacksChanged: () => walkNow.current?.() } };
|
|
1992
2012
|
}
|
|
@@ -5,7 +5,9 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
5
5
|
|
|
6
6
|
register("hubAdminRooms", {
|
|
7
7
|
en: {
|
|
8
|
-
adminOnly: "
|
|
8
|
+
adminOnly: "No one else is on this list yet.",
|
|
9
|
+
roleCreators: "The Hub's first administrator and people with an active Create rooms role permission can also create rooms. Manage role grants in Roles.",
|
|
10
|
+
independentGrants: "Removing someone from this list does not remove their role grant, and removing a role grant does not remove them from this list.",
|
|
9
11
|
colPeople: "People", colAgents: "Agents", colLast: "Last activity", colState: "Status",
|
|
10
12
|
none: "No rooms yet.",
|
|
11
13
|
rowMenu: "More for {0}",
|
|
@@ -15,7 +17,9 @@ register("hubAdminRooms", {
|
|
|
15
17
|
joined: "You are a room manager of “{0}” now. A line in the room says so.",
|
|
16
18
|
},
|
|
17
19
|
"zh-TW": {
|
|
18
|
-
adminOnly: "
|
|
20
|
+
adminOnly: "名單上還沒有其他人。",
|
|
21
|
+
roleCreators: "Hub 的第一位管理員與目前角色授予「開房間」權限的人,也可以開房間。角色權限請至「角色」管理。",
|
|
22
|
+
independentGrants: "從這份名單移除某人,不會移除他的角色授權;移除角色授權,也不會將他從這份名單移除。",
|
|
19
23
|
colPeople: "人數", colAgents: "Agent 數", colLast: "最後活動", colState: "狀態",
|
|
20
24
|
none: "還沒有房間。",
|
|
21
25
|
rowMenu: "{0} 的更多動作",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Hub rooms, Administration → Rooms (docs/design/hub-rooms-ux.md section 11), for the Hub administrator:
|
|
2
|
-
// - 「誰可以開房間」: people and teams who may start rooms besides the administrators (
|
|
2
|
+
// - 「誰可以開房間」: people and teams who may start rooms besides the administrators (roles are an independent grant);
|
|
3
3
|
// saved as soon as it changes; everyone can always start a one-to-one chat.
|
|
4
4
|
// - 「所有房間」: every group room's name, people, agents, managers, last activity and status, never its content. Each
|
|
5
5
|
// row's menu: 加入自己成為房間管理 (the room then shows a line saying so) and 封存 (after a confirmation).
|
|
@@ -54,9 +54,11 @@ export function AdminRooms({ client = hubClient() } = {}) {
|
|
|
54
54
|
${error ? html`<p class="note" role="alert">${error}</p>` : null}
|
|
55
55
|
${note ? html`<p class="note" role="status">${note}</p>` : null}
|
|
56
56
|
<section class="form hub-admin-creators"><h3>${hroom("whoCanCreate")}</h3>
|
|
57
|
+
<p class="note">${ha("roleCreators")}</p>
|
|
57
58
|
<${RoomPicker} client=${client} id="hubRoomCreators" kinds=${["person", "team"]} label=${hroom("addPeopleOrTeams")} placeholder=${hroom("addPeopleOrTeams")}
|
|
58
59
|
picked=${creators} onChange=${(next) => { if (!busy) void saveCreators(next); }} />
|
|
59
60
|
${creators.length ? null : html`<p class="note">${ha("adminOnly")}</p>`}
|
|
61
|
+
<p class="note">${ha("independentGrants")}</p>
|
|
60
62
|
<p class="note">${hroom("everyoneDirect")}</p>
|
|
61
63
|
</section>
|
|
62
64
|
<section class="hub-admin-all-rooms"><h3>${hroom("allRooms")}</h3>
|
|
@@ -15,13 +15,13 @@ export const groupSearchV1 = true;
|
|
|
15
15
|
export const groupSearchIdV1 = true;
|
|
16
16
|
register("hubGroupSearch", {
|
|
17
17
|
en: {
|
|
18
|
-
label: "Find
|
|
18
|
+
label: "Find an AD group", placeholder: "Start of the AD group's name, e.g. eng", hint: "Type at least 2 characters.",
|
|
19
19
|
searching: "Searching…", none: "No group starts with “{0}”.", more: "More groups match. Type more of the name.",
|
|
20
20
|
limited: "Too many searches. Try again in {0} seconds.", unknown: "The directory could not be searched just now. Try again, or add the group by its distinguished name.",
|
|
21
21
|
invalid: "Use 2 to 64 characters.", add: "Add {0}", addShort: "Add", added: "Added",
|
|
22
22
|
},
|
|
23
23
|
"zh-TW": {
|
|
24
|
-
label: "
|
|
24
|
+
label: "尋找 AD 群組", placeholder: "AD 群組名稱的開頭,例如 eng", hint: "請至少輸入 2 個字。",
|
|
25
25
|
searching: "搜尋中…", none: "沒有以「{0}」開頭的群組。", more: "還有更多群組符合。請多輸入幾個字。",
|
|
26
26
|
limited: "搜尋太多次了。請 {0} 秒後再試。", unknown: "目前無法搜尋目錄。請再試一次,或用辨別名稱新增群組。",
|
|
27
27
|
invalid: "請輸入 2 到 64 個字。", add: "新增 {0}", addShort: "新增", added: "已新增",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// S-257 step 1 (M-3828): turn Hub notifications on, and the first time they go on on this device, say what keeps them
|
|
2
|
+
// coming once every Hub window is closed — the installed app left running, or started at sign-in (S-255).
|
|
3
|
+
// Its own module and its own strings (Prism #4548): a tab that still holds an older hub-room-notify.js or
|
|
4
|
+
// hub-room-strings.js (cached by URL) loads this new file fresh, so nothing here depends on what those files export.
|
|
5
|
+
import { setNotify } from "/assets/app-needs.js";
|
|
6
|
+
import { installStore } from "/assets/app-install.js";
|
|
7
|
+
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
8
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
9
|
+
|
|
10
|
+
register("hubkeep", {
|
|
11
|
+
en: {
|
|
12
|
+
title: "Keep notifications coming",
|
|
13
|
+
tab: "Notifications arrive while a Hub tab is open, even in the background; closing every Hub tab stops them. To keep them coming, install the Hub as an app (the button beside the bell) and leave it running, minimized is fine. In Edge or Chrome, the app's settings also offer \"Start app when you sign in\".",
|
|
14
|
+
app: "Notifications arrive while this app is open, even minimized; quitting it stops them. Leave it running. In Edge or Chrome, the app's settings offer \"Start app when you sign in\", so it is there after a restart.",
|
|
15
|
+
noInstall: "Notifications arrive while a Hub tab is open, even in the background; closing every Hub tab stops them. Keep a Hub tab open. This Hub can't be installed as an app yet: its address doesn't have a certificate this browser trusts yet (the button beside the bell says more).",
|
|
16
|
+
ok: "OK",
|
|
17
|
+
},
|
|
18
|
+
"zh-TW": {
|
|
19
|
+
title: "持續收到通知",
|
|
20
|
+
tab: "Hub 分頁開著時(在背景也可以)會收到通知;關掉所有 Hub 分頁後就不會再通知。想一直收到,可以把 Hub 安裝成應用程式(鈴鐺旁的按鈕)並讓它保持開著,縮到最小也可以。在 Edge 或 Chrome 的應用程式設定中,也可以開啟「登入時啟動應用程式」。",
|
|
21
|
+
app: "這個應用程式開著時(縮到最小也可以)會收到通知;把它關掉就不會再通知。請讓它保持開著。在 Edge 或 Chrome 的應用程式設定中,可以開啟「登入時啟動應用程式」,重新開機後也會自動開啟。",
|
|
22
|
+
noInstall: "Hub 分頁開著時(在背景也可以)會收到通知;關掉所有 Hub 分頁後就不會再通知。請讓一個 Hub 分頁保持開著。這個 Hub 目前還不能安裝成應用程式:它的網址還沒有這個瀏覽器信任的憑證(鈴鐺旁的按鈕有說明)。",
|
|
23
|
+
ok: "知道了",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const tk = (k) => t(`hubkeep.${k}`);
|
|
27
|
+
|
|
28
|
+
const KEEP_HINT_KEY = "agend_hub_notify_kept";
|
|
29
|
+
/** Shown on this page already (when the browser's storage refuses, it is still shown once per page). */
|
|
30
|
+
let shownHere = false;
|
|
31
|
+
/** Tests only (a new page starts with nothing shown); nothing in the app calls it. */
|
|
32
|
+
export function forgetKeepHint() { shownHere = false; }
|
|
33
|
+
function firstTime() {
|
|
34
|
+
if (shownHere) return false;
|
|
35
|
+
shownHere = true;
|
|
36
|
+
try { if (localStorage.getItem(KEEP_HINT_KEY) === "1") return false; localStorage.setItem(KEEP_HINT_KEY, "1"); } catch { /* this page only */ }
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Notify on or off (app-needs.js setNotify); the first "on" on this device also says how to keep notifications coming. */
|
|
41
|
+
export async function setHubNotify(on) {
|
|
42
|
+
const state = await setNotify(on);
|
|
43
|
+
if (!on || state !== "on" || !firstTime()) return state;
|
|
44
|
+
// In the app: leave it running. A Hub that can't be installed here (an untrusted certificate, plain http): keep a tab.
|
|
45
|
+
const where = installStore.get().state;
|
|
46
|
+
const words = where === "installed" ? "app" : where === "untrusted" || where === "insecure" ? "noInstall" : "tab";
|
|
47
|
+
void confirmDialog({ title: tk("title"), message: tk(words), confirmLabel: tk("ok"), notice: true });
|
|
48
|
+
return state;
|
|
49
|
+
}
|
package/dist/ui/hub-role-view.js
CHANGED
|
@@ -3,7 +3,7 @@ import {hr} from "./hub-roles-strings.js";
|
|
|
3
3
|
import { dateTimeText } from "/assets/clock-text.js";
|
|
4
4
|
export const personKey=p=>`${p?.realm}/${p?.objectId}`;
|
|
5
5
|
export const management=["fleets.manage","join.manage","roles.assign","audit.view","hub.admin"];
|
|
6
|
-
export const permissionGroups=[{key:"usingHub",permissions:["ask_agents","publish_agents","pair_fleet"]},{key:"theirTeam",permissions:["team.view","team.usage"]},{key:"runningHub",permissions:["fleets.manage","join.manage","roles.assign","audit.view"]}];
|
|
6
|
+
export const permissionGroups=[{key:"usingHub",permissions:["ask_agents","publish_agents","pair_fleet","rooms.create"]},{key:"theirTeam",permissions:["team.view","team.usage"]},{key:"runningHub",permissions:["fleets.manage","join.manage","roles.assign","audit.view"]}];
|
|
7
7
|
const builtinNames={admin:"Administrator",manager:"Manager",member:"Member"};
|
|
8
8
|
export function roleName(role,view){
|
|
9
9
|
if(!role)return hr("unknownRole");
|
|
@@ -40,7 +40,7 @@ register("hubRole",{
|
|
|
40
40
|
"start": "Starts (optional)",
|
|
41
41
|
"expiry": "Expires (optional)",
|
|
42
42
|
"override": "Fleet limit override (optional)",
|
|
43
|
-
"personOnly": "A role with these can be given to people only, not to groups.",
|
|
43
|
+
"personOnly": "A role with these can be given to people only, not to AD groups.",
|
|
44
44
|
"groupCost": "Whoever manages this AD group can change who receives the role.",
|
|
45
45
|
"firstAdmin": "First administrator",
|
|
46
46
|
"firstAdminHelp": "Configured on the Hub host; cannot be removed here.",
|
|
@@ -80,6 +80,7 @@ register("hubRole",{
|
|
|
80
80
|
"ask_agents": "Chat with agents",
|
|
81
81
|
"publish_agents": "Share agents",
|
|
82
82
|
"pair_fleet": "Connect Fleets",
|
|
83
|
+
"rooms.create": "Create rooms",
|
|
83
84
|
"team.view": "View team roster",
|
|
84
85
|
"team.usage": "View team usage",
|
|
85
86
|
"team.approve_join": "Approve Fleet connection requests",
|
|
@@ -98,13 +99,13 @@ register("hubRole",{
|
|
|
98
99
|
"assignedTo": "Assigned to",
|
|
99
100
|
"nobodyAssigned": "Nobody yet",
|
|
100
101
|
"peopleCount": "{0} people",
|
|
101
|
-
"groupCount": "{0} groups",
|
|
102
|
+
"groupCount": "{0} AD groups",
|
|
102
103
|
"builtin": "Built-in",
|
|
103
104
|
"assignNamed": "Assign {0}",
|
|
104
|
-
"assignPeople": "Assign people or groups",
|
|
105
|
+
"assignPeople": "Assign people or AD groups",
|
|
105
106
|
"backRoles": "Back to Roles",
|
|
106
107
|
"editPermissions": "Edit permissions",
|
|
107
|
-
"adminFixed": "Built-in
|
|
108
|
+
"adminFixed": "Built-in Hub administration permissions. Creating rooms is granted separately.",
|
|
108
109
|
"usingHub": "Using the Hub",
|
|
109
110
|
"theirTeam": "Their team",
|
|
110
111
|
"runningHub": "Running the Hub",
|
|
@@ -194,6 +195,7 @@ register("hubRole",{
|
|
|
194
195
|
"description_ask_agents": "Ask the agents they are allowed to ask.",
|
|
195
196
|
"description_publish_agents": "Share their own agents and choose who may ask them.",
|
|
196
197
|
"description_pair_fleet": "Connect their own Fleet, up to the Fleet limit.",
|
|
198
|
+
"description_rooms.create": "Create group rooms. Removing this permission does not change existing rooms or their managers.",
|
|
197
199
|
"description_team.view": "See who is on their team and who has joined.",
|
|
198
200
|
"description_team.usage": "See their team’s question counts. Never what was asked.",
|
|
199
201
|
"description_fleets.manage": "See every connected Fleet and disconnect one.",
|
|
@@ -202,7 +204,7 @@ register("hubRole",{
|
|
|
202
204
|
"description_audit.view": "See who did what in this Hub. Actions only, never conversations.",
|
|
203
205
|
"description_hub.admin": "Edit roles and Hub settings, including the allowed list and the recommended version.",
|
|
204
206
|
"peopleCountOne": "1 person",
|
|
205
|
-
"groupCountOne": "1 group",
|
|
207
|
+
"groupCountOne": "1 AD group",
|
|
206
208
|
"losingPeopleOne": "1 person loses something they can do now",
|
|
207
209
|
"pausingResourcesOne": "1 shared agent or Fleet will be paused",
|
|
208
210
|
"unverifiedPeopleOne": "1 person could not be checked in AD",
|
|
@@ -254,7 +256,7 @@ register("hubRole",{
|
|
|
254
256
|
"start": "開始時間(選填)",
|
|
255
257
|
"expiry": "到期時間(選填)",
|
|
256
258
|
"override": "Fleet 台數上限(選填)",
|
|
257
|
-
"personOnly": "
|
|
259
|
+
"personOnly": "含有這些權限的角色只能指派給個人,不能指派給 AD 群組。",
|
|
258
260
|
"groupCost": "管理這個 AD 群組的人,可以變更誰取得這個角色。",
|
|
259
261
|
"firstAdmin": "第一位管理員",
|
|
260
262
|
"firstAdminHelp": "由 Hub 主機設定,不能在這裡移除。",
|
|
@@ -294,6 +296,7 @@ register("hubRole",{
|
|
|
294
296
|
"ask_agents": "和 Agent 對話",
|
|
295
297
|
"publish_agents": "分享 Agent",
|
|
296
298
|
"pair_fleet": "連接 Fleet",
|
|
299
|
+
"rooms.create": "開房間",
|
|
297
300
|
"team.view": "查看團隊名單",
|
|
298
301
|
"team.usage": "查看團隊用量",
|
|
299
302
|
"team.approve_join": "核准連接申請",
|
|
@@ -312,13 +315,13 @@ register("hubRole",{
|
|
|
312
315
|
"assignedTo": "已指派給",
|
|
313
316
|
"nobodyAssigned": "還沒有人",
|
|
314
317
|
"peopleCount": "{0} 人",
|
|
315
|
-
"groupCount": "{0}
|
|
318
|
+
"groupCount": "{0} 個 AD 群組",
|
|
316
319
|
"builtin": "內建",
|
|
317
320
|
"assignNamed": "指派「{0}」",
|
|
318
|
-
"assignPeople": "
|
|
321
|
+
"assignPeople": "指派人員或 AD 群組",
|
|
319
322
|
"backRoles": "返回角色清單",
|
|
320
323
|
"editPermissions": "編輯權限",
|
|
321
|
-
"adminFixed": "
|
|
324
|
+
"adminFixed": "內建的 Hub 管理權限;開房間權限另外授予。",
|
|
322
325
|
"usingHub": "使用 Hub",
|
|
323
326
|
"theirTeam": "所屬團隊",
|
|
324
327
|
"runningHub": "管理 Hub",
|
|
@@ -408,6 +411,7 @@ register("hubRole",{
|
|
|
408
411
|
"description_ask_agents": "向可以問的 Agent 提問。",
|
|
409
412
|
"description_publish_agents": "分享自己的 Agent,並決定誰可以問。",
|
|
410
413
|
"description_pair_fleet": "連接自己的 Fleet,數量不超過上限。",
|
|
414
|
+
"description_rooms.create": "開群組房間。移除此權限不會變更既有房間或房間管理。",
|
|
411
415
|
"description_team.view": "查看團隊有哪些人,以及誰已經加入。",
|
|
412
416
|
"description_team.usage": "查看團隊的提問次數,看不到提問內容。",
|
|
413
417
|
"description_fleets.manage": "查看所有已連接的 Fleet,並可中斷連接。",
|
|
@@ -416,7 +420,7 @@ register("hubRole",{
|
|
|
416
420
|
"description_audit.view": "查看誰在這個 Hub 做了什麼;只有動作,沒有對話內容。",
|
|
417
421
|
"description_hub.admin": "編輯角色與 Hub 設定,包含允許清單與建議版本。",
|
|
418
422
|
"peopleCountOne": "1 人",
|
|
419
|
-
"groupCountOne": "1
|
|
423
|
+
"groupCountOne": "1 個 AD 群組",
|
|
420
424
|
"losingPeopleOne": "1 人會失去目前可以做的事",
|
|
421
425
|
"pausingResourcesOne": "1 個分享的 Agent 或 Fleet 會暫停",
|
|
422
426
|
"unverifiedPeopleOne": "1 人無法在 AD 確認",
|
package/dist/ui/hub-roles.js
CHANGED
|
@@ -36,7 +36,7 @@ function RolePage({view,role,busy,canEdit,canAssign,onBack,onAssign,onEdit,onDel
|
|
|
36
36
|
const count=assignedSubjects(view,role.id).length;
|
|
37
37
|
return html`<section class="hub-role-detail"><button type="button" class="btn btn-sm" disabled=${busy} onClick=${onBack}>‹ ${hr("roles")}</button><div class="hub-card-head"><h2>${roleName(role,view)} <span class="tag">${hr(["custom","carried-over"].includes(role.kind)?role.kind==="custom"?"custom":"carried":"builtin")}</span></h2>
|
|
38
38
|
${editable&&role.kind==="custom"?html`<details class="hub-role-menu"><summary>${hr("more")}</summary><button type="button" class="btn danger" disabled=${busy} onClick=${onDelete}>${hr("delete")}</button></details>`:null}</div><p>${roleDescription(role,view)}</p><p class="note">${hr("quota")}: ${role.defaultMaxFleets}</p>
|
|
39
|
-
<${Tabs} label=${roleName(role,view)} items=${[{key:"people",label:hr("people")+" · "+count},{key:"permissions",label:hr("permissions")+" · "+hr("permissionCount",role.permissions.length,
|
|
39
|
+
<${Tabs} label=${roleName(role,view)} items=${[{key:"people",label:hr("people")+" · "+count},{key:"permissions",label:hr("permissions")+" · "+hr("permissionCount",role.permissions.length,view.permissions.length)}]} value=${tab} disabled=${busy} onChange=${setTab}/>
|
|
40
40
|
${tab==="people"?html`<${People} key=${role.id} view=${view} roleId=${role.id} busy=${busy} onOpen=${onPerson} onAssign=${canAssign?onAssign:null}/>`:html`<section class="card"><div class="hub-card-head"><h3>${hr("permissions")}</h3>${editable?html`<button type="button" class="btn" disabled=${busy} onClick=${onEdit}>${hr("editPermissions")}</button>`:null}</div>
|
|
41
41
|
${role.kind==="admin"?html`<p class="s-info">${hr("adminFixed")}</p>`:null}${role.kind==="carried-over"?html`<p class="note">${hr("inherited")}</p>`:null}<${PermissionSections} permissions=${role.permissions} readOnly=${true} administrator=${role.kind==="admin"}/></section>`}</section>`;
|
|
42
42
|
}
|
|
@@ -4,6 +4,7 @@ import { notifyOn, notifySupport, notifyStore, refreshNotify, setNotify } from "
|
|
|
4
4
|
import { html, useEffect } from "/assets/app-html.js";
|
|
5
5
|
import { useStore } from "/assets/app-store.js";
|
|
6
6
|
import { Icon } from "/assets/ui-icons.js";
|
|
7
|
+
import { setHubNotify } from "./hub-notify-keep.js";
|
|
7
8
|
import { counts, shouldNotify } from "./hub-room-unread.js";
|
|
8
9
|
import { hroom } from "./hub-room-strings.js";
|
|
9
10
|
|
|
@@ -157,5 +158,5 @@ export function HubNotifyToggle() {
|
|
|
157
158
|
return html`<span class="icon-btn hub-notify" aria-disabled="true" title=${title} aria-label=${title}><${Icon} name="bell" size=${16} /></span>`;
|
|
158
159
|
}
|
|
159
160
|
return html`<button type="button" class="icon-btn hub-notify" aria-pressed=${on ? "true" : "false"} aria-label=${label} title=${title}
|
|
160
|
-
disabled=${asking} onClick=${() => { void
|
|
161
|
+
disabled=${asking} onClick=${() => { void setHubNotify(!on); }}><${Icon} name="bell" size=${16} /></button>`;
|
|
161
162
|
}
|
|
@@ -142,7 +142,7 @@ register("hubRoom", {
|
|
|
142
142
|
assistantNotEnabled: "The room assistant is not enabled yet.",
|
|
143
143
|
assistantEnableHint: "Sign in an AI account in AgEnD on this computer, then come back and turn it on.",
|
|
144
144
|
// §11 admin → rooms
|
|
145
|
-
whoCanCreate: "Who can
|
|
145
|
+
whoCanCreate: "Who can create rooms", addPeopleOrTeams: "Add people or teams",
|
|
146
146
|
everyoneDirect: "Everyone can start a one-to-one chat.",
|
|
147
147
|
allRooms: "All rooms", active: "Active", archived: "Archived",
|
|
148
148
|
noContent: "Room content is not visible here.",
|
|
@@ -150,7 +150,7 @@ register("hubRoom", {
|
|
|
150
150
|
// §12 unread: unreadN is the list-row count tooltip; mentionedYou is the row's @ mark.
|
|
151
151
|
unreadPrefix: "({0})", unreadN: "{0} unread", mentionMark: "@", mentionedYou: "Mentioned you",
|
|
152
152
|
// §12 desktop notification (opt-in, like the Fleet's Notify me): the header toggle and one ping per kind.
|
|
153
|
-
notifyTitle: "Notify me on this device", notifyOn: "Notifications are on while a Hub tab is open.",
|
|
153
|
+
notifyTitle: "Notify me on this device", notifyOn: "Notifications are on while a Hub tab or the AgEnD app is open, even in the background.",
|
|
154
154
|
notifyOff: "Get a desktop notification when someone @mentions you, an agent answers, or a new invitation arrives.",
|
|
155
155
|
notifyDenied: "This browser blocked notifications. Allow them in the site settings to turn this on.",
|
|
156
156
|
notifyUnavailable: "This browser cannot show notifications here.",
|
|
@@ -295,7 +295,7 @@ register("hubRoom", {
|
|
|
295
295
|
noContent: "這裡看不到任何房間的內容。",
|
|
296
296
|
joinAsManager: "加入自己成為房間管理",
|
|
297
297
|
unreadPrefix: "({0})", unreadN: "{0} 則未讀", mentionMark: "@", mentionedYou: "有人 @ 你",
|
|
298
|
-
notifyTitle: "在這個裝置上通知我", notifyOn: "Hub
|
|
298
|
+
notifyTitle: "在這個裝置上通知我", notifyOn: "Hub 分頁或 AgEnD 應用程式開著時(在背景也可以)會收到通知。",
|
|
299
299
|
notifyOff: "有人 @ 你、Agent 回答或有新邀請時,收到桌面通知。",
|
|
300
300
|
notifyDenied: "這個瀏覽器封鎖了通知。請在網站設定中允許,才能開啟。",
|
|
301
301
|
notifyUnavailable: "這個瀏覽器在這裡無法顯示通知。",
|
|
@@ -27,8 +27,10 @@ import {ha} from "./hub-ai-apps-strings.js";
|
|
|
27
27
|
import { RoomComposer } from "./hub-room-composer.js";
|
|
28
28
|
import { TextSizeButton, TEXT_SIZES, setTextSize, textSizeStore } from "/assets/header-tools.js";
|
|
29
29
|
import { useStore } from "/assets/app-store.js";
|
|
30
|
-
import { notifyStore, notifySupport
|
|
30
|
+
import { notifyStore, notifySupport } from "/assets/app-needs.js";
|
|
31
31
|
import { HubNotifyToggle } from "./hub-room-notify.js";
|
|
32
|
+
import { setHubNotify } from "./hub-notify-keep.js";
|
|
33
|
+
import { InstallAppButton, installLabel, installOffered, installStore, runInstall } from "/assets/app-install.js";
|
|
32
34
|
import { createHubButtonActions } from "./hub-button-actions.js";
|
|
33
35
|
import { linkRoomsU2Css } from "./hub-room-new-strings.js";
|
|
34
36
|
import { directStatus, workingLine } from "./hub-room-working.js";
|
|
@@ -182,6 +184,7 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
|
|
|
182
184
|
const num = (id) => { if (!ids.has(id)) ids.set(id, ids.size * 2 + 2); return ids.get(id); };
|
|
183
185
|
for (const m of ordered) {
|
|
184
186
|
if (!m || typeof m.id !== "string") continue;
|
|
187
|
+
if (m.answerTo && m.acknowledgedByReaction === true) continue;
|
|
185
188
|
const author = m.author || {}, kind = author.kind;
|
|
186
189
|
// An answer still to come (queued, or being worked on: the working bar says who) is never an empty bubble.
|
|
187
190
|
if (m.answerTo && !m.text && (m.stage === "queued" || m.stage === "working")) continue;
|
|
@@ -602,7 +605,7 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
602
605
|
}
|
|
603
606
|
// M-3311 (3): the header's menu — a group room's Room settings and Leave, and on a desk the Fleet chat's 「全寬」 for any room.
|
|
604
607
|
const [fullWidth, setFullWidth] = useState(hubChatWide);
|
|
605
|
-
const textSize = useStore(textSizeStore), notify = useStore(notifyStore), narrow = useNarrowScreen();
|
|
608
|
+
const textSize = useStore(textSizeStore), notify = useStore(notifyStore), install = useStore(installStore), narrow = useNarrowScreen();
|
|
606
609
|
const [muteBusy,setMuteBusy]=useState(false);
|
|
607
610
|
async function toggleDirectMute(){
|
|
608
611
|
if(muteBusy)return;setMuteBusy(true);
|
|
@@ -624,7 +627,9 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
624
627
|
// move into ⋯ there (hub-chat.css hides the two buttons at the same width).
|
|
625
628
|
...(narrow ? [
|
|
626
629
|
{ key: "textSize", label: t("app.textSize", t(`app.textSize_${textSize.size}`)), icon: "type", onSelect: () => setTextSize(TEXT_SIZES[(TEXT_SIZES.indexOf(textSize.size) + 1) % TEXT_SIZES.length]) },
|
|
627
|
-
...(notifySupport() === "ok" ? [{ key: "notify", checkbox: true, checked: notify.state === "on", disabled: notify.asking, label: hroom("notifyTitle"), onSelect: () => { void
|
|
630
|
+
...(notifySupport() === "ok" ? [{ key: "notify", checkbox: true, checked: notify.state === "on", disabled: notify.asking, label: hroom("notifyTitle"), onSelect: () => { void setHubNotify(notify.state !== "on"); } }] : []),
|
|
631
|
+
// S-255: Install as an app sits by the bell, so on a phone it moves into ⋯ with it.
|
|
632
|
+
...(installOffered(install.state) ? [{ key: "install", label: installLabel(), icon: "install", onSelect: () => runInstall(install.state) }] : []),
|
|
628
633
|
] : []),
|
|
629
634
|
].filter(Boolean);
|
|
630
635
|
const line2 = narrow && inOffice ? hroom("tabOffice") : group ? `${countsLine(room.people, room.agents)}${hasAssistant ? ` · ${hroom("roomAssistant")}` : ""}`
|
|
@@ -679,7 +684,7 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
679
684
|
const label = hroom(v === "chat" ? "tabChat" : "tabOffice"), on = (v === "office") === inOffice;
|
|
680
685
|
return html`<a key=${v} class=${`seg-item${on ? " active" : ""}`} href=${officeHref(v)} aria-current=${on ? "page" : undefined} data-label=${label}
|
|
681
686
|
onClick=${(e) => { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button > 0) return; e.preventDefault(); onView(v); }}>${label}</a>`; })}</nav>` : null}
|
|
682
|
-
<span class="hub-head-tools"><${RoomPinsButton} count=${pinCount} onOpen=${() => setPinsOpen(true)} /><${TextSizeButton} /><${HubNotifyToggle} /></span>
|
|
687
|
+
<span class="hub-head-tools"><${RoomPinsButton} count=${pinCount} onOpen=${() => setPinsOpen(true)} /><${TextSizeButton} /><${InstallAppButton} /><${HubNotifyToggle} /></span>
|
|
683
688
|
${group && Panel ? html`<button type="button" class="icon-btn hub-room-rail-toggle" aria-pressed=${(wide ? showRail : sheet) ? "true" : "false"} title=${hroom("members")} aria-label=${hroom("members")}
|
|
684
689
|
onClick=${() => { if (!wide) { setSheet(true); return; } if (panelOpen && !inOffice) { closePanel(); setRail(true); return; } setRail(!rail); }}><${Icon} name="team" size=${18} /></button>` : null}
|
|
685
690
|
${menuItems.length ? html`<${Menu} cls="hub-room-menu" label=${hroom("menu")} fit=${true} ownerKey=${roomId} items=${menuItems} />` : null}
|