@devries-cameron20 / composio-1 / commits / dcb60bde5
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

refactor(core): reuse isPlainObject from FileToolModifier.utils.neutral

`isPlainObject` was redefined in three places across the workspace (`utils/jsonSchema.ts`, `utils/modifiers/FileToolModifier.utils.neutral.ts`, `cli/src/services/run-helpers-runtime.ts`). Drop the new copy and import the existing one. CLI cleanup is left as a separate concern.

jkomyno committed Apr 30, 2026 at 01:52 UTC dcb60bde575ffac7e2bd539267f3dbbc06d5923c
1 file changed +1 -3
ts/packages/core/src/utils/jsonSchema.ts
+1 -3
@@ -1,6 +1,7 @@
1 import { z } from 'zod/v3';
2 import { JsonSchemaRefResolutionError, JsonSchemaToZodError } from '../errors';
3 import { jsonSchemaToZod } from '@composio/json-schema-to-zod';
4 +import { isPlainObject } from './modifiers/FileToolModifier.utils.neutral';
5
6 const MAX_REF_CHAIN_DEPTH = 100;
7 const MAX_NODE_DEPTH = 512;
@@ -41,9 +42,6 @@ const resolvePointer = (root: Record<string, unknown>, pointer: string): unknown
42 .reduce<unknown>((cursor, seg) => stepInto(cursor, seg, pointer), root);
43 };
44
44 -const isPlainObject = (value: unknown): value is Record<string, unknown> =>
45 - value !== null && typeof value === 'object' && !Array.isArray(value);
46 -
45 /**
46 * Inlines internal JSON Schema `$ref` pointers (`#/$defs/...` and the
47 * legacy `#/definitions/...`) so the returned schema can be safely handed