Skip to content

Commit 4e38d96

Browse files
committed
Turn on marketplace
1 parent 3e2aec2 commit 4e38d96

File tree

8 files changed

+10
-113
lines changed

8 files changed

+10
-113
lines changed

packages/types/src/experiment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Keys, Equals, AssertEqual } from "./type-fu.js"
66
* ExperimentId
77
*/
88

9-
export const experimentIds = ["powerSteering", "disableCompletionCommand", "marketplace", "multiFileApplyDiff"] as const
9+
export const experimentIds = ["powerSteering", "disableCompletionCommand", "multiFileApplyDiff"] as const
1010

1111
export const experimentIdsSchema = z.enum(experimentIds)
1212

@@ -19,7 +19,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>
1919
export const experimentsSchema = z.object({
2020
powerSteering: z.boolean().optional(),
2121
disableCompletionCommand: z.boolean().optional(),
22-
marketplace: z.boolean().optional(),
2322
multiFileApplyDiff: z.boolean().optional(),
2423
})
2524

src/core/webview/ClineProvider.ts

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,6 @@ export class ClineProvider
502502
// If the extension is starting a new session, clear previous task state.
503503
await this.removeClineFromStack()
504504

505-
// Set initial VSCode context for experiments
506-
await this.updateVSCodeContext()
507-
508505
this.log("Webview view resolved")
509506
}
510507

@@ -1245,29 +1242,12 @@ export class ClineProvider
12451242
const state = await this.getStateToPostToWebview()
12461243
this.postMessageToWebview({ type: "state", state })
12471244

1248-
// Update VSCode context for experiments
1249-
await this.updateVSCodeContext()
1250-
12511245
// Check MDM compliance and send user to account tab if not compliant
12521246
if (!this.checkMdmCompliance()) {
12531247
await this.postMessageToWebview({ type: "action", action: "accountButtonClicked" })
12541248
}
12551249
}
12561250

1257-
/**
1258-
* Updates VSCode context variables for experiments so they can be used in when clauses
1259-
*/
1260-
private async updateVSCodeContext() {
1261-
const { experiments } = await this.getState()
1262-
1263-
// Set context for marketplace experiment
1264-
await vscode.commands.executeCommand(
1265-
"setContext",
1266-
`${Package.name}.marketplaceEnabled`,
1267-
experiments.marketplace ?? false,
1268-
)
1269-
}
1270-
12711251
/**
12721252
* Checks if there is a file-based system prompt override for the given mode
12731253
*/
@@ -1356,14 +1336,12 @@ export class ClineProvider
13561336
const allowedCommands = vscode.workspace.getConfiguration(Package.name).get<string[]>("allowedCommands") || []
13571337
const cwd = this.cwd
13581338

1359-
// Only fetch marketplace data if the feature is enabled
1339+
// Fetch marketplace data
13601340
let marketplaceItems: any[] = []
13611341
let marketplaceInstalledMetadata: any = { project: {}, global: {} }
13621342

1363-
if (experiments.marketplace) {
1364-
marketplaceItems = (await this.marketplaceManager.getCurrentItems()) || []
1365-
marketplaceInstalledMetadata = await this.marketplaceManager.getInstallationMetadata()
1366-
}
1343+
marketplaceItems = (await this.marketplaceManager.getCurrentItems()) || []
1344+
marketplaceInstalledMetadata = await this.marketplaceManager.getInstallationMetadata()
13671345

13681346
// Check if there's a system prompt override for the current mode
13691347
const currentMode = mode ?? defaultModeSlug

