Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,890 changes: 4,426 additions & 5,464 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 5 additions & 14 deletions src/agent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,7 @@ if (cli.tune) {
* - alternative_rejected: records an approach that was considered but not taken
*/
type TuneCategory =
| "decision"
| "concern"
| "constraint"
| "alternative_rejected";
"decision" | "concern" | "constraint" | "alternative_rejected";

const TUNE_CATEGORIES = new Set<string>([
"decision",
Expand Down Expand Up @@ -1181,10 +1178,7 @@ const state = createAgentState(cli, {
// Wire CLI --reasoning-effort <level> to state.reasoningEffort
if (cli.reasoningEffort) {
state.reasoningEffort = cli.reasoningEffort as
| "low"
| "medium"
| "high"
| "xhigh";
"low" | "medium" | "high" | "xhigh";
state.sessionNeedsRebuild = true;
}

Expand Down Expand Up @@ -5893,8 +5887,7 @@ const generateSkillTool = defineTool("generate_skill", {
// Optionally save a companion module (delegated to register_module
// so we get the same validation pipeline + sandbox cache update).
let moduleResult:
| { name: string; importAs: string; sizeBytes?: number }
| undefined;
{ name: string; importAs: string; sizeBytes?: number } | undefined;
if (params.companionModule) {
const m = params.companionModule;
const moduleSaveResult = (await registerModuleImpl({
Expand Down Expand Up @@ -6238,8 +6231,7 @@ function buildSessionConfig() {
// tags instead of using the native Rust parseHtml() which is faster
// and more correct.
const args = toolInput.toolArgs as
| Record<string, unknown>
| undefined;
Record<string, unknown> | undefined;
const code =
typeof args?.code === "string"
? args.code
Expand Down Expand Up @@ -6968,8 +6960,7 @@ async function main(): Promise<void> {
// parameters is a raw JSON Schema object (Record<string, unknown>),
// not a ZodSchema — safe to access .type directly.
const params = executeJavascriptTool.parameters as
| Record<string, unknown>
| undefined;
Record<string, unknown> | undefined;
debugLog(`parameters.type = "${params?.type}"`);
}

Expand Down
6 changes: 2 additions & 4 deletions src/agent/mcp/plugin-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ function generateInputInterface(tool: MCPToolSchema): string | null {
if (!schema || typeof schema !== "object") return null;

const properties = (schema as Record<string, unknown>).properties as
| Record<string, Record<string, unknown>>
| undefined;
Record<string, Record<string, unknown>> | undefined;
if (!properties) return null;

const required = new Set(
Expand Down Expand Up @@ -262,8 +261,7 @@ function pascalCase(name: string): string {
*/
function extractParameterSummary(schema: Record<string, unknown>): string {
const properties = schema.properties as
| Record<string, Record<string, unknown>>
| undefined;
Record<string, Record<string, unknown>> | undefined;
if (!properties) return "(no parameters)";

const required = new Set((schema.required as string[]) ?? []);
Expand Down
3 changes: 1 addition & 2 deletions src/agent/mcp/setup-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1528,8 +1528,7 @@ function loadTokenFromCache(): string | undefined {
readFileSync(join(M365_TOKENS_DIR, file), "utf8"),
) as Record<string, unknown>;
const tokenMap = parsed.AccessToken as
| Record<string, { secret?: string; expires_on?: string }>
| undefined;
Record<string, { secret?: string; expires_on?: string }> | undefined;
if (!tokenMap) continue;
for (const entry of Object.values(tokenMap)) {
if (typeof entry.secret !== "string") continue;
Expand Down
14 changes: 3 additions & 11 deletions src/agent/mcp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ export interface MCPStdioServerConfig extends MCPServerConfigBase {

/** Supported authentication methods for HTTP MCP servers. */
export type MCPAuthMethod =
| "oauth"
| "workload-identity"
| "client-credentials";
"oauth" | "workload-identity" | "client-credentials";

/**
* OAuth 2.0 user-delegated authentication via MSAL.
Expand Down Expand Up @@ -138,9 +136,7 @@ export interface MCPClientCredentialsConfig {

/** Discriminated union of all auth configurations. */
export type MCPAuthConfig =
| MCPOAuthConfig
| MCPWorkloadIdentityConfig
| MCPClientCredentialsConfig;
MCPOAuthConfig | MCPWorkloadIdentityConfig | MCPClientCredentialsConfig;

/**
* Configuration for an MCP server accessible over HTTP (Streamable HTTP).
Expand Down Expand Up @@ -234,11 +230,7 @@ export interface MCPToolSchema {

/** Connection state for an MCP server. */
export type MCPConnectionState =
| "idle"
| "connecting"
| "connected"
| "error"
| "closed";
"idle" | "connecting" | "connected" | "error" | "closed";

/** Runtime state for a single MCP server connection. */
export interface MCPConnection {
Expand Down
Loading
Loading