@belonguniverseai/react-sdk 0.6.27 → 0.6.29
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/README.md +43 -4
- package/dist/api/account-scope.d.ts +75 -0
- package/dist/api/artifact-actions.d.ts +0 -1
- package/dist/api/auth-errors.d.ts +21 -0
- package/dist/api/client-identity.d.ts +3 -1
- package/dist/api/client.d.ts +1394 -162
- package/dist/api/goals.d.ts +19 -2
- package/dist/api/live-artifacts.d.ts +197 -0
- package/dist/api/my-usage.d.ts +28 -0
- package/dist/api/queries.d.ts +6 -4
- package/dist/api/query-keys.d.ts +44 -3
- package/dist/api/task-schedule-sharing.d.ts +18 -3
- package/dist/api/task-schedules.d.ts +76 -12
- package/dist/app/VoiceOverlay.d.ts +4 -3
- package/dist/app/dock-story-data.d.ts +19 -1
- package/dist/browser/control-channel.d.ts +9 -0
- package/dist/browser/dom-bridge.d.ts +2 -0
- package/dist/component/BelongWidget.d.ts +17 -4
- package/dist/component/{abnfDiagram-N423BO3Z-DrnjkZwk.js → abnfDiagram-N423BO3Z-BvL7baZ-.js} +4 -4
- package/dist/component/{arc-CLchGzOM.js → arc-DVUroP2Z.js} +2 -2
- package/dist/component/{architectureDiagram-T3A2C74G-Du8PLen3.js → architectureDiagram-T3A2C74G-CYt93mxs.js} +3 -3
- package/dist/component/{blockDiagram-VBNYF7ZC-BxmYbrlL.js → blockDiagram-VBNYF7ZC-yST7U8Pb.js} +4 -4
- package/dist/component/{c4Diagram-5PPSVZJV-DHiwlK7l.js → c4Diagram-5PPSVZJV-BHz6Efx3.js} +3 -3
- package/dist/component/{channel-C2eeNEMi.js → channel-CKTqNdN4.js} +2 -2
- package/dist/component/{chunk-2GRJ4B5K-D6I_U4nB.js → chunk-2GRJ4B5K-Bw2zHHAm.js} +2 -2
- package/dist/component/{chunk-2Q5K7J3B-BR3JSmNI.js → chunk-2Q5K7J3B-DpBuF73m.js} +2 -2
- package/dist/component/{chunk-5RXB4S5H-DcmzyncC.js → chunk-5RXB4S5H-dxBtwi1p.js} +5 -5
- package/dist/component/{chunk-5VM5RSS4-8ww1xEAz.js → chunk-5VM5RSS4-BOTqM1Rc.js} +2 -2
- package/dist/component/{chunk-6Q2QTUOP-Chlg3gnC.js → chunk-6Q2QTUOP-DjMXJhRD.js} +2 -2
- package/dist/component/{chunk-GF5L2VYU-CgKydjVC.js → chunk-GF5L2VYU-CGpnSfXM.js} +6 -6
- package/dist/component/{chunk-JWPE2WC7-13zVpFYT.js → chunk-JWPE2WC7-L5aYKPho.js} +2 -2
- package/dist/component/{chunk-KBJHAD2P-CP28c_dJ.js → chunk-KBJHAD2P-DH2RFBaF.js} +2 -2
- package/dist/component/{chunk-RYQCIY6F-CaHaa77d.js → chunk-RYQCIY6F-QPgRO0s7.js} +2 -2
- package/dist/component/{chunk-XXDRQBXY-Cd0yVkqx.js → chunk-XXDRQBXY-C1ezaFpA.js} +2 -2
- package/dist/component/{classDiagram-JCYQIIEL-Bn0740dK.js → classDiagram-JCYQIIEL-Dx7Qx836.js} +3 -3
- package/dist/component/{classDiagram-v2-OCEON4UE-Bn0740dK.js → classDiagram-v2-OCEON4UE-Dx7Qx836.js} +3 -3
- package/dist/component/{cose-bilkent-JH36ORCC-Y6CvxIe4.js → cose-bilkent-JH36ORCC-Bem1eaLJ.js} +2 -2
- package/dist/component/{cynefinDiagram-MW4NZA55-BJ_o5gyM.js → cynefinDiagram-MW4NZA55-DF15EWOu.js} +3 -3
- package/dist/component/{dagre-VZM6K2ZE-Ce_ZLKlj.js → dagre-VZM6K2ZE-BVzwev7l.js} +3 -3
- package/dist/component/{diagram-7IWD3JNH-K8E_XdII.js → diagram-7IWD3JNH-DzQhKX_v.js} +4 -4
- package/dist/component/{diagram-B4RE2ZJO-DZGs1RuF.js → diagram-B4RE2ZJO-DnHINfhE.js} +3 -3
- package/dist/component/{diagram-LBJQPF4R-CzKPOqJK.js → diagram-LBJQPF4R-CPqE_GwY.js} +3 -3
- package/dist/component/{diagram-Q27KOJAE-UItKj-dk.js → diagram-Q27KOJAE-BjpvfqhL.js} +4 -4
- package/dist/component/{diagram-UB23O5K3-ZxBLx0B9.js → diagram-UB23O5K3-BcYqFjqI.js} +3 -3
- package/dist/component/{ebnfDiagram-BXEA7PRR-BIS2pIB5.js → ebnfDiagram-BXEA7PRR-DoqGcWGx.js} +4 -4
- package/dist/component/{erDiagram-JOGREHBK-BNZB6-ZZ.js → erDiagram-JOGREHBK-DGrj5tIK.js} +5 -5
- package/dist/component/{flowDiagram-UKHOOZJN-B8H3ZNjd.js → flowDiagram-UKHOOZJN-B8OuOrVY.js} +7 -7
- package/dist/component/{ganttDiagram-PKOTCBZU-2JJJVAY-.js → ganttDiagram-PKOTCBZU-BaxSqTVY.js} +3 -3
- package/dist/component/{gitGraphDiagram-DS77QQ5N-BVWxsX1D.js → gitGraphDiagram-DS77QQ5N-W1Sqa3Hc.js} +4 -4
- package/dist/component/{highlighted-body-OFNGDK62-CmQzAJHd.js → highlighted-body-OFNGDK62-Cf1UqcGe.js} +2 -2
- package/dist/component/index.d.ts +1 -0
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-6WML65LV-B-7B2PTM.js → infoDiagram-6WML65LV-BS0JlYPr.js} +2 -2
- package/dist/component/{ishikawaDiagram-WSZJBQD7-DgjY91jV.js → ishikawaDiagram-WSZJBQD7-Df_NzOQV.js} +2 -2
- package/dist/component/{journeyDiagram-NVQOT4AX-fkb_5H2H.js → journeyDiagram-NVQOT4AX-JWKvZ6rc.js} +5 -5
- package/dist/component/{kanban-definition-27J2QSJJ-ZRQERkli.js → kanban-definition-27J2QSJJ-DMvICKAB.js} +3 -3
- package/dist/component/{linear-DX0_iAiu.js → linear-D02U2fTS.js} +2 -2
- package/dist/component/{mermaid-GHXKKRXX-BhURR8Q_.js → mermaid-GHXKKRXX-B7CJJdoE.js} +51487 -47044
- package/dist/component/{mindmap-definition-FAOFIHXS-Duc36TEr.js → mindmap-definition-FAOFIHXS-AzTh8oju.js} +4 -4
- package/dist/component/{pegDiagram-VL7TDLO6-Egcz9GLB.js → pegDiagram-VL7TDLO6-DSCzZs_w.js} +4 -4
- package/dist/component/{pieDiagram-7S7Q4E2Y-DEe2GHp7.js → pieDiagram-7S7Q4E2Y-CEByr6BB.js} +4 -4
- package/dist/component/{quadrantDiagram-CIZ2JOQS-DNfio-6s.js → quadrantDiagram-CIZ2JOQS-BrWOf-GT.js} +3 -3
- package/dist/component/{railroadDiagram-AXF67PYL-B3lRYedY.js → railroadDiagram-AXF67PYL-DRtsV2gM.js} +4 -4
- package/dist/component/{requirementDiagram-LRYGKXZP-DYYxC0Cg.js → requirementDiagram-LRYGKXZP-_WwAo7AE.js} +4 -4
- package/dist/component/{sankeyDiagram-W5VNT64P-CKQNueMs.js → sankeyDiagram-W5VNT64P-DBxP3yyK.js} +2 -2
- package/dist/component/{sequenceDiagram-SI44F4Z6-ChF8pgI7.js → sequenceDiagram-SI44F4Z6-B3SNXrpC.js} +4 -4
- package/dist/component/{sizeCapture-X5ZJPWSS-BQyVznxb.js → sizeCapture-X5ZJPWSS-D5G8pyPC.js} +2 -2
- package/dist/component/{stateDiagram-OKZ733FA-CAVOTaJQ.js → stateDiagram-OKZ733FA-C4UZwsoc.js} +3 -3
- package/dist/component/{stateDiagram-v2-UEYNNEHI-rGNqHCbu.js → stateDiagram-v2-UEYNNEHI-DIYB5q15.js} +3 -3
- package/dist/component/{swimlanes-SLNWSIFB-j8tXsaid.js → swimlanes-SLNWSIFB-Cc9yJXTh.js} +4 -4
- package/dist/component/{swimlanesDiagram-ULZ7WXOC-CsbepRMA.js → swimlanesDiagram-ULZ7WXOC-DsGPiJ-s.js} +3 -3
- package/dist/component/{timeline-definition-Z64GVDOM-nCRE1AQh.js → timeline-definition-Z64GVDOM-Dr4-iAeD.js} +3 -3
- package/dist/component/{vennDiagram-T6HMQDX7-C3ubGm9c.js → vennDiagram-T6HMQDX7-ZiaZ9jYw.js} +2 -2
- package/dist/component/{wardleyDiagram-T6FBY63Y-mKT8yN1z.js → wardleyDiagram-T6FBY63Y-KdF37MT-.js} +3 -3
- package/dist/component/{xychartDiagram-ELKLHX3M-D5AF8jgv.js → xychartDiagram-ELKLHX3M-NH_bOKPL.js} +3 -3
- package/dist/components/artifacts/ArtifactDetailSurface.d.ts +37 -0
- package/dist/components/artifacts/ArtifactMeta.d.ts +10 -0
- package/dist/components/artifacts/ArtifactsListSurface.d.ts +11 -0
- package/dist/components/artifacts/BindScheduleDialog.d.ts +39 -0
- package/dist/components/artifacts/ConfirmDeleteArtifactDialog.d.ts +9 -0
- package/dist/components/artifacts/ConfirmReshareDialog.d.ts +24 -0
- package/dist/components/artifacts/artifact-format.d.ts +38 -0
- package/dist/components/artifacts/open-artifact-version.d.ts +16 -0
- package/dist/components/artifacts/use-artifact-actions.d.ts +32 -0
- package/dist/components/embed/ComposerContext.d.ts +11 -7
- package/dist/components/embed/EmbedComposer.d.ts +7 -1
- package/dist/components/embed/EmbedRail.d.ts +9 -2
- package/dist/components/embed/GoalRefusalCard.d.ts +5 -1
- package/dist/components/embed/MobileNavBar.d.ts +2 -1
- package/dist/components/embed/ResponseModeDial.d.ts +11 -0
- package/dist/components/embed/SessionStatsPanel.d.ts +3 -0
- package/dist/components/embed/UsageSettings.d.ts +11 -0
- package/dist/components/embed/format-compact-number.d.ts +8 -0
- package/dist/components/embed/use-artifact-operation-notices.d.ts +1 -0
- package/dist/components/scheduled/ConfirmRunPausedScheduleDialog.d.ts +18 -0
- package/dist/components/scheduled/EmailCopiesFields.d.ts +19 -0
- package/dist/components/scheduled/ScheduledDetailSurface.d.ts +2 -1
- package/dist/components/scheduled/use-run-now-with-confirmation.d.ts +17 -0
- package/dist/embed/artifact-action-bridge.d.ts +13 -3
- package/dist/embed/artifact-remint-budget.d.ts +5 -0
- package/dist/embed/copy.d.ts +13 -18
- package/dist/embed/dock-state.d.ts +1 -1
- package/dist/embed/global.d.ts +2 -0
- package/dist/embed/goal-edit-command.d.ts +6 -5
- package/dist/embed/plan-decision-text.d.ts +1 -0
- package/dist/embed/presets.d.ts +1 -0
- package/dist/embed/response-mode.d.ts +48 -0
- package/dist/embed/theme.d.ts +5 -0
- package/dist/embed/voice-config.d.ts +22 -31
- package/dist/embed/voice-prefs.d.ts +18 -34
- package/dist/i18n/messages/en.d.ts +146 -7
- package/dist/i18n/messages/surfaces/artifacts.d.ts +304 -0
- package/dist/i18n/messages/surfaces/feedback.d.ts +12 -0
- package/dist/i18n/messages/surfaces/header.d.ts +4 -0
- package/dist/i18n/messages/surfaces/myUsage.d.ts +75 -0
- package/dist/i18n/messages/surfaces/plan.d.ts +4 -0
- package/dist/i18n/messages/surfaces/scheduled.d.ts +53 -1
- package/dist/i18n/messages/surfaces/settings.d.ts +12 -0
- package/dist/i18n/messages/surfaces/stats.d.ts +4 -12
- package/dist/i18n/messages/surfaces/stream.d.ts +88 -0
- package/dist/i18n/messages/surfaces/usage.d.ts +1 -9
- package/dist/infrastructure/telemetry/first-response-timing.d.ts +51 -0
- package/dist/lib/tab-control-store.d.ts +14 -0
- package/dist/lib/tab-leadership.d.ts +9 -24
- package/dist/lib/use-now.d.ts +32 -0
- package/dist/lib/use-tab-leadership.d.ts +5 -7
- package/dist/routes/artifact-detail.d.ts +2 -0
- package/dist/routes/artifacts.d.ts +2 -0
- package/dist/routes/chat/history-merge.d.ts +53 -0
- package/dist/routes/chat/history-paging.d.ts +25 -6
- package/dist/routes/chat/transcript-row.d.ts +1 -0
- package/dist/routes/chat/use-catch-up-on-return.d.ts +70 -0
- package/dist/routes/chat/use-return-to-page.d.ts +7 -0
- package/dist/stream/belong-chat-transport.d.ts +38 -8
- package/dist/stream/belong-data-parts.d.ts +10 -0
- package/dist/stream/dispatch-once.d.ts +1 -1
- package/dist/stream/message-parts.d.ts +3 -1
- package/dist/stream/queued-message-outbox.d.ts +6 -0
- package/dist/stream/select-session-usage.d.ts +9 -0
- package/dist/stream/session-control-context.d.ts +7 -0
- package/dist/stream/session-stats-csv.d.ts +7 -9
- package/dist/types/public.d.ts +16 -9
- package/package.json +1 -1
package/dist/api/goals.d.ts
CHANGED
|
@@ -107,9 +107,9 @@ export declare const goalViewSchema: z.ZodObject<{
|
|
|
107
107
|
at: z.ZodString;
|
|
108
108
|
}, z.core.$strip>>>;
|
|
109
109
|
runway: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
110
|
+
long: "long";
|
|
110
111
|
quick: "quick";
|
|
111
112
|
normal: "normal";
|
|
112
|
-
long: "long";
|
|
113
113
|
}>>>;
|
|
114
114
|
}, z.core.$strip>;
|
|
115
115
|
export type GoalView = z.infer<typeof goalViewSchema>;
|
|
@@ -119,10 +119,26 @@ type FetchGoalOutcome = {
|
|
|
119
119
|
} | {
|
|
120
120
|
readonly status: "none" | "disabled" | "error";
|
|
121
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* #766 — one budget an edited goal has still REACHED (`used >= cap`), as
|
|
124
|
+
* `POST .../goal/edit` reports it (belong-cloud's `GoalBudgetLine`). `reason`
|
|
125
|
+
* is an OPEN string for the same reason `goalJournalEntrySchema.kind` is: a
|
|
126
|
+
* budget this dock predates must never turn an edit that applied into an
|
|
127
|
+
* `error` outcome — the notice falls back to its generic line instead.
|
|
128
|
+
*/
|
|
129
|
+
declare const goalExhaustedBudgetSchema: z.ZodObject<{
|
|
130
|
+
reason: z.ZodString;
|
|
131
|
+
used: z.ZodNumber;
|
|
132
|
+
cap: z.ZodNumber;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export type GoalExhaustedBudget = z.infer<typeof goalExhaustedBudgetSchema>;
|
|
122
135
|
export type GoalActionOutcome = {
|
|
123
136
|
readonly status: "ok";
|
|
124
137
|
readonly goalStatus: GoalStatus;
|
|
125
138
|
readonly revived?: boolean;
|
|
139
|
+
/** Edit only (#766): the budgets that still keep the goal stopped.
|
|
140
|
+
* Absent from an older backend, and from every other action. */
|
|
141
|
+
readonly exhaustedBudgets?: readonly GoalExhaustedBudget[];
|
|
126
142
|
} | {
|
|
127
143
|
readonly status: "conflict";
|
|
128
144
|
readonly goalStatus: GoalStatus;
|
|
@@ -167,7 +183,8 @@ export type GoalEditInput = {
|
|
|
167
183
|
* Content-Type as `{}`). The 202 body carries `revived` — the edit raised a
|
|
168
184
|
* cap past `turns_used`/`tokens_used` and un-stalled a `budget_limited` goal
|
|
169
185
|
* — which `runGoalCommand` (chat.tsx) uses to pick between `goal.edited` and
|
|
170
|
-
* `goal.revived
|
|
186
|
+
* `goal.revived`, and `exhaustedBudgets` (#766), which names what still keeps
|
|
187
|
+
* a goal that was NOT revived stopped. Both 409 variants the backend can return
|
|
171
188
|
* (`goal_not_editable`: the goal's current state can never be edited;
|
|
172
189
|
* `goal_edit_conflict`: a concurrent edit raced this one) collapse to the
|
|
173
190
|
* same `"conflict"` outcome — the dock has one notice for "try again",
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { QueryClient, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { Recurrence } from './task-schedules.ts';
|
|
3
|
+
import { ApiClient } from './client.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The cadence of the schedule a report is bound to, as the SERVER resolves it.
|
|
6
|
+
*
|
|
7
|
+
* Structured, never a rendered phrase: the dock formats these parts in the
|
|
8
|
+
* reader's locale with the same `recurrenceSummaryParams` the Scheduled
|
|
9
|
+
* surface uses. A server-rendered "daily at 09:00 UTC" would paint English
|
|
10
|
+
* inside a Spanish dock.
|
|
11
|
+
*
|
|
12
|
+
* It arrives from `/v1/live-artifacts` rather than being read client-side
|
|
13
|
+
* because that list is CALLER-scoped — a report follows its owner across
|
|
14
|
+
* workspaces — while the dock's own schedule read is workspace-scoped. A
|
|
15
|
+
* report bound in another workspace, or any report at all in a host with no
|
|
16
|
+
* workspace selected, could never learn its cadence client-side, and the
|
|
17
|
+
* overdue warning could never fire for it.
|
|
18
|
+
*/
|
|
19
|
+
export type LiveArtifactCadence = {
|
|
20
|
+
readonly recurrence: Recurrence;
|
|
21
|
+
/** Any instant on the cadence, in the schedule's own zone — the wall clock it preserves. */
|
|
22
|
+
readonly anchorAt: string;
|
|
23
|
+
readonly timezone: string;
|
|
24
|
+
};
|
|
25
|
+
/** One live report as the list serves it. Instants stay ISO strings (see header). */
|
|
26
|
+
export type LiveArtifactSummary = {
|
|
27
|
+
readonly liveArtifactId: string;
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly description: string | null;
|
|
30
|
+
readonly currentVersion: number;
|
|
31
|
+
/** The public link's stable id. Present from creation; the public route
|
|
32
|
+
* serves it only once the report has actually been shared. */
|
|
33
|
+
readonly shareSlug: string;
|
|
34
|
+
readonly shareExpiresAt: string | null;
|
|
35
|
+
readonly shareRevokedAt: string | null;
|
|
36
|
+
readonly seriesId: string | null;
|
|
37
|
+
/** Null when nothing refreshes this report — or when its series is gone. */
|
|
38
|
+
readonly cadence: LiveArtifactCadence | null;
|
|
39
|
+
readonly lastRefreshedAt: string | null;
|
|
40
|
+
readonly createdAt: string;
|
|
41
|
+
readonly updatedAt: string;
|
|
42
|
+
};
|
|
43
|
+
export type LiveArtifactVersion = {
|
|
44
|
+
readonly version: number;
|
|
45
|
+
readonly artifactId: string;
|
|
46
|
+
/**
|
|
47
|
+
* The media type of this version's bytes, as the server reads it off the
|
|
48
|
+
* artifact row. The detail surface needs it to decide whether the CURRENT
|
|
49
|
+
* version can be framed inline (an interactive HTML app, whose controls only
|
|
50
|
+
* work with the dock as the frame's parent) or must stay a tab-opened
|
|
51
|
+
* download (a CSV, a PDF).
|
|
52
|
+
*
|
|
53
|
+
* `null` means "this cloud did not say" — see `versionSchema`. A null is
|
|
54
|
+
* never guessed at: it renders exactly like a non-HTML version, i.e. no
|
|
55
|
+
* frame.
|
|
56
|
+
*/
|
|
57
|
+
readonly mimeType: string | null;
|
|
58
|
+
readonly runId: string | null;
|
|
59
|
+
readonly summary: string | null;
|
|
60
|
+
readonly publishedAt: string;
|
|
61
|
+
};
|
|
62
|
+
export type LiveArtifactDetail = LiveArtifactSummary & {
|
|
63
|
+
readonly versions: readonly LiveArtifactVersion[];
|
|
64
|
+
};
|
|
65
|
+
export type LiveArtifactsListResult = {
|
|
66
|
+
readonly status: "ready";
|
|
67
|
+
readonly artifacts: readonly LiveArtifactSummary[];
|
|
68
|
+
readonly slotsUsed: number;
|
|
69
|
+
readonly slotLimit: number;
|
|
70
|
+
} | {
|
|
71
|
+
readonly status: "featureAbsent";
|
|
72
|
+
};
|
|
73
|
+
export type LiveArtifactsAvailability = "available" | "absent";
|
|
74
|
+
/**
|
|
75
|
+
* Where a report's public link stands right now. Mirrors the server's own
|
|
76
|
+
* `resolveShareState`, deliberately: the list serves the two timestamps and
|
|
77
|
+
* the dock has to decide what to say about them, and a second rule here would
|
|
78
|
+
* be a second truth.
|
|
79
|
+
*/
|
|
80
|
+
export type ShareState = {
|
|
81
|
+
readonly kind: "never_shared";
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: "revoked";
|
|
84
|
+
} | {
|
|
85
|
+
readonly kind: "expired";
|
|
86
|
+
} | {
|
|
87
|
+
readonly kind: "live";
|
|
88
|
+
readonly expiresAt: string;
|
|
89
|
+
};
|
|
90
|
+
export declare const resolveShareState: (row: {
|
|
91
|
+
readonly shareExpiresAt: string | null;
|
|
92
|
+
readonly shareRevokedAt: string | null;
|
|
93
|
+
}, now: Date) => ShareState;
|
|
94
|
+
/**
|
|
95
|
+
* Does sharing from THIS state mint a new url and kill the old one? Only a
|
|
96
|
+
* re-share after a revoke rotates (design doc D5); a first share has no
|
|
97
|
+
* previous url to break, and extending a live or expired share keeps it.
|
|
98
|
+
*/
|
|
99
|
+
export declare const shareRotates: (state: ShareState) => boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The public url for a report's slug. Composed here rather than read back
|
|
102
|
+
* from the share response, so COPYING a link the user already has never has
|
|
103
|
+
* to POST (which would silently push the expiry out). Mirrors the server's
|
|
104
|
+
* `buildLiveShareUrl`.
|
|
105
|
+
*
|
|
106
|
+
* ASSUMPTION, stated because it is load-bearing and unenforced: the dock's
|
|
107
|
+
* configured `apiBaseUrl` is the SAME public origin the server composes from
|
|
108
|
+
* the request `Host` (`requestOrigin`, live-artifact.routes.ts). The two
|
|
109
|
+
* derive the origin independently — the server from the host the browser
|
|
110
|
+
* actually reached, the dock from its own config — so if a deployment ever
|
|
111
|
+
* points the dock at a base url that is not the public host (an internal Cloud
|
|
112
|
+
* Run url, a regional alias, a reverse proxy under a different name), the
|
|
113
|
+
* COPIED link is wrong while the MINTED one stays right, and only the copied
|
|
114
|
+
* one is silent about it. Keep this in step with `requestOrigin`.
|
|
115
|
+
*/
|
|
116
|
+
export declare const liveShareUrl: (apiBaseUrl: string, slug: string) => string;
|
|
117
|
+
export type ShareLiveArtifactOutcome = {
|
|
118
|
+
readonly status: "shared";
|
|
119
|
+
readonly shareUrl: string;
|
|
120
|
+
readonly expiresAt: string;
|
|
121
|
+
/**
|
|
122
|
+
* Did this call MINT A NEW url and kill the previous one? Read off the
|
|
123
|
+
* server's answer, never guessed from the state the dock happened to be
|
|
124
|
+
* looking at — the row can be stale, and "the link you already sent
|
|
125
|
+
* someone is dead now" is not a sentence to say on a guess.
|
|
126
|
+
*/
|
|
127
|
+
readonly rotated: boolean;
|
|
128
|
+
} | {
|
|
129
|
+
readonly status: "not_found";
|
|
130
|
+
} | {
|
|
131
|
+
readonly status: "forbidden";
|
|
132
|
+
} | {
|
|
133
|
+
readonly status: "error";
|
|
134
|
+
};
|
|
135
|
+
export type RevokeShareOutcome = {
|
|
136
|
+
readonly status: "revoked";
|
|
137
|
+
} | {
|
|
138
|
+
readonly status: "not_found";
|
|
139
|
+
} | {
|
|
140
|
+
readonly status: "forbidden";
|
|
141
|
+
} | {
|
|
142
|
+
readonly status: "error";
|
|
143
|
+
};
|
|
144
|
+
export type DeleteLiveArtifactOutcome = {
|
|
145
|
+
readonly status: "deleted";
|
|
146
|
+
} | {
|
|
147
|
+
readonly status: "not_found";
|
|
148
|
+
} | {
|
|
149
|
+
readonly status: "forbidden";
|
|
150
|
+
} | {
|
|
151
|
+
readonly status: "error";
|
|
152
|
+
};
|
|
153
|
+
export type UpdateLiveArtifactOutcome = {
|
|
154
|
+
readonly status: "updated";
|
|
155
|
+
} | {
|
|
156
|
+
readonly status: "not_found";
|
|
157
|
+
} | {
|
|
158
|
+
readonly status: "forbidden";
|
|
159
|
+
} | {
|
|
160
|
+
readonly status: "name_taken";
|
|
161
|
+
} | {
|
|
162
|
+
readonly status: "series_not_found";
|
|
163
|
+
} | {
|
|
164
|
+
readonly status: "error";
|
|
165
|
+
};
|
|
166
|
+
export type UpdateLiveArtifactInput = {
|
|
167
|
+
readonly liveArtifactId: string;
|
|
168
|
+
readonly name?: string;
|
|
169
|
+
readonly description?: string;
|
|
170
|
+
/** `null` unbinds the schedule; omit the field to leave the binding alone. */
|
|
171
|
+
readonly seriesId?: string | null;
|
|
172
|
+
};
|
|
173
|
+
export declare const listLiveArtifactsRequest: (api: ApiClient, signal?: AbortSignal) => Promise<LiveArtifactsListResult>;
|
|
174
|
+
export declare const useLiveArtifacts: () => UseQueryResult<LiveArtifactsListResult>;
|
|
175
|
+
/**
|
|
176
|
+
* Does this deployment have live reports? FALSE until some list call has
|
|
177
|
+
* RESOLVED `featureAbsent` — while loading, or during an outage, the rail keeps
|
|
178
|
+
* its entry (a late pop-in reads as a glitch; an outage must not look like a
|
|
179
|
+
* feature that was never there).
|
|
180
|
+
*/
|
|
181
|
+
export declare const useLiveArtifactsFeatureAbsent: () => boolean;
|
|
182
|
+
export type LiveArtifactDetailResult = {
|
|
183
|
+
readonly status: "ready";
|
|
184
|
+
readonly artifact: LiveArtifactDetail;
|
|
185
|
+
} | {
|
|
186
|
+
readonly status: "not_found";
|
|
187
|
+
};
|
|
188
|
+
export declare const useLiveArtifact: (liveArtifactId: string | null) => UseQueryResult<LiveArtifactDetailResult>;
|
|
189
|
+
/** Both the list and every detail read — a mutation makes both stale. */
|
|
190
|
+
export declare const invalidateLiveArtifacts: (queryClient: QueryClient) => Promise<void>;
|
|
191
|
+
export declare const useShareLiveArtifact: () => import('@tanstack/react-query').UseMutationResult<ShareLiveArtifactOutcome, Error, {
|
|
192
|
+
readonly liveArtifactId: string;
|
|
193
|
+
readonly ttlSeconds?: number;
|
|
194
|
+
}, unknown>;
|
|
195
|
+
export declare const useRevokeLiveArtifactShare: () => import('@tanstack/react-query').UseMutationResult<RevokeShareOutcome, Error, string, unknown>;
|
|
196
|
+
export declare const useDeleteLiveArtifact: () => import('@tanstack/react-query').UseMutationResult<DeleteLiveArtifactOutcome, Error, string, unknown>;
|
|
197
|
+
export declare const useUpdateLiveArtifact: () => import('@tanstack/react-query').UseMutationResult<UpdateLiveArtifactOutcome, Error, UpdateLiveArtifactInput, unknown>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ApiClient } from './client.ts';
|
|
3
|
+
export declare const myUsageSchema: z.ZodObject<{
|
|
4
|
+
timeZone: z.ZodLiteral<"UTC">;
|
|
5
|
+
asOf: z.ZodISODateTime;
|
|
6
|
+
days: z.ZodArray<z.ZodObject<{
|
|
7
|
+
date: z.ZodISODate;
|
|
8
|
+
weightedTokens: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
today: z.ZodObject<{
|
|
11
|
+
date: z.ZodISODate;
|
|
12
|
+
weightedTokens: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
monthToDate: z.ZodObject<{
|
|
15
|
+
from: z.ZodISODate;
|
|
16
|
+
weightedTokens: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type MyUsage = z.infer<typeof myUsageSchema>;
|
|
20
|
+
export type MyUsageState = {
|
|
21
|
+
readonly status: "ready";
|
|
22
|
+
readonly usage: MyUsage;
|
|
23
|
+
} | {
|
|
24
|
+
readonly status: "unavailable";
|
|
25
|
+
};
|
|
26
|
+
export declare const fetchMyUsage: (client: ApiClient) => Promise<MyUsageState>;
|
|
27
|
+
/** Keyed by the account speaking to the API (`useAccountKey`), so it is purged on a switch. */
|
|
28
|
+
export declare const useMyUsage: (accountKey: string) => import('@tanstack/react-query').UseQueryResult<NoInfer<MyUsageState>, Error>;
|
package/dist/api/queries.d.ts
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const useSessions: (limit?: number) => import('@tanstack/react-query').UseQueryResult<NoInfer<{
|
|
8
8
|
sessions: readonly {
|
|
9
|
-
readonly sessionId: import('
|
|
9
|
+
readonly sessionId: import('../../../../apps/belong-cloud/src/platform/ids.ts').SessionId;
|
|
10
10
|
readonly title: string | null;
|
|
11
|
-
readonly status: import('
|
|
11
|
+
readonly status: import('../../../../apps/belong-cloud/src/features/sessions/session.repo.ts').SessionRow["status"];
|
|
12
12
|
readonly updatedAt: string;
|
|
13
13
|
}[];
|
|
14
14
|
}>, Error>;
|
|
15
15
|
export declare const useSession: (sessionId: string | null) => import('@tanstack/react-query').UseQueryResult<NoInfer<{
|
|
16
|
-
readonly sessionId: import('
|
|
16
|
+
readonly sessionId: import('../../../../apps/belong-cloud/src/platform/ids.ts').SessionId;
|
|
17
17
|
readonly workspaceExternalId: string | null;
|
|
18
18
|
readonly title: string | null;
|
|
19
|
-
readonly status: import('
|
|
19
|
+
readonly status: import('../../../../apps/belong-cloud/src/features/sessions/session.repo.ts').SessionRow["status"];
|
|
20
20
|
readonly createdAt: string;
|
|
21
21
|
readonly updatedAt: string;
|
|
22
22
|
}>, Error>;
|
|
@@ -24,6 +24,7 @@ export declare const useSessionStats: (sessionId: string | null) => import('@tan
|
|
|
24
24
|
readonly totalInputTokens: number;
|
|
25
25
|
readonly totalOutputTokens: number;
|
|
26
26
|
readonly totalTokens: number;
|
|
27
|
+
readonly totalWeightedTokens: number;
|
|
27
28
|
readonly totalCacheReadInputTokens: number;
|
|
28
29
|
readonly totalCacheWriteInputTokens: number;
|
|
29
30
|
readonly turns: number;
|
|
@@ -36,5 +37,6 @@ export declare const useSessionStats: (sessionId: string | null) => import('@tan
|
|
|
36
37
|
readonly inputTokens: number;
|
|
37
38
|
readonly outputTokens: number;
|
|
38
39
|
readonly totalTokens: number;
|
|
40
|
+
readonly weightedTokens: number;
|
|
39
41
|
}[];
|
|
40
42
|
}>, Error>;
|
package/dist/api/query-keys.d.ts
CHANGED
|
@@ -47,9 +47,24 @@ export declare const queryKeys: {
|
|
|
47
47
|
/** Invalidation prefix for every task-schedule read (list + detail + runs). */
|
|
48
48
|
taskSchedules: readonly ["belong", "task-schedules"];
|
|
49
49
|
apiKeys: (ownerCacheKey: string) => readonly ["belong", "api-keys", string];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Plan 018 — the signed-in user's own usage. ACCOUNT-scoped (`accountKey`
|
|
52
|
+
* from `api/account-scope.ts`, right after the prefix like the schedule keys),
|
|
53
|
+
* so a host that swaps accounts in place never paints the previous user's
|
|
54
|
+
* usage.
|
|
55
|
+
*/
|
|
56
|
+
myUsage: (accountKey: string) => readonly ["belong", "my-usage", string];
|
|
57
|
+
/**
|
|
58
|
+
* Schedule reads are ACCOUNT-scoped as well as workspace-scoped (`accountKey`
|
|
59
|
+
* from `api/account-scope.ts`). `/v1/task-schedules` keys off the caller, and
|
|
60
|
+
* the account segment comes FIRST so `api/account-scope.ts` can find it in the
|
|
61
|
+
* same position for every one of these three — an unpartitioned schedule list
|
|
62
|
+
* showed account A's schedule titles to account B inside `BindScheduleDialog`
|
|
63
|
+
* (PR #614 audit finding 3, second pass).
|
|
64
|
+
*/
|
|
65
|
+
taskScheduleList: (accountKey: string, workspaceKey: string, filter: string, q: string) => readonly ["belong", "task-schedules", "list", string, string, string, string];
|
|
66
|
+
taskSchedule: (accountKey: string, workspaceKey: string, taskScheduleId: string) => readonly ["belong", "task-schedules", "detail", string, string, string];
|
|
67
|
+
taskScheduleRuns: (accountKey: string, workspaceKey: string, taskScheduleId: string) => readonly ["belong", "task-schedules", "detail", string, string, string, "runs"];
|
|
53
68
|
/** Invalidation prefix for every saved-prompt read (BEL-256). */
|
|
54
69
|
prePrompts: readonly ["belong", "pre-prompts"];
|
|
55
70
|
/** Workspace-scoped saved-prompt list (same "" unscoped convention). */
|
|
@@ -67,6 +82,32 @@ export declare const queryKeys: {
|
|
|
67
82
|
* every host workspace switch (R61).
|
|
68
83
|
*/
|
|
69
84
|
skillLibraryAvailability: readonly ["belong", "skill-library", "availability"];
|
|
85
|
+
/** Invalidation prefix for every live-artifact read (live-artifacts design doc §11.2). */
|
|
86
|
+
liveArtifacts: readonly ["belong", "live-artifacts"];
|
|
87
|
+
/**
|
|
88
|
+
* The owner's live-artifact list, partitioned by ACCOUNT (`accountKey` from
|
|
89
|
+
* `api/account-scope.ts` — the token's stable tenant+user claims, never the
|
|
90
|
+
* rotating token itself). `/v1/live-artifacts` is scoped by (tenant, user),
|
|
91
|
+
* and the SDK lets a host swap its token in place without remounting the
|
|
92
|
+
* memoized QueryClient: a key that named only the resource let the next
|
|
93
|
+
* account read the previous one's rows — including the public share slug that
|
|
94
|
+
* grants anonymous access to them (P1, 2026-09-27 PR #614 deep audit
|
|
95
|
+
* finding 3).
|
|
96
|
+
*
|
|
97
|
+
* NOT workspace-scoped, and deliberately so: a live report follows its owner
|
|
98
|
+
* across workspaces, so a per-workspace cache would paint the same list under
|
|
99
|
+
* two keys and let one of them go stale (the `connectors` reasoning, not the
|
|
100
|
+
* `skillLibrary` one).
|
|
101
|
+
*/
|
|
102
|
+
liveArtifactList: (accountKey: string) => readonly ["belong", "live-artifacts", "list", string];
|
|
103
|
+
liveArtifactDetail: (accountKey: string, liveArtifactId: string) => readonly ["belong", "live-artifacts", "detail", string, string];
|
|
104
|
+
/**
|
|
105
|
+
* UNSCOPED deployment probe, written by every list resolution and read by the
|
|
106
|
+
* rail — same reason as `skillLibraryAvailability`: whether the feature
|
|
107
|
+
* exists is a property of the CELL, so a host workspace switch must never pop
|
|
108
|
+
* a dead rail entry back in.
|
|
109
|
+
*/
|
|
110
|
+
liveArtifactsAvailability: readonly ["belong", "live-artifacts", "availability"];
|
|
70
111
|
/**
|
|
71
112
|
* Invalidation prefix for every custom-connector read. NOT workspace-scoped:
|
|
72
113
|
* `/v1/connectors` keys off the CALLER, not a workspace — a user's connected
|
|
@@ -6,6 +6,11 @@ export declare const sharedScheduleSchema: z.ZodObject<{
|
|
|
6
6
|
explicitTitle: z.ZodNullable<z.ZodString>;
|
|
7
7
|
message: z.ZodString;
|
|
8
8
|
sharedRecipients: z.ZodDefault<z.ZodArray<z.ZodEmail>>;
|
|
9
|
+
sharedCopies: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
10
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
11
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
12
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
13
|
+
}, z.core.$strip>>>;
|
|
9
14
|
role: z.ZodEnum<{
|
|
10
15
|
edit: "edit";
|
|
11
16
|
owner: "owner";
|
|
@@ -19,11 +24,11 @@ export declare const sharedScheduleSchema: z.ZodObject<{
|
|
|
19
24
|
recurrence: z.ZodPipe<z.ZodObject<{
|
|
20
25
|
kind: z.ZodEnum<{
|
|
21
26
|
none: "none";
|
|
22
|
-
manual: "manual";
|
|
23
27
|
daily: "daily";
|
|
24
28
|
weekdays: "weekdays";
|
|
25
29
|
weekly: "weekly";
|
|
26
30
|
interval: "interval";
|
|
31
|
+
manual: "manual";
|
|
27
32
|
}>;
|
|
28
33
|
intervalMinutes: z.ZodOptional<z.ZodNumber>;
|
|
29
34
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -40,7 +45,7 @@ export declare const sharedScheduleSchema: z.ZodObject<{
|
|
|
40
45
|
readonly kind: "interval";
|
|
41
46
|
readonly intervalMinutes: number;
|
|
42
47
|
}, {
|
|
43
|
-
kind: "none" | "
|
|
48
|
+
kind: "none" | "daily" | "weekdays" | "weekly" | "interval" | "manual";
|
|
44
49
|
intervalMinutes?: number | undefined;
|
|
45
50
|
}>>;
|
|
46
51
|
anchorAt: z.ZodISODateTime;
|
|
@@ -54,6 +59,11 @@ export declare const useSharedSchedules: () => import('@tanstack/react-query').U
|
|
|
54
59
|
explicitTitle: string | null;
|
|
55
60
|
message: string;
|
|
56
61
|
sharedRecipients: string[];
|
|
62
|
+
sharedCopies: {
|
|
63
|
+
cc?: string[] | undefined;
|
|
64
|
+
bcc?: string[] | undefined;
|
|
65
|
+
replyTo?: string[] | undefined;
|
|
66
|
+
} | null;
|
|
57
67
|
role: "edit" | "owner" | "use";
|
|
58
68
|
owner: string;
|
|
59
69
|
ownerTenant: string;
|
|
@@ -88,6 +98,11 @@ export declare const useSharedSchedule: (definitionId: string | null) => import(
|
|
|
88
98
|
explicitTitle: string | null;
|
|
89
99
|
message: string;
|
|
90
100
|
sharedRecipients: string[];
|
|
101
|
+
sharedCopies: {
|
|
102
|
+
cc?: string[] | undefined;
|
|
103
|
+
bcc?: string[] | undefined;
|
|
104
|
+
replyTo?: string[] | undefined;
|
|
105
|
+
} | null;
|
|
91
106
|
role: "edit" | "owner" | "use";
|
|
92
107
|
owner: string;
|
|
93
108
|
ownerTenant: string;
|
|
@@ -149,7 +164,7 @@ export declare const useUpdateSharedSchedule: () => import('@tanstack/react-quer
|
|
|
149
164
|
revision: number;
|
|
150
165
|
}, Error, {
|
|
151
166
|
readonly definitionId: string;
|
|
152
|
-
readonly patch: Omit<UpdateTaskScheduleSeriesInput["patch"], "mode" | "recipients" | "expectedRevision"> & {
|
|
167
|
+
readonly patch: Omit<UpdateTaskScheduleSeriesInput["patch"], "mode" | "recipients" | "copies" | "expectedRevision"> & {
|
|
153
168
|
readonly expectedRevision: number;
|
|
154
169
|
};
|
|
155
170
|
}, unknown>;
|
|
@@ -19,6 +19,13 @@ export type DeleteTaskScheduleOutcome = {
|
|
|
19
19
|
} | {
|
|
20
20
|
readonly status: "not_found" | "already_started" | "error";
|
|
21
21
|
};
|
|
22
|
+
/** cc / bcc / replyTo on a schedule's email. Empty or absent lists mean none. */
|
|
23
|
+
export declare const emailCopiesSchema: z.ZodObject<{
|
|
24
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
25
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
26
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type EmailCopies = z.infer<typeof emailCopiesSchema>;
|
|
22
29
|
export type CreateTaskScheduleRequest = {
|
|
23
30
|
readonly scheduledFor: Date;
|
|
24
31
|
readonly timeExpression: string;
|
|
@@ -46,15 +53,15 @@ export declare const createTaskSchedule: (apiBaseUrl: string, input: CreateTaskS
|
|
|
46
53
|
export declare const deleteTaskSchedule: (apiBaseUrl: string, taskScheduleId: string) => Promise<DeleteTaskScheduleOutcome>;
|
|
47
54
|
export declare const recurrenceKindSchema: z.ZodEnum<{
|
|
48
55
|
none: "none";
|
|
49
|
-
manual: "manual";
|
|
50
56
|
daily: "daily";
|
|
51
57
|
weekdays: "weekdays";
|
|
52
58
|
weekly: "weekly";
|
|
53
59
|
interval: "interval";
|
|
60
|
+
manual: "manual";
|
|
54
61
|
}>;
|
|
55
62
|
export type RecurrenceKind = z.infer<typeof recurrenceKindSchema>;
|
|
56
|
-
/** Bounds for the `interval` cadence (BEL-157):
|
|
57
|
-
export declare const MIN_RECURRENCE_INTERVAL_MINUTES =
|
|
63
|
+
/** Bounds for the `interval` cadence (BEL-157): 5 minutes up to a full day. */
|
|
64
|
+
export declare const MIN_RECURRENCE_INTERVAL_MINUTES = 5;
|
|
58
65
|
export declare const MAX_RECURRENCE_INTERVAL_MINUTES = 1440;
|
|
59
66
|
/**
|
|
60
67
|
* Recurrence as a discriminated union: only `interval` carries a width. Used
|
|
@@ -87,11 +94,11 @@ export type Recurrence = {
|
|
|
87
94
|
export declare const recurrenceSchema: z.ZodPipe<z.ZodObject<{
|
|
88
95
|
kind: z.ZodEnum<{
|
|
89
96
|
none: "none";
|
|
90
|
-
manual: "manual";
|
|
91
97
|
daily: "daily";
|
|
92
98
|
weekdays: "weekdays";
|
|
93
99
|
weekly: "weekly";
|
|
94
100
|
interval: "interval";
|
|
101
|
+
manual: "manual";
|
|
95
102
|
}>;
|
|
96
103
|
intervalMinutes: z.ZodOptional<z.ZodNumber>;
|
|
97
104
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -108,7 +115,7 @@ export declare const recurrenceSchema: z.ZodPipe<z.ZodObject<{
|
|
|
108
115
|
readonly kind: "interval";
|
|
109
116
|
readonly intervalMinutes: number;
|
|
110
117
|
}, {
|
|
111
|
-
kind: "none" | "
|
|
118
|
+
kind: "none" | "daily" | "weekdays" | "weekly" | "interval" | "manual";
|
|
112
119
|
intervalMinutes?: number | undefined;
|
|
113
120
|
}>>;
|
|
114
121
|
export declare const taskScheduleSeriesStatusSchema: z.ZodEnum<{
|
|
@@ -132,11 +139,11 @@ declare const taskScheduleListItemSchema: z.ZodObject<{
|
|
|
132
139
|
recurrence: z.ZodPipe<z.ZodObject<{
|
|
133
140
|
kind: z.ZodEnum<{
|
|
134
141
|
none: "none";
|
|
135
|
-
manual: "manual";
|
|
136
142
|
daily: "daily";
|
|
137
143
|
weekdays: "weekdays";
|
|
138
144
|
weekly: "weekly";
|
|
139
145
|
interval: "interval";
|
|
146
|
+
manual: "manual";
|
|
140
147
|
}>;
|
|
141
148
|
intervalMinutes: z.ZodOptional<z.ZodNumber>;
|
|
142
149
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -153,7 +160,7 @@ declare const taskScheduleListItemSchema: z.ZodObject<{
|
|
|
153
160
|
readonly kind: "interval";
|
|
154
161
|
readonly intervalMinutes: number;
|
|
155
162
|
}, {
|
|
156
|
-
kind: "none" | "
|
|
163
|
+
kind: "none" | "daily" | "weekdays" | "weekly" | "interval" | "manual";
|
|
157
164
|
intervalMinutes?: number | undefined;
|
|
158
165
|
}>>;
|
|
159
166
|
timezone: z.ZodString;
|
|
@@ -183,11 +190,11 @@ export declare const taskScheduleDetailSchema: z.ZodObject<{
|
|
|
183
190
|
recurrence: z.ZodPipe<z.ZodObject<{
|
|
184
191
|
kind: z.ZodEnum<{
|
|
185
192
|
none: "none";
|
|
186
|
-
manual: "manual";
|
|
187
193
|
daily: "daily";
|
|
188
194
|
weekdays: "weekdays";
|
|
189
195
|
weekly: "weekly";
|
|
190
196
|
interval: "interval";
|
|
197
|
+
manual: "manual";
|
|
191
198
|
}>;
|
|
192
199
|
intervalMinutes: z.ZodOptional<z.ZodNumber>;
|
|
193
200
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -204,7 +211,7 @@ export declare const taskScheduleDetailSchema: z.ZodObject<{
|
|
|
204
211
|
readonly kind: "interval";
|
|
205
212
|
readonly intervalMinutes: number;
|
|
206
213
|
}, {
|
|
207
|
-
kind: "none" | "
|
|
214
|
+
kind: "none" | "daily" | "weekdays" | "weekly" | "interval" | "manual";
|
|
208
215
|
intervalMinutes?: number | undefined;
|
|
209
216
|
}>>;
|
|
210
217
|
timezone: z.ZodString;
|
|
@@ -230,6 +237,11 @@ export declare const taskScheduleDetailSchema: z.ZodObject<{
|
|
|
230
237
|
revision: z.ZodNumber;
|
|
231
238
|
workspaceCount: z.ZodNumber;
|
|
232
239
|
sharedRecipients: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
240
|
+
sharedCopies: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
241
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
242
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
243
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
244
|
+
}, z.core.$strip>>>;
|
|
233
245
|
}, z.core.$strip>>>;
|
|
234
246
|
explicitTitle: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
235
247
|
message: z.ZodString;
|
|
@@ -246,10 +258,20 @@ export declare const taskScheduleDetailSchema: z.ZodObject<{
|
|
|
246
258
|
notification: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
247
259
|
kind: z.ZodLiteral<"completion_email">;
|
|
248
260
|
recipients: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
261
|
+
copies: z.ZodOptional<z.ZodObject<{
|
|
262
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
263
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
264
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
265
|
+
}, z.core.$strip>>;
|
|
249
266
|
}, z.core.$strip>, z.ZodObject<{
|
|
250
267
|
kind: z.ZodLiteral<"custom_email">;
|
|
251
268
|
templatePath: z.ZodString;
|
|
252
269
|
recipients: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
270
|
+
copies: z.ZodOptional<z.ZodObject<{
|
|
271
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
272
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
273
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
253
275
|
}, z.core.$strip>], "kind">>;
|
|
254
276
|
microsoftTeamsDelivery: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
255
277
|
destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -274,9 +296,13 @@ export type TaskScheduleDetail = z.infer<typeof taskScheduleDetailSchema>;
|
|
|
274
296
|
declare const taskScheduleRunSchema: z.ZodObject<{
|
|
275
297
|
taskScheduleRunId: z.ZodUUID;
|
|
276
298
|
occurrenceKind: z.ZodEnum<{
|
|
277
|
-
scheduled: "scheduled";
|
|
278
299
|
manual: "manual";
|
|
300
|
+
scheduled: "scheduled";
|
|
279
301
|
}>;
|
|
302
|
+
seriesStatusAtRequest: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
303
|
+
active: "active";
|
|
304
|
+
paused: "paused";
|
|
305
|
+
}>>>;
|
|
280
306
|
displayStatus: z.ZodEnum<{
|
|
281
307
|
failed: "failed";
|
|
282
308
|
running: "running";
|
|
@@ -356,10 +382,20 @@ export declare const useTaskSchedule: (taskScheduleId: string | null) => import(
|
|
|
356
382
|
notification: {
|
|
357
383
|
kind: "completion_email";
|
|
358
384
|
recipients?: string[] | undefined;
|
|
385
|
+
copies?: {
|
|
386
|
+
cc?: string[] | undefined;
|
|
387
|
+
bcc?: string[] | undefined;
|
|
388
|
+
replyTo?: string[] | undefined;
|
|
389
|
+
} | undefined;
|
|
359
390
|
} | {
|
|
360
391
|
kind: "custom_email";
|
|
361
392
|
templatePath: string;
|
|
362
393
|
recipients?: string[] | undefined;
|
|
394
|
+
copies?: {
|
|
395
|
+
cc?: string[] | undefined;
|
|
396
|
+
bcc?: string[] | undefined;
|
|
397
|
+
replyTo?: string[] | undefined;
|
|
398
|
+
} | undefined;
|
|
363
399
|
};
|
|
364
400
|
microsoftTeamsDelivery: {
|
|
365
401
|
destination: {
|
|
@@ -382,11 +418,23 @@ export declare const useTaskSchedule: (taskScheduleId: string | null) => import(
|
|
|
382
418
|
revision: number;
|
|
383
419
|
workspaceCount: number;
|
|
384
420
|
sharedRecipients?: string[] | undefined;
|
|
421
|
+
sharedCopies?: {
|
|
422
|
+
cc?: string[] | undefined;
|
|
423
|
+
bcc?: string[] | undefined;
|
|
424
|
+
replyTo?: string[] | undefined;
|
|
425
|
+
} | null | undefined;
|
|
385
426
|
} | null | undefined;
|
|
386
427
|
}>, Error>;
|
|
428
|
+
/**
|
|
429
|
+
* #837: read a schedule's status from the cloud NOW (not the cache), writing
|
|
430
|
+
* it into the cached detail so every surface shows it. Run-now uses it after
|
|
431
|
+
* a `task_schedule_series_status_changed` 409 to decide what to ask next.
|
|
432
|
+
*/
|
|
433
|
+
export declare const useRefetchTaskScheduleStatus: () => (taskScheduleId: string) => Promise<TaskScheduleDetail["status"]>;
|
|
387
434
|
export declare const useTaskScheduleRuns: (taskScheduleId: string | null) => import('@tanstack/react-query').UseInfiniteQueryResult<{
|
|
388
435
|
taskScheduleRunId: string;
|
|
389
|
-
occurrenceKind: "
|
|
436
|
+
occurrenceKind: "manual" | "scheduled";
|
|
437
|
+
seriesStatusAtRequest: "active" | "paused" | null;
|
|
390
438
|
displayStatus: "failed" | "running" | "completed" | "needs_attention";
|
|
391
439
|
scheduledFor: string;
|
|
392
440
|
startedAt: string | null;
|
|
@@ -405,12 +453,20 @@ export type CreateTaskScheduleSeriesInput = {
|
|
|
405
453
|
readonly recurrence: Recurrence;
|
|
406
454
|
readonly clientScheduleId: string;
|
|
407
455
|
readonly workspaceExternalId?: string;
|
|
456
|
+
readonly notification?: {
|
|
457
|
+
readonly kind: "completion_email";
|
|
458
|
+
readonly copies?: EmailCopies;
|
|
459
|
+
};
|
|
408
460
|
};
|
|
409
461
|
export type UpdateTaskScheduleSeriesInput = {
|
|
410
462
|
readonly taskScheduleId: string;
|
|
411
463
|
readonly patch: {
|
|
412
464
|
readonly expectedRevision?: number;
|
|
413
465
|
readonly sharedRecipients?: string[];
|
|
466
|
+
/** Replaces this installation's cc/bcc/replyTo; `null` clears them. */
|
|
467
|
+
readonly copies?: EmailCopies | null;
|
|
468
|
+
/** Replaces the shared definition's cc/bcc/replyTo (owner or editor). */
|
|
469
|
+
readonly sharedCopies?: EmailCopies;
|
|
414
470
|
readonly title?: string | null;
|
|
415
471
|
readonly message?: string;
|
|
416
472
|
readonly scheduledFor?: string;
|
|
@@ -435,8 +491,16 @@ export declare const useResumeTaskSchedule: () => import('@tanstack/react-query'
|
|
|
435
491
|
status: "completed" | "active" | "needs_attention";
|
|
436
492
|
nextRunAt: string | null;
|
|
437
493
|
}, Error, string, unknown>;
|
|
494
|
+
/** The two statuses run-now accepts — what the UI showed when it asked (#837). */
|
|
495
|
+
export type RunNowSeriesStatus = "active" | "paused";
|
|
496
|
+
/** The 409 run-now answers when the task's status is no longer the expected one. */
|
|
497
|
+
export declare const RUN_NOW_STATUS_CHANGED = "task_schedule_series_status_changed";
|
|
438
498
|
export declare const useRunNowTaskSchedule: () => import('@tanstack/react-query').UseMutationResult<{
|
|
439
499
|
taskScheduleRunId: string;
|
|
440
|
-
}, Error,
|
|
500
|
+
}, Error, {
|
|
501
|
+
readonly taskScheduleId: string;
|
|
502
|
+
/** The status the surface showed; the cloud refuses (409) if it moved. */
|
|
503
|
+
readonly expectedSeriesStatus: RunNowSeriesStatus;
|
|
504
|
+
}, unknown>;
|
|
441
505
|
export declare const useDeleteTaskScheduleSeries: () => import('@tanstack/react-query').UseMutationResult<void, Error, string, unknown>;
|
|
442
506
|
export {};
|