src/core/webview/webviewMessageHandler.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,13 +1465,6 @@ export const webviewMessageHandler = async (
14651465
break
14661466
}
14671467
case "filterMarketplaceItems": {
1468-
// Check if marketplace is enabled before making API calls
1469-
const { experiments } = await provider.getState()
1470-
if (!experiments.marketplace) {
1471-
console.log("Marketplace: Feature disabled, skipping API call")
1472-
break
1473-
}
1474-
14751468
if (marketplaceManager && message.filters) {
14761469
try {
14771470
await marketplaceManager.updateWithFilteredItems({
@@ -1489,13 +1482,6 @@ export const webviewMessageHandler = async (
14891482
}
14901483

14911484
case "installMarketplaceItem": {
1492-
// Check if marketplace is enabled before installing
1493-
const { experiments } = await provider.getState()
1494-
if (!experiments.marketplace) {
1495-
console.log("Marketplace: Feature disabled, skipping installation")
1496-
break
1497-
}
1498-
14991485
if (marketplaceManager && message.mpItem && message.mpInstallOptions) {
15001486
try {
15011487
const configFilePath = await marketplaceManager.installMarketplaceItem(
@@ -1525,13 +1511,6 @@ export const webviewMessageHandler = async (
15251511
}
15261512

15271513
case "removeInstalledMarketplaceItem": {
1528-
// Check if marketplace is enabled before removing
1529-
const { experiments } = await provider.getState()
1530-
if (!experiments.marketplace) {
1531-
console.log("Marketplace: Feature disabled, skipping removal")
1532-
break
1533-
}
1534-
15351514
if (marketplaceManager && message.mpItem && message.mpInstallOptions) {
15361515
try {
15371516
await marketplaceManager.removeInstalledMarketplaceItem(message.mpItem, message.mpInstallOptions)
@@ -1544,13 +1523,6 @@ export const webviewMessageHandler = async (
15441523
}
15451524

15461525
case "installMarketplaceItemWithParameters": {
1547-
// Check if marketplace is enabled before installing with parameters
1548-
const { experiments } = await provider.getState()
1549-
if (!experiments.marketplace) {
1550-
console.log("Marketplace: Feature disabled, skipping installation with parameters")
1551-
break
1552-
}
1553-
15541526
if (marketplaceManager && message.payload && "item" in message.payload && "parameters" in message.payload) {
15551527
try {
15561528
const configFilePath = await marketplaceManager.installMarketplaceItem(message.payload.item, {

src/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
{
233233
"command": "roo-cline.marketplaceButtonClicked",
234234
"group": "navigation@4",
235-
"when": "view == roo-cline.SidebarProvider && roo-cline.marketplaceEnabled"
235+
"when": "view == roo-cline.SidebarProvider"
236236
},
237237
{
238238
"command": "roo-cline.historyButtonClicked",
@@ -274,7 +274,7 @@
274274
{
275275
"command": "roo-cline.marketplaceButtonClicked",
276276
"group": "navigation@4",
277-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider && roo-cline.marketplaceEnabled"
277+
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
278278
},
279279
{
280280
"command": "roo-cline.historyButtonClicked",

src/shared/__tests__/experiments.spec.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe("experiments", () => {
2727
it("returns false when POWER_STEERING experiment is not enabled", () => {
2828
const experiments: Record<ExperimentId, boolean> = {
2929
powerSteering: false,
30-
marketplace: false,
3130
disableCompletionCommand: false,
3231
multiFileApplyDiff: false,
3332
}
@@ -37,7 +36,6 @@ describe("experiments", () => {
3736
it("returns true when experiment POWER_STEERING is enabled", () => {
3837
const experiments: Record<ExperimentId, boolean> = {
3938
powerSteering: true,
40-
marketplace: false,
4139
disableCompletionCommand: false,
4240
multiFileApplyDiff: false,
4341
}
@@ -47,49 +45,10 @@ describe("experiments", () => {
4745
it("returns false when experiment is not present", () => {
4846
const experiments: Record<ExperimentId, boolean> = {
4947
powerSteering: false,
50-
marketplace: false,
5148
disableCompletionCommand: false,
5249
multiFileApplyDiff: false,
5350
}
5451
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
5552
})
5653
})
57-
describe("MARKETPLACE", () => {
58-
it("is configured correctly", () => {
59-
expect(EXPERIMENT_IDS.MARKETPLACE).toBe("marketplace")
60-
expect(experimentConfigsMap.MARKETPLACE).toMatchObject({
61-
enabled: false,
62-
})
63-
})
64-
})
65-
66-
describe("isEnabled for MARKETPLACE", () => {
67-
it("returns false when MARKETPLACE experiment is not enabled", () => {
68-
const experiments: Record<ExperimentId, boolean> = {
69-
powerSteering: false,
70-
marketplace: false,
71-
disableCompletionCommand: false,
72-
multiFileApplyDiff: false,
73-
}
74-
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.MARKETPLACE)).toBe(false)
75-
})
76-
77-
it("returns true when MARKETPLACE experiment is enabled", () => {
78-
const experiments: Record<ExperimentId, boolean> = {
79-
powerSteering: false,
80-
marketplace: true,
81-
disableCompletionCommand: false,
82-
multiFileApplyDiff: false,
83-
}
84-
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.MARKETPLACE)).toBe(true)
85-
})
86-
87-
it("returns false when MARKETPLACE experiment is not present", () => {
88-
const experiments: Record<ExperimentId, boolean> = {
89-
powerSteering: false,
90-
// marketplace missing
91-
} as any
92-
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.MARKETPLACE)).toBe(false)
93-
})
94-
})
9554
})

src/shared/experiments.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { AssertEqual, Equals, Keys, Values, ExperimentId, Experiments } from "@roo-code/types"
22

33
export const EXPERIMENT_IDS = {
4-
MARKETPLACE: "marketplace",
54
MULTI_FILE_APPLY_DIFF: "multiFileApplyDiff",
65
DISABLE_COMPLETION_COMMAND: "disableCompletionCommand",
76
POWER_STEERING: "powerSteering",
@@ -16,7 +15,6 @@ interface ExperimentConfig {
1615
}
1716

1817
export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
19-
MARKETPLACE: { enabled: false },
2018
MULTI_FILE_APPLY_DIFF: { enabled: false },
2119
DISABLE_COMPLETION_COMMAND: { enabled: false },
2220
POWER_STEERING: { enabled: false },

webview-ui/src/App.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const App = () => {
4040
telemetrySetting,
4141
telemetryKey,
4242
machineId,
43-
experiments,
4443
cloudUserInfo,
4544
cloudIsAuthenticated,
4645
mdmCompliant,
@@ -93,10 +92,6 @@ const App = () => {
9392
// Handle switchTab action with tab parameter
9493
if (message.action === "switchTab" && message.tab) {
9594
const targetTab = message.tab as Tab
96-
// Don't switch to marketplace tab if the experiment is disabled
97-
if (targetTab === "marketplace" && !experiments.marketplace) {
98-
return
99-
}
10095
switchTab(targetTab)
10196
setCurrentSection(undefined)
10297
} else {
@@ -105,10 +100,6 @@ const App = () => {
105100
const section = message.values?.section as string | undefined
106101

107102
if (newTab) {
108-
// Don't switch to marketplace tab if the experiment is disabled
109-
if (newTab === "marketplace" && !experiments.marketplace) {
110-
return
111-
}
112103
switchTab(newTab)
113104
setCurrentSection(section)
114105
}
@@ -124,7 +115,7 @@ const App = () => {
124115
chatViewRef.current?.acceptInput()
125116
}
126117
},
127-
[switchTab, experiments],
118+
[switchTab],
128119
)
129120

130121
useEvent("message", onMessage)
@@ -147,10 +138,10 @@ const App = () => {
147138

148139
// Track marketplace tab views
149140
useEffect(() => {
150-
if (tab === "marketplace" && experiments.marketplace) {
141+
if (tab === "marketplace") {
151142
telemetryClient.capture(TelemetryEventName.MARKETPLACE_TAB_VIEWED)
152143
}
153-
}, [tab, experiments.marketplace])
144+
}, [tab])
154145

155146
if (!didHydrateState) {
156147
return null

webview-ui/src/components/settings/ExperimentalSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const ExperimentalSettings = ({
5252

5353
<Section>
5454
{Object.entries(experimentConfigsMap)
55-
.filter((config) => config[0] !== "DIFF_STRATEGY" && config[0] !== "MULTI_SEARCH_AND_REPLACE")
55+
.filter(([key]) => key in EXPERIMENT_IDS)
5656
.map((config) => {
5757
if (config[0] === "MULTI_FILE_APPLY_DIFF") {
5858
return (

0 commit comments

Comments
 (0)