MCPcopy Index your code
hub / github.com/github/copilot-sdk / emitClientSessionHandlerMethod

Function emitClientSessionHandlerMethod

scripts/codegen/python.ts:3645–3673  ·  view source on GitHub ↗
(
    lines: string[],
    method: RpcMethod,
    resolveType: (name: string) => string,
    groupExperimental = false,
    groupDeprecated = false
)

Source from the content-addressed store, hash-verified

3643}
3644
3645function emitClientSessionHandlerMethod(
3646 lines: string[],
3647 method: RpcMethod,
3648 resolveType: (name: string) => string,
3649 groupExperimental = false,
3650 groupDeprecated = false
3651): void {
3652 const paramsType = resolveType(pythonParamsTypeName(method));
3653 const resultSchema = getMethodResultSchema(method);
3654 const nullableInner = resultSchema ? getNullableInner(resultSchema) : undefined;
3655 let resultType: string;
3656 if (nullableInner) {
3657 resultType = `${resolveType(pythonResultTypeName(method, nullableInner))} | None`;
3658 } else if (!isVoidSchema(resultSchema)) {
3659 resultType = resolveType(pythonResultTypeName(method));
3660 } else {
3661 resultType = "None";
3662 }
3663 const methodName = clientSessionHandlerMethodName(method.rpcMethod);
3664 lines.push(` async def ${methodName}(self, params: ${paramsType}) -> ${resultType}:`);
3665 pushPyRpcMethodDocstring(lines, " ", method, {
3666 paramsName: "params",
3667 paramsDescription: rpcParamsDescription(method, getMethodParamsSchema(method)),
3668 resultDescription: rpcResultDescription(method, resultSchema),
3669 deprecated: method.deprecated && !groupDeprecated,
3670 experimental: method.stability === "experimental" && !groupExperimental,
3671 });
3672 lines.push(` pass`);
3673}
3674
3675function emitClientSessionRegistrationMethod(
3676 lines: string[],

Calls 12

pythonParamsTypeNameFunction · 0.85
getNullableInnerFunction · 0.85
pythonResultTypeNameFunction · 0.85
isVoidSchemaFunction · 0.85
pushPyRpcMethodDocstringFunction · 0.85
resolveTypeFunction · 0.70
getMethodResultSchemaFunction · 0.70
rpcParamsDescriptionFunction · 0.70
getMethodParamsSchemaFunction · 0.70
rpcResultDescriptionFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…