@@ -76,6 +76,7 @@ describe("ExtensionRunner", () => {
|
||||
const extensionContextActions: ExtensionContextActions = {
|
||||
getModel: () => undefined,
|
||||
isIdle: () => true,
|
||||
isProjectTrusted: () => true,
|
||||
getSignal: () => undefined,
|
||||
abort: () => {},
|
||||
hasPendingMessages: () => false,
|
||||
@@ -496,6 +497,18 @@ describe("ExtensionRunner", () => {
|
||||
expect(ctx.hasUI).toBe(false);
|
||||
});
|
||||
|
||||
it("exposes project trust state on ExtensionContext", async () => {
|
||||
const result = await discoverAndLoadExtensions([], tempDir, tempDir);
|
||||
const runner = new ExtensionRunner(result.extensions, result.runtime, tempDir, sessionManager, modelRegistry);
|
||||
runner.bindCore(extensionActions, {
|
||||
...extensionContextActions,
|
||||
isProjectTrusted: () => false,
|
||||
});
|
||||
|
||||
const ctx = runner.createContext();
|
||||
expect(ctx.isProjectTrusted()).toBe(false);
|
||||
});
|
||||
|
||||
it("exposes rpc mode with hasUI true when an RPC UI context is provided", async () => {
|
||||
const result = await discoverAndLoadExtensions([], tempDir, tempDir);
|
||||
const runner = new ExtensionRunner(result.extensions, result.runtime, tempDir, sessionManager, modelRegistry);
|
||||
|
||||
@@ -12,6 +12,7 @@ function createContext(tokens: number | null, compact = vi.fn()): ExtensionConte
|
||||
modelRegistry: {} as ExtensionContext["modelRegistry"],
|
||||
model: undefined,
|
||||
isIdle: () => true,
|
||||
isProjectTrusted: () => true,
|
||||
signal: undefined,
|
||||
abort: vi.fn(),
|
||||
hasPendingMessages: () => false,
|
||||
|
||||
Reference in New Issue
Block a user