taskchef 8.4.0 → 8.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/src/dashboard/dist/app.js +9 -9
- package/src/dashboard/dist/app.js.map +1 -1
- package/src/dashboard/react/components/ModelSettings.test.tsx +4 -3
- package/src/dashboard/react/components/ModelSettings.tsx +3 -6
- package/src/dashboard.js +10 -10
- package/src/version.js +1 -0
|
@@ -19,18 +19,19 @@ vi.mock('@mantine/core', async () => {
|
|
|
19
19
|
|
|
20
20
|
afterEach(() => { cleanup(); vi.unstubAllGlobals(); vi.clearAllMocks(); });
|
|
21
21
|
|
|
22
|
-
test('shows the version
|
|
22
|
+
test('shows the ccusage version pinned by TaskChef without an availability status', async () => {
|
|
23
23
|
vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
|
|
24
24
|
ok: true,
|
|
25
25
|
json: async () => ({
|
|
26
26
|
profiles: [],
|
|
27
|
-
usageProvider: { provider: 'ccusage',
|
|
27
|
+
usageProvider: { provider: 'ccusage', version: '20.0.21' },
|
|
28
28
|
}),
|
|
29
29
|
}));
|
|
30
30
|
render(<MantineProvider><ModelSettings /></MantineProvider>);
|
|
31
31
|
expect(await screen.findByText('ccusage 20.0.21')).toBeInTheDocument();
|
|
32
32
|
expect(screen.getByText('Usage provider')).toBeInTheDocument();
|
|
33
|
-
expect(screen.getByText(/Version
|
|
33
|
+
expect(screen.getByText(/Version pinned by TaskChef/)).toBeInTheDocument();
|
|
34
|
+
expect(screen.queryByText('available')).not.toBeInTheDocument();
|
|
34
35
|
});
|
|
35
36
|
|
|
36
37
|
test('refresh shows configuration failures and does not label them honored', async () => {
|
|
@@ -8,7 +8,7 @@ const effortLabels: Record<string, string> = { low: 'Light', medium: 'Medium', h
|
|
|
8
8
|
type ModelOption = { value: string; label: string; efforts: string[] };
|
|
9
9
|
type Role = { role: string; source: string | null; displaySource?: string | null; model: unknown; effort: unknown; status: string; problems: string[] };
|
|
10
10
|
type Profile = { id: string; roles: Role[]; problems: string[]; modelOptions?: ModelOption[] };
|
|
11
|
-
type UsageProvider = { provider: string;
|
|
11
|
+
type UsageProvider = { provider: string; version: string | null };
|
|
12
12
|
|
|
13
13
|
export function ModelSettings() {
|
|
14
14
|
const [profiles, setProfiles] = useState<Profile[]>([]);
|
|
@@ -97,12 +97,9 @@ export function ModelSettings() {
|
|
|
97
97
|
</>}
|
|
98
98
|
{usageProvider && <Paper withBorder p="md">
|
|
99
99
|
<Stack gap="xs">
|
|
100
|
-
<
|
|
101
|
-
<Title order={3} size="h4">Usage provider</Title>
|
|
102
|
-
<Badge color={usageProvider.status === 'available' ? 'teal' : 'red'}>{usageProvider.status}</Badge>
|
|
103
|
-
</Group>
|
|
100
|
+
<Title order={3} size="h4">Usage provider</Title>
|
|
104
101
|
<Text>{usageProvider.provider}{usageProvider.version ? ` ${usageProvider.version}` : ' version unavailable'}</Text>
|
|
105
|
-
<Text c="dimmed" size="sm">Version
|
|
102
|
+
<Text c="dimmed" size="sm">Version pinned by TaskChef for token and cost estimates.</Text>
|
|
106
103
|
</Stack>
|
|
107
104
|
</Paper>}
|
|
108
105
|
</Stack>;
|
package/src/dashboard.js
CHANGED
|
@@ -24,11 +24,15 @@ import {
|
|
|
24
24
|
readConfig,
|
|
25
25
|
readTask,
|
|
26
26
|
} from "./workspace.js";
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
DASHBOARD_SERVER_VERSION,
|
|
29
|
+
PINNED_CCUSAGE_VERSION,
|
|
30
|
+
TASKCHEF_VERSION,
|
|
31
|
+
} from "./version.js";
|
|
28
32
|
import { taskGitHubProjection } from "./dashboard/github-links.js";
|
|
29
33
|
import { CODEX_CHAT_ARCHIVE_ENABLED } from "./dashboard/state.js";
|
|
30
34
|
import { createUsageTracker } from "./usage-tracker.js";
|
|
31
|
-
import {
|
|
35
|
+
import { readUsageStore, usageStorePath } from "./usage.js";
|
|
32
36
|
import { reportedWorkSummary } from "./reported-work.js";
|
|
33
37
|
import {
|
|
34
38
|
DASHBOARD_CONTROL_SESSION_PATH,
|
|
@@ -794,7 +798,6 @@ export async function createDashboardServer({
|
|
|
794
798
|
usageSummaryMonitor = null,
|
|
795
799
|
usagePreloadIntervalMs = 30_000,
|
|
796
800
|
resolveRoles = resolveModelRoles,
|
|
797
|
-
resolveUsageProvider = readCcusageRuntimeInfo,
|
|
798
801
|
updateRole = updateModelRole,
|
|
799
802
|
control = null,
|
|
800
803
|
} = {}) {
|
|
@@ -861,8 +864,6 @@ export async function createDashboardServer({
|
|
|
861
864
|
}
|
|
862
865
|
const clients = new Set();
|
|
863
866
|
const archiveRequests = new Set();
|
|
864
|
-
let usageProviderPromise = null;
|
|
865
|
-
|
|
866
867
|
const broadcast = (event, value) => {
|
|
867
868
|
const payload = ssePayload(event, value);
|
|
868
869
|
for (const client of clients) client.write(payload);
|
|
@@ -989,12 +990,11 @@ export async function createDashboardServer({
|
|
|
989
990
|
|
|
990
991
|
if (url.pathname === "/api/settings" && method === "GET") {
|
|
991
992
|
const profiles = [{ id: "personal", project: "Personal", ...await resolveRoles({ includeCatalog: true }) }];
|
|
992
|
-
|
|
993
|
+
const usageProvider = {
|
|
993
994
|
provider: "ccusage",
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
})
|
|
997
|
-
sendJson(response, 200, { profiles, usageProvider: await usageProviderPromise });
|
|
995
|
+
version: PINNED_CCUSAGE_VERSION,
|
|
996
|
+
};
|
|
997
|
+
sendJson(response, 200, { profiles, usageProvider });
|
|
998
998
|
return;
|
|
999
999
|
}
|
|
1000
1000
|
|
package/src/version.js
CHANGED
|
@@ -4,4 +4,5 @@ const require = createRequire(import.meta.url);
|
|
|
4
4
|
const packageMetadata = require("../package.json");
|
|
5
5
|
|
|
6
6
|
export const TASKCHEF_VERSION = packageMetadata.version;
|
|
7
|
+
export const PINNED_CCUSAGE_VERSION = packageMetadata.optionalDependencies?.ccusage ?? null;
|
|
7
8
|
export const DASHBOARD_SERVER_VERSION = "4";
|