Merge branch 'codex/speko-voice-runtime' into codex/speko-voice-ui

* codex/speko-voice-runtime:
  feat(costs): report monthly subscriptions beside API spend (#15634)
  Fix Dot Cloud invitation and anonymous consent setup (#15722)
  refactor(heartbeat): extract scheduling and monitor recovery (#15717)
This commit is contained in:
Dotta committed 2026-10-09 15:46:42 -05:00
commit 7f044b4d8a
65 files changed
+5336 -56682

No files matched your search

+18
View File
@@ -43,6 +43,24 @@ afterEach(() => {
});
describe("tenant-session recovery", () => {
it("loads anonymous Dot consent despite concurrent protected background probes", async () => {
const reload = vi.fn();
const requestId = `pcmcp_request_${"a".repeat(43)}`;
const recovery = createTenantSessionRecoveryCoordinator(reload, () => `/dot-connect/${requestId}`);
vi.spyOn(tenantSessionRecovery, "recoverIfNeeded").mockImplementation(recovery.recoverIfNeeded);
fetchMock.mockImplementation((url: string) => Promise.resolve(
url.includes("/dot-mcp/requests/")
? jsonResponse({ id: requestId, agentConnection: true })
: errorResponse({ error: "tenant_session_required" }),
));
const background = api.get("/health");
const consent = api.get(`/dot-mcp/requests/${requestId}`);
await expect(background).rejects.toMatchObject({ status: 401 });
await expect(consent).resolves.toEqual({ id: requestId, agentConnection: true });
expect(reload).not.toHaveBeenCalled();
});
it("keeps concurrent failures pending and schedules one top-level reload", async () => {
const reload = vi.fn();
const recovery = createTenantSessionRecoveryCoordinator(reload);
+17
View File
@@ -0,0 +1,17 @@
import type { SubscriptionCostReport, UpdateSubscriptionPrice } from "@paperclipai/shared";
import { api } from "./client";
export const subscriptionsApi = {
report(companyId: string, from?: string, to?: string) {
const query = new URLSearchParams();
if (from) query.set("from", from);
if (to) query.set("to", to);
if (!from && !to) query.set("period", "all");
return api.get<SubscriptionCostReport>(`/companies/${companyId}/costs/subscriptions?${query}`);
},
refresh: (companyId: string) => api.post<{ status: string }>(`/companies/${companyId}/costs/subscriptions/refresh`, {}),
update: (companyId: string, id: string, input: UpdateSubscriptionPrice) =>
api.patch(`/companies/${companyId}/costs/subscriptions/${id}`, input),
link: (companyId: string, id: string, targetId: string, expectedRevision: number, targetRevision: number) =>
api.post(`/companies/${companyId}/costs/subscriptions/${id}/link`, { targetId, expectedRevision, targetRevision }),
};