MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / accessUrlLines

Function accessUrlLines

apps/kimi-code/src/cli/sub/server/access-urls.ts:62–85  ·  view source on GitHub ↗
(
  host: string,
  port: number,
  token: string | undefined,
  networkAddresses?: NetworkAddress[],
)

Source from the content-addressed store, hash-verified

60 * - specific host: a single `URL:` line.
61 */
62export function accessUrlLines(
63 host: string,
64 port: number,
65 token: string | undefined,
66 networkAddresses?: NetworkAddress[],
67): AccessUrlLine[] {
68 if (isWildcard(host)) {
69 const lines: AccessUrlLine[] = [
70 { label: 'Local: ', url: buildOpenableUrl(`http://localhost:${port}`, token) },
71 ];
72 const addrs = networkAddresses ?? listNetworkAddresses();
73 for (const addr of addrs) {
74 lines.push({
75 label: 'Network: ',
76 url: buildOpenableUrl(`http://${formatHostForUrl(addr.address, addr.family)}:${port}`, token),
77 });
78 }
79 return lines;
80 }
81 if (isLoopbackHost(host)) {
82 return [{ label: 'Local: ', url: buildOpenableUrl(hostOrigin(host, port), token) }];
83 }
84 return [{ label: 'URL: ', url: buildOpenableUrl(hostOrigin(host, port), token) }];
85}

Callers 3

formatReadyBannerFunction · 0.90
server.test.tsFile · 0.85

Calls 7

listNetworkAddressesFunction · 0.90
formatHostForUrlFunction · 0.90
buildOpenableUrlFunction · 0.85
hostOriginFunction · 0.85
isWildcardFunction · 0.70
isLoopbackHostFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected