showrunner-agent-staging 0.5.135-staging.2001 → 0.5.135-staging.2012
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/README.md +2 -2
- package/dist/src/adapter-runner.js +3 -4
- package/dist/src/adapter.d.ts +3 -3
- package/dist/src/adapter.js +22 -20
- package/dist/src/adapters/acp/acp-adapter.js +2 -2
- package/dist/src/adapters/claude/claude-adapter.d.ts +3 -2
- package/dist/src/adapters/claude/claude-adapter.js +35 -28
- package/dist/src/adapters/claude/claude-permission-mapper.js +3 -3
- package/dist/src/adapters/claude/claude-sandbox.d.ts +3 -7
- package/dist/src/adapters/claude/claude-sandbox.js +8 -12
- package/dist/src/adapters/codex/codex-adapter.d.ts +4 -11
- package/dist/src/adapters/codex/codex-adapter.js +35 -49
- package/dist/src/adapters/codex/codex-input-mapper.js +9 -10
- package/dist/src/adapters/codex/codex-sandbox.d.ts +3 -4
- package/dist/src/adapters/codex/codex-sandbox.js +4 -7
- package/dist/src/agent-tools.js +2 -2
- package/dist/src/approval-policy.d.ts +2 -2
- package/dist/src/approval-policy.js +7 -15
- package/dist/src/file-tools.js +3 -3
- package/dist/src/run-type.d.ts +3 -0
- package/dist/src/run-type.js +1 -0
- package/dist/src/step-names.d.ts +5 -0
- package/dist/src/step-names.js +20 -1
- package/dist/src/teammate-sandbox.d.ts +3 -4
- package/dist/src/teammate-sandbox.js +4 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,9 +71,9 @@ Run each connector under a dedicated OS account/container with access only to it
|
|
|
71
71
|
|
|
72
72
|
The server fixes `trust.runType` to `owner`, `trusted`, or `untrusted` when a run starts. Reading messages, files, web pages, or tool output never changes it. `trust.ownerProfileId` identifies whose Showrunner content the run works with; for a team agent that is the initiating member. Only the installer's runs get `owner` authority.
|
|
73
73
|
|
|
74
|
-
Owner runs pass through the provider's native configuration and permission prompts, including the owner's
|
|
74
|
+
Owner and trusted runs pass through the provider's native configuration and permission prompts, including Full access. A trusted teammate cannot use the owner's connected accounts (Claude's claude.ai connectors, Codex's apps). Untrusted runs use a verified provider sandbox: project work and Showrunner's own tools in the chat need no card, while files outside the project folder, each new site, the owner's accounts, and email sends ask the owner. On any run, Showrunner's own tools ask only before sending to people and moving money. The server limits teammate reads to content the teammate can see, and the connector starts a fresh provider session when retained context may contain private content. ACP accepts owner and trusted runs. See [docs/native-sandbox-approvals.md](docs/native-sandbox-approvals.md).
|
|
75
75
|
|
|
76
|
-
Cards carry an origin describing why they appeared: `provider_ask` relays a provider permission request; `sandbox_escape`, `network`, `outside_project`, and `owner_account` identify
|
|
76
|
+
Cards carry an origin describing why they appeared: `provider_ask` relays a provider permission request; `sandbox_escape`, `network`, `outside_project`, and `owner_account` identify untrusted requests beyond the sandbox or into the installer's accounts. A run reads the chats everyone in the room it was asked in can see; in an owner's private chat with the agent that is all the owner's chats, and a teammate's run stays within what its starter can see. Provider permission memory stays with the provider. Allow on an untrusted run's non-folder card covers that exact effect for the rest of the request; a decline is final for that request. Allow on an outside-folder card grants the folder for the rest of the invocation. Outside-folder cards also offer **Always allow this folder**, which saves the exact directory from the provider's native permission request. Later untrusted runs can read saved folders; owner and trusted runs use the native filesystem instead. The filesystem root, `/Users`, a home folder, its `Library` and `.config`, and top-level system folders such as `/etc`, `/opt`, `/usr` and `/Volumes` can be granted for one invocation but can't be saved. Other untrusted cards offer **Always trust _name_**.
|
|
77
77
|
|
|
78
78
|
Claude and Codex keep a run open while the provider reports background jobs. Claude's `background_tasks_changed` snapshot (excluding tasks the SDK marks `ambient`, plus terminal `task_updated` patches) and Codex's background-terminal inventory decide which jobs are running. When the provider's turn ends, the connector marks the foreground ended: the card shows its finished steps and one quiet background-jobs line, each job with its own Stop (Claude `stopTask`, Codex `thread/backgroundTerminals/terminate`). The run's Stop stays while any job runs and ends the run and every job. A person's message during this time steers into the run, as it does while the foreground works. Codex isn't woken when a job ends, so the connector posts one line saying how it went. Once the CLI is idle with only ambient tasks, the invocation ends while the CLI stays available for that chat. The next message uses the same input queue. Ending the CLI ends its background tasks.
|
|
79
79
|
|
|
@@ -37,7 +37,6 @@ export function createAdapterProcessor(input) {
|
|
|
37
37
|
const installationState = new NamespacedAdapterStateStore(input.state, input.adapter.kind, event.installation.id);
|
|
38
38
|
const state = new NamespacedAdapterStateStore(installationState, ...(generation === undefined ? [] : [generation]), event.session.id);
|
|
39
39
|
const previousSessionId = accountChanged ? null : handlerContext.session.externalSessionId;
|
|
40
|
-
const isOwner = trust.runType === "owner";
|
|
41
40
|
const previousWasTeammateBox = previousSessionId !== null &&
|
|
42
41
|
await state.get("provider-teammate-box", previousSessionId) === true;
|
|
43
42
|
const previousRunType = previousSessionId === null ? undefined :
|
|
@@ -46,7 +45,7 @@ export function createAdapterProcessor(input) {
|
|
|
46
45
|
// currently visible history, never from a transcript that may contain revoked private content.
|
|
47
46
|
const reason = accountChanged ? "account_change"
|
|
48
47
|
: previousSessionId === null ? "no_session"
|
|
49
|
-
:
|
|
48
|
+
: trust.runType !== "owner" ? "teammate_authority"
|
|
50
49
|
: previousRunType !== "owner" ? "provider_box_change"
|
|
51
50
|
: "reuse";
|
|
52
51
|
const freshProviderSession = reason !== "reuse" && reason !== "no_session";
|
|
@@ -247,12 +246,12 @@ export function createAdapterProcessor(input) {
|
|
|
247
246
|
get reasoningEffort() { return currentSettings().reasoningEffort; },
|
|
248
247
|
get mode() { return currentSettings().mode ?? null; },
|
|
249
248
|
get allowedFolders() {
|
|
250
|
-
if (
|
|
249
|
+
if (trust.runType !== "untrusted")
|
|
251
250
|
return [];
|
|
252
251
|
return currentSettings().allowedFolders ?? [];
|
|
253
252
|
},
|
|
254
253
|
get approvalMode() { return input.adapter.supportsAutoApproval ? currentPermissions().approvalMode : "ask"; },
|
|
255
|
-
get ownerFullAccess() { return input.adapter.supportsAutoApproval === true &&
|
|
254
|
+
get ownerFullAccess() { return input.adapter.supportsAutoApproval === true && trust.runType !== "untrusted" && currentPermissions().fullAccess === true; },
|
|
256
255
|
client: commands,
|
|
257
256
|
finishRun: finish,
|
|
258
257
|
installationState,
|
package/dist/src/adapter.d.ts
CHANGED
|
@@ -461,7 +461,7 @@ export interface AgentInvocationContext {
|
|
|
461
461
|
reasoningEffort: string | null;
|
|
462
462
|
mode: string | null;
|
|
463
463
|
approvalMode?: "ask" | "auto";
|
|
464
|
-
/** Full access is on:
|
|
464
|
+
/** Full access is on: owner-path runs use the provider's no-approvals mode. */
|
|
465
465
|
ownerFullAccess?: boolean;
|
|
466
466
|
client: AdapterClient;
|
|
467
467
|
/** Durable state shared by every chat and provider session for this agent installation. */
|
|
@@ -473,7 +473,7 @@ export interface AgentInvocationContext {
|
|
|
473
473
|
ownerProfileId: string;
|
|
474
474
|
/** The profile that started the run. */
|
|
475
475
|
initiatingProfileId?: string;
|
|
476
|
-
/** That person's name, for
|
|
476
|
+
/** That person's name, for owner-only cards such as untrusted sandbox escapes, sends and payments. */
|
|
477
477
|
initiatingDisplayName?: string;
|
|
478
478
|
};
|
|
479
479
|
scope: AgentStreamScope;
|
|
@@ -639,7 +639,7 @@ export declare function messageReferences(event: AgentEvent): string;
|
|
|
639
639
|
/** The body and its references as one turn, for a provider with no model-only channel. */
|
|
640
640
|
export declare function messageText(event: AgentEvent): string;
|
|
641
641
|
export declare function providerResourceId(namespace: string, value: string): string;
|
|
642
|
-
/**
|
|
642
|
+
/** Untrusted and owner-account questions belong to the installation owner. */
|
|
643
643
|
export declare function teammateQuestion(context: AgentInvocationContext, body: string, origin?: ApprovalOrigin): {
|
|
644
644
|
body: string;
|
|
645
645
|
authorizedResponderProfileId?: string;
|
package/dist/src/adapter.js
CHANGED
|
@@ -8,7 +8,7 @@ import { readdir } from "node:fs/promises";
|
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { nativeCanonicalPath, runScope } from "./run-folders.js";
|
|
10
10
|
import { isWithin } from "./command-boundaries.js";
|
|
11
|
-
import { runStartedByOwner } from "./run-type.js";
|
|
11
|
+
import { runStartedByOwner, runUsesOwnerPath } from "./run-type.js";
|
|
12
12
|
import { invocationDownloadDirectory } from "./file-tools.js";
|
|
13
13
|
import { redactKnownSecrets } from "./known-secrets.js";
|
|
14
14
|
const redacted = "[REDACTED]";
|
|
@@ -324,25 +324,26 @@ export function consequenceFor(request) {
|
|
|
324
324
|
*/
|
|
325
325
|
export function invocationRunScope(context, workspaceRoot, sessionFolder, purpose = "read", projectAccess = "write") {
|
|
326
326
|
const project = [workspaceRoot, context.workingDirectory].map(folder => ({ path: folder, access: projectAccess }));
|
|
327
|
-
const saved = teammateAllowedFolders(context.allowedFolders ?? []
|
|
327
|
+
const saved = context.trust.runType === "untrusted" ? teammateAllowedFolders(context.allowedFolders ?? []) : [];
|
|
328
328
|
const approved = [...context.ownerApprovedFolders ?? []].map(([folder, access]) => ({ path: folder, access }));
|
|
329
329
|
const folders = [...project, ...saved, ...approved].filter(folder => purpose === "read" || folder.access === "write").map(folder => folder.path);
|
|
330
330
|
const folderScope = runScope([...folders, invocationDownloadDirectory(context), context.outputDirectory?.path, nativeTemporaryDirectory()]);
|
|
331
|
-
const credentials =
|
|
331
|
+
const credentials = runUsesOwnerPath(context.trust) ? [] : context.credentialPaths ?? [];
|
|
332
332
|
return target => (folderScope(target) && !credentials.some(credential => isWithin(credential, target))) || sessionFolder?.(target) === true;
|
|
333
333
|
}
|
|
334
334
|
export async function requestHostToolApproval(context, request, input, signal) {
|
|
335
|
-
const
|
|
335
|
+
const ownerPath = runUsesOwnerPath(context.trust);
|
|
336
|
+
// A trusted teammate answers its own provider prompts, as the owner does; sends and payments still ask the owner.
|
|
337
|
+
const asksInstallationOwner = !runStartedByOwner(context.trust) && (!ownerPath || input.asksOwner === true);
|
|
336
338
|
const providerAsked = input.providerAsked === true;
|
|
337
339
|
const folderScope = request.origin === "outside_project" || request.origin === "sandbox_escape" ? "outside" : "inside";
|
|
338
|
-
const reportedFolder =
|
|
340
|
+
const reportedFolder = ownerPath || folderScope !== "outside" || request.allowedFolder === undefined ? undefined
|
|
339
341
|
: nativeCanonicalPath(request.allowedFolder, request.cwd ?? request.workspaceRoot ?? context.workingDirectory ?? "/");
|
|
340
342
|
const allowedFolder = reportedFolder;
|
|
341
|
-
const reach = input.reach ?? (!
|
|
343
|
+
const reach = input.reach ?? (!ownerPath && folderScope === "outside" && reportedFolder !== undefined
|
|
342
344
|
? "outside_folder" : undefined);
|
|
343
|
-
//
|
|
344
|
-
|
|
345
|
-
if (usesOwnerApprovalPolicy(context.trust.runType, context.approvalMode, folderScope) &&
|
|
345
|
+
// Provider prompts, sends, payments and server-owned decisions still ask.
|
|
346
|
+
if (usesOwnerApprovalPolicy(context.trust.runType) &&
|
|
346
347
|
!providerAsked && input.asksOwner !== true) {
|
|
347
348
|
return { allowed: true, outcome: "allowed", cardless: true };
|
|
348
349
|
}
|
|
@@ -352,7 +353,7 @@ export async function requestHostToolApproval(context, request, input, signal) {
|
|
|
352
353
|
}
|
|
353
354
|
// The server spends an Allow for a send (an email, or a connected-app write) once, so a teammate's
|
|
354
355
|
// run never reuses one: sending the same again shows a new card.
|
|
355
|
-
const remembersAllow = !
|
|
356
|
+
const remembersAllow = !ownerPath && request.emailAction === undefined && request.appAction === undefined;
|
|
356
357
|
const approvedEffect = approvedEffectKey(request);
|
|
357
358
|
if (remembersAllow && context.approvedHostToolEffects?.has(approvedEffect)) {
|
|
358
359
|
return { allowed: true, outcome: "allowed", cardless: true };
|
|
@@ -366,14 +367,15 @@ export async function requestHostToolApproval(context, request, input, signal) {
|
|
|
366
367
|
answer = await waitForApproval(context.client.requestApproval({
|
|
367
368
|
origin: request.origin ?? "provider_ask",
|
|
368
369
|
effectIdentity: request.effectIdentity, activityId: request.activityId,
|
|
369
|
-
title: input.title, body:
|
|
370
|
+
title: input.title, body: asksInstallationOwner
|
|
371
|
+
? `${context.trust.initiatingDisplayName?.trim() || "A teammate"} asked: ${input.body}`.slice(0, 2_000) : input.body,
|
|
370
372
|
toolName: request.toolName, capability: request.capability,
|
|
371
373
|
effectDetail: sanitizeApprovalText(fullEffect.value, 500), effectFull: fullEffect.value,
|
|
372
374
|
effectFullTruncated: fullEffect.truncated,
|
|
373
375
|
...(command === undefined ? {} : { command }),
|
|
374
376
|
...(editSupported ? { canEditCommand: true } : {}),
|
|
375
377
|
riskLevel: request.origin === "sandbox_escape" || request.origin === "owner_account" ? "high" : request.origin === "network" ? "medium" : "low", availableDecisions: ["approve", "decline", "cancel"],
|
|
376
|
-
expiresInSeconds: inputRequestLifetimeSeconds, requiresOwnerApproval:
|
|
378
|
+
expiresInSeconds: inputRequestLifetimeSeconds, requiresOwnerApproval: asksInstallationOwner,
|
|
377
379
|
...(reach === undefined ? {} : { reachType: reach }),
|
|
378
380
|
...(allowedFolder === undefined ? {} : { allowedFolder }),
|
|
379
381
|
...(request.appAction === undefined ? {} : { appAction: request.appAction }),
|
|
@@ -404,18 +406,18 @@ export async function requestHostToolApproval(context, request, input, signal) {
|
|
|
404
406
|
if (answer.decision === "decline") {
|
|
405
407
|
(context.declinedHostToolEffects ??= new Set()).add(declinedEffect);
|
|
406
408
|
}
|
|
407
|
-
//
|
|
409
|
+
// An untrusted card offers no provider "don't ask again". A response that asks for the folder (allowFolderForRunRequested,
|
|
408
410
|
// sent only by a surface that said so) grants it for this invocation, and nothing else is remembered; any other
|
|
409
411
|
// approval covers only that exact effect.
|
|
410
|
-
const remember =
|
|
412
|
+
const remember = ownerPath && answer.rememberRequested;
|
|
411
413
|
const alwaysAllowFolder = answer.alwaysAllowFolderRequested === true && allowedFolder !== undefined &&
|
|
412
414
|
canPersistTeammateFolder(allowedFolder);
|
|
413
|
-
const folderAllowed = allowed && editedCommand === undefined && !
|
|
415
|
+
const folderAllowed = allowed && editedCommand === undefined && !ownerPath && allowedFolder !== undefined &&
|
|
414
416
|
(alwaysAllowFolder || answer.allowFolderForRunRequested === true);
|
|
415
417
|
if (folderAllowed) {
|
|
416
418
|
const requestedAccess = alwaysAllowFolder ? allowedFolderAccess(request.capability) : "write";
|
|
417
419
|
const access = alwaysAllowFolder
|
|
418
|
-
? teammateAllowedFolders([{ path: allowedFolder, access: requestedAccess }]
|
|
420
|
+
? teammateAllowedFolders([{ path: allowedFolder, access: requestedAccess }])[0]?.access ?? requestedAccess
|
|
419
421
|
: requestedAccess;
|
|
420
422
|
const approved = context.ownerApprovedFolders ??= new Map();
|
|
421
423
|
if (approved.get(allowedFolder) !== "write")
|
|
@@ -435,7 +437,7 @@ export async function requestHostToolApproval(context, request, input, signal) {
|
|
|
435
437
|
}
|
|
436
438
|
/** A teammate's Allow covers that one thing for the rest of the run, so the provider asking again shows no second card. */
|
|
437
439
|
export function rememberTeammateApproval(context, request) {
|
|
438
|
-
if (!
|
|
440
|
+
if (!runUsesOwnerPath(context.trust))
|
|
439
441
|
(context.approvedHostToolEffects ??= new Set()).add(approvedEffectKey(request));
|
|
440
442
|
}
|
|
441
443
|
export function declinedEffectKey(request) {
|
|
@@ -838,9 +840,9 @@ export function providerResourceId(namespace, value) {
|
|
|
838
840
|
const hex = bytes.toString("hex");
|
|
839
841
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
840
842
|
}
|
|
841
|
-
/**
|
|
843
|
+
/** Untrusted and owner-account questions belong to the installation owner. */
|
|
842
844
|
export function teammateQuestion(context, body, origin = "provider_ask") {
|
|
843
|
-
return runStartedByOwner(context.trust) ? { body } : {
|
|
845
|
+
return runStartedByOwner(context.trust) || runUsesOwnerPath(context.trust) && origin !== "owner_account" ? { body } : {
|
|
844
846
|
body: `${context.trust.initiatingDisplayName?.trim() || "A teammate"} asked: ${body}`.slice(0, 2_000),
|
|
845
847
|
authorizedResponderProfileId: context.trust.ownerProfileId,
|
|
846
848
|
origin,
|
|
@@ -857,7 +859,7 @@ const workingFolderListingLimit = 30;
|
|
|
857
859
|
export async function workingFolderGuidance(event, context, folder) {
|
|
858
860
|
if (folder === undefined || event.event.type !== "message.created" || event.event.scheduledToDoId !== undefined)
|
|
859
861
|
return "";
|
|
860
|
-
if (event.stream.isAgentChat &&
|
|
862
|
+
if (event.stream.isAgentChat && runUsesOwnerPath(context.trust))
|
|
861
863
|
return "";
|
|
862
864
|
let entries;
|
|
863
865
|
try {
|
|
@@ -78,8 +78,8 @@ export class AcpAdapter {
|
|
|
78
78
|
if (signal.aborted) {
|
|
79
79
|
return { status: "aborted" };
|
|
80
80
|
}
|
|
81
|
-
if (context.trust.runType
|
|
82
|
-
return { status: "failed", error: { code: "teammate_sandbox_unavailable", message: "This agent only
|
|
81
|
+
if (context.trust.runType === "untrusted")
|
|
82
|
+
return { status: "failed", error: { code: "teammate_sandbox_unavailable", message: "This agent can only take requests from people you trust." } };
|
|
83
83
|
const cwd = context.workingDirectory ?? this.#cwd;
|
|
84
84
|
const runtime = this.#runtime ?? new AcpStdioRuntime({ config: this.#config, cwd });
|
|
85
85
|
let bridge;
|
|
@@ -65,9 +65,10 @@ export type ClaudeQueryInput = {
|
|
|
65
65
|
pathToClaudeCodeExecutable?: string;
|
|
66
66
|
nativeOwnerRun?: () => boolean;
|
|
67
67
|
teammateOptions?: ReturnType<typeof claudeTeammateOptions>;
|
|
68
|
+
blockOwnerAccounts?: boolean;
|
|
68
69
|
};
|
|
69
70
|
export declare const claudeConnectorManagedSettings: Settings;
|
|
70
|
-
export declare const claudeTeammateManagedPolicyReason = "A managed Claude policy blocks
|
|
71
|
+
export declare const claudeTeammateManagedPolicyReason = "A managed Claude policy blocks requests from people you haven't trusted yet.";
|
|
71
72
|
export declare const claudeTeammateManagedPolicyCode = "claude_teammate_managed_policy";
|
|
72
73
|
export declare const claudeTeammateSettingsUnavailableCode = "claude_teammate_settings_unavailable";
|
|
73
74
|
/**
|
|
@@ -109,7 +110,7 @@ export type ClaudeModelListerInput = {
|
|
|
109
110
|
cwd: string;
|
|
110
111
|
pathToClaudeCodeExecutable?: string;
|
|
111
112
|
signal: AbortSignal;
|
|
112
|
-
/** A probe started while serving
|
|
113
|
+
/** A probe started while serving an untrusted run must not load project MCP servers. */
|
|
113
114
|
teammateMcpIsolation?: true;
|
|
114
115
|
};
|
|
115
116
|
export type ClaudeModelLister = (input: ClaudeModelListerInput) => Promise<ModelInfo[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shortStepName } from "../../step-names.js";
|
|
1
|
+
import { backgroundJobName, shortStepName } from "../../step-names.js";
|
|
2
2
|
import { isWithin } from "../../command-boundaries.js";
|
|
3
3
|
import { nativeCanonicalPath } from "../../run-folders.js";
|
|
4
4
|
import { resolveSettings } from "@anthropic-ai/claude-agent-sdk";
|
|
@@ -9,7 +9,7 @@ import { getTeammateToolchain, teammateCredentialPaths, teammateEscapeInstructio
|
|
|
9
9
|
import { claudeTeammateStateDirectory } from "../../storage.js";
|
|
10
10
|
import { createTeammateHome, removeTeammateHome } from "../../teammate-homes.js";
|
|
11
11
|
import { claudeOwnerSettings, claudeRulePath, claudeTeammateOptions } from "./claude-sandbox.js";
|
|
12
|
-
import { runStartedByOwner } from "../../run-type.js";
|
|
12
|
+
import { runStartedByOwner, runUsesOwnerPath } from "../../run-type.js";
|
|
13
13
|
import { runClaudeCloudSetup } from "./claude-cloud-setup.js";
|
|
14
14
|
import { renameClaudeProfileSession, resolveClaudeProfileSettings } from "./claude-profile-api.js";
|
|
15
15
|
import { claudeLimitName, claudePlanUsage, planLimitNotice } from "../../plan-usage.js";
|
|
@@ -49,7 +49,7 @@ export const claudeConnectorManagedSettings = {
|
|
|
49
49
|
permissions: { allow: ["mcp__showrunner__*"] },
|
|
50
50
|
bashEditDiffEnabled: true,
|
|
51
51
|
};
|
|
52
|
-
export const claudeTeammateManagedPolicyReason = "A managed Claude policy blocks
|
|
52
|
+
export const claudeTeammateManagedPolicyReason = "A managed Claude policy blocks requests from people you haven't trusted yet.";
|
|
53
53
|
export const claudeTeammateManagedPolicyCode = "claude_teammate_managed_policy";
|
|
54
54
|
export const claudeTeammateSettingsUnavailableCode = "claude_teammate_settings_unavailable";
|
|
55
55
|
/**
|
|
@@ -275,10 +275,9 @@ export class ClaudeAdapter {
|
|
|
275
275
|
if (signal.aborted)
|
|
276
276
|
return { status: "aborted" };
|
|
277
277
|
const cwd = context.workingDirectory ?? this.#cwd;
|
|
278
|
-
let ownerDomains;
|
|
279
278
|
let projectEnvironment;
|
|
280
279
|
let restrictions;
|
|
281
|
-
if (!
|
|
280
|
+
if (!runUsesOwnerPath(context.trust)) {
|
|
282
281
|
const owner = await Promise.resolve().then(() => claudeOwnerSettings(cwd, this.#resolveSettings)).then(value => ({ type: "ready", value }), (error) => ({ type: "unavailable", reason: String(error) }));
|
|
283
282
|
if (owner.type === "unavailable") {
|
|
284
283
|
context.logger.warn("claude.teammate_settings_unavailable", { reason: owner.reason, source: "owner_settings" });
|
|
@@ -289,7 +288,6 @@ export class ClaudeAdapter {
|
|
|
289
288
|
return { status: "failed", failureAsStatus: true, error: { code: claudeTeammateManagedPolicyCode,
|
|
290
289
|
message: claudeTeammateManagedPolicyReason } };
|
|
291
290
|
}
|
|
292
|
-
ownerDomains = owner.value.domains;
|
|
293
291
|
projectEnvironment = owner.value.projectEnvironment;
|
|
294
292
|
restrictions = owner.value.restrictions;
|
|
295
293
|
}
|
|
@@ -306,16 +304,16 @@ export class ClaudeAdapter {
|
|
|
306
304
|
context.completionRequirements ??= new CompletionRequirements();
|
|
307
305
|
context.client.completionRequirements = context.completionRequirements;
|
|
308
306
|
const sessionKey = JSON.stringify([context.installationId, context.sessionId, cwd, context.allowedFolders ?? [],
|
|
309
|
-
!
|
|
310
|
-
...(!
|
|
311
|
-
if ((context.freshProviderSession || !
|
|
307
|
+
!runUsesOwnerPath(context.trust), context.trust.runType,
|
|
308
|
+
...(!runUsesOwnerPath(context.trust) ? [context.invocationId] : [])]);
|
|
309
|
+
if ((context.freshProviderSession || !runUsesOwnerPath(context.trust)) && continuation === undefined)
|
|
312
310
|
await this.forceStop(event);
|
|
313
311
|
let connection = this.#sessions.get(sessionKey);
|
|
314
312
|
if (connection?.iterator.ended) {
|
|
315
313
|
this.#sessions.delete(sessionKey);
|
|
316
314
|
connection = undefined;
|
|
317
315
|
}
|
|
318
|
-
const expectedPermissionMode = claudePermissionMode(context.approvalMode,
|
|
316
|
+
const expectedPermissionMode = claudePermissionMode(context.approvalMode, runUsesOwnerPath(context.trust) && context.ownerFullAccess === true);
|
|
319
317
|
if (connection !== undefined && connection.permissionMode !== expectedPermissionMode) {
|
|
320
318
|
if (connection.session.setPermissionMode === undefined) {
|
|
321
319
|
await this.forceStop(event);
|
|
@@ -338,7 +336,7 @@ export class ClaudeAdapter {
|
|
|
338
336
|
controller,
|
|
339
337
|
cli: () => connection?.iterator,
|
|
340
338
|
session: () => activeSession,
|
|
341
|
-
owner:
|
|
339
|
+
owner: runUsesOwnerPath(context.trust),
|
|
342
340
|
logger: context.logger,
|
|
343
341
|
approvalMode: context.approvalMode ?? "ask",
|
|
344
342
|
permissionMode: () => permissionMode,
|
|
@@ -370,7 +368,7 @@ export class ClaudeAdapter {
|
|
|
370
368
|
let sessionId = connection?.sessionId ?? context.externalSessionId ?? undefined;
|
|
371
369
|
const resumed = sessionId !== undefined;
|
|
372
370
|
let activeSession = connection?.session;
|
|
373
|
-
const providerPermissionMode = () => claudePermissionMode(context.approvalMode,
|
|
371
|
+
const providerPermissionMode = () => claudePermissionMode(context.approvalMode, runUsesOwnerPath(context.trust) && context.ownerFullAccess === true);
|
|
374
372
|
let permissionMode = providerPermissionMode();
|
|
375
373
|
let shellCwd;
|
|
376
374
|
const title = providerSessionTitle(event);
|
|
@@ -383,7 +381,7 @@ export class ClaudeAdapter {
|
|
|
383
381
|
return;
|
|
384
382
|
}
|
|
385
383
|
modelFallbackChecked = true;
|
|
386
|
-
const options = await this.#listModelsForRun(signal, !
|
|
384
|
+
const options = await this.#listModelsForRun(signal, !runUsesOwnerPath(context.trust)).catch(() => null);
|
|
387
385
|
// A listed choice is one the CLI resolves itself, such as a plan-mode or long-context variant.
|
|
388
386
|
if (options?.some(option => option.id.toLowerCase() === requested.toLowerCase())) {
|
|
389
387
|
await context.client.reportModel(resolved);
|
|
@@ -405,6 +403,8 @@ export class ClaudeAdapter {
|
|
|
405
403
|
const progressActivities = new Map();
|
|
406
404
|
// Keyed by CLI task id; the CLI wakes the model in this same session when one finishes.
|
|
407
405
|
const backgroundActivities = new Map();
|
|
406
|
+
// The CLI names a shell the agent didn't describe by its raw command, which is named like a command.
|
|
407
|
+
const undescribedBackgroundCommands = new Set();
|
|
408
408
|
const settleBackgroundActivities = async (live, outcome) => {
|
|
409
409
|
for (const [taskId, activityId] of backgroundActivities) {
|
|
410
410
|
if (live.has(taskId))
|
|
@@ -420,7 +420,8 @@ export class ClaudeAdapter {
|
|
|
420
420
|
continue;
|
|
421
421
|
const activityId = providerResourceId("claude-background", `${context.invocationId}:${task.taskId}`);
|
|
422
422
|
backgroundActivities.set(task.taskId, activityId);
|
|
423
|
-
|
|
423
|
+
const name = undescribedBackgroundCommands.has(task.description.trim()) ? backgroundJobName(task.description) : shortStepName(task.description);
|
|
424
|
+
await context.client.startActivity({ activityId, label: name || "Background job", type: "background" });
|
|
424
425
|
}
|
|
425
426
|
};
|
|
426
427
|
const unsubscribeBackgroundStop = context.onBackgroundJobStop?.(async (backgroundJobId) => {
|
|
@@ -567,7 +568,7 @@ export class ClaudeAdapter {
|
|
|
567
568
|
context.logger.warn("claude.interrupt_settlement_failed", { error: String(error) });
|
|
568
569
|
}
|
|
569
570
|
};
|
|
570
|
-
//
|
|
571
|
+
// An untrusted run's Claude config folder, removed when the run ends.
|
|
571
572
|
let teammateHome;
|
|
572
573
|
try {
|
|
573
574
|
chatRuns.add(run);
|
|
@@ -576,9 +577,9 @@ export class ClaudeAdapter {
|
|
|
576
577
|
if (connection === undefined)
|
|
577
578
|
permissionMode = providerPermissionMode();
|
|
578
579
|
const reasoningEffort = claudeReasoningEffort(context.reasoningEffort);
|
|
579
|
-
const teammateOptions = context.trust.runType
|
|
580
|
-
runType:
|
|
581
|
-
get mode() { return context.approvalMode; }, cwd,
|
|
580
|
+
const teammateOptions = context.trust.runType !== "untrusted" ? undefined : claudeTeammateOptions({
|
|
581
|
+
runType: "untrusted", configDirectory: teammateHome = createTeammateHome(claudeTeammateStateDirectory),
|
|
582
|
+
get mode() { return context.approvalMode; }, cwd, projectEnvironment, restrictions,
|
|
582
583
|
environment: this.#environment,
|
|
583
584
|
credentialPaths: this.#teammateCredentialPaths,
|
|
584
585
|
allowedFolders: context.allowedFolders,
|
|
@@ -587,7 +588,7 @@ export class ClaudeAdapter {
|
|
|
587
588
|
},
|
|
588
589
|
folders: [invocationDownloadDirectory(context), ...(context.outputDirectory === undefined ? [] : [context.outputDirectory.path])],
|
|
589
590
|
});
|
|
590
|
-
//
|
|
591
|
+
// An untrusted run's sessions and saved tool output live in its own config folder, not the connector's.
|
|
591
592
|
const teammateConfigDir = teammateOptions?.env?.CLAUDE_CONFIG_DIR;
|
|
592
593
|
const queryInput = {
|
|
593
594
|
environment: this.#environment,
|
|
@@ -600,10 +601,11 @@ export class ClaudeAdapter {
|
|
|
600
601
|
...(context.model === null ? {} : { model: context.model }),
|
|
601
602
|
...(reasoningEffort === undefined ? {} : { reasoningEffort }),
|
|
602
603
|
signal: controller.signal,
|
|
603
|
-
nativeOwnerRun: () =>
|
|
604
|
+
nativeOwnerRun: () => runUsesOwnerPath(context.trust),
|
|
605
|
+
blockOwnerAccounts: !runStartedByOwner(context.trust),
|
|
604
606
|
permissionMode: providerPermissionMode(),
|
|
605
|
-
appendSystemPrompt: `${describeVocabulary()}\n\n${claudeBackgroundWorkGuidance}${
|
|
606
|
-
`\n\n${teammateEscapeInstruction(
|
|
607
|
+
appendSystemPrompt: `${describeVocabulary()}\n\n${claudeBackgroundWorkGuidance}${runUsesOwnerPath(context.trust) ? "" :
|
|
608
|
+
`\n\n${teammateEscapeInstruction("claude")}`}`,
|
|
607
609
|
...(teammateOptions === undefined ? {} : { teammateOptions }),
|
|
608
610
|
...(this.#pathToClaudeCodeExecutable === undefined ? {} : {
|
|
609
611
|
pathToClaudeCodeExecutable: this.#pathToClaudeCodeExecutable,
|
|
@@ -631,7 +633,7 @@ export class ClaudeAdapter {
|
|
|
631
633
|
// The owner started the run that saves the agent's own wake link, so that needs no approval.
|
|
632
634
|
if (name !== undefined || toolName === claudeWakeLinkTool || isClaudeAgentSpawn(toolName))
|
|
633
635
|
return true;
|
|
634
|
-
const allowedFolder =
|
|
636
|
+
const allowedFolder = runUsesOwnerPath(context.trust) ? undefined : claudeAllowedFolder(providerOptions, { toolName, input, workspaceRoot: cwd, cwd: shellCwd });
|
|
635
637
|
const result = await approve({ toolName, input, toolUseId, sessionId, providerAsked, providerRequestId: providerOptions?.requestId, providerReason: providerOptions?.decisionReason, workspaceRoot: cwd, ...(shellCwd === undefined ? {} : { cwd: shellCwd }),
|
|
636
638
|
...(teammateConfigDir === undefined ? {} : { configDir: teammateConfigDir }),
|
|
637
639
|
...(allowedFolder === undefined ? {} : { allowedFolder }),
|
|
@@ -717,7 +719,7 @@ export class ClaudeAdapter {
|
|
|
717
719
|
setWakeLink: async (...args) => { await binding.ready; controller.signal.throwIfAborted(); return binding.current.setWakeLink(...args); },
|
|
718
720
|
});
|
|
719
721
|
connection = { session, iterator: new ClaudeSessionStream(session.events, () => session.endInput?.()), controller, binding, tasks: [],
|
|
720
|
-
owner:
|
|
722
|
+
owner: runUsesOwnerPath(context.trust), logger: context.logger, permissionMode, requestedModel: context.model,
|
|
721
723
|
...(reasoningEffort === undefined ? {} : { requestedEffort: reasoningEffort }) };
|
|
722
724
|
connection.iterator.observer = observeSessionEvent;
|
|
723
725
|
}
|
|
@@ -842,6 +844,11 @@ export class ClaudeAdapter {
|
|
|
842
844
|
else if (item.type === "file.edit.started") {
|
|
843
845
|
if (item.name === "Bash")
|
|
844
846
|
bashFileChanges.start(item.toolUseId);
|
|
847
|
+
// A foreground command can move to the background later, so every undescribed one is kept.
|
|
848
|
+
if (item.name === "Bash" && typeof item.input.command === "string" &&
|
|
849
|
+
(typeof item.input.description !== "string" || item.input.description.trim().length === 0)) {
|
|
850
|
+
undescribedBackgroundCommands.add(item.input.command.trim());
|
|
851
|
+
}
|
|
845
852
|
changedFiles.startClaude(item.toolUseId, item.name, item.input);
|
|
846
853
|
}
|
|
847
854
|
else if (item.type === "file.edit.completed") {
|
|
@@ -1054,7 +1061,7 @@ export class ClaudeAdapter {
|
|
|
1054
1061
|
// Renaming appends to the session's transcript, so it waits until the CLI has finished
|
|
1055
1062
|
// this turn's writes, but the turn doesn't wait on it. A new session already started
|
|
1056
1063
|
// under this title.
|
|
1057
|
-
// The SDK renames only sessions in the connector's own config folder, so
|
|
1064
|
+
// The SDK renames only sessions in the connector's own config folder, so an untrusted session
|
|
1058
1065
|
// keeps its first title.
|
|
1059
1066
|
const renamedSessionId = sessionId;
|
|
1060
1067
|
void applyProviderSessionTitle(context.state, context.logger, renamedSessionId, title, resumed && teammateConfigDir === undefined ? (next) => this.#renameSession(renamedSessionId, next, cwd) : () => Promise.resolve());
|
|
@@ -1113,8 +1120,8 @@ export class ClaudeAdapter {
|
|
|
1113
1120
|
signal.removeEventListener("abort", stop);
|
|
1114
1121
|
clearTimeout(stopTimer);
|
|
1115
1122
|
if (connection !== undefined) {
|
|
1116
|
-
//
|
|
1117
|
-
if (
|
|
1123
|
+
// A run that started untrusted lives in its own config folder, removed below, so it is never kept.
|
|
1124
|
+
if (teammateHome !== undefined)
|
|
1118
1125
|
retained = false;
|
|
1119
1126
|
if (retained) {
|
|
1120
1127
|
connection.permissionMode = permissionMode;
|
|
@@ -1641,7 +1648,7 @@ export const defaultClaudeQuery = (input, query = sdkQuery, now = Date.now, envi
|
|
|
1641
1648
|
append: input.appendSystemPrompt,
|
|
1642
1649
|
},
|
|
1643
1650
|
managedSettings: claudeConnectorManagedSettings,
|
|
1644
|
-
disallowedTools: [claudeHiddenConnectorTools, ...claudeSchedulingTools],
|
|
1651
|
+
disallowedTools: [claudeHiddenConnectorTools, ...claudeSchedulingTools, ...(input.blockOwnerAccounts === true ? ["mcp__claude_ai_*"] : [])],
|
|
1645
1652
|
...(input.teammateOptions === undefined ? {} : {
|
|
1646
1653
|
...input.teammateOptions,
|
|
1647
1654
|
env: claudeSessionEnvironment(input.teammateOptions.env ?? {}),
|
|
@@ -3,11 +3,11 @@ import os from "node:os";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { providerResourceId, consequenceFor, hostToolEffectIdentity, invocationRunScope, rememberTeammateApproval, requestHostToolApproval } from "../../adapter.js";
|
|
5
5
|
import { nativeCanonicalPath, pathLeavesRunScope } from "../../run-folders.js";
|
|
6
|
-
import { isOwnerAccountMcpTool,
|
|
6
|
+
import { isOwnerAccountMcpTool, runUsesOwnerPath } from "../../run-type.js";
|
|
7
7
|
import { claudeArtifactApproval, claudeRoutineApproval } from "./claude-artifact-tools.js";
|
|
8
8
|
import { claudeWakeLinkTool, showrunnerToolName } from "./claude-message-mapper.js";
|
|
9
9
|
export async function handleClaudePermissionResult(request, context, signal) {
|
|
10
|
-
const hostRequest = { ...claudeHostRequest(request), origin:
|
|
10
|
+
const hostRequest = { ...claudeHostRequest(request), origin: runUsesOwnerPath(context.trust) ? "provider_ask"
|
|
11
11
|
: isOwnerAccountMcpTool(request.toolName) ? "owner_account"
|
|
12
12
|
: claudeCallLeavesRunScope(request, context) ? "outside_project"
|
|
13
13
|
: request.toolName === "Bash" && request.input?.dangerouslyDisableSandbox === true ? "sandbox_escape"
|
|
@@ -78,7 +78,7 @@ const claudeReadTools = new Set(["read", "glob", "grep", "ls", "notebookread"]);
|
|
|
78
78
|
* A tool from the owner's own account or MCP config (isOwnerAccountMcpTool) always reaches beyond them.
|
|
79
79
|
*/
|
|
80
80
|
export function claudeCallLeavesRunScope(request, context) {
|
|
81
|
-
if (
|
|
81
|
+
if (runUsesOwnerPath(context.trust) || claudeInternalTools.has(request.toolName) ||
|
|
82
82
|
showrunnerToolName(request.toolName) !== undefined || request.toolName === claudeWakeLinkTool)
|
|
83
83
|
return false;
|
|
84
84
|
if (isOwnerAccountMcpTool(request.toolName))
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { resolveSettings, type Options, type Settings } from "@anthropic-ai/claude-agent-sdk";
|
|
2
2
|
import { type AllowedFolder, type TeammateToolchain } from "../../teammate-sandbox.js";
|
|
3
|
-
import type { RunType } from "../../run-type.js";
|
|
4
3
|
/** Preserve the connector's Claude provider and account selection without restoring its unrelated environment. */
|
|
5
4
|
export declare function claudeIdentityEnvironment(environment: NodeJS.ProcessEnv): Record<string, string>;
|
|
6
5
|
export declare function claudeTeammateOptions(input: {
|
|
7
|
-
runType:
|
|
6
|
+
runType: "untrusted";
|
|
8
7
|
configDirectory: string;
|
|
9
8
|
mode?: "ask" | "auto";
|
|
10
9
|
cwd: string;
|
|
11
10
|
folders: string[];
|
|
12
11
|
allowedFolders?: readonly AllowedFolder[];
|
|
13
12
|
runAllowedFolders?: readonly AllowedFolder[];
|
|
14
|
-
ownerDomains?: string[];
|
|
15
13
|
toolchain?: TeammateToolchain;
|
|
16
14
|
environment?: NodeJS.ProcessEnv;
|
|
17
15
|
credentialPaths?: readonly string[];
|
|
@@ -30,12 +28,10 @@ export declare function claudeRulePath(file: string, behavior: "allow"): string
|
|
|
30
28
|
/** Public operating-system and developer-tool files needed by commands inside a root-denied sandbox. */
|
|
31
29
|
export declare function claudeRuntimeReadPaths(platform?: NodeJS.Platform): string[];
|
|
32
30
|
/**
|
|
33
|
-
* The
|
|
34
|
-
*
|
|
35
|
-
* teammate run cannot share a process with it.
|
|
31
|
+
* The variables the project's and local settings put in Claude Code's environment, and whether an admin settings tier
|
|
32
|
+
* is present: that tier can drop the sandbox and hook locks the connector passes, so an untrusted run cannot share a process with it.
|
|
36
33
|
*/
|
|
37
34
|
export declare function claudeOwnerSettings(cwd: string, resolve?: typeof resolveSettings): Promise<{
|
|
38
|
-
domains: string[] | undefined;
|
|
39
35
|
projectEnvironment: string[];
|
|
40
36
|
restrictions: Settings;
|
|
41
37
|
managedPolicy: boolean;
|
|
@@ -4,7 +4,6 @@ import { nativeTemporaryDirectory } from "../../native-sandbox-config.js";
|
|
|
4
4
|
import { nativeCanonicalPath } from "../../run-folders.js";
|
|
5
5
|
import { darwinBuildEntries, teammateCredentialPaths, teammateEnvironment, teammateAllowedFolders, getTeammateToolchain } from "../../teammate-sandbox.js";
|
|
6
6
|
import { claudeTeammateEnvironment } from "./claude-teammate-home.js";
|
|
7
|
-
const localHosts = ["localhost", "127.0.0.1", "::1"];
|
|
8
7
|
const claudeIdentityVariables = new Set([
|
|
9
8
|
"CLAUDE_CONFIG_DIR", "CLAUDE_SECURESTORAGE_CONFIG_DIR", "CLAUDE_SESSION_INGRESS_TOKEN_FILE",
|
|
10
9
|
"CLAUDE_CODE_OAUTH_TOKEN", "CLAUDE_CODE_SESSION_ACCESS_TOKEN",
|
|
@@ -38,10 +37,9 @@ export function claudeTeammateOptions(input) {
|
|
|
38
37
|
const darwin = toolchain.darwinUserDirectories;
|
|
39
38
|
const buildWrites = [...(toolchain.buildCaches ?? []), ...(toolchain.derivedData === undefined ? [] : [toolchain.derivedData]), ...(darwin === undefined ? [] : claudeDarwinWrites(darwin))];
|
|
40
39
|
const credentialPaths = input.credentialPaths ?? teammateCredentialPaths(toolchain.home, environment, input.cwd);
|
|
41
|
-
const effectiveFolders = [...teammateAllowedFolders(input.allowedFolders ?? []
|
|
40
|
+
const effectiveFolders = [...teammateAllowedFolders(input.allowedFolders ?? []), ...input.runAllowedFolders ?? []];
|
|
42
41
|
const writableFolders = effectiveFolders.filter(folder => folder.access === "write").map(folder => folder.path);
|
|
43
42
|
const readOnlyFolders = effectiveFolders.filter(folder => folder.access === "read").map(folder => folder.path);
|
|
44
|
-
const trusted = input.runType === "trusted";
|
|
45
43
|
const sandbox = {
|
|
46
44
|
enabled: true, failIfUnavailable: true, autoAllowBashIfSandboxed: true, allowUnsandboxedCommands: false,
|
|
47
45
|
filesystem: {
|
|
@@ -59,8 +57,8 @@ export function claudeTeammateOptions(input) {
|
|
|
59
57
|
.map(name => ({ name, mode: "deny" })), ...input.restrictions?.sandbox?.credentials?.envVars ?? []],
|
|
60
58
|
},
|
|
61
59
|
// The provider cannot distinguish a port this run bound from an owner's existing loopback service.
|
|
62
|
-
network: { allowedDomains:
|
|
63
|
-
allowLocalBinding:
|
|
60
|
+
network: { allowedDomains: [],
|
|
61
|
+
allowLocalBinding: false,
|
|
64
62
|
// Chrome's single-instance socket lives in the box scratch folder.
|
|
65
63
|
allowUnixSockets: [scratch],
|
|
66
64
|
...(input.restrictions?.sandbox?.network?.deniedDomains === undefined ? {}
|
|
@@ -74,7 +72,7 @@ export function claudeTeammateOptions(input) {
|
|
|
74
72
|
const nativeAllows = ["mcp__showrunner__*", ...readOnlyFolders.flatMap(folder => {
|
|
75
73
|
const rulePath = claudeRulePath(folder, "allow");
|
|
76
74
|
return rulePath === undefined ? [] : [`Read(${rulePath}/**)`];
|
|
77
|
-
})
|
|
75
|
+
})];
|
|
78
76
|
const claudeMdExcludes = ["**/CLAUDE.local.md", ...claudeInstructionsAbove(input.cwd)];
|
|
79
77
|
return {
|
|
80
78
|
// Project instructions load natively. Project and local permission grants do not; their restrictions are copied
|
|
@@ -146,15 +144,13 @@ function claudeDarwinWrites(directories) {
|
|
|
146
144
|
return [...entries.caches, `${entries.replacementItems}/${entries.replacementPrefix}**`, `${directories.temp}/${entries.scratchPrefix}**`];
|
|
147
145
|
}
|
|
148
146
|
/**
|
|
149
|
-
* The
|
|
150
|
-
*
|
|
151
|
-
* teammate run cannot share a process with it.
|
|
147
|
+
* The variables the project's and local settings put in Claude Code's environment, and whether an admin settings tier
|
|
148
|
+
* is present: that tier can drop the sandbox and hook locks the connector passes, so an untrusted run cannot share a process with it.
|
|
152
149
|
*/
|
|
153
150
|
export async function claudeOwnerSettings(cwd, resolve = resolveSettings) {
|
|
154
|
-
const {
|
|
151
|
+
const { sources } = await resolve({ cwd, settingSources: ["user"] });
|
|
155
152
|
const project = await resolve({ cwd, settingSources: ["project", "local"] });
|
|
156
|
-
return {
|
|
157
|
-
projectEnvironment: Object.keys(project.effective.env ?? {}),
|
|
153
|
+
return { projectEnvironment: Object.keys(project.effective.env ?? {}),
|
|
158
154
|
restrictions: claudeRestrictions(project.effective),
|
|
159
155
|
managedPolicy: sources.some(source => source.source === "managed" && Object.keys(source.settings).length > 0) };
|
|
160
156
|
}
|