Skip to content

Commit da74567

Browse files
committed
updates to secret rendering
1 parent f293727 commit da74567

File tree

12 files changed

+133
-127
lines changed

12 files changed

+133
-127
lines changed

core/config/ConfigHandler.ts

+20-38
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import * as fs from "node:fs";
22

3-
import {
4-
AssistantUnrolled,
5-
ConfigResult,
6-
FullSlug,
7-
} from "@continuedev/config-yaml";
8-
import * as YAML from "yaml";
3+
import { ConfigResult, FullSlug } from "@continuedev/config-yaml";
94

105
import {
116
ControlPlaneClient,
@@ -36,7 +31,6 @@ import {
3631
ProfileDescription,
3732
ProfileLifecycleManager,
3833
} from "./ProfileLifecycleManager.js";
39-
import { clientRenderHelper } from "./yaml/clientRender.js";
4034

4135
export type { ProfileDescription };
4236

@@ -172,38 +166,26 @@ export class ConfigHandler {
172166
// Logged in
173167
const assistants =
174168
await this.controlPlaneClient.listAssistants(selectedOrgId);
175-
const hubProfiles = await Promise.all(
176-
assistants.map(async (assistant) => {
177-
let renderedConfig: AssistantUnrolled | undefined = undefined;
178-
if (assistant.configResult.config) {
179-
renderedConfig = await clientRenderHelper(
180-
{
181-
ownerSlug: assistant.ownerSlug,
182-
packageSlug: assistant.packageSlug,
183-
},
184-
YAML.stringify(assistant.configResult.config),
185-
selectedOrgId,
186-
this.ide,
187-
this.controlPlaneClient,
188-
);
189-
}
190-
191-
const profileLoader = new PlatformProfileLoader(
192-
{ ...assistant.configResult, config: renderedConfig },
193-
assistant.ownerSlug,
194-
assistant.packageSlug,
195-
assistant.iconUrl,
196-
assistant.configResult.config?.version ?? "latest",
197-
this.controlPlaneClient,
198-
this.ide,
199-
this.ideSettingsPromise,
200-
this.writeLog,
201-
this.reloadConfig.bind(this),
202-
);
203169

204-
return new ProfileLifecycleManager(profileLoader, this.ide);
205-
}),
206-
);
170+
const hubProfiles = assistants.map((assistant) => {
171+
const profileLoader = new PlatformProfileLoader(
172+
{
173+
...assistant.configResult,
174+
config: assistant.configResult.config,
175+
},
176+
assistant.ownerSlug,
177+
assistant.packageSlug,
178+
assistant.iconUrl,
179+
assistant.configResult.config?.version ?? "latest",
180+
this.controlPlaneClient,
181+
this.ide,
182+
this.ideSettingsPromise,
183+
this.writeLog,
184+
this.reloadConfig.bind(this),
185+
);
186+
187+
return new ProfileLifecycleManager(profileLoader, this.ide);
188+
});
207189

208190
if (selectedOrgId === null) {
209191
// Personal

core/config/yaml/clientRender.ts

-45
This file was deleted.

core/control-plane/client.ts

+5-19
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,18 @@ export class ControlPlaneClient {
4040
private readonly ideSettingsPromise: Promise<IdeSettings>,
4141
) {}
4242

43-
async resolveFQSNs(fqsns: FQSN[]): Promise<(SecretResult | undefined)[]> {
43+
async resolveFQSNs(
44+
fqsns: FQSN[],
45+
orgScopeId: string | null,
46+
): Promise<(SecretResult | undefined)[]> {
4447
const userId = await this.userId;
4548
if (!userId) {
4649
throw new Error("No user id");
4750
}
4851

4952
const resp = await this.request("ide/sync-secrets", {
5053
method: "POST",
51-
body: JSON.stringify({ fqsns }),
54+
body: JSON.stringify({ fqsns, orgScopeId }),
5255
});
5356
return (await resp.json()) as any;
5457
}
@@ -183,21 +186,4 @@ export class ControlPlaneClient {
183186
});
184187
return ((await resp.json()) as any).settings;
185188
}
186-
187-
async syncSecrets(secretNames: string[]): Promise<Record<string, string>> {
188-
const userId = await this.userId;
189-
if (!userId) {
190-
throw new Error("No user id");
191-
}
192-
193-
try {
194-
const resp = await this.request("ide/sync-secrets", {
195-
method: "POST",
196-
body: JSON.stringify({ secretNames }),
197-
});
198-
return (await resp.json()) as any;
199-
} catch (e) {
200-
return {};
201-
}
202-
}
203189
}

core/package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
4747
"@aws-sdk/credential-providers": "^3.620.1",
4848
"@continuedev/config-types": "^1.0.13",
49-
"@continuedev/config-yaml": "^1.0.42",
49+
"@continuedev/config-yaml": "^1.0.47",
5050
"@continuedev/fetch": "^1.0.4",
5151
"@continuedev/llm-info": "^1.0.2",
5252
"@continuedev/openai-adapters": "^1.0.10",

extensions/vscode/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:watch": "vitest"
1616
},
1717
"dependencies": {
18-
"@continuedev/config-yaml": "^1.0.42",
18+
"@continuedev/config-yaml": "^1.0.47",
1919
"@headlessui/react": "^1.7.17",
2020
"@heroicons/react": "^2.0.18",
2121
"@reduxjs/toolkit": "^2.3.0",

packages/config-yaml/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@continuedev/config-yaml",
3-
"version": "1.0.42",
3+
"version": "1.0.47",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/config-yaml/src/load/clientRender.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
parseAssistantUnrolled,
1919
} from "./unroll.js";
2020

21-
export async function clientRender(
21+
export async function renderSecrets(
2222
packageSlug: PackageSlug,
2323
unrolledConfigContent: string,
2424
clientSecretStore: SecretStore,
@@ -109,7 +109,7 @@ function getContinueProxyModelName(
109109
return `${packageSlug.ownerSlug}/${packageSlug.packageSlug}/${provider}/${model}`;
110110
}
111111

112-
function useProxyForUnrenderedSecrets(
112+
export function useProxyForUnrenderedSecrets(
113113
config: AssistantUnrolled,
114114
packageSlug: PackageSlug,
115115
orgScopeId: string | null,

0 commit comments

Comments
 (0)