@songsid/agend 2.3.1 → 2.3.2-beta.10
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/THIRD_PARTY_NOTICES.md +40 -0
- package/dist/agent-cli.js +21 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +5 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/antigravity-usage-scan.d.ts +58 -0
- package/dist/antigravity-usage-scan.js +257 -0
- package/dist/antigravity-usage-scan.js.map +1 -0
- package/dist/antigravity-usage-worker.d.ts +1 -0
- package/dist/antigravity-usage-worker.js +10 -0
- package/dist/antigravity-usage-worker.js.map +1 -0
- package/dist/auth-api.js +4 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/authority-state.d.ts +4 -0
- package/dist/authority/authority-state.js +16 -10
- package/dist/authority/authority-state.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +7 -1
- package/dist/authority/session-authorizations.js +6 -4
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/authority/web-authority.d.ts +19 -6
- package/dist/authority/web-authority.js +22 -8
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/kiro-identity.d.ts +64 -0
- package/dist/backend/kiro-identity.js +101 -0
- package/dist/backend/kiro-identity.js.map +1 -1
- package/dist/backend/kiro-retired-model.d.ts +62 -0
- package/dist/backend/kiro-retired-model.js +160 -0
- package/dist/backend/kiro-retired-model.js.map +1 -0
- package/dist/backend/kiro.d.ts +71 -2
- package/dist/backend/kiro.js +352 -11
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/types.d.ts +59 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-signin-guide.d.ts +1 -0
- package/dist/backend-signin-guide.js +9 -0
- package/dist/backend-signin-guide.js.map +1 -0
- package/dist/backend-signin-pending.d.ts +10 -0
- package/dist/backend-signin-pending.js +44 -0
- package/dist/backend-signin-pending.js.map +1 -0
- package/dist/browser-backend-signins.d.ts +56 -0
- package/dist/browser-backend-signins.js +189 -0
- package/dist/browser-backend-signins.js.map +1 -0
- package/dist/cache-ledger.d.ts +38 -2
- package/dist/cache-ledger.js +133 -8
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-prices.d.ts +2 -1
- package/dist/cache-prices.js +5 -2
- package/dist/cache-prices.js.map +1 -1
- package/dist/cache-service.d.ts +68 -0
- package/dist/cache-service.js +355 -13
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +13 -0
- package/dist/channel/adapters/discord.js +103 -16
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/mcp-tools.js +34 -7
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +2 -1
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +11 -0
- package/dist/classic-channel-manager.d.ts +11 -0
- package/dist/classic-channel-manager.js +39 -1
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +21 -2
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.d.ts +7 -1
- package/dist/config-validator.js +92 -12
- package/dist/config-validator.js.map +1 -1
- package/dist/config.d.ts +19 -0
- package/dist/config.js +31 -1
- package/dist/config.js.map +1 -1
- package/dist/cpu-quota.d.ts +23 -0
- package/dist/cpu-quota.js +86 -0
- package/dist/cpu-quota.js.map +1 -0
- package/dist/daemon.d.ts +57 -3
- package/dist/daemon.js +330 -50
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +20 -6
- package/dist/dashboard-permissions.js +58 -9
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +12 -1
- package/dist/delivery-outbox.js +67 -15
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/doctor.d.ts +3 -0
- package/dist/doctor.js +11 -1
- package/dist/doctor.js.map +1 -1
- package/dist/event-log.d.ts +5 -0
- package/dist/event-log.js +13 -0
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-manager.d.ts +212 -0
- package/dist/fleet-manager.js +914 -111
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-process-handlers.d.ts +1 -0
- package/dist/fleet-process-handlers.js +9 -1
- package/dist/fleet-process-handlers.js.map +1 -1
- package/dist/forged-envelope-scan.d.ts +9 -0
- package/dist/forged-envelope-scan.js +30 -5
- package/dist/forged-envelope-scan.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +5 -2
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +14 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.canvas-worker-off.md +28 -5
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +31 -8
- package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +138 -59
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +145 -61
- package/dist/guest-seen-people.d.ts +38 -0
- package/dist/guest-seen-people.js +78 -0
- package/dist/guest-seen-people.js.map +1 -0
- package/dist/instance-config-impact.js +14 -6
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +20 -0
- package/dist/instance-lifecycle.js +71 -13
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/kiro-db-reader.d.ts +5 -0
- package/dist/kiro-db-reader.js +18 -0
- package/dist/kiro-db-reader.js.map +1 -1
- package/dist/kiro-engine-status.d.ts +2 -0
- package/dist/kiro-engine-status.js +9 -0
- package/dist/kiro-engine-status.js.map +1 -1
- package/dist/kiro-migrate.d.ts +49 -0
- package/dist/kiro-migrate.js +105 -0
- package/dist/kiro-migrate.js.map +1 -0
- package/dist/kiro-transcript-lane.d.ts +2 -0
- package/dist/kiro-transcript-lane.js.map +1 -1
- package/dist/kiro-transcript-worker.js +1 -0
- package/dist/kiro-transcript-worker.js.map +1 -1
- package/dist/kiro-tui-forensic.d.ts +7 -0
- package/dist/kiro-tui-forensic.js +110 -0
- package/dist/kiro-tui-forensic.js.map +1 -0
- package/dist/kiro-usage-run.d.ts +7 -0
- package/dist/kiro-usage-run.js +39 -0
- package/dist/kiro-usage-run.js.map +1 -0
- package/dist/kiro-usage-scan.d.ts +49 -0
- package/dist/kiro-usage-scan.js +223 -0
- package/dist/kiro-usage-scan.js.map +1 -0
- package/dist/kiro-usage-worker.d.ts +1 -0
- package/dist/kiro-usage-worker.js +10 -0
- package/dist/kiro-usage-worker.js.map +1 -0
- package/dist/kiro-usage.d.ts +58 -0
- package/dist/kiro-usage.js +310 -0
- package/dist/kiro-usage.js.map +1 -0
- package/dist/locale.js +120 -12
- package/dist/locale.js.map +1 -1
- package/dist/log-service.js +1 -1
- package/dist/log-service.js.map +1 -1
- package/dist/login-url.d.ts +4 -0
- package/dist/login-url.js +22 -0
- package/dist/login-url.js.map +1 -0
- package/dist/mac-auto-restore.d.ts +117 -0
- package/dist/mac-auto-restore.js +294 -0
- package/dist/mac-auto-restore.js.map +1 -0
- package/dist/needs-you-hub.d.ts +2 -1
- package/dist/needs-you-hub.js +1 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +8 -2
- package/dist/needs-you.js +6 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/notice-delivery.d.ts +16 -0
- package/dist/notice-delivery.js +35 -0
- package/dist/notice-delivery.js.map +1 -0
- package/dist/office-share-page.d.ts +16 -0
- package/dist/office-share-page.js +85 -0
- package/dist/office-share-page.js.map +1 -0
- package/dist/office-share-service.d.ts +91 -0
- package/dist/office-share-service.js +176 -0
- package/dist/office-share-service.js.map +1 -0
- package/dist/office-share.d.ts +258 -0
- package/dist/office-share.js +549 -0
- package/dist/office-share.js.map +1 -0
- package/dist/opencode-usage-scan.d.ts +28 -0
- package/dist/opencode-usage-scan.js +92 -0
- package/dist/opencode-usage-scan.js.map +1 -0
- package/dist/opencode-usage-worker.d.ts +1 -0
- package/dist/opencode-usage-worker.js +10 -0
- package/dist/opencode-usage-worker.js.map +1 -0
- package/dist/outbound-handlers.js +22 -2
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +28 -2
- package/dist/outbound-schemas.js +29 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +16 -2
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/quickstart-api.js +13 -2
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.js +2 -1
- package/dist/quickstart.js.map +1 -1
- package/dist/remote-card-answer.d.ts +83 -0
- package/dist/remote-card-answer.js +208 -0
- package/dist/remote-card-answer.js.map +1 -0
- package/dist/reply-triggers.d.ts +2 -0
- package/dist/reply-triggers.js +3 -0
- package/dist/reply-triggers.js.map +1 -0
- package/dist/settings-api.d.ts +28 -0
- package/dist/settings-api.js +148 -17
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +54 -17
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +12 -3
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-instance-patch.js +4 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-form.d.ts +1 -1
- package/dist/setup-form.js +55 -6
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-host.d.ts +9 -0
- package/dist/setup-host.js +127 -6
- package/dist/setup-host.js.map +1 -1
- package/dist/setup-signin-assets.d.ts +2 -0
- package/dist/setup-signin-assets.js +6 -0
- package/dist/setup-signin-assets.js.map +1 -0
- package/dist/setup-wizard.js +2 -0
- package/dist/setup-wizard.js.map +1 -1
- package/dist/start-attempt.d.ts +9 -5
- package/dist/start-attempt.js +27 -8
- package/dist/start-attempt.js.map +1 -1
- package/dist/start-failure-chat.d.ts +4 -0
- package/dist/start-failure-chat.js +23 -6
- package/dist/start-failure-chat.js.map +1 -1
- package/dist/start-failure-notice.d.ts +4 -0
- package/dist/start-failure-notice.js +8 -0
- package/dist/start-failure-notice.js.map +1 -1
- package/dist/start-failure.d.ts +25 -0
- package/dist/start-failure.js +75 -2
- package/dist/start-failure.js.map +1 -1
- package/dist/structured-signin-transport.d.ts +8 -0
- package/dist/structured-signin-transport.js +79 -0
- package/dist/structured-signin-transport.js.map +1 -0
- package/dist/structured-signin.d.ts +131 -0
- package/dist/structured-signin.js +388 -0
- package/dist/structured-signin.js.map +1 -0
- package/dist/tool-permissions.js +12 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.js +6 -2
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-sources.d.ts +26 -2
- package/dist/transcript-sources.js +103 -40
- package/dist/transcript-sources.js.map +1 -1
- package/dist/turn-reply-guard.d.ts +25 -0
- package/dist/turn-reply-guard.js +111 -12
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/types.d.ts +46 -9
- package/dist/ui/backend-signin.js +68 -12
- package/dist/ui/chat-ambient.js +1 -1
- package/dist/ui/chat-effects.js +4 -4
- package/dist/ui/chat-render.js +5 -2
- package/dist/ui/chat-strings.js +4 -4
- package/dist/ui/chat-thread.js +2 -2
- package/dist/ui/first-run.js +2 -2
- package/dist/ui/fleet-canvas-view.js +114 -0
- package/dist/ui/fleet-canvas.js +15 -77
- package/dist/ui/fleet-office-editor.js +94 -14
- package/dist/ui/fleet-office-layout.js +235 -0
- package/dist/ui/fleet-office-model.js +12 -6
- package/dist/ui/fleet-office-overview.js +167 -0
- package/dist/ui/fleet-office-pack.d.ts +44 -0
- package/dist/ui/fleet-office-pack.js +352 -37
- package/dist/ui/fleet-office-skin.js +220 -36
- package/dist/ui/fleet-office-store.js +112 -7
- package/dist/ui/fleet-office-view.js +155 -0
- package/dist/ui/fleet-office-zones.js +264 -42
- package/dist/ui/fleet-office.js +957 -160
- package/dist/ui/fleet-usage.js +26 -21
- package/dist/ui/office-share-dialog.js +145 -0
- package/dist/ui/office-share-page.js +164 -0
- package/dist/ui/panel-chat.js +9 -2
- package/dist/ui/panel-details.js +2 -2
- package/dist/ui/panel-fleet.js +11 -77
- package/dist/ui/panel-log.js +4 -4
- package/dist/ui/panel-needs.js +4 -4
- package/dist/ui/panel-settings.js +608 -167
- package/dist/ui/search-dialog.js +26 -7
- package/dist/ui/settings-appearance.js +82 -29
- package/dist/ui/settings-apply.js +42 -7
- package/dist/ui/settings-dialogs.js +76 -23
- package/dist/ui/settings-draft.js +51 -0
- package/dist/ui/settings-guests.js +255 -79
- package/dist/ui/settings-learn.js +2 -2
- package/dist/ui/settings-model.js +16 -6
- package/dist/ui/settings-registry.js +146 -0
- package/dist/ui/settings-strings.js +116 -44
- package/dist/ui/settings-web-authority.js +34 -23
- package/dist/ui/shared/app-i18n.js +18 -2
- package/dist/ui/shared/app-nav.js +10 -5
- package/dist/ui/shared/app-prefs.js +80 -2
- package/dist/ui/shared/app-route.js +39 -5
- package/dist/ui/shared/app-shell.js +73 -10
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +307 -17
- package/dist/ui/shared/app.js +3 -0
- package/dist/ui/shared/effect-stock-trust.js +1 -1
- package/dist/ui/shared/identity-color.js +4 -4
- package/dist/ui/shared/office/cozy.png +0 -0
- package/dist/ui/shared/side-panel.js +95 -0
- package/dist/ui/shared/signin.js +2 -2
- package/dist/ui/shared/ui-dialog.js +6 -1
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/web-authorize.js +13 -12
- package/dist/ui/structured-signin.js +115 -0
- package/dist/usage-report.d.ts +20 -0
- package/dist/usage-report.js +54 -17
- package/dist/usage-report.js.map +1 -1
- package/dist/usage-rollup.d.ts +9 -1
- package/dist/usage-rollup.js +20 -4
- package/dist/usage-rollup.js.map +1 -1
- package/dist/web-api.d.ts +26 -2
- package/dist/web-api.js +361 -5
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.js +8 -2
- package/dist/web-auth.js.map +1 -1
- package/dist/web-backend-login.d.ts +1 -7
- package/dist/web-backend-login.js +2 -24
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-experimental.d.ts +1 -1
- package/dist/web-experimental.js +1 -1
- package/dist/web-experimental.js.map +1 -1
- package/dist/web-mod-agent.js +2 -2
- package/dist/web-mod-agent.js.map +1 -1
- package/dist/web-office-acts.d.ts +173 -0
- package/dist/web-office-acts.js +285 -0
- package/dist/web-office-acts.js.map +1 -0
- package/dist/web-office-skins.d.ts +109 -0
- package/dist/web-office-skins.js +299 -0
- package/dist/web-office-skins.js.map +1 -0
- package/dist/web-office-store.d.ts +8 -2
- package/dist/web-office-store.js +77 -14
- package/dist/web-office-store.js.map +1 -1
- package/dist/web-settings-patch.d.ts +8 -1
- package/dist/web-settings-patch.js +65 -5
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-shell-routes.d.ts +4 -2
- package/dist/web-shell-routes.js +17 -7
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/working-recovery.d.ts +104 -0
- package/dist/working-recovery.js +298 -0
- package/dist/working-recovery.js.map +1 -0
- package/dist/working-state-journal.d.ts +5 -1
- package/dist/working-state-journal.js +31 -3
- package/dist/working-state-journal.js.map +1 -1
- package/package.json +3 -2
- package/templates/windows-shortcuts.ps1 +155 -140
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { createServer, type Server } from "node:http";
|
|
2
|
+
import { type OfficeAct } from "./web-office-acts.js";
|
|
3
|
+
import type { Office } from "./web-office-store.js";
|
|
4
|
+
export declare const OFFICE_SHARE_LIMITS: {
|
|
5
|
+
/** Shares open at once, fleet-wide. */
|
|
6
|
+
readonly links: 10;
|
|
7
|
+
/** Lifetime: 1 h unless asked, 15 min to `web.office_share.max_hours` (24 at most). */
|
|
8
|
+
readonly defaultMinutes: 60;
|
|
9
|
+
readonly minMinutes: 15;
|
|
10
|
+
readonly maxHours: 24;
|
|
11
|
+
/** Per share, a sliding minute: requests, and bytes answered. */
|
|
12
|
+
readonly requestsPerMinute: 120;
|
|
13
|
+
readonly bytesPerMinute: number;
|
|
14
|
+
/** The page's static files (its code, the same for every share), all shares together. */
|
|
15
|
+
readonly staticRequestsPerMinute: 1200;
|
|
16
|
+
readonly staticBytesPerMinute: number;
|
|
17
|
+
/**
|
|
18
|
+
* #2662: a share's pack pictures (immutable, content-addressed: a browser reads each once) have their own minute, never
|
|
19
|
+
* the 120 above: `pictureLoads` times what the shown packs hold (their files and bytes, as the host lists them), so a
|
|
20
|
+
* viewer's first look at every room never reaches it, and at least the floors here.
|
|
21
|
+
*/
|
|
22
|
+
readonly pictureLoads: 2;
|
|
23
|
+
readonly pictureRequestsFloor: 240;
|
|
24
|
+
readonly pictureBytesFloor: number;
|
|
25
|
+
};
|
|
26
|
+
/** "All offices": every stored office (and whoever is in none); otherwise a stored office's id. */
|
|
27
|
+
export declare const ALL_OFFICES = "all";
|
|
28
|
+
/**
|
|
29
|
+
* An office's members after the share's cut, when every one it named is out of the share: a team no chart has (a team's
|
|
30
|
+
* name has no control character), so the page finds nobody — never [], which the page reads as everyone.
|
|
31
|
+
*/
|
|
32
|
+
export declare const NOBODY = "team:\0";
|
|
33
|
+
/** An ended (or unknown) share's page: the same words whichever it is. */
|
|
34
|
+
export declare const ENDED_PAGE: string;
|
|
35
|
+
export interface OfficeShare {
|
|
36
|
+
/** A short handle for lists and revoking (never the token). */
|
|
37
|
+
id: string;
|
|
38
|
+
/** ALL_OFFICES, or a stored office's id. */
|
|
39
|
+
office: string;
|
|
40
|
+
/** Agents' own lines (office_set `say`) are shown. */
|
|
41
|
+
text: boolean;
|
|
42
|
+
/** Who made it (for the list and General's announcement). */
|
|
43
|
+
owner: string;
|
|
44
|
+
/** Wall-clock ms, for display; the expiry itself runs on the monotonic clock. */
|
|
45
|
+
createdAt: number;
|
|
46
|
+
expiresAt: number;
|
|
47
|
+
}
|
|
48
|
+
export type OfficeShareCreate = {
|
|
49
|
+
ok: true;
|
|
50
|
+
share: OfficeShare;
|
|
51
|
+
token: string;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
error: "too_many" | "duration" | "office";
|
|
55
|
+
};
|
|
56
|
+
export declare const hashShareToken: (token: string) => string;
|
|
57
|
+
/** The longest a share may live, in minutes: `web.office_share.max_hours` (whole hours, 1–24), 24 by default. */
|
|
58
|
+
export declare function shareMaxMinutes(maxHours: unknown): number;
|
|
59
|
+
/**
|
|
60
|
+
* The open shares. Each ends at its deadline (monotonic; a timer tells `changed` then, and find() refuses it from that
|
|
61
|
+
* moment whatever the timer did), when revoked, or when its owner is no longer allowed (endWhere). `changed` hears every
|
|
62
|
+
* change with the list as it is now — the tunnel follows it (none left: stop).
|
|
63
|
+
*/
|
|
64
|
+
export declare class OfficeShares {
|
|
65
|
+
private readonly deps;
|
|
66
|
+
private readonly byHash;
|
|
67
|
+
private readonly now;
|
|
68
|
+
private readonly wall;
|
|
69
|
+
constructor(deps?: {
|
|
70
|
+
/** Monotonic ms (performance.now by default). */
|
|
71
|
+
now?(): number;
|
|
72
|
+
/** Wall-clock ms (Date.now by default): only what is shown. */
|
|
73
|
+
wall?(): number;
|
|
74
|
+
changed?(shares: OfficeShare[]): void;
|
|
75
|
+
random?(n: number): Buffer;
|
|
76
|
+
setTimer?(fn: () => void, ms: number): ReturnType<typeof setTimeout> | null;
|
|
77
|
+
clearTimer?(t: ReturnType<typeof setTimeout>): void;
|
|
78
|
+
});
|
|
79
|
+
/** A new share: `minutes` from 15 to `maxMinutes`; `office` ALL_OFFICES or an id `exists` knows. */
|
|
80
|
+
create(opts: {
|
|
81
|
+
office: string;
|
|
82
|
+
minutes?: number;
|
|
83
|
+
text?: boolean;
|
|
84
|
+
owner: string;
|
|
85
|
+
maxMinutes?: number;
|
|
86
|
+
exists?(office: string): boolean;
|
|
87
|
+
}): OfficeShareCreate;
|
|
88
|
+
/** The open share a token names, or null (unknown, malformed, ended). */
|
|
89
|
+
find(token: string): OfficeShare | null;
|
|
90
|
+
/** The open shares, soonest to end first. */
|
|
91
|
+
list(): OfficeShare[];
|
|
92
|
+
/** End one share by id, or every one (ALL_OFFICES is not an id: "all" ends all). Returns how many ended. */
|
|
93
|
+
revoke(id: string): number;
|
|
94
|
+
/** End every share `test` picks (an owner no longer a fleet admin, an office deleted, the feature turned off). */
|
|
95
|
+
endWhere(test: (share: OfficeShare) => boolean): number;
|
|
96
|
+
private drop;
|
|
97
|
+
private prune;
|
|
98
|
+
private announce;
|
|
99
|
+
}
|
|
100
|
+
export interface OfficeShareRate {
|
|
101
|
+
requests: number;
|
|
102
|
+
bytes: number;
|
|
103
|
+
}
|
|
104
|
+
/** Per key (a share's id): requests and bytes in a sliding minute (monotonic, memory only). */
|
|
105
|
+
export declare class OfficeShareLimiter {
|
|
106
|
+
private readonly now;
|
|
107
|
+
private readonly limits;
|
|
108
|
+
private readonly seen;
|
|
109
|
+
constructor(now?: () => number, limits?: OfficeShareRate);
|
|
110
|
+
/** A request arrives: false when the key has had its requests or bytes this minute (`limits`: this key's, #2662). */
|
|
111
|
+
admit(id: string, limits?: OfficeShareRate): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* #2662: whole seconds (1–60) until admit() would let the key in again — when enough of this minute's requests, and of
|
|
114
|
+
* its bytes, have left it. For Retry-After.
|
|
115
|
+
*/
|
|
116
|
+
retryAfter(id: string, limits?: OfficeShareRate): number;
|
|
117
|
+
/** What the admitted request answered, in bytes. */
|
|
118
|
+
sent(id: string, bytes: number): void;
|
|
119
|
+
forget(id: string): void;
|
|
120
|
+
private window;
|
|
121
|
+
}
|
|
122
|
+
/** Where a share's picture is read from: the fleet's own reads, as they are now. */
|
|
123
|
+
export interface OfficeShareSource {
|
|
124
|
+
/** The status frame (getUiStatus): its `instances`. */
|
|
125
|
+
status(): unknown;
|
|
126
|
+
/** The org chart (orgChart): `general` and `teams`. */
|
|
127
|
+
org(): {
|
|
128
|
+
general?: unknown;
|
|
129
|
+
teams?: unknown;
|
|
130
|
+
};
|
|
131
|
+
/** The stored offices (web-office-store.ts list()). */
|
|
132
|
+
offices(): {
|
|
133
|
+
rev: number;
|
|
134
|
+
offices: Office[];
|
|
135
|
+
};
|
|
136
|
+
/** The live acts (OfficeActs live()). */
|
|
137
|
+
acts(): OfficeAct[];
|
|
138
|
+
/** /ui/traffic's snapshot. */
|
|
139
|
+
traffic(): {
|
|
140
|
+
now: string;
|
|
141
|
+
items: unknown[];
|
|
142
|
+
delegations?: unknown[];
|
|
143
|
+
};
|
|
144
|
+
/** The instances "Needs you" names now (one entry per item). */
|
|
145
|
+
needs(): string[];
|
|
146
|
+
/** cross_instance_visibility "hidden" now. */
|
|
147
|
+
hidden(name: string): boolean;
|
|
148
|
+
/** The skin packs the host keeps (web-office-skins.ts). */
|
|
149
|
+
skins?: {
|
|
150
|
+
list(): {
|
|
151
|
+
packs: Array<{
|
|
152
|
+
id: string;
|
|
153
|
+
files?: number;
|
|
154
|
+
bytes?: number;
|
|
155
|
+
}>;
|
|
156
|
+
} & Record<string, unknown>;
|
|
157
|
+
get(id: string): unknown;
|
|
158
|
+
picture(id: string, sha: string): Buffer | null;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* One share's picture, read once from `src`: who is in it (`scope`), and each read the page makes, cut to them.
|
|
163
|
+
* `offices`: the shared office, or every stored office; `null` when the shared office is gone (the share then shows
|
|
164
|
+
* nothing and its owner is told it ended).
|
|
165
|
+
*/
|
|
166
|
+
export declare class OfficeShareView {
|
|
167
|
+
private readonly share;
|
|
168
|
+
private readonly src;
|
|
169
|
+
readonly offices: Office[] | null;
|
|
170
|
+
readonly scope: ReadonlySet<string>;
|
|
171
|
+
private readonly people;
|
|
172
|
+
/** fleet.yaml's teams with someone shown, each with only its shown members. */
|
|
173
|
+
private readonly teams;
|
|
174
|
+
constructor(share: Pick<OfficeShare, "office" | "text"> & Partial<Pick<OfficeShare, "expiresAt">>, src: OfficeShareSource);
|
|
175
|
+
/** The status frame as the page's app store takes it, and the chart's structure (no descriptions, threads or info). */
|
|
176
|
+
state(): Record<string, unknown>;
|
|
177
|
+
/**
|
|
178
|
+
* /ui/offices's answer, the shared office (or all) only, each cut to the share (#2637 review): its members only those
|
|
179
|
+
* shown (an instance, or a team with someone shown; NOBODY when none is), and a seat kept for someone not shown keeps
|
|
180
|
+
* its place but not the name. The stored offices are never changed.
|
|
181
|
+
*/
|
|
182
|
+
officeList(): {
|
|
183
|
+
rev: number;
|
|
184
|
+
offices: Office[];
|
|
185
|
+
readable: boolean;
|
|
186
|
+
};
|
|
187
|
+
/** /ui/office-acts's answer: the acts of the people shown, in a shown office, without their line unless shared. */
|
|
188
|
+
acts(): {
|
|
189
|
+
acts: OfficeAct[];
|
|
190
|
+
now: number;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* A pack's answer as this share gets it (#2637 review): its manifest's instance names cut to the share — `byInstance`
|
|
194
|
+
* only for people shown, a furniture item's `activeFor` only them (none left: [], which watches nobody, never the
|
|
195
|
+
* missing key, which watches everyone). #2662: and only the character sets someone shown wears (theirs in `byInstance`,
|
|
196
|
+
* and `default` for everyone else), with `files` only the pictures it still names: the page loads what is drawn, not
|
|
197
|
+
* every set of a fleet-sized pack. A copy: the kept pack is never changed.
|
|
198
|
+
*/
|
|
199
|
+
pack(answer: unknown): unknown;
|
|
200
|
+
/** The packs the shown offices are drawn in (a pack no shown office names is not offered). */
|
|
201
|
+
skinIds(): Set<string>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* #2662: a share's minute of pack pictures — OFFICE_SHARE_LIMITS.pictureLoads times the files and bytes of the packs its
|
|
205
|
+
* offices are drawn in (the host's own count of each), at least the floors. Read from the stored offices and the pack
|
|
206
|
+
* list only (cheap: it is asked before a picture is admitted).
|
|
207
|
+
*/
|
|
208
|
+
export declare function sharePictureRate(share: Pick<OfficeShare, "office">, offices: Office[], packs: Array<{
|
|
209
|
+
id: string;
|
|
210
|
+
files?: number;
|
|
211
|
+
bytes?: number;
|
|
212
|
+
}>): OfficeShareRate;
|
|
213
|
+
export interface OfficeShareGateway {
|
|
214
|
+
readonly server: Server;
|
|
215
|
+
readonly readinessMarker: string;
|
|
216
|
+
listen(): Promise<URL>;
|
|
217
|
+
setHost(host: string | null): void;
|
|
218
|
+
close(): void;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* The share tunnel's gateway. GET and HEAD only, on this tunnel's own Host; `/ready` for the tunnel's probe; then
|
|
222
|
+
* `/o/<token>` and its reads, for an open share within its limits:
|
|
223
|
+
*
|
|
224
|
+
* /o/<t> the page (`page`; 404 while there is none)
|
|
225
|
+
* /o/<t>/state OfficeShareView.state()
|
|
226
|
+
* /o/<t>/offices OfficeShareView.officeList()
|
|
227
|
+
* /o/<t>/office-acts OfficeShareView.acts()
|
|
228
|
+
* /o/<t>/office-skins the packs the shown offices use
|
|
229
|
+
* /o/<t>/office-skins/<id> one of them, its instance names cut to the share (never cached)
|
|
230
|
+
* /o/<t>/office-skins/<id>/img/<sha>.png its picture (immutable)
|
|
231
|
+
*
|
|
232
|
+
* and, with no token, the page's static files at the dashboard's own paths (`statics`: `/assets/<name>`, `/ui/js/<name>`;
|
|
233
|
+
* office-share-page.ts names them), limited together (OFFICE_SHARE_LIMITS.static*).
|
|
234
|
+
*
|
|
235
|
+
* Anything else, an unknown or ended token, an office since deleted: an empty 404 (no word on why: a stranger learns
|
|
236
|
+
* nothing). Over the limit: 429. The share is asked again before each answer is sent. No cookie is read or set and
|
|
237
|
+
* nothing is logged per request.
|
|
238
|
+
*/
|
|
239
|
+
export declare function createOfficeShareGateway(opts: {
|
|
240
|
+
shares: Pick<OfficeShares, "find">;
|
|
241
|
+
source: OfficeShareSource;
|
|
242
|
+
limiter?: OfficeShareLimiter;
|
|
243
|
+
/** The page for a share (HTML), or null while there is none. */
|
|
244
|
+
page?(share: OfficeShare, token: string): {
|
|
245
|
+
body: string;
|
|
246
|
+
csp: string;
|
|
247
|
+
} | null;
|
|
248
|
+
/** A static file of the page by its path (`/assets/…`, `/ui/js/…`), or null. */
|
|
249
|
+
statics?(path: string): {
|
|
250
|
+
body: Buffer;
|
|
251
|
+
type: string;
|
|
252
|
+
} | null;
|
|
253
|
+
staticLimiter?: OfficeShareLimiter;
|
|
254
|
+
/** #2662: the shares' pack pictures, each share's minute sized by its packs (sharePictureRate). */
|
|
255
|
+
pictureLimiter?: OfficeShareLimiter;
|
|
256
|
+
create?: typeof createServer;
|
|
257
|
+
marker?: string;
|
|
258
|
+
}): OfficeShareGateway;
|