Skip to content

chore: refined tool types and eslint config#58

Merged
Patrik Simek (patriksimek) merged 1 commit intomainfrom
bump-version-6
Apr 25, 2026
Merged

chore: refined tool types and eslint config#58
Patrik Simek (patriksimek) merged 1 commit intomainfrom
bump-version-6

Conversation

@patriksimek
Copy link
Copy Markdown
Member

@patriksimek Patrik Simek (patriksimek) commented Apr 25, 2026

Tightens types across the harness-agnostic tool definitions and irons out a few small ESLint / test issues that fell out of recent refactors.

Copilot AI review requested due to automatic review settings April 25, 2026 20:24
@patriksimek Patrik Simek (patriksimek) requested a review from a team as a code owner April 25, 2026 20:24
@patriksimek Patrik Simek (patriksimek) added the no-production-impact This PR is not impacting production and does not require a JIRA ticket label Apr 25, 2026
@patriksimek Patrik Simek (patriksimek) merged commit 1b34add into main Apr 25, 2026
6 checks passed
@patriksimek Patrik Simek (patriksimek) deleted the bump-version-6 branch April 25, 2026 20:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines the SDK’s tool typing and schema definitions, updates multiple endpoint tool modules to explicitly type their exported tools arrays, and adjusts linting/test configuration to better cover Jest spec files.

Changes:

  • Expanded JSONSchema typing (e.g., patternProperties) and tightened several endpoint response/value types to JSONValue.
  • Standardized many endpoint *.tools.ts exports to export const tools: MakeTool[] = [...] and updated a few tool metadata fields (scopeId/identifier/resourceId) and schemas (oneOf).
  • Updated Jest/ESLint config to include *.spec.ts and bumped package version to 1.4.0.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/mcp.spec.ts Refactors validations (scope checks, duplicate names reporting) and expands naming convention assertions.
src/tools.ts Extends JSONSchema and adjusts the MakeTool.execute type/signature contract.
src/endpoints/users.tools.ts Types exported tools as MakeTool[].
src/endpoints/teams.tools.ts Types exported tools as MakeTool[].
src/endpoints/sdk/webhooks.tools.ts Types exported tools as MakeTool[].
src/endpoints/sdk/rpcs.ts Tightens test() return type to JSONValue.
src/endpoints/sdk/rpcs.tools.ts Types exported tools as MakeTool[].
src/endpoints/sdk/modules.tools.ts Types exported tools as MakeTool[].
src/endpoints/sdk/functions.tools.ts Types exported tools as MakeTool[].
src/endpoints/sdk/connections.tools.ts Types exported tools as MakeTool[].
src/endpoints/sdk/apps.ts Refines SDKApp.changes element type to JSON-shaped records.
src/endpoints/sdk/apps.tools.ts Types exported tools as MakeTool[].
src/endpoints/scenarios.ts Refines scenario fields (customProperties, outputs) to JSONValue-based types.
src/endpoints/scenarios.tools.ts Types exported tools as MakeTool[].
src/endpoints/public-templates.tools.ts Adjusts tool metadata fields (scopeId/identifier) and resource targeting.
src/endpoints/organizations.ts Refines features to Record<string, JSONValue> and updates imports.
src/endpoints/organizations.tools.ts Types exported tools as MakeTool[].
src/endpoints/keys.tools.ts Types exported tools as MakeTool[].
src/endpoints/incomplete-executions.tools.ts Types exported tools as MakeTool[].
src/endpoints/hooks.tools.ts Types exported tools as MakeTool[].
src/endpoints/functions.tools.ts Types exported tools as MakeTool[].
src/endpoints/folders.tools.ts Types exported tools as MakeTool[].
src/endpoints/executions.tools.ts Types exported tools as MakeTool[].
src/endpoints/enums.tools.ts Types exported tools as MakeTool[].
src/endpoints/devices.tools.ts Types exported tools as MakeTool[].
src/endpoints/data-structures.tools.ts Types exported tools as MakeTool[].
src/endpoints/data-stores.tools.ts Types exported tools as MakeTool[].
src/endpoints/data-store-records.tools.ts Types exported tools as MakeTool[].
src/endpoints/credential-requests.tools.ts Types exported tools as MakeTool[], refines schema union typing (oneOf), and adjusts id fields.
src/endpoints/connections.tools.ts Types exported tools as MakeTool[].
package.json Bumps package version to 1.4.0.
package-lock.json Updates lockfile package version to 1.4.0.
eslint.config.mjs Enables Jest lint rules for *.spec.ts in addition to *.test.ts.
Comments suppressed due to low confidence (1)

src/endpoints/sdk/rpcs.ts:155

  • FetchFunction defaults its generic to unknown, so calling this.#fetch(...) without a type argument returns Promise<unknown>, which won’t satisfy the new Promise<JSONValue> return type. Pass a type parameter (e.g. this.#fetch<JSONValue>(...)) or cast the result to JSONValue so this compiles under strict typing.
    async test(appName: string, appVersion: number, rpcName: string, body: TestSDKRPCBody): Promise<JSONValue> {
        return await this.#fetch(`/sdk/apps/${appName}/${appVersion}/rpcs/${rpcName}`, {
            method: 'POST',
            body,
        });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/mcp.spec.ts
Comment on lines +108 to 111
// SDK categories should start with "sdk."
MakeTools.filter(tool => tool.name.startsWith('sdk_')).forEach(tool => {
expect(tool.category).toMatch(/^sdk\./);
});
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK-category assertion here is both mismatched with the current SDK tool naming and currently ineffective: SDK tool names use the sdk- prefix (e.g. sdk-apps_list), so filtering by name.startsWith('sdk_') yields an empty set, and the ^sdk\. expectation doesn’t match existing categories like sdk-apps. Consider filtering by tool.category.startsWith('sdk-') (or tool.name.startsWith('sdk-')) and asserting the sdk- prefix, or update the actual categories to sdk.* consistently if that’s the intended convention.

Copilot uses AI. Check for mistakes.
Comment thread src/tools.ts
Comment on lines 181 to 183
*/
execute: (make: Make, args?: Record<string, JSONValue>) => Promise<JSONValue>;
execute(make: Make, args: Record<string, JSONValue>): Promise<JSONValue>;
};
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing MakeTool.execute to require args is a breaking API change for any tool runner that previously called execute(make) for tools with empty inputSchema (and it forces callers to always pass an object even when no args exist). If backward compatibility is desired, consider keeping args optional (or giving it a default {}) while still allowing tools with required inputs to enforce required keys via their own arg types.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 13
category: 'public-templates',
scope: 'templates:read',
scopeId: undefined,
identifier: undefined,
annotations: {
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is now being updated, but unlike the other *.tools.ts modules it still exports an untyped tools array (no MakeTool[] annotation). That makes it easier for tool objects here to drift from the MakeTool contract without TypeScript catching it. Consider importing MakeTool and declaring export const tools: MakeTool[] = [...] for consistency with the rest of src/endpoints/*/*.tools.ts.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-production-impact This PR is not impacting production and does not require a JIRA ticket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants