@songsid/agend 2.3.2-beta.9 → 2.3.3-beta.1

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 (285) hide show
  1. package/README.md +6 -0
  2. package/README.zh-TW.md +6 -0
  3. package/dist/agent-cli-instructions.md +2 -2
  4. package/dist/agent-cli.js +48 -0
  5. package/dist/agent-cli.js.map +1 -1
  6. package/dist/agent-endpoint.js +6 -0
  7. package/dist/agent-endpoint.js.map +1 -1
  8. package/dist/agent-whats-new.d.ts +21 -0
  9. package/dist/agent-whats-new.js +53 -21
  10. package/dist/agent-whats-new.js.map +1 -1
  11. package/dist/auth-api.js +2 -0
  12. package/dist/auth-api.js.map +1 -1
  13. package/dist/backend/claude-code.d.ts +13 -1
  14. package/dist/backend/claude-code.js +43 -2
  15. package/dist/backend/claude-code.js.map +1 -1
  16. package/dist/backend/codex-session-lookup.d.ts +15 -0
  17. package/dist/backend/codex-session-lookup.js +58 -0
  18. package/dist/backend/codex-session-lookup.js.map +1 -1
  19. package/dist/backend/codex.js +15 -4
  20. package/dist/backend/codex.js.map +1 -1
  21. package/dist/backend/kiro-classic-archive.d.ts +57 -0
  22. package/dist/backend/kiro-classic-archive.js +622 -0
  23. package/dist/backend/kiro-classic-archive.js.map +1 -0
  24. package/dist/backend/kiro-classic-links.d.ts +24 -0
  25. package/dist/backend/kiro-classic-links.js +135 -0
  26. package/dist/backend/kiro-classic-links.js.map +1 -0
  27. package/dist/backend/kiro-identity.d.ts +100 -1
  28. package/dist/backend/kiro-identity.js +262 -31
  29. package/dist/backend/kiro-identity.js.map +1 -1
  30. package/dist/backend/kiro-migration-verify.d.ts +10 -0
  31. package/dist/backend/kiro-migration-verify.js +52 -0
  32. package/dist/backend/kiro-migration-verify.js.map +1 -0
  33. package/dist/backend/kiro-reconcile-store.d.ts +27 -0
  34. package/dist/backend/kiro-reconcile-store.js +351 -0
  35. package/dist/backend/kiro-reconcile-store.js.map +1 -0
  36. package/dist/backend/kiro-v2-store-worker.js +35 -1
  37. package/dist/backend/kiro-v2-store-worker.js.map +1 -1
  38. package/dist/backend/kiro-v2-store.d.ts +31 -1
  39. package/dist/backend/kiro-v2-store.js +22 -12
  40. package/dist/backend/kiro-v2-store.js.map +1 -1
  41. package/dist/backend/kiro.d.ts +124 -6
  42. package/dist/backend/kiro.js +553 -39
  43. package/dist/backend/kiro.js.map +1 -1
  44. package/dist/backend/types.d.ts +109 -4
  45. package/dist/backend/types.js +9 -0
  46. package/dist/backend/types.js.map +1 -1
  47. package/dist/cache-service.d.ts +13 -1
  48. package/dist/cache-service.js +45 -2
  49. package/dist/cache-service.js.map +1 -1
  50. package/dist/channel/ipc-timeouts.js +3 -0
  51. package/dist/channel/ipc-timeouts.js.map +1 -1
  52. package/dist/channel/mcp-tools.js +40 -5
  53. package/dist/channel/mcp-tools.js.map +1 -1
  54. package/dist/channel/tool-router.js +2 -1
  55. package/dist/channel/tool-router.js.map +1 -1
  56. package/dist/classic-channel-manager.d.ts +6 -0
  57. package/dist/classic-channel-manager.js +25 -0
  58. package/dist/classic-channel-manager.js.map +1 -1
  59. package/dist/cli.js +52 -6
  60. package/dist/cli.js.map +1 -1
  61. package/dist/config-validator.d.ts +7 -1
  62. package/dist/config-validator.js +20 -9
  63. package/dist/config-validator.js.map +1 -1
  64. package/dist/config.js +2 -0
  65. package/dist/config.js.map +1 -1
  66. package/dist/cross-instance-envelope.d.ts +10 -5
  67. package/dist/cross-instance-envelope.js +20 -17
  68. package/dist/cross-instance-envelope.js.map +1 -1
  69. package/dist/daemon.d.ts +125 -63
  70. package/dist/daemon.js +694 -330
  71. package/dist/daemon.js.map +1 -1
  72. package/dist/dashboard-permissions.d.ts +15 -4
  73. package/dist/dashboard-permissions.js +49 -23
  74. package/dist/dashboard-permissions.js.map +1 -1
  75. package/dist/delivery-outbox.d.ts +27 -22
  76. package/dist/delivery-outbox.js +109 -161
  77. package/dist/delivery-outbox.js.map +1 -1
  78. package/dist/delivery-outbox.test.js +10 -25
  79. package/dist/delivery-outbox.test.js.map +1 -1
  80. package/dist/doctor.js +2 -1
  81. package/dist/doctor.js.map +1 -1
  82. package/dist/fleet-control-audit.d.ts +1 -1
  83. package/dist/fleet-control-audit.js +3 -0
  84. package/dist/fleet-control-audit.js.map +1 -1
  85. package/dist/fleet-manager.d.ts +94 -15
  86. package/dist/fleet-manager.js +597 -133
  87. package/dist/fleet-manager.js.map +1 -1
  88. package/dist/forged-envelope-scan.d.ts +9 -0
  89. package/dist/forged-envelope-scan.js +30 -5
  90. package/dist/forged-envelope-scan.js.map +1 -1
  91. package/dist/general-instance.d.ts +24 -0
  92. package/dist/general-instance.js +53 -0
  93. package/dist/general-instance.js.map +1 -1
  94. package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +1 -1
  95. package/dist/general-knowledge/skills/docker-install/SKILL.md +25 -0
  96. package/dist/general-knowledge/skills/fleet-config/SKILL.md +5 -3
  97. package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -1
  98. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +34 -0
  99. package/dist/general-knowledge/skills/session-management/SKILL.md +2 -2
  100. package/dist/general-knowledge/skills/tui-effort/SKILL.md +1 -1
  101. package/dist/general-knowledge/skills/web-appearance/SKILL.canvas-worker-off.md +32 -0
  102. package/dist/general-knowledge/skills/web-appearance/SKILL.md +32 -0
  103. package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +57 -17
  104. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +57 -17
  105. package/dist/instance-config-impact.js +3 -2
  106. package/dist/instance-config-impact.js.map +1 -1
  107. package/dist/instance-lifecycle.d.ts +4 -0
  108. package/dist/instance-lifecycle.js +28 -5
  109. package/dist/instance-lifecycle.js.map +1 -1
  110. package/dist/instructions.js +6 -7
  111. package/dist/instructions.js.map +1 -1
  112. package/dist/kiro-migrate.d.ts +19 -2
  113. package/dist/kiro-migrate.js +133 -35
  114. package/dist/kiro-migrate.js.map +1 -1
  115. package/dist/kiro-reconcile.d.ts +21 -0
  116. package/dist/kiro-reconcile.js +88 -0
  117. package/dist/kiro-reconcile.js.map +1 -0
  118. package/dist/kiro-session-proof.d.ts +41 -0
  119. package/dist/kiro-session-proof.js +89 -0
  120. package/dist/kiro-session-proof.js.map +1 -0
  121. package/dist/kiro-tui-forensic.d.ts +19 -0
  122. package/dist/kiro-tui-forensic.js +124 -0
  123. package/dist/kiro-tui-forensic.js.map +1 -0
  124. package/dist/locale.js +202 -16
  125. package/dist/locale.js.map +1 -1
  126. package/dist/log-service.js +3 -3
  127. package/dist/log-service.js.map +1 -1
  128. package/dist/needs-you.d.ts +3 -1
  129. package/dist/needs-you.js +4 -2
  130. package/dist/needs-you.js.map +1 -1
  131. package/dist/office-levels.d.ts +64 -0
  132. package/dist/office-levels.js +66 -0
  133. package/dist/office-levels.js.map +1 -0
  134. package/dist/office-share-page.d.ts +3 -1
  135. package/dist/office-share-page.js +8 -3
  136. package/dist/office-share-page.js.map +1 -1
  137. package/dist/office-share-service.d.ts +6 -3
  138. package/dist/office-share-service.js +12 -8
  139. package/dist/office-share-service.js.map +1 -1
  140. package/dist/office-share.d.ts +45 -8
  141. package/dist/office-share.js +75 -15
  142. package/dist/office-share.js.map +1 -1
  143. package/dist/outbound-handlers.js +21 -2
  144. package/dist/outbound-handlers.js.map +1 -1
  145. package/dist/outbound-schemas.d.ts +47 -2
  146. package/dist/outbound-schemas.js +42 -3
  147. package/dist/outbound-schemas.js.map +1 -1
  148. package/dist/public-web-gateway.js +1 -1
  149. package/dist/public-web-gateway.js.map +1 -1
  150. package/dist/quickstart-api.d.ts +39 -1
  151. package/dist/quickstart-api.js +115 -17
  152. package/dist/quickstart-api.js.map +1 -1
  153. package/dist/remote-card-answer.d.ts +83 -0
  154. package/dist/remote-card-answer.js +208 -0
  155. package/dist/remote-card-answer.js.map +1 -0
  156. package/dist/remote-card-prompt.d.ts +38 -0
  157. package/dist/remote-card-prompt.js +86 -0
  158. package/dist/remote-card-prompt.js.map +1 -0
  159. package/dist/scheduler/task-board.d.ts +44 -17
  160. package/dist/scheduler/task-board.js +95 -36
  161. package/dist/scheduler/task-board.js.map +1 -1
  162. package/dist/sd-notify.d.ts +13 -14
  163. package/dist/sd-notify.js +62 -28
  164. package/dist/sd-notify.js.map +1 -1
  165. package/dist/service-installer.d.ts +13 -0
  166. package/dist/service-installer.js +15 -0
  167. package/dist/service-installer.js.map +1 -1
  168. package/dist/service-owner.d.ts +25 -0
  169. package/dist/service-owner.js +43 -2
  170. package/dist/service-owner.js.map +1 -1
  171. package/dist/settings-api.d.ts +2 -1
  172. package/dist/settings-api.js +19 -26
  173. package/dist/settings-api.js.map +1 -1
  174. package/dist/settings-change.js +10 -5
  175. package/dist/settings-change.js.map +1 -1
  176. package/dist/settings-effect.js +7 -6
  177. package/dist/settings-effect.js.map +1 -1
  178. package/dist/settings-instance-patch.js +1 -1
  179. package/dist/settings-instance-patch.js.map +1 -1
  180. package/dist/setup-form.d.ts +2 -2
  181. package/dist/setup-form.js +139 -93
  182. package/dist/setup-form.js.map +1 -1
  183. package/dist/setup-i18n.d.ts +25 -0
  184. package/dist/setup-i18n.js +226 -0
  185. package/dist/setup-i18n.js.map +1 -0
  186. package/dist/task-board-waker.d.ts +40 -1
  187. package/dist/task-board-waker.js +115 -9
  188. package/dist/task-board-waker.js.map +1 -1
  189. package/dist/tmux-control.d.ts +1 -1
  190. package/dist/tmux-control.js +3 -2
  191. package/dist/tmux-control.js.map +1 -1
  192. package/dist/tmux-manager.js +18 -16
  193. package/dist/tmux-manager.js.map +1 -1
  194. package/dist/tmux-read.d.ts +2 -0
  195. package/dist/tmux-read.js +7 -1
  196. package/dist/tmux-read.js.map +1 -1
  197. package/dist/tool-permissions.js +18 -0
  198. package/dist/tool-permissions.js.map +1 -1
  199. package/dist/topic-commands.d.ts +2 -0
  200. package/dist/topic-commands.js +2 -1
  201. package/dist/topic-commands.js.map +1 -1
  202. package/dist/transcript-sources.d.ts +1 -0
  203. package/dist/transcript-sources.js +20 -3
  204. package/dist/transcript-sources.js.map +1 -1
  205. package/dist/types.d.ts +11 -5
  206. package/dist/ui/backend-signin.js +4 -3
  207. package/dist/ui/chat-store.js +3 -2
  208. package/dist/ui/chat-strings.js +2 -2
  209. package/dist/ui/fleet-office-card.js +114 -0
  210. package/dist/ui/fleet-office-editor.js +81 -9
  211. package/dist/ui/fleet-office-layout.js +56 -11
  212. package/dist/ui/fleet-office-levels.js +105 -0
  213. package/dist/ui/fleet-office-model.js +9 -1
  214. package/dist/ui/fleet-office-pack.d.ts +15 -3
  215. package/dist/ui/fleet-office-pack.js +177 -23
  216. package/dist/ui/fleet-office-skin.js +39 -3
  217. package/dist/ui/fleet-office-store.js +74 -3
  218. package/dist/ui/fleet-office-view.js +8 -0
  219. package/dist/ui/fleet-office-zones.js +102 -19
  220. package/dist/ui/fleet-office.js +308 -44
  221. package/dist/ui/fleet-org.js +2 -0
  222. package/dist/ui/fleet-task-card.js +2 -2
  223. package/dist/ui/fleet-task-common.js +30 -7
  224. package/dist/ui/fleet-task-work.js +2 -2
  225. package/dist/ui/fleet-tasks.js +10 -11
  226. package/dist/ui/office-share-dialog.js +31 -7
  227. package/dist/ui/office-share-page.js +1 -0
  228. package/dist/ui/panel-chat.js +14 -2
  229. package/dist/ui/panel-log.js +6 -6
  230. package/dist/ui/panel-needs.js +1 -1
  231. package/dist/ui/panel-settings.js +16 -8
  232. package/dist/ui/settings-appearance.js +3 -35
  233. package/dist/ui/settings-discord.js +3 -2
  234. package/dist/ui/settings-guests.js +17 -7
  235. package/dist/ui/settings-model.js +17 -9
  236. package/dist/ui/settings-registry.js +1 -1
  237. package/dist/ui/settings-strings.js +18 -6
  238. package/dist/ui/settings-token.js +3 -2
  239. package/dist/ui/settings-wizard.js +25 -9
  240. package/dist/ui/shared/app-i18n.js +2 -2
  241. package/dist/ui/shared/app-stream.js +1 -1
  242. package/dist/ui/shared/app.css +70 -2
  243. package/dist/ui/shared/setup-host-text.js +107 -0
  244. package/dist/ui/structured-signin.js +89 -38
  245. package/dist/update-check.d.ts +13 -4
  246. package/dist/update-check.js +17 -4
  247. package/dist/update-check.js.map +1 -1
  248. package/dist/usage-rollup.d.ts +34 -3
  249. package/dist/usage-rollup.js +56 -3
  250. package/dist/usage-rollup.js.map +1 -1
  251. package/dist/web-api.d.ts +10 -1
  252. package/dist/web-api.js +207 -17
  253. package/dist/web-api.js.map +1 -1
  254. package/dist/web-auth.js +1 -1
  255. package/dist/web-auth.js.map +1 -1
  256. package/dist/web-experimental.d.ts +6 -2
  257. package/dist/web-experimental.js +8 -4
  258. package/dist/web-experimental.js.map +1 -1
  259. package/dist/web-office-acts.d.ts +5 -2
  260. package/dist/web-office-acts.js +9 -4
  261. package/dist/web-office-acts.js.map +1 -1
  262. package/dist/web-office-pack-read.d.ts +35 -0
  263. package/dist/web-office-pack-read.js +252 -0
  264. package/dist/web-office-pack-read.js.map +1 -0
  265. package/dist/web-office-pack-tools.d.ts +241 -0
  266. package/dist/web-office-pack-tools.js +785 -0
  267. package/dist/web-office-pack-tools.js.map +1 -0
  268. package/dist/web-office-skins.d.ts +68 -4
  269. package/dist/web-office-skins.js +324 -33
  270. package/dist/web-office-skins.js.map +1 -1
  271. package/dist/web-office-store.d.ts +47 -4
  272. package/dist/web-office-store.js +124 -23
  273. package/dist/web-office-store.js.map +1 -1
  274. package/dist/web-settings-patch.d.ts +3 -2
  275. package/dist/web-settings-patch.js +7 -5
  276. package/dist/web-settings-patch.js.map +1 -1
  277. package/dist/workflow-templates/default.md +3 -3
  278. package/dist/working-recovery.d.ts +0 -2
  279. package/dist/working-recovery.js +2 -23
  280. package/dist/working-recovery.js.map +1 -1
  281. package/package.json +2 -2
  282. package/templates/windows-shortcuts.ps1 +18 -17
  283. package/dist/upgrade-notices.d.ts +0 -17
  284. package/dist/upgrade-notices.js +0 -93
  285. package/dist/upgrade-notices.js.map +0 -1
