Skip to content

Commit 3c837e3

Browse files
author
Yaroslav Litkovych
committed
fix(provider-cursor): advertise manual compaction
1 parent a21d788 commit 3c837e3

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎packages/provider-cursor/src/server/status.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import * as Schema from "effect/Schema";
55
import type { CursorSettings } from "../settings.ts";
66
import { CursorSettings as CursorSettingsSchema } from "../settings.ts";
77
import { createModelCapabilities } from "@t3tools/shared/model";
8+
import { COMPACT_SLASH_COMMAND } from "@t3tools/provider-core/server/snapshotProbe";
89

910
import {
1011
buildCursorCapabilitiesFromSdkModel,
1112
buildCursorDiscoveredModelsFromSdk,
1213
buildCursorProviderSnapshot,
14+
buildInitialCursorProviderSnapshot,
1315
checkCursorProviderStatus,
1416
} from "./status.ts";
1517
import * as CursorSdkCatalog from "./CursorSdkCatalog.ts";
@@ -94,6 +96,19 @@ const sdkParameterizedModel = {
9496
],
9597
} satisfies SDKModel;
9698

99+
describe("buildInitialCursorProviderSnapshot", () => {
100+
it.effect.each([true, false])("advertises manual compaction only when enabled (%s)", (enabled) =>
101+
Effect.gen(function* () {
102+
const provider = yield* buildInitialCursorProviderSnapshot({
103+
...baseCursorSettings,
104+
enabled,
105+
});
106+
107+
expect(provider.slashCommands).toEqual(enabled ? [COMPACT_SLASH_COMMAND] : []);
108+
}),
109+
);
110+
});
111+
97112
describe("buildCursorProviderSnapshot", () => {
98113
it("downgrades ready status to warning when SDK model discovery returns no models", () => {
99114
expect(
@@ -111,6 +126,7 @@ describe("buildCursorProviderSnapshot", () => {
111126
status: "warning",
112127
message: "Cursor SDK model discovery returned no built-in models.",
113128
models: [],
129+
slashCommands: [COMPACT_SLASH_COMMAND],
114130
supportsConversationRollback: false,
115131
});
116132
});
@@ -181,6 +197,7 @@ describe("checkCursorProviderStatus", () => {
181197

182198
expect(provider).toMatchObject({
183199
status: "ready",
200+
slashCommands: [COMPACT_SLASH_COMMAND],
184201
auth: {
185202
status: "authenticated",
186203
type: "api-key",

‎packages/provider-cursor/src/server/status.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
buildBooleanOptionDescriptor,
1919
buildSelectOptionDescriptor,
2020
buildServerProvider,
21+
COMPACT_SLASH_COMMAND,
2122
providerModelsFromSettings,
2223
type ServerProviderDraft,
2324
} from "@t3tools/provider-core/server/snapshotProbe";
@@ -61,6 +62,7 @@ export const buildInitialCursorProviderSnapshot = Effect.fn(
6162
enabled: true,
6263
checkedAt,
6364
models,
65+
slashCommands: [COMPACT_SLASH_COMMAND],
6466
probe: {
6567
installed: true,
6668
version: null,
@@ -233,6 +235,7 @@ export function buildCursorProviderSnapshot(input: {
233235
input.cursorSettings.customModels,
234236
EMPTY_CAPABILITIES,
235237
),
238+
slashCommands: [COMPACT_SLASH_COMMAND],
236239
probe: {
237240
installed: true,
238241
version: input.parsed.version,

0 commit comments

Comments
 (0)