@kortix/sdk 0.12.4 → 0.12.6
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 +80 -15
- package/dist/browser/session-sync/session-transcript-cache.d.ts +17 -0
- package/dist/browser/session-sync/session-transcript-cache.d.ts.map +1 -1
- package/dist/browser/session-sync/session-transcript-cache.js +14 -2
- package/dist/browser/session-sync/session-transcript-cache.js.map +1 -1
- package/dist/browser/stores/sync-store.d.ts +86 -2
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +386 -33
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/client/kortix.d.ts +87 -54
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +67 -21
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/http/api-client.d.ts +19 -1
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +79 -21
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/http/auth.d.ts.map +1 -1
- package/dist/core/http/auth.js +6 -4
- package/dist/core/http/auth.js.map +1 -1
- package/dist/core/http/config.d.ts +4 -0
- package/dist/core/http/config.d.ts.map +1 -1
- package/dist/core/http/config.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +2 -2
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/access.d.ts +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/apps.d.ts +216 -0
- package/dist/core/rest/projects-client/apps.d.ts.map +1 -0
- package/dist/core/rest/projects-client/apps.js +105 -0
- package/dist/core/rest/projects-client/apps.js.map +1 -0
- package/dist/core/rest/projects-client/audit.js +1 -1
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/billing.d.ts +7 -0
- package/dist/core/rest/projects-client/billing.d.ts.map +1 -1
- package/dist/core/rest/projects-client/billing.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +7 -6
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js +12 -2
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +133 -98
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +199 -119
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/files.d.ts.map +1 -1
- package/dist/core/rest/projects-client/files.js +7 -1
- package/dist/core/rest/projects-client/files.js.map +1 -1
- package/dist/core/rest/projects-client/index.d.ts +1 -0
- package/dist/core/rest/projects-client/index.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.js +1 -0
- package/dist/core/rest/projects-client/index.js.map +1 -1
- package/dist/core/rest/projects-client/policies.js +3 -3
- package/dist/core/rest/projects-client/policies.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +47 -1
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +12 -0
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +55 -3
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js +14 -4
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +8 -16
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +1 -1
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/session/index.d.ts +1 -0
- package/dist/core/session/index.d.ts.map +1 -1
- package/dist/core/session/index.js +1 -0
- package/dist/core/session/index.js.map +1 -1
- package/dist/core/session/preview-probe.d.ts +76 -0
- package/dist/core/session/preview-probe.d.ts.map +1 -0
- package/dist/core/session/preview-probe.js +97 -0
- package/dist/core/session/preview-probe.js.map +1 -0
- package/dist/core/turns/classify.js +1 -1
- package/dist/core/turns/errors.js +1 -1
- package/dist/core/turns/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kortix.esm.min.js +19 -19
- package/dist/kortix.global.js +19 -19
- package/dist/platform/auth-core.d.ts +2 -1
- package/dist/platform/auth-core.d.ts.map +1 -1
- package/dist/platform/auth-core.js +10 -1
- package/dist/platform/auth-core.js.map +1 -1
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +13 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/invalidate-project.d.ts +76 -0
- package/dist/react/invalidate-project.d.ts.map +1 -0
- package/dist/react/invalidate-project.js +72 -0
- package/dist/react/invalidate-project.js.map +1 -0
- package/dist/react/provider-refresh.d.ts.map +1 -1
- package/dist/react/provider-refresh.js +12 -3
- package/dist/react/provider-refresh.js.map +1 -1
- package/dist/react/query-contracts.d.ts +112 -0
- package/dist/react/query-contracts.d.ts.map +1 -0
- package/dist/react/query-contracts.js +100 -0
- package/dist/react/query-contracts.js.map +1 -0
- package/dist/react/query-keys.d.ts +251 -0
- package/dist/react/query-keys.d.ts.map +1 -0
- package/dist/react/query-keys.js +249 -0
- package/dist/react/query-keys.js.map +1 -0
- package/dist/react/session-title-sync.d.ts.map +1 -1
- package/dist/react/session-title-sync.js +14 -4
- package/dist/react/session-title-sync.js.map +1 -1
- package/dist/react/use-admin-accounts.d.ts +85 -0
- package/dist/react/use-admin-accounts.d.ts.map +1 -1
- package/dist/react/use-admin-accounts.js +100 -0
- package/dist/react/use-admin-accounts.js.map +1 -1
- package/dist/react/use-admin-activity-analytics.d.ts +91 -0
- package/dist/react/use-admin-activity-analytics.d.ts.map +1 -0
- package/dist/react/use-admin-activity-analytics.js +83 -0
- package/dist/react/use-admin-activity-analytics.js.map +1 -0
- package/dist/react/use-admin-projects.d.ts +50 -0
- package/dist/react/use-admin-projects.d.ts.map +1 -0
- package/dist/react/use-admin-projects.js +28 -0
- package/dist/react/use-admin-projects.js.map +1 -0
- package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
- package/dist/react/use-canonical-opencode-session.js +12 -7
- package/dist/react/use-canonical-opencode-session.js.map +1 -1
- package/dist/react/use-gateway-catalog-sync.d.ts.map +1 -1
- package/dist/react/use-gateway-catalog-sync.js +5 -2
- package/dist/react/use-gateway-catalog-sync.js.map +1 -1
- package/dist/react/use-model-defaults.d.ts.map +1 -1
- package/dist/react/use-model-defaults.js +3 -1
- package/dist/react/use-model-defaults.js.map +1 -1
- package/dist/react/use-model-enablement.d.ts.map +1 -1
- package/dist/react/use-model-enablement.js +6 -2
- package/dist/react/use-model-enablement.js.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts +6 -0
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +3 -3
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-opencode-events/helpers.d.ts +27 -1
- package/dist/react/use-opencode-events/helpers.d.ts.map +1 -1
- package/dist/react/use-opencode-events/helpers.js +31 -6
- package/dist/react/use-opencode-events/helpers.js.map +1 -1
- package/dist/react/use-opencode-events/index.d.ts.map +1 -1
- package/dist/react/use-opencode-events/index.js +8 -0
- package/dist/react/use-opencode-events/index.js.map +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/agents.js +10 -1
- package/dist/react/use-opencode-sessions/agents.js.map +1 -1
- package/dist/react/use-opencode-sessions/messages.d.ts +19 -3
- package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/messages.js +28 -55
- package/dist/react/use-opencode-sessions/messages.js.map +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.js +9 -2
- package/dist/react/use-opencode-sessions/providers.js.map +1 -1
- package/dist/react/use-project-apps.d.ts +410 -0
- package/dist/react/use-project-apps.d.ts.map +1 -0
- package/dist/react/use-project-apps.js +98 -0
- package/dist/react/use-project-apps.js.map +1 -0
- package/dist/react/use-project-config.d.ts +7 -0
- package/dist/react/use-project-config.d.ts.map +1 -1
- package/dist/react/use-project-config.js +14 -4
- package/dist/react/use-project-config.js.map +1 -1
- package/dist/react/use-project-models.d.ts.map +1 -1
- package/dist/react/use-project-models.js +8 -2
- package/dist/react/use-project-models.js.map +1 -1
- package/dist/react/use-project-name.d.ts +23 -0
- package/dist/react/use-project-name.d.ts.map +1 -0
- package/dist/react/use-project-name.js +44 -0
- package/dist/react/use-project-name.js.map +1 -0
- package/dist/react/use-project-secrets.d.ts +29 -2
- package/dist/react/use-project-secrets.d.ts.map +1 -1
- package/dist/react/use-project-secrets.js +8 -2
- package/dist/react/use-project-secrets.js.map +1 -1
- package/dist/react/use-project-session.d.ts +40 -0
- package/dist/react/use-project-session.d.ts.map +1 -0
- package/dist/react/use-project-session.js +49 -0
- package/dist/react/use-project-session.js.map +1 -0
- package/dist/react/use-project-triggers.d.ts +4 -2
- package/dist/react/use-project-triggers.d.ts.map +1 -1
- package/dist/react/use-project-triggers.js +7 -2
- package/dist/react/use-project-triggers.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +1 -2
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +17 -40
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +18 -16
- package/dist/react/use-session.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle of an admin-issued trial. `active` is the only status that grants
|
|
3
|
+
* the trial tier; every other value is history the row keeps for audit.
|
|
4
|
+
* Mirrors `TRIAL_STATUS` in `apps/api/src/billing/services/effective-tier.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export type AdminTrialStatus = 'none' | 'active' | 'expired' | 'revoked' | 'converted';
|
|
7
|
+
/** The trial overlay as the admin accounts list reports it. */
|
|
8
|
+
export interface AdminAccountTrial {
|
|
9
|
+
status: AdminTrialStatus | string;
|
|
10
|
+
/** Paid tier the trial emulates (never 'free'/'none'). */
|
|
11
|
+
tier: string | null;
|
|
12
|
+
seats: number | null;
|
|
13
|
+
startedAt: string | null;
|
|
14
|
+
endsAt: string | null;
|
|
15
|
+
note: string | null;
|
|
16
|
+
}
|
|
1
17
|
export interface AdminAccount {
|
|
2
18
|
accountId: string;
|
|
3
19
|
name: string | null;
|
|
@@ -15,6 +31,14 @@ export interface AdminAccount {
|
|
|
15
31
|
billingCustomerId: string | null;
|
|
16
32
|
billingCustomerEmail: string | null;
|
|
17
33
|
createdAt: string | null;
|
|
34
|
+
/** e.g. 'per_seat' — how the account is billed, independent of `tier`. */
|
|
35
|
+
billingModel: string | null;
|
|
36
|
+
seatCount: number | null;
|
|
37
|
+
trial: AdminAccountTrial;
|
|
38
|
+
/** null = the effective tier decides; true = force managed models; false = BYOK only. */
|
|
39
|
+
managedModelsOverride: boolean | null;
|
|
40
|
+
demoEnterprise: boolean;
|
|
41
|
+
enterpriseEntitled: boolean;
|
|
18
42
|
}
|
|
19
43
|
export interface AdminAccountsSummary {
|
|
20
44
|
totalCredits: string;
|
|
@@ -87,6 +111,67 @@ export declare function useAdminSetTier(): import("@tanstack/react-query").UseMu
|
|
|
87
111
|
accountId: string;
|
|
88
112
|
tier: string;
|
|
89
113
|
}, unknown>;
|
|
114
|
+
export interface AdminGrantTrialVariables {
|
|
115
|
+
accountId: string;
|
|
116
|
+
/** An existing paid tier key — the server rejects 'free' and 'none'. */
|
|
117
|
+
tierKey: string;
|
|
118
|
+
seats: number;
|
|
119
|
+
durationDays: number;
|
|
120
|
+
/** USD wallet credits granted with the trial (sandbox compute always debits the wallet). */
|
|
121
|
+
creditGrant?: number;
|
|
122
|
+
note?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface AdminTrialMutationResult {
|
|
125
|
+
ok: boolean;
|
|
126
|
+
trial: AdminAccountTrial;
|
|
127
|
+
credit_granted?: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Grant or replace an admin-issued trial. The account BEHAVES as `tierKey`
|
|
131
|
+
* until the window ends, without touching `credit_accounts.tier` (which the
|
|
132
|
+
* Stripe webhook owns). Re-granting over an active trial is allowed and
|
|
133
|
+
* overwrites the window — extend/adjust = re-grant.
|
|
134
|
+
*/
|
|
135
|
+
export declare function useAdminGrantTrial(): import("@tanstack/react-query").UseMutationResult<AdminTrialMutationResult, Error, AdminGrantTrialVariables, unknown>;
|
|
136
|
+
/** Revoke an active trial immediately. The route answers 400 when none is active. */
|
|
137
|
+
export declare function useAdminRevokeTrial(): import("@tanstack/react-query").UseMutationResult<AdminTrialMutationResult, Error, {
|
|
138
|
+
accountId: string;
|
|
139
|
+
}, unknown>;
|
|
140
|
+
/**
|
|
141
|
+
* Set the account's managed-models override. Tri-state: `null` restores "the
|
|
142
|
+
* effective tier decides", `true` forces managed (Kortix-credential) models on,
|
|
143
|
+
* `false` forces BYOK-only.
|
|
144
|
+
*/
|
|
145
|
+
export declare function useAdminSetManagedModels(): import("@tanstack/react-query").UseMutationResult<{
|
|
146
|
+
ok: boolean;
|
|
147
|
+
override: boolean | null;
|
|
148
|
+
}, Error, {
|
|
149
|
+
accountId: string;
|
|
150
|
+
override: boolean | null;
|
|
151
|
+
}, unknown>;
|
|
152
|
+
/**
|
|
153
|
+
* Set the account's enterprise-demo flag — an interactive preview of SSO, SCIM,
|
|
154
|
+
* RBAC and audit. Operator-only since the self-serve IAM toggle was retired.
|
|
155
|
+
*/
|
|
156
|
+
export declare function useAdminSetEnterpriseDemo(): import("@tanstack/react-query").UseMutationResult<{
|
|
157
|
+
ok: boolean;
|
|
158
|
+
enabled: boolean;
|
|
159
|
+
}, Error, {
|
|
160
|
+
accountId: string;
|
|
161
|
+
enabled: boolean;
|
|
162
|
+
}, unknown>;
|
|
163
|
+
/**
|
|
164
|
+
* Set the contracted-Enterprise entitlement flag. Independent of `tier`: it
|
|
165
|
+
* keeps SSO/SCIM/RBAC/audit entitled for a signed Enterprise account that is
|
|
166
|
+
* ALSO per-seat billed, which the Stripe webhook would otherwise reconcile away.
|
|
167
|
+
*/
|
|
168
|
+
export declare function useAdminSetEnterpriseEntitled(): import("@tanstack/react-query").UseMutationResult<{
|
|
169
|
+
ok: boolean;
|
|
170
|
+
enabled: boolean;
|
|
171
|
+
}, Error, {
|
|
172
|
+
accountId: string;
|
|
173
|
+
enabled: boolean;
|
|
174
|
+
}, unknown>;
|
|
90
175
|
export interface AdminLedgerEntry {
|
|
91
176
|
id: string;
|
|
92
177
|
amount: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-accounts.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-accounts.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,S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AM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;cAClC,mBAAmB,EAAE;WAWlD;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;eAClC,mBAAmB,EAAE;WAWnD"}
|
|
@@ -107,6 +107,106 @@ export function useAdminSetTier() {
|
|
|
107
107
|
},
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Every entitlement mutation below invalidates the same two keys the credit
|
|
112
|
+
* mutations do: the paginated accounts list (the row carries `trial`,
|
|
113
|
+
* `managedModelsOverride`, `demoEnterprise` and `enterpriseEntitled`) and the
|
|
114
|
+
* per-account detail subtree.
|
|
115
|
+
*/
|
|
116
|
+
function invalidateAdminAccount(queryClient, accountId) {
|
|
117
|
+
queryClient.invalidateQueries({ queryKey: ['admin', 'accounts'] });
|
|
118
|
+
queryClient.invalidateQueries({ queryKey: ['admin', 'accounts', accountId] });
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Grant or replace an admin-issued trial. The account BEHAVES as `tierKey`
|
|
122
|
+
* until the window ends, without touching `credit_accounts.tier` (which the
|
|
123
|
+
* Stripe webhook owns). Re-granting over an active trial is allowed and
|
|
124
|
+
* overwrites the window — extend/adjust = re-grant.
|
|
125
|
+
*/
|
|
126
|
+
export function useAdminGrantTrial() {
|
|
127
|
+
const queryClient = useQueryClient();
|
|
128
|
+
return useMutation({
|
|
129
|
+
mutationFn: async ({ accountId, tierKey, seats, durationDays, creditGrant, note }) => {
|
|
130
|
+
const body = {
|
|
131
|
+
tier_key: tierKey,
|
|
132
|
+
seats,
|
|
133
|
+
duration_days: durationDays,
|
|
134
|
+
};
|
|
135
|
+
if (creditGrant !== undefined)
|
|
136
|
+
body.credit_grant = creditGrant;
|
|
137
|
+
if (note !== undefined)
|
|
138
|
+
body.note = note;
|
|
139
|
+
const response = await backendApi.post(`/admin/api/accounts/${accountId}/trial`, body);
|
|
140
|
+
if (response.error)
|
|
141
|
+
throw new Error(response.error.message);
|
|
142
|
+
return response.data;
|
|
143
|
+
},
|
|
144
|
+
onSuccess: (_data, { accountId }) => invalidateAdminAccount(queryClient, accountId),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/** Revoke an active trial immediately. The route answers 400 when none is active. */
|
|
148
|
+
export function useAdminRevokeTrial() {
|
|
149
|
+
const queryClient = useQueryClient();
|
|
150
|
+
return useMutation({
|
|
151
|
+
mutationFn: async ({ accountId }) => {
|
|
152
|
+
const response = await backendApi.delete(`/admin/api/accounts/${accountId}/trial`);
|
|
153
|
+
if (response.error)
|
|
154
|
+
throw new Error(response.error.message);
|
|
155
|
+
return response.data;
|
|
156
|
+
},
|
|
157
|
+
onSuccess: (_data, { accountId }) => invalidateAdminAccount(queryClient, accountId),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Set the account's managed-models override. Tri-state: `null` restores "the
|
|
162
|
+
* effective tier decides", `true` forces managed (Kortix-credential) models on,
|
|
163
|
+
* `false` forces BYOK-only.
|
|
164
|
+
*/
|
|
165
|
+
export function useAdminSetManagedModels() {
|
|
166
|
+
const queryClient = useQueryClient();
|
|
167
|
+
return useMutation({
|
|
168
|
+
mutationFn: async ({ accountId, override }) => {
|
|
169
|
+
const response = await backendApi.post(`/admin/api/accounts/${accountId}/managed-models`, { override });
|
|
170
|
+
if (response.error)
|
|
171
|
+
throw new Error(response.error.message);
|
|
172
|
+
return response.data;
|
|
173
|
+
},
|
|
174
|
+
onSuccess: (_data, { accountId }) => invalidateAdminAccount(queryClient, accountId),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Set the account's enterprise-demo flag — an interactive preview of SSO, SCIM,
|
|
179
|
+
* RBAC and audit. Operator-only since the self-serve IAM toggle was retired.
|
|
180
|
+
*/
|
|
181
|
+
export function useAdminSetEnterpriseDemo() {
|
|
182
|
+
const queryClient = useQueryClient();
|
|
183
|
+
return useMutation({
|
|
184
|
+
mutationFn: async ({ accountId, enabled }) => {
|
|
185
|
+
const response = await backendApi.post(`/admin/api/accounts/${accountId}/enterprise-demo`, { enabled });
|
|
186
|
+
if (response.error)
|
|
187
|
+
throw new Error(response.error.message);
|
|
188
|
+
return response.data;
|
|
189
|
+
},
|
|
190
|
+
onSuccess: (_data, { accountId }) => invalidateAdminAccount(queryClient, accountId),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Set the contracted-Enterprise entitlement flag. Independent of `tier`: it
|
|
195
|
+
* keeps SSO/SCIM/RBAC/audit entitled for a signed Enterprise account that is
|
|
196
|
+
* ALSO per-seat billed, which the Stripe webhook would otherwise reconcile away.
|
|
197
|
+
*/
|
|
198
|
+
export function useAdminSetEnterpriseEntitled() {
|
|
199
|
+
const queryClient = useQueryClient();
|
|
200
|
+
return useMutation({
|
|
201
|
+
mutationFn: async ({ accountId, enabled }) => {
|
|
202
|
+
const response = await backendApi.post(`/admin/api/accounts/${accountId}/enterprise-entitlement`, { enabled });
|
|
203
|
+
if (response.error)
|
|
204
|
+
throw new Error(response.error.message);
|
|
205
|
+
return response.data;
|
|
206
|
+
},
|
|
207
|
+
onSuccess: (_data, { accountId }) => invalidateAdminAccount(queryClient, accountId),
|
|
208
|
+
});
|
|
209
|
+
}
|
|
110
210
|
export function useAdminAccountLedger(accountId, limit = 50) {
|
|
111
211
|
return useQuery({
|
|
112
212
|
queryKey: ['admin', 'accounts', accountId, 'ledger', limit],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-admin-accounts.js","sourceRoot":"","sources":["../../src/react/use-admin-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-admin-accounts.js","sourceRoot":"","sources":["../../src/react/use-admin-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAyGrD,MAAM,UAAU,gBAAgB,CAAC,UAAgC,EAAE;IACjE,MAAM,EACJ,MAAM,GAAG,EAAE,EACX,IAAI,GAAG,EAAE,EACT,aAAa,GAAG,EAAE,EAClB,QAAQ,GAAG,KAAK,EAChB,eAAe,GAAG,IAAI,EACtB,UAAU,GAAG,IAAI,EACjB,UAAU,GAAG,IAAI,EACjB,MAAM,GAAG,SAAS,EAClB,OAAO,GAAG,MAAM,EAChB,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,EAAE,GACX,GAAG,OAAO,CAAC;IAEZ,OAAO,QAAQ,CAAwB;QACrC,QAAQ,EAAE;YACR,OAAO;YACP,UAAU;YACV,MAAM;YACN,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YACd,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC;YACvB,QAAQ;YACR,eAAe;YACf,UAAU;YACV,UAAU;YACV,MAAM;YACN,OAAO;YACP,IAAI;YACJ,KAAK;SACN;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,CAAC,GAAG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AI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,CACnC,uBAAuB,SAAS,WAAW,CAC5C,CAAC;YACF,IAAI,QAAQ,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5D,OAAO,QAAQ,CAAC,IAAK,CAAC;QACxB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,SAAwB;IAC/D,OAAO,QAAQ,CAAuC;QACpD,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC;QACvD,OAAO,EAAE,CAAC,CAAC,SAAS;QACpB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,CACnC,uBAAuB,SAAS,YAAY,CAC7C,CAAC;YACF,IAAI,QAAQ,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5D,OAAO,QAAQ,CAAC,IAAK,CAAC;QACxB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Default series length, matching the API default. */
|
|
2
|
+
export declare const ADMIN_ANALYTICS_DEFAULT_DAYS = 30;
|
|
3
|
+
/** Longest series the API will return. Larger values are clamped, not rejected. */
|
|
4
|
+
export declare const ADMIN_ANALYTICS_MAX_DAYS = 90;
|
|
5
|
+
/** Shortest series the API will return (today only). */
|
|
6
|
+
export declare const ADMIN_ANALYTICS_MIN_DAYS = 1;
|
|
7
|
+
/** One UTC day of platform activity. */
|
|
8
|
+
export interface AdminActivityDay {
|
|
9
|
+
/** `YYYY-MM-DD`, UTC. */
|
|
10
|
+
date: string;
|
|
11
|
+
/** Rows created in `kortix.project_sessions` that day. */
|
|
12
|
+
sessionsCreated: number;
|
|
13
|
+
/** Distinct accounts that created at least one session that day. */
|
|
14
|
+
activeAccounts: number;
|
|
15
|
+
/** Distinct `project_sessions.created_by` users that created a session that day. */
|
|
16
|
+
activeUsers: number;
|
|
17
|
+
/** Accounts created that day. */
|
|
18
|
+
newAccounts: number;
|
|
19
|
+
/** Distinct projects that had a session created in them that day. */
|
|
20
|
+
activeProjects: number;
|
|
21
|
+
}
|
|
22
|
+
/** Fixed-window headline numbers. These do NOT vary with the requested `days`. */
|
|
23
|
+
export interface AdminActivitySummary {
|
|
24
|
+
/** Sessions created in the last 24h * 7. */
|
|
25
|
+
sessionsLast7d: number;
|
|
26
|
+
/** Sessions created in the 7 days before that — the comparison for growth. */
|
|
27
|
+
sessionsPrev7d: number;
|
|
28
|
+
/** Distinct users who created a session in the last 24 hours. */
|
|
29
|
+
dau: number;
|
|
30
|
+
/** ...in the last 7 days. */
|
|
31
|
+
wau: number;
|
|
32
|
+
/** ...in the last 30 days. */
|
|
33
|
+
mau: number;
|
|
34
|
+
totalAccounts: number;
|
|
35
|
+
totalProjects: number;
|
|
36
|
+
}
|
|
37
|
+
export interface AdminActivityAnalytics {
|
|
38
|
+
days: AdminActivityDay[];
|
|
39
|
+
summary: AdminActivitySummary;
|
|
40
|
+
}
|
|
41
|
+
/** One UTC day of credit burn. All amounts are positive USD magnitudes. */
|
|
42
|
+
export interface AdminUsageDay {
|
|
43
|
+
/** `YYYY-MM-DD`, UTC. */
|
|
44
|
+
date: string;
|
|
45
|
+
computeUsd: number;
|
|
46
|
+
llmUsd: number;
|
|
47
|
+
/** Debits that are neither compute nor LLM — tool calls, manual adjustments. */
|
|
48
|
+
otherUsd: number;
|
|
49
|
+
/** Always exactly `computeUsd + llmUsd + otherUsd`. */
|
|
50
|
+
totalUsd: number;
|
|
51
|
+
/** Distinct accounts with at least one debit that day. */
|
|
52
|
+
payingAccounts: number;
|
|
53
|
+
}
|
|
54
|
+
export interface AdminUsageSummary {
|
|
55
|
+
/** Totals across the whole requested window, so these DO vary with `days`. */
|
|
56
|
+
totalUsd: number;
|
|
57
|
+
computeUsd: number;
|
|
58
|
+
llmUsd: number;
|
|
59
|
+
otherUsd: number;
|
|
60
|
+
spendLast7d: number;
|
|
61
|
+
spendPrev7d: number;
|
|
62
|
+
/**
|
|
63
|
+
* Distinct accounts that spent in the last 7 days. Counted over the whole
|
|
64
|
+
* window server-side, not summed from `days[].payingAccounts` — an account
|
|
65
|
+
* that spends on three days appears in three daily buckets.
|
|
66
|
+
*/
|
|
67
|
+
payingAccountsLast7d: number;
|
|
68
|
+
}
|
|
69
|
+
export interface AdminUsageAnalytics {
|
|
70
|
+
days: AdminUsageDay[];
|
|
71
|
+
summary: AdminUsageSummary;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Clamp a requested window to the range the API accepts.
|
|
75
|
+
*
|
|
76
|
+
* Applied to the query KEY as well as the request, so `days=9999` and `days=90`
|
|
77
|
+
* share one cache entry instead of refetching identical data under two keys.
|
|
78
|
+
* Fractional input is truncated for the same reason.
|
|
79
|
+
*/
|
|
80
|
+
export declare function clampAdminAnalyticsDays(days?: number): number;
|
|
81
|
+
/**
|
|
82
|
+
* Daily platform activity + DAU/WAU/MAU for the trailing `days` UTC days.
|
|
83
|
+
*
|
|
84
|
+
* `placeholderData` holds the previous window on screen while a new one loads,
|
|
85
|
+
* so changing the range re-renders the charts with new data instead of
|
|
86
|
+
* collapsing them to a skeleton.
|
|
87
|
+
*/
|
|
88
|
+
export declare function useAdminActivityAnalytics(days?: number): import("@tanstack/react-query").UseQueryResult<NoInfer<AdminActivityAnalytics>, Error>;
|
|
89
|
+
/** Daily credit burn + paying accounts for the trailing `days` UTC days. */
|
|
90
|
+
export declare function useAdminUsageAnalytics(days?: number): import("@tanstack/react-query").UseQueryResult<NoInfer<AdminUsageAnalytics>, Error>;
|
|
91
|
+
//# sourceMappingURL=use-admin-activity-analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-admin-activ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IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAM7D;AAMD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,GAAE,MAAqC,0FAcpF;AAED,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,IAAI,GAAE,MAAqC,uFAcjF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin activity analytics — "how active are our users?".
|
|
3
|
+
*
|
|
4
|
+
* Two read hooks over the platform-admin routes in
|
|
5
|
+
* `apps/api/src/admin/analytics.ts`, which own the response contract:
|
|
6
|
+
* GET /admin/analytics/activity?days= -> sessions, active accounts/users, DAU/WAU/MAU
|
|
7
|
+
* GET /admin/analytics/usage?days= -> daily credit burn + paying accounts
|
|
8
|
+
*
|
|
9
|
+
* Deliberately a NEW file rather than an addition to `use-admin-analytics.ts`.
|
|
10
|
+
* That module is a large legacy surface bound to an older `/admin/analytics/*`
|
|
11
|
+
* shape (ARR simulator, retention, thread browser) that the current backend does
|
|
12
|
+
* not serve. Nothing there is removed — every export stays public API — but new
|
|
13
|
+
* work does not extend it.
|
|
14
|
+
*
|
|
15
|
+
* Both routes are gated by supabaseAuth + requireAdmin on the server. These
|
|
16
|
+
* hooks do not re-check the caller's role; a non-admin gets a rejected query,
|
|
17
|
+
* which is the correct place for that decision to live.
|
|
18
|
+
*/
|
|
19
|
+
import { useQuery } from '@tanstack/react-query';
|
|
20
|
+
import { backendApi } from '../core/http/api-client.js';
|
|
21
|
+
/** Default series length, matching the API default. */
|
|
22
|
+
export const ADMIN_ANALYTICS_DEFAULT_DAYS = 30;
|
|
23
|
+
/** Longest series the API will return. Larger values are clamped, not rejected. */
|
|
24
|
+
export const ADMIN_ANALYTICS_MAX_DAYS = 90;
|
|
25
|
+
/** Shortest series the API will return (today only). */
|
|
26
|
+
export const ADMIN_ANALYTICS_MIN_DAYS = 1;
|
|
27
|
+
/**
|
|
28
|
+
* Clamp a requested window to the range the API accepts.
|
|
29
|
+
*
|
|
30
|
+
* Applied to the query KEY as well as the request, so `days=9999` and `days=90`
|
|
31
|
+
* share one cache entry instead of refetching identical data under two keys.
|
|
32
|
+
* Fractional input is truncated for the same reason.
|
|
33
|
+
*/
|
|
34
|
+
export function clampAdminAnalyticsDays(days) {
|
|
35
|
+
if (typeof days !== 'number' || !Number.isFinite(days))
|
|
36
|
+
return ADMIN_ANALYTICS_DEFAULT_DAYS;
|
|
37
|
+
const truncated = Math.trunc(days);
|
|
38
|
+
if (truncated < ADMIN_ANALYTICS_MIN_DAYS)
|
|
39
|
+
return ADMIN_ANALYTICS_MIN_DAYS;
|
|
40
|
+
if (truncated > ADMIN_ANALYTICS_MAX_DAYS)
|
|
41
|
+
return ADMIN_ANALYTICS_MAX_DAYS;
|
|
42
|
+
return truncated;
|
|
43
|
+
}
|
|
44
|
+
// Activity moves on the scale of minutes, and the page is a dashboard an
|
|
45
|
+
// operator leaves open. One minute of staleness beats a refetch storm.
|
|
46
|
+
const ANALYTICS_STALE_TIME_MS = 60_000;
|
|
47
|
+
/**
|
|
48
|
+
* Daily platform activity + DAU/WAU/MAU for the trailing `days` UTC days.
|
|
49
|
+
*
|
|
50
|
+
* `placeholderData` holds the previous window on screen while a new one loads,
|
|
51
|
+
* so changing the range re-renders the charts with new data instead of
|
|
52
|
+
* collapsing them to a skeleton.
|
|
53
|
+
*/
|
|
54
|
+
export function useAdminActivityAnalytics(days = ADMIN_ANALYTICS_DEFAULT_DAYS) {
|
|
55
|
+
const window = clampAdminAnalyticsDays(days);
|
|
56
|
+
return useQuery({
|
|
57
|
+
queryKey: ['admin', 'analytics', 'activity', window],
|
|
58
|
+
queryFn: async () => {
|
|
59
|
+
const response = await backendApi.get(`/admin/analytics/activity?days=${window}`);
|
|
60
|
+
if (response.error)
|
|
61
|
+
throw new Error(response.error.message);
|
|
62
|
+
return response.data;
|
|
63
|
+
},
|
|
64
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
65
|
+
placeholderData: (previousData) => previousData,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Daily credit burn + paying accounts for the trailing `days` UTC days. */
|
|
69
|
+
export function useAdminUsageAnalytics(days = ADMIN_ANALYTICS_DEFAULT_DAYS) {
|
|
70
|
+
const window = clampAdminAnalyticsDays(days);
|
|
71
|
+
return useQuery({
|
|
72
|
+
queryKey: ['admin', 'analytics', 'usage', window],
|
|
73
|
+
queryFn: async () => {
|
|
74
|
+
const response = await backendApi.get(`/admin/analytics/usage?days=${window}`);
|
|
75
|
+
if (response.error)
|
|
76
|
+
throw new Error(response.error.message);
|
|
77
|
+
return response.data;
|
|
78
|
+
},
|
|
79
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
80
|
+
placeholderData: (previousData) => previousData,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=use-admin-activity-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-admin-activity-analytics.js","sourceRoot":"","sources":["../../src/react/use-admin-activity-analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,UAAU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CAAC,YAAY,EAAE,EAAE,CAAC,YAAY;KAChD,CAAC,CAAC;AACL,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CAAC,OAAe,4BAA4B;IAChF,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,QAAQ,CAAsB;QACnC,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC;QACjD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,CACnC,+BAA+B,MAAM,EAAE,CACxC,CAAC;YACF,IAAI,QAAQ,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5D,OAAO,QAAQ,CAAC,IAAK,CAAC;QACxB,CAAC;QACD,SAAS,EAAE,uBAAuB;QAClC,eAAe,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY;KAChD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin fleet view of projects: every project on the platform, across every
|
|
3
|
+
* account, most-active first. Sibling of `useAdminAccounts` and backed by
|
|
4
|
+
* `GET /v1/admin/api/projects` (apps/api/src/admin/index.ts).
|
|
5
|
+
*
|
|
6
|
+
* "Active" is session activity, not row mtime: `lastSessionAt` is the newest
|
|
7
|
+
* session's `created_at`, and the default sort puts projects with no session at
|
|
8
|
+
* the end rather than the front.
|
|
9
|
+
*/
|
|
10
|
+
/** One row of the admin projects list. */
|
|
11
|
+
export interface AdminProject {
|
|
12
|
+
projectId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
/** `kortix.project_status` — 'active' | 'archived'. */
|
|
15
|
+
status: string | null;
|
|
16
|
+
accountId: string;
|
|
17
|
+
accountName: string | null;
|
|
18
|
+
/** Owner (or first admin) of the owning account; null when none resolves. */
|
|
19
|
+
ownerEmail: string | null;
|
|
20
|
+
createdAt: string | null;
|
|
21
|
+
sessionCount: number;
|
|
22
|
+
/** Sessions in queued/branching/provisioning/running. */
|
|
23
|
+
activeSessionCount: number;
|
|
24
|
+
/** `created_at` of the newest session; null when the project never ran one. */
|
|
25
|
+
lastSessionAt: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface AdminProjectsResponse {
|
|
28
|
+
projects: AdminProject[];
|
|
29
|
+
total: number;
|
|
30
|
+
page: number;
|
|
31
|
+
limit: number;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
/** `activity` sorts on `lastSessionAt`, nulls last in both directions. */
|
|
35
|
+
export type AdminProjectsSortBy = 'activity' | 'created' | 'sessions';
|
|
36
|
+
export type AdminProjectsSortDir = 'asc' | 'desc';
|
|
37
|
+
export interface AdminProjectsFilters {
|
|
38
|
+
/** Matches project name, account name, or any account member's email. */
|
|
39
|
+
search?: string;
|
|
40
|
+
accountId?: string;
|
|
41
|
+
/** `kortix.project_status` values; empty = no status filter. */
|
|
42
|
+
status?: string[];
|
|
43
|
+
sortBy?: AdminProjectsSortBy;
|
|
44
|
+
sortDir?: AdminProjectsSortDir;
|
|
45
|
+
page?: number;
|
|
46
|
+
/** Server caps this at 100. */
|
|
47
|
+
limit?: number;
|
|
48
|
+
}
|
|
49
|
+
export declare function useAdminProjects(filters?: AdminProjectsFilters): import("@tanstack/react-query").UseQueryResult<NoInfer<AdminProjectsResponse>, Error>;
|
|
50
|
+
//# sourceMappingURL=use-admin-projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-admin-projects.d.ts","sourceRoot":"","sources":["../../src/react/use-admin-projects.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,yFA+BlE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { backendApi } from '../core/http/api-client.js';
|
|
3
|
+
export function useAdminProjects(filters = {}) {
|
|
4
|
+
const { search = '', accountId = '', status = [], sortBy = 'activity', sortDir = 'desc', page = 1, limit = 50, } = filters;
|
|
5
|
+
return useQuery({
|
|
6
|
+
queryKey: ['admin', 'projects', search, accountId, status.join(','), sortBy, sortDir, page, limit],
|
|
7
|
+
queryFn: async () => {
|
|
8
|
+
const q = new URLSearchParams();
|
|
9
|
+
if (search)
|
|
10
|
+
q.set('search', search);
|
|
11
|
+
if (accountId)
|
|
12
|
+
q.set('accountId', accountId);
|
|
13
|
+
if (status.length)
|
|
14
|
+
q.set('status', status.join(','));
|
|
15
|
+
q.set('sortBy', sortBy);
|
|
16
|
+
q.set('sortDir', sortDir);
|
|
17
|
+
q.set('page', String(page));
|
|
18
|
+
q.set('limit', String(limit));
|
|
19
|
+
const response = await backendApi.get(`/admin/api/projects?${q.toString()}`);
|
|
20
|
+
if (response.error)
|
|
21
|
+
throw new Error(response.error.message);
|
|
22
|
+
return response.data;
|
|
23
|
+
},
|
|
24
|
+
staleTime: 15_000,
|
|
25
|
+
placeholderData: (prev) => prev,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=use-admin-projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-admin-projects.js","sourceRoot":"","sources":["../../src/react/use-admin-projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAuDrD,MAAM,UAAU,gBAAgB,CAAC,UAAgC,EAAE;IACjE,MAAM,EACJ,MAAM,GAAG,EAAE,EACX,SAAS,GAAG,EAAE,EACd,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,UAAU,EACnB,OAAO,GAAG,MAAM,EAChB,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,EAAE,GACX,GAAG,OAAO,CAAC;IAEZ,OAAO,QAAQ,CAAwB;QACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE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opencode-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-canonical-opencode-session.d.ts","sourceRoot":"","sources":["../../src/react/use-canonical-opencode-session.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAG5E;;;;;;;;;;;;;GAaG;AAEH;gFACgF;AAChF,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED,MAAM,WAAW,wBAAwB;IACvC,kFAAkF;IAClF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,wBAAwB,CAuC3B"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQuery } from '@tanstack/react-query';
|
|
3
|
-
import { getProjectSession } from '../core/rest/projects-client/index.js';
|
|
4
2
|
import { resolveSessionPin } from './initial-session-pin.js';
|
|
5
3
|
import { useOpenCodeSessions } from './use-opencode-sessions/index.js';
|
|
4
|
+
import { useProjectSession } from './use-project-session.js';
|
|
6
5
|
/**
|
|
7
6
|
* OpenCode ↔ Kortix session mapping — READ side.
|
|
8
7
|
*
|
|
@@ -33,11 +32,17 @@ export function useCanonicalOpenCodeSession(params) {
|
|
|
33
32
|
// reads active but the pin isn't resolved (pinFromStart null → query still runs).
|
|
34
33
|
// On a warm start pinFromStart is always present, so this saves a redundant
|
|
35
34
|
// round-trip that otherwise contends for connections during boot.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
// Through `useProjectSession`, not a local `useQuery`: this hook POPULATES
|
|
36
|
+
// the `qk.project.session(id, sid)` entry that `session-files-panel.tsx`,
|
|
37
|
+
// `session-changes-shared.tsx` and `session-title-sync.ts`'s title-refresh
|
|
38
|
+
// ladder all read. A local `useQuery` here shared the key but not the
|
|
39
|
+
// contract — a bare `staleTime: 10_000` against the panels'
|
|
40
|
+
// `contract('inventory')`, and a `queryFn` that differed in `showErrors` —
|
|
41
|
+
// so freshness and error-toast behaviour both came down to which surface
|
|
42
|
+
// mounted first. `enabled` is the one thing that stays local: on a warm
|
|
43
|
+
// start /start already handed us the pin, so this read is pure overhead.
|
|
44
|
+
const projectSessionQuery = useProjectSession(projectId, sessionId, {
|
|
45
|
+
enabled: !pinFromStart && !initialPin,
|
|
41
46
|
});
|
|
42
47
|
const pin = projectSessionQuery.data?.opencode_session_id ?? null;
|
|
43
48
|
const rootSessionId = resolveSessionPin({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-canonical-opencode-session.js","sourceRoot":"","sources":["../../src/react/use-canonical-opencode-session.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-canonical-opencode-session.js","sourceRoot":"","sources":["../../src/react/use-canonical-opencode-session.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAgB,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AAEH;gFACgF;AAChF,MAAM,UAAU,wBAAwB;IACtC,WAAW;AACb,CAAC;AAaD,MAAM,UAAU,2BAA2B,CAAC,MAS3C;IACC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAC9F,MAAM,aAAa,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;IAE/D,8EAA8E;IAC9E,sEAAsE;IACtE,8EAA8E;IAC9E,gFAAgF;IAChF,gFAAgF;IAChF,kFAAkF;IAClF,4EAA4E;IAC5E,kEAAkE;IAClE,2EAA2E;IAC3E,0EAA0E;IAC1E,2EAA2E;IAC3E,sEAAsE;IACtE,4DAA4D;IAC5D,2EAA2E;IAC3E,yEAAyE;IACzE,wEAAwE;IACxE,yEAAyE;IACzE,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE;QAClE,OAAO,EAAE,CAAC,YAAY,IAAI,CAAC,UAAU;KACtC,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,IAAI,IAAI,CAAC;IAClE,MAAM,aAAa,GAAG,iBAAiB,CAAC;QACtC,QAAQ,EAAE,YAAY;QACtB,UAAU;QACV,YAAY,EAAE,GAAG;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,aAAa;QACb,QAAQ,EAAE,aAAa,CAAC,IAAI,IAAI,EAAE;QAClC,SAAS,EAAE,aAAa,CAAC,SAAS;QAClC,OAAO,EAAE,aAAa,CAAC,OAAO;QAC9B,MAAM,EAAE,aAAa,CAAC,SAAS;QAC/B,KAAK,EAAE,aAAa,CAAC,KAAK,IAAI,IAAI;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-gateway-catalog-sync.d.ts","sourceRoot":"","sources":["../../src/react/use-gateway-catalog-sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-gateway-catalog-sync.d.ts","sourceRoot":"","sources":["../../src/react/use-gateway-catalog-sync.ts"],"names":[],"mappings":"AAYA,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAoChF"}
|
|
@@ -4,15 +4,18 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
|
4
4
|
import { listProjectSecrets } from '../core/rest/projects-client/index.js';
|
|
5
5
|
import { refreshProjectProviderState } from './provider-refresh.js';
|
|
6
6
|
import { useSandboxConnectionStore } from '../browser/stores/sandbox-connection-store.js';
|
|
7
|
+
import { contract } from './query-contracts.js';
|
|
8
|
+
import { qk } from './query-keys.js';
|
|
7
9
|
const REFETCH_DELAYS_MS = [0, 1200, 3000, 6000];
|
|
8
10
|
export function useGatewayCatalogSync(projectId) {
|
|
9
11
|
const queryClient = useQueryClient();
|
|
10
12
|
const runtimeReady = useSandboxConnectionStore((s) => s.status === 'connected' && s.healthy === true);
|
|
11
13
|
const secretsQuery = useQuery({
|
|
12
|
-
|
|
14
|
+
// Same entry every other `listProjectSecrets` reader shares.
|
|
15
|
+
queryKey: qk.project.secrets(projectId ?? ''),
|
|
13
16
|
queryFn: () => listProjectSecrets(projectId),
|
|
14
17
|
enabled: !!projectId && runtimeReady,
|
|
15
|
-
|
|
18
|
+
...contract('config'),
|
|
16
19
|
});
|
|
17
20
|
const signature = (() => {
|
|
18
21
|
const data = secretsQuery.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-gateway-catalog-sync.js","sourceRoot":"","sources":["../../src/react/use-gateway-catalog-sync.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,O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