@@ -0,0 +1,241 @@
1
+ import { type CheckedPack } from "./ui/fleet-office-pack.js";
2
+ import { type OfficeSkinStore } from "./web-office-skins.js";
3
+ import type { Office, OfficeStore } from "./web-office-store.js";
4
+ export declare const OFFICE_PACK_TOOL_LIMITS: {
5
+ readonly batchesPerHour: 20;
6
+ readonly bytesPerHour: number;
7
+ /** Pending changes waiting for an admin's yes: at most 8 in the fleet, 200 MiB of pictures, each for 24 hours. */
8
+ readonly pending: 8;
9
+ readonly pendingBytes: number;
10
+ readonly pendingMs: number;
11
+ /** #2695: office_pack_check's own hourly budget, in wire bytes (one full batch fits several times). */
12
+ readonly checkBatchesPerHour: 60;
13
+ readonly checkBytesPerHour: number;
14
+ /** The log keeps its newest entries: at most this many lines once it passes 512 KiB. */
15
+ readonly logLines: 500;
16
+ readonly logBytes: number;
17
+ };
18
+ export declare const OFFICE_PACK_APPROVALS: readonly ["apply", "approve"];
19
+ export type OfficePackApproval = typeof OFFICE_PACK_APPROVALS[number];
20
+ /** Until an admin chooses: every change waits for a yes. */
21
+ export declare const OFFICE_PACK_APPROVAL_DEFAULT: OfficePackApproval;
22
+ /** The built-in styles an office may be drawn in besides a kept pack (fleet-office-skin.js BUILT_IN_SKINS). */
23
+ export declare const BUILT_IN_STYLES: readonly ["pixel", "studio", "cozy"];
24
+ export declare const OFFICE_PACK_TOOLS: readonly ["office_pack_check", "office_pack_upload", "office_pack_delete", "office_pack_restore", "office_pack_list", "office_set_style"];
25
+ export type OfficePackAnswer = Record<string, unknown>;
26
+ export declare const mib: (bytes: number) => string;
27
+ /**
28
+ * One office's override entry that does not fit a pack: `entry` is what is dropped — "seats.desks", "furniture.rack",
29
+ * "furnitureNight.rack", one seat's reservation "seatFor.desks.0" (#2691), or "seatFor.desks" for an area's empty
30
+ * reservation map. "overrides" (UNDROPPABLE) when the layout fails as a whole but no single entry does: never dropped.
31
+ */
32
+ export interface OverrideConflict {
33
+ office: string;
34
+ name: string;
35
+ entry: string;
36
+ rule: string;
37
+ }
38
+ /** A conflict no exact drop clears: the change is refused even with drop_invalid_overrides (never a whole layout lost). */
39
+ export declare const UNDROPPABLE = "overrides";
40
+ export declare const undroppable: (conflicts: readonly OverrideConflict[]) => boolean;
41
+ /**
42
+ * Each stored office whose overrides were made on `pack` (overrides.pack: the ones PUT /ui/offices checks against it),
43
+ * put on it whole (applyOverrides, as that save does — every entry, the reservations too), and where that fails entry
44
+ * by entry: what does not fit. When the entries found are dropped the rest must fit whole; if not (a rule between
45
+ * entries), the office's conflict is UNDROPPABLE instead, and the change is refused.
46
+ */
47
+ export declare function overrideConflicts(offices: readonly Office[], pack: CheckedPack): OverrideConflict[];
48
+ /** The offices with exactly those entries dropped (an office left with nothing but `pack` loses its overrides). An UNDROPPABLE conflict is never passed here. */
49
+ export declare function dropConflicts(offices: readonly Office[], conflicts: readonly OverrideConflict[]): Office[];
50
+ /** How many dropped entries a notice names; the rest are counted. */
51
+ export declare const DROPS_SHOWN = 6;
52
+ /**
53
+ * What a change drops, for its notice (an admin approving from General sees it): the count, then each office with its
54
+ * entries — "Ops: seats.desks, furniture.rack; Den: …" — the first DROPS_SHOWN entries, "…and N more" after them.
55
+ */
56
+ export declare function dropsText(conflicts: readonly OverrideConflict[]): string;
57
+ /** How much one agent may change: batches and bytes an hour (accepted calls only; a monotonic clock; memory only). */
58
+ export declare class OfficePackBatchLimiter {
59
+ private readonly now;
60
+ private readonly limits;
61
+ private readonly batches;
62
+ constructor(now?: () => number, limits?: {
63
+ batchesPerHour: number;
64
+ bytesPerHour: number;
65
+ });
66
+ private recent;
67
+ /** Whether a batch of `bytes` may go now; else the ms until it may (never: larger than the hour's budget). */
68
+ check(instance: string, bytes: number): {
69
+ ok: true;
70
+ } | {
71
+ ok: false;
72
+ retry_after_ms: number | null;
73
+ why: string;
74
+ };
75
+ record(instance: string, bytes: number): void;
76
+ /** What is left of the hour's budget. */
77
+ left(instance: string): {
78
+ batches: number;
79
+ bytes: number;
80
+ };
81
+ forget(instance: string): void;
82
+ }
83
+ /**
84
+ * The receiving side of web-office-pack-read.ts's parts: one unfinished batch per instance and tool, dropped after a
85
+ * minute without a part; at most 8 at once and twice a batch's wire size in memory. The caller is the connection's
86
+ * instance, never a field of a part; no path is ever accepted.
87
+ */
88
+ export declare class OfficePackUploads {
89
+ private readonly clock;
90
+ private readonly pending;
91
+ constructor(clock?: () => number);
92
+ forget(instance: string): void;
93
+ /** `admit`: asked once a batch's first part is valid, with the batch's wire bytes; an answer refuses the batch. */
94
+ accept(instance: string, tool: string, args: Record<string, unknown>, admit?: (bytes: number) => OfficePackAnswer | null): {
95
+ done: false;
96
+ answer: OfficePackAnswer;
97
+ } | {
98
+ done: true;
99
+ doc: unknown;
100
+ options: Record<string, unknown>;
101
+ };
102
+ }
103
+ /** A pending change's view (no picture bytes): the page, the notice and office_pack_list show it. */
104
+ export interface PackChangeView {
105
+ id: string;
106
+ instance: string;
107
+ at: number;
108
+ expires_at: number;
109
+ action: "upload" | "delete" | "restore" | "style";
110
+ packs: Array<{
111
+ id: string;
112
+ name: string;
113
+ files?: number;
114
+ bytes?: number;
115
+ replaces?: string | null;
116
+ }>;
117
+ office?: string;
118
+ style?: string;
119
+ keep_previous?: boolean;
120
+ drop_invalid_overrides?: boolean;
121
+ drops?: OverrideConflict[];
122
+ }
123
+ export interface PackLogEntry {
124
+ at: string;
125
+ by: string;
126
+ action: string;
127
+ pack?: string;
128
+ name?: string;
129
+ version?: string;
130
+ files?: number;
131
+ bytes?: number;
132
+ manifest_sha256?: string;
133
+ pictures?: Record<string, string>;
134
+ previous_kept?: boolean;
135
+ replaced_version?: string | null;
136
+ office?: string;
137
+ style?: string;
138
+ dropped_overrides?: OverrideConflict[];
139
+ change?: string;
140
+ approved_by?: string;
141
+ approval?: string;
142
+ outcome?: string;
143
+ }
144
+ export interface OfficePackToolsDeps {
145
+ skins: OfficeSkinStore;
146
+ offices: OfficeStore;
147
+ /** The agents whose `office_packs` feature is on (the Office page shows them). */
148
+ allowedAgents(): string[];
149
+ /** Tell the fleet's admins (General): one short message; with `pending`, the change waits for their yes (buttons). */
150
+ notice(text: string, pending?: PackChangeView): void;
151
+ /** A pending change was decided or expired (its notice's buttons are retired with `text`). */
152
+ settled(id: string, text: string): void;
153
+ /** What changed, for every page: the packs' rev, the offices' rev, the agent changes (pending, approval, log). */
154
+ changed(what: {
155
+ skins?: string;
156
+ offices?: number;
157
+ changes?: boolean;
158
+ }): void;
159
+ logger?: {
160
+ info(obj: object, msg: string): void;
161
+ warn(obj: object, msg: string): void;
162
+ };
163
+ }
164
+ export declare class OfficePackTools {
165
+ private readonly deps;
166
+ readonly limiter: OfficePackBatchLimiter;
167
+ /** #2695: office_pack_check's budget (wire bytes), apart from the changes'. */
168
+ readonly checkLimiter: OfficePackBatchLimiter;
169
+ readonly uploads: OfficePackUploads;
170
+ private readonly pending;
171
+ private readonly now;
172
+ private approvalCache;
173
+ constructor(deps: OfficePackToolsDeps, opts?: {
174
+ limiter?: OfficePackBatchLimiter;
175
+ checkLimiter?: OfficePackBatchLimiter;
176
+ uploads?: OfficePackUploads;
177
+ now?: () => number;
178
+ });
179
+ private get settingsPath();
180
+ private get logPath();
181
+ /** The admins' choice: "apply" (at once) or "approve" (a pending change until an admin's yes). Kept beside the packs. */
182
+ approval(): OfficePackApproval;
183
+ setApproval(mode: unknown, by: string): {
184
+ ok: true;
185
+ approval: OfficePackApproval;
186
+ } | {
187
+ ok: false;
188
+ error: string;
189
+ };
190
+ /** Append one entry to the log (and the fleet log); the newest are kept once it grows past its cap. */
191
+ private log;
192
+ /** The newest log entries first. */
193
+ logEntries(limit?: number): PackLogEntry[];
194
+ /** A version's digests: the manifest's sha256 and each picture's (its kept bytes), from the upload or from disk. */
195
+ private digest;
196
+ private recordOf;
197
+ private sweep;
198
+ /** The pending changes (all, or one agent's). */
199
+ pendingViews(instance?: string): PackChangeView[];
200
+ /** GET /ui/office-pack-changes: what the Office page shows an admin. */
201
+ changes(): {
202
+ approval: OfficePackApproval;
203
+ agents: string[];
204
+ pending: PackChangeView[];
205
+ log: PackLogEntry[];
206
+ };
207
+ /** The tool call, from the instance its connection (or agent token) belongs to. */
208
+ handle(instance: string, tool: string, args: Record<string, unknown>): OfficePackAnswer;
209
+ /** #2695: a check's batch counts against its own budget as it starts (refused before any more of it arrives). */
210
+ private admitCheck;
211
+ private list;
212
+ /** The batch document, each pack checked as the web upload checks it. */
213
+ private decode;
214
+ /** Whether the checked packs may go in now: the pack count, the disk budget, the offices' overrides. */
215
+ private fit;
216
+ private check;
217
+ /** A change from an agent: judged, counted, then applied at once or held for an admin's yes. */
218
+ private submit;
219
+ private logFields;
220
+ /** What a change would do, or why it cannot: the packs it names (for the view), the override entries it drops. */
221
+ private judge;
222
+ /** Make the change (judged again first). Its answer for the agent, and a one-line summary for the notice. */
223
+ private apply;
224
+ /**
225
+ * An admin's yes or no on a pending change (the Office page, or the notice's buttons). A yes judges it again and
226
+ * applies it; what happened is the answer (and the notice's new text).
227
+ */
228
+ decide(id: string, decision: "approve" | "reject", by: string): {
229
+ ok: true;
230
+ text: string;
231
+ applied?: OfficePackAnswer;
232
+ } | {
233
+ ok: false;
234
+ status: 404 | 409;
235
+ error: string;
236
+ text: string;
237
+ };
238
+ forget(instance: string): void;
239
+ }
240
+ /** One line for a notice: what a pending change would do. */
241
+ export declare function summaryOf(v: PackChangeView): string;