@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 940 B
JavaScript
export function narrowContext(ctx, ids) {
const narrowed = {
cwd: ctx.cwd,
agentDir: ctx.agentDir,
mode: ctx.mode,
toolCallId: ids.toolCallId,
projectTrusted: ctx.isProjectTrusted(),
};
if (ids.sessionId !== undefined)
narrowed.sessionId = ids.sessionId;
if (ctx.model !== undefined)
narrowed.model = { provider: ctx.model.provider, id: ctx.model.id };
if (ctx.thinkingLevel !== undefined)
narrowed.thinkingLevel = ctx.thinkingLevel;
if (ctx.serviceTier !== undefined)
narrowed.serviceTier = ctx.serviceTier;
if (ctx.browserEngine !== undefined)
narrowed.browserEngine = ctx.browserEngine;
if (ctx.sessionEnv !== undefined)
narrowed.sessionEnv = { ...ctx.sessionEnv };
if (ctx.goalStoreFile !== undefined)
narrowed.goalStoreFile = ctx.goalStoreFile;
return narrowed;
}
//# sourceMappingURL=context.js.map